From 124b1e7f9ed577b16513ffffd18185b49248d643 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 21 Aug 2023 14:31:38 +0800 Subject: [PATCH] docs: add current_user() in function (#22496) --- docs/en/12-taos-sql/06-select.md | 8 +++++++- docs/en/12-taos-sql/10-function.md | 8 ++++++++ docs/zh/12-taos-sql/06-select.md | 8 +++++++- docs/zh/12-taos-sql/10-function.md | 8 ++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 661b4f5dea..5902dcb1df 100755 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -7,7 +7,7 @@ description: This document describes how to query data in TDengine. ## Syntax ```sql -SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} +SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE() | CURRENT_USER() | USER() } SELECT [DISTINCT] select_list from_clause @@ -300,6 +300,12 @@ SELECT TODAY(); SELECT TIMEZONE(); ``` +### Obtain Current User + +```sql +SELECT CURRENT_USER(); +``` + ## Regular Expression ### Syntax diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index ad6d5d77fb..3e25d2d4ec 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -1275,6 +1275,14 @@ SELECT SERVER_STATUS(); **Description**: The server status. +### CURRENT_USER + +```sql +SELECT CURRENT_USER(); +``` + +**Description**: get current user. + ## Geometry Functions diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index 80966cf386..8e122da894 100755 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -7,7 +7,7 @@ description: 查询数据的详细语法 ## 查询语法 ```sql -SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE()} +SELECT {DATABASE() | CLIENT_VERSION() | SERVER_VERSION() | SERVER_STATUS() | NOW() | TODAY() | TIMEZONE() | CURRENT_USER() | USER() } SELECT [DISTINCT] select_list from_clause @@ -300,6 +300,12 @@ SELECT TODAY(); SELECT TIMEZONE(); ``` +### 获取当前用户 + +```sql +SELECT CURRENT_USER(); +``` + ## 正则表达式过滤 ### 语法 diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index 773ea67989..f0ad0c62a5 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -1266,6 +1266,14 @@ SELECT SERVER_STATUS(); **说明**:检测服务端是否所有 dnode 都在线,如果是则返回成功,否则返回无法建立连接的错误。 +### CURRENT_USER + +```sql +SELECT CURRENT_USER(); +``` + +**说明**:获取当前用户。 + ## Geometry 函数 -- GitLab