diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-16 07:49:19 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-16 07:49:19 +0300 |
commit | 81fd8ff6761109546f14cc8f8a5dfb27b0da8a2d (patch) | |
tree | d352be0a8b6bcf069f9da4a2e6726364d42a5a18 /mysql-test/suite/galera/t/galera_var_dirty_reads.test | |
parent | 5017c261d4b6332ffff70919080a99fd5e459ed1 (diff) | |
download | mariadb-git-81fd8ff6761109546f14cc8f8a5dfb27b0da8a2d.tar.gz |
Fix test failures.
Diffstat (limited to 'mysql-test/suite/galera/t/galera_var_dirty_reads.test')
-rw-r--r-- | mysql-test/suite/galera/t/galera_var_dirty_reads.test | 80 |
1 files changed, 14 insertions, 66 deletions
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 |