#1067 - Invalid default value

Error: #1067 - Invalid default value
happens with deployment script from MySQL compare
Caused by statement like: MODIFY COLUMN `created_at` timestamp NULL DEFAULT 'NULL';

This statement should be:
MODIFY COLUMN `created_at` timestamp NULL DEFAULT NULL;

(without the single quotes around 2nd NULL)


MODIFY COLUMN `created_at` timestamp NULL;

(without DEFAULT 'NULL')

Also, the addition of DEFAULT 'NULL' causes unnecessary difference in database comparisons. I'm not sure, but it seems DEFAULT 'NULL' is coming from a new version of MySQL Database.

How are people handling this issue?


  • thoskythosky Posts: 1 New member
    I also experience this error. It occured after changing from Mysql version 14.14 to MariaDB 10.4.

    It seems like Mysql Compare Bundle does not work with later versions of MariaDB. The comparison works but the deployment script does not work because it puts an extra quote around the default value which makes a syntax error.

    Here an example of how it makes an syntax error at my server:

    CREATE TABLE `database`.`test` (
      `id` int(10) unsigned NOT NULL auto_increment,
      `title` varchar(50) NOT NULL DEFAULT ''0'',
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB

    The DEFAULT ''0'' should be DEFAULT '0'

    I hope the dev team will solve this error in the application.
  • Same problem here after migrating to another host (and another MariaDB). 
    Should be great when the developers should solve this.... 
Sign In or Register to comment.