1
0
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:
Narayanan V
2008-09-16 18:37:59 +05:30
parent a7bc87b39c
commit 83ef8f3427
3 changed files with 30 additions and 1 deletions

View File

@@ -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;