handler.test 1.35 KB
Newer Older
1 2 3 4 5
#
# test of HANDLER ...
#

drop table if exists t1;
6
create table t1 (a int, b char(10), key a(a), key b(a,b));
7
insert into t1 values
8
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
9
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
10
(20,"ggg"),(21,"hhh"),(22,"iii");
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
handler t1 open as t2;
handler t2 read a first;
handler t2 read a next;
handler t2 read a next;
handler t2 read a prev;
handler t2 read a last;
handler t2 read a prev;
handler t2 read a prev;

handler t2 read a first;
handler t2 read a prev;

handler t2 read a last;
handler t2 read a prev;
handler t2 read a next;
handler t2 read a next;

handler t2 read a=(15);
handler t2 read a=(16);

!$1070 handler t2 read a=(19,"fff");
32

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
handler t2 read b=(19,"fff");
handler t2 read b=(19,"yyy");
handler t2 read b=(19);

!$1109 handler t1 read a last;

handler t2 read a=(11);
handler t2 read a>=(11);

handler t2 read a=(18);
handler t2 read a>=(18);
handler t2 read a>(18);
handler t2 read a<=(18);
handler t2 read a<(18);

48 49 50 51 52
handler t2 read a first limit 5;
handler t2 read a next  limit 3;
handler t2 read a prev  limit 10;

handler t2 read a>=(16) limit 4;
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
53
handler t2 read a>=(16) limit 2,2;
54 55
handler t2 read a last  limit 3;

serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
56 57 58 59 60 61
handler t2 read a=(19);
handler t2 read a=(19) where b="yyy";

handler t2 read first;
handler t2 read next;
handler t2 read next;
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
62
!$1064 handler t2 read last;
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
63

64 65
handler t2 close;
drop table if exists t1;