File: gr_consistent_statement_hold_show.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (118 lines) | stat: -rw-r--r-- 3,702 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
################################################################################
# Validate that SHOW statements which output does depend on data consistency
# go through the `trans_begin` hook on Group Replication on server1.
#
# Test:
#  0. The test requires one group member: M1.
#  1. Bootstrap group on server1.
#  2. Validate that a given SHOW statement goes through the
#     `trans_begin` hook on Group Replication on server1.
#  3. Clean up.
################################################################################
--source include/have_debug_sync.inc
--source include/have_group_replication_plugin.inc
--let $rpl_group_replication_single_primary_mode=1
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc


--echo
--echo ############################################################
--echo # 1. Bootstrap group on server1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY);

USE test;
delimiter $$;
CREATE PROCEDURE procedure1()
     BEGIN
     end$$
delimiter ;$$

CREATE FUNCTION function1() RETURNS INT RETURN (SELECT COUNT(*) FROM t1);

delimiter $$;
CREATE EVENT event1
 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
 ON COMPLETION PRESERVE
 DISABLE
 DO
 BEGIN
END$$
delimiter ;$$

DELIMITER |;
CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
BEGIN
  INSERT INTO t2 VALUES (NEW.c1);
END|
DELIMITER ;|


--echo
--echo ############################################################
--echo # 2. Validate that a given SHOW statement goes through the
--echo #    `trans_begin` hook on Group Replication on server1.
--let $statement_to_hold= SHOW DATABASES
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW TABLES
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW INDEX FROM t1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW KEYS FROM t1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW GRANTS FOR CURRENT_USER()
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE DATABASE test
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW TABLE STATUS FROM test
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW TRIGGERS FROM test
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE PROCEDURE test.procedure1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE FUNCTION test.function1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW PROCEDURE CODE test.procedure1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW FUNCTION CODE test.function1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE EVENT test.event1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE TRIGGER test.trigger1
--source ../include/gr_consistent_statement_hold.inc

--let $statement_to_hold= SHOW CREATE USER CURRENT_USER()
--source ../include/gr_consistent_statement_hold.inc


--echo
--echo ############################################################
--echo # 3. Clean up.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
DROP PROCEDURE procedure1;
DROP FUNCTION function1;
DROP EVENT event1;
DROP TRIGGER trigger1;
DROP TABLE t2;
DROP TABLE t1;

--source include/group_replication_end.inc