Fixed MDEV-8408

Assertion `inited==INDEX' failed in int handler::ha_index_first(uchar*)

The crash was because errors from init_read_record_idx() was not taken care of.
This commit is contained in:
Monty 2015-10-23 18:49:02 +03:00
commit d546d1cc13
6 changed files with 59 additions and 23 deletions

View file

@ -508,17 +508,18 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(TRUE);
}
if (query_plan.index == MAX_KEY || (select && select->quick))
{
if (init_read_record(&info, thd, table, select, 1, 1, FALSE))
{
delete select;
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(TRUE);
}
}
error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
else
init_read_record_idx(&info, thd, table, 1, query_plan.index, reverse);
error= init_read_record_idx(&info, thd, table, 1, query_plan.index,
reverse);
if (error)
{
delete select;
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(TRUE);
}
init_ftfuncs(thd, select_lex, 1);
THD_STAGE_INFO(thd, stage_updating);