Search code examples
sqlmysqlconstraintsmyisam

Constraint like check constraints, not null constraints on MyISAM Storage Engines in MySQL


Can we use constraint like check constraints, not null constraints on MyISAM Storage Engines in MySQL?


Solution

  • MyISAM supports NOT NULL.

    Mostly.

    Unless in batch insert mode, MySQL will insert the 'implicit default' of a column and maybe throw a warning. To prevent this you must enable the strict sql mode.

    As for check clauses, MySQL will accept the syntax but totally ignore it in table definitions.