summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-25 10:20:57 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-25 10:20:57 +0300
commite4394cc5472a18d791b48e56784742b512de2bf8 (patch)
tree4e20f1da804a86891d7477bb4cc20bbcb6b63564 /sql/sql_delete.cc
parentee455e6f2e6c9cda921c0801210786123d9f8b95 (diff)
parent2c9bf0ae8758b2c46ea5e02d1ea3d3ab5cab63b2 (diff)
downloadmariadb-git-e4394cc5472a18d791b48e56784742b512de2bf8.tar.gz
Merge 10.3 into 10.4bb-10.4-merge
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index be8767af111..9fa1e015274 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
- Copyright (c) 2010, 2019, MariaDB
+ Copyright (c) 2010, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1128,14 +1128,11 @@ int mysql_multi_delete_prepare(THD *thd)
FALSE, DELETE_ACL, SELECT_ACL, FALSE))
DBUG_RETURN(TRUE);
- if (lex->first_select_lex()->handle_derived(thd->lex, DT_MERGE))
- DBUG_RETURN(TRUE);
-
/*
Multi-delete can't be constructed over-union => we always have
single SELECT on top and have to check underlying SELECTs of it
*/
- lex->first_select_lex()->exclude_from_table_unique_test= TRUE;
+ lex->first_select_lex()->set_unique_exclude();
/* Fix tables-to-be-deleted-from list to point at opened tables */
for (target_tbl= (TABLE_LIST*) aux_tables;
target_tbl;
@@ -1158,6 +1155,12 @@ int mysql_multi_delete_prepare(THD *thd)
target_tbl->table_name.str, "DELETE");
DBUG_RETURN(TRUE);
}
+ }
+
+ for (target_tbl= (TABLE_LIST*) aux_tables;
+ target_tbl;
+ target_tbl= target_tbl->next_local)
+ {
/*
Check that table from which we delete is not used somewhere
inside subqueries/view.
@@ -1202,12 +1205,6 @@ multi_delete::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
unit= u;
do_delete= 1;
THD_STAGE_INFO(thd, stage_deleting_from_main_table);
- SELECT_LEX *select_lex= u->first_select();
- if (select_lex->first_cond_optimization)
- {
- if (select_lex->handle_derived(thd->lex, DT_MERGE))
- DBUG_RETURN(TRUE);
- }
DBUG_RETURN(0);
}