summaryrefslogtreecommitdiff
path: root/mysql-test/t/update.test
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-10-25 02:27:40 +0300
committermonty@mysql.com <>2005-10-25 02:27:40 +0300
commit3e653fb922ca6a9b4233cd1d8625031e851d33c5 (patch)
tree56b86b67bce65a21ff4ffd27cd2dd139b110b622 /mysql-test/t/update.test
parentea3ea9ed1001a0f0d0a86297896b465f9d1cbaf8 (diff)
downloadmariadb-git-3e653fb922ca6a9b4233cd1d8625031e851d33c5.tar.gz
Added more tests for new UPDATE ... ORDER BY ... LIMIT optimization
Diffstat (limited to 'mysql-test/t/update.test')
-rw-r--r--mysql-test/t/update.test13
1 files changed, 9 insertions, 4 deletions
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index a37655b15fe..e81415628d0 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -228,15 +228,16 @@ 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);
+create table t1 ( a int, b int default 0, index (a) );
+insert into t1 (a) 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;
+update t1 set a=9999 order by a limit 1;
+update t1 set b=9999 order by a limit 1;
show status like 'handler_read%';
flush status;
@@ -253,7 +254,11 @@ flush status;
delete from t1 order by a limit 1;
show status like 'handler_read%';
-select count(*) from t1;
+select * from t1;
+update t1 set a=a+10,b=1 order by a limit 3;
+update t1 set a=a+11,b=2 order by a limit 3;
+update t1 set a=a+12,b=3 order by a limit 3;
+select * from t1 order by a;
drop table t1;
# End of 4.1 tests