summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-06-25 10:53:33 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-07-08 20:14:51 +0300
commit53dd0e4f75d39972d51cbecb77d82520a3986f3e (patch)
tree404c9ccc28827713f691fbe4e6acf0a8e3689c71 /storage
parent0fe212a8805661053446c5b7d8a189ac439dc120 (diff)
downloadmariadb-git-53dd0e4f75d39972d51cbecb77d82520a3986f3e.tar.gz
MDEV-16222 Assertion `0' failed in row_purge_remove_sec_if_poss_leaf on table with virtual columns and indexes
Cause Stale thd->m_stmt_da->m_sql_errno which is from different invocation. Fix Reset error state before attempt to open table.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index c29ec97f3d4..7b4c06b6554 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -119,6 +119,8 @@ this program; if not, write to the Free Software Foundation, Inc.,
extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
unsigned long long thd_get_query_id(const MYSQL_THD thd);
+void thd_clear_error(MYSQL_THD thd);
+
TABLE *find_fk_open_table(THD *thd, const char *db, size_t db_len,
const char *table, size_t table_len);
MYSQL_THD create_thd();
@@ -21493,6 +21495,8 @@ static TABLE* innodb_acquire_mdl(THD* thd, dict_table_t* table)
return NULL;
}
+ DEBUG_SYNC(thd, "ib_purge_virtual_latch_released");
+
const table_id_t table_id = table->id;
retry_mdl:
const bool unaccessible = !table->is_readable() || table->corrupted;
@@ -21504,6 +21508,10 @@ retry_mdl:
TABLE* mariadb_table = open_purge_table(thd, db_buf, db_buf_len,
tbl_buf, tbl_buf_len);
+ if (!mariadb_table)
+ thd_clear_error(thd);
+
+ DEBUG_SYNC(thd, "ib_purge_virtual_got_no_such_table");
table = dict_table_open_on_id(table_id, false, DICT_TABLE_OP_NORMAL);
@@ -21553,6 +21561,20 @@ fail:
for purge thread */
static TABLE* innodb_find_table_for_vc(THD* thd, dict_table_t* table)
{
+ DBUG_EXECUTE_IF(
+ "ib_purge_virtual_mdev_16222_1",
+ DBUG_ASSERT(!debug_sync_set_action(
+ thd,
+ STRING_WITH_LEN("ib_purge_virtual_latch_released "
+ "SIGNAL latch_released "
+ "WAIT_FOR drop_started"))););
+ DBUG_EXECUTE_IF(
+ "ib_purge_virtual_mdev_16222_2",
+ DBUG_ASSERT(!debug_sync_set_action(
+ thd,
+ STRING_WITH_LEN("ib_purge_virtual_got_no_such_table "
+ "SIGNAL got_no_such_table"))););
+
if (THDVAR(thd, background_thread)) {
/* Purge thread acquires dict_operation_lock while
processing undo log record. Release the dict_operation_lock
@@ -21888,6 +21910,7 @@ innobase_get_computed_value(
dbug_tmp_restore_column_map(mysql_table->write_set, old_write_set);
if (ret != 0) {
+ // FIXME: Why this error message is macro-hidden?
#ifdef INNODB_VIRTUAL_DEBUG
ib::warn() << "Compute virtual column values failed ";
fputs("InnoDB: Cannot compute value for following record ",