94 lines
3.3 KiB
Plaintext
94 lines
3.3 KiB
Plaintext
#
|
|
# Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB,
|
|
# PARTITONING, ON INDEX CREATE
|
|
# Bug#12696518: MEMORY LEAKS IN HA_PARTITION (VALGRIND TESTS ON TRUNK)
|
|
#
|
|
CREATE TABLE t1 (
|
|
id bigint NOT NULL AUTO_INCREMENT,
|
|
time date,
|
|
id2 bigint not null,
|
|
PRIMARY KEY (id,time)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
|
/*!50100 PARTITION BY RANGE(TO_DAYS(time))
|
|
(PARTITION p10 VALUES LESS THAN (734708) ENGINE = InnoDB,
|
|
PARTITION p20 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */;
|
|
Warnings:
|
|
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
|
|
INSERT INTO t1 (time,id2) VALUES ('2011-07-24',1);
|
|
INSERT INTO t1 (time,id2) VALUES ('2011-07-25',1);
|
|
INSERT INTO t1 (time,id2) VALUES ('2011-07-25',1);
|
|
CREATE UNIQUE INDEX uk_time_id2 on t1(time,id2);
|
|
ERROR 23000: Duplicate entry '2011-07-25-1' for key 'uk_time_id2'
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
3
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
`time` date NOT NULL,
|
|
`id2` bigint(20) NOT NULL,
|
|
PRIMARY KEY (`id`,`time`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
|
|
/*!50100 PARTITION BY RANGE (to_days(`time`))
|
|
(PARTITION p10 VALUES LESS THAN (734708) ENGINE = InnoDB,
|
|
PARTITION p20 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
|
|
DROP TABLE t1;
|
|
call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* Table `test`.`t1` .* Partition.* InnoDB internal");
|
|
#
|
|
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
|
|
#
|
|
# Connection con1
|
|
CREATE TABLE t1 (id INT NOT NULL
|
|
PRIMARY KEY,
|
|
user_num CHAR(10)
|
|
) ENGINE = InnoDB
|
|
KEY_BLOCK_SIZE=4
|
|
PARTITION BY HASH(id) PARTITIONS 1;
|
|
t1#P#p0.ibd
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`id` int(11) NOT NULL,
|
|
`user_num` char(10) DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci KEY_BLOCK_SIZE=4
|
|
/*!50100 PARTITION BY HASH (`id`)
|
|
PARTITIONS 1 */
|
|
SET GLOBAL innodb_file_per_table = OFF;
|
|
# Connection con2
|
|
LOCK TABLE t1 WRITE;
|
|
# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
|
|
# are incompatible with innodb_file_per_table = OFF;
|
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
|
|
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
|
t1#P#p0.ibd
|
|
# This SET is not needed to reproduce the bug,
|
|
# it is here just to make the test case more realistic
|
|
SET innodb_strict_mode = OFF;
|
|
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
|
|
Warnings:
|
|
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
|
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
|
|
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
|
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
|
|
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
|
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
|
|
ALTER TABLE t1 REBUILD PARTITION p0;
|
|
Warnings:
|
|
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
|
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
|
|
UNLOCK TABLES;
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`id` int(11) NOT NULL,
|
|
`user_num` char(10) DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci KEY_BLOCK_SIZE=4
|
|
/*!50100 PARTITION BY HASH (`id`)
|
|
PARTITIONS 3 */
|
|
DROP TABLE t1;
|
|
# Connection default
|
|
SET GLOBAL innodb_file_per_table = default;
|