[Commits] 81fd8ff6761: Fix test failures.

jan jan.lindstrom at mariadb.com
Wed Aug 16 07:49:26 EEST 2017


revision-id: 81fd8ff6761109546f14cc8f8a5dfb27b0da8a2d (mariadb-galera-10.0.31-47-g81fd8ff6761)
parent(s): 5017c261d4b6332ffff70919080a99fd5e459ed1
author: Jan Lindström
committer: Jan Lindström
timestamp: 2017-08-16 07:49:19 +0300
message:

Fix test failures.

---
 mysql-test/suite/galera/r/GAL-401.result           |  1 +
 .../suite/galera/r/galera_suspend_slave.result     |  3 +
 .../suite/galera/r/galera_var_dirty_reads.result   | 78 ++++-----------------
 mysql-test/suite/galera/t/GAL-401.test             |  1 +
 .../suite/galera/t/galera_suspend_slave.test       |  3 +
 .../suite/galera/t/galera_var_dirty_reads.test     | 80 ++++------------------
 .../suite/sys_vars/r/wsrep_sync_wait_basic.result  |  4 +-
 7 files changed, 37 insertions(+), 133 deletions(-)

diff --git a/mysql-test/suite/galera/r/GAL-401.result b/mysql-test/suite/galera/r/GAL-401.result
index fbdb2d39a28..03509cb0e29 100644
--- a/mysql-test/suite/galera/r/GAL-401.result
+++ b/mysql-test/suite/galera/r/GAL-401.result
@@ -1,6 +1,7 @@
 SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
 SET @@global.wsrep_desync = 1;
 SET SESSION wsrep_dirty_reads=1;
+SET SESSION wsrep_sync_wait=0;
 SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
 SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
diff --git a/mysql-test/suite/galera/r/galera_suspend_slave.result b/mysql-test/suite/galera/r/galera_suspend_slave.result
index 02904812dd5..357a0d4f78e 100644
--- a/mysql-test/suite/galera/r/galera_suspend_slave.result
+++ b/mysql-test/suite/galera/r/galera_suspend_slave.result
@@ -3,8 +3,11 @@ Suspending node_2 ...
 INSERT INTO t1 VALUES (1);
 Got one of the listed errors
 Resuming node_2 ...
+SET SESSION wsrep_sync_wait = 1;
 INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 1;
 SELECT COUNT(*) = 1 FROM t1;
 COUNT(*) = 1
 1
+SET SESSION wsrep_sync_wait = 15;
 DROP TABLE t1;
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 8a3175912c7..405d86b3027 100644
--- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
@@ -3,10 +3,6 @@ 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,78 +14,32 @@ Variable_name	Value
 wsrep_cluster_status	non-Primary
 SELECT * FROM t1;
 ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT 1 FROM t1;
+ERROR 08S01: WSREP has not yet prepared node for application use
 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;
+SELECT 1 FROM t1;
 1
 1
-execute stmt_select;
-i
-1
-execute stmt_insert;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
+i	variable_name	variable_value
+1	WSREP_DIRTY_READS	ON
+SET @@session.wsrep_dirty_reads=OFF;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
 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;
+SELECT 1;
 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;
+USE information_schema;
 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;
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
+ERROR 08S01: WSREP has not yet prepared node for application use
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
 ERROR 08S01: WSREP has not yet prepared node for application use
-connection node_2;
-SET @@global.wsrep_dirty_reads=OFF;
-connection node_1;
+USE test;
 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/GAL-401.test b/mysql-test/suite/galera/t/GAL-401.test
index 25ab9502bec..06ce37dc81f 100644
--- a/mysql-test/suite/galera/t/GAL-401.test
+++ b/mysql-test/suite/galera/t/GAL-401.test
@@ -10,6 +10,7 @@ SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
 --connection node_2
 SET @@global.wsrep_desync = 1;
 SET SESSION wsrep_dirty_reads=1;
+SET SESSION wsrep_sync_wait=0;
 SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
 --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
 --source include/wait_condition.inc
diff --git a/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-test/suite/galera/t/galera_suspend_slave.test
index 5c622085804..fd8bc362d02 100644
--- a/mysql-test/suite/galera/t/galera_suspend_slave.test
+++ b/mysql-test/suite/galera/t/galera_suspend_slave.test
@@ -41,6 +41,7 @@ INSERT INTO t1 VALUES (1);
 	exit(0);
 EOF
 
+SET SESSION wsrep_sync_wait = 1;
 --sleep 10
 --source include/wait_until_ready.inc
 INSERT INTO t1 VALUES (1);
@@ -50,9 +51,11 @@ INSERT INTO t1 VALUES (1);
 --source include/galera_connect.inc
 --connection node_2a
 
+SET SESSION wsrep_sync_wait = 1;
 --source include/wait_until_ready.inc
 SELECT COUNT(*) = 1 FROM t1;
 
+SET SESSION wsrep_sync_wait = 15;
 DROP TABLE t1;
 
 # Restore original auto_increment_offset values.
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 bcdb1574a3d..183c60753ad 100644
--- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -5,11 +5,6 @@
 --source include/galera_cluster.inc
 --source include/have_innodb.inc
 
-# Save original auto_increment_offset values.
---let $node_1=node_1
---let $node_2=node_2
---source include/auto_increment_offset_save.inc
-
 --connection node_2
 --let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
 
@@ -17,15 +12,10 @@ 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;
 
-# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT (MDEV-6832).
+# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT.
 SET SESSION wsrep_sync_wait=0;
 
 # Must return 'OFF'
@@ -37,70 +27,32 @@ SHOW STATUS LIKE 'wsrep_cluster_status';
 --error ER_UNKNOWN_COM_ERROR
 SELECT * FROM t1;
 
+--error ER_UNKNOWN_COM_ERROR
+SELECT 1 FROM t1;
+
 SET @@session.wsrep_dirty_reads=ON;
 
 SELECT * FROM t1;
+SELECT 1 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;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
 
-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;
+SET @@session.wsrep_dirty_reads=OFF;
 
-#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;
+SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
 
-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;
+SELECT 1;
 
-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;
+USE information_schema;
 
-SET SESSION wsrep_sync_wait=7;
-execute stmt_show;
-execute stmt_select;
 --error ER_UNKNOWN_COM_ERROR
-execute stmt_insert;
+SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
 
---connection node_2
-SET @@global.wsrep_dirty_reads=OFF;
+--error ER_UNKNOWN_COM_ERROR
+SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
 
 --disable_query_log
 --eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved'
@@ -108,14 +60,10 @@ SET @@global.wsrep_dirty_reads=OFF;
 --source include/wait_until_connected_again.inc
 
 --connection node_1
+USE test;
 SELECT * FROM t1;
 # Cleanup
 DROP TABLE t1;
-drop user user1;
-drop user user2;
-
-# Restore original auto_increment_offset values.
---source include/auto_increment_offset_restore.inc
 
 --source include/galera_end.inc
 --echo # End of 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;


More information about the commits mailing list