Commit b02b79a
Sujatha Sivakumar
Bug#17588419: INSERT ON DUPLICATE KEY UPDATE FAILING AFTER
MYSQL 5.6 UPGRADE.
Problem:
========
After upgrading a MySQL 5.5.23 slave to 5.6.14 (the master
still runs 5.5.23) on executing INSERT ON DUPLICATE KEY
following error is reported in SBR.
[ERROR] Slave SQL: Error 'Auto-increment value in UPDATE
conflicts with internally generated values' on query.
Analysis:
========
On master when user specifies an autoincrement value in
multi insert statement the user given value is compared with
current auto increment value and current + number of rows
affected value. Whenever the user specified value falls
within the given range ER_AUTO_INCREMENT_CONFLICT error is
generated.
On the slave the range is set to the value ULONGULONG_MAX
by default. Whenever user specifies any value it will
always fall within the above range and error gets generated.
On slave each DML operation will result in n number of rows
being manipulated. When number of manipulated rows is known
the value range can be reset to currect value to current+n.
Fix:
===
On slave identify the number of rows being manipulated.
Reset the value ranage from currnet value to current
value + number of maninupated rows. If the number is not
known go ahead with default values.1 parent 670a876 commit b02b79a
3 files changed
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
3216 | 3216 | | |
3217 | 3217 | | |
3218 | 3218 | | |
3219 | | - | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
3220 | 3227 | | |
3221 | 3228 | | |
3222 | 3229 | | |
| |||
0 commit comments