Fix to ensure that all subpartitions gets deleted before renaming starts, BUG#47029
This commit is contained in:
parent
80d872bd9d
commit
ea5d204370
@ -1,4 +1,18 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
create table t1 (a int not null,
|
||||||
|
b datetime not null,
|
||||||
|
primary key (a,b))
|
||||||
|
engine=innodb
|
||||||
|
partition by range (to_days(b))
|
||||||
|
subpartition by hash (a)
|
||||||
|
subpartitions 2
|
||||||
|
( partition p0 values less than (to_days('2009-01-01')),
|
||||||
|
partition p1 values less than (to_days('2009-02-01')),
|
||||||
|
partition p2 values less than (to_days('2009-03-01')),
|
||||||
|
partition p3 values less than maxvalue);
|
||||||
|
alter table t1 reorganize partition p1,p2 into
|
||||||
|
( partition p2 values less than (to_days('2009-03-01')));
|
||||||
|
drop table t1;
|
||||||
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
|
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
|
||||||
PARTITION BY RANGE(id) (
|
PARTITION BY RANGE(id) (
|
||||||
PARTITION p0 VALUES LESS THAN (5),
|
PARTITION p0 VALUES LESS THAN (5),
|
||||||
|
@ -5,6 +5,23 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#47029: Crash when reorganize partition with subpartition
|
||||||
|
#
|
||||||
|
create table t1 (a int not null,
|
||||||
|
b datetime not null,
|
||||||
|
primary key (a,b))
|
||||||
|
engine=innodb
|
||||||
|
partition by range (to_days(b))
|
||||||
|
subpartition by hash (a)
|
||||||
|
subpartitions 2
|
||||||
|
( partition p0 values less than (to_days('2009-01-01')),
|
||||||
|
partition p1 values less than (to_days('2009-02-01')),
|
||||||
|
partition p2 values less than (to_days('2009-03-01')),
|
||||||
|
partition p3 values less than maxvalue);
|
||||||
|
alter table t1 reorganize partition p1,p2 into
|
||||||
|
( partition p2 values less than (to_days('2009-03-01')));
|
||||||
|
drop table t1;
|
||||||
#
|
#
|
||||||
# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
|
# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
|
||||||
# with partitions
|
# with partitions
|
||||||
|
@ -705,6 +705,7 @@ int ha_partition::rename_partitions(const char *path)
|
|||||||
if (m_is_sub_partitioned)
|
if (m_is_sub_partitioned)
|
||||||
{
|
{
|
||||||
List_iterator<partition_element> sub_it(part_elem->subpartitions);
|
List_iterator<partition_element> sub_it(part_elem->subpartitions);
|
||||||
|
j= 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
sub_elem= sub_it++;
|
sub_elem= sub_it++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user