summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-15 08:32:28 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-15 08:32:28 +0200
commite1246775a99372a57834617331bf9f66921fffdc (patch)
tree02a952ee2f121de1077082070d40c9c384b874e3 /sql/sql_delete.cc
parent258c34f17cd5a06e29888498064bb46d019dc58f (diff)
parent9c6135e81f29b3e3286d6b864c0fdafc2fea16ce (diff)
downloadmariadb-git-e1246775a99372a57834617331bf9f66921fffdc.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 7e053e60fdf..0fe6037e88b 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, 2021, MariaDB
+ Copyright (c) 2010, 2022, 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
@@ -406,7 +406,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_RETURN(TRUE);
const_cond= (!conds || conds->const_item());
- safe_update= MY_TEST(thd->variables.option_bits & OPTION_SAFE_UPDATES);
+ safe_update= (thd->variables.option_bits & OPTION_SAFE_UPDATES) &&
+ !thd->lex->describe;
if (safe_update && const_cond)
{
my_message(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE,
@@ -531,7 +532,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
}
/* If running in safe sql mode, don't allow updates without keys */
- if (table->opt_range_keys.is_clear_all())
+ if (!select || !select->quick)
{
thd->set_status_no_index_used();
if (safe_update && !using_limit)