summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-03 17:44:40 +0300
committerSergei Golubchik <serg@mariadb.org>2018-04-10 13:12:36 +0200
commita4251d6f18fd2208564b49a178834136ff3ee0d0 (patch)
tree78ec946e836b3153ef40f0eb81d4b571df75a0d2 /sql/sql_delete.cc
parent1a86fc5f142397e35ec878e50c63193793b63a80 (diff)
downloadmariadb-git-a4251d6f18fd2208564b49a178834136ff3ee0d0.tar.gz
MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion `join->best_read < double(1.79...e+308L)' failed
vers_setup_conds() used to AND all conditions on row_start/row_end columns and store it either in the WHERE clause or in the ON clause for some table. In some cases this caused ON clause to have conditions for tables that aren't part of that ON's join. Fixed to put a table's condition always in the ON clause of the corresponding table. Removed unnecessary ... `OR row_end IS NULL` clause, it's not needed in the ON clause. Simplified handling on PS and SP.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index b92dd4139b2..0a12d01596b 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -318,9 +318,13 @@ 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, &conds))
+ 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;
+
// trx_sees() in InnoDB reads row_start
if (!table->versioned(VERS_TIMESTAMP))
{
@@ -941,7 +945,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list,
my_error(ER_IT_IS_A_VIEW, MYF(0), table_list->table_name.str);
DBUG_RETURN(true);
}
- if (select_lex->vers_setup_conds(thd, table_list, conds))
+ if (select_lex->vers_setup_conds(thd, table_list))
DBUG_RETURN(true);
}
if ((wild_num && setup_wild(thd, table_list, field_list, NULL, wild_num)) ||