You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

  1. #
  2. # Tests of innodb/binlog with the row binlog format
  3. #
  4. source include/have_innodb.inc;
  5. source include/have_log_bin.inc;
  6. source include/have_binlog_format_row.inc;
  7. #
  8. # Bug #40221 Replication failure on RBR + UPDATE the primary key
  9. #
  10. CREATE TABLE t1 (i int unique) ENGINE=innodb;
  11. reset master;
  12. # part 1: update can cause the dup key
  13. begin;
  14. insert into t1 values (1),(2);
  15. --echo *** the following UPDATE query wont generate any updates for the binlog ***
  16. --error ER_DUP_ENTRY
  17. update t1 set i = 3 where i < 3;
  18. commit;
  19. --echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows ***
  20. source include/show_binlog_events.inc;
  21. # part 2: insert can cause the dup key
  22. delete from t1;
  23. reset master;
  24. begin;
  25. insert into t1 values (1),(2);
  26. --echo *** the following UPDATE query wont generate any updates for the binlog ***
  27. --error ER_DUP_ENTRY
  28. insert into t1 values (3),(4),(1),(2);
  29. commit;
  30. --echo *** Results of the test: the binlog must have only one Write_rows event not two ***
  31. source include/show_binlog_events.inc;
  32. drop table t1;