summaryrefslogtreecommitdiff
path: root/mysql-test/suite/handler/aria.test
blob: 912a9e8972159f02f16cab515ec0b4d0c0c8a71d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# t/handler_innodb.test
#
# test of HANDLER ...
#
# Last update:
# 2006-07-31 ML test refactored (MySQL 5.1)
#               code of t/handler.test and t/innodb_handler.test united
#               main testing code put into handler.inc
#               rename t/innodb_handler.test to t/handler_innodb.test
#

--source include/have_maria.inc
let $engine_type= Aria;

--source init.inc
--source handler.inc

--echo #
--echo # BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash 
--echo #
CREATE TABLE t1 AS SELECT 1 AS f1; 
HANDLER t1 OPEN;
TRUNCATE t1;
--error ER_UNKNOWN_TABLE
HANDLER t1 READ FIRST;
DROP TABLE t1;

CREATE TEMPORARY TABLE t1 AS SELECT 1 AS f1; 
HANDLER t1 OPEN;
TRUNCATE t1;
--error ER_UNKNOWN_TABLE
HANDLER t1 READ FIRST;
DROP TABLE t1;

--echo #
--echo # Bug #54007: assert in ha_myisam::index_next , HANDLER
--echo #
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));

HANDLER t1 OPEN;
HANDLER t1 READ FIRST;
HANDLER t1 READ `PRIMARY` NEXT;
HANDLER t1 READ ab NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ NEXT;
HANDLER t1 CLOSE;

INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
HANDLER t1 OPEN;
HANDLER t1 READ FIRST;
HANDLER t1 READ NEXT;
HANDLER t1 READ `PRIMARY` NEXT;
HANDLER t1 READ `PRIMARY` NEXT;
HANDLER t1 READ ab NEXT;
HANDLER t1 READ ab NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ b NEXT;
HANDLER t1 READ NEXT;
HANDLER t1 READ NEXT;
HANDLER t1 READ NEXT;
HANDLER t1 CLOSE;

HANDLER t1 OPEN;
HANDLER t1 READ FIRST;
HANDLER t1 READ `PRIMARY` PREV;
HANDLER t1 READ `PRIMARY` PREV;
HANDLER t1 READ b PREV;
HANDLER t1 READ b PREV;
HANDLER t1 CLOSE;

HANDLER t1 OPEN;
HANDLER t1 READ FIRST;
HANDLER t1 READ `PRIMARY` PREV LIMIT 3;
HANDLER t1 READ b NEXT LIMIT 5;
HANDLER t1 CLOSE;

DROP TABLE t1;

--echo End of 5.1 tests

--echo #
--echo # 10.2 Test
--echo #
--echo # MDEV-20207: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon HANDLER READ
--echo #

DROP TABLE IF EXISTS t1;

CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;

--error ER_CANT_CREATE_GEOMETRY_OBJECT
HANDLER h READ a = (0);

HANDLER h CLOSE;
DROP TABLE t1;

--echo # End of 10.2 Test