diff --git a/ast/functions.go b/ast/functions.go index 6a1f94016..74f09bf1b 100755 --- a/ast/functions.go +++ b/ast/functions.go @@ -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. diff --git a/parser_test.go b/parser_test.go index 6c19ff853..6a47afc76 100644 --- a/parser_test.go +++ b/parser_test.go @@ -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))"},