Skip to content

Commit

Permalink
Fixed crash in Delayed_insert::get_local_table()
Browse files Browse the repository at this point in the history
This was a bug in my previous commit, found by buildbot
  • Loading branch information
montywi committed Nov 28, 2023
1 parent 7081fee commit acdb8b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sql/sql_insert.cc
Expand Up @@ -2586,7 +2586,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
}
THD_STAGE_INFO(client_thd, stage_got_handler_lock);
if (client_thd->killed)
goto error;
goto error2;
if (thd.killed)
{
/*
Expand All @@ -2611,7 +2611,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
my_message(thd.get_stmt_da()->sql_errno(),
thd.get_stmt_da()->message(), MYF(0));
}
goto error;
goto error2;
}
}
share= table->s;
Expand All @@ -2629,7 +2629,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
share->reclength +
share->column_bitmap_size*4);
if (!copy_tmp)
goto error;
goto error2;

/* Copy the TABLE object. */
copy= new (copy_tmp) TABLE;
Expand Down Expand Up @@ -2739,6 +2739,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
/* Got fatal error */
error:
free_root(&copy->mem_root, 0);
error2:
tables_in_use--;
mysql_cond_signal(&cond); // Inform thread about abort
DBUG_RETURN(0);
Expand Down

0 comments on commit acdb8b6

Please sign in to comment.