mirror of
https://github.com/MariaDB/server.git
synced 2026-03-15 21:08:40 +01:00
This affects row-based replication for UPDATE/DELETE on tables with no
primary key (and no non-NULL unique index).
There was a typo / incorrect merge from the following commit:
commit 3abce27e9d
Author: unknown <knielsen@knielsen-hq.org>
Date: Mon Dec 27 22:37:37 2010 +0100
Merge Percona patch row_based_replication_without_primary_key.patch into MariaDB.
Instead of referencing the index selected for applying the event, part
of the code was referencing the first index (in internal order) in the
table. This is code that checks if an index lookup is unique, or if it
requires a range scan. This could lead the code to incorrectly do a
unique lookup instead of comparing the pre-image against each row in a
range scan, thus applying the event to the wrong row and causing
replication to diverge.
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
20 lines
555 B
Text
20 lines
555 B
Text
include/master-slave.inc
|
|
[connection master]
|
|
CREATE TABLE t (a int, b int, c int, d int, KEY (d)) ENGINE=InnoDB;
|
|
INSERT INTO t (a,b,d) VALUES
|
|
(1,NULL,4),(2,NULL,1),(3,NULL,1),
|
|
(4,NULL,1),(5,NULL,1),(6,NULL,1),
|
|
(7,0,NULL),(8,NULL,NULL);
|
|
ALTER TABLE t ADD UNIQUE (b);
|
|
connection slave;
|
|
ANALYZE TABLE t;
|
|
Table Op Msg_type Msg_text
|
|
test.t analyze status Engine-independent statistics collected
|
|
test.t analyze status OK
|
|
connection master;
|
|
UPDATE t SET c = 1;
|
|
ALTER TABLE t ADD UNIQUE (a);
|
|
connection slave;
|
|
connection master;
|
|
DROP TABLE t;
|
|
include/rpl_end.inc
|