From 272bb6b5856a7f033e6826ba5a96b1ca52aabb12 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 12:46:38 +0500 Subject: Bug#27580 SPACE() function collation bug? Problem: when character_set_connection=utf8, mixing SPACE() with a non-Unicode column (e.g. for concat) produced "illegal mix of collations" error. Fix: Item_string() corresponding to space character is now created using "ASCII" repertoire. Previously it was incorrectly created using "UNICODE" repertoure, which didn't allow to convert results of SPACE() to a non-Unicode character set. mysql-test/include/ctype_common.inc: - Adding test for bug#27580 - Restoring previous values of character_set_client and character_set_results, because ctype_common.inc now changes them when doing "set names utf8" in the test for bug#27580 mysql-test/r/ctype_big5.result: Adding test mysql-test/r/ctype_cp1250_ch.result: Adding test mysql-test/r/ctype_euckr.result: Adding test mysql-test/r/ctype_gb2312.result: Adding test mysql-test/r/ctype_gbk.result: Adding test mysql-test/r/ctype_uca.result: Adding test mysql-test/r/ctype_ucs.result: Adding test mysql-test/t/ctype_cp1250_ch.test: Adding test mysql-test/t/ctype_ucs.test: Adding test sql/item_create.cc: Item for SQL function SPACE() is now created with ASCII repertoire, to allow automatic conversion from UTF8 to column's character set e.g. for CONCAT(). --- mysql-test/include/ctype_common.inc | 16 ++++ mysql-test/r/ctype_big5.result | 19 +++++ mysql-test/r/ctype_cp1250_ch.result | 152 ++++++++++++++++++++++++++++++++++++ mysql-test/r/ctype_euckr.result | 19 +++++ mysql-test/r/ctype_gb2312.result | 19 +++++ mysql-test/r/ctype_gbk.result | 19 +++++ mysql-test/r/ctype_uca.result | 19 +++++ mysql-test/r/ctype_ucs.result | 76 ++++++++++++++++++ mysql-test/t/ctype_cp1250_ch.test | 10 +++ mysql-test/t/ctype_ucs.test | 4 + sql/item_create.cc | 4 +- 11 files changed, 355 insertions(+), 2 deletions(-) diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 202c508a9c9..b9bd7869967 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -13,6 +13,8 @@ SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -51,8 +53,22 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%'; SELECT c1 as want1result from t1 where c1 like 'location%'; DROP TABLE t1; +# +# Bug#27580 SPACE() function collation bug? +# +set names utf8; +create table t1 ( + name varchar(10), + level smallint unsigned); +show create table t1; +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +drop table t1; + DROP DATABASE d1; # Restore settings USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 6d318a445f5..75b231dbe60 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -3,6 +3,8 @@ SET @test_character_set= 'big5'; SET @test_collation= 'big5_chinese_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -52,10 +54,27 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=big5 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET NAMES big5; SET collation_connection='big5_chinese_ci'; create table t1 select repeat('a',4000) a; diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 73f415732cd..3f22933e260 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -2,6 +2,158 @@ DROP TABLE IF EXISTS t1; SHOW COLLATION LIKE 'cp1250_czech_cs'; Collation Charset Id Default Compiled Sortlen cp1250_czech_cs cp1250 34 Yes 2 +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_general_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) cp1250_general_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) cp1250_general_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1250 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_czech_cs'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) cp1250_czech_cs YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) cp1250_czech_cs YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) collate cp1250_czech_cs default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp1250 COLLATE=cp1250_czech_cs +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs; INSERT INTO t1 VALUES (''); SELECT a, length(a), a='', a=' ', a=' ' FROM t1; diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index 57e3e2ed8f8..3409c278847 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -3,6 +3,8 @@ SET @test_character_set= 'euckr'; SET @test_collation= 'euckr_korean_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -52,10 +54,27 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=euckr +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET NAMES euckr; SET collation_connection='euckr_korean_ci'; create table t1 select repeat('a',4000) a; diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 314c336bab9..234201f28d0 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -3,6 +3,8 @@ SET @test_character_set= 'gb2312'; SET @test_collation= 'gb2312_chinese_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -52,10 +54,27 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=gb2312 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET NAMES gb2312; SET collation_connection='gb2312_chinese_ci'; create table t1 select repeat('a',4000) a; diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index 3f5d8b0d8c6..d78e3dd3097 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -3,6 +3,8 @@ SET @test_character_set= 'gbk'; SET @test_collation= 'gbk_chinese_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -52,10 +54,27 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=gbk +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET NAMES gbk; SET collation_connection='gbk_chinese_ci'; create table t1 select repeat('a',4000) a; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 889702e380c..4fe1eb29b19 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2538,6 +2538,8 @@ SET @test_character_set= 'utf8'; SET @test_collation= 'utf8_swedish_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -2587,10 +2589,27 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) collate utf8_swedish_ci default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); select a, a regexp '[a]' from t1 order by binary a; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 023267c227c..2b58aebeafe 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1,4 +1,80 @@ DROP TABLE IF EXISTS t1; +SET @test_character_set= 'ucs2'; +SET @test_collation= 'ucs2_general_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) ucs2_general_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) ucs2_general_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET NAMES latin1; SET character_set_connection=ucs2; select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test index 86eb8c31d99..b3daa8a02a2 100644 --- a/mysql-test/t/ctype_cp1250_ch.test +++ b/mysql-test/t/ctype_cp1250_ch.test @@ -6,6 +6,16 @@ DROP TABLE IF EXISTS t1; SHOW COLLATION LIKE 'cp1250_czech_cs'; +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_general_ci'; +-- source include/ctype_common.inc + +SET @test_character_set= 'cp1250'; +SET @test_collation= 'cp1250_czech_cs'; +-- source include/ctype_common.inc + + + # # Bugs: #8840: Empty string comparison and character set 'cp1250' # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index bca3a9c3a96..17d9f71e316 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -4,6 +4,10 @@ DROP TABLE IF EXISTS t1; --enable_warnings +SET @test_character_set= 'ucs2'; +SET @test_collation= 'ucs2_general_ci'; +-- source include/ctype_common.inc + SET NAMES latin1; SET character_set_connection=ucs2; -- source include/endspace.inc diff --git a/sql/item_create.cc b/sql/item_create.cc index 561613032bc..60a17c21521 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -361,13 +361,13 @@ Item *create_func_space(Item *a) if (cs->mbminlen > 1) { uint dummy_errors; - sp= new Item_string("",0,cs); + sp= new Item_string("", 0, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); if (sp) sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { - sp= new Item_string(" ",1,cs); + sp= new Item_string(" ", 1, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); } return sp ? new Item_func_repeat(sp, a) : 0; } -- cgit v1.2.1 From 510bda4bed61e3fc96249e693532874e21b1f274 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Dec 2007 17:40:42 +0400 Subject: BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is silently ignored When symbolic links are disabled by command line option or NO_DIR_IN_CREATE sql mode, CREATE TABLE silently ignores DATA/INDEX DIRECTORY options. With this fix a warning is issued when symbolic links are disabled. mysql-test/r/symlink.result: A test case for BUG#25677. mysql-test/t/symlink.test: A test case for BUG#25677. sql/sql_parse.cc: Moved handling of situation when mysqld is compiled without HAVE_READLINK to mysql_create_table_no_lock(). sql/sql_table.cc: Issue a warning in case DATA/INDEX DIRECTORY is specified and: - server is compiled without HAVE_READLINK; - using symbolic links is disabled by command line option; - using symbolic links is disabled by NO_DIR_IN_CREATE sql mode. --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++++++++++ mysql-test/r/symlink.result | 8 ++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++++++++++ mysql-test/t/symlink.test | 12 ++++++++++++ sql/sql_parse.cc | 10 +--------- sql/sql_table.cc | 12 +++++++++++- 6 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 4eece9d5b5a..7599d80588a 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -162,3 +162,11 @@ DROP DATABASE db1; DROP DATABASE db2; USE test; End of 5.0 tests +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; +CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp'; +Warnings: +Warning 0 DATA DIRECTORY option ignored +Warning 0 INDEX DIRECTORY option ignored +DROP TABLE t1; +SET @@SQL_MODE=@OLD_SQL_MODE; +End of 5.1 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index f339b29c83a..eaad45d7d5d 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -226,3 +226,15 @@ USE test; --echo End of 5.0 tests + +# +# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is +# silently ignored +# +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; +DROP TABLE t1; +SET @@SQL_MODE=@OLD_SQL_MODE; + +--echo End of 5.1 tests diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8ed658df90d..e5f96a96a00 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2237,15 +2237,7 @@ mysql_execute_command(THD *thd) /* Might have been updated in create_table_precheck */ create_info.alias= create_table->alias; -#ifndef HAVE_READLINK - if (create_info.data_file_name) - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, - "DATA DIRECTORY option ignored"); - if (create_info.index_file_name) - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, - "INDEX DIRECTORY option ignored"); - create_info.data_file_name= create_info.index_file_name= NULL; -#else +#ifdef HAVE_READLINK /* Fix names if symlinked tables */ if (append_file_to_dir(thd, &create_info.data_file_name, create_table->table_name) || diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 91acd8d20a3..4236028c9d8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3437,8 +3437,18 @@ bool mysql_create_table_no_lock(THD *thd, thd->proc_info="creating table"; create_info->table_existed= 0; // Mark that table is created - if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) +#ifdef HAVE_READLINK + if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) +#endif + { + if (create_info->data_file_name) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, + "DATA DIRECTORY option ignored"); + if (create_info->index_file_name) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, + "INDEX DIRECTORY option ignored"); create_info->data_file_name= create_info->index_file_name= 0; + } create_info->table_options=db_options; path[path_length - reg_ext_length]= '\0'; // Remove .frm extension -- cgit v1.2.1 From c9b46d56eb0304e6d9d58545ddb6a192eebbb795 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Dec 2007 17:16:59 +0400 Subject: BUG#26978 - s->z_err not assigned a value? azio didn't handle situation when my_read() returns error. Added handling of situation when my_read() returns error. No test case for this fix. storage/archive/azio.c: Added handling of situation when my_read() returns error. --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++++++++++ storage/archive/azio.c | 10 ++++++++-- 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/storage/archive/azio.c b/storage/archive/azio.c index cada6c57918..59fbe2182ee 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -225,11 +225,17 @@ int get_byte(s) if (s->stream.avail_in == 0) { errno = 0; - s->stream.avail_in = my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0)); + s->stream.avail_in= (uInt) my_read(s->file, (uchar *)s->inbuf, + AZ_BUFSIZE_READ, MYF(0)); if (s->stream.avail_in == 0) { s->z_eof = 1; - /* if (ferror(s->file)) s->z_err = Z_ERRNO; */ + return EOF; + } + else if (s->stream.avail_in == (uInt) -1) + { + s->z_eof= 1; + s->z_err= Z_ERRNO; return EOF; } s->stream.next_in = s->inbuf; -- cgit v1.2.1 From 647fe5b3a12324918ebb1e75ff5619eec137efed Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Dec 2007 17:05:27 +0400 Subject: BUG#22708 - Error message doesn't refer to storage engine unsupported When openning a table with unsupported (disabled or not compiled) storage engine, confusing error message is returned. Return better error message when we're attempting to open a table that uses unsupported engine. sql/table.cc: Return better error message when we're attempting to open a table that uses unsupported engine. --- mysql-test/r/bdb_notembedded.result | 35 +++++++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 ++++++++++++++++++++++++++++++++++ sql/table.cc | 41 ++++++++++++++++++++++--------------- 3 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/sql/table.cc b/sql/table.cc index c3ddb809b9e..493a940fd2e 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -886,26 +886,31 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, ha_legacy_type(share->db_type()))); } #ifdef WITH_PARTITION_STORAGE_ENGINE - else + else if (str_db_type_length == 9 && + !strncmp((char *) next_chunk + 2, "partition", 9)) { - LEX_STRING pname= { C_STRING_WITH_LEN( "partition" ) }; - if (str_db_type_length == pname.length && - !strncmp((char *) next_chunk + 2, pname.str, pname.length)) - { - /* - Use partition handler - tmp_plugin is locked with a local lock. - we unlock the old value of share->db_plugin before - replacing it with a globally locked version of tmp_plugin - */ - plugin_unlock(NULL, share->db_plugin); - share->db_plugin= ha_lock_engine(NULL, partition_hton); - DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)", - str_db_type_length, next_chunk + 2, - ha_legacy_type(share->db_type()))); - } + /* + Use partition handler + tmp_plugin is locked with a local lock. + we unlock the old value of share->db_plugin before + replacing it with a globally locked version of tmp_plugin + */ + plugin_unlock(NULL, share->db_plugin); + share->db_plugin= ha_lock_engine(NULL, partition_hton); + DBUG_PRINT("info", ("setting dbtype to '%.*s' (%d)", + str_db_type_length, next_chunk + 2, + ha_legacy_type(share->db_type()))); } #endif + else if (!tmp_plugin) + { + /* purecov: begin inspected */ + error= 8; + my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); + my_free(buff, MYF(0)); + goto err; + /* purecov: end */ + } next_chunk+= str_db_type_length + 2; } if (next_chunk + 5 < buff_end) @@ -2188,6 +2193,8 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg) "of MySQL and cannot be read", MYF(0), buff); break; + case 8: + break; default: /* Better wrong error than none */ case 4: strxmov(buff, share->normalized_path.str, reg_ext, NullS); -- cgit v1.2.1 From 53f762abfd26e432477016f00cd984e2c6c9e2d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Dec 2007 12:29:50 +0100 Subject: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Inserting strings with a common prefix into a table with characterset UCS2 corrupted the table. An efficient search method was used, which compares end space with ASCII blank. This doesn't work for character sets like UCS2, which do not encode blank like ASCII does. Use the less efficient search method _mi_seq_search() for charsets with mbminlen > 1. myisam/mi_open.c: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Use _mi_seq_search() for charsets with mbminlen > 1. mysql-test/r/myisam.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Added test result. mysql-test/t/myisam.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Added test. --- myisam/mi_open.c | 11 ++++++++++- mysql-test/r/myisam.result | 10 ++++++++++ mysql-test/t/myisam.test | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index ec169ac8785..5314d6a9a6c 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -791,8 +791,17 @@ static void setup_key_functions(register MI_KEYDEF *keyinfo) keyinfo->get_key= _mi_get_pack_key; if (keyinfo->seg[0].flag & HA_PACK_KEY) { /* Prefix compression */ + /* + _mi_prefix_search() compares end-space against ASCII blank (' '). + It cannot be used for character sets, that do not encode the + blank character like ASCII does. UCS2 is an example. All + character sets with a fixed width > 1 or a mimimum width > 1 + cannot represent blank like ASCII does. In these cases we have + to use _mi_seq_search() for the search. + */ if (!keyinfo->seg->charset || use_strnxfrm(keyinfo->seg->charset) || - (keyinfo->seg->flag & HA_NULL_PART)) + (keyinfo->seg->flag & HA_NULL_PART) || + (keyinfo->seg->charset->mbminlen > 1)) keyinfo->bin_search=_mi_seq_search; else keyinfo->bin_search=_mi_prefix_search; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 56933f45fbf..4ff7441c02e 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1839,4 +1839,14 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, +KEY(c1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 80c7a92c12f..b182c35514c 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1193,4 +1193,17 @@ SET @@myisam_repair_threads=1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; +# +# Bug#32705 - myisam corruption: Key in wrong position +# at page 1024 with ucs2_bin +# +CREATE TABLE t1 ( + c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, + KEY(c1) + ) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1 From fa01e8845b6b75c0d5f1f564ff5705a2c3735468 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Jan 2008 12:06:20 +0100 Subject: Bug#30459 Partitioning across disks failing on Windows Problem was that there are no support for symlinked files on Windows for mysqld. So we fail when trying to create them. Solution: Ignore the DATA/INDEX DIRECTORY clause for partitions and push a warning. (Just like a MyISAM table) mysql-test/r/partition.result: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests to partition_symlink result file mysql-test/r/partition_symlink.result: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests from partition.test result file mysql-test/r/partition_windows.result: Bug#30459 Partitioning across disks failing on Windows result file mysql-test/t/partition.test: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests to partition_symlink test file mysql-test/t/partition_symlink.test: Bug#30459 Partitioning across disks failing on Windows Moved symlink specific tests from partition.test test file mysql-test/t/partition_windows.test: Bug#30459 Partitioning across disks failing on Windows test file --- mysql-test/r/partition.result | 28 -------------------- mysql-test/r/partition_symlink.result | 31 ++++++++++++++++++++++ mysql-test/r/partition_windows.result | 40 +++++++++++++++++++--------- mysql-test/t/partition.test | 47 -------------------------------- mysql-test/t/partition_symlink.test | 50 ++++++++++++++++++++++++++++++++++- mysql-test/t/partition_windows.test | 37 +++++++++++++++++--------- sql/partition_info.cc | 14 ++++++++-- 7 files changed, 144 insertions(+), 103 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index a361a8f6bcc..161337ae8a6 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -44,15 +44,6 @@ partition by key(a) partitions 1e+300; ERROR 42000: Only integers allowed as number here near '1e+300' at line 3 create table t1 (a int) -partition by key (a) -(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); -ERROR 42000: Incorrect table name 'part-data' -create table t1 (a int) -partition by key (a) -(partition p0, -partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); -ERROR 42000: Incorrect table name 'part-data' -create table t1 (a int) partition by list (a) (partition p0 values in (1)); create procedure pz() @@ -1207,25 +1198,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' id 22589 drop table t1, t2; -set @org_mode=@@sql_mode; -set @@sql_mode='NO_DIR_IN_CREATE'; -select @@sql_mode; -@@sql_mode -NO_DIR_IN_CREATE -create table t1 (i int ) -partition by range (i) -( -partition p01 values less than (1000) -data directory='/not/existing' - index directory='/not/existing' -); -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `i` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ -DROP TABLE t1, t2; -set @@sql_mode=@org_mode; create table t1 (c1 varchar(255),c2 tinyint,primary key(c1)) partition by key (c1) partitions 10 ; insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1; diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result index 20e841d2e0e..8b55124d7eb 100644 --- a/mysql-test/r/partition_symlink.result +++ b/mysql-test/r/partition_symlink.result @@ -81,3 +81,34 @@ Got one of the listed errors DROP DATABASE mysqltest2; USE test; DROP USER mysqltest_1@localhost; +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +@@sql_mode +NO_DIR_IN_CREATE +create table t1 (i int ) +partition by range (i) +( +partition p01 values less than (1000) +data directory='/not/existing' + index directory='/not/existing' +); +Warnings: +Warning 0 DATA DIRECTORY option ignored +Warning 0 INDEX DIRECTORY option ignored +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `i` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; +create table t1 (a int) +partition by key (a) +(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); +ERROR 42000: Incorrect table name 'part-data' +create table t1 (a int) +partition by key (a) +(partition p0, +partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); +ERROR 42000: Incorrect table name 'part-data' diff --git a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result index 1fc9e2ba254..c2d4054deeb 100644 --- a/mysql-test/r/partition_windows.result +++ b/mysql-test/r/partition_windows.result @@ -1,14 +1,30 @@ -DROP TABLE IF EXISTS `example`; -CREATE TABLE `example` ( -`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, -`DESCRIPTION` varchar(30) NOT NULL, -`LEVEL` smallint(5) unsigned DEFAULT NULL, -PRIMARY KEY (`ID_EXAMPLE`) +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +c1 int(10) unsigned NOT NULL AUTO_INCREMENT, +c2 varchar(30) NOT NULL, +c3 smallint(5) unsigned DEFAULT NULL, +PRIMARY KEY (c1) ) ENGINE = MYISAM -PARTITION BY HASH(ID_EXAMPLE)( -PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data', -PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data', -PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data', -PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data' +PARTITION BY HASH(c1)( +PARTITION p0 +DATA DIRECTORY = 'C:/mysqltest/p0Data' + INDEX DIRECTORY = 'D:/mysqltest/p0Index', +PARTITION p1, +PARTITION p2 +DATA DIRECTORY = 'E:/mysqltest/p2Data' + INDEX DIRECTORY = 'F:/mysqltest/p2Index' ); -ERROR HY000: Can't create/write to file 'C:\build\5.1\data\partitiontest\p0Data\example#P#p0.MYD' (Errcode: 2) +Warnings: +Warning 0 DATA DIRECTORY option ignored +Warning 0 INDEX DIRECTORY option ignored +Warning 0 DATA DIRECTORY option ignored +Warning 0 INDEX DIRECTORY option ignored +INSERT INTO t1 VALUES (NULL, "first", 1); +INSERT INTO t1 VALUES (NULL, "second", 2); +INSERT INTO t1 VALUES (NULL, "third", 3); +ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index'); +Warnings: +Warning 0 DATA DIRECTORY option ignored +Warning 0 INDEX DIRECTORY option ignored +INSERT INTO t1 VALUES (NULL, "last", 4); +DROP TABLE t1; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..183b348d473 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -78,24 +78,6 @@ create table t1 (a int) partition by key(a) partitions 1e+300; -# -# Bug 21350: Data Directory problems -# --- error ER_WRONG_TABLE_NAME -create table t1 (a int) -partition by key (a) -(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); - -# -# Insert a test that manages to create the first partition and fails with -# the second, ensure that we clean up afterwards in a proper manner. -# ---error ER_WRONG_TABLE_NAME -create table t1 (a int) -partition by key (a) -(partition p0, - partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); - # # Bug 19309 Partitions: Crash if double procedural alter # @@ -1398,35 +1380,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified' drop table t1, t2; -# -# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables -# - -disable_query_log; -eval create table t2 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory="$MYSQLTEST_VARDIR/master-data/test/" - index directory="$MYSQLTEST_VARDIR/master-data/test/" -); -enable_query_log; - -set @org_mode=@@sql_mode; -set @@sql_mode='NO_DIR_IN_CREATE'; -select @@sql_mode; -create table t1 (i int ) -partition by range (i) -( - partition p01 values less than (1000) - data directory='/not/existing' - index directory='/not/existing' -); - -show create table t2; -DROP TABLE t1, t2; -set @@sql_mode=@org_mode; - # # Bug #27123 partition + on duplicate key update + varchar = Can't find record in # diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test index ab779ec2b68..ec809a34090 100644 --- a/mysql-test/t/partition_symlink.test +++ b/mysql-test/t/partition_symlink.test @@ -2,7 +2,9 @@ # (DATA/INDEX DIR requires symlinks) -- source include/have_partition.inc -- source include/have_symlink.inc -# remove the not_windows line after fixing bug#30459 +# remove the not_windows line after fixing bug#33687 +# symlinks must also work for files, not only directories +# as in --skip-symbolic-links -- source include/not_windows.inc -- disable_warnings DROP TABLE IF EXISTS t1; @@ -118,4 +120,50 @@ connection default; DROP USER mysqltest_1@localhost; disconnect con1; +# +# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables +# + +disable_query_log; +eval create table t2 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory="$MYSQLTEST_VARDIR/master-data/test/" + index directory="$MYSQLTEST_VARDIR/master-data/test/" +); +enable_query_log; + +set @org_mode=@@sql_mode; +set @@sql_mode='NO_DIR_IN_CREATE'; +select @@sql_mode; +create table t1 (i int ) +partition by range (i) +( + partition p01 values less than (1000) + data directory='/not/existing' + index directory='/not/existing' +); + +show create table t2; +DROP TABLE t1, t2; +set @@sql_mode=@org_mode; + +# +# Bug 21350: Data Directory problems +# +-- error ER_WRONG_TABLE_NAME +create table t1 (a int) +partition by key (a) +(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); + +# +# Insert a test that manages to create the first partition and fails with +# the second, ensure that we clean up afterwards in a proper manner. +# +--error ER_WRONG_TABLE_NAME +create table t1 (a int) +partition by key (a) +(partition p0, + partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data'); diff --git a/mysql-test/t/partition_windows.test b/mysql-test/t/partition_windows.test index a0723feac44..d42a7383c99 100644 --- a/mysql-test/t/partition_windows.test +++ b/mysql-test/t/partition_windows.test @@ -7,23 +7,34 @@ # # Bug 25141: Crash Server on Partitioning command # +# Bug#30459: Partitioning across disks failing on Windows +# updated this test, since symlinked files are not supported on Windows +# (not the same as symlinked directories that have a special hack +# on windows). This test is not dependent on have_symlink. --disable_warnings -DROP TABLE IF EXISTS `example`; +DROP TABLE IF EXISTS t1; --enable_warnings ---disable_abort_on_error -CREATE TABLE `example` ( - `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, - `DESCRIPTION` varchar(30) NOT NULL, - `LEVEL` smallint(5) unsigned DEFAULT NULL, - PRIMARY KEY (`ID_EXAMPLE`) +CREATE TABLE t1 ( + c1 int(10) unsigned NOT NULL AUTO_INCREMENT, + c2 varchar(30) NOT NULL, + c3 smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (c1) ) ENGINE = MYISAM -PARTITION BY HASH(ID_EXAMPLE)( -PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data', -PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data', -PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data', -PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data' +PARTITION BY HASH(c1)( + PARTITION p0 + DATA DIRECTORY = 'C:/mysqltest/p0Data' + INDEX DIRECTORY = 'D:/mysqltest/p0Index', + PARTITION p1, + PARTITION p2 + DATA DIRECTORY = 'E:/mysqltest/p2Data' + INDEX DIRECTORY = 'F:/mysqltest/p2Index' ); ---enable_abort_on_error +INSERT INTO t1 VALUES (NULL, "first", 1); +INSERT INTO t1 VALUES (NULL, "second", 2); +INSERT INTO t1 VALUES (NULL, "third", 3); +ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index'); +INSERT INTO t1 VALUES (NULL, "last", 4); +DROP TABLE t1; diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 3b580422da1..16433497efd 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -794,8 +794,18 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, partition_element *part_elem= part_it++; if (part_elem->engine_type == NULL) part_elem->engine_type= default_engine_type; - if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) - part_elem->data_file_name= part_elem->index_file_name= 0; +#ifdef HAVE_READLINK + if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) +#endif + { + if (part_elem->data_file_name) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, + "DATA DIRECTORY option ignored"); + if (part_elem->index_file_name) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0, + "INDEX DIRECTORY option ignored"); + part_elem->data_file_name= part_elem->index_file_name= NULL; + } if (!is_sub_partitioned()) { if (check_table_name(part_elem->partition_name, -- cgit v1.2.1 From d84a0e5caa26602b282695b52417cf7d9b667e7e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Jan 2008 13:15:50 +0100 Subject: Bug#31931 Partitions: unjustified 'mix of handlers' error message Problem was that the mix of handlers was not consistent between CREATE and ALTER changed so that it works like: - All partitions must use the same engine AND it must be the same as the table. - if one does NOT specify an engine on the table level then one must either NOT specify any engine on any partition/subpartition OR for ALL partitions/subpartitions Note: that after a table have been created, the storage engine is specified for all parts of the table (table/partition/subpartition) and so when using alter, one does not need to specify it (unless one wants to change the storage engine, then one have to specify it on the table level) mysql-test/r/partition.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/r/partition_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/ndb/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case update mysql-test/suite/parts/inc/partition_engine.inc: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/suite/parts/r/ndb_partition_key.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#31931 Partitions: unjustified 'mix of handlers' error message test result updated mysql-test/suite/parts/t/ndb_partition_key.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated mysql-test/t/partition_innodb.test: Bug#31931 Partitions: unjustified 'mix of handlers' error message test case updated sql/partition_info.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved the check_engine_condition here from sql_partition.cc created a new check_engine_mix from check_native_partitioned in sql_partition.cc sql/partition_info.h: Bug#31931 Partitions: unjustified 'mix of handlers' error message non static function check_engine_mix (now used in sql_partition.cc) sql/sql_partition.cc: Bug#31931 Partitions: unjustified 'mix of handlers' error message moved check_engine_condition to partition_info.cc and moved out some common code in check_native_partitioned to check_engine_mix in partition_info.cc --- mysql-test/r/partition.result | 2 - mysql-test/r/partition_innodb.result | 9 +- mysql-test/suite/ndb/r/ndb_partition_key.result | 7 +- mysql-test/suite/ndb/t/ndb_partition_key.test | 13 +- mysql-test/suite/parts/inc/partition_engine.inc | 50 +- mysql-test/suite/parts/r/ndb_partition_key.result | 7 +- .../suite/parts/r/partition_engine_innodb.result | 2826 +------------------ .../suite/parts/r/partition_engine_myisam.result | 2918 +------------------- mysql-test/suite/parts/t/ndb_partition_key.test | 12 +- mysql-test/t/partition.test | 7 +- mysql-test/t/partition_innodb.test | 7 +- sql/partition_info.cc | 247 +- sql/partition_info.h | 2 +- sql/sql_partition.cc | 138 +- 14 files changed, 551 insertions(+), 5694 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index a361a8f6bcc..2cf3cffb038 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -536,11 +536,9 @@ t1 CREATE TABLE `t1` ( alter table t1 partition by key(a) (partition p0, partition p1 engine=heap); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL alter table t1 partition by key(a) (partition p0 engine=heap, partition p1); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL alter table t1 engine=heap partition by key (a) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 5cbe34c94ca..ac9b548b19e 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -79,8 +79,7 @@ engine = innodb partition by list (a) (partition p0 values in (0)); alter table t1 engine = x; -Warnings: -Warning 1286 Unknown table engine 'x' +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -151,9 +150,11 @@ DROP TABLE t1; create table t1 (int_column int, char_column char(5)) PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB); -alter table t1 PARTITION BY RANGE (int_column) +alter table t1 +ENGINE = MyISAM +PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 -(PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam); +(PARTITION p1 VALUES LESS THAN (5)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/ndb/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result index 60e96ce03b6..5daa590482d 100644 --- a/mysql-test/suite/ndb/r/ndb_partition_key.result +++ b/mysql-test/suite/ndb/r/ndb_partition_key.result @@ -88,6 +88,12 @@ PARTITION BY KEY(a) 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; @@ -143,7 +149,6 @@ t1 CREATE TABLE `t1` ( alter table t1 partition by key(a) (partition p0 engine=ndb, partition p1); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL alter table t1 engine=ndb partition by key(a) diff --git a/mysql-test/suite/ndb/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test index 78e2c9d15c2..af0852976b3 100644 --- a/mysql-test/suite/ndb/t/ndb_partition_key.test +++ b/mysql-test/suite/ndb/t/ndb_partition_key.test @@ -75,6 +75,14 @@ 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); @@ -112,7 +120,10 @@ show create table t1; alter table t1 remove partitioning; show create table t1; ---error ER_MIX_HANDLER_ERROR +# after bug#31931 was fixed +# this is OK, since the storage engine is specified +# on table level before. +#--error ER_MIX_HANDLER_ERROR alter table t1 partition by key(a) (partition p0 engine=ndb, partition p1); diff --git a/mysql-test/suite/parts/inc/partition_engine.inc b/mysql-test/suite/parts/inc/partition_engine.inc index 769e3d71530..d2f3277cf6d 100644 --- a/mysql-test/suite/parts/inc/partition_engine.inc +++ b/mysql-test/suite/parts/inc/partition_engine.inc @@ -83,6 +83,7 @@ DROP TABLE t1; --echo # 3 Some but not all named partitions or subpartitions get a storage --echo # engine assigned --echo #------------------------------------------------------------------------ +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -90,10 +91,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = $engine, 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; ---source suite/parts/inc/partition_check.inc -DROP TABLE t1; +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -101,10 +99,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 , PARTITION part2 STORAGE ENGINE = $engine ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; ---source suite/parts/inc/partition_check.inc -DROP TABLE t1; +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -117,10 +112,8 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; ---source suite/parts/inc/partition_check.inc -DROP TABLE t1; +--echo # this should fail with ER_MIX_HANDLER_ERROR +--echo # after fixing Bug#33722 eval CREATE TABLE t1 ( $column_list ) @@ -142,6 +135,9 @@ DROP TABLE t1; --echo # 4 Storage engine assignment after partition name + after name of --echo # subpartitions belonging to another partition --echo #------------------------------------------------------------------------ +--echo # this should work +--echo # after fixing Bug#33722 +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -154,10 +150,13 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; ---source suite/parts/inc/partition_check.inc -DROP TABLE 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; +#--source suite/parts/inc/partition_check.inc +#DROP TABLE t1; +--echo # this should work +--echo # after fixing Bug#33722 +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -170,10 +169,10 @@ SUBPARTITION BY HASH(f_int1) (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; ---source suite/parts/inc/partition_check.inc -DROP TABLE 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; +#--source suite/parts/inc/partition_check.inc +#DROP TABLE t1; # --echo #------------------------------------------------------------------------ --echo # 5 Precedence of storage engine assignments (if there is any) @@ -210,6 +209,9 @@ DROP TABLE t1; --echo # 6.2 Storage engine assignment after partition name + after --echo # subpartition name # in partition part + in sub partition part +--echo # this should work +--echo # after fixing Bug#33722 +--error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) @@ -222,10 +224,10 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; ---source suite/parts/inc/partition_check.inc -DROP TABLE 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; +#--source suite/parts/inc/partition_check.inc +#DROP TABLE t1; --echo #------------------------------------------------------------------------ --echo # 6 Session default engine differs from engine used within create table diff --git a/mysql-test/suite/parts/r/ndb_partition_key.result b/mysql-test/suite/parts/r/ndb_partition_key.result index daac61fb530..00565a3979d 100644 --- a/mysql-test/suite/parts/r/ndb_partition_key.result +++ b/mysql-test/suite/parts/r/ndb_partition_key.result @@ -88,6 +88,12 @@ PARTITION BY KEY(a) 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; @@ -143,7 +149,6 @@ t1 CREATE TABLE `t1` ( alter table t1 partition by key(a) (partition p0 engine=ndb, partition p1); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL alter table t1 engine=ndb partition by key(a) diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index 04a5a492269..05242b3bf3f 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -1416,6 +1416,54 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'InnoDB', PARTITION part2 ); +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) +) +PARTITION BY HASH(f_int1) +( PARTITION part1 , +PARTITION part2 STORAGE ENGINE = 'InnoDB' +); +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) +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11, +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should fail with ER_MIX_HANDLER_ERROR +# after fixing Bug#33722 +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) +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +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 (inc/partition_check.inc) @@ -1428,7 +1476,7 @@ t1 CREATE TABLE `t1` ( `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 part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1496,9 +1544,7 @@ 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##'; +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), @@ -1855,6 +1901,31 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; +#------------------------------------------------------------------------ +# 4 Storage engine assignment after partition name + after name of +# subpartitions belonging to another partition +#------------------------------------------------------------------------ +# this should work +# after fixing Bug#33722 +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 = 'InnoDB' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1862,8 +1933,30 @@ 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) +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'InnoDB' +(SUBPARTITION subpart21, +SUBPARTITION subpart22) +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +#------------------------------------------------------------------------ +# 5 Precedence of storage engine assignments (if there is any) +#------------------------------------------------------------------------ +# 5.1 Storage engine assignment after column list + after partition +# or subpartition name +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) ENGINE = 'InnoDB' PARTITION BY HASH(f_int1) -( PARTITION part1 , +( PARTITION part1 STORAGE ENGINE = 'InnoDB', PARTITION part2 STORAGE ENGINE = 'InnoDB' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) @@ -2315,7 +2408,7 @@ f_charbig VARCHAR(1000) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11, +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', @@ -2758,6 +2851,10 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; +# 6.2 Storage engine assignment after partition name + after +# subpartition name +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2767,2723 +2864,14 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) +( PARTITION part1 VALUES LESS THAN (10) STORAGE ENGINE = 'InnoDB' (SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21, -SUBPARTITION subpart22 ) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); -INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 status OK -# check layout success: 1 -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 Storage engine assignment after partition name + after name of -# subpartitions belonging to another partition -#------------------------------------------------------------------------ -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 = 'InnoDB' -(SUBPARTITION subpart11, -SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') -); -INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 status OK -# check layout success: 1 -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 HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'InnoDB' -(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 status OK -# check layout success: 1 -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 Precedence of storage engine assignments (if there is any) -#------------------------------------------------------------------------ -# 5.1 Storage engine assignment after column list + after partition -# or subpartition name -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -) ENGINE = 'InnoDB' -PARTITION BY HASH(f_int1) -( PARTITION part1 STORAGE ENGINE = 'InnoDB', -PARTITION part2 STORAGE ENGINE = 'InnoDB' -); -INSERT INTO t1(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 (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 part1 ENGINE = InnoDB, PARTITION part2 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 status OK -# check layout success: 1 -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 HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') -); -INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 status OK -# check layout success: 1 -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.2 Storage engine assignment after partition name + after -# subpartition name -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) STORAGE ENGINE = 'InnoDB' -(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') -); -INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 status OK -# check layout success: 1 -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; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index f81becc6eea..fd21e687eb0 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -1450,6 +1450,54 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'MyISAM', PARTITION part2 ); +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) +) +PARTITION BY HASH(f_int1) +( PARTITION part1 , +PARTITION part2 STORAGE ENGINE = 'MyISAM' +); +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) +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11, +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should fail with ER_MIX_HANDLER_ERROR +# after fixing Bug#33722 +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) +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +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 (inc/partition_check.inc) @@ -1462,13 +1510,17 @@ t1 CREATE TABLE `t1` ( `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 part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ +) 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.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#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 @@ -1538,9 +1590,7 @@ 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##'; +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), @@ -1899,6 +1949,31 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; +#------------------------------------------------------------------------ +# 4 Storage engine assignment after partition name + after name of +# subpartitions belonging to another partition +#------------------------------------------------------------------------ +# this should work +# after fixing Bug#33722 +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 = 'MyISAM' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1906,8 +1981,30 @@ 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) +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'MyISAM' +(SUBPARTITION subpart21, +SUBPARTITION subpart22) +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +#------------------------------------------------------------------------ +# 5 Precedence of storage engine assignments (if there is any) +#------------------------------------------------------------------------ +# 5.1 Storage engine assignment after column list + after partition +# or subpartition name +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) ENGINE = 'MyISAM' PARTITION BY HASH(f_int1) -( PARTITION part1 , +( PARTITION part1 STORAGE ENGINE = 'MyISAM', PARTITION part2 STORAGE ENGINE = 'MyISAM' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) @@ -2369,7 +2466,7 @@ f_charbig VARCHAR(1000) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11, +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', @@ -2826,6 +2923,10 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; +# 6.2 Storage engine assignment after partition name + after +# subpartition name +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2835,2803 +2936,14 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) +( PARTITION part1 VALUES LESS THAN (10) STORAGE ENGINE = 'MyISAM' (SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21, -SUBPARTITION subpart22 ) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); -INSERT INTO t1(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 (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 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 - -# 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; -#------------------------------------------------------------------------ -# 4 Storage engine assignment after partition name + after name of -# subpartitions belonging to another partition -#------------------------------------------------------------------------ -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 = 'MyISAM' -(SUBPARTITION subpart11, -SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') -); -INSERT INTO t1(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 (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 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 - -# 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) -SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'MyISAM' -(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 (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 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 - -# 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; -#------------------------------------------------------------------------ -# 5 Precedence of storage engine assignments (if there is any) -#------------------------------------------------------------------------ -# 5.1 Storage engine assignment after column list + after partition -# or subpartition name -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -) ENGINE = 'MyISAM' -PARTITION BY HASH(f_int1) -( PARTITION part1 STORAGE ENGINE = 'MyISAM', -PARTITION part2 STORAGE ENGINE = 'MyISAM' -); -INSERT INTO t1(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 (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 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 - -# 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 HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') -); -INSERT INTO t1(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 (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 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 - -# 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; -# 6.2 Storage engine assignment after partition name + after -# subpartition name -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) STORAGE ENGINE = 'MyISAM' -(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') -); -INSERT INTO t1(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 (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 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 - -# 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; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/t/ndb_partition_key.test b/mysql-test/suite/parts/t/ndb_partition_key.test index fb0581eb6f6..36a8a1863aa 100644 --- a/mysql-test/suite/parts/t/ndb_partition_key.test +++ b/mysql-test/suite/parts/t/ndb_partition_key.test @@ -75,6 +75,14 @@ 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); @@ -112,7 +120,9 @@ show create table t1; alter table t1 remove partitioning; show create table t1; ---error ER_MIX_HANDLER_ERROR +#--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); diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..1ba8402cdf0 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -49,6 +49,7 @@ create table t1 (id int auto_increment, s1 int, primary key (id)); insert into t1 values (null,1); insert into t1 values (null,6); +-- sorted_result select * from t1; alter table t1 partition by range (id) ( @@ -618,12 +619,14 @@ partition by key (a) (partition p0, partition p1); show create table t1; ---error ER_MIX_HANDLER_ERROR +# Since alter, it already have ENGINE=HEAP from before on table level +# -> OK alter table t1 partition by key(a) (partition p0, partition p1 engine=heap); ---error ER_MIX_HANDLER_ERROR +# Since alter, it already have ENGINE=HEAP from before on table level +# -> OK alter table t1 partition by key(a) (partition p0 engine=heap, partition p1); diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 58010f85ecf..5445be6019e 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -86,6 +86,7 @@ engine = innodb partition by list (a) (partition p0 values in (0)); +-- error ER_MIX_HANDLER_ERROR alter table t1 engine = x; show create table t1; drop table t1; @@ -164,8 +165,10 @@ DROP TABLE t1; create table t1 (int_column int, char_column char(5)) PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB); -alter table t1 PARTITION BY RANGE (int_column) +alter table t1 +ENGINE = MyISAM +PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2 - (PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam); + (PARTITION p1 VALUES LESS THAN (5)); show create table t1; drop table t1; diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 3b580422da1..cc7a7f17577 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -419,41 +419,167 @@ char *partition_info::has_unique_names() /* - Check that all partitions use the same storage engine. - This is currently a limitation in this version. + Check that the partition/subpartition is setup to use the correct + storage engine + SYNOPSIS + check_engine_condition() + p_elem Partition element + table_engine_set Have user specified engine on table level + inout::engine_type Current engine used + inout::first Is it first partition + RETURN VALUE + TRUE Failed check + FALSE Ok + DESCRIPTION + Specified engine for table and partitions p0 and pn + Must be correct both on CREATE and ALTER commands + table p0 pn res (0 - OK, 1 - FAIL) + - - - 0 + - - x 1 + - x - 1 + - x x 0 + x - - 0 + x - x 0 + x x - 0 + x x x 0 + i.e: + - All subpartitions must use the same engine + AND it must be the same as the partition. + - All partitions must use the same engine + AND it must be the same as the table. + - if one does NOT specify an engine on the table level + then one must either NOT specify any engine on any + partition/subpartition OR for ALL partitions/subpartitions + Note: + When ALTER a table, the engines are already set for all levels + (table, all partitions and subpartitions). So if one want to + change the storage engine, one must specify it on the table level + +*/ + +static bool check_engine_condition(partition_element *p_elem, + bool table_engine_set, + handlerton **engine_type, + bool *first) +{ + DBUG_ENTER("check_engine_condition"); + + DBUG_PRINT("enter", ("p_eng %u t_eng %u t_eng_set %u first %u state %u", + ha_legacy_type(p_elem->engine_type), + ha_legacy_type(*engine_type), + table_engine_set, *first, p_elem->part_state)); + if (*first && !table_engine_set) + { + *engine_type= p_elem->engine_type; + DBUG_PRINT("info", ("setting table_engine = %u", + ha_legacy_type(*engine_type))); + } + *first= FALSE; + if ((table_engine_set && + (p_elem->engine_type != (*engine_type) && + p_elem->engine_type)) || + (!table_engine_set && + p_elem->engine_type != (*engine_type))) + { + DBUG_RETURN(TRUE); + } + else + { + DBUG_RETURN(FALSE); + } +} + +/* + Check engine mix that it is correct + Current limitation is that all partitions and subpartitions + must use the same storage engine. SYNOPSIS check_engine_mix() - engine_array An array of engine identifiers - no_parts Total number of partitions - + inout::engine_type Current engine used + table_engine_set Have user specified engine on table level RETURN VALUE - TRUE Error, mixed engines - FALSE Ok, no mixed engines + TRUE Error, mixed engines + FALSE Ok, no mixed engines DESCRIPTION Current check verifies only that all handlers are the same. Later this check will be more sophisticated. + (specified partition handler ) specified table handler + (NDB, NDB) NDB OK + (MYISAM, MYISAM) - OK + (MYISAM, -) - NOT OK + (MYISAM, -) MYISAM OK + (- , MYISAM) - NOT OK + (- , -) MYISAM OK + (-,-) - OK + (NDB, MYISAM) * NOT OK */ -bool partition_info::check_engine_mix(handlerton **engine_array, uint no_parts) +bool partition_info::check_engine_mix(handlerton *engine_type, + bool table_engine_set) { - uint i= 0; + handlerton *old_engine_type= engine_type; + bool first= TRUE; + uint no_parts= partitions.elements; DBUG_ENTER("partition_info::check_engine_mix"); - - do + DBUG_PRINT("info", ("in: engine_type = %u, table_engine_set = %u", + ha_legacy_type(engine_type), + table_engine_set)); + if (no_parts) { - if (engine_array[i] != engine_array[0]) + List_iterator part_it(partitions); + uint i= 0; + do { - my_error(ER_MIX_HANDLER_ERROR, MYF(0)); - DBUG_RETURN(TRUE); - } - } while (++i < no_parts); - if (engine_array[0]->flags & HTON_NO_PARTITION) + partition_element *part_elem= part_it++; + DBUG_PRINT("info", ("part = %d engine = %d table_engine_set %u", + i, ha_legacy_type(part_elem->engine_type), + table_engine_set)); + if (is_sub_partitioned() && + part_elem->subpartitions.elements) + { + uint no_subparts= part_elem->subpartitions.elements; + uint j= 0; + List_iterator sub_it(part_elem->subpartitions); + do + { + partition_element *sub_elem= sub_it++; + DBUG_PRINT("info", ("sub = %d engine = %u table_engie_set %u", + j, ha_legacy_type(sub_elem->engine_type), + table_engine_set)); + if (check_engine_condition(sub_elem, table_engine_set, + &engine_type, &first)) + goto error; + } while (++j < no_subparts); + /* ensure that the partition also has correct engine */ + if (check_engine_condition(part_elem, table_engine_set, + &engine_type, &first)) + goto error; + } + else if (check_engine_condition(part_elem, table_engine_set, + &engine_type, &first)) + goto error; + } while (++i < no_parts); + } + DBUG_PRINT("info", ("engine_type = %u", + ha_legacy_type(engine_type))); + if (!engine_type) + engine_type= old_engine_type; + if (engine_type->flags & HTON_NO_PARTITION) { my_error(ER_PARTITION_MERGE_ERROR, MYF(0)); DBUG_RETURN(TRUE); } + DBUG_PRINT("info", ("out: engine_type = %u", + ha_legacy_type(engine_type))); + DBUG_ASSERT(engine_type != partition_hton); DBUG_RETURN(FALSE); +error: + /* + Mixed engines not yet supported but when supported it will need + the partition handler + */ + DBUG_RETURN(TRUE); } @@ -726,12 +852,12 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, handler *file, HA_CREATE_INFO *info, bool check_partition_function) { - handlerton **engine_array= NULL; - uint part_count= 0; + handlerton *table_engine= default_engine_type; uint i, tot_partitions; - bool result= TRUE; + bool result= TRUE, table_engine_set; char *same_name; DBUG_ENTER("partition_info::check_partition_info"); + DBUG_ASSERT(default_engine_type != partition_hton); if (check_partition_function) { @@ -777,23 +903,49 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0)); goto end; } + /* + if NOT specified ENGINE = : + If Create, always use create_info->db_type + else, use previous tables db_type + either ALL or NONE partition should be set to + default_engine_type when not table_engine_set + Note: after a table is created its storage engines for + the table and all partitions/subpartitions are set. + So when ALTER it is already set on table level + */ + if (thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE) + { + table_engine_set= TRUE; + table_engine= thd->lex->create_info.db_type; + } + else + { + table_engine_set= FALSE; + if (thd->lex->sql_command != SQLCOM_CREATE_TABLE) + { + table_engine_set= TRUE; + DBUG_ASSERT(table_engine && table_engine != partition_hton); + } + } + if ((same_name= has_unique_names())) { my_error(ER_SAME_NAME_PARTITION, MYF(0), same_name); goto end; } - engine_array= (handlerton**)my_malloc(tot_partitions * sizeof(handlerton *), - MYF(MY_WME)); - if (unlikely(!engine_array)) - goto end; i= 0; { List_iterator part_it(partitions); + uint no_parts_not_set= 0; + uint prev_no_subparts_not_set= no_subparts + 1; do { partition_element *part_elem= part_it++; if (part_elem->engine_type == NULL) + { + no_parts_not_set++; part_elem->engine_type= default_engine_type; + } if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) part_elem->data_file_name= part_elem->index_file_name= 0; if (!is_sub_partitioned()) @@ -804,13 +956,13 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, my_error(ER_WRONG_PARTITION_NAME, MYF(0)); goto end; } - DBUG_PRINT("info", ("engine = %d", - ha_legacy_type(part_elem->engine_type))); - engine_array[part_count++]= part_elem->engine_type; + DBUG_PRINT("info", ("part = %d engine = %d", + i, ha_legacy_type(part_elem->engine_type))); } else { uint j= 0; + uint no_subparts_not_set= 0; List_iterator sub_it(part_elem->subpartitions); do { @@ -822,19 +974,49 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, goto end; } if (sub_elem->engine_type == NULL) + { sub_elem->engine_type= default_engine_type; - DBUG_PRINT("info", ("engine = %u", - ha_legacy_type(sub_elem->engine_type))); - engine_array[part_count++]= sub_elem->engine_type; + no_subparts_not_set++; + } + DBUG_PRINT("info", ("part = %d sub = %d engine = %u", + i, j, ha_legacy_type(sub_elem->engine_type))); } while (++j < no_subparts); + if (prev_no_subparts_not_set == (no_subparts + 1)) + prev_no_subparts_not_set= no_subparts_not_set; + if (!table_engine_set && + prev_no_subparts_not_set == no_subparts_not_set && + no_subparts_not_set != 0 && + no_subparts_not_set != no_subparts) + { + DBUG_PRINT("info", ("no_subparts_not_set = %u no_subparts = %u", + no_subparts_not_set, no_subparts)); + my_error(ER_MIX_HANDLER_ERROR, MYF(0)); + goto end; + } } } while (++i < no_parts); + if (!table_engine_set && + no_parts_not_set != 0 && + no_parts_not_set != no_parts) + { + DBUG_PRINT("info", ("no_parts_not_set = %u no_parts = %u", + no_parts_not_set, no_subparts)); + my_error(ER_MIX_HANDLER_ERROR, MYF(0)); + goto end; + } } - if (unlikely(partition_info::check_engine_mix(engine_array, part_count))) + if (unlikely(check_engine_mix(table_engine, table_engine_set))) + { + my_error(ER_MIX_HANDLER_ERROR, MYF(0)); goto end; + } + if (table_engine == partition_hton) + DBUG_PRINT("info", ("Table engine set to partition_hton")); + DBUG_ASSERT(default_engine_type == table_engine); if (eng_type) - *eng_type= (handlerton*)engine_array[0]; + *eng_type= table_engine; + /* We need to check all constant expressions that they are of the correct @@ -850,7 +1032,6 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } result= FALSE; end: - my_free((char*)engine_array,MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(result); } diff --git a/sql/partition_info.h b/sql/partition_info.h index b7d13e188f3..b38e572d3aa 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -269,7 +269,7 @@ public: bool set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info, uint start_no); char *has_unique_names(); - static bool check_engine_mix(handlerton **engine_array, uint no_parts); + bool check_engine_mix(handlerton *engine_type, bool default_engine); bool check_range_constants(); bool check_list_constants(); bool check_partition_info(THD *thd, handlerton **eng_type, diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index ce70e177a85..d10ee3fa408 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3863,6 +3863,8 @@ bool mysql_unpack_partition(THD *thd, if (!part_info->default_engine_type) part_info->default_engine_type= default_db_type; DBUG_ASSERT(part_info->default_engine_type == default_db_type); + DBUG_ASSERT(part_info->default_engine_type->db_type != DB_TYPE_UNKNOWN); + DBUG_ASSERT(part_info->default_engine_type != partition_hton); { /* @@ -3996,56 +3998,6 @@ static int fast_end_partition(THD *thd, ulonglong copied, } -/* - Check engine mix that it is correct - SYNOPSIS - check_engine_condition() - p_elem Partition element - default_engine Have user specified engine on table level - inout::engine_type Current engine used - inout::first Is it first partition - RETURN VALUE - TRUE Failed check - FALSE Ok - DESCRIPTION - (specified partition handler ) specified table handler - (NDB, NDB) NDB OK - (MYISAM, MYISAM) - OK - (MYISAM, -) - NOT OK - (MYISAM, -) MYISAM OK - (- , MYISAM) - NOT OK - (- , -) MYISAM OK - (-,-) - OK - (NDB, MYISAM) * NOT OK -*/ - -static bool check_engine_condition(partition_element *p_elem, - bool default_engine, - handlerton **engine_type, - bool *first) -{ - DBUG_ENTER("check_engine_condition"); - - DBUG_PRINT("enter", ("def_eng = %u, first = %u", default_engine, *first)); - if (*first && default_engine) - { - *engine_type= p_elem->engine_type; - } - *first= FALSE; - if ((!default_engine && - (p_elem->engine_type != (*engine_type) && - p_elem->engine_type)) || - (default_engine && - p_elem->engine_type != (*engine_type))) - { - DBUG_RETURN(TRUE); - } - else - { - DBUG_RETURN(FALSE); - } -} - /* We need to check if engine used by all partitions can handle partitioning natively. @@ -4070,52 +4022,30 @@ static bool check_engine_condition(partition_element *p_elem, static bool check_native_partitioned(HA_CREATE_INFO *create_info,bool *ret_val, partition_info *part_info, THD *thd) { - List_iterator part_it(part_info->partitions); - bool first= TRUE; - bool default_engine; - handlerton *engine_type= create_info->db_type; + bool table_engine_set; + handlerton *engine_type= part_info->default_engine_type; handlerton *old_engine_type= engine_type; - uint i= 0; - uint no_parts= part_info->partitions.elements; DBUG_ENTER("check_native_partitioned"); - default_engine= (create_info->used_fields & HA_CREATE_USED_ENGINE) ? - FALSE : TRUE; - DBUG_PRINT("info", ("engine_type = %u, default = %u", - ha_legacy_type(engine_type), - default_engine)); - if (no_parts) + if (create_info->used_fields & HA_CREATE_USED_ENGINE) { - do + table_engine_set= TRUE; + engine_type= create_info->db_type; + } + else + { + table_engine_set= FALSE; + if (thd->lex->sql_command != SQLCOM_CREATE_TABLE) { - partition_element *part_elem= part_it++; - if (part_info->is_sub_partitioned() && - part_elem->subpartitions.elements) - { - uint no_subparts= part_elem->subpartitions.elements; - uint j= 0; - List_iterator sub_it(part_elem->subpartitions); - do - { - partition_element *sub_elem= sub_it++; - if (check_engine_condition(sub_elem, default_engine, - &engine_type, &first)) - goto error; - } while (++j < no_subparts); - /* - In case of subpartitioning and defaults we allow that only - subparts have specified engines, as long as the parts haven't - specified the wrong engine it's ok. - */ - if (check_engine_condition(part_elem, FALSE, - &engine_type, &first)) - goto error; - } - else if (check_engine_condition(part_elem, default_engine, - &engine_type, &first)) - goto error; - } while (++i < no_parts); + table_engine_set= TRUE; + DBUG_ASSERT(engine_type && engine_type != partition_hton); + } } + DBUG_PRINT("info", ("engine_type = %u, table_engine_set = %u", + ha_legacy_type(engine_type), + table_engine_set)); + if (part_info->check_engine_mix(engine_type, table_engine_set)) + goto error; /* All engines are of the same type. Check if this engine supports @@ -4212,7 +4142,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0)); DBUG_RETURN(TRUE); } - if (alter_info->flags == ALTER_TABLE_REORG) + if (alter_info->flags & ALTER_TABLE_REORG) { uint new_part_no, curr_part_no; if (tab_part_info->part_type != HASH_PARTITION || @@ -4538,7 +4468,7 @@ that are reorganised. tab_part_info->is_auto_partitioned= FALSE; } } - else if (alter_info->flags == ALTER_DROP_PARTITION) + else if (alter_info->flags & ALTER_DROP_PARTITION) { /* Drop a partition from a range partition and list partitioning is @@ -4742,7 +4672,7 @@ state of p1. tab_part_info->is_auto_partitioned= FALSE; } } - else if (alter_info->flags == ALTER_REORGANIZE_PARTITION) + else if (alter_info->flags & ALTER_REORGANIZE_PARTITION) { /* Reorganise partitions takes a number of partitions that are next @@ -4923,8 +4853,8 @@ the generated partition syntax in a correct manner. } *partition_changed= TRUE; thd->work_part_info= tab_part_info; - if (alter_info->flags == ALTER_ADD_PARTITION || - alter_info->flags == ALTER_REORGANIZE_PARTITION) + if (alter_info->flags & ALTER_ADD_PARTITION || + alter_info->flags & ALTER_REORGANIZE_PARTITION) { if (tab_part_info->use_default_subpartitions && !alt_part_info->use_default_subpartitions) @@ -5051,13 +4981,21 @@ the generated partition syntax in a correct manner. DBUG_PRINT("info", ("partition changed")); *partition_changed= TRUE; } - if (create_info->db_type == partition_hton) + /* + Set up partition default_engine_type either from the create_info + or from the previus table + */ + if (create_info->used_fields & HA_CREATE_USED_ENGINE) + part_info->default_engine_type= create_info->db_type; + else { - if (!part_info->default_engine_type) + if (table->part_info) part_info->default_engine_type= table->part_info->default_engine_type; + else + part_info->default_engine_type= create_info->db_type; } - else - part_info->default_engine_type= create_info->db_type; + DBUG_ASSERT(part_info->default_engine_type && + part_info->default_engine_type != partition_hton); if (check_native_partitioned(create_info, &is_native_partitioned, part_info, thd)) { @@ -6164,7 +6102,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, goto err; } } - else if (alter_info->flags == ALTER_DROP_PARTITION) + else if (alter_info->flags & ALTER_DROP_PARTITION) { /* Now after all checks and setting state on dropped partitions we can -- cgit v1.2.1 From c3bf70215b4515c2fcf21bbb9a93aaf66d8c3faf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Jan 2008 17:59:45 +0100 Subject: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists CHECK TABLE (non-QUICK) and any form of repair table did wrongly rate records as corrupted under the following conditions: 1. The table has dynamic row format and 2. it has a CHAR like column > 127 bytes (but not VARCHAR) (for multi-byte character sets this could be less than 127 characters) and 3. it has records with > 127 bytes significant length in that column (a byte beyond byte position 127 must be non-space). Affected were the statements CHECK TABLE, REPAIR TABLE, OPTIMIZE TABLE, ALTER TABLE. CHECK TABLE reported and marked the table as crashed if any record was present that fulfilled condition 3. The other statements deleted these records. The problem was a signed/unsigned compare in MyISAM code. A char to uchar change became necessary after the big byte to uchar change. mysql-test/r/myisam.result: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists Added test result. mysql-test/t/myisam.test: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists Added test. storage/myisam/mi_dynrec.c: Bug#33222 - myisam-table drops rows when column is added and a char-field > 128 exists char -> uchar became necessary after big byte -> uchar change. Fixed some small coding style violations near the changes. --- mysql-test/r/myisam.result | 162 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/myisam.test | 170 +++++++++++++++++++++++++++++++++++++++++++++ storage/myisam/mi_dynrec.c | 32 +++++---- 3 files changed, 349 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 353d66b1ad5..62220de0496 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2001,4 +2001,166 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(130), +c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(130), +c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(130), +c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(130), +c2 VARCHAR(1), +KEY (c1) +) ENGINE=MyISAM; +# Insert 100 rows. Query log disabled. +UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90; +SELECT COUNT(*) FROM t1; +COUNT(*) +100 +ALTER TABLE t1 ENGINE=MyISAM; +SELECT COUNT(*) FROM t1; +COUNT(*) +100 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(50), +c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(50), +c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +1 +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(50), +c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(50), +c2 VARCHAR(1), +KEY (c1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Insert 100 rows. Query log disabled. +UPDATE t1 SET c1=REPEAT(_utf8 x'e0ae85',43) LIMIT 90; +SELECT COUNT(*) FROM t1; +COUNT(*) +100 +ALTER TABLE t1 ENGINE=MyISAM; +SELECT COUNT(*) FROM t1; +COUNT(*) +100 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index cadab8b3b70..334ecfd02d3 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1261,5 +1261,175 @@ DELETE FROM t1 WHERE c1 >= 10; CHECK TABLE t1; DROP TABLE t1; +# +# Bug#33222 - myisam-table drops rows when column is added +# and a char-field > 128 exists +# +# Test #1 - CHECK TABLE sees wrong record, REPAR TABLE deletes it. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +REPAIR TABLE t1; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +DROP TABLE t1; +# +# Test #2 - same as test #1, but using EXTENDED. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +REPAIR TABLE t1 EXTENDED; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #3 - same as test #1, but using OPTIMIZE TABLE. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES(REPEAT("a",128), 'b'); +# Insert more rows and delete one in the middle to force optimize. +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +OPTIMIZE TABLE t1; +SELECT COUNT(*) FROM t1; +DROP TABLE t1; +# +# Test #4 - ALTER TABLE deletes rows. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +# Using an index which can be disabled during bulk insert. +CREATE TABLE t1 ( + c1 CHAR(130), + c2 VARCHAR(1), + KEY (c1) +) ENGINE=MyISAM; +# +# Insert 100 rows. This turns bulk insert on during the copy phase of +# ALTER TABLE. Bulk insert disables keys before the insert and re-enables +# them by repair after the insert. +--disable_query_log +let $count= 100; +--echo # Insert $count rows. Query log disabled. +while ($count) +{ + INSERT INTO t1 VALUES ('a', 'b'); + dec $count; +} +--enable_query_log +# +# Change most of the rows into long character values with > 127 characters. +UPDATE t1 SET c1=REPEAT("a",128) LIMIT 90; +SELECT COUNT(*) FROM t1; +ALTER TABLE t1 ENGINE=MyISAM; +# +# With bug present, this shows that all long rows are gone. +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #5 - same as test #1 but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +REPAIR TABLE t1; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +DROP TABLE t1; +# +# Test #6 - same as test #2, but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +REPAIR TABLE t1 EXTENDED; +SELECT COUNT(*) FROM t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; +# +# Test #7 - same as test #3, but UTF-8. +# Using a CHAR column that can have > 127 characters. +# Using a VARCHAR to create a table with dynamic row format. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# Using Tamil Letter A, Unicode U+0B85 +INSERT INTO t1 VALUES(REPEAT(_utf8 x'e0ae85',43), 'b'); +# Insert more rows and delete one in the middle to force optimize. +INSERT INTO t1 VALUES('b', 'b'); +INSERT INTO t1 VALUES('c', 'b'); +DELETE FROM t1 WHERE c1='b'; +SELECT COUNT(*) FROM t1; +OPTIMIZE TABLE t1; +SELECT COUNT(*) FROM t1; +DROP TABLE t1; +# +# Test #8 - same as test #4, but UTF-8. +# Using a CHAR column that can have > 42 UTF-8 characters. +# Using a VARCHAR to create a table with dynamic row format. +# Using an index which can be disabled during bulk insert. +CREATE TABLE t1 ( + c1 CHAR(50), + c2 VARCHAR(1), + KEY (c1) +) ENGINE=MyISAM DEFAULT CHARSET UTF8; +# +# Insert 100 rows. This turns bulk insert on during the copy phase of +# ALTER TABLE. Bulk insert disables keys before the insert and re-enables +# them by repair after the insert. +--disable_query_log +let $count= 100; +--echo # Insert $count rows. Query log disabled. +while ($count) +{ + INSERT INTO t1 VALUES ('a', 'b'); + dec $count; +} +--enable_query_log +# +# Change most of the rows into long character values with > 42 characters. +# Using Tamil Letter A, Unicode U+0B85 +UPDATE t1 SET c1=REPEAT(_utf8 x'e0ae85',43) LIMIT 90; +SELECT COUNT(*) FROM t1; +ALTER TABLE t1 ENGINE=MyISAM; +# +# With bug present, this shows that all long rows are gone. +SELECT COUNT(*) FROM t1; +CHECK TABLE t1; +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 9940cf62204..22fa3d18802 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -1006,12 +1006,12 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to, { if (rec->length > 255 && new_length > 127) { - to[0]=(char) ((new_length & 127)+128); - to[1]=(char) (new_length >> 7); - to+=2; - } - else - *to++= (char) new_length; + to[0]= (uchar) ((new_length & 127) + 128); + to[1]= (uchar) (new_length >> 7); + to+=2; + } + else + *to++= (uchar) new_length; memcpy((uchar*) to,pos,(size_t) new_length); to+=new_length; flag|=bit; } @@ -1045,7 +1045,7 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to, } if ((bit= bit << 1) >= 256) { - *packpos++ = (char) (uchar) flag; + *packpos++= (uchar) flag; bit=1; flag=0; } } @@ -1055,9 +1055,9 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to, } } if (bit != 1) - *packpos= (char) (uchar) flag; + *packpos= (uchar) flag; if (info->s->calc_checksum) - *to++=(char) info->checksum; + *to++= (uchar) info->checksum; DBUG_PRINT("exit",("packed length: %d",(int) (to-startpos))); DBUG_RETURN((uint) (to-startpos)); } /* _mi_rec_pack */ @@ -1128,12 +1128,14 @@ my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *rec_buff, goto err; if (rec->length > 255 && new_length > 127) { - if (to[0] != (char) ((new_length & 127)+128) || - to[1] != (char) (new_length >> 7)) - goto err; - to+=2; - } - else if (*to++ != (char) new_length) + /* purecov: begin inspected */ + if (to[0] != (uchar) ((new_length & 127) + 128) || + to[1] != (uchar) (new_length >> 7)) + goto err; + to+=2; + /* purecov: end */ + } + else if (*to++ != (uchar) new_length) goto err; to+=new_length; } -- cgit v1.2.1 From 082cfb87919999efe83216d572ba6c776ecf748d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Jan 2008 16:23:14 +0400 Subject: BUG#28884 - maybe a problem with malloc into base64.c Fixed that return value of malloc was not checked. Fixed wrong argument count (compilation failure) to base64_decode() function. Note: - there is no test case for this fix as this code is never compiled into mysql clients/server; - as this code is used for internal testing purposes only, no changelog entry needed. mysys/base64.c: Fixed that return value of malloc was not checked. Fixed wrong argument count to base64_decode function. --- mysys/base64.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysys/base64.c b/mysys/base64.c index dbe8927290d..6157dcaa5af 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -256,6 +256,7 @@ main(void) char * str; char * dst; + require(src); for (j= 0; j Date: Wed, 16 Jan 2008 11:48:04 +0100 Subject: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Post-pushbuild fix. Moved test from myisam.test to ctype_ucs2_def.test. UCS2 is not always available. mysql-test/r/ctype_ucs2_def.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test result from myisam.result to here. mysql-test/r/myisam.result: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test result from here to ctype_ucs2_def.result. mysql-test/t/ctype_ucs2_def.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test from myisam.test to here. UCS2 is not always available. mysql-test/t/myisam.test: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Moved test from here to ctype_ucs2_def.test. UCS2 is not always available. --- mysql-test/r/ctype_ucs2_def.result | 10 ++++++++++ mysql-test/r/myisam.result | 10 ---------- mysql-test/t/ctype_ucs2_def.test | 13 +++++++++++++ mysql-test/t/myisam.test | 13 ------------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result index d838c5d66b0..1bbb354798b 100644 --- a/mysql-test/r/ctype_ucs2_def.result +++ b/mysql-test/r/ctype_ucs2_def.result @@ -21,4 +21,14 @@ INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C'); INSERT INTO t1 VALUES('A ', 'A '); ERROR 23000: Duplicate entry '' for key 1 DROP TABLE t1; +CREATE TABLE t1 ( +c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, +KEY(c1) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 4ff7441c02e..56933f45fbf 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1839,14 +1839,4 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; -CREATE TABLE t1 ( -c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, -KEY(c1) -) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('marshall\'s'); -INSERT INTO t1 VALUES ('marsh'); -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check status OK -DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/ctype_ucs2_def.test b/mysql-test/t/ctype_ucs2_def.test index c80444daddd..b146dc63626 100644 --- a/mysql-test/t/ctype_ucs2_def.test +++ b/mysql-test/t/ctype_ucs2_def.test @@ -39,4 +39,17 @@ INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C'); INSERT INTO t1 VALUES('A ', 'A '); DROP TABLE t1; +# +# Bug#32705 - myisam corruption: Key in wrong position +# at page 1024 with ucs2_bin +# +CREATE TABLE t1 ( + c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, + KEY(c1) + ) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('marshall\'s'); +INSERT INTO t1 VALUES ('marsh'); +CHECK TABLE t1 EXTENDED; +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index b182c35514c..80c7a92c12f 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1193,17 +1193,4 @@ SET @@myisam_repair_threads=1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; -# -# Bug#32705 - myisam corruption: Key in wrong position -# at page 1024 with ucs2_bin -# -CREATE TABLE t1 ( - c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, - KEY(c1) - ) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('marshall\'s'); -INSERT INTO t1 VALUES ('marsh'); -CHECK TABLE t1 EXTENDED; -DROP TABLE t1; - --echo End of 5.0 tests -- cgit v1.2.1 From dd40d4ea407e640d47b0f34fdb177b4d6ee4a175 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Jan 2008 15:38:40 +0100 Subject: Bug#32705 - myisam corruption: Key in wrong position at page 1024 with ucs2_bin Post merge fix --- mysql-test/r/myisam.result | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 6863259aa9a..a18018657e0 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -1809,16 +1809,6 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; -CREATE TABLE t1 ( -c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL, -KEY(c1) -) ENGINE=MyISAM; -INSERT INTO t1 VALUES ('marshall\'s'); -INSERT INTO t1 VALUES ('marsh'); -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check status OK -DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, ref int NOT NULL, INDEX (id)) ENGINE=MyISAM; CREATE TABLE t2 LIKE t1; INSERT INTO t2 (id, ref) VALUES (1,3), (2,1), (3,2), (4,5), (4,4); -- cgit v1.2.1 From 8f3a0ea2c8e791f0ee84c3e1dd7f09ef7daf0d48 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Jan 2008 15:37:18 -0800 Subject: Bug#33067 "Update of CSV row incorrect for some BLOBs" when reading in rows, move blob columns into temporary storage not allocated by Field_blob class or else row update operation will alter original row and make mysql think that nothing has been changed. fix incrementing wrong statistic values. mysql-test/r/csv.result: test for bug33067 mysql-test/t/csv.test: test for bug33067 storage/csv/ha_tina.cc: bug33067 when reading in rows, move blob columns into temporary storage not allocated by Field_blob class or else row update operation will alter original row and make mysql think that nothing has been changed. fix incrementing wrong statistic values. storage/csv/ha_tina.h: bug33067 new memroot attribute for blobs --- mysql-test/r/csv.result | 9 +++++++++ mysql-test/t/csv.test | 11 +++++++++++ storage/csv/ha_tina.cc | 47 +++++++++++++++++++++++++++++++++++++++++------ storage/csv/ha_tina.h | 1 + 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index b0033383f00..b91272f7e59 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5379,4 +5379,13 @@ SHOW WARNINGS; Level Code Message Error 1178 The storage engine for the table doesn't support nullable columns Error 1005 Can't create table 'test.t1' (errno: 138) +create table t1 (c1 tinyblob not null) engine=csv; +insert into t1 values("This"); +update t1 set c1="That" where c1="This"; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select * from t1; +c1 +That +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 7b4f95bbf8a..dd8c940ac44 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1773,4 +1773,15 @@ drop table t1; CREATE TABLE t1(a INT) ENGINE=CSV; SHOW WARNINGS; +# +# BUG#33067 - . +# +create table t1 (c1 tinyblob not null) engine=csv; +insert into t1 values("This"); +--enable_info +update t1 set c1="That" where c1="This"; +--disable_info +select * from t1; +drop table t1; + --echo End of 5.1 tests diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index c9fab79a4c5..f8dd778045f 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -56,6 +56,7 @@ TODO: #define META_BUFFER_SIZE sizeof(uchar) + sizeof(uchar) + sizeof(ulonglong) \ + sizeof(ulonglong) + sizeof(ulonglong) + sizeof(ulonglong) + sizeof(uchar) #define TINA_CHECK_HEADER 254 // The number we use to determine corruption +#define BLOB_MEMROOT_ALLOC_SIZE 8192 /* The file extension */ #define CSV_EXT ".CSV" // The data file @@ -597,6 +598,8 @@ int ha_tina::find_current_row(uchar *buf) bool read_all; DBUG_ENTER("ha_tina::find_current_row"); + free_root(&blobroot, MYF(MY_MARK_BLOCKS_FREE)); + /* We do not read further then local_saved_data_file_length in order not to conflict with undergoing concurrent insert. @@ -684,6 +687,22 @@ int ha_tina::find_current_row(uchar *buf) if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(), CHECK_FIELD_WARN)) goto err; + if ((*field)->flags & BLOB_FLAG) + { + Field_blob *blob= *(Field_blob**) field; + uchar *src, *tgt; + uint length, packlength; + + packlength= blob->pack_length_no_ptr(); + length= blob->get_length(blob->ptr); + memcpy_fixed(&src, blob->ptr + packlength, sizeof(char*)); + if (src) + { + tgt= (uchar*) alloc_root(&blobroot, length); + bmove(tgt, src, length); + memcpy_fixed(blob->ptr + packlength, &tgt, sizeof(char*)); + } + } } } next_position= end_offset + eoln_len; @@ -914,9 +933,10 @@ int ha_tina::open_update_temp_file_if_needed() int ha_tina::update_row(const uchar * old_data, uchar * new_data) { int size; + int rc= -1; DBUG_ENTER("ha_tina::update_row"); - ha_statistic_increment(&SSV::ha_read_rnd_next_count); + ha_statistic_increment(&SSV::ha_update_count); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); @@ -931,20 +951,23 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data) The temp_file_length is used to calculate new data file length. */ if (chain_append()) - DBUG_RETURN(-1); + goto err; if (open_update_temp_file_if_needed()) - DBUG_RETURN(-1); + goto err; if (my_write(update_temp_file, (uchar*)buffer.ptr(), size, MYF(MY_WME | MY_NABP))) - DBUG_RETURN(-1); + goto err; temp_file_length+= size; + rc= 0; /* UPDATE should never happen on the log tables */ DBUG_ASSERT(!share->is_log_table); - DBUG_RETURN(0); +err: + DBUG_PRINT("info",("rc = %d", rc)); + DBUG_RETURN(rc); } @@ -1050,6 +1073,8 @@ int ha_tina::rnd_init(bool scan) records_is_known= 0; chain_ptr= chain; + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); + DBUG_RETURN(0); } @@ -1115,7 +1140,7 @@ void ha_tina::position(const uchar *record) int ha_tina::rnd_pos(uchar * buf, uchar *pos) { DBUG_ENTER("ha_tina::rnd_pos"); - ha_statistic_increment(&SSV::ha_read_rnd_next_count); + ha_statistic_increment(&SSV::ha_read_rnd_count); current_position= (off_t)my_get_ptr(pos,ref_length); DBUG_RETURN(find_current_row(buf)); } @@ -1179,6 +1204,7 @@ int ha_tina::rnd_end() off_t file_buffer_start= 0; DBUG_ENTER("ha_tina::rnd_end"); + free_root(&blobroot, MYF(0)); records_is_known= 1; if ((chain_ptr - chain) > 0) @@ -1350,6 +1376,8 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) /* set current position to the beginning of the file */ current_position= next_position= 0; + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); + /* Read the file row-by-row. If everything is ok, repair is not needed. */ while (!(rc= find_current_row(buf))) { @@ -1358,6 +1386,8 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) current_position= next_position; } + free_root(&blobroot, MYF(0)); + my_free((char*)buf, MYF(0)); if (rc == HA_ERR_END_OF_FILE) @@ -1535,6 +1565,9 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) local_saved_data_file_length= share->saved_data_file_length; /* set current position to the beginning of the file */ current_position= next_position= 0; + + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); + /* Read the file row-by-row. If everything is ok, repair is not needed. */ while (!(rc= find_current_row(buf))) { @@ -1542,6 +1575,8 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) count--; current_position= next_position; } + + free_root(&blobroot, MYF(0)); my_free((char*)buf, MYF(0)); thd_proc_info(thd, old_proc_info); diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 5ce09783b9b..5b4381396fc 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -82,6 +82,7 @@ class ha_tina: public handler uint32 chain_size; uint local_data_file_version; /* Saved version of the data file used */ bool records_is_known; + MEM_ROOT blobroot; private: bool get_write_pos(off_t *end_pos, tina_set *closest_hole); -- cgit v1.2.1 From 1804046d78a4e4c8750aed1dfbffdd1f07fc7857 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Jan 2008 18:56:42 +0100 Subject: Bug#29182 - MyISAMCHK reports wrong character set myisamchk did always show Character set: latin1_swedish_ci (8), regardless what DEFAULT CHARSET the table had. When the server created a MyISAM table, it did not copy the characterset number into the MyISAM create info structure. Added assignment of charset number to MI_CREATE_INFO. mysql-test/r/myisam.result: Bug#29182 - MyISAMCHK reports wrong character set Added test result. mysql-test/t/myisam.test: Bug#29182 - MyISAMCHK reports wrong character set Added test. storage/myisam/ha_myisam.cc: Bug#29182 - MyISAMCHK reports wrong character set Added assignment of charset number to MI_CREATE_INFO. --- mysql-test/r/myisam.result | 19 +++++++++++++++++++ mysql-test/t/myisam.test | 14 ++++++++++++++ storage/myisam/ha_myisam.cc | 1 + 3 files changed, 34 insertions(+) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index a18018657e0..bf57b6e1006 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2185,4 +2185,23 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +CREATE TABLE t1 ( +c1 VARCHAR(10) NOT NULL, +c2 CHAR(10) DEFAULT NULL, +c3 VARCHAR(10) NOT NULL, +KEY (c1), +KEY (c2) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; + +MyISAM file: MYSQLTEST_VARDIR/master-data/test/t1 +Record format: Packed +Character set: utf8_general_ci (33) +Data records: 0 Deleted blocks: 0 +Recordlength: 94 + +table description: +Key Start Len Index Type +1 2 30 multip. varchar +2 33 30 multip. char NULL +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index bb2c295eac2..21ffa0683b6 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1448,5 +1448,19 @@ CHECK TABLE t1; CHECK TABLE t1 EXTENDED; DROP TABLE t1; +# +# Bug#29182 - MyISAMCHK reports wrong character set +# +CREATE TABLE t1 ( + c1 VARCHAR(10) NOT NULL, + c2 CHAR(10) DEFAULT NULL, + c3 VARCHAR(10) NOT NULL, + KEY (c1), + KEY (c2) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYISAMCHK -d $MYSQLTEST_VARDIR/master-data/test/t1 +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 0b69f9d135f..09393d58d1a 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1859,6 +1859,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, share->avg_row_length); create_info.data_file_name= ha_create_info->data_file_name; create_info.index_file_name= ha_create_info->index_file_name; + create_info.language= share->table_charset->number; if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) create_flags|= HA_CREATE_TMP_TABLE; -- cgit v1.2.1 From f1042103e619330f5b1fdd11faed7d07c79df49f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Jan 2008 16:05:15 -0800 Subject: Bug#33358 "Plugin enum variables can't be set from command line" fix crash of LOCK_plugins mutex when loading plug-ins from command line. fix off-by-one bug when loading multiple plug-ins from the command line. initialize command line handling for ENUM and SET plugin variable types. sql/sql_plugin.cc: Bug33358 fix crash of LOCK_plugins mutex when loading plug-ins from command line. fix off-by-one bug when loading multiple plug-ins from the command line. initialize command line handling for ENUM and SET plugin variable types. mysql-test/r/plugin_load.result: New BitKeeper file ``mysql-test/r/plugin_load.result'' mysql-test/t/plugin_load-master.opt: New BitKeeper file ``mysql-test/t/plugin_load-master.opt'' mysql-test/t/plugin_load.test: New BitKeeper file ``mysql-test/t/plugin_load.test'' --- mysql-test/r/plugin_load.result | 3 ++ mysql-test/t/plugin_load-master.opt | 3 ++ mysql-test/t/plugin_load.test | 3 ++ sql/sql_plugin.cc | 66 +++++++++++++++++++++++++++---------- 4 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 mysql-test/r/plugin_load.result create mode 100644 mysql-test/t/plugin_load-master.opt create mode 100644 mysql-test/t/plugin_load.test diff --git a/mysql-test/r/plugin_load.result b/mysql-test/r/plugin_load.result new file mode 100644 index 00000000000..33116cc20ab --- /dev/null +++ b/mysql-test/r/plugin_load.result @@ -0,0 +1,3 @@ +SELECT @@global.example_enum_var = 'e2'; +@@global.example_enum_var = 'e2' +1 diff --git a/mysql-test/t/plugin_load-master.opt b/mysql-test/t/plugin_load-master.opt new file mode 100644 index 00000000000..34186aab890 --- /dev/null +++ b/mysql-test/t/plugin_load-master.opt @@ -0,0 +1,3 @@ +$EXAMPLE_PLUGIN_OPT +"--plugin-load=;EXAMPLE=ha_example.so;" +--plugin-example-enum-var=e2 diff --git a/mysql-test/t/plugin_load.test b/mysql-test/t/plugin_load.test new file mode 100644 index 00000000000..8555247dd71 --- /dev/null +++ b/mysql-test/t/plugin_load.test @@ -0,0 +1,3 @@ +--source include/have_example_plugin.inc + +SELECT @@global.example_enum_var = 'e2'; diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 2a86844c8c6..8e204eb3d51 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1412,7 +1412,11 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, while (list) { if (p == buffer + sizeof(buffer) - 1) - break; + { + sql_print_error("plugin-load parameter too long"); + DBUG_RETURN(TRUE); + } + switch ((*(p++)= *(list++))) { case '\0': list= NULL; /* terminate the loop */ @@ -1421,10 +1425,17 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, case ':': /* can't use this as delimiter as it may be drive letter */ #endif case ';': - name.str[name.length]= '\0'; - if (str != &dl) // load all plugins in named module + str->str[str->length]= '\0'; + if (str == &name) // load all plugins in named module { + if (!name.length) + { + p--; /* reset pointer */ + continue; + } + dl= name; + pthread_mutex_lock(&LOCK_plugin); if ((plugin_dl= plugin_dl_add(&dl, REPORT_TO_LOG))) { for (plugin= plugin_dl->plugins; plugin->info; plugin++) @@ -1434,7 +1445,10 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) + { + pthread_mutex_unlock(&LOCK_plugin); goto error; + } } plugin_dl_del(&dl); // reduce ref count } @@ -1442,9 +1456,14 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, else { free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); + pthread_mutex_lock(&LOCK_plugin); if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) + { + pthread_mutex_unlock(&LOCK_plugin); goto error; + } } + pthread_mutex_unlock(&LOCK_plugin); name.length= dl.length= 0; dl.str= NULL; name.str= p= buffer; str= &name; @@ -1453,6 +1472,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, case '#': if (str == &name) { + name.str[name.length]= '\0'; str= &dl; str->str= p; continue; @@ -2999,7 +3019,8 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, DBUG_RETURN(-1); } - if (opt->flags & PLUGIN_VAR_NOCMDOPT) + if ((opt->flags & (PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_THDLOCAL)) + == PLUGIN_VAR_NOCMDOPT) continue; if (!opt->name) @@ -3009,7 +3030,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, DBUG_RETURN(-1); } - if (!(v= find_bookmark(name, opt->name, opt->flags))) + if (!(opt->flags & PLUGIN_VAR_THDLOCAL)) { optnamelen= strlen(opt->name); optname= (char*) alloc_root(mem_root, namelen + optnamelen + 2); @@ -3017,7 +3038,23 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, optnamelen= namelen + optnamelen + 1; } else - optname= (char*) memdup_root(mem_root, v->key + 1, (optnamelen= v->name_len) + 1); + { + /* this should not fail because register_var should create entry */ + if (!(v= find_bookmark(name, opt->name, opt->flags))) + { + sql_print_error("Thread local variable '%s' not allocated " + "in plugin '%s'.", opt->name, plugin_name); + DBUG_RETURN(-1); + } + + *(int*)(opt + 1)= offset= v->offset; + + if (opt->flags & PLUGIN_VAR_NOCMDOPT) + continue; + + optname= (char*) memdup_root(mem_root, v->key + 1, + (optnamelen= v->name_len) + 1); + } /* convert '_' to '-' */ for (p= optname; *p; p++) @@ -3029,20 +3066,13 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, options->app_type= opt; options->id= (options-1)->id + 1; - if (opt->flags & PLUGIN_VAR_THDLOCAL) - *(int*)(opt + 1)= offset= v->offset; - plugin_opt_set_limits(options, opt); - if ((opt->flags & PLUGIN_VAR_TYPEMASK) != PLUGIN_VAR_ENUM && - (opt->flags & PLUGIN_VAR_TYPEMASK) != PLUGIN_VAR_SET) - { - if (opt->flags & PLUGIN_VAR_THDLOCAL) - options->value= options->u_max_value= (uchar**) - (global_system_variables.dynamic_variables_ptr + offset); - else - options->value= options->u_max_value= *(uchar***) (opt + 1); - } + if (opt->flags & PLUGIN_VAR_THDLOCAL) + options->value= options->u_max_value= (uchar**) + (global_system_variables.dynamic_variables_ptr + offset); + else + options->value= options->u_max_value= *(uchar***) (opt + 1); options[1]= options[0]; options[1].name= p= (char*) alloc_root(mem_root, optnamelen + 8); -- cgit v1.2.1 From 70884e09b8d10088da4598aaf0b8ebe04e6a97b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Jan 2008 02:13:35 -0800 Subject: fixes to make pushbuild tests green mysql-test/t/plugin_load-master.opt: add '--loose' modifier to allow test to be skipped if plugin is not available. sql/sql_plugin.cc: Failure to load a plugin from command line option made non-fatal as plugin load failures from plugin table is already non-fatal. --- mysql-test/t/plugin_load-master.opt | 2 +- sql/sql_plugin.cc | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/plugin_load-master.opt b/mysql-test/t/plugin_load-master.opt index 34186aab890..66637841f16 100644 --- a/mysql-test/t/plugin_load-master.opt +++ b/mysql-test/t/plugin_load-master.opt @@ -1,3 +1,3 @@ $EXAMPLE_PLUGIN_OPT "--plugin-load=;EXAMPLE=ha_example.so;" ---plugin-example-enum-var=e2 +--loose-plugin-example-enum-var=e2 diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 8e204eb3d51..bae4a85fd8a 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1181,9 +1181,8 @@ int plugin_init(int *argc, char **argv, int flags) /* Register all dynamic plugins */ if (!(flags & PLUGIN_INIT_SKIP_DYNAMIC_LOADING)) { - if (opt_plugin_load && - plugin_load_list(&tmp_root, argc, argv, opt_plugin_load)) - goto err; + if (opt_plugin_load) + plugin_load_list(&tmp_root, argc, argv, opt_plugin_load); if (!(flags & PLUGIN_INIT_SKIP_PLUGIN_TABLE)) plugin_load(&tmp_root, argc, argv); } -- cgit v1.2.1 From 516f95acea961ed8e7c550ba49acdd884678058c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 15:20:55 +0100 Subject: BUG#32943: Fixed buggy lock handling of ALTER TABLE for partitioning mysql-test/r/partition_range.result: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. mysql-test/t/partition_range.test: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. sql/mysql_priv.h: Added WFRM_KEEP_SHARE for use of code not to be used otherwise sql/sql_partition.cc: Removed get_name_lock and release_name_lock, use close_data_files_and_morph_locks which leaves an exclusive name lock after completing. Reopen table after completing if under lock tables Updated comments sql/sql_table.cc: Ensure that code to set partition syntax isn't used other than when specifically asked to do it. --- mysql-test/r/partition_range.result | 22 +++++++ mysql-test/t/partition_range.test | 35 +++++++++++ sql/mysql_priv.h | 1 + sql/sql_partition.cc | 114 ++++++++++++++---------------------- sql/sql_table.cc | 10 +++- 5 files changed, 109 insertions(+), 73 deletions(-) diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 4da79704ec3..4c6459a09e3 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,4 +1,26 @@ drop table if exists t1, t2; +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), +partition p1 values less than (100)); +create trigger tr1 before insert on t1 +for each row begin +set @a = 1; +end| +alter table t1 drop partition p0; +drop table t1; +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), +partition p1 values less than (100)); +LOCK TABLES t1 WRITE; +alter table t1 drop partition p0; +alter table t1 reorganize partition p1 into +( partition p0 values less than (4), +partition p1 values less than (100)); +alter table t1 add partition ( partition p2 values less than (200)); +UNLOCK TABLES; +drop table t1; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 6ed3abab46a..c73a56aff9d 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -9,6 +9,41 @@ drop table if exists t1, t2; --enable_warnings +# +# BUG 32943: +# Locking problems in relation to partitioning and triggers +# Also fixes and test cases of generic lock issues with +# partition change code. +# +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), + partition p1 values less than (100)); + +delimiter |; +create trigger tr1 before insert on t1 +for each row begin + set @a = 1; +end| + +delimiter ;| +alter table t1 drop partition p0; + +drop table t1; + +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), + partition p1 values less than (100)); +LOCK TABLES t1 WRITE; +alter table t1 drop partition p0; +alter table t1 reorganize partition p1 into +( partition p0 values less than (4), + partition p1 values less than (100)); +alter table t1 add partition ( partition p2 values less than (200)); +UNLOCK TABLES; +drop table t1; + # # BUG 18198: Various tests for partition functions # diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0adf90dc258..b2e97116828 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1635,6 +1635,7 @@ extern pthread_mutex_t LOCK_gdl; #define WFRM_WRITE_SHADOW 1 #define WFRM_INSTALL_SHADOW 2 #define WFRM_PACK_FRM 4 +#define WFRM_KEEP_SHARE 8 bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags); int abort_and_upgrade_lock(ALTER_PARTITION_PARAM_TYPE *lpt); void close_open_tables_and_downgrade(ALTER_PARTITION_PARAM_TYPE *lpt); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index eabf4526f7b..677d45dc33d 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -5838,32 +5838,32 @@ static void release_log_entries(partition_info *part_info) /* - Get a lock on table name to avoid that anyone can open the table in - a critical part of the ALTER TABLE. - SYNOPSIS - get_name_lock() + Final part of partition changes to handle things when under + LOCK TABLES. + SYNPOSIS + alter_partition_lock_handling() lpt Struct carrying parameters RETURN VALUES - FALSE Success - TRUE Failure + NONE */ - -static int get_name_lock(ALTER_PARTITION_PARAM_TYPE *lpt) +void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt) { - int error= 0; - DBUG_ENTER("get_name_lock"); - - bzero(&lpt->table_list, sizeof(lpt->table_list)); - lpt->table_list.db= (char*)lpt->db; - lpt->table_list.table= lpt->table; - lpt->table_list.table_name= (char*)lpt->table_name; - pthread_mutex_lock(&LOCK_open); - error= lock_table_name(lpt->thd, &lpt->table_list, FALSE); - pthread_mutex_unlock(&LOCK_open); - DBUG_RETURN(error); + int err; + if (lpt->thd->locked_tables) + { + pthread_mutex_lock(&LOCK_open); + lpt->thd->in_lock_tables= 1; + err= reopen_tables(lpt->thd, 1, 1); + lpt->thd->in_lock_tables= 0; + pthread_mutex_unlock(&LOCK_open); + if (err) + { + /* Issue a warning since we weren't able to regain the lock again. */ + sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE"); + } + } } - /* Unlock and close table before renaming and dropping partitions SYNOPSIS @@ -5876,35 +5876,16 @@ static int get_name_lock(ALTER_PARTITION_PARAM_TYPE *lpt) static int alter_close_tables(ALTER_PARTITION_PARAM_TYPE *lpt) { THD *thd= lpt->thd; - TABLE *table= lpt->table; + const char *db= lpt->db; + const char *table_name= lpt->table_name; DBUG_ENTER("alter_close_tables"); /* We need to also unlock tables and close all handlers. We set lock to zero to ensure we don't do this twice and we set db_stat to zero to ensure we don't close twice. */ - mysql_unlock_tables(thd, thd->lock); - thd->lock= 0; - table->file->close(); - table->db_stat= 0; - DBUG_RETURN(0); -} - - -/* - Release a lock name - SYNOPSIS - release_name_lock() - lpt - RETURN VALUES - 0 -*/ - -static int release_name_lock(ALTER_PARTITION_PARAM_TYPE *lpt) -{ - DBUG_ENTER("release_name_lock"); pthread_mutex_lock(&LOCK_open); - unlock_table_name(lpt->thd, &lpt->table_list); + close_data_files_and_morph_locks(thd, db, table_name); pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(0); } @@ -6202,7 +6183,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, name lock. 5) Close all tables that have already been opened but didn't stumble on the abort locked previously. This is done as part of the - get_name_lock call. + close_data_files_and_morph_locks call. 6) We are now ready to release all locks we got in this thread. 7) Write the bin log Unfortunately the writing of the binlog is not synchronised with @@ -6219,8 +6200,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, 9) Prepare handlers for drop of partitions 10) Drop the partitions 11) Remove entries from ddl log - 12) Release name lock so that all other threads can access the table - again. + 12) Reopen table if under lock tables 13) Complete query We insert Error injections at all places where it could be interesting @@ -6235,23 +6215,21 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, (not_completed= FALSE) || abort_and_upgrade_lock(lpt) || /* Always returns 0 */ ERROR_INJECT_CRASH("crash_drop_partition_4") || - get_name_lock(lpt) || - ERROR_INJECT_CRASH("crash_drop_partition_5") || alter_close_tables(lpt) || - ERROR_INJECT_CRASH("crash_drop_partition_6") || + ERROR_INJECT_CRASH("crash_drop_partition_5") || ((!thd->lex->no_write_to_binlog) && (write_bin_log(thd, FALSE, thd->query, thd->query_length), FALSE)) || - ERROR_INJECT_CRASH("crash_drop_partition_7") || + ERROR_INJECT_CRASH("crash_drop_partition_6") || ((frm_install= TRUE), FALSE) || mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) || ((frm_install= FALSE), FALSE) || - ERROR_INJECT_CRASH("crash_drop_partition_8") || + ERROR_INJECT_CRASH("crash_drop_partition_7") || mysql_drop_partitions(lpt) || - ERROR_INJECT_CRASH("crash_drop_partition_9") || + ERROR_INJECT_CRASH("crash_drop_partition_8") || (write_log_completed(lpt, FALSE), FALSE) || - ERROR_INJECT_CRASH("crash_drop_partition_10") || - (release_name_lock(lpt), FALSE)) + ERROR_INJECT_CRASH("crash_drop_partition_9") || + (alter_partition_lock_handling(lpt), FALSE)) { handle_alter_part_error(lpt, not_completed, TRUE, frm_install); goto err; @@ -6283,7 +6261,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, name lock. 5) Close all tables that have already been opened but didn't stumble on the abort locked previously. This is done as part of the - get_name_lock call. + close_data_files_and_morph_locks call. 6) Close all table handlers and unlock all handlers but retain name lock 7) Write binlog 8) Now the change is completed except for the installation of the @@ -6293,7 +6271,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, added to the table. 10)Wait until all accesses using the old frm file has completed 11)Remove entries from ddl log - 12)Release name lock + 12)Reopen tables if under lock tables 13)Complete query */ if (write_log_add_change_partition(lpt) || @@ -6303,8 +6281,6 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, mysql_change_partitions(lpt) || ERROR_INJECT_CRASH("crash_add_partition_3") || abort_and_upgrade_lock(lpt) || /* Always returns 0 */ - ERROR_INJECT_CRASH("crash_add_partition_3") || - get_name_lock(lpt) || ERROR_INJECT_CRASH("crash_add_partition_4") || alter_close_tables(lpt) || ERROR_INJECT_CRASH("crash_add_partition_5") || @@ -6320,7 +6296,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ERROR_INJECT_CRASH("crash_add_partition_8") || (write_log_completed(lpt, FALSE), FALSE) || ERROR_INJECT_CRASH("crash_add_partition_9") || - (release_name_lock(lpt), FALSE)) + (alter_partition_lock_handling(lpt), FALSE)) { handle_alter_part_error(lpt, not_completed, FALSE, frm_install); goto err; @@ -6374,15 +6350,15 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, 7) Close all tables opened but not yet locked, after this call we are certain that no other thread is in the lock wait queue or has opened the table. The name lock will ensure that they are blocked - on the open call. This is achieved also by get_name_lock call. + on the open call. + This is achieved also by close_data_files_and_morph_locks call. 8) Close all partitions opened by this thread, but retain name lock. 9) Write bin log 10) Prepare handlers for rename and delete of partitions 11) Rename and drop the reorged partitions such that they are no longer used and rename those added to their real new names. 12) Install the shadow frm file - 13) Release the name lock to enable other threads to start using the - table again. + 13) Reopen the table if under lock tables 14) Complete query */ if (write_log_add_change_partition(lpt) || @@ -6396,24 +6372,22 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, (not_completed= FALSE) || abort_and_upgrade_lock(lpt) || /* Always returns 0 */ ERROR_INJECT_CRASH("crash_change_partition_5") || - get_name_lock(lpt) || - ERROR_INJECT_CRASH("crash_change_partition_6") || alter_close_tables(lpt) || - ERROR_INJECT_CRASH("crash_change_partition_7") || + ERROR_INJECT_CRASH("crash_change_partition_6") || ((!thd->lex->no_write_to_binlog) && (write_bin_log(thd, FALSE, thd->query, thd->query_length), FALSE)) || - ERROR_INJECT_CRASH("crash_change_partition_8") || + ERROR_INJECT_CRASH("crash_change_partition_7") || mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) || - ERROR_INJECT_CRASH("crash_change_partition_9") || + ERROR_INJECT_CRASH("crash_change_partition_8") || mysql_drop_partitions(lpt) || - ERROR_INJECT_CRASH("crash_change_partition_10") || + ERROR_INJECT_CRASH("crash_change_partition_9") || mysql_rename_partitions(lpt) || ((frm_install= TRUE), FALSE) || - ERROR_INJECT_CRASH("crash_change_partition_11") || + ERROR_INJECT_CRASH("crash_change_partition_10") || (write_log_completed(lpt, FALSE), FALSE) || - ERROR_INJECT_CRASH("crash_change_partition_12") || - (release_name_lock(lpt), FALSE)) + ERROR_INJECT_CRASH("crash_change_partition_11") || + (alter_partition_lock_handling(lpt), FALSE)) { handle_alter_part_error(lpt, not_completed, FALSE, frm_install); goto err; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 505bcd1b421..a0464d43372 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1226,8 +1226,12 @@ uint build_table_shadow_filename(char *buff, size_t bufflen, flags Flags as defined below WFRM_INITIAL_WRITE If set we need to prepare table before creating the frm file - WFRM_CREATE_HANDLER_FILES If set we need to create the handler file as - part of the creation of the frm file + WFRM_INSTALL_SHADOW If set we should install the new frm + WFRM_KEEP_SHARE If set we know that the share is to be + retained and thus we should ensure share + object is correct, if not set we don't + set the new partition syntax string since + we know the share object is destroyed. WFRM_PACK_FRM If set we should pack the frm file and delete the frm file @@ -1370,7 +1374,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) goto err; } #ifdef WITH_PARTITION_STORAGE_ENGINE - if (part_info) + if (part_info && (flags & WFRM_KEEP_SHARE)) { TABLE_SHARE *share= lpt->table->s; char *tmp_part_syntax_str; -- cgit v1.2.1 From 21e654a828fb553a05fa59ce1e24a9360e377835 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 16:11:43 +0100 Subject: BUG#33429: No check for maxvalue before adding partition mysql-test/r/partition_range.result: Added new test cases mysql-test/t/partition_range.test: Added new test cases sql/sql_partition.cc: Added check that last partition hasn't got maxvalue defined when executing ADD PARTITION --- mysql-test/r/partition_range.result | 11 +++++++++++ mysql-test/t/partition_range.test | 11 +++++++++++ sql/sql_partition.cc | 7 ++++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 4da79704ec3..bfc67d4947f 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,4 +1,15 @@ drop table if exists t1, t2; +create table t1 (a int) +partition by range (a) +( partition p0 values less than (maxvalue)); +alter table t1 add partition (partition p1 values less than (100000)); +ERROR HY000: MAXVALUE can only be used in last partition definition +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +drop table t1; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 6ed3abab46a..035a895dbab 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -9,6 +9,17 @@ drop table if exists t1, t2; --enable_warnings +# +# BUG 33429: Succeeds in adding partition when maxvalue on last partition +# +create table t1 (a int) +partition by range (a) +( partition p0 values less than (maxvalue)); +--error ER_PARTITION_MAXVALUE_ERROR +alter table t1 add partition (partition p1 values less than (100000)); +show create table t1; +drop table t1; + # # BUG 18198: Various tests for partition functions # diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index eabf4526f7b..36f1cc771a6 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4313,7 +4313,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, { my_error(ER_NO_BINLOG_ERROR, MYF(0)); DBUG_RETURN(TRUE); - } + } + if (tab_part_info->defined_max_value) + { + my_error(ER_PARTITION_MAXVALUE_ERROR, MYF(0)); + DBUG_RETURN(TRUE); + } if (no_new_partitions == 0) { my_error(ER_ADD_PARTITION_NO_NEW_PARTITION, MYF(0)); -- cgit v1.2.1 From bb091abb145f89e2332a5b49cbc221793bce3452 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Jan 2008 22:05:25 +0100 Subject: BUG#33182: Disallow division due to div_precision_increment problems mysql-test/r/partition.result: New test case to validate that '/' is no longer allowed, only integer division is allowed mysql-test/t/partition.test: New test case to validate that '/' is no longer allowed, only integer division is allowed sql/item_func.h: +,-,*, mod is allowed / is disallowed --- mysql-test/r/partition.result | 3 +++ mysql-test/t/partition.test | 4 ++++ sql/item_func.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index a361a8f6bcc..d3275cec922 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,4 +1,7 @@ drop table if exists t1; +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 CREATE TABLE t1 ( d DATE NOT NULL ) diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..7ca6f0f55d6 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -14,6 +14,10 @@ drop table if exists t1; --enable_warnings +--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)); + # # Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes the Server to crash. # diff --git a/sql/item_func.h b/sql/item_func.h index e09b584de95..c73b46f21e6 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -296,7 +296,6 @@ class Item_num_op :public Item_func_numhybrid void print(String *str) { print_op(str); } void find_num_type(); String *str_op(String *str) { DBUG_ASSERT(0); return 0; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -382,6 +381,7 @@ class Item_func_additive_op :public Item_num_op public: Item_func_additive_op(Item *a,Item *b) :Item_num_op(a,b) {} void result_precision(); + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -416,6 +416,7 @@ public: double real_op(); my_decimal *decimal_op(my_decimal *); void result_precision(); + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -456,6 +457,7 @@ public: const char *func_name() const { return "%"; } void result_precision(); void fix_length_and_dec(); + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; -- cgit v1.2.1 From 324d54170144dc8926258a13ef514a77ce170506 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Jan 2008 20:14:35 +0400 Subject: BUG#33871 - Duplicate "would" in Fulltext Stopwords Code cleanup: removed duplicate stopword. storage/myisam/ft_static.c: Code cleanup: removed duplicate stopword. --- storage/myisam/ft_static.c | 1 - 1 file changed, 1 deletion(-) diff --git a/storage/myisam/ft_static.c b/storage/myisam/ft_static.c index 610c20eede6..1b6c7458fd7 100644 --- a/storage/myisam/ft_static.c +++ b/storage/myisam/ft_static.c @@ -608,7 +608,6 @@ const char *ft_precompiled_stopwords[] = { "won't", "wonder", "would", - "would", "wouldn't", "yes", "yet", -- cgit v1.2.1 From 5177c97ec0e11b65227868d6cf98de3970262340 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 31 Jan 2008 18:51:20 +0400 Subject: BUG#22989 - START SLAVE causes Error on COM_REGISTER_SLAVE: 1105 'Wrong parameters to functi START SLAVE reports vague error when it fails to register on master: "Wrong parameters to function register_slave". If master failed to register slave because of too long 'report-host'/'report-user'/'report-password', return better error messages: "Failed to register slave: too long 'report-host'" "Failed to register slave: too long 'report-user'" "Failed to register slave; too long 'report-password'" No test case for this fix. sql/repl_failsafe.cc: Report descriptive error when master fails to register slave. --- sql/repl_failsafe.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 896315ec82f..f1826678c9f 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -109,11 +109,14 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status) } -#define get_object(p, obj) \ +#define get_object(p, obj, msg) \ {\ uint len = (uint)*p++; \ if (p + len > p_end || len >= sizeof(obj)) \ + {\ + errmsg= msg;\ goto err; \ + }\ strmake(obj,(char*) p,len); \ p+= len; \ }\ @@ -158,6 +161,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) int res; SLAVE_INFO *si; uchar *p= packet, *p_end= packet + packet_length; + const char *errmsg= "Wrong parameters to function register_slave"; if (check_access(thd, REPL_SLAVE_ACL, any_db,0,0,0,0)) return 1; @@ -166,9 +170,9 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) thd->server_id= si->server_id= uint4korr(p); p+= 4; - get_object(p,si->host); - get_object(p,si->user); - get_object(p,si->password); + get_object(p,si->host, "Failed to register slave: too long 'report-host'"); + get_object(p,si->user, "Failed to register slave: too long 'report-user'"); + get_object(p,si->password, "Failed to register slave; too long 'report-password'"); if (p+10 > p_end) goto err; si->port= uint2korr(p); @@ -187,8 +191,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) err: my_free((gptr) si, MYF(MY_WME)); - my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave", - MYF(0)); + my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); err2: return 1; } -- cgit v1.2.1 From 2bac240cf78642d7c5ee428f544286ad8f526df5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Feb 2008 15:13:56 +0100 Subject: Bug#34225: test suit parts uses /tmp-dir Since it used /tmp-dir, it continues to fail on the same server until the /tmp-dir is cleaned. (Another problem was that it uses DATA/INDEX DIR without checking for symlink, which is needed) Solution: Moved all DATA/INDEX DIR test to a new partition_basic_symlink.inc file and use this for myisam and innodb, also requiring symlinks and not_windows. (i.e. removed DATA/INDEX DIR use from several tests) mysql-test/suite/parts/inc/partition_basic.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_bigint.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_binary.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_bit.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_blob.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_char.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_date.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_datetime.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_decimal.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_double.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_enum.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_float.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_int.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_key_16col.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_key_32col.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_key_4col.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_key_8col.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_mediumint.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_set.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_smallint.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_text.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_time.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_timestamp.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_tinyint.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_varbinary.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_varchar.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_year.inc: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_basic_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_basic_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_bit_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_bit_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_char_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_char_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_datetime_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_datetime_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_decimal_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_decimal_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_float_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_float_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_int_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_int_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_special_innodb.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/r/partition_special_myisam.result: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/t/partition_sessions.test: Bug#34225: test suit parts uses /tmp-dir Removed the DATA/INDEX DIR, since the test is not dependent of it (adding "--source include/have_symlink.inc" would have disabled it on some platforms/configurations) mysql-test/suite/parts/inc/partition_basic_symlink.inc: Bug#34225: test suit parts uses /tmp-dir Added this test case for testing some DATA/INDEX DIRECTORY cases since I removed so much of it from all other tests. mysql-test/suite/parts/r/partition_basic_symlink_innodb.result: Bug#34225: test suit parts uses /tmp-dir Added this test case for testing some DATA/INDEX DIRECTORY cases since I removed so much of it from all other tests. mysql-test/suite/parts/r/partition_basic_symlink_myisam.result: Bug#34225: test suit parts uses /tmp-dir Added this test case for testing some DATA/INDEX DIRECTORY cases since I removed so much of it from all other tests. mysql-test/suite/parts/t/partition_basic_symlink_innodb.test: Bug#34225: test suit parts uses /tmp-dir Added this test case for testing some DATA/INDEX DIRECTORY cases since I removed so much of it from all other tests. mysql-test/suite/parts/t/partition_basic_symlink_myisam.test: Bug#34225: test suit parts uses /tmp-dir Added this test case for testing some DATA/INDEX DIRECTORY cases since I removed so much of it from all other tests. --- mysql-test/suite/parts/inc/partition_basic.inc | 45 - .../suite/parts/inc/partition_basic_symlink.inc | 159 + mysql-test/suite/parts/inc/partition_bigint.inc | 20 +- mysql-test/suite/parts/inc/partition_binary.inc | 20 +- mysql-test/suite/parts/inc/partition_bit.inc | 24 +- mysql-test/suite/parts/inc/partition_blob.inc | 20 +- mysql-test/suite/parts/inc/partition_char.inc | 20 +- mysql-test/suite/parts/inc/partition_date.inc | 20 +- mysql-test/suite/parts/inc/partition_datetime.inc | 20 +- mysql-test/suite/parts/inc/partition_decimal.inc | 20 +- mysql-test/suite/parts/inc/partition_double.inc | 20 +- mysql-test/suite/parts/inc/partition_enum.inc | 20 +- mysql-test/suite/parts/inc/partition_float.inc | 20 +- mysql-test/suite/parts/inc/partition_int.inc | 20 +- mysql-test/suite/parts/inc/partition_key_16col.inc | 20 +- mysql-test/suite/parts/inc/partition_key_32col.inc | 28 +- mysql-test/suite/parts/inc/partition_key_4col.inc | 20 +- mysql-test/suite/parts/inc/partition_key_8col.inc | 20 +- mysql-test/suite/parts/inc/partition_mediumint.inc | 20 +- mysql-test/suite/parts/inc/partition_set.inc | 20 +- mysql-test/suite/parts/inc/partition_smallint.inc | 20 +- mysql-test/suite/parts/inc/partition_text.inc | 20 +- mysql-test/suite/parts/inc/partition_time.inc | 20 +- mysql-test/suite/parts/inc/partition_timestamp.inc | 20 +- mysql-test/suite/parts/inc/partition_tinyint.inc | 20 +- mysql-test/suite/parts/inc/partition_varbinary.inc | 20 +- mysql-test/suite/parts/inc/partition_varchar.inc | 20 +- mysql-test/suite/parts/inc/partition_year.inc | 20 +- .../suite/parts/r/partition_basic_innodb.result | 6705 +--- .../suite/parts/r/partition_basic_myisam.result | 7131 +--- .../parts/r/partition_basic_symlink_innodb.result | 37465 +++++++++++++++++++ .../parts/r/partition_basic_symlink_myisam.result | 22911 ++++++++++++ .../suite/parts/r/partition_bit_innodb.result | 28 +- .../suite/parts/r/partition_bit_myisam.result | 28 +- .../suite/parts/r/partition_char_innodb.result | 140 +- .../suite/parts/r/partition_char_myisam.result | 140 +- .../suite/parts/r/partition_datetime_innodb.result | 90 +- .../suite/parts/r/partition_datetime_myisam.result | 90 +- .../suite/parts/r/partition_decimal_innodb.result | 18 +- .../suite/parts/r/partition_decimal_myisam.result | 18 +- .../suite/parts/r/partition_float_innodb.result | 36 +- .../suite/parts/r/partition_float_myisam.result | 36 +- .../suite/parts/r/partition_int_innodb.result | 90 +- .../suite/parts/r/partition_int_myisam.result | 90 +- .../suite/parts/r/partition_special_innodb.result | 88 +- .../suite/parts/r/partition_special_myisam.result | 88 +- .../parts/t/partition_basic_symlink_innodb.test | 84 + .../parts/t/partition_basic_symlink_myisam.test | 86 + mysql-test/suite/parts/t/partition_sessions.test | 31 +- 49 files changed, 61114 insertions(+), 15015 deletions(-) create mode 100644 mysql-test/suite/parts/inc/partition_basic_symlink.inc create mode 100644 mysql-test/suite/parts/r/partition_basic_symlink_innodb.result create mode 100644 mysql-test/suite/parts/r/partition_basic_symlink_myisam.result create mode 100644 mysql-test/suite/parts/t/partition_basic_symlink_innodb.test create mode 100644 mysql-test/suite/parts/t/partition_basic_symlink_myisam.test diff --git a/mysql-test/suite/parts/inc/partition_basic.inc b/mysql-test/suite/parts/inc/partition_basic.inc index a5815d3b71c..35b016d5ab2 100644 --- a/mysql-test/suite/parts/inc/partition_basic.inc +++ b/mysql-test/suite/parts/inc/partition_basic.inc @@ -30,29 +30,6 @@ let $unique= ; --source suite/parts/inc/partition_methods1.inc # - --echo # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY - # - --disable_query_log - # DATA DIRECTORY - # Make directory for partition data - --exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true - eval SET @data_dir = 'DATA DIRECTORY = - ''''$MYSQLTEST_VARDIR/master-data/test/data'''''; - let $data_directory = `select @data_dir`; - - #INDEX DIRECTORY - # Make directory for partition index - --exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true - eval SET @indx_dir = 'INDEX DIRECTORY = - ''''$MYSQLTEST_VARDIR/master-data/test/index'''''; - let $index_directory = `select @indx_dir`; - - let $with_directories= 1; - --source suite/parts/inc/partition_methods1.inc - --source suite/parts/inc/partition_directory.inc - let $with_directories= 0; - --enable_query_log - # --echo # 1.2 The partitioning function contains two columns. let $unique= ; --source suite/parts/inc/partition_methods2.inc @@ -72,28 +49,6 @@ if ($more_pk_ui_tests) --echo # 2.2 UNIQUE INDEX consisting of one column let $unique= , UNIQUE INDEX uidx1 (f_int1); --source suite/parts/inc/partition_methods1.inc - - --echo # 2.2.1 with DATA DIECTORY/INDEX DIRECTORY - # - --disable_query_log - # DATA DIRECTORY - # Make directory for partition data - --exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true - eval SET @data_dir = 'DATA DIRECTORY = - ''''$MYSQLTEST_VARDIR/master-data/test/data'''''; - let $data_directory = `select @data_dir`; - - #INDEX DIRECTORY - # Make directory for partition index - --exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true - eval SET @indx_dir = 'INDEX DIRECTORY = - ''''$MYSQLTEST_VARDIR/master-data/test/index'''''; - let $index_directory = `select @indx_dir`; - - let $with_directories= TRUE; - --source suite/parts/inc/partition_methods1.inc - let $with_directories= FALSE; - --enable_query_log # if ($do_pk_tests) { diff --git a/mysql-test/suite/parts/inc/partition_basic_symlink.inc b/mysql-test/suite/parts/inc/partition_basic_symlink.inc new file mode 100644 index 00000000000..22a61477388 --- /dev/null +++ b/mysql-test/suite/parts/inc/partition_basic_symlink.inc @@ -0,0 +1,159 @@ +################################################################################ +# inc/partition_basic_symlink.inc # +# # +# Purpose: # +# Basic tests around create partitioned table with/without PRIMARY KEY and # +# /or UNIQUE INDEX # +# Also includes test for DATA/INDEX DIR which requires symlinked files # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mattiasj # +# Change Date: 2008-02-06 # +# Change: copied it from partition_basic.inc and kept DATA/INDEX DIR # +################################################################################ +--enable_abort_on_error + +--echo +--echo #======================================================================== +--echo # Check partitioning methods on just created tables +--echo # The tables should be defined without/with PRIMARY KEY and +--echo # UNIQUE INDEXes. +--echo # Every test round has to check +--echo # PARTITION BY HASH/KEY/LIST/RANGE +--echo # PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... +--echo #======================================================================== +--echo #------------------------------------------------------------------------ +--echo # 1 Tables without PRIMARY KEY or UNIQUE INDEXes +--echo #------------------------------------------------------------------------ +--echo # 1.1 The partitioning function contains one column. +let $unique= ; +--source suite/parts/inc/partition_methods1.inc +# + --echo # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY + # + --disable_query_log + # DATA DIRECTORY + # Make directory for partition data + --exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true + eval SET @data_dir = 'DATA DIRECTORY = + ''''$MYSQLTEST_VARDIR/master-data/test/data'''''; + let $data_directory = `select @data_dir`; + + #INDEX DIRECTORY + # Make directory for partition index + --exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true + eval SET @indx_dir = 'INDEX DIRECTORY = + ''''$MYSQLTEST_VARDIR/master-data/test/index'''''; + let $index_directory = `select @indx_dir`; + + let $with_directories= 1; + --source suite/parts/inc/partition_methods1.inc + --source suite/parts/inc/partition_directory.inc + let $with_directories= 0; + --enable_query_log + # +--echo # 1.2 The partitioning function contains two columns. +let $unique= ; +--source suite/parts/inc/partition_methods2.inc +# +--echo #------------------------------------------------------------------------ +--echo # 2 Tables with PRIMARY KEY and/or UNIQUE INDEXes +--echo # The partitioning function contains one column. +--echo #------------------------------------------------------------------------ +if ($more_pk_ui_tests) +{ + if ($do_pk_tests) + { + --echo # 2.1 PRIMARY KEY consisting of one column + let $unique= , PRIMARY KEY(f_int1); + --source suite/parts/inc/partition_methods1.inc + } + --echo # 2.2 UNIQUE INDEX consisting of one column + let $unique= , UNIQUE INDEX uidx1 (f_int1); + --source suite/parts/inc/partition_methods1.inc + + --echo # 2.2.1 with DATA DIECTORY/INDEX DIRECTORY + # + --disable_query_log + # DATA DIRECTORY + # Make directory for partition data + --exec mkdir $MYSQLTEST_VARDIR/master-data/test/data || true + eval SET @data_dir = 'DATA DIRECTORY = + ''''$MYSQLTEST_VARDIR/master-data/test/data'''''; + let $data_directory = `select @data_dir`; + + #INDEX DIRECTORY + # Make directory for partition index + --exec mkdir $MYSQLTEST_VARDIR/master-data/test/index || true + eval SET @indx_dir = 'INDEX DIRECTORY = + ''''$MYSQLTEST_VARDIR/master-data/test/index'''''; + let $index_directory = `select @indx_dir`; + + let $with_directories= TRUE; + --source suite/parts/inc/partition_methods1.inc + let $with_directories= FALSE; + --enable_query_log + # + if ($do_pk_tests) + { + --echo # 2.3 PRIMARY KEY consisting of two columns + let $unique= , PRIMARY KEY(f_int1,f_int2); + --source suite/parts/inc/partition_methods1.inc + let $unique= , PRIMARY KEY(f_int2,f_int1); + --source suite/parts/inc/partition_methods1.inc + } + # + --echo # 2.4 UNIQUE INDEX consisting of two columns + let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); + --source suite/parts/inc/partition_methods1.inc + let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); + --source suite/parts/inc/partition_methods1.inc + # +} +--echo # 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns +if ($do_pk_tests) +{ + let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); + --source suite/parts/inc/partition_methods1.inc + let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); + --source suite/parts/inc/partition_methods1.inc +} +let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); +--source suite/parts/inc/partition_methods1.inc + +--echo #------------------------------------------------------------------------ +--echo # 3 Tables with PRIMARY KEY and/or UNIQUE INDEXes +--echo # The partitioning function contains two columns. +--echo #------------------------------------------------------------------------ +# +if ($more_pk_ui_tests) +{ + if ($do_pk_tests) + { + --echo # 3.1 PRIMARY KEY consisting of two columns + let $unique= , PRIMARY KEY(f_int1,f_int2); + --source suite/parts/inc/partition_methods2.inc + + let $unique= , PRIMARY KEY(f_int2,f_int1); + --source suite/parts/inc/partition_methods2.inc + } + # + --echo # 3.2 UNIQUE INDEX consisting of two columns + let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2); + --source suite/parts/inc/partition_methods2.inc + let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1); + --source suite/parts/inc/partition_methods2.inc +} +# +--echo # 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns +if ($do_pk_tests) +{ + let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1); + --source suite/parts/inc/partition_methods2.inc + let $unique= , UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2); + --source suite/parts/inc/partition_methods2.inc +} +let $unique= , UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1); +--source suite/parts/inc/partition_methods2.inc diff --git a/mysql-test/suite/parts/inc/partition_bigint.inc b/mysql-test/suite/parts/inc/partition_bigint.inc index f7d22ce17d1..d3cd55096e7 100644 --- a/mysql-test/suite/parts/inc/partition_bigint.inc +++ b/mysql-test/suite/parts/inc/partition_bigint.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a bigint unsigned not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_binary.inc b/mysql-test/suite/parts/inc/partition_binary.inc index 3ee363927c4..68e9e56e29e 100644 --- a/mysql-test/suite/parts/inc/partition_binary.inc +++ b/mysql-test/suite/parts/inc/partition_binary.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and binary data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a binary(255) not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select hex(a) from t1; diff --git a/mysql-test/suite/parts/inc/partition_bit.inc b/mysql-test/suite/parts/inc/partition_bit.inc index 6fcf3b208bb..3e37d7a68d1 100644 --- a/mysql-test/suite/parts/inc/partition_bit.inc +++ b/mysql-test/suite/parts/inc/partition_bit.inc @@ -1,15 +1,3 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - --disable_warnings drop table if exists t1; --enable_warnings @@ -23,8 +11,8 @@ drop table t1; eval create table t1 (a bit(0), primary key (a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory, -partition pa2 $data_directory $index_directory); +partition pa1, +partition pa2); show create table t1; drop table t1; @@ -42,10 +30,10 @@ drop table t1; eval create table t1 (a bit(64), primary key (a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), diff --git a/mysql-test/suite/parts/inc/partition_blob.inc b/mysql-test/suite/parts/inc/partition_blob.inc index b22693c9f3d..0c3ec3fc9ba 100644 --- a/mysql-test/suite/parts/inc/partition_blob.inc +++ b/mysql-test/suite/parts/inc/partition_blob.inc @@ -1,24 +1,12 @@ --echo ---- Partitioning and blob data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR eval create table t1 (a blob not null, primary key(a(767))) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; #insert into t1 values (repeat('a',1000)), ('b'), (repeat('a',500)), (repeat('b',64)); diff --git a/mysql-test/suite/parts/inc/partition_char.inc b/mysql-test/suite/parts/inc/partition_char.inc index b3d7ae3c2a1..1db9642c002 100644 --- a/mysql-test/suite/parts/inc/partition_char.inc +++ b/mysql-test/suite/parts/inc/partition_char.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and char data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a char(255) not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_date.inc b/mysql-test/suite/parts/inc/partition_date.inc index 45f9012604c..b538a5a9d8b 100644 --- a/mysql-test/suite/parts/inc/partition_date.inc +++ b/mysql-test/suite/parts/inc/partition_date.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a date not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_datetime.inc b/mysql-test/suite/parts/inc/partition_datetime.inc index e948e827b4e..b9b277a0fcc 100644 --- a/mysql-test/suite/parts/inc/partition_datetime.inc +++ b/mysql-test/suite/parts/inc/partition_datetime.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a datetime not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc index 09eb9b10831..17cef08e275 100644 --- a/mysql-test/suite/parts/inc/partition_decimal.inc +++ b/mysql-test/suite/parts/inc/partition_decimal.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a decimal(10,4) not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc index 57be826bac7..befbe860b86 100644 --- a/mysql-test/suite/parts/inc/partition_double.inc +++ b/mysql-test/suite/parts/inc/partition_double.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a double not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_enum.inc b/mysql-test/suite/parts/inc/partition_enum.inc index 886ab6a5f97..9f2c5976097 100644 --- a/mysql-test/suite/parts/inc/partition_enum.inc +++ b/mysql-test/suite/parts/inc/partition_enum.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and enum data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a enum('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('A'),('D'),('L'),('G'); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc index 45c2f16ac98..34f14137d4d 100644 --- a/mysql-test/suite/parts/inc/partition_float.inc +++ b/mysql-test/suite/parts/inc/partition_float.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a float not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_int.inc b/mysql-test/suite/parts/inc/partition_int.inc index 7f019c96b94..bd9da689187 100644 --- a/mysql-test/suite/parts/inc/partition_int.inc +++ b/mysql-test/suite/parts/inc/partition_int.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a int unsigned not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_key_16col.inc b/mysql-test/suite/parts/inc/partition_key_16col.inc index 5f97d5d0f71..988dc4554ab 100644 --- a/mysql-test/suite/parts/inc/partition_key_16col.inc +++ b/mysql-test/suite/parts/inc/partition_key_16col.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine=$engine partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), diff --git a/mysql-test/suite/parts/inc/partition_key_32col.inc b/mysql-test/suite/parts/inc/partition_key_32col.inc index 90a36d2a228..614693902dc 100644 --- a/mysql-test/suite/parts/inc/partition_key_32col.inc +++ b/mysql-test/suite/parts/inc/partition_key_32col.inc @@ -1,29 +1,17 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - --error ER_TOO_MANY_KEY_PARTS eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine=$engine partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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); eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine=$engine partition by key(a,b,c,d,e,f,g,h) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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); --disable_abort_on error show create table t1; diff --git a/mysql-test/suite/parts/inc/partition_key_4col.inc b/mysql-test/suite/parts/inc/partition_key_4col.inc index c5d1452080f..a94ab581620 100644 --- a/mysql-test/suite/parts/inc/partition_key_4col.inc +++ b/mysql-test/suite/parts/inc/partition_key_4col.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w'), primary key(a,b,c,d)) engine=$engine partition by key (a,b,c,d) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), diff --git a/mysql-test/suite/parts/inc/partition_key_8col.inc b/mysql-test/suite/parts/inc/partition_key_8col.inc index a0d2e1532f3..fcbab7c355d 100644 --- a/mysql-test/suite/parts/inc/partition_key_8col.inc +++ b/mysql-test/suite/parts/inc/partition_key_8col.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h)) engine=$engine partition by key(a,b,c,d,e,f,g,h) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), diff --git a/mysql-test/suite/parts/inc/partition_mediumint.inc b/mysql-test/suite/parts/inc/partition_mediumint.inc index 18bfedf7ed9..10ed96e52b0 100644 --- a/mysql-test/suite/parts/inc/partition_mediumint.inc +++ b/mysql-test/suite/parts/inc/partition_mediumint.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a mediumint unsigned not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_set.inc b/mysql-test/suite/parts/inc/partition_set.inc index b9501ad04b6..8b8c3c9ddf5 100644 --- a/mysql-test/suite/parts/inc/partition_set.inc +++ b/mysql-test/suite/parts/inc/partition_set.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and set data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a set('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K'); select * from t1 order by a; diff --git a/mysql-test/suite/parts/inc/partition_smallint.inc b/mysql-test/suite/parts/inc/partition_smallint.inc index c594cd4c26c..8e5e93f079b 100644 --- a/mysql-test/suite/parts/inc/partition_smallint.inc +++ b/mysql-test/suite/parts/inc/partition_smallint.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a smallint unsigned not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_text.inc b/mysql-test/suite/parts/inc/partition_text.inc index 761f5dfb118..f766027773d 100644 --- a/mysql-test/suite/parts/inc/partition_text.inc +++ b/mysql-test/suite/parts/inc/partition_text.inc @@ -1,24 +1,12 @@ --echo ---- Partitioning and text data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR eval create table t1 (a text not null, primary key(a(767))) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; #insert into t1 values (repeat('a',1000)), ('b'), (repeat('a',500)), (repeat('b',64)); diff --git a/mysql-test/suite/parts/inc/partition_time.inc b/mysql-test/suite/parts/inc/partition_time.inc index a3f49a156fe..008963ed934 100644 --- a/mysql-test/suite/parts/inc/partition_time.inc +++ b/mysql-test/suite/parts/inc/partition_time.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a time not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_timestamp.inc b/mysql-test/suite/parts/inc/partition_timestamp.inc index d4b1699d6c5..d152c82a76f 100644 --- a/mysql-test/suite/parts/inc/partition_timestamp.inc +++ b/mysql-test/suite/parts/inc/partition_timestamp.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a timestamp not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_tinyint.inc b/mysql-test/suite/parts/inc/partition_tinyint.inc index a1f8874e794..00568eec244 100644 --- a/mysql-test/suite/parts/inc/partition_tinyint.inc +++ b/mysql-test/suite/parts/inc/partition_tinyint.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a tinyint unsigned not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_varbinary.inc b/mysql-test/suite/parts/inc/partition_varbinary.inc index 48fd6d890d8..02d9f68f1a2 100644 --- a/mysql-test/suite/parts/inc/partition_varbinary.inc +++ b/mysql-test/suite/parts/inc/partition_varbinary.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and varbinary data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a varbinary(767) not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_varchar.inc b/mysql-test/suite/parts/inc/partition_varchar.inc index c018a16e919..f1412d3aae5 100644 --- a/mysql-test/suite/parts/inc/partition_varchar.inc +++ b/mysql-test/suite/parts/inc/partition_varchar.inc @@ -1,23 +1,11 @@ --echo ---- Partitioning and varchar data type ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a varchar(767) not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; diff --git a/mysql-test/suite/parts/inc/partition_year.inc b/mysql-test/suite/parts/inc/partition_year.inc index 2643380702e..5fb46c1756b 100644 --- a/mysql-test/suite/parts/inc/partition_year.inc +++ b/mysql-test/suite/parts/inc/partition_year.inc @@ -1,21 +1,9 @@ ---disable_query_log -# DATA DIRECTORY -eval SET @data_dir = 'DATA DIRECTORY = -''/tmp'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -eval SET @indx_dir = 'INDEX DIRECTORY = -''/tmp'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - eval create table t1 (a year not null, primary key(a)) engine=$engine partition by key (a) ( -partition pa1 $data_directory $index_directory max_rows=20 min_rows=2, -partition pa2 $data_directory $index_directory max_rows=30 min_rows=3, -partition pa3 $data_directory $index_directory max_rows=30 min_rows=4, -partition pa4 $data_directory $index_directory 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; insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index b9097e33ce0..894a57b2357 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -3597,6675 +3597,6 @@ 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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -# 1.1.1 with DATA DIECTORY/INDEX DIRECTORY -INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -DROP TABLE IF EXISTS 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; -# 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) PARTITIONS 2 */ - -# 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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) PARTITIONS 5 */ - -# 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 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 status OK -# check layout success: 1 -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; -# Attention: There are unused files. -# Either the DROP TABLE or a preceding ALTER TABLE -# worked incomplete. -# We found: -unified filelist ---- not determined --- -INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK -# check layout success: 1 -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) @@ -14878,7 +8209,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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 @@ -15360,7 +8691,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15840,7 +9171,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16322,7 +9653,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16802,7 +10133,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17284,7 +10615,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18731,7 +12062,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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 @@ -19213,7 +12544,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19693,7 +13024,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20175,7 +13506,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20655,7 +13986,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21137,7 +14468,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22616,7 +15947,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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 @@ -23114,7 +16445,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23610,7 +16941,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24108,7 +17439,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24604,7 +17935,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ +) 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)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25102,7 +18433,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ +) 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) */ # 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 7e0d5bcd62a..120db1274af 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -3711,7125 +3711,6 @@ 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.1.1 with DATA DIECTORY/INDEX DIRECTORY -INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI - -# 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 -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI - -# 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 -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI - -# 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 -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI - -# 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 -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI - -# 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 -state new -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI - -# 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 -state new -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI - -# 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 -state new -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ -File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE 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; -# 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI - -# 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 -state new -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI -# check layout success: 0 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair status OK -state new -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI -# check layout success: 0 -TRUNCATE t1; - -# check TRUNCATE success: 1 -state new -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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 -state old -Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ -File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI -# check layout success: 0 -# End usability test (inc/partition_check.inc) -DROP TABLE t1; -DROP TABLE IF EXISTS 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; -# 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) 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 - -# 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; -INSERT INTO t1(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 (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) 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 - -# 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; -INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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; -INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 - -# 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; -INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 - -# 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; -INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 - -# 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; -INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 - -# 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) @@ -15638,7 +8519,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) 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 @@ -16152,7 +9033,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) 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 @@ -16660,7 +9541,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) 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 @@ -17174,7 +10055,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) 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 @@ -17686,7 +10567,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +) 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 @@ -18200,7 +11081,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) -) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +) 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 diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result new file mode 100644 index 00000000000..b9097e33ce0 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result @@ -0,0 +1,37465 @@ +SET @max_row = 20; +SET @@session.storage_engine = 'InnoDB'; + +#------------------------------------------------------------------------ +# 0. Setting of auxiliary variables + Creation of an auxiliary tables +# needed in many testcases +#------------------------------------------------------------------------ +SELECT @max_row DIV 2 INTO @max_row_div2; +SELECT @max_row DIV 3 INTO @max_row_div3; +SELECT @max_row DIV 4 INTO @max_row_div4; +SET @max_int_4 = 2147483647; +DROP TABLE IF EXISTS t0_template; +CREATE TABLE t0_template ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) , +PRIMARY KEY(f_int1)) +ENGINE = MEMORY; +# Logging of INSERTs into t0_template suppressed +DROP TABLE IF EXISTS t0_definition; +CREATE TABLE t0_definition ( +state CHAR(3), +create_command VARBINARY(5000), +file_list VARBINARY(10000), +PRIMARY KEY (state) +) ENGINE = MEMORY; +DROP TABLE IF EXISTS t0_aux; +CREATE TABLE t0_aux ( f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) ) +ENGINE = MEMORY; +SET AUTOCOMMIT= 1; +SET @@session.sql_mode= ''; +# End of basic preparations needed for all tests +#----------------------------------------------- + +#======================================================================== +# Check partitioning methods on just created tables +# The tables should be defined without/with PRIMARY KEY and +# UNIQUE INDEXes. +# Every test round has to check +# PARTITION BY HASH/KEY/LIST/RANGE +# PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... +#======================================================================== +#------------------------------------------------------------------------ +# 1 Tables without PRIMARY KEY or UNIQUE INDEXes +#------------------------------------------------------------------------ +# 1.1 The partitioning function contains one column. +DROP TABLE IF EXISTS 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; +# 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) PARTITIONS 2 */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) PARTITIONS 5 */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 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) */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 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) */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 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)) */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 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)) */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +# 1.1.1 with DATA DIECTORY/INDEX DIRECTORY +INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +DROP TABLE IF EXISTS 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; +# 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) PARTITIONS 2 */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) PARTITIONS 5 */ + +# 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +# 1.2 The partitioning function contains two columns. +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 + f_int2) 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 (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 + f_int2) PARTITIONS 2 */ + +# 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 status OK +# check layout success: 1 +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,f_int2) PARTITIONS 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; +# 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,f_int2) PARTITIONS 5 */ + +# 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 status OK +# check layout success: 1 +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 + f_int2,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; +# 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 + 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) */ + +# 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 status OK +# check layout success: 1 +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 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# 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 + 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) */ + +# 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 status OK +# check layout success: 1 +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 HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# 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 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) */ + +# 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 status OK +# check layout success: 1 +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_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# 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_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)) */ + +# 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 status OK +# check layout success: 1 +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_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# 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_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)) */ + +# 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 status OK +# check layout success: 1 +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_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# 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_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 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 status OK +# check layout success: 1 +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 Tables with PRIMARY KEY and/or UNIQUE INDEXes +# The partitioning function contains one column. +#------------------------------------------------------------------------ +# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns +DROP TABLE IF EXISTS 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +DROP TABLE IF EXISTS 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +DROP TABLE IF EXISTS 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +#------------------------------------------------------------------------ +# 3 Tables with PRIMARY KEY and/or UNIQUE INDEXes +# The partitioning function contains two columns. +#------------------------------------------------------------------------ +# 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY HASH(f_int1 + f_int2) 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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY KEY(f_int1,f_int2) PARTITIONS 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +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 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY RANGE((f_int1 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int2`,`f_int1`), + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY HASH(f_int1 + f_int2) 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 (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY KEY(f_int1,f_int2) PARTITIONS 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +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 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY RANGE((f_int1 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) NOT NULL DEFAULT '0', + `f_int2` int(11) NOT NULL DEFAULT '0', + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL, + PRIMARY KEY (`f_int1`,`f_int2`), + UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +ERROR 23000: Column 'f_int1' cannot be null +# check null 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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY HASH(f_int1 + f_int2) 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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY KEY(f_int1,f_int2) PARTITIONS 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +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 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE((f_int1 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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)) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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) */ + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 status OK +# check layout success: 1 +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; +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t0_aux; +DROP TABLE IF EXISTS t0_definition; +DROP TABLE IF EXISTS t0_template; diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result new file mode 100644 index 00000000000..7e0d5bcd62a --- /dev/null +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -0,0 +1,22911 @@ +SET @max_row = 20; +SET @@session.storage_engine = 'MyISAM'; + +#------------------------------------------------------------------------ +# 0. Setting of auxiliary variables + Creation of an auxiliary tables +# needed in many testcases +#------------------------------------------------------------------------ +SELECT @max_row DIV 2 INTO @max_row_div2; +SELECT @max_row DIV 3 INTO @max_row_div3; +SELECT @max_row DIV 4 INTO @max_row_div4; +SET @max_int_4 = 2147483647; +DROP TABLE IF EXISTS t0_template; +CREATE TABLE t0_template ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) , +PRIMARY KEY(f_int1)) +ENGINE = MEMORY; +# Logging of INSERTs into t0_template suppressed +DROP TABLE IF EXISTS t0_definition; +CREATE TABLE t0_definition ( +state CHAR(3), +create_command VARBINARY(5000), +file_list VARBINARY(10000), +PRIMARY KEY (state) +) ENGINE = MEMORY; +DROP TABLE IF EXISTS t0_aux; +CREATE TABLE t0_aux ( f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) ) +ENGINE = MEMORY; +SET AUTOCOMMIT= 1; +SET @@session.sql_mode= ''; +# End of basic preparations needed for all tests +#----------------------------------------------- + +#======================================================================== +# Check partitioning methods on just created tables +# The tables should be defined without/with PRIMARY KEY and +# UNIQUE INDEXes. +# Every test round has to check +# PARTITION BY HASH/KEY/LIST/RANGE +# PARTITION BY RANGE/LIST ... SUBPARTITION BY HASH/KEY ... +#======================================================================== +#------------------------------------------------------------------------ +# 1 Tables without PRIMARY KEY or UNIQUE INDEXes +#------------------------------------------------------------------------ +# 1.1 The partitioning function contains one column. +DROP TABLE IF EXISTS 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; +# 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) 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 + +# 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; +INSERT INTO t1(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 (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) 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 + +# 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; +INSERT INTO t1(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 (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; +INSERT INTO t1(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 (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 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 + +# 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; +INSERT INTO t1(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 (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 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 + +# 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; +INSERT INTO t1(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 (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 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 + +# 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; +INSERT INTO t1(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 (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 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 + +# 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; +INSERT INTO t1(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 (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 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 + +# 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.1.1 with DATA DIECTORY/INDEX DIRECTORY +INSERT INTO t1(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 (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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#p1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI + +# 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 +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#p1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI + +# 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 +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#p1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p4.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#p5.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#p1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p4.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#p5.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI + +# 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 +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_3.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part_N.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_3.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part_N.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI + +# 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 +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parte.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partf.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parte.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partf.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI + +# 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 +state new +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#parta#SP#partasp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#parta#SP#partasp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partb#SP#partbsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partc#SP#partcsp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#partd#SP#partdsp1.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#parta#SP#partasp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partb#SP#partbsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partc#SP#partcsp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI + +# 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 +state new +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#subpart11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#subpart12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#subpart22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#subpart32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#subpart42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#subpart12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#subpart22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#subpart32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#subpart42.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI + +# 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 +state new +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ +File list 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/master-data/test/data/t1#P#part1#SP#sp11.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#sp12.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp21.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#sp22.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp31.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#sp32.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp41.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part4#SP#sp42.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp11.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#sp12.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp21.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#sp22.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp31.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#sp32.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp41.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part4#SP#sp42.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE 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; +# 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI + +# 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 +state new +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +# check layout success: 0 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +state new +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +# check layout success: 0 +TRUNCATE t1; + +# check TRUNCATE success: 1 +state new +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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 +state old +Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ +File list 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/master-data/test/data/t1#P#part1#SP#part1sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part1#SP#part1sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part2#SP#part2sp2.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp0.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp1.MYD MYSQLTEST_VARDIR/master-data/test/data/t1#P#part3#SP#part3sp2.MYD MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part1#SP#part1sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part2#SP#part2sp2.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp0.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp1.MYI MYSQLTEST_VARDIR/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +# check layout success: 0 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +DROP TABLE IF EXISTS 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; +# 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) 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 + +# 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; +INSERT INTO t1(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 (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) 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 + +# 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; +INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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; +INSERT INTO t1(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 (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) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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; +INSERT INTO t1(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 (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 parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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; +INSERT INTO t1(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 (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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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; +INSERT INTO t1(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 (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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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.2 The partitioning function contains two columns. +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 + f_int2) 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 (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 + 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 + +# 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,f_int2) PARTITIONS 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; +# 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,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 + +# 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 + f_int2,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; +# 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 + 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 + +# 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 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# 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 + 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 + +# 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) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# 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 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 + +# 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) SUBPARTITION BY KEY(f_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# 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_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 + +# 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_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# 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_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 + +# 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_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# 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_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 + +# 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 Tables with PRIMARY KEY and/or UNIQUE INDEXes +# The partitioning function contains one column. +#------------------------------------------------------------------------ +# 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns +DROP TABLE IF EXISTS 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +INSERT INTO t1(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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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 Tables with PRIMARY KEY and/or UNIQUE INDEXes +# The partitioning function contains two columns. +#------------------------------------------------------------------------ +# 3.3 PRIMARY KEY and UNIQUE INDEX consisting of two columns +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY HASH(f_int1 + f_int2) 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 (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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY KEY(f_int1,f_int2) PARTITIONS 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +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 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE((f_int1 + f_int2) DIV 2) +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd VALUES LESS THAN (10 + 5), +PARTITION parte VALUES LESS THAN (20), +PARTITION partf 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2 +(PARTITION parta VALUES LESS THAN (0), +PARTITION partb VALUES LESS THAN (5), +PARTITION partc VALUES LESS THAN (10), +PARTITION partd 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2) +(PARTITION part1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part4 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int2 + 1) +(PARTITION part1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part4 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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) +, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3 +(PARTITION part1 VALUES IN (0), + 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; +# 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, + UNIQUE KEY `uidx1` (`f_int1`,`f_int2`), + UNIQUE KEY `uidx2` (`f_int2`,`f_int1`) +) 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 + +# 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); +ERROR 23000: Can't write; duplicate key in table 't1' +# check prerequisites-3 success: 1 +# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, 2 * @max_row + f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR), +CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# 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 COUNT(*) INTO @try_count FROM t0_template +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +SELECT COUNT(*) INTO @clash_count +FROM t1 INNER JOIN t0_template USING(f_int1) +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row; +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#'; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 +AND f_int1 BETWEEN @max_row_div2 AND @max_row +ON DUPLICATE KEY +UPDATE f_int1 = 2 * @max_row + source_tab.f_int1, +f_int2 = 2 * @max_row + source_tab.f_int1, +f_charbig = 'was updated'; + +# check unique-1-a success: 1 + +# check unique-1-b success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'===') +WHERE f_charbig = 'was updated'; +REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, - f_int1, '', '', 'was inserted or replaced' + FROM t0_template source_tab +WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row; + +# check replace success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4; +DELETE FROM t1 +WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND +f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row; +UPDATE t1 SET f_int2 = f_int1, +f_char1 = CAST(f_int1 AS CHAR), +f_char2 = CAST(f_int1 AS CHAR), +f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===') +WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2; +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; +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t0_aux; +DROP TABLE IF EXISTS t0_definition; +DROP TABLE IF EXISTS t0_template; diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result index 9f6403090ee..6920519e4db 100644 --- a/mysql-test/suite/parts/r/partition_bit_innodb.result +++ b/mysql-test/suite/parts/r/partition_bit_innodb.result @@ -12,18 +12,14 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp', -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp'); +partition pa1, +partition pa2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL DEFAULT '\0', PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = InnoDB, PARTITION pa2 ENGINE = InnoDB) */ drop table t1; create table t1 (a bit(64), primary key (a)) engine='INNODB' partition by key (a) partitions 2; @@ -49,24 +45,16 @@ FFFFFFFFFFFFFFFF drop table t1; create table t1 (a bit(64), primary key (a)) engine='INNODB' 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` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result index e5b31e0c154..ed76c67baa3 100644 --- a/mysql-test/suite/parts/r/partition_bit_myisam.result +++ b/mysql-test/suite/parts/r/partition_bit_myisam.result @@ -12,18 +12,14 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp', -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp'); +partition pa1, +partition pa2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bit(1) NOT NULL DEFAULT '\0', PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 ENGINE = MyISAM, PARTITION pa2 ENGINE = MyISAM) */ drop table t1; create table t1 (a bit(64), primary key (a)) engine='MyISAM' partition by key (a) partitions 2; @@ -49,24 +45,16 @@ FFFFFFFFFFFFFFFF drop table t1; create table t1 (a bit(64), primary key (a)) engine='MyISAM' 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` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (b'1111111111111111111111111111111111111111111111111111111111111111'), (b'1000000000000000000000000000000000000000000000000000000000000000'), diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result index c9609537f08..455ff0353ed 100644 --- a/mysql-test/suite/parts/r/partition_char_innodb.result +++ b/mysql-test/suite/parts/r/partition_char_innodb.result @@ -1,24 +1,16 @@ ---- Partitioning and char data type create table t1 (a char(255) not null, primary key(a)) engine='InnoDB' 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` char(255) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select * from t1; a @@ -107,24 +99,16 @@ drop table t2; ---- Partitioning and binary data type create table t1 (a binary(255) not null, primary key(a)) engine='InnoDB' 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` binary(255) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select hex(a) from t1; hex(a) @@ -216,24 +200,16 @@ drop table t2; ---- Partitioning and varchar data type create table t1 (a varchar(767) not null, primary key(a)) engine='InnoDB' 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` varchar(767) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -322,24 +298,16 @@ drop table t2; ---- Partitioning and varbinary data type create table t1 (a varbinary(767) not null, primary key(a)) engine='InnoDB' 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` varbinary(767) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -428,24 +396,16 @@ drop table t2; ---- Partitioning and enum data type create table t1 (a enum('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='InnoDB' 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` enum('A','B','C','D','E','F','G','H','I','J','K','L') 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('A'),('D'),('L'),('G'); select * from t1; a @@ -558,24 +518,16 @@ drop table t2; ---- Partitioning and set data type create table t1 (a set('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='InnoDB' 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` set('A','B','C','D','E','F','G','H','I','J','K','L') 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K'); select * from t1 order by a; a @@ -727,18 +679,10 @@ drop table t2; ---- Partitioning and blob data type create table t1 (a blob not null, primary key(a(767))) engine='InnoDB' 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); ERROR HY000: A BLOB field is not allowed in partition function create table t2 (a blob not null, primary key(a(767))) engine='InnoDB' partition by key (a) partitions 30; @@ -755,18 +699,10 @@ ERROR HY000: A BLOB field is not allowed in partition function ---- Partitioning and text data type create table t1 (a text not null, primary key(a(767))) engine='InnoDB' 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); ERROR HY000: A BLOB field is not allowed in partition function create table t2 (a tinytext not null, primary key(a(767))) engine='InnoDB' partition by key (a) partitions 30; diff --git a/mysql-test/suite/parts/r/partition_char_myisam.result b/mysql-test/suite/parts/r/partition_char_myisam.result index 1009f52348d..af25f4b19a4 100644 --- a/mysql-test/suite/parts/r/partition_char_myisam.result +++ b/mysql-test/suite/parts/r/partition_char_myisam.result @@ -1,24 +1,16 @@ ---- Partitioning and char data type create table t1 (a char(255) not null, primary key(a)) engine='MyISAM' 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` char(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select * from t1; a @@ -107,24 +99,16 @@ drop table t2; ---- Partitioning and binary data type create table t1 (a binary(255) not null, primary key(a)) engine='MyISAM' 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` binary(255) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (repeat('a',255)), ('b'), (repeat('a',128)), (repeat('b',64)); select hex(a) from t1; hex(a) @@ -216,24 +200,16 @@ drop table t2; ---- Partitioning and varchar data type create table t1 (a varchar(767) not null, primary key(a)) engine='MyISAM' 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` varchar(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -322,24 +298,16 @@ drop table t2; ---- Partitioning and varbinary data type create table t1 (a varbinary(767) not null, primary key(a)) engine='MyISAM' 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` varbinary(767) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (repeat('a',767)), ('b'), (repeat('a',500)), (repeat('b',64)); select * from t1; a @@ -428,24 +396,16 @@ drop table t2; ---- Partitioning and enum data type create table t1 (a enum('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='MyISAM' 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` enum('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('A'),('D'),('L'),('G'); select * from t1; a @@ -558,24 +518,16 @@ drop table t2; ---- Partitioning and set data type create table t1 (a set('A','B','C','D','E','F','G','H','I','J','K','L') not null, primary key(a)) engine='MyISAM' 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` set('A','B','C','D','E','F','G','H','I','J','K','L') NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('A,B'),('C,D'),('E,L'),('G,H,K'); select * from t1 order by a; a @@ -727,18 +679,10 @@ drop table t2; ---- Partitioning and blob data type create table t1 (a blob not null, primary key(a(767))) engine='MyISAM' 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); ERROR HY000: A BLOB field is not allowed in partition function create table t2 (a blob not null, primary key(a(767))) engine='MyISAM' partition by key (a) partitions 30; @@ -755,18 +699,10 @@ ERROR HY000: A BLOB field is not allowed in partition function ---- Partitioning and text data type create table t1 (a text not null, primary key(a(767))) engine='MyISAM' 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); ERROR HY000: A BLOB field is not allowed in partition function create table t2 (a tinytext not null, primary key(a(767))) engine='MyISAM' partition by key (a) partitions 30; diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index 4ced059ba9e..0d95df98bbf 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -1,23 +1,15 @@ create table t1 (a timestamp not null, primary key(a)) engine='InnoDB' 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` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -281,24 +273,16 @@ a drop table t4; create table t1 (a date not null, primary key(a)) engine='InnoDB' 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` date 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -608,24 +592,16 @@ a drop table t4; create table t1 (a time not null, primary key(a)) engine='InnoDB' 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` time 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -1073,24 +1049,16 @@ a drop table t4; create table t1 (a datetime not null, primary key(a)) engine='InnoDB' 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` datetime 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -1350,24 +1318,16 @@ a drop table t4; create table t1 (a year not null, primary key(a)) engine='InnoDB' 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` year(4) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 7e05d368cf8..4bb182281c4 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -1,23 +1,15 @@ create table t1 (a timestamp not null, primary key(a)) engine='MyISAM' 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` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -281,24 +273,16 @@ a drop table t4; create table t1 (a date not null, primary key(a)) engine='MyISAM' 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` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15'); select * from t1; a @@ -608,24 +592,16 @@ a drop table t4; create table t1 (a time not null, primary key(a)) engine='MyISAM' 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` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59'); select * from t1; a @@ -1073,24 +1049,16 @@ a drop table t4; create table t1 (a datetime not null, primary key(a)) engine='MyISAM' 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` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59'); select * from t1; a @@ -1350,24 +1318,16 @@ a drop table t4; create table t1 (a year not null, primary key(a)) engine='MyISAM' 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` year(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975'), (2020), ('1980'), ('2000'); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index c0a165cf189..3aede5bb09b 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -1,23 +1,15 @@ create table t1 (a decimal(10,4) not null, primary key(a)) engine='InnoDB' 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` decimal(10,4) 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index 4d06f4d7b38..4ed9b94d008 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -1,23 +1,15 @@ create table t1 (a decimal(10,4) not null, primary key(a)) engine='MYISAM' 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` decimal(10,4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result index c203fabfd87..8e1e1b51efd 100644 --- a/mysql-test/suite/parts/r/partition_float_innodb.result +++ b/mysql-test/suite/parts/r/partition_float_innodb.result @@ -1,23 +1,15 @@ create table t1 (a float not null, primary key(a)) engine='InnoDB' 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` float 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -91,24 +83,16 @@ count(*) drop table t2; create table t1 (a double not null, primary key(a)) engine='InnoDB' 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` double 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result index 13881548473..9abd0fb11cd 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -1,23 +1,15 @@ create table t1 (a float not null, primary key(a)) engine='MYISAM' 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` float NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5); select * from t1; a @@ -91,24 +83,16 @@ count(*) drop table t2; create table t1 (a double not null, primary key(a)) engine='MYISAM' 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` double NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result index 8bc095b2886..9f1712e141e 100644 --- a/mysql-test/suite/parts/r/partition_int_innodb.result +++ b/mysql-test/suite/parts/r/partition_int_innodb.result @@ -1,23 +1,15 @@ create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -108,24 +100,16 @@ a drop table t3; create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB' 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -216,24 +200,16 @@ a drop table t3; create table t1 (a int unsigned not null, primary key(a)) engine='InnoDB' 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -324,24 +300,16 @@ a drop table t3; create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -432,24 +400,16 @@ a drop table t3; create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB' 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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index 7f16cdb207a..1e0ba724f4c 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -1,23 +1,15 @@ create table t1 (a tinyint unsigned not null, primary key(a)) engine='MYISAM' 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=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a @@ -108,24 +100,16 @@ a drop table t3; create table t1 (a smallint unsigned not null, primary key(a)) engine='MYISAM' 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=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -216,24 +200,16 @@ a drop table t3; create table t1 (a int unsigned not null, primary key(a)) engine='MYISAM' 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=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a @@ -324,24 +300,16 @@ a drop table t3; create table t1 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' 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=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a @@ -432,24 +400,16 @@ a drop table t3; create table t1 (a bigint unsigned not null, primary key(a)) engine='MYISAM' 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=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result index 4b139bb0f9e..fa1d2eb9994 100644 --- a/mysql-test/suite/parts/r/partition_special_innodb.result +++ b/mysql-test/suite/parts/r/partition_special_innodb.result @@ -1,17 +1,9 @@ create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w'), primary key(a,b,c,d)) engine='InnoDB' partition by key (a,b,c,d) ( -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` ( @@ -20,7 +12,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(50) NOT NULL, `d` enum('m','w') NOT NULL DEFAULT 'm', PRIMARY KEY (`a`,`b`,`c`,`d`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -40,18 +32,10 @@ a b c d drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h)) engine='InnoDB' partition by key(a,b,c,d,e,f,g,h) ( -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` ( @@ -65,7 +49,7 @@ t1 CREATE TABLE `t1` ( `h` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -85,18 +69,10 @@ a b c d e f g h i drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='InnoDB' partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) ( -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` ( @@ -118,7 +94,7 @@ t1 CREATE TABLE `t1` ( `h1` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -138,33 +114,17 @@ a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine='InnoDB' partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) ( -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); ERROR 42000: Too many key parts specified; max 16 parts allowed create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='InnoDB' partition by key(a,b,c,d,e,f,g,h) ( -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` ( @@ -202,7 +162,7 @@ t1 CREATE TABLE `t1` ( `h3` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result index 85e6d5445fd..f0a66ac847f 100644 --- a/mysql-test/suite/parts/r/partition_special_myisam.result +++ b/mysql-test/suite/parts/r/partition_special_myisam.result @@ -1,17 +1,9 @@ create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w'), primary key(a,b,c,d)) engine='MyISAM' partition by key (a,b,c,d) ( -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` ( @@ -20,7 +12,7 @@ t1 CREATE TABLE `t1` ( `c` varchar(50) NOT NULL, `d` enum('m','w') NOT NULL DEFAULT 'm', PRIMARY KEY (`a`,`b`,`c`,`d`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m'), ('1983-12-31', 'cdef', 'srtbvsr', 'w'), @@ -40,18 +32,10 @@ a b c d drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h)) engine='MyISAM' partition by key(a,b,c,d,e,f,g,h) ( -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` ( @@ -65,7 +49,7 @@ t1 CREATE TABLE `t1` ( `h` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -85,18 +69,10 @@ a b c d e f g h i drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='MyISAM' partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) ( -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` ( @@ -118,7 +94,7 @@ t1 CREATE TABLE `t1` ( `h1` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), @@ -138,33 +114,17 @@ a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i drop table t1; create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3)) engine='MyISAM' partition by key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h3) ( -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); ERROR 42000: Too many key parts specified; max 16 parts allowed create table t1 (a date not null, b varchar(50) not null, c varchar(50) not null, d enum('m', 'w') not null, e int not null, f decimal (18,2) not null, g bigint not null, h tinyint not null, a1 date not null, b1 varchar(50) not null, c1 varchar(50) not null, d1 enum('m', 'w') not null, e1 int not null, f1 decimal (18,2) not null, g1 bigint not null, h1 tinyint not null, a2 date not null, b2 varchar(50) not null, c2 varchar(50) not null, d2 enum('m', 'w') not null, e2 int not null, f2 decimal (18,2) not null, g2 bigint not null, h2 tinyint not null, a3 date not null, b3 varchar(50) not null, c3 varchar(50) not null, d3 enum('m', 'w') not null, e3 int not null, f3 decimal (18,2) not null, g3 bigint not null, h3 tinyint not null, i char(255), primary key(a,b,c,d,e,f,g,h,a1,b1,c1,d1,e1,f1,g1,h1)) engine='MyISAM' partition by key(a,b,c,d,e,f,g,h) ( -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` ( @@ -202,7 +162,7 @@ t1 CREATE TABLE `t1` ( `h3` tinyint(4) NOT NULL, `i` char(255) DEFAULT NULL, PRIMARY KEY (`a`,`b`,`c`,`d`,`e`,`f`,`g`,`h`,`a1`,`b1`,`c1`,`d1`,`e1`,`f1`,`g1`,`h1`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a,b,c,d,e,f,g,h) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) */ insert into t1 values ('1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113,'1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, '1975-01-01', 'abcde', 'abcde','m', 1234, 123.45, 32412341234, 113, 'tbhth nrzh ztfghgfh fzh ftzhj fztjh'), ('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'), diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test new file mode 100644 index 00000000000..9400e9ffe2b --- /dev/null +++ b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test @@ -0,0 +1,84 @@ +################################################################################ +# t/partition_basic_innodb.test # +# # +# Purpose: # +# Tests around Create Partitioned table using DATA/INDEX DIR # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mattiasj # +# Change Date: 2008-02-05 # +# Change: copied it from partition_basic_innodb.test and kept DATA DIR # +################################################################################ + +# +# 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 + +##### Options, for debugging support ##### +let $debug= 0; +let $with_partitioning= 1; + +##### Option, for displaying files ##### +let $ls= 1; + +##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments ##### +# on partioned tables +SET @max_row = 20; + +##### Execute more tests ##### +let $more_trigger_tests= 0; +let $more_pk_ui_tests= 0; + +# The server must support partitioning. +--source include/have_partition.inc +# The server must support symlink for DATA/INDEX DIRECTORY. +--source include/have_symlink.inc +# windows does not support symlink for DATA/INDEX DIRECTORY. +--source include/not_windows.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### Execute the test of "table" files +# InnoDB has no files per PK, UI, ... +let $do_file_tests= 0; + +##### Execute PRIMARY KEY tests ##### +# AFAIK InnoDB clusters the table around PRIMARY KEYs. +let $do_pk_tests= 1; + +##### Assign a big number smaller than the maximum value for partitions ##### +# and smaller than the maximum value of SIGNED INTEGER +let $MAX_VALUE= (2147483646); + +# Generate the prerequisites ($variables, @variables, tables) needed +--source suite/parts/inc/partition.pre + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_basic_symlink.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/parts/inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test new file mode 100644 index 00000000000..8a12f8e8b39 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test @@ -0,0 +1,86 @@ +################################################################################ +# t/partition_basic_myisam.test # +# # +# Purpose: # +# Tests around Create Partitioned table using DATA/INDEX DIR # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mattiasj # +# Change Date: 2008-02-05 # +# Change: copied it from partition_basic_myisam.test and kept DATA DIR # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM 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 + +##### Options, for debugging support ##### +let $debug= 0; +let $with_partitioning= 1; + +##### Option, for displaying files ##### +let $ls= 1; + +##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments ##### +# on partioned tables +SET @max_row = 20; + +##### Execute more tests ##### +let $more_trigger_tests= 0; +let $more_pk_ui_tests= 0; + +# The server must support partitioning. +--source include/have_partition.inc +# The server must support symlink for DATA/INDEX DIRECTORY. +--source include/have_symlink.inc +# windows does not support symlink for DATA/INDEX DIRECTORY. +--source include/not_windows.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MyISAM'; +# The server uses in case of MyISAM symlinking (if available) and the expected +# results fit to symlinking support. +--source include/have_symlink.inc + +##### Execute the test of "table" files +# MyISAM has files per PK, UI, ... +let $do_file_tests= 1; + +##### Execute PRIMARY KEY tests ##### +# AFAIK MyISAM treats PRIMARY KEYs like UNIQUE INDEXes +let $do_pk_tests= 0; + +##### Assign a big number smaller than the maximum value for partitions ##### +# and smaller than the maximum value of SIGNED INTEGER +let $MAX_VALUE= (2147483646); + +# Generate the prerequisites ($variables, @variables, tables) needed +--source suite/parts/inc/partition.pre + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_basic_symlink.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/parts/inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_sessions.test b/mysql-test/suite/parts/t/partition_sessions.test index ef3c5ef6a97..3d59292bee5 100644 --- a/mysql-test/suite/parts/t/partition_sessions.test +++ b/mysql-test/suite/parts/t/partition_sessions.test @@ -27,27 +27,6 @@ f4 datetime; let $col_access_list = f1,f2,f3,f4 ; let $col_new_list = new.f1,new.f2,new.f3 new.f4 ; -#-------------------------------------------------- -# initialize directories for partitions -#-------------------------------------------------- - ---disable_query_log -# DATA DIRECTORY -# Make directory for partition data ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpdata || true -eval SET @data_dir = 'DATA DIRECTORY = -''$MYSQLTEST_VARDIR/master-data/tmpdata'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -# Make directory for partition index ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpindex || true -eval SET @indx_dir = 'INDEX DIRECTORY = -''$MYSQLTEST_VARDIR/master-data/tmpindex'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - - #--------------------------------------------------- # Setting the parameters to use during testing #--------------------------------------------------- @@ -134,16 +113,16 @@ create table test_stat ( # tb3_eng1: key partitioning #---------------------------------------------------------------------- -#--replace_result $data_directory $index_directory $ENG1 ENG1 +#--replace_result $ENG1 ENG1 eval create table tb3_eng1 ( i1 int NOT NULL auto_increment, primary key (i1), $column_list ) engine=$ENG1 PARTITION BY KEY (i1) PARTITIONS 4 -(PARTITION part1 $data_directory $index_directory, -PARTITION part2 $data_directory $index_directory, -PARTITION part3 $data_directory $index_directory, -PARTITION part4 $data_directory $index_directory); +(PARTITION part1, +PARTITION part2, +PARTITION part3, +PARTITION part4); #--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt' -- cgit v1.2.1 From f134b62c563a7ea57694672254ff9948ec368586 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Feb 2008 21:26:05 +0100 Subject: Bug#31331 - MyISAM or Merge Table upgrade incompatibility with 5.1 A table with BLOB/TEXT prefix key part, created with version 4.1, could not be opened by a 5.1 server. The routine check at table open, if the frm file matches the MyISAM table, was too picky regarding old and new implementation of such keys. Added relaxed check for blob prefix key part. No test case. It requires to create a table in 4.1 and open it in 5.1. storage/myisam/ha_myisam.cc: Bug#31331 - MyISAM or Merge Table upgrade incompatibility with 5.1 Added relaxed check for blob prefix key part. --- storage/myisam/ha_myisam.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index dfb36700288..4486d317ae0 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -397,7 +397,26 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, } for (j= t1_keyinfo[i].keysegs; j--;) { - if (t1_keysegs[j].type != t2_keysegs[j].type || + uint8 t1_keysegs_j__type= t1_keysegs[j].type; + + /* + Table migration from 4.1 to 5.1. In 5.1 a *TEXT key part is + always HA_KEYTYPE_VARTEXT2. In 4.1 we had only the equivalent of + HA_KEYTYPE_VARTEXT1. Since we treat both the same on MyISAM + level, we can ignore a mismatch between these types. + */ + if ((t1_keysegs[j].flag & HA_BLOB_PART) && + (t2_keysegs[j].flag & HA_BLOB_PART)) + { + if ((t1_keysegs_j__type == HA_KEYTYPE_VARTEXT2) && + (t2_keysegs[j].type == HA_KEYTYPE_VARTEXT1)) + t1_keysegs_j__type= HA_KEYTYPE_VARTEXT1; + else if ((t1_keysegs_j__type == HA_KEYTYPE_VARBINARY2) && + (t2_keysegs[j].type == HA_KEYTYPE_VARBINARY1)) + t1_keysegs_j__type= HA_KEYTYPE_VARBINARY1; + } + + if (t1_keysegs_j__type != t2_keysegs[j].type || t1_keysegs[j].language != t2_keysegs[j].language || t1_keysegs[j].null_bit != t2_keysegs[j].null_bit || t1_keysegs[j].length != t2_keysegs[j].length) -- cgit v1.2.1 From 64d17dd1c2fdca2cc102cd582b38a324ca1ad82c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 12:04:19 +0100 Subject: Bug#34376 - merge-big test fails After changes to the bug fix for bug 26379 (Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table) the test case merge-big failed. Repaired the test case. Removed tests for INSERT ... SELECT, which is disabled for MERGE. Test case change only. mysql-test/r/merge-big.result: Bug#34376 - merge-big test fails Removed result for removed tests. mysql-test/t/merge-big.test: Bug#34376 - merge-big test fails Repaired the test case. Removed tests for INSERT ... SELECT, which is disabled for MERGE. --- mysql-test/r/merge-big.result | 51 -------------------------- mysql-test/t/merge-big.test | 84 +++++-------------------------------------- 2 files changed, 8 insertions(+), 127 deletions(-) diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result index 82fedc1df73..e34ebbd9578 100644 --- a/mysql-test/r/merge-big.result +++ b/mysql-test/r/merge-big.result @@ -24,54 +24,3 @@ UNLOCK TABLES; SET SESSION debug="-d,sleep_open_and_lock_after_open"; # connection default DROP TABLE t1; -# -# Extra tests for Bug#26379 - Combination of FLUSH TABLE and -# REPAIR TABLE corrupts a MERGE table -# -CREATE TABLE t1 (c1 INT); -CREATE TABLE t2 (c1 INT); -CREATE TABLE t3 (c1 INT); -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); -# -# CREATE ... SELECT -# try to access parent from another thread. -# -# connection con1 -SET SESSION debug="+d,sleep_create_select_before_lock"; -CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) -INSERT_METHOD=FIRST SELECT * FROM t3; -# connection default -# Now try to access the parent. -# If 3 is in table, SELECT had to wait. -SELECT * FROM t4 ORDER BY c1; -c1 -1 -2 -3 -# connection con1 -SET SESSION debug="-d,sleep_create_select_before_lock"; -# connection default -# Cleanup for next test. -DROP TABLE t4; -DELETE FROM t1 WHERE c1 != 1; -# -# CREATE ... SELECT -# try to access child from another thread. -# -# connection con1 -SET SESSION debug="+d,sleep_create_select_before_lock"; -CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) -INSERT_METHOD=FIRST SELECT * FROM t3; -# connection default -# Now try to access a child. -# If 3 is in table, SELECT had to wait. -SELECT * FROM t1 ORDER BY c1; -c1 -1 -3 -# connection con1 -SET SESSION debug="-d,sleep_create_select_before_lock"; -# connection default -DROP TABLE t1, t2, t3, t4; diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test index eddcbb59ed4..b687973c9d1 100644 --- a/mysql-test/t/merge-big.test +++ b/mysql-test/t/merge-big.test @@ -3,8 +3,10 @@ # # This test takes rather long time so let us run it only in --big-test mode --source include/big_test.inc -# We are using some debug-only features in this test +# We use some debug-only features in this test --source include/have_debug.inc +# We use INFORMATION_SCHEMA.PROCESSLIST in this test +--source include/not_embedded.inc --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6; @@ -46,6 +48,8 @@ LOCK TABLE t1 WRITE; --echo # connection default connection default; --echo # Let INSERT go into thr_multi_lock(). +#--sleep 8 +#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = $con1_id AND STATE = 'Locked'; --source include/wait_condition.inc @@ -54,8 +58,10 @@ let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST FLUSH TABLES; #SELECT NOW(); --echo # Let INSERT go through open_tables() where it sleeps. +#--sleep 8 +#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST; let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; + WHERE ID = $con1_id AND STATE = 'Waiting for table'; --source include/wait_condition.inc #SELECT NOW(); --echo # Unlock and close table and wait for con1 to close too. @@ -74,77 +80,3 @@ UNLOCK TABLES; connection default; DROP TABLE t1; ---echo # ---echo # Extra tests for Bug#26379 - Combination of FLUSH TABLE and ---echo # REPAIR TABLE corrupts a MERGE table ---echo # -CREATE TABLE t1 (c1 INT); -CREATE TABLE t2 (c1 INT); -CREATE TABLE t3 (c1 INT); -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (2); -INSERT INTO t3 VALUES (3); ---echo # ---echo # CREATE ... SELECT ---echo # try to access parent from another thread. ---echo # -#SELECT NOW(); - --echo # connection con1 - connect (con1,localhost,root,,); - let $con1_id= `SELECT CONNECTION_ID()`; - SET SESSION debug="+d,sleep_create_select_before_lock"; - send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) - INSERT_METHOD=FIRST SELECT * FROM t3; ---echo # connection default -connection default; -# wait for the other query to start executing -let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; ---source include/wait_condition.inc -#SELECT NOW(); ---echo # Now try to access the parent. ---echo # If 3 is in table, SELECT had to wait. -SELECT * FROM t4 ORDER BY c1; -#SELECT NOW(); - --echo # connection con1 - connection con1; - reap; - #SELECT NOW(); - SET SESSION debug="-d,sleep_create_select_before_lock"; - disconnect con1; ---echo # connection default -connection default; ---echo # Cleanup for next test. -DROP TABLE t4; -DELETE FROM t1 WHERE c1 != 1; ---echo # ---echo # CREATE ... SELECT ---echo # try to access child from another thread. ---echo # -#SELECT NOW(); - --echo # connection con1 - connect (con1,localhost,root,,); - let $con1_id= `SELECT CONNECTION_ID()`; - SET SESSION debug="+d,sleep_create_select_before_lock"; - send CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2) - INSERT_METHOD=FIRST SELECT * FROM t3; ---echo # connection default -connection default; -# wait for the other query to start executing -let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST - WHERE ID = $con1_id AND STATE = 'DBUG sleep'; ---source include/wait_condition.inc -#SELECT NOW(); ---echo # Now try to access a child. ---echo # If 3 is in table, SELECT had to wait. -SELECT * FROM t1 ORDER BY c1; -#SELECT NOW(); - --echo # connection con1 - connection con1; - reap; - #SELECT NOW(); - SET SESSION debug="-d,sleep_create_select_before_lock"; - disconnect con1; ---echo # connection default -connection default; -DROP TABLE t1, t2, t3, t4; -- cgit v1.2.1 From b2f0ed637171a1658699e3084c3a68710fefac93 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 12:28:38 +0100 Subject: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length, which was caught by valgrind. Solution: created a Field_bit::hash() that uses Field_bit::val_int() and my_charset_bin-collation function hash_sort. Also use the store function for platform independs mysql-test/r/partition_datatype.result: Bug#33379: valgrind error in parts/partition_bit_myisam result file enabled bit datatype test mysql-test/t/partition_datatype.test: Bug#33379: valgrind error in parts/partition_bit_myisam test file enabled bit datatype test sql/field.cc: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length. Solution: created a Field_bit::hash() that uses Field_bit::val_int() and my_charset_bin-collation function hash_sort. Also use the store function for platform independens. sql/field.h: Bug#33379: valgrind error in parts/partition_bit_myisam Problem was that Field_bit used Field::hash() function that did not know about using null-byte for storing bits. Resulting in wrong length. Solution: created a Field_bit::hash(). --- mysql-test/r/partition_datatype.result | 14 ++++++++++++++ mysql-test/t/partition_datatype.test | 20 ++++++++++---------- sql/field.cc | 17 +++++++++++++++++ sql/field.h | 1 + 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result index c6506178b03..242e67de9e0 100644 --- a/mysql-test/r/partition_datatype.result +++ b/mysql-test/r/partition_datatype.result @@ -1,4 +1,11 @@ drop table if exists t1; +# test with not null +create table t1 (a bit not null) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +hex(a) +1 +drop table t1; create table t1 (a tinyint not null) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; @@ -125,6 +132,13 @@ select * from t1 where a = 'y'; a y drop table t1; +# test with null allowed +create table t1 (a bit) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +hex(a) +1 +drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index 61d3cb42c7b..d6e65c3406e 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -11,11 +11,11 @@ drop table if exists t1; --enable_warnings -# FIXME: disabled this test because of valgrind error -#create table t1 (a bit not null) partition by key (a); -#insert into t1 values (b'1'); -#select * from t1 where a = b'1'; -#drop table t1; +-- echo # test with not null +create table t1 (a bit not null) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +drop table t1; create table t1 (a tinyint not null) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; @@ -100,11 +100,11 @@ create table t1 (a set('y','n') not null) partition by key (a); insert into t1 values ('y'); select * from t1 where a = 'y'; drop table t1; -# FIXME: disabled this test because of valgrind error -#create table t1 (a bit) partition by key (a); -#insert into t1 values (b'1'); -#select * from t1 where a = b'1'; -#drop table t1; +-- echo # test with null allowed +create table t1 (a bit) partition by key (a); +insert into t1 values (b'1'); +select hex(a) from t1 where a = b'1'; +drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); select * from t1 where a = 2; diff --git a/sql/field.cc b/sql/field.cc index 7c4f6c9ff5f..88fac96df89 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8793,6 +8793,23 @@ Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, } +void Field_bit::hash(ulong *nr, ulong *nr2) +{ + if (is_null()) + { + *nr^= (*nr << 1) | 1; + } + else + { + CHARSET_INFO *cs= &my_charset_bin; + longlong value= Field_bit::val_int(); + uchar tmp[8]; + mi_int8store(tmp,value); + cs->coll->hash_sort(cs, tmp, 8, nr, nr2); + } +} + + size_t Field_bit::do_last_null_byte() const { diff --git a/sql/field.h b/sql/field.h index a6a1d8bfabc..38a0b1d5bbd 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1904,6 +1904,7 @@ public: Field::move_field_offset(ptr_diff); bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*); } + void hash(ulong *nr, ulong *nr2); private: virtual size_t do_last_null_byte() const; -- cgit v1.2.1 From 1c0bd60db4e6810e4ac11f2626ab97063f205477 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 15:09:59 +0100 Subject: Bug#34358: Cannot find specified bit row in partitioned table Problem was incorrect data length in the key_restore function resulting in overwriting the search key. Solution, remove one byte in length if uneven bits are used. mysql-test/r/partition_datatype.result: Bug#34358: Cannot find specified bit row Updated result file mysql-test/t/partition_datatype.test: Bug#34358: Cannot find specified bit row Updated test file (corrected a few errors and added a test case for the bug) sql/key.cc: Bug34358: error in key_restore for bit fields with uneven bits When uneven bits exist, it has special treatment for the uneven bits but does use the same byte again when copying the rest of the key_part. --- mysql-test/r/partition_datatype.result | 68 ++++++++++++++++++++++++---------- mysql-test/t/partition_datatype.test | 42 ++++++++++++++------- sql/key.cc | 7 +++- 3 files changed, 84 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result index c6506178b03..a3301a55d45 100644 --- a/mysql-test/r/partition_datatype.result +++ b/mysql-test/r/partition_datatype.result @@ -30,22 +30,22 @@ a 2 drop table t1; create table t1 (a float not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; a +0.5 drop table t1; create table t1 (a double not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; a -2.1 +0.5 drop table t1; -create table t1 (a decimal not null) partition by key (a); +create table t1 (a decimal(4,2) not null) partition by key (a); insert into t1 values (2.1); -Warnings: -Note 1265 Data truncated for column 'a' at row 1 select * from t1 where a = 2.1; a +2.10 drop table t1; create table t1 (a date not null) partition by key (a); insert into t1 values ('2001-01-01'); @@ -156,22 +156,22 @@ a 2 drop table t1; create table t1 (a float) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; a +0.5 drop table t1; create table t1 (a double) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; a -2.1 +0.5 drop table t1; -create table t1 (a decimal) partition by key (a); +create table t1 (a decimal(4,2)) partition by key (a); insert into t1 values (2.1); -Warnings: -Note 1265 Data truncated for column 'a' at row 1 select * from t1 where a = 2.1; a +2.10 drop table t1; create table t1 (a date) partition by key (a); insert into t1 values ('2001-01-01'); @@ -254,25 +254,41 @@ drop table t1; create table t1 (a varchar(65531)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; a +aaaa select * from t1 where a like 'aaa%'; a aaaa +select * from t1 where a = 'bbbb'; +a +bbbb drop table t1; create table t1 (a varchar(65532)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; a +aaaa select * from t1 where a like 'aaa%'; a aaaa +select * from t1 where a = 'bbbb'; +a +bbbb drop table t1; create table t1 (a varchar(65533) not null) partition by key (a); +insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; a +aaaa +select * from t1 where a like 'aaa%'; +a +aaaa +select * from t1 where a = 'bbbb'; +a +bbbb drop table t1; create table t1 (a varchar(65533)) partition by key (a); ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs @@ -280,3 +296,17 @@ create table t1 (a varchar(65534) not null) partition by key (a); ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs create table t1 (a varchar(65535)) partition by key (a); ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs +create table t1 (a bit(27), primary key (a)) engine=myisam +partition by hash (a) +(partition p0, partition p1, partition p2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bit(27) NOT NULL DEFAULT '\0\0\0\0', + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, PARTITION p2 ENGINE = MyISAM) */ +insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); +select hex(a) from t1 where a = 7; +hex(a) +7 +drop table t1; diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index 61d3cb42c7b..33975e3cf85 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -37,14 +37,14 @@ insert into t1 values (2); select * from t1 where a = 2; drop table t1; create table t1 (a float not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; create table t1 (a double not null) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; -create table t1 (a decimal not null) partition by key (a); +create table t1 (a decimal(4,2) not null) partition by key (a); insert into t1 values (2.1); select * from t1 where a = 2.1; drop table t1; @@ -126,14 +126,14 @@ insert into t1 values (2); select * from t1 where a = 2; drop table t1; create table t1 (a float) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; create table t1 (a double) partition by key (a); -insert into t1 values (2.1); -select * from t1 where a = 2.1; +insert into t1 values (0.5); +select * from t1 where a = 0.5; drop table t1; -create table t1 (a decimal) partition by key (a); +create table t1 (a decimal(4,2)) partition by key (a); insert into t1 values (2.1); select * from t1 where a = 2.1; drop table t1; @@ -192,18 +192,23 @@ drop table t1; create table t1 (a varchar(65531)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; create table t1 (a varchar(65532)) partition by key (a); insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; create table t1 (a varchar(65533) not null) partition by key (a); +insert into t1 values ('bbbb'); insert into t1 values ('aaaa'); -select * from t1 where a = 'aaa%'; +select * from t1 where a = 'aaaa'; +select * from t1 where a like 'aaa%'; +select * from t1 where a = 'bbbb'; drop table t1; -- error ER_TOO_BIG_ROWSIZE create table t1 (a varchar(65533)) partition by key (a); @@ -211,3 +216,14 @@ create table t1 (a varchar(65533)) partition by key (a); create table t1 (a varchar(65534) not null) partition by key (a); -- error ER_TOO_BIG_ROWSIZE create table t1 (a varchar(65535)) partition by key (a); + +# +# Bug#34358: error in key_restore for bitfields with uneven bits +# +create table t1 (a bit(27), primary key (a)) engine=myisam +partition by hash (a) +(partition p0, partition p1, partition p2); +show create table t1; +insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); +select hex(a) from t1 where a = 7; +drop table t1; diff --git a/sql/key.cc b/sql/key.cc index 7f075674ab6..47e5c5ebdd7 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -168,6 +168,7 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info, } for (key_part= key_info->key_part ; (int) key_length > 0 ; key_part++) { + uchar used_uneven_bits= 0; if (key_part->null_bit) { if (*from_key++) @@ -186,6 +187,8 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info, set_rec_bits(bits, to_record + key_part->null_offset + (key_part->null_bit == 128), field->bit_ofs, field->bit_len); + /* we have now used the byte with 'uneven' bits */ + used_uneven_bits= 1; } } if (key_part->key_part_flag & HA_BLOB_PART) @@ -222,7 +225,9 @@ void key_restore(uchar *to_record, uchar *from_key, KEY *key_info, else { length= min(key_length, key_part->length); - memcpy(to_record + key_part->offset, from_key, (size_t) length); + /* skip the byte with 'uneven' bits, if used */ + memcpy(to_record + key_part->offset, from_key + used_uneven_bits + , (size_t) length - used_uneven_bits); } from_key+= length; key_length-= length; -- cgit v1.2.1 From 11b8c529ccbf2ed9d82a9c3bf26bb9c2c851893f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Feb 2008 16:26:22 +0100 Subject: Bug#34225: suite/parts test failure Pre push fix: added --sorted_result for consistent results mysql-test/suite/parts/inc/partition_bit.inc: Bug#34225: suite/parts test failure added --sorted_result for consistent results mysql-test/suite/parts/r/partition_bit_innodb.result: Bug#34225: suite/parts test failure added --sorted_result for consistent results mysql-test/suite/parts/r/partition_bit_myisam.result: Bug#34225: suite/parts test failure added --sorted_result for consistent results --- mysql-test/suite/parts/inc/partition_bit.inc | 7 +++ .../suite/parts/r/partition_bit_innodb.result | 58 +++++++++++----------- .../suite/parts/r/partition_bit_myisam.result | 56 ++++++++++----------- 3 files changed, 64 insertions(+), 57 deletions(-) diff --git a/mysql-test/suite/parts/inc/partition_bit.inc b/mysql-test/suite/parts/inc/partition_bit.inc index 3e37d7a68d1..5bbf0058028 100644 --- a/mysql-test/suite/parts/inc/partition_bit.inc +++ b/mysql-test/suite/parts/inc/partition_bit.inc @@ -25,6 +25,7 @@ insert into t1 values (b'0000000000000000000000000000000000000000000000000000000000000001'), (b'1010101010101010101010101010101010101010101010101010101010101010'), (b'0101010101010101010101010101010101010101010101010101010101010101'); +--sorted_result select hex(a) from t1; drop table t1; @@ -43,6 +44,7 @@ insert into t1 values (b'0101010101010101010101010101010101010101010101010101010101010101'); select hex(a) from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101'; delete from t1 where a=b'0101010101010101010101010101010101010101010101010101010101010101'; +--sorted_result select hex(a) from t1; drop table t1; @@ -50,12 +52,15 @@ eval create table t2 (a bit, primary key (a)) engine=$engine partition by key (a) partitions 4; show create table t2; insert into t2 values (b'0'), (b'1'); +--sorted_result select hex(a) from t2; alter table t2 drop primary key; show create table t2; +--sorted_result select hex(a) from t2; alter table t2 add primary key (a); show create table t2; +--sorted_result select hex(a) from t2; drop table t2; @@ -78,6 +83,7 @@ dec $count; select hex(a) from t3 where a=b'01010101'; delete from t3 where a=b'01010101'; select count(*) from t3; +--sorted_result select hex(a) from t3; drop table t3; @@ -99,5 +105,6 @@ dec $count; select hex(a) from t4 where a=b'00000001'; delete from t4 where a=b'00000001'; select count(*) from t4; +--sorted_result select hex(a) from t4; drop table t4; diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result index 6920519e4db..22d1d0e0a30 100644 --- a/mysql-test/suite/parts/r/partition_bit_innodb.result +++ b/mysql-test/suite/parts/r/partition_bit_innodb.result @@ -93,8 +93,8 @@ t2 CREATE TABLE `t2` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */ select hex(a) from t2; hex(a) -1 0 +1 alter table t2 add primary key (a); show create table t2; Table Create Table @@ -130,20 +130,6 @@ count(*) select hex(a) from t3; hex(a) 1 -2 -3 -4 -5 -6 -7 -8 -9 -A -B -C -D -E -F 10 11 12 @@ -160,6 +146,7 @@ F 1D 1E 1F +2 20 21 22 @@ -176,6 +163,7 @@ F 2D 2E 2F +3 30 31 32 @@ -192,6 +180,7 @@ F 3D 3E 3F +4 40 41 42 @@ -208,6 +197,7 @@ F 4D 4E 4F +5 50 51 52 @@ -223,6 +213,7 @@ F 5D 5E 5F +6 60 61 62 @@ -239,6 +230,7 @@ F 6D 6E 6F +7 70 71 72 @@ -255,6 +247,7 @@ F 7D 7E 7F +8 80 81 82 @@ -271,6 +264,7 @@ F 8D 8E 8F +9 90 91 92 @@ -287,6 +281,7 @@ F 9D 9E 9F +A A0 A1 A2 @@ -303,6 +298,7 @@ AC AD AE AF +B B0 B1 B2 @@ -319,6 +315,7 @@ BC BD BE BF +C C0 C1 C2 @@ -335,6 +332,7 @@ CC CD CE CF +D D0 D1 D2 @@ -351,6 +349,7 @@ DC DD DE DF +E E0 E1 E2 @@ -367,6 +366,7 @@ EC ED EE EF +F F0 F1 F2 @@ -405,20 +405,6 @@ count(*) 31 select hex(a) from t4; hex(a) -2 -3 -4 -5 -6 -7 -8 -9 -A -B -C -D -E -F 10 11 12 @@ -435,5 +421,19 @@ F 1D 1E 1F +2 20 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F drop table t4; diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result index ed76c67baa3..d4b81fc74b5 100644 --- a/mysql-test/suite/parts/r/partition_bit_myisam.result +++ b/mysql-test/suite/parts/r/partition_bit_myisam.result @@ -130,20 +130,6 @@ count(*) select hex(a) from t3; hex(a) 1 -2 -3 -4 -5 -6 -7 -8 -9 -A -B -C -D -E -F 10 11 12 @@ -160,6 +146,7 @@ F 1D 1E 1F +2 20 21 22 @@ -176,6 +163,7 @@ F 2D 2E 2F +3 30 31 32 @@ -192,6 +180,7 @@ F 3D 3E 3F +4 40 41 42 @@ -208,6 +197,7 @@ F 4D 4E 4F +5 50 51 52 @@ -223,6 +213,7 @@ F 5D 5E 5F +6 60 61 62 @@ -239,6 +230,7 @@ F 6D 6E 6F +7 70 71 72 @@ -255,6 +247,7 @@ F 7D 7E 7F +8 80 81 82 @@ -271,6 +264,7 @@ F 8D 8E 8F +9 90 91 92 @@ -287,6 +281,7 @@ F 9D 9E 9F +A A0 A1 A2 @@ -303,6 +298,7 @@ AC AD AE AF +B B0 B1 B2 @@ -319,6 +315,7 @@ BC BD BE BF +C C0 C1 C2 @@ -335,6 +332,7 @@ CC CD CE CF +D D0 D1 D2 @@ -351,6 +349,7 @@ DC DD DE DF +E E0 E1 E2 @@ -367,6 +366,7 @@ EC ED EE EF +F F0 F1 F2 @@ -405,20 +405,6 @@ count(*) 31 select hex(a) from t4; hex(a) -2 -3 -4 -5 -6 -7 -8 -9 -A -B -C -D -E -F 10 11 12 @@ -435,5 +421,19 @@ F 1D 1E 1F +2 20 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F drop table t4; -- cgit v1.2.1 From f1dd83ea58773f902819c6c65d9ec19e5912e1b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Feb 2008 00:12:34 +0100 Subject: WL#3834: New build script for system admins and developers especially for MySQL Cluster Carrier Grade Edition BUILD/build_mccge.sh: BitKeeper file /home/mikael/mysql_clones/mysql-5.1-engines/BUILD/build_mccge.sh BUILD/check-cpu: Added comments Added support for Core 2 cpu's Fixed some bad styles for scripts Fixed some copy-paste bug Added support for i386 from Mac OS X Added support for Itanium Added support for Sparc Added support for GCC 4.2+ Fixed some issues with later change of cpu_arg Removed some broken, unnecessarily complex parts to find native compiler flags --- BUILD/build_mccge.sh | 1516 ++++++++++++++++++++++++++++++++++++++++++++++++++ BUILD/check-cpu | 145 +++-- 2 files changed, 1579 insertions(+), 82 deletions(-) create mode 100755 BUILD/build_mccge.sh diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh new file mode 100755 index 00000000000..fc0f8181692 --- /dev/null +++ b/BUILD/build_mccge.sh @@ -0,0 +1,1516 @@ +#!/bin/sh + +die() +{ + echo "ERROR: $@"; exit 1; +} + +get_key_value() +{ + echo "$1" | sed 's/^--[a-zA-Z_-]*=//' +} + +developer_usage() +{ +cat < ./build_mccge.sh + + This performs the following operations: + 1) Detects the operating system. Currently, Linux, FreeBSD, Solaris + 10/11, and Mac OS X are supported by this script. + 2) Detect the type of CPU being used. Currently supported processors + are: x86 for all supported operating systems, Itanium for Linux + with GCC, and SPARC for Solaris using the Forte compiler. + 3) Invokes the GCC compiler. + 4) Builds a set of MySQL Cluster Carrier Grade Edition binaries; for + more information about these, see --extended-help. + + The default version assumes that you have a source code tarball from + which you are building, and thus autoconf and automake do not need to + be run. If you have downloaded a BitKeeper tree then you should read + --developer-help. + + If you are building MySQL Cluster Carrier Grade Edition for commercial + use then you need to set the --commercial flag to ensure that the + commercial libraries are compiled in, rather than the GPL-only + libraries. The default is to build a GPL version of MySQL Cluster + Carrier Grade Edition. + + If your building on a Solaris SPARC machine you must set + --compiler=forte; if you want to build using the Intel compiler on + Linux, you need to set --compiler=icc. + + If you want to make sure that a 64-bit version is built then you + should add the flag --64. This is always set on Solaris machines and + when check-cpu is able to discover that a 64-bit CPU is being used. If + you want to ensure that a 32-bit binary is produced, use --32 instead. + + If you need the binaries to be installed in a different location from + /usr/local/mysql, then you should set --prefix to point to where you + want the binaries installed. + + Using a data directory other than the default (PREFIX/data) can be + done when starting the MySQL Server, or by invoking this script with + the --datadir option. + + If you want your binaries stripped of surplus debug or other + information, use the --strip option. + + If you want debug information in the binary (for example, to be + able to send gdb core dumps to MySQL Support), then you should add the + flag --with-debug; if you want a production build with only debugging + information in the binary then use --debug. + + If your aim is not to build MySQL Cluster Carrier Grade Edition, you + can also use this script to build MySQL Classic and MySQL Pro + versions; see the --extended-help for descriptions of these packages. +EOF +} + +usage() +{ +cat < 32-bit binary + x86_64 => 64 bit binary unless Mac OS X + --warning-mode=[extra|pedantic|normal|no] Set warning mode level + --warnings Set warning mode to normal + --32 Build a 32-bit binary even if CPU is 64-bit + --64 Build a 64-bit binary even if not sure a + 64-bit CPU is being used + --package=[cge|extended|pro|classic] Select package to build + --parallelism=number Define parallelism in make + --strip Strip binaries + --error-inject Enable error injection into MySQL Server and + data nodes + --valgrind Build with valgrind + --fast Optimise for CPU architecture buildt on + --static-linking Statically link system libraries into binaries + --with-flags * Pass extra --with-xxx options to configure +EOF + if test "x$1" != "x" ; then + echo "Failure Message: $1" + fi +} + +extended_usage() +{ + cat </bin (can be overridden) + + --localstatedir: /data, unless --datadir is used, in which + case it defaults to /data (can be overridden by setting + --localstatedir explicitly). + + --enable-local-infile: Enable use of the LOAD DATA FROM LOCAL INFILE + command (cannot be overridden). + + --enable-thread-safe-client: Enable the multi-threaded mysql client + library (cannot be overridden). + + --with-big-tables: Enable use of tables with more than 4G rows (cannot + be overridden). + + --with-extra-charsets=all: Enable use of all character sets supported + by MySQL (cannot be overridden). + + --with-ssl: Enable use of yaSSL library included in the MySQL source + (cannot be overridden). + + --with-pic: Build all binaries using position independent assembler + to avoid problems with dynamic linkers (cannot be overridden). + + --with-csv-storage-engine: Ensure that the CSV storage engine is + included in all builds. Since CSV is required for log tables in + MySQL 5.1, this option cannot be overridden. + + (Note that MyISAM support is always built into the MySQL Server; the + server *cannot* be built without MyISAM.) + + --with-mysqld-ldflags=-static + --with-client-ldflags=-static + Ensures that binaries for, respectively, the MySQL server and client + are built with static libraries except for the system libraries, + which use dynamically loaded libraries provided by the operating + system. Building with --developer sets these to all-static instead, + to build everything statically. + + In addition there are some configure options that are specific to + Linux operating systems: + + --with-fast-mutexes + Include an alternative implementation of mutexes that is faster on + Linux systems + + --enable-assembler + Include assembler code optimisations for a number of mostly string + methods. Used for x86 processors only. + + Neither of the preceding options can be disabled. + + MySQL Cluster Carrier Grade edition also adds the following options + (also used by the extended package): + + --with-ndbcluster + Include the NDB Cluster storage engine, its kernel, management + server, and client, as well as support for the NDB and MGM APIs. + + --without-ndb-debug + Do not include specific NDB debug code, not even in debug versions + (cannot be overridden). + + Package-specific options: + ------------------------- + --with-innodb + Specifically included in the "pro" and "extended" packages, and not + in any of the others. + + --with-comment + Sets the comment for the MySQL version, by package, as described + above. + + --with-server-suffix + Sets the server suffix on the MySQL version, by package, as + described above. + + Other options used: + ------------------- + --with-readline + Use the GPL readline library for command editing functions; not + available with commercial packages. + + --with-libedit + Use the BSD licensed library for command editing functions; used for + commercial packages. + + --with-zlib-dir=bundled + Use the zlib package bundled with MySQL. + + --with-mysqld-libs=-lmtmalloc + Used on Solaris to ensure that the proper malloc library is used. + + Compiler options: + ----------------- + + This section describes the compiler options for each of the different + platforms supported by thisscript. + + The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides + support for Nocona, K8, and other processors). + + Use of the --debug option adds -g to the C/C++ flags. + + FreeBSD/x86/gcc + --------------- + No flags are used. Instead, configure determines the proper flags to + use. + + Linux/x86+Itanium/gcc + ------------- + No flags are used. Instead the configure script determines the + proper flags to use for both normal and debug builds. Discovery of a + Nocona or Core 2 Duo CPU causes a 64-bit binary to be built; + otherwise, the binary is 32-bit. To build a 64-bit binary, -m64 is + added to the C/C++ flags. (To build a 32-bit binary on a 64-bit CPU, + use the --32 option as described previously.) + + Linux/x86+Itanium/icc + ------------- + Flags used: + CC = icc -static-libgcc -static-libcxa -i-static + C++ = icpc -static-libgcc -static-libcxa -i-static + C/C++ flags = -mp -restrict + + On Itanium we also add -no-ftz and -no-prefetch to CC and C++ flags. + + The non-debug versions also add the following: + C/C++ flags += -O3 unroll2 -ip + + The fast version adds: + C/C++ flags += -ipo + + On discovery of a Core 2 Duo architecture while using icc, -xT is also + added to the C/C++ flags; this provides optimisations specific to Core + 2 Duo. This is added only when the --fast flag is set. + + Solaris/x86/gcc + --------------- + All builds on Solaris are 64-bit, so -m64 is always used in the + C/C++ flags. LDFLAGS is set to -m64 -static-libgcc -O/-O2. + + Solaris/Sparc/Forte + ------------------- + Uses cc-5.0 as CC + Sets ASFLAGS=LDFLAGS=xarch=v9, so that we compile Sparc v9 binaries + C flags = -Xa -strconst -xc99=none + C++ flags = -noex + C/C++ flags = -mt -D_FORTEC -xarch=v9 + + For non-debug builds, the following flags are also used: + + C/C++ flags = -xO3 + + MacOSX/x86/gcc + -------------- + C/C++ flags include -fno-common -arch i386. + + Non-debug versions also add -Os -felide-constructors, where "-Os" + means the build is space-optimised as long as the space optimisations + do not negatively affect performance. Debug versions use -O. +EOF +} +with_usage() +{ + cat < /dev/null 2>&1 + then + make=gmake + else + make=make + fi + if test "x`$make --version | grep GNU`" = "x" ; then + die "Only gmake is supported" + fi +} + +# +# Find a libtoolize binary, both libtoolize and glibtoolize are +# ok, use first found. +# +set_libtoolize_version() +{ + LIBTOOLIZE=not_found + save_ifs="$IFS"; IFS=':' + for dir in $PATH + do + if test -x $dir/libtoolize + then + LIBTOOLIZE=libtoolize + echo "Found libtoolize in $dir" + break + fi + if test -x $dir/glibtoolize + then + LIBTOOLIZE=glibtoolize + echo "Found glibtoolize in $dir" + break + fi + done + IFS="$save_ifs" + if test "x$LIBTOOLIZE" = "xnot_found" ; then + die "Found no libtoolize version, quitting here" + fi + return +} + +# +# If ccache (a compiler cache which reduces build time) +# (http://samba.org/ccache) is installed, use it. +# We use 'grep' and hope that 'grep' works as expected +# (returns 0 if finds lines) +# We do not use ccache when gcov is used. Also only when +# gcc is used. +# +set_up_ccache() +{ + if test "x$compiler" = "xgcc" ; then + if ccache -V > /dev/null 2>&1 && test "$USING_GCOV" != "1" + then + echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC" + echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX" + fi + fi +} + +# +# Set flags for various build configurations. +# Used in -valgrind builds +# +set_valgrind_flags() +{ + if test "x$valgrind_flag" = "xyes" ; then + loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " + loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" + compiler_flags="$compiler_flags $loc_valgrind_flags" + fi +} + +# +# Set up warnings; default is to use no warnings, but if warning_mode +# is used a lot of warning flags are set up. These flags are valid only +# for gcc, so for other compilers we ignore the warning_mode. +# +set_warning_flags() +{ + if test "x$developer_flag" = "xyes" && test "x$warning_mode" = "x" ; then + warning_mode="normal" + fi + if test "x$compiler" = "xgcc" ; then + if test "x$warning_mode" = "normal" || test "x$warning_mode" = "extra" ; then +# Both C and C++ warnings + warnings="$warnings -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs" + warnings="$warnings -Wcomment -W" + warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare" + warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label" + warnings="$warnings -Wunused-value -Wunused-variable" + + if test "x$warning_mode" = "extra" ; then + warnings="$warnings -Wshadow" + fi +# C warnings + c_warnings="$warnings -Wunused-parameter" +# C++ warnings + cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder" + cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor" +# Added unless --with-debug=full + if test "x$full_debug" = "x" ; then + compiler_flags="$compiler_flags -Wuninitialized" + fi + elif test "x$warning_mode" = "xpedantic" ; then + warnings="-W -Wall -ansi -pedantic -Wno-long-long -D_POSIX_SOURCE" + c_warnings="$warnings" + cxx_warnings="$warnings -std=c++98" +# Reset CPU flags (-mtune), they don't work in -pedantic mode + check_cpu_cflags="" + fi + fi +} + +# +# Used in -debug builds +# +set_with_debug_flags() +{ + if test "x$with_debug_flag" = "xyes" ; then + if test "x$developer_flag" = "xyes" ; then + loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " + loc_debug_flags="$loc_debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC" + compiler_flags="$compiler_flags $loc_debug_flags" + fi + fi +} + +# +# Flag for optimizing builds for developers. +# +set_no_omit_frame_pointer_for_developers() +{ + if test "x$fast_flag" != "xno" ; then + if test "x$developer_flag" = "xyes" && test "x$compiler" = "xgcc" ; then +# Be as fast as we can be without losing our ability to backtrace. + compiler_flags="$compiler_flags -fno-omit-frame-pointer" + fi + fi +} + +# +# Add -g to all builds that requested debug information in build +# +set_debug_flag() +{ + if test "x$compile_debug_flags" = "xyes" ; then + compiler_flags="$compiler_flags -g" + fi +} + +# +# Base options used by all packages +# +# SSL library to use. --with-ssl selects the bundled yaSSL +# implementation of SSL. To use openSSL, you must point out the location +# of the openSSL headers and libs on your system. +# For example: --with-ssl=/usr +# +set_base_configs() +{ + base_configs="$base_configs --prefix=$prefix" + base_configs="$base_configs --libexecdir=$prefix/bin" + base_configs="$base_configs --with-zlib-dir=bundled" + if test "x$datadir" = "x" ; then + base_configs="$base_configs --localstatedir=$prefix/data" + else + base_configs="$base_configs --localstatedir=$datadir" + fi + if test "x$with_debug_flag" = "xyes" ; then + base_configs="$base_configs --with-debug$full_debug" + fi + base_configs="$base_configs --enable-local-infile" + base_configs="$base_configs --enable-thread-safe-client" + base_configs="$base_configs --with-big-tables" + base_configs="$base_configs --with-extra-charsets=all" + base_configs="$base_configs --with-ssl" + base_configs="$base_configs --with-pic" + base_configs="$base_configs --with-csv-storage-engine" +} + +# +# Add all standard engines and partitioning (included as part of MySQL +# Cluster storage engine as well) as part of MySQL Server. These are +# added in all packages except the classic package. +# +set_base_engines() +{ + engine_configs="$engine_configs --with-archive-storage-engine" + engine_configs="$engine_configs --with-blackhole-storage-engine" + engine_configs="$engine_configs --with-example-storage-engine" + engine_configs="$engine_configs --with-federated-storage-engine" + engine_configs="$engine_configs --with-partition" +} + +set_pro_package() +{ + base_configs="$base_configs $engine_configs" + base_configs="$base_configs --with-innodb" + base_configs="$base_configs --with-comment=\"MySQL Pro $version_text built from source\"" + if test "x$with_debug_flag" = "xyes" ; then + base_configs="$base_configs --with-server-suffix=\"-debug\"" + fi +} + +set_cge_extended_package() +{ + if test "x$gpl" = "xno" ; then + echo "Cannot build Extended Carrier Grade Edition as Commercial version" + fi + base_configs="$base_configs --with-ndbcluster" + base_configs="$base_configs --without-ndb-debug" + base_configs="$base_configs $engine_configs" + base_configs="$base_configs --with-innodb" + base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\"" + if test "x$with_debug_flag" = "xyes" ; then + base_configs="$base_configs --with-server-suffix=\"-cge-extended-debug\"" + else + base_configs="$base_configs --with-server-suffix=\"-cge-extended"\" + fi +} + +set_cge_package() +{ + base_configs="$base_configs --with-ndbcluster" + base_configs="$base_configs --without-ndb-debug" + base_configs="$base_configs $engine_configs" + base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\"" + if test "x$with_debug_flag" = "xyes" ; then + base_configs="$base_configs --with-server-suffix=\"-cge-debug\"" + else + base_configs="$base_configs --with-server-suffix=\"-cge"\" + fi +} + +set_classic_package() +{ + base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\"" + if test "x$with_debug_flag" = "xyes" ; then + base_configs="$base_configs --with-server-suffix=\"-debug\"" + fi +} + +# +# Special handling of readline; use readline from the MySQL +# distribution if building a GPL version, otherwise use libedit. +# +set_readline_package() +{ + if test -d "$path/../cmd-line-utils/readline" && test "x$gpl" = "xyes" ; then + base_configs="$base_configs --with-readline" + elif test -d "$path/../cmd-line-utils/libedit" ; then + base_configs="$base_configs --with-libedit" + fi +} + +# +# If fast flag set by user we also add architecture as discovered to +# compiler flags to make binary optimised for architecture at hand. +# We use this feature on gcc compilers. +# +set_gcc_special_options() +{ + if test "x$fast_flag" = "xyes" && test "x$compiler" = "xgcc" ; then + compiler_flags="$compiler_flags $check_cpu_cflags" + fi +} + +# +# If we discover a Core 2 Duo architecture and we have enabled the fast +# flag, we enable a compile especially optimised for Core 2 Duo. This +# feature is currently available on Intel's icc compiler only. +# +set_icc_special_options() +{ + if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \ + test "x$compiler" = "xicc" ; then + compiler_flags="$compiler_flags -xT" + fi +} + +# +# FreeBSD Section +# +set_bsd_configs() +{ + if test "x$cpu_base_type" != "xx86" ; then + usage "Only x86 CPUs supported for FreeBSD" + exit 1 + fi + if test "x$compiler" != "xgcc" ; then + usage "Only gcc supported for FreeBSD" + exit 1 + fi + base_configs="$base_configs --enable-assembler" + CC="gcc" + CXX="gcc" +} + +# +# Linux Section +# +set_linux_configs() +{ + if test "x$cpu_base_type" != "xx86" && \ + test "x$cpu_base_type" != "xitanium" ; then + usage "Only x86 and Itanium CPUs supported for 32-bit Linux" + exit 1 + fi + base_configs="$base_configs --with-fast-mutexes" + if test "x$cpu_base_type" = "xx86" ; then + base_configs="$base_configs --enable-assembler" + fi + if test "x$compiler" = "xgcc" ; then + CC="gcc" + CXX="gcc" + if test "x$m64" = "xyes" ; then + compiler_flags="$compiler_flags -m64" + fi +# configure will set proper compiler flags for gcc on Linux + elif test "x$compiler" = "xicc" ; then + compiler_flags="$compiler_flags -mp -restrict" + CC="icc -static-intel" + CXX="icpc -static-intel" + if test "x$cpu_base_type" = "xitanium" ; then + compiler_flags="$compiler_flags -no-ftz" + fi + if test "x$fast_flag" != "xno" ; then + compiler_flags="$compiler_flags -O3 -unroll2 -ip" + if test "x$fast_flag" = "xyes" ; then + compiler_flags="$compiler_flags -ipo" + fi + fi + else + usage "Only gcc and icc compilers supported for Linux" + exit 1 + fi +} + +# +# Solaris Section +# +set_solaris_configs() +{ + base_configs="$base_configs --with-mysqld-libs=-lmtmalloc" + case "`uname -a`" in + *5.10*|*5.11*) + ;; + *) + die "Only versions 10 and 11 supported for Solaris" + esac + if test "x$cpu_base_type" != "xx86" && \ + test "x$cpu_base_type" != "xsparc" ; then + usage "Only x86 and Sparc CPUs supported for Solaris" + exit 1 + fi + if test "x$compiler" = "xgcc" ; then + CC="gcc" + CXX="gcc" + if test "x$cpu_base_type" != "xx86" ; then + usage "Only gcc supported for Solaris 10/11 on SPARC" + fi + compiler_flags="$compiler_flags -m64 -DMY_ATOMIC_MODE_RWLOCKS" + LDFLAGS="-m64 -static-libgcc" + if test "x$fast_flag" != "xno" ; then + LDFLAGS="$LDFLAGS -O2" + compiler_flags="$compiler_flags -O2" + else + LDFLAGS="$LDFLAGS -O" + compiler_flags="$compiler_flags -O" + fi + elif test "x$compiler" = "xforte" ; then + if test "x$cpu_base_type" = "xx86" ; then + usage "Only gcc supported for Solaris/x86" + fi + if test "x$cpu_base_type" != "xsparc" ; then + usage "Forte compiler supported for Solaris 9/SPARC only" + fi + CC="cc-5.0" + CXX=CC + ASFLAGS="xarch=v9" + LDFLAGS="xarch=v9" + base_cflags="$base_cflags -Xa -xstrconst -xc99=none" + base_cxxflags="$base_cxxflags -noex" + compiler_flags="$compiler_flags -mt -D_FORTEC -xarch=v9" + if test "x$fast_flag" != "xno" ; then + compiler_flags="$compiler_flags -xO3" + fi + else + usage "Only gcc and Forte compilers supported for Solaris" + exit 1 + fi +} + +# +# Mac OS X Section +# +set_macosx_configs() +{ + base_cxxflags="$base_cxxflags -fno-common" + if test "x$cpu_base_type" = "xx86" && test "x$compiler" = "xgcc" ; then + compiler_flags="$compiler_flags -arch i386" + else + usage "Only gcc/x86 supported for Mac OS X" + exit 1 + fi +# +# Optimize for space as long as it doesn't affect performance, use some +# optimisations also when not in fast mode. +# + if test "x$fast_flag" != "xno" ; then + compiler_flags="$compiler_flags -Os" + base_cxxflags="$base_cxxflags -felide-constructors" + else + compiler_flags="$compiler_flags -O" + fi + CC="gcc" + CXX="gcc" +} + +# +# Use static linking for own modules and dynamic linking for system +# modules unless specifically requested to do everything statically. +# Should normally not be used; static_linking_flag kept in case someone +# really needs it. Available only if developer flag is also set. +# +set_static_link_configs() +{ + if test "x$static_linking_flag" = "xyes" && test "x$developer_flag" = "xyes" ; then + loc_static_link="--with-mysqld-ldflags=\"-all-static\"" + loc_static_link="$loc_static_link --with-client-ldflags=\"-all-static\"" + else + loc_static_link="--with-mysqld-ldflags=\"-static\"" + loc_static_link="$loc_static_link --with-client-ldflags=\"-static\"" + fi + base_configs="$base_configs $loc_static_link" +} + +# +# Enable error injection in MySQL Server (for developer build only - +# extra check for developer flag required). +# +set_error_inject_configs() +{ + if test "x$error_inject_flag" = "xyes" && test "x$developer_flag" = "xyes" ; then + base_configs="$base_configs --with-error-inject" + if test "x$package" = "xndb" || test "x$package" = "xextended" ; then + base_configs="$base_configs --with-ndb-ccflags='-DERROR_INSERT'" + fi + fi +} + +set_default_package() +{ + if test "x$package" = "x" ; then + if test "x$developer_flag" = "xyes" ; then + package="extended" + else + package="cge" + fi + fi +} + +set_autotool_flags() +{ + if test "x$use_autotools" = "x" ; then + if test "x$developer_flag" = "xno" ; then + use_autotools="no" + else + use_autotools="yes" + fi + fi +} + +set_defaults_based_on_environment() +{ + if test ! -z "$MYSQL_DEVELOPER" ; then + developer_flag="yes" + fi + if test ! -z "$MYSQL_DEVELOPER_DEBUG" ; then + with_debug_flag="yes" + fast_flag="no" + fi + if test ! -z "$MYSQL_DEVELOPER_PACKAGE" ; then + package="$MYSQL_DEVELOPER_PACKAGE" + parse_package + fi +} + +######################################################################## + +if test ! -f sql/mysqld.cc ; then + die "You must run this script from the MySQL top-level directory" +fi + +cpu_type= +package= +prefix="/usr/local/mysql" +parallelism="4" +fast_flag="generic" +compiler="gcc" +gpl="yes" +version_text= +developer_flag="no" +just_configure= +full_debug= +warning_mode= +with_flags= +error_inject_flag= +with_debug_flag= +compile_debug_flag= +strip_flag= +valgrind_flag= +static_linking_flag= +compiler_flags= +os= +cpu_base_type= +warnings= +c_warnings= +cflags= +base_cflags= +cxx_warnings= +base_cxxflags= +base_configs= +debug_flags= +cxxflags= +m32= +m64= +datadir= +commands= +use_autotools= + +set_defaults_based_on_environment + +parse_options "$@" + +set_autotool_flags +set_default_package + +set -e + +# +# Check for the CPU and set up CPU specific flags. We may reset them +# later. +# This call sets the cpu_arg and check_cpu_args parameters +# +path=`dirname $0` +. "$path/check-cpu" +set_cpu_base +if test "x$?" = "x1" ; then + exit 1 +fi + +# +# Set up c_warnings and cxx_warnings; add to compiler_flags. +# Possibly reset check_cpu_flags. +# +set_warning_flags + +# +# Add to compiler_flags. +# +set_valgrind_flags +set_with_debug_flags +set_no_omit_frame_pointer_for_developers +set_debug_flag +set_gcc_special_options +set_icc_special_options + +# +# Definitions of various packages possible to compile. The default is to +# build a source variant of MySQL Cluster Carrier Grade Edition +# including all storage engines except InnoDB, and to use GPL libraries. +# +set_base_configs +set_base_engines +if test "x$gpl" = "xyes" ; then + version_text="GPL version" +else + version_text="Commercial version" +fi +if test "x$package" = "xpro" ; then + set_pro_package +elif test "x$package" = "xextended" ; then + set_cge_extended_package +elif test "x$package" = "xcge" ; then + set_cge_package +elif test "x$package" = "xclassic" ; then + set_classic_package +else + die "No supported package was used, internal error" +fi +set_readline_package +set_static_link_configs +set_error_inject_configs + +# +# This section handles flags for specific combinations of compilers, +# operating systems, and processors. +# + +check_os +if test "x$os" = "xlinux" ; then + set_linux_configs +elif test "x$os" = "xSolaris" ; then + set_solaris_configs +elif test "x$os" = "xMacOSX" ; then + set_macosx_configs +elif test "x$os" = "xbsd" ; then + set_bsd_configs +else + die "Operating system not supported by this script" +fi + +# +# Final step before setting up commands is to set up proper make and +# proper libtoolize versions, and to determine whether to use ccache. +# +set_make_version +set_up_ccache + +# +# Set up commands variable from variables prepared for base +# configurations, compiler flags, and warnings flags. +# +if test "x$use_autotools" = "xyes" ; then + init_auto_commands +fi +init_configure_commands + +if test "x$just_configure" != "xyes" ; then + add_make_commands +fi + +# +# The commands variable now contains the entire command to be run for +# the build; we either execute it, or merely print it out. +# +if test "x$just_print" = "xyes" ; then + echo "$commands" +else + eval "set -x; $commands" +fi diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 0720a53c54d..45dd8404f0d 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -2,6 +2,9 @@ # # Check cpu of current machine and find the # best compiler optimization flags for gcc +# Will return result in: +# cpu_arg : Type of CPU +# check_cpu_args : Arguments for GCC compiler settings # check_cpu () { @@ -33,7 +36,7 @@ check_cpu () { # parse CPU flags for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //' -e 's/[^a-zA-Z0-9_ ]/_/g'`; do - eval cpu_flag_$flag=yes + eval cpu_flag_$flag=yes done else # Fallback when there is no /proc/cpuinfo @@ -62,92 +65,95 @@ check_cpu () { Alpha*EV6*) cpu_arg="ev6"; ;; - # Intel ia32 *Intel*Core*|*X[eE][oO][nN]*) # a Xeon is just another pentium4 ... # ... unless it has the "lm" (long-mode) flag set, # in that case it's a Xeon with EM64T support + # If SSE3 support exists it is a Core2 Duo or newer # So is Intel Core. - if [ -z "$cpu_flag_lm" ]; then - cpu_arg="pentium4"; - else - cpu_arg="nocona"; + if [ -z "$cpu_flag_lm" ]; then + cpu_arg="pentium4" + else + cpu_arg="nocona" + fi + if test -z "$cpu_flag_ssse3" ; then + core2="no" + else + core2="yes" fi ;; *Pentium*4*Mobile*) - cpu_arg="pentium4m"; - ;; + cpu_arg="pentium4m" + ;; *Pentium*4*) - cpu_arg="pentium4"; + cpu_arg="pentium4" ;; *Pentium*III*Mobile*) - cpu_arg="pentium3m"; - ;; + cpu_arg="pentium3m" + ;; *Pentium*III*) - cpu_arg="pentium3"; - ;; + cpu_arg="pentium3" + ;; *Pentium*M*pro*) - cpu_arg="pentium-m"; + cpu_arg="pentium-m" ;; *Celeron\(R\)*\ M*) - cpu_arg="pentium-m"; - ;; + cpu_arg="pentium-m" + ;; *Celeron*Coppermine*) cpu_arg="pentium3" - ;; + ;; *Celeron\(R\)*) cpu_arg="pentium4" - ;; + ;; *Celeron*) - cpu_arg="pentium2"; - ;; - *Athlon*64*) - cpu_arg="athlon64"; + cpu_arg="pentium2" ;; *Turion*) - cpu_arg="athlon64"; + cpu_arg="athlon64" ;; - *Opteron*) - cpu_arg="athlon64"; + *Athlon*64*) + cpu_arg="athlon64" ;; *Athlon*) - cpu_arg="athlon"; + cpu_arg="athlon" ;; *Opteron*) - cpu_arg="opteron"; + cpu_arg="opteron" ;; # MacOSX / Intel *i386*i486*) - cpu_arg="pentium-m"; + cpu_arg="pentium-m" + ;; + *i386*) + cpu_arg="i386" ;; #Core 2 Duo *Intel*Core\(TM\)2*) - cpu_arg="nocona"; + cpu_arg="nocona" ;; - # Intel ia64 *Itanium*) - # Don't need to set any flags for itanium(at the moment) - cpu_arg=""; + cpu_arg="itanium" ;; - - # + # Solaris Sparc + *sparc*sun4u*) + cpu_arg="sparc" + ;; + # Power PC *ppc*) - cpu_arg='powerpc' + cpu_arg="powerpc" ;; - *powerpc*) - cpu_arg='powerpc' + cpu_arg="powerpc" ;; - # unknown *) - cpu_arg=""; + cpu_arg="" ;; esac - if test -z "$cpu_arg" ; then if test "$CPUINFO" != " " ; then # fallback to uname if necessary @@ -176,29 +182,22 @@ check_cpu () { cc_minor=$2 cc_patch=$3 cc_comp=`expr $cc_major '*' 100 '+' $cc_minor` - + case "$cc_ver--$cc_verno" in *GCC*) # different gcc backends (and versions) have different CPU flags case `gcc -dumpmachine` in - i?86-*) - if test "$cc_comp" -lt 304 - then - check_cpu_args='-mcpu=$cpu_arg' + i?86-* | x86_64-*) + if test "$cc_comp" -lt 304 ; then + check_cpu_cflags="-mcpu=${cpu_arg}" + elif test "$cc_comp" -ge 402 ; then + check_cpu_cflags="-mtune=native" else - check_cpu_args='-mtune=$cpu_arg' + check_cpu_cflags="-mtune=${cpu_arg}" fi ;; ppc-*) - check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg' - ;; - x86_64-*) - if test "$cc_comp" -lt 304 - then - check_cpu_args='-mcpu=$cpu_arg' - else - check_cpu_args='-mtune=$cpu_arg' - fi + check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}" ;; *) check_cpu_cflags="" @@ -208,7 +207,7 @@ check_cpu () { ;; 2.95.*) # GCC 2.95 doesn't expose its name in --version output - check_cpu_args='-m$cpu_arg' + check_cpu_cflags="-m${cpu_arg}" ;; *) check_cpu_cflags="" @@ -219,41 +218,23 @@ check_cpu () { # now we check whether the compiler really understands the cpu type touch __test.c + if test "x$core2" = "xyes" ; then + cpu_arg="core2" + fi while [ "$cpu_arg" ] ; do printf "testing $cpu_arg ... " >&2 # compile check - check_cpu_cflags=`eval echo $check_cpu_args` - if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then - echo ok >&2 - break; + eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null + if test "x$?" = "x0" ; then + echo ok >&2 + break; fi echo failed >&2 check_cpu_cflags="" - - # if compile failed: check whether it supports a predecessor of this CPU - # this list is not complete, feel free to add further entries - case "$cpu_arg" in - # Intel ia32 - nocona) cpu_arg=pentium4 ;; - prescott) cpu_arg=pentium4 ;; - pentium4m) cpu_arg=pentium4 ;; - pentium4) cpu_arg=pentium3 ;; - pentium3m) cpu_arg=pentium3 ;; - pentium3) cpu_arg=pentium2 ;; - pentium2) cpu_arg=pentiumpro ;; - pentiumpro) cpu_arg=pentium ;; - pentium) cpu_arg=i486 ;; - i486) cpu_arg=i386 ;; - - # power / powerPC - 7450) cpu_arg=7400 ;; - - *) cpu_arg="" ;; - esac + break; done - rm __test.* } -- cgit v1.2.1 From 6a15453640b4d92797817aeb83bcc96957a12c51 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Feb 2008 11:32:46 +0100 Subject: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Problem was that it did not work with corrupted/crashed tables. Solution is to disable these commands until WL#4176 is completed mysql-test/r/partition.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/inc/partition_alter4.inc: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION copy-paste error, changed from REBUILT to REPAIR, as the heading says mysql-test/suite/parts/r/partition_alter1_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter1_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter2_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_alter2_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_basic_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_basic_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Test result mysql-test/suite/parts/t/disabled.def: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Disabled test since the tested feature is not longer supported mysql-test/t/partition.test: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION OPTIMIZE PARTITION is not longer supported, waiting for WL#4176 sql/ha_partition.cc: Bug#20129: ALTER TABLE ... ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION Problem was that it did not work with corrupted/crashed tables. Solution is to disable these commands until WL#4176 is completed (returning HA_ADMIN_NOT_IMPLEMENTED and #ifdef'ed the non-reachable code) --- mysql-test/r/partition.result | 6 +- mysql-test/suite/parts/inc/partition_alter4.inc | 16 +- .../suite/parts/r/partition_alter1_innodb.result | 1008 +++++++------- .../suite/parts/r/partition_alter1_myisam.result | 512 +++---- .../suite/parts/r/partition_alter2_innodb.result | 1440 ++++++++++---------- .../suite/parts/r/partition_alter2_myisam.result | 1152 ++++++++-------- .../suite/parts/r/partition_basic_innodb.result | 474 +++---- .../suite/parts/r/partition_basic_myisam.result | 376 ++--- .../suite/parts/r/partition_engine_innodb.result | 84 +- .../suite/parts/r/partition_engine_myisam.result | 112 +- mysql-test/suite/parts/t/disabled.def | 2 + mysql-test/t/partition.test | 12 +- sql/ha_partition.cc | 15 + sql/sql_partition.cc | 14 +- 14 files changed, 2626 insertions(+), 2597 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index a361a8f6bcc..3cb681e4f92 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -342,7 +342,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 status OK +test.t1 analyze note The storage engine for the table doesn't support analyze drop table t1; create table t1 (a int) @@ -1045,9 +1045,7 @@ 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; -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 +ERROR 42000: The storage engine for the table doesn't support optimize partition DROP TABLE t1; CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; diff --git a/mysql-test/suite/parts/inc/partition_alter4.inc b/mysql-test/suite/parts/inc/partition_alter4.inc index 040c13d69d6..148d21e95f5 100644 --- a/mysql-test/suite/parts/inc/partition_alter4.inc +++ b/mysql-test/suite/parts/inc/partition_alter4.inc @@ -83,17 +83,17 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --echo #------------------------------------------------------------------------ --echo # 5 ALTER ... REPAIR PARTITION --echo #------------------------------------------------------------------------ ---echo # 5.1 ALTER ... REBUILD PARTITION part_1; -let $alter= ALTER TABLE t1 REBUILD PARTITION part_1; +--echo # 5.1 ALTER ... REPAIR PARTITION part_1; +let $alter= ALTER TABLE t1 REPAIR PARTITION part_1; --source suite/parts/inc/partition_alter_41.inc ---echo # 5.2 ALTER ... REBUILD PARTITION part_1,part_2; -let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +--echo # 5.2 ALTER ... REPAIR PARTITION part_1,part_2; +let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2; --source suite/parts/inc/partition_alter_41.inc ---echo # 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; +--echo # 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; --source suite/parts/inc/partition_alter_41.inc ---echo # 5.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; -let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; +--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 #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/r/partition_alter1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_innodb.result index a1d40af196c..2da6a92af31 100644 --- a/mysql-test/suite/parts/r/partition_alter1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_innodb.result @@ -833,16 +833,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1322,16 +1322,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1819,16 +1819,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2312,16 +2312,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2805,16 +2805,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3300,16 +3300,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3797,16 +3797,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4290,16 +4290,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4780,16 +4780,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5269,16 +5269,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5766,16 +5766,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6259,16 +6259,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6752,16 +6752,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7247,16 +7247,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7744,16 +7744,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8237,16 +8237,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8744,16 +8744,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9249,16 +9249,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9762,16 +9762,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10271,16 +10271,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10780,16 +10780,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11291,16 +11291,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11804,16 +11804,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12313,16 +12313,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12819,16 +12819,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13324,16 +13324,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13837,16 +13837,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14346,16 +14346,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14855,16 +14855,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15366,16 +15366,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15879,16 +15879,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16388,16 +16388,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16883,16 +16883,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17372,16 +17372,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17869,16 +17869,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18362,16 +18362,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18853,16 +18853,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19348,16 +19348,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19845,16 +19845,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20338,16 +20338,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20828,16 +20828,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21317,16 +21317,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21814,16 +21814,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22307,16 +22307,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22798,16 +22798,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23293,16 +23293,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23790,16 +23790,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24283,16 +24283,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24790,16 +24790,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25295,16 +25295,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25808,16 +25808,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26317,16 +26317,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26824,16 +26824,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27335,16 +27335,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27848,16 +27848,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28357,16 +28357,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28863,16 +28863,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29368,16 +29368,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29881,16 +29881,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30390,16 +30390,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30897,16 +30897,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31408,16 +31408,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31921,16 +31921,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32430,16 +32430,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32922,16 +32922,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33412,16 +33412,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33910,16 +33910,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34404,16 +34404,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34896,16 +34896,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35392,16 +35392,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35890,16 +35890,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36384,16 +36384,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36875,16 +36875,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37365,16 +37365,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37863,16 +37863,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -38357,16 +38357,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -38849,16 +38849,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -39345,16 +39345,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -39843,16 +39843,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -40337,16 +40337,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -40828,16 +40828,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -41318,16 +41318,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -41816,16 +41816,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -42310,16 +42310,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -42802,16 +42802,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -43298,16 +43298,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -43796,16 +43796,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -44290,16 +44290,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -44736,16 +44736,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -45173,16 +45173,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -45618,16 +45618,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -46059,16 +46059,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -46500,16 +46500,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -46943,16 +46943,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -47388,16 +47388,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -47829,16 +47829,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -48267,16 +48267,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -48704,16 +48704,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -49149,16 +49149,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -49590,16 +49590,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -50031,16 +50031,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -50474,16 +50474,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -50919,16 +50919,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -51360,16 +51360,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -51814,16 +51814,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -52267,16 +52267,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -52728,16 +52728,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -53185,16 +53185,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -53642,16 +53642,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -54101,16 +54101,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -54562,16 +54562,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -55019,16 +55019,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -55461,16 +55461,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -55898,16 +55898,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -56343,16 +56343,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -56784,16 +56784,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -57223,16 +57223,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -57666,16 +57666,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -58111,16 +58111,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -58552,16 +58552,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -58990,16 +58990,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -59427,16 +59427,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -59872,16 +59872,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -60313,16 +60313,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -60752,16 +60752,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -61195,16 +61195,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -61640,16 +61640,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -62081,16 +62081,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -62536,16 +62536,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -62989,16 +62989,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -63450,16 +63450,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -63907,16 +63907,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -64362,16 +64362,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -64821,16 +64821,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -65282,16 +65282,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -65739,16 +65739,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -66193,16 +66193,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -66646,16 +66646,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -67107,16 +67107,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -67564,16 +67564,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -68019,16 +68019,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -68478,16 +68478,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -68939,16 +68939,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -69396,16 +69396,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -69835,16 +69835,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -70272,16 +70272,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -70717,16 +70717,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -71158,16 +71158,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -71597,16 +71597,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -72040,16 +72040,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -72485,16 +72485,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -72926,16 +72926,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -73364,16 +73364,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -73801,16 +73801,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -74246,16 +74246,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -74687,16 +74687,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -75126,16 +75126,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -75569,16 +75569,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -76014,16 +76014,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -76455,16 +76455,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -76909,16 +76909,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -77362,16 +77362,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -77823,16 +77823,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -78280,16 +78280,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -78735,16 +78735,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -79194,16 +79194,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -79655,16 +79655,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -80112,16 +80112,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 diff --git a/mysql-test/suite/parts/r/partition_alter1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_myisam.result index 1058342aa8d..80c622a5d3c 100644 --- a/mysql-test/suite/parts/r/partition_alter1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9167,20 +9167,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9688,20 +9688,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10223,20 +10223,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10750,20 +10750,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11279,20 +11279,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11812,20 +11812,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12347,20 +12347,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12880,20 +12880,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13396,20 +13396,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13917,20 +13917,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14452,20 +14452,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14979,20 +14979,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -15508,20 +15508,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16041,20 +16041,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16576,20 +16576,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17109,20 +17109,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17580,20 +17580,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18049,20 +18049,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18532,20 +18532,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19007,20 +19007,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19486,20 +19486,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19967,20 +19967,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20450,20 +20450,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20931,20 +20931,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21399,20 +21399,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21868,20 +21868,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22351,20 +22351,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22826,20 +22826,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -23303,20 +23303,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -23784,20 +23784,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -24267,20 +24267,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -24748,20 +24748,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -25212,20 +25212,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -25681,20 +25681,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -26164,20 +26164,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -26639,20 +26639,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -27116,20 +27116,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -27597,20 +27597,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -28080,20 +28080,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -28561,20 +28561,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -29025,20 +29025,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -29494,20 +29494,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -29977,20 +29977,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -30452,20 +30452,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -30929,20 +30929,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -31410,20 +31410,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -31893,20 +31893,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -32374,20 +32374,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 0bb44bb2a1d..15de39a3f9f 100644 --- a/mysql-test/suite/parts/r/partition_alter2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_innodb.result @@ -479,16 +479,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -932,16 +932,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1393,16 +1393,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1850,16 +1850,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2307,16 +2307,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2766,16 +2766,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3227,16 +3227,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3684,16 +3684,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4175,16 +4175,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4664,16 +4664,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5161,16 +5161,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5654,16 +5654,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6147,16 +6147,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6642,16 +6642,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7139,16 +7139,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7632,16 +7632,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8122,16 +8122,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8611,16 +8611,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9108,16 +9108,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9601,16 +9601,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10094,16 +10094,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10589,16 +10589,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11086,16 +11086,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11579,16 +11579,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12086,16 +12086,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12591,16 +12591,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13104,16 +13104,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13613,16 +13613,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14122,16 +14122,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14633,16 +14633,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15146,16 +15146,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15655,16 +15655,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16161,16 +16161,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16666,16 +16666,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17179,16 +17179,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17688,16 +17688,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18197,16 +18197,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18708,16 +18708,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19221,16 +19221,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19730,16 +19730,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20189,16 +20189,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20642,16 +20642,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21103,16 +21103,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21560,16 +21560,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22017,16 +22017,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22476,16 +22476,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22937,16 +22937,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23394,16 +23394,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23848,16 +23848,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24301,16 +24301,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24762,16 +24762,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25219,16 +25219,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25674,16 +25674,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26133,16 +26133,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26594,16 +26594,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27051,16 +27051,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27542,16 +27542,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28031,16 +28031,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28528,16 +28528,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29021,16 +29021,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29514,16 +29514,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30009,16 +30009,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30506,16 +30506,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30999,16 +30999,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31489,16 +31489,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31978,16 +31978,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32475,16 +32475,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32968,16 +32968,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33459,16 +33459,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33954,16 +33954,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34451,16 +34451,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34944,16 +34944,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35434,16 +35434,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35923,16 +35923,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36420,16 +36420,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36913,16 +36913,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37406,16 +37406,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37901,16 +37901,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -38398,16 +38398,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -38891,16 +38891,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -39381,16 +39381,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -39870,16 +39870,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -40367,16 +40367,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -40860,16 +40860,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -41351,16 +41351,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -41846,16 +41846,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -42343,16 +42343,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -42836,16 +42836,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -43343,16 +43343,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -43848,16 +43848,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -44361,16 +44361,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -44870,16 +44870,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -45379,16 +45379,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -45890,16 +45890,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -46403,16 +46403,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -46912,16 +46912,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -47418,16 +47418,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -47923,16 +47923,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -48436,16 +48436,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -48945,16 +48945,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -49452,16 +49452,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -49963,16 +49963,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -50476,16 +50476,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -50985,16 +50985,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -51491,16 +51491,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -51996,16 +51996,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -52509,16 +52509,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -53018,16 +53018,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -53527,16 +53527,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -54038,16 +54038,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -54551,16 +54551,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -55060,16 +55060,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -55566,16 +55566,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -56071,16 +56071,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -56584,16 +56584,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -57093,16 +57093,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -57600,16 +57600,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -58111,16 +58111,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -58624,16 +58624,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -59133,16 +59133,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -59598,16 +59598,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -60053,16 +60053,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -60516,16 +60516,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -60973,16 +60973,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -61432,16 +61432,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -61891,16 +61891,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -62354,16 +62354,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -62813,16 +62813,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -63305,16 +63305,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -63796,16 +63796,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -64295,16 +64295,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -64788,16 +64788,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -65283,16 +65283,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -65778,16 +65778,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -66277,16 +66277,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -66772,16 +66772,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -67264,16 +67264,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -67755,16 +67755,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -68254,16 +68254,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -68747,16 +68747,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -69242,16 +69242,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -69737,16 +69737,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -70236,16 +70236,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -70731,16 +70731,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -71240,16 +71240,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -71747,16 +71747,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -72262,16 +72262,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -72771,16 +72771,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -73282,16 +73282,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -73793,16 +73793,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -74308,16 +74308,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -74819,16 +74819,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -75327,16 +75327,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -75834,16 +75834,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -76349,16 +76349,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -76858,16 +76858,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -77369,16 +77369,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -77880,16 +77880,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -78395,16 +78395,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -78906,16 +78906,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -79367,16 +79367,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -79823,16 +79823,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -80287,16 +80287,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -80749,16 +80749,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -81209,16 +81209,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -81673,16 +81673,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -82137,16 +82137,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -82597,16 +82597,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -83054,16 +83054,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -83510,16 +83510,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -83974,16 +83974,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -84436,16 +84436,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -84896,16 +84896,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -85360,16 +85360,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -85824,16 +85824,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -86284,16 +86284,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -86778,16 +86778,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -87270,16 +87270,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -87770,16 +87770,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -88268,16 +88268,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -88764,16 +88764,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -89264,16 +89264,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -89764,16 +89764,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -90260,16 +90260,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -90753,16 +90753,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -91245,16 +91245,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -91745,16 +91745,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -92243,16 +92243,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -92739,16 +92739,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -93239,16 +93239,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -93739,16 +93739,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -94235,16 +94235,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -94728,16 +94728,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -95220,16 +95220,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -95720,16 +95720,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -96218,16 +96218,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -96714,16 +96714,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -97214,16 +97214,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -97714,16 +97714,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -98210,16 +98210,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -98703,16 +98703,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -99195,16 +99195,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -99695,16 +99695,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -100193,16 +100193,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -100689,16 +100689,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -101189,16 +101189,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -101689,16 +101689,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -102185,16 +102185,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -102695,16 +102695,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -103203,16 +103203,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -103719,16 +103719,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -104233,16 +104233,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -104745,16 +104745,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -105261,16 +105261,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -105777,16 +105777,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -106289,16 +106289,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -106798,16 +106798,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -107306,16 +107306,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -107822,16 +107822,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -108336,16 +108336,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -108848,16 +108848,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -109364,16 +109364,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -109880,16 +109880,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -110392,16 +110392,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -110901,16 +110901,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -111409,16 +111409,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -111925,16 +111925,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -112439,16 +112439,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -112951,16 +112951,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -113467,16 +113467,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -113983,16 +113983,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -114495,16 +114495,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -115004,16 +115004,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -115512,16 +115512,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -116028,16 +116028,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -116542,16 +116542,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -117054,16 +117054,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -117570,16 +117570,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -118086,16 +118086,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -118598,16 +118598,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 18abf7380c3..99cb22b97c3 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index b9097e33ce0..03c6e1915bf 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -469,16 +469,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -914,16 +914,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1359,16 +1359,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1802,16 +1802,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2247,16 +2247,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2690,16 +2690,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3135,16 +3135,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3580,16 +3580,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4026,16 +4026,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4471,16 +4471,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4916,16 +4916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5359,16 +5359,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5804,16 +5804,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6247,16 +6247,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6692,16 +6692,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7137,16 +7137,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7583,16 +7583,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8028,16 +8028,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8473,16 +8473,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8916,16 +8916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9361,16 +9361,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9804,16 +9804,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10249,16 +10249,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10705,16 +10705,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11153,16 +11153,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11609,16 +11609,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12061,16 +12061,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12511,16 +12511,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12965,16 +12965,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13421,16 +13421,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13873,16 +13873,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14355,16 +14355,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14837,16 +14837,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15319,16 +15319,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15799,16 +15799,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16281,16 +16281,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16761,16 +16761,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17243,16 +17243,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17725,16 +17725,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18208,16 +18208,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18690,16 +18690,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19172,16 +19172,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19652,16 +19652,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20134,16 +20134,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20614,16 +20614,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21096,16 +21096,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21578,16 +21578,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22077,16 +22077,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22575,16 +22575,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23073,16 +23073,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23569,16 +23569,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24067,16 +24067,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24563,16 +24563,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25061,16 +25061,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25559,16 +25559,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26056,16 +26056,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26541,16 +26541,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27034,16 +27034,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27523,16 +27523,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28010,16 +28010,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28501,16 +28501,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28994,16 +28994,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29483,16 +29483,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29969,16 +29969,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30454,16 +30454,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30947,16 +30947,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31436,16 +31436,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31923,16 +31923,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32414,16 +32414,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32907,16 +32907,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33396,16 +33396,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33898,16 +33898,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34399,16 +34399,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34908,16 +34908,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35413,16 +35413,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35916,16 +35916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36423,16 +36423,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36932,16 +36932,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37437,16 +37437,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index 7e0d5bcd62a..52c3b92912e 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -479,20 +479,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -934,20 +934,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -1395,20 +1395,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -1850,20 +1850,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2311,20 +2311,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2770,20 +2770,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3231,20 +3231,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3694,20 +3694,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -4148,16 +4148,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4167,7 +4167,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master- # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4631,16 +4631,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4650,7 +4650,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master- # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5126,16 +5126,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5145,7 +5145,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/mast # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5611,16 +5611,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5630,7 +5630,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/mast # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6106,16 +6106,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6125,7 +6125,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6599,16 +6599,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -6618,7 +6618,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTES # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7094,16 +7094,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7113,7 +7113,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VAR # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7593,16 +7593,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -7612,7 +7612,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -8061,20 +8061,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -8516,20 +8516,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -8977,20 +8977,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9432,20 +9432,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9893,20 +9893,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10352,20 +10352,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10813,20 +10813,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11273,20 +11273,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11737,20 +11737,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12215,20 +12215,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12685,20 +12685,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13157,20 +13157,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13633,20 +13633,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14111,20 +14111,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14587,20 +14587,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -15095,20 +15095,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -15603,20 +15603,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16117,20 +16117,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16625,20 +16625,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17139,20 +17139,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17651,20 +17651,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18165,20 +18165,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18681,20 +18681,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19198,20 +19198,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19715,20 +19715,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20246,20 +20246,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20769,20 +20769,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21294,20 +21294,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21823,20 +21823,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22354,20 +22354,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22883,20 +22883,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 04a5a492269..72881e5ed7e 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -473,16 +473,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -927,16 +927,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1380,16 +1380,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1834,16 +1834,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2284,16 +2284,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2737,16 +2737,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3190,16 +3190,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3647,16 +3647,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4100,16 +4100,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4555,16 +4555,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5008,16 +5008,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5463,16 +5463,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5914,16 +5914,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6363,16 +6363,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index f81becc6eea..5ec221722e0 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 status OK +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -1878,20 +1878,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2338,20 +2338,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2805,20 +2805,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3272,20 +3272,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3743,20 +3743,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -4210,20 +4210,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -4675,20 +4675,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -5142,20 +5142,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -5611,20 +5611,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -6070,20 +6070,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -6529,20 +6529,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 85b31bb0598..31bbd8c05b4 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -16,3 +16,5 @@ partition_sessions : needs system_3_init.inc partition_engine_ndb : cannot create t1 part_supported_sql_func_ndb : cannot create t1 rpl_ndb_dd_partitions : cannot create t1 +partition_alter4_myisam : Bug#20129 / WL#4176 +partition_alter4_innodb : Bug#20129 / WL#4176 diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23d6c5f8865..dc0f6cdcc2e 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -35,7 +35,7 @@ PARTITION `p5` VALUES LESS THAN (2010) COMMENT 'APSTART \' APEND' ); #--exec sed 's/APSTART \\/APSTART /' var/master-data/test/t1.frm > tmpt1.frm && mv tmpt1.frm var/master-data/test/t1.frm -#--error 1064 +#--error ER_PARSE_ERROR SELECT * FROM t1 LIMIT 1; DROP TABLE t1; @@ -1208,9 +1208,11 @@ 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; # @@ -1568,9 +1570,9 @@ PARTITION BY RANGE (a) ( PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20) ); ---error 1064 +--error ER_PARSE_ERROR ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; ---error 1064 +--error ER_PARSE_ERROR ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; DROP TABLE t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 51070a525c5..d97af771a00 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1035,6 +1035,13 @@ 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); + +#ifdef WL4176_IS_DONE if (flag == OPTIMIZE_PARTS) error= file->ha_optimize(thd, check_opt); else if (flag == ANALYZE_PARTS) @@ -1051,6 +1058,7 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, if (error == HA_ADMIN_ALREADY_DONE) error= 0; DBUG_RETURN(error); +#endif } @@ -1080,6 +1088,12 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, 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++; @@ -1110,6 +1124,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, } } while (++i < no_parts); DBUG_RETURN(FALSE); +#endif } /* diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index eabf4526f7b..c0707360027 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -6113,7 +6113,19 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, ((alter_info->flags & ALTER_REPAIR_PARTITION) && (error= table->file->ha_repair_partitions(thd)))) { - table->file->print_error(error, MYF(0)); + 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; } } -- cgit v1.2.1 From 863b86db2485dddbfdbb8200531b7af265daa5db Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Feb 2008 15:12:45 +0400 Subject: Fix for bug #33758: Got query result when using ORDER BY ASC, but empty result when using DESC Problem: fetching MyISAM keys we copy a key block pointer to the end of the key buffer. However, we don't take into account the pointer length calculatig the buffer size, that may leads to memory overwriting and in turn to unpredictable results. Fix: increase key buffer size by length of the key block pointer. Note: no simple test case. myisam/mi_open.c: Fix for bug #33758: Got query result when using ORDER BY ASC, but empty result when using DESC - increase possible maximum key length by size of the key block pointer, as it's copied into the key buffer in the get_key() MyISAM functions. --- myisam/mi_open.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 5314d6a9a6c..d4d8458a669 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -270,6 +270,9 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) if (share->options & HA_OPTION_COMPRESS_RECORD) share->base.max_key_length+=2; /* For safety */ + /* Add space for node pointer */ + share->base.max_key_length+= share->base.key_reflength; + if (!my_multi_malloc(MY_WME, &share,sizeof(*share), &share->state.rec_per_key_part,sizeof(long)*key_parts, -- cgit v1.2.1 From 911a85d54844ad75f407359bd86a44c76c7e6dc4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Feb 2008 11:26:24 +0100 Subject: Added comments on why we do reopen Handle error case of not being able to reopen which requires us to remove table from thread's open list and table_cache. --- sql/sql_partition.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 677d45dc33d..3f65baa71ff 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -5846,21 +5846,31 @@ static void release_log_entries(partition_info *part_info) RETURN VALUES NONE */ -void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt) +static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt) { int err; if (lpt->thd->locked_tables) { + /* + When we have the table locked, it is necessary to reopen the table + since all table objects were closed and removed as part of the + ALTER TABLE of partitioning structure. + */ pthread_mutex_lock(&LOCK_open); lpt->thd->in_lock_tables= 1; err= reopen_tables(lpt->thd, 1, 1); lpt->thd->in_lock_tables= 0; - pthread_mutex_unlock(&LOCK_open); if (err) { - /* Issue a warning since we weren't able to regain the lock again. */ + /* + Issue a warning since we weren't able to regain the lock again. + We also need to unlink table from thread's open list and from + table_cache + */ + unlink_open_table(lpt->thd, lpt->table, FALSE); sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE"); } + pthread_mutex_unlock(&LOCK_open); } } -- cgit v1.2.1 From 55f6727b708d99562b48ba5391a43ec235375125 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Feb 2008 16:27:01 +0400 Subject: BUG#33946 - Join on Federated tables with Unique index gives error 1430 from storage engine Federated may crash a server, return wrong result set, return "ERROR 1030 (HY000): Got error 1430 from storage engine" message when local (engine=federated) table has a key against nullable column. The problem was wrong implementation of function that creates WHERE clause for remote query from key. mysql-test/r/federated.result: A test case for BUG#33946. mysql-test/t/federated.test: A test case for BUG#33946. sql/ha_federated.cc: Fixed that federated adds " IS NULL " condition to a remote query, whereas "IS NOT NULL" requested by original query. Fixed that federated didn't check for end of key buffer, didn't setup key buffer pointer and remaining lenght of key buffer, didn't add " AND " between conditions in case original query has IS [NOT] NULL condition against nullable column. Fixed that federated wrongly shifts key buffer pointer by extra one byte when key part may be null (was: store_length + 1, now: store_length). --- mysql-test/r/federated.result | 24 ++++++++++++++++++++++++ mysql-test/t/federated.test | 21 +++++++++++++++++++++ sql/ha_federated.cc | 22 +++++++++++++++++++--- 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index a005db4deac..3a934e7fe3c 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -2045,6 +2045,30 @@ select 1 from t1 order by a; drop table t1; drop table t1; drop view v1; +CREATE TABLE t1 (a INT, b INT, KEY(a,b)); +INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2); +CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +SELECT * FROM t1 WHERE a IS NULL; +a b +NULL NULL +NULL 1 +SELECT * FROM t1 WHERE a IS NOT NULL; +a b +1 NULL +1 1 +2 2 +SELECT * FROM t1 WHERE a=1 AND b=1; +a b +1 1 +SELECT * FROM t1 WHERE a IS NULL AND b=1; +a b +NULL 1 +SELECT * FROM t1 WHERE a IS NOT NULL AND b=1; +a b +1 1 +DROP TABLE t1; +DROP TABLE t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index d4f22650a32..934db5cd68b 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1716,5 +1716,26 @@ connection slave; drop table t1; drop view v1; +# +# BUG#33946 - Join on Federated tables with Unique index gives error 1430 +# from storage engine +# +connection slave; +CREATE TABLE t1 (a INT, b INT, KEY(a,b)); +INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2); + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated +CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +SELECT * FROM t1 WHERE a IS NULL; +SELECT * FROM t1 WHERE a IS NOT NULL; +SELECT * FROM t1 WHERE a=1 AND b=1; +SELECT * FROM t1 WHERE a IS NULL AND b=1; +SELECT * FROM t1 WHERE a IS NOT NULL AND b=1; +DROP TABLE t1; + +connection slave; +DROP TABLE t1; source include/federated_cleanup.inc; diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index ac1e0962ffb..c0743bd6c9a 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -1094,10 +1094,20 @@ bool ha_federated::create_where_from_key(String *to, { if (*ptr++) { + /* + We got "IS [NOT] NULL" condition against nullable column. We + distinguish between "IS NOT NULL" and "IS NULL" by flag. For + "IS NULL", flag is set to HA_READ_KEY_EXACT. + */ if (emit_key_part_name(&tmp, key_part) || - tmp.append(FEDERATED_ISNULL)) + tmp.append(ranges[i]->flag == HA_READ_KEY_EXACT ? + FEDERATED_ISNULL : " IS NOT NULL ")) DBUG_RETURN(1); - continue; + /* + We need to adjust pointer and length to be prepared for next + key part. As well as check if this was last key part. + */ + goto prepare_for_next_key_part; } } @@ -1199,12 +1209,18 @@ bool ha_federated::create_where_from_key(String *to, if (tmp.append(FEDERATED_CLOSEPAREN)) DBUG_RETURN(1); +prepare_for_next_key_part: if (store_length >= length) break; DBUG_PRINT("info", ("remainder %d", remainder)); DBUG_ASSERT(remainder > 1); length-= store_length; - ptr+= store_length; + /* + For nullable columns, null-byte is already skipped before, that is + ptr was incremented by 1. Since store_length still counts null-byte, + we need to subtract 1 from store_length. + */ + ptr+= store_length - test(key_part->null_bit); if (tmp.append(FEDERATED_AND)) DBUG_RETURN(1); -- cgit v1.2.1 From df6d607c87054edf2b6e269359efd2a18f884571 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 14 Feb 2008 18:23:58 +0400 Subject: After merge fix. --- storage/federated/ha_federated.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 01c9e3df4ea..d7040c44fe8 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1298,9 +1298,9 @@ bool ha_federated::create_where_from_key(String *to, "IS NULL", flag is set to HA_READ_KEY_EXACT. */ if (emit_key_part_name(&tmp, key_part) || - tmp.append(ranges[i]->flag == HA_READ_KEY_EXACT ? - STRING_WITH_LEN(" IS NULL ") : - STRING_WITH_LEN(" IS NOT NULL "))) + (ranges[i]->flag == HA_READ_KEY_EXACT ? + tmp.append(STRING_WITH_LEN(" IS NULL ")) : + tmp.append(STRING_WITH_LEN(" IS NOT NULL ")))) goto err; /* We need to adjust pointer and length to be prepared for next -- cgit v1.2.1 From 38354149c87dcb16a97c79de34ab48c80c10c499 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Feb 2008 16:03:54 +0400 Subject: Fix for bug #33304: Test 'func_group' hangs on Mac OS X 10.4 PowerPC 64-bit Problem: SLEEP(0) never returns on 64-bit Mac OS X due to a bug in pthread_cond_timedwait(). Fix: when given a very short timeout just return immediately. sql/item_func.cc: Fix for bug #33304: Test 'func_group' hangs on Mac OS X 10.4 PowerPC 64-bit - if given a very short timeout (< 10 mcs) just return from SLEEP(). --- sql/item_func.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sql/item_func.cc b/sql/item_func.cc index 639e069d24e..e20b0762ea2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3729,6 +3729,18 @@ longlong Item_func_sleep::val_int() DBUG_ASSERT(fixed == 1); double time= args[0]->val_real(); + /* + On 64-bit OSX pthread_cond_timedwait() waits forever + if passed abstime time has already been exceeded by + the system time. + When given a very short timeout (< 10 mcs) just return + immediately. + We assume that the lines between this test and the call + to pthread_cond_timedwait() will be executed in less than 0.00001 sec. + */ + if (time < 0.00001) + return 0; + set_timespec_nsec(abstime, (ulonglong)(time * ULL(1000000000))); pthread_cond_init(&cond, NULL); -- cgit v1.2.1 From f802cd51238c7842b789e49ba27d3c119ebb8ce3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Feb 2008 18:16:17 +0400 Subject: BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks replication NAME_CONST() didn't replicate constant character set and collation correctly. With this fix NAME_CONST() inherits collation from the value argument. mysql-test/r/func_misc.result: A test case for BUG#34289. mysql-test/t/func_misc.test: A test case for BUG#34289. sql/item.cc: Inherit collation from value argument. --- mysql-test/r/func_misc.result | 3 +++ mysql-test/t/func_misc.test | 6 ++++++ sql/item.cc | 1 + 3 files changed, 10 insertions(+) diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 4f6b6d3a0d8..fa9ca3539d6 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -225,4 +225,7 @@ select min(a) from t1 group by inet_ntoa(a); min(a) -2 drop table t1; +SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs; +NAME_CONST('var', 'value') COLLATE latin1_general_cs +value End of 5.0 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index ccb59df5677..17a0dbe50a7 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -237,5 +237,11 @@ insert into t1 values (-1), (-2); select min(a) from t1 group by inet_ntoa(a); drop table t1; +# +# BUG#34289 - Incorrect NAME_CONST substitution in stored procedures breaks +# replication +# +SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs; + --echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index ffb18054750..d0dc8201577 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1240,6 +1240,7 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref) return TRUE; } set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info); + collation.set(value_item->collation.collation, DERIVATION_IMPLICIT); max_length= value_item->max_length; decimals= value_item->decimals; fixed= 1; -- cgit v1.2.1 From a1915039e8e202c705b6cde961fd2fb95fa84901 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Feb 2008 12:55:13 -0800 Subject: Bug#34598 "crash on hpita: Invalid address alignment" Replace dangerous pointer arithmetic - it may occurr where sizeof(int) is less than size of machine alignment requirement. include/mysql/plugin.h: bug34598 change of update func prototype sql/sql_plugin.cc: bug34598 Avoid dangerous pointer arithmetic which can cause unaligned word access. Change of update function prototype --- include/mysql/plugin.h | 2 +- sql/sql_plugin.cc | 56 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 50ec051d111..5094f65cb59 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -187,7 +187,7 @@ typedef int (*mysql_var_check_func)(MYSQL_THD thd, */ typedef void (*mysql_var_update_func)(MYSQL_THD thd, struct st_mysql_sys_var *var, - void *var_ptr, void *save); + void *var_ptr, const void *save); /* the following declarations are for internal use only */ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 2a86844c8c6..ede326457f5 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2069,35 +2069,35 @@ err: static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, - void *tgt, void *save) + void *tgt, const void *save) { *(my_bool *) tgt= *(int *) save ? 1 : 0; } static void update_func_int(THD *thd, struct st_mysql_sys_var *var, - void *tgt, void *save) + void *tgt, const void *save) { *(int *)tgt= *(int *) save; } static void update_func_long(THD *thd, struct st_mysql_sys_var *var, - void *tgt, void *save) + void *tgt, const void *save) { *(long *)tgt= *(long *) save; } static void update_func_longlong(THD *thd, struct st_mysql_sys_var *var, - void *tgt, void *save) + void *tgt, const void *save) { *(longlong *)tgt= *(ulonglong *) save; } static void update_func_str(THD *thd, struct st_mysql_sys_var *var, - void *tgt, void *save) + void *tgt, const void *save) { char *old= *(char **) tgt; *(char **)tgt= *(char **) save; @@ -2654,7 +2654,8 @@ bool sys_var_pluginvar::check(THD *thd, set_var *var) void sys_var_pluginvar::set_default(THD *thd, enum_var_type type) { - void *tgt, *src; + const void *src; + void *tgt; DBUG_ASSERT(is_readonly() || plugin_var->update); @@ -2667,9 +2668,34 @@ void sys_var_pluginvar::set_default(THD *thd, enum_var_type type) if (plugin_var->flags & PLUGIN_VAR_THDLOCAL) { - src= ((int*) (plugin_var + 1) + 1); if (type != OPT_GLOBAL) src= real_value_ptr(thd, OPT_GLOBAL); + else + switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) { + case PLUGIN_VAR_INT: + src= &((thdvar_uint_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONG: + src= &((thdvar_ulong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_LONGLONG: + src= &((thdvar_ulonglong_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_ENUM: + src= &((thdvar_enum_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_SET: + src= &((thdvar_set_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_BOOL: + src= &((thdvar_bool_t*) plugin_var)->def_val; + break; + case PLUGIN_VAR_STR: + src= &((thdvar_str_t*) plugin_var)->def_val; + break; + default: + DBUG_ASSERT(0); + } } /* thd must equal current_thd if PLUGIN_VAR_THDLOCAL flag is set */ @@ -2757,25 +2783,25 @@ static void plugin_opt_set_limits(struct my_option *options, case PLUGIN_VAR_ENUM: options->var_type= GET_ENUM; options->typelib= ((sysvar_enum_t*) opt)->typelib; - options->def_value= *(ulong*) ((int*) (opt + 1) + 1); + options->def_value= ((sysvar_enum_t*) opt)->def_val; options->min_value= options->block_size= 0; options->max_value= options->typelib->count - 1; break; case PLUGIN_VAR_SET: options->var_type= GET_SET; options->typelib= ((sysvar_set_t*) opt)->typelib; - options->def_value= *(ulonglong*) ((int*) (opt + 1) + 1); + options->def_value= ((sysvar_set_t*) opt)->def_val; options->min_value= options->block_size= 0; options->max_value= (ULL(1) << options->typelib->count) - 1; break; case PLUGIN_VAR_BOOL: options->var_type= GET_BOOL; - options->def_value= *(my_bool*) ((void**)(opt + 1) + 1); + options->def_value= ((sysvar_bool_t*) opt)->def_val; break; case PLUGIN_VAR_STR: options->var_type= ((opt->flags & PLUGIN_VAR_MEMALLOC) ? GET_STR_ALLOC : GET_STR); - options->def_value= (ulonglong)(intptr) *((char**) ((void**) (opt + 1) + 1)); + options->def_value= (intptr) ((sysvar_str_t*) opt)->def_val; break; /* threadlocal variables */ case PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL: @@ -2799,25 +2825,25 @@ static void plugin_opt_set_limits(struct my_option *options, case PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL: options->var_type= GET_ENUM; options->typelib= ((thdvar_enum_t*) opt)->typelib; - options->def_value= *(ulong*) ((int*) (opt + 1) + 1); + options->def_value= ((thdvar_enum_t*) opt)->def_val; options->min_value= options->block_size= 0; options->max_value= options->typelib->count - 1; break; case PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL: options->var_type= GET_SET; options->typelib= ((thdvar_set_t*) opt)->typelib; - options->def_value= *(ulonglong*) ((int*) (opt + 1) + 1); + options->def_value= ((thdvar_set_t*) opt)->def_val; options->min_value= options->block_size= 0; options->max_value= (ULL(1) << options->typelib->count) - 1; break; case PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL: options->var_type= GET_BOOL; - options->def_value= *(my_bool*) ((int*) (opt + 1) + 1); + options->def_value= ((thdvar_bool_t*) opt)->def_val; break; case PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL: options->var_type= ((opt->flags & PLUGIN_VAR_MEMALLOC) ? GET_STR_ALLOC : GET_STR); - options->def_value= (intptr) *((char**) ((void**) (opt + 1) + 1)); + options->def_value= (intptr) ((thdvar_str_t*) opt)->def_val; break; default: DBUG_ASSERT(0); -- cgit v1.2.1 From 40089da1db09fc58aa1c696809e91cf471d30948 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Feb 2008 13:46:54 -0800 Subject: backport valgrind cleanups from 6.0-engines mysql-test/valgrind.supp: silence valgrind warning of memory leak in dlopen strings/strmake.c: silence valgrind warning cause by strlen examining unset bytes. --- mysql-test/valgrind.supp | 13 +++++++++++++ strings/strmake.c | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index a4fb488a3d6..cb1b07c83b0 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -495,3 +495,16 @@ fun:_db_enter_ fun:kill_server } + +# +# Warning caused by small memory leak in threaded dlopen +# + +{ + dlopen threaded memory leak + Memcheck:Leak + fun:calloc + obj:*/libdl-*.so + fun:dlopen* +} + diff --git a/strings/strmake.c b/strings/strmake.c index df8d78e8476..2d5fa5e36aa 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -41,9 +41,9 @@ char *strmake(register char *dst, register const char *src, size_t length) write a character rather than '\0' as this makes spotting these problems in the results easier. */ - uint n= strlen(src) + 1; - if (n <= length) - memset(dst + n, (int) 'Z', length - n + 1); + uint n= 0; + while (n < length && src[n++]); + memset(dst + n, (int) 'Z', length - n + 1); #endif while (length--) -- cgit v1.2.1 From fea2a5d83dea81e231bb14bc5535b60261c7b30d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Feb 2008 19:07:07 +0400 Subject: BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if log-slave-updates and circul repl Slave SQL thread may execute one extra event when there are events skipped by slave I/O thread (e.g. originated by the same server). Whereas it was requested not to do so by the UNTIL condition. This happens because we compare with the end position of previously executed event. This is fine when there are no skipped by slave I/O thread events, as end position of previous event equals to start position of to be executed event. Otherwise this position equals to start position of skipped event. This is fixed by: - reading the event to be executed before checking if the until condition is satisfied. - comparing the start position of the event to be executed. Since we do not have the start position available, we compute it by subtracting event length from end position (which is available). - if there are no events on the event queue at the slave sql starting time, that meet until condition, we stop immediately, as in this case we do not want to wait for next event. mysql-test/r/rpl_dual_pos_advance.result: A test case for BUG#13861. mysql-test/t/rpl_dual_pos_advance.test: A test case for BUG#13861. sql/log_event.cc: Store length of event. This is needed for further calculation of the beginning of event. sql/slave.cc: Slave SQL thread may execute one extra event when there are events skipped by slave I/O thread (e.g. originated by the same server). Whereas it was requested not to do so by the UNTIL condition. This happens because we compare with the end position of previously executed event. This is fine when there are no skipped by slave I/O thread events, as end position of previous event equals to start position of to be executed event. Otherwise this position equals to start position of skipped event. This is fixed by: - reading the event to be executed before checking if the until condition is satisfied. - comparing the start position of the event to be executed. Since we do not have the start position available, we compute it by subtracting event length from end position (which is available). - if there are no events on the event queue at the slave sql starting time, that meet until condition, we stop immediately, as in this case we do not want to wait for next event. sql/slave.h: Added master_log_pos parametr to is_until_satisfied(). mysql-test/t/rpl_dual_pos_advance-slave.opt: New BitKeeper file ``mysql-test/t/rpl_dual_pos_advance-slave.opt'' --- mysql-test/r/rpl_dual_pos_advance.result | 43 +++++++++++++++++- mysql-test/t/rpl_dual_pos_advance-slave.opt | 1 + mysql-test/t/rpl_dual_pos_advance.test | 56 ++++++++++++++++-------- sql/log_event.cc | 3 +- sql/slave.cc | 68 +++++++++++++++++++---------- sql/slave.h | 2 +- 6 files changed, 128 insertions(+), 45 deletions(-) create mode 100644 mysql-test/t/rpl_dual_pos_advance-slave.opt diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/r/rpl_dual_pos_advance.result index 257baa81b74..97ca8101c33 100644 --- a/mysql-test/r/rpl_dual_pos_advance.result +++ b/mysql-test/r/rpl_dual_pos_advance.result @@ -8,15 +8,56 @@ reset master; change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root"; start slave; create table t1 (n int); +stop slave; +create table t2 (n int); +show tables; +Tables_in_test +t1 +t2 +create table t3 (n int) engine=innodb; +set @a=1; +insert into t3 values(@a); +begin; +insert into t3 values(2); +insert into t3 values(3); +commit; +insert into t3 values(4); +start slave until master_log_file="slave-bin.000001",master_log_pos=195; +Warnings: +Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart +select master_pos_wait("slave-bin.000001",137); +master_pos_wait("slave-bin.000001",137) +0 +show tables; +Tables_in_test +t1 +t2 +start slave until master_log_file="slave-bin.000001",master_log_pos=438; +Warnings: +Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart +select * from t3; +n +1 +start slave until master_log_file="slave-bin.000001",master_log_pos=663; +Warnings: +Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart +select * from t3; +n +1 +2 +3 +start slave; create table t4 (n int); create table t5 (n int); create table t6 (n int); show tables; Tables_in_test t1 +t2 +t3 t4 t5 t6 stop slave; reset slave; -drop table t1,t4,t5,t6; +drop table t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/t/rpl_dual_pos_advance-slave.opt b/mysql-test/t/rpl_dual_pos_advance-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_dual_pos_advance-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test index 518fa9df885..5e08284a2f2 100644 --- a/mysql-test/t/rpl_dual_pos_advance.test +++ b/mysql-test/t/rpl_dual_pos_advance.test @@ -7,6 +7,7 @@ # It also will test BUG#13861. source include/master-slave.inc; +source include/have_innodb.inc; # set up "dual head" @@ -30,45 +31,64 @@ save_master_pos; connection master; sync_with_master; -# Now test BUG#13861. This will be enabled when Guilhem fixes this -# bug. +# +# BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if +# log-slave-updates and circul repl +# +stop slave; -# stop slave +create table t2 (n int); # create one ignored event -# create table t2 (n int); # create one ignored event +save_master_pos; +connection slave; +sync_with_master; -# save_master_pos; -# connection slave; -# sync_with_master; +connection slave; -# connection slave; +show tables; -# show tables; +save_master_pos; -# save_master_pos; +create table t3 (n int) engine=innodb; +set @a=1; +insert into t3 values(@a); +begin; +insert into t3 values(2); +insert into t3 values(3); +commit; +insert into t3 values(4); -# create table t3 (n int); -# connection master; +connection master; # bug is that START SLAVE UNTIL may stop too late, we test that by # asking it to stop before creation of t3. -# start slave until master_log_file="slave-bin.000001",master_log_pos=195; +start slave until master_log_file="slave-bin.000001",master_log_pos=195; # wait until it's started (the position below is the start of "CREATE # TABLE t2") (otherwise wait_for_slave_to_stop may return at once) -# select master_pos_wait("slave-bin.000001",137); +select master_pos_wait("slave-bin.000001",137); -# wait_for_slave_to_stop; +wait_for_slave_to_stop; # then BUG#13861 causes t3 to show up below (because stopped too # late). -# show tables; +show tables; + +# ensure that we do not break set @a=1; insert into t3 values(@a); +start slave until master_log_file="slave-bin.000001",master_log_pos=438; +wait_for_slave_to_stop; +select * from t3; + +# ensure that we do not break transaction +start slave until master_log_file="slave-bin.000001",master_log_pos=663; +wait_for_slave_to_stop; +select * from t3; -# start slave; +start slave; # BUG#13023 is that Exec_master_log_pos may stay too low "forever": @@ -99,7 +119,7 @@ show tables; stop slave; reset slave; -drop table t1,t4,t5,t6; # add t2 and t3 later +drop table t1,t2,t3,t4,t5,t6; save_master_pos; connection slave; diff --git a/sql/log_event.cc b/sql/log_event.cc index a950094a018..8e14a873fc6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -373,6 +373,7 @@ Log_event::Log_event(const char* buf, #endif when = uint4korr(buf); server_id = uint4korr(buf + SERVER_ID_OFFSET); + data_written= uint4korr(buf + EVENT_LEN_OFFSET); if (description_event->binlog_version==1) { log_pos= 0; @@ -405,7 +406,7 @@ Log_event::Log_event(const char* buf, binlog, so which will cause problems if the user uses this value in CHANGE MASTER). */ - log_pos+= uint4korr(buf + EVENT_LEN_OFFSET); + log_pos+= data_written; } DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos)); diff --git a/sql/slave.cc b/sql/slave.cc index 8a3620080f2..500683e080d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3115,6 +3115,11 @@ int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int expected_error) Check if condition stated in UNTIL clause of START SLAVE is reached. SYNOPSYS st_relay_log_info::is_until_satisfied() + master_beg_pos position of the beginning of to be executed event + (not log_pos member of the event that points to the + beginning of the following event) + + DESCRIPTION Checks if UNTIL condition is reached. Uses caching result of last comparison of current log file name and target log file name. So cached @@ -3139,7 +3144,7 @@ int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int expected_error) false - condition not met */ -bool st_relay_log_info::is_until_satisfied() +bool st_relay_log_info::is_until_satisfied(my_off_t master_beg_pos) { const char *log_name; ulonglong log_pos; @@ -3149,7 +3154,7 @@ bool st_relay_log_info::is_until_satisfied() if (until_condition == UNTIL_MASTER_POS) { log_name= group_master_log_name; - log_pos= group_master_log_pos; + log_pos= master_beg_pos; } else { /* until_condition == UNTIL_RELAY_POS */ @@ -3228,28 +3233,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) wait for something for example inside of next_event(). */ pthread_mutex_lock(&rli->data_lock); - /* - This tests if the position of the end of the last previous executed event - hits the UNTIL barrier. - We would prefer to test if the position of the start (or possibly) end of - the to-be-read event hits the UNTIL barrier, this is different if there - was an event ignored by the I/O thread just before (BUG#13861 to be - fixed). - */ - if (rli->until_condition!=RELAY_LOG_INFO::UNTIL_NONE && - rli->is_until_satisfied()) - { - char buf[22]; - sql_print_information("Slave SQL thread stopped because it reached its" - " UNTIL position %s", llstr(rli->until_pos(), buf)); - /* - Setting abort_slave flag because we do not want additional message about - error in query execution to be printed. - */ - rli->abort_slave= 1; - pthread_mutex_unlock(&rli->data_lock); - return 1; - } Log_event * ev = next_event(rli); @@ -3266,6 +3249,27 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) int type_code = ev->get_type_code(); int exec_res; + /* + This tests if the position of the beginning of the current event + hits the UNTIL barrier. + */ + if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE && + rli->is_until_satisfied((thd->options & OPTION_BEGIN || !ev->log_pos) ? + rli->group_master_log_pos : + ev->log_pos - ev->data_written)) + { + char buf[22]; + sql_print_information("Slave SQL thread stopped because it reached its" + " UNTIL position %s", llstr(rli->until_pos(), buf)); + /* + Setting abort_slave flag because we do not want additional message about + error in query execution to be printed. + */ + rli->abort_slave= 1; + pthread_mutex_unlock(&rli->data_lock); + delete ev; + return 1; + } /* Queries originating from this server must be skipped. Low-level events (Format_desc, Rotate, Stop) from this server @@ -3977,6 +3981,22 @@ Slave SQL thread aborted. Can't execute init_slave query"); } } + /* + First check until condition - probably there is nothing to execute. We + do not want to wait for next event in this case. + */ + pthread_mutex_lock(&rli->data_lock); + if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE && + rli->is_until_satisfied(rli->group_master_log_pos)) + { + char buf[22]; + sql_print_information("Slave SQL thread stopped because it reached its" + " UNTIL position %s", llstr(rli->until_pos(), buf)); + pthread_mutex_unlock(&rli->data_lock); + goto err; + } + pthread_mutex_unlock(&rli->data_lock); + /* Read queries from the IO/THREAD until this thread is killed */ while (!sql_slave_killed(thd,rli)) diff --git a/sql/slave.h b/sql/slave.h index c61787cdf3b..da548e145d3 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -348,7 +348,7 @@ typedef struct st_relay_log_info void close_temporary_tables(); /* Check if UNTIL condition is satisfied. See slave.cc for more. */ - bool is_until_satisfied(); + bool is_until_satisfied(my_off_t master_beg_pos); inline ulonglong until_pos() { return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos : -- cgit v1.2.1 From c37fdbcdfdc065498cfc837ac6dcb6bc78fb206b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Feb 2008 19:13:18 +0100 Subject: Pre push fixes Test file fixes for bugs 20129, 31931 and 34225 mysql-test/suite/parts/r/partition_basic_symlink_innodb.result: Manual merge, new test case to be modified for Bug#20129 mysql-test/suite/parts/r/partition_basic_symlink_myisam.result: Manual merge, new test case to be modified for Bug#20129 mysql-test/suite/parts/r/partition_engine_innodb.result: Manual merge, fix for bug#31931 mysql-test/suite/parts/r/partition_engine_myisam.result: Manual merge, fix for bug#31931 mysql-test/suite/parts/t/disabled.def: These should work now since Bug#34225 is fixed sql/ha_partition.cc: Bug#20129: partition maintenance command not working with crashed tables Fix for compiler warnings. --- .../parts/r/partition_basic_symlink_innodb.result | 474 ++++++++++----------- .../parts/r/partition_basic_symlink_myisam.result | 376 ++++++++-------- .../suite/parts/r/partition_engine_innodb.result | 10 + .../suite/parts/r/partition_engine_myisam.result | 10 + mysql-test/suite/parts/t/disabled.def | 7 - sql/ha_partition.cc | 6 +- 6 files changed, 449 insertions(+), 434 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result index b9097e33ce0..03c6e1915bf 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result @@ -469,16 +469,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -914,16 +914,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1359,16 +1359,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -1802,16 +1802,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2247,16 +2247,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -2690,16 +2690,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3135,16 +3135,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -3580,16 +3580,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4026,16 +4026,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4471,16 +4471,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -4916,16 +4916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5359,16 +5359,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -5804,16 +5804,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6247,16 +6247,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -6692,16 +6692,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7137,16 +7137,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -7583,16 +7583,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8028,16 +8028,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8473,16 +8473,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -8916,16 +8916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9361,16 +9361,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -9804,16 +9804,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10249,16 +10249,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -10705,16 +10705,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11153,16 +11153,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -11609,16 +11609,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12061,16 +12061,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12511,16 +12511,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -12965,16 +12965,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13421,16 +13421,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -13873,16 +13873,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14355,16 +14355,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -14837,16 +14837,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15319,16 +15319,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -15799,16 +15799,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16281,16 +16281,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -16761,16 +16761,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17243,16 +17243,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -17725,16 +17725,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18208,16 +18208,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -18690,16 +18690,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19172,16 +19172,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -19652,16 +19652,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20134,16 +20134,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -20614,16 +20614,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21096,16 +21096,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -21578,16 +21578,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22077,16 +22077,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -22575,16 +22575,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23073,16 +23073,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -23569,16 +23569,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24067,16 +24067,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -24563,16 +24563,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25061,16 +25061,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -25559,16 +25559,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26056,16 +26056,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -26541,16 +26541,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27034,16 +27034,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -27523,16 +27523,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28010,16 +28010,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28501,16 +28501,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -28994,16 +28994,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29483,16 +29483,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -29969,16 +29969,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30454,16 +30454,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -30947,16 +30947,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31436,16 +31436,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -31923,16 +31923,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32414,16 +32414,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -32907,16 +32907,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33396,16 +33396,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -33898,16 +33898,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34399,16 +34399,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -34908,16 +34908,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35413,16 +35413,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -35916,16 +35916,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36423,16 +36423,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -36932,16 +36932,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 @@ -37437,16 +37437,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 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 7e0d5bcd62a..52c3b92912e 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -479,20 +479,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -934,20 +934,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -1395,20 +1395,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -1850,20 +1850,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2311,20 +2311,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -2770,20 +2770,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3231,20 +3231,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -3694,20 +3694,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -4148,16 +4148,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4167,7 +4167,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master- # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4631,16 +4631,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -4650,7 +4650,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD MYSQLTEST_VARDIR/master- # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5126,16 +5126,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5145,7 +5145,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD MYSQLTEST_VARDIR/mast # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5611,16 +5611,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -5630,7 +5630,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD MYSQLTEST_VARDIR/mast # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6106,16 +6106,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6125,7 +6125,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD MYSQLTEST # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -6599,16 +6599,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -6618,7 +6618,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD MYSQLTES # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7094,16 +7094,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7113,7 +7113,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD MYSQLTEST_VAR # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM)) */ File list 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 @@ -7593,16 +7593,16 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +test.t1 optimize note The storage engine for the table doesn't support optimize state new Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -7612,7 +7612,7 @@ File list MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD MYSQLTEST # check layout success: 0 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair note The storage engine for the table doesn't support repair state new Table definition 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 part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = MyISAM) */ File list 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 @@ -8061,20 +8061,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -8516,20 +8516,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -8977,20 +8977,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9432,20 +9432,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -9893,20 +9893,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10352,20 +10352,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -10813,20 +10813,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11273,20 +11273,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -11737,20 +11737,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12215,20 +12215,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -12685,20 +12685,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13157,20 +13157,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -13633,20 +13633,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14111,20 +14111,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -14587,20 +14587,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -15095,20 +15095,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -15603,20 +15603,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16117,20 +16117,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -16625,20 +16625,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17139,20 +17139,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -17651,20 +17651,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18165,20 +18165,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -18681,20 +18681,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19198,20 +19198,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -19715,20 +19715,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20246,20 +20246,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -20769,20 +20769,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21294,20 +21294,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -21823,20 +21823,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22354,20 +22354,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # check layout success: 1 TRUNCATE t1; @@ -22883,20 +22883,20 @@ AND f_int2 <> CAST(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 +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 status OK +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 status OK +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 status OK +test.t1 repair note The storage engine for the table doesn't support repair # 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 f9c4db296a3..fef4186d5b9 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -1416,6 +1416,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'InnoDB', PARTITION part2 ); +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, @@ -1427,6 +1428,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 , PARTITION part2 STORAGE ENGINE = 'InnoDB' ); +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, @@ -1443,6 +1445,9 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should fail with ER_MIX_HANDLER_ERROR +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1918,6 +1923,9 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1934,6 +1942,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'InnoDB' (SUBPARTITION subpart21, SUBPARTITION subpart22) ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) #------------------------------------------------------------------------ @@ -2862,6 +2871,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 66a4b4cc2a7..6c228b05113 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -1450,6 +1450,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'MyISAM', PARTITION part2 ); +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, @@ -1461,6 +1462,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 , PARTITION part2 STORAGE ENGINE = 'MyISAM' ); +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, @@ -1477,6 +1479,9 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should fail with ER_MIX_HANDLER_ERROR +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1966,6 +1971,9 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +# this should work +# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1982,6 +1990,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'MyISAM' (SUBPARTITION subpart21, SUBPARTITION subpart22) ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) #------------------------------------------------------------------------ @@ -2934,6 +2943,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index 0307975ff06..408a624e707 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -7,17 +7,10 @@ part_supported_sql_func_ndb : cannot create t1 partition_alter1_ndb : timeout. Needs too much time. partition_alter2_ndb : cannot create t1 partition_basic_ndb : cannot create t1 -partition_bit_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_bit_ndb : cannot create t1 -partition_char_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_datetime_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_decimal_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_engine_ndb : cannot create t1 -partition_float_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_int_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_int_ndb : cannot create t1 partition_sessions : needs system_3_init.inc -partition_special_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_syntax_ndb : cannot create t1 partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index d97af771a00..64bee07aa1c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1028,6 +1028,7 @@ 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) { @@ -1041,7 +1042,6 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, */ DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); -#ifdef WL4176_IS_DONE if (flag == OPTIMIZE_PARTS) error= file->ha_optimize(thd, check_opt); else if (flag == ANALYZE_PARTS) @@ -1058,8 +1058,8 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, if (error == HA_ADMIN_ALREADY_DONE) error= 0; DBUG_RETURN(error); -#endif } +#endif /* @@ -1080,11 +1080,13 @@ 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)); -- cgit v1.2.1 From db9b2bdc1b229e492d0e60761d7f62db1ee0f652 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Feb 2008 21:18:50 +0100 Subject: Post push fix Fixed a missed case in the patch for Bug#31931. Also makes Bug#33722 a duplicate of Bug#31931. Added tests for better coverage. Replaced some legacy function calls. mysql-test/r/partition.result: Added tests for better coverage mysql-test/r/partition_datatype.result: Added tests for better coverage mysql-test/r/partition_error.result: Added tests for better coverage mysql-test/suite/parts/inc/partition_engine.inc: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#31931: Mix of handlers error message Bug#33722 is fixed within this patch too mysql-test/t/partition.test: Added tests for better coverage mysql-test/t/partition_datatype.test: Added tests for better coverage mysql-test/t/partition_error.test: Added tests for Bug#31931 sql/partition_info.cc: Bug#31931: Mix of handlers error message Fixed case where given info->db_type not matched thd->lex->create_info.db_type And the check for inconsistent subpartition engines-clauses. sql/sql_partition.cc: Changed ha_legacy_type to ha_resolve_storage_engine_name sql/sql_table.cc: Changed ha_legacy_type to ha_resolve_storage_engine_name --- mysql-test/r/partition.result | 14 + mysql-test/r/partition_datatype.result | 8 + mysql-test/r/partition_error.result | 13 + mysql-test/suite/parts/inc/partition_engine.inc | 78 +- .../suite/parts/r/partition_engine_innodb.result | 1440 ++++++++++++++++++- .../suite/parts/r/partition_engine_myisam.result | 1490 +++++++++++++++++++- mysql-test/t/partition.test | 14 +- mysql-test/t/partition_datatype.test | 3 + mysql-test/t/partition_error.test | 18 + sql/partition_info.cc | 99 +- sql/sql_partition.cc | 10 +- sql/sql_table.cc | 7 +- 12 files changed, 3034 insertions(+), 160 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 1cbe0d577b1..b13010f8471 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1052,6 +1052,12 @@ test.t1 repair note The storage engine for the table doesn't support repair OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note The storage engine for the table doesn't support optimize +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check note The storage engine for the table doesn't support check +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze note The storage engine for the table doesn't support analyze drop table t1; drop procedure if exists mysqltest_1; create table t1 (a int) @@ -1290,6 +1296,14 @@ ALTER TABLE t1 OPTIMIZE 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 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 +ALTER TABLE t1 CHECK PARTITION p1; +ERROR 42000: The storage engine for the table doesn't support check partition +ALTER TABLE t1 REPAIR PARTITION p1; +ERROR 42000: The storage engine for the table doesn't support repair partition +ALTER TABLE t1 OPTIMIZE PARTITION p1; +ERROR 42000: The storage engine for the table doesn't support optimize partition DROP TABLE t1; CREATE TABLE t1 (s1 BIGINT UNSIGNED) PARTITION BY RANGE (s1) ( diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result index 43c65f23e61..43d9aac13b7 100644 --- a/mysql-test/r/partition_datatype.result +++ b/mysql-test/r/partition_datatype.result @@ -135,9 +135,17 @@ drop table t1; # test with null allowed create table t1 (a bit) partition by key (a); insert into t1 values (b'1'); +insert into t1 values (NULL); select hex(a) from t1 where a = b'1'; hex(a) 1 +select hex(a) from t1 where a is NULL; +hex(a) +NULL +select hex(a) from t1 order by a; +hex(a) +NULL +1 drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 46532cb32ab..585447ff333 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,4 +1,17 @@ drop table if exists t1; +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, +PARTITION p1); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), +PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( a int ) diff --git a/mysql-test/suite/parts/inc/partition_engine.inc b/mysql-test/suite/parts/inc/partition_engine.inc index d2f3277cf6d..b2fab2ff27e 100644 --- a/mysql-test/suite/parts/inc/partition_engine.inc +++ b/mysql-test/suite/parts/inc/partition_engine.inc @@ -112,11 +112,23 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); ---echo # this should fail with ER_MIX_HANDLER_ERROR ---echo # after fixing Bug#33722 +--error ER_MIX_HANDLER_ERROR +eval CREATE TABLE t1 ( +$column_list +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN ($max_row_div2) + (SUBPARTITION subpart11 STORAGE ENGINE = $engine, + SUBPARTITION subpart12 STORAGE ENGINE = $engine), + PARTITION part2 VALUES LESS THAN $MAX_VALUE + (SUBPARTITION subpart21, + SUBPARTITION subpart22 ) +); eval CREATE TABLE t1 ( $column_list ) +ENGINE = $engine PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN ($max_row_div2) @@ -135,14 +147,38 @@ DROP TABLE t1; --echo # 4 Storage engine assignment after partition name + after name of --echo # subpartitions belonging to another partition --echo #------------------------------------------------------------------------ ---echo # this should work ---echo # after fixing Bug#33722 --error ER_MIX_HANDLER_ERROR eval CREATE TABLE t1 ( $column_list ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN ($max_row_div2) + (SUBPARTITION subpart11, + SUBPARTITION subpart12), + PARTITION part2 VALUES LESS THAN $MAX_VALUE + (SUBPARTITION subpart21 STORAGE ENGINE = $engine, + SUBPARTITION subpart22 STORAGE ENGINE = $engine) +); +eval CREATE TABLE t1 ( +$column_list +) +ENGINE = $engine +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN ($max_row_div2) ENGINE = $engine + (SUBPARTITION subpart11, + SUBPARTITION subpart12), + PARTITION part2 VALUES LESS THAN $MAX_VALUE + (SUBPARTITION subpart21, + SUBPARTITION subpart22 STORAGE ENGINE = $engine) +); +DROP TABLE t1; +eval CREATE TABLE t1 ( +$column_list +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN ($max_row_div2) ENGINE = $engine (SUBPARTITION subpart11, SUBPARTITION subpart12), @@ -150,13 +186,10 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); -#INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -#SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -#--source suite/parts/inc/partition_check.inc -#DROP TABLE t1; ---echo # this should work ---echo # after fixing Bug#33722 ---error ER_MIX_HANDLER_ERROR +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; +--source suite/parts/inc/partition_check.inc +DROP TABLE t1; eval CREATE TABLE t1 ( $column_list ) @@ -166,13 +199,13 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart11 STORAGE ENGINE = $engine, SUBPARTITION subpart12 STORAGE ENGINE = $engine), PARTITION part2 VALUES LESS THAN $MAX_VALUE ENGINE = $engine - (SUBPARTITION subpart21, + (SUBPARTITION subpart21 ENGINE = $engine, 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; -#--source suite/parts/inc/partition_check.inc -#DROP TABLE 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; +--source suite/parts/inc/partition_check.inc +DROP TABLE t1; # --echo #------------------------------------------------------------------------ --echo # 5 Precedence of storage engine assignments (if there is any) @@ -208,10 +241,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; DROP TABLE t1; --echo # 6.2 Storage engine assignment after partition name + after --echo # subpartition name -# in partition part + in sub partition part ---echo # this should work ---echo # after fixing Bug#33722 ---error ER_MIX_HANDLER_ERROR +--echo # in partition part + in sub partition part eval CREATE TABLE t1 ( $column_list ) @@ -224,10 +254,10 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart21 STORAGE ENGINE = $engine, SUBPARTITION subpart22 STORAGE ENGINE = $engine) ); -#INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -#SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -#--source suite/parts/inc/partition_check.inc -#DROP TABLE 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; +--source suite/parts/inc/partition_check.inc +DROP TABLE t1; --echo #------------------------------------------------------------------------ --echo # 6 Session default engine differs from engine used within create table diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index fef4186d5b9..4aad4c3c36a 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -1446,8 +1446,6 @@ PARTITION part2 VALUES LESS THAN (2147483646) SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -# this should fail with ER_MIX_HANDLER_ERROR -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1464,6 +1462,24 @@ 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 = 'InnoDB' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +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 (inc/partition_check.inc) @@ -1905,8 +1921,6 @@ DROP TABLE t1; # 4 Storage engine assignment after partition name + after name of # subpartitions belonging to another partition #------------------------------------------------------------------------ -# this should work -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1916,7 +1930,7 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'InnoDB' +( PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11, SUBPARTITION subpart12), PARTITION part2 VALUES LESS THAN (2147483646) @@ -1924,8 +1938,6 @@ PARTITION part2 VALUES LESS THAN (2147483646) SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -# this should work -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1933,31 +1945,32 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +ENGINE = 'InnoDB' PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'InnoDB' +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'InnoDB' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21, -SUBPARTITION subpart22) +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -#------------------------------------------------------------------------ -# 5 Precedence of storage engine assignments (if there is any) -#------------------------------------------------------------------------ -# 5.1 Storage engine assignment after column list + after partition -# or subpartition name +DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) -) ENGINE = 'InnoDB' -PARTITION BY HASH(f_int1) -( PARTITION part1 STORAGE ENGINE = 'InnoDB', -PARTITION part2 STORAGE ENGINE = 'InnoDB' +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'InnoDB' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; @@ -1971,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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2039,9 +2052,7 @@ 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##'; +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), @@ -2410,9 +2421,9 @@ SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'InnoDB' +(SUBPARTITION subpart21 ENGINE = 'InnoDB', +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; @@ -2851,27 +2862,1370 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 6.2 Storage engine assignment after partition name + after -# subpartition name -# this should work -# after fixing Bug#33722 +#------------------------------------------------------------------------ +# 5 Precedence of storage engine assignments (if there is any) +#------------------------------------------------------------------------ +# 5.1 Storage engine assignment after column list + after partition +# or subpartition name 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) STORAGE ENGINE = 'InnoDB' -(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', -SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +) ENGINE = 'InnoDB' +PARTITION BY HASH(f_int1) +( PARTITION part1 STORAGE ENGINE = 'InnoDB', +PARTITION part2 STORAGE ENGINE = 'InnoDB' ); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +INSERT INTO t1(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 (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 part1 ENGINE = InnoDB, PARTITION part2 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 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 (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 HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +); +INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 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 (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, +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) STORAGE ENGINE = 'InnoDB' +(SUBPARTITION subpart11 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart12 STORAGE ENGINE = 'InnoDB'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'InnoDB', +SUBPARTITION subpart22 STORAGE ENGINE = 'InnoDB') +); +INSERT INTO t1(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 (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 HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 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 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 (inc/partition_check.inc) +DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 6c228b05113..2dfea58995e 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -1480,8 +1480,6 @@ PARTITION part2 VALUES LESS THAN (2147483646) SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -# this should fail with ER_MIX_HANDLER_ERROR -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1498,6 +1496,24 @@ 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 = 'MyISAM' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +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 (inc/partition_check.inc) @@ -1953,8 +1969,6 @@ DROP TABLE t1; # 4 Storage engine assignment after partition name + after name of # subpartitions belonging to another partition #------------------------------------------------------------------------ -# this should work -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1964,7 +1978,7 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'MyISAM' +( PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11, SUBPARTITION subpart12), PARTITION part2 VALUES LESS THAN (2147483646) @@ -1972,8 +1986,6 @@ PARTITION part2 VALUES LESS THAN (2147483646) SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -# this should work -# after fixing Bug#33722 CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1981,31 +1993,32 @@ f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) ) +ENGINE = 'MyISAM' PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) -( PARTITION part1 VALUES LESS THAN (10) -(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'MyISAM' +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'MyISAM' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21, -SUBPARTITION subpart22) +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL -#------------------------------------------------------------------------ -# 5 Precedence of storage engine assignments (if there is any) -#------------------------------------------------------------------------ -# 5.1 Storage engine assignment after column list + after partition -# or subpartition name +DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(20), f_char2 CHAR(20), f_charbig VARCHAR(1000) -) ENGINE = 'MyISAM' -PARTITION BY HASH(f_int1) -( PARTITION part1 STORAGE ENGINE = 'MyISAM', -PARTITION part2 STORAGE ENGINE = 'MyISAM' +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'MyISAM' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; @@ -2019,13 +2032,17 @@ t1 CREATE TABLE `t1` ( `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 part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ +) 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.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#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 @@ -2095,9 +2112,7 @@ 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##'; +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), @@ -2468,9 +2483,9 @@ SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'MyISAM' +(SUBPARTITION subpart21 ENGINE = 'MyISAM', +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; @@ -2923,27 +2938,1408 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 6.2 Storage engine assignment after partition name + after -# subpartition name -# this should work -# after fixing Bug#33722 +#------------------------------------------------------------------------ +# 5 Precedence of storage engine assignments (if there is any) +#------------------------------------------------------------------------ +# 5.1 Storage engine assignment after column list + after partition +# or subpartition name 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) STORAGE ENGINE = 'MyISAM' -(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), -PARTITION part2 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', -SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +) ENGINE = 'MyISAM' +PARTITION BY HASH(f_int1) +( PARTITION part1 STORAGE ENGINE = 'MyISAM', +PARTITION part2 STORAGE ENGINE = 'MyISAM' ); -ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +INSERT INTO t1(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 (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 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 + +# 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 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 (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 HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +); +INSERT INTO t1(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 (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 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 + +# 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 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 (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, +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) STORAGE ENGINE = 'MyISAM' +(SUBPARTITION subpart11 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart12 STORAGE ENGINE = 'MyISAM'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'MyISAM', +SUBPARTITION subpart22 STORAGE ENGINE = 'MyISAM') +); +INSERT INTO t1(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 (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 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 + +# 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 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 (inc/partition_check.inc) +DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table #------------------------------------------------------------------------ diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 5adf21d53e8..c4e447988db 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1215,13 +1215,15 @@ DROP TABLE t1; # # Bug 17455 Partitions: Wrong message and error when using Repair/Optimize # table on partitioned table -# +# (added check/analyze for gcov of Bug#20129) create table t1 (a int) engine=MEMORY partition by key (a); REPAIR TABLE t1; OPTIMIZE TABLE t1; +CHECK TABLE t1; +ANALYZE TABLE t1; drop table t1; @@ -1524,7 +1526,7 @@ select c1 from t1 group by (select c0 from t1 limit 1); drop table t1; # Bug #30495: optimize table t1,t2,t3 extended errors -# +# (added more maintenace commands for Bug#20129 CREATE TABLE t1(a int) PARTITION BY RANGE (a) ( PARTITION p1 VALUES LESS THAN (10), @@ -1534,6 +1536,14 @@ 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/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test index c21fb40f735..7440a9bf3a3 100644 --- a/mysql-test/t/partition_datatype.test +++ b/mysql-test/t/partition_datatype.test @@ -103,7 +103,10 @@ drop table t1; -- echo # test with null allowed create table t1 (a bit) partition by key (a); insert into t1 values (b'1'); +insert into t1 values (NULL); select hex(a) from t1 where a = b'1'; +select hex(a) from t1 where a is NULL; +select hex(a) from t1 order by a; drop table t1; create table t1 (a tinyint) partition by key (a); insert into t1 values (2); diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index c9b95fc1664..d470fb67b49 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -8,6 +8,24 @@ drop table if exists t1; --enable_warnings +# +# Bug#31931: Mix of handlers error message +# +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY HASH (a) +( PARTITION p0 ENGINE=MyISAM, + PARTITION p1); +--error ER_MIX_HANDLER_ERROR +CREATE TABLE t1 (a INT) +PARTITION BY LIST (a) +SUBPARTITION BY HASH (a) +( PARTITION p0 VALUES IN (0) +( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2), + PARTITION p1 VALUES IN (1) +( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM)); + + # # Bug 29368: # Incorrect error, 1467, for syntax error when creating partition diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 6816fce7818..1d21a10beaa 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -464,15 +464,15 @@ static bool check_engine_condition(partition_element *p_elem, { DBUG_ENTER("check_engine_condition"); - DBUG_PRINT("enter", ("p_eng %u t_eng %u t_eng_set %u first %u state %u", - ha_legacy_type(p_elem->engine_type), - ha_legacy_type(*engine_type), + DBUG_PRINT("enter", ("p_eng %s t_eng %s t_eng_set %u first %u state %u", + ha_resolve_storage_engine_name(p_elem->engine_type), + ha_resolve_storage_engine_name(*engine_type), table_engine_set, *first, p_elem->part_state)); if (*first && !table_engine_set) { *engine_type= p_elem->engine_type; - DBUG_PRINT("info", ("setting table_engine = %u", - ha_legacy_type(*engine_type))); + DBUG_PRINT("info", ("setting table_engine = %s", + ha_resolve_storage_engine_name(*engine_type))); } *first= FALSE; if ((table_engine_set && @@ -522,8 +522,8 @@ bool partition_info::check_engine_mix(handlerton *engine_type, bool first= TRUE; uint no_parts= partitions.elements; DBUG_ENTER("partition_info::check_engine_mix"); - DBUG_PRINT("info", ("in: engine_type = %u, table_engine_set = %u", - ha_legacy_type(engine_type), + DBUG_PRINT("info", ("in: engine_type = %s, table_engine_set = %u", + ha_resolve_storage_engine_name(engine_type), table_engine_set)); if (no_parts) { @@ -532,8 +532,8 @@ bool partition_info::check_engine_mix(handlerton *engine_type, do { partition_element *part_elem= part_it++; - DBUG_PRINT("info", ("part = %d engine = %d table_engine_set %u", - i, ha_legacy_type(part_elem->engine_type), + DBUG_PRINT("info", ("part = %d engine = %s table_engine_set %u", + i, ha_resolve_storage_engine_name(part_elem->engine_type), table_engine_set)); if (is_sub_partitioned() && part_elem->subpartitions.elements) @@ -544,8 +544,8 @@ bool partition_info::check_engine_mix(handlerton *engine_type, do { partition_element *sub_elem= sub_it++; - DBUG_PRINT("info", ("sub = %d engine = %u table_engie_set %u", - j, ha_legacy_type(sub_elem->engine_type), + DBUG_PRINT("info", ("sub = %d engine = %s table_engie_set %u", + j, ha_resolve_storage_engine_name(sub_elem->engine_type), table_engine_set)); if (check_engine_condition(sub_elem, table_engine_set, &engine_type, &first)) @@ -561,8 +561,8 @@ bool partition_info::check_engine_mix(handlerton *engine_type, goto error; } while (++i < no_parts); } - DBUG_PRINT("info", ("engine_type = %u", - ha_legacy_type(engine_type))); + DBUG_PRINT("info", ("engine_type = %s", + ha_resolve_storage_engine_name(engine_type))); if (!engine_type) engine_type= old_engine_type; if (engine_type->flags & HTON_NO_PARTITION) @@ -570,8 +570,8 @@ bool partition_info::check_engine_mix(handlerton *engine_type, my_error(ER_PARTITION_MERGE_ERROR, MYF(0)); DBUG_RETURN(TRUE); } - DBUG_PRINT("info", ("out: engine_type = %u", - ha_legacy_type(engine_type))); + DBUG_PRINT("info", ("out: engine_type = %s", + ha_resolve_storage_engine_name(engine_type))); DBUG_ASSERT(engine_type != partition_hton); DBUG_RETURN(FALSE); error: @@ -859,6 +859,8 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, DBUG_ENTER("partition_info::check_partition_info"); DBUG_ASSERT(default_engine_type != partition_hton); + DBUG_PRINT("info", ("default table_engine = %s", + ha_resolve_storage_engine_name(table_engine))); if (check_partition_function) { int err= 0; @@ -913,10 +915,16 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, the table and all partitions/subpartitions are set. So when ALTER it is already set on table level */ - if (thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE) + if (info && info->used_fields & HA_CREATE_USED_ENGINE) { table_engine_set= TRUE; - table_engine= thd->lex->create_info.db_type; + table_engine= info->db_type; + /* if partition_hton, use thd->lex->create_info */ + if (table_engine == partition_hton) + table_engine= thd->lex->create_info.db_type; + DBUG_ASSERT(table_engine != partition_hton); + DBUG_PRINT("info", ("Using table_engine = %s", + ha_resolve_storage_engine_name(table_engine))); } else { @@ -924,6 +932,8 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, if (thd->lex->sql_command != SQLCOM_CREATE_TABLE) { table_engine_set= TRUE; + DBUG_PRINT("info", ("No create, table_engine = %s", + ha_resolve_storage_engine_name(table_engine))); DBUG_ASSERT(table_engine && table_engine != partition_hton); } } @@ -941,11 +951,6 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, do { partition_element *part_elem= part_it++; - if (part_elem->engine_type == NULL) - { - no_parts_not_set++; - part_elem->engine_type= default_engine_type; - } #ifdef HAVE_READLINK if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)) #endif @@ -960,23 +965,29 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } if (!is_sub_partitioned()) { + if (part_elem->engine_type == NULL) + { + no_parts_not_set++; + part_elem->engine_type= default_engine_type; + } if (check_table_name(part_elem->partition_name, strlen(part_elem->partition_name))) { my_error(ER_WRONG_PARTITION_NAME, MYF(0)); goto end; } - DBUG_PRINT("info", ("part = %d engine = %d", - i, ha_legacy_type(part_elem->engine_type))); + DBUG_PRINT("info", ("part = %d engine = %s", + i, ha_resolve_storage_engine_name(part_elem->engine_type))); } else { uint j= 0; uint no_subparts_not_set= 0; List_iterator sub_it(part_elem->subpartitions); + partition_element *sub_elem; do { - partition_element *sub_elem= sub_it++; + sub_elem= sub_it++; if (check_table_name(sub_elem->partition_name, strlen(sub_elem->partition_name))) { @@ -985,24 +996,41 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } if (sub_elem->engine_type == NULL) { - sub_elem->engine_type= default_engine_type; - no_subparts_not_set++; + if (part_elem->engine_type != NULL) + sub_elem->engine_type= part_elem->engine_type; + else + { + sub_elem->engine_type= default_engine_type; + no_subparts_not_set++; + } } - DBUG_PRINT("info", ("part = %d sub = %d engine = %u", - i, j, ha_legacy_type(sub_elem->engine_type))); + DBUG_PRINT("info", ("part = %d sub = %d engine = %s", i, j, + ha_resolve_storage_engine_name(sub_elem->engine_type))); } while (++j < no_subparts); - if (prev_no_subparts_not_set == (no_subparts + 1)) + + if (prev_no_subparts_not_set == (no_subparts + 1) && + (no_subparts_not_set == 0 || no_subparts_not_set == no_subparts)) prev_no_subparts_not_set= no_subparts_not_set; + if (!table_engine_set && - prev_no_subparts_not_set == no_subparts_not_set && - no_subparts_not_set != 0 && - no_subparts_not_set != no_subparts) + prev_no_subparts_not_set != no_subparts_not_set) { DBUG_PRINT("info", ("no_subparts_not_set = %u no_subparts = %u", no_subparts_not_set, no_subparts)); my_error(ER_MIX_HANDLER_ERROR, MYF(0)); goto end; } + + if (part_elem->engine_type == NULL) + { + if (no_subparts_not_set == 0) + part_elem->engine_type= sub_elem->engine_type; + else + { + no_parts_not_set++; + part_elem->engine_type= default_engine_type; + } + } } } while (++i < no_parts); if (!table_engine_set && @@ -1021,9 +1049,8 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, goto end; } - if (table_engine == partition_hton) - DBUG_PRINT("info", ("Table engine set to partition_hton")); - DBUG_ASSERT(default_engine_type == table_engine); + DBUG_ASSERT(table_engine != partition_hton && + default_engine_type == table_engine); if (eng_type) *eng_type= table_engine; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a072b7fa8e4..7eab04b073a 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3819,9 +3819,9 @@ bool mysql_unpack_partition(THD *thd, DBUG_PRINT("info", ("Successful parse")); part_info= lex.part_info; - DBUG_PRINT("info", ("default engine = %d, default_db_type = %d", - ha_legacy_type(part_info->default_engine_type), - ha_legacy_type(default_db_type))); + DBUG_PRINT("info", ("default engine = %s, default_db_type = %s", + ha_resolve_storage_engine_name(part_info->default_engine_type), + ha_resolve_storage_engine_name(default_db_type))); if (is_create_table_ind && old_lex->sql_command == SQLCOM_CREATE_TABLE) { if (old_lex->create_info.options & HA_LEX_CREATE_TABLE_LIKE) @@ -4041,8 +4041,8 @@ static bool check_native_partitioned(HA_CREATE_INFO *create_info,bool *ret_val, DBUG_ASSERT(engine_type && engine_type != partition_hton); } } - DBUG_PRINT("info", ("engine_type = %u, table_engine_set = %u", - ha_legacy_type(engine_type), + DBUG_PRINT("info", ("engine_type = %s, table_engine_set = %u", + ha_resolve_storage_engine_name(engine_type), table_engine_set)); if (part_info->check_engine_mix(engine_type, table_engine_set)) goto error; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 553ce9b3f1a..3114bbc77b3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3295,8 +3295,9 @@ bool mysql_create_table_no_lock(THD *thd, } } } - DBUG_PRINT("info", ("db_type = %d", - ha_legacy_type(part_info->default_engine_type))); + DBUG_PRINT("info", ("db_type = %s create_info->db_type = %s", + ha_resolve_storage_engine_name(part_info->default_engine_type), + ha_resolve_storage_engine_name(create_info->db_type))); if (part_info->check_partition_info(thd, &engine_type, file, create_info, TRUE)) goto err; @@ -3321,7 +3322,7 @@ bool mysql_create_table_no_lock(THD *thd, Assign the partition handler as the handler of the table. */ DBUG_PRINT("info", ("db_type: %d", - ha_legacy_type(create_info->db_type))); + ha_resolve_storage_engine_name(create_info->db_type))); delete file; create_info->db_type= partition_hton; if (!(file= get_ha_partition(part_info))) -- cgit v1.2.1 From 2583c281b67ae8cf470266c7438a5852a1bd2265 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Feb 2008 07:58:46 +0100 Subject: Removed compiler warning (Missed a change of printf format) sql/sql_table.cc: wrong printf type --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3114bbc77b3..5600abfdc87 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3321,7 +3321,7 @@ bool mysql_create_table_no_lock(THD *thd, The handler assigned to the table cannot handle partitioning. Assign the partition handler as the handler of the table. */ - DBUG_PRINT("info", ("db_type: %d", + DBUG_PRINT("info", ("db_type: %s", ha_resolve_storage_engine_name(create_info->db_type))); delete file; create_info->db_type= partition_hton; -- cgit v1.2.1 From 83bcd5dfab83948353b2f30bfe497f0a92d31977 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Feb 2008 21:46:06 +0400 Subject: BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if log-slave-updates and circul repl After merge fixes. mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt: Rename: mysql-test/t/rpl_dual_pos_advance-slave.opt -> mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt mysql-test/include/wait_for_slave_sql_to_stop.inc: Do not change connection if it was requested by caller (needed for circular replication tests). mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Let include/wait_for_slave_sql_to_stop.inc know that we do not want to change connection to slave. sql/rpl_rli.cc: After merge fix. sql/rpl_rli.h: After merge fix. sql/slave.cc: After merge fix. --- mysql-test/include/wait_for_slave_sql_to_stop.inc | 5 ++++- mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt | 1 + mysql-test/suite/rpl/t/rpl_dual_pos_advance.test | 9 +++++---- mysql-test/t/rpl_dual_pos_advance-slave.opt | 1 - sql/rpl_rli.cc | 9 +++++++-- sql/rpl_rli.h | 2 +- sql/slave.cc | 4 ++-- 7 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt delete mode 100644 mysql-test/t/rpl_dual_pos_advance-slave.opt diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc index 7f435142901..cb5c437a586 100644 --- a/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -9,7 +9,10 @@ # sql threads to stop # 3) If loops too long die. #################################################### -connection slave; +if (!$keep_connection) +{ + connection slave; +} let $row_number= 1; let $run= 1; let $counter= 300; diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test index 26e477786e1..d51b175ca00 100644 --- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test +++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test @@ -12,6 +12,7 @@ source include/have_innodb.inc; # set up "dual head" +let $keep_connection= 1; connection slave; reset master; @@ -67,11 +68,11 @@ connection master; start slave until master_log_file="slave-bin.000001",master_log_pos=195; # wait until it's started (the position below is the start of "CREATE -# TABLE t2") (otherwise wait_for_slave_to_stop may return at once) +# TABLE t2") (otherwise wait_for_slave_sql_to_stop may return at once) select master_pos_wait("slave-bin.000001",137); ---source include/wait_for_slave_to_stop.inc +--source include/wait_for_slave_sql_to_stop.inc # then BUG#13861 causes t3 to show up below (because stopped too # late). @@ -80,12 +81,12 @@ show tables; # ensure that we do not break set @a=1; insert into t3 values(@a); start slave until master_log_file="slave-bin.000001",master_log_pos=438; ---source include/wait_for_slave_to_stop.inc +--source include/wait_for_slave_sql_to_stop.inc select * from t3; # ensure that we do not break transaction start slave until master_log_file="slave-bin.000001",master_log_pos=663; ---source include/wait_for_slave_to_stop.inc +--source include/wait_for_slave_sql_to_stop.inc select * from t3; start slave; diff --git a/mysql-test/t/rpl_dual_pos_advance-slave.opt b/mysql-test/t/rpl_dual_pos_advance-slave.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/t/rpl_dual_pos_advance-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 03f790b934f..96e6b194916 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -955,6 +955,11 @@ err: Check if condition stated in UNTIL clause of START SLAVE is reached. SYNOPSYS Relay_log_info::is_until_satisfied() + master_beg_pos position of the beginning of to be executed event + (not log_pos member of the event that points to the + beginning of the following event) + + DESCRIPTION Checks if UNTIL condition is reached. Uses caching result of last comparison of current log file name and target log file name. So cached @@ -979,7 +984,7 @@ err: false - condition not met */ -bool Relay_log_info::is_until_satisfied() +bool Relay_log_info::is_until_satisfied(my_off_t master_beg_pos) { const char *log_name; ulonglong log_pos; @@ -990,7 +995,7 @@ bool Relay_log_info::is_until_satisfied() if (until_condition == UNTIL_MASTER_POS) { log_name= group_master_log_name; - log_pos= group_master_log_pos; + log_pos= master_beg_pos; } else { /* until_condition == UNTIL_RELAY_POS */ diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 36daffae1af..e13ea93842c 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -296,7 +296,7 @@ public: void close_temporary_tables(); /* Check if UNTIL condition is satisfied. See slave.cc for more. */ - bool is_until_satisfied(); + bool is_until_satisfied(my_off_t master_beg_pos); inline ulonglong until_pos() { return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos : diff --git a/sql/slave.cc b/sql/slave.cc index 8bd28c903ae..b8d1fdfbb6b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1990,7 +1990,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) This tests if the position of the beginning of the current event hits the UNTIL barrier. */ - if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE && + if (rli->until_condition != Relay_log_info::UNTIL_NONE && rli->is_until_satisfied((rli->is_in_group() || !ev->log_pos) ? rli->group_master_log_pos : ev->log_pos - ev->data_written)) @@ -2648,7 +2648,7 @@ Slave SQL thread aborted. Can't execute init_slave query"); do not want to wait for next event in this case. */ pthread_mutex_lock(&rli->data_lock); - if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE && + if (rli->until_condition != Relay_log_info::UNTIL_NONE && rli->is_until_satisfied(rli->group_master_log_pos)) { char buf[22]; -- cgit v1.2.1 From 1ed34fed3390e10ff67981c4470f46c6ce1e2a6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 17:56:50 +0400 Subject: Bug#23924 general_log truncates queries with character set introducers. Problem: logging of utf8-incompatible binary strings didn't work Fix: hex-encoding of incompatible sequences. mysql-test/r/log_tables.result: Adding test mysql-test/t/log_tables.test: Adding test sql/field.cc: Copying with hex escaping sql/field.h: New field flag sql/log.cc: Marking the column "general_log.argument" as hex-escaping field. sql/sql_string.cc: New function to copy strings with hex-encoding of incompatible characters. sql/sql_string.h: Prototype for the new function --- mysql-test/r/log_tables.result | 11 ++++++++ mysql-test/t/log_tables.test | 10 +++++++ sql/field.cc | 11 ++++++++ sql/field.h | 2 ++ sql/log.cc | 1 + sql/sql_string.cc | 62 ++++++++++++++++++++++++++++++++++++++++++ sql/sql_string.h | 3 ++ 7 files changed, 100 insertions(+) diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 0a7634df85a..2a4cee9fbbc 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -107,6 +107,17 @@ Database Table In_use Name_locked SET GLOBAL GENERAL_LOG=ON; SET GLOBAL SLOW_QUERY_LOG=ON; truncate table mysql.general_log; +set names binary; +select _koi8r'ΤΕΣΤ' as test; +test +ΤΕΣΤ +select * from mysql.general_log; +event_time user_host thread_id server_id command_type argument +TIMESTAMP USER_HOST THREAD_ID 1 Query set names binary +TIMESTAMP USER_HOST THREAD_ID 1 Query select _koi8r'\xD4\xC5\xD3\xD4' as test +TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log +set names utf8; +truncate table mysql.general_log; set names utf8; create table bug16905 (s char(15) character set utf8 default 'пусто'); insert into bug16905 values ('Π½ΠΎΠ²ΠΎΠ΅'); diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 0c986c6d63a..3047d16d3b6 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -130,6 +130,16 @@ show open tables; SET GLOBAL GENERAL_LOG=ON; SET GLOBAL SLOW_QUERY_LOG=ON; +# +# Bug#23924 general_log truncates queries with character set introducers. +# +truncate table mysql.general_log; +set names binary; +select _koi8r'ΤΕΣΤ' as test; +--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID +select * from mysql.general_log; +set names utf8; + # # Bug #16905 Log tables: unicode statements are logged incorrectly # diff --git a/sql/field.cc b/sql/field.cc index 88fac96df89..fb14b4d5c77 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7644,6 +7644,17 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) if (value.alloc(new_length)) goto oom_error; + + if (f_is_hex_escape(flags)) + { + copy_length= my_copy_with_hex_escaping(field_charset, + (char*) value.ptr(), new_length, + from, length); + Field_blob::store_length(copy_length); + tmp= value.ptr(); + bmove(ptr + packlength, (uchar*) &tmp, sizeof(char*)); + return 0; + } /* "length" is OK as "nchars" argument to well_formed_copy_nchars as this is never used to limit the length of the data. The cut of long data diff --git a/sql/field.h b/sql/field.h index 38a0b1d5bbd..2e8a27e579a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -2069,6 +2069,7 @@ int set_field_to_null_with_conversions(Field *field, bool no_conversions); #define FIELDFLAG_NO_DEFAULT 16384 /* sql */ #define FIELDFLAG_SUM ((uint) 32768)// predit: +#fieldflag #define FIELDFLAG_MAYBE_NULL ((uint) 32768)// sql +#define FIELDFLAG_HEX_ESCAPE ((uint) 0x10000) #define FIELDFLAG_PACK_SHIFT 3 #define FIELDFLAG_DEC_SHIFT 8 #define FIELDFLAG_MAX_DEC 31 @@ -2094,3 +2095,4 @@ int set_field_to_null_with_conversions(Field *field, bool no_conversions); #define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL) #define f_no_default(x) (x & FIELDFLAG_NO_DEFAULT) #define f_bit_as_char(x) ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR) +#define f_is_hex_escape(x) ((x) & FIELDFLAG_HEX_ESCAPE) diff --git a/sql/log.cc b/sql/log.cc index 9b5b2ae5a6c..328aaa45f3f 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -418,6 +418,7 @@ bool Log_to_csv_event_handler:: A positive return value in store() means truncation. Still logging a message in the log in this case. */ + table->field[5]->flags|= FIELDFLAG_HEX_ESCAPE; if (table->field[5]->store(sql_text, sql_text_len, client_cs) < 0) goto err; diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 7fa3786c382..34b310931d6 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -840,6 +840,68 @@ outp: } +/** + Copy string with HEX-encoding of "bad" characters. + + @details This functions copies the string pointed by "src" + to the string pointed by "dst". Not more than "srclen" bytes + are read from "src". Any sequences of bytes representing + a not-well-formed substring (according to cs) are hex-encoded, + and all well-formed substrings (according to cs) are copied as is. + Not more than "dstlen" bytes are written to "dst". The number + of bytes written to "dst" is returned. + + @param cs character set pointer of the destination string + @param[out] dst destination string + @param dstlen size of dst + @param src source string + @param srclen length of src + + @retval result length +*/ + +size_t +my_copy_with_hex_escaping(CHARSET_INFO *cs, + char *dst, size_t dstlen, + const char *src, size_t srclen) +{ + const char *srcend= src + srclen; + char *dst0= dst; + + for ( ; src < srcend ; ) + { + size_t chlen; + if ((chlen= my_ismbchar(cs, src, srcend))) + { + if (dstlen < chlen) + break; /* purecov: inspected */ + memcpy(dst, src, chlen); + src+= chlen; + dst+= chlen; + dstlen-= chlen; + } + else if (*src & 0x80) + { + if (dstlen < 4) + break; /* purecov: inspected */ + *dst++= '\\'; + *dst++= 'x'; + *dst++= _dig_vec_upper[((unsigned char) *src) >> 4]; + *dst++= _dig_vec_upper[((unsigned char) *src) & 15]; + src++; + dstlen-= 4; + } + else + { + if (dstlen < 1) + break; /* purecov: inspected */ + *dst++= *src++; + dstlen--; + } + } + return dst - dst0; +} + /* copy a string, with optional character set conversion, diff --git a/sql/sql_string.h b/sql/sql_string.h index 128ed749b5f..b4d76a1779a 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -37,6 +37,9 @@ uint32 well_formed_copy_nchars(CHARSET_INFO *to_cs, 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 { -- cgit v1.2.1 From 8e4a3fcbc996e41b4d805a926479bfacf13a99dd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2008 16:13:08 +0400 Subject: Bug#23097 mysql can't insert korean on mysql prompt. Problem: libedit is a very pure-ASCII oriented library, and it is not aware of extended (0x80..0xFF) or even multi-byte characters. It considered such characters as non-printable and didn't allow to input them. Fix: make libedit think that all bytes >= 0x80 are printable. cmd-line-utils/libedit/el.h: Defining macro, a locale's isprint() replacement. We'll consider all 8bit values as printable characters. cmd-line-utils/libedit/key.c: Changing isprint() to el_isprint(). cmd-line-utils/libedit/map.c: Changing isprint() to el_isprint(). cmd-line-utils/libedit/read.c: Changing isprint() to el_isprint(). cmd-line-utils/libedit/refresh.c: Changing isprint() to el_isprint(). --- cmd-line-utils/libedit/el.h | 2 ++ cmd-line-utils/libedit/key.c | 4 ++-- cmd-line-utils/libedit/map.c | 2 +- cmd-line-utils/libedit/read.c | 2 +- cmd-line-utils/libedit/refresh.c | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd-line-utils/libedit/el.h b/cmd-line-utils/libedit/el.h index c4b6cff2186..d9379d7c8aa 100644 --- a/cmd-line-utils/libedit/el.h +++ b/cmd-line-utils/libedit/el.h @@ -136,6 +136,8 @@ struct editline { protected int el_editmode(EditLine *, int, const char **); +#define el_isprint(x) ((unsigned char) (x) < 0x80 ? isprint(x) : 1) + #ifdef DEBUG #define EL_ABORT(a) do { \ fprintf(el->el_errfile, "%s, %d: ", \ diff --git a/cmd-line-utils/libedit/key.c b/cmd-line-utils/libedit/key.c index 090a2684e92..35fcf0651b2 100644 --- a/cmd-line-utils/libedit/key.c +++ b/cmd-line-utils/libedit/key.c @@ -618,7 +618,7 @@ key__decode_char(char *buf, int cnt, int ch) } else if (ch == '\\') { buf[cnt++] = '\\'; buf[cnt] = '\\'; - } else if (ch == ' ' || (isprint(ch) && !isspace(ch))) { + } else if (ch == ' ' || (el_isprint(ch) && !isspace(ch))) { buf[cnt] = ch; } else { buf[cnt++] = '\\'; @@ -660,7 +660,7 @@ key__decode_str(const char *str, char *buf, const char *sep) } else if (*p == '^' || *p == '\\') { *b++ = '\\'; *b++ = *p; - } else if (*p == ' ' || (isprint((unsigned char) *p) && + } else if (*p == ' ' || (el_isprint((unsigned char) *p) && !isspace((unsigned char) *p))) { *b++ = *p; } else { diff --git a/cmd-line-utils/libedit/map.c b/cmd-line-utils/libedit/map.c index d99c36ff665..6be9279b5e5 100644 --- a/cmd-line-utils/libedit/map.c +++ b/cmd-line-utils/libedit/map.c @@ -961,7 +961,7 @@ map_init_nls(EditLine *el) el_action_t *map = el->el_map.key; for (i = 0200; i <= 0377; i++) - if (isprint(i)) + if (el_isprint(i)) map[i] = ED_INSERT; } diff --git a/cmd-line-utils/libedit/read.c b/cmd-line-utils/libedit/read.c index 051f3e8e42e..51848c2038e 100644 --- a/cmd-line-utils/libedit/read.c +++ b/cmd-line-utils/libedit/read.c @@ -508,7 +508,7 @@ el_gets(EditLine *el, int *nread) el->el_chared.c_redo.pos < el->el_chared.c_redo.lim) { if (cmdnum == VI_DELETE_PREV_CHAR && el->el_chared.c_redo.pos != el->el_chared.c_redo.buf - && isprint((unsigned char)el->el_chared.c_redo.pos[-1])) + && el_isprint((unsigned char)el->el_chared.c_redo.pos[-1])) el->el_chared.c_redo.pos--; else *el->el_chared.c_redo.pos++ = ch; diff --git a/cmd-line-utils/libedit/refresh.c b/cmd-line-utils/libedit/refresh.c index b2833d215c5..46aca15ef08 100644 --- a/cmd-line-utils/libedit/refresh.c +++ b/cmd-line-utils/libedit/refresh.c @@ -88,7 +88,7 @@ private void re_addc(EditLine *el, int c) { - if (isprint(c)) { + if (el_isprint(c)) { re_putc(el, c, 1); return; } @@ -964,7 +964,7 @@ re_refresh_cursor(EditLine *el) h = 1; v++; } - } else if (!isprint((unsigned char) c)) { + } else if (!el_isprint((unsigned char) c)) { h += 3; if (h > th) { /* if overflow, compensate */ h = h - th; @@ -1057,7 +1057,7 @@ re_fastaddc(EditLine *el) char mc = (c == '\177') ? '?' : (c | 0100); re_fastputc(el, '^'); re_fastputc(el, mc); - } else if (isprint((unsigned char) c)) { /* normal char */ + } else if (el_isprint((unsigned char) c)) { /* normal char */ re_fastputc(el, c); } else { re_fastputc(el, '\\'); -- cgit v1.2.1 From f2c9483dd5071747bfb46f4dd97d3607fe7d74ec Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Mar 2008 09:58:49 +0400 Subject: additional test fixes for bug 27580 --- mysql-test/r/ctype_cp1250_ch.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/r/ctype_cp932.result | 19 +++++++++++++++++++ mysql-test/r/ctype_ucs.result | 17 +++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 3f22933e260..2ed22802805 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -57,6 +57,23 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; set names utf8; create table t1 ( name varchar(10), @@ -133,6 +150,23 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/ctype_cp932.result index 8974a6a8594..63cd720746f 100755 --- a/mysql-test/r/ctype_cp932.result +++ b/mysql-test/r/ctype_cp932.result @@ -6,6 +6,8 @@ SET @test_character_set= 'cp932'; SET @test_collation= 'cp932_japanese_ci'; SET @safe_character_set_server= @@character_set_server; SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; SET character_set_server= @test_character_set; SET collation_server= @test_collation; CREATE DATABASE d1; @@ -72,10 +74,27 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) default NULL, + `level` smallint(5) unsigned default NULL +) ENGINE=MyISAM DEFAULT CHARSET=cp932 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; set names cp932; set character_set_database = cp932; CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index a69c98590c6..f1a2da6c6bb 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -54,6 +54,23 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; set names utf8; create table t1 ( name varchar(10), -- cgit v1.2.1 From 44df0f6e9cece95b914f3f3b0ce3d3baa6f2dbf1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Mar 2008 18:41:50 +0400 Subject: BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR || m_status == DA_OK Reading from information_scema.tables or information_schema.columns may cause assertion failure in debug builds. This may happen under rare circumstances when information_schema fails to get information about a table (e.g. when a connection is killed). This happens because open_normal_and_derived_tables() can return an error without setting an error message in THD. But information_schema attempts to get an error message from THD unconditionally. With this fix information_schema attempts to get an error message from THD only in case error message is set in THD. mysql-test/r/information_schema.result: A test case for BUG#34656. mysql-test/t/information_schema.test: A test case for BUG#34656. sql/item_func.cc: Set proc info to "User sleep". sql/sql_show.cc: open_normal_and_derived_tables() can return an error without setting an error message in THD. That means we must access error message conditionally, only in case thd->is_error() is true. --- mysql-test/r/information_schema.result | 2 ++ mysql-test/t/information_schema.test | 44 ++++++++++++++++++++++++++++++++++ sql/item_func.cc | 2 ++ sql/sql_show.cc | 7 +++--- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 708d8ab027d..cfd96ccfd68 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1638,4 +1638,6 @@ show open tables where f1()=0; show open tables where f1()=0; drop table t1; drop function f1; +select * from information_schema.tables where 1=sleep(100000); +select * from information_schema.columns where 1=sleep(100000); End of 5.1 tests. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 6e76a043645..9f99f0fe32b 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1270,4 +1270,48 @@ show open tables where f1()=0; drop table t1; drop function f1; +# +# BUG#34656 - KILL a query = Assertion failed: m_status == DA_ERROR || +# m_status == DA_OK +# +connect (conn1, localhost, root,,); +connection conn1; +let $ID= `select connection_id()`; +send select * from information_schema.tables where 1=sleep(100000); +connection default; +let $wait_timeout= 10; +let $wait_condition=select count(*)=1 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.tables where 1=sleep(100000)'; +--source include/wait_condition.inc +disable_query_log; +eval kill $ID; +enable_query_log; +disconnect conn1; +let $wait_timeout= 10; +let $wait_condition=select count(*)=0 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.tables where 1=sleep(100000)'; +--source include/wait_condition.inc + +connect (conn1, localhost, root,,); +connection conn1; +let $ID= `select connection_id()`; +send select * from information_schema.columns where 1=sleep(100000); +connection default; +let $wait_timeout= 10; +let $wait_condition=select count(*)=1 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.columns where 1=sleep(100000)'; +--source include/wait_condition.inc +disable_query_log; +eval kill $ID; +enable_query_log; +disconnect conn1; +let $wait_timeout= 10; +let $wait_condition=select count(*)=0 from information_schema.processlist +where state='User sleep' and +info='select * from information_schema.columns where 1=sleep(100000)'; +--source include/wait_condition.inc + --echo End of 5.1 tests. diff --git a/sql/item_func.cc b/sql/item_func.cc index 65d3a627d2d..b61f683ae9f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3722,6 +3722,7 @@ longlong Item_func_sleep::val_int() pthread_cond_init(&cond, NULL); pthread_mutex_lock(&LOCK_user_locks); + thd_proc_info(thd, "User sleep"); thd->mysys_var->current_mutex= &LOCK_user_locks; thd->mysys_var->current_cond= &cond; @@ -3733,6 +3734,7 @@ longlong Item_func_sleep::val_int() break; error= 0; } + thd_proc_info(thd, 0); pthread_mutex_unlock(&LOCK_user_locks); pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6d817cb0620..a6516d5bf46 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3430,7 +3430,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables, /* there was errors during opening tables */ - const char *error= thd->main_da.message(); + const char *error= thd->is_error() ? thd->main_da.message() : ""; if (tables->view) table->field[3]->store(STRING_WITH_LEN("VIEW"), cs); else if (tables->schema_table) @@ -3631,8 +3631,9 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS rather than in SHOW COLUMNS */ - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - thd->main_da.sql_errno(), thd->main_da.message()); + if (thd->is_error()) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + thd->main_da.sql_errno(), thd->main_da.message()); thd->clear_error(); res= 0; } -- cgit v1.2.1