Skip to content

Commit

Permalink
MDEV-10219 rpl.rpl_parallel_temptable failed in buildbot: Assertion `…
Browse files Browse the repository at this point in the history
…!table || !table->in_use || table->in_use == _current_thd()' failed

Problem was that table->in_use was not properly set when dropping a temporary for the slave.
  • Loading branch information
montywi committed Jun 22, 2016
1 parent 838205f commit ec38c7e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions sql/temporary_tables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ bool THD::drop_temporary_table(TABLE *table,
*/
while ((tab= share->all_tmp_tables.pop_front()))
{
/*
We need to set the THD as it may be different in case of
parallel replication
*/
tab->in_use= this;

free_temporary_table(tab);
}

Expand Down Expand Up @@ -1188,6 +1194,8 @@ bool THD::use_temporary_table(TABLE *table, TABLE **out_table)
DBUG_ENTER("THD::use_temporary_table");

*out_table= table;

/* The following can happen if find_temporary_table() returns NULL */
if (!table)
DBUG_RETURN(false);

Expand Down Expand Up @@ -1215,10 +1223,7 @@ bool THD::use_temporary_table(TABLE *table, TABLE **out_table)
We need to set the THD as it may be different in case of
parallel replication
*/
if (table->in_use != this)
{
table->in_use= this;
}
table->in_use= this;

DBUG_RETURN(false);
}
Expand Down

0 comments on commit ec38c7e

Please sign in to comment.