summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2019-06-25 10:53:33 +0300
committerAleksey Midenkov <midenok@gmail.com>2019-07-07 23:11:20 +0300
commit08baaa14b9075f61a043de4443cbecd36117cd12 (patch)
treeb4319f631ea19b91dbcb396be8b44e1dbd9beb01 /sql
parentb27dc3d93ce298ae49611fe76aff54bd5556b536 (diff)
downloadmariadb-git-08baaa14b9075f61a043de4443cbecd36117cd12.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 'sql')
-rw-r--r--sql/sql_class.cc5
-rw-r--r--sql/sql_table.cc5
-rw-r--r--sql/table.cc1
3 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 326b8a3f16a..0f24604aa5e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4848,6 +4848,11 @@ unsigned long long thd_get_query_id(const MYSQL_THD thd)
return((unsigned long long)thd->query_id);
}
+void thd_clear_error(MYSQL_THD thd)
+{
+ thd->clear_error();
+}
+
extern "C" const struct charset_info_st *thd_charset(MYSQL_THD thd)
{
return(thd->charset());
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8a2d22b79c5..e147c5247fb 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2108,6 +2108,11 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, bool if_exists,
}
}
+ DBUG_EXECUTE_IF("ib_purge_virtual_mdev_16222_1",
+ DBUG_ASSERT(!debug_sync_set_action(
+ thd,
+ STRING_WITH_LEN("now SIGNAL drop_started"))););
+
/* mark for close and remove all cached entries */
thd->push_internal_handler(&err_handler);
error= mysql_rm_table_no_locks(thd, tables, if_exists, drop_temporary,
diff --git a/sql/table.cc b/sql/table.cc
index 34e7c23b2df..d65b4c7af08 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -8232,6 +8232,7 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
int TABLE::update_virtual_field(Field *vf)
{
+ DBUG_ASSERT(!in_use->is_error());
Query_arena backup_arena;
DBUG_ENTER("TABLE::update_virtual_field");
in_use->set_n_backup_active_arena(expr_arena, &backup_arena);