InnoDB Strict Mode

You are viewing an old version of this article. View the current version here.

InnoDB strict mode is similar to SQL strict mode. When it is enabled, certain InnoDB warnings become errors instead.

Enabling InnoDB Strict Mode

MariaDB starting with 10.2.2

In MariaDB 10.2.2 and later, InnoDB strict mode is enabled by default.

InnoDB strict mode can be enabled or disabled by configuring the innodb_strict_mode server system variable.

Its global value can be changed dynamically with SET GLOBAL. For example:

SET GLOBAL innodb_strict_mode=ON;

Its value for the current session can also be changed dynamically with SET SESSION. For example:

SET SESSION innodb_strict_mode=ON;

It can also be set in a server option group in an option file prior to starting up the server. For example:

[mariadb]
...
innodb_strict_mode=ON;

InnoDB Strict Mode Errors

Invalid Table Options

If DDL is executed, and if invalid or conflicting table options are specified, then an error is returned by the statement when InnoDB strict mode is enabled. For example:

COMPRESSED Row Format

If InnoDB strict mode is enabled, and if a table uses the COMPRESSED row format, and if the table's KEY_BLOCK_SIZE is too small to contain a row, then an error is returned by the statement.

Row Size Too Large

If InnoDB strict mode is enabled, and if a table exceeds its row format's maximum row size, then InnoDB will return an error.

ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to 
TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

See Troubleshooting Row Size Too Large Errors with InnoDB for more information.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.