summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2015-01-29 15:12:32 +0200
committerMichael Widenius <monty@askmonty.org>2015-01-29 15:12:32 +0200
commitb83f6925659c9966340cdca4a55d9ae87b949733 (patch)
tree1ada44550d320b0483086acdc5945bee4c0b7d63 /sql/table.cc
parentfb71449b10100e9a0f887b1585000fbfab294f3c (diff)
downloadmariadb-git-b83f6925659c9966340cdca4a55d9ae87b949733.tar.gz
MDEV-6668: Server crashes in check_view_single_update on concurrent DDL/DML flow with views and triggers
Call mysql_derived_reinit() if we are reusing view. This is needed as during a previous error condition the view may not have been reset sql/sql_derived.cc: More DBUG_PRINT Always reset merged_for_insert (no reason to not do that) sql/sql_derived.h: Added prototype sql/sql_insert.cc: More DBUG_PRINT Added DBUG_ASSERT sql/sql_view.cc: Call mysql_derived_reinit() if we are reusing view. This is needed as during a previous error condition the view may not have been reset sql/table.cc: More DBUG_PRINT
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 321c2a96b4f..e48d8e274cc 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -4728,23 +4728,26 @@ bool TABLE_LIST::check_single_table(TABLE_LIST **table_arg,
bool TABLE_LIST::set_insert_values(MEM_ROOT *mem_root)
{
+ DBUG_ENTER("set_insert_values");
if (table)
{
+ DBUG_PRINT("info", ("setting insert_value for table"));
if (!table->insert_values &&
!(table->insert_values= (uchar *)alloc_root(mem_root,
table->s->rec_buff_length)))
- return TRUE;
+ DBUG_RETURN(TRUE);
}
else
{
+ DBUG_PRINT("info", ("setting insert_value for view"));
DBUG_ASSERT(is_view_or_derived() && is_merged_derived());
for (TABLE_LIST *tbl= (TABLE_LIST*)view->select_lex.table_list.first;
tbl;
tbl= tbl->next_local)
if (tbl->set_insert_values(mem_root))
- return TRUE;
+ DBUG_RETURN(TRUE);
}
- return FALSE;
+ DBUG_RETURN(FALSE);
}
@@ -6897,15 +6900,16 @@ void TABLE_LIST::reset_const_table()
bool TABLE_LIST::handle_derived(LEX *lex, uint phases)
{
- SELECT_LEX_UNIT *unit= get_unit();
- if (unit)
+ SELECT_LEX_UNIT *unit;
+ DBUG_ENTER("handle_derived");
+ if ((unit= get_unit()))
{
for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
if (sl->handle_derived(lex, phases))
- return TRUE;
- return mysql_handle_single_derived(lex, this, phases);
+ DBUG_RETURN(TRUE);
+ DBUG_RETURN(mysql_handle_single_derived(lex, this, phases));
}
- return FALSE;
+ DBUG_RETURN(FALSE);
}