parser: Add charset info for string literal
This commit is contained in:
@ -1797,6 +1797,15 @@ Literal:
|
||||
| floatLit
|
||||
| intLit
|
||||
| stringLit
|
||||
{
|
||||
tp := types.NewFieldType(mysql.TypeString)
|
||||
l := yylex.(*lexer)
|
||||
tp.Charset, tp.Collate = l.GetCharsetInfo()
|
||||
$$ = &types.DataItem{
|
||||
Type: tp,
|
||||
Data: $1.(string),
|
||||
}
|
||||
}
|
||||
| "UNDERSCORE_CHARSET" stringLit
|
||||
{
|
||||
// See: https://dev.mysql.com/doc/refman/5.7/en/charset-literal.html
|
||||
|
||||
Reference in New Issue
Block a user