mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / partition_archive.test
blobfad57107b7d076e4922e3bd19b7e035c2037e5c3
1 # Tests for the partition storage engine in connection with the
2 # storage engine ARCHIVE.
4 # Creation:
5 # 2007-10-18 mleich  - Move ARCHIVE related sub tests of partition.test to
6 #                      this test. Reason: ARCHIVE is not everytime available.
7 #                    - Minor cleanup
10 --source include/have_partition.inc
11 --source include/have_archive.inc
15 # Bug 17310 Partitions: Bugs with archived partitioned tables
17 --disable_warnings
18 drop database if exists db99;
19 drop table if exists t1;
20 --enable_warnings
22 create database db99;
23 use db99;
24 create table t1 (a int not null)
25 engine=archive
26 partition by list (a)
27 (partition p0 values in (1), partition p1 values in (2));
28 insert into t1 values (1), (2);
29 --error 0, ER_CANT_CREATE_TABLE
30 create index inx on t1 (a);
31 alter table t1 add partition (partition p2 values in (3));
32 alter table t1 drop partition p2;
33 use test;
34 drop database db99;
36 create table t1 (f1 integer) engine= ARCHIVE partition by list(f1)
38  partition p1 values in (1),
39  partition p2 values in (NULL),
40  partition p3 values in (2),
41  partition p4 values in (3),
42  partition p5 values in (4)
45 insert into t1 values (1),(2),(3),(4),(null);
46 select * from t1;
47 select * from t1 where f1 < 3;
48 drop table t1;
50 CREATE TABLE t1 (
51 a int not null,
52 b int not null,
53 c int not null) engine=ARCHIVE
54 partition by hash (a + 2)
55 partitions 3
56 (partition x1 tablespace ts1,
57  partition x2 tablespace ts2,
58  partition x3 tablespace ts3);
60 insert into t1 values (1,1,1);
61 insert into t1 values (2,1,1);
62 insert into t1 values (3,1,1);
63 insert into t1 values (4,1,1);
64 insert into t1 values (5,1,1);
66 select * from t1;
68 drop table t1;
71 # Bug #32247 Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table)
72 #   (though reported as InnoDB bug, requires some ARCHIVE tests
74 create table t1 (a int) engine=archive partition by hash(a);
75 show create table t1;
76 drop table t1;
78 CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
79                 f1 VARCHAR(25),
80                 PRIMARY KEY(id)) ENGINE=ARCHIVE
81                      PARTITION BY RANGE(id)
82                      SUBPARTITION BY hash(id) subpartitions 2
83                      (PARTITION pa1 values less than (10),
84                       PARTITION pa2 values less than (20),
85                       PARTITION pa3 values less than (30),
86                       PARTITION pa4 values less than (40),
87                       PARTITION pa5 values less than (50),
88                       PARTITION pa6 values less than (60),
89                       PARTITION pa7 values less than (70),
90                       PARTITION pa8 values less than (80),
91                       PARTITION pa9 values less than (90),
92                       PARTITION pa10 values less than (100),
93                       PARTITION pa11 values less than MAXVALUE);
95 --disable_query_log
96 let $n= 100;
97 while ($n)
99   insert into t1 (f1) values (repeat('a',25));
100   dec $n;
102 --enable_query_log
104 show create table t1;
105 select count(*) from t1;
106 drop table t1;