1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
Files
mariadb/sql
kroki/tomash@moonlight.intranet 5ea8adfae7 BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID
Non-upper-level INSERTs (the ones in the body of stored procedure,
stored function, or trigger) into a table that have AUTO_INCREMENT
column didn't affected the result of LAST_INSERT_ID() on this level.

The problem was introduced with the fix of bug 6880, which in turn was
introduced with the fix of bug 3117, where current insert_id value was
remembered on the first call to LAST_INSERT_ID() (bug 3117) and was
returned from that function until it was reset before the next
_upper-level_ statement (bug 6880).

The fix for bug#21726 brings back the behaviour of version 4.0, and
implements the following: remember insert_id value at the beginning
of the statement or expression (which at that point equals to
the first insert_id value generated by the previous statement), and
return that remembered value from LAST_INSERT_ID() or @@LAST_INSERT_ID.

Thus, the value returned by LAST_INSERT_ID() is not affected by values
generated by current statement, nor by LAST_INSERT_ID(expr) calls in
this statement.

Version 5.1 does not have this bug (it was fixed by WL 3146).
2006-10-02 14:28:23 +04:00
..
2006-08-30 13:20:39 -07:00
2006-08-30 13:20:39 -07:00
2006-08-30 13:20:39 -07:00
2006-04-13 17:22:56 +09:30
2006-09-12 18:25:35 +05:00
2006-08-30 13:20:39 -07:00
2006-05-30 17:10:53 -07:00
2006-09-18 12:14:27 +02:00
2006-08-24 20:56:28 +04:00
2006-06-17 02:11:12 +04:00
2006-04-04 17:54:58 -07:00
2006-09-01 10:32:12 +02:00
2006-09-18 12:14:27 +02:00
2006-07-08 04:07:43 +04:00
2006-08-23 15:46:57 -06:00
2006-09-27 19:21:29 +05:00
2006-09-27 19:21:29 +05:00
2006-09-27 19:21:29 +05:00
2006-06-27 00:47:52 +04:00
2006-09-27 19:21:29 +05:00
2006-09-25 06:15:14 -07:00
2006-08-21 16:21:48 +04:00
2006-09-27 19:21:29 +05:00
2006-05-03 21:35:27 -07:00
2006-04-21 08:19:38 -07:00
2006-06-14 23:54:08 +04:00
2006-06-27 00:47:52 +04:00