merge into 5.1-sec of bug#11766879.
This commit is contained in:
commit
1cfcab041a
@ -1,3 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB,
|
||||||
|
# PARTITONING, ON INDEX CREATE
|
||||||
|
#
|
||||||
|
call mtr.add_suppression("contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL");
|
||||||
|
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
|
||||||
|
DROP TABLE t1;
|
||||||
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
|
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
|
||||||
#
|
#
|
||||||
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
|
# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
|
||||||
|
@ -1,10 +1,34 @@
|
|||||||
--source include/have_partition.inc
|
--source include/have_partition.inc
|
||||||
--source include/have_innodb_plugin.inc
|
--source include/have_innodb_plugin.inc
|
||||||
# Remove the line below when bug#53307 is solved.
|
|
||||||
--source include/not_valgrind.inc
|
|
||||||
|
|
||||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
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 #
|
||||||
|
call mtr.add_suppression("contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL");
|
||||||
|
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;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
|
call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt
|
--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt
|
||||||
|
@ -6490,7 +6490,25 @@ int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
|
|||||||
*/
|
*/
|
||||||
for (file= m_file; *file; file++)
|
for (file= m_file; *file; file++)
|
||||||
if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys)))
|
if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys)))
|
||||||
break;
|
goto err;
|
||||||
|
return ret;
|
||||||
|
err:
|
||||||
|
if (file > m_file)
|
||||||
|
{
|
||||||
|
uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
|
||||||
|
KEY *old_key_info= table_arg->key_info;
|
||||||
|
uint i;
|
||||||
|
/* Use the newly added key_info as table->key_info to remove them. */
|
||||||
|
for (i= 0; i < num_of_keys; i++)
|
||||||
|
key_numbers[i]= i;
|
||||||
|
table_arg->key_info= key_info;
|
||||||
|
while (--file >= m_file)
|
||||||
|
{
|
||||||
|
(void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
|
||||||
|
(void) (*file)->final_drop_index(table_arg);
|
||||||
|
}
|
||||||
|
table_arg->key_info= old_key_info;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user