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.

27 lines
1.5 KiB

  1. --- r/rpl_iodku.result
  2. +++ r/rpl_iodku,stmt.reject
  3. @@ -1,10 +1,15 @@
  4. include/master-slave.inc
  5. [connection master]
  6. +call mtr.add_suppression("Unsafe statement written to the binary log using statement");
  7. CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, a INT, b INT, c INT,
  8. UNIQUE (a), UNIQUE (b)) ENGINE=innodb;
  9. INSERT INTO t1 (`a`,`c`) VALUES (1,1), (2,1) ON DUPLICATE KEY UPDATE c = 1;
  10. +Warnings:
  11. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
  12. # UNSAFE
  13. INSERT INTO t1 (`a`,`c`) VALUES (3, 1),(2,1), (1,1) ON DUPLICATE KEY UPDATE c = a * 10 + VALUES(c);
  14. +Warnings:
  15. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
  16. SELECT * from t1;
  17. id a b c
  18. 1 1 NULL 11
  19. @@ -17,6 +22,8 @@
  20. INSERT INTO t1 VALUES (1,10,1);
  21. # eligable for the statement format run unsafe warning
  22. INSERT INTO t1 VALUES (2,20,2) ON DUPLICATE KEY UPDATE c = 100;
  23. +Warnings:
  24. +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
  25. # not eligable: no warning in the statement format run
  26. INSERT INTO t1 (`a`,`c`) VALUES (3, 1) ON DUPLICATE KEY UPDATE c = 99;
  27. SELECT * from t1;