summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-10-23 18:49:02 +0300
committerMonty <monty@mariadb.org>2015-10-23 18:49:02 +0300
commitd546d1cc138cc0e6c7d69a55bfee2bebfa4d4c0e (patch)
tree0d7eeebae93c93dc943588ae82381893939d21f6 /sql/sql_delete.cc
parentdf8832caae60de4f7b9ceca808a3f97b92bc22fb (diff)
downloadmariadb-git-d546d1cc138cc0e6c7d69a55bfee2bebfa4d4c0e.tar.gz
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.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 5292b964576..64f5c85ef22 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -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))
+ error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
+ else
+ error= init_read_record_idx(&info, thd, table, 1, query_plan.index,
+ reverse);
+ if (error)
{
- if (init_read_record(&info, thd, table, select, 1, 1, FALSE))
- {
- delete select;
- free_underlaid_joins(thd, select_lex);
- DBUG_RETURN(TRUE);
- }
+ delete select;
+ free_underlaid_joins(thd, select_lex);
+ DBUG_RETURN(TRUE);
}
- else
- init_read_record_idx(&info, thd, table, 1, query_plan.index, reverse);
init_ftfuncs(thd, select_lex, 1);
THD_STAGE_INFO(thd, stage_updating);