summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorKristian Nielsen <knielsen@knielsen-hq.org>2015-04-13 09:52:56 +0200
committerKristian Nielsen <knielsen@knielsen-hq.org>2015-04-13 14:24:18 +0200
commit60d094aeacb0c1433f2510e0228b2791745ae53e (patch)
treeb039a966eadd8788c497d32bd65e7e2228812d11 /sql/sql_base.h
parentc47fe0e9db7f3f111618a6a6e488aaf8257b231a (diff)
downloadmariadb-git-60d094aeacb0c1433f2510e0228b2791745ae53e.tar.gz
MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode
Make sure that in parallel replication, we execute wait_for_prior_commit() before setting table->in_use for a temporary table. Otherwise we can end up with two parallel replication worker threads competing with each other for use of a temporary table. Re-factor the use of find_temporary_table() to be able to handle errors in the caller (as wait_for_prior_commit() can return error in case of deadlock kill).
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 8a0a1e42500..a6d90199860 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -148,7 +148,11 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
const char *db_name,
const char *table_name);
TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name);
+bool find_and_use_temporary_table(THD *thd, const char *db,
+ const char *table_name, TABLE **out_table);
TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl);
+bool find_and_use_temporary_table(THD *thd, const TABLE_LIST *tl,
+ TABLE **out_table);
TABLE *find_temporary_table(THD *thd, const char *table_key,
uint table_key_length);
void close_thread_tables(THD *thd);