Skip to content

Commit 81fd8ff

Browse files
author
Jan Lindström
committed
Fix test failures.
1 parent 5017c26 commit 81fd8ff

File tree

7 files changed

+37
-133
lines changed

7 files changed

+37
-133
lines changed

mysql-test/suite/galera/r/GAL-401.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
22
SET @@global.wsrep_desync = 1;
33
SET SESSION wsrep_dirty_reads=1;
4+
SET SESSION wsrep_sync_wait=0;
45
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
56
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
67
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';

mysql-test/suite/galera/r/galera_suspend_slave.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ Suspending node_2 ...
33
INSERT INTO t1 VALUES (1);
44
Got one of the listed errors
55
Resuming node_2 ...
6+
SET SESSION wsrep_sync_wait = 1;
67
INSERT INTO t1 VALUES (1);
8+
SET SESSION wsrep_sync_wait = 1;
79
SELECT COUNT(*) = 1 FROM t1;
810
COUNT(*) = 1
911
1
12+
SET SESSION wsrep_sync_wait = 15;
1013
DROP TABLE t1;

mysql-test/suite/galera/r/galera_var_dirty_reads.result

Lines changed: 14 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ INSERT INTO t1 VALUES(1);
33
SELECT * FROM t1;
44
i
55
1
6-
create user user1;
7-
grant all privileges on *.* to user1;
8-
create user user2;
9-
grant all privileges on *.* to user2;
106
SET @@global.wsrep_cluster_address = '';
117
SET @@session.wsrep_dirty_reads=OFF;
128
SET SESSION wsrep_sync_wait=0;
@@ -18,78 +14,32 @@ Variable_name Value
1814
wsrep_cluster_status non-Primary
1915
SELECT * FROM t1;
2016
ERROR 08S01: WSREP has not yet prepared node for application use
17+
SELECT 1 FROM t1;
18+
ERROR 08S01: WSREP has not yet prepared node for application use
2119
SET @@session.wsrep_dirty_reads=ON;
2220
SELECT * FROM t1;
2321
i
2422
1
25-
connect con1, localhost, user1,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2;
26-
SET SESSION wsrep_sync_wait=0;
27-
set session wsrep_dirty_reads=1;
28-
prepare stmt_show from 'select 1';
29-
prepare stmt_select from 'select * from t1';
30-
prepare stmt_insert from 'insert into t1 values(1)';
31-
set session wsrep_dirty_reads=0;
32-
execute stmt_show;
33-
ERROR 08S01: WSREP has not yet prepared node for application use
34-
execute stmt_select;
35-
ERROR 08S01: WSREP has not yet prepared node for application use
36-
execute stmt_insert;
37-
ERROR 08S01: WSREP has not yet prepared node for application use
38-
SET wsrep_dirty_reads=ON;
39-
select @@session.wsrep_dirty_reads;
40-
@@session.wsrep_dirty_reads
41-
1
42-
execute stmt_show;
23+
SELECT 1 FROM t1;
4324
1
4425
1
45-
execute stmt_select;
46-
i
47-
1
48-
execute stmt_insert;
26+
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
27+
i variable_name variable_value
28+
1 WSREP_DIRTY_READS ON
29+
SET @@session.wsrep_dirty_reads=OFF;
30+
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
4931
ERROR 08S01: WSREP has not yet prepared node for application use
50-
SET @@global.wsrep_dirty_reads=ON;
51-
connect con2, localhost, user2,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2;
52-
select @@session.wsrep_dirty_reads;
53-
@@session.wsrep_dirty_reads
54-
1
55-
prepare stmt_show from 'select 1';
56-
prepare stmt_select from 'select * from t1';
57-
prepare stmt_insert from 'insert into t1 values(1)';
58-
execute stmt_show;
59-
1
60-
1
61-
execute stmt_select;
62-
i
63-
1
64-
execute stmt_insert;
32+
SELECT 1;
6533
ERROR 08S01: WSREP has not yet prepared node for application use
66-
SET SESSION wsrep_sync_wait=1;
67-
execute stmt_show;
68-
1
69-
1
70-
execute stmt_select;
71-
i
72-
1
73-
execute stmt_insert;
34+
USE information_schema;
7435
ERROR 08S01: WSREP has not yet prepared node for application use
75-
SET SESSION wsrep_sync_wait=7;
76-
execute stmt_show;
77-
1
78-
1
79-
execute stmt_select;
80-
i
81-
1
82-
execute stmt_insert;
36+
SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
37+
ERROR 08S01: WSREP has not yet prepared node for application use
38+
SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
8339
ERROR 08S01: WSREP has not yet prepared node for application use
84-
connection node_2;
85-
SET @@global.wsrep_dirty_reads=OFF;
86-
connection node_1;
40+
USE test;
8741
SELECT * FROM t1;
8842
i
8943
1
9044
DROP TABLE t1;
91-
drop user user1;
92-
drop user user2;
93-
disconnect node_2;
94-
disconnect node_1;
9545
# End of test

