mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
207 lines
3.5 KiB
Text
207 lines
3.5 KiB
Text
drop table if exists t1;
|
|
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"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
|
|
(20,"ggg"),(21,"hhh"),(22,"iii");
|
|
handler t1 open as t2;
|
|
handler t2 read a=(SELECT 1);
|
|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1
|
|
handler t2 read a first;
|
|
a b
|
|
14 aaa
|
|
handler t2 read a next;
|
|
a b
|
|
15 bbb
|
|
handler t2 read a next;
|
|
a b
|
|
16 ccc
|
|
handler t2 read a prev;
|
|
a b
|
|
15 bbb
|
|
handler t2 read a last;
|
|
a b
|
|
22 iii
|
|
handler t2 read a prev;
|
|
a b
|
|
21 hhh
|
|
handler t2 read a prev;
|
|
a b
|
|
20 ggg
|
|
handler t2 read a first;
|
|
a b
|
|
14 aaa
|
|
handler t2 read a prev;
|
|
a b
|
|
handler t2 read a last;
|
|
a b
|
|
22 iii
|
|
handler t2 read a prev;
|
|
a b
|
|
21 hhh
|
|
handler t2 read a next;
|
|
a b
|
|
22 iii
|
|
handler t2 read a next;
|
|
a b
|
|
handler t2 read a=(15);
|
|
a b
|
|
15 bbb
|
|
handler t2 read a=(16);
|
|
a b
|
|
16 ccc
|
|
handler t2 read a=(19,"fff");
|
|
ERROR 42000: Too many key parts specified. Max 1 parts allowed
|
|
handler t2 read b=(19,"fff");
|
|
a b
|
|
19 fff
|
|
handler t2 read b=(19,"yyy");
|
|
a b
|
|
19 yyy
|
|
handler t2 read b=(19);
|
|
a b
|
|
19 fff
|
|
handler t1 read a last;
|
|
ERROR 42S02: Unknown table 't1' in HANDLER
|
|
handler t2 read a=(11);
|
|
a b
|
|
handler t2 read a>=(11);
|
|
a b
|
|
14 aaa
|
|
handler t2 read a=(18);
|
|
a b
|
|
18 eee
|
|
handler t2 read a>=(18);
|
|
a b
|
|
18 eee
|
|
handler t2 read a>(18);
|
|
a b
|
|
19 fff
|
|
handler t2 read a<=(18);
|
|
a b
|
|
18 eee
|
|
handler t2 read a<(18);
|
|
a b
|
|
17 ddd
|
|
handler t2 read a first limit 5;
|
|
a b
|
|
14 aaa
|
|
15 bbb
|
|
16 ccc
|
|
16 xxx
|
|
17 ddd
|
|
handler t2 read a next limit 3;
|
|
a b
|
|
18 eee
|
|
19 fff
|
|
19 yyy
|
|
handler t2 read a prev limit 10;
|
|
a b
|
|
19 fff
|
|
18 eee
|
|
17 ddd
|
|
16 xxx
|
|
16 ccc
|
|
15 bbb
|
|
14 aaa
|
|
handler t2 read a>=(16) limit 4;
|
|
a b
|
|
16 ccc
|
|
16 xxx
|
|
17 ddd
|
|
18 eee
|
|
handler t2 read a>=(16) 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);
|
|
a b
|
|
19 fff
|
|
handler t2 read a=(19) where b="yyy";
|
|
a b
|
|
19 yyy
|
|
handler t2 read first;
|
|
a b
|
|
17 ddd
|
|
handler t2 read next;
|
|
a b
|
|
18 eee
|
|
handler t2 read next;
|
|
a b
|
|
19 fff
|
|
handler t2 read last;
|
|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
|
handler t2 close;
|
|
handler t1 open as t2;
|
|
drop table t1;
|
|
create table t1 (a int);
|
|
insert into t1 values (17);
|
|
handler t2 read first;
|
|
ERROR 42S02: Unknown table 't2' in HANDLER
|
|
handler t1 open as t2;
|
|
alter table t1 engine=MyISAM;
|
|
handler t2 read first;
|
|
ERROR 42S02: Unknown table 't2' in HANDLER
|
|
drop table t1;
|
|
create table t1 (a int);
|
|
insert into t1 values (1),(2),(3),(4),(5),(6);
|
|
delete from t1 limit 2;
|
|
handler t1 open;
|
|
handler t1 read first;
|
|
a
|
|
3
|
|
handler t1 read first limit 1,1;
|
|
a
|
|
4
|
|
handler t1 read first limit 2,2;
|
|
a
|
|
5
|
|
6
|
|
delete from t1 limit 3;
|
|
handler t1 read first;
|
|
a
|
|
6
|
|
drop table t1;
|
|
create table t1(a int, index(a));
|
|
insert into t1 values (1), (2), (3);
|
|
handler t1 open;
|
|
handler t1 read a=(W);
|
|
ERROR 42S22: Unknown column 'W' in 'field list'
|
|
handler t1 read a=(a);
|
|
ERROR HY000: Wrong arguments to HANDLER ... READ
|
|
drop table t1;
|
|
create table t1 (a char(5));
|
|
insert into t1 values ("Ok");
|
|
handler t1 open as t;
|
|
handler t read first;
|
|
a
|
|
Ok
|
|
use mysql;
|
|
handler t read first;
|
|
a
|
|
Ok
|
|
handler t close;
|
|
handler test.t1 open as t;
|
|
handler t read first;
|
|
a
|
|
Ok
|
|
handler t close;
|
|
use test;
|
|
drop table t1;
|
|
create table t1 ( a int, b int, INDEX a (a) );
|
|
insert into t1 values (1,2), (2,1);
|
|
handler t1 open;
|
|
handler t1 read a=(1) where b=2;
|
|
a b
|
|
1 2
|
|
handler t1 read a=(1) where b=3;
|
|
a b
|
|
handler t1 read a=(1) where b=1;
|
|
a b
|
|
handler t1 close;
|
|
drop table t1;
|