Skip to content
Permalink
Browse files
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.
  • Loading branch information
Thirunarayanan committed Aug 1, 2022
1 parent 742e1c7 commit 3330f8d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
@@ -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.

0 comments on commit 3330f8d

Please sign in to comment.