mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
A fix and a test case for Bug#12713 "Error in a stored function called from
a SELECT doesn't cause ROLLBACK of statem". The idea of the fix is to ensure that we always commit the current statement at the end of dispatch_command(). In order to not issue redundant disc syncs, an optimization of the two-phase commit protocol is implemented to bypass the two phase commit if the transaction is read-only.
This commit is contained in:
@ -322,9 +322,10 @@ Sensitive_cursor::post_open(THD *thd)
|
||||
|
||||
close_at_commit= FALSE; /* reset in case we're reusing the cursor */
|
||||
info= &ht_info[0];
|
||||
for (handlerton **pht= thd->transaction.stmt.ht; *pht; pht++)
|
||||
for (Ha_trx_info *ha_trx_info= thd->transaction.stmt.ha_list;
|
||||
ha_trx_info; ha_trx_info= ha_trx_info->next())
|
||||
{
|
||||
handlerton *ht= *pht;
|
||||
handlerton *ht= ha_trx_info->ht();
|
||||
close_at_commit|= test(ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT);
|
||||
if (ht->create_cursor_read_view)
|
||||
{
|
||||
|
Reference in New Issue
Block a user