mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Bug#38692 concurrent inserts cause valgrind errors in Query_cache::invalidate
If a delayed insert thread was aborted by a concurrent 'truncate table' statement, then the diagnostic area would fail with an assert in a debug build because no actual error message was pushed on the stack despite a thread being killed. This patch adds an error message to the stack. sql/sql_insert.cc: * Changed sql_print_error() to my_error() to avoid assertion in the DA * Added assertion in "should never happen" branch.
This commit is contained in:
@@ -2532,8 +2532,13 @@ bool Delayed_insert::handle_inserts(void)
|
|||||||
thd_proc_info(&thd, "upgrading lock");
|
thd_proc_info(&thd, "upgrading lock");
|
||||||
if (thr_upgrade_write_delay_lock(*thd.lock->locks))
|
if (thr_upgrade_write_delay_lock(*thd.lock->locks))
|
||||||
{
|
{
|
||||||
/* This can only happen if thread is killed by shutdown */
|
/*
|
||||||
sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->s->table_name.str);
|
This can happen if thread is killed either by a shutdown
|
||||||
|
or if another thread is removing the current table definition
|
||||||
|
from the table cache.
|
||||||
|
*/
|
||||||
|
my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
|
||||||
|
table->s->table_name.str);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2688,9 +2693,10 @@ bool Delayed_insert::handle_inserts(void)
|
|||||||
query_cache_invalidate3(&thd, table, 1);
|
query_cache_invalidate3(&thd, table, 1);
|
||||||
if (thr_reschedule_write_lock(*thd.lock->locks))
|
if (thr_reschedule_write_lock(*thd.lock->locks))
|
||||||
{
|
{
|
||||||
/* This should never happen */
|
/* This is not known to happen. */
|
||||||
sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),
|
my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR),
|
||||||
table->s->table_name.str);
|
table->s->table_name.str);
|
||||||
|
goto err;
|
||||||
}
|
}
|
||||||
if (!using_bin_log)
|
if (!using_bin_log)
|
||||||
table->file->extra(HA_EXTRA_WRITE_CACHE);
|
table->file->extra(HA_EXTRA_WRITE_CACHE);
|
||||||
|
Reference in New Issue
Block a user