Debian Codegraph @

mysql-test/suite/rpl/r/rpl_gipk_with_column_differences.result

raw
1 include/only_with_option.inc [GLOBAL.binlog_row_image = 'full']
2 include/master-slave.inc
3 Warnings:
4 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
5 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
6 [connection master]
7 # Phase 1: Tests with a GIPK only on the source
8
9 ##################################################
10 # 1. Enable the generation of GIPKs in the source
11 # With the binary log temporarily disabled, create tables t1, t2 and t3 with no primary keys
12 [connection master]
13 SET SESSION sql_generate_invisible_primary_key = ON;
14 include/disable_binlog.inc
15 CREATE TABLE t1(f1 INT, f2 INT);
16 CREATE TABLE t2(f1 INT, f2 INT);
17 CREATE TABLE t3(f1 INT, f2 INT);
18 include/restore_binlog.inc
19 SET SESSION sql_generate_invisible_primary_key = OFF;
20
21 ##################################################
22 # 2. Create the same tables on the replica
23 # Table t1 has the same number of columns in the replica
24 # Table t2 has less columns in the replica
25 # Table t3 has more columns in the replica
26 [connection slave]
27 CREATE TABLE t1(f1 INT, f2 INT);
28 CREATE TABLE t2(f1 INT);
29 CREATE TABLE t3(f1 INT, f2 INT, f3 INT);
30
31 ##################################################
32 # 3. Insert some values on the tables
33 # Check they are replicated correctly
34 [connection master]
35 INSERT INTO t1 VALUES (11, 11);
36 INSERT INTO t1 VALUES (12, 12);
37 INSERT INTO t2 VALUES (21, 21);
38 INSERT INTO t2 VALUES (21, 22);
39 INSERT INTO t2 VALUES (21, 23);
40 INSERT INTO t3 VALUES (31, 31);
41 INSERT INTO t3 VALUES (32, 32);
42 include/sync_slave_sql_with_master.inc
43 [connection slave]
44 include/assert.inc [The table t1 contains the 2 inserted rows]
45 include/assert.inc [The table t2 contains the 3 inserted rows]
46 include/assert.inc [The table t3 contains the 2 inserted rows]
47
48 ##################################################
49 # 4. Update and delete rows in all tables
50 # Check changes are replicated correctly
51 [connection master]
52 UPDATE t1 SET t1.f2 = 13 WHERE t1.f1=12;
53 DELETE FROM t1 WHERE t1.f1=11;
54 DELETE FROM t2 WHERE t2.f2=21;
55 UPDATE t2 SET t2.f2 = 24 WHERE t2.f2=23;
56 UPDATE t3 SET t3.f2 = 33 WHERE t3.f1=31;
57 DELETE FROM t3 WHERE t3.f1=32;
58 include/sync_slave_sql_with_master.inc
59 [connection slave]
60 include/assert.inc [The table t1 contains 1 row]
61 include/assert.inc [The table t1 was updated]
62 include/assert.inc [The table t2 contains 2 rows with value 21]
63 include/assert.inc [The table t3 contains 1 row]
64 include/assert.inc [The table t3 was updated]
65 [connection master]
66 UPDATE t2 SET t2.f1 = 22 WHERE t2.f2=22;
67 include/sync_slave_sql_with_master.inc
68 include/assert.inc [The table t2 contains 1 rows with value 21]
69 include/assert.inc [The table t2 contains 1 rows with value 22]
70 # Phase 2: Tests with a GIPK only on the replica
71
72 ##################################################
73 # 5. Enable the generation of GIPKs on replication
74 [connection slave]
75 include/stop_slave_sql.inc
76 CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE;
77 include/start_slave_sql.inc
78
79 ##################################################
80 # 6. Create some tables without primary keys on the source
81 # On the replica, drop a column on t5 and add an extra column on t6
82 [connection master]
83 CREATE TABLE t4(f1 INT, f2 INT);
84 CREATE TABLE t5(f1 INT, f2 INT);
85 CREATE TABLE t6(f1 INT, f2 INT);
86 include/sync_slave_sql_with_master.inc
87 ALTER TABLE t5 DROP COLUMN f2;
88 ALTER TABLE t6 ADD COLUMN f3 INT AFTER f2;
89
90 ##################################################
91 # 7. Insert some values on the tables
92 # Check they are replicated correctly
93 [connection master]
94 INSERT INTO t4 VALUES (41, 41);
95 INSERT INTO t4 VALUES (42, 42);
96 INSERT INTO t5 VALUES (51, 51);
97 INSERT INTO t5 VALUES (51, 52);
98 INSERT INTO t5 VALUES (51, 53);
99 INSERT INTO t6 VALUES (61, 61);
100 INSERT INTO t6 VALUES (62, 62);
101 include/sync_slave_sql_with_master.inc
102 [connection slave]
103 include/assert.inc [The table t4 contains the 2 inserted rows]
104 include/assert.inc [The table t5 contains the 3 inserted rows]
105 include/assert.inc [The table t6 contains the 2 inserted rows]
106
107 ##################################################
108 # 8. Update and delete rows in all tables
109 # Check changes are replicated correctly
110 [connection master]
111 UPDATE t4 SET t4.f2 = 43 WHERE t4.f1=42;
112 DELETE FROM t4 WHERE t4.f1=41;
113 DELETE FROM t5 WHERE t5.f2=51;
114 UPDATE t5 SET t5.f2 = 54 WHERE t5.f2=53;
115 UPDATE t6 SET t6.f2 = 63 WHERE t6.f1=61;
116 DELETE FROM t6 WHERE t6.f1=62;
117 include/sync_slave_sql_with_master.inc
118 [connection slave]
119 include/assert.inc [The table t4 contains 1 row]
120 include/assert.inc [The table t4 was updated]
121 include/assert.inc [The table t5 contains 2 rows with value 51]
122 include/assert.inc [The table t6 contains 1 row]
123 include/assert.inc [The table t6 was updated]
124 [connection master]
125 UPDATE t5 SET t5.f1 = 52 WHERE t5.f2=52;
126 include/sync_slave_sql_with_master.inc
127 include/assert.inc [The table t5 contains 1 rows with value 51]
128 include/assert.inc [The table t5 contains 1 rows with value 52]
129
130 ##################################################
131 # 9. Cleanup
132 include/stop_slave_sql.inc
133 CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = PRIMARY_KEY_CHECK_VALUE;
134 include/start_slave_sql.inc
135 [connection master]
136 DROP TABLE t1;
137 DROP TABLE t2;
138 DROP TABLE t3;
139 DROP TABLE t4;
140 DROP TABLE t5;
141 DROP TABLE t6;
142 include/rpl_end.inc