DEFAULT For BLOB, TEXT Columns - MariaDB to MySQL Migration

In MariaDB 10.2.1 or later, you can assign a default value for a BLOB or TEXT column.

In MySQL 8.0.13 or later, you can also assign a default value for a BLOB or TEXT column, but the default value must be enclosed in parentheses.

MariaDB:

  CREATE TABLE default1 (c1 TEXT DEFAULT 'abc');
  /* Query OK, 0 rows affected */

MySQL:

  CREATE TABLE default1 (c1 TEXT DEFAULT 'abc');
  /* ERROR 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column `c1` can`t have a default value */
 
  -- Enclosing in () now
  CREATE TABLE default1 (c1 TEXT DEFAULT ('abc'));
  /* Query OK, 0 rows affected */

You can see that MySQL returns a misleading error when trying to use DEFAULT without parentheses.

For more information, see MariaDB to MySQL Migration.