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.
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.
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.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 https://github.com/pingcap/parser/pull/1310