mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
724dbaabc0
when restoring auto-inc value in INSERT ... ON DUPLICATE KEY UPDATE, take into account that 1. it may be changed in the UPDATE clause (old code did that) 2. it may be changed in the INSERT clause and then cause a dup key (old code missed that)
9 lines
225 B
Text
9 lines
225 B
Text
create table t1 (a int(10) auto_increment primary key, b int(11));
|
|
insert t1 values (null,1);
|
|
insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b);
|
|
select * from t1;
|
|
a b
|
|
1 -1
|
|
2 2
|
|
3 3
|
|
drop table t1;
|