mysql-test/suite/galera/t/GAL-401.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
1010
--connection node_2
1111
SET @@global.wsrep_desync = 1;
1212
SET SESSION wsrep_dirty_reads=1;
13+
SET SESSION wsrep_sync_wait=0;
1314
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
1415
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
1516
--source include/wait_condition.inc

mysql-test/suite/galera/t/galera_suspend_slave.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ INSERT INTO t1 VALUES (1);
4141
exit(0);
4242
EOF
4343

44+
SET SESSION wsrep_sync_wait = 1;
4445
--sleep 10
4546
--source include/wait_until_ready.inc
4647
INSERT INTO t1 VALUES (1);
@@ -50,9 +51,11 @@ INSERT INTO t1 VALUES (1);
5051
--source include/galera_connect.inc
5152
--connection node_2a
5253

54+
SET SESSION wsrep_sync_wait = 1;
5355
--source include/wait_until_ready.inc
5456
SELECT COUNT(*) = 1 FROM t1;
5557

58+
SET SESSION wsrep_sync_wait = 15;
5659
DROP TABLE t1;
5760

5861
# Restore original auto_increment_offset values.

mysql-test/suite/galera/t/galera_var_dirty_reads.test

Lines changed: 14 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,17 @@
55
--source include/galera_cluster.inc
66
--source include/have_innodb.inc
77

8-
# Save original auto_increment_offset values.
9-
--let $node_1=node_1
10-
--let $node_2=node_2
11-
--source include/auto_increment_offset_save.inc
12-
138
--connection node_2
149
--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
1510

1611
CREATE TABLE t1(i INT) ENGINE=INNODB;
1712
INSERT INTO t1 VALUES(1);
1813
SELECT * FROM t1;
1914

20-
create user user1;
21-
grant all privileges on *.* to user1;
22-
create user user2;
23-
grant all privileges on *.* to user2;
24-
2515
SET @@global.wsrep_cluster_address = '';
2616
SET @@session.wsrep_dirty_reads=OFF;
2717

28-
# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT (MDEV-6832).
18+
# Set wsrep_sync_wait to avoid ER_LOCK_WAIT_TIMEOUT.
2919
SET SESSION wsrep_sync_wait=0;
3020

3121
# Must return 'OFF'
@@ -37,85 +27,43 @@ SHOW STATUS LIKE 'wsrep_cluster_status';
3727
--error ER_UNKNOWN_COM_ERROR
3828
SELECT * FROM t1;
3929

30+
--error ER_UNKNOWN_COM_ERROR
31+
SELECT 1 FROM t1;
32+
4033
SET @@session.wsrep_dirty_reads=ON;
4134

4235
SELECT * FROM t1;
36+
SELECT 1 FROM t1;
4337

