Skip to content

Commit

Permalink
MDEV-9290 : InnoDB: Assertion failure in file trx0sys.cc line 353
Browse files Browse the repository at this point in the history
Addendum: Save thd's server_status & option_bits before
setting the thread specific pointer.
  • Loading branch information
Nirbhay Choubey committed Dec 22, 2015
1 parent 3f515a0 commit 70113ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4611,18 +4611,18 @@ a file name for --log-bin-index option", opt_binlog_index_name);
if (tmp->wsrep_applier == true)
{
/*
Set THR_THD to temporally point to this THD to register all the
variables that allocates memory for this THD.
Save/restore server_status and variables.option_bits and they get
altered during init_for_queries().
*/
THD *current_thd_saved= current_thd;
my_pthread_setspecific_ptr(THR_THD, tmp);
unsigned int server_status_saved= tmp->server_status;
ulonglong option_bits_saved= tmp->variables.option_bits;

/*
Also save/restore server_status and variables.option_bits and they
get altered during init_for_queries().
Set THR_THD to temporarily point to this THD to register all the
variables that allocates memory for this THD.
*/
unsigned int server_status_saved= tmp->server_status;
ulonglong option_bits_saved= tmp->variables.option_bits;
THD *current_thd_saved= current_thd;
my_pthread_setspecific_ptr(THR_THD, tmp);

tmp->init_for_queries();

Expand Down

0 comments on commit 70113ee

Please sign in to comment.