Skip to content

Persist table comment from create table#2307

Merged
fulghum merged 4 commits intomainfrom
fulghum/table-comments
Feb 1, 2024
Merged

Persist table comment from create table#2307
fulghum merged 4 commits intomainfrom
fulghum/table-comments

Conversation

@fulghum
Copy link
Contributor

@fulghum fulghum commented Jan 31, 2024

We parse table comments, but they were not persisted anywhere. This change adds support for persisting table comments so that they can be round-tripped between create table and show create table.

There are still several limitations with table comments that we should eventually follow up on:

  • Table comments containing any single quotes are not supported – Vitess parses the table options, but then strips any quotes and replaces them with single quotes, then pushes all table options back into a single string that GMS parses again, using regexes to pull out charset, collation, and comment. If a table comment is double quoted and contains single quotes in the string, Vitess doesn't currently preserve enough information for us to reparse that correctly in GMS. The right fix for this is to change Vitess to return table options in a structure, instead of as a single string.
  • ALTER TABLE does not support altering a table's comment.

Related to dolthub/dolt#7416

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fulghum fulghum merged commit f4eb390 into main Feb 1, 2024
@fulghum fulghum deleted the fulghum/table-comments branch February 1, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants