Skip to content

Commit

Permalink
[parser] ast/functions: Add built-in function tidb_decode_sql_digests (
Browse files Browse the repository at this point in the history
  • Loading branch information
MyonKeminta authored and ti-chi-bot committed Oct 9, 2021
1 parent 238f296 commit eb90a16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
43 changes: 22 additions & 21 deletions parser/ast/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,27 +238,28 @@ const (
Soundex = "soundex"

// information functions
Benchmark = "benchmark"
Charset = "charset"
Coercibility = "coercibility"
Collation = "collation"
ConnectionID = "connection_id"
CurrentUser = "current_user"
CurrentRole = "current_role"
Database = "database"
FoundRows = "found_rows"
LastInsertId = "last_insert_id"
RowCount = "row_count"
Schema = "schema"
SessionUser = "session_user"
SystemUser = "system_user"
User = "user"
Version = "version"
TiDBVersion = "tidb_version"
TiDBIsDDLOwner = "tidb_is_ddl_owner"
TiDBDecodePlan = "tidb_decode_plan"
FormatBytes = "format_bytes"
FormatNanoTime = "format_nano_time"
Benchmark = "benchmark"
Charset = "charset"
Coercibility = "coercibility"
Collation = "collation"
ConnectionID = "connection_id"
CurrentUser = "current_user"
CurrentRole = "current_role"
Database = "database"
FoundRows = "found_rows"
LastInsertId = "last_insert_id"
RowCount = "row_count"
Schema = "schema"
SessionUser = "session_user"
SystemUser = "system_user"
User = "user"
Version = "version"
TiDBVersion = "tidb_version"
TiDBIsDDLOwner = "tidb_is_ddl_owner"
TiDBDecodePlan = "tidb_decode_plan"
TiDBDecodeSQLDigests = "tidb_decode_sql_digests"
FormatBytes = "format_bytes"
FormatNanoTime = "format_nano_time"

// control functions
If = "if"
Expand Down
1 change: 1 addition & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1507,6 +1507,7 @@ func (s *testParserSuite) TestBuiltin(c *C) {
{`SELECT tidb_decode_plan();`, true, "SELECT TIDB_DECODE_PLAN()"},
{`SELECT tidb_decode_key('abc');`, true, "SELECT TIDB_DECODE_KEY(_UTF8MB4'abc')"},
{`SELECT tidb_decode_base64_key('abc');`, true, "SELECT TIDB_DECODE_BASE64_KEY(_UTF8MB4'abc')"},
{`SELECT tidb_decode_sql_digests('[]');`, true, "SELECT TIDB_DECODE_SQL_DIGESTS(_UTF8MB4'[]')"},
{`SELECT get_mvcc_info('hex', '0xabc');`, true, "SELECT GET_MVCC_INFO(_UTF8MB4'hex', _UTF8MB4'0xabc')"},

// for time fsp
Expand Down

0 comments on commit eb90a16

Please sign in to comment.