Debian Codegraph @

mysql-test/suite/maria/maria_partition.test

raw
1 # Aria tests which require partitioning enabled
2
3 --source include/have_partition.inc
4 -- source include/have_maria.inc
5
6 let $default_engine=`select @@global.default_storage_engine`;
7 let $default_checksum=`select @@global.aria_page_checksum`;
8 set global default_storage_engine=aria;
9 set session default_storage_engine=aria;
10 set global aria_page_checksum=0;
11
12 # Initialise
13 --disable_warnings
14 drop table if exists t1,t2;
15 drop view if exists v1;
16 --enable_warnings
17 SET SQL_WARNINGS=1;
18
19 #
20 # Bug #39227 Aria: crash with ALTER TABLE PARTITION
21 #
22
23 create table t1 (s1 int);
24 insert into t1 values (1);
25 --error ER_NO_PARTITION_FOR_GIVEN_VALUE
26 alter table t1 partition by list (s1) (partition p1 values in (2));
27 drop table t1;
28
29 #
30 # Test outer join const propagation
31 #
32 create table t2(a blob) engine=aria;
33 create table t1(a int primary key) engine=aria;
34 insert into t2 values ('foo'),('bar');
35 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
36 insert into t1 values (1);
37 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
38 insert into t1 values (2);
39 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
40 drop table t1,t2;
41
42 create table t2(a blob);
43 create table t1(a int primary key) PARTITION BY HASH (a) PARTITIONS 2;
44 insert into t2 values ('foo'),('bar');
45 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
46 insert into t1 values (1);
47 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
48 insert into t1 values (2);
49 select * from t2 left join t1 on (t2.a=t1.a) where t2.a='bbb';
50 drop table t1,t2;
51
52 #
53 # MDEV-6493
54 # Assertion `table->file->stats.records > 0 || error'
55 # failure, or 'Invalid write' valgrind warnings, or crash on scenario
56 # with Aria table, view, LOCK TABLES #
57 #
58
59 CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=Aria PARTITION BY KEY() PARTITIONS 2;
60 CREATE VIEW v1 AS SELECT * FROM t1;
61
62 LOCK TABLE v1 WRITE;
63 --error 1100
64 CREATE TABLE v1 (i INT);
65 INSERT INTO v1 VALUES (1);
66 UNLOCK TABLES;
67 check table t1;
68
69 SELECT * FROM t1;
70
71 drop table t1;
72 drop view v1;
73
74 # Set defaults back
75 --disable_result_log
76 --disable_query_log
77 eval set global default_storage_engine=$default_engine, aria_page_checksum=$default_checksum;
78 set global aria_log_file_size=default;
79 --enable_result_log
80 --enable_query_log