1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix for the patch for bug#21726: Incorrect result with multiple

invocations of LAST_INSERT_ID.

Reding of LAST_INSERT_ID inside stored function wasn't noted by caller,
and no LAST_INSERT_ID_EVENT was issued for binary log.

The solution is to add THD::last_insert_id_used_bin_log, which is much
like THD::last_insert_id_used, but is reset only for upper-level
statements.  This new variable is used to issue LAST_INSERT_ID_EVENT.
This commit is contained in:
kroki/tomash@moonlight.intranet
2006-10-03 13:38:16 +04:00
parent 5ea8adfae7
commit 8798b462b5
9 changed files with 61 additions and 12 deletions

View File

@ -8154,11 +8154,11 @@ remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
21))))
{
/*
Set THD::last_insert_id_used manually, as this statement
uses LAST_INSERT_ID() in a sense, and should issue
LAST_INSERT_ID_EVENT.
Set THD::last_insert_id_used_bin_log manually, as this
statement uses LAST_INSERT_ID() in a sense, and should
issue LAST_INSERT_ID_EVENT.
*/
thd->last_insert_id_used= TRUE;
thd->last_insert_id_used_bin_log= TRUE;
cond=new_cond;
/*