summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2018-07-24 01:59:15 +1000
committerSergei Golubchik <serg@mariadb.org>2018-08-24 11:20:06 +0200
commitdb3be33ec877a3e39a18d46da8dc3ac364be8113 (patch)
treea69e9c8d2948a7c14b42b8bd6f859e929391f852 /sql/sql_delete.cc
parent6c6ca907ee84e3f129bc33be8202c0fee2f29196 (diff)
downloadmariadb-git-db3be33ec877a3e39a18d46da8dc3ac364be8113.tar.gz
MDEV-16783 Assertion `!conds' failed in mysql_delete upon 2nd execution of SP with DELETE HISTORY
* remove assertion * do not setup `conds` if it's already cached Fixes #823
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index b6ca2e956cb..a040ba9eb93 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -323,12 +323,16 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_ASSERT(table);
DBUG_ASSERT(!conds || thd->stmt_arena->is_stmt_execute());
- if (select_lex->vers_setup_conds(thd, table_list))
- DBUG_RETURN(TRUE);
- DBUG_ASSERT(!conds);
- conds= table_list->on_expr;
- table_list->on_expr= NULL;
+ // conds could be cached from previous SP call
+ if (!conds)
+ {
+ if (select_lex->vers_setup_conds(thd, table_list))
+ DBUG_RETURN(TRUE);
+
+ conds= table_list->on_expr;
+ table_list->on_expr= NULL;
+ }
}
if (mysql_handle_list_of_derived(thd->lex, table_list, DT_MERGE_FOR_INSERT))