diff options
Diffstat (limited to 'mysql-test/suite/maria')
42 files changed, 572 insertions, 150 deletions
diff --git a/mysql-test/suite/maria/aria_sort_buffer.result b/mysql-test/suite/maria/aria_sort_buffer.result new file mode 100644 index 00000000000..5db9b9d7d44 --- /dev/null +++ b/mysql-test/suite/maria/aria_sort_buffer.result @@ -0,0 +1,11 @@ +SET SESSION aria_repair_threads=128; +SET SESSION aria_sort_buffer_size=CAST(-1 AS UNSIGNED INT); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1292 Truncated incorrect aria_sort_buffer_size value: '18446744073709551615' +SET SESSION tmp_table_size=65535; +CREATE TABLE t1 (a VARCHAR(255)); +insert into t1 (a) select seq from seq_1_to_1000; +UPDATE t1 SET a=( (SELECT MAX(a) FROM t1)); +DROP TABLE t1; diff --git a/mysql-test/suite/maria/aria_sort_buffer.test b/mysql-test/suite/maria/aria_sort_buffer.test new file mode 100644 index 00000000000..190daa0fa10 --- /dev/null +++ b/mysql-test/suite/maria/aria_sort_buffer.test @@ -0,0 +1,15 @@ +--source include/have_sequence.inc + +# +# +# MDEV-24750 Various corruptions caused by Aria subsystem asking system call +# to overwrite memory that it does not own (InnoDB stacks) + +SET SESSION aria_repair_threads=128; +SET SESSION aria_sort_buffer_size=CAST(-1 AS UNSIGNED INT); + +SET SESSION tmp_table_size=65535; +CREATE TABLE t1 (a VARCHAR(255)); +insert into t1 (a) select seq from seq_1_to_1000; +UPDATE t1 SET a=( (SELECT MAX(a) FROM t1)); +DROP TABLE t1; diff --git a/mysql-test/suite/maria/create.result b/mysql-test/suite/maria/create.result index f1da0d7105b..801812b647f 100644 --- a/mysql-test/suite/maria/create.result +++ b/mysql-test/suite/maria/create.result @@ -75,3 +75,32 @@ DROP TABLE t1; # # End of 10.3 tests # +CREATE TABLE t1 (a INT) ENGINE=Aria; +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (b INT); +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t1; +a +1 +SELECT * from t2; +a +1 +BEGIN; +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t2; +a +1 +COMMIT; +LOCK TABLES t1 read, t2 write; +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t2; +a +1 +UNLOCK TABLES; +CREATE TABLE t3 (a INT) engine=Aria; +INSERT INTO t3 values(2); +CREATE OR REPLACE TABLE t2 AS SELECT t1.a,t3.a as b FROM t1,t3; +SELECT * from t2; +a b +1 2 +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/maria/create.test b/mysql-test/suite/maria/create.test index cac1f8bd7e1..3937d800fed 100644 --- a/mysql-test/suite/maria/create.test +++ b/mysql-test/suite/maria/create.test @@ -86,12 +86,42 @@ flush tables; --error 1,ER_TABLE_EXISTS_ERROR --eval CREATE TABLE MDEV_23222 (i INT) DATA DIRECTORY = '$MYSQL_TMP_DIR', ENGINE=Aria TRANSACTIONAL=1; DROP TABLE t1; ---disable_warnings ---remove_file $mysqld_datadir/test/MDEV_23222.MAD ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR ---remove_file $MYSQL_TMP_DIR/MDEV_23222.MAD ---enable_warnings --echo # --echo # End of 10.3 tests --echo # + +# +# MDEV-22686 # Assertion `trn' failed in ha_maria::start_stmt +# ASAN heap-after-free in maria_status +# + +CREATE TABLE t1 (a INT) ENGINE=Aria; +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (b INT); +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t1; +SELECT * from t2; + +# Check also BEGIN/COMMIT + +BEGIN; +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t2; +COMMIT; + +# Check also LOCK TABLES + +LOCK TABLES t1 read, t2 write; +CREATE OR REPLACE TABLE t2 AS SELECT * FROM t1; +SELECT * from t2; +UNLOCK TABLES; + +# Check with 3 tables +CREATE TABLE t3 (a INT) engine=Aria; +INSERT INTO t3 values(2); + +CREATE OR REPLACE TABLE t2 AS SELECT t1.a,t3.a as b FROM t1,t3; +SELECT * from t2; + +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index 975c280d467..43ec6439144 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -1,5 +1,5 @@ -set @save_storage_engine= @@storage_engine; -set storage_engine=Maria; +set @save_storage_engine= @@default_storage_engine; +set default_storage_engine=Maria; set @maria_icp_tmp=@@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; # @@ -409,7 +409,7 @@ WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240 ORDER BY c1 LIMIT 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,k1 k1 5 NULL 4 Using where +1 SIMPLE t1 range PRIMARY,k1 PRIMARY 4 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort DROP TABLE t1; # # @@ -430,9 +430,9 @@ EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index condition -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func # Using index condition +2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); pk i @@ -677,16 +677,18 @@ DROP TABLE t1; # CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b)); INSERT INTO t1 VALUES (1,4,'Ill'); +insert into t1 select seq+100,5,seq from seq_1_to_100; CREATE TABLE t2 (a varchar(1024), KEY (a(512))); INSERT INTO t2 VALUES ('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w'); +insert into t2 select seq from seq_1_to_100; SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 -1 SIMPLE t2 ref a a 515 const 1 Using where +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort +1 SIMPLE t2 ref a a 515 test.t1.a # Using where SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c @@ -696,8 +698,8 @@ EXPLAIN SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 -1 SIMPLE t2 ref a a 515 const 1 Using where +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort +1 SIMPLE t2 ref a a 515 test.t1.a # Using where SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0) HAVING t1.c != 5 ORDER BY t1.c; b c @@ -903,5 +905,5 @@ c1 c2 aa x a y DROP TABLE t1; -set storage_engine= @save_storage_engine; +set default_storage_engine= @save_storage_engine; set optimizer_switch=@maria_icp_tmp; diff --git a/mysql-test/suite/maria/icp.test b/mysql-test/suite/maria/icp.test index 83d770dd8fd..0bcb3bccfe2 100644 --- a/mysql-test/suite/maria/icp.test +++ b/mysql-test/suite/maria/icp.test @@ -5,14 +5,14 @@ --source include/have_maria.inc --source include/default_optimizer_switch.inc -set @save_storage_engine= @@storage_engine; -set storage_engine=Maria; +set @save_storage_engine= @@default_storage_engine; +set default_storage_engine=Maria; set @maria_icp_tmp=@@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; --source include/icp_tests.inc -set storage_engine= @save_storage_engine; +set default_storage_engine= @save_storage_engine; set optimizer_switch=@maria_icp_tmp; diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result index de24b987524..0891e8ad249 100644 --- a/mysql-test/suite/maria/lock.result +++ b/mysql-test/suite/maria/lock.result @@ -1,7 +1,6 @@ drop table if exists t1,t2; Warnings: -Note 1051 Unknown table 'test.t1' -Note 1051 Unknown table 'test.t2' +Note 1051 Unknown table 'test.t1,test.t2' CREATE TABLE t1 (i INT) ENGINE=Aria; CREATE TABLE t2 (i INT) ENGINE=Aria; LOCK TABLE t1 WRITE, t2 WRITE; @@ -167,3 +166,14 @@ test.t1 optimize status Table is already up to date disconnect con1; connection default; DROP TABLE t1, t2; +# +# MDEV-22829 SIGSEGV in _ma_reset_history on LOCK +# +CREATE TABLE t1 (f1 INT) ENGINE=Aria; +CREATE TABLE t2 (f2 INT) ENGINE=Aria; +LOCK TABLES t2 WRITE, t1 WRITE; +INSERT INTO t1 VALUES (1); +CREATE TRIGGER ai AFTER INSERT ON t1 FOR EACH ROW UPDATE t1 SET v=1 WHERE b=new.a; +ERROR 42S22: Unknown column 'a' in 'NEW' +UNLOCK TABLES; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/maria/lock.test b/mysql-test/suite/maria/lock.test index bb709f8a69c..017bd025ac1 100644 --- a/mysql-test/suite/maria/lock.test +++ b/mysql-test/suite/maria/lock.test @@ -185,3 +185,16 @@ OPTIMIZE TABLE t1; --disconnect con1 --connection default DROP TABLE t1, t2; + +--echo # +--echo # MDEV-22829 SIGSEGV in _ma_reset_history on LOCK +--echo # + +CREATE TABLE t1 (f1 INT) ENGINE=Aria; +CREATE TABLE t2 (f2 INT) ENGINE=Aria; +LOCK TABLES t2 WRITE, t1 WRITE; +INSERT INTO t1 VALUES (1); +--error ER_BAD_FIELD_ERROR +CREATE TRIGGER ai AFTER INSERT ON t1 FOR EACH ROW UPDATE t1 SET v=1 WHERE b=new.a; +UNLOCK TABLES; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/maria/maria-autozerofill.result b/mysql-test/suite/maria/maria-autozerofill.result index 064ac9e6496..e135d3d7d58 100644 --- a/mysql-test/suite/maria/maria-autozerofill.result +++ b/mysql-test/suite/maria/maria-autozerofill.result @@ -38,14 +38,15 @@ create_rename_lsn has non-magic value # check table t2; Table Op Msg_type Msg_text -mysqltest.t2 check error Table is from another system and must be zerofilled or repaired to be usable on this system +mysqltest.t2 check error Table is probably from another system and must be zerofilled or repaired ('REPAIR TABLE table_name') to be usable on this system mysqltest.t2 check error Corrupt check table t2; Table Op Msg_type Msg_text -mysqltest.t2 check error Table is from another system and must be zerofilled or repaired to be usable on this system +mysqltest.t2 check error Table is probably from another system and must be zerofilled or repaired ('REPAIR TABLE table_name') to be usable on this system mysqltest.t2 check error Corrupt repair table t2; Table Op Msg_type Msg_text +mysqltest.t2 repair info Running zerofill on moved table mysqltest.t2 repair status OK check table t2; Table Op Msg_type Msg_text @@ -61,6 +62,7 @@ mysqltest.t4 analyze Note Zerofilling moved table ./mysqltest/t4 mysqltest.t4 analyze status OK repair table t5; Table Op Msg_type Msg_text +mysqltest.t5 repair info Running zerofill on moved table mysqltest.t5 repair status OK check table t5; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/maria/maria-autozerofill.test b/mysql-test/suite/maria/maria-autozerofill.test index 4baa118302c..8459e27a8a8 100644 --- a/mysql-test/suite/maria/maria-autozerofill.test +++ b/mysql-test/suite/maria/maria-autozerofill.test @@ -71,7 +71,7 @@ perl; my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/autozerofill.txt"; open(FILE, "<", $fname) or die; my @content= <FILE>; - print grep(/Status:.*zerofilled/, @content); + print grep(/Status:.*/, @content); print "create_rename_lsn has magic value\n" if grep(/create_rename \(0,0x2\)/, @content); close FILE; EOF @@ -115,7 +115,14 @@ check table t5; # Check that if we zerofill with aria_chk, we should not get any warnings when # accessing the table +--error 0,1,11,139 --exec $MARIA_CHK --ignore-control-file --zerofill $MYSQLD_DATADIR/mysqltest/t6 >$MYSQLTEST_VARDIR/tmp/autozerofill.txt 2>&1 +if ($sys_errno != 0) +{ +--cat_file $MYSQLTEST_VARDIR/tmp/autozerofill.txt +--die +} + select * from t6; check table t6; diff --git a/mysql-test/suite/maria/maria-big.result b/mysql-test/suite/maria/maria-big.result index f7f7d3d7525..f4fd4b65dc8 100644 --- a/mysql-test/suite/maria/maria-big.result +++ b/mysql-test/suite/maria/maria-big.result @@ -1,7 +1,7 @@ set global max_allowed_packet=400000000; connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK; connection root; -set storage_engine=aria; +set default_storage_engine=aria; affected rows: 0 drop table if exists t1, t2; affected rows: 0 diff --git a/mysql-test/suite/maria/maria-big.test b/mysql-test/suite/maria/maria-big.test index 6dc56756cf7..33a211b53bf 100644 --- a/mysql-test/suite/maria/maria-big.test +++ b/mysql-test/suite/maria/maria-big.test @@ -9,7 +9,7 @@ connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root; enable_info; -set storage_engine=aria; +set default_storage_engine=aria; disable_warnings; drop table if exists t1, t2; enable_warnings; diff --git a/mysql-test/suite/maria/maria-connect.result b/mysql-test/suite/maria/maria-connect.result index b731bb4e1d0..84195780cf8 100644 --- a/mysql-test/suite/maria/maria-connect.result +++ b/mysql-test/suite/maria/maria-connect.result @@ -1,5 +1,5 @@ -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; drop table if exists t1; SET SQL_WARNINGS=1; RESET MASTER; @@ -8,6 +8,11 @@ CREATE TABLE t1 (a int primary key); insert t1 values (1),(2),(3); insert t1 values (4),(2),(5); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +show warnings; +Level Code Message +Error 1062 Duplicate entry '2' for key 'PRIMARY' +Note 4173 Engine Aria does not support rollback. Changes were committed during rollback call +Warning 1196 Some non-transactional changed tables couldn't be rolled back select * from t1; a 1 diff --git a/mysql-test/suite/maria/maria-connect.test b/mysql-test/suite/maria/maria-connect.test index a1e9bbce4f2..ac7e9589285 100644 --- a/mysql-test/suite/maria/maria-connect.test +++ b/mysql-test/suite/maria/maria-connect.test @@ -8,9 +8,9 @@ let $start_pos= `select @binlog_start_pos`; -let $default=`select @@global.storage_engine`; -set global storage_engine=aria; -set session storage_engine=aria; +let $default=`select @@global.default_storage_engine`; +set global default_storage_engine=aria; +set session default_storage_engine=aria; # Initialise --disable_warnings @@ -29,6 +29,7 @@ CREATE TABLE t1 (a int primary key); insert t1 values (1),(2),(3); --error ER_DUP_ENTRY insert t1 values (4),(2),(5); +show warnings; select * from t1; --replace_result $start_pos <start_pos> --replace_column 2 # 5 # @@ -40,7 +41,7 @@ set binlog_format=default; --disable_result_log --disable_query_log -eval set global storage_engine=$default; +eval set global default_storage_engine=$default; set global aria_log_file_size=default; --enable_result_log --enable_query_log diff --git a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result index 2f8c1b9408c..dad74e3767f 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result +++ b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result @@ -1,4 +1,4 @@ -set storage_engine=aria; +set default_storage_engine=aria; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, diff --git a/mysql-test/suite/maria/maria-gis-rtree-dynamic.test b/mysql-test/suite/maria/maria-gis-rtree-dynamic.test index 473f787db53..8dd1d04d539 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-dynamic.test +++ b/mysql-test/suite/maria/maria-gis-rtree-dynamic.test @@ -1,7 +1,7 @@ -- source include/have_maria.inc -- source include/have_geometry.inc -set storage_engine=aria; +set default_storage_engine=aria; # # test of rtree (using with spatial data) diff --git a/mysql-test/suite/maria/maria-gis-rtree-trans.result b/mysql-test/suite/maria/maria-gis-rtree-trans.result index 1c0d9e756a4..e118db697b2 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-trans.result +++ b/mysql-test/suite/maria/maria-gis-rtree-trans.result @@ -1,4 +1,4 @@ -set storage_engine=aria; +set default_storage_engine=aria; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, diff --git a/mysql-test/suite/maria/maria-gis-rtree-trans.test b/mysql-test/suite/maria/maria-gis-rtree-trans.test index 84678b68693..ab0203dfc6f 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-trans.test +++ b/mysql-test/suite/maria/maria-gis-rtree-trans.test @@ -4,7 +4,7 @@ -- source include/have_maria.inc -- source include/have_geometry.inc -set storage_engine=aria; +set default_storage_engine=aria; # # test of rtree (using with spatial data) diff --git a/mysql-test/suite/maria/maria-gis-rtree.result b/mysql-test/suite/maria/maria-gis-rtree.result index e39430a2efb..9267556bc4b 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.result +++ b/mysql-test/suite/maria/maria-gis-rtree.result @@ -1,4 +1,4 @@ -set storage_engine=aria; +set default_storage_engine=aria; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, diff --git a/mysql-test/suite/maria/maria-gis-rtree.test b/mysql-test/suite/maria/maria-gis-rtree.test index 5c68e570fca..6c82108ecb0 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.test +++ b/mysql-test/suite/maria/maria-gis-rtree.test @@ -1,7 +1,7 @@ -- source include/have_maria.inc -- source include/have_geometry.inc -set storage_engine=aria; +set default_storage_engine=aria; # # test of rtree (using with spatial data) diff --git a/mysql-test/suite/maria/maria-partitioning.result b/mysql-test/suite/maria/maria-partitioning.result index ad5de7952c7..35b7da489fa 100644 --- a/mysql-test/suite/maria/maria-partitioning.result +++ b/mysql-test/suite/maria/maria-partitioning.result @@ -1,9 +1,8 @@ -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; DROP TABLE if exists t1,t2; Warnings: -Note 1051 Unknown table 'test.t1' -Note 1051 Unknown table 'test.t2' +Note 1051 Unknown table 'test.t1,test.t2' create table t2(a blob) engine=aria; create table t1(a int primary key) engine=aria; insert into t2 values ('foo'),('bar'); diff --git a/mysql-test/suite/maria/maria-partitioning.test b/mysql-test/suite/maria/maria-partitioning.test index 446cfed770b..6856d5a7157 100644 --- a/mysql-test/suite/maria/maria-partitioning.test +++ b/mysql-test/suite/maria/maria-partitioning.test @@ -5,10 +5,10 @@ --source include/have_maria.inc --source include/have_partition.inc -let $default_engine=`select @@global.storage_engine`; +let $default_engine=`select @@global.default_storage_engine`; let $default_checksum=`select @@global.aria_page_checksum`; -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; # # Test outer join const propagation @@ -46,6 +46,6 @@ drop table t1; # Set defaults back --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine; +eval set global default_storage_engine=$default_engine; --enable_result_log --enable_query_log diff --git a/mysql-test/suite/maria/maria-purge.result b/mysql-test/suite/maria/maria-purge.result index 53208aee990..71070cba7ff 100644 --- a/mysql-test/suite/maria/maria-purge.result +++ b/mysql-test/suite/maria/maria-purge.result @@ -4,8 +4,8 @@ connection default; connection admin; * shut down mysqld, removed logs, restarted it connection default; -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_log_file_size=4294959104; drop table if exists t1,t2; SET SQL_WARNINGS=1; diff --git a/mysql-test/suite/maria/maria-purge.test b/mysql-test/suite/maria/maria-purge.test index ad41fa0f5d0..7d799d9e2a9 100644 --- a/mysql-test/suite/maria/maria-purge.test +++ b/mysql-test/suite/maria/maria-purge.test @@ -15,9 +15,9 @@ connection default; # practice) -- source include/maria_empty_logs.inc -let $default=`select @@global.storage_engine`; -set global storage_engine=aria; -set session storage_engine=aria; +let $default=`select @@global.default_storage_engine`; +set global default_storage_engine=aria; +set session default_storage_engine=aria; let $def_logsize=`select @@global.aria_log_file_size`; let $def_checkinterval=`select @@global.aria_checkpoint_interval`; @@ -111,7 +111,7 @@ drop table t1, t2; --disable_result_log --disable_query_log set global aria_log_purge_type=immediate; -eval set global storage_engine=$default; +eval set global default_storage_engine=$default; eval set global aria_log_file_size=$def_logsize; eval set global aria_checkpoint_interval=$def_checkinterval; --enable_result_log diff --git a/mysql-test/suite/maria/maria-ucs2.result b/mysql-test/suite/maria/maria-ucs2.result index 321a374f4c2..7f3b691b139 100644 --- a/mysql-test/suite/maria/maria-ucs2.result +++ b/mysql-test/suite/maria/maria-ucs2.result @@ -1,8 +1,8 @@ select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Aria YES Crash-safe tables with MyISAM heritage. Used for internal temporary tables and privilege tables NO NO NO -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; drop table if exists t1; SET SQL_WARNINGS=1; CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) @@ -16,8 +16,6 @@ Table Op Msg_type Msg_text test.t1 check status OK SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; -Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -25,12 +23,12 @@ SHOW CREATE table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL, - KEY `a` (`a`(500)) + KEY `a` (`a`) ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 DROP TABLE t1; -CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; +CREATE TABLE t1 (a VARCHAR(1200),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes INSERT INTO t1 VALUES (REPEAT('abc ',200)); CHECK TABLE t1; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/maria/maria-ucs2.test b/mysql-test/suite/maria/maria-ucs2.test index e4f8bc8dd27..742de596e92 100644 --- a/mysql-test/suite/maria/maria-ucs2.test +++ b/mysql-test/suite/maria/maria-ucs2.test @@ -3,9 +3,9 @@ select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; -let $default_engine=`select @@global.storage_engine`; -set global storage_engine=aria; -set session storage_engine=aria; +let $default_engine=`select @@global.default_storage_engine`; +set global default_storage_engine=aria; +set session default_storage_engine=aria; # Initialise --disable_warnings @@ -37,7 +37,7 @@ DROP TABLE t1; # Issue was too long key # -CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; +CREATE TABLE t1 (a VARCHAR(1200),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; INSERT INTO t1 VALUES (REPEAT('abc ',200)); CHECK TABLE t1; DROP TABLE t1; @@ -47,6 +47,6 @@ DROP TABLE t1; --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine; +eval set global default_storage_engine=$default_engine; --enable_result_log --enable_query_log diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 03d37270eed..ac28953dff8 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2,8 +2,8 @@ call mtr.add_suppression("Can't find record in '.*'"); select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Aria YES Crash-safe tables with MyISAM heritage. Used for internal temporary tables and privilege tables NO NO NO -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; set global aria_log_file_size=4294959104; drop table if exists t1,t2; @@ -351,13 +351,13 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e)); -ERROR 42000: Specified key was too long; max key length is 1000 bytes +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255), KEY t1 (a, b, c, d, e, f, g, h, i)); +ERROR 42000: Specified key was too long; max key length is 2000 bytes CREATE TABLE t1 (a varchar(1), b varchar(1), key (a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b)); ERROR 42000: Too many key parts specified; max 32 parts allowed -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255)); -ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e); -ERROR 42000: Specified key was too long; max key length is 1000 bytes +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255)); +ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e, f, g, h, i); +ERROR 42000: Specified key was too long; max key length is 2000 bytes DROP TABLE t1; CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a)); INSERT into t1 values (0,null,0), (0,null,1), (0,null,2), (0,null,3), (1,1,4); @@ -400,7 +400,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 4 test.t2.a 1 explain select * from t1 where a=0 or a=2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL a NULL NULL NULL 10 Using where +1 SIMPLE t1 range a a 4 NULL 5 Using index condition explain select * from t1 force index (a) where a=0 or a=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 4 NULL 5 Using index condition @@ -935,7 +935,7 @@ _id DELETE FROM t1 WHERE _id < 8; SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1'; table_name engine version row_format Table_rows Data_free create_options table_comment -t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC +t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC transactional=0 CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK @@ -947,7 +947,7 @@ Table Op Msg_type Msg_text test.t1 check status OK SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1'; table_name engine version row_format Table_rows Data_free create_options table_comment -t1 Aria 10 Dynamic 2 0 row_format=DYNAMIC +t1 Aria 10 Dynamic 2 0 row_format=DYNAMIC transactional=0 SELECT _id FROM t1; _id 8 @@ -994,7 +994,7 @@ _id DELETE FROM t1 WHERE _id < 8; SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1'; table_name engine version row_format Table_rows Data_free create_options table_comment -t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC +t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC transactional=0 CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK @@ -1006,7 +1006,7 @@ Table Op Msg_type Msg_text test.t1 check status OK SELECT table_name, engine, version, row_format, Table_rows, Data_free, create_options, table_comment FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='t1'; table_name engine version row_format Table_rows Data_free create_options table_comment -t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC +t1 Aria 10 Dynamic 2 140 row_format=DYNAMIC transactional=0 SELECT _id FROM t1; _id 8 @@ -1156,7 +1156,7 @@ alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 'v_2' show warnings; Level Code Message -Error 1062 Duplicate entry 'a' for key 'v_2' +Error 1062 Duplicate entry 'a\0001' for key 'v_2' alter table t1 add key(v); Warnings: Note 1831 Duplicate index `v_2`. This is deprecated and will be disallowed in a future release @@ -1594,7 +1594,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes drop table if exists t1; set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for create table t1 (v varchar(65536)); @@ -1773,27 +1773,27 @@ DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 0 # # # 8192 # # # # # # # # N +t1 Aria 10 Page 0 # # # 8192 # # # # # # # transactional=1 # N INSERT INTO t1 VALUES (1,1); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N +t1 Aria 10 Page 1 # # # 24576 # # # # # # # transactional=1 # N ALTER TABLE t1 DISABLE KEYS; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N +t1 Aria 10 Page 1 # # # 24576 # # # # # # # transactional=1 # N ALTER TABLE t1 ENABLE KEYS; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N +t1 Aria 10 Page 1 # # # 24576 # # # # # # # transactional=1 # N ALTER TABLE t1 DISABLE KEYS; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N +t1 Aria 10 Page 1 # # # 24576 # # # # # # # transactional=1 # N ALTER TABLE t1 ENABLE KEYS; SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 1 # # # 24576 # # # # # # # # N +t1 Aria 10 Page 1 # # # 24576 # # # # # # # transactional=1 # N # Enable keys with parallel repair SET @@aria_repair_threads=2; ALTER TABLE t1 DISABLE KEYS; @@ -1866,34 +1866,34 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a)); Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2048) DEFAULT NULL, - KEY `a` (`a`(1000)) + KEY `a` (`a`(2000)) ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1024); Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2048) DEFAULT NULL, - KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192 + KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=1024; Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(2048) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192 + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=1024 alter table t1 key_block_size=2048; show create table t1; @@ -1902,7 +1902,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(2048) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192 + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048 alter table t1 add c int, add key (c); show create table t1; @@ -1912,7 +1912,7 @@ t1 CREATE TABLE `t1` ( `b` varchar(2048) DEFAULT NULL, `c` int(11) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192, + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192, KEY `c` (`c`) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=2048 alter table t1 key_block_size=4096; @@ -1923,7 +1923,7 @@ t1 CREATE TABLE `t1` ( `b` varchar(2048) DEFAULT NULL, `c` int(11) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192, + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192, KEY `c` (`c`) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=4096 alter table t1 key_block_size=0; @@ -1934,7 +1934,7 @@ t1 CREATE TABLE `t1` ( `b` varchar(2048) DEFAULT NULL, `c` int(11) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192, + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192, KEY `c` (`c`) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 alter table t1 add d int, add key (d); @@ -1946,33 +1946,33 @@ t1 CREATE TABLE `t1` ( `c` int(11) DEFAULT NULL, `d` int(11) DEFAULT NULL, KEY `a` (`a`) KEY_BLOCK_SIZE=8192, - KEY `b` (`b`(1000)) KEY_BLOCK_SIZE=8192, + KEY `b` (`b`(2000)) KEY_BLOCK_SIZE=8192, KEY `c` (`c`) KEY_BLOCK_SIZE=8192, KEY `d` (`d`) ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (a int not null, b varchar(2048), key (a), key(b)) key_block_size=8192; Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(2048) DEFAULT NULL, KEY `a` (`a`), - KEY `b` (`b`(1000)) + KEY `b` (`b`(2000)) ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192 drop table t1; create table t1 (a int not null, b varchar(2048), key (a) key_block_size=1024, key(b)) key_block_size=8192; Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` varchar(2048) DEFAULT NULL, KEY `a` (`a`), - KEY `b` (`b`(1000)) + KEY `b` (`b`(2000)) ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 KEY_BLOCK_SIZE=8192 drop table t1; create table t1 (a int not null, b int, key (a) key_block_size=1024, key(b) key_block_size=8192) key_block_size=16384; @@ -1995,12 +1995,12 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000); Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2048) DEFAULT NULL, - KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192 + KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (a int not null, key `a` (a) key_block_size=1025); diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index d5b9d839699..c940fc66bd4 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -10,10 +10,10 @@ call mtr.add_suppression("Can't find record in '.*'"); select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; -let $default_engine=`select @@global.storage_engine`; +let $default_engine=`select @@global.default_storage_engine`; let $default_checksum=`select @@global.aria_page_checksum`; -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; let $default_log_file_size=`select @@global.aria_log_file_size`; set global aria_log_file_size=4294959104; @@ -373,12 +373,12 @@ drop table t1; # --error 1071 -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e)); +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255), KEY t1 (a, b, c, d, e, f, g, h, i)); --error 1070 CREATE TABLE t1 (a varchar(1), b varchar(1), key (a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b,a,b)); -CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255)); +CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), f varchar(255), g varchar(255), h varchar(255), i varchar(255)); --error 1071 -ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e); +ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e, f, g, h, i); DROP TABLE t1; # @@ -2094,7 +2094,7 @@ drop table t1; # Set defaults back --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine, +eval set global default_storage_engine=$default_engine, aria_page_checksum=$default_checksum, aria_log_file_size=$default_log_file_size; --enable_result_log diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 09fc696c272..871748b399a 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -1,8 +1,8 @@ select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Aria YES Crash-safe tables with MyISAM heritage. Used for internal temporary tables and privilege tables NO NO NO -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; set global aria_log_file_size=4294959104; drop table if exists t1,t2; @@ -17,12 +17,12 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a varchar(2048), key `a` (a) key_block_size=1000000000000000000); Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(2048) DEFAULT NULL, - KEY `a` (`a`(1000)) KEY_BLOCK_SIZE=8192 + KEY `a` (`a`(2000)) KEY_BLOCK_SIZE=8192 ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (a int not null, key `a` (a) key_block_size=1025); diff --git a/mysql-test/suite/maria/maria3.test b/mysql-test/suite/maria/maria3.test index fd0d5c67a57..bf533228300 100644 --- a/mysql-test/suite/maria/maria3.test +++ b/mysql-test/suite/maria/maria3.test @@ -2,10 +2,10 @@ select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; -let $default_engine=`select @@global.storage_engine`; +let $default_engine=`select @@global.default_storage_engine`; let $default_checksum=`select @@global.aria_page_checksum`; -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; let $default_log_file_size=`select @@global.aria_log_file_size`; set global aria_log_file_size=4294959104; @@ -561,7 +561,7 @@ drop table t1; --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine, +eval set global default_storage_engine=$default_engine, aria_page_checksum=$default_checksum, aria_log_file_size=$default_log_file_size; --enable_result_log diff --git a/mysql-test/suite/maria/maria_notembedded.result b/mysql-test/suite/maria/maria_notembedded.result index a717782830d..0e90ebced66 100644 --- a/mysql-test/suite/maria/maria_notembedded.result +++ b/mysql-test/suite/maria/maria_notembedded.result @@ -1,5 +1,5 @@ call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction"); -set session storage_engine=aria; +set session default_storage_engine=aria; create table t1 (a int) row_format=page; insert delayed into t1 values(1); ERROR HY000: DELAYED option not supported for table 't1' diff --git a/mysql-test/suite/maria/maria_notembedded.test b/mysql-test/suite/maria/maria_notembedded.test index 29f15e81013..70c04073416 100644 --- a/mysql-test/suite/maria/maria_notembedded.test +++ b/mysql-test/suite/maria/maria_notembedded.test @@ -5,8 +5,8 @@ call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction"); -let $default_engine=`select @@session.storage_engine`; -set session storage_engine=aria; +let $default_engine=`select @@session.default_storage_engine`; +set session default_storage_engine=aria; # Verify that INSERT DELAYED is disabled only for transactional tables # ("embedded" server translates them to plain INSERT) @@ -96,6 +96,6 @@ drop table t1; --disable_result_log --disable_query_log -eval set session storage_engine=$default_engine; +eval set session default_storage_engine=$default_engine; --enable_result_log --enable_query_log diff --git a/mysql-test/suite/maria/maria_partition.result b/mysql-test/suite/maria/maria_partition.result index 1c4f0fbaf05..f544ddd4927 100644 --- a/mysql-test/suite/maria/maria_partition.result +++ b/mysql-test/suite/maria/maria_partition.result @@ -1,5 +1,5 @@ -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; drop table if exists t1,t2; drop view if exists v1; diff --git a/mysql-test/suite/maria/maria_partition.test b/mysql-test/suite/maria/maria_partition.test index ca2651bcdc3..c515b6e717a 100644 --- a/mysql-test/suite/maria/maria_partition.test +++ b/mysql-test/suite/maria/maria_partition.test @@ -3,10 +3,10 @@ --source include/have_partition.inc -- source include/have_maria.inc -let $default_engine=`select @@global.storage_engine`; +let $default_engine=`select @@global.default_storage_engine`; let $default_checksum=`select @@global.aria_page_checksum`; -set global storage_engine=aria; -set session storage_engine=aria; +set global default_storage_engine=aria; +set session default_storage_engine=aria; set global aria_page_checksum=0; # Initialise @@ -74,7 +74,7 @@ drop view v1; # Set defaults back --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine, aria_page_checksum=$default_checksum; +eval set global default_storage_engine=$default_engine, aria_page_checksum=$default_checksum; set global aria_log_file_size=default; --enable_result_log --enable_query_log diff --git a/mysql-test/suite/maria/max_length.result b/mysql-test/suite/maria/max_length.result index 93478e033f4..4403ce5d0d2 100644 --- a/mysql-test/suite/maria/max_length.result +++ b/mysql-test/suite/maria/max_length.result @@ -1,14 +1,30 @@ drop table if exists t1,t2; Warnings: -Note 1051 Unknown table 'test.t1' -Note 1051 Unknown table 'test.t2' -create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria; -create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria; +Note 1051 Unknown table 'test.t1,test.t2' +create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob) row_format=page max_rows=2 engine=aria; +create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob, key(v)) row_format=page max_rows=20000000 engine=aria; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `v` varchar(2000) DEFAULT NULL, + `b` blob DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=2 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `v` varchar(2000) DEFAULT NULL, + `b` blob DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `v` (`v`) +) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=20000000 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE lock tables t1 write,t2 write; show table status like "t_"; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE 536862720 N -t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE 536862720 N +t1 Aria 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE transactional=1 536862720 N +t2 Aria 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE transactional=1 137438945280 N insert into t1 values(null, repeat("ab",100),repeat("def",1000)); insert into t1 values(null, repeat("de",200),repeat("ghi",2000)); insert into t1 values(null, repeat("fe",300),repeat("ghi",3000)); @@ -160,9 +176,9 @@ test.t1 check warning Datafile is almost full, 268320768 of 268320768 used test.t1 check status OK show table status like "t1"; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 6189940 43 268320768 268320768 8192 0 NULL # # # latin1_swedish_ci NULL max_rows=10 row_format=PAGE 137438945280 N +t1 Aria 10 Page 6189940 43 268320768 268320768 8192 0 NULL # # # latin1_swedish_ci NULL max_rows=10 row_format=PAGE transactional=1 137438945280 N create index seq on t1(c1); show table status like "t1"; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 Aria 10 Page 6189940 43 268320768 268320768 49750016 0 NULL # # # latin1_swedish_ci NULL max_rows=10 page_checksum=1 row_format=PAGE 536862720 N +t1 Aria 10 Page 6189940 43 268320768 268320768 49750016 0 NULL # # # latin1_swedish_ci NULL max_rows=10 page_checksum=1 row_format=PAGE transactional=1 536862720 N drop table t1; diff --git a/mysql-test/suite/maria/max_length.test b/mysql-test/suite/maria/max_length.test index fdfe2aae4ac..a5bfb0b8fd6 100644 --- a/mysql-test/suite/maria/max_length.test +++ b/mysql-test/suite/maria/max_length.test @@ -4,11 +4,15 @@ --source include/have_maria.inc --source include/have_sequence.inc --source include/big_test.inc +# This test is too slow for valgrind +--source include/not_valgrind.inc drop table if exists t1,t2; -create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria; -create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria; +create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob) row_format=page max_rows=2 engine=aria; +create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(2000), b blob, key(v)) row_format=page max_rows=20000000 engine=aria; +show create table t1; +show create table t2; lock tables t1 write,t2 write; --replace_column 12 # 13 # 14 # show table status like "t_"; diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result index 17b7b751dfb..df915e4a15d 100644 --- a/mysql-test/suite/maria/mrr.result +++ b/mysql-test/suite/maria/mrr.result @@ -2,8 +2,8 @@ drop table if exists t1,t2,t3,t4; set @maria_mrr_tmp=@@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; set @mrr_buffer_size_save= @@mrr_buffer_size; -set @save_storage_engine= @@storage_engine; -set storage_engine=aria; +set @save_storage_engine= @@default_storage_engine; +set default_storage_engine=aria; create table t1(a int); show create table t1; Table Create Table @@ -297,7 +297,7 @@ NULL 7 0 NULL 9 0 NULL 9 0 drop table t1, t2; -set storage_engine= @save_storage_engine; +set default_storage_engine= @save_storage_engine; set @@mrr_buffer_size= @mrr_buffer_size_save; # # Crash in quick_range_seq_next() in maria-5.3-dsmrr-cpk with join_cache_level = {8,1} @@ -392,8 +392,6 @@ col_varchar_1024_latin1_key varchar(1024) DEFAULT NULL, PRIMARY KEY (pk), KEY col_varchar_1024_latin1_key (col_varchar_1024_latin1_key) ) ENGINE=Aria; -Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes INSERT INTO t1 VALUES (1,'z'), (2,'abcdefjhjkl'), (3,'in'), (4,'abcdefjhjkl'), (6,'abcdefjhjkl'), (11,'zx'), (12,'abcdefjhjm'), (13,'jn'), (14,'abcdefjhjp'), (16,'abcdefjhjr'); @@ -407,7 +405,7 @@ WHERE table1.col_varchar_1024_latin1_key = table2.col_varchar_10_latin1 AND table1.pk<>0 ; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE table2 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1003 test.table2.col_varchar_10_latin1 2 Using where +1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1027 test.table2.col_varchar_10_latin1 2 Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan SELECT count(*) FROM t1 AS table1, t2 AS table2 WHERE @@ -425,12 +423,12 @@ set join_buffer_size=10240; CREATE TABLE t1 ( f2 varchar(32) COLLATE latin1_swedish_ci, f3 int(11), -f4 varchar(1024) COLLATE utf8_bin, -f5 varchar(1024) COLLATE latin1_bin, +f4 varchar(2048) COLLATE utf8_bin, +f5 varchar(2048) COLLATE latin1_bin, KEY (f5) ) ENGINE=Aria TRANSACTIONAL=0 ; Warnings: -Note 1071 Specified key was too long; max key length is 1000 bytes +Note 1071 Specified key was too long; max key length is 2000 bytes # Fill the table with some data SELECT alias2.* , alias1.f2 FROM diff --git a/mysql-test/suite/maria/mrr.test b/mysql-test/suite/maria/mrr.test index 6c6a8c4e7b6..45d75a9d795 100644 --- a/mysql-test/suite/maria/mrr.test +++ b/mysql-test/suite/maria/mrr.test @@ -12,11 +12,11 @@ set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; set @mrr_buffer_size_save= @@mrr_buffer_size; -set @save_storage_engine= @@storage_engine; -set storage_engine=aria; +set @save_storage_engine= @@default_storage_engine; +set default_storage_engine=aria; --source include/mrr_tests.inc -set storage_engine= @save_storage_engine; +set default_storage_engine= @save_storage_engine; set @@mrr_buffer_size= @mrr_buffer_size_save; @@ -144,8 +144,8 @@ set join_buffer_size=10240; CREATE TABLE t1 ( f2 varchar(32) COLLATE latin1_swedish_ci, f3 int(11), - f4 varchar(1024) COLLATE utf8_bin, - f5 varchar(1024) COLLATE latin1_bin, + f4 varchar(2048) COLLATE utf8_bin, + f5 varchar(2048) COLLATE latin1_bin, KEY (f5) ) ENGINE=Aria TRANSACTIONAL=0 ; diff --git a/mysql-test/suite/maria/rollback.result b/mysql-test/suite/maria/rollback.result new file mode 100644 index 00000000000..fd2e012805a --- /dev/null +++ b/mysql-test/suite/maria/rollback.result @@ -0,0 +1,186 @@ +call mtr.add_suppression("Table '.*' is marked as crashed and should be repaired"); +call mtr.add_suppression("Checking table: .*"); +create table t1 (a int primary key auto_increment, b int) engine=aria transactional= 1; +create table t2 (a int primary key auto_increment, b int) engine=aria transactional= 0; +create sequence s1 cache=2 engine=aria; +insert into t1 (b) values (1),(2),(3),(4); +insert into t2 (b) values (1),(2),(3),(4); +select NEXT VALUE for s1,seq from seq_1_to_4; +NEXT VALUE for s1 seq +1 1 +2 2 +3 3 +4 4 +begin; +insert into t1 (b) values (5),(6); +insert into t1 (b) values (7),(8); +insert into t2 (b) values (5),(6); +insert into t2 (b) values (7),(8); +commit; +begin; +insert into t1 (b) values (10),(11),(12); +update t1 set b=100 where a=2; +delete from t1 where a between 3 and 4; +insert into t2 (b) values (10),(11),(12); +update t2 set b=100 where a=2; +delete from t2 where a between 3 and 4; +select NEXT VALUE for s1,seq from seq_1_to_4; +NEXT VALUE for s1 seq +5 1 +6 2 +7 3 +8 4 +# Kill and restart +select * from t1 order by a; +a b +1 1 +2 100 +5 5 +6 6 +7 7 +8 8 +9 10 +10 11 +11 12 +select * from t2 order by a; +a b +1 1 +2 100 +5 5 +6 6 +7 7 +8 8 +9 10 +10 11 +11 12 +Warnings: +Error 145 Table './test/t2' is marked as crashed and should be repaired +Warning 1034 1 client is using or hasn't closed the table properly +Note 1034 Table is fixed +insert into t1 (b) values (100),(200); +insert into t2 (b) values (100),(200); +select * from t1 order by a; +a b +1 1 +2 100 +5 5 +6 6 +7 7 +8 8 +9 10 +10 11 +11 12 +12 100 +13 200 +select * from t2 order by a; +a b +1 1 +2 100 +5 5 +6 6 +7 7 +8 8 +9 10 +10 11 +11 12 +12 100 +13 200 +select NEXT VALUE for s1,seq from seq_1_to_4; +NEXT VALUE for s1 seq +9 1 +10 2 +11 3 +12 4 +Warnings: +Error 145 Table './test/s1' is marked as crashed and should be repaired +Warning 1034 1 client is using or hasn't closed the table properly +Note 1034 Table is fixed +drop table t1,t2; +drop sequence s1; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Table \'.*\' is marked as crashed and should be repaired' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Checking table: .*' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (a int primary key auto_increment, b int) engine=aria transactional= 1 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t2 (a int primary key auto_increment, b int) engine=aria transactional= 0 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create sequence s1 cache=2 engine=aria +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t1 (b) values (1),(2),(3),(4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=1 +master-bin.000001 # Query # # use `test`; insert into t2 (b) values (1),(2),(3),(4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # select NEXT VALUE for s1,seq from seq_1_to_4 +master-bin.000001 # Table_map # # table_id: # (test.s1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t1 (b) values (5),(6) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=7 +master-bin.000001 # Query # # use `test`; insert into t1 (b) values (7),(8) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t2 (b) values (5),(6) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=7 +master-bin.000001 # Query # # use `test`; insert into t2 (b) values (7),(8) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=9 +master-bin.000001 # Query # # use `test`; insert into t1 (b) values (10),(11),(12) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; update t1 set b=100 where a=2 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; delete from t1 where a between 3 and 4 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Intvar # # INSERT_ID=9 +master-bin.000001 # Query # # use `test`; insert into t2 (b) values (10),(11),(12) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; update t2 set b=100 where a=2 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; delete from t2 where a between 3 and 4 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Annotate_rows # # select NEXT VALUE for s1,seq from seq_1_to_4 +master-bin.000001 # Table_map # # table_id: # (test.s1) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Intvar # # INSERT_ID=12 +master-bin.000002 # Query # # use `test`; insert into t1 (b) values (100),(200) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Intvar # # INSERT_ID=12 +master-bin.000002 # Query # # use `test`; insert into t2 (b) values (100),(200) +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows # # select NEXT VALUE for s1,seq from seq_1_to_4 +master-bin.000002 # Table_map # # table_id: # (test.s1) +master-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000002 # Query # # COMMIT +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; DROP TABLE `t1`,`t2` /* generated by server */ +master-bin.000002 # Gtid # # GTID #-#-# +master-bin.000002 # Query # # use `test`; DROP SEQUENCE `s1` /* generated by server */ diff --git a/mysql-test/suite/maria/rollback.test b/mysql-test/suite/maria/rollback.test new file mode 100644 index 00000000000..40a96b9b05b --- /dev/null +++ b/mysql-test/suite/maria/rollback.test @@ -0,0 +1,51 @@ +--source include/have_binlog_format_mixed_or_statement.inc +--source include/have_sequence.inc +# no-protocol doesn't print warnings about repaired tables +--source include/no_protocol.inc + +call mtr.add_suppression("Table '.*' is marked as crashed and should be repaired"); +call mtr.add_suppression("Checking table: .*"); + +# +# Testing rollback after crash +# + +create table t1 (a int primary key auto_increment, b int) engine=aria transactional= 1; +create table t2 (a int primary key auto_increment, b int) engine=aria transactional= 0; +create sequence s1 cache=2 engine=aria; + +insert into t1 (b) values (1),(2),(3),(4); +insert into t2 (b) values (1),(2),(3),(4); +select NEXT VALUE for s1,seq from seq_1_to_4; + +begin; +insert into t1 (b) values (5),(6); +insert into t1 (b) values (7),(8); +insert into t2 (b) values (5),(6); +insert into t2 (b) values (7),(8); +commit; +begin; +insert into t1 (b) values (10),(11),(12); +update t1 set b=100 where a=2; +delete from t1 where a between 3 and 4; + +insert into t2 (b) values (10),(11),(12); +update t2 set b=100 where a=2; +delete from t2 where a between 3 and 4; +select NEXT VALUE for s1,seq from seq_1_to_4; + +--source include/kill_and_restart_mysqld.inc + +select * from t1 order by a; +select * from t2 order by a; +insert into t1 (b) values (100),(200); +insert into t2 (b) values (100),(200); +select * from t1 order by a; +select * from t2 order by a; +select NEXT VALUE for s1,seq from seq_1_to_4; +drop table t1,t2; +drop sequence s1; + +source include/show_binlog_events.inc; +--let $binlog_file=master-bin.000002 +source include/show_binlog_events.inc; diff --git a/mysql-test/suite/maria/transaction.result b/mysql-test/suite/maria/transaction.result new file mode 100644 index 00000000000..369d3728839 --- /dev/null +++ b/mysql-test/suite/maria/transaction.result @@ -0,0 +1,19 @@ +connect con1, localhost, root,,; +connection default; +CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) +ENGINE = aria; +START TRANSACTION; +INSERT INTO t1 (c1) VALUES (2); +INSERT INTO t1 (c1) VALUES (4); +connection con1; +START TRANSACTION; +select * from t1; +c1 +2 +4 +select * from t1 where c1=2; +c1 +2 +disconnect con1; +connection default; +drop table t1; diff --git a/mysql-test/suite/maria/transaction.test b/mysql-test/suite/maria/transaction.test new file mode 100644 index 00000000000..6cf4590cdbd --- /dev/null +++ b/mysql-test/suite/maria/transaction.test @@ -0,0 +1,26 @@ +# +# Test that checks transactions and MVCC +# + +# +# This is a taken from parts.partition_auto_increment_maria. It originally +# crashde because con1 could read the first record from t1, which confused +# the optimizer. +# + +connect(con1, localhost, root,,); +connection default; +CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) + ENGINE = aria; +START TRANSACTION; +INSERT INTO t1 (c1) VALUES (2); +INSERT INTO t1 (c1) VALUES (4); +connection con1; +START TRANSACTION; +# When Aria proparly supports MVCC, the following two queries will not see +# any rows +select * from t1; +select * from t1 where c1=2; +disconnect con1; +connection default; +drop table t1; |