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

MDEV-15977 Assertion !thd->in_sub_stmt failed in trans_commit_stmt

This commit is contained in:
Robert Bindar
2019-04-16 17:52:31 +03:00
parent 7e917bba5d
commit 8d2a57b4b7
3 changed files with 184 additions and 2 deletions

View File

@ -487,9 +487,12 @@ int SEQUENCE::read_initial_values(TABLE *table)
Doing mysql_lock_tables() may have started a read only transaction.
If that happend, it's better that we commit it now, as a lot of
code assumes that there is no active stmt transaction directly after
open_tables()
open_tables().
But we also don't want to commit the stmt transaction while in a
substatement, see MDEV-15977.
*/
if (!has_active_transaction && !thd->transaction.stmt.is_empty())
if (!has_active_transaction && !thd->transaction.stmt.is_empty() &&
!thd->in_sub_stmt)
trans_commit_stmt(thd);
}
write_unlock(table);