summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/MW-86-wait1.test
blob: 6c0982ad8b31630a9dd0eb133957cd275253291c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#
# SHOW commands no longer obey wsrep_sync_wait = 1 (WSREP_SYNC_WAIT_BEFORE_READ)
# (they do not wait for the background INSERT in the applier in node_2 to
# complete)
#
--source include/galera_cluster.inc
--source include/have_binlog_format_row.inc
--source include/have_debug_sync.inc

--connection node_2
# Make sure no signals have been leftover from previous tests to surprise us.
SELECT @@debug_sync;

SET SESSION wsrep_sync_wait = 1;
SET GLOBAL debug = "+d,sync.wsrep_apply_cb";

--connection node_1
CREATE TABLE t_wait1 (f1 INTEGER) ENGINE=InnoDB;
# This will complete in node_1 but will start a background apply in node_2
# which will stop because of sync.wsrep_apply_cb we set above.
INSERT INTO t_wait1 VALUES (1);

--connection node_2

SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached";

--disable_result_log

SHOW BINARY LOGS;

SHOW BINLOG EVENTS;

--error ER_NO_SUCH_TABLE
SHOW COLUMNS FROM t1;

--error ER_EVENT_DOES_NOT_EXIST
SHOW CREATE EVENT e1;

--error ER_SP_DOES_NOT_EXIST
SHOW CREATE FUNCTION f1;

--error ER_SP_DOES_NOT_EXIST
SHOW CREATE PROCEDURE p1;

--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE t1;

--error ER_TRG_DOES_NOT_EXIST
SHOW CREATE TRIGGER tr1;

--error ER_NO_SUCH_TABLE
SHOW CREATE VIEW v1;

SHOW DATABASES;

SHOW ENGINE InnoDB STATUS;

--error ER_SP_DOES_NOT_EXIST
SHOW FUNCTION CODE f1;

SHOW FUNCTION STATUS;

SHOW GRANTS FOR 'root'@'localhost';

--error ER_NO_SUCH_TABLE
SHOW INDEX FROM t1;

SHOW OPEN TABLES;

--error ER_SP_DOES_NOT_EXIST
SHOW PROCEDURE CODE p1;

SHOW PROCEDURE STATUS;

SHOW PRIVILEGES;

SHOW STATUS LIKE 'wsrep_cluster_size';

SHOW TABLE STATUS;

SHOW TABLES;

SHOW TRIGGERS;

SHOW GLOBAL VARIABLES LIKE 'foo_bar';

--error 0
SHOW WARNINGS;

--enable_result_log

# Unblock the background INSERT and remove the sync point.
SET GLOBAL debug = "-d,sync.wsrep_apply_cb";
SET SESSION debug_sync = "now SIGNAL signal.wsrep_apply_cb";

SET SESSION wsrep_sync_wait = default;

# This will wait for the background INSERT to complete before we quit
# from the test.
DROP TABLE t_wait1;

SET GLOBAL debug = NULL;
SET debug_sync='RESET';

# Make sure no pending signals are leftover to surprise subsequent tests.
SELECT @@debug_sync;