[MDEV-20949] Stop performing unnecessary maximum row size check for DML Created: 2019-11-02  Updated: 2023-11-27  Resolved: 2019-11-14

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.30, 10.3.21, 10.4.11

Type: Bug Priority: Major
Reporter: Eugene Kosov (Inactive) Assignee: Eugene Kosov (Inactive)
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
PartOf
is part of MDEV-20194 Warnings inconsistently issued upon C... Closed
Problem/Incident
causes MDEV-21172 Memory leak after failed ADD PRIMARY KEY Closed
causes MDEV-26371 Assertion `info.max_leaf_size != 0' f... Closed
Relates
relates to MDEV-16969 Fix error message as promised in upst... Open
relates to MDEV-19292 "Row size too large" error when creat... Closed
relates to MDEV-20400 Implement a way to query an InnoDB ta... Confirmed
relates to MDEV-20786 MariaDB server writes warnings into e... Closed
relates to MDEV-20832 Don't print "row size too large" warn... Closed
relates to MDEV-21261 When performing instant add column, I... Confirmed
relates to MDEV-23521 Implement an InnoDB row format that c... Open
relates to MDEV-22585 Incorrect note being written to the e... Open

 Description   

When a DDL statement, such as CREATE TABLE or ALTER TABLE, affects an InnoDB table, InnoDB calculates the maximum row size of the new or altered table. If InnoDB detects that the maximum row size is too big to fit on an index's leaf page, then it prints the following message in the error log:

2019-07-28  0:57:51 140189814937344 [Warning] InnoDB: Cannot add field `c08` in table `test`.`t1` because after adding it, the row size is 2484 which is greater than maximum allowed size (1982) for a record on index leaf page.

If innodb_strict_mode is enabled, then the message will be an error. If innodb_strict_mode is disabled, then the message will be a warning.

This check is here: https://github.com/MariaDB/server/blob/mariadb-10.2.27/storage/innobase/dict/dict0dict.cc#L2138

InnoDB performs this check, because it wants to ensure that it will be possible to insert every possible row for a given index definition.

The problem is that this check is currently being performed when executing DML, and not just when executing DDL. This means that users can see confusing warning or error messages in the error log. We should fix it, so that InnoDB only performs this specific check when executing DDL.

When executing DML, InnoDB will still have to check every actual tuple to determine whether it exceeds InnoDB's maximum row size. That check is still appropriate, and it shouldn't be touched in this MDEV.



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2019-11-04 ]

Please re-submit the patch after fixing the compilation issues

Comment by Marko Mäkelä [ 2019-11-13 ]

I posted some comments.

Generated at Thu Feb 08 09:03:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.