summaryrefslogtreecommitdiff
path: root/mysql-test/suite/handler/myisam.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/handler/myisam.result')
-rw-r--r--mysql-test/suite/handler/myisam.result273
1 files changed, 222 insertions, 51 deletions
diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result
index bd356d6e81d..321811d7339 100644
--- a/mysql-test/suite/handler/myisam.result
+++ b/mysql-test/suite/handler/myisam.result
@@ -4,50 +4,50 @@ create table t1 (a int, b char(10), key a (a), key b (a,b));
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
(14,"aaa"),(16,"ccc"),(16,"xxx"),
-(20,"ggg"),(21,"hhh"),(22,"iii");
+(20,"ggg"),(21,"hhh"),(22,"iii"),(23,"xxx"),(24,"xxx"),(25,"xxx");
handler t1 open as t2;
-handler t2 read a first;
+handler t2 read b first;
a b
14 aaa
-handler t2 read a next;
+handler t2 read b next;
a b
16 ccc
-handler t2 read a next;
+handler t2 read b next;
a b
16 xxx
-handler t2 read a prev;
+handler t2 read b prev;
a b
16 ccc
-handler t2 read a last;
+handler t2 read b last;
a b
-22 iii
-handler t2 read a prev;
+25 xxx
+handler t2 read b prev;
a b
-21 hhh
-handler t2 read a prev;
+24 xxx
+handler t2 read b prev;
a b
-20 ggg
-handler t2 read a first;
+23 xxx
+handler t2 read b first;
a b
14 aaa
-handler t2 read a prev;
+handler t2 read b prev;
a b
-handler t2 read a last;
+handler t2 read b last;
a b
-22 iii
-handler t2 read a prev;
+25 xxx
+handler t2 read b prev;
a b
-21 hhh
-handler t2 read a next;
+24 xxx
+handler t2 read b next;
a b
-22 iii
-handler t2 read a next;
+25 xxx
+handler t2 read b next;
a b
handler t2 read a=(15);
a b
-handler t2 read a=(16);
+handler t2 read a=(21);
a b
-16 ccc
+21 hhh
handler t2 read a=(19,"fff");
ERROR 42000: Too many key parts specified; max 1 parts allowed
handler t2 read b=(19,"fff");
@@ -66,29 +66,31 @@ a b
handler t2 read a>=(11);
a b
14 aaa
-handler t2 read a=(18);
+handler t2 read b=(18);
a b
18 eee
-handler t2 read a>=(18);
+handler t2 read b>=(18);
a b
18 eee
-handler t2 read a>(18);
+handler t2 read b>(18);
a b
19 fff
-handler t2 read a<=(18);
+handler t2 read b<=(18);
a b
18 eee
-handler t2 read a<(18);
+handler t2 read b<(18);
a b
17 ddd
handler t2 read a=(15);
a b
-handler t2 read a>=(15);
+handler t2 read a>=(15) limit 2;
a b
16 ccc
-handler t2 read a>(15);
+16 xxx
+handler t2 read a>(15) limit 2;
a b
16 ccc
+16 xxx
handler t2 read a<=(15);
a b
14 aaa
@@ -103,10 +105,10 @@ handler t2 read a>(54);
a b
handler t2 read a<=(54);
a b
-22 iii
+25 xxx
handler t2 read a<(54);
a b
-22 iii
+25 xxx
handler t2 read a=(1);
a b
handler t2 read a>=(1);
@@ -119,19 +121,19 @@ handler t2 read a<=(1);
a b
handler t2 read a<(1);
a b
-handler t2 read a first limit 5;
+handler t2 read b first limit 5;
a b
14 aaa
16 ccc
16 xxx
17 ddd
18 eee
-handler t2 read a next limit 3;
+handler t2 read b next limit 3;
a b
19 fff
19 yyy
20 ggg
-handler t2 read a prev limit 10;
+handler t2 read b prev limit 10;
a b
19 yyy
19 fff
@@ -140,25 +142,32 @@ a b
16 xxx
16 ccc
14 aaa
-handler t2 read a>=(16) limit 4;
+handler t2 read b>=(16) limit 4;
a b
16 ccc
16 xxx
17 ddd
18 eee
-handler t2 read a>=(16) limit 2,2;
+handler t2 read b>=(16) limit 2,2;
+a b
+17 ddd
+18 eee
+select * from t1 where a>=16 order by a,b limit 2,2;
a b
17 ddd
18 eee
handler t2 read a last limit 3;
a b
-22 iii
-21 hhh
-20 ggg
-handler t2 read a=(19);
+25 xxx
+24 xxx
+23 xxx
+handler t2 read b=(16) limit 1,3;
+a b
+16 xxx
+handler t2 read b=(19);
a b
19 fff
-handler t2 read a=(19) where b="yyy";
+handler t2 read b=(19) where b="yyy";
a b
19 yyy
handler t2 read first;
@@ -172,20 +181,20 @@ a b
19 fff
handler t2 close;
handler t1 open;
-handler t1 read a next;
+handler t1 read b next;
a b
14 aaa
-handler t1 read a next;
+handler t1 read b next;
a b
16 ccc
handler t1 close;
handler t1 open;
handler t1 read a prev;
a b
-22 iii
+25 xxx
handler t1 read a prev;
a b
-21 hhh
+24 xxx
handler t1 close;
handler t1 open as t2;
handler t2 read first;
@@ -194,6 +203,168 @@ a b
alter table t1 engine = MyISAM;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
+handler t1 open;
+handler t1 read a=(20) limit 1,3;
+a b
+flush tables;
+handler t1 read a=(20) limit 1,3;
+a b
+handler t1 close;
+handler t1 open;
+handler t1 read a=(25);
+a b
+25 xxx
+handler t1 read a next;
+a b
+handler t1 read a next;
+a b
+handler t1 read a next;
+a b
+handler t1 read a prev;
+a b
+25 xxx
+handler t1 read a=(1000);
+a b
+handler t1 read a next;
+a b
+handler t1 read a prev;
+a b
+25 xxx
+handler t1 read a=(1000);
+a b
+handler t1 read a prev;
+a b
+25 xxx
+handler t1 read a=(14);
+a b
+14 aaa
+handler t1 read a prev;
+a b
+handler t1 read a prev;
+a b
+handler t1 read a next;
+a b
+14 aaa
+handler t1 read a=(1);
+a b
+handler t1 read a prev;
+a b
+handler t1 read a next;
+a b
+14 aaa
+handler t1 read a=(1);
+a b
+handler t1 read a next;
+a b
+14 aaa
+handler t1 close;
+handler t1 open;
+prepare stmt from 'handler t1 read a=(?) limit ?,?';
+set @a=20,@b=1,@c=100;
+execute stmt using @a,@b,@c;
+a b
+set @a=20,@b=2,@c=1;
+execute stmt using @a,@b,@c;
+a b
+set @a=20,@b=0,@c=2;
+execute stmt using @a,@b,@c;
+a b
+20 ggg
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read a next limit ?';
+handler t1 read a>=(21);
+a b
+21 hhh
+set @a=3;
+execute stmt using @a;
+a b
+22 iii
+23 xxx
+24 xxx
+execute stmt using @a;
+a b
+25 xxx
+execute stmt using @a;
+a b
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read b prev limit ?';
+execute stmt using @a;
+a b
+25 xxx
+24 xxx
+23 xxx
+execute stmt using @a;
+a b
+22 iii
+21 hhh
+20 ggg
+execute stmt using @a;
+a b
+19 yyy
+19 fff
+18 eee
+execute stmt using @a;
+a b
+17 ddd
+16 xxx
+16 ccc
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read b=(?,?)';
+set @a=14, @b='aaa';
+execute stmt using @a,@b;
+a b
+14 aaa
+set @a=14, @b='not found';
+execute stmt using @a,@b;
+a b
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read b=(1+?) limit 10';
+set @a=15;
+execute stmt using @a;
+a b
+16 ccc
+16 xxx
+execute stmt using @a;
+a b
+16 ccc
+16 xxx
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read b>=(?) where a < ? limit 5';
+set @a=17, @b=24;
+execute stmt using @a,@b;
+a b
+17 ddd
+18 eee
+19 fff
+19 yyy
+20 ggg
+execute stmt using @a,@b;
+a b
+17 ddd
+18 eee
+19 fff
+19 yyy
+20 ggg
+deallocate prepare stmt;
+prepare stmt from 'handler t1 read a=(?)';
+set @a=17;
+execute stmt using @a;
+a b
+17 ddd
+alter table t1 add c int;
+execute stmt using @a;
+ERROR 42S02: Unknown table 't1' in HANDLER
+deallocate prepare stmt;
+handler t1 close;
+ERROR 42S02: Unknown table 't1' in HANDLER
+handler t1 open;
+prepare stmt from 'handler t1 read a=(?)';
+flush tables;
+set @a=17;
+execute stmt using @a;
+ERROR HY000: Prepared statement needs to be re-prepared
+deallocate prepare stmt;
+handler t1 close;
handler t1 open as t2;
drop table t1;
create table t1 (a int not null);
@@ -429,7 +600,7 @@ handler t1_alias READ a next where inexistent > 0;
ERROR 42S22: Unknown column 'inexistent' in 'field list'
handler t1_alias close;
drop table t1;
-create temporary table t1 (a int, b char(1), key a (a), key b(a,b));
+create temporary table t1 (a int, b char(1), key a (a), key b (a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
select a,b from t1;
@@ -481,20 +652,20 @@ a b
9 j
9 k
handler t1 open as a2;
-handler a2 read a=(9);
+handler a2 read b=(9);
a b
9 j
-handler a2 read a next;
+handler a2 read b next;
a b
9 k
-handler a2 read a prev limit 2;
+handler a2 read b prev limit 2;
a b
9 j
8 i
-handler a2 read a last;
+handler a2 read b last;
a b
9 k
-handler a2 read a prev;
+handler a2 read b prev;
a b
9 j
handler a2 close;