Commit 899c5bd5 authored by Eugene Kosov's avatar Eugene Kosov

MDEV-20832 Don't print "row size too large" warnings in error log if...

MDEV-20832 Don't print "row size too large" warnings in error log if innodb_strict_mode=OFF and log_warnings<=2

create_table_info_t::row_size_is_acceptable(): add condition for log writing
parent 6718d3bc
call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
......
call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
......
call mtr.add_suppression("InnoDB: Cannot add field `.* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
call mtr.add_suppression("Row size too large (> 8126)*");
CREATE TABLE t1 ( text1 TEXT,
text2 TEXT,
......
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
SELECT @@innodb_page_size;
@@innodb_page_size
32768
......
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
SELECT @@innodb_page_size;
@@innodb_page_size
65536
......
call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
SET innodb_strict_mode = 0;
SET @@global.log_warnings = 3;
CREATE TABLE t1 (
col_1 TEXT
,col_2 TEXT
,col_3 TEXT
,col_4 TEXT
,col_5 TEXT
,col_6 TEXT
,col_7 TEXT
,col_8 TEXT
,col_9 TEXT
,col_10 TEXT
,col_11 TEXT
) ENGINE=INNODB 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.
DROP TABLE t1;
SET @@global.log_warnings = 2;
SET innodb_strict_mode = 1;
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,
......
......@@ -5,8 +5,6 @@
let $MYSQLD_DATADIR= `select @@datadir`;
call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
......
......@@ -5,8 +5,6 @@
let $MYSQLD_DATADIR= `select @@datadir`;
call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is");
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
o blob,p blob,q blob,r blob,s blob,t blob,u blob,
......
......@@ -3,7 +3,6 @@
# MDEV-7513: ib_warn_row_too_big dereferences null thd
call mtr.add_suppression("InnoDB: Cannot add field `.* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
call mtr.add_suppression("Row size too large (> 8126)*");
--disable_warnings
......
--source include/have_innodb.inc
--source include/have_innodb_32k.inc
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
# Check page size 32k
SELECT @@innodb_page_size;
......
--source include/have_innodb.inc
--source include/have_innodb_64k.inc
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
# Check page size 64k
SELECT @@innodb_page_size;
......
--source include/have_innodb.inc
call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
SET innodb_strict_mode = 0;
SET @@global.log_warnings = 3;
CREATE TABLE t1 (
col_1 TEXT
,col_2 TEXT
,col_3 TEXT
,col_4 TEXT
,col_5 TEXT
,col_6 TEXT
,col_7 TEXT
,col_8 TEXT
,col_9 TEXT
,col_10 TEXT
,col_11 TEXT
) ENGINE=INNODB ROW_FORMAT=COMPACT;
DROP TABLE t1;
SET @@global.log_warnings = 2;
SET innodb_strict_mode = 1;
--source include/have_innodb.inc
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,
......
......@@ -12964,12 +12964,15 @@ bool create_table_info_t::row_size_is_acceptable(
const size_t idx= info.get_first_overrun_field_index();
const dict_field_t *field= dict_index_get_nth_field(&index, idx);
if (strict || global_system_variables.log_warnings > 2)
{
ib::error_or_warn(strict)
<< "Cannot add field " << field->name << " in table "
<< index.table->name << " because after adding it, the row size is "
<< info.get_overrun_size()
<< " which is greater than maximum allowed size ("
<< info.max_leaf_size << " bytes) for a record on index leaf page.";
}
if (strict)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment