Debian Codegraph @

mysql-test/suite/group_replication/t/gr_consistent_statement_hold_select_do.test

raw
1 ################################################################################
2 # Validate that SELECT and DO statements which output does depend on data
3 # consistency or do call UDFs go through the `trans_begin` hook on Group
4 # Replication on server1.
5 #
6 # Test:
7 # 0. The test requires one group member: M1.
8 # 1. Bootstrap group on server1.
9 # 2. Validate that a given SELECT that access tables goes
10 # through the `trans_begin` hook on Group Replication on
11 # server1.
12 # 3. Validate that a given SELECT that calls a UDF goes
13 # through the `trans_begin` hook on Group Replication on
14 # server1.
15 # 4. Validate that a given DO that calls a UDF goes
16 # through the `trans_begin` hook on Group Replication on
17 # server1.
18 # 5. Clean up.
19 ################################################################################
20 --source include/have_debug_sync.inc
21 --source include/have_group_replication_plugin.inc
22 --let $rpl_group_replication_single_primary_mode=1
23 --let $rpl_skip_group_replication_start= 1
24 --source include/group_replication.inc
25
26
27 --echo
28 --echo ############################################################
29 --echo # 1. Bootstrap group on server1.
30 --let $rpl_connection_name= server1
31 --source include/rpl_connection.inc
32 --source include/start_and_bootstrap_group_replication.inc
33
34 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);
35
36
37 --echo
38 --echo ############################################################
39 --echo # 2. Validate that a given SELECT that access tables goes
40 --echo # through the `trans_begin` hook on Group Replication on
41 --echo # server1.
42 --let $statement_to_hold= SELECT * FROM t1
43 --source ../include/gr_consistent_statement_hold.inc
44
45
46 --echo
47 --echo ############################################################
48 --echo # 3. Validate that a given SELECT that calls a UDF goes
49 --echo # through the `trans_begin` hook on Group Replication on
50 --echo # server1.
51 --let $statement_to_hold= SELECT group_replication_enable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
52 --source ../include/gr_consistent_statement_hold.inc
53
54
55 --echo
56 --echo ############################################################
57 --echo # 4. Validate that a given DO that calls a UDF goes
58 --echo # through the `trans_begin` hook on Group Replication on
59 --echo # server1.
60 --let $statement_to_hold= DO group_replication_enable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION");
61 --source ../include/gr_consistent_statement_hold.inc
62
63
64 --echo
65 --echo ############################################################
66 --echo # 5. Clean up.
67 --let $rpl_connection_name= server1
68 --source include/rpl_connection.inc
69 DROP TABLE t1;
70
71 --source include/group_replication_end.inc