default value and comment are not displayed for numeric data types (mariadb 10.2.6)

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

When column type is int (or bigint, tinyint, decimal, float, double) and column has default value (and this value <>null) and a comment, then heidisql substitude column definition to DEFAULT ''.

create table a (i int default 5 comment 'qqq');

in heidisql:

CREATE TABLE a ( i INT(11) NULL DEFAULT '' ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB ;

in MariaDB 10.1 displayed as expected.

2 attachment(s):
  • 19848969_1413223208793422_873374036_n
  • 19873709_1413227115459698_923070657_n
[expired user #10861]'s profile image [expired user #10861] posted 7 years ago Permalink

Please see also jira.mariadb.org MDEV-13244

[expired user #10861]'s profile image [expired user #10861] posted 7 years ago Permalink

Note the difference between 10.1 and 10.2: 10.1 MariaDB [test]> show create table a\G 1. row Table: a Create Table: CREATE TABLE a ( i int(11) DEFAULT '5' COMMENT 'qqq' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.00 sec) 10.2 MariaDB [test]> show create table a\G 1. row Table: a Create Table: CREATE TABLE a ( i int(11) DEFAULT 5 COMMENT 'qqq' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 1 row in set (0.00 sec) Apparently, HeidiSQL expects '5', default value in quotes. That's why it works for strings and stopped working for numbers.

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