Skip to content

Commit

Permalink
ast/functions: add tidb_decode_key() function (pingcap#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 authored Sep 23, 2019
1 parent f151f65 commit 52ad150
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ const (
JSONDepth = "json_depth"
JSONKeys = "json_keys"
JSONLength = "json_length"

// TiDB internal function.
TiDBDecodeKey = "tidb_decode_key"
)

// FuncCallExpr is for function expression.
Expand Down
1 change: 1 addition & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ 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_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 52ad150

Please sign in to comment.