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;
9
***********************************************************
10
***********************************************************
11
***************** Start of Testing ************************
12
***********************************************************
13
***********************************************************
14
* This test format == binlog_format ROW and engine == 'InnoDB'
15
***********************************************************
16
***********************************************************
18
***** Testing more columns on the Master *****
20
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
22
f5 FLOAT DEFAULT '2.00',
23
f6 CHAR(4) DEFAULT 'TEST',
28
f11 VARBINARY(64))ENGINE='InnoDB';
30
* Alter Table on Slave and drop columns f5 through f11 *
32
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
34
* Insert data in Master then update and delete some rows*
36
* Select count and 20 rows from Master *
38
SELECT COUNT(*) FROM t1;
42
SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
43
hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
44
f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
45
2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
46
3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
47
5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
48
6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
49
8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
50
9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
51
11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
52
12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
53
14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
54
15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
55
17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
56
18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
57
20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
58
21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
59
23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
60
24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
61
26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
62
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
63
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
64
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
66
* Select count and 20 rows from Slave *
68
SELECT COUNT(*) FROM t1;
72
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
103
Master_Log_File master-bin.000001
104
Read_Master_Log_Pos #
107
Relay_Master_Log_File master-bin.000001
109
Slave_SQL_Running Yes
113
Replicate_Ignore_Table
114
Replicate_Wild_Do_Table
115
Replicate_Wild_Ignore_Table
119
Exec_Master_Log_Pos #
124
Master_SSL_Allowed No
130
Seconds_Behind_Master #
131
Master_SSL_Verify_Server_Cert No
138
***** Testing Altering table def scenario *****
140
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
142
f5 DOUBLE DEFAULT '2.00',
143
f6 ENUM('a', 'b', 'c') default 'a',
144
f7 DECIMAL(17,9) default '1000.00',
146
f9 NUMERIC(6,4) default '2000.00',
148
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
149
f12 SET('a', 'b', 'c') default 'b')
152
Warning 1264 Out of range value for column 'f9' at row 1
154
CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
156
f5 DOUBLE DEFAULT '2.00',
157
f6 ENUM('a', 'b', 'c') default 'a',
160
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
161
f12 SET('a', 'b', 'c') default 'b')
164
CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
166
f5 DOUBLE DEFAULT '2.00',
167
f6 DECIMAL(17,9) default '1000.00',
169
f8 NUMERIC(6,4) default '2000.00',
171
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
175
Warning 1264 Out of range value for column 'f8' at row 1
177
CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
204
f30 ENUM ('a','b', 'c') default 'a',
207
f33 SET ('a', 'b', 'c') default 'b',
212
** Alter tables on slave and drop columns **
214
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
216
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
217
alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
219
drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
220
drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
221
drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
222
drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
223
drop f33, drop f34, drop f35;
225
** Insert Data into Master **
226
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
228
INSERT into t2 values (2, 2, 2, 'second',
229
2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
232
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
235
Warning 1264 Out of range value for column 'f9' at row 1
236
Warning 1264 Out of range value for column 'f9' at row 2
237
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
238
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
240
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
241
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
242
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
244
Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
245
INSERT into t31 values (1, 1, 3, 'third',
246
/* f5 BIGINT, */ 333333333333333333333333,
247
/* f6 BLOB, */ '3333333333333333333333',
248
/* f7 DATE, */ '2007-07-18',
249
/* f8 DATETIME, */ "2007-07-18",
250
/* f9 FLOAT, */ 3.33333333,
251
/* f10 INT, */ 333333333,
252
/* f11 LONGBLOB, */ '3333333333333333333',
253
/* f12 LONGTEXT, */ '3333333333333333333',
254
/* f13 MEDIUMBLOB, */ '3333333333333333333',
255
/* f14 MEDIUMINT, */ 33,
256
/* f15 MEDIUMTEXT, */ 3.3,
258
/* f17 SMALLINT, */ 3,
259
/* f18 TEXT, */ '33',
260
/* f19 TIME, */ '2:59:58.999',
261
/* f20 TIMESTAMP, */ 20000303000000,
262
/* f21 TINYBLOB, */ '3333',
263
/* f22 TINYINT, */ 3,
264
/* f23 TINYTEXT, */ '3',
265
/* f24 YEAR, */ 3000,
266
/* f25 BINARY(255), */ 'three_33333',
267
/* f26 BIT(64), */ b'011',
268
/* f27 CHAR(255), */ 'three',
269
/* f28 DECIMAL(30,7), */ 3.333,
270
/* f29 DOUBLE, */ 3.333333333333333333333333333,
271
/* f30 ENUM ('a','b','c')*/ 'c',
272
/* f31 FLOAT, */ 3.0,
273
/* f32 NUMERIC(17,9), */ 3.3333,
274
/* f33 SET ('a','b','c'),*/ 'c',
275
/*f34 VARBINARY(1025),*/ '3333 minus 3',
276
/*f35 VARCHAR(257),*/ 'three times three'
279
Warning 1264 Out of range value for column 'f5' at row 1
280
Warning 1264 Out of range value for column 'f24' at row 1
281
INSERT into t31 values (1, 1, 4, 'fourth',
282
/* f5 BIGINT, */ 333333333333333333333333,
283
/* f6 BLOB, */ '3333333333333333333333',
284
/* f7 DATE, */ '2007-07-18',
285
/* f8 DATETIME, */ "2007-07-18",
286
/* f9 FLOAT, */ 3.33333333,
287
/* f10 INT, */ 333333333,
288
/* f11 LONGBLOB, */ '3333333333333333333',
289
/* f12 LONGTEXT, */ '3333333333333333333',
290
/* f13 MEDIUMBLOB, */ '3333333333333333333',
291
/* f14 MEDIUMINT, */ 33,
292
/* f15 MEDIUMTEXT, */ 3.3,
294
/* f17 SMALLINT, */ 3,
295
/* f18 TEXT, */ '33',
296
/* f19 TIME, */ '2:59:58.999',
297
/* f20 TIMESTAMP, */ 20000303000000,
298
/* f21 TINYBLOB, */ '3333',
299
/* f22 TINYINT, */ 3,
300
/* f23 TINYTEXT, */ '3',
301
/* f24 YEAR, */ 3000,
302
/* f25 BINARY(255), */ 'three_33333',
303
/* f26 BIT(64), */ b'011',
304
/* f27 CHAR(255), */ 'three',
305
/* f28 DECIMAL(30,7), */ 3.333,
306
/* f29 DOUBLE, */ 3.333333333333333333333333333,
307
/* f30 ENUM ('a','b','c')*/ 'c',
308
/* f31 FLOAT, */ 3.0,
309
/* f32 NUMERIC(17,9), */ 3.3333,
310
/* f33 SET ('a','b','c'),*/ 'c',
311
/*f34 VARBINARY(1025),*/ '3333 minus 3',
312
/*f35 VARCHAR(257),*/ 'three times three'
315
/* f5 BIGINT, */ 333333333333333333333333,
316
/* f6 BLOB, */ '3333333333333333333333',
317
/* f7 DATE, */ '2007-07-18',
318
/* f8 DATETIME, */ "2007-07-18",
319
/* f9 FLOAT, */ 3.33333333,
320
/* f10 INT, */ 333333333,
321
/* f11 LONGBLOB, */ '3333333333333333333',
322
/* f12 LONGTEXT, */ '3333333333333333333',
323
/* f13 MEDIUMBLOB, */ '3333333333333333333',
324
/* f14 MEDIUMINT, */ 33,
325
/* f15 MEDIUMTEXT, */ 3.3,
327
/* f17 SMALLINT, */ 3,
328
/* f18 TEXT, */ '33',
329
/* f19 TIME, */ '2:59:58.999',
330
/* f20 TIMESTAMP, */ 20000303000000,
331
/* f21 TINYBLOB, */ '3333',
332
/* f22 TINYINT, */ 3,
333
/* f23 TINYTEXT, */ '3',
334
/* f24 YEAR, */ 3000,
335
/* f25 BINARY(255), */ 'three_33333',
336
/* f26 BIT(64), */ b'011',
337
/* f27 CHAR(255), */ 'three',
338
/* f28 DECIMAL(30,7), */ 3.333,
339
/* f29 DOUBLE, */ 3.333333333333333333333333333,
340
/* f30 ENUM ('a','b','c')*/ 'c',
341
/* f31 FLOAT, */ 3.0,
342
/* f32 NUMERIC(17,9), */ 3.3333,
343
/* f33 SET ('a','b','c'),*/ 'c',
344
/*f34 VARBINARY(1025),*/ '3333 minus 3',
345
/*f35 VARCHAR(257),*/ 'three times three'
348
/* f5 BIGINT, */ NULL,
349
/* f6 BLOB, */ '3333333333333333333333',
350
/* f7 DATE, */ '2007-07-18',
351
/* f8 DATETIME, */ "2007-07-18",
352
/* f9 FLOAT, */ 3.33333333,
353
/* f10 INT, */ 333333333,
354
/* f11 LONGBLOB, */ '3333333333333333333',
355
/* f12 LONGTEXT, */ '3333333333333333333',
356
/* f13 MEDIUMBLOB, */ '3333333333333333333',
357
/* f14 MEDIUMINT, */ 33,
358
/* f15 MEDIUMTEXT, */ 3.3,
360
/* f17 SMALLINT, */ 3,
361
/* f18 TEXT, */ '33',
362
/* f19 TIME, */ '2:59:58.999',
363
/* f20 TIMESTAMP, */ 20000303000000,
364
/* f21 TINYBLOB, */ '3333',
365
/* f22 TINYINT, */ 3,
366
/* f23 TINYTEXT, */ '3',
367
/* f24 YEAR, */ 3000,
368
/* f25 BINARY(255), */ 'three_33333',
369
/* f26 BIT(64), */ b'011',
370
/* f27 CHAR(255), */ 'three',
371
/* f28 DECIMAL(30,7), */ 3.333,
372
/* f29 DOUBLE, */ 3.333333333333333333333333333,
373
/* f30 ENUM ('a','b','c')*/ 'c',
374
/* f31 FLOAT, */ 3.0,
375
/* f32 NUMERIC(17,9), */ 3.3333,
376
/* f33 SET ('a','b','c'),*/ 'c',
377
/*f34 VARBINARY(1025),*/ '3333 minus 3',
378
/*f35 VARCHAR(257),*/ NULL
381
Warning 1264 Out of range value for column 'f5' at row 1
382
Warning 1264 Out of range value for column 'f24' at row 1
383
Warning 1264 Out of range value for column 'f5' at row 2
384
Warning 1264 Out of range value for column 'f24' at row 2
385
Warning 1264 Out of range value for column 'f24' at row 3
387
** Sync slave with master **
388
** Do selects from tables **
390
select * from t1 order by f3;
432
select * from t2 order by f1;
437
select * from t3 order by f1;
440
select * from t4 order by f1;
443
select * from t31 order by f3;
452
** Do updates master **
454
update t31 set f5=555555555555555 where f3=6;
455
update t31 set f2=2 where f3=2;
456
update t31 set f1=NULL where f3=1;
457
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
459
** Delete from Master **
467
** Check slave status **
473
Master_Host 127.0.0.1
477
Master_Log_File master-bin.000001
478
Read_Master_Log_Pos #
481
Relay_Master_Log_File master-bin.000001
483
Slave_SQL_Running Yes
487
Replicate_Ignore_Table
488
Replicate_Wild_Do_Table
489
Replicate_Wild_Ignore_Table
493
Exec_Master_Log_Pos #
498
Master_SSL_Allowed No
504
Seconds_Behind_Master #
505
Master_SSL_Verify_Server_Cert No
511
****************************************
512
* columns in master at middle of table *
513
* Expect: Proper error message *
514
****************************************
516
** Stop and Reset Slave **
521
** create table slave side **
522
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
525
** Connect to master and create table **
527
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
528
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
534
*** Master Data Insert ***
535
set @b1 = 'b1b1b1b1';
536
set @b1 = concat(@b1,@b1);
537
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
538
(2,@b1,DEFAULT,'JOE',DEFAULT),
539
(3,@b1,DEFAULT,'QA',DEFAULT);
541
********************************************
542
*** Expect slave to fail with Error 1523 ***
543
********************************************
547
Master_Host 127.0.0.1
551
Master_Log_File master-bin.000001
552
Read_Master_Log_Pos #
555
Relay_Master_Log_File master-bin.000001
561
Replicate_Ignore_Table
562
Replicate_Wild_Do_Table
563
Replicate_Wild_Ignore_Table
565
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
567
Exec_Master_Log_Pos #
572
Master_SSL_Allowed No
578
Seconds_Behind_Master #
579
Master_SSL_Verify_Server_Cert No
583
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
584
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
590
*********************************************
591
* More columns in master at middle of table *
592
* Expect: Proper error message *
593
*********************************************
595
*** Create t11 on slave ***
598
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
601
*** Create t11 on Master ***
602
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
603
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
609
*** Master Data Insert ***
610
set @b1 = 'b1b1b1b1';
611
set @b1 = concat(@b1,@b1);
612
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
613
(2,@b1,'Testing is cool','JOE',DEFAULT),
614
(3,@b1,DEFAULT,'QA',DEFAULT);
616
********************************************
617
*** Expect slave to fail with Error 1523 ***
618
********************************************
622
Master_Host 127.0.0.1
626
Master_Log_File master-bin.000001
627
Read_Master_Log_Pos #
630
Relay_Master_Log_File master-bin.000001
636
Replicate_Ignore_Table
637
Replicate_Wild_Do_Table
638
Replicate_Wild_Ignore_Table
640
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
642
Exec_Master_Log_Pos #
647
Master_SSL_Allowed No
653
Seconds_Behind_Master #
654
Master_SSL_Verify_Server_Cert No
658
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
659
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
665
*********************************************
666
* More columns in master at middle of table *
667
* Expect: This one should pass blob-text *
668
*********************************************
670
*** Create t12 on slave ***
673
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
676
*** Create t12 on Master ***
677
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
678
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
684
*** Master Data Insert ***
685
set @b1 = 'b1b1b1b1';
686
set @b1 = concat(@b1,@b1);
687
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
688
(2,@b1,'JOE',DEFAULT,DEFAULT),
689
(3,@b1,'QA',DEFAULT,DEFAULT);
691
SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
693
1 62316231623162316231623162316231 Kyle test 1
694
2 62316231623162316231623162316231 JOE test 1
695
3 62316231623162316231623162316231 QA test 1
697
*** Select on Slave ***
698
SELECT a,hex(b),c FROM t12 ORDER BY a;
700
1 62316231623162316231623162316231 Kyle
701
2 62316231623162316231623162316231 JOE
702
3 62316231623162316231623162316231 QA
707
****************************************************
708
* - Alter Master adding columns at middle of table *
709
* Expect: columns added *
710
****************************************************
713
*** Create t14 on slave ***
716
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
719
*** Create t14 on Master ***
720
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
722
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
729
*** Master Data Insert ***
730
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
731
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
733
set @b1 = 'b1b1b1b1';
734
set @b1 = concat(@b1,@b1);
735
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
736
(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
737
(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
739
SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
740
c1 c2 c3 hex(c4) c5 c6 c7
741
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
742
2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
743
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
745
*** Select on Slave ****
746
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
748
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
749
2 2.00 This Test Should work 62316231623162316231623162316231 JOE
750
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
752
****************************************************
753
* - Alter Master Dropping columns from the middle. *
754
* Expect: columns dropped *
755
****************************************************
757
*** connect to master and drop columns ***
758
ALTER TABLE t14 DROP COLUMN c2;
759
ALTER TABLE t14 DROP COLUMN c7;
761
*** Select from Master ***
762
SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
764
1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
765
2 This Test Should work 62316231623162316231623162316231 JOE 1
766
3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
773
Master_Host 127.0.0.1
777
Master_Log_File master-bin.000001
778
Read_Master_Log_Pos #
781
Relay_Master_Log_File master-bin.000001
787
Replicate_Ignore_Table
788
Replicate_Wild_Do_Table
789
Replicate_Wild_Ignore_Table
791
Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
793
Exec_Master_Log_Pos #
798
Master_SSL_Allowed No
804
Seconds_Behind_Master #
805
Master_SSL_Verify_Server_Cert No
809
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
819
*************************************************
820
* - Alter Master adding columns at end of table *
821
* Expect: Error 1054 *
822
*************************************************
824
*** Create t15 on slave ***
827
CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
830
*** Create t15 on Master ***
831
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
833
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
840
*** Master Data Insert ***
841
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
842
set @b1 = 'b1b1b1b1';
843
set @b1 = concat(@b1,@b1);
844
INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
845
(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
846
(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
847
SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
848
c1 hex(c4) c5 c6 c7 c2
849
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
850
2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
851
3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
853
********************************************
854
*** Expect slave to fail with Error 1054 ***
855
********************************************
859
Master_Host 127.0.0.1
863
Master_Log_File master-bin.000001
864
Read_Master_Log_Pos #
867
Relay_Master_Log_File master-bin.000001
873
Replicate_Ignore_Table
874
Replicate_Wild_Do_Table
875
Replicate_Wild_Ignore_Table
877
Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
879
Exec_Master_Log_Pos #
884
Master_SSL_Allowed No
890
Seconds_Behind_Master #
891
Master_SSL_Verify_Server_Cert No
895
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
905
************************************************
906
* - Create index on Master column not on slave *
908
************************************************
910
*** Create t16 on slave ***
913
CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
916
*** Create t16 on Master ***
917
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
919
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
926
*** Master Create Index and Data Insert ***
927
CREATE INDEX part_of_c6 ON t16 (c6);
928
set @b1 = 'b1b1b1b1';
929
set @b1 = concat(@b1,@b1);
930
INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
931
(2,@b1,'JOE',2,DEFAULT),
932
(3,@b1,'QA',3,DEFAULT);
933
SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
935
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
936
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
937
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
945
Master_Host 127.0.0.1
949
Master_Log_File master-bin.000001
950
Read_Master_Log_Pos #
953
Relay_Master_Log_File master-bin.000001
959
Replicate_Ignore_Table
960
Replicate_Wild_Do_Table
961
Replicate_Wild_Ignore_Table
963
Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
965
Exec_Master_Log_Pos #
970
Master_SSL_Allowed No
976
Seconds_Behind_Master #
977
Master_SSL_Verify_Server_Cert No
981
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
991
*****************************************************
992
* - Delete rows using column on Master not on slave *
993
* Expect: Rows Deleted *
994
*****************************************************
996
*** Create t17 on slave ***
999
CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
1002
*** Create t17 on Master ***
1003
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
1005
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
1012
*** Master Data Insert ***
1013
set @b1 = 'b1b1b1b1';
1014
set @b1 = concat(@b1,@b1);
1015
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
1016
(2,@b1,'JOE',2,DEFAULT),
1017
(3,@b1,'QA',3,DEFAULT);
1018
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
1020
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
1021
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
1022
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
1024
** Select * from Slave **
1025
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
1027
1 62316231623162316231623162316231 Kyle
1028
2 62316231623162316231623162316231 JOE
1029
3 62316231623162316231623162316231 QA
1031
** Delete from master **
1032
DELETE FROM t17 WHERE c6 = 3;
1033
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
1035
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
1036
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
1039
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
1041
1 62316231623162316231623162316231 Kyle
1042
2 62316231623162316231623162316231 JOE
1046
*****************************************************
1047
* - Update row using column on Master not on slave *
1048
* Expect: Rows updated *
1049
*****************************************************
1053
*** Create t18 on slave ***
1057
CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
1060
*** Create t18 on Master ***
1061
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
1063
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
1070
*** Master Data Insert ***
1071
set @b1 = 'b1b1b1b1';
1072
set @b1 = concat(@b1,@b1);
1073
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
1074
(2,@b1,'JOE',2,DEFAULT),
1075
(3,@b1,'QA',3,DEFAULT);
1076
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
1078
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
1079
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
1080
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
1082
** Select * from Slave **
1083
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
1085
1 62316231623162316231623162316231 Kyle
1086
2 62316231623162316231623162316231 JOE
1087
3 62316231623162316231623162316231 QA
1089
** update from master **
1090
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
1091
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
1093
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
1094
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
1095
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
1098
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
1100
1 62316231623162316231623162316231 Kyle
1101
2 62316231623162316231623162316231 JOE
1102
3 62316231623162316231623162316231 TEST
1106
*****************************************************
1107
* - Insert UUID column on Master not on slave *
1108
* Expect: Rows inserted *
1109
*****************************************************
1111
*** Create t5 on slave ***
1114
CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
1117
*** Create t5 on Master ***
1118
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
1120
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
1127
*** Master Data Insert ***
1128
set @b1 = 'b1b1b1b1';
1129
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
1130
(2,@b1,'JOE',UUID(),DEFAULT),
1131
(3,@b1,'QA',UUID(),DEFAULT);
1132
SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
1134
1 6231623162316231 Kyle UUID TIME
1135
2 6231623162316231 JOE UUID TIME
1136
3 6231623162316231 QA UUID TIME
1138
** Select * from Slave **
1139
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
1141
1 6231623162316231 Kyle
1142
2 6231623162316231 JOE
1143
3 6231623162316231 QA
1146
set binlog_format=statement;
1148
***********************************************************
1149
***********************************************************
1150
***************** Start of Testing ************************
1151
***********************************************************
1152
***********************************************************
1153
* This test format == binlog_format STATEMENT and engine == 'InnoDB'
1154
***********************************************************
1155
***********************************************************
1157
***** Testing more columns on the Master *****
1159
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
1161
f5 FLOAT DEFAULT '2.00',
1162
f6 CHAR(4) DEFAULT 'TEST',
1167
f11 VARBINARY(64))ENGINE='InnoDB';
1169
* Alter Table on Slave and drop columns f5 through f11 *
1171
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
1173
* Insert data in Master then update and delete some rows*
1175
* Select count and 20 rows from Master *
1177
SELECT COUNT(*) FROM t1;
1181
SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
1182
hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
1183
f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
1184
2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1185
3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1186
5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1187
6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1188
8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1189
9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1190
11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1191
12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1192
14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1193
15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1194
17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1195
18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1196
20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1197
21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1198
23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1199
24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1200
26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1201
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1202
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1203
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
1205
* Select count and 20 rows from Slave *
1207
SELECT COUNT(*) FROM t1;
1211
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
1234
* Show Slave Status *
1238
Master_Host 127.0.0.1
1242
Master_Log_File master-bin.000001
1243
Read_Master_Log_Pos #
1246
Relay_Master_Log_File master-bin.000001
1247
Slave_IO_Running Yes
1248
Slave_SQL_Running Yes
1252
Replicate_Ignore_Table
1253
Replicate_Wild_Do_Table
1254
Replicate_Wild_Ignore_Table
1258
Exec_Master_Log_Pos #
1260
Until_Condition None
1263
Master_SSL_Allowed No
1269
Seconds_Behind_Master #
1270
Master_SSL_Verify_Server_Cert No
1277
***** Testing Altering table def scenario *****
1279
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
1281
f5 DOUBLE DEFAULT '2.00',
1282
f6 ENUM('a', 'b', 'c') default 'a',
1283
f7 DECIMAL(17,9) default '1000.00',
1285
f9 NUMERIC(6,4) default '2000.00',
1287
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
1288
f12 SET('a', 'b', 'c') default 'b')
1291
Warning 1264 Out of range value for column 'f9' at row 1
1293
CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
1295
f5 DOUBLE DEFAULT '2.00',
1296
f6 ENUM('a', 'b', 'c') default 'a',
1299
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
1300
f12 SET('a', 'b', 'c') default 'b')
1303
CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
1305
f5 DOUBLE DEFAULT '2.00',
1306
f6 DECIMAL(17,9) default '1000.00',
1308
f8 NUMERIC(6,4) default '2000.00',
1310
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
1314
Warning 1264 Out of range value for column 'f8' at row 1
1316
CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
1343
f30 ENUM ('a','b', 'c') default 'a',
1346
f33 SET ('a', 'b', 'c') default 'b',
1347
f34 VARBINARY(1025),
1351
** Alter tables on slave and drop columns **
1353
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
1355
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
1356
alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
1358
drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
1359
drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
1360
drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
1361
drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
1362
drop f33, drop f34, drop f35;
1364
** Insert Data into Master **
1365
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
1367
INSERT into t2 values (2, 2, 2, 'second',
1368
2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
1371
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
1374
Warning 1264 Out of range value for column 'f9' at row 1
1375
Warning 1264 Out of range value for column 'f9' at row 2
1376
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
1377
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
1379
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
1380
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
1381
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
1383
Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
1384
INSERT into t31 values (1, 1, 3, 'third',
1385
/* f5 BIGINT, */ 333333333333333333333333,
1386
/* f6 BLOB, */ '3333333333333333333333',
1387
/* f7 DATE, */ '2007-07-18',
1388
/* f8 DATETIME, */ "2007-07-18",
1389
/* f9 FLOAT, */ 3.33333333,
1390
/* f10 INT, */ 333333333,
1391
/* f11 LONGBLOB, */ '3333333333333333333',
1392
/* f12 LONGTEXT, */ '3333333333333333333',
1393
/* f13 MEDIUMBLOB, */ '3333333333333333333',
1394
/* f14 MEDIUMINT, */ 33,
1395
/* f15 MEDIUMTEXT, */ 3.3,
1396
/* f16 REAL, */ 3.3,
1397
/* f17 SMALLINT, */ 3,
1398
/* f18 TEXT, */ '33',
1399
/* f19 TIME, */ '2:59:58.999',
1400
/* f20 TIMESTAMP, */ 20000303000000,
1401
/* f21 TINYBLOB, */ '3333',
1402
/* f22 TINYINT, */ 3,
1403
/* f23 TINYTEXT, */ '3',
1404
/* f24 YEAR, */ 3000,
1405
/* f25 BINARY(255), */ 'three_33333',
1406
/* f26 BIT(64), */ b'011',
1407
/* f27 CHAR(255), */ 'three',
1408
/* f28 DECIMAL(30,7), */ 3.333,
1409
/* f29 DOUBLE, */ 3.333333333333333333333333333,
1410
/* f30 ENUM ('a','b','c')*/ 'c',
1411
/* f31 FLOAT, */ 3.0,
1412
/* f32 NUMERIC(17,9), */ 3.3333,
1413
/* f33 SET ('a','b','c'),*/ 'c',
1414
/*f34 VARBINARY(1025),*/ '3333 minus 3',
1415
/*f35 VARCHAR(257),*/ 'three times three'
1418
Warning 1264 Out of range value for column 'f5' at row 1
1419
Warning 1264 Out of range value for column 'f24' at row 1
1420
INSERT into t31 values (1, 1, 4, 'fourth',
1421
/* f5 BIGINT, */ 333333333333333333333333,
1422
/* f6 BLOB, */ '3333333333333333333333',
1423
/* f7 DATE, */ '2007-07-18',
1424
/* f8 DATETIME, */ "2007-07-18",
1425
/* f9 FLOAT, */ 3.33333333,
1426
/* f10 INT, */ 333333333,
1427
/* f11 LONGBLOB, */ '3333333333333333333',
1428
/* f12 LONGTEXT, */ '3333333333333333333',
1429
/* f13 MEDIUMBLOB, */ '3333333333333333333',
1430
/* f14 MEDIUMINT, */ 33,
1431
/* f15 MEDIUMTEXT, */ 3.3,
1432
/* f16 REAL, */ 3.3,
1433
/* f17 SMALLINT, */ 3,
1434
/* f18 TEXT, */ '33',
1435
/* f19 TIME, */ '2:59:58.999',
1436
/* f20 TIMESTAMP, */ 20000303000000,
1437
/* f21 TINYBLOB, */ '3333',
1438
/* f22 TINYINT, */ 3,
1439
/* f23 TINYTEXT, */ '3',
1440
/* f24 YEAR, */ 3000,
1441
/* f25 BINARY(255), */ 'three_33333',
1442
/* f26 BIT(64), */ b'011',
1443
/* f27 CHAR(255), */ 'three',
1444
/* f28 DECIMAL(30,7), */ 3.333,
1445
/* f29 DOUBLE, */ 3.333333333333333333333333333,
1446
/* f30 ENUM ('a','b','c')*/ 'c',
1447
/* f31 FLOAT, */ 3.0,
1448
/* f32 NUMERIC(17,9), */ 3.3333,
1449
/* f33 SET ('a','b','c'),*/ 'c',
1450
/*f34 VARBINARY(1025),*/ '3333 minus 3',
1451
/*f35 VARCHAR(257),*/ 'three times three'
1454
/* f5 BIGINT, */ 333333333333333333333333,
1455
/* f6 BLOB, */ '3333333333333333333333',
1456
/* f7 DATE, */ '2007-07-18',
1457
/* f8 DATETIME, */ "2007-07-18",
1458
/* f9 FLOAT, */ 3.33333333,
1459
/* f10 INT, */ 333333333,
1460
/* f11 LONGBLOB, */ '3333333333333333333',
1461
/* f12 LONGTEXT, */ '3333333333333333333',
1462
/* f13 MEDIUMBLOB, */ '3333333333333333333',
1463
/* f14 MEDIUMINT, */ 33,
1464
/* f15 MEDIUMTEXT, */ 3.3,
1465
/* f16 REAL, */ 3.3,
1466
/* f17 SMALLINT, */ 3,
1467
/* f18 TEXT, */ '33',
1468
/* f19 TIME, */ '2:59:58.999',
1469
/* f20 TIMESTAMP, */ 20000303000000,
1470
/* f21 TINYBLOB, */ '3333',
1471
/* f22 TINYINT, */ 3,
1472
/* f23 TINYTEXT, */ '3',
1473
/* f24 YEAR, */ 3000,
1474
/* f25 BINARY(255), */ 'three_33333',
1475
/* f26 BIT(64), */ b'011',
1476
/* f27 CHAR(255), */ 'three',
1477
/* f28 DECIMAL(30,7), */ 3.333,
1478
/* f29 DOUBLE, */ 3.333333333333333333333333333,
1479
/* f30 ENUM ('a','b','c')*/ 'c',
1480
/* f31 FLOAT, */ 3.0,
1481
/* f32 NUMERIC(17,9), */ 3.3333,
1482
/* f33 SET ('a','b','c'),*/ 'c',
1483
/*f34 VARBINARY(1025),*/ '3333 minus 3',
1484
/*f35 VARCHAR(257),*/ 'three times three'
1487
/* f5 BIGINT, */ NULL,
1488
/* f6 BLOB, */ '3333333333333333333333',
1489
/* f7 DATE, */ '2007-07-18',
1490
/* f8 DATETIME, */ "2007-07-18",
1491
/* f9 FLOAT, */ 3.33333333,
1492
/* f10 INT, */ 333333333,
1493
/* f11 LONGBLOB, */ '3333333333333333333',
1494
/* f12 LONGTEXT, */ '3333333333333333333',
1495
/* f13 MEDIUMBLOB, */ '3333333333333333333',
1496
/* f14 MEDIUMINT, */ 33,
1497
/* f15 MEDIUMTEXT, */ 3.3,
1498
/* f16 REAL, */ 3.3,
1499
/* f17 SMALLINT, */ 3,
1500
/* f18 TEXT, */ '33',
1501
/* f19 TIME, */ '2:59:58.999',
1502
/* f20 TIMESTAMP, */ 20000303000000,
1503
/* f21 TINYBLOB, */ '3333',
1504
/* f22 TINYINT, */ 3,
1505
/* f23 TINYTEXT, */ '3',
1506
/* f24 YEAR, */ 3000,
1507
/* f25 BINARY(255), */ 'three_33333',
1508
/* f26 BIT(64), */ b'011',
1509
/* f27 CHAR(255), */ 'three',
1510
/* f28 DECIMAL(30,7), */ 3.333,
1511
/* f29 DOUBLE, */ 3.333333333333333333333333333,
1512
/* f30 ENUM ('a','b','c')*/ 'c',
1513
/* f31 FLOAT, */ 3.0,
1514
/* f32 NUMERIC(17,9), */ 3.3333,
1515
/* f33 SET ('a','b','c'),*/ 'c',
1516
/*f34 VARBINARY(1025),*/ '3333 minus 3',
1517
/*f35 VARCHAR(257),*/ NULL
1520
Warning 1264 Out of range value for column 'f5' at row 1
1521
Warning 1264 Out of range value for column 'f24' at row 1
1522
Warning 1264 Out of range value for column 'f5' at row 2
1523
Warning 1264 Out of range value for column 'f24' at row 2
1524
Warning 1264 Out of range value for column 'f24' at row 3
1526
** Sync slave with master **
1527
** Do selects from tables **
1529
select * from t1 order by f3;
1571
select * from t2 order by f1;
1576
select * from t3 order by f1;
1579
select * from t4 order by f1;
1582
select * from t31 order by f3;
1591
** Do updates master **
1593
update t31 set f5=555555555555555 where f3=6;
1594
update t31 set f2=2 where f3=2;
1595
update t31 set f1=NULL where f3=1;
1596
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
1598
** Delete from Master **
1606
** Check slave status **
1612
Master_Host 127.0.0.1
1616
Master_Log_File master-bin.000001
1617
Read_Master_Log_Pos #
1620
Relay_Master_Log_File master-bin.000001
1621
Slave_IO_Running Yes
1622
Slave_SQL_Running Yes
1626
Replicate_Ignore_Table
1627
Replicate_Wild_Do_Table
1628
Replicate_Wild_Ignore_Table
1632
Exec_Master_Log_Pos #
1634
Until_Condition None
1637
Master_SSL_Allowed No
1643
Seconds_Behind_Master #
1644
Master_SSL_Verify_Server_Cert No
1650
****************************************
1651
* columns in master at middle of table *
1652
* Expect: Proper error message *
1653
****************************************
1655
** Stop and Reset Slave **
1660
** create table slave side **
1661
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
1664
** Connect to master and create table **
1666
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
1667
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
1673
*** Master Data Insert ***
1674
set @b1 = 'b1b1b1b1';
1675
set @b1 = concat(@b1,@b1);
1676
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
1677
(2,@b1,DEFAULT,'JOE',DEFAULT),
1678
(3,@b1,DEFAULT,'QA',DEFAULT);
1680
********************************************
1681
*** Expect slave to fail with Error 1523 ***
1682
********************************************
1686
Master_Host 127.0.0.1
1690
Master_Log_File master-bin.000001
1691
Read_Master_Log_Pos #
1694
Relay_Master_Log_File master-bin.000001
1695
Slave_IO_Running Yes
1696
Slave_SQL_Running No
1700
Replicate_Ignore_Table
1701
Replicate_Wild_Do_Table
1702
Replicate_Wild_Ignore_Table
1704
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
1706
Exec_Master_Log_Pos #
1708
Until_Condition None
1711
Master_SSL_Allowed No
1717
Seconds_Behind_Master #
1718
Master_SSL_Verify_Server_Cert No
1722
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
1723
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
1729
*********************************************
1730
* More columns in master at middle of table *
1731
* Expect: Proper error message *
1732
*********************************************
1734
*** Create t11 on slave ***
1737
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
1740
*** Create t11 on Master ***
1741
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
1742
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
1748
*** Master Data Insert ***
1749
set @b1 = 'b1b1b1b1';
1750
set @b1 = concat(@b1,@b1);
1751
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
1752
(2,@b1,'Testing is cool','JOE',DEFAULT),
1753
(3,@b1,DEFAULT,'QA',DEFAULT);
1755
********************************************
1756
*** Expect slave to fail with Error 1523 ***
1757
********************************************
1761
Master_Host 127.0.0.1
1765
Master_Log_File master-bin.000001
1766
Read_Master_Log_Pos #
1769
Relay_Master_Log_File master-bin.000001
1770
Slave_IO_Running Yes
1771
Slave_SQL_Running No
1775
Replicate_Ignore_Table
1776
Replicate_Wild_Do_Table
1777
Replicate_Wild_Ignore_Table
1779
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
1781
Exec_Master_Log_Pos #
1783
Until_Condition None
1786
Master_SSL_Allowed No
1792
Seconds_Behind_Master #
1793
Master_SSL_Verify_Server_Cert No
1797
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
1798
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
1804
*********************************************
1805
* More columns in master at middle of table *
1806
* Expect: This one should pass blob-text *
1807
*********************************************
1809
*** Create t12 on slave ***
1812
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
1815
*** Create t12 on Master ***
1816
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
1817
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
1823
*** Master Data Insert ***
1824
set @b1 = 'b1b1b1b1';
1825
set @b1 = concat(@b1,@b1);
1826
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
1827
(2,@b1,'JOE',DEFAULT,DEFAULT),
1828
(3,@b1,'QA',DEFAULT,DEFAULT);
1830
SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
1832
1 62316231623162316231623162316231 Kyle test 1
1833
2 62316231623162316231623162316231 JOE test 1
1834
3 62316231623162316231623162316231 QA test 1
1836
*** Select on Slave ***
1837
SELECT a,hex(b),c FROM t12 ORDER BY a;
1839
1 62316231623162316231623162316231 Kyle
1840
2 62316231623162316231623162316231 JOE
1841
3 62316231623162316231623162316231 QA
1846
****************************************************
1847
* - Alter Master adding columns at middle of table *
1848
* Expect: columns added *
1849
****************************************************
1852
*** Create t14 on slave ***
1855
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
1858
*** Create t14 on Master ***
1859
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
1861
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
1868
*** Master Data Insert ***
1869
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
1870
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
1872
set @b1 = 'b1b1b1b1';
1873
set @b1 = concat(@b1,@b1);
1874
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
1875
(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
1876
(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
1878
SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
1879
c1 c2 c3 hex(c4) c5 c6 c7
1880
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
1881
2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
1882
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
1884
*** Select on Slave ****
1885
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
1887
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
1888
2 2.00 This Test Should work 62316231623162316231623162316231 JOE
1889
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
1891
****************************************************
1892
* - Alter Master Dropping columns from the middle. *
1893
* Expect: columns dropped *
1894
****************************************************
1896
*** connect to master and drop columns ***
1897
ALTER TABLE t14 DROP COLUMN c2;
1898
ALTER TABLE t14 DROP COLUMN c7;
1900
*** Select from Master ***
1901
SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
1903
1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
1904
2 This Test Should work 62316231623162316231623162316231 JOE 1
1905
3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
1912
Master_Host 127.0.0.1
1916
Master_Log_File master-bin.000001
1917
Read_Master_Log_Pos #
1920
Relay_Master_Log_File master-bin.000001
1921
Slave_IO_Running Yes
1922
Slave_SQL_Running No
1926
Replicate_Ignore_Table
1927
Replicate_Wild_Do_Table
1928
Replicate_Wild_Ignore_Table
1930
Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
1932
Exec_Master_Log_Pos #
1934
Until_Condition None
1937
Master_SSL_Allowed No
1943
Seconds_Behind_Master #
1944
Master_SSL_Verify_Server_Cert No
1948
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
1958
*************************************************
1959
* - Alter Master adding columns at end of table *
1960
* Expect: Error 1054 *
1961
*************************************************
1963
*** Create t15 on slave ***
1966
CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
1969
*** Create t15 on Master ***
1970
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
1972
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
1979
*** Master Data Insert ***
1980
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
1981
set @b1 = 'b1b1b1b1';
1982
set @b1 = concat(@b1,@b1);
1983
INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
1984
(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
1985
(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
1986
SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
1987
c1 hex(c4) c5 c6 c7 c2
1988
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
1989
2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
1990
3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
1992
********************************************
1993
*** Expect slave to fail with Error 1054 ***
1994
********************************************
1998
Master_Host 127.0.0.1
2002
Master_Log_File master-bin.000001
2003
Read_Master_Log_Pos #
2006
Relay_Master_Log_File master-bin.000001
2007
Slave_IO_Running Yes
2008
Slave_SQL_Running No
2012
Replicate_Ignore_Table
2013
Replicate_Wild_Do_Table
2014
Replicate_Wild_Ignore_Table
2016
Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
2018
Exec_Master_Log_Pos #
2020
Until_Condition None
2023
Master_SSL_Allowed No
2029
Seconds_Behind_Master #
2030
Master_SSL_Verify_Server_Cert No
2034
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
2044
************************************************
2045
* - Create index on Master column not on slave *
2047
************************************************
2049
*** Create t16 on slave ***
2052
CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
2055
*** Create t16 on Master ***
2056
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
2058
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
2065
*** Master Create Index and Data Insert ***
2066
CREATE INDEX part_of_c6 ON t16 (c6);
2067
set @b1 = 'b1b1b1b1';
2068
set @b1 = concat(@b1,@b1);
2069
INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
2070
(2,@b1,'JOE',2,DEFAULT),
2071
(3,@b1,'QA',3,DEFAULT);
2072
SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
2074
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
2075
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
2076
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
2084
Master_Host 127.0.0.1
2088
Master_Log_File master-bin.000001
2089
Read_Master_Log_Pos #
2092
Relay_Master_Log_File master-bin.000001
2093
Slave_IO_Running Yes
2094
Slave_SQL_Running No
2098
Replicate_Ignore_Table
2099
Replicate_Wild_Do_Table
2100
Replicate_Wild_Ignore_Table
2102
Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
2104
Exec_Master_Log_Pos #
2106
Until_Condition None
2109
Master_SSL_Allowed No
2115
Seconds_Behind_Master #
2116
Master_SSL_Verify_Server_Cert No
2120
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
2130
*****************************************************
2131
* - Delete rows using column on Master not on slave *
2132
* Expect: Rows Deleted *
2133
*****************************************************
2135
*** Create t17 on slave ***
2138
CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
2141
*** Create t17 on Master ***
2142
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
2144
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
2151
*** Master Data Insert ***
2152
set @b1 = 'b1b1b1b1';
2153
set @b1 = concat(@b1,@b1);
2154
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
2155
(2,@b1,'JOE',2,DEFAULT),
2156
(3,@b1,'QA',3,DEFAULT);
2157
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
2159
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
2160
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
2161
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
2163
** Select * from Slave **
2164
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
2166
1 62316231623162316231623162316231 Kyle
2167
2 62316231623162316231623162316231 JOE
2168
3 62316231623162316231623162316231 QA
2170
** Delete from master **
2171
DELETE FROM t17 WHERE c6 = 3;
2172
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
2174
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
2175
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
2178
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
2180
1 62316231623162316231623162316231 Kyle
2181
2 62316231623162316231623162316231 JOE
2185
*****************************************************
2186
* - Update row using column on Master not on slave *
2187
* Expect: Rows updated *
2188
*****************************************************
2192
*** Create t18 on slave ***
2196
CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
2199
*** Create t18 on Master ***
2200
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
2202
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
2209
*** Master Data Insert ***
2210
set @b1 = 'b1b1b1b1';
2211
set @b1 = concat(@b1,@b1);
2212
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
2213
(2,@b1,'JOE',2,DEFAULT),
2214
(3,@b1,'QA',3,DEFAULT);
2215
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
2217
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
2218
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
2219
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
2221
** Select * from Slave **
2222
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
2224
1 62316231623162316231623162316231 Kyle
2225
2 62316231623162316231623162316231 JOE
2226
3 62316231623162316231623162316231 QA
2228
** update from master **
2229
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
2230
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
2232
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
2233
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
2234
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
2237
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
2239
1 62316231623162316231623162316231 Kyle
2240
2 62316231623162316231623162316231 JOE
2241
3 62316231623162316231623162316231 TEST
2245
*****************************************************
2246
* - Insert UUID column on Master not on slave *
2247
* Expect: Rows inserted *
2248
*****************************************************
2250
*** Create t5 on slave ***
2253
CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
2256
*** Create t5 on Master ***
2257
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
2259
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
2266
*** Master Data Insert ***
2267
set @b1 = 'b1b1b1b1';
2268
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
2269
(2,@b1,'JOE',UUID(),DEFAULT),
2270
(3,@b1,'QA',UUID(),DEFAULT);
2271
SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
2273
1 6231623162316231 Kyle UUID TIME
2274
2 6231623162316231 JOE UUID TIME
2275
3 6231623162316231 QA UUID TIME
2277
** Select * from Slave **
2278
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
2280
1 6231623162316231 Kyle
2281
2 6231623162316231 JOE
2282
3 6231623162316231 QA
2285
set binlog_format=mixed;
2287
***********************************************************
2288
***********************************************************
2289
***************** Start of Testing ************************
2290
***********************************************************
2291
***********************************************************
2292
* This test format == binlog_format MIXED and engine == 'InnoDB'
2293
***********************************************************
2294
***********************************************************
2296
***** Testing more columns on the Master *****
2298
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
2300
f5 FLOAT DEFAULT '2.00',
2301
f6 CHAR(4) DEFAULT 'TEST',
2306
f11 VARBINARY(64))ENGINE='InnoDB';
2308
* Alter Table on Slave and drop columns f5 through f11 *
2310
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
2312
* Insert data in Master then update and delete some rows*
2314
* Select count and 20 rows from Master *
2316
SELECT COUNT(*) FROM t1;
2320
SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
2321
hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
2322
f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
2323
2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2324
3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2325
5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2326
6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2327
8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2328
9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2329
11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2330
12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2331
14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2332
15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2333
17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2334
18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2335
20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2336
21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2337
23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2338
24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2339
26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2340
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2341
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2342
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
2344
* Select count and 20 rows from Slave *
2346
SELECT COUNT(*) FROM t1;
2350
SELECT * FROM t1 ORDER BY f3 LIMIT 20;
2373
* Show Slave Status *
2377
Master_Host 127.0.0.1
2381
Master_Log_File master-bin.000001
2382
Read_Master_Log_Pos #
2385
Relay_Master_Log_File master-bin.000001
2386
Slave_IO_Running Yes
2387
Slave_SQL_Running Yes
2391
Replicate_Ignore_Table
2392
Replicate_Wild_Do_Table
2393
Replicate_Wild_Ignore_Table
2397
Exec_Master_Log_Pos #
2399
Until_Condition None
2402
Master_SSL_Allowed No
2408
Seconds_Behind_Master #
2409
Master_SSL_Verify_Server_Cert No
2416
***** Testing Altering table def scenario *****
2418
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
2420
f5 DOUBLE DEFAULT '2.00',
2421
f6 ENUM('a', 'b', 'c') default 'a',
2422
f7 DECIMAL(17,9) default '1000.00',
2424
f9 NUMERIC(6,4) default '2000.00',
2426
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
2427
f12 SET('a', 'b', 'c') default 'b')
2430
Warning 1264 Out of range value for column 'f9' at row 1
2432
CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
2434
f5 DOUBLE DEFAULT '2.00',
2435
f6 ENUM('a', 'b', 'c') default 'a',
2438
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
2439
f12 SET('a', 'b', 'c') default 'b')
2442
CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
2444
f5 DOUBLE DEFAULT '2.00',
2445
f6 DECIMAL(17,9) default '1000.00',
2447
f8 NUMERIC(6,4) default '2000.00',
2449
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
2453
Warning 1264 Out of range value for column 'f8' at row 1
2455
CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
2482
f30 ENUM ('a','b', 'c') default 'a',
2485
f33 SET ('a', 'b', 'c') default 'b',
2486
f34 VARBINARY(1025),
2490
** Alter tables on slave and drop columns **
2492
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
2494
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
2495
alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
2497
drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
2498
drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
2499
drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
2500
drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
2501
drop f33, drop f34, drop f35;
2503
** Insert Data into Master **
2504
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
2506
INSERT into t2 values (2, 2, 2, 'second',
2507
2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
2510
3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
2513
Warning 1264 Out of range value for column 'f9' at row 1
2514
Warning 1264 Out of range value for column 'f9' at row 2
2515
INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
2516
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
2518
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
2519
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
2520
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
2522
Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
2523
INSERT into t31 values (1, 1, 3, 'third',
2524
/* f5 BIGINT, */ 333333333333333333333333,
2525
/* f6 BLOB, */ '3333333333333333333333',
2526
/* f7 DATE, */ '2007-07-18',
2527
/* f8 DATETIME, */ "2007-07-18",
2528
/* f9 FLOAT, */ 3.33333333,
2529
/* f10 INT, */ 333333333,
2530
/* f11 LONGBLOB, */ '3333333333333333333',
2531
/* f12 LONGTEXT, */ '3333333333333333333',
2532
/* f13 MEDIUMBLOB, */ '3333333333333333333',
2533
/* f14 MEDIUMINT, */ 33,
2534
/* f15 MEDIUMTEXT, */ 3.3,
2535
/* f16 REAL, */ 3.3,
2536
/* f17 SMALLINT, */ 3,
2537
/* f18 TEXT, */ '33',
2538
/* f19 TIME, */ '2:59:58.999',
2539
/* f20 TIMESTAMP, */ 20000303000000,
2540
/* f21 TINYBLOB, */ '3333',
2541
/* f22 TINYINT, */ 3,
2542
/* f23 TINYTEXT, */ '3',
2543
/* f24 YEAR, */ 3000,
2544
/* f25 BINARY(255), */ 'three_33333',
2545
/* f26 BIT(64), */ b'011',
2546
/* f27 CHAR(255), */ 'three',
2547
/* f28 DECIMAL(30,7), */ 3.333,
2548
/* f29 DOUBLE, */ 3.333333333333333333333333333,
2549
/* f30 ENUM ('a','b','c')*/ 'c',
2550
/* f31 FLOAT, */ 3.0,
2551
/* f32 NUMERIC(17,9), */ 3.3333,
2552
/* f33 SET ('a','b','c'),*/ 'c',
2553
/*f34 VARBINARY(1025),*/ '3333 minus 3',
2554
/*f35 VARCHAR(257),*/ 'three times three'
2557
Warning 1264 Out of range value for column 'f5' at row 1
2558
Warning 1264 Out of range value for column 'f24' at row 1
2559
INSERT into t31 values (1, 1, 4, 'fourth',
2560
/* f5 BIGINT, */ 333333333333333333333333,
2561
/* f6 BLOB, */ '3333333333333333333333',
2562
/* f7 DATE, */ '2007-07-18',
2563
/* f8 DATETIME, */ "2007-07-18",
2564
/* f9 FLOAT, */ 3.33333333,
2565
/* f10 INT, */ 333333333,
2566
/* f11 LONGBLOB, */ '3333333333333333333',
2567
/* f12 LONGTEXT, */ '3333333333333333333',
2568
/* f13 MEDIUMBLOB, */ '3333333333333333333',
2569
/* f14 MEDIUMINT, */ 33,
2570
/* f15 MEDIUMTEXT, */ 3.3,
2571
/* f16 REAL, */ 3.3,
2572
/* f17 SMALLINT, */ 3,
2573
/* f18 TEXT, */ '33',
2574
/* f19 TIME, */ '2:59:58.999',
2575
/* f20 TIMESTAMP, */ 20000303000000,
2576
/* f21 TINYBLOB, */ '3333',
2577
/* f22 TINYINT, */ 3,
2578
/* f23 TINYTEXT, */ '3',
2579
/* f24 YEAR, */ 3000,
2580
/* f25 BINARY(255), */ 'three_33333',
2581
/* f26 BIT(64), */ b'011',
2582
/* f27 CHAR(255), */ 'three',
2583
/* f28 DECIMAL(30,7), */ 3.333,
2584
/* f29 DOUBLE, */ 3.333333333333333333333333333,
2585
/* f30 ENUM ('a','b','c')*/ 'c',
2586
/* f31 FLOAT, */ 3.0,
2587
/* f32 NUMERIC(17,9), */ 3.3333,
2588
/* f33 SET ('a','b','c'),*/ 'c',
2589
/*f34 VARBINARY(1025),*/ '3333 minus 3',
2590
/*f35 VARCHAR(257),*/ 'three times three'
2593
/* f5 BIGINT, */ 333333333333333333333333,
2594
/* f6 BLOB, */ '3333333333333333333333',
2595
/* f7 DATE, */ '2007-07-18',
2596
/* f8 DATETIME, */ "2007-07-18",
2597
/* f9 FLOAT, */ 3.33333333,
2598
/* f10 INT, */ 333333333,
2599
/* f11 LONGBLOB, */ '3333333333333333333',
2600
/* f12 LONGTEXT, */ '3333333333333333333',
2601
/* f13 MEDIUMBLOB, */ '3333333333333333333',
2602
/* f14 MEDIUMINT, */ 33,
2603
/* f15 MEDIUMTEXT, */ 3.3,
2604
/* f16 REAL, */ 3.3,
2605
/* f17 SMALLINT, */ 3,
2606
/* f18 TEXT, */ '33',
2607
/* f19 TIME, */ '2:59:58.999',
2608
/* f20 TIMESTAMP, */ 20000303000000,
2609
/* f21 TINYBLOB, */ '3333',
2610
/* f22 TINYINT, */ 3,
2611
/* f23 TINYTEXT, */ '3',
2612
/* f24 YEAR, */ 3000,
2613
/* f25 BINARY(255), */ 'three_33333',
2614
/* f26 BIT(64), */ b'011',
2615
/* f27 CHAR(255), */ 'three',
2616
/* f28 DECIMAL(30,7), */ 3.333,
2617
/* f29 DOUBLE, */ 3.333333333333333333333333333,
2618
/* f30 ENUM ('a','b','c')*/ 'c',
2619
/* f31 FLOAT, */ 3.0,
2620
/* f32 NUMERIC(17,9), */ 3.3333,
2621
/* f33 SET ('a','b','c'),*/ 'c',
2622
/*f34 VARBINARY(1025),*/ '3333 minus 3',
2623
/*f35 VARCHAR(257),*/ 'three times three'
2626
/* f5 BIGINT, */ NULL,
2627
/* f6 BLOB, */ '3333333333333333333333',
2628
/* f7 DATE, */ '2007-07-18',
2629
/* f8 DATETIME, */ "2007-07-18",
2630
/* f9 FLOAT, */ 3.33333333,
2631
/* f10 INT, */ 333333333,
2632
/* f11 LONGBLOB, */ '3333333333333333333',
2633
/* f12 LONGTEXT, */ '3333333333333333333',
2634
/* f13 MEDIUMBLOB, */ '3333333333333333333',
2635
/* f14 MEDIUMINT, */ 33,
2636
/* f15 MEDIUMTEXT, */ 3.3,
2637
/* f16 REAL, */ 3.3,
2638
/* f17 SMALLINT, */ 3,
2639
/* f18 TEXT, */ '33',
2640
/* f19 TIME, */ '2:59:58.999',
2641
/* f20 TIMESTAMP, */ 20000303000000,
2642
/* f21 TINYBLOB, */ '3333',
2643
/* f22 TINYINT, */ 3,
2644
/* f23 TINYTEXT, */ '3',
2645
/* f24 YEAR, */ 3000,
2646
/* f25 BINARY(255), */ 'three_33333',
2647
/* f26 BIT(64), */ b'011',
2648
/* f27 CHAR(255), */ 'three',
2649
/* f28 DECIMAL(30,7), */ 3.333,
2650
/* f29 DOUBLE, */ 3.333333333333333333333333333,
2651
/* f30 ENUM ('a','b','c')*/ 'c',
2652
/* f31 FLOAT, */ 3.0,
2653
/* f32 NUMERIC(17,9), */ 3.3333,
2654
/* f33 SET ('a','b','c'),*/ 'c',
2655
/*f34 VARBINARY(1025),*/ '3333 minus 3',
2656
/*f35 VARCHAR(257),*/ NULL
2659
Warning 1264 Out of range value for column 'f5' at row 1
2660
Warning 1264 Out of range value for column 'f24' at row 1
2661
Warning 1264 Out of range value for column 'f5' at row 2
2662
Warning 1264 Out of range value for column 'f24' at row 2
2663
Warning 1264 Out of range value for column 'f24' at row 3
2665
** Sync slave with master **
2666
** Do selects from tables **
2668
select * from t1 order by f3;
2710
select * from t2 order by f1;
2715
select * from t3 order by f1;
2718
select * from t4 order by f1;
2721
select * from t31 order by f3;
2730
** Do updates master **
2732
update t31 set f5=555555555555555 where f3=6;
2733
update t31 set f2=2 where f3=2;
2734
update t31 set f1=NULL where f3=1;
2735
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
2737
** Delete from Master **
2745
** Check slave status **
2751
Master_Host 127.0.0.1
2755
Master_Log_File master-bin.000001
2756
Read_Master_Log_Pos #
2759
Relay_Master_Log_File master-bin.000001
2760
Slave_IO_Running Yes
2761
Slave_SQL_Running Yes
2765
Replicate_Ignore_Table
2766
Replicate_Wild_Do_Table
2767
Replicate_Wild_Ignore_Table
2771
Exec_Master_Log_Pos #
2773
Until_Condition None
2776
Master_SSL_Allowed No
2782
Seconds_Behind_Master #
2783
Master_SSL_Verify_Server_Cert No
2789
****************************************
2790
* columns in master at middle of table *
2791
* Expect: Proper error message *
2792
****************************************
2794
** Stop and Reset Slave **
2799
** create table slave side **
2800
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
2803
** Connect to master and create table **
2805
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
2806
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
2812
*** Master Data Insert ***
2813
set @b1 = 'b1b1b1b1';
2814
set @b1 = concat(@b1,@b1);
2815
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
2816
(2,@b1,DEFAULT,'JOE',DEFAULT),
2817
(3,@b1,DEFAULT,'QA',DEFAULT);
2819
********************************************
2820
*** Expect slave to fail with Error 1523 ***
2821
********************************************
2825
Master_Host 127.0.0.1
2829
Master_Log_File master-bin.000001
2830
Read_Master_Log_Pos #
2833
Relay_Master_Log_File master-bin.000001
2834
Slave_IO_Running Yes
2835
Slave_SQL_Running No
2839
Replicate_Ignore_Table
2840
Replicate_Wild_Do_Table
2841
Replicate_Wild_Ignore_Table
2843
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
2845
Exec_Master_Log_Pos #
2847
Until_Condition None
2850
Master_SSL_Allowed No
2856
Seconds_Behind_Master #
2857
Master_SSL_Verify_Server_Cert No
2861
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
2862
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
2868
*********************************************
2869
* More columns in master at middle of table *
2870
* Expect: Proper error message *
2871
*********************************************
2873
*** Create t11 on slave ***
2876
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
2879
*** Create t11 on Master ***
2880
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
2881
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
2887
*** Master Data Insert ***
2888
set @b1 = 'b1b1b1b1';
2889
set @b1 = concat(@b1,@b1);
2890
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
2891
(2,@b1,'Testing is cool','JOE',DEFAULT),
2892
(3,@b1,DEFAULT,'QA',DEFAULT);
2894
********************************************
2895
*** Expect slave to fail with Error 1523 ***
2896
********************************************
2900
Master_Host 127.0.0.1
2904
Master_Log_File master-bin.000001
2905
Read_Master_Log_Pos #
2908
Relay_Master_Log_File master-bin.000001
2909
Slave_IO_Running Yes
2910
Slave_SQL_Running No
2914
Replicate_Ignore_Table
2915
Replicate_Wild_Do_Table
2916
Replicate_Wild_Ignore_Table
2918
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
2920
Exec_Master_Log_Pos #
2922
Until_Condition None
2925
Master_SSL_Allowed No
2931
Seconds_Behind_Master #
2932
Master_SSL_Verify_Server_Cert No
2936
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
2937
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
2943
*********************************************
2944
* More columns in master at middle of table *
2945
* Expect: This one should pass blob-text *
2946
*********************************************
2948
*** Create t12 on slave ***
2951
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
2954
*** Create t12 on Master ***
2955
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
2956
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
2962
*** Master Data Insert ***
2963
set @b1 = 'b1b1b1b1';
2964
set @b1 = concat(@b1,@b1);
2965
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
2966
(2,@b1,'JOE',DEFAULT,DEFAULT),
2967
(3,@b1,'QA',DEFAULT,DEFAULT);
2969
SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
2971
1 62316231623162316231623162316231 Kyle test 1
2972
2 62316231623162316231623162316231 JOE test 1
2973
3 62316231623162316231623162316231 QA test 1
2975
*** Select on Slave ***
2976
SELECT a,hex(b),c FROM t12 ORDER BY a;
2978
1 62316231623162316231623162316231 Kyle
2979
2 62316231623162316231623162316231 JOE
2980
3 62316231623162316231623162316231 QA
2985
****************************************************
2986
* - Alter Master adding columns at middle of table *
2987
* Expect: columns added *
2988
****************************************************
2991
*** Create t14 on slave ***
2994
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
2997
*** Create t14 on Master ***
2998
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3000
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3007
*** Master Data Insert ***
3008
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
3009
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
3011
set @b1 = 'b1b1b1b1';
3012
set @b1 = concat(@b1,@b1);
3013
INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
3014
(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
3015
(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
3017
SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
3018
c1 c2 c3 hex(c4) c5 c6 c7
3019
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3020
2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
3021
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
3023
*** Select on Slave ****
3024
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
3026
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
3027
2 2.00 This Test Should work 62316231623162316231623162316231 JOE
3028
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
3030
****************************************************
3031
* - Alter Master Dropping columns from the middle. *
3032
* Expect: columns dropped *
3033
****************************************************
3035
*** connect to master and drop columns ***
3036
ALTER TABLE t14 DROP COLUMN c2;
3037
ALTER TABLE t14 DROP COLUMN c7;
3039
*** Select from Master ***
3040
SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
3042
1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
3043
2 This Test Should work 62316231623162316231623162316231 JOE 1
3044
3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
3051
Master_Host 127.0.0.1
3055
Master_Log_File master-bin.000001
3056
Read_Master_Log_Pos #
3059
Relay_Master_Log_File master-bin.000001
3060
Slave_IO_Running Yes
3061
Slave_SQL_Running No
3065
Replicate_Ignore_Table
3066
Replicate_Wild_Do_Table
3067
Replicate_Wild_Ignore_Table
3069
Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
3071
Exec_Master_Log_Pos #
3073
Until_Condition None
3076
Master_SSL_Allowed No
3082
Seconds_Behind_Master #
3083
Master_SSL_Verify_Server_Cert No
3087
Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
3097
*************************************************
3098
* - Alter Master adding columns at end of table *
3099
* Expect: Error 1054 *
3100
*************************************************
3102
*** Create t15 on slave ***
3105
CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
3108
*** Create t15 on Master ***
3109
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3111
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3118
*** Master Data Insert ***
3119
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
3120
set @b1 = 'b1b1b1b1';
3121
set @b1 = concat(@b1,@b1);
3122
INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
3123
(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
3124
(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
3125
SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
3126
c1 hex(c4) c5 c6 c7 c2
3127
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
3128
2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
3129
3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
3131
********************************************
3132
*** Expect slave to fail with Error 1054 ***
3133
********************************************
3137
Master_Host 127.0.0.1
3141
Master_Log_File master-bin.000001
3142
Read_Master_Log_Pos #
3145
Relay_Master_Log_File master-bin.000001
3146
Slave_IO_Running Yes
3147
Slave_SQL_Running No
3151
Replicate_Ignore_Table
3152
Replicate_Wild_Do_Table
3153
Replicate_Wild_Ignore_Table
3155
Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
3157
Exec_Master_Log_Pos #
3159
Until_Condition None
3162
Master_SSL_Allowed No
3168
Seconds_Behind_Master #
3169
Master_SSL_Verify_Server_Cert No
3173
Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
3183
************************************************
3184
* - Create index on Master column not on slave *
3186
************************************************
3188
*** Create t16 on slave ***
3191
CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
3194
*** Create t16 on Master ***
3195
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3197
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3204
*** Master Create Index and Data Insert ***
3205
CREATE INDEX part_of_c6 ON t16 (c6);
3206
set @b1 = 'b1b1b1b1';
3207
set @b1 = concat(@b1,@b1);
3208
INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
3209
(2,@b1,'JOE',2,DEFAULT),
3210
(3,@b1,'QA',3,DEFAULT);
3211
SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
3213
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3214
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
3215
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
3223
Master_Host 127.0.0.1
3227
Master_Log_File master-bin.000001
3228
Read_Master_Log_Pos #
3231
Relay_Master_Log_File master-bin.000001
3232
Slave_IO_Running Yes
3233
Slave_SQL_Running No
3237
Replicate_Ignore_Table
3238
Replicate_Wild_Do_Table
3239
Replicate_Wild_Ignore_Table
3241
Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
3243
Exec_Master_Log_Pos #
3245
Until_Condition None
3248
Master_SSL_Allowed No
3254
Seconds_Behind_Master #
3255
Master_SSL_Verify_Server_Cert No
3259
Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
3269
*****************************************************
3270
* - Delete rows using column on Master not on slave *
3271
* Expect: Rows Deleted *
3272
*****************************************************
3274
*** Create t17 on slave ***
3277
CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
3280
*** Create t17 on Master ***
3281
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3283
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3290
*** Master Data Insert ***
3291
set @b1 = 'b1b1b1b1';
3292
set @b1 = concat(@b1,@b1);
3293
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
3294
(2,@b1,'JOE',2,DEFAULT),
3295
(3,@b1,'QA',3,DEFAULT);
3296
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
3298
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3299
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
3300
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
3302
** Select * from Slave **
3303
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
3305
1 62316231623162316231623162316231 Kyle
3306
2 62316231623162316231623162316231 JOE
3307
3 62316231623162316231623162316231 QA
3309
** Delete from master **
3310
DELETE FROM t17 WHERE c6 = 3;
3311
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
3313
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3314
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
3317
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
3319
1 62316231623162316231623162316231 Kyle
3320
2 62316231623162316231623162316231 JOE
3324
*****************************************************
3325
* - Update row using column on Master not on slave *
3326
* Expect: Rows updated *
3327
*****************************************************
3331
*** Create t18 on slave ***
3335
CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
3338
*** Create t18 on Master ***
3339
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3341
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3348
*** Master Data Insert ***
3349
set @b1 = 'b1b1b1b1';
3350
set @b1 = concat(@b1,@b1);
3351
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
3352
(2,@b1,'JOE',2,DEFAULT),
3353
(3,@b1,'QA',3,DEFAULT);
3354
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
3356
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3357
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
3358
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
3360
** Select * from Slave **
3361
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
3363
1 62316231623162316231623162316231 Kyle
3364
2 62316231623162316231623162316231 JOE
3365
3 62316231623162316231623162316231 QA
3367
** update from master **
3368
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
3369
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
3371
1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
3372
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
3373
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
3376
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
3378
1 62316231623162316231623162316231 Kyle
3379
2 62316231623162316231623162316231 JOE
3380
3 62316231623162316231623162316231 TEST
3384
*****************************************************
3385
* - Insert UUID column on Master not on slave *
3386
* Expect: Rows inserted *
3387
*****************************************************
3389
*** Create t5 on slave ***
3392
CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
3395
*** Create t5 on Master ***
3396
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
3398
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
3405
*** Master Data Insert ***
3406
set @b1 = 'b1b1b1b1';
3407
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
3408
(2,@b1,'JOE',UUID(),DEFAULT),
3409
(3,@b1,'QA',UUID(),DEFAULT);
3410
SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
3412
1 6231623162316231 Kyle UUID TIME
3413
2 6231623162316231 JOE UUID TIME
3414
3 6231623162316231 QA UUID TIME
3416
** Select * from Slave **
3417
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
3419
1 6231623162316231 Kyle
3420
2 6231623162316231 JOE
3421
3 6231623162316231 QA