44-
--enable_connect_log
45-
--connect (con1, localhost, user1,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2)
46-
#Just test the session behavior
47-
SET SESSION wsrep_sync_wait=0;
38+
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
4839

49-
set session wsrep_dirty_reads=1;
50-
#Prepared statement creation should be allowed MDEV-11479
51-
prepare stmt_show from 'select 1';
52-
prepare stmt_select from 'select * from t1';
53-
prepare stmt_insert from 'insert into t1 values(1)';
54-
set session wsrep_dirty_reads=0;
40+
SET @@session.wsrep_dirty_reads=OFF;
5541

56-
#No Preapare stmt/proceure will be allowed
57-
--error ER_UNKNOWN_COM_ERROR
58-
execute stmt_show;
5942
--error ER_UNKNOWN_COM_ERROR
60-
execute stmt_select;
61-
--error ER_UNKNOWN_COM_ERROR
62-
execute stmt_insert;
43+
SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1;
6344

64-
SET wsrep_dirty_reads=ON;
65-
select @@session.wsrep_dirty_reads;
66-
#Only prepare statement which does not change data should be allowed
67-
execute stmt_show;
68-
execute stmt_select;
6945
--error ER_UNKNOWN_COM_ERROR
70-
execute stmt_insert;
71-
SET @@global.wsrep_dirty_reads=ON;
72-
73-
--connect (con2, localhost, user2,,test,$NODE_MYPORT_2,$NODE_MYSOCK_2)
74-
#Just test the session behavior
75-
select @@session.wsrep_dirty_reads;
46+
SELECT 1;
7647

77-
prepare stmt_show from 'select 1';
78-
prepare stmt_select from 'select * from t1';
79-
prepare stmt_insert from 'insert into t1 values(1)';
80-
81-
#Only prepare statement which does not change data should be allowed
82-
execute stmt_show;
83-
execute stmt_select;
84-
--error ER_UNKNOWN_COM_ERROR
85-
execute stmt_insert;
86-
87-
#wsrep_dirty_read should work when wsrep_sync_wait is 1 or non zero
88-
#because we already are disconnected , So It does not make any sense
89-
#to wait for other nodes
90-
SET SESSION wsrep_sync_wait=1;
91-
execute stmt_show;
92-
execute stmt_select;
9348
--error ER_UNKNOWN_COM_ERROR
94-
execute stmt_insert;
49+
USE information_schema;
9550

96-
SET SESSION wsrep_sync_wait=7;
97-
execute stmt_show;
98-
execute stmt_select;
9951
--error ER_UNKNOWN_COM_ERROR
100-
execute stmt_insert;
52+
SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
10153

102-
--connection node_2
103-
SET @@global.wsrep_dirty_reads=OFF;
54+
--error ER_UNKNOWN_COM_ERROR
55+
SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
10456

10557
--disable_query_log
10658
--eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_saved'
10759
--enable_query_log
10860
--source include/wait_until_connected_again.inc
10961

11062
--connection node_1
63+
USE test;
11164
SELECT * FROM t1;
11265
# Cleanup
11366
DROP TABLE t1;
114-
drop user user1;
115-
drop user user2;
116-
117-
# Restore original auto_increment_offset values.
118-
--source include/auto_increment_offset_restore.inc
11967

12068
--source include/galera_end.inc
12169
--echo # End of test

mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ SELECT @@session.wsrep_sync_wait;
3434
@@session.wsrep_sync_wait
3535
7
3636
SET @@session.wsrep_sync_wait=8;
37-
Warnings:
38-
Warning 1292 Truncated incorrect wsrep_sync_wait value: '8'
3937
SELECT @@session.wsrep_sync_wait;
4038
@@session.wsrep_sync_wait
41-
7
39+
8
4240

4341
# invalid values
4442
SET @@global.wsrep_sync_wait=NULL;

0 commit comments

Comments
 (0)