mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#38338: REPLACE causes last_insert_id() to return an incorrect value
Fix the write_record function to record auto increment values in a consistent way.
This commit is contained in:
@@ -454,3 +454,11 @@ select last_insert_id();
|
||||
last_insert_id()
|
||||
3
|
||||
drop table t1;
|
||||
create table t1 (a int primary key auto_increment, b int, c int, e int, d timestamp default current_timestamp, unique(b),unique(c),unique(e));
|
||||
insert into t1 values(null,1,1,1,now());
|
||||
insert into t1 values(null,0,0,0,null);
|
||||
replace into t1 values(null,1,0,2,null);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
3
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user