Debian Codegraph @

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

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 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.
5 [connection master]
6 # Phase 1: Tests with a GIPK only on the source
7
8 ##################################################
9 # 1. Enable the generation of GIPKs in the source
10 # With the binary log temporarily disabled, create table t1, t2 and t3
11 # The same tables were created early on the replica with
12 # - t1 doesn't have a functional index in source but it has one in the replica
13 # - t2 has a functional index in the source but not in the replica
14 # - t3 has a functional index on source and replica but also an extra column
15 [connection slave]
16 CREATE TABLE t1 (f1 BIGINT UNSIGNED, f2 TEXT, INDEX ((f1*1)));
17 CREATE TABLE t2 (f1 CHAR(25), f2 INT);
18 CREATE TABLE t3 (f1 INT, f2 CHAR(25), f3 BIGINT, INDEX ((f1+2)));
19 [connection master]
20 SET SESSION sql_generate_invisible_primary_key = ON;
21 include/disable_binlog.inc
22 CREATE TABLE t1 (f1 BIGINT UNSIGNED, f2 TEXT);
23 CREATE TABLE t2 (f1 CHAR(25), f2 INT, INDEX ((f1+1)));
24 CREATE TABLE t3 (f1 INT, f2 CHAR(25), INDEX ((f1+2)));
25 include/restore_binlog.inc
26 SET SESSION sql_generate_invisible_primary_key = OFF;
27
28 ##################################################
29 # 2. Add a row to each table
30 # Check the rows are correctly applied in the replica
31 INSERT INTO t1 VALUES (1, '1');
32 INSERT INTO t2 VALUES ('2', 2);
33 INSERT INTO t3 VALUES (3, '3');
34 include/sync_slave_sql_with_master.inc
35 include/assert.inc [Table t1 contains the inserted values]
36 include/assert.inc [Table t2 contains the inserted values]
37 include/assert.inc [Table t3 contains the inserted values]
38 # Phase 2: Tests with a GIPK only on the replica
39
40 ##################################################
41 # 3. Enable the generation of GIPKs in the replica
42 # Create tables t4, t5 and t6 on the source
43 # On the replica drop the index on t4 and add a index to t5
44 # On the replica add an index and an extra column to t6
45 [connection slave]
46 include/stop_slave_sql.inc
47 CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = GENERATE;
48 include/start_slave_sql.inc
49 [connection master]
50 CREATE TABLE t4 (f1 INT UNSIGNED, INDEX idx1 ((f1*1)));
51 CREATE TABLE t5 (f1 VARCHAR(20), f2 TINYINT);
52 CREATE TABLE t6 (f1 BIGINT UNSIGNED);
53 include/sync_slave_sql_with_master.inc
54 DROP INDEX `idx1` ON t4;
55 ALTER TABLE t5 ADD INDEX ((f2 * 40) DESC);
56 ALTER TABLE t6 ADD INDEX ((f1 + 30) DESC);
57 ALTER TABLE t6 ADD f3 INT;
58
59 ##################################################
60 # 4. Add a row to each table
61 # Check the rows are correctly applied in the replica
62 [connection master]
63 INSERT INTO t4 VALUES (40);
64 INSERT INTO t5 VALUES ('text', 5);
65 INSERT INTO t6 VALUES (6);
66 include/sync_slave_sql_with_master.inc
67 include/assert.inc [Table t4 contains the inserted values]
68 include/assert.inc [Table t5 contains the inserted values]
69 include/assert.inc [Table t6 contains the inserted values]
70
71 ##################################################
72 # 5. Cleanup
73 [connection slave]
74 include/stop_slave_sql.inc
75 CHANGE REPLICATION SOURCE TO REQUIRE_TABLE_PRIMARY_KEY_CHECK = PRIMARY_KEY_CHECK_VALUE;
76 include/start_slave_sql.inc
77 [connection master]
78 DROP TABLE t1;
79 DROP TABLE t2;
80 DROP TABLE t3;
81 DROP TABLE t4;
82 DROP TABLE t5;
83 DROP TABLE t6;
84 include/rpl_end.inc