mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -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)) ||
|
||||
|
Reference in New Issue
Block a user