diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-07-14 16:05:29 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-07-14 16:05:29 -0400 |
commit | dced5146bdfc46e200ba35a86c3c55fb60972e33 (patch) | |
tree | 22e3dd18f4edec2a585341fee607765f96b2744f /mysql-test/suite/galera/t/galera_transaction_read_only.test | |
parent | 75931feabe99595e9659a423e299c4229d3c02ba (diff) | |
download | mariadb-git-dced5146bdfc46e200ba35a86c3c55fb60972e33.tar.gz |
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'mysql-test/suite/galera/t/galera_transaction_read_only.test')
-rw-r--r-- | mysql-test/suite/galera/t/galera_transaction_read_only.test | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/t/galera_transaction_read_only.test b/mysql-test/suite/galera/t/galera_transaction_read_only.test new file mode 100644 index 00000000000..386d73fd3ca --- /dev/null +++ b/mysql-test/suite/galera/t/galera_transaction_read_only.test @@ -0,0 +1,58 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# Ensure that transactions that do not write anything do not cause the wsrep_last_committed counter to advance +# + +# Empty transaction + +--connection node_1 +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; + +--connection node_2 +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_1 + +SET AUTOCOMMIT=OFF; +START TRANSACTION; +COMMIT; + +--connection node_2 +--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` +--disable_query_log +--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; +--enable_query_log + +# START TRANSACTION READ ONLY + +--connection node_2 +--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` + +--connection node_1 +START TRANSACTION READ ONLY; +SELECT COUNT(*) = 0 FROM t1; +COMMIT; + +--connection node_2 +--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` +--disable_query_log +--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; +--enable_query_log + +# Ordinary transaction with only SELECTs + +--connection node_1 +START TRANSACTION; +SELECT COUNT(*) = 0 FROM t1; +COMMIT; + +--connection node_2 +--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` +--disable_query_log +--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; +--enable_query_log + +DROP TABLE t1; + |