mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +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:
@@ -5651,6 +5651,7 @@ void mysql_reset_thd_for_next_command(THD *thd)
|
||||
thd->free_list= 0;
|
||||
thd->select_number= 1;
|
||||
thd->query_start_used= thd->insert_id_used=0;
|
||||
thd->last_insert_id_used_bin_log= FALSE;
|
||||
thd->is_fatal_error= thd->time_zone_used= 0;
|
||||
thd->server_status&= ~ (SERVER_MORE_RESULTS_EXISTS |
|
||||
SERVER_QUERY_NO_INDEX_USED |
|
||||
|
Reference in New Issue
Block a user