mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed BUG#3117: LAST_INSERT_ID() works incorrectly inside stored procedure.
This turned out to be a problem for prepared statements as well; the id was evaluated once, at parse time. mysql-test/r/auto_increment.result: Updated results after bugfix in last_insert_id(). mysql-test/r/query_cache.result: Updated results after bugfix in last_insert_id(). mysql-test/r/variables.result: Updated results after bugfix in last_insert_id(). sql/item_func.cc: Fixed bug in last_insert_id(); get id at each evaluation (and not in the parser). Renamed the class Item_func_set_last_insert_id too, since it's not only for setting. sql/item_func.h: Fixed bug in last_insert_id(); get id at each evaluation (and not in the parser). Renamed the class Item_func_set_last_insert_id too, since it's not only for setting. sql/sql_yacc.yy: Fixed bug in last_insert_id(); get id at each evaluation (and not in the parser). Renamed the class Item_func_set_last_insert_id too, since it's not only for setting. tests/client_test.c: Test case for last_insert_id() in prepared statements.
This commit is contained in:
@ -93,7 +93,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,345 AS `last_insert_id()`,345 AS `@@identity`
|
||||
Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity`
|
||||
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
|
||||
set global concurrent_insert=ON;
|
||||
show variables like 'concurrent_insert';
|
||||
|
Reference in New Issue
Block a user