summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2006-01-25 23:25:23 +0300
committerunknown <sergefp@mysql.com>2006-01-25 23:25:23 +0300
commitf6ca71f7428c08941e7e5f8864dd8c2dc09b3dd9 (patch)
tree6eb5453574dbbc5b4cca00daf48ba4aa1f574863 /sql/sql_update.cc
parentf74e03e966f34df990f2ed721fcfd4e44b881acc (diff)
downloadmariadb-git-f6ca71f7428c08941e7e5f8864dd8c2dc09b3dd9.tar.gz
BUG#15935: In mysql_update, don't use full index scan when we could have used quick select scan.
mysql-test/r/update.result: Testcase for BUG#15935 mysql-test/t/update.test: Testcase for BUG#15935 sql/sql_update.cc: BUG#15935: - Do account for the fact that used_index!=MAX_KEY is also true for cases when quick select is used, and use quick select then (and not full index scan). - Also removed the redundant "used_index= MAX_KEY" statement
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 24c7a278e79..edd16bb4bee 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -212,7 +212,6 @@ int mysql_update(THD *thd,
SORT_FIELD *sortorder;
ha_rows examined_rows;
- used_index= MAX_KEY; // For call to init_read_record()
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
if (!(sortorder=make_unireg_sortorder(order, &length)) ||
@@ -244,7 +243,7 @@ int mysql_update(THD *thd,
DISK_BUFFER_SIZE, MYF(MY_WME)))
goto err;
- if (used_index == MAX_KEY)
+ if (used_index == MAX_KEY || (select && select->quick))
init_read_record(&info,thd,table,select,0,1);
else
init_read_record_idx(&info, thd, table, 1, used_index);