TiDBTiDB Docs Dash 2024

Jan 9 - Jan 12 (UTC)
Join us to improve docs and win a prize!
Sign InTry Free

Information Functions

TiDB supports most of the information functions available in MySQL 5.7.

TiDB supported MySQL functions

NameDescription
BENCHMARK()Execute an expression in a loop
CONNECTION_ID()Return the connection ID (thread ID) for the connection
CURRENT_USER(), CURRENT_USERReturn the authenticated user name and host name
DATABASE()Return the default (current) database name
FOUND_ROWS()For a SELECT with a LIMIT clause, the number of the rows that are returned if there is no LIMIT clause
LAST_INSERT_ID()Return the value of the AUTOINCREMENT column for the last INSERT
ROW_COUNT()The number of rows affected
SCHEMA()Synonym for DATABASE()
SESSION_USER()Synonym for USER()
SYSTEM_USER()Synonym for USER()
USER()Return the user name and host name provided by the client
VERSION()Return a string that indicates the MySQL server version

TiDB specific functions

The following function is only supported by TiDB, and there is no equivalent function in MySQL.

NameDescription
CURRENT_RESOURCE_GROUP()Return the name of the resource group that the current session is bound to

Unsupported functions

  • CHARSET()
  • COERCIBILITY()
  • COLLATION()

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.