diff options
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f4d9272eca1..41f02fbed92 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. - Copyright (c) 2010, 2020, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4286,8 +4286,17 @@ bool open_tables(THD *thd, const DDL_options_st &options, DBUG_ENTER("open_tables"); /* Data access in XA transaction is only allowed when it is active. */ - if (*start && thd->transaction.xid_state.check_has_uncommitted_xa()) - DBUG_RETURN(true); + for (TABLE_LIST *table= *start; table; table= table->next_global) + if (!table->schema_table) + { + if (thd->transaction.xid_state.check_has_uncommitted_xa()) + { + thd->transaction.xid_state.er_xaer_rmfail(); + DBUG_RETURN(true); + } + else + break; + } thd->current_tablenr= 0; restart: |