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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1,test.t2'
CREATE TABLE t1 (i INT) ENGINE=Aria;
CREATE TABLE t2 (i INT) ENGINE=Aria;
LOCK TABLE t1 WRITE, t2 WRITE;
DROP TABLE t1;
UNLOCK TABLES;
DROP TABLE t2;
CREATE TABLE t1 (i INT) ENGINE=Aria;
CREATE TABLE t2 (i INT) ENGINE=Aria;
LOCK TABLE t1 WRITE, t2 WRITE;
FLUSH TABLE t1;
select * from t1;
i
unlock tables;
drop table t1,t2;
CREATE TABLE t1 (i INT) ENGINE=Aria;
CREATE TABLE t2 (i INT) ENGINE=Aria;
LOCK TABLE t1 WRITE, t2 WRITE;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair status OK
select * from t1;
i
drop table t2;
unlock tables;
drop table t1;
CREATE TABLE t1 (i INT) ENGINE=Aria;
LOCK TABLES t1 WRITE, t1 AS t1a WRITE;
DROP TABLE t1;
#
# MDEV-8200 aria bug with insert select when select is a aria table
# (wrong result or assertion failure:
# `table->file->stats.records > 0 || error')
#
CREATE TABLE t1 (f1 INT) ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
1
unlock tables;
DROP TABLE t1,t2,tmp;
#
# Same without transactional
#
CREATE TABLE t1 (f1 INT) transactional=0 ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=0
INSERT INTO t1 VALUES (2);
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT) transactional=0 engine=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1 FROM t1;
INSERT INTO t2 SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
2
unlock tables;
DROP TABLE t1,t2,tmp;
#
# Using spatical keys (disables versioning)
#
CREATE TABLE t1 (f1 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL,
`c1` geometry NOT NULL,
SPATIAL KEY `i1` (`c1`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
INSERT INTO t1 VALUES (3,
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
-18.7186111000 -66.8102777000,
-18.7211111000 -66.9269443999,
-18.6086111000 -66.9327777000))'));
CREATE TABLE t2 (f2 INT) ENGINE=MyISAM;
CREATE TABLE tmp (f3 INT, c1 geometry NOT NULL, SPATIAL KEY i1 (c1)) transactional=1 ENGINE=Aria;
LOCK TABLE t2 WRITE, tmp WRITE, tmp AS tmp_alias WRITE, t1 WRITE;
INSERT INTO tmp SELECT f1,c1 FROM t1;
INSERT INTO t2 (f2) SELECT f3 FROM tmp AS tmp_alias;
select * from t2;
f2
3
unlock tables;
DROP TABLE t1,t2,tmp;
#
# MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt
#
CREATE TABLE t1 (f1 VARCHAR(3), f2 INT, pk INT, PRIMARY KEY (pk)) ENGINE=Aria;
INSERT INTO t1 VALUES ('foo',10,1), ('foo',1,2);
LOCK TABLE t1 WRITE;
ALTER TABLE t1 ADD UNIQUE KEY (f1);
ERROR 23000: Duplicate entry 'foo' for key 'f1'
ALTER TABLE t1 ADD KEY (f2);
DROP TABLE t1;
#
# MDEV-10748 Server crashes in ha_maria::implicit_commit upon ALTER TABLE
#
CREATE TABLE t1 (a INT, b INT) ENGINE=Aria;
SELECT * FROM t1;
a b
CREATE TABLE t2 (c INT) ENGINE=Aria;
LOCK TABLE t2 READ, t1 WRITE;
ALTER TABLE t1 CHANGE b a INT;
ERROR 42S21: Duplicate column name 'a'
UNLOCK TABLES;
DROP TABLE t1, t2;
#
# MDEV-10748 Server crashes in ha_maria::implicit_commit upon ALTER TABLE
#
CREATE TABLE t1 (a INT) ENGINE=Aria;
CREATE TABLE t2 (b INT) ENGINE=Aria;
LOCK TABLES t1 WRITE, t2 AS t2a WRITE, t2 WRITE;
ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=COPY;
UNLOCK TABLES;
DROP TABLE t1, t2;
# More complex test, from RQG
CREATE TABLE t1 (a INT) ENGINE=Aria;
CREATE TABLE t2 (b INT) ENGINE=Aria;
CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2 ;
LOCK TABLES t1 WRITE, t2 AS t2a WRITE, v2 WRITE CONCURRENT, t2 WRITE;
ALTER TABLE t1 FORCE;
ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ALTER TABLE t2 CHANGE b c VARBINARY(30000), ALGORITHM=COPY;
UNLOCK TABLES;
DROP VIEW v2;
DROP TABLE t1, t2;
# End of 10.2 tests
#
# MDEV-14669 Assertion `file->trn == trn' failed in ha_maria::start_stmt
#
CREATE TABLE t1 (i INT) ENGINE=Aria;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (c CHAR(1)) ENGINE=Aria;
INSERT INTO t2 VALUES ('a'),('b');
connect con1,localhost,root,,test;
LOCK TABLE t1 WRITE;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
connection default;
DELETE FROM t2 WHERE c < 1;
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'a'
Warning 1292 Truncated incorrect DOUBLE value: 'b'
connection con1;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
disconnect con1;
connection default;
DROP TABLE t1, t2;
#
# MDEV-22829 SIGSEGV in _ma_reset_history on LOCK
#
CREATE TABLE t1 (f1 INT) ENGINE=Aria;
CREATE TABLE t2 (f2 INT) ENGINE=Aria;
LOCK TABLES t2 WRITE, t1 WRITE;
INSERT INTO t1 VALUES (1);
CREATE TRIGGER ai AFTER INSERT ON t1 FOR EACH ROW UPDATE t1 SET v=1 WHERE b=new.a;
ERROR 42S22: Unknown column 'a' in 'NEW'
UNLOCK TABLES;
DROP TABLE t1, t2;
|