diff options
author | sergefp@mysql.com <> | 2005-10-19 01:52:06 +0400 |
---|---|---|
committer | sergefp@mysql.com <> | 2005-10-19 01:52:06 +0400 |
commit | e7065d355c7360aaa15ae168499506100c91402d (patch) | |
tree | febbf43acba837f32d47827ceeddb248142fb95a /mysql-test/t/update.test | |
parent | 5db97a8d9a9d93cf71e5e3311d505a25638608e2 (diff) | |
parent | d6903c45667444d4407cde4dd14f81a2e7042ba8 (diff) | |
download | mariadb-git-e7065d355c7360aaa15ae168499506100c91402d.tar.gz |
BUG#121915: Merge 4.1->5.0
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 3822d1fe4e7..13ced76079f 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 |