This changeset contains the following stuff:
- Fix for Bug#28827 Partition test needs archive engine Bug#26669 Two tests on partition fail while blackhole engine is missing Solution: Move ARCHIVE and BLACKHOLE sub test cases to their own main test. - The two bugs above + the fact that CSV could be also sometimes not available --> Move also CSV sub tests out. - Minor cleanups - Replace error numbers with error names - fix typos, wrong comments - remove redundant sub test cases - add missing drop database - SET GLOBAL general_log = default is wrong, = 1 is correct
This commit is contained in:
parent
14241c8297
commit
51fd4937c4
@ -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) (
|
||||
|
13
mysql-test/r/partition_archive.result
Normal file
13
mysql-test/r/partition_archive.result
Normal file
@ -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;
|
7
mysql-test/r/partition_blackhole.result
Normal file
7
mysql-test/r/partition_blackhole.result
Normal file
@ -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;
|
15
mysql-test/r/partition_csv.result
Normal file
15
mysql-test/r/partition_csv.result
Normal file
@ -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;
|
@ -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,
|
||||
@ -62,24 +67,15 @@ call pz();
|
||||
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),
|
||||
@ -100,15 +96,6 @@ select * from t1 where (a + 1) < 10;
|
||||
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
|
||||
#
|
||||
@ -412,34 +399,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)
|
||||
#
|
||||
@ -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));
|
||||
@ -1221,23 +1180,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
|
||||
#
|
||||
@ -1480,32 +1422,13 @@ 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),
|
||||
|
32
mysql-test/t/partition_archive.test
Normal file
32
mysql-test/t/partition_archive.test
Normal file
@ -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;
|
24
mysql-test/t/partition_blackhole.test
Normal file
24
mysql-test/t/partition_blackhole.test
Normal file
@ -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;
|
38
mysql-test/t/partition_csv.test
Normal file
38
mysql-test/t/partition_csv.test
Normal file
@ -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;
|
Loading…
x
Reference in New Issue
Block a user