1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00

Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were

inserted.

The select_insert::send_eof() function now resets LAST_INSERT_ID variable if
no rows were inserted.
This commit is contained in:
evgen@moonbone.local
2007-02-09 22:25:09 +03:00
parent a119169bf0
commit 380c220545
3 changed files with 28 additions and 1 deletions

View File

@@ -717,3 +717,17 @@ select * from t1;
f1 f2
1 2
drop table t1;
create table t1(f1 int primary key auto_increment, f2 int unique);
insert into t1(f2) values(1);
select @@identity;
@@identity
1
insert ignore t1(f2) values(1);
select @@identity;
@@identity
0
insert ignore t1(f2) select 1;
select @@identity;
@@identity
0
drop table t1;