1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for bug #6880: LAST_INSERT_ID() within a statement

This commit is contained in:
ramil@mysql.com
2006-06-07 14:01:10 +05:00
parent cb4c6a0ded
commit 0bdae38efb
5 changed files with 74 additions and 3 deletions

View File

@@ -238,4 +238,21 @@ SHOW CREATE TABLE `t1`;
DROP TABLE `t1`;
#
# Bug #6880: LAST_INSERT_ID() within a statement
#
create table t1(a int not null auto_increment primary key);
create table t2(a int not null auto_increment primary key, t1a int);
insert into t1 values(NULL);
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
insert into t1 values (NULL);
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID());
insert into t1 values (NULL);
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
select * from t2;
drop table t1, t2;
--echo End of 4.1 tests