You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MySQL 8 expressions as default values cause syntax parsing error #1197
I assume this may just be a feature missing from the upstream https://github.com/pingcap/parser library.
Figured I would raise this here to see if anyone is aware of a workaround.
Thanks again for all the hard work.
Relevant log output
# package auth
schema.sql:3:29: syntax error near "(UUID()) NOT NULL PRIMARY KEY"
Database schema
CREATETABLEIF NOT EXISTS organizations
(
id VARCHAR(36) DEFAULT (UUID()) NOT NULLPRIMARY KEY
);
SQL queries
-- name: GetOrganization :oneSELECT*FROM organizations
WHERE id = ? LIMIT1;
Activity
kyleconroy commentedon Sep 20, 2021
This indeed appears to be an issue with the pingcap MySQL parser. I've opened an issue (pingcap/parser#1347) for this problem.
(chore): Upgrade tidb_parser to new repository
test(MySQL): Add test for default column values
Upgrade pingcap parser (#1759) (#1760)
kyleconroy commentedon Jul 27, 2022
We've upgraded to the latest version of the MySQL parser which should fix this issue.
Upgrade pingcap parser (sqlc-dev#1759) (sqlc-dev#1760)