mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Manually merged
This commit is contained in:
@ -132,7 +132,7 @@ int mysql_update(THD *thd,
|
||||
ha_rows updated, found;
|
||||
key_map old_used_keys;
|
||||
TABLE *table;
|
||||
SQL_SELECT *select;
|
||||
SQL_SELECT *select= 0;
|
||||
READ_RECORD info;
|
||||
SELECT_LEX *select_lex= &thd->lex->select_lex;
|
||||
bool need_reopen;
|
||||
@ -228,11 +228,20 @@ int mysql_update(THD *thd,
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
}
|
||||
|
||||
if (conds)
|
||||
{
|
||||
Item::cond_result cond_value;
|
||||
conds= remove_eq_conds(thd, conds, &cond_value);
|
||||
if (cond_value == Item::COND_FALSE)
|
||||
limit= 0; // Impossible WHERE
|
||||
}
|
||||
// Don't count on usage of 'only index' when calculating which key to use
|
||||
table->used_keys.clear_all();
|
||||
select= make_select(table, 0, 0, conds, 0, &error);
|
||||
if (error ||
|
||||
(select && select->check_quick(thd, safe_update, limit)) || !limit)
|
||||
if (limit)
|
||||
select=make_select(table,0,0,conds,&error);
|
||||
if (error || !limit ||
|
||||
(select && select->check_quick(thd, safe_update, limit)))
|
||||
{
|
||||
delete select;
|
||||
free_underlaid_joins(thd, select_lex);
|
||||
|
Reference in New Issue
Block a user