diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
commit | b4a0b2c2f862ab0de853dc34e1e56f6159043e45 (patch) | |
tree | 18a0c25fdc9ac0076da19247666414a46434b85e /sql/sql_delete.cc | |
parent | 9809f05199aeb0b67991fac41bd86f38730768dc (diff) | |
download | mariadb-git-b4a0b2c2f862ab0de853dc34e1e56f6159043e45.tar.gz |
post-merge fixes.
most tests pass.
5.3 merge is next
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 8dd611e4ccf..3a7cc38b097 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -230,8 +230,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, order= simple_remove_const(order, conds); bool need_sort; - usable_index= get_index_for_order(order, table, select, limit, - &need_sort, &reverse); + if (select && select->quick && select->quick->unique_key_range()) + { // Single row select (always "ordered") + need_sort= FALSE; + usable_index= MAX_KEY; + } + else + usable_index= get_index_for_order(order, table, select, limit, + &need_sort, &reverse); if (need_sort) { DBUG_ASSERT(usable_index == MAX_KEY); |