mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-17614: After-merge fix
MDEV-17614 flags INSERT…ON DUPLICATE KEY UPDATE unsafe for statement-based
replication when there are multiple unique indexes. This correctly fixes
something whose attempted fix in MySQL 5.7
in mysql/mysql-server@c93b0d9a97
caused lock conflicts. That change was reverted in MySQL 5.7.26
in mysql/mysql-server@066b6fdd43
(with a substantial amount of other changes).
In MDEV-17073 we already disabled the unfortunate MySQL change when
statement-based replication was not being used. Now, thanks to MDEV-17614,
we can actually remove the change altogether.
This reverts commit 8a346f31b9 (MDEV-17073)
and mysql/mysql-server@c93b0d9a97 while
keeping the test cases.
This commit is contained in:
@@ -89,13 +89,14 @@ affected rows: 0
|
||||
SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue';
|
||||
affected rows: 0
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
connection con1;
|
||||
#
|
||||
# 2 duplicates
|
||||
#
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
affected rows: 4
|
||||
info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
connection default;
|
||||
#
|
||||
# 3 rows
|
||||
@@ -103,19 +104,21 @@ connection default;
|
||||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
2 2 NULL
|
||||
3 3 NULL
|
||||
affected rows: 3
|
||||
4 2 1
|
||||
2 3 NULL
|
||||
5 4 NULL
|
||||
6 5 NULL
|
||||
affected rows: 5
|
||||
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
|
||||
affected rows: 4
|
||||
info: Records: 3 Duplicates: 1 Warnings: 0
|
||||
affected rows: 6
|
||||
info: Records: 3 Duplicates: 3 Warnings: 0
|
||||
SELECT * FROM t1 order by k;
|
||||
id k c
|
||||
1 1 NULL
|
||||
2 2 2
|
||||
3 3 NULL
|
||||
7 4 NULL
|
||||
8 5 NULL
|
||||
4 2 2
|
||||
2 3 NULL
|
||||
5 4 2
|
||||
6 5 2
|
||||
affected rows: 5
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
|
||||
Reference in New Issue
Block a user