From e3130d22e1fbd9060fe3009a2d3b3152932efe97 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 30 Mar 2020 21:59:07 +0300 Subject: Fixed some assert crashes related to keyread. - MDEV-22062 Assertion `!table->file->keyread_enabled()' failed in close_thread_table() - MDEV-22077 table->no_keyread .. failed in join_read_first() - MDEV-22237 Assertion `!table->file->keyread_enabled()' failed in handler::ha_reset on DELETE --- sql/sql_delete.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 12e764ffce3..2bb63552c6a 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -379,8 +379,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, tables.table = table; tables.alias = table_list->alias; - if (select_lex->setup_ref_array(thd, order_list->elements) || - setup_order(thd, select_lex->ref_pointer_array, &tables, + if (select_lex->setup_ref_array(thd, order_list->elements) || + setup_order(thd, select_lex->ref_pointer_array, &tables, fields, all_fields, order)) { free_underlaid_joins(thd, thd->lex->first_select_lex()); @@ -547,10 +547,12 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, else { ha_rows scanned_limit= query_plan.scanned_rows; + table->no_keyread= 1; query_plan.index= get_index_for_order(order, table, select, limit, &scanned_limit, &query_plan.using_filesort, &reverse); + table->no_keyread= 0; if (!query_plan.using_filesort) query_plan.scanned_rows= scanned_limit; } -- cgit v1.2.1