diff --git a/ast/misc.go b/ast/misc.go index 1e259893d..f70f8a2dc 100755 --- a/ast/misc.go +++ b/ast/misc.go @@ -63,10 +63,11 @@ const ( RepeatableRead = "REPEATABLE-READ" // Valid formats for explain statement. - ExplainFormatROW = "row" - ExplainFormatDOT = "dot" - PumpType = "PUMP" - DrainerType = "DRAINER" + ExplainFormatROW = "row" + ExplainFormatDOT = "dot" + ExplainFormatHint = "hint" + PumpType = "PUMP" + DrainerType = "DRAINER" ) // Transaction mode constants. @@ -80,6 +81,7 @@ var ( ExplainFormats = []string{ ExplainFormatROW, ExplainFormatDOT, + ExplainFormatHint, } ) diff --git a/parser_test.go b/parser_test.go index e7a9aa05c..803e844e6 100644 --- a/parser_test.go +++ b/parser_test.go @@ -3700,6 +3700,7 @@ func (s *testParserSuite) TestExplain(c *C) { {"EXPLAIN FORMAT = TRADITIONAL SELECT 1", true, "EXPLAIN FORMAT = 'row' SELECT 1"}, {"EXPLAIN FORMAT = JSON FOR CONNECTION 1", true, "EXPLAIN FORMAT = 'json' FOR CONNECTION 1"}, {"EXPLAIN FORMAT = JSON SELECT 1", true, "EXPLAIN FORMAT = 'json' SELECT 1"}, + {"EXPLAIN FORMAT = 'hint' SELECT 1", true, "EXPLAIN FORMAT = 'hint' SELECT 1"}, } s.RunTest(c, table) }