summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-02 14:43:25 +0200
committerunknown <monty@mysql.com>2005-11-02 14:43:25 +0200
commita73b682af9d39bda9a1972d268a3703da4131a12 (patch)
treeaaa67a99674d8a7acaf23771c5994ceda6c00fa4 /sql/sql_update.cc
parent256d286174c25f25ec4d7af44b0397493a0be9e7 (diff)
downloadmariadb-git-a73b682af9d39bda9a1972d268a3703da4131a12.tar.gz
Fixed wrong merge
Optimize new pushed code sql/item_func.cc: Fixed wrong merge sql/sql_update.cc: Optimize new pushed code (There is no reason to add extra test for not common error case if code can handle it anyway)
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index bd19d4d85f3..039aa0f71fa 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -121,7 +121,7 @@ int mysql_update(THD *thd,
bool safe_update= thd->options & OPTION_SAFE_UPDATES;
bool used_key_is_modified, transactional_table;
int res;
- int error=0;
+ int error;
uint used_index= MAX_KEY;
bool need_sort= TRUE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -132,7 +132,7 @@ int mysql_update(THD *thd,
ha_rows updated, found;
key_map old_used_keys;
TABLE *table;
- SQL_SELECT *select= 0;
+ SQL_SELECT *select;
READ_RECORD info;
SELECT_LEX *select_lex= &thd->lex->select_lex;
bool need_reopen;
@@ -237,8 +237,7 @@ int mysql_update(THD *thd,
}
// Don't count on usage of 'only index' when calculating which key to use
table->used_keys.clear_all();
- if (limit)
- select= make_select(table, 0, 0, conds, 0, &error);
+ select= make_select(table, 0, 0, conds, 0, &error);
if (error || !limit ||
(select && select->check_quick(thd, safe_update, limit)))
{