From 874942a0f910731b54eb57aef01c1bef701ab6ba Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 5 Oct 2020 13:26:28 +1100 Subject: MDEV-4851: (tests) log tables modifiable on log_output!=TABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test we can ALTER log tables directly when not being written to. This removes the contraint in the rpl_mysql_upgrade.test such that we can run mysql_upgrade --write-binlog all the way through to a replica. We test this in the replication scenario where the mysql.{slow,general}_log tables aren't being written to. Reviewers: Vicențiu Ciorbaru, Anel Husakovic --- mysql-test/t/log_tables.test | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index f822ec8d758..0196e62f12f 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -58,7 +58,7 @@ select * from general_log where argument like '%general_log%'; # # Check some basic queries interfering with the log tables. -# In our test we'll use a tbale with verbose comments to the short +# In our test we'll use a table with verbose comments to the short # command type names, used in the tables # @@ -470,6 +470,24 @@ show tables like "%log%"; drop table slow_log_new, general_log_new; use test; +# +# Bug#69953 / MDEV-4851 +# Log tables should be modifable on LOG_OUTPUT != TABLE +# +# + +SET GLOBAL LOG_OUTPUT = 'FILE'; +SET GLOBAL slow_query_log = 1; +SET GLOBAL general_log = 1; + +ALTER TABLE mysql.slow_log ADD COLUMN comment_text TEXT NOT NULL; +ALTER TABLE mysql.general_log ADD COLUMN comment_text TEXT NOT NULL; + +SET GLOBAL LOG_OUTPUT = 'NONE'; +ALTER TABLE mysql.slow_log DROP COLUMN comment_text; +ALTER TABLE mysql.general_log DROP COLUMN comment_text; + + # # Bug#27857 (Log tables supplies the wrong value for generating # AUTO_INCREMENT numbers) -- cgit v1.2.1 From 3e807d255e0e667eec9791dd505a5be4bbfc6a25 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 9 Oct 2020 17:48:22 +0300 Subject: MDEV-23938: innodb row_search_idx_cond_check handle ICP_ABORTED_BY_USER - row_search_mvcc() should return DB_INTERRUPTED when it got killed. - Add a syncpoint for the ICP check. - Add test coverage for killed-during-ICP-check scenario Backport of MDEV-22761 fixes for ICP from 10.4 commits: * a6f956488c712bef3b13660584d1b905e0c676cc * c03885cd9ceb1ede7f49a9e218022b401b3a1e28 XtraDB was fixed in deb3b9a17498 Reviewer: Daniel Black --- mysql-test/t/aria_icp_debug.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/aria_icp_debug.test | 5 +++++ mysql-test/t/innodb_icp_debug.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/innodb_icp_debug.test | 6 ++++++ mysql-test/t/myisam_icp_debug.result | 32 ++++++++++++++++++++++++++++++++ mysql-test/t/myisam_icp_debug.test | 1 + 6 files changed, 112 insertions(+) create mode 100644 mysql-test/t/aria_icp_debug.result create mode 100644 mysql-test/t/aria_icp_debug.test create mode 100644 mysql-test/t/innodb_icp_debug.result create mode 100644 mysql-test/t/innodb_icp_debug.test create mode 100644 mysql-test/t/myisam_icp_debug.result create mode 100644 mysql-test/t/myisam_icp_debug.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/aria_icp_debug.result b/mysql-test/t/aria_icp_debug.result new file mode 100644 index 00000000000..fc01ee4fb3b --- /dev/null +++ b/mysql-test/t/aria_icp_debug.result @@ -0,0 +1,34 @@ +set default_storage_engine=aria; +drop table if exists t0,t1,t2; +create table t0(a int primary key); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int primary key); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 ( +kp1 int, +kp2 int, +col char(100), +key(kp1, kp2) +); +insert into t2 select a, a, a from t1; +select engine from information_schema.tables +where table_schema=database() and table_name='t2'; +engine +Aria +explain +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range kp1 kp1 5 NULL 10 Using index condition +set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go'; +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +connect con1, localhost, root,,; +connection con1; +set debug_sync='now WAIT_FOR at_icp_check'; +kill query $target_id; +set debug_sync='now SIGNAL go'; +connection default; +ERROR 70100: Query execution was interrupted +set debug_sync='RESET'; +disconnect con1; +drop table t0,t1,t2; +set default_storage_engine=default; diff --git a/mysql-test/t/aria_icp_debug.test b/mysql-test/t/aria_icp_debug.test new file mode 100644 index 00000000000..bbdd59d6012 --- /dev/null +++ b/mysql-test/t/aria_icp_debug.test @@ -0,0 +1,5 @@ + +set default_storage_engine=aria; +--source include/icp_debug_kill.inc +set default_storage_engine=default; + diff --git a/mysql-test/t/innodb_icp_debug.result b/mysql-test/t/innodb_icp_debug.result new file mode 100644 index 00000000000..5a169650c8e --- /dev/null +++ b/mysql-test/t/innodb_icp_debug.result @@ -0,0 +1,34 @@ +set default_storage_engine=innodb; +drop table if exists t0,t1,t2; +create table t0(a int primary key); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int primary key); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 ( +kp1 int, +kp2 int, +col char(100), +key(kp1, kp2) +); +insert into t2 select a, a, a from t1; +select engine from information_schema.tables +where table_schema=database() and table_name='t2'; +engine +InnoDB +explain +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range kp1 kp1 5 NULL 11 Using index condition +set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go'; +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +connect con1, localhost, root,,; +connection con1; +set debug_sync='now WAIT_FOR at_icp_check'; +kill query $target_id; +set debug_sync='now SIGNAL go'; +connection default; +ERROR 70100: Query execution was interrupted +set debug_sync='RESET'; +disconnect con1; +drop table t0,t1,t2; +set default_storage_engine=default; diff --git a/mysql-test/t/innodb_icp_debug.test b/mysql-test/t/innodb_icp_debug.test new file mode 100644 index 00000000000..4aa08c61e87 --- /dev/null +++ b/mysql-test/t/innodb_icp_debug.test @@ -0,0 +1,6 @@ +--source include/have_innodb.inc + +set default_storage_engine=innodb; +--source include/icp_debug_kill.inc +set default_storage_engine=default; + diff --git a/mysql-test/t/myisam_icp_debug.result b/mysql-test/t/myisam_icp_debug.result new file mode 100644 index 00000000000..cb45a0e2274 --- /dev/null +++ b/mysql-test/t/myisam_icp_debug.result @@ -0,0 +1,32 @@ +drop table if exists t0,t1,t2; +create table t0(a int primary key); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int primary key); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 ( +kp1 int, +kp2 int, +col char(100), +key(kp1, kp2) +); +insert into t2 select a, a, a from t1; +select engine from information_schema.tables +where table_schema=database() and table_name='t2'; +engine +MyISAM +explain +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range kp1 kp1 5 NULL 11 Using index condition +set debug_sync='handler_index_cond_check SIGNAL at_icp_check WAIT_FOR go'; +select * from t2 where kp1 between 10 and 20 and kp2 +1 >100; +connect con1, localhost, root,,; +connection con1; +set debug_sync='now WAIT_FOR at_icp_check'; +kill query $target_id; +set debug_sync='now SIGNAL go'; +connection default; +ERROR 70100: Query execution was interrupted +set debug_sync='RESET'; +disconnect con1; +drop table t0,t1,t2; diff --git a/mysql-test/t/myisam_icp_debug.test b/mysql-test/t/myisam_icp_debug.test new file mode 100644 index 00000000000..d5b1af799fa --- /dev/null +++ b/mysql-test/t/myisam_icp_debug.test @@ -0,0 +1 @@ +--source include/icp_debug_kill.inc -- cgit v1.2.1 From d36cd5f01ec322c4cdf2feda288c3932260c5c57 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Mon, 27 Jul 2020 02:51:33 +0530 Subject: MDEV-17729: Assertion `! is_set() || m_can_overwrite_status' failed in Diagnostics_area::set_error_status Analysis: When strict mode is enabled, all warnings are converted to errors including those which do not occur because of bad data. Fix: Query should not be aborted when we have warning because limit to examine rows was reached because it doesn't happen due to bad data. So thd->abort_on_warning should be false. --- mysql-test/t/limit_rows_examined.test | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/limit_rows_examined.test b/mysql-test/t/limit_rows_examined.test index 45ee483c7aa..346a0478891 100644 --- a/mysql-test/t/limit_rows_examined.test +++ b/mysql-test/t/limit_rows_examined.test @@ -576,3 +576,20 @@ EXECUTE ps; drop view v; drop table t1, t2; + +--echo # +--echo # 10.1 Test +--echo # +--echo # MDEV-17729: Assertion `! is_set() || m_can_overwrite_status' +--echo # failed in Diagnostics_area::set_error_status +--echo # +set @old_mode= @@sql_mode; + +CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,k INT, c CHAR(20)); +INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'); + +SET @@sql_mode='STRICT_TRANS_TABLES'; +INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2; + +SET @@sql_mode=@old_mode; +DROP TABLE t1; -- cgit v1.2.1 From 9fca6645f42a6322215de51d97c9237f4a28a2d1 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Thu, 17 Sep 2020 18:55:59 +0530 Subject: MDEV-5628: Assertion `! is_set()' or `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a partitioned table with subquery (MySQL:71630) Analysis and fix: Error is not checked. So correct error state is not returned. Fix: Check for error and return the error state. --- mysql-test/t/partition.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 23f3fa0b4d8..b82485dfc5c 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2998,6 +2998,22 @@ insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, ' select id from t1 where data = 'ab' order by id; drop table t1; +--echo # +--echo # MDEV-5628: Assertion `! is_set()' or `!is_set() || +--echo # (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a +--echo # partitioned table with subquery (MySQL:71630) +--echo # + +CREATE TABLE t1 (a INT) PARTITION BY HASH(a) PARTITIONS 2; + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (1),(2); + +--error ER_SUBQUERY_NO_1_ROW +UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6; + +DROP TABLE t1,t2; + --echo # --echo # End of 10.1 tests --echo # -- cgit v1.2.1