From fe42f62b80fbc1163e5dfed8b726e452605e6fb3 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Thu, 28 Sep 2017 15:33:17 +0800 Subject: [PATCH] Create information-functions.md (#197) * Create information-functions.md * Address comments * Add link for information functions --- sql/README.md | 2 +- sql/information-functions.md | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 sql/information-functions.md diff --git a/sql/README.md b/sql/README.md index 8122571913dc5..38a9f516fb4c5 100644 --- a/sql/README.md +++ b/sql/README.md @@ -54,7 +54,7 @@ TiDB supports the SQL-92 standard and is compatible with MySQL. To help you easi - [Cast Functions and Operators](cast-functions-and-operators.md) - Bit Functions and Operators - [Encryption and Compression Functions](encryption-and-compression-functions.md) - - Information Functions + - [Information Functions](information-functions.md) - JSON Functions - Functions Used with Global Transaction IDs - [Aggregate (GROUP BY) Functions](aggregate-group-by-functions.md) diff --git a/sql/information-functions.md b/sql/information-functions.md new file mode 100644 index 0000000000000..fe89f557ef64c --- /dev/null +++ b/sql/information-functions.md @@ -0,0 +1,24 @@ +--- +title: Information Functions +category: user guide +--- + +# Information Functions + +In TiDB, the usage of information functions is similar to MySQL. For more information, see [Information Functions](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html). + +## Information Function Descriptions + +| Name | Description | +|:-----|:------------| +| [`CONNECTION_ID()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_connection-id) | Return the connection ID (thread ID) for the connection | +| [`CURRENT_USER()`, `CURRENT_USER`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_current-user) | Return the authenticated user name and host name | +| [`DATABASE()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_database) | Return the default (current) database name | +| [`FOUND_ROWS()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_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()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_last-insert-id) | Return the value of the `AUTOINCREMENT` column for the last `INSERT` | +| [`SCHEMA()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_schema) | Synonym for `DATABASE()` | +| [`SESSION_USER()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_session-user) | Synonym for `USER()` | +| [`SYSTEM_USER()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_system-user) | Synonym for `USER()` | +| [`USER()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_user) | Return the user name and host name provided by the client | +| [`VERSION()`](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_version) | Return a string that indicates the MySQL server version | +| `TIDB_VERSION` | Return a string that indicates the TiDB server version |