summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/partition.result43
-rw-r--r--mysql-test/r/partition_archive.result13
-rw-r--r--mysql-test/r/partition_blackhole.result7
-rw-r--r--mysql-test/r/partition_csv.result15
-rw-r--r--mysql-test/t/partition.test121
-rw-r--r--mysql-test/t/partition_archive.test32
-rw-r--r--mysql-test/t/partition_blackhole.test24
-rw-r--r--mysql-test/t/partition_csv.test38
8 files changed, 151 insertions, 142 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 7120e3ea9e6..c367619f495 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -33,11 +33,6 @@ call pz();
call pz();
drop procedure pz;
drop table t1;
-create table t1 (a int)
-engine = csv
-partition by list (a)
-(partition p0 values in (null));
-ERROR HY000: Engine cannot be used in partitioned tables
create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
@@ -68,11 +63,6 @@ a
18446744073709551614
drop table t1;
create table t1 (a int)
-engine = csv
-partition by list (a)
-(partition p0 values in (null));
-ERROR HY000: Engine cannot be used in partitioned tables
-create table t1 (a int)
partition by key(a)
(partition p0 engine = MEMORY);
drop table t1;
@@ -319,18 +309,6 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
drop table t1;
-CREATE TABLE `t1` (
-`id` int(11) default NULL
-) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
-SELECT * FROM t1;
-id
-drop table t1;
-CREATE TABLE `t1` (
-`id` int(11) default NULL
-) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
-SELECT * FROM t1;
-id
-drop table t1;
create table t1
(a int)
partition by range (a)
@@ -1050,18 +1028,6 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
drop table t1;
-create database db99;
-use db99;
-create table t1 (a int not null)
-engine=archive
-partition by list (a)
-(partition p0 values in (1), partition p1 values in (2));
-insert into t1 values (1), (2);
-create index inx on t1 (a);
-alter table t1 add partition (partition p2 values in (3));
-alter table t1 drop partition p2;
-use test;
-drop database db99;
drop procedure if exists mysqltest_1;
create table t1 (a int)
partition by list (a)
@@ -1259,15 +1225,6 @@ INSERT INTO t1 SELECT a + 8, b FROM t1;
ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64));
ALTER TABLE t1 DROP PARTITION p1;
DROP TABLE t1;
-USE mysql;
-SET GLOBAL general_log = 0;
-ALTER TABLE general_log ENGINE = MyISAM;
-ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
-(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
-ERROR HY000: Incorrect usage of PARTITION and log table
-ALTER TABLE general_log ENGINE = CSV;
-SET GLOBAL general_log = default;
-use test;
create table t2 (b int);
create table t1 (b int)
PARTITION BY RANGE (t2.b) (
diff --git a/mysql-test/r/partition_archive.result b/mysql-test/r/partition_archive.result
new file mode 100644
index 00000000000..dd063f6224c
--- /dev/null
+++ b/mysql-test/r/partition_archive.result
@@ -0,0 +1,13 @@
+drop database if exists db99;
+create database db99;
+use db99;
+create table t1 (a int not null)
+engine=archive
+partition by list (a)
+(partition p0 values in (1), partition p1 values in (2));
+insert into t1 values (1), (2);
+create index inx on t1 (a);
+alter table t1 add partition (partition p2 values in (3));
+alter table t1 drop partition p2;
+use test;
+drop database db99;
diff --git a/mysql-test/r/partition_blackhole.result b/mysql-test/r/partition_blackhole.result
new file mode 100644
index 00000000000..225cc1886fd
--- /dev/null
+++ b/mysql-test/r/partition_blackhole.result
@@ -0,0 +1,7 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE `t1` (
+`id` int(11) default NULL
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
+SELECT * FROM t1;
+id
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_csv.result b/mysql-test/r/partition_csv.result
new file mode 100644
index 00000000000..b5e1dcd9541
--- /dev/null
+++ b/mysql-test/r/partition_csv.result
@@ -0,0 +1,15 @@
+drop table if exists t1;
+create table t1 (a int)
+engine = csv
+partition by list (a)
+(partition p0 values in (null));
+ERROR HY000: Engine cannot be used in partitioned tables
+USE mysql;
+SET GLOBAL general_log = 0;
+ALTER TABLE general_log ENGINE = MyISAM;
+ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
+(PARTITION p0 VALUES LESS THAN (733144),
+PARTITION p1 VALUES LESS THAN (3000000));
+ERROR HY000: Incorrect usage of PARTITION and log table
+ALTER TABLE general_log ENGINE = CSV;
+SET GLOBAL general_log = 1;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 2be2ab83c88..2fbf8aa7a65 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1,9 +1,14 @@
#--disable_abort_on_error
#
# Simple test for the partition storage engine
-# Taken fromm the select test
+# taken from the select test.
#
--- source include/have_partition.inc
+# Last update:
+# 2007-10-22 mleich - Move ARCHIVE, BLACKHOLE and CSV related sub tests to
+# new tests. Reason: All these might be not available.
+# - Minor cleanup
+#
+--source include/have_partition.inc
--disable_warnings
drop table if exists t1;
@@ -12,19 +17,19 @@ drop table if exists t1;
#
# Bug 15890: Strange number of partitions accepted
#
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by key(a)
partitions 0.2+e1;
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by key(a)
partitions -1;
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by key(a)
partitions 1.5;
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by key(a)
partitions 1e+300;
@@ -32,7 +37,7 @@ partitions 1e+300;
#
# Bug 21350: Data Directory problems
#
--- error 1103
+-- error ER_WRONG_TABLE_NAME
create table t1 (a int)
partition by key (a)
(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
@@ -41,7 +46,7 @@ partition by key (a)
# Insert a test that manages to create the first partition and fails with
# the second, ensure that we clean up afterwards in a proper manner.
#
---error 1103
+--error ER_WRONG_TABLE_NAME
create table t1 (a int)
partition by key (a)
(partition p0,
@@ -63,23 +68,14 @@ drop procedure pz;
drop table t1;
#
-# Bug 19307: CSV engine crashes
-#
---error ER_PARTITION_MERGE_ERROR
-create table t1 (a int)
-engine = csv
-partition by list (a)
-(partition p0 values in (null));
-
-#
# BUG 16002: Handle unsigned integer functions properly
#
---error 1064
+--error ER_PARSE_ERROR
create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
---error 1064
+--error ER_PARSE_ERROR
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
@@ -101,15 +97,6 @@ select * from t1 where (a + 1) > 10;
drop table t1;
#
-# Bug 19307: CSV engine crashes
-#
---error ER_PARTITION_MERGE_ERROR
-create table t1 (a int)
-engine = csv
-partition by list (a)
-(partition p0 values in (null));
-
-#
# Added test case
#
create table t1 (a int)
@@ -413,34 +400,6 @@ analyze table t1;
drop table t1;
#
-# BUG 14524
-#
-# Disable warnings to allow this test case to work without
-# the Blackhole engine.
---disable_warnings
-CREATE TABLE `t1` (
- `id` int(11) default NULL
-) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
---enable_warnings
-SELECT * FROM t1;
-
-drop table t1;
-
-#
-# BUG 14524
-#
-# Disable warnings to allow this test case to work without
-# the Blackhole engine.
---disable_warnings
-CREATE TABLE `t1` (
- `id` int(11) default NULL
-) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
---enable_warnings
-SELECT * FROM t1;
-
-drop table t1;
-
-#
# BUG 15221 (Cannot reorganize with the same name)
#
create table t1
@@ -766,7 +725,7 @@ create table t1 (a int)
partition by list (a)
(partition p0 values in (1));
---error 1064
+--error ER_PARSE_ERROR
alter table t1 rebuild partition;
drop table t1;
@@ -810,14 +769,14 @@ drop table t1;
#
# BUG 15407 Crash with subpartition
#
---error 1064
+--error ER_PARSE_ERROR
create table t1 (a int, b int)
partition by range (a)
subpartition by hash(a)
(partition p0 values less than (0) (subpartition sp0),
partition p1 values less than (1));
---error 1064
+--error ER_PARSE_ERROR
create table t1 (a int, b int)
partition by range (a)
subpartition by hash(a)
@@ -875,7 +834,7 @@ create table t1 (a int)
partition by list (a)
(partition p0 values in (1));
---error 1064
+--error ER_PARSE_ERROR
alter table t1 rebuild partition;
drop table t1;
@@ -937,7 +896,7 @@ drop table t1;
#
prepare stmt1 from 'create table t1 (s1 int) partition by hash (s1)';
execute stmt1;
---error 1050
+--error ER_TABLE_EXISTS_ERROR
execute stmt1;
drop table t1;
@@ -1126,7 +1085,7 @@ PARTITION BY LIST (a)
SHOW CREATE TABLE t1;
DROP TABLE t1;
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
@@ -1222,23 +1181,6 @@ OPTIMIZE TABLE t1;
drop table t1;
#
-# Bug 17310 Partitions: Bugs with archived partitioned tables
-#
-create database db99;
-use db99;
-create table t1 (a int not null)
-engine=archive
-partition by list (a)
-(partition p0 values in (1), partition p1 values in (2));
-insert into t1 values (1), (2);
---error 0, 1005
-create index inx on t1 (a);
-alter table t1 add partition (partition p2 values in (3));
-alter table t1 drop partition p2;
-use test;
-drop database db99;
-
-#
#BUG 17138 Problem with stored procedure and analyze partition
#
--disable_warnings
@@ -1481,31 +1423,12 @@ ALTER TABLE t1 DROP PARTITION p1;
DROP TABLE t1;
#
-# Bug #27816: Log tables ran with partitions crashes the server when logging
-# is enabled.
-#
-
-USE mysql;
-SET GLOBAL general_log = 0;
-ALTER TABLE general_log ENGINE = MyISAM;
---error ER_WRONG_USAGE
-ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
- (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
-ALTER TABLE general_log ENGINE = CSV;
-SET GLOBAL general_log = default;
-use test;
-
-#
# Bug #27084 partitioning by list seems failing when using case
# BUG #18198: Case no longer supported, test case removed
#
-#
-# Bug #29444: crash with partition refering to table in create-select
-#
-
create table t2 (b int);
---error 1054
+--error ER_BAD_FIELD_ERROR
create table t1 (b int)
PARTITION BY RANGE (t2.b) (
PARTITION p1 VALUES LESS THAN (10),
diff --git a/mysql-test/t/partition_archive.test b/mysql-test/t/partition_archive.test
new file mode 100644
index 00000000000..3109894d9c9
--- /dev/null
+++ b/mysql-test/t/partition_archive.test
@@ -0,0 +1,32 @@
+# Tests for the partition storage engine in connection with the
+# storage engine ARCHIVE.
+#
+# Creation:
+# 2007-10-18 mleich - Move ARCHIVE related sub tests of partition.test to
+# this test. Reason: ARCHIVE is not everytime available.
+# - Minor cleanup
+#
+
+--source include/have_partition.inc
+--source include/have_archive.inc
+
+
+#
+# Bug 17310 Partitions: Bugs with archived partitioned tables
+#
+--disable_warnings
+drop database if exists db99;
+--enable_warnings
+create database db99;
+use db99;
+create table t1 (a int not null)
+engine=archive
+partition by list (a)
+(partition p0 values in (1), partition p1 values in (2));
+insert into t1 values (1), (2);
+--error 0, ER_CANT_CREATE_TABLE
+create index inx on t1 (a);
+alter table t1 add partition (partition p2 values in (3));
+alter table t1 drop partition p2;
+use test;
+drop database db99;
diff --git a/mysql-test/t/partition_blackhole.test b/mysql-test/t/partition_blackhole.test
new file mode 100644
index 00000000000..9344ecb3b62
--- /dev/null
+++ b/mysql-test/t/partition_blackhole.test
@@ -0,0 +1,24 @@
+# Tests for the partition storage engine in connection with the
+# storage engine BLACKHOLE.
+#
+# Creation:
+# 2007-10-18 mleich - Move BLACKHOLE related sub tests of partition.test to
+# this test. Reason: BLACKHOLE is not everytime available.
+# - Minor cleanup
+#
+
+--source include/have_partition.inc
+--source include/have_blackhole.inc
+
+#
+# Bug#14524 Partitions: crash if blackhole
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE `t1` (
+ `id` int(11) default NULL
+) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1 PARTITION BY HASH (id) ;
+SELECT * FROM t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_csv.test b/mysql-test/t/partition_csv.test
new file mode 100644
index 00000000000..aa3d9d67c26
--- /dev/null
+++ b/mysql-test/t/partition_csv.test
@@ -0,0 +1,38 @@
+# Tests for the partition storage engine in connection with the
+# storage engine CSV.
+#
+# Creation:
+# 2007-10-18 mleich - Move CSV related sub tests of partition.test to
+# this test. Reason: CSV is not everytime available.
+# - Minor cleanup
+#
+
+--source include/have_partition.inc
+--source include/have_csv.inc
+
+#
+# Bug#19307: Partitions: csv delete failure
+# = CSV engine crashes
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--error ER_PARTITION_MERGE_ERROR
+create table t1 (a int)
+engine = csv
+partition by list (a)
+(partition p0 values in (null));
+
+#
+# Bug#27816: Log tables ran with partitions crashes the server when logging
+# is enabled.
+#
+USE mysql;
+SET GLOBAL general_log = 0;
+ALTER TABLE general_log ENGINE = MyISAM;
+--error ER_WRONG_USAGE
+ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
+ (PARTITION p0 VALUES LESS THAN (733144),
+ PARTITION p1 VALUES LESS THAN (3000000));
+ALTER TABLE general_log ENGINE = CSV;
+SET GLOBAL general_log = 1;