Debian Codegraph @

mysql-test/suite/ndb_rpl/r/ndb_rpl_auto_inc.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 ***************** Test 1 ************************
7
8 CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
9 insert into t1 values (NULL,1),(NULL,2),(NULL,3);
10 ******* Select from Master *************
11
12 select * from t1 ORDER BY a;
13 a b
14 3 1
15 4 2
16 5 3
17 ******* Select from Slave *************
18
19 select * from t1 ORDER BY a;
20 a b
21 3 1
22 4 2
23 5 3
24 drop table t1;
25 create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
26 insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
27 delete from t1 where b=4;
28 insert into t1 values (NULL,5),(NULL,6);
29 ******* Select from Master *************
30
31 select * from t1 ORDER BY a;
32 a b
33 1 1
34 2 2
35 3 3
36 5 5
37 6 6
38 ******* Select from Slave *************
39
40 select * from t1 ORDER BY a;
41 a b
42 1 1
43 2 2
44 3 3
45 5 5
46 6 6
47 drop table t1;
48 create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
49 insert into t1 values (NULL),(5),(NULL);
50 insert into t1 values (250),(NULL);
51 ******* Select from Master *************
52
53 select * from t1 ORDER BY a;
54 a
55 1
56 5
57 6
58 250
59 251
60 insert into t1 values (1000);
61 set @@insert_id=400;
62 insert into t1 values(NULL),(NULL);
63 ******* Select from Master *************
64
65 select * from t1 ORDER BY a;
66 a
67 1
68 5
69 6
70 250
71 251
72 400
73 401
74 1000
75 ******* Select from Slave *************
76
77 select * from t1 ORDER BY a;
78 a
79 1
80 5
81 6
82 250
83 251
84 400
85 401
86 1000
87 drop table t1;
88 create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
89 insert into t1 values (NULL),(5),(NULL),(NULL);
90 insert into t1 values (500),(NULL),(502),(NULL),(600);
91 ******* Select from Master *************
92
93 select * from t1 ORDER BY a;
94 a
95 1
96 5
97 6
98 7
99 500
100 501
101 502
102 503
103 600
104 set @@insert_id=600;
105 insert into t1 values(600),(NULL),(NULL);
106 ERROR 23000: Duplicate entry '601' for key 't1.PRIMARY'
107 set @@insert_id=600;
108 insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
109 Warnings:
110 Warning 1062 Duplicate entry '600' for key 't1.PRIMARY'
111 Warning 1062 Duplicate entry '600' for key 't1.PRIMARY'
112 Warning 1062 Duplicate entry '600' for key 't1.PRIMARY'
113 ******* Select from Master *************
114
115 select * from t1 ORDER BY a;
116 a
117 1
118 5
119 6
120 7
121 500
122 501
123 502
124 503
125 600
126 610
127 611
128 ******* Select from Slave *************
129
130 select * from t1 ORDER BY a;
131 a
132 1
133 5
134 6
135 7
136 500
137 501
138 502
139 503
140 600
141 610
142 611
143 drop table t1;
144 create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
145 insert into t1 values(2),(12),(22),(32),(42);
146 insert into t1 values (NULL),(NULL);
147 insert into t1 values (3),(NULL),(NULL);
148 ******* Select from Master *************
149
150 select * from t1 ORDER BY a;
151 a
152 1
153 2
154 3
155 4
156 5
157 ******* Select from Slave *************
158
159 ** Slave should have 2, 12, 22, 32, 42 **
160 ** Master will have 2 but not 12, 22, 32, 42 **
161
162 select * from t1 ORDER BY a;
163 a
164 1
165 2
166 3
167 4
168 5
169 12
170 22
171 32
172 42
173 drop table t1;
174 set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
175 set ndb_autoincrement_prefetch_sz = 32;
176 CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT KEY) ENGINE=ndb;
177 INSERT INTO t1 () VALUES (),(),();
178 set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
179 set ndb_autoincrement_prefetch_sz = 32;
180 select * from t1 order by id;
181 id
182 1
183 2
184 3
185 INSERT INTO t1 () VALUES (),(),();
186 select * from t1 order by id;
187 id
188 1
189 2
190 3
191 4
192 5
193 6
194 set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
195 select * from t1 order by id;
196 id
197 1
198 2
199 3
200 drop table t1;
201 set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
202 include/rpl_end.inc