File: rpl_functional_index_cross_version_replication.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 (95 lines) | stat: -rw-r--r-- 2,860 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
# ==== Purpose ====
#
# Tests the row-based replication of tables with functional indexes and with
# extra columns or columns added with `ALTER TABLE` in a cross-version scenario
# by replacing the slave's relay-log for a relay-log produced with a version
# prior to the code changes being tested.
#
# ==== Requirements ====
#
# R1. It should be possible to replicate from an 8.0.17 master where a
#     replicated column was added after a hidden generated column.
#
# ==== Implementation ====
#
# TC1. Apply OLD-generated relay log on NEW server
# ------------------------------------------------------------------------
# 1) Stop the slave.
# 2) Setup the previous saved log - from a 8.0.17 server - as the slave relay
#    log which contains:
#
#    CREATE TABLE t (a INT, INDEX i((a+1)));
#    ALTER TABLE t ADD COLUMN b TEXT;
#    INSERT INTO t(a, b) VALUES (1, '1');
#
# 3) Start the slave.
# 4) Check table included in the relay log exists.
#
# ==== References ====
#
# BUG#29390506 HIDDEN GENERATED COLUMNS PREVENT SLAVE FROM HAVING EXTRA COLUMNS IN TABLES
#

--let $rpl_skip_start_slave = 1
--source include/not_have_privilege_checks_user.inc
--source include/master-slave.inc
--source include/have_binlog_format_row.inc

--echo #
--echo # TC1. Apply OLD-generated relay log on NEW server
--echo #

#
# 1) Stop the slave.
#
--source include/rpl_connection_slave.inc
call mtr.add_suppression("Replica SQL.*Error executing row event: .Table .test.t. doesn.t exist., Error_code: MY-001146");

#
# 2) Setup the previous saved log as the slave relay log which contains:
#
#    CREATE TABLE t (a INT, INDEX i((a+1)));
#    ALTER TABLE t ADD COLUMN b TEXT;
#    INSERT INTO t(a, b) VALUES (1, '1');
#
--let $fake_relay_log = $MYSQL_TEST_DIR/std_data/rpl_unfiltered_hidden_gcol.000001
--source include/setup_fake_relay_log.inc

#
# 3) Start the slave.
#
START SLAVE SQL_THREAD;

#
# 4) Check table included in the relay log exists.
#
# Test if the slave arrived at a sane state and finished processing all
# relay-logs.
#
--let $slave_param = Slave_SQL_Running_State
--let $slave_param_value= Replica has read all relay log; waiting for more updates
--let $slave_io_running_check_disable = 1
--source include/wait_for_slave_param.inc

# Even with the above validation, we should protect against future changes that
# bipass _OLD_ relay-logs. Therefore, making the test fail if the table doesn't
# exist.
#

--let $wait_timeout= 60
--let $wait_condition= SELECT count(*) = 1 FROM t
--source include/wait_condition_or_abort.inc

--let $table_t = `SHOW TABLES LIKE "t"`
--let $assert_text = Slave was able to apply the provided relay log.
--let $assert_cond = "$table_t" = "t"
--source include/assert.inc

# Clean up
DROP TABLE t;

STOP SLAVE SQL_THREAD;
--source include/cleanup_fake_relay_log.inc
--source include/start_slave.inc

--source include/rpl_end.inc