diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 09:05:52 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 09:05:52 +0300 |
commit | acf6f92aa936fbfe7524617ae57d011ab8f1f96d (patch) | |
tree | e7fc2258c06a0fdab1cce115de4d71a091d82d28 /mysql-test/suite | |
parent | 765ae6e82165d1bc4cf6cc9f0d556d66a5e172d1 (diff) | |
parent | bc145193c164b895a52b943e73fff53952d48a60 (diff) | |
download | mariadb-git-acf6f92aa936fbfe7524617ae57d011ab8f1f96d.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/archive/archive_eits.result | 24 | ||||
-rw-r--r-- | mysql-test/suite/archive/archive_eits.test | 32 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/foreign_key.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/xa_debug.result | 361 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/foreign_key.test | 10 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/xa_debug.test | 45 |
6 files changed, 480 insertions, 2 deletions
diff --git a/mysql-test/suite/archive/archive_eits.result b/mysql-test/suite/archive/archive_eits.result new file mode 100644 index 00000000000..e077c2e4954 --- /dev/null +++ b/mysql-test/suite/archive/archive_eits.result @@ -0,0 +1,24 @@ +drop table if exists t1; +# +# MDEV-17297: stats.records=0 for a table of Archive engine when it has rows, when we run ANALYZE command +# +CREATE TABLE t1 (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; +INSERT INTO t1 VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +set @tmp1= @@optimizer_use_condition_selectivity; +set @tmp2= @@use_stat_tables; +set optimizer_use_condition_selectivity=4; +set use_stat_tables=PREFERABLY; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze note The storage engine for the table doesn't support analyze +select * from mysql.table_stats where table_name='t1' and db_name=database(); +db_name table_name cardinality +test t1 4 +drop table t1; +set optimizer_use_condition_selectivity=@tmp1; +set use_stat_tables=@tmp2; diff --git a/mysql-test/suite/archive/archive_eits.test b/mysql-test/suite/archive/archive_eits.test new file mode 100644 index 00000000000..04c4ccdb709 --- /dev/null +++ b/mysql-test/suite/archive/archive_eits.test @@ -0,0 +1,32 @@ +-- source include/have_archive.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +--echo # +--echo # MDEV-17297: stats.records=0 for a table of Archive engine when it has rows, when we run ANALYZE command +--echo # + +CREATE TABLE t1 (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; +INSERT INTO t1 VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); + +set @tmp1= @@optimizer_use_condition_selectivity; +set @tmp2= @@use_stat_tables; + +set optimizer_use_condition_selectivity=4; +set use_stat_tables=PREFERABLY; +ANALYZE TABLE t1; + +select * from mysql.table_stats where table_name='t1' and db_name=database(); + +drop table t1; + +set optimizer_use_condition_selectivity=@tmp1; +set use_stat_tables=@tmp2; + + diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 75197099c11..397b4f9304c 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -261,10 +261,18 @@ ALTER IGNORE TABLE t1 ADD FOREIGN KEY (a) REFERENCES t2 (b); ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") SHOW WARNINGS; Level Code Message -Warning 150 Alter table test/#sql-temporary with foreign key constraint failed. Referenced table `test`.`t2` not found in the data dictionary near 'FOREIGN KEY (a) REFERENCES t2 (b)'. +Warning 150 Alter table `test`.`t1` with foreign key constraint failed. Referenced table `test`.`t2` not found in the data dictionary near 'FOREIGN KEY (a) REFERENCES t2 (b)'. Error 1005 Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") Warning 1215 Cannot add foreign key constraint for `t1` DROP TABLE t1; +# +# MDEV-18139 ALTER IGNORE ... ADD FOREIGN KEY causes bogus error +# +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, KEY(f1)) ENGINE=InnoDB; +CREATE TABLE t2 (f INT, KEY(f)) ENGINE=InnoDB; +ALTER TABLE t1 ADD FOREIGN KEY (f2) REFERENCES t2 (f); +ALTER IGNORE TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f1); +DROP TABLE t1, t2; # Start of 10.2 tests # # MDEV-13246 Stale rows despite ON DELETE CASCADE constraint diff --git a/mysql-test/suite/innodb/r/xa_debug.result b/mysql-test/suite/innodb/r/xa_debug.result new file mode 100644 index 00000000000..902166f51c8 --- /dev/null +++ b/mysql-test/suite/innodb/r/xa_debug.result @@ -0,0 +1,361 @@ +call mtr.add_suppression("Found 50 prepared XA transactions"); +create table t1 (a int) engine=innodb; +insert into t1 values(1); +connect con$trial, localhost, root,,; +xa start 'test50'; +insert into t1 values(1); +xa end 'test50'; +xa prepare 'test50'; +connect con$trial, localhost, root,,; +xa start 'test49'; +insert into t1 values(1); +xa end 'test49'; +xa prepare 'test49'; +connect con$trial, localhost, root,,; +xa start 'test48'; +insert into t1 values(1); +xa end 'test48'; +xa prepare 'test48'; +connect con$trial, localhost, root,,; +xa start 'test47'; +insert into t1 values(1); +xa end 'test47'; +xa prepare 'test47'; +connect con$trial, localhost, root,,; +xa start 'test46'; +insert into t1 values(1); +xa end 'test46'; +xa prepare 'test46'; +connect con$trial, localhost, root,,; +xa start 'test45'; +insert into t1 values(1); +xa end 'test45'; +xa prepare 'test45'; +connect con$trial, localhost, root,,; +xa start 'test44'; +insert into t1 values(1); +xa end 'test44'; +xa prepare 'test44'; +connect con$trial, localhost, root,,; +xa start 'test43'; +insert into t1 values(1); +xa end 'test43'; +xa prepare 'test43'; +connect con$trial, localhost, root,,; +xa start 'test42'; +insert into t1 values(1); +xa end 'test42'; +xa prepare 'test42'; +connect con$trial, localhost, root,,; +xa start 'test41'; +insert into t1 values(1); +xa end 'test41'; +xa prepare 'test41'; +connect con$trial, localhost, root,,; +xa start 'test40'; +insert into t1 values(1); +xa end 'test40'; +xa prepare 'test40'; +connect con$trial, localhost, root,,; +xa start 'test39'; +insert into t1 values(1); +xa end 'test39'; +xa prepare 'test39'; +connect con$trial, localhost, root,,; +xa start 'test38'; +insert into t1 values(1); +xa end 'test38'; +xa prepare 'test38'; +connect con$trial, localhost, root,,; +xa start 'test37'; +insert into t1 values(1); +xa end 'test37'; +xa prepare 'test37'; +connect con$trial, localhost, root,,; +xa start 'test36'; +insert into t1 values(1); +xa end 'test36'; +xa prepare 'test36'; +connect con$trial, localhost, root,,; +xa start 'test35'; +insert into t1 values(1); +xa end 'test35'; +xa prepare 'test35'; +connect con$trial, localhost, root,,; +xa start 'test34'; +insert into t1 values(1); +xa end 'test34'; +xa prepare 'test34'; +connect con$trial, localhost, root,,; +xa start 'test33'; +insert into t1 values(1); +xa end 'test33'; +xa prepare 'test33'; +connect con$trial, localhost, root,,; +xa start 'test32'; +insert into t1 values(1); +xa end 'test32'; +xa prepare 'test32'; +connect con$trial, localhost, root,,; +xa start 'test31'; +insert into t1 values(1); +xa end 'test31'; +xa prepare 'test31'; +connect con$trial, localhost, root,,; +xa start 'test30'; +insert into t1 values(1); +xa end 'test30'; +xa prepare 'test30'; +connect con$trial, localhost, root,,; +xa start 'test29'; +insert into t1 values(1); +xa end 'test29'; +xa prepare 'test29'; +connect con$trial, localhost, root,,; +xa start 'test28'; +insert into t1 values(1); +xa end 'test28'; +xa prepare 'test28'; +connect con$trial, localhost, root,,; +xa start 'test27'; +insert into t1 values(1); +xa end 'test27'; +xa prepare 'test27'; +connect con$trial, localhost, root,,; +xa start 'test26'; +insert into t1 values(1); +xa end 'test26'; +xa prepare 'test26'; +connect con$trial, localhost, root,,; +xa start 'test25'; +insert into t1 values(1); +xa end 'test25'; +xa prepare 'test25'; +connect con$trial, localhost, root,,; +xa start 'test24'; +insert into t1 values(1); +xa end 'test24'; +xa prepare 'test24'; +connect con$trial, localhost, root,,; +xa start 'test23'; +insert into t1 values(1); +xa end 'test23'; +xa prepare 'test23'; +connect con$trial, localhost, root,,; +xa start 'test22'; +insert into t1 values(1); +xa end 'test22'; +xa prepare 'test22'; +connect con$trial, localhost, root,,; +xa start 'test21'; +insert into t1 values(1); +xa end 'test21'; +xa prepare 'test21'; +connect con$trial, localhost, root,,; +xa start 'test20'; +insert into t1 values(1); +xa end 'test20'; +xa prepare 'test20'; +connect con$trial, localhost, root,,; +xa start 'test19'; +insert into t1 values(1); +xa end 'test19'; +xa prepare 'test19'; +connect con$trial, localhost, root,,; +xa start 'test18'; +insert into t1 values(1); +xa end 'test18'; +xa prepare 'test18'; +connect con$trial, localhost, root,,; +xa start 'test17'; +insert into t1 values(1); +xa end 'test17'; +xa prepare 'test17'; +connect con$trial, localhost, root,,; +xa start 'test16'; +insert into t1 values(1); +xa end 'test16'; +xa prepare 'test16'; +connect con$trial, localhost, root,,; +xa start 'test15'; +insert into t1 values(1); +xa end 'test15'; +xa prepare 'test15'; +connect con$trial, localhost, root,,; +xa start 'test14'; +insert into t1 values(1); +xa end 'test14'; +xa prepare 'test14'; +connect con$trial, localhost, root,,; +xa start 'test13'; +insert into t1 values(1); +xa end 'test13'; +xa prepare 'test13'; +connect con$trial, localhost, root,,; +xa start 'test12'; +insert into t1 values(1); +xa end 'test12'; +xa prepare 'test12'; +connect con$trial, localhost, root,,; +xa start 'test11'; +insert into t1 values(1); +xa end 'test11'; +xa prepare 'test11'; +connect con$trial, localhost, root,,; +xa start 'test10'; +insert into t1 values(1); +xa end 'test10'; +xa prepare 'test10'; +connect con$trial, localhost, root,,; +xa start 'test9'; +insert into t1 values(1); +xa end 'test9'; +xa prepare 'test9'; +connect con$trial, localhost, root,,; +xa start 'test8'; +insert into t1 values(1); +xa end 'test8'; +xa prepare 'test8'; +connect con$trial, localhost, root,,; +xa start 'test7'; +insert into t1 values(1); +xa end 'test7'; +xa prepare 'test7'; +connect con$trial, localhost, root,,; +xa start 'test6'; +insert into t1 values(1); +xa end 'test6'; +xa prepare 'test6'; +connect con$trial, localhost, root,,; +xa start 'test5'; +insert into t1 values(1); +xa end 'test5'; +xa prepare 'test5'; +connect con$trial, localhost, root,,; +xa start 'test4'; +insert into t1 values(1); +xa end 'test4'; +xa prepare 'test4'; +connect con$trial, localhost, root,,; +xa start 'test3'; +insert into t1 values(1); +xa end 'test3'; +xa prepare 'test3'; +connect con$trial, localhost, root,,; +xa start 'test2'; +insert into t1 values(1); +xa end 'test2'; +xa prepare 'test2'; +connect con$trial, localhost, root,,; +xa start 'test1'; +insert into t1 values(1); +xa end 'test1'; +xa prepare 'test1'; +connection default; +xa recover; +formatID gtrid_length bqual_length data +1 5 0 test1 +1 5 0 test2 +1 5 0 test3 +1 5 0 test4 +1 5 0 test5 +1 5 0 test6 +1 5 0 test7 +1 5 0 test8 +1 5 0 test9 +1 6 0 test10 +1 6 0 test11 +1 6 0 test12 +1 6 0 test13 +1 6 0 test14 +1 6 0 test15 +1 6 0 test16 +1 6 0 test17 +1 6 0 test18 +1 6 0 test19 +1 6 0 test20 +1 6 0 test21 +1 6 0 test22 +1 6 0 test23 +1 6 0 test24 +1 6 0 test25 +1 6 0 test26 +1 6 0 test27 +1 6 0 test28 +1 6 0 test29 +1 6 0 test30 +1 6 0 test31 +1 6 0 test32 +1 6 0 test33 +1 6 0 test34 +1 6 0 test35 +1 6 0 test36 +1 6 0 test37 +1 6 0 test38 +1 6 0 test39 +1 6 0 test40 +1 6 0 test41 +1 6 0 test42 +1 6 0 test43 +1 6 0 test44 +1 6 0 test45 +1 6 0 test46 +1 6 0 test47 +1 6 0 test48 +1 6 0 test49 +1 6 0 test50 +xa recover; +formatID gtrid_length bqual_length data +1 5 0 test1 +1 5 0 test2 +1 5 0 test3 +1 5 0 test4 +1 5 0 test5 +1 5 0 test6 +1 5 0 test7 +1 5 0 test8 +1 5 0 test9 +1 6 0 test10 +1 6 0 test11 +1 6 0 test12 +1 6 0 test13 +1 6 0 test14 +1 6 0 test15 +1 6 0 test16 +1 6 0 test17 +1 6 0 test18 +1 6 0 test19 +1 6 0 test20 +1 6 0 test21 +1 6 0 test22 +1 6 0 test23 +1 6 0 test24 +1 6 0 test25 +1 6 0 test26 +1 6 0 test27 +1 6 0 test28 +1 6 0 test29 +1 6 0 test30 +1 6 0 test31 +1 6 0 test32 +1 6 0 test33 +1 6 0 test34 +1 6 0 test35 +1 6 0 test36 +1 6 0 test37 +1 6 0 test38 +1 6 0 test39 +1 6 0 test40 +1 6 0 test41 +1 6 0 test42 +1 6 0 test43 +1 6 0 test44 +1 6 0 test45 +1 6 0 test46 +1 6 0 test47 +1 6 0 test48 +1 6 0 test49 +1 6 0 test50 +xa recover; +formatID gtrid_length bqual_length data +drop table t1; diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index a4e045d4d5e..e7ba5530b19 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -244,10 +244,18 @@ DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=InnoDB; --error ER_CANT_CREATE_TABLE ALTER IGNORE TABLE t1 ADD FOREIGN KEY (a) REFERENCES t2 (b); ---replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/ SHOW WARNINGS; DROP TABLE t1; +--echo # +--echo # MDEV-18139 ALTER IGNORE ... ADD FOREIGN KEY causes bogus error +--echo # +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT, KEY(f1)) ENGINE=InnoDB; +CREATE TABLE t2 (f INT, KEY(f)) ENGINE=InnoDB; +ALTER TABLE t1 ADD FOREIGN KEY (f2) REFERENCES t2 (f); +ALTER IGNORE TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f1); +DROP TABLE t1, t2; + --echo # Start of 10.2 tests --echo # diff --git a/mysql-test/suite/innodb/t/xa_debug.test b/mysql-test/suite/innodb/t/xa_debug.test new file mode 100644 index 00000000000..5724891bb65 --- /dev/null +++ b/mysql-test/suite/innodb/t/xa_debug.test @@ -0,0 +1,45 @@ +-- source include/have_innodb.inc +-- source include/have_debug.inc +-- source include/not_embedded.inc + +call mtr.add_suppression("Found 50 prepared XA transactions"); +create table t1 (a int) engine=innodb; +insert into t1 values(1); + +let $trial = 50; +while ($trial) +{ +--connect (con$trial, localhost, root,,) +let $st_pre = `select concat('test', $trial)`; +eval xa start '$st_pre'; +insert into t1 values(1); +eval xa end '$st_pre'; +eval xa prepare '$st_pre'; +dec $trial; +} + +connection default; +# Kill and restart the server. +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- shutdown_server 0 +-- source include/wait_until_disconnected.inc + +-- exec echo "restart:--debug_dbug=+d,min_xa_len" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- enable_reconnect +-- source include/wait_until_connected_again.inc +-- disable_reconnect +--sorted_result +xa recover; +--sorted_result +xa recover; +--disable_query_log +let $trial = 50; +while ($trial) +{ +let $st_pre = `select concat('test', $trial)`; +eval xa commit '$st_pre'; +dec $trial; +} +--enable_query_log +xa recover; +drop table t1; |