Skip to content

Commit

Permalink
ast/functions: add tidb_decode_plan() function (#557) (#629)
Browse files Browse the repository at this point in the history
* ast/functions: add tidb_decode_plan() function (#557)

* address comment
  • Loading branch information
bb7133 authored and kennytm committed Nov 8, 2019
1 parent 0c4055e commit a8f0a51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const (
Version = "version"
TiDBVersion = "tidb_version"
TiDBIsDDLOwner = "tidb_is_ddl_owner"
TiDBDecodePlan = "tidb_decode_plan"

// control functions
If = "if"
Expand Down
2 changes: 2 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,8 @@ func (s *testParserSuite) TestBuiltin(c *C) {
{`SELECT tidb_version();`, true, "SELECT TIDB_VERSION()"},
{`SELECT tidb_is_ddl_owner();`, true, "SELECT TIDB_IS_DDL_OWNER()"},

{`SELECT tidb_decode_plan();`, true, "SELECT TIDB_DECODE_PLAN()"},

// for time fsp
{"CREATE TABLE t( c1 TIME(2), c2 DATETIME(2), c3 TIMESTAMP(2) );", true, "CREATE TABLE `t` (`c1` TIME(2),`c2` DATETIME(2),`c3` TIMESTAMP(2))"},

Expand Down

0 comments on commit a8f0a51

Please sign in to comment.