distal-attribute
distal-attribute
distal-attribute
distal-attribute

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

alicesh posted 3 months ago in General

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
alicesh posted 2 months ago

Please see also jira.mariadb.org MDEV-13244

alicesh posted 2 months ago

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.