diff options
author | Luis Soares <luis.soares@sun.com> | 2010-06-02 23:26:12 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-06-02 23:26:12 +0100 |
commit | 1b27674429a5c6f639eeff07ce952de3703d2f10 (patch) | |
tree | 359a52e14c2e9c26a2211aa08ee2e0f73ced3015 /plugin | |
parent | 37b02cd7d99278aec20e793c79ed105e99b2f7e7 (diff) | |
download | mariadb-git-1b27674429a5c6f639eeff07ce952de3703d2f10.tar.gz |
BUG#53893: RBR: nullable unique key can lead to out-of-sync slave
When using Unique Keys with nullable parts in RBR, the slave can
choose the wrong row to update. This happens because a table with
an unique key containing nullable parts cannot strictly guarantee
uniqueness. As stated in the manual, for all engines, a UNIQUE
index allows multiple NULL values for columns that can contain
NULL.
We fix this at the slave by extending the checks before assuming
that the row found through an unique index is is the correct
one. This means that when a record (R) is fetched from the storage
engine and a key that is not primary (K) is used, the server does
the following:
- If K is unique and has no nullable parts, it returns R;
- Otherwise, if any field in the before image that is part of K
is null do an index scan;
- If there is no NULL field in the BI part of K, then return R.
A side change: renamed the existing test case file and added a
test case covering the changes in this patch.
Diffstat (limited to 'plugin')
0 files changed, 0 insertions, 0 deletions