mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-34078 Memory leak in InnoDB purge with 32-column PRIMARY KEY
row_purge_reset_trx_id(): Reserve large enough offsets for accomodating the maximum width PRIMARY KEY followed by DB_TRX_ID,DB_ROLL_PTR. Reviewed by: Thirunarayanan Balathandayuthapani
This commit is contained in:
@ -116,6 +116,29 @@ t12963823 CREATE TABLE `t12963823` (
|
||||
KEY `ndx_o` (`o`(500)),
|
||||
KEY `ndx_p` (`p`(500))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(c',
|
||||
GROUP_CONCAT(seq SEPARATOR
|
||||
' INT DEFAULT 0, c'),
|
||||
' INT DEFAULT 0, PRIMARY KEY(c',
|
||||
GROUP_CONCAT(seq SEPARATOR ', c'),
|
||||
')) ENGINE=InnoDB;') FROM seq_1_to_33);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
ERROR 42000: Too many key parts specified; max 32 parts allowed
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(c',
|
||||
GROUP_CONCAT(seq SEPARATOR
|
||||
' INT DEFAULT 0, c'),
|
||||
' INT DEFAULT 0, PRIMARY KEY(c',
|
||||
GROUP_CONCAT(seq SEPARATOR ', c'),
|
||||
')) ENGINE=InnoDB;') FROM seq_1_to_32);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
INSERT INTO t1() VALUES();
|
||||
InnoDB 0 transactions not purged
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge, t12637786, t12963823;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
|
||||
|
@ -1,5 +1,6 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
|
||||
@ -110,8 +111,34 @@ CREATE INDEX ndx_n ON t12963823 (n(500));
|
||||
CREATE INDEX ndx_o ON t12963823 (o(500));
|
||||
CREATE INDEX ndx_p ON t12963823 (p(500));
|
||||
SHOW CREATE TABLE t12963823;
|
||||
# We need to activate the purge thread before DROP TABLE.
|
||||
|
||||
DELIMITER $$;
|
||||
--error ER_TOO_MANY_KEY_PARTS
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(c',
|
||||
GROUP_CONCAT(seq SEPARATOR
|
||||
' INT DEFAULT 0, c'),
|
||||
' INT DEFAULT 0, PRIMARY KEY(c',
|
||||
GROUP_CONCAT(seq SEPARATOR ', c'),
|
||||
')) ENGINE=InnoDB;') FROM seq_1_to_33);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1(c',
|
||||
GROUP_CONCAT(seq SEPARATOR
|
||||
' INT DEFAULT 0, c'),
|
||||
' INT DEFAULT 0, PRIMARY KEY(c',
|
||||
GROUP_CONCAT(seq SEPARATOR ', c'),
|
||||
')) ENGINE=InnoDB;') FROM seq_1_to_32);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
INSERT INTO t1() VALUES();
|
||||
|
||||
# We need to activate the purge thread before DROP TABLE.
|
||||
-- source include/wait_all_purged.inc
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge, t12637786, t12963823;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
|
||||
|
Reference in New Issue
Block a user