summaryrefslogtreecommitdiff
path: root/sql/sql_update.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_update.cc
parent258c34f17cd5a06e29888498064bb46d019dc58f (diff)
parent9c6135e81f29b3e3286d6b864c0fdafc2fea16ce (diff)
downloadmariadb-git-e1246775a99372a57834617331bf9f66921fffdc.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 624c183c83b..e30da347f8b 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2011, 2021, MariaDB
+ Copyright (c) 2011, 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
@@ -370,7 +370,8 @@ int mysql_update(THD *thd,
ha_rows *found_return, ha_rows *updated_return)
{
bool using_limit= limit != HA_POS_ERROR;
- bool safe_update= thd->variables.option_bits & OPTION_SAFE_UPDATES;
+ bool safe_update= (thd->variables.option_bits & OPTION_SAFE_UPDATES)
+ && !thd->lex->describe;
bool used_key_is_modified= FALSE, transactional_table;
bool will_batch= FALSE;
bool can_compare_record;
@@ -597,7 +598,7 @@ int mysql_update(THD *thd,
}
/* 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)