summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-03-30 21:59:07 +0300
committerMonty <monty@mariadb.org>2020-04-19 17:33:51 +0300
commite3130d22e1fbd9060fe3009a2d3b3152932efe97 (patch)
treeda7e895dfd4eb965c7aef8875614399be303be38 /sql/sql_delete.cc
parent8399af81be0a87d1c0ea09164c05a9ac8eb715e2 (diff)
downloadmariadb-git-e3130d22e1fbd9060fe3009a2d3b3152932efe97.tar.gz
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
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc6
1 files changed, 4 insertions, 2 deletions
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;
}