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

« back to all changes in this revision

Viewing changes to mysql-test/t/partition_mgm.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
-- source include/have_partition.inc
 
2
--disable_warnings
 
3
DROP TABLE IF EXISTS t1;
 
4
--enable_warnings
 
5
 
 
6
#
 
7
# Bug 40389: REORGANIZE PARTITION crashes when only using one partition
 
8
#
 
9
CREATE TABLE t1 (a INT PRIMARY KEY)
 
10
ENGINE MYISAM
 
11
PARTITION BY HASH (a)
 
12
PARTITIONS 1;
 
13
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
 
14
ALTER TABLE t1 REORGANIZE PARTITION;
 
15
DROP TABLE t1;
 
16
 
 
17
#
 
18
# Bug 21143: mysqld hang when error in number of subparts in
 
19
#            REORGANIZE command
 
20
#
 
21
create table t1 (a int)
 
22
partition by range (a)
 
23
subpartition by key (a)
 
24
(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
 
25
 partition p1 values less than (20) (subpartition sp10, subpartition sp11));
 
26
 
 
27
-- error ER_PARTITION_WRONG_NO_SUBPART_ERROR
 
28
alter table t1 reorganize partition p0 into
 
29
(partition p0 values less than (10) (subpartition sp00,
 
30
subpartition sp01, subpartition sp02));
 
31
drop table t1;
 
32
 
 
33
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
 
34
PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
 
35
SHOW CREATE TABLE t1;
 
36
let $MYSQLD_DATADIR= `select @@datadir`;
 
37
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
 
38
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
 
39
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
 
40
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
 
41
-- file_exists $MYSQLD_DATADIR/test/t1.frm
 
42
-- file_exists $MYSQLD_DATADIR/test/t1.par
 
43
ALTER TABLE t1 COALESCE PARTITION 1;
 
44
SHOW CREATE TABLE t1;
 
45
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
 
46
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
 
47
-- file_exists $MYSQLD_DATADIR/test/t1.frm
 
48
-- file_exists $MYSQLD_DATADIR/test/t1.par
 
49
drop table t1;
 
50
#
 
51
# Bug 20767: REORGANIZE partition crashes
 
52
#
 
53
create table t1 (a int)
 
54
partition by list (a)
 
55
subpartition by hash (a)
 
56
(partition p11 values in (1,2),
 
57
 partition p12 values in (3,4));
 
58
 
 
59
alter table t1 REORGANIZE partition p11, p12 INTO
 
60
(partition p1 values in (1,2,3,4));
 
61
 
 
62
alter table t1 REORGANIZE partition p1 INTO
 
63
(partition p11 values in (1,2),
 
64
 partition p12 values in (3,4));
 
65
 
 
66
drop table t1;
 
67
#
 
68
# Verification tests for bug#14326
 
69
#
 
70
CREATE TABLE t1 (a INT)
 
71
/*!50100 PARTITION BY HASH (a)
 
72
/* Test
 
73
   of multi-line
 
74
   comment */
 
75
PARTITIONS 5 */;
 
76
SHOW CREATE TABLE t1;
 
77
DROP TABLE t1;
 
78
CREATE TABLE t1 (a INT)
 
79
/*!50100 PARTITION BY HASH (a)
 
80
-- with a single line comment embedded
 
81
PARTITIONS 5 */;
 
82
SHOW CREATE TABLE t1;
 
83
DROP TABLE t1;
 
84
CREATE TABLE t1 (a INT)
 
85
/*!50100 PARTITION BY HASH (a)
 
86
PARTITIONS 5 */;
 
87
SHOW CREATE TABLE t1;
 
88
DROP TABLE t1;
 
89
CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
 
90
SHOW CREATE TABLE t1;
 
91
DROP TABLE t1;