1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-19292 "Row size too large" error when creating table with lots columns when row format is DYNAMIC or COMPRESSED

Basic idea of the patch: disallow creating tables which allow to create
rows which are too big to insert. In other words, if user created a table user
should never see an errors like 'can not insert row as it is too big for current
page size'.

SET innodb_strict_mode=OFF; will allow to create very long tables and only a
warning will be issued.

dict_table_t::get_overflow_field_local_len(): this function lets know a maximum
local field len for overflow fields for every file and row format.

innobase_check_column_length(): improve name to too_big_key_part_length()
and reuse in a different part of code.

create_table_info_t::prepare_create_table(): add check for maximum allowed
key part length to keep ALGORITHM=COPY behavior similar to ALGORITHM=INPLACE
behavior. Affected test is innodb.strict_mode

Rename dict_index_too_big_for_tree() to
dict_index_t::rec_potentially_too_big(): copy overflow-related size computation
from dtuple_convert_big_rec(). A lot of tests was changed because of that.
I wonder whether users will complain about it?

Test innodb.max_record_size tests dict_index_t::rec_potentially_too_big()
for different row formats and page sizes.
This commit is contained in:
Eugene Kosov
2019-06-26 16:10:00 +03:00
parent 044d0ffcf3
commit 5ebef42238
38 changed files with 4153 additions and 1492 deletions

View File

@ -1,3 +1,5 @@
call mtr.add_suppression("Cannot add field `b_str_20` in table `test`.`test_tab` because after adding it, the row size is");
SET innodb_strict_mode=OFF;
CREATE TABLE test_tab (
a_str_18 mediumtext,
b_str_3 varchar(32) DEFAULT NULL,
@ -123,6 +125,9 @@ KEY b_str_5 (b_str_5),
KEY b_str_31 (b_str_31),
KEY a_ref_11 (a_ref_11)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
Warnings:
Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
SET innodb_strict_mode=ON;
BEGIN;
INSERT INTO test_tab (b_str_26, a_str_13, a_str_18) VALUES
('a', REPEAT('f',4031), REPEAT('g', 4031));