From 8745eae66894eeeccdc746ca2d2b0b6abbc48dfd Mon Sep 17 00:00:00 2001 From: imtbkcat Date: Tue, 2 Jul 2019 17:48:46 +0800 Subject: [PATCH] address comment --- ast/misc.go | 10 +++++----- parser.go | 4 ++-- parser.y | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ast/misc.go b/ast/misc.go index 7916a52b9..a91bde03e 100755 --- a/ast/misc.go +++ b/ast/misc.go @@ -2029,15 +2029,15 @@ func (n *TableOptimizerHint) Accept(v Visitor) (Node, bool) { return v.Leave(n) } -// NewDecimal creates a types.Decimal value, it's provided by parser driver. -var NewDecimal func(string) (interface{}, error) - type BinaryLiteral interface { ToString() string } +// NewDecimal creates a types.Decimal value, it's provided by parser driver. +var NewDecimal func(string) (interface{}, error) + // NewHexLiteral creates a types.HexLiteral value, it's provided by parser driver. -var NewHexLiteral func(string) (BinaryLiteral, error) +var NewHexLiteral func(string) (interface{}, error) // NewBitLiteral creates a types.BitLiteral value, it's provided by parser driver. -var NewBitLiteral func(string) (BinaryLiteral, error) +var NewBitLiteral func(string) (interface{}, error) diff --git a/parser.go b/parser.go index 0e7363595..39ce29dd7 100644 --- a/parser.go +++ b/parser.go @@ -14542,12 +14542,12 @@ yynewstate: case 1634: { h, _ := ast.NewHexLiteral(yyS[yypt-0].item.(string)) - parser.yyVAL.item = h.ToString() + parser.yyVAL.item = (h.(ast.BinaryLiteral)).ToString() } case 1635: { b, _ := ast.NewBitLiteral(yyS[yypt-0].item.(string)) - parser.yyVAL.item = b.ToString() + parser.yyVAL.item = (b.(ast.BinaryLiteral)).ToString() } case 1636: { diff --git a/parser.y b/parser.y index 033b3c54f..3e704a80b 100644 --- a/parser.y +++ b/parser.y @@ -8894,12 +8894,12 @@ FieldTerminator: | hexLit { h, _ := ast.NewHexLiteral($1.(string)) - $$ = h.ToString() + $$ = (h.(ast.BinaryLiteral)).ToString() } | bitLit { b, _ := ast.NewBitLiteral($1.(string)) - $$ = b.ToString() + $$ = (b.(ast.BinaryLiteral)).ToString() } Lines: