Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe for default value expressions is formatted incorrectly #4500

Closed
VinaiRachakonda opened this issue Jun 22, 2022 · 1 comment
Closed
Labels
enhancement New feature or request sql Issue with SQL

Comments

@VinaiRachakonda
Copy link
Contributor

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 VinaiRachakonda changed the title Describe for expression double wraps expressions Describe for default value expressions is formatted incorrectly Jun 22, 2022
@VinaiRachakonda VinaiRachakonda added the enhancement New feature or request label Jun 29, 2022
@zachmu zachmu transferred this issue from dolthub/go-mysql-server Oct 7, 2022
@timsehn timsehn added the sql Issue with SQL label Oct 7, 2022
@fulghum
Copy link
Contributor

fulghum commented Nov 24, 2022

Latest versions of Dolt now match MySQL's output:

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

@fulghum fulghum closed this as completed Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

3 participants