~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/partition_archive.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Tests for the partition storage engine in connection with the
 
2
# storage engine ARCHIVE.
 
3
#
 
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
 
8
#
 
9
 
 
10
--source include/have_partition.inc
 
11
--source include/have_archive.inc
 
12
 
 
13
 
 
14
#
 
15
# Bug 17310 Partitions: Bugs with archived partitioned tables
 
16
#
 
17
--disable_warnings
 
18
drop database if exists db99;
 
19
drop table if exists t1;
 
20
--enable_warnings
 
21
 
 
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;
 
35
 
 
36
create table t1 (f1 integer) engine= ARCHIVE partition by list(f1)
 
37
(
 
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)
 
43
);
 
44
 
 
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;
 
49
 
 
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);
 
59
 
 
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);
 
65
 
 
66
select * from t1;
 
67
 
 
68
drop table t1;
 
69
 
 
70
#
 
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
 
73
 
 
74
create table t1 (a int) engine=archive partition by hash(a);
 
75
show create table t1;
 
76
drop table t1;
 
77
 
 
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);
 
94
 
 
95
--disable_query_log
 
96
let $n= 100;
 
97
while ($n)
 
98
{
 
99
  insert into t1 (f1) values (repeat('a',25));
 
100
  dec $n;
 
101
}
 
102
--enable_query_log
 
103
 
 
104
show create table t1;
 
105
select count(*) from t1;
 
106
drop table t1;
 
107