-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
add table create comment to table spec #7416
Comments
Hi @Allam76, thanks for contacting us. It makes sense for us to support those comments at the table level, too. Looks like we just need to pull the comment out of the AST, plug it into Thanks for requesting this one! We'll start looking into the implementation details. I'm going to slide this issue over to the |
I've got Note that I ran into a couple of snags along the way, so full support for table level comments will require a bit more follow up work, but we can iteratively release functionality. The most notable limitation is that this first iteration can't yet support comments that contain the single quote character. This is due to a limitation in how we are parsing this content in our SQL parser, and how it is assembled back into a string that needs to be reparsed at the GMS layer. Unfortunately, that process loses some information and we can't disambiguate single quotes. The fix is pretty straightforward – we need to change the SQL parser to parse table options into structures, instead of back into a string. It'll just take some time to untangle that, and I think it's best done as a follow up. |
@Allam76, support for persisting table comments has been merged into I'll go ahead and resolve this issue now that the support is merged in, but let us know if you need anything else! |
mysql allows comments on create table statement, both on the table clause itself as well as on the columns. The column spec has this implemented but for the table this is missing.
The parsed AST does contain the comment so it is merely about passing it to the tablespec.
Would it be possible to ask to add this?
As in
I would assume it should be added here:
https://github.com/dolthub/go-mysql-server/blob/e42adc9dbc2869bab77e0012c6f01f0d96dee0ab/sql/planbuilder/ddl.go#L244-L250
Many thanks
Martin
The text was updated successfully, but these errors were encountered: