Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_replica_invalid_time_zone.test

raw
1 ##############################################################################
2 # ==== Purpose ====
3 # The purpose of this test is to verify that when time_zone value is unknown
4 # for the replica, an attempt to replicate a transaction which sets the value
5 # of time_zone should not throw any assertion failure.
6 #
7 # ==== Requirement ====
8 # When attempting to replicate a transaction that sets the session value of
9 # time_zone which is unknown for the replica, replica should throw an error
10 # and stop gracefully.
11 #
12 # ==== Implementation ====
13 # 1. Create source-replica topology
14 # 2. Configure source with time_zone value to 'UTC'
15 # 3. Configure replica without time_zone table
16 # 4. Execute a transaction which doesn't use time_zone
17 # 5. Execute a transaction which does use time_zone
18 # 6: Start replica
19 # 7. Verify that replica sql thread failed with error
20 # 8. Cleanup
21 #
22 # ==== References ====
23 # Bug #32986721: REPLICA SERVER FAILS WITH ASSERTION `!IS_SET() ||
24 # M_CAN_OVERWRITE_STATUS
25 ###############################################################################
26
27 --source include/have_binlog_format_row.inc
28
29 --echo #
30 --echo # 1. Create source-replica topology
31 --let $rpl_skip_start_slave= 1
32 --source include/master-slave.inc
33
34 --echo #
35 --echo # 2. Configure source with time_zone value to 'UTC'
36 SET @save.time_zone= @@time_zone;
37 SET time_zone='UTC';
38
39 --echo #
40 --echo # 3. Configure replica without time_zone table
41 --source include/rpl_connection_slave.inc
42 RENAME TABLE mysql.time_zone TO mysql.time_zone_bkup;
43
44 --source include/rpl_connection_master.inc
45 --echo #
46 --echo # 4. Execute a transaction which doesn't use time_zone
47 CREATE DATABASE IF NOT EXISTS db1;
48
49 --echo #
50 --echo # 5. Execute a transaction which does use time_zone
51 CREATE USER u1 IDENTIFIED BY 'Root@123';
52
53 --echo #
54 --echo # 6. Start replica
55 --source include/rpl_connection_slave.inc
56 call mtr.add_suppression("Replica SQL for channel '': ... The replica coordinator and worker threads are stopped.*");
57 call mtr.add_suppression("Replica SQL for channel '':.*failed executing transaction.*");
58 call mtr.add_suppression("Replica SQL for channel '': Error 'Table 'mysql.time_zone' doesn't exist' on query.*");
59 call mtr.add_suppression("Replica: Unknown or incorrect time zone: 'UTC'.*");
60 --source include/start_slave_io.inc
61 --source include/wait_for_slave_io_to_start.inc
62 START REPLICA SQL_THREAD;
63
64 --echo #
65 --echo # 7. Verify that replica sql thread failed with error
66 --let $slave_sql_errno= convert_error(ER_NO_SUCH_TABLE)
67 --source include/wait_for_slave_sql_error.inc
68
69 --echo #
70 --echo # 8. Cleanup
71 --source include/stop_slave_io.inc
72 RESET REPLICA ALL;
73 --replace_result $MASTER_MYPORT MASTER_MYPORT
74 --eval CHANGE REPLICATION SOURCE TO SOURCE_USER= 'root', SOURCE_HOST= "127.0.0.1", SOURCE_PORT= $MASTER_MYPORT;
75 RENAME TABLE mysql.time_zone_bkup TO mysql.time_zone;
76 --source include/start_slave.inc
77
78 --source include/rpl_connection_master.inc
79 DROP USER u1;
80 DROP DATABASE db1;
81 set time_zone= @save.time_zone;
82
83 --source include/rpl_end.inc