innodb_strict_mode

2025-11-14 07:33:33  Updated

Note

This variable is available starting with V4.0.0.

Description

innodb_strict_mode specifies the SQL syntax checking mode.

Privilege requirements

  • Query variables

    • Global level

      sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (Oracle mode) or the information_schema.GLOBAL_VARIABLES view (MySQL mode) to view the value of a global system variable.

    • Session level

      sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (Oracle mode) or the information_schema.SESSION_VARIABLES view (MySQL mode) to view the value of a session system variable.

  • Modify variables

    • Global level

      • sys tenant can directly modify the value of a global system variable.

      • MySQL user tenants need to have the SUPER or ALTER SYSTEM privilege to modify the value of a global system variable.

      • Oracle user tenants need to have the ALTER SYSTEM privilege to modify the value of a global system variable.

    • Session level

      sys tenant and all user tenants can directly modify the value of a session system variable.

Attributes

Attribute Description
Type Bool
Default value 1
Value range
  • 1: strict mode. In strict mode, specific errors (such as unsupported ROW_FORMAT) will not be reported as warnings when you execute the CREATE TABLE, ALTER TABLE, or CREATE INDEX statement. Instead, the system will directly return an error.
  • 0: non-strict mode. In non-strict mode, the system will use a default syntax to replace an invalid syntax and will not report specific errors (such as unsupported ROW_FORMAT) as warnings when you execute the CREATE TABLE, ALTER TABLE, or CREATE INDEX statement.
Scope
  • Global
  • Session
Modifiable Yes. You can execute the SET statement to modify the value.
Nullable No

Examples

Set the SQL syntax checking mode to 1.

  • Global level

    obclient> SET GLOBAL innodb_strict_mode =1;
    
  • Session level

    obclient> SET innodb_strict_mode =1;
    

Contact Us