mirror of
https://github.com/MariaDB/server.git
synced 2025-12-21 11:01:08 +03:00
Import 5.0 code.
This commit is contained in:
96
mysql-test/innodb_handler.test
Normal file
96
mysql-test/innodb_handler.test
Normal file
@@ -0,0 +1,96 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# test of HANDLER ...
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a int, b char(10), key a(a), key b(a,b)) engine=innodb;
|
||||
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 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");
|
||||
|
||||
handler t2 read b=(19,"fff");
|
||||
handler t2 read b=(19,"yyy");
|
||||
handler t2 read b=(19);
|
||||
|
||||
--error 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);
|
||||
|
||||
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;
|
||||
handler t2 read a>=(16) limit 2,2;
|
||||
handler t2 read a last limit 3;
|
||||
|
||||
handler t2 read a=(19);
|
||||
handler t2 read a=(19) where b="yyy";
|
||||
|
||||
handler t2 read first;
|
||||
handler t2 read next;
|
||||
--error 1064
|
||||
handler t2 read last;
|
||||
handler t2 close;
|
||||
|
||||
handler t1 open;
|
||||
handler t1 read a next; # this used to crash as a bug#5373
|
||||
handler t1 read a next;
|
||||
handler t1 close;
|
||||
|
||||
handler t1 open;
|
||||
handler t1 read a prev; # this used to crash as a bug#5373
|
||||
handler t1 read a prev;
|
||||
handler t1 close;
|
||||
|
||||
handler t1 open as t2;
|
||||
handler t2 read first;
|
||||
alter table t1 engine=innodb;
|
||||
--error 1109
|
||||
handler t2 read first;
|
||||
|
||||
drop table t1;
|
||||
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
|
||||
HANDLER t1 OPEN;
|
||||
HANDLER t1 READ `primary` = (1, 1000);
|
||||
HANDLER t1 READ `primary` PREV;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
Reference in New Issue
Block a user