@@ -333,7 +333,7 @@ while (`SELECT HEX(@img_types) != HEX('')`)
333
333
# 1. columns that are set to default value are in AI
334
334
#
335
335
# UPDATE/MINIMAL:
336
- # 2. columns that are set to the same value are in AI
336
+ # 2. columns that are set to the same value are not in AI
337
337
# 3. columns that are not in WHERE clause but in PKE are in BI
338
338
# 4. on slave, columns that are not in master's BI but are in slave's
339
339
# PKE are in slave's BI
@@ -359,11 +359,11 @@ while (`SELECT HEX(@img_types) != HEX('')`)
359
359
-- source include/rpl_row_img_parts_master_slave.inc
360
360
361
361
-- let $row_img_query= UPDATE t SET c2=100, c3=1000 WHERE c2=100;
362
- # 2. columns that are set to the same value are in AI
362
+ # 2. columns that are set to the same value are not in AI
363
363
# 3. columns that are not in WHERE clause but in PKE are in BI
364
364
# 4. on slave, columns that are not in master's BI but are in slave's PKE are in slave's BI
365
- -- let $row_img_expected_master= 1:1 | 2:100 3:1000
366
- -- let $row_img_expected_slave = 2:100 3:1 | 2:100 3:1000
365
+ -- let $row_img_expected_master= 1:1 | 3:1000
366
+ -- let $row_img_expected_slave = 2:100 3:1 | 3:1000
367
367
-- source include/rpl_row_img_parts_master_slave.inc
368
368
369
369
-- let $row_img_query= DELETE FROM t WHERE c1=1
@@ -410,6 +410,54 @@ while (`SELECT HEX(@img_types) != HEX('')`)
410
410
--source include/sync_slave_sql_with_master.inc
411
411
}
412
412
413
+ if (`SELECT @@binlog_row_image = "MINIMAL" OR (SELECT @@binlog_row_image = "COMPLETE")`)
414
+ {
415
+ -- echo ####### MINIMAL AND COMPLETE PARTICULAR SCENARIO SETTING SAME VALUE ######
416
+
417
+ # ASSERTIONS:
418
+ # 1. columns that are set to the same value are not in AI
419
+ # 2. columns that are set to the same value by INSERT ... DUPLICATE KEY
420
+ # are not in AI
421
+ #
422
+
423
+ -- connection master
424
+ CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
425
+ INSERT INTO t VALUES (1,2,"a");
426
+
427
+
428
+ --source include/sync_slave_sql_with_master.inc
429
+ -- connection master
430
+
431
+ # Issue some statements
432
+ -- let $row_img_query= UPDATE t SET c1 = 1, c2 = 4 WHERE c3 = "a";
433
+ if (`SELECT @@binlog_row_image = "MINIMAL"`)
434
+ {
435
+ -- let $row_img_expected_master= 1:1 | 2:4
436
+ }
437
+ if (`SELECT @@binlog_row_image = "COMPLETE"`)
438
+ {
439
+ -- let $row_img_expected_master= 1:1 2:2 3:'a' | 2:4
440
+ }
441
+ -- let $row_img_expected_slave = $row_img_expected_master
442
+ -- source include/rpl_row_img_parts_master_slave.inc
443
+
444
+ -- let $row_img_query= INSERT INTO t VALUES (1, 4, "a") ON DUPLICATE KEY UPDATE c2 = c2 + 2, c3 = values(c3);
445
+ if (`SELECT @@binlog_row_image = "MINIMAL"`)
446
+ {
447
+ -- let $row_img_expected_master= 1:1 | 2:6
448
+ }
449
+ if (`SELECT @@binlog_row_image = "COMPLETE"`)
450
+ {
451
+ -- let $row_img_expected_master= 1:1 2:4 3:'a' | 2:6
452
+ }
453
+ -- let $row_img_expected_slave = $row_img_expected_master
454
+ -- source include/rpl_row_img_parts_master_slave.inc
455
+
456
+ -- connection master
457
+ DROP TABLE t;
458
+ --source include/sync_slave_sql_with_master.inc
459
+ }
460
+
413
461
if (`SELECT @@binlog_row_image = "NOBLOB"`)
414
462
{
415
463
-- echo ####### NOBLOB PARTICULAR SCENARIO ######
@@ -419,19 +467,17 @@ while (`SELECT HEX(@img_types) != HEX('')`)
419
467
# 1 non-blob columns that are set to default value are in AI
420
468
#
421
469
# UPDATE/NOBLOB:
422
- # 2 non-blob columns that are set to default value are in AI
423
- # 3 blob columns that are set to default value are in AI
424
- # 4 blob columns that are in WHERE clause but not in PKE are not in BI
425
- # 5 blob columns that are in NON-NULL UK but not in PK are not in BI
426
- # 6 on slave, blob columns that are in master's BI clause but not in
470
+ # 2 blob columns that are in WHERE clause but not in PKE are not in BI
471
+ # 3 blob columns that are in NON-NULL UK but not in PK are not in BI
472
+ # 4 on slave, blob columns that are in master's BI clause but not in
427
473
# slave's PKE are not in BI
428
474
#
429
475
# DELETE
430
- # 7 non-blob columns that are not in WHERE clause but in PKE are in BI
431
- # 8 blob columns that are used in WHERE clause but not in PKE are not
476
+ # 5 non-blob columns that are not in WHERE clause but in PKE are in BI
477
+ # 6 blob columns that are used in WHERE clause but not in PKE are not
432
478
# in BI
433
- # 9 blob columns that are NOT NULL UK but not in PK are not in BI
434
- # 10 on slave, blob columns that are in master's BI but not in slave's PKE
479
+ # 7 blob columns that are NOT NULL UK but not in PK are not in BI
480
+ # 8 on slave, blob columns that are in master's BI but not in slave's PKE
435
481
# are not in slave's BI
436
482
437
483
-- connection master
@@ -454,23 +500,21 @@ while (`SELECT HEX(@img_types) != HEX('')`)
454
500
-- connection master
455
501
-- let $row_img_query= UPDATE t SET c2='aaa', c3=1000, c5=10000 WHERE c1=1 AND c4='bbb'
456
502
# asserts that:
457
- # 2. non-blob columns that are set to default value are in AI
458
- # 3. blob columns that are set to default value are in AI
459
- # 4. blob columns that are in WHERE clause but not in PKE are not in BI
460
- # 5. blob columns that are in NON-NULL UK but not in PK are not in BI
461
- # 6. on slave, blob columns that are in master's BI clause but not in
503
+ # 2. blob columns that are in WHERE clause but not in PKE are not in BI
504
+ # 3. blob columns that are in NON-NULL UK but not in PK are not in BI
505
+ # 4. on slave, blob columns that are in master's BI clause but not in
462
506
# slave's PKE are not in BI
463
- -- let $row_img_expected_master= 1:1 2:'aaa' 3:1000 5:1 | 1:1 2:'aaa' 3:1000 5:10000
464
- -- let $row_img_expected_slave = 1:1 3:1000 5:1 | 1:1 2:'aaa' 3:1000 5:10000
507
+ -- let $row_img_expected_master= 1:1 2:'aaa' 3:1000 5:1 | 1:1 3:1000 5:10000
508
+ -- let $row_img_expected_slave = 1:1 3:1000 5:1 | 1:1 3:1000 5:10000
465
509
-- source include/rpl_row_img_parts_master_slave.inc
466
510
467
511
-- connection master
468
512
-- let $row_img_query= DELETE FROM t WHERE c1=1 AND c4='bbb'
469
513
# asserts that:
470
- # 7 . non-blob columns that are not in WHERE clause but in PKE are in BI
471
- # 8 . blob columns that are used in WHERE clause but not in PKE are not n BI
472
- # 9 . blob columns that are NOT NULL UK but not in PK are not in BI
473
- # 10 . on slave, blob columns that are in master's BI but not in slave's PKE are not in slave's BI
514
+ # 5 . non-blob columns that are not in WHERE clause but in PKE are in BI
515
+ # 6 . blob columns that are used in WHERE clause but not in PKE are not n BI
516
+ # 7 . blob columns that are NOT NULL UK but not in PK are not in BI
517
+ # 8 . on slave, blob columns that are in master's BI but not in slave's PKE are not in slave's BI
474
518
-- let $row_img_expected_master= 1:1 2:'aaa' 3:1000 5:10000 |
475
519
-- let $row_img_expected_slave = 1:1 3:1000 5:10000 |
476
520
-- source include/rpl_row_img_parts_master_slave.inc
0 commit comments