Skip to content

Commit 56b97ca

Browse files
committed
MDEV-29742 heap number overflow
A previous fix in commit efd8af5 failed to cover ALTER TABLE. PageBulk::isSpaceAvailable(): Check for record heap number overflow.
1 parent 602124b commit 56b97ca

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

mysql-test/suite/innodb/r/innodb-64k.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,9 +1081,11 @@ COMMIT;
10811081
drop table t2;
10821082
DROP TABLE t1;
10831083
#
1084-
# MDEV-19526 heap number overflow
1084+
# MDEV-19526/MDEV-29742 heap number overflow
10851085
#
10861086
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
10871087
ENGINE=InnoDB;
10881088
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
1089+
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
10891090
DROP TABLE t1;
1091+
# End of 10.3 tests

mysql-test/suite/innodb/t/innodb-64k.test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,12 @@ drop table t2;
641641
DROP TABLE t1;
642642

643643
--echo #
644-
--echo # MDEV-19526 heap number overflow
644+
--echo # MDEV-19526/MDEV-29742 heap number overflow
645645
--echo #
646646
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
647647
ENGINE=InnoDB;
648648
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
649+
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
649650
DROP TABLE t1;
651+
652+
--echo # End of 10.3 tests

storage/innobase/btr/btr0bulk.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2014, 2019, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, 2021, MariaDB Corporation.
4+
Copyright (c) 2017, 2022, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -597,6 +597,11 @@ bool
597597
PageBulk::isSpaceAvailable(
598598
ulint rec_size)
599599
{
600+
if (m_rec_no >= 8190) {
601+
ut_ad(srv_page_size == 65536);
602+
return false;
603+
}
604+
600605
ulint slot_size;
601606
ulint required_space;
602607

0 commit comments

Comments
 (0)