Debian Codegraph @

mysql-test/suite/rpl/t/rpl_row_jsondiff_missing_col_slave.test

raw
1 # ==== Requirements ====
2 #
3 # R1. When a JSON column is missing on slave, and has partial JSON,
4 # it should be correctly replicated to slave.
5 #
6 # ==== Implementation ====
7 #
8 # Create a table with a JSON column, drop the JSON column on the slave,
9 # replicate partial JSON, and check that it is correct.
10 #
11 # ==== References ====
12 #
13 # Test added in WL#2955: RBR replication of partial JSON updates
14
15 --source include/have_binlog_format_row.inc
16 --source include/master-slave.inc
17
18 --echo ######## Configure ########
19
20 --source include/rpl_connection_master.inc
21 SET SESSION binlog_row_image= MINIMAL;
22 SET SESSION binlog_row_value_options= PARTIAL_JSON;
23
24 --echo ######## Initialize ########
25
26 CREATE TABLE t1 (i INT PRIMARY KEY, j JSON);
27 --source include/sync_slave_sql_with_master.inc
28 ALTER TABLE t1 DROP COLUMN j;
29 --source include/rpl_connection_master.inc
30 INSERT INTO t1 VALUES (1, '{"a":"b"}');
31
32 --echo ######## Test ########
33
34 UPDATE t1 SET j=JSON_SET(j, '$.c', "d"), i=2;
35 --source include/sync_slave_sql_with_master.inc
36
37 --echo ######## Clean up ########
38
39 --source include/rpl_connection_master.inc
40 DROP TABLE t1;
41 --source include/sync_slave_sql_with_master.inc
42
43 --source include/rpl_end.inc