diff options
author | Igor Babaev <igor@askmonty.org> | 2012-09-01 14:21:59 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-09-01 14:21:59 -0700 |
commit | a6b88f1431238152643e41979ce10b9bbdac2a82 (patch) | |
tree | 42482ef66f3c59b255d299fc58ace8c1b0c518ea /sql/sql_update.cc | |
parent | 5a86a61219826aadf8d08cbc447fe438f2bf50c3 (diff) | |
download | mariadb-git-a6b88f1431238152643e41979ce10b9bbdac2a82.tar.gz |
MDEV-415: Back-port of the WL task #1393 from the mysql-5.6 code line.
The task adds a more efficient handling of the queries with
ORDER BY order LIMIT n, such that n is small enough and
no indexes are used for order.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f2b6c5c9f92..bf261bffec3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -498,13 +498,15 @@ int mysql_update(THD *thd, uint length= 0; SORT_FIELD *sortorder; ha_rows examined_rows; + ha_rows found_rows; table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL)); if (!(sortorder=make_unireg_sortorder(order, &length, NULL)) || (table->sort.found_records= filesort(thd, table, sortorder, length, - select, limit, 1, - &examined_rows)) + select, limit, + true, + &examined_rows, &found_rows)) == HA_POS_ERROR) { goto err; |