diff options
author | unknown <sergefp@mysql.com> | 2005-10-18 14:08:50 +0400 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-10-18 14:08:50 +0400 |
commit | 168942c194fc4a7cb87a240722ea56daf7c91d20 (patch) | |
tree | d6d7b767e37101864068ce6dc37173555bab7642 /mysql-test/t/update.test | |
parent | 387a29e33063b097ef6c22ed4b6dcb1d2672606f (diff) | |
parent | 7e3feca7b2b3b55449e1c87c62af53293d58aa4e (diff) | |
download | mariadb-git-168942c194fc4a7cb87a240722ea56daf7c91d20.tar.gz |
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug12915-r2
sql/sql_update.cc:
Auto merged
Diffstat (limited to 'mysql-test/t/update.test')
-rw-r--r-- | mysql-test/t/update.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 84e9ced2017..a37655b15fe 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -227,4 +227,33 @@ select DATABASE(); delete from t1 where count(*)=1; drop table t1; +# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index +create table t1 ( a int, index (a) ); +insert into t1 values (0),(0),(0),(0),(0),(0),(0),(0); + +flush status; +select a from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +update t1 set a=unix_timestamp() order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +flush status; +delete from t1 order by a desc limit 1; +show status like 'handler_read%'; + +alter table t1 disable keys; + +flush status; +delete from t1 order by a limit 1; +show status like 'handler_read%'; + +select count(*) from t1; + +drop table t1; # End of 4.1 tests |