go-mysql-server icon indicating copy to clipboard operation
go-mysql-server copied to clipboard

Describe for default value expressions is formatted incorrectly

Open VinaiRachakonda opened this issue 3 years ago • 0 comments

Consider the following example

CREATE TABLE t(pk int primary key, val int DEFAULT (pk * 2))

Mysql with describe t will print

mysql> desc t;
+-------+------+------+-----+------------+-------------------+
| Field | Type | Null | Key | Default    | Extra             |
+-------+------+------+-----+------------+-------------------+
| pk    | int  | NO   | PRI | NULL       |                   |
| val   | int  | YES  |     | (`pk` * 2) | DEFAULT_GENERATED |
+-------+------+------+-----+------------+-------------------+
2 rows in set (0.02 sec)

GMS will instead return ((pk * 2)) for val

VinaiRachakonda avatar Jun 22 '22 22:06 VinaiRachakonda