Debian Codegraph @

mysql-test/suite/rpl/r/rpl_auto_increment_innodb.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 create table t1 (a int not null auto_increment, primary key (a)) engine=innodb;
7 insert into t1 values (NULL),(5),(NULL);
8 insert into t1 values (250),(NULL);
9 select * from t1;
10 a
11 1
12 5
13 6
14 250
15 251
16 insert into t1 values (1000);
17 set @@insert_id=400;
18 insert into t1 values(NULL),(NULL);
19 select * from t1;
20 a
21 1
22 5
23 6
24 250
25 251
26 400
27 401
28 1000
29 include/sync_slave_sql_with_master.inc
30 select * from t1;
31 a
32 1
33 5
34 6
35 250
36 251
37 400
38 401
39 1000
40 drop table t1;
41 set auto_increment_increment=1;
42 set auto_increment_offset=1;
43 CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
44 INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
45 show create table t1;
46 Table Create Table
47 t1 CREATE TABLE `t1` (
48 `id` mediumint NOT NULL AUTO_INCREMENT,
49 PRIMARY KEY (`id`)
50 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
51 include/sync_slave_sql_with_master.inc
52 show create table t1;
53 Table Create Table
54 t1 CREATE TABLE `t1` (
55 `id` mediumint NOT NULL AUTO_INCREMENT,
56 PRIMARY KEY (`id`)
57 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
58 drop table t1;
59 include/rpl_reset.inc
60 DROP TABLE IF EXISTS t1;
61 CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
62 SET SQL_MODE='';
63 INSERT INTO t1 VALUES(NULL);
64 SELECT * FROM t1;
65 id
66 1
67 INSERT INTO t1 VALUES();
68 SELECT * FROM t1;
69 id
70 1
71 2
72 INSERT INTO t1 VALUES(0);
73 SELECT * FROM t1;
74 id
75 1
76 2
77 3
78 SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
79 INSERT INTO t1 VALUES(0);
80 SELECT * FROM t1;
81 id
82 0
83 1
84 2
85 3
86 INSERT INTO t1 VALUES(4);
87 FLUSH LOGS;
88 include/sync_slave_sql_with_master.inc
89 include/diff_tables.inc [master:t1, slave:t1]
90 DROP TABLE t1;
91 include/sync_slave_sql_with_master.inc
92 include/stop_slave.inc
93 RESET SLAVE;
94 Warnings:
95 Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
96 RESET MASTER;
97 RESET MASTER;
98 FLUSH LOGS;
99 include/start_slave.inc
100 include/sync_slave_sql_with_master.inc
101 include/diff_tables.inc [master:t1, slave:t1]
102 DROP TABLE t1;
103 SET SQL_MODE='';
104 include/sync_slave_sql_with_master.inc
105 CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
106 BEGIN;
107 # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
108 # zero to fill the auto_increment field.
109 SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
110 INSERT INTO t1(id,data) VALUES(0,2);
111 # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
112 # affect the execution of the transaction on slave.
113 SET SQL_MODE=0;
114 COMMIT;
115 SELECT * FROM t1;
116 id data
117 0 2
118 include/sync_slave_sql_with_master.inc
119 SELECT * FROM t1;
120 id data
121 0 2
122 DROP TABLE t1;
123 include/sync_slave_sql_with_master.inc
124 create table t1(a int auto_increment primary key) engine=innodb;
125 insert into t1 values (null),(null),(1025),(null);
126 include/sync_slave_sql_with_master.inc
127 select * from t1;
128 a
129 1
130 2
131 1025
132 1026
133 include/diff_tables.inc [master:t1, slave:t1]
134 drop table t1;
135 include/sync_slave_sql_with_master.inc
136 include/rpl_end.inc