Debian Codegraph @

mysql-test/suite/rpl/r/rpl_trigger_with_extra_key_on_replica.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
7 ##############################################################
8 # 1. Create a table t1 with a primary key on both source and replica
9 # Create a table t2 that only has an auto incremented PK in the replica
10 # Create a table t3 that only has an auto incremented KEY in the replica
11 CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
12 CREATE TABLE t2 (f1 INT) ENGINE=InnoDB;
13 CREATE TABLE t3 (f1 TEXT);
14 include/sync_slave_sql_with_master.inc
15 ALTER TABLE t2 ADD f2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY AFTER f1;
16 ALTER TABLE t3 ADD f2 INT NOT NULL AUTO_INCREMENT KEY AFTER f1;
17
18 ##############################################################
19 # 2. Create a trigger that for inserts in t1, inserts something on t2
20 # Create a function that inserts 2 rows in t3 but one of the rows is
21 # too large to be grouped with other in a single log event
22 [connection master]
23 CREATE TRIGGER insert_trigger BEFORE INSERT ON t1
24 FOR EACH ROW
25 BEGIN
26 INSERT INTO t2(f1) VALUES (1);
27 INSERT INTO t2(f1) VALUES (2);
28 END |
29 CREATE FUNCTION multi_event_function() RETURNS INT BEGIN
30 INSERT INTO t3 VALUES (REPEAT('a', 300));
31 INSERT INTO t3 VALUES ('a');
32 RETURN 0;
33 END|
34 include/sync_slave_sql_with_master.inc
35
36 ##############################################################
37 # 3. Insert something on t1 on the source
38 # Validate that the table t2 on the replica has the expected values
39 # Execute the multi_event_function() on the source
40 # Validate that the table t3 on the replica has the expected values
41 [connection master]
42 INSERT INTO t1 VALUES (99);
43 SELECT multi_event_function();
44 multi_event_function()
45 0
46 include/sync_slave_sql_with_master.inc
47 include/assert.inc [The trigger associated table was updated]
48 include/assert.inc [The function associated table was updated]
49
50 ##############################################################
51 # 4. Cleanup
52 [connection master]
53 DROP FUNCTION multi_event_function;
54 DROP TRIGGER insert_trigger;
55 DROP TABLE t1;
56 DROP TABLE t2;
57 DROP TABLE t3;
58 include/sync_slave_sql_with_master.inc
59 include/rpl_end.inc