MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert()

- Change partition does undo logging of all rows unnecessarily and
it invokes bulk insert during DDL. Better to avoid the logging of undo
records during copy of the parititon.
parent 742e1c72
......@@ -296,3 +296,11 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CREATE TABLE t2(d INT)ENGINE=InnoDB;
DROP TABLE t2, t1;
#
# MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
#
SET SESSION foreign_key_checks=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
INSERT INTO t1 VALUES (1),(2);
ALTER TABLE t1 REBUILD PARTITION p0;
DROP TABLE t1;
......@@ -304,3 +304,14 @@ SET SESSION foreign_key_checks=TRUE;
SHOW CREATE TABLE t1;
CREATE TABLE t2(d INT)ENGINE=InnoDB;
DROP TABLE t2, t1;
--echo #
--echo # MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
--echo #
SET SESSION foreign_key_checks=0;
CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
INSERT INTO t1 VALUES (1),(2);
ALTER TABLE t1 REBUILD PARTITION p0;
# Cleanup
DROP TABLE t1;
......@@ -2143,7 +2143,10 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
}
DBUG_ASSERT(m_new_file == 0);
m_new_file= new_file_array;
if (unlikely((error= copy_partitions(copied, deleted))))
(*m_new_file)->extra(HA_EXTRA_BEGIN_ALTER_COPY);
error= copy_partitions(copied, deleted);
(*m_new_file)->extra(HA_EXTRA_END_ALTER_COPY);
if (unlikely(error))
{
/*
Close and unlock the new temporary partitions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment