diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-12-09 15:09:41 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-12-09 15:09:41 +0100 |
commit | a15234bf4bf98d7833996284c033fc53a981f5d4 (patch) | |
tree | d989b448854f9d59de5ca16b962414591c8a5b2e /sql/sql_sequence.cc | |
parent | 9a6212008999da44b136605c1abf2cc9c7cc4b2c (diff) | |
parent | e5e5877740f248de848219ee3a1d2881cd5c5b82 (diff) | |
download | mariadb-git-a15234bf4bf98d7833996284c033fc53a981f5d4.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_sequence.cc')
-rw-r--r-- | sql/sql_sequence.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 4e8624d6360..035fb1211e6 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -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); |