[BUG] Mariadb adding comment to any INT type field drops default

[expired user #10759]'s profile image [expired user #10759] posted 7 years ago in General Permalink

Start off with the following:

CREATE TABLE test ( extra_info BLOB NULL DEFAULT NULL, test_int INT(11) NULL DEFAULT '1' ) COLLATE='utf8_general_ci' ENGINE=InnoDB ;

Then add a comment to the test_int field and you get the following which is now invalid SQL and very bad as the default value is no longer present.

CREATE TABLE test ( extra_info BLOB NULL DEFAULT NULL, test_int INT(11) NULL DEFAULT '' ) COLLATE='utf8_general_ci' ENGINE=InnoDB ;

This bug plus that CHECK constraints are also removed on table schema changes makes HeidiSQL very dangerous to modify table structures.

Please login to leave a reply, or register at first.