mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-13227: Assertion failure len < 16384 in file rem0rec.cc line 1285
Crashes with innodb_page_size=64K. Does not crash at <= 32K. Problem was that when blob record that was earlier < 16k is enlarged at update wo that length > 16K it should be stored externally. However, that was not enforced when page-size = 64K (note that 16K+1 < 64K/2 i.e. half of the btree leaf page). btr_cur_optimistic_update: limit max record size to 16K or in REDUNDANT row format to 16K-1.
This commit is contained in:
parent
f58142f644
commit
d1b3e428d4
5 changed files with 102 additions and 8 deletions
38
mysql-test/suite/innodb/r/innodb-enlarge-blob.result
Normal file
38
mysql-test/suite/innodb/r/innodb-enlarge-blob.result
Normal file
|
@ -0,0 +1,38 @@
|
|||
CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=DYNAMIC;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
SELECT * from t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=REDUNDANT;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
SELECT * from t1;
|
||||
DROP TABLE t1;
|
6
mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
Normal file
6
mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
Normal file
|
@ -0,0 +1,6 @@
|
|||
--innodb-file-per-table
|
||||
--innodb-file-format='Barracuda'
|
||||
--innodb-buffer-pool-size=32M
|
||||
--innodb-log-file-size=32M
|
||||
--innodb-strict-mode=OFF
|
||||
|
50
mysql-test/suite/innodb/t/innodb-enlarge-blob.test
Normal file
50
mysql-test/suite/innodb/t/innodb-enlarge-blob.test
Normal file
|
@ -0,0 +1,50 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/innodb_page_size.inc
|
||||
|
||||
#
|
||||
# MDEV-13227: Assertion failure len < 16384 in file rem0rec.cc line 1285
|
||||
# Crashes with innodb_page_size=64K. Does not crash at <= 32K.
|
||||
#
|
||||
CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=DYNAMIC;
|
||||
SHOW WARNINGS;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
# random data no output we are only interested if fails
|
||||
--disable_result_log
|
||||
SELECT * from t1;
|
||||
--enable_result_log
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a LONGTEXT) ENGINE=INNODB DEFAULT CHARSET=UTF8 ROW_FORMAT=REDUNDANT;
|
||||
SHOW WARNINGS;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B');
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
INSERT INTO t1 SELECT CONCAT('A', SPACE(4087), 'B') FROM t1;
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
UPDATE t1 SET a=CONCAT(a, RAND(), a);
|
||||
# random data no output we are only interested if fails
|
||||
--disable_result_log
|
||||
SELECT * from t1;
|
||||
--enable_result_log
|
||||
DROP TABLE t1;
|
|
@ -2316,10 +2316,10 @@ any_extern:
|
|||
rec = page_cur_get_rec(page_cursor);
|
||||
}
|
||||
|
||||
/* We limit max record size to 16k for 64k page size. */
|
||||
if (!dict_table_is_comp(index->table)
|
||||
&& new_rec_size > REDUNDANT_REC_MAX_DATA_SIZE) {
|
||||
ut_ad(srv_page_size == UNIV_PAGE_SIZE_MAX);
|
||||
/* We limit max record size to 16k even for 64k page size. */
|
||||
if (new_rec_size >= COMPRESSED_REC_MAX_DATA_SIZE ||
|
||||
(!dict_table_is_comp(index->table)
|
||||
&& new_rec_size >= REDUNDANT_REC_MAX_DATA_SIZE)) {
|
||||
err = DB_OVERFLOW;
|
||||
|
||||
goto func_exit;
|
||||
|
|
|
@ -2466,10 +2466,10 @@ any_extern:
|
|||
rec = page_cur_get_rec(page_cursor);
|
||||
}
|
||||
|
||||
/* We limit max record size to 16k for 64k page size. */
|
||||
if (!dict_table_is_comp(index->table)
|
||||
&& new_rec_size > REDUNDANT_REC_MAX_DATA_SIZE) {
|
||||
ut_ad(srv_page_size == UNIV_PAGE_SIZE_MAX);
|
||||
/* We limit max record size to 16k even for 64k page size. */
|
||||
if (new_rec_size >= COMPRESSED_REC_MAX_DATA_SIZE ||
|
||||
(!dict_table_is_comp(index->table)
|
||||
&& new_rec_size >= REDUNDANT_REC_MAX_DATA_SIZE)) {
|
||||
err = DB_OVERFLOW;
|
||||
|
||||
goto func_exit;
|
||||
|
|
Loading…
Add table
Reference in a new issue