From 7826b9b983e8cc15becbc1ad8dc672c0f088a3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 28 Nov 2018 11:53:40 +0200 Subject: Fix syntax error on galera/disabled.def file --- mysql-test/suite/galera/disabled.def | 2 -- 1 file changed, 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 9eead53c82b..9ddb96e5525 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -41,8 +41,6 @@ galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion galera_wan : MDEV-17259: Test failure on galera.galera_wan galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb -galera_drop_database : test -galera_ist_innodb_flush_logs galera.MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C] -- cgit v1.2.1 From 3e5162d814c522da6b0f19c3f6baae1ab5035db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 30 Nov 2018 15:54:21 +0200 Subject: Re-disable a failing test --- mysql-test/suite/galera/disabled.def | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 9ddb96e5525..c5fa1491d34 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -29,6 +29,7 @@ MW-416 : MDEV-13549 Galera test failures MW-388 : MDEV-13549 Galera test failures galera.MW-44 : MDEV-15809 Test failure on galera.MW-44 galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb +galera_drop_database : MDEV-17421 mtr does not restart the server whose parameters were changed galera_kill_applier : race condition at the start of the test galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status pxc-421: Lock timeout exceeded -- cgit v1.2.1 From 46960365b102b1b446c300ed4da606e63ddfab5d Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sat, 1 Dec 2018 15:06:04 -0800 Subject: MDEV-17871 Crash when running explain with CTE When the with clause of a query contains a recursive CTE that is not used then processing of EXPLAIN for this query does not require optimization of the unit specifying this CTE. In this case if 'derived' is the TABLE_LIST object created for this CTE then derived->derived_result is NULL and any assignment to derived->derived_result->table causes a crash. After fixing this problem in the code of st_select_lex_unit::prepare() EXPLAIN for such a query worked without crashes. Yet an execution plan for the recursive CTE appeared there. The cause of this problem was an incorrect condition used in JOIN::save_explain_data_intern() that determined whether CTE was to be optimized or not. A similar condition was used in select_describe() and this patch has corrected it as well. --- mysql-test/r/cte_recursive.result | 48 +++++++++++++++++++++++++++++++++++++++ mysql-test/t/cte_recursive.test | 39 +++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 78530261efc..667b8c4289d 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -3600,3 +3600,51 @@ Mandelbrot Set .............................................................................. ........................................................................... ........................................................................ +# +# MDEV-17871: EXPLAIN for query with not used recursive cte +# +create table t1 (a int); +insert into t1 values (2), (1), (4), (3); +explain extended +with recursive cte as +(select * from t1 where a=1 union select a+1 from cte where a<3) +select * from cte as t; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY ALL NULL NULL NULL NULL 4 100.00 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 100.00 Using where +3 RECURSIVE UNION ALL NULL NULL NULL NULL 4 100.00 Using where +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 with recursive cte as (select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 union select `cte`.`a` + 1 AS `a+1` from `cte` where `cte`.`a` < 3)select `t`.`a` AS `a` from `cte` `t` +with recursive cte as +(select * from t1 where a=1 union select a+1 from cte where a<3) +select * from cte as t; +a +1 +2 +3 +explain extended +with recursive cte as +(select * from t1 where a=1 union select a+1 from cte where a<3) +select * from t1 as t; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t ALL NULL NULL NULL NULL 4 100.00 +Warnings: +Note 1003 with recursive cte as (select `*` AS `*` from `test`.`t1` where `a` = 1 union select `a` + 1 AS `a+1` from `cte` where `a` < 3)select `test`.`t`.`a` AS `a` from `test`.`t1` `t` +with recursive cte as +(select * from t1 where a=1 union select a+1 from cte where a<3) +select * from t1 as t; +a +2 +1 +4 +3 +create table t2 ( i1 int, i2 int); +insert into t2 values (1,1),(2,2); +explain +with recursive cte as +( select * from t1 union select s1.* from t1 as s1, cte where s1.i1 = cte.i2 ) +select * from t1 as t; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t ALL NULL NULL NULL NULL 4 +drop table t1,t2; diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index 3c5bc62ae1a..0923ca3fdd1 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -2495,3 +2495,42 @@ SELECT GROUP_CONCAT( FROM Zt GROUP BY Iy ORDER BY Iy; + +--echo # +--echo # MDEV-17871: EXPLAIN for query with not used recursive cte +--echo # + +create table t1 (a int); +insert into t1 values (2), (1), (4), (3); + +let $rec_cte = +with recursive cte as + (select * from t1 where a=1 union select a+1 from cte where a<3); + +eval +explain extended +$rec_cte +select * from cte as t; + +eval +$rec_cte +select * from cte as t; + +eval +explain extended +$rec_cte +select * from t1 as t; + +eval +$rec_cte +select * from t1 as t; + +create table t2 ( i1 int, i2 int); +insert into t2 values (1,1),(2,2); + +explain +with recursive cte as + ( select * from t1 union select s1.* from t1 as s1, cte where s1.i1 = cte.i2 ) +select * from t1 as t; + +drop table t1,t2; -- cgit v1.2.1 From f2c7972a3da51acd0e869878c0950d546d29a6e9 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 3 Dec 2018 01:12:04 +0530 Subject: MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY - This is a regression of commit b26e603aebc0c375751cc1d08029b3fb603a0373. While dropping the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one. --- mysql-test/suite/innodb/t/table_flags.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test index 07fe39664f2..69f5d00693b 100644 --- a/mysql-test/suite/innodb/t/table_flags.test +++ b/mysql-test/suite/innodb/t/table_flags.test @@ -207,3 +207,9 @@ DROP TABLE tr,tc,td,tz,tp; --list_files $bugdir --remove_files_wildcard $bugdir --rmdir $bugdir + +call mtr.add_suppression("ERROR HY000: Can't create table `test`.`t1`"); +--error ER_CANT_CREATE_TABLE +CREATE TABLE t1(f1 INT, f2 VARCHAR(1), KEY k1(f2), + FULLTEXT KEY(f2), + FOREIGN KEY (f2) REFERENCES t1(f3))ENGINE=InnoDB; -- cgit v1.2.1 From 157d3c3bc109bf13c433d9d150ea0c47291ade0d Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 3 Dec 2018 15:57:21 +0530 Subject: MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY - Fixed innodb.table_flags test case in release build. --- mysql-test/suite/innodb/r/table_flags.result | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result index 3684242f765..ab665d46cac 100644 --- a/mysql-test/suite/innodb/r/table_flags.result +++ b/mysql-test/suite/innodb/r/table_flags.result @@ -185,3 +185,8 @@ ib_logfile0 ib_logfile1 ibdata1 sys_tables.bin +call mtr.add_suppression("ERROR HY000: Can't create table `test`.`t1`"); +CREATE TABLE t1(f1 INT, f2 VARCHAR(1), KEY k1(f2), +FULLTEXT KEY(f2), +FOREIGN KEY (f2) REFERENCES t1(f3))ENGINE=InnoDB; +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") -- cgit v1.2.1