Skip to content

Commit

Permalink
ast/functions: add tidb_decode_plan() function (pingcap#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 committed Oct 18, 2019
1 parent 1f407b3 commit 991d5f8
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 @@ -1078,6 +1078,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()"},
{`SELECT tidb_decode_key('abc');`, true, "SELECT TIDB_DECODE_KEY('abc')"},

// 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 991d5f8

Please sign in to comment.