2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
8
SET @my_sql_mode= @@global.sql_mode;
9
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
11
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
12
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
13
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
14
CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
15
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
16
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
17
CREATE TABLE t4 (a INT) ENGINE='MyISAM';
18
CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='MyISAM';
19
CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='MyISAM';
20
CREATE TABLE t7 (a INT NOT NULL) ENGINE='MyISAM';
21
CREATE TABLE t8 (a INT NOT NULL) ENGINE='MyISAM';
22
CREATE TABLE t9 (a INT) ENGINE='MyISAM';
23
ALTER TABLE t1_int ADD x INT DEFAULT 42;
25
ADD x BIT(3) DEFAULT b'011',
26
ADD y BIT(5) DEFAULT b'10101',
27
ADD z BIT(2) DEFAULT b'10';
28
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
29
ALTER TABLE t1_nodef ADD x INT NOT NULL, ADD y INT NOT NULL, ADD z INT NOT NULL;
30
ALTER TABLE t2 DROP b;
31
ALTER TABLE t4 MODIFY a FLOAT;
32
ALTER TABLE t5 MODIFY b FLOAT;
33
ALTER TABLE t6 MODIFY c FLOAT;
34
ALTER TABLE t7 ADD e1 INT, ADD e2 INT, ADD e3 INT, ADD e4 INT,
35
ADD e5 INT, ADD e6 INT, ADD e7 INT, ADD e8 INT;
36
ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
37
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
38
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
39
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
40
set @@global.slave_exec_mode= 'IDEMPOTENT';
41
INSERT INTO t1_int VALUES (2, 4, 4711);
42
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
43
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
45
INSERT INTO t1_int VALUES (1,2);
46
INSERT INTO t1_int VALUES (2,5);
47
INSERT INTO t1_bit VALUES (1,2);
48
INSERT INTO t1_bit VALUES (2,5);
49
INSERT INTO t1_char VALUES (1,2);
50
INSERT INTO t1_char VALUES (2,5);
51
SELECT * FROM t1_int ORDER BY a;
55
SELECT * FROM t1_bit ORDER BY a;
59
SELECT * FROM t1_char ORDER BY a;
64
set @@global.slave_exec_mode= default;
65
SELECT a,b,x FROM t1_int ORDER BY a;
69
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
70
a b HEX(x) HEX(y) HEX(z)
73
SELECT a,b,x FROM t1_char ORDER BY a;
78
UPDATE t1_int SET b=2*b WHERE a=2;
79
UPDATE t1_char SET b=2*b WHERE a=2;
80
UPDATE t1_bit SET b=2*b WHERE a=2;
81
SELECT * FROM t1_int ORDER BY a;
85
SELECT * FROM t1_bit ORDER BY a;
89
SELECT * FROM t1_char ORDER BY a;
94
SELECT a,b,x FROM t1_int ORDER BY a;
98
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
99
a b HEX(x) HEX(y) HEX(z)
102
SELECT a,b,x FROM t1_char ORDER BY a;
106
INSERT INTO t9 VALUES (2);
107
INSERT INTO t1_nodef VALUES (1,2);
108
select count(*) from t1_nodef;
111
INSERT INTO t9 VALUES (2);
113
INSERT INTO t2 VALUES (2,4);
123
Master_Host 127.0.0.1
127
Master_Log_File master-bin.000001
128
Read_Master_Log_Pos #
131
Relay_Master_Log_File master-bin.000001
133
Slave_SQL_Running Yes
137
Replicate_Ignore_Table
138
Replicate_Wild_Do_Table
139
Replicate_Wild_Ignore_Table
141
Last_Error <Last_Error>
143
Exec_Master_Log_Pos #
148
Master_SSL_Allowed No
154
Seconds_Behind_Master #
155
Master_SSL_Verify_Server_Cert No
156
Last_IO_Errno <Last_IO_Errno>
157
Last_IO_Error <Last_IO_Error>
159
Last_SQL_Error <Last_SQL_Error>
160
INSERT INTO t9 VALUES (4);
161
INSERT INTO t4 VALUES (4);
164
Master_Host 127.0.0.1
168
Master_Log_File master-bin.000001
169
Read_Master_Log_Pos #
172
Relay_Master_Log_File master-bin.000001
178
Replicate_Ignore_Table
179
Replicate_Wild_Do_Table
180
Replicate_Wild_Ignore_Table
182
Last_Error <Last_Error>
184
Exec_Master_Log_Pos #
189
Master_SSL_Allowed No
195
Seconds_Behind_Master #
196
Master_SSL_Verify_Server_Cert No
197
Last_IO_Errno <Last_IO_Errno>
198
Last_IO_Error <Last_IO_Error>
200
Last_SQL_Error <Last_SQL_Error>
201
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
203
INSERT INTO t9 VALUES (5);
204
INSERT INTO t5 VALUES (5,10,25);
207
Master_Host 127.0.0.1
211
Master_Log_File master-bin.000001
212
Read_Master_Log_Pos #
215
Relay_Master_Log_File master-bin.000001
221
Replicate_Ignore_Table
222
Replicate_Wild_Do_Table
223
Replicate_Wild_Ignore_Table
225
Last_Error <Last_Error>
227
Exec_Master_Log_Pos #
232
Master_SSL_Allowed No
238
Seconds_Behind_Master #
239
Master_SSL_Verify_Server_Cert No
240
Last_IO_Errno <Last_IO_Errno>
241
Last_IO_Error <Last_IO_Error>
243
Last_SQL_Error <Last_SQL_Error>
244
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
246
INSERT INTO t9 VALUES (6);
247
INSERT INTO t6 VALUES (6,12,36);
250
Master_Host 127.0.0.1
254
Master_Log_File master-bin.000001
255
Read_Master_Log_Pos #
258
Relay_Master_Log_File master-bin.000001
264
Replicate_Ignore_Table
265
Replicate_Wild_Do_Table
266
Replicate_Wild_Ignore_Table
268
Last_Error <Last_Error>
270
Exec_Master_Log_Pos #
275
Master_SSL_Allowed No
281
Seconds_Behind_Master #
282
Master_SSL_Verify_Server_Cert No
283
Last_IO_Errno <Last_IO_Errno>
284
Last_IO_Error <Last_IO_Error>
286
Last_SQL_Error <Last_SQL_Error>
287
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
289
INSERT INTO t9 VALUES (6);
292
Master_Host 127.0.0.1
296
Master_Log_File master-bin.000001
297
Read_Master_Log_Pos #
300
Relay_Master_Log_File master-bin.000001
302
Slave_SQL_Running Yes
306
Replicate_Ignore_Table
307
Replicate_Wild_Do_Table
308
Replicate_Wild_Ignore_Table
310
Last_Error <Last_Error>
312
Exec_Master_Log_Pos #
317
Master_SSL_Allowed No
323
Seconds_Behind_Master #
324
Master_SSL_Verify_Server_Cert No
325
Last_IO_Errno <Last_IO_Errno>
326
Last_IO_Error <Last_IO_Error>
328
Last_SQL_Error <Last_SQL_Error>
329
INSERT INTO t7 VALUES (1),(2),(3);
330
INSERT INTO t8 VALUES (1),(2),(3);
331
SELECT * FROM t7 ORDER BY a;
336
SELECT * FROM t8 ORDER BY a;
341
SELECT * FROM t7 ORDER BY a;
342
a e1 e2 e3 e4 e5 e6 e7 e8
343
1 NULL NULL NULL NULL NULL NULL NULL NULL
344
2 NULL NULL NULL NULL NULL NULL NULL NULL
345
3 NULL NULL NULL NULL NULL NULL NULL NULL
346
SELECT * FROM t8 ORDER BY a;
347
a e1 e2 e3 e4 e5 e6 e7 e8
354
INSERT INTO t1_nodef VALUES (1,2);
355
INSERT INTO t1_nodef VALUES (2,4);
358
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
359
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
361
UPDATE t1_nodef SET b=2*b WHERE a=1;
362
SELECT * FROM t1_nodef ORDER BY a;
367
SELECT * FROM t1_nodef ORDER BY a;
372
DELETE FROM t1_nodef WHERE a=2;
373
SELECT * FROM t1_nodef ORDER BY a;
377
SELECT * FROM t1_nodef ORDER BY a;
381
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
382
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
383
SET @@global.sql_mode= @my_sql_mode;