summaryrefslogtreecommitdiffstats
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /sql/sql_delete.cc
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 90194659..202dde11 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -534,7 +534,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
select=make_select(table, 0, 0, conds, (SORT_INFO*) 0, 0, &error);
if (unlikely(error))
DBUG_RETURN(TRUE);
- if ((select && select->check_quick(thd, safe_update, limit)) || !limit)
+ if ((select && select->check_quick(thd, safe_update, limit,
+ Item_func::BITMAP_ALL)) || !limit)
{
query_plan.set_impossible_where();
if (thd->lex->describe || thd->lex->analyze_stmt)
@@ -1268,6 +1269,13 @@ multi_delete::initialize_tables(JOIN *join)
{
TABLE_LIST *tbl= walk->correspondent_table->find_table_for_update();
tables_to_delete_from|= tbl->table->map;
+
+ /*
+ Ensure that filesort re-reads the row from the engine before
+ delete is called.
+ */
+ join->map2table[tbl->table->tablenr]->keep_current_rowid= true;
+
if (delete_while_scanning &&
unique_table(thd, tbl, join->tables_list, 0))
{