From fc1798785f4daf878e2c9f4c28ed35ca1af6dcba Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Mon, 17 Oct 2016 12:10:12 -0400 Subject: Adjust test to adapt to a recent change in mysqltest. --- mysql-test/suite/galera/t/galera_concurrent_ctas.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/t/galera_concurrent_ctas.test b/mysql-test/suite/galera/t/galera_concurrent_ctas.test index f0dcf8e4900..8b9b461d0fd 100644 --- a/mysql-test/suite/galera/t/galera_concurrent_ctas.test +++ b/mysql-test/suite/galera/t/galera_concurrent_ctas.test @@ -43,10 +43,10 @@ let $run=10; while($run) { --error 0,1 - exec $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_1 test - < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql & - $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_2 test - < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql; + exec $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_1 test \ + < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql & \ + $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_2 test \ + < $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql; dec $run; } -- cgit v1.2.1 From 72fd15f7c31aa3e3705ae1b005a3247a985c5bb3 Mon Sep 17 00:00:00 2001 From: SachinSetiya Date: Thu, 1 Dec 2016 12:16:13 +0530 Subject: MDEV-11016 wsrep_node_is_ready() check is too strict Problem:- The condition that checks for node readiness is too strict as it does not allow SELECTs even if these selects do not access any tables. For example,if we run SELECT 1; OR SELECT @@max_allowed_packet; Solution:- We need not to report this error when all_tables(lex->query_tables) is NULL: --- mysql-test/suite/galera/r/galera_var_dirty_reads.result | 13 +++++++++++++ mysql-test/suite/galera/t/galera_var_dirty_reads.test | 7 +++++++ 2 files changed, 20 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index 6d703c8cf95..6a2aa1eb5e7 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -18,6 +18,19 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; i 1 +SET @@session.wsrep_dirty_reads=OFF; +SELECT 2; +2 +2 +SELECT @@max_allowed_packet; +@@max_allowed_packet +4194304 +SELECT 2+2 from DUAL; +2+2 +4 +SELECT sysdate() from DUAL; +sysdate() +2016-10-28 23:13:06 SELECT * FROM t1; i 1 diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test index 9eea8efdaf3..dd7bc88cb1c 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -39,6 +39,13 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; +#Select query which does not access table should be allowed MDEV-11016 +SET @@session.wsrep_dirty_reads=OFF; +SELECT 2; +SELECT @@max_allowed_packet; +SELECT 2+2 from DUAL; +SELECT sysdate() from DUAL; + --disable_query_log --eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved' --enable_query_log -- cgit v1.2.1 From 313a14f79e6de43acd5c2ceffbcc01af2506d800 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 9 Dec 2016 12:24:08 -0500 Subject: Fix test failures. --- mysql-test/suite/galera/r/galera_var_dirty_reads.result | 15 +++++++++------ mysql-test/suite/galera/suite.pm | 1 + mysql-test/suite/galera/t/galera_var_dirty_reads.test | 12 +++++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index 6a2aa1eb5e7..c0ffb2d4860 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -18,19 +18,22 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; i 1 +# +# MDEV-11016: wsrep_node_is_ready() check is too strict +# SET @@session.wsrep_dirty_reads=OFF; SELECT 2; 2 2 -SELECT @@max_allowed_packet; -@@max_allowed_packet -4194304 SELECT 2+2 from DUAL; 2+2 4 -SELECT sysdate() from DUAL; -sysdate() -2016-10-28 23:13:06 +SET @VAR=1; +SELECT @VAR; +@VAR +1 +SELECT @@max_allowed_packet; +SELECT SYSDATE() from DUAL; SELECT * FROM t1; i 1 diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index fdaf64580c7..a790e951762 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -37,6 +37,7 @@ push @::global_suppressions, qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, qr|WSREP: no nodes coming from prim view, prim not possible|, qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.), + qr(WSREP: discarding established .*), ); diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test index dd7bc88cb1c..48fbe37139c 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -39,12 +39,18 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; -#Select query which does not access table should be allowed MDEV-11016 +--echo # +--echo # MDEV-11016: wsrep_node_is_ready() check is too strict +--echo # SET @@session.wsrep_dirty_reads=OFF; SELECT 2; -SELECT @@max_allowed_packet; SELECT 2+2 from DUAL; -SELECT sysdate() from DUAL; +SET @VAR=1; +SELECT @VAR; +--disable_result_log +SELECT @@max_allowed_packet; +SELECT SYSDATE() from DUAL; +--enable_result_log --disable_query_log --eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved' -- cgit v1.2.1 From 95422c445db7db60fca688711d98955e59e009e2 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Wed, 14 Dec 2016 15:58:14 +0530 Subject: Revert " MDEV-11016 wsrep_node_is_ready() check is too strict" This reverts commit 72fd15f7c31aa3e3705ae1b005a3247a985c5bb3. # Conflicts: # mysql-test/suite/galera/r/galera_var_dirty_reads.result # mysql-test/suite/galera/t/galera_var_dirty_reads.test --- mysql-test/suite/galera/r/galera_var_dirty_reads.result | 16 ---------------- mysql-test/suite/galera/t/galera_var_dirty_reads.test | 13 ------------- 2 files changed, 29 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index c0ffb2d4860..6d703c8cf95 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -18,22 +18,6 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; i 1 -# -# MDEV-11016: wsrep_node_is_ready() check is too strict -# -SET @@session.wsrep_dirty_reads=OFF; -SELECT 2; -2 -2 -SELECT 2+2 from DUAL; -2+2 -4 -SET @VAR=1; -SELECT @VAR; -@VAR -1 -SELECT @@max_allowed_packet; -SELECT SYSDATE() from DUAL; SELECT * FROM t1; i 1 diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test index 48fbe37139c..9eea8efdaf3 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -39,19 +39,6 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; ---echo # ---echo # MDEV-11016: wsrep_node_is_ready() check is too strict ---echo # -SET @@session.wsrep_dirty_reads=OFF; -SELECT 2; -SELECT 2+2 from DUAL; -SET @VAR=1; -SELECT @VAR; ---disable_result_log -SELECT @@max_allowed_packet; -SELECT SYSDATE() from DUAL; ---enable_result_log - --disable_query_log --eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved' --enable_query_log -- cgit v1.2.1 From 5ddd8149e44122feb0989b9944113d2b92d6f84a Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Wed, 14 Dec 2016 17:14:42 +0530 Subject: MDEV-11479 Improved wsrep_dirty_reads Tasks:- Changes in wsrep_dirty_reads variable 1.) Global + Session scope (Current: session-only) 2.) Can be set using command line. 3.) Allow all commands that do not change data (besides SELECT) 4.) Allow prepared Statements that do not change data 5.) Works with wsrep_sync_wait enabled --- mysql-test/r/mysqld--help.result | 3 + .../suite/galera/r/galera_var_dirty_reads.result | 70 ++++++++++++++++++++++ .../suite/galera/t/galera_var_dirty_reads.test | 68 +++++++++++++++++++++ .../sys_vars/r/wsrep_dirty_reads_basic.result | 23 ++++++- .../suite/sys_vars/t/wsrep_dirty_reads_basic.test | 17 +++++- 5 files changed, 177 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 61243e02363..34d4bae0f28 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -879,6 +879,8 @@ The following options may be given as the first argument: DBUG options to provider library --wsrep-debug To enable debug level logging --wsrep-desync To desynchronize the node from the cluster + --wsrep-dirty-reads Allow reads even when the node is not in the primary + component. --wsrep-drupal-282555-workaround To use a workaround forbad autoincrement value --wsrep-forced-binlog-format=name @@ -1201,6 +1203,7 @@ wsrep-convert-LOCK-to-trx FALSE wsrep-dbug-option wsrep-debug FALSE wsrep-desync FALSE +wsrep-dirty-reads FALSE wsrep-drupal-282555-workaround FALSE wsrep-forced-binlog-format NONE wsrep-load-data-splitting TRUE diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index 6d703c8cf95..8a3175912c7 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -3,6 +3,10 @@ INSERT INTO t1 VALUES(1); SELECT * FROM t1; i 1 +create user user1; +grant all privileges on *.* to user1; +create user user2; +grant all privileges on *.* to user2; SET @@global.wsrep_cluster_address = ''; SET @@session.wsrep_dirty_reads=OFF; SET SESSION wsrep_sync_wait=0; @@ -18,8 +22,74 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; i 1 +connect con1, localhost, user1,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2; +SET SESSION wsrep_sync_wait=0; +set session wsrep_dirty_reads=1; +prepare stmt_show from 'select 1'; +prepare stmt_select from 'select * from t1'; +prepare stmt_insert from 'insert into t1 values(1)'; +set session wsrep_dirty_reads=0; +execute stmt_show; +ERROR 08S01: WSREP has not yet prepared node for application use +execute stmt_select; +ERROR 08S01: WSREP has not yet prepared node for application use +execute stmt_insert; +ERROR 08S01: WSREP has not yet prepared node for application use +SET wsrep_dirty_reads=ON; +select @@session.wsrep_dirty_reads; +@@session.wsrep_dirty_reads +1 +execute stmt_show; +1 +1 +execute stmt_select; +i +1 +execute stmt_insert; +ERROR 08S01: WSREP has not yet prepared node for application use +SET @@global.wsrep_dirty_reads=ON; +connect con2, localhost, user2,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2; +select @@session.wsrep_dirty_reads; +@@session.wsrep_dirty_reads +1 +prepare stmt_show from 'select 1'; +prepare stmt_select from 'select * from t1'; +prepare stmt_insert from 'insert into t1 values(1)'; +execute stmt_show; +1 +1 +execute stmt_select; +i +1 +execute stmt_insert; +ERROR 08S01: WSREP has not yet prepared node for application use +SET SESSION wsrep_sync_wait=1; +execute stmt_show; +1 +1 +execute stmt_select; +i +1 +execute stmt_insert; +ERROR 08S01: WSREP has not yet prepared node for application use +SET SESSION wsrep_sync_wait=7; +execute stmt_show; +1 +1 +execute stmt_select; +i +1 +execute stmt_insert; +ERROR 08S01: WSREP has not yet prepared node for application use +connection node_2; +SET @@global.wsrep_dirty_reads=OFF; +connection node_1; SELECT * FROM t1; i 1 DROP TABLE t1; +drop user user1; +drop user user2; +disconnect node_2; +disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test index 9eea8efdaf3..8fd3b1d22f2 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -20,6 +20,11 @@ CREATE TABLE t1(i INT) ENGINE=INNODB; INSERT INTO t1 VALUES(1); SELECT * FROM t1; +create user user1; +grant all privileges on *.* to user1; +create user user2; +grant all privileges on *.* to user2; + SET @@global.wsrep_cluster_address = ''; SET @@session.wsrep_dirty_reads=OFF; @@ -39,6 +44,67 @@ SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; +--enable_connect_log +--connect (con1, localhost, user1,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2) +#Just test the session behavior +SET SESSION wsrep_sync_wait=0; + +set session wsrep_dirty_reads=1; +#Prepared statement creation should be allowed MDEV-11479 +prepare stmt_show from 'select 1'; +prepare stmt_select from 'select * from t1'; +prepare stmt_insert from 'insert into t1 values(1)'; +set session wsrep_dirty_reads=0; + +#No Preapare stmt/proceure will be allowed +--error ER_UNKNOWN_COM_ERROR +execute stmt_show; +--error ER_UNKNOWN_COM_ERROR +execute stmt_select; +--error ER_UNKNOWN_COM_ERROR +execute stmt_insert; + +SET wsrep_dirty_reads=ON; +select @@session.wsrep_dirty_reads; +#Only prepare statement which does not change data should be allowed +execute stmt_show; +execute stmt_select; +--error ER_UNKNOWN_COM_ERROR +execute stmt_insert; +SET @@global.wsrep_dirty_reads=ON; + +--connect (con2, localhost, user2,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2) +#Just test the session behavior +select @@session.wsrep_dirty_reads; + +prepare stmt_show from 'select 1'; +prepare stmt_select from 'select * from t1'; +prepare stmt_insert from 'insert into t1 values(1)'; + +#Only prepare statement which does not change data should be allowed +execute stmt_show; +execute stmt_select; +--error ER_UNKNOWN_COM_ERROR +execute stmt_insert; + +#wsrep_dirty_read should work when wsrep_sync_wait is 1 or non zero +#because we already are disconnected , So It does not make any sense +#to wait for other nodes +SET SESSION wsrep_sync_wait=1; +execute stmt_show; +execute stmt_select; +--error ER_UNKNOWN_COM_ERROR +execute stmt_insert; + +SET SESSION wsrep_sync_wait=7; +execute stmt_show; +execute stmt_select; +--error ER_UNKNOWN_COM_ERROR +execute stmt_insert; + +--connection node_2 +SET @@global.wsrep_dirty_reads=OFF; + --disable_query_log --eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved' --enable_query_log @@ -48,6 +114,8 @@ SELECT * FROM t1; SELECT * FROM t1; # Cleanup DROP TABLE t1; +drop user user1; +drop user user2; --disable_query_log # Restore original auto_increment_offset values. diff --git a/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result b/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result index d2a62d6136f..1968103873a 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result @@ -5,12 +5,13 @@ SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads; # default SELECT @@global.wsrep_dirty_reads; -ERROR HY000: Variable 'wsrep_dirty_reads' is a SESSION variable +@@global.wsrep_dirty_reads +0 SELECT @@session.wsrep_dirty_reads; @@session.wsrep_dirty_reads 0 -# scope and valid values +# valid values for session SET @@session.wsrep_dirty_reads=OFF; SELECT @@session.wsrep_dirty_reads; @@session.wsrep_dirty_reads @@ -24,11 +25,29 @@ SELECT @@session.wsrep_dirty_reads; @@session.wsrep_dirty_reads 0 +# valid values for global +SET @@global.wsrep_dirty_reads=OFF; +SELECT @@global.wsrep_dirty_reads; +@@global.wsrep_dirty_reads +0 +SET @@global.wsrep_dirty_reads=ON; +SELECT @@global.wsrep_dirty_reads; +@@global.wsrep_dirty_reads +1 +SET @@global.wsrep_dirty_reads=default; +SELECT @@global.wsrep_dirty_reads; +@@global.wsrep_dirty_reads +0 + # invalid values SET @@session.wsrep_dirty_reads=NULL; ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'NULL' SET @@session.wsrep_dirty_reads='junk'; ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'junk' +SET @@global.wsrep_dirty_reads=NULL; +ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'NULL' +SET @@global.wsrep_dirty_reads='junk'; +ERROR 42000: Variable 'wsrep_dirty_reads' can't be set to the value of 'junk' # restore the initial values SET @@session.wsrep_dirty_reads = @wsrep_dirty_reads_session_saved; diff --git a/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test b/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test index a47524fcfe3..ffe767a051b 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test @@ -8,12 +8,12 @@ SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads; --echo # default ---error ER_INCORRECT_GLOBAL_LOCAL_VAR + SELECT @@global.wsrep_dirty_reads; SELECT @@session.wsrep_dirty_reads; --echo ---echo # scope and valid values +--echo # valid values for session SET @@session.wsrep_dirty_reads=OFF; SELECT @@session.wsrep_dirty_reads; SET @@session.wsrep_dirty_reads=ON; @@ -21,12 +21,25 @@ SELECT @@session.wsrep_dirty_reads; SET @@session.wsrep_dirty_reads=default; SELECT @@session.wsrep_dirty_reads; +--echo +--echo # valid values for global +SET @@global.wsrep_dirty_reads=OFF; +SELECT @@global.wsrep_dirty_reads; +SET @@global.wsrep_dirty_reads=ON; +SELECT @@global.wsrep_dirty_reads; +SET @@global.wsrep_dirty_reads=default; +SELECT @@global.wsrep_dirty_reads; + --echo --echo # invalid values --error ER_WRONG_VALUE_FOR_VAR SET @@session.wsrep_dirty_reads=NULL; --error ER_WRONG_VALUE_FOR_VAR SET @@session.wsrep_dirty_reads='junk'; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_dirty_reads=NULL; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_dirty_reads='junk'; --echo --echo # restore the initial values -- cgit v1.2.1 From b0bae66b8ef95844b5d94a72c35d2a5fe6460275 Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Thu, 20 Apr 2017 18:33:20 +0530 Subject: FIX test failures --- mysql-test/suite/galera/disabled.def | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 mysql-test/suite/galera/disabled.def (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def new file mode 100644 index 00000000000..c91654c2023 --- /dev/null +++ b/mysql-test/suite/galera/disabled.def @@ -0,0 +1,2 @@ +galera_var_dirty_reads : MDEV-12539 +query_cache : MDEV-12539 -- cgit v1.2.1 From e5c488a49ba54aee596f4ff0080f3a855461b911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 21 Jul 2017 08:29:52 +0300 Subject: Fix failing test case. --- mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result index 1e7b9364570..0df3dff8990 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result @@ -34,11 +34,9 @@ SELECT @@session.wsrep_sync_wait; @@session.wsrep_sync_wait 7 SET @@session.wsrep_sync_wait=8; -Warnings: -Warning 1292 Truncated incorrect wsrep_sync_wait value: '8' SELECT @@session.wsrep_sync_wait; @@session.wsrep_sync_wait -7 +8 # invalid values SET @@global.wsrep_sync_wait=NULL; -- cgit v1.2.1 From 8822b30f1e258a5f0efc124043f42970e600c5d4 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Tue, 10 Oct 2017 23:39:48 +0300 Subject: MW-416 Replicating DDL after ACL check, 5.6 version Re-implemented the fix for MW-416 according to 5.7 version --- mysql-test/suite/galera/r/MW-416.result | 114 +++++++++++++++++++++++++++ mysql-test/suite/galera/t/MW-416.test | 132 ++++++++++++++++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 mysql-test/suite/galera/r/MW-416.result create mode 100644 mysql-test/suite/galera/t/MW-416.test (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result new file mode 100644 index 00000000000..05399b213a8 --- /dev/null +++ b/mysql-test/suite/galera/r/MW-416.result @@ -0,0 +1,114 @@ +CREATE USER 'userMW416'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost'; +SHOW GLOBAL STATUS LIKE 'wsrep_replicated'; +Variable_name Value +wsrep_replicated 2 +ALTER DATABASE db CHARACTER SET = utf8; +ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'db' +ALTER EVENT ev1 RENAME TO ev2; +ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test' +ALTER FUNCTION fun1 COMMENT 'foo'; +ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1' +ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; +Got one of the listed errors +ALTER PROCEDURE proc1 COMMENT 'foo'; +Got one of the listed errors +ALTER SERVER srv OPTIONS (USER 'sally'); +Got one of the listed errors +ALTER TABLE tbl DROP COLUMN col; +Got one of the listed errors +ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; +Got one of the listed errors +ALTER VIEW vw AS SELECT 1; +Got one of the listed errors +CREATE DATABASE db; +Got one of the listed errors +CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; +Got one of the listed errors +CREATE FUNCTION fun1() RETURNS int RETURN(1); +Got one of the listed errors +CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so'; +Got one of the listed errors +CREATE PROCEDURE proc1() BEGIN END; +Got one of the listed errors +CREATE INDEX idx ON tbl(id); +Got one of the listed errors +CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb; +Got one of the listed errors +CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user'); +Got one of the listed errors +CREATE TABLE t (i int); +Got one of the listed errors +CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb; +Got one of the listed errors +CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; +Got one of the listed errors +CREATE VIEW vw AS SELECT 1; +Got one of the listed errors +DROP DATABASE db; +Got one of the listed errors +DROP EVENT ev; +Got one of the listed errors +DROP FUNCTION fun1; +Got one of the listed errors +DROP INDEX idx ON t0; +Got one of the listed errors +DROP LOGFILE GROUP lfg; +Got one of the listed errors +DROP PROCEDURE proc1; +Got one of the listed errors +DROP SERVEr srv; +Got one of the listed errors +DROP TABLE t0; +Got one of the listed errors +DROP TABLESPACE tblspc; +Got one of the listed errors +DROP TRIGGER trg; +Got one of the listed errors +DROP VIEW vw; +Got one of the listed errors +RENAME TABLE t0 TO t1; +Got one of the listed errors +TRUNCATE TABLE t0; +Got one of the listed errors +ALTER USER myuser PASSWORD EXPIRE; +Got one of the listed errors +CREATE USER myuser IDENTIFIED BY 'pass'; +Got one of the listed errors +DROP USER myuser; +Got one of the listed errors +GRANT ALL ON *.* TO 'myuser'; +Got one of the listed errors +RENAME USER myuser TO mariauser; +Got one of the listed errors +REVOKE SELECT ON test FROM myuser; +Got one of the listed errors +REVOKE ALL, GRANT OPTION FROM myuser; +Got one of the listed errors +REVOKE PROXY ON myuser FROM myuser; +Got one of the listed errors +ANALYZE TABLE db.tbl; +Got one of the listed errors +CHECK TABLE db.tbl; +Got one of the listed errors +CHECKSUM TABLE db.tbl; +Got one of the listed errors +OPTIMIZE TABLE db.tbl; +Got one of the listed errors +REPAIR TABLE db.tbl; +Got one of the listed errors +INSTALL PLUGIN plg SONAME 'plg.so'; +Got one of the listed errors +UNINSTALL PLUGIN plg; +Got one of the listed errors +DROP USER 'userMW416'@'localhost'; +SHOW DATABASES; +Database +information_schema +mtr +mysql +performance_schema +test +SHOW GLOBAL STATUS LIKE 'wsrep_replicated'; +Variable_name Value +wsrep_replicated 3 diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test new file mode 100644 index 00000000000..ebc15438adc --- /dev/null +++ b/mysql-test/suite/galera/t/MW-416.test @@ -0,0 +1,132 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +CREATE USER 'userMW416'@'localhost'; +GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost'; + +SHOW GLOBAL STATUS LIKE 'wsrep_replicated'; + +--connect userMW416, localhost, userMW416,, test, $NODE_MYPORT_1 +--connection userMW416 + +# DDL + +--error 1044 +ALTER DATABASE db CHARACTER SET = utf8; +--error 1044 +ALTER EVENT ev1 RENAME TO ev2; +--error 1370 +ALTER FUNCTION fun1 COMMENT 'foo'; +#--error 1044,1227 +#ALTER INSTANCE ROTATE INNODB MASTER KEY; +--error 1044,1227 +ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB; +--error 1044,1227,1370 +ALTER PROCEDURE proc1 COMMENT 'foo'; +--error 1044,1227,1370 +ALTER SERVER srv OPTIONS (USER 'sally'); +--error 1044,1142,1227,1370 +ALTER TABLE tbl DROP COLUMN col; +--error 1044,1227,1370 +ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb; +--error 1044,1142,1227,1370 +ALTER VIEW vw AS SELECT 1; + +--error 1044,1227,1370 +CREATE DATABASE db; +--error 1044,1227,1370 +CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1; +--error 1044,1227,1370 +CREATE FUNCTION fun1() RETURNS int RETURN(1); +--error 1044,1227,1370 +CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so'; +--error 1044,1227,1370 +CREATE PROCEDURE proc1() BEGIN END; +--error 1044,1142,1227,1370 +CREATE INDEX idx ON tbl(id); +--error 1044,1142,1227,1370 +CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb; +--error 1044,1142,1227,1370 +CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user'); +--error 1044,1142,1227,1370 +CREATE TABLE t (i int); +--error 1044,1142,1227,1370 +CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb; +--error 1044,1142,1227,1370 +CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END; +--error 1044,1142,1227,1370 +CREATE VIEW vw AS SELECT 1; + + + +--error 1044,1142,1227,1370 +DROP DATABASE db; +--error 1044,1142,1227,1370 +DROP EVENT ev; +--error 1044,1142,1227,1370 +DROP FUNCTION fun1; +--error 1044,1142,1227,1370 +DROP INDEX idx ON t0; +--error 1044,1142,1227,1370 +DROP LOGFILE GROUP lfg; +--error 1044,1142,1227,1370 +DROP PROCEDURE proc1; +--error 1044,1142,1227,1370 +DROP SERVEr srv; +--error 1044,1142,1227,1370 +DROP TABLE t0; +--error 1044,1142,1227,1370 +DROP TABLESPACE tblspc; +--error 1044,1142,1227,1360,1370 +DROP TRIGGER trg; +--error 1044,1142,1227,1370 +DROP VIEW vw; + +--error 1044,1142,1227,1370 +RENAME TABLE t0 TO t1; + +--error 1044,1142,1227,1370 +TRUNCATE TABLE t0; + +# DCL + +# account management +--error 1044,1142,1227,1370 +ALTER USER myuser PASSWORD EXPIRE; +--error 1044,1142,1227,1370 +CREATE USER myuser IDENTIFIED BY 'pass'; +--error 1044,1142,1227,1370 +DROP USER myuser; +--error 1044,1045,1142,1227,1370 +GRANT ALL ON *.* TO 'myuser'; +--error 1044,1142,1227,1370 +RENAME USER myuser TO mariauser; +--error 1044,1142,1227,1370 +REVOKE SELECT ON test FROM myuser; +--error 1044,1142,1227,1370,1698 +REVOKE ALL, GRANT OPTION FROM myuser; +--error 1044,1142,1227,1370,1698 +REVOKE PROXY ON myuser FROM myuser; + +# table maintenance +--error 1044,1142,1227,1370 +ANALYZE TABLE db.tbl; +--error 1044,1142,1227,1370 +CHECK TABLE db.tbl; +--error 1044,1142,1227,1370 +CHECKSUM TABLE db.tbl; +--error 1044,1142,1227,1370 +OPTIMIZE TABLE db.tbl; +--error 1044,1142,1227,1370 +REPAIR TABLE db.tbl; + +# plugin and user defined functions +--error 1044,1142,1227,1370 +INSTALL PLUGIN plg SONAME 'plg.so'; +--error 1044,1142,1227,1370 +UNINSTALL PLUGIN plg; + +--connection node_1 +DROP USER 'userMW416'@'localhost'; +SHOW DATABASES; +SHOW GLOBAL STATUS LIKE 'wsrep_replicated'; -- cgit v1.2.1 From 181f3015bf62bccc108aacd4df55065e0158b060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 19 Oct 2017 11:06:55 +0300 Subject: MariaDB adjustments. Add missing COND variable and disable test that fail. --- mysql-test/suite/galera/disabled.def | 2 ++ mysql-test/suite/galera/t/MW-416.test | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index c91654c2023..ad966ebab0d 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -1,2 +1,4 @@ galera_var_dirty_reads : MDEV-12539 query_cache : MDEV-12539 +MW-421 : MDEV-12539 +galera_concurrent_ctas : MDEV-12539 diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test index ebc15438adc..df4fa35abc7 100644 --- a/mysql-test/suite/galera/t/MW-416.test +++ b/mysql-test/suite/galera/t/MW-416.test @@ -1,6 +1,8 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/wait_until_ready.inc + CREATE USER 'userMW416'@'localhost'; GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost'; @@ -67,7 +69,7 @@ DROP EVENT ev; DROP FUNCTION fun1; --error 1044,1142,1227,1370 DROP INDEX idx ON t0; ---error 1044,1142,1227,1370 +--error 1044,1142,1227,1370,1064 DROP LOGFILE GROUP lfg; --error 1044,1142,1227,1370 DROP PROCEDURE proc1; @@ -75,7 +77,7 @@ DROP PROCEDURE proc1; DROP SERVEr srv; --error 1044,1142,1227,1370 DROP TABLE t0; ---error 1044,1142,1227,1370 +--error 1044,1142,1227,1370,1064 DROP TABLESPACE tblspc; --error 1044,1142,1227,1360,1370 DROP TRIGGER trg; @@ -91,7 +93,7 @@ TRUNCATE TABLE t0; # DCL # account management ---error 1044,1142,1227,1370 +--error 1044,1142,1227,1370,1064 ALTER USER myuser PASSWORD EXPIRE; --error 1044,1142,1227,1370 CREATE USER myuser IDENTIFIED BY 'pass'; -- cgit v1.2.1 From 016785f6aa9c56b731b612363e7d52488735ee98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 19 Oct 2017 15:02:14 +0300 Subject: Fix test failure on perfschema.all_instances. --- mysql-test/suite/perfschema/r/all_instances.result | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result index 3b0b4db4541..bfe50b881da 100644 --- a/mysql-test/suite/perfschema/r/all_instances.result +++ b/mysql-test/suite/perfschema/r/all_instances.result @@ -152,6 +152,7 @@ wait/synch/cond/sql/Relay_log_info::sleep_cond wait/synch/cond/sql/Relay_log_info::start_cond wait/synch/cond/sql/Relay_log_info::stop_cond wait/synch/cond/sql/THD::COND_wakeup_ready +wait/synch/cond/sql/THD::COND_wsrep_thd select event_name from file_instances group by event_name; event_name wait/io/file/aria/control -- cgit v1.2.1 From e6e026ae51a77969749de201d491a176483bbc69 Mon Sep 17 00:00:00 2001 From: Ian Gilfillan Date: Thu, 23 Nov 2017 14:02:36 +0200 Subject: Update wsrep_sync_wait documentation as per MW-86 --- mysql-test/r/mysqld--help.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 34d4bae0f28..91131870752 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -942,8 +942,8 @@ The following options may be given as the first argument: --wsrep-sync-wait[=#] Ensure "synchronous" read view before executing an operation of the type specified by bitmask: 1 - - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); - 2 - UPDATE and DELETE; 4 - INSERT and REPLACE + READ(includes SELECT and BEGIN/START TRANSACTION); 2 - + UPDATE and DELETE; 4 - INSERT and REPLACE; 8 - SHOW Variables (--variable-name=value) allow-suspicious-udfs FALSE -- cgit v1.2.1 From 09b25f85966f44aae933e86b84b4ebe59ded47c3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Mar 2018 16:35:46 +0100 Subject: only allow SUPER user to modify wsrep_on --- mysql-test/suite/wsrep/r/variables.result | 7 +++++++ mysql-test/suite/wsrep/t/variables.test | 14 ++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index 5117dd1b048..72ea8eacfbf 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -73,6 +73,13 @@ Threads_connected 1 SHOW STATUS LIKE 'wsrep_thread_count'; Variable_name Value wsrep_thread_count 11 +set wsrep_on=0; +set wsrep_on=1; +create user test@localhost; +set auto_increment_increment=10; +set wsrep_on=0; +ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +drop user test@localhost; # # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash # diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index 3093d8ba942..e148152fc22 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -68,6 +68,20 @@ sleep 3; SHOW STATUS LIKE 'threads_connected'; SHOW STATUS LIKE 'wsrep_thread_count'; +# +# privileges for wsrep_on +# +set wsrep_on=0; +set wsrep_on=1; +create user test@localhost; +connect con1,localhost,test; +set auto_increment_increment=10; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +set wsrep_on=0; +disconnect con1; +connection default; +drop user test@localhost; + --echo # --echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash --echo # -- cgit v1.2.1 From 1ecd68d867ced1d00ebffdcedbf6bc97493f5067 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 30 Apr 2018 23:06:09 +0200 Subject: Use after free in authentication --- mysql-test/r/connect_debug.result | 5 +++++ mysql-test/t/connect_debug.test | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mysql-test/r/connect_debug.result create mode 100644 mysql-test/t/connect_debug.test (limited to 'mysql-test') diff --git a/mysql-test/r/connect_debug.result b/mysql-test/r/connect_debug.result new file mode 100644 index 00000000000..0452b238db9 --- /dev/null +++ b/mysql-test/r/connect_debug.result @@ -0,0 +1,5 @@ +set @old_dbug=@@global.debug_dbug; +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +set global debug_dbug=@old_dbug; +drop user bad; diff --git a/mysql-test/t/connect_debug.test b/mysql-test/t/connect_debug.test new file mode 100644 index 00000000000..299b605b2cd --- /dev/null +++ b/mysql-test/t/connect_debug.test @@ -0,0 +1,12 @@ +source include/have_debug.inc; +set @old_dbug=@@global.debug_dbug; + +# +# use after free if need plugin change and auth aborted +# +set global debug_dbug='+d,auth_disconnect'; +create user 'bad' identified by 'worse'; +--error 1 +--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse +set global debug_dbug=@old_dbug; +drop user bad; -- cgit v1.2.1 From 0088fb91f36574ea79a575282951e956ab7f15f8 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Fri, 2 Feb 2018 14:18:39 +0100 Subject: Fix sporadic failure of MTR test galera.galera_many_tables_pk The test relies on the false assumption that node_1 is always "assigned" autoincrement value 1 for a given key. However that is no necessarily the case when wsrep autoincrement control is enabled. This patch changed the test so that it does not make use of a autoincrement key, which is not fundamental for the test itself. codership/mysql-wsrep#322 --- mysql-test/suite/galera/t/galera_many_tables_pk.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-test/suite/galera/t/galera_many_tables_pk.test index 72c7e08bcc3..0af7160d4d8 100644 --- a/mysql-test/suite/galera/t/galera_many_tables_pk.test +++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test @@ -16,7 +16,7 @@ while ($count) { --disable_query_log - --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")` + --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB")` --eval $ddl_var --enable_query_log --dec $count @@ -37,7 +37,7 @@ START TRANSACTION; while ($count) { --disable_query_log - --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")` + --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1)")` --eval $ddl_var --enable_query_log --dec $count -- cgit v1.2.1 From b1fabb2c0aecc4518a04341325abdbf26e341754 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Wed, 7 Feb 2018 14:14:21 +0100 Subject: Galera MTR Tests: missing wsrep_sync_wait in test galera_evs_suspect_timeout --- mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result | 1 + mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result index 1464222a079..7e0d282ec7f 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result +++ b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result @@ -11,6 +11,7 @@ SET SESSION wsrep_sync_wait = 0; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +SET SESSION wsrep_sync_wait = DEFAULT; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 diff --git a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test index a87f19ac94e..03236a3cb93 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test +++ b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test @@ -50,6 +50,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N --enable_query_log --source include/wait_until_connected_again.inc +SET SESSION wsrep_sync_wait = DEFAULT; SELECT COUNT(*) = 1 FROM t1; DROP TABLE t1; -- cgit v1.2.1 From ba07581c811a3991116605f51143a5f3e3dd8b7f Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Wed, 7 Feb 2018 14:16:50 +0100 Subject: Galera MTR tests: remove unused config files in galera suite --- .../suite/galera/galera_2nodes_as_master_slave.cnf | 83 --------------------- .../galera_2nodes_as_master_with_repl_filter.cnf | 87 ---------------------- 2 files changed, 170 deletions(-) delete mode 100644 mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf delete mode 100644 mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf deleted file mode 100644 index f68fe524904..00000000000 --- a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf +++ /dev/null @@ -1,83 +0,0 @@ - -# -# Let's understand the topology. -# * Independent Master with server-id = 1 -# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3 -# node#1 act as slave to Independent Master with server-id = 1 -# * Independent Slave with server-id = 4 replicating from galera node#2 -# - -# Use default setting for mysqld processes -!include include/default_mysqld.cnf - -[mysqld] -log-slave-updates -log-bin=mysqld-bin -binlog-format=row -gtid-mode=on -enforce-gtid-consistency=true - -[mysqld.1] -server-id=1 - -[mysqld.2] -server-id=2 - -wsrep_provider=@ENV.WSREP_PROVIDER -wsrep_cluster_address='gcomm://' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;' - -# enforce read-committed characteristics across the cluster -wsrep_causal_reads=ON -wsrep_sync_wait = 15 - -wsrep_node_address=127.0.0.1 -wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port - -# Required for Galera -innodb_autoinc_lock_mode=2 - -innodb_flush_log_at_trx_commit=2 - -[mysqld.3] -server-id=3 - -wsrep_provider=@ENV.WSREP_PROVIDER -wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;' - -# enforce read-committed characteristics across the cluster -wsrep_causal_reads=ON -wsrep_sync_wait = 15 - -wsrep_node_address=127.0.0.1 -wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port -wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port - -# Required for Galera -innodb_autoinc_lock_mode=2 - -innodb_flush_log_at_trx_commit=2 - -[mysqld.4] -server-id=4 - -[ENV] -NODE_MYPORT_1= @mysqld.1.port -NODE_MYSOCK_1= @mysqld.1.socket - -NODE_MYPORT_2= @mysqld.2.port -NODE_MYSOCK_2= @mysqld.2.socket - -NODE_MYPORT_3= @mysqld.3.port -NODE_MYSOCK_3= @mysqld.3.socket - -NODE_MYPORT_4= @mysqld.4.port -NODE_MYSOCK_4= @mysqld.4.socket - -NODE_GALERAPORT_2= @mysqld.2.#galera_port -NODE_GALERAPORT_3= @mysqld.3.#galera_port - -NODE_SSTPORT_2= @mysqld.2.#sst_port -NODE_SSTPORT_3= @mysqld.3.#sst_port diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf deleted file mode 100644 index d5490280ab2..00000000000 --- a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf +++ /dev/null @@ -1,87 +0,0 @@ -# -# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave -# - -# Use default setting for mysqld processes -!include include/default_mysqld.cnf - -[mysqld] -default-storage-engine=InnoDB - -[mysqld.1] -server-id=1 -binlog-format=row -log-bin=mysqld-bin -log_slave_updates -gtid-mode=on -enforce-gtid-consistency=true -event-scheduler=1 - -wsrep_provider=@ENV.WSREP_PROVIDER -wsrep_cluster_address='gcomm://' -wsrep_provider_options='base_port=@mysqld.1.#galera_port' - -# enforce read-committed characteristics across the cluster -wsrep_causal_reads=ON -wsrep_sync_wait = 15 - -wsrep_node_address=127.0.0.1 -wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port - -# Required for Galera -innodb_autoinc_lock_mode=2 - -innodb_flush_log_at_trx_commit=2 - -[mysqld.2] -server-id=2 -binlog-format=row -log-bin=mysqld-bin -log_slave_updates -gtid-mode=on -enforce-gtid-consistency=true -event-scheduler=1 - -wsrep_provider=@ENV.WSREP_PROVIDER -wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port' - -# enforce read-committed characteristics across the cluster -wsrep_causal_reads=ON -wsrep_sync_wait = 15 - -wsrep_node_address=127.0.0.1 -wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port - -# Required for Galera -innodb_autoinc_lock_mode=2 - -innodb_flush_log_at_trx_commit=2 - -[mysqld.3] -server-id=3 -replicate-ignore-db=test -replicate-wild-ignore-table=test.% -log-bin=mysqld-bin -log_slave_updates -gtid-mode=on -enforce-gtid-consistency=true -event-scheduler=1 - -[ENV] -NODE_MYPORT_1= @mysqld.1.port -NODE_MYSOCK_1= @mysqld.1.socket - -NODE_MYPORT_2= @mysqld.2.port -NODE_MYSOCK_2= @mysqld.2.socket - -NODE_MYPORT_3= @mysqld.3.port -NODE_MYSOCK_3= @mysqld.3.socket - -NODE_GALERAPORT_1= @mysqld.1.#galera_port -NODE_GALERAPORT_2= @mysqld.2.#galera_port - -NODE_SSTPORT_1= @mysqld.1.#sst_port -NODE_SSTPORT_2= @mysqld.2.#sst_port -- cgit v1.2.1 From 7274bed257420d85fe07c986b57f864fc6052e24 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Thu, 22 Feb 2018 11:14:16 +0100 Subject: Fix MTR test galera.galera_gcache_recover_manytrx The kills the two nodes that compose the cluster and then recovers them. The first node that is recovered is expected to recover its gcache, so that when the second node is recovered, it is expected that it rejoins the cluster via IST. However, it is possible that if the second node is killed while it is applying in TOI mode, its local state is marked unsafe. In which case, SST is the only option to rejoin the cluster. codership/mysql-wsrep#323 --- .../suite/galera/t/galera_gcache_recover_manytrx.test | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test index 3bfcdc9f117..08165f30f7d 100644 --- a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test +++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test @@ -5,6 +5,7 @@ --source include/galera_cluster.inc --source include/big_test.inc +--source include/have_log_bin.inc SET SESSION wsrep_sync_wait = 0; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB; @@ -93,6 +94,8 @@ END| DELIMITER ;| +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + --connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1 --connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1 --connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1 @@ -124,6 +127,13 @@ DELIMITER ;| --connection node_2 SET SESSION wsrep_sync_wait = 0; + +# Make sure that node_2 is not killed while TOIs are applied. +# Otherwhise we risk that grastate file is marked unsafe, and +# as a consequence the node cannot rejoin with IST. +--let $wait_condition = SELECT VARIABLE_VALUE > $wsrep_last_committed_before FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed' +--source include/wait_condition.inc + --source include/kill_galera.inc --sleep 10 @@ -172,9 +182,8 @@ SET SESSION wsrep_sync_wait = 0; --source include/start_mysqld.inc --connection node_1 ---source include/wait_until_connected_again.inc ---source include/galera_wait_ready.inc --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc --let $diff_servers = 1 2 --source include/diff_servers.inc -- cgit v1.2.1 From f8ea96b80c3eb79c45b646b61ff4472e1326ec18 Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Tue, 27 Feb 2018 04:52:55 +0200 Subject: codership/galera#500 MTR test for proper Galera provider tear down Added a test which verifies that if the gcomm background thread is forced to quit via exception, the error is propagated all the way up the stack and wsrep_ready becomes 0. --- mysql-test/suite/galera/r/galera#500.result | 10 ++++++++ mysql-test/suite/galera/t/galera#500.test | 37 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 mysql-test/suite/galera/r/galera#500.result create mode 100644 mysql-test/suite/galera/t/galera#500.test (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera#500.result b/mysql-test/suite/galera/r/galera#500.result new file mode 100644 index 00000000000..6a07d0359a4 --- /dev/null +++ b/mysql-test/suite/galera/r/galera#500.result @@ -0,0 +1,10 @@ +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options="gmcast.isolate=2"; +SET SESSION wsrep_sync_wait = 0; +SHOW STATUS LIKE 'wsrep_cluster_status'; +Variable_name Value +wsrep_cluster_status non-Primary +SET SESSION wsrep_sync_wait = default; +SET GLOBAL wsrep_provider_options="pc.bootstrap=1"; +SET SESSION wsrep_on=0; +CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2."); diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test new file mode 100644 index 00000000000..a313d5778d3 --- /dev/null +++ b/mysql-test/suite/galera/t/galera#500.test @@ -0,0 +1,37 @@ +# +# The purpose of this test is to verify that if an exception is +# thrown from gcomm background thread, the provider terminates properly +# and wsrep_ready becomes 0. +# + +--source include/have_innodb.inc +--source include/galera_cluster.inc + +# Force node_2 gcomm background thread to terminate via exception. +--connection node_2 +--let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address` +# Setting gmcast.isolate=2 will force gcomm background thread to +# throw exception. +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options="gmcast.isolate=2"; + +# Wait until wsrep_ready becomes 0. +--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_ready' +--source include/wait_condition.inc + +# Wait until node_1 ends up in non-prim and rebootstrap the cluster. +--connection node_1 +SET SESSION wsrep_sync_wait = 0; +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_cluster_size' +--source include/wait_condition.inc +SHOW STATUS LIKE 'wsrep_cluster_status'; +SET SESSION wsrep_sync_wait = default; +SET GLOBAL wsrep_provider_options="pc.bootstrap=1"; + +# Restart node_2 +--connection node_2 +SET SESSION wsrep_on=0; +--source include/restart_mysqld.inc + +--connection node_2 +CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2."); -- cgit v1.2.1 From 2e5681a450627709512138a7d15b8ee035a29c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 8 May 2018 09:33:48 +0300 Subject: Test requires galera debug library. --- mysql-test/suite/galera/t/galera#500.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test index a313d5778d3..3c8490b6907 100644 --- a/mysql-test/suite/galera/t/galera#500.test +++ b/mysql-test/suite/galera/t/galera#500.test @@ -6,6 +6,7 @@ --source include/have_innodb.inc --source include/galera_cluster.inc +--source include/galera_have_debug_sync.inc # Force node_2 gcomm background thread to terminate via exception. --connection node_2 -- cgit v1.2.1 From 6a04c2a1aa60e67c07d4e6ada63f65cc3b26a5a9 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 22 May 2018 12:09:05 -0700 Subject: MDEV-16235 Server crashes in my_utf8_uni or in my_strtod_int upon SELECT .. LIMIT 0 The code must differentiate between a SELECT with contradictory WHERE/HAVING and one with LIMIT 0. Also for the latter printed 'Zero limit' instead of 'Impossible where' in the EXPLAIN output. --- mysql-test/r/limit.result | 16 ++++++++++++++++ mysql-test/r/subselect4.result | 2 +- mysql-test/r/subselect_mat_cost_bugs.result | 2 +- mysql-test/t/limit.test | 14 ++++++++++++++ mysql-test/t/subselect4.test | 2 +- 5 files changed, 33 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index 176a93c7a46..deb4ca2ab95 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -146,3 +146,19 @@ a 16 DROP TABLE t1; End of 5.1 tests +# +# mdev-16235: SELECT over a table with LIMIT 0 +# +EXPLAIN +SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit +SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; +start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text +EXPLAIN +SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit +SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; +help_topic_id name help_category_id description example url +End of 5.5 tests diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 6accc23d18a..8973330c7da 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2512,7 +2512,7 @@ SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1); SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; # -# mfrv-14515: Wrong results for tableless query with subquery in WHERE +# mdev-14515: Wrong results for tableless query with subquery in WHERE # and implicit aggregation # create table t1 (i1 int, i2 int); diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result index df6b543bab8..d33f1488e4d 100644 --- a/mysql-test/r/subselect_mat_cost_bugs.result +++ b/mysql-test/r/subselect_mat_cost_bugs.result @@ -334,7 +334,7 @@ SELECT * FROM t1 WHERE (f1) IN (SELECT f1 FROM t2) LIMIT 0; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Zero limit 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where SELECT * FROM t1 WHERE (f1) IN (SELECT f1 FROM t2) diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 4dbe13096d4..668d3b74518 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -115,3 +115,17 @@ SELECT a FROM t1 ORDER BY a LIMIT 2 OFFSET 14; DROP TABLE t1; --echo End of 5.1 tests + +--echo # +--echo # mdev-16235: SELECT over a table with LIMIT 0 +--echo # + +EXPLAIN +SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; +SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; + +EXPLAIN +SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; +SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; + +--echo End of 5.5 tests diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 2b53b55b735..2727fd9daed 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2047,7 +2047,7 @@ SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; --echo # ---echo # mfrv-14515: Wrong results for tableless query with subquery in WHERE +--echo # mdev-14515: Wrong results for tableless query with subquery in WHERE --echo # and implicit aggregation --echo # -- cgit v1.2.1 From 1ada4afb0a51f7283b6187a95019ec2cb80c8a0b Mon Sep 17 00:00:00 2001 From: Teodor Mircea Ionita Date: Sun, 29 Apr 2018 19:47:48 +0300 Subject: mtr: use process launch -- args to start mysqld in lldb gdb's "set args" equivalent for lldb would be "settings set target.run-args", however it doesn't play well with double dashed args (--). --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index de1871cbf03..ba49d88a85f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -6051,7 +6051,7 @@ sub lldb_arguments { $input = $input ? "< $input" : ""; # write init file for mysqld or client - mtr_tofile($lldb_init_file, "set args $str $input\n"); + mtr_tofile($lldb_init_file, "process launch --stop-at-entry -- $str $input\n"); print "\nTo start lldb for $type, type in another window:\n"; print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n"; -- cgit v1.2.1 From 5fb2c586f225361deae0f04dc6f72a3f0d168ac2 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sat, 2 Jun 2018 11:52:48 +0530 Subject: MDEV-16225: wrong resultset from query with semijoin=on For non-semi-join subquery optimization we do a cost based decision between Materialisation and IN -> EXIST transformation. The issue in this case is that for IN->EXIST transformation we run JOIN::reoptimize with the IN->EXISt conditions and we come up with a new query plan. But when we compare the cost with Materialization, we make the decision to chose Materialization so we need to restore the query plan for Materilization. The saving and restoring for keyuse array and join_tab keyuse is only done when we have atleast one element in the keyuse_array , we are now changing to do it even for 0 elements to main the generality. --- mysql-test/r/subselect_sj2_mat.result | 57 +++++++++++++++++++++++++++++++++++ mysql-test/t/subselect_sj2_mat.test | 42 ++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 835742a3ff4..19aa3bd3f02 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1601,3 +1601,60 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY eq_ref distinct_key distinct_key 11 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where DROP TABLE t1,t2; +# +# MDEV-16225: wrong resultset from query with semijoin=on +# +CREATE TABLE t1 ( +`id` int(10) NOT NULL AUTO_INCREMENT, +`local_name` varchar(64) NOT NULL, +PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1; +insert into t1(`id`,`local_name`) values +(1,'Cash Advance'), +(2,'Cash Advance'), +(3,'Rollover'), +(4,'AL Installment'), +(5,'AL Installment'), +(6,'AL Installment'), +(7,'AL Installment'), +(8,'AL Installment'), +(9,'AL Installment'), +(10,'Internet Payday'), +(11,'Rollover - Internet Payday'), +(12,'AL Monthly Installment'), +(13,'AL Semi-Monthly Installment'); +explain +SELECT SQL_NO_CACHE t.id +FROM t1 t +WHERE ( +t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11))) +OR +(t.id IN (0,4,12,13,1,10,3,11)) +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t index PRIMARY PRIMARY 4 NULL 13 Using where; Using index +2 MATERIALIZED ALL distinct_key NULL NULL NULL 8 +2 MATERIALIZED A ALL PRIMARY NULL NULL NULL 13 Using where; Using join buffer (flat, BNL join) +3 MATERIALIZED B ALL PRIMARY NULL NULL NULL 13 Using where +SELECT SQL_NO_CACHE t.id +FROM t1 t +WHERE ( +t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11))) +OR +(t.id IN (0,4,12,13,1,10,3,11)) +); +id +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +drop table t1; diff --git a/mysql-test/t/subselect_sj2_mat.test b/mysql-test/t/subselect_sj2_mat.test index cfb6c8c2819..0665cdf68fe 100644 --- a/mysql-test/t/subselect_sj2_mat.test +++ b/mysql-test/t/subselect_sj2_mat.test @@ -303,3 +303,45 @@ eval $q; eval explain $q; DROP TABLE t1,t2; + +--echo # +--echo # MDEV-16225: wrong resultset from query with semijoin=on +--echo # + +CREATE TABLE t1 ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `local_name` varchar(64) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1; + +insert into t1(`id`,`local_name`) values +(1,'Cash Advance'), +(2,'Cash Advance'), +(3,'Rollover'), +(4,'AL Installment'), +(5,'AL Installment'), +(6,'AL Installment'), +(7,'AL Installment'), +(8,'AL Installment'), +(9,'AL Installment'), +(10,'Internet Payday'), +(11,'Rollover - Internet Payday'), +(12,'AL Monthly Installment'), +(13,'AL Semi-Monthly Installment'); + +explain +SELECT SQL_NO_CACHE t.id +FROM t1 t +WHERE ( + t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11))) + OR + (t.id IN (0,4,12,13,1,10,3,11)) +); +SELECT SQL_NO_CACHE t.id +FROM t1 t +WHERE ( + t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11))) + OR + (t.id IN (0,4,12,13,1,10,3,11)) +); +drop table t1; -- cgit v1.2.1 From 3627dd7f6a1cf5bd7151ff23290d64cb6dffea90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 7 Jun 2018 10:31:39 +0300 Subject: MDEV-16416 Crash on IMPORT TABLESPACE of a ROW_FORMAT=COMPRESSED table fil_iterate(): Invoke fil_encrypt_buf() correctly when a ROW_FORMAT=COMPRESSED table with a physical page size of innodb_page_size is being imported. Also, validate the page checksum before decryption, and reduce the scope of some variables. AbstractCallback::operator()(): Remove the parameter 'offset'. The check for it in FetchIndexRootPages::operator() was basically redundant and dead code since the previous refactoring. --- .../encryption/r/innodb-discard-import.result | 6 ++++ .../suite/encryption/t/innodb-discard-import.test | 32 ++++++++-------------- 2 files changed, 17 insertions(+), 21 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/encryption/r/innodb-discard-import.result b/mysql-test/suite/encryption/r/innodb-discard-import.result index 06f4abab9f4..406460d0a23 100644 --- a/mysql-test/suite/encryption/r/innodb-discard-import.result +++ b/mysql-test/suite/encryption/r/innodb-discard-import.result @@ -1,5 +1,8 @@ call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue."); +SET @innodb_file_format_orig = @@GLOBAL.innodb_file_format; +SET @innodb_file_per_table_orig = @@GLOBAL.innodb_file_per_table; +SET @innodb_compression_algo = @@GLOBAL.innodb_compression_algorithm; SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_compression_algorithm = 1; @@ -134,3 +137,6 @@ NOT FOUND /tmpres/ in t3.ibd NOT FOUND /mysql/ in t4.ibd DROP PROCEDURE innodb_insert_proc; DROP TABLE t1,t2,t3,t4; +SET GLOBAL innodb_file_format = @innodb_file_format_orig; +SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig; +SET GLOBAL innodb_compression_algorithm = @innodb_compression_algo; diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.test b/mysql-test/suite/encryption/t/innodb-discard-import.test index 9feaacc41e5..54471ae3bae 100644 --- a/mysql-test/suite/encryption/t/innodb-discard-import.test +++ b/mysql-test/suite/encryption/t/innodb-discard-import.test @@ -1,10 +1,6 @@ -- source include/have_innodb.inc +-- source include/innodb_page_size_small.inc -- source include/have_file_key_management_plugin.inc -# embedded does not support restart --- source include/not_embedded.inc --- source include/not_valgrind.inc -# Avoid CrashReporter popup on Mac --- source include/not_crashrep.inc # # MDEV-8770: Incorrect error message when importing page compressed tablespace @@ -13,17 +9,13 @@ call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue."); ---disable_query_log -let $innodb_file_format_orig = `SELECT @@innodb_file_format`; -let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; -let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`; ---enable_query_log +SET @innodb_file_format_orig = @@GLOBAL.innodb_file_format; +SET @innodb_file_per_table_orig = @@GLOBAL.innodb_file_per_table; +SET @innodb_compression_algo = @@GLOBAL.innodb_compression_algorithm; ---disable_warnings SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_compression_algorithm = 1; ---enable_warnings --let $MYSQLD_TMPDIR = `SELECT @@tmpdir` --let $MYSQLD_DATADIR = `SELECT @@datadir` @@ -37,7 +29,9 @@ create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes en show warnings; create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4; show warnings; -create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4; +let $kbs= `select floor(@@global.innodb_page_size/1024)`; +--replace_regex / key_block_size=\d+//i +eval create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4 key_block_size=$kbs; show warnings; create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1; show warnings; @@ -98,6 +92,7 @@ ALTER TABLE t2 IMPORT TABLESPACE; SHOW CREATE TABLE t2; SELECT COUNT(*) FROM t2; ALTER TABLE t3 IMPORT TABLESPACE; +--replace_regex / key_block_size=\d+//i SHOW CREATE TABLE t3; SELECT COUNT(*) FROM t3; ALTER TABLE t4 IMPORT TABLESPACE; @@ -125,11 +120,6 @@ SELECT COUNT(*) FROM t4; DROP PROCEDURE innodb_insert_proc; DROP TABLE t1,t2,t3,t4; -# reset system ---disable_warnings ---disable_query_log -EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; -EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; -EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo; ---enable_query_log ---enable_warnings +SET GLOBAL innodb_file_format = @innodb_file_format_orig; +SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig; +SET GLOBAL innodb_compression_algorithm = @innodb_compression_algo; -- cgit v1.2.1 From d9b159a2027c56c5c87385cfe1ae43b8c73a97b6 Mon Sep 17 00:00:00 2001 From: Chris Calender Date: Tue, 17 Apr 2018 15:00:15 -0400 Subject: MDEV-15789 - mysqlslap use incorrect table def The bug arises when one uses --auto-generate-sql-guid-primary (and --auto-generate-sql-secondary-indexes) with mysqlslap and also have sql_mode=STRICT_TRANS_TABLE. When using this option, mysqlslap should create a column with varchar(36), but it appears to create it as a varchar(32) only. Then if one has sql_mode=STRICT_TRANS_TABLES, it throws an error, like: mysqlslap: Cannot run query INSERT INTO t1 VALUES (...) ERROR : Data too long for column 'id' at row 1 Upstream bug report: BUG#80329. --- mysql-test/r/mysqlslap.result | 3 +++ mysql-test/t/mysqlslap.test | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result index af78677647f..50bd53f4263 100644 --- a/mysql-test/r/mysqlslap.result +++ b/mysql-test/r/mysqlslap.result @@ -255,3 +255,6 @@ Benchmark # MDEV-4684 - Enhancement request: --init-command support for mysqlslap # DROP TABLE t1; +# +# Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK +# diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test index c49c4ab3d7d..81115d59d09 100644 --- a/mysql-test/t/mysqlslap.test +++ b/mysql-test/t/mysqlslap.test @@ -80,3 +80,11 @@ DROP DATABASE bug58090; --exec $MYSQL_SLAP --create-schema=test --init-command="CREATE TABLE t1(a INT)" --silent --concurrency=1 --iterations=1 DROP TABLE t1; + +--echo # +--echo # Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK +--echo # + +--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --create-schema=slap + +--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-secondary-indexes=1 --create-schema=slap -- cgit v1.2.1 From cd33280b682692f0517a26178d7b5337db648751 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sat, 9 Jun 2018 11:26:52 +0530 Subject: MDEV-16374: Filtered shows 0 for materilization scan for a semi join, which makes optimizer always picks materialization scan over materialization lookup For non-mergeable semi-joins we don't store the estimates of the IN subquery in table->file->stats.records. In the function TABLE_LIST::fetch_number_of_rows, we store the number of rows in the tables (estimates in case of derived table/views). Currently we don't store the estimates for non-mergeable semi-joins, which leads to a problem of selecting materialization scan over materialization lookup. Fixed this by storing these estimated appropriately --- mysql-test/r/selectivity.result | 70 ++++++++++++++++++++++++++++-- mysql-test/r/selectivity_innodb.result | 70 ++++++++++++++++++++++++++++-- mysql-test/r/subselect_sj_nonmerged.result | 6 +-- mysql-test/t/selectivity.test | 18 ++++++++ 4 files changed, 153 insertions(+), 11 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 61a77d135e7..3e8fb8e2e41 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -356,13 +356,13 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort -1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 .l_orderkey 1 100.00 Using where +1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort +1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 .l_orderkey 4 100.00 +1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index 2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -1535,6 +1535,68 @@ t 10:00:00 11:00:00 DROP TABLE t1; +# +# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer +# always pick materialization scan over materialization lookup +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int); +insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10), +(11,11),(12,12),(13,13),(14,14),(15,15); +set @@optimizer_use_condition_selectivity=2; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (``.`max(a)` = `test`.`t1`.`a`) +select * from t1 where a in (select max(a) from t1 group by b); +a b +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +set @@optimizer_use_condition_selectivity=1; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (``.`max(a)` = `test`.`t1`.`a`) +select * from t1 where a in (select max(a) from t1 group by b); +a b +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +drop table t1,t0; set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index a026c2e6d92..748ef0cb6ca 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -359,13 +359,13 @@ and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort -1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 .l_orderkey 1 100.00 Using where +1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort +1 PRIMARY eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00 1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00 -1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 .l_orderkey 4 100.00 +1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index 2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00 Warnings: -Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = ``.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = ``.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` +Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (``.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE` select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem @@ -1539,6 +1539,68 @@ t 10:00:00 11:00:00 DROP TABLE t1; +# +# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer +# always pick materialization scan over materialization lookup +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int); +insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10), +(11,11),(12,12),(13,13),(14,14),(15,15); +set @@optimizer_use_condition_selectivity=2; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (``.`max(a)` = `test`.`t1`.`a`) +select * from t1 where a in (select max(a) from t1 group by b); +a b +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +set @@optimizer_use_condition_selectivity=1; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (``.`max(a)` = `test`.`t1`.`a`) +select * from t1 where a in (select max(a) from t1 group by b); +a b +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +drop table t1,t0; set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; diff --git a/mysql-test/r/subselect_sj_nonmerged.result b/mysql-test/r/subselect_sj_nonmerged.result index c7e04225ffe..47970668ae5 100644 --- a/mysql-test/r/subselect_sj_nonmerged.result +++ b/mysql-test/r/subselect_sj_nonmerged.result @@ -77,9 +77,9 @@ explain select * from t4 where t4.a in (select max(t2.a) from t1, t2 group by t2.b) and t4.b in (select max(t2.a) from t1, t2 group by t2.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL distinct_key NULL NULL NULL 5 -1 PRIMARY ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join) -1 PRIMARY t4 ref a a 10 .max(t2.a),.max(t2.a) 12 +1 PRIMARY ALL distinct_key NULL NULL NULL 5 +1 PRIMARY t4 ref a a 5 .max(t2.a) 12 Using index condition +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t4.b 1 3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index 548ef295fb2..afaa937c360 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -1043,6 +1043,24 @@ SELECT * FROM (SELECT t FROM t1 WHERE d IS NULL) sq; DROP TABLE t1; +--echo # +--echo # MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer +--echo # always pick materialization scan over materialization lookup +--echo # + +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int); +insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10), +(11,11),(12,12),(13,13),(14,14),(15,15); +set @@optimizer_use_condition_selectivity=2; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +select * from t1 where a in (select max(a) from t1 group by b); +set @@optimizer_use_condition_selectivity=1; +explain extended select * from t1 where a in (select max(a) from t1 group by b); +select * from t1 where a in (select max(a) from t1 group by b); +drop table t1,t0; + set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set use_stat_tables=@save_use_stat_tables; -- cgit v1.2.1 From c17468d4abe59339af11ef4a17a59156741c6a21 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Sat, 9 Jun 2018 19:04:34 +0530 Subject: MDEV-16191: Analyze format=json gives incorrect value for r_limit inside a dependent subquery when ORDER BY is present Currently for setting r_limit we divide with the number of iterations we invoke the dependent subquery. This is not needed for the case of limit. For varying limits we produce the output that the limit varies with execution. Also there is a type for filtered , we forgot to multiply by 100 as it is represented as a percent. --- mysql-test/r/analyze_stmt_orderby.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/analyze_stmt_orderby.result b/mysql-test/r/analyze_stmt_orderby.result index be1f01a2a52..238baff50e1 100644 --- a/mysql-test/r/analyze_stmt_orderby.result +++ b/mysql-test/r/analyze_stmt_orderby.result @@ -303,7 +303,7 @@ ANALYZE "r_rows": 10, "r_total_time_ms": "REPLACED", "filtered": 100, - "r_filtered": 1, + "r_filtered": 100, "attached_condition": "(t0.a is not null)" } } -- cgit v1.2.1 From d39629f01ebdd5b89186e6c8a4a8d3dd528bd26a Mon Sep 17 00:00:00 2001 From: Teodor Mircea Ionita Date: Mon, 7 May 2018 22:40:27 +0300 Subject: MDEV-16075: Workaround to run MTR test suite for make test Assign all tests added via MY_ADD_TEST to a bogus default_ignore target, so that they are not ran by default when doing bare make test. Add default test named MTR that calls mysql-test-run suite, which is now the single test run by make test. In consequence, modified unit/suite.pm to exclude the MTR test and run the real ctests flagged for default_ignore target, thus no circular loop. --- mysql-test/suite/unit/suite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm index 78d82ccb31d..43eaa970350 100644 --- a/mysql-test/suite/unit/suite.pm +++ b/mysql-test/suite/unit/suite.pm @@ -31,7 +31,7 @@ sub start_test { return "Not run for embedded server" if $::opt_embedded_server; return "Not configured to run ctest" unless -f "../CTestTestfile.cmake"; my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : ""; - my (@ctest_list)= `cd .. && ctest $opt_vs_config --show-only --verbose`; + my (@ctest_list)= `cd .. && ctest $opt_vs_config -E MTR -C default_ignore --show-only --verbose`; return "No ctest" if $?; my ($command, %tests); -- cgit v1.2.1 From 1d43f71c7b4c39a6fd196c104b5ebafb65376199 Mon Sep 17 00:00:00 2001 From: Rutuja Surve Date: Sun, 10 Jun 2018 11:19:39 +0300 Subject: MDEV-15021: mysqldump --tables --routines generates non importable dump file The order of outputting stored procedures is important. Stored procedures must be available on view creation, for views which make use of them. Make sure to print them before outputting tables. --- mysql-test/r/mysqldump.result | 15 +++++++++++++++ mysql-test/t/mysqldump.test | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 68de653742c..99b14189282 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5401,3 +5401,18 @@ DELIMITER ; /*!50003 SET collation_connection = @saved_col_connection */ ; ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ; DROP DATABASE `a\"'``b`; +# +# MDEV-15021: Fix the order in which routines are called +# +use test; +CREATE FUNCTION f() RETURNS INT RETURN 1; +CREATE VIEW v1 AS SELECT f(); +# Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp +DROP VIEW v1; +DROP FUNCTION f; +# Running mysql -uroot test < **vardir**/test.dmp +# +# Cleanup after succesful import. +# +DROP VIEW v1; +DROP FUNCTION f; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 39ca5b3c58e..cb12919a823 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2567,3 +2567,25 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/bug11505.sql; let SEARCH_PATTERN=Database: mysql; exec $MYSQL_DUMP mysql func > $SEARCH_FILE; source include/search_pattern_in_file.inc; + +--echo # +--echo # MDEV-15021: Fix the order in which routines are called +--echo # +use test; +CREATE FUNCTION f() RETURNS INT RETURN 1; +CREATE VIEW v1 AS SELECT f(); + +--echo # Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp +--exec $MYSQL_DUMP -uroot test --routines --tables v1 > $MYSQLTEST_VARDIR/test.dmp + +DROP VIEW v1; +DROP FUNCTION f; + +--echo # Running mysql -uroot test < **vardir**/test.dmp +--exec $MYSQL -uroot test < $MYSQLTEST_VARDIR/test.dmp + +--echo # +--echo # Cleanup after succesful import. +--echo # +DROP VIEW v1; +DROP FUNCTION f; -- cgit v1.2.1 From 719ed09e5e96b53467ede331631de641f98a348f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Sun, 10 Jun 2018 18:25:11 +0300 Subject: Update test results post-merge --- mysql-test/r/limit.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index deb4ca2ab95..6c295bb86af 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -154,7 +154,7 @@ SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0; -start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text +start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id EXPLAIN SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0; id select_type table type possible_keys key key_len ref rows Extra -- cgit v1.2.1 From e7ca377cb73a64e40832e9306194412fb07b8fa5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 5 Jun 2018 15:21:45 +0200 Subject: MDEV-16342 SHOW ENGINES: MyISAM description is useless rewrite tautological engine descriptions --- mysql-test/r/information_schema.result | 2 +- mysql-test/suite/federated/have_federatedx.inc | 2 +- mysql-test/suite/funcs_1/r/is_engines_archive.result | 2 +- mysql-test/suite/funcs_1/r/is_engines_csv.result | 2 +- mysql-test/suite/funcs_1/r/is_engines_federated.result | 2 +- mysql-test/suite/funcs_1/r/is_engines_myisam.result | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 1f765a70137..dfa7b12562d 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1387,7 +1387,7 @@ USE test; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS -MyISAM DEFAULT MyISAM storage engine NO NO NO +MyISAM DEFAULT Non-transactional engine with good performance and small data footprint NO NO NO grant select on *.* to user3148@localhost; select user,db from information_schema.processlist; user db diff --git a/mysql-test/suite/federated/have_federatedx.inc b/mysql-test/suite/federated/have_federatedx.inc index 56ce31f5b2f..2250dd205bd 100644 --- a/mysql-test/suite/federated/have_federatedx.inc +++ b/mysql-test/suite/federated/have_federatedx.inc @@ -1,5 +1,5 @@ if (!`SELECT count(*) FROM information_schema.plugins WHERE plugin_name = 'federated' AND plugin_status = 'active' AND - plugin_description LIKE '%FederatedX%'`){ + plugin_description LIKE '%transactions%'`){ skip Need FederatedX engine; } diff --git a/mysql-test/suite/funcs_1/r/is_engines_archive.result b/mysql-test/suite/funcs_1/r/is_engines_archive.result index 2772992495c..52802b17acd 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_archive.result +++ b/mysql-test/suite/funcs_1/r/is_engines_archive.result @@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines WHERE ENGINE = 'ARCHIVE'; ENGINE ARCHIVE SUPPORT YES -COMMENT Archive storage engine +COMMENT gzip-compresses tables for a low storage footprint TRANSACTIONS NO XA NO SAVEPOINTS NO diff --git a/mysql-test/suite/funcs_1/r/is_engines_csv.result b/mysql-test/suite/funcs_1/r/is_engines_csv.result index 2a7e61ee4d3..7e413b9af6f 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_csv.result +++ b/mysql-test/suite/funcs_1/r/is_engines_csv.result @@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines WHERE ENGINE = 'CSV'; ENGINE CSV SUPPORT YES -COMMENT CSV storage engine +COMMENT Stores tables as CSV files TRANSACTIONS NO XA NO SAVEPOINTS NO diff --git a/mysql-test/suite/funcs_1/r/is_engines_federated.result b/mysql-test/suite/funcs_1/r/is_engines_federated.result index 8057a0266c5..20926458ed0 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_federated.result +++ b/mysql-test/suite/funcs_1/r/is_engines_federated.result @@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines WHERE ENGINE = 'FEDERATED'; ENGINE FEDERATED SUPPORT YES -COMMENT FederatedX pluggable storage engine +COMMENT Allows to access tables on other MariaDB servers, supports transactions and more TRANSACTIONS YES XA NO SAVEPOINTS YES diff --git a/mysql-test/suite/funcs_1/r/is_engines_myisam.result b/mysql-test/suite/funcs_1/r/is_engines_myisam.result index 7e42c864187..d307ce4be6a 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_engines_myisam.result @@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines WHERE ENGINE = 'MyISAM'; ENGINE MyISAM SUPPORT DEFAULT -COMMENT MyISAM storage engine +COMMENT Non-transactional engine with good performance and small data footprint TRANSACTIONS NO XA NO SAVEPOINTS NO -- cgit v1.2.1 From 6da8192174f033c2958ddafb2a15c14360bb1ecc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 10 Jun 2018 17:23:53 +0200 Subject: mysqltest: Allow HANDLER READ in --ps-protocol tests adjust tests --- mysql-test/r/lock.result | 2 +- mysql-test/suite/handler/handler.inc | 2 ++ mysql-test/suite/handler/interface.result | 2 +- mysql-test/suite/handler/interface.test | 2 +- mysql-test/t/lock.test | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result index 501c379b257..0dcc0de828f 100644 --- a/mysql-test/r/lock.result +++ b/mysql-test/r/lock.result @@ -407,7 +407,7 @@ LOCK TABLE t1 WRITE; HANDLER t1 OPEN; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction HANDLER t1 READ FIRST; -ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +Got one of the listed errors HANDLER t1 CLOSE; ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction UNLOCK TABLES; diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc index 5b2dd5ef7e9..bfc21a3b2c3 100644 --- a/mysql-test/suite/handler/handler.inc +++ b/mysql-test/suite/handler/handler.inc @@ -377,7 +377,9 @@ send optimize table t1; # client 1 --echo proceed with the normal connection connection default; +--disable_ps_protocol handler t1 read next; +--enable_ps_protocol handler t1 close; # client 2 --echo read the result from the other connection diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result index fb633bb94c4..c9cffba33f7 100644 --- a/mysql-test/suite/handler/interface.result +++ b/mysql-test/suite/handler/interface.result @@ -269,7 +269,7 @@ handler t1 open; lock table t1 write; alter table t1 engine=csv; handler t1 read a next; -ERROR HY000: Table storage engine for 't1' doesn't have this option +Got one of the listed errors handler t1 close; unlock tables; drop table t1; diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test index 2ef617c3ce7..06797ed6980 100644 --- a/mysql-test/suite/handler/interface.test +++ b/mysql-test/suite/handler/interface.test @@ -326,7 +326,7 @@ let $wait_condition= info = "alter table t1 engine=csv"; --source include/wait_condition.inc connection default; ---error ER_ILLEGAL_HA +--error ER_ILLEGAL_HA,ER_KEY_DOES_NOT_EXITS handler t1 read a next; handler t1 close; connection con1; diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test index 78f0e2ecf8d..6cfaf9fc320 100644 --- a/mysql-test/t/lock.test +++ b/mysql-test/t/lock.test @@ -481,7 +481,7 @@ LOCK TABLE t1 WRITE; --echo # HANDLER commands are not allowed in LOCK TABLES mode --error ER_LOCK_OR_ACTIVE_TRANSACTION HANDLER t1 OPEN; ---error ER_LOCK_OR_ACTIVE_TRANSACTION +--error ER_LOCK_OR_ACTIVE_TRANSACTION,ER_UNKNOWN_TABLE HANDLER t1 READ FIRST; --error ER_LOCK_OR_ACTIVE_TRANSACTION HANDLER t1 CLOSE; -- cgit v1.2.1 From ca733d03c82b02cd842ff2a226fee7b12eb86f8d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 10 Jun 2018 21:19:11 +0200 Subject: MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol update table->pos_in_table_list during prepare, just like it's done in normal execution. otherwise it'll be a dangling pointer --- mysql-test/suite/handler/ps.result | 9 +++++++++ mysql-test/suite/handler/ps.test | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 mysql-test/suite/handler/ps.result create mode 100644 mysql-test/suite/handler/ps.test (limited to 'mysql-test') diff --git a/mysql-test/suite/handler/ps.result b/mysql-test/suite/handler/ps.result new file mode 100644 index 00000000000..54685f9156b --- /dev/null +++ b/mysql-test/suite/handler/ps.result @@ -0,0 +1,9 @@ +create table t1 (i int); +handler test.t1 open handler_a; +flush status; +handler handler_a read first; +i +show status like 'Com_stmt_prepare%'; +Variable_name Value +Com_stmt_prepare OK +drop table t1; diff --git a/mysql-test/suite/handler/ps.test b/mysql-test/suite/handler/ps.test new file mode 100644 index 00000000000..68091190c85 --- /dev/null +++ b/mysql-test/suite/handler/ps.test @@ -0,0 +1,11 @@ +# +# MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol +# +create table t1 (i int); +handler test.t1 open handler_a; +flush status; +handler handler_a read first; +# handler...read must be prepared in --ps-protocol mode +--replace_result $PS_PROTOCOL OK +show status like 'Com_stmt_prepare%'; +drop table t1; -- cgit v1.2.1 From 5227198908d4f12ab3e5c95e4c8f15e6b9805f10 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 11 Jun 2018 16:29:22 +0400 Subject: MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING virtual Item_null_result::get_date() was not overridden. It used the inherited Item::get_date(), which tests field_type(), which in case of Item_null_result calls result_field->field_type(), and result_field is not really always set (e.g. it's not set in the test case from the bug report). Overriding Item_null::get_date() like it's done for other val_xxx() methods. This make the code more symmetric across data types. In the new reduction, get_date() immediately returns NULL without entering into any data type specific code. --- mysql-test/r/olap.result | 22 ++++++++++++++++++++++ mysql-test/t/olap.test | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index b10f175b63e..24140583d13 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -766,3 +766,25 @@ b NULL DROP TABLE t1, t2; End of 5.0 tests +# +# Start of 10.1 tests +# +# +# MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING +# +CREATE TABLE t1 (t TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('12:12:12'); +SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00'; +t COUNT(*) +12:12:12 1 +DROP TABLE t1; +CREATE TABLE t1 (t TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('12:12:12'),('12:12:13'); +SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00'; +t COUNT(*) +12:12:12 1 +12:12:13 1 +DROP TABLE t1; +# +# End of 10.1 tests +# diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index fec5df1a1c7..4a61cebdc0d 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -404,3 +404,26 @@ SELECT DISTINCT b FROM t1, t2 GROUP BY a, b WITH ROLLUP; DROP TABLE t1, t2; --echo End of 5.0 tests + + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING +--echo # +CREATE TABLE t1 (t TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('12:12:12'); +SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00'; +DROP TABLE t1; + +CREATE TABLE t1 (t TIME) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('12:12:12'),('12:12:13'); +SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00'; +DROP TABLE t1; + + +--echo # +--echo # End of 10.1 tests +--echo # -- cgit v1.2.1 From 147744d455d57c753ca75fccca106d3326d251ab Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 11 Jun 2018 08:52:26 -0700 Subject: MDEV-16235 Server crashes in my_utf8_uni or in my_strtod_int upon SELECT .. LIMIT 0 (new variant) This is another attempt to fix the problem of mdev-14515. --- mysql-test/r/having.result | 11 +++++++++++ mysql-test/r/subselect4.result | 4 ++-- mysql-test/t/having.test | 9 +++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 18915da1a09..9e0466efb9f 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -712,3 +712,14 @@ a ct 4 2 set sql_mode=@save_sql_mode; drop table t1; +# +# mdev-16235: impossible HAVING in query without aggregation +# +explain extended +select * from mysql.help_topic where example = 'foo' having description is null; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +Warnings: +Note 1003 select `mysql`.`help_topic`.`help_topic_id` AS `help_topic_id`,`mysql`.`help_topic`.`name` AS `name`,`mysql`.`help_topic`.`help_category_id` AS `help_category_id`,`mysql`.`help_topic`.`description` AS `description`,`mysql`.`help_topic`.`example` AS `example`,`mysql`.`help_topic`.`url` AS `url` from `mysql`.`help_topic` where (`mysql`.`help_topic`.`example` = 'foo') having 0 +select * from mysql.help_topic where example = 'foo' having description is null; +help_topic_id name help_category_id description example url diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 8973330c7da..f726bcfa15e 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -1056,7 +1056,7 @@ EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); f1 f2 SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off'; @@ -1147,7 +1147,7 @@ EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); f1 f2 set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index a470f462d6a..c8bd47940cc 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -744,3 +744,12 @@ SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0; set sql_mode=@save_sql_mode; drop table t1; + +--echo # +--echo # mdev-16235: impossible HAVING in query without aggregation +--echo # + +explain extended +select * from mysql.help_topic where example = 'foo' having description is null; + +select * from mysql.help_topic where example = 'foo' having description is null; -- cgit v1.2.1 From 26be5072429082e634b8fc102609370975443439 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 12 Jun 2018 10:41:25 +0400 Subject: MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command Backporting (partially) the fix for MDEV-14603. --- mysql-test/r/ps.result | 42 ++++++++++++++++++++++++++++++++++++++ mysql-test/t/ps.test | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index e63b820d4dd..1b40a734263 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -4351,3 +4351,45 @@ LINE2 2 LINE3 3 drop table t1; # End of 5.5 tests +# +# Start of 10.1 tests +# +# +# MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command +# (the 10.1 part) +# +CREATE PROCEDURE p2 () +BEGIN +SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +END; +/ +CALL p2(); +1 +1 +DROP PROCEDURE p2; +BEGIN NOT ATOMIC +SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +END; +/ +1 +1 +BEGIN NOT ATOMIC +SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; +DEALLOCATE PREPARE stmt; +END; +/ +BEGIN NOT ATOMIC +PREPARE stmt FROM 'SELECT 1'; +SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt; +DEALLOCATE PREPARE stmt; +END; +/ +1 +1 +# +# End of 10.1 tests +# diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index f7008f570b8..e1e8dfeeb17 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3876,3 +3876,58 @@ FROM ) X; drop table t1; --echo # End of 5.5 tests + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command +--echo # (the 10.1 part) +--echo # + +DELIMITER /; +CREATE PROCEDURE p2 () +BEGIN + SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; +END; +/ +DELIMITER ;/ +CALL p2(); +DROP PROCEDURE p2; + + +DELIMITER /; +BEGIN NOT ATOMIC + SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; +END; +/ +DELIMITER ;/ + + +DELIMITER /; +BEGIN NOT ATOMIC + SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1'; + DEALLOCATE PREPARE stmt; +END; +/ +DELIMITER ;/ + + +DELIMITER /; +BEGIN NOT ATOMIC + PREPARE stmt FROM 'SELECT 1'; + SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt; + DEALLOCATE PREPARE stmt; +END; +/ +DELIMITER ;/ + + +--echo # +--echo # End of 10.1 tests +--echo # -- cgit v1.2.1 From 0ad9c3a0160d1dd46139b3e6b6b05d0fba01540b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 11 Jun 2018 13:02:47 +0300 Subject: MDEV-16456 InnoDB error "returned OS error 71" complains about wrong path When attempting to rename a table to a non-existing database, InnoDB would misleadingly report "OS error 71" when in fact the error code is InnoDB's own (OS_FILE_NOT_FOUND), and not report both pathnames. Errors on rename could occur due to reasons connected to either pathname. os_file_handle_rename_error(): New function, to report errors in renaming files. --- mysql-test/suite/innodb/r/rename_table.result | 5 +++++ mysql-test/suite/innodb/t/innodb-mdev7046.test | 7 ++++--- mysql-test/suite/innodb/t/rename_table.test | 11 +++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/innodb/r/rename_table.result create mode 100644 mysql-test/suite/innodb/t/rename_table.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/rename_table.result b/mysql-test/suite/innodb/r/rename_table.result new file mode 100644 index 00000000000..b2e15c87348 --- /dev/null +++ b/mysql-test/suite/innodb/r/rename_table.result @@ -0,0 +1,5 @@ +call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)"); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +RENAME TABLE t1 TO non_existing_db.t1; +ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: -1 "Internal error < 0 (Not system error)") +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index b4085228e02..85a257a1739 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -9,9 +9,10 @@ # Ignore OS errors -call mtr.add_suppression("InnoDB: File ./test/t1*"); -call mtr.add_suppression("InnoDB: Error number*"); -call mtr.add_suppression("InnoDB: File ./test/t1#p#p1#sp#p1sp0.ibd: 'rename' returned OS error*"); +call mtr.add_suppression("InnoDB: File ./test/t1"); +call mtr.add_suppression("InnoDB: Error number"); +call mtr.add_suppression("InnoDB: Cannot rename file '.*/test/t1#[Pp]#p1#[Ss][Pp]#p1sp0\\.ibd' to"); +call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation."); # MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) # after Operating system error number 36 in a file operation diff --git a/mysql-test/suite/innodb/t/rename_table.test b/mysql-test/suite/innodb/t/rename_table.test new file mode 100644 index 00000000000..60df8b5d2ec --- /dev/null +++ b/mysql-test/suite/innodb/t/rename_table.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)"); + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +--replace_result "\\" "/" +--error ER_ERROR_ON_RENAME +RENAME TABLE t1 TO non_existing_db.t1; + +# Cleanup +DROP TABLE t1; -- cgit v1.2.1 From 6b8d34fe0d5e73a469383bcb0818d3ff91ed9a84 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 12 Jun 2018 12:36:51 +0400 Subject: MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key. Check the name of the primary key to be 'PRIMARY'. Than differs it from any implicit primary keys created by an engine. --- mysql-test/r/alter_table.result | 23 +++++++++++++++++++++++ mysql-test/t/alter_table.test | 16 ++++++++++++++++ 2 files changed, 39 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index bb78df907ad..c6e3c7e31d9 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -2225,3 +2225,26 @@ t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key +# +CREATE TABLE t1 ( +`ID` BIGINT(20) NOT NULL, +`RANK` MEDIUMINT(4) NOT NULL, +`CHECK_POINT` BIGINT(20) NOT NULL, +UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`) +) ENGINE=InnoDB; +ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ID` bigint(20) NOT NULL, + `RANK` mediumint(4) NOT NULL, + `CHECK_POINT` bigint(20) NOT NULL, + PRIMARY KEY (`ID`,`CHECK_POINT`), + UNIQUE KEY `HORIZON_UIDX01` (`ID`,`RANK`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`); +Warnings: +Note 1061 Multiple primary key defined +DROP TABLE t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 585a272de9b..28d8c5bf5e9 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1841,3 +1841,19 @@ CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB; ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c; SHOW CREATE TABLE t1; DROP TABLE t1; + +--echo # +--echo # MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key +--echo # +CREATE TABLE t1 ( + `ID` BIGINT(20) NOT NULL, + `RANK` MEDIUMINT(4) NOT NULL, + `CHECK_POINT` BIGINT(20) NOT NULL, + UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`) + ) ENGINE=InnoDB; + +ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`); +SHOW CREATE TABLE t1; +ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`); +DROP TABLE t1; + -- cgit v1.2.1 From 7bbe324fc17d9734833f717921629c36d1d0c996 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 8 Jun 2018 22:01:05 +0300 Subject: MDEV-13577 slave_parallel_mode=optimistic should not report the mode's specific temporary errors The optimistic parallel slave's worker thread could face a run-time error due to the algorithm's specifics which allows for conflicts like the reported "Can't find record in 'table'". A typical stack is like {noformat} #0 handler::print_error (this=0x61c00008f8a0, error=149, errflag=0) at handler.cc:3650 #1 0x0000555555e95361 in write_record (thd=thd@entry=0x62a0000a2208, table=table@entry=0x61f00008ce88, info=info@entry=0x7fffdee356d0) at sql_insert.cc:1944 #2 0x0000555555ea7767 in mysql_insert (thd=thd@entry=0x62a0000a2208, table_list=0x61b00012ada0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=, ignore=) at sql_insert.cc:1039 #3 0x0000555555efda90 in mysql_execute_command (thd=thd@entry=0x62a0000a2208) at sql_parse.cc:3927 #4 0x0000555555f0cc50 in mysql_parse (thd=0x62a0000a2208, rawbuf=, length=, parser_state=) at sql_parse.cc:7449 #5 0x00005555566d4444 in Query_log_event::do_apply_event (this=0x61200005b9c8, rgi=, query_arg=, q_len_arg=) at log_event.cc:4508 #6 0x00005555566d639e in Query_log_event::do_apply_event (this=, rgi=) at log_event.cc:4185 #7 0x0000555555d738cf in Log_event::apply_event (rgi=0x61d0001ea080, this=0x61200005b9c8) at log_event.h:1343 #8 apply_event_and_update_pos_apply (ev=ev@entry=0x61200005b9c8, thd=thd@entry=0x62a0000a2208, rgi=rgi@entry=0x61d0001ea080, reason=) at slave.cc:3479 #9 0x0000555555d8596b in apply_event_and_update_pos_for_parallel (ev=ev@entry=0x61200005b9c8, thd=thd@entry=0x62a0000a2208, rgi=rgi@entry=0x61d0001ea080) at slave.cc:3623 #10 0x00005555562aca83 in rpt_handle_event (qev=qev@entry=0x6190000fa088, rpt=rpt@entry=0x62200002bd68) at rpl_parallel.cc:50 #11 0x00005555562bd04e in handle_rpl_parallel_thread (arg=arg@entry=0x62200002bd68) at rpl_parallel.cc:1258 {noformat} Here {{handler::print_error}} computes whether to error log the current error when --log-warnings > 1. The decision flag is consulted bu {{my_message_sql()}} which can be eventually called. In the bug case the decision is to log. However in the optimistic mode slave applier case any conflict is attempted to resolve with rollback and retry to success. Hence the logging is at least extraneous. The case is fixed with adding a new flag {{ME_LOG_AS_WARN}} which {{handler::print_error}} may propagate further on through {{my_error}} when the error comes from an optimistically running slave worker thread. The new flag effectively requests the warning level for the errlog record, while the thread's DA records the actual error (which is regarded as temporary one by the parallel slave error handler). --- .../suite/rpl/r/rpl_parallel_optimistic.result | 23 ++++++++ .../suite/rpl/t/rpl_parallel_optimistic.test | 64 +++++++++++++++++++++- 2 files changed, 86 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result index 0177e65b10f..a6da3399fab 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result @@ -1,4 +1,6 @@ include/rpl_init.inc [topology=1->2] +call mtr.add_suppression("Warning.*Deadlock found when trying to get lock; try restarting transaction"); +call mtr.add_suppression("Warning.*mysqld: Can't find record in 't2'"); ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; @@ -543,6 +545,27 @@ a b 57 7 58 8 59 9 +DELETE FROM t1; +DELETE FROM t2; +include/save_master_gtid.inc +include/sync_with_master_gtid.inc +BEGIN; +INSERT INTO t1 SET a=1; +SET @save.binlog_format=@@session.binlog_format; +SET @@SESSION.binlog_format=row; +BEGIN; +INSERT INTO t1 SET a=1; +INSERT INTO t2 SET a=1; +COMMIT; +BEGIN; +DELETE FROM t2; +COMMIT; +ROLLBACK; +SET @@SESSION.binlog_format= @save.binlog_format; +DELETE FROM t1; +DELETE FROM t2; +include/save_master_gtid.inc +include/sync_with_master_gtid.inc include/stop_slave.inc SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test index 41fb6ebb72e..28bf4a77fd4 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test @@ -4,6 +4,11 @@ --let $rpl_topology=1->2 --source include/rpl_init.inc +--connection server_2 +call mtr.add_suppression("Warning.*Deadlock found when trying to get lock; try restarting transaction"); +# The following instruction is a part of the proof of MDEV-13577 fixes, below. +call mtr.add_suppression("Warning.*mysqld: Can't find record in 't2'"); + --connection server_1 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; @@ -480,8 +485,65 @@ SELECT * FROM t2 WHERE a >= 40 ORDER BY a; SELECT * FROM t1 WHERE a >= 40 ORDER BY a; SELECT * FROM t2 WHERE a >= 40 ORDER BY a; -# Clean up. +# partial cleanup to reuse the tables by following tests +--connection server_1 +DELETE FROM t1; +DELETE FROM t2; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +# +# MDEV-13577 optimistic parallel slave errors out to error log unnecessary +# + +# The 1st of the following two trx:s a blocker on slave +--connection server_2 +BEGIN; +INSERT INTO t1 SET a=1; + +--connection server_1 +SET @save.binlog_format=@@session.binlog_format; +SET @@SESSION.binlog_format=row; + +BEGIN; + INSERT INTO t1 SET a=1; + INSERT INTO t2 SET a=1; +COMMIT; + +# This transaction is going to win optimistical race with above INSERT +# on slave while being depend on it. That means it will face a kind of temporary error +# and then will retry to succeed. +BEGIN; + DELETE FROM t2; +COMMIT; + +# First make sure DELETE raced indeed to get stuck at retrying stage +# where it runs "realistically" now. There is nomore optimistic error +# in the errorlog, which is downgraded to the warning level (when +# --log-warnings > 1), see above suppression. +--connection server_2 +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit" +--source include/wait_condition.inc + +# Next release the 1st trx to commit. +--connection server_2 +ROLLBACK; + +# MDEV-13577 local cleanup: +--connection server_1 +SET @@SESSION.binlog_format= @save.binlog_format; +DELETE FROM t1; +DELETE FROM t2; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc + +# +# Clean up. +# --connection server_2 --source include/stop_slave.inc SET GLOBAL slave_parallel_mode=@old_parallel_mode; -- cgit v1.2.1 From d2e1ed8b936a78ceeec0e64231997d7ed18a4daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 13 Jun 2018 08:33:25 +0300 Subject: Fix innodb.rename_table for embedded An embedded run will output the full path name instead of a relative one. Update results to cover both cases. --- mysql-test/suite/innodb/r/rename_table.result | 2 +- mysql-test/suite/innodb/t/rename_table.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/rename_table.result b/mysql-test/suite/innodb/r/rename_table.result index b2e15c87348..49ce3254091 100644 --- a/mysql-test/suite/innodb/r/rename_table.result +++ b/mysql-test/suite/innodb/r/rename_table.result @@ -1,5 +1,5 @@ call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)"); CREATE TABLE t1 (a INT) ENGINE=InnoDB; RENAME TABLE t1 TO non_existing_db.t1; -ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: -1 "Internal error < 0 (Not system error)") +ERROR HY000: Error on rename of '**path-to-t1**' to '**path-to-non-existing-db-t1**' (errno: -1 "Internal error < 0 (Not system error)") DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/rename_table.test b/mysql-test/suite/innodb/t/rename_table.test index 60df8b5d2ec..695c0915d14 100644 --- a/mysql-test/suite/innodb/t/rename_table.test +++ b/mysql-test/suite/innodb/t/rename_table.test @@ -3,7 +3,7 @@ call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)"); CREATE TABLE t1 (a INT) ENGINE=InnoDB; ---replace_result "\\" "/" +--replace_regex /\'.*t1\' to/'**path-to-t1**' to/ /to \'.*non.*t1\'/to '**path-to-non-existing-db-t1**'/ --error ER_ERROR_ON_RENAME RENAME TABLE t1 TO non_existing_db.t1; -- cgit v1.2.1 From 72005b7a1c42cb31294ead822b812909e5885f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Jun 2018 08:26:46 +0300 Subject: MDEV-13103: Improve 'cannot be decrypted' error message buf_page_check_corrupt(): Display the file name. --- .../suite/encryption/r/innodb-bad-key-change.result | 8 ++++---- .../suite/encryption/r/innodb-bad-key-change2.result | 5 ++--- .../suite/encryption/r/innodb-bad-key-change4.result | 2 +- .../suite/encryption/r/innodb-compressed-blob.result | 3 +-- .../suite/encryption/r/innodb-encryption-disable.result | 3 +-- .../suite/encryption/r/innodb-force-corrupt.result | 8 ++------ mysql-test/suite/encryption/r/innodb-missing-key.result | 4 +--- mysql-test/suite/encryption/r/innodb-redo-badkey.result | 17 +++++++---------- mysql-test/suite/encryption/r/innodb-redo-nokeys.result | 13 +++++-------- .../suite/encryption/t/innodb-bad-key-change.test | 9 +++++---- .../suite/encryption/t/innodb-bad-key-change2.test | 5 ++--- .../suite/encryption/t/innodb-bad-key-change4.test | 2 +- .../suite/encryption/t/innodb-compressed-blob.test | 3 +-- .../suite/encryption/t/innodb-encryption-disable.test | 3 +-- mysql-test/suite/encryption/t/innodb-force-corrupt.test | 8 ++------ mysql-test/suite/encryption/t/innodb-missing-key.test | 4 +--- mysql-test/suite/encryption/t/innodb-redo-badkey.test | 17 +++++++---------- mysql-test/suite/encryption/t/innodb-redo-nokeys.test | 13 +++++-------- 18 files changed, 49 insertions(+), 78 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result index d581b98513d..51fc7a8cbc4 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result @@ -1,7 +1,7 @@ -call mtr.add_suppression("InnoDB: The page .*"); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* "); -call mtr.add_suppression("Plugin 'file_key_management' .*"); -call mtr.add_suppression("mysqld: File .*"); +call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); +call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("mysqld: File .*keysbad3.txt' not found "); # Start server with keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result index 94ed922a0ec..1ed78a9efd2 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result @@ -1,6 +1,5 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*"); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("InnoDB: Table \'\"test\".\"t1\"\' tablespace is set as discarded."); SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result index 227b8cc3deb..a491b084764 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result @@ -1,4 +1,4 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t1\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("InnoDB: Cannot open table .*"); call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*"); diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result index 15c2a410948..ce73b80820f 100644 --- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result +++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result @@ -1,5 +1,4 @@ -call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '..test.t[1-3]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); # Restart mysqld --file-key-management-filename=keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result index dd2b025553e..4d15098d936 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result @@ -1,5 +1,4 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); create table t5 ( `intcol1` int(32) DEFAULT NULL, diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result index 3f3a2afb02d..7d63f47d17e 100644 --- a/mysql-test/suite/encryption/r/innodb-force-corrupt.result +++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result @@ -1,9 +1,5 @@ -CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*"); -CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*"); -CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; set global innodb_compression_algorithm = 1; diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result index 2f2cc025973..53ca0845c25 100644 --- a/mysql-test/suite/encryption/r/innodb-missing-key.result +++ b/mysql-test/suite/encryption/r/innodb-missing-key.result @@ -1,6 +1,4 @@ -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); # Start server with keys2.txt CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19; diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result index e12dad6d0d7..ed578d80b3a 100644 --- a/mysql-test/suite/encryption/r/innodb-redo-badkey.result +++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result @@ -1,16 +1,13 @@ call mtr.add_suppression("InnoDB: Block in space_id .* in file .* encrypted."); -call mtr.add_suppression("Plugin 'file_key_management' .*"); +call mtr.add_suppression("Plugin 'file_key_management' "); call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -call mtr.add_suppression("InnoDB: Read operation failed for tablespace .*"); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); -call mtr.add_suppression("InnoDB: Recovery read page .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE .*"); -call mtr.add_suppression("InnoDB: Plugin initialization aborted .*"); +call mtr.add_suppression("InnoDB: Read operation failed for tablespace "); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed"); +call mtr.add_suppression("InnoDB: Recovery read page "); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1234]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE "); +call mtr.add_suppression("InnoDB: Plugin initialization aborted "); call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND ##################"); # Restart mysqld --file-key-management-filename=keys2.txt # Wait max 10 min for key encryption threads to encrypt all spaces diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result index dcbe1f5a395..1ea706dbde4 100644 --- a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result +++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result @@ -1,13 +1,10 @@ -call mtr.add_suppression("InnoDB: Block in space_id .*"); -call mtr.add_suppression("mysqld: File .*"); -call mtr.add_suppression("Plugin 'file_key_management' .*"); +call mtr.add_suppression("InnoDB: Block in space_id "); +call mtr.add_suppression("mysqld: File "); +call mtr.add_suppression("Plugin 'file_key_management' "); call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available"); -call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); +call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1234]\\.ibd' cannot be decrypted\\."); # Restart mysqld --file-key-management-filename=keys2.txt SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_per_table = ON; diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test index 6fa5fc9847f..9d61770f543 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test @@ -8,10 +8,11 @@ # table exists and encryption service is not available. # -call mtr.add_suppression("InnoDB: The page .*"); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* "); -call mtr.add_suppression("Plugin 'file_key_management' .*"); -call mtr.add_suppression("mysqld: File .*"); +call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); +call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("mysqld: File .*keysbad3.txt' not found "); + --echo --echo # Start server with keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test index 52ee442c725..0c312f1f449 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test @@ -8,10 +8,9 @@ # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1new cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted\\."); # Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management.*"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); call mtr.add_suppression("InnoDB: Table \'\"test\".\"t1\"\' tablespace is set as discarded."); --let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test index 14d88614f55..0c52bfe3fe6 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test @@ -7,7 +7,7 @@ # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '.*test.t1\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("InnoDB: Cannot open table .*"); call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); # Suppression for builds where file_key_management plugin is linked statically diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test index cb69f22f745..4a81dae5a0f 100644 --- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test +++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test @@ -4,8 +4,7 @@ # embedded does not support restart -- source include/not_embedded.inc -call mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-3] cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file '..test.t[1-3]\\.ibd' cannot be decrypted\\."); call mtr.add_suppression("Unable to decompress space ..test.t[1-3].ibd \\[[1-9][0-9]*:[0-9]+\\]"); --echo # Restart mysqld --file-key-management-filename=keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test index 38f36076c73..6ade8d6e3b2 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test @@ -7,8 +7,7 @@ # MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t5 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\."); # Suppression for builds where file_key_management plugin is linked statically call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test index dd4ee51b1eb..cb6440127cc 100644 --- a/mysql-test/suite/encryption/t/innodb-force-corrupt.test +++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test @@ -7,12 +7,8 @@ # Don't test under embedded -- source include/not_embedded.inc -CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed .*"); -CALL mtr.add_suppression("InnoDB: Corruption: Block in space_id .*"); -CALL mtr.add_suppression("InnoDB: However key management plugin or used key_version .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t[0-9]+ page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); --disable_warnings SET GLOBAL innodb_file_format = `Barracuda`; diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test index 07a2b16211c..6ea0528825b 100644 --- a/mysql-test/suite/encryption/t/innodb-missing-key.test +++ b/mysql-test/suite/encryption/t/innodb-missing-key.test @@ -7,9 +7,7 @@ # MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing # -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\."); --echo --echo # Start server with keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test index 159646541c7..69de4f0f921 100644 --- a/mysql-test/suite/encryption/t/innodb-redo-badkey.test +++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test @@ -4,18 +4,15 @@ -- source include/not_embedded.inc call mtr.add_suppression("InnoDB: Block in space_id .* in file .* encrypted."); -call mtr.add_suppression("Plugin 'file_key_management' .*"); +call mtr.add_suppression("Plugin 'file_key_management' "); call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -call mtr.add_suppression("InnoDB: Read operation failed for tablespace .*"); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); -call mtr.add_suppression("InnoDB: Recovery read page .*"); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); -call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE .*"); -call mtr.add_suppression("InnoDB: Plugin initialization aborted .*"); +call mtr.add_suppression("InnoDB: Read operation failed for tablespace "); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed"); +call mtr.add_suppression("InnoDB: Recovery read page "); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1234]\\.ibd' cannot be decrypted\\."); +call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE "); +call mtr.add_suppression("InnoDB: Plugin initialization aborted "); call mtr.add_suppression("InnoDB: ############### CORRUPT LOG RECORD FOUND ##################"); --echo # Restart mysqld --file-key-management-filename=keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test index e55e2ade153..68d831fcd17 100644 --- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test +++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test @@ -3,16 +3,13 @@ # embedded does not support restart -- source include/not_embedded.inc -call mtr.add_suppression("InnoDB: Block in space_id .*"); -call mtr.add_suppression("mysqld: File .*"); -call mtr.add_suppression("Plugin 'file_key_management' .*"); +call mtr.add_suppression("InnoDB: Block in space_id "); +call mtr.add_suppression("mysqld: File "); +call mtr.add_suppression("Plugin 'file_key_management' "); call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available"); -call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); +call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\."); call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t2 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t3 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t4 cannot be decrypted."); -call mtr.add_suppression("InnoDB: The page \[page id: space=[0-9]+, page number=[0-9]+\] in file test/t1 cannot be decrypted."); +call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1234]\\.ibd' cannot be decrypted\\."); --echo # Restart mysqld --file-key-management-filename=keys2.txt -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- cgit v1.2.1 From 51254da52c144781695250a98f365fbc090ef619 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 12 Jun 2018 12:37:28 +0200 Subject: MDEV-15359 Thread stay in "cleaning up" status after finishing make thd_get_error_context_description() to show not just thd->proc_info, but exactly the same thread state that SHOW PROCESSLIST shows. --- mysql-test/suite/plugins/r/processlist.result | 8 ++++++++ mysql-test/suite/plugins/t/processlist.test | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 mysql-test/suite/plugins/r/processlist.result create mode 100644 mysql-test/suite/plugins/t/processlist.test (limited to 'mysql-test') diff --git a/mysql-test/suite/plugins/r/processlist.result b/mysql-test/suite/plugins/r/processlist.result new file mode 100644 index 00000000000..d08ea9d3523 --- /dev/null +++ b/mysql-test/suite/plugins/r/processlist.result @@ -0,0 +1,8 @@ +create table t1 (a int) engine=innodb; +start transaction; +insert t1 values (1); +state from show engine innodb status + +state from show processlist + +drop table t1; diff --git a/mysql-test/suite/plugins/t/processlist.test b/mysql-test/suite/plugins/t/processlist.test new file mode 100644 index 00000000000..5aacef317b9 --- /dev/null +++ b/mysql-test/suite/plugins/t/processlist.test @@ -0,0 +1,18 @@ +# +# MDEV-15359 Thread stay in "cleaning up" status after finishing +# +source include/have_innodb.inc; + +create table t1 (a int) engine=innodb; +start transaction; +insert t1 values (1); +let id=`select connection_id()`; +connect con2,localhost,root; +let s=query_get_value(show engine innodb status,Status,1); +disable_query_log; +eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status`; +eval select state as `state from show processlist` from information_schema.processlist where id = $id; +enable_query_log; +disconnect con2; +connection default; +drop table t1; -- cgit v1.2.1 From f5eb37129f24893ab095e78c6fd2ef87e2c460cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Jun 2018 16:15:21 +0300 Subject: MDEV-13103 Deal with page_compressed page corruption fil_page_decompress(): Replaces fil_decompress_page(). Allow the caller detect errors. Remove duplicated code. Use the "safe" instead of "fast" variants of decompression routines. fil_page_compress(): Replaces fil_compress_page(). The length of the input buffer always was srv_page_size (innodb_page_size). Remove printouts, and remove the fil_space_t* parameter. buf_tmp_buffer_t::reserved: Make private; the accessors acquire() and release() will use atomic memory access. buf_pool_reserve_tmp_slot(): Make static. Remove the second parameter. Do not acquire any mutex. Remove the allocation of the buffers. buf_tmp_reserve_crypt_buf(), buf_tmp_reserve_compression_buf(): Refactored away from buf_pool_reserve_tmp_slot(). buf_page_decrypt_after_read(): Make static, and simplify the logic. Use the encryption buffer also for decompressing. buf_page_io_complete(), buf_dblwr_process(): Check more failures. fil_space_encrypt(): Simplify the debug checks. fil_space_t::printed_compression_failure: Remove. fil_get_compression_alg_name(): Remove. fil_iterate(): Allocate a buffer for compression and decompression only once, instead of allocating and freeing it for every page that uses compression, during IMPORT TABLESPACE. fil_node_get_space_id(), fil_page_is_index_page(), fil_page_is_lzo_compressed(): Remove (unused code). --- mysql-test/suite/innodb/r/innodb-page_compression_default.result | 1 - mysql-test/suite/innodb/r/innodb-page_compression_snappy.result | 1 - mysql-test/suite/innodb/t/innodb-page_compression_default.test | 2 -- mysql-test/suite/innodb/t/innodb-page_compression_snappy.test | 2 -- 4 files changed, 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_default.result b/mysql-test/suite/innodb/r/innodb-page_compression_default.result index 18f7fb5e04a..19d0a875ce6 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_default.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_default.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result index 74cfa9bce3a..824b671eea3 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); set global innodb_compression_algorithm = snappy; set global innodb_file_format = `Barracuda`; set global innodb_file_per_table = on; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_default.test b/mysql-test/suite/innodb/t/innodb-page_compression_default.test index 1cc6c917548..34b1829485e 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_default.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_default.test @@ -1,8 +1,6 @@ --source include/have_innodb.inc --source include/not_embedded.inc -call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); - # All page compression test use the same --source include/innodb-page-compression.inc diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test index 532ec294d28..0186c24ef2e 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test @@ -2,8 +2,6 @@ -- source include/have_innodb_snappy.inc --source include/not_embedded.inc -call mtr.add_suppression("InnoDB: Compression failed for space [0-9]+ name test/innodb_page_compressed[0-9] len [0-9]+ err 2 write_size [0-9]+."); - # snappy set global innodb_compression_algorithm = snappy; -- cgit v1.2.1 From f4387288ab54837aa84ce728b2ce61e52850e4ec Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Fri, 15 Jun 2018 03:49:04 +0300 Subject: Updated list of unstable tests for 10.1.34 release --- mysql-test/unstable-tests | 137 ++++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 65 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 5c795bf79c8..9b00579944c 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,74 +23,80 @@ # ############################################################################## -# Based on 10.1 0db66ab18ffef6d8920e2e6ff66e99516a458a4d +# Based on 10.1 c22ab56f0d690feee471e173a3d95acb642cd6dc +main.alter_table : Modified in 10.1.34 main.alter_table_trans : MDEV-12084 - timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result +main.assign_key_cache : Added in 10.1.34 +main.assign_key_cache_debug : Added in 10.1.34 main.auth_named_pipe : MDEV-14724 - System error 2 main.connect : Modified in 10.1.33 main.connect_debug : Added in 10.1.33 main.create_delayed : MDEV-10605 - failed with timeout -main.ctype_latin1 : Modified in 10.1.32 +main.create_or_replace : Modified in 10.1.34 main.ctype_ucs : Modified in 10.1.33 main.ctype_utf16le : MDEV-10675: timeout or extra warnings -main.ctype_utf8 : Modified in 10.1.32 main.ctype_utf8mb4 : Modified in 10.1.33 -main.dyncol : Modified in 10.1.32 +main.grant : Modified in 10.1.34 +main.grant_not_windows : Added in 10.1.34 main.events_2 : MDEV-13277 - Server crash main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist main.events_slowlog : MDEV-12821 - Wrong result main.events_restart : MDEV-12236 - Server shutdown problem -main.fast_prefix_index_fetch_innodb : Modified in 10.1.32 -main.func_date_add : Modified in 10.1.32 main.func_misc : Modified in 10.1.33 main.func_str : Modified in 10.1.33 -main.func_time : Modified in 10.1.32 -main.having : Modified in 10.1.32 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure -main.join_outer : Modified in 10.1.32 +main.insert_select : Modified in 10.1.34 main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist +main.limit : Modified in 10.1.34 main.mdev-504 : MDEV-10607 - sporadic "can't connect" main.mdev375 : MDEV-10607 - sporadic "can't connect"; modified in 10.1.33 main.merge : MDEV-10607 - sporadic "can't connect" -main.myisam : Modified in 10.1.33 +main.myisam : Modified in 10.1.34 main.myisam_recover : Modified in 10.1.33 +main.mysql : Modified in 10.1.34 main.mysql_client_test_nonblock : MDEV-15096 - exec failed +main.mysql_cp932 : Modified in 10.1.34 main.mysql_upgrade_noengine : MDEV-14355 - Plugin is busy -main.mysqlslap : MDEV-11801 - timeout +main.mysqldump : Modified in 10.1.34 +main.mysqlslap : MDEV-11801 - timeout; modified in 10.1.34 main.mysqltest : MDEV-9269 - fails on Alpha +main.olap : Modified in 10.1.34 main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan main.parser : Modified in 10.1.33 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.ps_qc_innodb : Added in 10.1.32 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; modified in 10.1.34 main.query_cache : MDEV-12895 - Wrong result main.query_cache_debug : MDEV-15281 - Resize or similar command in progress main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.read_only_innodb : Modified in 10.1.33 +main.read_only_innodb : Modified in 10.1.34 +main.rename : Modified in 10.1.34 +main.selectivity : Modified in 10.1.34 main.set_statement : MDEV-13183 - Wrong result main.show_explain : MDEV-10674 - sporadic failure -main.sp : Modified in 10.1.33 +main.sp : Modified in 10.1.34 main.sp-destruct : Modified in 10.1.33 main.sp-innodb : Modified in 10.1.33 main.sp-security : MDEV-10607 - sporadic "can't connect" +main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.statistics : Modified in 10.1.33 +main.statistics_close : Added in 10.1.34 main.status : MDEV-8510 - sporadic wrong result main.subselect4 : Modified in 10.1.33 main.subselect_innodb : MDEV-10614 - sporadic wrong results -main.subselect_mat : Modified in 10.1.32 main.subselect_sj : Modified in 10.1.33 +main.subselect_sj2_mat : Modified in 10.1.34 main.symlink-aria-11902 : MDEV-15098 - error 40 from storage engine main.symlink-myisam-11902 : MDEV-15098 - error 40 from storage engine main.tc_heuristic_recover : MDEV-15200 - wrong error on mysqld_stub_cmd +main.trigger : Modified in 10.1.34 main.type_blob : MDEV-15195 - Wrong result main.type_datetime_hires : MDEV-10687 - timeout -main.type_time : Modified in 10.1.32 -main.type_time_6065 : Modified in 10.1.32 main.variables : Modified in 10.1.33 main.view : Modified in 10.1.33 @@ -138,29 +144,32 @@ connect.zip : MDEV-13884 - Wrong result #---------------------------------------------------------------- -disks.disks : Added in 10.1.32 - -#---------------------------------------------------------------- - encryption.create_or_replace : MDEV-16115 - Trying to access tablespace encryption.debug_key_management : MDEV-13841 - Timeout on wait condition encryption.encrypt_and_grep : MDEV-13765 - Wrong result -encryption.innodb-bad-key-change : Modified in 10.1.32 -encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate +encryption.innodb-bad-key-change : Modified in 10.1.34 +encryption.innodb-bad-key-change2 : Modified in 10.1.34 +encryption.innodb-bad-key-change4 : Modified in 10.1.34 +encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate; modified in 10.1.34 +encryption.innodb-discard-import : Modified in 10.1.34 +encryption.innodb-encryption-disable : Modified in 10.1.34 encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result; modified in 10.1.33 encryption.innodb_encryption_filekeys : Modified in 10.1.33 -encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure; modified in 10.1.32 +encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb_first_page : MDEV-10689 - Crash encryption.innodb-first-page-read : MDEV-14356 - Timeout on wait condition +encryption.innodb-force-corrupt : Modified in 10.1.34 encryption.innodb_lotoftables : MDEV-16111 - Wrong result +encryption.innodb-missing-key : Modified in 10.1.34 encryption.innodb-page_encryption : MDEV-10641 - mutex problem -encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup -encryption.innodb-remove-encryption : Added in 10.1.33 +encryption.innodb-read-only : MDEV-14728 - Unable to get certificate +encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup; modified in 10.1.34 +encryption.innodb-redo-nokeys : Modified in 10.1.34 +encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition; a dded in 10.1.33 encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing -encryption.tempfiles : Modified in 10.1.32 #---------------------------------------------------------------- @@ -202,56 +211,60 @@ galera.MW-328A : MDEV-13876 - Wrong result #---------------------------------------------------------------- +handler.ps : Added in 10.1.34 + +#---------------------------------------------------------------- + innodb.alter_partitioned_xa : Added in 10.1.33 innodb.binlog_consistent : MDEV-10618 - Server fails to start -innodb.default_row_format_alter : Added in 10.1.32 -innodb.default_row_format_compatibility : Added in 10.1.32 -innodb.default_row_format_create : Added in 10.1.32 innodb.doublewrite : MDEV-12905 - Lost connection to MySQL server -innodb.file_format_defaults : Added in 10.1.32 -innodb_fts.fulltext2 : MDEV-14727 - Long semaphore wait innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup +innodb.innodb-alter : Added in 10.1.34 innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS innodb.innodb-alter-nullable : Modified in 10.1.33 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout -innodb.innodb-blob : MDEV-12053 - Client crash +innodb.innodb-blob : MDEV-12053 - Client crash; modified in 10.1.34 innodb.innodb_bug14147491 : MDEV-11808 - wrong error codes -innodb.innodb_bug27216817 : Added in 10.1.33 innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan innodb.innodb_bug48024 : MDEV-14352 - Assertion failure +innodb.innodb_bug54044 : Modified in 10.1.34 +innodb.innodb_defragment_small : Modified in 10.1.34 innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb_max_recordsize_64k : MDEV-15203 - wrong result +innodb.innodb-mdev7046 : Modified in 10.1.34 +innodb.innodb-page_compression_default : Modified in 10.1.34 innodb.innodb-page_compression_lzma : MDEV-14353 - wrong result on Fedora 25 +innodb.innodb-page_compression_snappy : Modified in 10.1.34 innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb_stats : MDEV-10682 - wrong result innodb.innodb_sys_semaphore_waits : MDEV-10331 - wrong result innodb.innodb_zip_innochecksum2 : MDEV-13882 - Warning: difficult to find free blocks +innodb.lock_deleted : Added in 10.1.34 innodb.log_file_size : MDEV-15668 - Not found pattern -innodb.mvcc : Added in 10.1.32 -innodb.read_only_recover_committed : Added in 10.1.32 -innodb.recovery_shutdown : MDEV-15671 - Warning: database page corruption; modified in 10.1.32 -innodb.restart : Added in 10.1.32 +innodb.recovery_shutdown : MDEV-15671 - Warning: database page corruption +innodb.rename_table : Added in 10.1.34 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning innodb.table_flags : MDEV-14363 - Operating system error number 2 -innodb_fts.fulltext_misc : MDEV-12636 - Valgrind warnings +#---------------------------------------------------------------- -innodb_zip.innodb-create-options : Modified in 10.1.32 -innodb_zip.innodb-zip : Modified in 10.1.32 +innodb_fts.basic : Added in 10.1.34 #---------------------------------------------------------------- -maria.dynamic : Added in 10.1.32 +maria.alter : Modified in 10.1.34 maria.insert_select : MDEV-12757 - Timeout -maria.maria : MDEV-14430 - Wrong result +maria.insert_select-7314 : MDEV-16492 - Timeout +maria.lock : Modified in 10.1.34 +maria.maria : MDEV-14430 - Wrong result; modified in 10.1.34 #---------------------------------------------------------------- mariabackup.absolute_ibdata_paths : Added in 10.1.33 +mariabackup.backup_ssl : Added in 10.1.34 mariabackup.incremental_encrypted : MDEV-15667 - Timeout mariabackup.mdev-14447 : MDEV-15201 - Timeout -mariabackup.undo_space_id : Added in 10.1.32 mariabackup.xb_compressed_encrypted : MDEV-14812 - Segfault #---------------------------------------------------------------- @@ -282,8 +295,8 @@ parts.partition_alter_innodb : Include file modified in 10.1.33 parts.partition_alter_maria : Include file modified in 10.1.33 parts.partition_alter_myisam : Include file modified in 10.1.33 parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query +parts.partition_auto_increment_archive : MDEV-16491 - Table marked as crashed parts.partition_auto_increment_maria : MDEV-14430 - Wrong result -parts.partition_basic_symlink_innodb : Modified in 10.1.32 parts.partition_debug_innodb : MDEV-15095 - table does not exist parts.partition_innodb_status_file : MDEV-12901 - Valgrind @@ -293,8 +306,8 @@ perfschema.func_file_io : MDEV-5708 - fails for s390x perfschema.func_mutex : MDEV-5708 - fails for s390x perfschema.hostcache_ipv4_max_con : Modified in 10.1.33 perfschema.hostcache_ipv6_max_con : Modified in 10.1.33 +perfschema.partition : Added in 10.1.34 perfschema.privilege_table_io : MDEV-13184 - Extra lines -perfschema.setup_actors : MDEV-10679 - rare crash perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders perfschema.stage_mdl_table : MDEV-12638 - Wrong result @@ -303,12 +316,14 @@ perfschema.threads_mysql : MDEV-10677 - sporadic wrong resul #---------------------------------------------------------------- plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url -plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.1.32 +plugins.processlist : Added in 10.1.34 +plugins.server_audit : MDEV-9562 - crashes on sol10-sparc; modified in 10.1.34 plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc #---------------------------------------------------------------- rpl.last_insert_id : MDEV-10625 - warnings in error log +rpl.rename : Added in 10.1.34 rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log @@ -331,15 +346,15 @@ rpl.rpl_insert_id : MDEV-15197 - Wrong result rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog -rpl.rpl_mdev6020 : MDEV-10630, MDEV-10417 - Timeouts, fails on Mips +rpl.rpl_mdev6020 : MDEV-10417 - Fails on Mips +rpl.rpl_mixed_implicit_commit_binlog : Modified in 10.1.34 rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed -rpl.rpl_non_direct_row_mixing_engines : MDEV-14491 - Long semaphore wait rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_parallel : MDEV-10653 - Timeouts rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-10511 - Timeout +rpl.rpl_parallel_optimistic : MDEV-10511 - Timeout; modified in 10.1.34 rpl.rpl_parallel_retry : MDEV-11119 - Server crash rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips @@ -349,20 +364,20 @@ rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed rpl.rpl_row_img_eng_min : MDEV-13875 - command "diff_files" failed rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed +rpl.rpl_row_implicit_commit_binlog : Modified in 10.1.34 rpl.rpl_row_index_choice : MDEV-15196 - Slave crash -rpl.rpl_row_mixing_engines : MDEV-14491 - Long semaphore wait rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_skip_repl : Added in 10.1.32 rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock rpl.rpl_start_stop_slave : MDEV-13567 - Replication failure +rpl.rpl_stm_implicit_commit_binlog : Modified in 10.1.34 rpl.rpl_stm_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion rpl.rpl_sync : MDEV-10633 - Database page corruption @@ -373,16 +388,11 @@ rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result spider.* : MDEV-9329 - tests are too memory-consuming -spider.spider_fixes : MDEV-12900 - Valgrind -spider.spider_fixes_part : MDEV-12900 - Valgrind - -spider/bg.basic_sql : MDEV-12900 - Valgrind spider/bg.direct_aggregate : MDEV-7098 - Trying to unlock mutex that wasn't locked spider/bg.direct_aggregate_part : MDEV-7098 - Trying to unlock mutex that wasn't locked -spider/bg.function : MDEV-12900 - Valgrind -spider/bg.ha : MDEV-7914 - Crash (only fixed in 10.3), MDEV-9329 - failures on s390x -spider/bg.ha_part : MDEV-7914 - Crash (only fixed in 10.3), MDEV-9329 - Fails on Ubuntu/s390x -spider/bg.spider_fixes : MDEV-7098 -Mutex problem, MDEV-9329 - failures on s390x, MDEV-12900 - Valgrind +spider/bg.ha : MDEV-9329 - failures on s390x +spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x +spider/bg.spider_fixes : MDEV-7098 -Mutex problem, MDEV-9329 - failures on s390x spider/bg.spider3_fixes : MDEV-12639 - Packets out of order spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x @@ -404,7 +414,6 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout -sys_vars.innodb_default_row_format_basic : Added in 10.1.32 sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.max_prepared_stmt_count_basic : Modified in 10.1.33 sys_vars.rpl_init_slave_func : MDEV-10149 - wrong results @@ -413,7 +422,6 @@ sys_vars.sysvars_server_embedded : Opt file added in 10.1.33 sys_vars.sysvars_server_notembedded : Opt file added in 10.1.33 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result -sys_vars.wsrep_sst_receive_address_basic : Modified in 10.1.32 #---------------------------------------------------------------- @@ -440,8 +448,6 @@ tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output tokudb_bugs.db917 : Modified in 10.1.33 tokudb_bugs.xa : MDEV-11804 - Lock wait timeout -tokudb_mariadb.mdev6657 : Modified in 10.1.32 - #---------------------------------------------------------------- unit.lf : MDEV-12897 - Signal 11 thrown @@ -459,5 +465,6 @@ wsrep.binlog_format : MDEV-11532 - WSREP has not yet prepared node wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node wsrep.mdev_6832 : MDEV-14195 - Failure upon check-testcase wsrep.pool_of_threads : MDEV-12234 - Library problem on Power +wsrep.variables : Modified in 10.1.34 wsrep_info.plugin : MDEV-12909 - Wrong result -- cgit v1.2.1 From c69357d8d4592b746a2dd7074c8fb6a437098b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 14 Jun 2018 15:47:39 +0300 Subject: MDEV-15611 Due to the failure of foreign key detection, Galera slave node killed himself. Merge following change from 10.2 revision-id: d52cff9f10aeea208a1058f7b5527e602125584c (mariadb-10.2.14-25-gd52cff9) parent(s): bc2501453c3ab9a2cf3516bc3557de8665bc2776 author: Sachin Setiya committer: Sachin Setiya timestamp: 2018-04-04 12:26:06 +0530 message: MDEV-15611 Due to the failure of foreign key detection, Galera... slave node killed himself. Problem:- If we try to delete table with foreign key and table whom it is referring with wsrep_slave_threads>1 then galera tries to execute both Delete_rows_log-event in parallel, which should not happen. Solution:- This is happening because we do not have foreign key info in write set. Upto version 10.2.7 it used to work fine. Actually it happening because of issue in commit 2f342c4. wsrep_must_process_fk should be used with negation. --- mysql-test/suite/galera/r/galera_mdev_15611.result | 15 +++++++++++ mysql-test/suite/galera/t/galera_mdev_15611.cnf | 5 ++++ mysql-test/suite/galera/t/galera_mdev_15611.test | 30 ++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 mysql-test/suite/galera/r/galera_mdev_15611.result create mode 100644 mysql-test/suite/galera/t/galera_mdev_15611.cnf create mode 100644 mysql-test/suite/galera/t/galera_mdev_15611.test (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_mdev_15611.result b/mysql-test/suite/galera/r/galera_mdev_15611.result new file mode 100644 index 00000000000..677ed98202d --- /dev/null +++ b/mysql-test/suite/galera/r/galera_mdev_15611.result @@ -0,0 +1,15 @@ +CREATE TABLE t1 ( +id int primary key +); +CREATE TABLE t2 ( +id int primary key , +f_id int DEFAULT NULL, FOREIGN KEY(f_id) REFERENCES t1 (id) +); +insert into t1 select 1; +#Running 200 insert in t2 table +select count(*) from t2; +count(*) +200 +delete from t2; +delete from t1; +drop table t2,t1; diff --git a/mysql-test/suite/galera/t/galera_mdev_15611.cnf b/mysql-test/suite/galera/t/galera_mdev_15611.cnf new file mode 100644 index 00000000000..b6f601c56b1 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_mdev_15611.cnf @@ -0,0 +1,5 @@ +!include ../galera_2nodes.cnf +[mysqld.1] + +[mysqld.2] +wsrep_slave_threads=6 diff --git a/mysql-test/suite/galera/t/galera_mdev_15611.test b/mysql-test/suite/galera/t/galera_mdev_15611.test new file mode 100644 index 00000000000..d32d7e75262 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_mdev_15611.test @@ -0,0 +1,30 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connection node_1 +CREATE TABLE t1 ( + id int primary key +); + +CREATE TABLE t2 ( + id int primary key , + f_id int DEFAULT NULL, FOREIGN KEY(f_id) REFERENCES t1 (id) +); + +insert into t1 select 1; + +--disable_query_log +--let $count=200 +--echo #Running 200 insert in t2 table +while($count) +{ + #Repeatedly execute the following SQL until you generate thousands of data + --eval insert into t2 values ($count, 1); + --dec $count +} +--enable_query_log + +select count(*) from t2; +delete from t2; +delete from t1; +drop table t2,t1; -- cgit v1.2.1 From b8514c94f61f37757a24df1c6b9a7dd530b3de12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 15 Jun 2018 14:09:15 +0300 Subject: MDEV-16496 Mariabackup: Implement --verbose option to instrument InnoDB log apply srv_print_verbose_log: Introduce the value 2 to refer to mariabackup --verbose. recv_recover_page(), recv_parse_log_recs(): Add output for mariabackup --verbose. --- mysql-test/suite/mariabackup/apply-log-only-incr.test | 4 ++-- mysql-test/suite/mariabackup/mdev-14447.test | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.test b/mysql-test/suite/mariabackup/apply-log-only-incr.test index 25cb3a82023..74ab680d840 100644 --- a/mysql-test/suite/mariabackup/apply-log-only-incr.test +++ b/mysql-test/suite/mariabackup/apply-log-only-incr.test @@ -36,7 +36,7 @@ connection default; --disable_result_log exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ; -exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ; +exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir ; --enable_result_log let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; @@ -44,7 +44,7 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; --source include/search_pattern_in_file.inc --echo # expect NOT FOUND -exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; +exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; --source include/search_pattern_in_file.inc --echo # expect NOT FOUND diff --git a/mysql-test/suite/mariabackup/mdev-14447.test b/mysql-test/suite/mariabackup/mdev-14447.test index 48f37646231..689b578f2ab 100644 --- a/mysql-test/suite/mariabackup/mdev-14447.test +++ b/mysql-test/suite/mariabackup/mdev-14447.test @@ -18,8 +18,8 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir --disable_result_log echo # Prepare full backup, apply incremental one; -exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir; -exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; +exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir; +exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; echo # Restore and check results; let $targetdir=$basedir; -- cgit v1.2.1 From 7fdb7d4058e5a41687057a4b56c5a7698521ba99 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 15 Jun 2018 18:20:36 +0200 Subject: more sst test failures * xtrabackup no longer support --compact * wsrep_sst_mysqldump wasn't always using --default-file * wsrep_sst.cc overquoted --default-file for wsrep_sst_mysqldump also remove redundant lines config and test lines, compiler warnings, and mark big tests as big. --- .../suite/galera/r/galera_sst_mysqldump_with_key.result | 4 ++-- mysql-test/suite/galera/t/galera_sst_mariabackup.test | 1 + mysql-test/suite/galera/t/galera_sst_mysqldump.test | 1 + .../suite/galera/t/galera_sst_mysqldump_with_key.cnf | 4 ---- .../suite/galera/t/galera_sst_mysqldump_with_key.test | 14 ++++++-------- mysql-test/suite/galera/t/galera_sst_rsync.test | 1 + .../suite/galera/t/galera_sst_xtrabackup-v2-options.cnf | 2 +- mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test | 1 + 8 files changed, 13 insertions(+), 15 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result index 227e1c15444..074481afc2d 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result @@ -1,4 +1,6 @@ Setting SST method to mysqldump ... +call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'"); +call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; @@ -105,5 +107,3 @@ CALL mtr.add_suppression("Can't open and lock privilege tables"); CALL mtr.add_suppression("Info table is not ready to be used"); CALL mtr.add_suppression("Native table .* has the wrong structure"); DROP USER sslsst; -SET GLOBAL general_log = ON; -SET GLOBAL slow_query_log = ON; diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup.test b/mysql-test/suite/galera/t/galera_sst_mariabackup.test index 0e7ac487700..bcb9ade3a25 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup.test +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup.test @@ -1,3 +1,4 @@ +--source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc --source include/have_mariabackup.inc diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.test b/mysql-test/suite/galera/t/galera_sst_mysqldump.test index 390e9815b20..835fac94a68 100644 --- a/mysql-test/suite/galera/t/galera_sst_mysqldump.test +++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.test @@ -1,3 +1,4 @@ +--source include/big_test.inc --source include/galera_cluster.inc --source suite/galera/include/galera_sst_set_mysqldump.inc diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf index e108484b248..44e5573b3e6 100644 --- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf @@ -12,10 +12,6 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore [mysqld] wsrep_debug=ON -ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem -ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem -ssl-key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem - [client] ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test index c813e04169f..0dbc63b531c 100644 --- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test +++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test @@ -5,9 +5,12 @@ --source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc ---source include/have_openssl.inc +--source include/have_ssl_communication.inc --source suite/galera/include/galera_sst_set_mysqldump.inc +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc --connection node_1 CREATE USER sslsst; @@ -18,12 +21,7 @@ SET GLOBAL wsrep_sst_auth = 'sslsst:'; --source suite/galera/include/galera_st_disconnect_slave.inc +--source include/auto_increment_offset_restore.inc --source suite/galera/include/galera_sst_restore.inc -DROP USER sslsst; - ---connection node_2 -# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108 -# Otherwise MTR's check_testcases complains -SET GLOBAL general_log = ON; -SET GLOBAL slow_query_log = ON; +DROP USER sslsst; diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-test/suite/galera/t/galera_sst_rsync.test index f796356cac7..5c08707e870 100644 --- a/mysql-test/suite/galera/t/galera_sst_rsync.test +++ b/mysql-test/suite/galera/t/galera_sst_rsync.test @@ -1,3 +1,4 @@ +--source include/big_test.inc --source include/galera_cluster.inc --let $node_1=node_1 diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf index 1e29673c0ff..3abf2549aae 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf @@ -8,7 +8,7 @@ wsrep_debug=ON [xtrabackup] backup-locks close-files -compact +#compact - disabled in xtrabackup 2.4, https://bugs.launchpad.net/percona-xtrabackup/+bug/1192834/comments/29 # compression requires qpress from the Percona repositories # compress # compress-threads=2 diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test index f1fd0f3ddf3..c270e4d0b19 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test @@ -1,3 +1,4 @@ +--source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc --source include/have_xtrabackup.inc -- cgit v1.2.1 From 352c7e0dfaa0f121c5b35e1d9fafb9ec8897e768 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 17 Jun 2018 17:15:21 +0400 Subject: MDEV-15905 select json_value('{"b":true}','$.b')=1 --> false with "Truncated incorrect DOUBLE value: 'true'". JSON_VALUE_TRUE and JSON_VALUE_FALSE should be handled specifically in Item_json_value. --- mysql-test/r/func_json.result | 3 +++ mysql-test/t/func_json.test | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 2ffeb83b0de..77a424171b1 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -739,3 +739,6 @@ drop table t1; select json_extract('{"test":8.437e-5}','$.test'); json_extract('{"test":8.437e-5}','$.test') 8.437e-5 +select json_value('{"b":true}','$.b')=1; +json_value('{"b":true}','$.b')=1 +1 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index a6ae934f7b4..b74915cd064 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -398,3 +398,10 @@ drop table t1; select json_extract('{"test":8.437e-5}','$.test'); +# +# MDEV-15905 select json_value('{"b":true}','$.b')=1 --> false with +# "Truncated incorrect DOUBLE value: 'true'" +# +select json_value('{"b":true}','$.b')=1; + + -- cgit v1.2.1 From eb77f8cf8de44ecaa7155afa7f55ece73b2b0497 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 18 Jun 2018 14:26:37 +0530 Subject: MDEV-16087 Inconsistent SELECT results when query cache is enabled The following conditions will decide the query cache retrieval or storing inside innodb: (1) There should not be any locks on the table. (2) Some other trx shouldn't invalidated the cache before the transaction started. (3) Read view shouldn't exist. If exists then the view low_limit_id should be greater than or equal to the transaction that invalidates the cache for the particular table. For read-only transaction: should satisfy the above (1) and (3) For read-write transaction: should satisfy the above (1), (2), (3). - Changed the variable from query_cache_inv_id to query_cache_inv_trx_id. - Moved the function row_search_check_if_query_cache_permitted from row0sel.h and made it as static function in ha_innodb.cc --- .../suite/innodb/r/innodb_query_cache.result | 39 ++++++++++++++++++ mysql-test/suite/innodb/t/innodb_query_cache.test | 47 ++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb_query_cache.result create mode 100644 mysql-test/suite/innodb/t/innodb_query_cache.test (limited to 'mysql-test') diff --git a/mysql-test/suite/innodb/r/innodb_query_cache.result b/mysql-test/suite/innodb/r/innodb_query_cache.result new file mode 100644 index 00000000000..bbacbdfd748 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_query_cache.result @@ -0,0 +1,39 @@ +# +# MDEV-16087 Inconsistent SELECT results when query cache is enabled +# +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; +create table t1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; +create table t2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; +create table t3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; +connect con1,localhost,root; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +select * from t2; +id +connection default; +insert into t3 () values (); +connection con1; +insert into t1 () values (); +select * from t3; +id +connect con2,localhost,root; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +select * from t3; +id +1 +select * from t3; +id +1 +select sql_no_cache * from t3; +id +1 +rollback; +connection con1; +rollback; +disconnect con1; +disconnect con2; +connection default; +drop table t1; +drop table t2; +drop table t3; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/suite/innodb/t/innodb_query_cache.test b/mysql-test/suite/innodb/t/innodb_query_cache.test new file mode 100644 index 00000000000..7dbdf986946 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_query_cache.test @@ -0,0 +1,47 @@ +-- source include/have_innodb.inc +-- source include/have_query_cache.inc +-- source include/not_embedded.inc + +--echo # +--echo # MDEV-16087 Inconsistent SELECT results when query cache is enabled +--echo # + +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; + +create table t1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; +create table t2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; +create table t3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB; + +connect (con1,localhost,root); +START TRANSACTION WITH CONSISTENT SNAPSHOT; +select * from t2; + +connection default; +insert into t3 () values (); + +connection con1; +insert into t1 () values (); +select * from t3; + +connect (con2,localhost,root); +START TRANSACTION WITH CONSISTENT SNAPSHOT; +select * from t3; +select * from t3; +select sql_no_cache * from t3; + +rollback; + +connection con1; + +rollback; + +disconnect con1; +disconnect con2; +connection default; + +drop table t1; +drop table t2; +drop table t3; + +set GLOBAL query_cache_type=default; -- cgit v1.2.1 From 5ba6cee01255186ea77a69f122d3a15c07f44f6d Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 18 Jun 2018 23:00:34 +0400 Subject: MDEV-16209 JSON_EXTRACT in query crashes server. The optimizer can create various item's over the original one, so we can't count on the exact item's type inside the comparison. --- mysql-test/r/func_json.result | 5 +++++ mysql-test/t/func_json.test | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 77a424171b1..564442a2880 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -742,3 +742,8 @@ json_extract('{"test":8.437e-5}','$.test') select json_value('{"b":true}','$.b')=1; json_value('{"b":true}','$.b')=1 1 +CREATE TABLE t1 (c VARCHAR(8)); +INSERT INTO t1 VALUES ('foo'),('bar'); +SELECT * FROM t1 WHERE c IN (JSON_EXTRACT('{"a":"b"}', '$.*')); +c +DROP TABLE t1; diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index b74915cd064..1b91061b9a3 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -404,4 +404,12 @@ select json_extract('{"test":8.437e-5}','$.test'); # select json_value('{"b":true}','$.b')=1; +# +# MDEV-16209 JSON_EXTRACT in query crashes server. +# + +CREATE TABLE t1 (c VARCHAR(8)); +INSERT INTO t1 VALUES ('foo'),('bar'); +SELECT * FROM t1 WHERE c IN (JSON_EXTRACT('{"a":"b"}', '$.*')); +DROP TABLE t1; -- cgit v1.2.1 From 15b92915ed93661a56f40430204d18bf7b7cf1fc Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 19 Jun 2018 13:02:02 +0400 Subject: MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe --- mysql-test/std_data/frm/t1.frm | Bin 0 -> 8584 bytes mysql-test/suite/vcol/r/vcol_misc.result | 10 ++++++++++ mysql-test/suite/vcol/t/vcol_misc.test | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 mysql-test/std_data/frm/t1.frm (limited to 'mysql-test') diff --git a/mysql-test/std_data/frm/t1.frm b/mysql-test/std_data/frm/t1.frm new file mode 100644 index 00000000000..a998f54ec67 Binary files /dev/null and b/mysql-test/std_data/frm/t1.frm differ diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 0a8d87dc2f7..92be94cbb81 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -354,5 +354,15 @@ a b c DROP TABLE t1; SET sql_mode=DEFAULT; # +# MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe +# +SHOW TABLES; +Tables_in_test +t1 +SHOW CREATE TABLE t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +ALTER TABLE t1; +ERROR HY000: Incorrect information in file: './test/t1.frm' +# # End of 5.5 tests # diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 1ac0b4f80b7..a123d21d574 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -1,5 +1,7 @@ --source include/have_ucs2.inc +let $MYSQLD_DATADIR= `select @@datadir`; + --disable_warnings drop table if exists t1,t2; --enable_warnings @@ -318,6 +320,20 @@ SELECT * FROM t1; DROP TABLE t1; SET sql_mode=DEFAULT; + +--echo # +--echo # MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe +--echo # + +--copy_file std_data/frm/t1.frm $MYSQLD_DATADIR/test/t1.frm +SHOW TABLES; +--error ER_NOT_FORM_FILE +SHOW CREATE TABLE t1; +--error ER_NOT_FORM_FILE +ALTER TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.frm + + --echo # --echo # End of 5.5 tests --echo # -- cgit v1.2.1 From 831df10981b7851871e1f3b8f04079df0cf5da36 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 16 Jun 2018 12:03:15 +0300 Subject: Add PART_INDIRECT_KEY_FLAG This is to mark that a field is indirectly part of a key, which simplifes checking if we need to have this field up to date to evaluate a key. For example: CREATE TABLE t1 (a int, b int as (a) virtual, c int as (b) virtual, index(c)) would mark a and b with PART_INDIRECT_KEY_FLAG. c is marked with PART_KEY_FLAG as before. --- mysql-test/suite/vcol/r/index.result | 38 ++++++++++++++++++++++++++++++++++++ mysql-test/suite/vcol/t/index.test | 25 ++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 mysql-test/suite/vcol/r/index.result create mode 100644 mysql-test/suite/vcol/t/index.test (limited to 'mysql-test') diff --git a/mysql-test/suite/vcol/r/index.result b/mysql-test/suite/vcol/r/index.result new file mode 100644 index 00000000000..cd4ebc96024 --- /dev/null +++ b/mysql-test/suite/vcol/r/index.result @@ -0,0 +1,38 @@ +CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; +insert into t1 (a) values (1),(2),(3); +update t1 set a=5 where a=3; +delete from t1 where a=1; +select * from t1; +a b c +2 3 4 +5 6 7 +select * from t1 where c=7; +a b c +5 6 7 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a b c +2 3 4 +5 6 7 +drop table t1; +CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb; +insert into t1 (a) values (1),(2),(3); +update t1 set a=5 where a=3; +delete from t1 where a=1; +select * from t1; +a b c +2 3 4 +5 6 7 +select * from t1 where c=7; +a b c +5 6 7 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a b c +2 3 4 +5 6 7 +drop table t1; diff --git a/mysql-test/suite/vcol/t/index.test b/mysql-test/suite/vcol/t/index.test new file mode 100644 index 00000000000..55d5b68f26b --- /dev/null +++ b/mysql-test/suite/vcol/t/index.test @@ -0,0 +1,25 @@ +--source include/have_innodb.inc + +# +# Test creating table with a key that consists of indirect virtual fields +# + +CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; +insert into t1 (a) values (1),(2),(3); +update t1 set a=5 where a=3; +delete from t1 where a=1; +select * from t1; +select * from t1 where c=7; +check table t1; +select * from t1; +drop table t1; + +CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb; +insert into t1 (a) values (1),(2),(3); +update t1 set a=5 where a=3; +delete from t1 where a=1; +select * from t1; +select * from t1 where c=7; +check table t1; +select * from t1; +drop table t1; -- cgit v1.2.1 From ab194666564acab29a4bcb7ca763e0ae0e691d1f Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 17 Jun 2018 14:19:51 +0300 Subject: MDEV-15114 ASAN heap-use-after-free in mem_heap_dup or dfield_data_is_binary_equal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug was that innobase_get_computed_value() trashed record[0] and data in Field_blob::value Fixed by using a record on the heap for innobase_get_computed_value() Reviewer: Marko Mäkelä --- mysql-test/suite/vcol/r/index.result | 53 ++++++++++++++++++++++++++++++ mysql-test/suite/vcol/t/index.test | 62 ++++++++++++++++++++++++++++++++++-- 2 files changed, 112 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/vcol/r/index.result b/mysql-test/suite/vcol/r/index.result index cd4ebc96024..8860a728bd1 100644 --- a/mysql-test/suite/vcol/r/index.result +++ b/mysql-test/suite/vcol/r/index.result @@ -1,3 +1,6 @@ +# +# Test table with a key that consists of indirect virtual fields +# CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; insert into t1 (a) values (1),(2),(3); update t1 set a=5 where a=3; @@ -36,3 +39,53 @@ a b c 2 3 4 5 6 7 drop table t1; +# +# MDEV-15114 +# ASAN heap-use-after-free in mem_heap_dup or +# dfield_data_is_binary_equal +# +CREATE TABLE t1 ( +pk INT, +extra tinyint, +c TEXT, +vc LONGTEXT AS (c) VIRTUAL, +i INT, +PRIMARY KEY(pk), +UNIQUE(i), +INDEX(vc(64)) +) ENGINE=InnoDB; +INSERT INTO t1 (pk,extra, c, i) VALUES (1, 10, REPEAT('foo ',15000),0); +REPLACE INTO t1 (pk,extra, c,i) SELECT pk,extra+10, c,i FROM t1; +select pk, extra, left(c, 10), length(c), left(vc,10), length(vc), extra from t1; +pk extra left(c, 10) length(c) left(vc,10) length(vc) extra +1 20 foo foo fo 60000 foo foo fo 60000 20 +DROP TABLE t1; +# +# Update of deleted row with binary logging enabled +# +SET BINLOG_FORMAT=row; +CREATE TABLE t1 ( +pk INT, +c TEXT, +vc LONGTEXT AS (c) VIRTUAL, +i INT, +PRIMARY KEY(pk), +UNIQUE(i), +INDEX(vc(64)) +) ENGINE=InnoDB; +INSERT INTO t1 (pk,c,i) VALUES (1,REPEAT('foo ',15000),10); +INSERT INTO t1 (pk,c,i) VALUES (2,REPEAT('bar ',15000),11); +connect c1,localhost,root,,; +connection c1; +begin; +DELETE from t1 WHERE pk=1; +connection default; +update t1 set pk=1 where pk=2; +connection c1; +commit; +connection default; +select pk, left(c, 10), length(c), i from t1; +pk left(c, 10) length(c) i +1 bar bar ba 60000 11 +drop table t1; +disconnect c1; diff --git a/mysql-test/suite/vcol/t/index.test b/mysql-test/suite/vcol/t/index.test index 55d5b68f26b..72eed0a8a40 100644 --- a/mysql-test/suite/vcol/t/index.test +++ b/mysql-test/suite/vcol/t/index.test @@ -1,8 +1,9 @@ --source include/have_innodb.inc +--source include/have_log_bin.inc -# -# Test creating table with a key that consists of indirect virtual fields -# +--echo # +--echo # Test table with a key that consists of indirect virtual fields +--echo # CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam; insert into t1 (a) values (1),(2),(3); @@ -23,3 +24,58 @@ select * from t1 where c=7; check table t1; select * from t1; drop table t1; + +--echo # +--echo # MDEV-15114 +--echo # ASAN heap-use-after-free in mem_heap_dup or +--echo # dfield_data_is_binary_equal +--echo # + +CREATE TABLE t1 ( + pk INT, + extra tinyint, + c TEXT, + vc LONGTEXT AS (c) VIRTUAL, + i INT, + PRIMARY KEY(pk), + UNIQUE(i), + INDEX(vc(64)) +) ENGINE=InnoDB; + +INSERT INTO t1 (pk,extra, c, i) VALUES (1, 10, REPEAT('foo ',15000),0); +REPLACE INTO t1 (pk,extra, c,i) SELECT pk,extra+10, c,i FROM t1; +select pk, extra, left(c, 10), length(c), left(vc,10), length(vc), extra from t1; +DROP TABLE t1; + +--echo # +--echo # Update of deleted row with binary logging enabled +--echo # + +SET BINLOG_FORMAT=row; + +CREATE TABLE t1 ( + pk INT, + c TEXT, + vc LONGTEXT AS (c) VIRTUAL, + i INT, + PRIMARY KEY(pk), + UNIQUE(i), + INDEX(vc(64)) +) ENGINE=InnoDB; + +INSERT INTO t1 (pk,c,i) VALUES (1,REPEAT('foo ',15000),10); +INSERT INTO t1 (pk,c,i) VALUES (2,REPEAT('bar ',15000),11); + +--connect (c1,localhost,root,,) +--connection c1 +begin; +DELETE from t1 WHERE pk=1; +--connection default +--send update t1 set pk=1 where pk=2 +--connection c1 +commit; +--connection default +--reap +select pk, left(c, 10), length(c), i from t1; +drop table t1; +disconnect c1; -- cgit v1.2.1 From 10d09a57f88cafaabcb6ba8475c1951fe329756e Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 18 Jun 2018 22:44:58 +0300 Subject: Fixed failing test acl_load_mutex-5170 Added flush tables to ensure that MyISAM tables are properly flushed before reboot --- mysql-test/suite/roles/acl_load_mutex-5170.result | 1 + mysql-test/suite/roles/acl_load_mutex-5170.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/roles/acl_load_mutex-5170.result b/mysql-test/suite/roles/acl_load_mutex-5170.result index 6f6688f446e..775541b94f7 100644 --- a/mysql-test/suite/roles/acl_load_mutex-5170.result +++ b/mysql-test/suite/roles/acl_load_mutex-5170.result @@ -1,6 +1,7 @@ create user user1@localhost; create role r1 with admin user1@localhost; grant all on test.* to r1; +flush tables; select 1; 1 1 diff --git a/mysql-test/suite/roles/acl_load_mutex-5170.test b/mysql-test/suite/roles/acl_load_mutex-5170.test index e77d191ea16..22b9dffb5fd 100644 --- a/mysql-test/suite/roles/acl_load_mutex-5170.test +++ b/mysql-test/suite/roles/acl_load_mutex-5170.test @@ -5,6 +5,7 @@ create user user1@localhost; create role r1 with admin user1@localhost; grant all on test.* to r1; +flush tables; --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect wait -- cgit v1.2.1 From 778df04661c72544baed4363a55b07362d5020ed Mon Sep 17 00:00:00 2001 From: Galina Shalygina Date: Tue, 19 Jun 2018 19:19:40 +0200 Subject: MDEV-16517: Server crash in Item_func_in::val_int() when IN predicate defined with non-constant values is pushed down The problem appears because of wrong changes made in MDEV-16090 in the Item_func_in::build_clone() method. For the clone of the IN predicate it copied 'cmp_fields' array values that become dirty after Item::cleanup_excluding_const_fields_processor has worked in pushdown. That causes crash. There is no need to copy 'cmp_fields' field, the array values should be NULLs in order to fix_fields() for the cloned IN predicate can set them correctly. fix_fields() computes values for 'cmp_fields' array only if they were not set earlier. --- mysql-test/r/derived_cond_pushdown.result | 139 ++++++++++++++++++++++++++++++ mysql-test/t/derived_cond_pushdown.test | 39 +++++++++ 2 files changed, 178 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 83e70dd634c..a2e84a1e419 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -9669,3 +9669,142 @@ EXPLAIN } } DROP TABLE t1; +# +# MDEV-16517: pushdown condition with the IN predicate defined +# with non-constant values +# +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,2),(1,3); +SELECT * FROM +( +SELECT t1.a +FROM t1 +WHERE 1 IN (0,t1.a) +GROUP BY t1.a +) AS dt1 +JOIN +( +SELECT t1.a +FROM t1 +WHERE 1 IN (0,t1.a) +) AS dt2 +ON dt1.a = dt2.a; +a a +1 1 +1 1 +EXPLAIN FORMAT=JSON SELECT * FROM +( +SELECT t1.a +FROM t1 +WHERE 1 IN (0,t1.a) +GROUP BY t1.a +) AS dt1 +JOIN +( +SELECT t1.a +FROM t1 +WHERE 1 IN (0,t1.a) +) AS dt2 +ON dt1.a = dt2.a; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "1 in (0,dt1.a)", + "materialized": { + "query_block": { + "select_id": 2, + "filesort": { + "sort_key": "t1.a", + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)" + } + } + } + } + } + }, + "block-nl-join": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNL", + "attached_condition": "t1.a = dt1.a" + } + } +} +SELECT * FROM +( +SELECT t1.a,MAX(t1.b) +FROM t1 +GROUP BY t1.a +) AS dt, t1 +WHERE dt.a=t1.a AND dt.a IN (1,t1.a); +a MAX(t1.b) a b +1 3 1 2 +1 3 1 3 +EXPLAIN FORMAT=JSON SELECT * FROM +( +SELECT t1.a,MAX(t1.b) +FROM t1 +GROUP BY t1.a +) AS dt, t1 +WHERE dt.a=t1.a AND dt.a IN (1,t1.a); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "dt.a in (1,dt.a)", + "materialized": { + "query_block": { + "select_id": 2, + "filesort": { + "sort_key": "t1.a", + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.a in (1,t1.a)" + } + } + } + } + } + }, + "block-nl-join": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNL", + "attached_condition": "t1.a = dt.a" + } + } +} +DROP TABLE t1; diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test index 718140d3a77..3103ddb5c55 100644 --- a/mysql-test/t/derived_cond_pushdown.test +++ b/mysql-test/t/derived_cond_pushdown.test @@ -1801,3 +1801,42 @@ EVAL $query; EVAL EXPLAIN FORMAT=JSON $query; DROP TABLE t1; + +--echo # +--echo # MDEV-16517: pushdown condition with the IN predicate defined +--echo # with non-constant values +--echo # + +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,2),(1,3); + +LET $query= +SELECT * FROM +( + SELECT t1.a + FROM t1 + WHERE 1 IN (0,t1.a) + GROUP BY t1.a +) AS dt1 +JOIN +( + SELECT t1.a + FROM t1 + WHERE 1 IN (0,t1.a) +) AS dt2 +ON dt1.a = dt2.a; +EVAL $query; +EVAL EXPLAIN FORMAT=JSON $query; + +LET $query= +SELECT * FROM +( + SELECT t1.a,MAX(t1.b) + FROM t1 + GROUP BY t1.a +) AS dt, t1 +WHERE dt.a=t1.a AND dt.a IN (1,t1.a); +EVAL $query; +EVAL EXPLAIN FORMAT=JSON $query; + +DROP TABLE t1; -- cgit v1.2.1 From 5f2a67a6c35fd0d833024652ddc33eab8bcb1ed4 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 20 Jun 2018 02:36:00 +0530 Subject: MDEV-15247: Crash when SET NAMES 'utf8' is set In this case we are accessing incorrect memory when we have mergeable semi-joins. In the case when we have mergeable semi joins parent select will have a table count of all the tables in that select plus all the tables involved in the IN-subquery. But this table count does not include the "sjm table" (only includes the inner and outer tables) denotes as in explain. --- mysql-test/r/subselect_sj2_mat.result | 90 +++++++++++++++++++++++++++++++++++ mysql-test/t/subselect_sj2_mat.test | 87 +++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index c629c8196c7..c27beb295b8 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1691,3 +1691,93 @@ id 12 13 drop table t1; +# +# MDEV-15247: Crash when SET NAMES 'utf8' is set +# +CREATE TABLE t1 ( +id_category int unsigned, +id_product int unsigned, +PRIMARY KEY (id_category,id_product) +) ENGINE=MyISAM; +INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102); +CREATE TABLE t2 ( +id_product int, +id_t2 int, +KEY id_t2 (id_t2), +KEY id_product (id_product) +) ENGINE=MyISAM; +INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32), +(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26), +(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32), +(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19), +(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19), +(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20), +(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32), +(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19), +(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16), +(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31), +(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24), +(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19), +(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31), +(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32), +(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26), +(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22), +(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19), +(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32), +(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30), +(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23), +(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19), +(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15), +(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33), +(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18), +(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15), +(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19); +CREATE TABLE t3 ( +id_product int unsigned, +PRIMARY KEY (id_product) +) ENGINE=MyISAM; +INSERT INTO t3 VALUES +(102),(103),(104),(105),(106),(107),(108),(109),(110), +(315371),(315373),(315374),(315375),(315376),(315377), +(315378),(315379),(315380); +CREATE TABLE t4 ( +id_product int not null, +id_shop int, +PRIMARY KEY (id_product,id_shop) +) ENGINE=MyISAM ; +INSERT INTO t4 VALUES +(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1), +(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1), +(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1), +(177,1),(176,1),(126,1),(315380,1); +CREATE TABLE t5 (id_product int) ENGINE=MyISAM; +INSERT INTO `t5` VALUES +(652),(668),(669),(670),(671),(673),(674),(675),(676), +(677),(679),(680),(681),(682),(683),(684),(685),(686); +explain +SELECT * FROM t3 +JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1) +JOIN t1 ON (t1.id_product = t3.id_product) +LEFT JOIN t5 ON (t5.id_product = t3.id_product) +WHERE 1=1 +AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32) +AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15) +AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19) +AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23) +AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index +1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) +5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where +4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 32 Using index condition; Using where +3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12 +2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 50 +6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 30 Using index condition; Using where +drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/t/subselect_sj2_mat.test b/mysql-test/t/subselect_sj2_mat.test index 0665cdf68fe..68a888012f2 100644 --- a/mysql-test/t/subselect_sj2_mat.test +++ b/mysql-test/t/subselect_sj2_mat.test @@ -345,3 +345,90 @@ WHERE ( (t.id IN (0,4,12,13,1,10,3,11)) ); drop table t1; + +--echo # +--echo # MDEV-15247: Crash when SET NAMES 'utf8' is set +--echo # + +CREATE TABLE t1 ( + id_category int unsigned, + id_product int unsigned, + PRIMARY KEY (id_category,id_product) +) ENGINE=MyISAM; + +INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102); + +CREATE TABLE t2 ( + id_product int, + id_t2 int, + KEY id_t2 (id_t2), + KEY id_product (id_product) +) ENGINE=MyISAM; + +INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32), +(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26), +(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32), +(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19), +(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19), +(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20), +(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32), +(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19), +(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16), +(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31), +(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24), +(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19), +(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31), +(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32), +(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26), +(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22), +(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19), +(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32), +(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30), +(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23), +(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19), +(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15), +(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33), +(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18), +(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15), +(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19); + +CREATE TABLE t3 ( + id_product int unsigned, + PRIMARY KEY (id_product) +) ENGINE=MyISAM; + +INSERT INTO t3 VALUES +(102),(103),(104),(105),(106),(107),(108),(109),(110), +(315371),(315373),(315374),(315375),(315376),(315377), +(315378),(315379),(315380); + +CREATE TABLE t4 ( + id_product int not null, + id_shop int, + PRIMARY KEY (id_product,id_shop) +) ENGINE=MyISAM ; + +INSERT INTO t4 VALUES +(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1), +(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1), +(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1), +(177,1),(176,1),(126,1),(315380,1); + +CREATE TABLE t5 (id_product int) ENGINE=MyISAM; +INSERT INTO `t5` VALUES +(652),(668),(669),(670),(671),(673),(674),(675),(676), +(677),(679),(680),(681),(682),(683),(684),(685),(686); + +explain +SELECT * FROM t3 + JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1) + JOIN t1 ON (t1.id_product = t3.id_product) +LEFT JOIN t5 ON (t5.id_product = t3.id_product) +WHERE 1=1 +AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32) +AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15) +AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19) +AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23) +AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26); + +drop table t1,t2,t3,t4,t5; -- cgit v1.2.1 From bb24663f5ad955a615172512c04779d219bb6645 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 20 Jun 2018 10:45:57 +0200 Subject: MDEV-13577 slave_parallel_mode=optimistic should not report the mode's specific temporary errors Revert 7bbe324fc17 Fix the bug differently (in log_event.cc) Fix the test case to actually fail without the bug fix --- mysql-test/suite/rpl/r/rpl_parallel_optimistic.result | 4 ++-- mysql-test/suite/rpl/t/rpl_parallel_optimistic.test | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result index a6da3399fab..3cd4f8231bf 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result @@ -1,6 +1,4 @@ include/rpl_init.inc [topology=1->2] -call mtr.add_suppression("Warning.*Deadlock found when trying to get lock; try restarting transaction"); -call mtr.add_suppression("Warning.*mysqld: Can't find record in 't2'"); ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; @@ -549,6 +547,7 @@ DELETE FROM t1; DELETE FROM t2; include/save_master_gtid.inc include/sync_with_master_gtid.inc +set global log_warnings=2; BEGIN; INSERT INTO t1 SET a=1; SET @save.binlog_format=@@session.binlog_format; @@ -567,6 +566,7 @@ DELETE FROM t2; include/save_master_gtid.inc include/sync_with_master_gtid.inc include/stop_slave.inc +set global log_warnings=default; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test index 28bf4a77fd4..9f6669279db 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test @@ -4,11 +4,6 @@ --let $rpl_topology=1->2 --source include/rpl_init.inc ---connection server_2 -call mtr.add_suppression("Warning.*Deadlock found when trying to get lock; try restarting transaction"); -# The following instruction is a part of the proof of MDEV-13577 fixes, below. -call mtr.add_suppression("Warning.*mysqld: Can't find record in 't2'"); - --connection server_1 ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; @@ -500,6 +495,7 @@ DELETE FROM t2; # The 1st of the following two trx:s a blocker on slave --connection server_2 +set global log_warnings=2; BEGIN; INSERT INTO t1 SET a=1; @@ -546,6 +542,7 @@ DELETE FROM t2; # --connection server_2 --source include/stop_slave.inc +set global log_warnings=default; SET GLOBAL slave_parallel_mode=@old_parallel_mode; SET GLOBAL slave_parallel_threads=@old_parallel_threads; --source include/start_slave.inc -- cgit v1.2.1 From 170b43c1568ba6b9a772e8bdfbe90bd06cc2a345 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 20 Jun 2018 16:36:46 +0400 Subject: MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment columns in HEAP, MyISAM, ARIA --- mysql-test/r/auto_increment.result | 29 ++++++++++++++++++++++++ mysql-test/suite/heap/heap_auto_increment.result | 29 ++++++++++++++++++++++++ mysql-test/suite/heap/heap_auto_increment.test | 25 ++++++++++++++++++++ mysql-test/suite/maria/maria.result | 29 ++++++++++++++++++++++++ mysql-test/suite/maria/maria.test | 25 ++++++++++++++++++++ mysql-test/t/auto_increment.test | 25 ++++++++++++++++++++ 6 files changed, 162 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 12cbf294b69..4c04c00b79f 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -537,3 +537,32 @@ pk -5 1 drop table t1; +# +# Start of 5.5 tests +# +# +# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +# +CREATE TABLE t1 ( +id TINYINT NOT NULL AUTO_INCREMENT, +name CHAR(30) NOT NULL, +PRIMARY KEY (id) +) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` tinyint(4) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +id name +-1 dog +2 cat +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/suite/heap/heap_auto_increment.result b/mysql-test/suite/heap/heap_auto_increment.result index 5b04a77e9eb..ab0c852f253 100644 --- a/mysql-test/suite/heap/heap_auto_increment.result +++ b/mysql-test/suite/heap/heap_auto_increment.result @@ -39,3 +39,32 @@ _rowid _rowid skey sval 1 1 1 hello 2 2 2 hey drop table t1; +# +# Start of 5.5 tests +# +# +# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +# +CREATE TABLE t1 ( +id TINYINT NOT NULL AUTO_INCREMENT, +name CHAR(30) NOT NULL, +PRIMARY KEY (id) +) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` tinyint(4) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +id name +-1 dog +2 cat +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/suite/heap/heap_auto_increment.test b/mysql-test/suite/heap/heap_auto_increment.test index 016bc946209..bd4a0eaa886 100644 --- a/mysql-test/suite/heap/heap_auto_increment.test +++ b/mysql-test/suite/heap/heap_auto_increment.test @@ -33,3 +33,28 @@ select _rowid,t1._rowid,skey,sval from t1; drop table t1; # End of 4.1 tests + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +--echo # + +CREATE TABLE t1 ( + id TINYINT NOT NULL AUTO_INCREMENT, + name CHAR(30) NOT NULL, + PRIMARY KEY (id) +) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 5.5 tests +--echo # + diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 7f8badb78ae..2aca47538cb 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2697,3 +2697,32 @@ ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (b) VALUES (''); ALTER TABLE t1 ENABLE KEYS; DROP TABLE t1; +# +# Start of 5.5 tests +# +# +# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +# +CREATE TABLE t1 ( +id TINYINT NOT NULL AUTO_INCREMENT, +name CHAR(30) NOT NULL, +PRIMARY KEY (id) +) ENGINE=ARIA; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` tinyint(4) NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +id name +-1 dog +2 cat +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index 39a9a06c4c2..ab8e72dc321 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -1990,3 +1990,28 @@ aria_page_checksum=$default_checksum, aria_log_file_size=$default_log_file_size; --enable_result_log --enable_query_log + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +--echo # + +CREATE TABLE t1 ( + id TINYINT NOT NULL AUTO_INCREMENT, + name CHAR(30) NOT NULL, + PRIMARY KEY (id) +) ENGINE=ARIA; +SHOW CREATE TABLE t1; +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 7f0ab5dc169..2fea2cfd351 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -397,3 +397,28 @@ insert into t1 values(null); select last_insert_id(); select * from t1; drop table t1; + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA +--echo # + +CREATE TABLE t1 ( + id TINYINT NOT NULL AUTO_INCREMENT, + name CHAR(30) NOT NULL, + PRIMARY KEY (id) +) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +INSERT INTO t1 (name) VALUES ('dog'); +UPDATE t1 SET id=-1 WHERE id=1; +INSERT INTO t1 (name) VALUES ('cat'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 5.5 tests +--echo # -- cgit v1.2.1 From 621caad3ca007f84ae3d9216b8a23219b334347e Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 20 Jun 2018 17:14:04 +0400 Subject: MDEV-11917 enum/set command-line options aren't respecting max-* settings. --- mysql-test/suite/sys_vars/r/maximum_basic.result | 30 ++++++++++++++++++++++ .../suite/sys_vars/t/maximum_basic-master.opt | 2 ++ mysql-test/suite/sys_vars/t/maximum_basic.test | 19 ++++++++++++++ 3 files changed, 51 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/sys_vars/r/maximum_basic.result b/mysql-test/suite/sys_vars/r/maximum_basic.result index 20b6bbc962e..becd6da91f4 100644 --- a/mysql-test/suite/sys_vars/r/maximum_basic.result +++ b/mysql-test/suite/sys_vars/r/maximum_basic.result @@ -16,3 +16,33 @@ Warning 1292 Truncated incorrect max_join_size value: '40960' SELECT @@session.max_join_size; @@session.max_join_size 8192 +SET @@session.use_stat_tables= COMPLEMENTARY; +SELECT @@session.use_stat_tables; +@@session.use_stat_tables +COMPLEMENTARY +SET @@session.use_stat_tables= PREFERABLY; +Warnings: +Warning 1292 Truncated incorrect use_stat_tables value: 'PREFERABLY' +SELECT @@session.use_stat_tables; +@@session.use_stat_tables +COMPLEMENTARY +SET @@session.use_stat_tables= 2; +Warnings: +Warning 1292 Truncated incorrect use_stat_tables value: '2' +SELECT @@session.use_stat_tables; +@@session.use_stat_tables +COMPLEMENTARY +SET @@session.sql_mode= 'REAL_AS_FLOAT'; +SELECT @@session.sql_mode; +@@session.sql_mode +REAL_AS_FLOAT +SET @@session.sql_mode= 'REAL_AS_FLOAT,ANSI_QUOTES'; +SELECT @@session.sql_mode; +@@session.sql_mode +REAL_AS_FLOAT,ANSI_QUOTES +SET @@session.sql_mode= 'ANSI_QUOTES,IGNORE_SPACE'; +Warnings: +Warning 1292 Truncated incorrect sql_mode value: 'ANSI_QUOTES,IGNORE_SPACE' +SELECT @@session.sql_mode; +@@session.sql_mode +ANSI_QUOTES diff --git a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt index b6e5666f4fb..16e365d491c 100644 --- a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt +++ b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt @@ -1,3 +1,5 @@ --maximum-auto-increment-increment=8192 --maximum-tmp-table-size=8192 --maximum-max-join-size=8192 +--maximum-use-stat-tables=COMPLEMENTARY +--maximum-sql-mode='REAL_AS_FLOAT,ANSI_QUOTES' diff --git a/mysql-test/suite/sys_vars/t/maximum_basic.test b/mysql-test/suite/sys_vars/t/maximum_basic.test index 9961f65883a..3153d62d562 100644 --- a/mysql-test/suite/sys_vars/t/maximum_basic.test +++ b/mysql-test/suite/sys_vars/t/maximum_basic.test @@ -18,3 +18,22 @@ SELECT @@session.tmp_table_size; SET @@session.max_join_size=40960; SELECT @@session.max_join_size; +# +# enum +# +SET @@session.use_stat_tables= COMPLEMENTARY; +SELECT @@session.use_stat_tables; +SET @@session.use_stat_tables= PREFERABLY; +SELECT @@session.use_stat_tables; +SET @@session.use_stat_tables= 2; +SELECT @@session.use_stat_tables; + +# +# set +# +SET @@session.sql_mode= 'REAL_AS_FLOAT'; +SELECT @@session.sql_mode; +SET @@session.sql_mode= 'REAL_AS_FLOAT,ANSI_QUOTES'; +SELECT @@session.sql_mode; +SET @@session.sql_mode= 'ANSI_QUOTES,IGNORE_SPACE'; +SELECT @@session.sql_mode; -- cgit v1.2.1 From 0a9d78f51d74be7708f2efd940311bf7b33108e9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 20 Jun 2018 23:27:23 +0200 Subject: Revert "MDEV-16075: Workaround to run MTR test suite for make test" This reverts commit d39629f01ebdd5b89186e6c8a4a8d3dd528bd26a. Because running mtr for many hours with no output whatsoever is not really what we should do. And in 5.5 `make test` just works anyway, nothing to fix here. --- mysql-test/suite/unit/suite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm index 43eaa970350..78d82ccb31d 100644 --- a/mysql-test/suite/unit/suite.pm +++ b/mysql-test/suite/unit/suite.pm @@ -31,7 +31,7 @@ sub start_test { return "Not run for embedded server" if $::opt_embedded_server; return "Not configured to run ctest" unless -f "../CTestTestfile.cmake"; my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : ""; - my (@ctest_list)= `cd .. && ctest $opt_vs_config -E MTR -C default_ignore --show-only --verbose`; + my (@ctest_list)= `cd .. && ctest $opt_vs_config --show-only --verbose`; return "No ctest" if $?; my ($command, %tests); -- cgit v1.2.1 From 2b8f2b3e882f7ea93c6743f2ad717f968bd245fe Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 20 Jun 2018 23:30:49 +0200 Subject: Fix unit suite on Windows and in out-of-source builds --- mysql-test/suite/unit/suite.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm index 78d82ccb31d..ce7ccefe926 100644 --- a/mysql-test/suite/unit/suite.pm +++ b/mysql-test/suite/unit/suite.pm @@ -28,10 +28,11 @@ sub start_test { } { + my $bin=$ENV{MTR_BINDIR} || '..'; return "Not run for embedded server" if $::opt_embedded_server; - return "Not configured to run ctest" unless -f "../CTestTestfile.cmake"; - my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : ""; - my (@ctest_list)= `cd .. && ctest $opt_vs_config --show-only --verbose`; + return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake"; + my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : ""; + my (@ctest_list)= `cd $bin && ctest $ctest_vs --show-only --verbose`; return "No ctest" if $?; my ($command, %tests); -- cgit v1.2.1 From 5f0510225aa149377b8563f6e96b74d05d41f080 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 18 Jun 2018 21:00:25 +0200 Subject: MDEV-16238 root/localhost authn prioritizes authentication_string over Password Don't let SET PASSWORD to set the password, if auth_string is set. Now SET PASSWORD always sets the plugin/auth_string fields and clears the password field (on pre-plugin mysql.user table it works as before). --- mysql-test/r/grant2.result | 8 +- mysql-test/r/set_password.result | 177 +++++++++++++++++++++ mysql-test/r/set_password_plugin-9835.result | 160 ------------------- mysql-test/r/show_grants_with_plugin-7985.result | 6 +- .../suite/rpl/include/rpl_mixed_check_user.inc | 4 +- mysql-test/suite/rpl/r/rpl_do_grant.result | 14 +- mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result | 68 ++++---- mysql-test/suite/rpl/t/rpl_do_grant.test | 8 +- mysql-test/t/grant2.test | 4 +- mysql-test/t/set_password.test | 145 +++++++++++++++++ mysql-test/t/set_password_plugin-9835.test | 131 --------------- mysql-test/t/show_grants_with_plugin-7985.test | 2 +- 12 files changed, 379 insertions(+), 348 deletions(-) create mode 100644 mysql-test/r/set_password.result delete mode 100644 mysql-test/r/set_password_plugin-9835.result create mode 100644 mysql-test/t/set_password.test delete mode 100644 mysql-test/t/set_password_plugin-9835.test (limited to 'mysql-test') diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index d7e42f9b7aa..ffb41c1b5f8 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -372,8 +372,8 @@ mysqltest_1@127.0.0.1 set password = password('changed'); disconnect b12302; connection default; -select host, length(password) from mysql.user where user like 'mysqltest\_1'; -host length(password) +select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; +host length(authentication_string) 127.0.0.1 41 revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1'; delete from mysql.user where user like 'mysqltest\_1'; @@ -387,8 +387,8 @@ mysqltest_1@127.0.0.0/255.0.0.0 set password = password('changed'); disconnect b12302_2; connection default; -select host, length(password) from mysql.user where user like 'mysqltest\_1'; -host length(password) +select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; +host length(authentication_string) 127.0.0.0/255.0.0.0 41 revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0'; delete from mysql.user where user like 'mysqltest\_1'; diff --git a/mysql-test/r/set_password.result b/mysql-test/r/set_password.result new file mode 100644 index 00000000000..f0faeda1974 --- /dev/null +++ b/mysql-test/r/set_password.result @@ -0,0 +1,177 @@ +set global secure_auth=0; +create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user newpassnat@localhost identified via 'mysql_native_password'; +set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; +create user oldpass@localhost identified by password '378b243e220ca493'; +create user oldpassold@localhost identified with 'mysql_old_password'; +set password for oldpassold@localhost = '378b243e220ca493'; +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; +user host password plugin authentication_string +natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +newpassnat localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 +oldauth localhost 378b243e220ca493 +oldpass localhost 378b243e220ca493 +oldpassold localhost mysql_old_password 378b243e220ca493 +connect con,localhost,natauth,test,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +flush privileges; +connect con,localhost,natauth,test,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +set password for natauth@localhost = PASSWORD('test2'); +set password for newpass@localhost = PASSWORD('test2'); +set password for newpassnat@localhost = PASSWORD('test2'); +set password for oldauth@localhost = PASSWORD('test2'); +set password for oldpass@localhost = PASSWORD('test2'); +set password for oldpassold@localhost = PASSWORD('test2'); +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; +user host password plugin authentication_string +natauth localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +newpass localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +newpassnat localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldauth localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldpass localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +oldpassold localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E +connect con,localhost,natauth,test2,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test2,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test2,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test2,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test2,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test2,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +flush privileges; +connect con,localhost,natauth,test2,; +select current_user(); +current_user() +natauth@localhost +disconnect con; +connect con,localhost,newpass,test2,; +select current_user(); +current_user() +newpass@localhost +disconnect con; +connect con,localhost,newpassnat,test2,; +select current_user(); +current_user() +newpassnat@localhost +disconnect con; +connect con,localhost,oldauth,test2,; +select current_user(); +current_user() +oldauth@localhost +disconnect con; +connect con,localhost,oldpass,test2,; +select current_user(); +current_user() +oldpass@localhost +disconnect con; +connect con,localhost,oldpassold,test2,; +select current_user(); +current_user() +oldpassold@localhost +disconnect con; +connection default; +drop user natauth@localhost, newpass@localhost, newpassnat@localhost; +drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; +set global secure_auth=default; +create user foo@localhost identified with mysql_native_password; +update mysql.user set authentication_string=password('foo'), plugin='mysql_native_password' where user='foo' and host='localhost'; +set password for 'foo'@'localhost' = password('bar'); +flush privileges; +connect foo, localhost, foo, bar; +select user(), current_user(); +user() current_user() +foo@localhost foo@localhost +show grants; +Grants for foo@localhost +GRANT USAGE ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB' +disconnect foo; +connection default; +select user,host,password,plugin,authentication_string from mysql.user where user='foo'; +user host password plugin authentication_string +foo localhost mysql_native_password *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB +drop user foo@localhost; diff --git a/mysql-test/r/set_password_plugin-9835.result b/mysql-test/r/set_password_plugin-9835.result deleted file mode 100644 index 3cc723957d8..00000000000 --- a/mysql-test/r/set_password_plugin-9835.result +++ /dev/null @@ -1,160 +0,0 @@ -set global secure_auth=0; -create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; -create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; -create user newpassnat@localhost identified via 'mysql_native_password'; -set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; -create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; -create user oldpass@localhost identified by password '378b243e220ca493'; -create user oldpassold@localhost identified with 'mysql_old_password'; -set password for oldpassold@localhost = '378b243e220ca493'; -select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; -user host password plugin authentication_string -natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 -newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 -newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 -oldauth localhost 378b243e220ca493 -oldpass localhost 378b243e220ca493 -oldpassold localhost 378b243e220ca493 -connect con,localhost,natauth,test,; -select current_user(); -current_user() -natauth@localhost -disconnect con; -connect con,localhost,newpass,test,; -select current_user(); -current_user() -newpass@localhost -disconnect con; -connect con,localhost,newpassnat,test,; -select current_user(); -current_user() -newpassnat@localhost -disconnect con; -connect con,localhost,oldauth,test,; -select current_user(); -current_user() -oldauth@localhost -disconnect con; -connect con,localhost,oldpass,test,; -select current_user(); -current_user() -oldpass@localhost -disconnect con; -connect con,localhost,oldpassold,test,; -select current_user(); -current_user() -oldpassold@localhost -disconnect con; -connection default; -flush privileges; -connect con,localhost,natauth,test,; -select current_user(); -current_user() -natauth@localhost -disconnect con; -connect con,localhost,newpass,test,; -select current_user(); -current_user() -newpass@localhost -disconnect con; -connect con,localhost,newpassnat,test,; -select current_user(); -current_user() -newpassnat@localhost -disconnect con; -connect con,localhost,oldauth,test,; -select current_user(); -current_user() -oldauth@localhost -disconnect con; -connect con,localhost,oldpass,test,; -select current_user(); -current_user() -oldpass@localhost -disconnect con; -connect con,localhost,oldpassold,test,; -select current_user(); -current_user() -oldpassold@localhost -disconnect con; -connection default; -set password for natauth@localhost = PASSWORD('test2'); -set password for newpass@localhost = PASSWORD('test2'); -set password for newpassnat@localhost = PASSWORD('test2'); -set password for oldauth@localhost = PASSWORD('test2'); -set password for oldpass@localhost = PASSWORD('test2'); -set password for oldpassold@localhost = PASSWORD('test2'); -select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; -user host password plugin authentication_string -natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -oldauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -oldpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -oldpassold localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E -connect con,localhost,natauth,test2,; -select current_user(); -current_user() -natauth@localhost -disconnect con; -connect con,localhost,newpass,test2,; -select current_user(); -current_user() -newpass@localhost -disconnect con; -connect con,localhost,newpassnat,test2,; -select current_user(); -current_user() -newpassnat@localhost -disconnect con; -connect con,localhost,oldauth,test2,; -select current_user(); -current_user() -oldauth@localhost -disconnect con; -connect con,localhost,oldpass,test2,; -select current_user(); -current_user() -oldpass@localhost -disconnect con; -connect con,localhost,oldpassold,test2,; -select current_user(); -current_user() -oldpassold@localhost -disconnect con; -connection default; -flush privileges; -connect con,localhost,natauth,test2,; -select current_user(); -current_user() -natauth@localhost -disconnect con; -connect con,localhost,newpass,test2,; -select current_user(); -current_user() -newpass@localhost -disconnect con; -connect con,localhost,newpassnat,test2,; -select current_user(); -current_user() -newpassnat@localhost -disconnect con; -connect con,localhost,oldauth,test2,; -select current_user(); -current_user() -oldauth@localhost -disconnect con; -connect con,localhost,oldpass,test2,; -select current_user(); -current_user() -oldpass@localhost -disconnect con; -connect con,localhost,oldpassold,test2,; -select current_user(); -current_user() -oldpassold@localhost -disconnect con; -connection default; -drop user natauth@localhost, newpass@localhost, newpassnat@localhost; -drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; -set global secure_auth=default; diff --git a/mysql-test/r/show_grants_with_plugin-7985.result b/mysql-test/r/show_grants_with_plugin-7985.result index 81880e5cc40..0f8e1e39969 100644 --- a/mysql-test/r/show_grants_with_plugin-7985.result +++ b/mysql-test/r/show_grants_with_plugin-7985.result @@ -71,7 +71,7 @@ connection default; set password for u1 = PASSWORD('SOMETHINGELSE'); select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; user host password plugin authentication_string -u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 +u1 % mysql_native_password *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 # # Here we should use the password field, as that primes over # the authentication_string field. @@ -112,7 +112,7 @@ connection default; # Now we remove the authentication plugin password, flush privileges and # try again. # -update mysql.user set authentication_string = '' where user='u1'; +update mysql.user set password=authentication_string, plugin='', authentication_string='' where user='u1'; select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; user host password plugin authentication_string u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 @@ -172,7 +172,7 @@ connection default; set password for u1 = ''; select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; user host password plugin authentication_string -u1 % +u1 % mysql_native_password # # Test no password connect. # diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc index 8bf5a4eea1e..548fdf789da 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc @@ -5,9 +5,9 @@ # Requirements: ######################################### -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; sync_slave_with_master; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index aed8bba3bc0..9eca21b38e4 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -20,21 +20,21 @@ GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost' connection master; set password for rpl_do_grant@localhost=password("does it work?"); connection slave; -select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; -password<>_binary'' +select authentication_string<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; +authentication_string<>_binary'' 1 connection master; -update mysql.user set password='' where user='rpl_do_grant'; +update mysql.user set authentication_string='' where user='rpl_do_grant'; flush privileges; -select password<>'' from mysql.user where user='rpl_do_grant'; -password<>'' +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; +authentication_string<>'' 0 set sql_mode='ANSI_QUOTES'; set password for rpl_do_grant@localhost=password('does it work?'); set sql_mode=''; connection slave; -select password<>'' from mysql.user where user='rpl_do_grant'; -password<>'' +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; +authentication_string<>'' 1 connection master; delete from mysql.user where user=_binary'rpl_do_grant'; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 1f6a9370090..24ce8899e2c 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -480,72 +480,72 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ******************** CREATE USER ******************** CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 N connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 N connection master; ******************** GRANT ******************** GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 Y +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 Y connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 Y +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 Y connection master; ******************** REVOKE ******************** REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 N connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *1111111111111111111111111111111111111111 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl *1111111111111111111111111111111111111111 N connection master; ******************** SET PASSWORD ******************** SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *0000000000000000000000000000000000000000 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl mysql_native_password *0000000000000000000000000000000000000000 N connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl *0000000000000000000000000000000000000000 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl mysql_native_password *0000000000000000000000000000000000000000 N connection master; ******************** RENAME USER ******************** RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl_2 mysql_native_password *0000000000000000000000000000000000000000 N connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv -localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv +localhost user_test_rpl_2 mysql_native_password *0000000000000000000000000000000000000000 N connection master; ******************** DROP USER ******************** DROP USER 'user_test_rpl_2'@'localhost'; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv connection slave; USE test_rpl; -SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; -host user password select_priv +SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%'; +host user password plugin authentication_string select_priv connection master; INSERT INTO t1 VALUES(100, 'test'); diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index 83b9a84744f..0024c7039e4 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -27,20 +27,20 @@ show grants for rpl_do_grant@localhost; connection master; set password for rpl_do_grant@localhost=password("does it work?"); sync_slave_with_master; -select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; +select authentication_string<>_binary'' from mysql.user where user=_binary'rpl_do_grant'; # # Bug#24158 SET PASSWORD in binary log fails under ANSI_QUOTES # connection master; -update mysql.user set password='' where user='rpl_do_grant'; +update mysql.user set authentication_string='' where user='rpl_do_grant'; flush privileges; -select password<>'' from mysql.user where user='rpl_do_grant'; +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; set sql_mode='ANSI_QUOTES'; set password for rpl_do_grant@localhost=password('does it work?'); set sql_mode=''; sync_slave_with_master; -select password<>'' from mysql.user where user='rpl_do_grant'; +select authentication_string<>'' from mysql.user where user='rpl_do_grant'; # clear what we have done, to not influence other tests. diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index cee5df089df..1f7450df6c1 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -385,7 +385,7 @@ select current_user(); set password = password('changed'); disconnect b12302; connection default; -select host, length(password) from mysql.user where user like 'mysqltest\_1'; +select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1'; delete from mysql.user where user like 'mysqltest\_1'; flush privileges; @@ -396,7 +396,7 @@ select current_user(); set password = password('changed'); disconnect b12302_2; connection default; -select host, length(password) from mysql.user where user like 'mysqltest\_1'; +select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1'; revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0'; delete from mysql.user where user like 'mysqltest\_1'; flush privileges; diff --git a/mysql-test/t/set_password.test b/mysql-test/t/set_password.test new file mode 100644 index 00000000000..4d8010d3b25 --- /dev/null +++ b/mysql-test/t/set_password.test @@ -0,0 +1,145 @@ +# +# MDEV-9835 Valid password is not working after server restart. +# +# Various combinations of SET PASSWORD and not-empty mysql.user.plugin field +# +--source include/not_embedded.inc + +--enable_connect_log + +set global secure_auth=0; + +# The hash (old and new) is for 'test' +create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user newpassnat@localhost identified via 'mysql_native_password'; +set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; + +create user oldpass@localhost identified by password '378b243e220ca493'; + +create user oldpassold@localhost identified with 'mysql_old_password'; +set password for oldpassold@localhost = '378b243e220ca493'; + +--sorted_result +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; + +--connect(con,localhost,natauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test,) +select current_user(); +--disconnect con + +--connection default + +flush privileges; + +--connect(con,localhost,natauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test,) +select current_user(); +--disconnect con + +--connection default + +# changing to the NEW password hash +set password for natauth@localhost = PASSWORD('test2'); +set password for newpass@localhost = PASSWORD('test2'); +set password for newpassnat@localhost = PASSWORD('test2'); +set password for oldauth@localhost = PASSWORD('test2'); +set password for oldpass@localhost = PASSWORD('test2'); +set password for oldpassold@localhost = PASSWORD('test2'); + +--sorted_result +select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; + +--connect(con,localhost,natauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test2,) +select current_user(); +--disconnect con + +--connection default + +flush privileges; + +--connect(con,localhost,natauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,newpassnat,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldauth,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpass,test2,) +select current_user(); +--disconnect con +--connect(con,localhost,oldpassold,test2,) +select current_user(); +--disconnect con + +--connection default +drop user natauth@localhost, newpass@localhost, newpassnat@localhost; +drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; +set global secure_auth=default; + +# +# MDEV-16238 root/localhost authn prioritizes authentication_string over Password +# +create user foo@localhost identified with mysql_native_password; +update mysql.user set authentication_string=password('foo'), plugin='mysql_native_password' where user='foo' and host='localhost'; +set password for 'foo'@'localhost' = password('bar'); +flush privileges; +--connect foo, localhost, foo, bar +select user(), current_user(); +show grants; +--disconnect foo +--connection default +select user,host,password,plugin,authentication_string from mysql.user where user='foo'; +drop user foo@localhost; diff --git a/mysql-test/t/set_password_plugin-9835.test b/mysql-test/t/set_password_plugin-9835.test deleted file mode 100644 index 6afccd74f9d..00000000000 --- a/mysql-test/t/set_password_plugin-9835.test +++ /dev/null @@ -1,131 +0,0 @@ -# -# MDEV-9835 Valid password is not working after server restart. -# -# Various combinations of SET PASSWORD and not-empty mysql.user.plugin field -# ---source include/not_embedded.inc - ---enable_connect_log - -set global secure_auth=0; - -# The hash (old and new) is for 'test' -create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; - -create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; - -create user newpassnat@localhost identified via 'mysql_native_password'; -set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; - -create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493'; - -create user oldpass@localhost identified by password '378b243e220ca493'; - -create user oldpassold@localhost identified with 'mysql_old_password'; -set password for oldpassold@localhost = '378b243e220ca493'; - ---sorted_result -select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; - ---connect(con,localhost,natauth,test,) -select current_user(); ---disconnect con ---connect(con,localhost,newpass,test,) -select current_user(); ---disconnect con ---connect(con,localhost,newpassnat,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldauth,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpass,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpassold,test,) -select current_user(); ---disconnect con - ---connection default - -flush privileges; - ---connect(con,localhost,natauth,test,) -select current_user(); ---disconnect con ---connect(con,localhost,newpass,test,) -select current_user(); ---disconnect con ---connect(con,localhost,newpassnat,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldauth,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpass,test,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpassold,test,) -select current_user(); ---disconnect con - ---connection default - -# changing to the NEW password hash -set password for natauth@localhost = PASSWORD('test2'); -set password for newpass@localhost = PASSWORD('test2'); -set password for newpassnat@localhost = PASSWORD('test2'); -set password for oldauth@localhost = PASSWORD('test2'); -set password for oldpass@localhost = PASSWORD('test2'); -set password for oldpassold@localhost = PASSWORD('test2'); - ---sorted_result -select user, host, password, plugin, authentication_string from mysql.user where user != 'root'; - ---connect(con,localhost,natauth,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,newpass,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,newpassnat,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldauth,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpass,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpassold,test2,) -select current_user(); ---disconnect con - ---connection default - -flush privileges; - ---connect(con,localhost,natauth,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,newpass,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,newpassnat,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldauth,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpass,test2,) -select current_user(); ---disconnect con ---connect(con,localhost,oldpassold,test2,) -select current_user(); ---disconnect con - ---connection default -drop user natauth@localhost, newpass@localhost, newpassnat@localhost; -drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost; -set global secure_auth=default; - diff --git a/mysql-test/t/show_grants_with_plugin-7985.test b/mysql-test/t/show_grants_with_plugin-7985.test index 84f71c72667..85952870254 100644 --- a/mysql-test/t/show_grants_with_plugin-7985.test +++ b/mysql-test/t/show_grants_with_plugin-7985.test @@ -91,7 +91,7 @@ show grants; --echo # Now we remove the authentication plugin password, flush privileges and --echo # try again. --echo # -update mysql.user set authentication_string = '' where user='u1'; +update mysql.user set password=authentication_string, plugin='', authentication_string='' where user='u1'; select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; flush privileges; show grants for u1; -- cgit v1.2.1 From af2dd582e64a6903bee766cd992666da98ca8d69 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 18 Jun 2018 21:28:27 +0200 Subject: empty password is a valid password, don't crash --- mysql-test/r/set_password.result | 4 ++++ mysql-test/t/set_password.test | 2 ++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/set_password.result b/mysql-test/r/set_password.result index f0faeda1974..315d0bef9fb 100644 --- a/mysql-test/r/set_password.result +++ b/mysql-test/r/set_password.result @@ -174,4 +174,8 @@ connection default; select user,host,password,plugin,authentication_string from mysql.user where user='foo'; user host password plugin authentication_string foo localhost mysql_native_password *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB +set password for 'foo'@'localhost' = ''; +select user,host,password,plugin,authentication_string from mysql.user where user='foo'; +user host password plugin authentication_string +foo localhost mysql_native_password drop user foo@localhost; diff --git a/mysql-test/t/set_password.test b/mysql-test/t/set_password.test index 4d8010d3b25..fc1ecb5ef5c 100644 --- a/mysql-test/t/set_password.test +++ b/mysql-test/t/set_password.test @@ -142,4 +142,6 @@ show grants; --disconnect foo --connection default select user,host,password,plugin,authentication_string from mysql.user where user='foo'; +set password for 'foo'@'localhost' = ''; +select user,host,password,plugin,authentication_string from mysql.user where user='foo'; drop user foo@localhost; -- cgit v1.2.1 From fe3f9fa9183ea3d10397b6f7f4d422ae9bba00a4 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 21 Jun 2018 15:17:15 +0400 Subject: MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8 --- mysql-test/r/type_blob.result | 16 ++++++++++++++++ mysql-test/t/type_blob.test | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 569ba65df3f..3c99366168c 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -1063,3 +1063,19 @@ DROP TABLE t1; # # End of 5.5 tests # +# +# Start of 10.2 test +# +# +# MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8 +# +CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +# +# End of 10.2 test +# diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 8db6ac6da2a..2c74d4ea241 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -680,3 +680,21 @@ DROP TABLE t1; --echo # --echo # End of 5.5 tests --echo # + + +--echo # +--echo # Start of 10.2 test +--echo # + +--echo # +--echo # MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8 +--echo # + +CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8); +SHOW CREATE TABLE t1; +DROP TABLE t1; + + +--echo # +--echo # End of 10.2 test +--echo # -- cgit v1.2.1 From 0d745343fc1e274a938bef9e91b18c508076ae62 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Jun 2018 09:52:21 +0200 Subject: fix plugins.processlist make it not to fail when `show engine innodb status` output contains a double quote --- mysql-test/suite/plugins/t/processlist.test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/plugins/t/processlist.test b/mysql-test/suite/plugins/t/processlist.test index 5aacef317b9..e8f03aacb10 100644 --- a/mysql-test/suite/plugins/t/processlist.test +++ b/mysql-test/suite/plugins/t/processlist.test @@ -8,7 +8,8 @@ start transaction; insert t1 values (1); let id=`select connection_id()`; connect con2,localhost,root; -let s=query_get_value(show engine innodb status,Status,1); +replace_regex /\"/-/; #" +let s=`show engine innodb status`; disable_query_log; eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status`; eval select state as `state from show processlist` from information_schema.processlist where id = $id; -- cgit v1.2.1 From ecc4682672f604bf24edb79662ba0eafdfd16f0c Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 22 Jun 2018 15:24:09 +0100 Subject: MDEV-16519 : mariabackup should fail if MDL could not be acquired with lock-ddl-per-table There is a tiny chance for race condition during MDL acquisition. If table is renamed just prior to SELECT 1 FROM LIMIT 0 then this query would fail, yet mariabackup --backup does not handle it as fatal error and continues, only to fail later during file copy. The fix is to die on error, of MDL lock query fails. --- mysql-test/suite/mariabackup/rename_during_mdl_lock.result | 3 +++ mysql-test/suite/mariabackup/rename_during_mdl_lock.test | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 mysql-test/suite/mariabackup/rename_during_mdl_lock.result create mode 100644 mysql-test/suite/mariabackup/rename_during_mdl_lock.test (limited to 'mysql-test') diff --git a/mysql-test/suite/mariabackup/rename_during_mdl_lock.result b/mysql-test/suite/mariabackup/rename_during_mdl_lock.result new file mode 100644 index 00000000000..982851438f2 --- /dev/null +++ b/mysql-test/suite/mariabackup/rename_during_mdl_lock.result @@ -0,0 +1,3 @@ +CREATE TABLE t1(i int) ENGINE INNODB; +FOUND 1 /failed to execute query SELECT 1 FROM/ in backup.log +DROP TABLE t2; diff --git a/mysql-test/suite/mariabackup/rename_during_mdl_lock.test b/mysql-test/suite/mariabackup/rename_during_mdl_lock.test new file mode 100644 index 00000000000..0a41f1dfe74 --- /dev/null +++ b/mysql-test/suite/mariabackup/rename_during_mdl_lock.test @@ -0,0 +1,13 @@ +--source include/have_debug.inc +let $targetdir=$MYSQLTEST_VARDIR/backup; +mkdir $targetdir; +CREATE TABLE t1(i int) ENGINE INNODB; +--error 1 +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table --dbug=+d,rename_during_mdl_lock_table 2>$targetdir/backup.log; + +let SEARCH_FILE=$targetdir/backup.log; +let SEARCH_PATTERN=failed to execute query SELECT 1 FROM; +source include/search_pattern_in_file.inc; + +DROP TABLE t2; +rmdir $targetdir; -- cgit v1.2.1 From 364a20fe0b072fb1d2a9b54a8c4e47a5012f3e97 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sat, 23 Jun 2018 19:36:26 -0700 Subject: MDEV-16507 SIGSEGV when use_stat_tables = preferably and optimizer_use_condition_selectivity = 4 It does not makes sense to try to read statistics for temporary tables because it's not collected. --- mysql-test/r/statistics.result | 20 ++++++++++++++++++++ mysql-test/t/statistics.test | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/statistics.result b/mysql-test/r/statistics.result index 74997c92d3e..23c8807897b 100644 --- a/mysql-test/r/statistics.result +++ b/mysql-test/r/statistics.result @@ -1659,3 +1659,23 @@ id set use_stat_tables=@save_use_stat_tables; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; +# +# MDEV-16507: statistics for temporary tables should not be used +# +SET +@save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +SET @@use_stat_tables = preferably ; +SET @@optimizer_use_condition_selectivity = 4; +CREATE TABLE t1 ( +TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +ON UPDATE CURRENT_TIMESTAMP +); +SET @had_t1_table= @@warning_count != 0; +CREATE TEMPORARY TABLE tmp_t1 LIKE t1; +INSERT INTO tmp_t1 VALUES (now()); +INSERT INTO t1 SELECT * FROM tmp_t1 WHERE @had_t1_table=0; +DROP TABLE t1; +SET +use_stat_tables=@save_use_stat_tables; +SET +optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; diff --git a/mysql-test/t/statistics.test b/mysql-test/t/statistics.test index 0ab42453125..5831e0b1d60 100644 --- a/mysql-test/t/statistics.test +++ b/mysql-test/t/statistics.test @@ -737,3 +737,27 @@ set use_stat_tables=@save_use_stat_tables; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; +--echo # +--echo # MDEV-16507: statistics for temporary tables should not be used +--echo # + +SET +@save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity; +SET @@use_stat_tables = preferably ; +SET @@optimizer_use_condition_selectivity = 4; + +CREATE TABLE t1 ( + TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP + ON UPDATE CURRENT_TIMESTAMP +); + +SET @had_t1_table= @@warning_count != 0; +CREATE TEMPORARY TABLE tmp_t1 LIKE t1; +INSERT INTO tmp_t1 VALUES (now()); +INSERT INTO t1 SELECT * FROM tmp_t1 WHERE @had_t1_table=0; +DROP TABLE t1; + +SET +use_stat_tables=@save_use_stat_tables; +SET +optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; -- cgit v1.2.1 From e561a346c34da860206092f03742264246081005 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 23 Jun 2018 15:30:52 +0200 Subject: fix mtr warnings after 5f0510225aa --- mysql-test/r/grant.result | 1 + mysql-test/r/sp-security.result | 1 + mysql-test/suite/roles/grant_revoke_current.result | 1 + mysql-test/suite/roles/grant_revoke_current.test | 2 ++ mysql-test/suite/roles/set_default_role_ps-6960.result | 1 + mysql-test/suite/roles/set_default_role_ps-6960.test | 2 ++ mysql-test/t/grant.test | 3 +++ mysql-test/t/sp-security.test | 2 ++ 8 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 118d1f2134b..81b41a083a3 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1447,6 +1447,7 @@ CURRENT_USER() root@localhost SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin"); SET PASSWORD FOR CURRENT_USER() = PASSWORD(""); +update mysql.user set plugin=''; # Bug#57952 diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 882072ff7c7..7813ab6a192 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -755,6 +755,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost' GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION drop procedure sp1; set password=''; +update mysql.user set plugin=''; # # MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE # diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result index d9798463965..436bec92a8f 100644 --- a/mysql-test/suite/roles/grant_revoke_current.result +++ b/mysql-test/suite/roles/grant_revoke_current.result @@ -39,4 +39,5 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*34391 GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION GRANT USAGE ON *.* TO 'r1' set password=''; +update mysql.user set plugin=''; drop role r1; diff --git a/mysql-test/suite/roles/grant_revoke_current.test b/mysql-test/suite/roles/grant_revoke_current.test index 0ebe0170782..bffc04087b1 100644 --- a/mysql-test/suite/roles/grant_revoke_current.test +++ b/mysql-test/suite/roles/grant_revoke_current.test @@ -25,5 +25,7 @@ show grants; grant r1 to current_user() identified by 'barfoo'; show grants; set password=''; +#cleanup after MDEV-16238 +update mysql.user set plugin=''; drop role r1; diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.result b/mysql-test/suite/roles/set_default_role_ps-6960.result index 60210d7f92c..c186e7bccb0 100644 --- a/mysql-test/suite/roles/set_default_role_ps-6960.result +++ b/mysql-test/suite/roles/set_default_role_ps-6960.result @@ -6,3 +6,4 @@ execute stmt; set password = ''; set default role NONE; drop role r1; +update mysql.user set plugin=''; diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.test b/mysql-test/suite/roles/set_default_role_ps-6960.test index 8ac520e1776..8af95c9e8a0 100644 --- a/mysql-test/suite/roles/set_default_role_ps-6960.test +++ b/mysql-test/suite/roles/set_default_role_ps-6960.test @@ -13,3 +13,5 @@ execute stmt; set password = ''; set default role NONE; drop role r1; +#cleanup after MDEV-16238 +update mysql.user set plugin=''; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 72e427493da..cb4254fe8c6 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1265,6 +1265,9 @@ SELECT CURRENT_USER(); SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin"); SET PASSWORD FOR CURRENT_USER() = PASSWORD(""); +#cleanup after MDEV-16238 +update mysql.user set plugin=''; + # # Bug#57952: privilege change is not taken into account by EXECUTE. # diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 059a5dd0fa8..73d0263dd69 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -1023,6 +1023,8 @@ grant execute on procedure sp1 to current_user() identified by 'barfoo'; show grants; drop procedure sp1; set password=''; +#cleanup after MDEV-16238 +update mysql.user set plugin=''; --echo # --echo # MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE -- cgit v1.2.1 From b2190f859b652a0d4c5f2931b34d6e6e821bf715 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 22 Jun 2018 15:45:17 +0200 Subject: fix vcol.vcol_misc --embedded --- mysql-test/suite/vcol/t/vcol_misc.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 3efbaa0a376..b351e1eb4a6 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -330,8 +330,10 @@ SET sql_mode=DEFAULT; --copy_file std_data/frm/t1.frm $MYSQLD_DATADIR/test/t1.frm SHOW TABLES; +--replace_result $MYSQLD_DATADIR ./ --error ER_NOT_FORM_FILE SHOW CREATE TABLE t1; +--replace_result $MYSQLD_DATADIR ./ --error ER_NOT_FORM_FILE ALTER TABLE t1; --remove_file $MYSQLD_DATADIR/test/t1.frm -- cgit v1.2.1 From ee6ac4d313c5e8846c4f7b92a923154984528215 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 25 Jun 2018 09:08:07 +0400 Subject: MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type --- mysql-test/r/type_decimal.result | 25 +++++++++++++++++++++++++ mysql-test/t/type_decimal.test | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index d5232ff92a8..b858d1ebab1 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -1033,5 +1033,30 @@ c1 c2 0.123456 0.123456 SET sql_mode=DEFAULT; # +# MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type +# +SHOW CREATE TABLE t1dec102; +Table Create Table +t1dec102 CREATE TABLE `t1dec102` ( + `a` decimal(10,2)/*old*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t1 AS SELECT a, MAX(a), COALESCE(a) FROM t1dec102; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(10,2) DEFAULT NULL, + `MAX(a)` decimal(10,2) DEFAULT NULL, + `COALESCE(a)` decimal(12,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 AS SELECT a FROM t1dec102 UNION SELECT a FROM t1dec102; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` decimal(12,2) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +DROP TABLE t1dec102; +# # End of 10.2 tests # diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index e8b3ecbf0a9..c5b64846f65 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -627,6 +627,27 @@ SELECT CAST(TIME'00:00:00.123456' AS DECIMAL(10,6)) AS c2; SET sql_mode=DEFAULT; +--echo # +--echo # MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type +--echo # + +let $MYSQLD_DATADIR= `select @@datadir`; +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +SHOW CREATE TABLE t1dec102; + +CREATE TABLE t1 AS SELECT a, MAX(a), COALESCE(a) FROM t1dec102; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 AS SELECT a FROM t1dec102 UNION SELECT a FROM t1dec102; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +DROP TABLE t1dec102; + --echo # --echo # End of 10.2 tests --echo # -- cgit v1.2.1 From bb825194b87da63126960656e86a18692b381b12 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 25 Jun 2018 14:04:16 +0300 Subject: Updated list of unstable tests for 10.2.16 --- mysql-test/unstable-tests | 219 ++++++++++++++++++++++++++++++---------------- 1 file changed, 142 insertions(+), 77 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 23d1924fff8..00a914cc266 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,102 +23,115 @@ # ############################################################################## -# Based on 10.2 4ab180ad5e9c67427b561035e4b8e193d429fe5a +# Based on 10.2 ee6ac4d313c5e8846c4f7b92a923154984528215 +main.alter_table : Modified in 10.2.16 main.alter_table_errors : Added in 10.2.15 main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.assign_key_cache : Added in 10.2.15 main.assign_key_cache_debug : Added in 10.2.15 main.auth_named_pipe : MDEV-14724 - System error 2 -main.case : Modified in 10.2.14 +main.auto_increment : Modified in 10.2.16 +main.check : Modified in 10.2.16 main.check_constraint : Modified in 10.2.15 main.connect : Modified in 10.2.15 main.connect_debug : Added in 10.2.15 main.connect2 : MDEV-13885 - Server crash -main.cte_nonrecursive : Modified in 10.2.14 -main.cte_recursive : Modified in 10.2.15 -main.ctype_latin1 : Modified in 10.2.14 +main.create_or_replace : Modified in 10.2.16 +main.cte_nonrecursive : Modified in 10.2.16 +main.cte_recursive : Modified in 10.2.16 main.ctype_ucs : Modified in 10.2.15 -main.ctype_utf8 : Modified in 10.2.14 main.ctype_utf8mb4 : Modified in 10.2.15 -main.derived_cond_pushdown : Modified in 10.2.15 -main.distinct : MDEV-14194 - Crash +main.derived_cond_pushdown : Modified in 10.2.16 +main.distinct : MDEV-14194 - Crash; modified in 10.2.16 main.drop_bad_db_type : MDEV-15676 - Wrong result main.events_2 : MDEV-13277 - Crash +main.events_bugs : MDEV-12892 - Crash main.events_slowlog : MDEV-12821 - Wrong result -main.fast_prefix_index_fetch_innodb : Modified in 10.2.14 -main.func_date_add : Modified in 10.2.14 -main.func_json : Modified in 10.2.14 +main.explain_slowquerylog : Modified in 10.2.16 +main.func_json : Modified in 10.2.16 main.func_str : Modified in 10.2.15 -main.func_time : Modified in 10.2.14 -main.having : Modified in 10.2.14 +main.grant : Modified in 10.2.16 +main.grant2 : Modified in 10.2.16 +main.grant_not_windows : Added in 10.2.16 +main.having : Modified in 10.2.16 main.index_merge_innodb : MDEV-7142 - Plan mismatch main.innodb_mysql_lock : MDEV-7861 - Wrong result -main.join_outer : Modified in 10.2.14 +main.insert_select : Modified in 10.2.16 main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result +main.limit : Modified in 10.2.16 main.lock : Modified in 10.2.15 main.log_slow : MDEV-13263 - Wrong result main.mdev375 : Modified in 10.2.15 main.mdev-504 : MDEV-15171 - warning main.myisam : Modified in 10.2.15 main.myisam_recover : Modified in 10.2.15 +main.mysql : Modified in 10.2.16 main.mysql_client_test_nonblock : CONC-208 - Error on Power; MDEV-15096 - exec failed +main.mysql_cp932 : Modified in 10.2.16 main.mysql_upgrade_noengine : MDEV-14355 - Wrong result main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error -main.mysqldump : MDEV-14800 - Stack smashing detected +main.mysqldump : MDEV-14800 - Stack smashing detected; modified in 10.2.16 main.mysqld_option_err : MDEV-12747 - Timeout main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug +main.mysqlslap : Modified in 10.2.16 main.mysqltest : MDEV-13887 - Wrong result +main.olap : Modified in 10.2.16 main.openssl_1 : MDEV-13492 - Unknown SSL error main.order_by_optimizer_innodb : MDEV-10683 - Wrong result main.parser : Modified in 10.2.15 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock main.partition_list : Modified in 10.2.15 -main.ps : MDEV-11017 - Wrong result; modified in 10.2.15 -main.ps_qc_innodb : Added in 10.2.14 -main.query_cache : MDEV-16180 - Wrong result; modified in 10.2.14 +main.partition_open_files_limit : Modified in 10.2.16 +main.ps : MDEV-11017 - Wrong result; modified in 10.2.16 +main.query_cache : MDEV-16180 - Wrong result main.query_cache_debug : MDEV-15281 - Query cache is disabled main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.read_only_innodb : Modified in 10.2.15 +main.read_only_innodb : Modified in 10.2.16 +main.rename : Modified in 10.2.16 main.select : MDEV-15430 - Wrong result with clang-4 main.select_jcl6 : MDEV-15430 - Wrong result with clang-4 main.select_pkeycache : MDEV-15430 - Wrong result with clang-4 +main.selectivity : Modified in 10.2.16 +main.set_password : Added in 10.2.16 main.set_statement : MDEV-13183 - Wrong result -main.shutdown : Modified in 10.2.14 +main.show_grants_with_plugin-7985 : Modified in 10.2.16 main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_explain : MDEV-10674 - Wrong result code -main.sp : MDEV-7866 - Mismatch; modified in 10.2.15 +main.sp : MDEV-7866 - Mismatch; modified in 10.2.16 main.sp-destruct : Modified in 10.2.15 main.sp-innodb : Modified in 10.2.15 +main.sp-security : Modified in 10.2.16 main.ssl_ca : MDEV-10895 - SSL connection error on Power main.ssl_cert_verify : MDEV-13735 - Server crash main.ssl_connect : MDEV-13492 - Unknown SSL error main.ssl_timeout : MDEV-11244 - Crash main.stat_tables_par : MDEV-13266 - Wrong result +main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding main.statistics : Modified in 10.2.15 +main.statistics_close : Modified in 10.2.16 main.status : MDEV-13255 - Wrong result main.subselect4 : Modified in 10.2.15 main.subselect-crash_15755 : Added in 10.2.15 main.subselect_innodb : MDEV-10614 - Wrong result -main.subselect_mat : Modified in 10.2.14 main.subselect_sj : Modified in 10.2.15 +main.subselect_sj2_mat : Modified in 10.2.16 main.symlink-myisam-11902 : MDEV-15098 - Error 40 from storage engine main.tc_heuristic_recover : MDEV-14189 - Wrong result -main.type_blob : MDEV-15195 - Wrong result +main.trigger : Modified in 10.2.16 +main.type_bit : Modified in 10.2.16 +main.type_blob : MDEV-15195 - Wrong result; modified in 10.2.16 main.type_datetime_hires : MDEV-15430 - Wrong result with clang-4 -main.type_decimal : Modified in 10.2.14 +main.type_decimal : Modified in 10.2.16 main.type_float : MDEV-15430 - Wrong result with clang-4 -main.type_temporal_innodb : Modified in 10.2.14 -main.type_time : Modified in 10.2.14 +main.type_int : Modified in 10.2.16 main.type_time_hires : MDEV-15430 - Wrong result with clang-4 main.type_timestamp_hires : MDEV-15430 - Wrong result with clang-4 main.userstat : MDEV-12904 - SSL errors main.variables : Modified in 10.2.15 main.view : Modified in 10.2.15 -main.warnings : Modified in 10.2.14 main.win : Modified in 10.2.15 -main.xa : Modified in 10.2.14 #---------------------------------------------------------------- @@ -129,14 +142,14 @@ archive.mysqlhotcopy_archive : MDEV-10995 - Hang on debug binlog.binlog_commit_wait : MDEV-10150 - Mismatch binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - Wrong exit code -binlog.binlog_stm_datetime_ranges_mdev15289 : Added in 10.2.14 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint #---------------------------------------------------------------- binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint -binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings +binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings; modified in 10.2.16 binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log +binlog_encryption.encrypted_slave : Modified in 10.2.16 binlog_encryption.encryption_combo : MDEV-14199 - Table is marked as crashed binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include @@ -150,43 +163,35 @@ binlog_encryption.rpl_typeconv : Include file modified in 10.2.15 #---------------------------------------------------------------- -connect.jdbc_postgresql : Modified in 10.2.14 -connect.json_udf : Modified in 10.2.14 connect.pivot : MDEV-14803 - Failed to discover table -connect.tbl_thread : Modified in 10.2.14 -connect.vcol : MDEV-12374 - Fails on Windows; modified in 10.2.14 - -#---------------------------------------------------------------- - -disks.disks : Added in 10.2.14 +connect.vcol : MDEV-12374 - Fails on Windows #---------------------------------------------------------------- encryption.create_or_replace : MDEV-12694 - Timeout; MDEV-16115 - Trying to access tablespace encryption.debug_key_management : MDEV-13841 - Timeout -encryption.encrypt_and_grep : MDEV-13765 - Wrong result; modified in 10.2.14 +encryption.encrypt_and_grep : MDEV-13765 - Wrong result encryption.innochecksum : MDEV-13644 - Assertion failure -encryption.innodb-bad-key-change : Modified in 10.2.14 +encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of threads encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate +encryption.innodb-discard-import : Modified in 10.2.16 encryption.innodb_encrypt_log : MDEV-13725 - Wrong result -encryption.innodb_encryption : MDEV-15675 - Timeout; modified in 10.2.14 +encryption.innodb_encryption : MDEV-15675 - Timeout encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result; modified in 10.2.15 encryption.innodb_encryption_filekeys : MDEV-15673 - Timeout; modified in 10.2.15 -encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure; modified in 10.2.14 +encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition encryption.innodb_lotoftables : Modified in 10.2.15 +encryption.innodb-read-only : MDEV-16563 - Crash on startup encryption.innodb-redo-badkey : MDEV-13893 - Page cannot be decrypted; include file modified in 10.2.15 -encryption.innodb-redo-nokeys : Include file modified in 10.2.15 -encryption.innodb-remove-encryption : Added in 10.2.15 -encryption.innodb_scrub_background : Modified in 10.2.14 -encryption.innodb-spatial-index : MDEV-13746 - Wrong result; modified in 10.2.14 +encryption.innodb-redo-nokeys : Modified in 10.2.16 +encryption.innodb-remove-encryption : MDEV-16493 - Timeout in wait condition; added in 10.2.15 +encryption.innodb-spatial-index : MDEV-13746 - Wrong result #---------------------------------------------------------------- -engines/iuds.update_time : Modified in 10.2.14 - engines/rr_trx.* : MDEV-10998 - Not maintained #---------------------------------------------------------------- @@ -209,22 +214,31 @@ galera_3nodes.* : Suite is not stable yet #---------------------------------------------------------------- +gcol.innodb_virtual_debug : Modified in 10.2.16 gcol.innodb_virtual_fk : Modified in 10.2.15 gcol.innodb_virtual_index : Modified in 10.2.15 #---------------------------------------------------------------- +handler.ps : Added in 10.2.16 + +#---------------------------------------------------------------- + +heap.heap_auto_increment : Modified in 10.2.16 + +#---------------------------------------------------------------- + innodb.101_compatibility : MDEV-13891 - Wrong result innodb.alter_copy : MDEV-16181 - Assertion failure +innodb.alter_foreign_crash : Added in 10.2.16 +innodb.alter_kill : Added in 10.2.16 innodb.alter_missing_tablespace : Modified in 10.2.15 innodb.alter_partitioned_debug : Added in 10.2.15 innodb.alter_partitioned_xa : Added in 10.2.15 +innodb.alter_rename_files : Added in 10.2.16 +innodb.analyze_table : Added in 10.2.16 innodb.autoinc_persist : MDEV-15282 - Assertion failure -innodb.default_row_format_alter : Added in 10.2.14 -innodb.default_row_format_compatibility : Added in 10.2.14 -innodb.default_row_format_create : Added in 10.2.14 innodb.doublewrite : MDEV-12905 - Server crash; include file modified in 10.2.15 -innodb.file_format_defaults : Added in 10.2.14 innodb.foreign_key : Modified in 10.2.15 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure @@ -232,13 +246,16 @@ innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup innodb.innodb-alter : Modified in 10.2.15 innodb.innodb-alter-nullable : Modified in 10.2.15 innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists +innodb.innodb-autoinc : Modified in 10.2.16 +innodb.innodb-blob : Modified in 10.2.16 innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt -innodb.innodb_bug27216817 : Added in 10.2.15 innodb.innodb_bug30423 : MDEV-7311 - Wrong result innodb.innodb_bug48024 : MDEV-14352 - Assertion failure +innodb.innodb_bug54044 : Modified in 10.2.16 innodb.innodb_bug59641 : MDEV-13830 - Assertion failure innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full +innodb.innodb_defragment_small : Modified in 10.2.16 innodb.innodb-get-fk : MDEV-13276 - Server crash innodb.innodb-index : Modified in 10.2.15 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics @@ -246,9 +263,13 @@ innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb-isolation : Modified in 10.2.15 innodb.innodb_max_recordsize_32k : MDEV-14801 - Operation failed innodb.innodb_max_recordsize_64k : MDEV-15203 - Wrong result -innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure +innodb.innodb-mdev7046 : Modified in 10.2.16 +innodb.innodb-online-alter-gis : Modified in 10.2.16 +innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure; modified in 10.2.16 innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result +innodb.innodb-page_compression_snappy : Modified in 10.2.16 innodb.innodb_prefix_index_restart_server : Modified in 10.2.15 +innodb.innodb_query_cache : Added in 10.2.16 innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb-table-online : MDEV-13894 - Wrong result innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait @@ -263,12 +284,11 @@ innodb.log_file_name_debug : Include file modified in 10.2.15 innodb.log_file_size : MDEV-15668 - Not found pattern innodb.mdev-15707 : Added in 10.2.15 innodb.monitor : MDEV-16179 - Wrong result -innodb.purge_secondary : MDEV-15681 - Wrong result; modified in 10.2.14 +innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash -innodb.read_only_recover_committed : Added in 10.2.14 innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile -innodb.restart : Added in 10.2.14 +innodb.rename_table : Modified in 10.2.16 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.stored_fk : Added in 10.2.15 innodb.table_definition_cache_debug : MDEV-14206 - Extra warning @@ -303,28 +323,39 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error #---------------------------------------------------------------- -maria.dynamic : Added in 10.2.14 +maria.alter : Modified in 10.2.16 maria.insert_select : MDEV-12757 - Timeout -maria.maria : MDEV-14430 - Extra warning +maria.insert_select-7314 : MDEV-16492 - Timeout +maria.lock : Modified in 10.2.16 +maria.maria : MDEV-14430 - Extra warning; modified in 10.2.16 +maria.maria-autoinc : Added in 10.2.16 #---------------------------------------------------------------- mariabackup.absolute_ibdata_paths : Added in 10.2.15 mariabackup.apply-log-only : MDEV-14192 - Assertion failure -mariabackup.apply-log-only-incr : MDEV-14192 - Assertion failure -mariabackup.backup_ssl : Added in 10.2.15 +mariabackup.apply-log-only-incr : MDEV-14192 - Assertion failure; modified in 10.2.16 +mariabackup.backup_ssl : MDEV-14192 - Assertion failure; added in 10.2.15 mariabackup.data_directory : MDEV-15270 - Error on exec -mariabackup.extra_lsndir : Added in 10.2.14 +mariabackup.full_backup : MDEV-16571 - Wrong result +mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future mariabackup.incremental_backup : MDEV-14192 - Assertion failure -mariabackup.incremental_encrypted : MDEV-14188 - Wrong result, MDEV-15667 - timeout -mariabackup.mdev-14447 : MDEV-15201 - Timeout +mariabackup.incremental_encrypted : MDEV-14188 - Wrong result, MDEV-15667 - timeout, MDEV-14192 - Assertion failure +mariabackup.lock_ddl_per_table : Modified in 10.2.16 +mariabackup.log_checksum_mismatch : MDEV-16568 - Sequence number is in the future +mariabackup.mdev-14447 : MDEV-15201 - Timeout; modified in 10.2.16 mariabackup.partial_exclude : MDEV-15270 - Error on exec -mariabackup.undo_space_id : Added in 10.2.14 +mariabackup.partition_datadir : Modified in 10.2.16 +mariabackup.rename_during_mdl_lock : Added in 10.2.16 mariabackup.unsupported_redo : Modified in 10.2.15 mariabackup.xbstream : MDEV-14192 - Crash mariabackup.xb_aws_key_management : MDEV-15680 - Error: xtrabackup_copy_logfile() failed mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault +mariabackup.xb_file_key_management : MDEV-16569 - Table doesn't exist +mariabackup.xb_rocksdb : Added in 10.2.16 +mariabackup.xb_rocksdb_datadir : Added in 10.2.16 +mariabackup.xb_rocksdb_datadir_debug : Added in 10.2.16 #---------------------------------------------------------------- @@ -342,6 +373,7 @@ multi_source.simple : MDEV-4633 - Wrong result parts.partition_alter_innodb : Include file modified in 10.2.15 parts.partition_alter_maria : Include file modified in 10.2.15 parts.partition_alter_myisam : Include file modified in 10.2.15 +parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket; MDEV-15095 - Table doesn't exist parts.show_create : Added in 10.2.15 @@ -362,6 +394,7 @@ perfschema.hostcache_ipv6_addrinfo_again_allow : MDEV-12752 - Crash perfschema.hostcache_ipv6_addrinfo_bad_allow : MDEV-13260 - Crash perfschema.hostcache_ipv6_max_con : Modified in 10.2.15 perfschema.hostcache_ipv6_ssl : MDEV-10696 - Crash +perfschema.partition : Added in 10.2.16 perfschema.setup_actors : MDEV-10679 - Crash perfschema.socket_connect : MDEV-15677 - Wrong result perfschema.socket_summary_by_event_name_func : MDEV-10622 - Wrong result @@ -375,48 +408,77 @@ perfschema_stress.* : MDEV-10996 - Not maintained #---------------------------------------------------------------- plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such +plugins.processlist : MDEV-16574 - Wrong result; modified in 10.2.16 plugins.server_audit : Modified in 10.2.15 plugins.thread_pool_server_audit : MDEV-14295 - Wrong result #---------------------------------------------------------------- -rocksdb.* : Tests are unstable -rocksdb_sys_vars.* : Tests are unstable +rocksdb.2pc_group_commit : MDEV-14455 - Wrong result +rocksdb.allow_no_primary_key : Modified in 10.2.16 +rocksdb.analyze_table : Modified in 10.2.16 +rocksdb.autoinc_debug : MDEV-16203 - Wrong result +rocksdb.autoinc_vars_thread : MDEV-16573 - Debug sync timed out +rocksdb.bloomfilter2 : MDEV-16564 - Wrong result +rocksdb.bulk_load_errors : MDEV-16575 - Wrong result +rocksdb.check_ignore_unknown_options : Modified in 10.2.16 +rocksdb.deadlock : MDEV-16033 - Timeout +rocksdb.drop_index_inplace : MDEV-14162 - Crash on shutdown +rocksdb.drop_table : MDEV-14308 - Timeout +rocksdb.issue255 : MDEV-16577 - Wrong plan; modified in 10.2.16 +rocksdb.mariadb_port_fixes : MDEV-16387 - Wrong plan; modified in 10.2.16 +rocksdb.read_only_tx : MDEV-16565 - Server crash +rocksdb.rocksdb_parts : MDEV-13843 - Wrong result +rocksdb.truncate_table3 : MDEV-14506 - Lost connection to server +rocksdb.ttl_primary_read_filtering : MDEV-16560 - Wrong result +rocksdb.ttl_secondary_read_filtering : MDEV-16560 - Wrong result +rocksdb.unique_check : MDEV-16576 - Wrong errno + +rocksdb_sys_vars.rocksdb_remove_mariabackup_checkpoint_basic : Added in 10.2.16 #---------------------------------------------------------------- +roles.acl_load_mutex-5170 : Modified in 10.2.16 +roles.grant_revoke_current : Modified in 10.2.16 +roles.set_default_role_ps-6960 : Modified in 10.2.16 + +#---------------------------------------------------------------- + +rpl.rename : Added in 10.2.16 rpl.rpl_binlog_errors : MDEV-12742 - Crash rpl.rpl_binlog_index : MDEV-9501 - Failed registering on master rpl.rpl_colSize : MDEV-16112 - Server crash rpl.rpl_ctype_latin1 : MDEV-14813 - Wrong result on Mac +rpl.rpl_do_grant : Modified in 10.2.16 rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDEV-13677 - Server crash rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result +rpl.rpl_extra_col_master_innodb : MDEV-16570 - Extra warning rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash rpl.rpl_gtid_reconnect : MDEV-14497 - Crash -rpl.rpl_gtid_stop_start : MDEV-11621 - Table marked as crashed rpl.rpl_insert_id : MDEV-15197 - Wrong result +rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog rpl.rpl_mdev6020 : MDEV-15272 - Server crash rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed +rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed -rpl.rpl_non_direct_row_mixing_engines : MDEV-14491 - Long semaphore wait rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Failed sync_slave_with_master rpl.rpl_parallel : MDEV-10653 - Timeouts rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.2.16 rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master -rpl.rpl_parallel_retry : MDEV-11119 - Crash; modified in 10.2.14 +rpl.rpl_parallel_retry : MDEV-11119 - Crash rpl.rpl_parallel_temptable : MDEV-10356 - Crash rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed rpl.rpl_row_index_choice : MDEV-15196 - Slave crash -rpl.rpl_row_mixing_engines : MDEV-14491 - Long semaphore wait +rpl.rpl_row_mixing_engines : MDEV-16515 - Assertion failure rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result rpl.rpl_semi_sync_after_sync_row : MDEV-14366 - Wrong result @@ -449,7 +511,6 @@ rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained spider.basic_sql : MDEV-11186 - Internal check fails spider/bg.direct_aggregate : MDEV-7098 - Packets out of order -spider/bg.ha_part : MDEV-7914 - Crash (only fixed in 10.3) spider/bg.spider3_fixes : MDEV-12639 - Syntax error spider/handler.* : MDEV-10990 - Not maintained @@ -467,13 +528,13 @@ storage_engine.* : Not always timely maintained sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error sys_vars.max_prepared_stmt_count_basic : Modified in 10.2.15 +sys_vars.maximum_basic : Modified in 10.2.16 sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result sys_vars.sysvars_innodb : Opt file modified in 10.2.15 sys_vars.sysvars_server_embedded : Opt file added in 10.2.15 sys_vars.sysvars_server_notembedded : Opt file added in 10.2.15 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result -sys_vars.wsrep_sst_receive_address_basic : Modified in 10.2.14 #---------------------------------------------------------------- @@ -481,6 +542,7 @@ tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection tokudb.change_column_bin : MDEV-12640 - Lost connection tokudb.change_column_char : MDEV-12822 - Lost connection tokudb.dir_per_db : MDEV-11537 - Wrong result +tokudb.hotindex-del-0 : MDEV-16559 - Timeout tokudb.hotindex-insert-0 : MDEV-15271 - Timeout tokudb.hotindex-insert-2 : MDEV-15271 - Timeout tokudb.hotindex-insert-bigchar : MDEV-12640 - Crash @@ -500,8 +562,6 @@ tokudb_backup.* : MDEV-11001 - Missing include file tokudb_sys_vars.* : MDEV-11001 - Missing include file tokudb_rpl.* : MDEV-11001 - Missing include file -tokudb_mariadb.mdev6657 : Modified in 10.2.14 - tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection #---------------------------------------------------------------- @@ -514,7 +574,12 @@ unit.my_atomic : MDEV-15670 - Signal 11 thrown #---------------------------------------------------------------- +vcol.binlog : Added in 10.2.16 +vcol.index : Added in 10.2.16 vcol.partition : Modified in 10.2.15 +vcol.update : Modified in 10.2.16 +vcol.update_binlog : Added in 10.2.16 +vcol.vcol_misc : Modified in 10.2.16 #---------------------------------------------------------------- @@ -522,7 +587,7 @@ wsrep.binlog_format : MDEV-11532 - Could not execute check-testca wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node wsrep.mdev_6832 : MDEV-14195 - Check testcase failed wsrep.pool_of_threads : MDEV-12234 - GLIBCXX_3.4.20 not found -wsrep.variables : MDEV-14311 - Wrong result +wsrep.variables : MDEV-14311 - Wrong result; modified in 10.2.16 wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view -- cgit v1.2.1 From a8e1eef89940892f7ae87a512c2ace60372d450a Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 9 Mar 2018 14:26:10 +0100 Subject: Reset connection support in mysqltest (port from mysql) --- mysql-test/r/reset_connection.result | 7 +++++++ mysql-test/t/reset_connection.test | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 mysql-test/r/reset_connection.result create mode 100644 mysql-test/t/reset_connection.test (limited to 'mysql-test') diff --git a/mysql-test/r/reset_connection.result b/mysql-test/r/reset_connection.result new file mode 100644 index 00000000000..925195f704e --- /dev/null +++ b/mysql-test/r/reset_connection.result @@ -0,0 +1,7 @@ +FLUSH STATUS; +SHOW local STATUS LIKE 'com_select'; +Variable_name Value +Com_select 10 +SHOW local STATUS LIKE 'com_select'; +Variable_name Value +Com_select 0 diff --git a/mysql-test/t/reset_connection.test b/mysql-test/t/reset_connection.test new file mode 100644 index 00000000000..39465677483 --- /dev/null +++ b/mysql-test/t/reset_connection.test @@ -0,0 +1,23 @@ +FLUSH STATUS; + +--disable_result_log +--disable_query_log + +let $i = 10; +begin; +while ($i) +{ + dec $i; + SELECT 1; +} +commit; + +--enable_query_log +--enable_result_log + +SHOW local STATUS LIKE 'com_select'; + +--reset_connection + +SHOW local STATUS LIKE 'com_select'; + -- cgit v1.2.1 From 73de63e898bd67f708c6df8d154a76b7ddd0d5d7 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 9 Mar 2018 14:27:13 +0100 Subject: Session tracking info support in mysqltest (port from mysql) --- mysql-test/r/mysqltest_tracking_info.result | 47 +++++++++++++++++++++++++++++ mysql-test/t/mysqltest_tracking_info.test | 25 +++++++++++++++ mysql-test/t/reset_connection.test | 2 ++ 3 files changed, 74 insertions(+) create mode 100644 mysql-test/r/mysqltest_tracking_info.result create mode 100644 mysql-test/t/mysqltest_tracking_info.test (limited to 'mysql-test') diff --git a/mysql-test/r/mysqltest_tracking_info.result b/mysql-test/r/mysqltest_tracking_info.result new file mode 100644 index 00000000000..b5885a37cde --- /dev/null +++ b/mysql-test/r/mysqltest_tracking_info.result @@ -0,0 +1,47 @@ +SELECT @@session.character_set_client, @@session.character_set_results, @@session.character_set_connection; +@@session.character_set_client @@session.character_set_results @@session.character_set_connection +latin1 latin1 latin1 +SET @@session.session_track_system_variables='character_set_client,character_set_results,character_set_connection'; +# tracking info on +SET NAMES 'utf8'; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- character_set_client +-- utf8 +-- character_set_connection +-- utf8 +-- character_set_results +-- utf8 + +SET NAMES 'big5'; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- character_set_client +-- big5 +-- character_set_connection +-- big5 +-- character_set_results +-- big5 + +# tracking info on once +SET NAMES 'utf8'; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- character_set_client +-- utf8 +-- character_set_connection +-- utf8 +-- character_set_results +-- utf8 + +SET NAMES 'big5'; +# tracking info on +SET NAMES 'utf8'; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- character_set_client +-- utf8 +-- character_set_connection +-- utf8 +-- character_set_results +-- utf8 + +# tracking info off once +SET NAMES 'big5'; +SET @@session.session_track_system_variables= default; diff --git a/mysql-test/t/mysqltest_tracking_info.test b/mysql-test/t/mysqltest_tracking_info.test new file mode 100644 index 00000000000..c32e20703a5 --- /dev/null +++ b/mysql-test/t/mysqltest_tracking_info.test @@ -0,0 +1,25 @@ + +--source include/no_protocol.inc +--source include/not_embedded.inc + +SELECT @@session.character_set_client, @@session.character_set_results, @@session.character_set_connection; +SET @@session.session_track_system_variables='character_set_client,character_set_results,character_set_connection'; + +--echo # tracking info on +--enable_session_track_info +SET NAMES 'utf8'; +SET NAMES 'big5'; +--disable_session_track_info +--echo # tracking info on once +--enable_session_track_info ONCE +SET NAMES 'utf8'; +SET NAMES 'big5'; +--echo # tracking info on +--enable_session_track_info +SET NAMES 'utf8'; +--echo # tracking info off once +--disable_session_track_info ONCE +SET NAMES 'big5'; +--disable_session_track_info + +SET @@session.session_track_system_variables= default; diff --git a/mysql-test/t/reset_connection.test b/mysql-test/t/reset_connection.test index 39465677483..49f41c32fc3 100644 --- a/mysql-test/t/reset_connection.test +++ b/mysql-test/t/reset_connection.test @@ -1,3 +1,5 @@ +--source include/not_embedded.inc + FLUSH STATUS; --disable_result_log -- cgit v1.2.1 From 517d7182013b212db4680a22da2c91314c41f51b Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 9 Mar 2018 14:39:40 +0100 Subject: MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid register changes of last_gtid --- mysql-test/r/mysqltest_tracking_info.result | 24 ++++--------------- mysql-test/r/session_tracker_last_gtid.result | 34 +++++++++++++++++++++++++++ mysql-test/t/mysqltest_tracking_info.test | 4 ++-- mysql-test/t/session_tracker_last_gtid.test | 19 +++++++++++++++ 4 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 mysql-test/r/session_tracker_last_gtid.result create mode 100644 mysql-test/t/session_tracker_last_gtid.test (limited to 'mysql-test') diff --git a/mysql-test/r/mysqltest_tracking_info.result b/mysql-test/r/mysqltest_tracking_info.result index b5885a37cde..df966ae1d39 100644 --- a/mysql-test/r/mysqltest_tracking_info.result +++ b/mysql-test/r/mysqltest_tracking_info.result @@ -1,46 +1,30 @@ -SELECT @@session.character_set_client, @@session.character_set_results, @@session.character_set_connection; -@@session.character_set_client @@session.character_set_results @@session.character_set_connection -latin1 latin1 latin1 -SET @@session.session_track_system_variables='character_set_client,character_set_results,character_set_connection'; +SELECT @@session.character_set_connection; +@@session.character_set_connection +latin1 +SET @@session.session_track_system_variables='character_set_connection'; # tracking info on SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_client --- utf8 -- character_set_connection -- utf8 --- character_set_results --- utf8 SET NAMES 'big5'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_client --- big5 -- character_set_connection -- big5 --- character_set_results --- big5 # tracking info on once SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_client --- utf8 -- character_set_connection -- utf8 --- character_set_results --- utf8 SET NAMES 'big5'; # tracking info on SET NAMES 'utf8'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES --- character_set_client --- utf8 -- character_set_connection -- utf8 --- character_set_results --- utf8 # tracking info off once SET NAMES 'big5'; diff --git a/mysql-test/r/session_tracker_last_gtid.result b/mysql-test/r/session_tracker_last_gtid.result new file mode 100644 index 00000000000..795d0aaa2a2 --- /dev/null +++ b/mysql-test/r/session_tracker_last_gtid.result @@ -0,0 +1,34 @@ +# +# MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid +# +SET gtid_seq_no=1000; +SET @@session.session_track_system_variables='last_gtid'; +create table t1 (a int) engine=innodb; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- last_gtid +-- 0-1-1000 + +select @@last_gtid; +@@last_gtid +0-1-1000 +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- last_gtid +-- 0-1-1000 + +insert into t1 values (1); +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- last_gtid +-- 0-1-1001 + +select @@last_gtid; +@@last_gtid +0-1-1001 +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- last_gtid +-- 0-1-1001 + +drop table t1; +-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES +-- last_gtid +-- 0-1-1002 + diff --git a/mysql-test/t/mysqltest_tracking_info.test b/mysql-test/t/mysqltest_tracking_info.test index c32e20703a5..d31f68b3cbd 100644 --- a/mysql-test/t/mysqltest_tracking_info.test +++ b/mysql-test/t/mysqltest_tracking_info.test @@ -2,8 +2,8 @@ --source include/no_protocol.inc --source include/not_embedded.inc -SELECT @@session.character_set_client, @@session.character_set_results, @@session.character_set_connection; -SET @@session.session_track_system_variables='character_set_client,character_set_results,character_set_connection'; +SELECT @@session.character_set_connection; +SET @@session.session_track_system_variables='character_set_connection'; --echo # tracking info on --enable_session_track_info diff --git a/mysql-test/t/session_tracker_last_gtid.test b/mysql-test/t/session_tracker_last_gtid.test new file mode 100644 index 00000000000..24cf2104a0c --- /dev/null +++ b/mysql-test/t/session_tracker_last_gtid.test @@ -0,0 +1,19 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_binlog_format_statement.inc + +--enable_session_track_info + +--echo # +--echo # MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid +--echo # + +SET gtid_seq_no=1000; +SET @@session.session_track_system_variables='last_gtid'; +create table t1 (a int) engine=innodb; +select @@last_gtid; +insert into t1 values (1); +select @@last_gtid; +drop table t1; + +--disable_session_track_info -- cgit v1.2.1 From 7d0d934ca642e485b2c008727dc20c83e26cce10 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 25 Jun 2018 19:19:10 -0700 Subject: MDEV-16473 WITH statement throws 'no database selected' error Before this patch if no default database was set the server threw an error for any table name reference that was not fully qualified by database name. In particular it happened for table names referenced CTE tables. This was incorrect. The error message was thrown at the parser stage when the names referencing different tables were not resolved yet. Now if no default database is set and a with clause is used in the processed statement any table reference is just supplied with a dummy database name "*none*" at the parser stage. Later after a call of check_dependencies_in_with_clauses() when the names for CTE tables can be resolved error messages are thrown only for those names that refer to non-CTE tables. This is done in open_and_process_table(). --- mysql-test/r/cte_nonrecursive.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/cte_nonrecursive.test | 29 ++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index 1d079c3bfa6..f6b80156ee0 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -1478,3 +1478,37 @@ select 2 as f; f 2 drop table t1; +# +# MDEV-16473: query with CTE when no database is set +# +create database db_mdev_16473; +use db_mdev_16473; +drop database db_mdev_16473; +# Now no default database is set +select database(); +database() +NULL +with cte as (select 1 as a) select * from cte; +a +1 +create database db_mdev_16473; +create table db_mdev_16473.t1 (a int); +insert into db_mdev_16473.t1 values (2), (7), (3), (1); +with cte as (select * from db_mdev_16473.t1) select * from cte; +a +2 +7 +3 +1 +with cte as (select * from db_mdev_16473.t1) +select * from cte, t1 as t where cte.a=t.a; +ERROR 3D000: No database selected +with cte as (select * from db_mdev_16473.t1) +select * from cte, db_mdev_16473.t1 as t where cte.a=t.a; +a a +2 2 +7 7 +3 3 +1 1 +drop database db_mdev_16473; +use test; diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test index 98a77940c99..11c864bcac1 100644 --- a/mysql-test/t/cte_nonrecursive.test +++ b/mysql-test/t/cte_nonrecursive.test @@ -1029,4 +1029,31 @@ with cte as select 2 as f; drop table t1; - \ No newline at end of file + +--echo # +--echo # MDEV-16473: query with CTE when no database is set +--echo # + +create database db_mdev_16473; +use db_mdev_16473; +drop database db_mdev_16473; + +--echo # Now no default database is set +select database(); + +with cte as (select 1 as a) select * from cte; + +create database db_mdev_16473; +create table db_mdev_16473.t1 (a int); +insert into db_mdev_16473.t1 values (2), (7), (3), (1); +with cte as (select * from db_mdev_16473.t1) select * from cte; + +--error ER_NO_DB_ERROR +with cte as (select * from db_mdev_16473.t1) +select * from cte, t1 as t where cte.a=t.a; +with cte as (select * from db_mdev_16473.t1) +select * from cte, db_mdev_16473.t1 as t where cte.a=t.a; + +drop database db_mdev_16473; + +use test; -- cgit v1.2.1 From ff8b3c8df89e973f3b91fa82a5fec65ef0e01c53 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Sat, 23 Jun 2018 13:49:36 +0300 Subject: MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir ha_innobase::prepare_inplace_alter_table: preserve DATA DICTIONARY for table --- .../parts/r/alter_data_directory_innodb.result | 65 ++++++++++++++++++++++ .../suite/parts/t/alter_data_directory_innodb.test | 46 +++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 mysql-test/suite/parts/r/alter_data_directory_innodb.result create mode 100644 mysql-test/suite/parts/t/alter_data_directory_innodb.test (limited to 'mysql-test') diff --git a/mysql-test/suite/parts/r/alter_data_directory_innodb.result b/mysql-test/suite/parts/r/alter_data_directory_innodb.result new file mode 100644 index 00000000000..ee0a7b80ebb --- /dev/null +++ b/mysql-test/suite/parts/r/alter_data_directory_innodb.result @@ -0,0 +1,65 @@ +# +# MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir +# +CREATE TABLE t ( +a INT NOT NULL +) ENGINE=INNODB +PARTITION BY HASH (a) ( +PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB, +PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB +); +INSERT INTO t VALUES (1); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) */ +ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) */ +ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) */ +SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE; +SET GLOBAL INNODB_FILE_PER_TABLE=OFF; +ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) */ +SET GLOBAL INNODB_FILE_PER_TABLE=@TMP; +ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO ( +PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB, +PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB +); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +(PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, + PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) */ +DROP TABLE t; diff --git a/mysql-test/suite/parts/t/alter_data_directory_innodb.test b/mysql-test/suite/parts/t/alter_data_directory_innodb.test new file mode 100644 index 00000000000..ac15e9bec6c --- /dev/null +++ b/mysql-test/suite/parts/t/alter_data_directory_innodb.test @@ -0,0 +1,46 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +--echo # +--echo # MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir +--echo # + +mkdir $MYSQLTEST_VARDIR/tmp/partitions_here; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t ( + a INT NOT NULL +) ENGINE=INNODB +PARTITION BY HASH (a) ( + PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB, + PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB +); +INSERT INTO t VALUES (1); + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t; +ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t; +ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t; +SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE; +SET GLOBAL INNODB_FILE_PER_TABLE=OFF; +ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t; +SET GLOBAL INNODB_FILE_PER_TABLE=@TMP; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO ( + PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB, + PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB +); +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t; + +DROP TABLE t; + +rmdir $MYSQLTEST_VARDIR/tmp/partitions_here/test; +rmdir $MYSQLTEST_VARDIR/tmp/partitions_here; -- cgit v1.2.1 From 090febbb2dedad764a4d9fdbc9216921dd27225f Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 28 Jun 2018 00:33:44 -0700 Subject: This is another attempt to fix mdev-16473. The previous correction of the patch for mdev-16473 did not work correctly for the databases whose names started with '*'. Added a test case with a database named "*". --- mysql-test/r/cte_nonrecursive.result | 11 +++++++++++ mysql-test/t/cte_nonrecursive.test | 7 +++++++ 2 files changed, 18 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index f6b80156ee0..32104c53af5 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -1511,4 +1511,15 @@ a a 3 3 1 1 drop database db_mdev_16473; +create database `*` ; +create table `*`.t1 (a int); +insert into `*`.t1 values (2), (7), (3), (1); +use `*`; +select * from t1; +a +2 +7 +3 +1 +drop database `*`; use test; diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test index 11c864bcac1..22bb292d8d9 100644 --- a/mysql-test/t/cte_nonrecursive.test +++ b/mysql-test/t/cte_nonrecursive.test @@ -1056,4 +1056,11 @@ select * from cte, db_mdev_16473.t1 as t where cte.a=t.a; drop database db_mdev_16473; +create database `*` ; +create table `*`.t1 (a int); +insert into `*`.t1 values (2), (7), (3), (1); +use `*`; +select * from t1; +drop database `*`; + use test; -- cgit v1.2.1 From 52a25d7b674464013b7749a366b0879929985a1e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Jun 2018 12:36:32 +0200 Subject: MDEV-16473 WITH statement throws 'no database selected' error Different fix, just use NULL, not no_db, --- mysql-test/r/cte_nonrecursive.result | 11 ----------- mysql-test/t/cte_nonrecursive.test | 7 ------- 2 files changed, 18 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result index 32104c53af5..f6b80156ee0 100644 --- a/mysql-test/r/cte_nonrecursive.result +++ b/mysql-test/r/cte_nonrecursive.result @@ -1511,15 +1511,4 @@ a a 3 3 1 1 drop database db_mdev_16473; -create database `*` ; -create table `*`.t1 (a int); -insert into `*`.t1 values (2), (7), (3), (1); -use `*`; -select * from t1; -a -2 -7 -3 -1 -drop database `*`; use test; diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test index 22bb292d8d9..11c864bcac1 100644 --- a/mysql-test/t/cte_nonrecursive.test +++ b/mysql-test/t/cte_nonrecursive.test @@ -1056,11 +1056,4 @@ select * from cte, db_mdev_16473.t1 as t where cte.a=t.a; drop database db_mdev_16473; -create database `*` ; -create table `*`.t1 (a int); -insert into `*`.t1 values (2), (7), (3), (1); -use `*`; -select * from t1; -drop database `*`; - use test; -- cgit v1.2.1 From 78a0646fe4ab7d58d900192ef7f4df905ed7442e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Jun 2018 09:05:01 +0200 Subject: make plugins.processlist more robust --- mysql-test/suite/plugins/r/processlist.result | 4 +--- mysql-test/suite/plugins/t/processlist.test | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/plugins/r/processlist.result b/mysql-test/suite/plugins/r/processlist.result index 22515c8174b..c27534d9d78 100644 --- a/mysql-test/suite/plugins/r/processlist.result +++ b/mysql-test/suite/plugins/r/processlist.result @@ -2,10 +2,8 @@ create table t1 (a int) engine=innodb; start transaction; insert t1 values (1); connect con2,localhost,root; -state from show engine innodb status +state from show engine innodb status, must be empty -state from show processlist - disconnect con2; connection default; drop table t1; diff --git a/mysql-test/suite/plugins/t/processlist.test b/mysql-test/suite/plugins/t/processlist.test index e8f03aacb10..39b715b867b 100644 --- a/mysql-test/suite/plugins/t/processlist.test +++ b/mysql-test/suite/plugins/t/processlist.test @@ -8,11 +8,12 @@ start transaction; insert t1 values (1); let id=`select connection_id()`; connect con2,localhost,root; +let $wait_condition=select state='' from information_schema.processlist where id = $id; +--source include/wait_condition.inc replace_regex /\"/-/; #" let s=`show engine innodb status`; disable_query_log; -eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status`; -eval select state as `state from show processlist` from information_schema.processlist where id = $id; +eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status, must be empty`; enable_query_log; disconnect con2; connection default; -- cgit v1.2.1 From 16c14d7ba05ed3ad6ce1f3a8e0447d6304a7e636 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 21 Jun 2018 09:43:05 +0200 Subject: mark ed25519 stable --- mysql-test/suite/plugins/r/auth_ed25519.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result index a3b85a11dea..371d20befeb 100644 --- a/mysql-test/suite/plugins/r/auth_ed25519.result +++ b/mysql-test/suite/plugins/r/auth_ed25519.result @@ -32,7 +32,7 @@ PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication PLUGIN_LICENSE GPL LOAD_OPTION ON -PLUGIN_MATURITY Beta +PLUGIN_MATURITY Stable PLUGIN_AUTH_VERSION 1.0-alpha create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'; show grants for test1@localhost; -- cgit v1.2.1 From 45cabf10175da1ae2d158ea17ccd6e19f461d6f4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Jun 2018 16:17:21 +0200 Subject: MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE table->in_use is not always set and a KILL signal can arrive anytime. --- mysql-test/r/max_statement_time.result | 3 +++ mysql-test/t/max_statement_time.test | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/max_statement_time.result b/mysql-test/r/max_statement_time.result index 44ee03b813a..a87a899b575 100644 --- a/mysql-test/r/max_statement_time.result +++ b/mysql-test/r/max_statement_time.result @@ -181,3 +181,6 @@ ERROR 70100: Query execution was interrupted (max_statement_time exceeded) set max_statement_time = 0; drop procedure pr; drop table t1; +SET max_statement_time= 1; +CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000; +ERROR 70100: Query execution was interrupted (max_statement_time exceeded) diff --git a/mysql-test/t/max_statement_time.test b/mysql-test/t/max_statement_time.test index 0882daff139..24b6d9311f2 100644 --- a/mysql-test/t/max_statement_time.test +++ b/mysql-test/t/max_statement_time.test @@ -5,6 +5,7 @@ --source include/not_embedded.inc --source include/have_innodb.inc +--source include/have_sequence.inc --source include/not_valgrind.inc --echo @@ -226,3 +227,10 @@ call pr(); set max_statement_time = 0; drop procedure pr; drop table t1; + +# +# MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE +# +SET max_statement_time= 1; +--error ER_STATEMENT_TIMEOUT +CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000; -- cgit v1.2.1