diff options
author | unknown <kroki@mysql.com> | 2006-04-21 18:55:04 +0400 |
---|---|---|
committer | unknown <kroki@mysql.com> | 2006-04-21 18:55:04 +0400 |
commit | 10eac46a520351d47ffbe74aeb14fdd7c6fecd87 (patch) | |
tree | 0da88cad11642a830d2c72dc4d8fd0e6a04eec4a /mysql-test/r/sp.result | |
parent | 90ecf9b698908ce58fd8aae2651f75079d9bf33f (diff) | |
download | mariadb-git-10eac46a520351d47ffbe74aeb14fdd7c6fecd87.tar.gz |
Bug#15728: LAST_INSERT_ID function inside a stored function returns 0
Do not reset value of LAST_INSERT_ID() in sub-statement.
mysql-test/r/rpl_insert_id.result:
Add result for bug#15728.
mysql-test/r/sp.result:
Add result for bug#15728.
mysql-test/t/rpl_insert_id.test:
Add test case for bug#15728.
mysql-test/t/sp.test:
Add test case for bug#15728.
sql/sql_class.cc:
Do not reset value of LAST_INSERT_ID() in sub-statement.
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r-- | mysql-test/r/sp.result | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 2787f0d5991..59ce1d13d2b 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -4848,6 +4848,23 @@ c 2 b 3 a 1 delete from t1| +drop function if exists bug15728| +drop table if exists t3| +create table t3 ( +id int not null auto_increment, +primary key (id) +)| +create function bug15728() returns int(11) +return last_insert_id()| +insert into t3 values (0)| +select last_insert_id()| +last_insert_id() +1 +select bug15728()| +bug15728() +1 +drop function bug15728| +drop table t3| drop procedure if exists bug18787| create procedure bug18787() begin |