Skip to content
New issue

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

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

Already on GitHub? # to your account

The Collate in types.FieldType in ColumnDef seems to be always empty #1309

Open
milkice233 opened this issue Aug 18, 2021 · 0 comments
Open

Comments

@milkice233
Copy link
Contributor

milkice233 commented Aug 18, 2021

Feature Request

Is your feature request related to a problem? Please describe:
When using pingcap/parser to parse SQL statement, the Collate in types.FieldType in ColumnDef seems to be always empty even if with collate specified in SQL statement.

Consider the following SQL statement: CREATE TABLE contacts (col1 char(10) CHARACTER SET ascii COLLATE ascii_bin, col2 varbinary(7), col3 varchar(20));
After parsing, the collate in types.FieldType in ColumnDef seems to be always empty and collate option can only be found in Options Array.
image

Describe the feature you'd like:
If a COLLATE of a column is found then set the COLLATE type to the collate in types.FieldType.

Describe alternatives you've considered:
Users can always get the collate value in options array, but since there's a collate field in types.FieldType, I think the parser should take the responsibility of setting the collate option.

Teachability, Documentation, Adoption, Migration Strategy:
I've initiated a pull request #1310

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant