config root man

Current Path : /usr/opt/mysql57/mysql-test/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/t/partition_mgm.test

-- source include/have_partition.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

--echo #
--echo # Bug#13357766: ASSERT IN HANDLER::HA_CREATE
--echo #
CREATE TABLE t1
(a INT)
PARTITION BY KEY(a) PARTITIONS 3;
ALTER TABLE t1 REPAIR PARTITION p2,p3,p1;
ALTER TABLE t1 ORDER BY a; 
DROP TABLE t1;

--echo #
--echo # Bug#11764110/bug#56909: REORGANIZE PARTITION is allowed on
--echo #                         HASH/KEY partitioned tables
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE MYISAM
PARTITION BY HASH (a)
PARTITIONS 1;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
INSERT INTO t1 VALUES (12), (13), (14), (15), (16), (17), (18), (19), (20);
--echo # This changes from auto partitioned to manual partitioned
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO (PARTITION pHidden);
SHOW CREATE TABLE t1;
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
ALTER TABLE t1 ADD PARTITION
(PARTITION pNamed1);
ALTER TABLE t1 ADD PARTITION
(PARTITION pNamed2);
ALTER TABLE t1 ADD PARTITION
(PARTITION p5);
--error ER_SAME_NAME_PARTITION
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 REBUILD PARTITION all;
ALTER TABLE t1 REBUILD PARTITION pNamed1,p5;
ALTER TABLE t1 COALESCE PARTITION 1;
ALTER TABLE t1 COALESCE PARTITION 2;
SHOW CREATE TABLE t1;
DROP TABLE t1;

#
# Bug 40389: REORGANIZE PARTITION crashes when only using one partition
#
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE MYISAM
PARTITION BY HASH (a)
PARTITIONS 1;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
ALTER TABLE t1 REORGANIZE PARTITION;
DROP TABLE t1;

#
# Bug 21143: mysqld hang when error in number of subparts in
#            REORGANIZE command
#
create table t1 (a int)
partition by range (a)
subpartition by key (a)
(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
 partition p1 values less than (20) (subpartition sp10, subpartition sp11));

-- error ER_PARTITION_WRONG_NO_SUBPART_ERROR
alter table t1 reorganize partition p0 into
(partition p0 values less than (10) (subpartition sp00,
subpartition sp01, subpartition sp02));
drop table t1;
 
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) ENGINE=MYISAM
PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p1.MYI
-- file_exists $MYSQLD_DATADIR/test/t1.frm
-- file_exists $MYSQLD_DATADIR/test/t1.par
ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYD
-- file_exists $MYSQLD_DATADIR/test/t1#P#p0.MYI
-- file_exists $MYSQLD_DATADIR/test/t1.frm
-- file_exists $MYSQLD_DATADIR/test/t1.par
drop table t1;
#
# Bug 20767: REORGANIZE partition crashes
#
create table t1 (a int)
partition by list (a)
subpartition by hash (a)
(partition p11 values in (1,2),
 partition p12 values in (3,4));

alter table t1 REORGANIZE partition p11, p12 INTO
(partition p1 values in (1,2,3,4));

alter table t1 REORGANIZE partition p1 INTO
(partition p11 values in (1,2),
 partition p12 values in (3,4));

drop table t1;
#
# Verification tests for bug#14326
#
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
/* Test
   of multi-line
   comment */
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # Bug#20727344: PARTITIONED TABLES NOT UPGRADED TO USE
--echo # NATIVE PARTITIONING
--echo #
CREATE TABLE t1 (a int PRIMARY KEY, b varchar(63))
ENGINE = MyISAM
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (100),
 PARTITION p1 VALUES LESS THAN (200),
 PARTITION pmax VALUES LESS THAN MAXVALUE);

INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
UPDATE t1 SET b = CONCAT("Filler_", a);
INSERT INTO t1 SELECT a + 100, CONCAT("Filler_", a + 100) FROM t1;
INSERT INTO t1 SELECT a + 200, CONCAT("Filler_", a + 200) FROM t1;

--enable_info
ALTER TABLE t1 UPGRADE PARTITIONING;
ALTER TABLE t1 ALGORITHM = INPLACE, UPGRADE PARTITIONING;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 ALGORITHM = COPY, UPGRADE PARTITIONING;
--disable_info

ALTER TABLE t1 REMOVE PARTITIONING;
--error ER_PARTITION_MGMT_ON_NONPARTITIONED
ALTER TABLE t1 UPGRADE PARTITIONING;

DROP TABLE t1;

Man Man