1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00
This commit is contained in:
Mattias Jonsson
2011-09-15 21:32:25 +02:00
6 changed files with 331 additions and 48 deletions

View File

@ -1,3 +1,37 @@
#
# 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) */;
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 DEFAULT '0000-00-00',
`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("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
#
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt

View File

@ -1,4 +1,75 @@
DROP TABLE IF EXISTS t1;
#
# Bug#12696518/Bug#11766879/60106:DIFF BETWEEN # OF INDEXES IN MYSQL
# VS INNODB, PARTITONING, ON INDEX CREATE
#
CREATE TABLE t1
(a INT PRIMARY KEY,
b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (0, 'first row'), (1, 'second row'), (2, 'Third row');
INSERT INTO t1 VALUES (3, 'row id 3'), (4, '4 row'), (5, 'row5');
INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');
ALTER TABLE t1 ADD INDEX new_b_index (b);
ALTER TABLE t1 DROP INDEX new_b_index;
SET SESSION debug= "+d,ha_partition_fail_final_add_index";
ALTER TABLE t1 ADD INDEX (b);
ERROR HY000: Table has no partition for value 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(64) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 3 */
SELECT * FROM t1;
a b
0 first row
1 second row
2 Third row
3 row id 3
4 4 row
5 row5
6 X 6 row
7 Seventh row
8 Last row
FLUSH TABLES;
CREATE INDEX new_index ON t1 (b);
ERROR HY000: Table has no partition for value 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(64) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 3 */
SELECT * FROM t1;
a b
0 first row
1 second row
2 Third row
3 row id 3
4 4 row
5 row5
6 X 6 row
7 Seventh row
8 Last row
SET SESSION debug= "-d,ha_partition_fail_final_add_index";
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(64) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 3 */
DROP TABLE t1;
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was");
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
call mtr.add_suppression("InnoDB: Warning: MySQL is trying to drop table ");

View File

@ -12,6 +12,41 @@ DROP TABLE IF EXISTS t1;
--let $DATADIR= `SELECT @@datadir;`
--echo #
--echo # Bug#12696518/Bug#11766879/60106:DIFF BETWEEN # OF INDEXES IN MYSQL
--echo # VS INNODB, PARTITONING, ON INDEX CREATE
--echo #
CREATE TABLE t1
(a INT PRIMARY KEY,
b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (0, 'first row'), (1, 'second row'), (2, 'Third row');
INSERT INTO t1 VALUES (3, 'row id 3'), (4, '4 row'), (5, 'row5');
INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');
ALTER TABLE t1 ADD INDEX new_b_index (b);
ALTER TABLE t1 DROP INDEX new_b_index;
SET SESSION debug= "+d,ha_partition_fail_final_add_index";
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
ALTER TABLE t1 ADD INDEX (b);
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
FLUSH TABLES;
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
CREATE INDEX new_index ON t1 (b);
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
SET SESSION debug= "-d,ha_partition_fail_final_add_index";
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Checking with #innodb what this is...
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was");
# If there is a crash or failure between the ddl_log is written and the

View File

@ -3,6 +3,33 @@
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo #
--echo # Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB,
--echo # PARTITONING, ON INDEX CREATE
--echo # Bug#12696518: MEMORY LEAKS IN HA_PARTITION (VALGRIND TESTS ON TRUNK)
--echo #
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) */;
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);
--error ER_DUP_ENTRY
CREATE UNIQUE INDEX uk_time_id2 on t1(time,id2);
SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
--echo #
--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt