mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-19526 heap number overflow on innodb_page_size=64k
InnoDB only reserves 13 bits for the heap number in the record header, limiting the heap number to be at most 8191. But, when using innodb_page_size=64k and secondary index records of 7 bytes each, it is possible to exceed the maximum heap number. btr_cur_optimistic_insert(): Let the operation fail if the maximum number of records would be exceeded. page_mem_alloc_heap(): Move to the same compilation unit with the only caller, and let the operation fail if the maximum heap number has been allocated already.
This commit is contained in:
@ -1084,3 +1084,10 @@ update t2 set col145=@b;
|
||||
COMMIT;
|
||||
drop table t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-19526 heap number overflow
|
||||
#
|
||||
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
|
||||
ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
|
||||
DROP TABLE t1;
|
||||
|
@ -2,6 +2,7 @@
|
||||
# Tests for setting innodb-page-size=64k;
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_innodb_64k.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
|
||||
call mtr.add_suppression("InnoDB: Resizing redo log from *");
|
||||
@ -650,6 +651,15 @@ COMMIT;
|
||||
|
||||
drop table t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19526 heap number overflow
|
||||
--echo #
|
||||
CREATE TABLE t1(a SMALLINT NOT NULL UNIQUE AUTO_INCREMENT, KEY(a))
|
||||
ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a) SELECT seq FROM seq_1_to_8191;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# restore environment to the state it was before this test execution
|
||||
#
|
||||
|
Reference in New Issue
Block a user