diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-21 13:35:00 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2017-08-21 13:35:00 +0300 |
commit | c23efc7d50530570e6c13207f3c76adcb9237346 (patch) | |
tree | 7c57ca7a1dc61590019abb5608c2b19327f8ed7c /mysql-test/suite/galera/t/galera_var_dirty_reads.test | |
parent | 06106c01481401b6d7ef4309391ca2f66242cc85 (diff) | |
parent | f1af2114993f884b1a6dc34fb1d972ead08f1966 (diff) | |
download | mariadb-git-c23efc7d50530570e6c13207f3c76adcb9237346.tar.gz |
Merge remote-tracking branch 'origin/10.0-galera' into 10.1
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 | 77 |
1 files changed, 13 insertions, 64 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 1fd30c69a7b..cba8488b879 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -17,15 +17,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,75 +32,31 @@ SHOW STATUS LIKE 'wsrep_cluster_status'; --error ER_UNKNOWN_COM_ERROR SELECT * FROM t1; -#Select query which does not access table should be allowed MDEV-11016 -SELECT @@wsrep_dirty_reads; -SELECT 2; -SELECT 2+2 FROM DUAL; +--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; - -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; +SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1; -#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 @@session.wsrep_dirty_reads=OFF; -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 i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1; -prepare stmt_show from 'select 1'; -prepare stmt_select from 'select * from t1'; -prepare stmt_insert from 'insert into t1 values(1)'; +SELECT 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' @@ -113,13 +64,11 @@ 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 |