mariadb/mysql-test/t/handler.test

88 lines
1.7 KiB
Text
Raw Normal View History

#
# test of HANDLER ...
#
--disable_warnings
drop table if exists t1;
--enable_warnings
2001-04-08 12:56:12 +02:00
create table t1 (a int, b char(10), key a(a), key b(a,b));
insert into t1 values
2001-04-08 12:56:12 +02:00
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
2001-04-13 16:18:44 +02:00
(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
(20,"ggg"),(21,"hhh"),(22,"iii");
2001-04-08 12:56:12 +02:00
handler t1 open as t2;
2003-01-10 16:36:59 +01:00
-- error 1064
handler t2 read a=(SELECT 1);
2001-04-08 12:56:12 +02:00
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);
--error 1070
handler t2 read a=(19,"fff");
2001-04-08 12:56:12 +02:00
handler t2 read b=(19,"fff");
handler t2 read b=(19,"yyy");
handler t2 read b=(19);
--error 1109
handler t1 read a last;
2001-04-08 12:56:12 +02:00
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);
2001-04-09 15:37:19 +02:00
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;
2001-04-13 16:18:44 +02:00
handler t2 read a>=(16) limit 2,2;
2001-04-09 15:37:19 +02:00
handler t2 read a last limit 3;
2001-04-13 16:18:44 +02:00
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;
--error 1064
handler t2 read last;
2001-04-08 12:56:12 +02:00
handler t2 close;
#
2003-02-22 18:22:39 +01:00
# DROP TABLE / ALTER TABLE
#
handler t1 open as t2;
drop table t1;
create table t1 (a int);
insert into t1 values (17);
--error 1109
handler t2 read first;
2003-02-22 18:22:39 +01:00
handler t1 open as t2;
alter table t1 type=MyISAM;
--error 1109
handler t2 read first;
drop table t1;
2002-01-03 15:31:54 +01:00