mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user