diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md
index 687349e31d..7ef47f2131 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 [hints] [DISTINCT] [TAGS] select_list
from_clause
@@ -195,7 +195,7 @@ The following SQL statement returns the number of subtables within the meters su
SELECT COUNT(*) FROM (SELECT DISTINCT TBNAME FROM meters);
```
-In the preceding two statements, only tags can be used as filtering conditions in the WHERE clause. For example:
+In the preceding two statements, only tags can be used as filtering conditions in the WHERE clause.
**\_QSTART and \_QEND**
@@ -245,8 +245,7 @@ You can perform INNER JOIN statements based on the primary key. The following co
3. For supertables, the ON condition must be equivalent to the primary key. In addition, the tag columns of the tables on which the INNER JOIN is performed must have a one-to-one relationship. You cannot specify an OR condition.
4. The tables that are included in a JOIN clause must be of the same type (supertable, standard table, or subtable).
5. You can include subqueries before and after the JOIN keyword.
-6. You cannot include more than ten tables in a JOIN clause.
-7. You cannot include a FILL clause and a JOIN clause in the same statement.
+6. You cannot include a FILL clause and a JOIN clause in the same statement.
## GROUP BY
@@ -337,6 +336,12 @@ SELECT TODAY();
SELECT TIMEZONE();
```
+### Obtain Current User
+
+```sql
+SELECT CURRENT_USER();
+```
+
## Regular Expression
### Syntax
@@ -391,7 +396,7 @@ SELECT AVG(CASE WHEN voltage < 200 or voltage > 250 THEN 220 ELSE voltage END) F
## JOIN
-TDengine supports the `INTER JOIN` based on the timestamp primary key, that is, the `JOIN` condition must contain the timestamp primary key. As long as the requirement of timestamp-based primary key is met, `INTER JOIN` can be made between normal tables, sub-tables, super tables and sub-queries at will, and there is no limit on the number of tables.
+TDengine supports the `INTER JOIN` based on the timestamp primary key, that is, the `JOIN` condition must contain the timestamp primary key. As long as the requirement of timestamp-based primary key is met, `INTER JOIN` can be made between normal tables, sub-tables, super tables and sub-queries at will, and there is no limit on the number of tables, primary key and other conditions must be combined with `AND` operator.
For standard tables:
diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md
index 234625bfb4..b0c5f82985 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/en/12-taos-sql/20-keywords.md b/docs/en/12-taos-sql/20-keywords.md
index d563181b87..983d4f63c9 100644
--- a/docs/en/12-taos-sql/20-keywords.md
+++ b/docs/en/12-taos-sql/20-keywords.md
@@ -178,7 +178,7 @@ The following list shows all reserved keywords:
- MATCH
- MAX_DELAY
-- MAX_SPEED
+- BWLIMIT
- MAXROWS
- MERGE
- META
diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md
index b663fbd435..7a58343f24 100644
--- a/docs/en/12-taos-sql/24-show.md
+++ b/docs/en/12-taos-sql/24-show.md
@@ -22,6 +22,14 @@ SHOW CLUSTER;
Shows information about the current cluster.
+## SHOW CLUSTER ALIVE
+
+```sql
+SHOW CLUSTER ALIVE;
+```
+
+It is used to check whether the cluster is available or not. Return value: 0 means unavailable, 1 means available, 2 means partially available (some dnodes are offline, the other dnodes are available)
+
## SHOW CONNECTIONS
```sql
diff --git a/docs/en/12-taos-sql/28-recovery.md b/docs/en/12-taos-sql/28-recovery.md
index b4da25ea0c..1c1838f616 100644
--- a/docs/en/12-taos-sql/28-recovery.md
+++ b/docs/en/12-taos-sql/28-recovery.md
@@ -17,7 +17,7 @@ You can use the SHOW CONNECTIONS statement to find the conn_id.
## Terminate a Query
```sql
-KILL QUERY kill_id;
+KILL QUERY 'kill_id';
```
You can use the SHOW QUERIES statement to find the kill_id.
diff --git a/docs/en/14-reference/03-connector/03-cpp.mdx b/docs/en/14-reference/03-connector/03-cpp.mdx
index 3e1a0f9545..f6ebf0fe47 100644
--- a/docs/en/14-reference/03-connector/03-cpp.mdx
+++ b/docs/en/14-reference/03-connector/03-cpp.mdx
@@ -168,6 +168,12 @@ The base API is used to do things like create database connections and provide a
:::
+- `TAOS *taos_connect_auth(const char *host, const char *user, const char *auth, const char *db, uint16_t port)`
+
+ The function is the same as taos_connect. Except that the pass parameter is replaced by auth, other parameters are the same as taos_connect.
+
+ - auth: the 32-bit lowercase md5 of the raw password
+
- `char *taos_get_server_info(TAOS *taos)`
Get server-side version information.
@@ -184,6 +190,14 @@ The base API is used to do things like create database connections and provide a
- If len is less than the space required to store the db (including the last '\0'), an error is returned. The truncated data assigned in the database ends with '\0'.
- If len is greater than or equal to the space required to store the db (including the last '\0'), return normal 0, and assign the db name ending with '\0' in the database.
+- `int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type)`
+
+ Set the event callback function.
+
+ - fp: event callback function pointer. Declaration:typedef void (*__taos_notify_fn_t)(void *param, void *ext, int type);Param is a user-defined parameter, ext is an extended parameter (depending on the event type, and returns the user password version for TAOS_NOTIFY_PASSVER), and type is the event type
+ - param: user-defined parameter
+ - type: event type. Value range: 1) TAOS_NOTIFY_PASSVER: User password changed
+
- `void taos_close(TAOS *taos)`
Closes the connection, where `taos` is the handle returned by `taos_connect()`.
@@ -307,21 +321,20 @@ The specific functions related to the interface are as follows (see also the [pr
Parse a SQL command, and bind the parsed result and parameter information to `stmt`. If the parameter length is greater than 0, use this parameter as the length of the SQL command. If it is equal to 0, the length of the SQL command will be determined automatically.
-- `int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_BIND *bind)`
+- `int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind)`
Not as efficient as `taos_stmt_bind_param_batch()`, but can support non-INSERT type SQL statements.
To bind parameters, bind points to an array (representing the row of data to be bound), making sure that the number and order of the elements in this array are the same as the parameters in the SQL statement. taos_bind is used similarly to MYSQL_BIND in MySQL, as defined below.
```c
- typedef struct TAOS_BIND {
+ typedef struct TAOS_MULTI_BIND {
int buffer_type;
- void * buffer;
- uintptr_t buffer_length; // not in use
- uintptr_t * length;
- int * is_null;
- int is_unsigned; // not in use
- int * error; // not in use
- } TAOS_BIND;
+ void *buffer;
+ uintptr_t buffer_length;
+ uint32_t *length;
+ char *is_null;
+ int num;
+ } TAOS_MULTI_BIND;
```
- `int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name)`
@@ -329,7 +342,7 @@ The specific functions related to the interface are as follows (see also the [pr
(Available in 2.1.1.0 and later versions, only supported for replacing parameter values in INSERT statements)
When the table name in the SQL command uses `? ` placeholder, you can use this function to bind a specific table name.
-- `int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags)`
+- `int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_MULTI_BIND* tags)`
(Available in 2.1.2.0 and later versions, only supported for replacing parameter values in INSERT statements)
When the table name and TAGS in the SQL command both use `? `, you can use this function to bind the specific table name and the specific TAGS value. The most typical usage scenario is an INSERT statement that uses the automatic table building function (the current version does not support specifying specific TAGS columns.) The number of columns in the TAGS parameter needs to be the same as the number of TAGS requested in the SQL command.
@@ -358,6 +371,14 @@ The specific functions related to the interface are as follows (see also the [pr
Execute the prepared statement. Currently, a statement can only be executed once.
+- `int taos_stmt_affected_rows(TAOS_STMT *stmt)`
+
+ Gets the number of rows affected by executing bind statements multiple times.
+
+- `int taos_stmt_affected_rows_once(TAOS_STMT *stmt)`
+
+ Gets the number of rows affected by executing a bind statement once.
+
- `TAOS_RES* taos_stmt_use_result(TAOS_STMT *stmt)`
Gets the result set of a statement. Use the result set in the same way as in the non-parametric call. When finished, `taos_free_result()` should be called on this result set to free resources.
diff --git a/docs/en/14-reference/03-connector/09-csharp.mdx b/docs/en/14-reference/03-connector/09-csharp.mdx
index 718462295a..203d44fe02 100644
--- a/docs/en/14-reference/03-connector/09-csharp.mdx
+++ b/docs/en/14-reference/03-connector/09-csharp.mdx
@@ -30,6 +30,10 @@ The source code of `TDengine.Connector` is hosted on [GitHub](https://github.com
The supported platforms are the same as those supported by the TDengine client driver.
+:::note
+Please note TDengine does not support 32bit Windows any more.
+:::
+
## Version support
Please refer to [version support list](/reference/connector#version-support)
diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md
index 6d5547e7a9..baf07d6b9e 100644
--- a/docs/en/14-reference/06-taosdump.md
+++ b/docs/en/14-reference/06-taosdump.md
@@ -102,6 +102,8 @@ Usage: taosdump [OPTION...] dbname [tbname ...]
-L, --loose-mode Use loose mode if the table name and column name
use letter and number only. Default is NOT.
-n, --no-escape No escape char '`'. Default is using it.
+ -Q, --dot-replace Repalce dot character with underline character in
+ the table name.
-T, --thread-num=THREAD_NUM Number of thread for dump in file. Default is
8.
-C, --cloud=CLOUD_DSN specify a DSN to access TDengine cloud service
diff --git a/docs/en/20-third-party/01-grafana.mdx b/docs/en/20-third-party/01-grafana.mdx
index 64acefe6b8..0ccdfe7254 100644
--- a/docs/en/20-third-party/01-grafana.mdx
+++ b/docs/en/20-third-party/01-grafana.mdx
@@ -74,7 +74,7 @@ grafana-cli plugins install tdengine-datasource
sudo -u grafana grafana-cli plugins install tdengine-datasource
```
-You can also download zip files from [GitHub](https://github.com/taosdata/grafanaplugin/releases/tag/latest) or [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) and install manually. The commands are as follows:
+You can also download zip files from [GitHub](https://github.com/taosdata/grafanaplugin/releases/latest) or [Grafana](https://grafana.com/grafana/plugins/tdengine-datasource/?tab=installation) and install manually. The commands are as follows:
```bash
GF_VERSION=3.3.1
diff --git a/docs/examples/c/multi_bind_example.c b/docs/examples/c/multi_bind_example.c
index 02e6568e9e..3d0bd3ccef 100644
--- a/docs/examples/c/multi_bind_example.c
+++ b/docs/examples/c/multi_bind_example.c
@@ -51,7 +51,7 @@ void insertData(TAOS *taos) {
int code = taos_stmt_prepare(stmt, sql, 0);
checkErrorCode(stmt, code, "failed to execute taos_stmt_prepare");
// bind table name and tags
- TAOS_BIND tags[2];
+ TAOS_MULTI_BIND tags[2];
char *location = "California.SanFrancisco";
int groupId = 2;
tags[0].buffer_type = TSDB_DATA_TYPE_BINARY;
@@ -144,4 +144,4 @@ int main() {
}
// output:
-// successfully inserted 2 rows
\ No newline at end of file
+// successfully inserted 2 rows
diff --git a/docs/examples/c/stmt_example.c b/docs/examples/c/stmt_example.c
index 28dae5f9d5..290a6bee66 100644
--- a/docs/examples/c/stmt_example.c
+++ b/docs/examples/c/stmt_example.c
@@ -58,7 +58,7 @@ void insertData(TAOS *taos) {
int code = taos_stmt_prepare(stmt, sql, 0);
checkErrorCode(stmt, code, "failed to execute taos_stmt_prepare");
// bind table name and tags
- TAOS_BIND tags[2];
+ TAOS_MULTI_BIND tags[2];
char* location = "California.SanFrancisco";
int groupId = 2;
tags[0].buffer_type = TSDB_DATA_TYPE_BINARY;
@@ -82,7 +82,7 @@ void insertData(TAOS *taos) {
{1648432611749, 12.6, 218, 0.33},
};
- TAOS_BIND values[4];
+ TAOS_MULTI_BIND values[4];
values[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP;
values[0].buffer_length = sizeof(int64_t);
values[0].length = &values[0].buffer_length;
@@ -138,4 +138,4 @@ int main() {
// output:
-// successfully inserted 2 rows
\ No newline at end of file
+// successfully inserted 2 rows
diff --git a/docs/zh/08-connector/10-cpp.mdx b/docs/zh/08-connector/10-cpp.mdx
index 12bbffa4f9..e5dc2ec8c8 100644
--- a/docs/zh/08-connector/10-cpp.mdx
+++ b/docs/zh/08-connector/10-cpp.mdx
@@ -256,6 +256,12 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
:::
+- `TAOS *taos_connect_auth(const char *host, const char *user, const char *auth, const char *db, uint16_t port)`
+
+ 功能同 taos_connect。除 pass 参数替换为 auth 外,其他参数同 taos_connect。
+
+ - auth: 原始密码取 32 位小写 md5
+
- `char *taos_get_server_info(TAOS *taos)`
获取服务端版本信息。
@@ -272,6 +278,14 @@ int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields)
- 如果,len 小于 存储db需要的空间(包含最后的'\0'),返回错误,database里赋值截断的数据,以'\0'结尾。
- 如果,len 大于等于 存储db需要的空间(包含最后的'\0'),返回正常0,database里赋值以'\0‘结尾的db名。
+- `int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type)`
+
+ 设置事件回调函数。
+
+ - fp 事件回调函数指针。函数声明:typedef void (*__taos_notify_fn_t)(void *param, void *ext, int type);其中, param 为用户自定义参数,ext 为扩展参数(依赖事件类型,针对 TAOS_NOTIFY_PASSVER 返回用户密码版本),type 为事件类型
+ - param 用户自定义参数
+ - type 事件类型。取值范围:1)TAOS_NOTIFY_PASSVER: 用户密码改变
+
- `void taos_close(TAOS *taos)`
关闭连接,其中`taos`是 `taos_connect()` 返回的句柄。
@@ -396,21 +410,20 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
解析一条 SQL 语句,将解析结果和参数信息绑定到 stmt 上,如果参数 length 大于 0,将使用此参数作为 SQL 语句的长度,如等于 0,将自动判断 SQL 语句的长度。
-- `int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_BIND *bind)`
+- `int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind)`
不如 `taos_stmt_bind_param_batch()` 效率高,但可以支持非 INSERT 类型的 SQL 语句。
- 进行参数绑定,bind 指向一个数组(代表所要绑定的一行数据),需保证此数组中的元素数量和顺序与 SQL 语句中的参数完全一致。TAOS_BIND 的使用方法与 MySQL 中的 MYSQL_BIND 类似,具体定义如下:
+ 进行参数绑定,bind 指向一个数组(代表所要绑定的一行数据),需保证此数组中的元素数量和顺序与 SQL 语句中的参数完全一致。TAOS_MULTI_BIND 的使用方法与 MySQL 中的 MYSQL_BIND 类似,具体定义如下:
```c
- typedef struct TAOS_BIND {
+ typedef struct TAOS_MULTI_BIND {
int buffer_type;
- void * buffer;
- uintptr_t buffer_length; // not in use
- uintptr_t * length;
- int * is_null;
- int is_unsigned; // not in use
- int * error; // not in use
- } TAOS_BIND;
+ void *buffer;
+ uintptr_t buffer_length;
+ uint32_t *length;
+ char *is_null;
+ int num; // the number of columns
+ } TAOS_MULTI_BIND;
```
- `int taos_stmt_set_tbname(TAOS_STMT* stmt, const char* name)`
@@ -418,7 +431,7 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
(2.1.1.0 版本新增,仅支持用于替换 INSERT 语句中的参数值)
当 SQL 语句中的表名使用了 `?` 占位时,可以使用此函数绑定一个具体的表名。
-- `int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_BIND* tags)`
+- `int taos_stmt_set_tbname_tags(TAOS_STMT* stmt, const char* name, TAOS_MULTI_BIND* tags)`
(2.1.2.0 版本新增,仅支持用于替换 INSERT 语句中的参数值)
当 SQL 语句中的表名和 TAGS 都使用了 `?` 占位时,可以使用此函数绑定具体的表名和具体的 TAGS 取值。最典型的使用场景是使用了自动建表功能的 INSERT 语句(目前版本不支持指定具体的 TAGS 列)。TAGS 参数中的列数量需要与 SQL 语句中要求的 TAGS 数量完全一致。
@@ -428,17 +441,6 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
(2.1.1.0 版本新增,仅支持用于替换 INSERT 语句中的参数值)
以多列的方式传递待绑定的数据,需要保证这里传递的数据列的顺序、列的数量与 SQL 语句中的 VALUES 参数完全一致。TAOS_MULTI_BIND 的具体定义如下:
- ```c
- typedef struct TAOS_MULTI_BIND {
- int buffer_type;
- void * buffer;
- uintptr_t buffer_length;
- uintptr_t * length;
- char * is_null;
- int num; // the number of columns
- } TAOS_MULTI_BIND;
- ```
-
- `int taos_stmt_add_batch(TAOS_STMT *stmt)`
将当前绑定的参数加入批处理中,调用此函数后,可以再次调用 `taos_stmt_bind_param()` 或 `taos_stmt_bind_param_batch()` 绑定新的参数。需要注意,此函数仅支持 INSERT/IMPORT 语句,如果是 SELECT 等其他 SQL 语句,将返回错误。
@@ -447,6 +449,14 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多
执行准备好的语句。目前,一条语句只能执行一次。
+- `int taos_stmt_affected_rows(TAOS_STMT *stmt)`
+
+ 获取执行多次绑定语句影响的行数。
+
+- `int taos_stmt_affected_rows_once(TAOS_STMT *stmt)`
+
+ 获取执行一次绑定语句影响的行数。
+
- `TAOS_RES* taos_stmt_use_result(TAOS_STMT *stmt)`
获取语句的结果集。结果集的使用方式与非参数化调用时一致,使用完成后,应对此结果集调用 `taos_free_result()` 以释放资源。
diff --git a/docs/zh/08-connector/40-csharp.mdx b/docs/zh/08-connector/40-csharp.mdx
index 3a945e77fd..325c71da88 100644
--- a/docs/zh/08-connector/40-csharp.mdx
+++ b/docs/zh/08-connector/40-csharp.mdx
@@ -29,6 +29,10 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx"
支持的平台和 TDengine 客户端驱动支持的平台一致。
+:::note
+注意 TDengine 不再支持 32 位 Windows 平台。
+:::
+
## 版本支持
请参考[版本支持列表](../#版本支持)
diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md
index 49a5cf8f19..222e166019 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 [hints] [DISTINCT] [TAGS] select_list
from_clause
@@ -205,7 +205,7 @@ SELECT table_name, tag_name, tag_type, tag_value FROM information_schema.ins_tag
SELECT COUNT(*) FROM (SELECT DISTINCT TBNAME FROM meters);
```
-以上两个查询均只支持在 WHERE 条件子句中添加针对标签(TAGS)的过滤条件。例如:
+以上两个查询均只支持在 WHERE 条件子句中添加针对标签(TAGS)的过滤条件。
**\_QSTART/\_QEND**
@@ -247,8 +247,7 @@ TDengine 支持基于时间戳主键的 INNER JOIN,规则如下:
3. 对于超级表,ON 条件在时间戳主键的等值条件之外,还要求有可以一一对应的标签列等值条件,不支持 OR 条件。
4. 参与 JOIN 计算的表只能是同一种类型,即只能都是超级表,或都是子表,或都是普通表。
5. JOIN 两侧均支持子查询。
-6. 参与 JOIN 的表个数上限为 10 个。
-7. 不支持与 FILL 子句混合使用。
+6. 不支持与 FILL 子句混合使用。
## GROUP BY
@@ -339,6 +338,12 @@ SELECT TODAY();
SELECT TIMEZONE();
```
+### 获取当前用户
+
+```sql
+SELECT CURRENT_USER();
+```
+
## 正则表达式过滤
### 语法
@@ -392,7 +397,7 @@ SELECT AVG(CASE WHEN voltage < 200 or voltage > 250 THEN 220 ELSE voltage END) F
## JOIN 子句
-TDengine 支持基于时间戳主键的内连接,即 JOIN 条件必须包含时间戳主键。只要满足基于时间戳主键这个要求,普通表、子表、超级表和子查询之间可以随意的进行内连接,且对表个数没有限制。
+TDengine 支持基于时间戳主键的内连接,即 JOIN 条件必须包含时间戳主键。只要满足基于时间戳主键这个要求,普通表、子表、超级表和子查询之间可以随意的进行内连接,且对表个数没有限制,其它连接条件与主键间必须是 AND 操作。
普通表与普通表之间的 JOIN 操作:
diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md
index 3c0ee06caf..f7e2a64ea7 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 函数
diff --git a/docs/zh/12-taos-sql/12-distinguished.md b/docs/zh/12-taos-sql/12-distinguished.md
old mode 100644
new mode 100755
index f750124049..62888cc5f7
--- a/docs/zh/12-taos-sql/12-distinguished.md
+++ b/docs/zh/12-taos-sql/12-distinguished.md
@@ -31,7 +31,7 @@ select max(current) from meters partition by location interval(10m)
## 窗口切分查询
-TDengine 支持按时间窗口切分方式进行聚合结果查询,比如温度传感器每秒采集一次数据,但需查询每隔 10 分钟的温度平均值。这种场景下可以使用窗口子句来获得需要的查询结果。窗口子句用于针对查询的数据集合按照窗口切分成为查询子集并进行聚合,窗口包含时间窗口(time window)、状态窗口(status window)、会话窗口(session window)、条件窗口(event window)四种窗口。其中时间窗口又可划分为滑动时间窗口和翻转时间窗口。
+TDengine 支持按时间窗口切分方式进行聚合结果查询,比如温度传感器每秒采集一次数据,但需查询每隔 10 分钟的温度平均值。这种场景下可以使用窗口子句来获得需要的查询结果。窗口子句用于针对查询的数据集合按照窗口切分成为查询子集并进行聚合,窗口包含时间窗口(time window)、状态窗口(status window)、会话窗口(session window)、事件窗口(event window)四种窗口。其中时间窗口又可划分为滑动时间窗口和翻转时间窗口。
窗口子句语法如下:
diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md
index f52af2f282..e7e926d0b7 100644
--- a/docs/zh/12-taos-sql/20-keywords.md
+++ b/docs/zh/12-taos-sql/20-keywords.md
@@ -178,7 +178,7 @@ description: TDengine 保留关键字的详细列表
- MATCH
- MAX_DELAY
-- MAX_SPEED
+- BWLIMIT
- MAXROWS
- MERGE
- META
diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md
index 6e102e2356..b7ca9493d4 100644
--- a/docs/zh/12-taos-sql/24-show.md
+++ b/docs/zh/12-taos-sql/24-show.md
@@ -22,6 +22,14 @@ SHOW CLUSTER;
显示当前集群的信息
+## SHOW CLUSTER ALIVE
+
+```sql
+SHOW CLUSTER ALIVE;
+```
+
+查询当前集群的状态是否可用,返回值: 0:不可用 1:完全可用 2:部分可用(集群中部分节点下线,但其它节点仍可以正常使用)
+
## SHOW CONNECTIONS
```sql
diff --git a/docs/zh/12-taos-sql/28-recovery.md b/docs/zh/12-taos-sql/28-recovery.md
index b5088e7982..8e327afe0b 100644
--- a/docs/zh/12-taos-sql/28-recovery.md
+++ b/docs/zh/12-taos-sql/28-recovery.md
@@ -17,7 +17,7 @@ conn_id 可以通过 `SHOW CONNECTIONS` 获取。
## 终止查询
```sql
-KILL QUERY kill_id;
+KILL QUERY 'kill_id';
```
kill_id 可以通过 `SHOW QUERIES` 获取。
diff --git a/docs/zh/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md
index 12122edd32..9fe3c5af7a 100644
--- a/docs/zh/14-reference/06-taosdump.md
+++ b/docs/zh/14-reference/06-taosdump.md
@@ -105,6 +105,8 @@ Usage: taosdump [OPTION...] dbname [tbname ...]
-L, --loose-mode Using loose mode if the table name and column name
use letter and number only. Default is NOT.
-n, --no-escape No escape char '`'. Default is using it.
+ -Q, --dot-replace Repalce dot character with underline character in
+ the table name.
-T, --thread-num=THREAD_NUM Number of thread for dump in file. Default is
8.
-C, --cloud=CLOUD_DSN specify a DSN to access TDengine cloud service
diff --git a/examples/JDBC/taosdemo/pom.xml b/examples/JDBC/taosdemo/pom.xml
index 0d47663bba..ff64d3e1df 100644
--- a/examples/JDBC/taosdemo/pom.xml
+++ b/examples/JDBC/taosdemo/pom.xml
@@ -133,6 +133,7 @@
8
8
+ UTF-8
diff --git a/examples/JDBC/taosdemo/readme.md b/examples/JDBC/taosdemo/readme.md
index edac970399..986eef8a05 100644
--- a/examples/JDBC/taosdemo/readme.md
+++ b/examples/JDBC/taosdemo/readme.md
@@ -8,4 +8,4 @@ java -jar target/taosdemo-2.0.1-jar-with-dependencies.jar -host -data
```
如果发生错误 Exception in thread "main" java.lang.UnsatisfiedLinkError: no taos in java.library.path
-请检查是否安装 TDengine 客户端安装包或编译 TDengine 安装。如果确定已经安装过还出现这个错误,可以在命令行 java 后加 -Djava.library.path=/usr/local/lib 来指定寻找共享库的路径。
+请检查是否安装 TDengine 客户端安装包或编译 TDengine 安装。如果确定已经安装过还出现这个错误,可以在命令行 java 后加 -Djava.library.path=/usr/lib 来指定寻找共享库的路径。
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index 63a370355a..748854c51b 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -113,7 +113,7 @@
#define TK_TABLE_PREFIX 95
#define TK_TABLE_SUFFIX 96
#define TK_NK_COLON 97
-#define TK_MAX_SPEED 98
+#define TK_BWLIMIT 98
#define TK_START 99
#define TK_TIMESTAMP 100
#define TK_END 101
@@ -356,6 +356,7 @@
#define TK_WAL 338
+
#define TK_NK_SPACE 600
#define TK_NK_COMMENT 601
#define TK_NK_ILLEGAL 602
diff --git a/include/libs/executor/dataSinkMgt.h b/include/libs/executor/dataSinkMgt.h
index 617ca7c23a..2e2882e35e 100644
--- a/include/libs/executor/dataSinkMgt.h
+++ b/include/libs/executor/dataSinkMgt.h
@@ -59,7 +59,7 @@ typedef struct SDataSinkMgtCfg {
uint32_t maxDataBlockNumPerQuery;
} SDataSinkMgtCfg;
-int32_t dsDataSinkMgtInit(SDataSinkMgtCfg* cfg, SStorageAPI* pAPI);
+int32_t dsDataSinkMgtInit(SDataSinkMgtCfg* cfg, SStorageAPI* pAPI, void** ppSinkManager);
typedef struct SInputData {
const struct SSDataBlock* pData;
@@ -83,7 +83,7 @@ typedef struct SOutputData {
* @param pHandle output
* @return error code
*/
-int32_t dsCreateDataSinker(const SDataSinkNode* pDataSink, DataSinkHandle* pHandle, void* pParam, const char* id);
+int32_t dsCreateDataSinker(void* pSinkManager, const SDataSinkNode* pDataSink, DataSinkHandle* pHandle, void* pParam, const char* id);
int32_t dsDataSinkGetCacheSize(SDataSinkStat* pStat);
diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile
index 0570bae191..1b2e555b88 100644
--- a/packaging/MPtestJenkinsfile
+++ b/packaging/MPtestJenkinsfile
@@ -114,7 +114,7 @@ pipeline {
sync_source("${BRANCH_NAME}")
sh '''
if [ "${verMode}" = "all" ];then
- verMode="community enterprise"
+ verMode="enterprise"
fi
verModeList=${verMode}
for verModeSin in ${verModeList}
@@ -123,18 +123,6 @@ pipeline {
bash testpackage.sh -m ${verModeSin} -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
python3 checkPackageRuning.py
done
- '''
-
- sh '''
- cd ${TDENGINE_ROOT_DIR}/packaging
- bash testpackage.sh -m community -f server -l true -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t tar
- python3 checkPackageRuning.py
- '''
-
- sh '''
- cd ${TDENGINE_ROOT_DIR}/packaging
- bash testpackage.sh -m community -f server -l false -c x64 -v ${version} -o ${baseVersion} -s ${sourcePath} -t deb
- python3 checkPackageRuning.py
'''
}
}
diff --git a/packaging/deb/DEBIAN/prerm b/packaging/deb/DEBIAN/prerm
index 0d63115a04..a474dc4c80 100644
--- a/packaging/deb/DEBIAN/prerm
+++ b/packaging/deb/DEBIAN/prerm
@@ -37,6 +37,7 @@ else
${csudo}rm -f ${inc_link_dir}/taos.h || :
${csudo}rm -f ${inc_link_dir}/taosdef.h || :
${csudo}rm -f ${inc_link_dir}/taoserror.h || :
+ ${csudo}rm -f ${inc_link_dir}/tdef.h || :
${csudo}rm -f ${inc_link_dir}/taosudf.h || :
[ -f ${inc_link_dir}/taosws.h ] && ${csudo}rm -f ${inc_link_dir}/taosws.h || :
${csudo}rm -f ${lib_link_dir}/libtaos.* || :
diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh
index 07819159c4..eca75ce71a 100755
--- a/packaging/deb/makedeb.sh
+++ b/packaging/deb/makedeb.sh
@@ -98,6 +98,7 @@ cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_pat
cp ${compile_dir}/../include/client/taos.h ${pkg_dir}${install_home_path}/include
cp ${compile_dir}/../include/common/taosdef.h ${pkg_dir}${install_home_path}/include
cp ${compile_dir}/../include/util/taoserror.h ${pkg_dir}${install_home_path}/include
+cp ${compile_dir}/../include/util/tdef.h ${pkg_dir}${install_home_path}/include
cp ${compile_dir}/../include/libs/function/taosudf.h ${pkg_dir}${install_home_path}/include
[ -f ${compile_dir}/build/include/taosws.h ] && cp ${compile_dir}/build/include/taosws.h ${pkg_dir}${install_home_path}/include ||:
cp -r ${top_dir}/examples/* ${pkg_dir}${install_home_path}/examples
diff --git a/packaging/rpm/tdengine.spec b/packaging/rpm/tdengine.spec
index 846d17e7f6..e93af2470a 100644
--- a/packaging/rpm/tdengine.spec
+++ b/packaging/rpm/tdengine.spec
@@ -95,6 +95,7 @@ cp %{_compiledir}/build/lib/${libfile} %{buildroot}%{homepath}/driv
cp %{_compiledir}/../include/client/taos.h %{buildroot}%{homepath}/include
cp %{_compiledir}/../include/common/taosdef.h %{buildroot}%{homepath}/include
cp %{_compiledir}/../include/util/taoserror.h %{buildroot}%{homepath}/include
+cp %{_compiledir}/../include/util/tdef.h %{buildroot}%{homepath}/include
cp %{_compiledir}/../include/libs/function/taosudf.h %{buildroot}%{homepath}/include
[ -f %{_compiledir}/build/include/taosws.h ] && cp %{_compiledir}/build/include/taosws.h %{buildroot}%{homepath}/include ||:
#cp -r %{_compiledir}/../src/connector/python %{buildroot}%{homepath}/connector
@@ -217,6 +218,7 @@ if [ $1 -eq 0 ];then
${csudo}rm -f ${inc_link_dir}/taos.h || :
${csudo}rm -f ${inc_link_dir}/taosdef.h || :
${csudo}rm -f ${inc_link_dir}/taoserror.h || :
+ ${csudo}rm -f ${inc_link_dir}/tdef.h || :
${csudo}rm -f ${inc_link_dir}/taosudf.h || :
${csudo}rm -f ${lib_link_dir}/libtaos.* || :
diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh
index f9a11f5540..408a5664a8 100755
--- a/packaging/tools/install.sh
+++ b/packaging/tools/install.sh
@@ -345,7 +345,7 @@ function install_jemalloc() {
}
function install_header() {
- ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || :
+ ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/tdef.h ${inc_link_dir}/taosudf.h || :
[ -f ${inc_link_dir}/taosws.h ] && ${csudo}rm -f ${inc_link_dir}/taosws.h || :
@@ -353,6 +353,7 @@ function install_header() {
${csudo}ln -sf ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -sf ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h
${csudo}ln -sf ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
+ ${csudo}ln -sf ${install_main_dir}/include/tdef.h ${inc_link_dir}/tdef.h
${csudo}ln -sf ${install_main_dir}/include/taosudf.h ${inc_link_dir}/taosudf.h
[ -f ${install_main_dir}/include/taosws.h ] && ${csudo}ln -sf ${install_main_dir}/include/taosws.h ${inc_link_dir}/taosws.h || :
@@ -935,7 +936,7 @@ function updateProduct() {
fi
echo
echo -e "\033[44;32;1m${productName2} is updated successfully!${NC}"
- echo -e "\033[44;32;1mTo manage ${productName2} instance, view documentation and explorer features, you need to install ${clientName2}Explorer ${NC}"
+ echo -e "\033[44;32;1mTo manage ${productName2} instance, view documentation or explorer features, please install ${clientName2}Explorer ${NC}"
else
install_bin
install_config
@@ -1028,7 +1029,7 @@ function installProduct() {
fi
echo -e "\033[44;32;1m${productName2} is installed successfully!${NC}"
- echo -e "\033[44;32;1mTo manage ${productName2} instance, view documentation and explorer features, you need to install ${clientName2}Explorer ${NC}"
+ echo -e "\033[44;32;1mTo manage ${productName2} instance, view documentation or explorer features, please install ${clientName2}Explorer ${NC}"
echo
else # Only install client
install_bin
diff --git a/packaging/tools/install_client.sh b/packaging/tools/install_client.sh
index 18ebf9dc8f..c8baab8269 100755
--- a/packaging/tools/install_client.sh
+++ b/packaging/tools/install_client.sh
@@ -180,10 +180,11 @@ function install_lib() {
}
function install_header() {
- ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || :
+ ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/tdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || :
${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h
+ ${csudo}ln -s ${install_main_dir}/include/tdef.h ${inc_link_dir}/tdef.h
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
${csudo}ln -s ${install_main_dir}/include/taosudf.h ${inc_link_dir}/taosudf.h
diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh
index 0a5f9d2668..ea19125bf5 100755
--- a/packaging/tools/make_install.sh
+++ b/packaging/tools/make_install.sh
@@ -158,7 +158,6 @@ function install_bin() {
${csudo}rm -f ${bin_link_dir}/udfd || :
${csudo}rm -f ${bin_link_dir}/taosdemo || :
${csudo}rm -f ${bin_link_dir}/taosdump || :
- ${csudo}rm -f ${bin_link_dir}/taosx || :
${csudo}rm -f ${bin_link_dir}/${uninstallScript} || :
if [ "$osType" != "Darwin" ]; then
@@ -348,9 +347,9 @@ function install_lib() {
function install_header() {
${csudo}mkdir -p ${inc_link_dir}
- ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || :
+ ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/tdef.h ${inc_link_dir}/taosudf.h || :
[ -f ${inc_link_dir}/taosws.h ] && ${csudo}rm -f ${inc_link_dir}/taosws.h ||:
- ${csudo}cp -f ${source_dir}/include/client/taos.h ${source_dir}/include/common/taosdef.h ${source_dir}/include/util/taoserror.h ${source_dir}/include/libs/function/taosudf.h \
+ ${csudo}cp -f ${source_dir}/include/client/taos.h ${source_dir}/include/common/taosdef.h ${source_dir}/include/util/taoserror.h ${source_dir}/include/util/tdef.h ${source_dir}/include/libs/function/taosudf.h \
${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
if [ -f ${binary_dir}/build/include/taosws.h ]; then
@@ -361,6 +360,7 @@ function install_header() {
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h > /dev/null 2>&1
${csudo}ln -s ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h > /dev/null 2>&1
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h > /dev/null 2>&1
+ ${csudo}ln -s ${install_main_dir}/include/tdef.h ${inc_link_dir}/tdef.h > /dev/null 2>&1
${csudo}ln -s ${install_main_dir}/include/taosudf.h ${inc_link_dir}/taosudf.h > /dev/null 2>&1
${csudo}chmod 644 ${install_main_dir}/include/*
diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh
index cd59294fe7..243efd693e 100755
--- a/packaging/tools/makeclient.sh
+++ b/packaging/tools/makeclient.sh
@@ -83,7 +83,7 @@ else
wslib_files="${build_dir}/lib/libtaosws.dylib"
fi
-header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/libs/function/taosudf.h"
+header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/util/tdef.h ${code_dir}/include/libs/function/taosudf.h"
wsheader_files="${build_dir}/include/taosws.h"
if [ "$dbName" != "taos" ]; then
diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh
index ad64ca431e..655629b92c 100755
--- a/packaging/tools/makepkg.sh
+++ b/packaging/tools/makepkg.sh
@@ -115,7 +115,7 @@ else
lib_files="${build_dir}/lib/libtaos.so.${version}"
wslib_files="${build_dir}/lib/libtaosws.so"
fi
-header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/libs/function/taosudf.h"
+header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/util/tdef.h ${code_dir}/include/libs/function/taosudf.h"
wsheader_files="${build_dir}/include/taosws.h"
diff --git a/packaging/tools/post.sh b/packaging/tools/post.sh
index e79a10c9e9..ceaebfdc7c 100755
--- a/packaging/tools/post.sh
+++ b/packaging/tools/post.sh
@@ -133,12 +133,13 @@ function kill_taosd() {
function install_include() {
log_print "start install include from ${inc_dir} to ${inc_link_dir}"
${csudo}mkdir -p ${inc_link_dir}
- ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/taosudf.h || :
+ ${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h ${inc_link_dir}/tdef.h ${inc_link_dir}/taosudf.h || :
[ -f ${inc_link_dir}/taosws.h ] && ${csudo}rm -f ${inc_link_dir}/taosws.h ||:
${csudo}ln -s ${inc_dir}/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${inc_dir}/taosdef.h ${inc_link_dir}/taosdef.h
${csudo}ln -s ${inc_dir}/taoserror.h ${inc_link_dir}/taoserror.h
+ ${csudo}ln -s ${inc_dir}/tdef.h ${inc_link_dir}/tdef.h
${csudo}ln -s ${inc_dir}/taosudf.h ${inc_link_dir}/taosudf.h
[ -f ${inc_dir}/taosws.h ] && ${csudo}ln -sf ${inc_dir}/taosws.h ${inc_link_dir}/taosws.h ||:
diff --git a/packaging/tools/preun.sh b/packaging/tools/preun.sh
index 68f6b53c45..25f3d8ce4a 100755
--- a/packaging/tools/preun.sh
+++ b/packaging/tools/preun.sh
@@ -143,6 +143,7 @@ ${csudo}rm -f ${cfg_link_dir}/*.new || :
${csudo}rm -f ${inc_link_dir}/taos.h || :
${csudo}rm -f ${inc_link_dir}/taosdef.h || :
${csudo}rm -f ${inc_link_dir}/taoserror.h || :
+${csudo}rm -f ${inc_link_dir}/tdef.h || :
${csudo}rm -f ${inc_link_dir}/taosudf.h || :
${csudo}rm -f ${lib_link_dir}/libtaos.* || :
${csudo}rm -f ${lib64_link_dir}/libtaos.* || :
diff --git a/packaging/tools/remove.sh b/packaging/tools/remove.sh
index eca0c5e973..0e8b036f28 100755
--- a/packaging/tools/remove.sh
+++ b/packaging/tools/remove.sh
@@ -155,6 +155,7 @@ function clean_header() {
${csudo}rm -f ${inc_link_dir}/taos.h || :
${csudo}rm -f ${inc_link_dir}/taosdef.h || :
${csudo}rm -f ${inc_link_dir}/taoserror.h || :
+ ${csudo}rm -f ${inc_link_dir}/tdef.h || :
${csudo}rm -f ${inc_link_dir}/taosudf.h || :
[ -f ${inc_link_dir}/taosws.h ] && ${csudo}rm -f ${inc_link_dir}/taosws.h || :
diff --git a/packaging/tools/remove_client.sh b/packaging/tools/remove_client.sh
index 2bdb56fac2..695307254d 100755
--- a/packaging/tools/remove_client.sh
+++ b/packaging/tools/remove_client.sh
@@ -73,6 +73,7 @@ function clean_header() {
${csudo}rm -f ${inc_link_dir}/taos.h || :
${csudo}rm -f ${inc_link_dir}/taosdef.h || :
${csudo}rm -f ${inc_link_dir}/taoserror.h || :
+ ${csudo}rm -f ${inc_link_dir}/tdef.h || :
${csudo}rm -f ${inc_link_dir}/taosudf.h || :
}
diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c
index dd311db126..9fb89aad77 100644
--- a/source/client/src/clientRawBlockWrite.c
+++ b/source/client/src/clientRawBlockWrite.c
@@ -687,14 +687,14 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
pReq.pColumns = taosArrayInit(req.schemaRow.nCols, sizeof(SField));
for (int32_t i = 0; i < req.schemaRow.nCols; i++) {
SSchema* pSchema = req.schemaRow.pSchema + i;
- SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
+ SField field = {.type = pSchema->type, .flags = pSchema->flags, .bytes = pSchema->bytes};
strcpy(field.name, pSchema->name);
taosArrayPush(pReq.pColumns, &field);
}
pReq.pTags = taosArrayInit(req.schemaTag.nCols, sizeof(SField));
for (int32_t i = 0; i < req.schemaTag.nCols; i++) {
SSchema* pSchema = req.schemaTag.pSchema + i;
- SField field = {.type = pSchema->type, .bytes = pSchema->bytes};
+ SField field = {.type = pSchema->type, .flags = pSchema->flags, .bytes = pSchema->bytes};
strcpy(field.name, pSchema->name);
taosArrayPush(pReq.pTags, &field);
}
diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c
index cad32842a0..56ce3a90e0 100644
--- a/source/client/src/clientSml.c
+++ b/source/client/src/clientSml.c
@@ -218,7 +218,16 @@ int32_t smlSetCTableName(SSmlTableInfo *oneTable) {
if (strlen(oneTable->childTableName) == 0) {
SArray *dst = taosArrayDup(oneTable->tags, NULL);
- RandTableName rName = {dst, oneTable->sTableName, (uint8_t)oneTable->sTableNameLen, oneTable->childTableName};
+ ASSERT(oneTable->sTableNameLen < TSDB_TABLE_NAME_LEN);
+ char superName[TSDB_TABLE_NAME_LEN] = {0};
+ RandTableName rName = {dst, NULL, (uint8_t)oneTable->sTableNameLen, oneTable->childTableName};
+ if(tsSmlDot2Underline){
+ memcpy(superName, oneTable->sTableName, oneTable->sTableNameLen);
+ smlStrReplace(superName, oneTable->sTableNameLen);
+ rName.stbFullName = superName;
+ }else{
+ rName.stbFullName = oneTable->sTableName;
+ }
buildChildTableName(&rName);
taosArrayDestroy(dst);
@@ -230,6 +239,9 @@ void getTableUid(SSmlHandle *info, SSmlLineInfo *currElement, SSmlTableInfo *tin
char key[TSDB_TABLE_NAME_LEN * 2 + 1] = {0};
size_t nLen = strlen(tinfo->childTableName);
memcpy(key, currElement->measure, currElement->measureLen);
+ if(tsSmlDot2Underline){
+ smlStrReplace(key, currElement->measureLen);
+ }
memcpy(key + currElement->measureLen + 1, tinfo->childTableName, nLen);
void *uid =
taosHashGet(info->tableUids, key,
diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c
index b4168046f4..e861bd4b92 100644
--- a/source/client/src/clientTmq.c
+++ b/source/client/src/clientTmq.c
@@ -985,6 +985,10 @@ int32_t tmq_subscription(tmq_t* tmq, tmq_list_t** topics) {
int32_t tmq_unsubscribe(tmq_t* tmq) {
if(tmq == NULL) return TSDB_CODE_INVALID_PARA;
+ if (tmq->status != TMQ_CONSUMER_STATUS__READY) {
+ tscInfo("consumer:0x%" PRIx64 " not in ready state, unsubscribe it directly", tmq->consumerId);
+ return 0;
+ }
if (tmq->autoCommit) {
int32_t rsp = tmq_commit_sync(tmq, NULL);
if (rsp != 0) {
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index e21e3a06b2..e14e4335d5 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -1407,8 +1407,9 @@ SSDataBlock* blockCopyOneRow(const SSDataBlock* pDataBlock, int32_t rowIdx) {
for (int32_t i = 0; i < numOfCols; ++i) {
SColumnInfoData* pDst = taosArrayGet(pBlock->pDataBlock, i);
SColumnInfoData* pSrc = taosArrayGet(pDataBlock->pDataBlock, i);
- void* pData = colDataGetData(pSrc, rowIdx);
bool isNull = colDataIsNull(pSrc, pDataBlock->info.rows, rowIdx, NULL);
+ void* pData = NULL;
+ if (!isNull) pData = colDataGetData(pSrc, rowIdx);
colDataSetVal(pDst, 0, pData, isNull);
}
diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c
index f52ce6582b..e2ba8e3581 100644
--- a/source/dnode/mnode/impl/src/mndStb.c
+++ b/source/dnode/mnode/impl/src/mndStb.c
@@ -3233,136 +3233,161 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock *p, const SSysTableMeta *p
return numOfRows;
}
+#define BUILD_COL_FOR_INFO_DB 1
+#define BUILD_COL_FOR_PERF_DB 1 << 1
+#define BUILD_COL_FOR_USER_DB 1 << 2
+#define BUILD_COL_FOR_ALL_DB (BUILD_COL_FOR_INFO_DB | BUILD_COL_FOR_PERF_DB | BUILD_COL_FOR_USER_DB)
-static int32_t buildSysDbColsInfo(SSDataBlock *p, char *db, char *tb) {
+static int32_t buildSysDbColsInfo(SSDataBlock *p, int8_t buildWhichDBs, char *tb) {
size_t size = 0;
const SSysTableMeta *pSysDbTableMeta = NULL;
- if (db[0] && strncmp(db, TSDB_INFORMATION_SCHEMA_DB, TSDB_DB_FNAME_LEN) != 0 &&
- strncmp(db, TSDB_PERFORMANCE_SCHEMA_DB, TSDB_DB_FNAME_LEN) != 0) {
- return p->info.rows;
+ if (buildWhichDBs & BUILD_COL_FOR_INFO_DB) {
+ getInfosDbMeta(&pSysDbTableMeta, &size);
+ p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB, tb);
}
- getInfosDbMeta(&pSysDbTableMeta, &size);
- p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB, tb);
-
- getPerfDbMeta(&pSysDbTableMeta, &size);
- p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB, tb);
+ if (buildWhichDBs & BUILD_COL_FOR_PERF_DB) {
+ getPerfDbMeta(&pSysDbTableMeta, &size);
+ p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB, tb);
+ }
return p->info.rows;
}
+static int8_t determineBuildColForWhichDBs(const char* db) {
+ int8_t buildWhichDBs;
+ if (!db[0])
+ buildWhichDBs = BUILD_COL_FOR_ALL_DB;
+ else {
+ char *p = strchr(db, '.');
+ if (p && strcmp(p + 1, TSDB_INFORMATION_SCHEMA_DB) == 0) {
+ buildWhichDBs = BUILD_COL_FOR_INFO_DB;
+ } else if (p && strcmp(p + 1, TSDB_PERFORMANCE_SCHEMA_DB) == 0) {
+ buildWhichDBs = BUILD_COL_FOR_PERF_DB;
+ } else {
+ buildWhichDBs = BUILD_COL_FOR_USER_DB;
+ }
+ }
+ return buildWhichDBs;
+}
+
static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
+ uint8_t buildWhichDBs;
SMnode *pMnode = pReq->info.node;
SSdb *pSdb = pMnode->pSdb;
SStbObj *pStb = NULL;
-
int32_t numOfRows = 0;
+
+ buildWhichDBs = determineBuildColForWhichDBs(pShow->db);
+
if (!pShow->sysDbRsp) {
- numOfRows = buildSysDbColsInfo(pBlock, pShow->db, pShow->filterTb);
+ numOfRows = buildSysDbColsInfo(pBlock, buildWhichDBs, pShow->filterTb);
mDebug("mndRetrieveStbCol get system table cols, rows:%d, db:%s", numOfRows, pShow->db);
pShow->sysDbRsp = true;
}
- SDbObj *pDb = NULL;
- if (strlen(pShow->db) > 0) {
- pDb = mndAcquireDb(pMnode, pShow->db);
- if (pDb == NULL) return terrno;
- }
-
- char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
- STR_TO_VARSTR(typeName, "SUPER_TABLE");
- bool fetch = pShow->restore ? false : true;
- pShow->restore = false;
- while (numOfRows < rows) {
- if (fetch) {
- pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb);
- if (pShow->pIter == NULL) break;
- } else {
- fetch = true;
- void *pKey = taosHashGetKey(pShow->pIter, NULL);
- pStb = sdbAcquire(pSdb, SDB_STB, pKey);
- if (!pStb) continue;
+ if (buildWhichDBs & BUILD_COL_FOR_USER_DB) {
+ SDbObj *pDb = NULL;
+ if (strlen(pShow->db) > 0) {
+ pDb = mndAcquireDb(pMnode, pShow->db);
+ if (pDb == NULL && TSDB_CODE_MND_DB_NOT_EXIST != terrno && pBlock->info.rows == 0) return terrno;
}
- if (pDb != NULL && pStb->dbUid != pDb->uid) {
- sdbRelease(pSdb, pStb);
- continue;
- }
-
- SName name = {0};
- char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
- mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN);
- if (pShow->filterTb[0] && strncmp(pShow->filterTb, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN) != 0) {
- sdbRelease(pSdb, pStb);
- continue;
- }
-
- if ((numOfRows + pStb->numOfColumns) > rows) {
- pShow->restore = true;
- if (numOfRows == 0) {
- mError("mndRetrieveStbCol failed to get stable cols since buf:%d less than result:%d, stable name:%s, db:%s",
- rows, pStb->numOfColumns, pStb->name, pStb->db);
+ char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_TO_VARSTR(typeName, "SUPER_TABLE");
+ bool fetch = pShow->restore ? false : true;
+ pShow->restore = false;
+ while (numOfRows < rows) {
+ if (fetch) {
+ pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb);
+ if (pShow->pIter == NULL) break;
+ } else {
+ fetch = true;
+ void *pKey = taosHashGetKey(pShow->pIter, NULL);
+ pStb = sdbAcquire(pSdb, SDB_STB, pKey);
+ if (!pStb) continue;
}
- sdbRelease(pSdb, pStb);
- break;
- }
- varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE]));
-
- mDebug("mndRetrieveStbCol get stable cols, stable name:%s, db:%s", pStb->name, pStb->db);
-
- char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
- tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB);
- tNameGetDbName(&name, varDataVal(db));
- varDataSetLen(db, strlen(varDataVal(db)));
-
- for (int i = 0; i < pStb->numOfColumns; i++) {
- int32_t cols = 0;
- SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetVal(pColInfo, numOfRows, (const char *)stbName, false);
-
- pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetVal(pColInfo, numOfRows, (const char *)db, false);
-
- pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetVal(pColInfo, numOfRows, typeName, false);
-
- // col name
- char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
- STR_TO_VARSTR(colName, pStb->pColumns[i].name);
- pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetVal(pColInfo, numOfRows, colName, false);
-
- // col type
- int8_t colType = pStb->pColumns[i].type;
- pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- char colTypeStr[VARSTR_HEADER_SIZE + 32];
- int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name);
- if (colType == TSDB_DATA_TYPE_VARCHAR) {
- colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)",
- (int32_t)(pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE));
- } else if (colType == TSDB_DATA_TYPE_NCHAR) {
- colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)",
- (int32_t)((pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE));
+ if (pDb != NULL && pStb->dbUid != pDb->uid) {
+ sdbRelease(pSdb, pStb);
+ continue;
}
- varDataSetLen(colTypeStr, colTypeLen);
- colDataSetVal(pColInfo, numOfRows, (char *)colTypeStr, false);
- pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetVal(pColInfo, numOfRows, (const char *)&pStb->pColumns[i].bytes, false);
- while (cols < pShow->numOfColumns) {
+ SName name = {0};
+ char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN);
+ if (pShow->filterTb[0] && strncmp(pShow->filterTb, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN) != 0) {
+ sdbRelease(pSdb, pStb);
+ continue;
+ }
+
+ if ((numOfRows + pStb->numOfColumns) > rows) {
+ pShow->restore = true;
+ if (numOfRows == 0) {
+ mError("mndRetrieveStbCol failed to get stable cols since buf:%d less than result:%d, stable name:%s, db:%s",
+ rows, pStb->numOfColumns, pStb->name, pStb->db);
+ }
+ sdbRelease(pSdb, pStb);
+ break;
+ }
+
+ varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE]));
+
+ mDebug("mndRetrieveStbCol get stable cols, stable name:%s, db:%s", pStb->name, pStb->db);
+
+ char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB);
+ tNameGetDbName(&name, varDataVal(db));
+ varDataSetLen(db, strlen(varDataVal(db)));
+
+ for (int i = 0; i < pStb->numOfColumns; i++) {
+ int32_t cols = 0;
+ SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, (const char *)stbName, false);
+
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
- colDataSetNULL(pColInfo, numOfRows);
+ colDataSetVal(pColInfo, numOfRows, (const char *)db, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, typeName, false);
+
+ // col name
+ char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
+ STR_TO_VARSTR(colName, pStb->pColumns[i].name);
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, colName, false);
+
+ // col type
+ int8_t colType = pStb->pColumns[i].type;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ char colTypeStr[VARSTR_HEADER_SIZE + 32];
+ int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name);
+ if (colType == TSDB_DATA_TYPE_VARCHAR) {
+ colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)",
+ (int32_t)(pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE));
+ } else if (colType == TSDB_DATA_TYPE_NCHAR) {
+ colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)",
+ (int32_t)((pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE));
+ }
+ varDataSetLen(colTypeStr, colTypeLen);
+ colDataSetVal(pColInfo, numOfRows, (char *)colTypeStr, false);
+
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetVal(pColInfo, numOfRows, (const char *)&pStb->pColumns[i].bytes, false);
+ while (cols < pShow->numOfColumns) {
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
+ colDataSetNULL(pColInfo, numOfRows);
+ }
+ numOfRows++;
}
- numOfRows++;
+
+ sdbRelease(pSdb, pStb);
}
- sdbRelease(pSdb, pStb);
- }
-
- if (pDb != NULL) {
- mndReleaseDb(pMnode, pDb);
+ if (pDb != NULL) {
+ mndReleaseDb(pMnode, pDb);
+ }
}
pShow->numOfRows += numOfRows;
diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c
index 427a52af3b..152b7df5ad 100644
--- a/source/dnode/mnode/impl/src/mndStream.c
+++ b/source/dnode/mnode/impl/src/mndStream.c
@@ -1567,6 +1567,7 @@ static int32_t mndProcessResumeStreamReq(SRpcMsg *pReq) {
}
if (pStream->status != STREAM_STATUS__PAUSE) {
+ sdbRelease(pMnode->pSdb, pStream);
return 0;
}
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index a5f7e0eb68..cef8a99e25 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -883,20 +883,8 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
} else {
tqInfo("vgId:%d switch consumer from Id:0x%" PRIx64 " to Id:0x%" PRIx64, req.vgId, pHandle->consumerId, req.newConsumerId);
atomic_store_64(&pHandle->consumerId, req.newConsumerId);
- // atomic_add_fetch_32(&pHandle->epoch, 1);
+ atomic_store_32(&pHandle->epoch, 0);
- // kill executing task
- // if(tqIsHandleExec(pHandle)) {
- // qTaskInfo_t pTaskInfo = pHandle->execHandle.task;
- // if (pTaskInfo != NULL) {
- // qKillTask(pTaskInfo, TSDB_CODE_SUCCESS);
- // }
-
- // if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) {
- // qStreamCloseTsdbReader(pTaskInfo);
- // }
- // }
- // remove if it has been register in the push manager, and return one empty block to consumer
tqUnregisterPushHandle(pTq, pHandle);
ret = tqMetaSaveHandle(pTq, req.subKey, pHandle);
}
diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c
index c15a92cc2e..ec8f2ae35d 100644
--- a/source/dnode/vnode/src/tq/tqRead.c
+++ b/source/dnode/vnode/src/tq/tqRead.c
@@ -305,7 +305,7 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, con
}
SWalCont* pCont = &pReader->pHead->head;
- int64_t ver = pCont->version;
+ int64_t ver = pCont->version;
if (ver > maxVer) {
tqDebug("maxVer in WAL:%" PRId64 " reached current:%" PRId64 ", do not scan wal anymore, %s", maxVer, ver, id);
return TSDB_CODE_SUCCESS;
diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit2.c b/source/dnode/vnode/src/tsdb/tsdbCommit2.c
index afbe895721..d4cb63fb7b 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCommit2.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCommit2.c
@@ -235,36 +235,33 @@ static int32_t tsdbCommitOpenReader(SCommitter2 *committer) {
return 0;
}
- ASSERT(TARRAY2_SIZE(committer->ctx->fset->lvlArr) == 1);
+ SSttLvl *lvl;
+ TARRAY2_FOREACH(committer->ctx->fset->lvlArr, lvl) {
+ STFileObj *fobj = NULL;
+ TARRAY2_FOREACH(lvl->fobjArr, fobj) {
+ SSttFileReader *sttReader;
- SSttLvl *lvl = TARRAY2_FIRST(committer->ctx->fset->lvlArr);
+ SSttFileReaderConfig config = {
+ .tsdb = committer->tsdb,
+ .szPage = committer->szPage,
+ .file = fobj->f[0],
+ };
- ASSERT(lvl->level == 0);
+ code = tsdbSttFileReaderOpen(fobj->fname, &config, &sttReader);
+ TSDB_CHECK_CODE(code, lino, _exit);
- STFileObj *fobj = NULL;
- TARRAY2_FOREACH(lvl->fobjArr, fobj) {
- SSttFileReader *sttReader;
+ code = TARRAY2_APPEND(committer->sttReaderArray, sttReader);
+ TSDB_CHECK_CODE(code, lino, _exit);
- SSttFileReaderConfig config = {
- .tsdb = committer->tsdb,
- .szPage = committer->szPage,
- .file = fobj->f[0],
- };
+ STFileOp op = {
+ .optype = TSDB_FOP_REMOVE,
+ .fid = fobj->f->fid,
+ .of = fobj->f[0],
+ };
- code = tsdbSttFileReaderOpen(fobj->fname, &config, &sttReader);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- code = TARRAY2_APPEND(committer->sttReaderArray, sttReader);
- TSDB_CHECK_CODE(code, lino, _exit);
-
- STFileOp op = {
- .optype = TSDB_FOP_REMOVE,
- .fid = fobj->f->fid,
- .of = fobj->f[0],
- };
-
- code = TARRAY2_APPEND(committer->fopArray, op);
- TSDB_CHECK_CODE(code, lino, _exit);
+ code = TARRAY2_APPEND(committer->fopArray, op);
+ TSDB_CHECK_CODE(code, lino, _exit);
+ }
}
_exit:
diff --git a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c
index 59ba51c371..3f1fcb7248 100644
--- a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c
+++ b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c
@@ -120,7 +120,15 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *
};
if (dataBlk->hasDup) {
- code = tsdbReadDataBlockEx(reader, dataBlk, ctx->blockData);
+ tBlockDataReset(ctx->blockData);
+
+ int16_t aCid = 0;
+ STSchema tSchema = {0};
+ TABLEID tbid = {.suid = pBlockIdx->suid, .uid = pBlockIdx->uid};
+ code = tBlockDataInit(ctx->blockData, &tbid, &tSchema, &aCid, 0);
+ TSDB_CHECK_CODE(code, lino, _exit);
+
+ code = tsdbReadDataBlock(reader, dataBlk, ctx->blockData);
TSDB_CHECK_CODE(code, lino, _exit);
record.count = 1;
@@ -334,6 +342,8 @@ static int32_t tsdbUpgradeFileSet(STsdb *tsdb, SDFileSet *pDFileSet, TFileSetArr
int32_t code = 0;
int32_t lino = 0;
+ tsdbInfo("vgId:%d upgrade file set start, fid:%d", TD_VID(tsdb->pVnode), pDFileSet->fid);
+
SDataFReader *reader;
STFileSet *fset;
@@ -366,6 +376,8 @@ static int32_t tsdbUpgradeFileSet(STsdb *tsdb, SDFileSet *pDFileSet, TFileSetArr
code = TARRAY2_APPEND(fileSetArray, fset);
TSDB_CHECK_CODE(code, lino, _exit);
+ tsdbInfo("vgId:%d upgrade file set end, fid:%d", TD_VID(tsdb->pVnode), pDFileSet->fid);
+
_exit:
if (code) {
TSDB_ERROR_LOG(TD_VID(tsdb->pVnode), lino, code);
diff --git a/source/libs/executor/src/dataDeleter.c b/source/libs/executor/src/dataDeleter.c
index 11074b0e94..960ae14fcf 100644
--- a/source/libs/executor/src/dataDeleter.c
+++ b/source/libs/executor/src/dataDeleter.c
@@ -224,6 +224,8 @@ static int32_t destroyDataSinker(SDataSinkHandle* pHandle) {
}
taosCloseQueue(pDeleter->pDataBlocks);
taosThreadMutexDestroy(&pDeleter->mutex);
+
+ taosMemoryFree(pDeleter->pManager);
return TSDB_CODE_SUCCESS;
}
@@ -279,6 +281,8 @@ _end:
if (deleter != NULL) {
destroyDataSinker((SDataSinkHandle*)deleter);
taosMemoryFree(deleter);
+ } else {
+ taosMemoryFree(pManager);
}
return code;
}
diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c
index 38f6541a39..53c7c073ed 100644
--- a/source/libs/executor/src/dataDispatcher.c
+++ b/source/libs/executor/src/dataDispatcher.c
@@ -234,6 +234,7 @@ static int32_t destroyDataSinker(SDataSinkHandle* pHandle) {
}
taosCloseQueue(pDispatcher->pDataBlocks);
taosThreadMutexDestroy(&pDispatcher->mutex);
+ taosMemoryFree(pDispatcher->pManager);
return TSDB_CODE_SUCCESS;
}
@@ -248,7 +249,7 @@ int32_t createDataDispatcher(SDataSinkManager* pManager, const SDataSinkNode* pD
SDataDispatchHandle* dispatcher = taosMemoryCalloc(1, sizeof(SDataDispatchHandle));
if (NULL == dispatcher) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
- return TSDB_CODE_OUT_OF_MEMORY;
+ goto _return;
}
dispatcher->sink.fPut = putDataBlock;
dispatcher->sink.fEndPut = endPut;
@@ -266,8 +267,13 @@ int32_t createDataDispatcher(SDataSinkManager* pManager, const SDataSinkNode* pD
if (NULL == dispatcher->pDataBlocks) {
taosMemoryFree(dispatcher);
terrno = TSDB_CODE_OUT_OF_MEMORY;
- return TSDB_CODE_OUT_OF_MEMORY;
+ goto _return;
}
*pHandle = dispatcher;
return TSDB_CODE_SUCCESS;
+
+_return:
+
+ taosMemoryFree(pManager);
+ return terrno;
}
diff --git a/source/libs/executor/src/dataInserter.c b/source/libs/executor/src/dataInserter.c
index 646964ebf4..8a70726cc8 100644
--- a/source/libs/executor/src/dataInserter.c
+++ b/source/libs/executor/src/dataInserter.c
@@ -395,6 +395,8 @@ static int32_t destroyDataSinker(SDataSinkHandle* pHandle) {
taosMemoryFree(pInserter->pParam);
taosHashCleanup(pInserter->pCols);
taosThreadMutexDestroy(&pInserter->mutex);
+
+ taosMemoryFree(pInserter->pManager);
return TSDB_CODE_SUCCESS;
}
@@ -411,7 +413,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
if (NULL == inserter) {
taosMemoryFree(pParam);
terrno = TSDB_CODE_OUT_OF_MEMORY;
- return TSDB_CODE_OUT_OF_MEMORY;
+ goto _return;
}
SQueryInserterNode* pInserterNode = (SQueryInserterNode*)pDataSink;
@@ -431,23 +433,18 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
int64_t suid = 0;
int32_t code = pManager->pAPI->metaFn.getTableSchema(inserter->pParam->readHandle->vnode, pInserterNode->tableId, &inserter->pSchema, &suid);
if (code) {
- destroyDataSinker((SDataSinkHandle*)inserter);
- taosMemoryFree(inserter);
- return code;
+ terrno = code;
+ goto _return;
}
if (pInserterNode->stableId != suid) {
- destroyDataSinker((SDataSinkHandle*)inserter);
- taosMemoryFree(inserter);
terrno = TSDB_CODE_TDB_INVALID_TABLE_ID;
- return terrno;
+ goto _return;
}
inserter->pDataBlocks = taosArrayInit(1, POINTER_BYTES);
taosThreadMutexInit(&inserter->mutex, NULL);
if (NULL == inserter->pDataBlocks) {
- destroyDataSinker((SDataSinkHandle*)inserter);
- taosMemoryFree(inserter);
terrno = TSDB_CODE_OUT_OF_MEMORY;
return TSDB_CODE_OUT_OF_MEMORY;
}
@@ -471,4 +468,15 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
*pHandle = inserter;
return TSDB_CODE_SUCCESS;
+
+_return:
+
+ if (inserter) {
+ destroyDataSinker((SDataSinkHandle*)inserter);
+ taosMemoryFree(inserter);
+ } else {
+ taosMemoryFree(pManager);
+ }
+
+ return terrno;
}
diff --git a/source/libs/executor/src/dataSinkMgt.c b/source/libs/executor/src/dataSinkMgt.c
index 38ec3ad393..2a59bbf1dc 100644
--- a/source/libs/executor/src/dataSinkMgt.c
+++ b/source/libs/executor/src/dataSinkMgt.c
@@ -18,12 +18,17 @@
#include "planner.h"
#include "tarray.h"
-static SDataSinkManager gDataSinkManager = {0};
SDataSinkStat gDataSinkStat = {0};
-int32_t dsDataSinkMgtInit(SDataSinkMgtCfg* cfg, SStorageAPI* pAPI) {
- gDataSinkManager.cfg = *cfg;
- gDataSinkManager.pAPI = pAPI;
+int32_t dsDataSinkMgtInit(SDataSinkMgtCfg* cfg, SStorageAPI* pAPI, void** ppSinkManager) {
+ SDataSinkManager* pSinkManager = taosMemoryMalloc(sizeof(SDataSinkManager));
+ if (NULL == pSinkManager) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ pSinkManager->cfg = *cfg;
+ pSinkManager->pAPI = pAPI;
+
+ *ppSinkManager = pSinkManager;
return 0; // to avoid compiler eror
}
@@ -33,18 +38,22 @@ int32_t dsDataSinkGetCacheSize(SDataSinkStat* pStat) {
return 0;
}
-int32_t dsCreateDataSinker(const SDataSinkNode* pDataSink, DataSinkHandle* pHandle, void* pParam, const char* id) {
+int32_t dsCreateDataSinker(void* pSinkManager, const SDataSinkNode* pDataSink, DataSinkHandle* pHandle, void* pParam, const char* id) {
+ SDataSinkManager* pManager = pSinkManager;
switch ((int)nodeType(pDataSink)) {
case QUERY_NODE_PHYSICAL_PLAN_DISPATCH:
- return createDataDispatcher(&gDataSinkManager, pDataSink, pHandle);
+ return createDataDispatcher(pManager, pDataSink, pHandle);
case QUERY_NODE_PHYSICAL_PLAN_DELETE: {
- return createDataDeleter(&gDataSinkManager, pDataSink, pHandle, pParam);
+ return createDataDeleter(pManager, pDataSink, pHandle, pParam);
}
case QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT: {
- return createDataInserter(&gDataSinkManager, pDataSink, pHandle, pParam);
+ return createDataInserter(pManager, pDataSink, pHandle, pParam);
}
+ default:
+ break;
}
+ taosMemoryFree(pSinkManager);
qError("invalid input node type:%d, %s", nodeType(pDataSink), id);
return TSDB_CODE_QRY_INVALID_INPUT;
}
diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c
index af205daa15..8d4b1c0ea0 100644
--- a/source/libs/executor/src/executor.c
+++ b/source/libs/executor/src/executor.c
@@ -531,23 +531,25 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
goto _error;
}
- SDataSinkMgtCfg cfg = {.maxDataBlockNum = 500, .maxDataBlockNumPerQuery = 50};
- code = dsDataSinkMgtInit(&cfg, &(*pTask)->storageAPI);
- if (code != TSDB_CODE_SUCCESS) {
- qError("failed to dsDataSinkMgtInit, code:%s, %s", tstrerror(code), (*pTask)->id.str);
- goto _error;
- }
-
if (handle) {
+ SDataSinkMgtCfg cfg = {.maxDataBlockNum = 500, .maxDataBlockNumPerQuery = 50};
+ void* pSinkManager = NULL;
+ code = dsDataSinkMgtInit(&cfg, &(*pTask)->storageAPI, &pSinkManager);
+ if (code != TSDB_CODE_SUCCESS) {
+ qError("failed to dsDataSinkMgtInit, code:%s, %s", tstrerror(code), (*pTask)->id.str);
+ goto _error;
+ }
+
void* pSinkParam = NULL;
code = createDataSinkParam(pSubplan->pDataSink, &pSinkParam, (*pTask), readHandle);
if (code != TSDB_CODE_SUCCESS) {
qError("failed to createDataSinkParam, vgId:%d, code:%s, %s", vgId, tstrerror(code), (*pTask)->id.str);
+ taosMemoryFree(pSinkManager);
goto _error;
}
// pSinkParam has been freed during create sinker.
- code = dsCreateDataSinker(pSubplan->pDataSink, handle, pSinkParam, (*pTask)->id.str);
+ code = dsCreateDataSinker(pSinkManager, pSubplan->pDataSink, handle, pSinkParam, (*pTask)->id.str);
}
qDebug("subplan task create completed, TID:0x%" PRIx64 " QID:0x%" PRIx64, taskId, pSubplan->id.queryId);
diff --git a/source/libs/executor/src/filloperator.c b/source/libs/executor/src/filloperator.c
index e7c9e404a0..c14692b7f0 100644
--- a/source/libs/executor/src/filloperator.c
+++ b/source/libs/executor/src/filloperator.c
@@ -64,6 +64,7 @@ typedef struct SFillOperatorInfo {
static void revisedFillStartKey(SFillOperatorInfo* pInfo, SSDataBlock* pBlock, int32_t order);
static void destroyFillOperatorInfo(void* param);
static void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlock, int32_t order, int32_t scanFlag);
+static void fillResetPrevForNewGroup(SFillInfo* pFillInfo);
static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOperatorInfo* pInfo,
SResultInfo* pResultInfo, int32_t order) {
@@ -84,6 +85,9 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOp
taosFillSetStartInfo(pInfo->pFillInfo, pInfo->pRes->info.rows, ts);
taosFillSetInputDataBlock(pInfo->pFillInfo, pInfo->pRes);
+ if (pInfo->pFillInfo->type == TSDB_FILL_PREV || pInfo->pFillInfo->type == TSDB_FILL_LINEAR) {
+ fillResetPrevForNewGroup(pInfo->pFillInfo);
+ }
int32_t numOfResultRows = pResultInfo->capacity - pResBlock->info.rows;
taosFillResultDataBlock(pInfo->pFillInfo, pResBlock, numOfResultRows);
@@ -122,6 +126,15 @@ void doApplyScalarCalculation(SOperatorInfo* pOperator, SSDataBlock* pBlock, int
pInfo->pRes->info.id.groupId = pBlock->info.id.groupId;
}
+static void fillResetPrevForNewGroup(SFillInfo* pFillInfo) {
+ for (int32_t colIdx = 0; colIdx < pFillInfo->numOfCols; ++colIdx) {
+ if (!pFillInfo->pFillCol[colIdx].notFillCol) {
+ SGroupKeys* key = taosArrayGet(pFillInfo->prev.pRowVal, colIdx);
+ key->isNull = true;
+ }
+ }
+}
+
// todo refactor: decide the start key according to the query time range.
static void revisedFillStartKey(SFillOperatorInfo* pInfo, SSDataBlock* pBlock, int32_t order) {
if (order == TSDB_ORDER_ASC) {
@@ -164,6 +177,7 @@ static void revisedFillStartKey(SFillOperatorInfo* pInfo, SSDataBlock* pBlock, i
}
// todo time window chosen problem: t or prev value?
+ if (t > pInfo->pFillInfo->start) t -= pInterval->sliding;
taosFillUpdateStartTimestampInfo(pInfo->pFillInfo, t);
}
}
@@ -825,6 +839,7 @@ void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillS
(pFillSup->next.key == pFillInfo->nextRowKey && !hasPrevWindow(pFillSup)))) {
setFillKeyInfo(ts, nextWKey, &pFillSup->interval, pFillInfo);
pFillInfo->pos = FILL_POS_START;
+ resetFillWindow(&pFillSup->prev);
pFillSup->prev.key = pFillSup->cur.key;
pFillSup->prev.pRowVal = pFillSup->cur.pRowVal;
} else if (hasPrevWindow(pFillSup)) {
@@ -838,6 +853,7 @@ void setFillValueInfo(SSDataBlock* pBlock, TSKEY ts, int32_t rowId, SStreamFillS
if (hasPrevWindow(pFillSup)) {
setFillKeyInfo(prevWKey, ts, &pFillSup->interval, pFillInfo);
pFillInfo->pos = FILL_POS_END;
+ resetFillWindow(&pFillSup->next);
pFillSup->next.key = pFillSup->cur.key;
pFillSup->next.pRowVal = pFillSup->cur.pRowVal;
pFillInfo->preRowKey = INT64_MIN;
@@ -1216,8 +1232,6 @@ static void doDeleteFillResult(SOperatorInfo* pOperator) {
SWinKey nextKey = {.groupId = groupId, .ts = ts};
while (pInfo->srcDelRowIndex < pBlock->info.rows) {
- void* nextVal = NULL;
- int32_t nextLen = 0;
TSKEY delTs = tsStarts[pInfo->srcDelRowIndex];
uint64_t delGroupId = groupIds[pInfo->srcDelRowIndex];
int32_t code = TSDB_CODE_SUCCESS;
@@ -1232,7 +1246,7 @@ static void doDeleteFillResult(SOperatorInfo* pOperator) {
if (delTs == nextKey.ts) {
code = pAPI->stateStore.streamStateCurNext(pOperator->pTaskInfo->streamInfo.pState, pCur);
if (code == TSDB_CODE_SUCCESS) {
- code = pAPI->stateStore.streamStateGetGroupKVByCur(pCur, &nextKey, (const void**)&nextVal, &nextLen);
+ code = pAPI->stateStore.streamStateGetGroupKVByCur(pCur, &nextKey, NULL, NULL);
}
// ts will be deleted later
if (delTs != ts) {
diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c
index bd46b2494f..9ec95faa38 100644
--- a/source/libs/executor/src/groupoperator.c
+++ b/source/libs/executor/src/groupoperator.c
@@ -973,7 +973,8 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) {
SColumnInfoData* pSrcCol = taosArrayGet(pSrc->pDataBlock, slotId);
SColumnInfoData* pDestCol = taosArrayGet(pDest->pDataBlock, j);
bool isNull = colDataIsNull(pSrcCol, pSrc->info.rows, rowIndex, NULL);
- char* pSrcData = colDataGetData(pSrcCol, rowIndex);
+ char* pSrcData = NULL;
+ if (!isNull) pSrcData = colDataGetData(pSrcCol, rowIndex);
colDataSetVal(pDestCol, pDest->info.rows, pSrcData, isNull);
}
pDest->info.rows++;
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index 2dfd9538c5..8d35a02c57 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -1353,7 +1353,8 @@ static SSDataBlock* doRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32
SColumnInfoData* pSrcCol = taosArrayGet(tmpBlock->pDataBlock, j);
SColumnInfoData* pDestCol = taosArrayGet(pResult->pDataBlock, j);
bool isNull = colDataIsNull(pSrcCol, tmpBlock->info.rows, i, NULL);
- char* pSrcData = colDataGetData(pSrcCol, i);
+ char* pSrcData = NULL;
+ if (!isNull) pSrcData = colDataGetData(pSrcCol, i);
colDataSetVal(pDestCol, pResult->info.rows, pSrcData, isNull);
}
pResult->info.rows++;
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index a742f5c954..3b0b4ed171 100755
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -286,7 +286,7 @@ retention(A) ::= NK_VARIABLE(B) NK_COLON NK_VARIABLE(C).
%type speed_opt { int32_t }
%destructor speed_opt { }
speed_opt(A) ::= . { A = 0; }
-speed_opt(A) ::= MAX_SPEED NK_INTEGER(B). { A = taosStr2Int32(B.z, NULL, 10); }
+speed_opt(A) ::= BWLIMIT NK_INTEGER(B). { A = taosStr2Int32(B.z, NULL, 10); }
start_opt(A) ::= . { A = NULL; }
start_opt(A) ::= START WITH NK_INTEGER(B). { A = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B); }
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 2d3c309610..c8c4772490 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -138,7 +138,7 @@ static SKeyword keywordTable[] = {
{"MATCH", TK_MATCH},
{"MAXROWS", TK_MAXROWS},
{"MAX_DELAY", TK_MAX_DELAY},
- {"MAX_SPEED", TK_MAX_SPEED},
+ {"BWLIMIT", TK_BWLIMIT},
{"MERGE", TK_MERGE},
{"META", TK_META},
{"ONLY", TK_ONLY},
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index fb1355d3db..0caf0c566c 100644
--- a/source/libs/parser/src/sql.c
+++ b/source/libs/parser/src/sql.c
@@ -1,5 +1,3 @@
-/* This file is automatically generated by Lemon from input grammar
-** source file "sql.y". */
/*
** 2000-05-29
**
@@ -24,8 +22,9 @@
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
+#include
+#include
/************ Begin %include sections from the grammar ************************/
-#line 11 "sql.y"
#include
#include
@@ -42,351 +41,12 @@
#include "parAst.h"
#define YYSTACKDEPTH 0
-#line 46 "sql.c"
/**************** End of %include directives **********************************/
-/* These constants specify the various numeric values for terminal symbols.
-***************** Begin token definitions *************************************/
-#ifndef TK_OR
-#define TK_OR 1
-#define TK_AND 2
-#define TK_UNION 3
-#define TK_ALL 4
-#define TK_MINUS 5
-#define TK_EXCEPT 6
-#define TK_INTERSECT 7
-#define TK_NK_BITAND 8
-#define TK_NK_BITOR 9
-#define TK_NK_LSHIFT 10
-#define TK_NK_RSHIFT 11
-#define TK_NK_PLUS 12
-#define TK_NK_MINUS 13
-#define TK_NK_STAR 14
-#define TK_NK_SLASH 15
-#define TK_NK_REM 16
-#define TK_NK_CONCAT 17
-#define TK_CREATE 18
-#define TK_ACCOUNT 19
-#define TK_NK_ID 20
-#define TK_PASS 21
-#define TK_NK_STRING 22
-#define TK_ALTER 23
-#define TK_PPS 24
-#define TK_TSERIES 25
-#define TK_STORAGE 26
-#define TK_STREAMS 27
-#define TK_QTIME 28
-#define TK_DBS 29
-#define TK_USERS 30
-#define TK_CONNS 31
-#define TK_STATE 32
-#define TK_USER 33
-#define TK_ENABLE 34
-#define TK_NK_INTEGER 35
-#define TK_SYSINFO 36
-#define TK_DROP 37
-#define TK_GRANT 38
-#define TK_ON 39
-#define TK_TO 40
-#define TK_REVOKE 41
-#define TK_FROM 42
-#define TK_SUBSCRIBE 43
-#define TK_NK_COMMA 44
-#define TK_READ 45
-#define TK_WRITE 46
-#define TK_NK_DOT 47
-#define TK_WITH 48
-#define TK_DNODE 49
-#define TK_PORT 50
-#define TK_DNODES 51
-#define TK_RESTORE 52
-#define TK_NK_IPTOKEN 53
-#define TK_FORCE 54
-#define TK_UNSAFE 55
-#define TK_LOCAL 56
-#define TK_QNODE 57
-#define TK_BNODE 58
-#define TK_SNODE 59
-#define TK_MNODE 60
-#define TK_VNODE 61
-#define TK_DATABASE 62
-#define TK_USE 63
-#define TK_FLUSH 64
-#define TK_TRIM 65
-#define TK_COMPACT 66
-#define TK_IF 67
-#define TK_NOT 68
-#define TK_EXISTS 69
-#define TK_BUFFER 70
-#define TK_CACHEMODEL 71
-#define TK_CACHESIZE 72
-#define TK_COMP 73
-#define TK_DURATION 74
-#define TK_NK_VARIABLE 75
-#define TK_MAXROWS 76
-#define TK_MINROWS 77
-#define TK_KEEP 78
-#define TK_PAGES 79
-#define TK_PAGESIZE 80
-#define TK_TSDB_PAGESIZE 81
-#define TK_PRECISION 82
-#define TK_REPLICA 83
-#define TK_VGROUPS 84
-#define TK_SINGLE_STABLE 85
-#define TK_RETENTIONS 86
-#define TK_SCHEMALESS 87
-#define TK_WAL_LEVEL 88
-#define TK_WAL_FSYNC_PERIOD 89
-#define TK_WAL_RETENTION_PERIOD 90
-#define TK_WAL_RETENTION_SIZE 91
-#define TK_WAL_ROLL_PERIOD 92
-#define TK_WAL_SEGMENT_SIZE 93
-#define TK_STT_TRIGGER 94
-#define TK_TABLE_PREFIX 95
-#define TK_TABLE_SUFFIX 96
-#define TK_NK_COLON 97
-#define TK_MAX_SPEED 98
-#define TK_START 99
-#define TK_TIMESTAMP 100
-#define TK_END 101
-#define TK_TABLE 102
-#define TK_NK_LP 103
-#define TK_NK_RP 104
-#define TK_STABLE 105
-#define TK_ADD 106
-#define TK_COLUMN 107
-#define TK_MODIFY 108
-#define TK_RENAME 109
-#define TK_TAG 110
-#define TK_SET 111
-#define TK_NK_EQ 112
-#define TK_USING 113
-#define TK_TAGS 114
-#define TK_BOOL 115
-#define TK_TINYINT 116
-#define TK_SMALLINT 117
-#define TK_INT 118
-#define TK_INTEGER 119
-#define TK_BIGINT 120
-#define TK_FLOAT 121
-#define TK_DOUBLE 122
-#define TK_BINARY 123
-#define TK_NCHAR 124
-#define TK_UNSIGNED 125
-#define TK_JSON 126
-#define TK_VARCHAR 127
-#define TK_MEDIUMBLOB 128
-#define TK_BLOB 129
-#define TK_VARBINARY 130
-#define TK_GEOMETRY 131
-#define TK_DECIMAL 132
-#define TK_COMMENT 133
-#define TK_MAX_DELAY 134
-#define TK_WATERMARK 135
-#define TK_ROLLUP 136
-#define TK_TTL 137
-#define TK_SMA 138
-#define TK_DELETE_MARK 139
-#define TK_FIRST 140
-#define TK_LAST 141
-#define TK_SHOW 142
-#define TK_PRIVILEGES 143
-#define TK_DATABASES 144
-#define TK_TABLES 145
-#define TK_STABLES 146
-#define TK_MNODES 147
-#define TK_QNODES 148
-#define TK_FUNCTIONS 149
-#define TK_INDEXES 150
-#define TK_ACCOUNTS 151
-#define TK_APPS 152
-#define TK_CONNECTIONS 153
-#define TK_LICENCES 154
-#define TK_GRANTS 155
-#define TK_QUERIES 156
-#define TK_SCORES 157
-#define TK_TOPICS 158
-#define TK_VARIABLES 159
-#define TK_CLUSTER 160
-#define TK_BNODES 161
-#define TK_SNODES 162
-#define TK_TRANSACTIONS 163
-#define TK_DISTRIBUTED 164
-#define TK_CONSUMERS 165
-#define TK_SUBSCRIPTIONS 166
-#define TK_VNODES 167
-#define TK_ALIVE 168
-#define TK_LIKE 169
-#define TK_TBNAME 170
-#define TK_QTAGS 171
-#define TK_AS 172
-#define TK_INDEX 173
-#define TK_FUNCTION 174
-#define TK_INTERVAL 175
-#define TK_COUNT 176
-#define TK_LAST_ROW 177
-#define TK_META 178
-#define TK_ONLY 179
-#define TK_TOPIC 180
-#define TK_CONSUMER 181
-#define TK_GROUP 182
-#define TK_DESC 183
-#define TK_DESCRIBE 184
-#define TK_RESET 185
-#define TK_QUERY 186
-#define TK_CACHE 187
-#define TK_EXPLAIN 188
-#define TK_ANALYZE 189
-#define TK_VERBOSE 190
-#define TK_NK_BOOL 191
-#define TK_RATIO 192
-#define TK_NK_FLOAT 193
-#define TK_OUTPUTTYPE 194
-#define TK_AGGREGATE 195
-#define TK_BUFSIZE 196
-#define TK_LANGUAGE 197
-#define TK_REPLACE 198
-#define TK_STREAM 199
-#define TK_INTO 200
-#define TK_PAUSE 201
-#define TK_RESUME 202
-#define TK_TRIGGER 203
-#define TK_AT_ONCE 204
-#define TK_WINDOW_CLOSE 205
-#define TK_IGNORE 206
-#define TK_EXPIRED 207
-#define TK_FILL_HISTORY 208
-#define TK_UPDATE 209
-#define TK_SUBTABLE 210
-#define TK_UNTREATED 211
-#define TK_KILL 212
-#define TK_CONNECTION 213
-#define TK_TRANSACTION 214
-#define TK_BALANCE 215
-#define TK_VGROUP 216
-#define TK_LEADER 217
-#define TK_MERGE 218
-#define TK_REDISTRIBUTE 219
-#define TK_SPLIT 220
-#define TK_DELETE 221
-#define TK_INSERT 222
-#define TK_NULL 223
-#define TK_NK_QUESTION 224
-#define TK_NK_ARROW 225
-#define TK_ROWTS 226
-#define TK_QSTART 227
-#define TK_QEND 228
-#define TK_QDURATION 229
-#define TK_WSTART 230
-#define TK_WEND 231
-#define TK_WDURATION 232
-#define TK_IROWTS 233
-#define TK_ISFILLED 234
-#define TK_CAST 235
-#define TK_NOW 236
-#define TK_TODAY 237
-#define TK_TIMEZONE 238
-#define TK_CLIENT_VERSION 239
-#define TK_SERVER_VERSION 240
-#define TK_SERVER_STATUS 241
-#define TK_CURRENT_USER 242
-#define TK_CASE 243
-#define TK_WHEN 244
-#define TK_THEN 245
-#define TK_ELSE 246
-#define TK_BETWEEN 247
-#define TK_IS 248
-#define TK_NK_LT 249
-#define TK_NK_GT 250
-#define TK_NK_LE 251
-#define TK_NK_GE 252
-#define TK_NK_NE 253
-#define TK_MATCH 254
-#define TK_NMATCH 255
-#define TK_CONTAINS 256
-#define TK_IN 257
-#define TK_JOIN 258
-#define TK_INNER 259
-#define TK_SELECT 260
-#define TK_NK_HINT 261
-#define TK_DISTINCT 262
-#define TK_WHERE 263
-#define TK_PARTITION 264
-#define TK_BY 265
-#define TK_SESSION 266
-#define TK_STATE_WINDOW 267
-#define TK_EVENT_WINDOW 268
-#define TK_SLIDING 269
-#define TK_FILL 270
-#define TK_VALUE 271
-#define TK_VALUE_F 272
-#define TK_NONE 273
-#define TK_PREV 274
-#define TK_NULL_F 275
-#define TK_LINEAR 276
-#define TK_NEXT 277
-#define TK_HAVING 278
-#define TK_RANGE 279
-#define TK_EVERY 280
-#define TK_ORDER 281
-#define TK_SLIMIT 282
-#define TK_SOFFSET 283
-#define TK_LIMIT 284
-#define TK_OFFSET 285
-#define TK_ASC 286
-#define TK_NULLS 287
-#define TK_ABORT 288
-#define TK_AFTER 289
-#define TK_ATTACH 290
-#define TK_BEFORE 291
-#define TK_BEGIN 292
-#define TK_BITAND 293
-#define TK_BITNOT 294
-#define TK_BITOR 295
-#define TK_BLOCKS 296
-#define TK_CHANGE 297
-#define TK_COMMA 298
-#define TK_CONCAT 299
-#define TK_CONFLICT 300
-#define TK_COPY 301
-#define TK_DEFERRED 302
-#define TK_DELIMITERS 303
-#define TK_DETACH 304
-#define TK_DIVIDE 305
-#define TK_DOT 306
-#define TK_EACH 307
-#define TK_FAIL 308
-#define TK_FILE 309
-#define TK_FOR 310
-#define TK_GLOB 311
-#define TK_ID 312
-#define TK_IMMEDIATE 313
-#define TK_IMPORT 314
-#define TK_INITIALLY 315
-#define TK_INSTEAD 316
-#define TK_ISNULL 317
-#define TK_KEY 318
-#define TK_MODULES 319
-#define TK_NK_BITNOT 320
-#define TK_NK_SEMI 321
-#define TK_NOTNULL 322
-#define TK_OF 323
-#define TK_PLUS 324
-#define TK_PRIVILEGE 325
-#define TK_RAISE 326
-#define TK_RESTRICT 327
-#define TK_ROW 328
-#define TK_SEMI 329
-#define TK_STAR 330
-#define TK_STATEMENT 331
-#define TK_STRICT 332
-#define TK_STRING 333
-#define TK_TIMES 334
-#define TK_VALUES 335
-#define TK_VARIABLE 336
-#define TK_VIEW 337
-#define TK_WAL 338
-#endif
-/**************** End token definitions ***************************************/
+/* These constants specify the various numeric values for terminal symbols
+** in a format understandable to "makeheaders". This section is blank unless
+** "lemon" is run with the "-m" command-line option.
+***************** Begin makeheaders token definitions *************************/
+/**************** End makeheaders token definitions ***************************/
/* The next sections is a series of control #defines.
** various aspects of the generated parser.
@@ -1480,7 +1140,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* TABLE_PREFIX => nothing */
0, /* TABLE_SUFFIX => nothing */
0, /* NK_COLON => nothing */
- 0, /* MAX_SPEED => nothing */
+ 0, /* BWLIMIT => nothing */
0, /* START => nothing */
0, /* TIMESTAMP => nothing */
288, /* END => ABORT */
@@ -1772,7 +1432,6 @@ struct yyParser {
};
typedef struct yyParser yyParser;
-#include
#ifndef NDEBUG
#include
static FILE *yyTraceFILE = 0;
@@ -1907,7 +1566,7 @@ static const char *const yyTokenName[] = {
/* 95 */ "TABLE_PREFIX",
/* 96 */ "TABLE_SUFFIX",
/* 97 */ "NK_COLON",
- /* 98 */ "MAX_SPEED",
+ /* 98 */ "BWLIMIT",
/* 99 */ "START",
/* 100 */ "TIMESTAMP",
/* 101 */ "END",
@@ -2449,7 +2108,7 @@ static const char *const yyRuleName[] = {
/* 140 */ "retention_list ::= retention_list NK_COMMA retention",
/* 141 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
/* 142 */ "speed_opt ::=",
- /* 143 */ "speed_opt ::= MAX_SPEED NK_INTEGER",
+ /* 143 */ "speed_opt ::= BWLIMIT NK_INTEGER",
/* 144 */ "start_opt ::=",
/* 145 */ "start_opt ::= START WITH NK_INTEGER",
/* 146 */ "start_opt ::= START WITH NK_STRING",
@@ -3111,9 +2770,7 @@ static void yy_destructor(
case 485: /* query_simple_or_subquery */
case 487: /* sort_specification */
{
-#line 7 "sql.y"
nodesDestroyNode((yypminor->yy952));
-#line 3116 "sql.c"
}
break;
case 340: /* account_options */
@@ -3123,9 +2780,7 @@ static void yy_destructor(
case 411: /* with_meta */
case 420: /* bufsize_opt */
{
-#line 54 "sql.y"
-#line 3128 "sql.c"
}
break;
case 344: /* user_name */
@@ -3146,32 +2801,24 @@ static void yy_destructor(
case 440: /* noarg_func */
case 458: /* alias_opt */
{
-#line 742 "sql.y"
-#line 3151 "sql.c"
}
break;
case 345: /* sysinfo_opt */
{
-#line 92 "sql.y"
-#line 3158 "sql.c"
}
break;
case 346: /* privileges */
case 349: /* priv_type_list */
case 350: /* priv_type */
{
-#line 101 "sql.y"
-#line 3167 "sql.c"
}
break;
case 347: /* priv_level */
{
-#line 117 "sql.y"
-#line 3174 "sql.c"
}
break;
case 356: /* force_opt */
@@ -3185,9 +2832,7 @@ static void yy_destructor(
case 464: /* set_quantifier_opt */
case 465: /* tag_mode_opt */
{
-#line 146 "sql.y"
-#line 3190 "sql.c"
}
break;
case 365: /* integer_list */
@@ -3221,60 +2866,44 @@ static void yy_destructor(
case 481: /* order_by_clause_opt */
case 486: /* sort_specification_list */
{
-#line 270 "sql.y"
nodesDestroyList((yypminor->yy824));
-#line 3226 "sql.c"
}
break;
case 369: /* alter_db_option */
case 391: /* alter_table_option */
{
-#line 243 "sql.y"
-#line 3234 "sql.c"
}
break;
case 381: /* type_name */
{
-#line 364 "sql.y"
-#line 3241 "sql.c"
}
break;
case 448: /* compare_op */
case 449: /* in_op */
{
-#line 930 "sql.y"
-#line 3249 "sql.c"
}
break;
case 461: /* join_type */
{
-#line 1006 "sql.y"
-#line 3256 "sql.c"
}
break;
case 477: /* fill_mode */
{
-#line 1092 "sql.y"
-#line 3263 "sql.c"
}
break;
case 488: /* ordering_specification_opt */
{
-#line 1177 "sql.y"
-#line 3270 "sql.c"
}
break;
case 489: /* null_ordering_opt */
{
-#line 1183 "sql.y"
-#line 3277 "sql.c"
}
break;
/********* End destructor definitions *****************************************/
@@ -3441,7 +3070,7 @@ static YYACTIONTYPE yy_find_shift_action(
#endif /* YYWILDCARD */
return yy_default[stateno];
}else{
- assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
+ assert( i>=0 && iyytos;
+#ifndef NDEBUG
+ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
+ yysize = yyRuleInfoNRhs[yyruleno];
+ if( yysize ){
+ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
+ yyTracePrompt,
+ yyruleno, yyRuleName[yyruleno],
+ yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){
+ yypParser->yyhwm++;
+ assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
+ }
+#endif
+#if YYSTACKDEPTH>0
+ if( yypParser->yytos>=yypParser->yystackEnd ){
+ yyStackOverflow(yypParser);
+ /* The call to yyStackOverflow() above pops the stack until it is
+ ** empty, causing the main parser loop to exit. So the return value
+ ** is never used and does not matter. */
+ return 0;
+ }
+#else
+ if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
+ if( yyGrowStack(yypParser) ){
+ yyStackOverflow(yypParser);
+ /* The call to yyStackOverflow() above pops the stack until it is
+ ** empty, causing the main parser loop to exit. So the return value
+ ** is never used and does not matter. */
+ return 0;
+ }
+ yymsp = yypParser->yytos;
+ }
+#endif
+ }
switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example
@@ -4818,21 +4495,15 @@ static YYACTIONTYPE yy_reduce(
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
-#line 50 "sql.y"
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
-#line 4823 "sql.c"
yy_destructor(yypParser,340,&yymsp[0].minor);
break;
case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
-#line 51 "sql.y"
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
-#line 4829 "sql.c"
yy_destructor(yypParser,341,&yymsp[0].minor);
break;
case 2: /* account_options ::= */
-#line 55 "sql.y"
{ }
-#line 4835 "sql.c"
break;
case 3: /* account_options ::= account_options PPS literal */
case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
@@ -4844,24 +4515,18 @@ static YYACTIONTYPE yy_reduce(
case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
{ yy_destructor(yypParser,340,&yymsp[-2].minor);
-#line 56 "sql.y"
{ }
-#line 4849 "sql.c"
yy_destructor(yypParser,342,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
{ yy_destructor(yypParser,343,&yymsp[0].minor);
-#line 68 "sql.y"
{ }
-#line 4857 "sql.c"
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
{ yy_destructor(yypParser,341,&yymsp[-1].minor);
-#line 69 "sql.y"
{ }
-#line 4864 "sql.c"
yy_destructor(yypParser,343,&yymsp[0].minor);
}
break;
@@ -4875,111 +4540,71 @@ static YYACTIONTYPE yy_reduce(
case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21);
case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
-#line 73 "sql.y"
{ }
-#line 4880 "sql.c"
yy_destructor(yypParser,342,&yymsp[0].minor);
break;
case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
-#line 85 "sql.y"
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy169, &yymsp[-1].minor.yy0, yymsp[0].minor.yy243); }
-#line 4886 "sql.c"
break;
case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-#line 86 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy169, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
-#line 4891 "sql.c"
break;
case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
-#line 87 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy169, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
-#line 4896 "sql.c"
break;
case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
-#line 88 "sql.y"
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy169, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
-#line 4901 "sql.c"
break;
case 28: /* cmd ::= DROP USER user_name */
-#line 89 "sql.y"
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy169); }
-#line 4906 "sql.c"
break;
case 29: /* sysinfo_opt ::= */
-#line 93 "sql.y"
{ yymsp[1].minor.yy243 = 1; }
-#line 4911 "sql.c"
break;
case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
-#line 94 "sql.y"
{ yymsp[-1].minor.yy243 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
-#line 4916 "sql.c"
break;
case 31: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */
-#line 97 "sql.y"
{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy949, &yymsp[-3].minor.yy637, &yymsp[0].minor.yy169, yymsp[-2].minor.yy952); }
-#line 4921 "sql.c"
break;
case 32: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */
-#line 98 "sql.y"
{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy949, &yymsp[-3].minor.yy637, &yymsp[0].minor.yy169, yymsp[-2].minor.yy952); }
-#line 4926 "sql.c"
break;
case 33: /* privileges ::= ALL */
-#line 102 "sql.y"
{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_ALL; }
-#line 4931 "sql.c"
break;
case 34: /* privileges ::= priv_type_list */
case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36);
-#line 103 "sql.y"
{ yylhsminor.yy949 = yymsp[0].minor.yy949; }
-#line 4937 "sql.c"
yymsp[0].minor.yy949 = yylhsminor.yy949;
break;
case 35: /* privileges ::= SUBSCRIBE */
-#line 104 "sql.y"
{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_SUBSCRIBE; }
-#line 4943 "sql.c"
break;
case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
-#line 109 "sql.y"
{ yylhsminor.yy949 = yymsp[-2].minor.yy949 | yymsp[0].minor.yy949; }
-#line 4948 "sql.c"
yymsp[-2].minor.yy949 = yylhsminor.yy949;
break;
case 38: /* priv_type ::= READ */
-#line 113 "sql.y"
{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_READ; }
-#line 4954 "sql.c"
break;
case 39: /* priv_type ::= WRITE */
-#line 114 "sql.y"
{ yymsp[0].minor.yy949 = PRIVILEGE_TYPE_WRITE; }
-#line 4959 "sql.c"
break;
case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
-#line 118 "sql.y"
{ yylhsminor.yy637.first = yymsp[-2].minor.yy0; yylhsminor.yy637.second = yymsp[0].minor.yy0; }
-#line 4964 "sql.c"
yymsp[-2].minor.yy637 = yylhsminor.yy637;
break;
case 41: /* priv_level ::= db_name NK_DOT NK_STAR */
-#line 119 "sql.y"
{ yylhsminor.yy637.first = yymsp[-2].minor.yy169; yylhsminor.yy637.second = yymsp[0].minor.yy0; }
-#line 4970 "sql.c"
yymsp[-2].minor.yy637 = yylhsminor.yy637;
break;
case 42: /* priv_level ::= db_name NK_DOT table_name */
-#line 120 "sql.y"
{ yylhsminor.yy637.first = yymsp[-2].minor.yy169; yylhsminor.yy637.second = yymsp[0].minor.yy169; }
-#line 4976 "sql.c"
yymsp[-2].minor.yy637 = yylhsminor.yy637;
break;
case 43: /* priv_level ::= topic_name */
-#line 121 "sql.y"
{ yylhsminor.yy637.first = yymsp[0].minor.yy169; yylhsminor.yy637.second = nil_token; }
-#line 4982 "sql.c"
yymsp[0].minor.yy637 = yylhsminor.yy637;
break;
case 44: /* with_opt ::= */
@@ -4998,72 +4623,46 @@ static YYACTIONTYPE yy_reduce(
case 571: /* every_opt ::= */ yytestcase(yyruleno==571);
case 584: /* slimit_clause_opt ::= */ yytestcase(yyruleno==584);
case 588: /* limit_clause_opt ::= */ yytestcase(yyruleno==588);
-#line 123 "sql.y"
{ yymsp[1].minor.yy952 = NULL; }
-#line 5003 "sql.c"
break;
case 45: /* with_opt ::= WITH search_condition */
case 503: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==503);
case 536: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==536);
case 567: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==567);
-#line 124 "sql.y"
{ yymsp[-1].minor.yy952 = yymsp[0].minor.yy952; }
-#line 5011 "sql.c"
break;
case 46: /* cmd ::= CREATE DNODE dnode_endpoint */
-#line 127 "sql.y"
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy169, NULL); }
-#line 5016 "sql.c"
break;
case 47: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
-#line 128 "sql.y"
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0); }
-#line 5021 "sql.c"
break;
case 48: /* cmd ::= DROP DNODE NK_INTEGER force_opt */
-#line 129 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy957, false); }
-#line 5026 "sql.c"
break;
case 49: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
-#line 130 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy169, yymsp[0].minor.yy957, false); }
-#line 5031 "sql.c"
break;
case 50: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */
-#line 131 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy957); }
-#line 5036 "sql.c"
break;
case 51: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */
-#line 132 "sql.y"
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy169, false, yymsp[0].minor.yy957); }
-#line 5041 "sql.c"
break;
case 52: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
-#line 133 "sql.y"
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
-#line 5046 "sql.c"
break;
case 53: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
-#line 134 "sql.y"
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5051 "sql.c"
break;
case 54: /* cmd ::= ALTER ALL DNODES NK_STRING */
-#line 135 "sql.y"
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
-#line 5056 "sql.c"
break;
case 55: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
-#line 136 "sql.y"
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5061 "sql.c"
break;
case 56: /* cmd ::= RESTORE DNODE NK_INTEGER */
-#line 137 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5066 "sql.c"
break;
case 57: /* dnode_endpoint ::= NK_STRING */
case 58: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==58);
@@ -5096,9 +4695,7 @@ static YYACTIONTYPE yy_reduce(
case 458: /* star_func ::= FIRST */ yytestcase(yyruleno==458);
case 459: /* star_func ::= LAST */ yytestcase(yyruleno==459);
case 460: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==460);
-#line 141 "sql.y"
{ yylhsminor.yy169 = yymsp[0].minor.yy0; }
-#line 5101 "sql.c"
yymsp[0].minor.yy169 = yylhsminor.yy169;
break;
case 60: /* force_opt ::= */
@@ -5110,9 +4707,7 @@ static YYACTIONTYPE yy_reduce(
case 356: /* ignore_opt ::= */ yytestcase(yyruleno==356);
case 523: /* tag_mode_opt ::= */ yytestcase(yyruleno==523);
case 525: /* set_quantifier_opt ::= */ yytestcase(yyruleno==525);
-#line 147 "sql.y"
{ yymsp[1].minor.yy957 = false; }
-#line 5115 "sql.c"
break;
case 61: /* force_opt ::= FORCE */
case 62: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==62);
@@ -5120,419 +4715,275 @@ static YYACTIONTYPE yy_reduce(
case 329: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==329);
case 524: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==524);
case 526: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==526);
-#line 148 "sql.y"
{ yymsp[0].minor.yy957 = true; }
-#line 5125 "sql.c"
break;
case 63: /* cmd ::= ALTER LOCAL NK_STRING */
-#line 155 "sql.y"
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 5130 "sql.c"
break;
case 64: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
-#line 156 "sql.y"
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5135 "sql.c"
break;
case 65: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
-#line 159 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5140 "sql.c"
break;
case 66: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
-#line 160 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5145 "sql.c"
break;
case 67: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */
-#line 161 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5150 "sql.c"
break;
case 68: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
-#line 164 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5155 "sql.c"
break;
case 69: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
-#line 165 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5160 "sql.c"
break;
case 70: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
-#line 168 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5165 "sql.c"
break;
case 71: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
-#line 169 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5170 "sql.c"
break;
case 72: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
-#line 172 "sql.y"
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5175 "sql.c"
break;
case 73: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
-#line 173 "sql.y"
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5180 "sql.c"
break;
case 74: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */
-#line 174 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5185 "sql.c"
break;
case 75: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */
-#line 177 "sql.y"
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5190 "sql.c"
break;
case 76: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
-#line 180 "sql.y"
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy957, &yymsp[-1].minor.yy169, yymsp[0].minor.yy952); }
-#line 5195 "sql.c"
break;
case 77: /* cmd ::= DROP DATABASE exists_opt db_name */
-#line 181 "sql.y"
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 5200 "sql.c"
break;
case 78: /* cmd ::= USE db_name */
-#line 182 "sql.y"
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy169); }
-#line 5205 "sql.c"
break;
case 79: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-#line 183 "sql.y"
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy169, yymsp[0].minor.yy952); }
-#line 5210 "sql.c"
break;
case 80: /* cmd ::= FLUSH DATABASE db_name */
-#line 184 "sql.y"
{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy169); }
-#line 5215 "sql.c"
break;
case 81: /* cmd ::= TRIM DATABASE db_name speed_opt */
-#line 185 "sql.y"
{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy169, yymsp[0].minor.yy480); }
-#line 5220 "sql.c"
break;
case 82: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
-#line 186 "sql.y"
{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy169, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 5225 "sql.c"
break;
case 83: /* not_exists_opt ::= IF NOT EXISTS */
-#line 190 "sql.y"
{ yymsp[-2].minor.yy957 = true; }
-#line 5230 "sql.c"
break;
case 85: /* exists_opt ::= IF EXISTS */
case 335: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==335);
case 357: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==357);
-#line 195 "sql.y"
{ yymsp[-1].minor.yy957 = true; }
-#line 5237 "sql.c"
break;
case 87: /* db_options ::= */
-#line 198 "sql.y"
{ yymsp[1].minor.yy952 = createDefaultDatabaseOptions(pCxt); }
-#line 5242 "sql.c"
break;
case 88: /* db_options ::= db_options BUFFER NK_INTEGER */
-#line 199 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
-#line 5247 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 89: /* db_options ::= db_options CACHEMODEL NK_STRING */
-#line 200 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
-#line 5253 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 90: /* db_options ::= db_options CACHESIZE NK_INTEGER */
-#line 201 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
-#line 5259 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 91: /* db_options ::= db_options COMP NK_INTEGER */
-#line 202 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
-#line 5265 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 92: /* db_options ::= db_options DURATION NK_INTEGER */
case 93: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==93);
-#line 203 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
-#line 5272 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 94: /* db_options ::= db_options MAXROWS NK_INTEGER */
-#line 205 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
-#line 5278 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 95: /* db_options ::= db_options MINROWS NK_INTEGER */
-#line 206 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
-#line 5284 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 96: /* db_options ::= db_options KEEP integer_list */
case 97: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==97);
-#line 207 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_KEEP, yymsp[0].minor.yy824); }
-#line 5291 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 98: /* db_options ::= db_options PAGES NK_INTEGER */
-#line 209 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
-#line 5297 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 99: /* db_options ::= db_options PAGESIZE NK_INTEGER */
-#line 210 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
-#line 5303 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 100: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
-#line 211 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
-#line 5309 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 101: /* db_options ::= db_options PRECISION NK_STRING */
-#line 212 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
-#line 5315 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 102: /* db_options ::= db_options REPLICA NK_INTEGER */
-#line 213 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
-#line 5321 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 103: /* db_options ::= db_options VGROUPS NK_INTEGER */
-#line 215 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
-#line 5327 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 104: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-#line 216 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
-#line 5333 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 105: /* db_options ::= db_options RETENTIONS retention_list */
-#line 217 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_RETENTIONS, yymsp[0].minor.yy824); }
-#line 5339 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 106: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
-#line 218 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
-#line 5345 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 107: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
-#line 219 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
-#line 5351 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 108: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
-#line 220 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
-#line 5357 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 109: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
-#line 221 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
-#line 5363 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 110: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
-#line 222 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-3].minor.yy952, DB_OPTION_WAL_RETENTION_PERIOD, &t);
}
-#line 5373 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 111: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
-#line 227 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
-#line 5379 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 112: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
-#line 228 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-3].minor.yy952, DB_OPTION_WAL_RETENTION_SIZE, &t);
}
-#line 5389 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 113: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
-#line 233 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
-#line 5395 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 114: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
-#line 234 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
-#line 5401 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 115: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
-#line 235 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
-#line 5407 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 116: /* db_options ::= db_options TABLE_PREFIX signed */
-#line 236 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy952); }
-#line 5413 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 117: /* db_options ::= db_options TABLE_SUFFIX signed */
-#line 237 "sql.y"
{ yylhsminor.yy952 = setDatabaseOption(pCxt, yymsp[-2].minor.yy952, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy952); }
-#line 5419 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 118: /* alter_db_options ::= alter_db_option */
-#line 239 "sql.y"
{ yylhsminor.yy952 = createAlterDatabaseOptions(pCxt); yylhsminor.yy952 = setAlterDatabaseOption(pCxt, yylhsminor.yy952, &yymsp[0].minor.yy25); }
-#line 5425 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 119: /* alter_db_options ::= alter_db_options alter_db_option */
-#line 240 "sql.y"
{ yylhsminor.yy952 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy952, &yymsp[0].minor.yy25); }
-#line 5431 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 120: /* alter_db_option ::= BUFFER NK_INTEGER */
-#line 244 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5437 "sql.c"
break;
case 121: /* alter_db_option ::= CACHEMODEL NK_STRING */
-#line 245 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5442 "sql.c"
break;
case 122: /* alter_db_option ::= CACHESIZE NK_INTEGER */
-#line 246 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5447 "sql.c"
break;
case 123: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
-#line 247 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5452 "sql.c"
break;
case 124: /* alter_db_option ::= KEEP integer_list */
case 125: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==125);
-#line 248 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_KEEP; yymsp[-1].minor.yy25.pList = yymsp[0].minor.yy824; }
-#line 5458 "sql.c"
break;
case 126: /* alter_db_option ::= PAGES NK_INTEGER */
-#line 250 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_PAGES; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5463 "sql.c"
break;
case 127: /* alter_db_option ::= REPLICA NK_INTEGER */
-#line 251 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5468 "sql.c"
break;
case 128: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
-#line 253 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_WAL; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5473 "sql.c"
break;
case 129: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
-#line 254 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5478 "sql.c"
break;
case 130: /* alter_db_option ::= MINROWS NK_INTEGER */
-#line 255 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5483 "sql.c"
break;
case 131: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
-#line 256 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5488 "sql.c"
break;
case 132: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
-#line 257 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yymsp[-2].minor.yy25.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy25.val = t;
}
-#line 5497 "sql.c"
break;
case 133: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
-#line 262 "sql.y"
{ yymsp[-1].minor.yy25.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5502 "sql.c"
break;
case 134: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
-#line 263 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yymsp[-2].minor.yy25.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy25.val = t;
}
-#line 5511 "sql.c"
break;
case 135: /* integer_list ::= NK_INTEGER */
-#line 271 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 5516 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 136: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
case 367: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==367);
-#line 272 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 5523 "sql.c"
yymsp[-2].minor.yy824 = yylhsminor.yy824;
break;
case 137: /* variable_list ::= NK_VARIABLE */
-#line 276 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 5529 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 138: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-#line 277 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 5535 "sql.c"
yymsp[-2].minor.yy824 = yylhsminor.yy824;
break;
case 139: /* retention_list ::= retention */
@@ -5549,9 +5000,7 @@ static YYACTIONTYPE yy_reduce(
case 528: /* select_list ::= select_item */ yytestcase(yyruleno==528);
case 539: /* partition_list ::= partition_item */ yytestcase(yyruleno==539);
case 595: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==595);
-#line 281 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, yymsp[0].minor.yy952); }
-#line 5554 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 140: /* retention_list ::= retention_list NK_COMMA retention */
@@ -5566,157 +5015,105 @@ static YYACTIONTYPE yy_reduce(
case 529: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==529);
case 540: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==540);
case 596: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==596);
-#line 282 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, yymsp[0].minor.yy952); }
-#line 5571 "sql.c"
yymsp[-2].minor.yy824 = yylhsminor.yy824;
break;
case 141: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
-#line 284 "sql.y"
{ yylhsminor.yy952 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 5577 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 142: /* speed_opt ::= */
case 330: /* bufsize_opt ::= */ yytestcase(yyruleno==330);
-#line 288 "sql.y"
{ yymsp[1].minor.yy480 = 0; }
-#line 5584 "sql.c"
break;
- case 143: /* speed_opt ::= MAX_SPEED NK_INTEGER */
+ case 143: /* speed_opt ::= BWLIMIT NK_INTEGER */
case 331: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==331);
-#line 289 "sql.y"
{ yymsp[-1].minor.yy480 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
-#line 5590 "sql.c"
break;
case 145: /* start_opt ::= START WITH NK_INTEGER */
case 149: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==149);
-#line 292 "sql.y"
{ yymsp[-2].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
-#line 5596 "sql.c"
break;
case 146: /* start_opt ::= START WITH NK_STRING */
case 150: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==150);
-#line 293 "sql.y"
{ yymsp[-2].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 5602 "sql.c"
break;
case 147: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
case 151: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==151);
-#line 294 "sql.y"
{ yymsp[-3].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 5608 "sql.c"
break;
case 152: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
case 154: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==154);
-#line 303 "sql.y"
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy957, yymsp[-5].minor.yy952, yymsp[-3].minor.yy824, yymsp[-1].minor.yy824, yymsp[0].minor.yy952); }
-#line 5614 "sql.c"
break;
case 153: /* cmd ::= CREATE TABLE multi_create_clause */
-#line 304 "sql.y"
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy824); }
-#line 5619 "sql.c"
break;
case 155: /* cmd ::= DROP TABLE multi_drop_clause */
-#line 307 "sql.y"
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy824); }
-#line 5624 "sql.c"
break;
case 156: /* cmd ::= DROP STABLE exists_opt full_table_name */
-#line 308 "sql.y"
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy952); }
-#line 5629 "sql.c"
break;
case 157: /* cmd ::= ALTER TABLE alter_table_clause */
case 369: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==369);
case 370: /* cmd ::= insert_query */ yytestcase(yyruleno==370);
-#line 310 "sql.y"
{ pCxt->pRootNode = yymsp[0].minor.yy952; }
-#line 5636 "sql.c"
break;
case 158: /* cmd ::= ALTER STABLE alter_table_clause */
-#line 311 "sql.y"
{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy952); }
-#line 5641 "sql.c"
break;
case 159: /* alter_table_clause ::= full_table_name alter_table_options */
-#line 313 "sql.y"
{ yylhsminor.yy952 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 5646 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 160: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
-#line 315 "sql.y"
{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); }
-#line 5652 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 161: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-#line 316 "sql.y"
{ yylhsminor.yy952 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy169); }
-#line 5658 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 162: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-#line 318 "sql.y"
{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); }
-#line 5664 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 163: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-#line 320 "sql.y"
{ yylhsminor.yy952 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); }
-#line 5670 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 164: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-#line 322 "sql.y"
{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); }
-#line 5676 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 165: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-#line 323 "sql.y"
{ yylhsminor.yy952 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy952, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy169); }
-#line 5682 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 166: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-#line 325 "sql.y"
{ yylhsminor.yy952 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84); }
-#line 5688 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 167: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-#line 327 "sql.y"
{ yylhsminor.yy952 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy952, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); }
-#line 5694 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 168: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
-#line 329 "sql.y"
{ yylhsminor.yy952 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy952, &yymsp[-2].minor.yy169, yymsp[0].minor.yy952); }
-#line 5700 "sql.c"
yymsp[-5].minor.yy952 = yylhsminor.yy952;
break;
case 170: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
case 470: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==470);
-#line 334 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-1].minor.yy824, yymsp[0].minor.yy952); }
-#line 5707 "sql.c"
yymsp[-1].minor.yy824 = yylhsminor.yy824;
break;
case 171: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */
-#line 338 "sql.y"
{ yylhsminor.yy952 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy957, yymsp[-8].minor.yy952, yymsp[-6].minor.yy952, yymsp[-5].minor.yy824, yymsp[-2].minor.yy824, yymsp[0].minor.yy952); }
-#line 5713 "sql.c"
yymsp[-9].minor.yy952 = yylhsminor.yy952;
break;
case 174: /* drop_table_clause ::= exists_opt full_table_name */
-#line 345 "sql.y"
{ yylhsminor.yy952 = createDropTableClause(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy952); }
-#line 5719 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 175: /* specific_cols_opt ::= */
@@ -5727,847 +5124,535 @@ static YYACTIONTYPE yy_reduce(
case 537: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==537);
case 562: /* group_by_clause_opt ::= */ yytestcase(yyruleno==562);
case 582: /* order_by_clause_opt ::= */ yytestcase(yyruleno==582);
-#line 349 "sql.y"
{ yymsp[1].minor.yy824 = NULL; }
-#line 5732 "sql.c"
break;
case 176: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
case 341: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==341);
-#line 350 "sql.y"
{ yymsp[-2].minor.yy824 = yymsp[-1].minor.yy824; }
-#line 5738 "sql.c"
break;
case 177: /* full_table_name ::= table_name */
-#line 352 "sql.y"
{ yylhsminor.yy952 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy169, NULL); }
-#line 5743 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 178: /* full_table_name ::= db_name NK_DOT table_name */
-#line 353 "sql.y"
{ yylhsminor.yy952 = createRealTableNode(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169, NULL); }
-#line 5749 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 181: /* column_def ::= column_name type_name */
-#line 360 "sql.y"
{ yylhsminor.yy952 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy169, yymsp[0].minor.yy84, NULL); }
-#line 5755 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 182: /* type_name ::= BOOL */
-#line 365 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BOOL); }
-#line 5761 "sql.c"
break;
case 183: /* type_name ::= TINYINT */
-#line 366 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TINYINT); }
-#line 5766 "sql.c"
break;
case 184: /* type_name ::= SMALLINT */
-#line 367 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
-#line 5771 "sql.c"
break;
case 185: /* type_name ::= INT */
case 186: /* type_name ::= INTEGER */ yytestcase(yyruleno==186);
-#line 368 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_INT); }
-#line 5777 "sql.c"
break;
case 187: /* type_name ::= BIGINT */
-#line 370 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BIGINT); }
-#line 5782 "sql.c"
break;
case 188: /* type_name ::= FLOAT */
-#line 371 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_FLOAT); }
-#line 5787 "sql.c"
break;
case 189: /* type_name ::= DOUBLE */
-#line 372 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
-#line 5792 "sql.c"
break;
case 190: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-#line 373 "sql.y"
{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
-#line 5797 "sql.c"
break;
case 191: /* type_name ::= TIMESTAMP */
-#line 374 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
-#line 5802 "sql.c"
break;
case 192: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-#line 375 "sql.y"
{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
-#line 5807 "sql.c"
break;
case 193: /* type_name ::= TINYINT UNSIGNED */
-#line 376 "sql.y"
{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
-#line 5812 "sql.c"
break;
case 194: /* type_name ::= SMALLINT UNSIGNED */
-#line 377 "sql.y"
{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
-#line 5817 "sql.c"
break;
case 195: /* type_name ::= INT UNSIGNED */
-#line 378 "sql.y"
{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UINT); }
-#line 5822 "sql.c"
break;
case 196: /* type_name ::= BIGINT UNSIGNED */
-#line 379 "sql.y"
{ yymsp[-1].minor.yy84 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
-#line 5827 "sql.c"
break;
case 197: /* type_name ::= JSON */
-#line 380 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_JSON); }
-#line 5832 "sql.c"
break;
case 198: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-#line 381 "sql.y"
{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
-#line 5837 "sql.c"
break;
case 199: /* type_name ::= MEDIUMBLOB */
-#line 382 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
-#line 5842 "sql.c"
break;
case 200: /* type_name ::= BLOB */
-#line 383 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_BLOB); }
-#line 5847 "sql.c"
break;
case 201: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-#line 384 "sql.y"
{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
-#line 5852 "sql.c"
break;
case 202: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */
-#line 385 "sql.y"
{ yymsp[-3].minor.yy84 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); }
-#line 5857 "sql.c"
break;
case 203: /* type_name ::= DECIMAL */
-#line 386 "sql.y"
{ yymsp[0].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 5862 "sql.c"
break;
case 204: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-#line 387 "sql.y"
{ yymsp[-3].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 5867 "sql.c"
break;
case 205: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-#line 388 "sql.y"
{ yymsp[-5].minor.yy84 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 5872 "sql.c"
break;
case 207: /* tags_def_opt ::= tags_def */
case 343: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==343);
case 462: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==462);
-#line 393 "sql.y"
{ yylhsminor.yy824 = yymsp[0].minor.yy824; }
-#line 5879 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 208: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
case 344: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==344);
-#line 397 "sql.y"
{ yymsp[-3].minor.yy824 = yymsp[-1].minor.yy824; }
-#line 5886 "sql.c"
break;
case 209: /* table_options ::= */
-#line 399 "sql.y"
{ yymsp[1].minor.yy952 = createDefaultTableOptions(pCxt); }
-#line 5891 "sql.c"
break;
case 210: /* table_options ::= table_options COMMENT NK_STRING */
-#line 400 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
-#line 5896 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 211: /* table_options ::= table_options MAX_DELAY duration_list */
-#line 401 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy824); }
-#line 5902 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 212: /* table_options ::= table_options WATERMARK duration_list */
-#line 402 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy824); }
-#line 5908 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 213: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
-#line 403 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-4].minor.yy952, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy824); }
-#line 5914 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 214: /* table_options ::= table_options TTL NK_INTEGER */
-#line 404 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
-#line 5920 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 215: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-#line 405 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-4].minor.yy952, TABLE_OPTION_SMA, yymsp[-1].minor.yy824); }
-#line 5926 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 216: /* table_options ::= table_options DELETE_MARK duration_list */
-#line 406 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-2].minor.yy952, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy824); }
-#line 5932 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 217: /* alter_table_options ::= alter_table_option */
-#line 408 "sql.y"
{ yylhsminor.yy952 = createAlterTableOptions(pCxt); yylhsminor.yy952 = setTableOption(pCxt, yylhsminor.yy952, yymsp[0].minor.yy25.type, &yymsp[0].minor.yy25.val); }
-#line 5938 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 218: /* alter_table_options ::= alter_table_options alter_table_option */
-#line 409 "sql.y"
{ yylhsminor.yy952 = setTableOption(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy25.type, &yymsp[0].minor.yy25.val); }
-#line 5944 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 219: /* alter_table_option ::= COMMENT NK_STRING */
-#line 413 "sql.y"
{ yymsp[-1].minor.yy25.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5950 "sql.c"
break;
case 220: /* alter_table_option ::= TTL NK_INTEGER */
-#line 414 "sql.y"
{ yymsp[-1].minor.yy25.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy25.val = yymsp[0].minor.yy0; }
-#line 5955 "sql.c"
break;
case 221: /* duration_list ::= duration_literal */
case 426: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==426);
-#line 418 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 5961 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 222: /* duration_list ::= duration_list NK_COMMA duration_literal */
case 427: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==427);
-#line 419 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 5968 "sql.c"
yymsp[-2].minor.yy824 = yylhsminor.yy824;
break;
case 225: /* rollup_func_name ::= function_name */
-#line 426 "sql.y"
{ yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[0].minor.yy169, NULL); }
-#line 5974 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 226: /* rollup_func_name ::= FIRST */
case 227: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==227);
case 285: /* tag_item ::= QTAGS */ yytestcase(yyruleno==285);
-#line 427 "sql.y"
{ yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 5982 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 230: /* col_name ::= column_name */
case 286: /* tag_item ::= column_name */ yytestcase(yyruleno==286);
-#line 435 "sql.y"
{ yylhsminor.yy952 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy169); }
-#line 5989 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 231: /* cmd ::= SHOW DNODES */
-#line 438 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
-#line 5995 "sql.c"
break;
case 232: /* cmd ::= SHOW USERS */
-#line 439 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
-#line 6000 "sql.c"
break;
case 233: /* cmd ::= SHOW USER PRIVILEGES */
-#line 440 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
-#line 6005 "sql.c"
break;
case 234: /* cmd ::= SHOW DATABASES */
-#line 441 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
-#line 6010 "sql.c"
break;
case 235: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
-#line 442 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, OP_TYPE_LIKE); }
-#line 6015 "sql.c"
break;
case 236: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-#line 443 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, OP_TYPE_LIKE); }
-#line 6020 "sql.c"
break;
case 237: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-#line 444 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy952, NULL, OP_TYPE_LIKE); }
-#line 6025 "sql.c"
break;
case 238: /* cmd ::= SHOW MNODES */
-#line 445 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
-#line 6030 "sql.c"
break;
case 239: /* cmd ::= SHOW QNODES */
-#line 447 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
-#line 6035 "sql.c"
break;
case 240: /* cmd ::= SHOW FUNCTIONS */
-#line 448 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
-#line 6040 "sql.c"
break;
case 241: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-#line 449 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy952, yymsp[-1].minor.yy952, OP_TYPE_EQUAL); }
-#line 6045 "sql.c"
break;
case 242: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */
-#line 450 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), OP_TYPE_EQUAL); }
-#line 6050 "sql.c"
break;
case 243: /* cmd ::= SHOW STREAMS */
-#line 451 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
-#line 6055 "sql.c"
break;
case 244: /* cmd ::= SHOW ACCOUNTS */
-#line 452 "sql.y"
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
-#line 6060 "sql.c"
break;
case 245: /* cmd ::= SHOW APPS */
-#line 453 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
-#line 6065 "sql.c"
break;
case 246: /* cmd ::= SHOW CONNECTIONS */
-#line 454 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
-#line 6070 "sql.c"
break;
case 247: /* cmd ::= SHOW LICENCES */
case 248: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==248);
-#line 455 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
-#line 6076 "sql.c"
break;
case 249: /* cmd ::= SHOW CREATE DATABASE db_name */
-#line 457 "sql.y"
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy169); }
-#line 6081 "sql.c"
break;
case 250: /* cmd ::= SHOW CREATE TABLE full_table_name */
-#line 458 "sql.y"
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy952); }
-#line 6086 "sql.c"
break;
case 251: /* cmd ::= SHOW CREATE STABLE full_table_name */
-#line 459 "sql.y"
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy952); }
-#line 6091 "sql.c"
break;
case 252: /* cmd ::= SHOW QUERIES */
-#line 460 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
-#line 6096 "sql.c"
break;
case 253: /* cmd ::= SHOW SCORES */
-#line 461 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
-#line 6101 "sql.c"
break;
case 254: /* cmd ::= SHOW TOPICS */
-#line 462 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
-#line 6106 "sql.c"
break;
case 255: /* cmd ::= SHOW VARIABLES */
case 256: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==256);
-#line 463 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
-#line 6112 "sql.c"
break;
case 257: /* cmd ::= SHOW LOCAL VARIABLES */
-#line 465 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
-#line 6117 "sql.c"
break;
case 258: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
-#line 466 "sql.y"
{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy952); }
-#line 6122 "sql.c"
break;
case 259: /* cmd ::= SHOW BNODES */
-#line 467 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
-#line 6127 "sql.c"
break;
case 260: /* cmd ::= SHOW SNODES */
-#line 468 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
-#line 6132 "sql.c"
break;
case 261: /* cmd ::= SHOW CLUSTER */
-#line 469 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
-#line 6137 "sql.c"
break;
case 262: /* cmd ::= SHOW TRANSACTIONS */
-#line 470 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
-#line 6142 "sql.c"
break;
case 263: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
-#line 471 "sql.y"
{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy952); }
-#line 6147 "sql.c"
break;
case 264: /* cmd ::= SHOW CONSUMERS */
-#line 472 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
-#line 6152 "sql.c"
break;
case 265: /* cmd ::= SHOW SUBSCRIPTIONS */
-#line 473 "sql.y"
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
-#line 6157 "sql.c"
break;
case 266: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
-#line 474 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy952, yymsp[-1].minor.yy952, OP_TYPE_EQUAL); }
-#line 6162 "sql.c"
break;
case 267: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */
-#line 475 "sql.y"
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), OP_TYPE_EQUAL); }
-#line 6167 "sql.c"
break;
case 268: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
-#line 476 "sql.y"
{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952, yymsp[-3].minor.yy824); }
-#line 6172 "sql.c"
break;
case 269: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */
-#line 477 "sql.y"
{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy169), yymsp[-4].minor.yy824); }
-#line 6177 "sql.c"
break;
case 270: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */
-#line 478 "sql.y"
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
-#line 6182 "sql.c"
break;
case 271: /* cmd ::= SHOW VNODES */
-#line 479 "sql.y"
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); }
-#line 6187 "sql.c"
break;
case 272: /* cmd ::= SHOW db_name_cond_opt ALIVE */
-#line 481 "sql.y"
{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy952, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
-#line 6192 "sql.c"
break;
case 273: /* cmd ::= SHOW CLUSTER ALIVE */
-#line 482 "sql.y"
{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); }
-#line 6197 "sql.c"
break;
case 274: /* db_name_cond_opt ::= */
case 279: /* from_db_opt ::= */ yytestcase(yyruleno==279);
-#line 484 "sql.y"
{ yymsp[1].minor.yy952 = createDefaultDatabaseCondValue(pCxt); }
-#line 6203 "sql.c"
break;
case 275: /* db_name_cond_opt ::= db_name NK_DOT */
-#line 485 "sql.y"
{ yylhsminor.yy952 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy169); }
-#line 6208 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 277: /* like_pattern_opt ::= LIKE NK_STRING */
-#line 488 "sql.y"
{ yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
-#line 6214 "sql.c"
break;
case 278: /* table_name_cond ::= table_name */
-#line 490 "sql.y"
{ yylhsminor.yy952 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169); }
-#line 6219 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 280: /* from_db_opt ::= FROM db_name */
-#line 493 "sql.y"
{ yymsp[-1].minor.yy952 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy169); }
-#line 6225 "sql.c"
break;
case 284: /* tag_item ::= TBNAME */
-#line 501 "sql.y"
{ yylhsminor.yy952 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
-#line 6230 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 287: /* tag_item ::= column_name column_alias */
-#line 504 "sql.y"
{ yylhsminor.yy952 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy169), &yymsp[0].minor.yy169); }
-#line 6236 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 288: /* tag_item ::= column_name AS column_alias */
-#line 505 "sql.y"
{ yylhsminor.yy952 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy169), &yymsp[0].minor.yy169); }
-#line 6242 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 289: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
-#line 509 "sql.y"
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy957, yymsp[-3].minor.yy952, yymsp[-1].minor.yy952, NULL, yymsp[0].minor.yy952); }
-#line 6248 "sql.c"
break;
case 290: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */
-#line 511 "sql.y"
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy957, yymsp[-5].minor.yy952, yymsp[-3].minor.yy952, yymsp[-1].minor.yy824, NULL); }
-#line 6253 "sql.c"
break;
case 291: /* cmd ::= DROP INDEX exists_opt full_index_name */
-#line 512 "sql.y"
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy952); }
-#line 6258 "sql.c"
break;
case 292: /* full_index_name ::= index_name */
-#line 514 "sql.y"
{ yylhsminor.yy952 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy169); }
-#line 6263 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 293: /* full_index_name ::= db_name NK_DOT index_name */
-#line 515 "sql.y"
{ yylhsminor.yy952 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169); }
-#line 6269 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 294: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
-#line 518 "sql.y"
{ yymsp[-9].minor.yy952 = createIndexOption(pCxt, yymsp[-7].minor.yy824, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 6275 "sql.c"
break;
case 295: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */
-#line 521 "sql.y"
{ yymsp[-11].minor.yy952 = createIndexOption(pCxt, yymsp[-9].minor.yy824, releaseRawExprNode(pCxt, yymsp[-5].minor.yy952), releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 6280 "sql.c"
break;
case 298: /* func ::= sma_func_name NK_LP expression_list NK_RP */
-#line 528 "sql.y"
{ yylhsminor.yy952 = createFunctionNode(pCxt, &yymsp[-3].minor.yy169, yymsp[-1].minor.yy824); }
-#line 6285 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 299: /* sma_func_name ::= function_name */
case 513: /* alias_opt ::= table_alias */ yytestcase(yyruleno==513);
-#line 532 "sql.y"
{ yylhsminor.yy169 = yymsp[0].minor.yy169; }
-#line 6292 "sql.c"
yymsp[0].minor.yy169 = yylhsminor.yy169;
break;
case 304: /* sma_stream_opt ::= */
case 345: /* stream_options ::= */ yytestcase(yyruleno==345);
-#line 538 "sql.y"
{ yymsp[1].minor.yy952 = createStreamOptions(pCxt); }
-#line 6299 "sql.c"
break;
case 305: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
-#line 539 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy952)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; }
-#line 6304 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 306: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
-#line 540 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy952)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; }
-#line 6310 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 307: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
-#line 541 "sql.y"
{ ((SStreamOptions*)yymsp[-2].minor.yy952)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); yylhsminor.yy952 = yymsp[-2].minor.yy952; }
-#line 6316 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 308: /* with_meta ::= AS */
-#line 546 "sql.y"
{ yymsp[0].minor.yy480 = 0; }
-#line 6322 "sql.c"
break;
case 309: /* with_meta ::= WITH META AS */
-#line 547 "sql.y"
{ yymsp[-2].minor.yy480 = 1; }
-#line 6327 "sql.c"
break;
case 310: /* with_meta ::= ONLY META AS */
-#line 548 "sql.y"
{ yymsp[-2].minor.yy480 = 2; }
-#line 6332 "sql.c"
break;
case 311: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
-#line 550 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy169, yymsp[0].minor.yy952); }
-#line 6337 "sql.c"
break;
case 312: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */
-#line 552 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy957, &yymsp[-3].minor.yy169, &yymsp[0].minor.yy169, yymsp[-2].minor.yy480); }
-#line 6342 "sql.c"
break;
case 313: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */
-#line 554 "sql.y"
{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy957, &yymsp[-4].minor.yy169, yymsp[-1].minor.yy952, yymsp[-3].minor.yy480, yymsp[0].minor.yy952); }
-#line 6347 "sql.c"
break;
case 314: /* cmd ::= DROP TOPIC exists_opt topic_name */
-#line 556 "sql.y"
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 6352 "sql.c"
break;
case 315: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
-#line 557 "sql.y"
{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169); }
-#line 6357 "sql.c"
break;
case 316: /* cmd ::= DESC full_table_name */
case 317: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==317);
-#line 560 "sql.y"
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy952); }
-#line 6363 "sql.c"
break;
case 318: /* cmd ::= RESET QUERY CACHE */
-#line 564 "sql.y"
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
-#line 6368 "sql.c"
break;
case 319: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
case 320: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==320);
-#line 567 "sql.y"
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 6374 "sql.c"
break;
case 323: /* explain_options ::= */
-#line 575 "sql.y"
{ yymsp[1].minor.yy952 = createDefaultExplainOptions(pCxt); }
-#line 6379 "sql.c"
break;
case 324: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-#line 576 "sql.y"
{ yylhsminor.yy952 = setExplainVerbose(pCxt, yymsp[-2].minor.yy952, &yymsp[0].minor.yy0); }
-#line 6384 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 325: /* explain_options ::= explain_options RATIO NK_FLOAT */
-#line 577 "sql.y"
{ yylhsminor.yy952 = setExplainRatio(pCxt, yymsp[-2].minor.yy952, &yymsp[0].minor.yy0); }
-#line 6390 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 326: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */
-#line 582 "sql.y"
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy957, yymsp[-9].minor.yy957, &yymsp[-6].minor.yy169, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy84, yymsp[-1].minor.yy480, &yymsp[0].minor.yy169, yymsp[-10].minor.yy957); }
-#line 6396 "sql.c"
break;
case 327: /* cmd ::= DROP FUNCTION exists_opt function_name */
-#line 583 "sql.y"
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 6401 "sql.c"
break;
case 332: /* language_opt ::= */
-#line 597 "sql.y"
{ yymsp[1].minor.yy169 = nil_token; }
-#line 6406 "sql.c"
break;
case 333: /* language_opt ::= LANGUAGE NK_STRING */
-#line 598 "sql.y"
{ yymsp[-1].minor.yy169 = yymsp[0].minor.yy0; }
-#line 6411 "sql.c"
break;
case 336: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
-#line 608 "sql.y"
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy957, &yymsp[-8].minor.yy169, yymsp[-5].minor.yy952, yymsp[-7].minor.yy952, yymsp[-3].minor.yy824, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, yymsp[-4].minor.yy824); }
-#line 6416 "sql.c"
break;
case 337: /* cmd ::= DROP STREAM exists_opt stream_name */
-#line 609 "sql.y"
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 6421 "sql.c"
break;
case 338: /* cmd ::= PAUSE STREAM exists_opt stream_name */
-#line 610 "sql.y"
{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 6426 "sql.c"
break;
case 339: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */
-#line 611 "sql.y"
{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy957, &yymsp[0].minor.yy169); }
-#line 6431 "sql.c"
break;
case 346: /* stream_options ::= stream_options TRIGGER AT_ONCE */
case 347: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==347);
-#line 625 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
-#line 6437 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 348: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
-#line 627 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 6443 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 349: /* stream_options ::= stream_options WATERMARK duration_literal */
-#line 628 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 6449 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 350: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
-#line 629 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
-#line 6455 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 351: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
-#line 630 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
-#line 6461 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 352: /* stream_options ::= stream_options DELETE_MARK duration_literal */
-#line 631 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-2].minor.yy952, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 6467 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 353: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
-#line 632 "sql.y"
{ yylhsminor.yy952 = setStreamOptions(pCxt, yymsp[-3].minor.yy952, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
-#line 6473 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 355: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
case 551: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==551);
case 572: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==572);
-#line 635 "sql.y"
{ yymsp[-3].minor.yy952 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy952); }
-#line 6481 "sql.c"
break;
case 358: /* cmd ::= KILL CONNECTION NK_INTEGER */
-#line 643 "sql.y"
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
-#line 6486 "sql.c"
break;
case 359: /* cmd ::= KILL QUERY NK_STRING */
-#line 644 "sql.y"
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
-#line 6491 "sql.c"
break;
case 360: /* cmd ::= KILL TRANSACTION NK_INTEGER */
-#line 645 "sql.y"
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
-#line 6496 "sql.c"
break;
case 361: /* cmd ::= BALANCE VGROUP */
-#line 648 "sql.y"
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
-#line 6501 "sql.c"
break;
case 362: /* cmd ::= BALANCE VGROUP LEADER */
-#line 649 "sql.y"
{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); }
-#line 6506 "sql.c"
break;
case 363: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
-#line 650 "sql.y"
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 6511 "sql.c"
break;
case 364: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-#line 651 "sql.y"
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy824); }
-#line 6516 "sql.c"
break;
case 365: /* cmd ::= SPLIT VGROUP NK_INTEGER */
-#line 652 "sql.y"
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
-#line 6521 "sql.c"
break;
case 366: /* dnode_list ::= DNODE NK_INTEGER */
-#line 656 "sql.y"
{ yymsp[-1].minor.yy824 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 6526 "sql.c"
break;
case 368: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
-#line 663 "sql.y"
{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 6531 "sql.c"
break;
case 371: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
-#line 672 "sql.y"
{ yymsp[-6].minor.yy952 = createInsertStmt(pCxt, yymsp[-4].minor.yy952, yymsp[-2].minor.yy824, yymsp[0].minor.yy952); }
-#line 6536 "sql.c"
break;
case 372: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
-#line 673 "sql.y"
{ yymsp[-3].minor.yy952 = createInsertStmt(pCxt, yymsp[-1].minor.yy952, NULL, yymsp[0].minor.yy952); }
-#line 6541 "sql.c"
break;
case 373: /* literal ::= NK_INTEGER */
-#line 676 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
-#line 6546 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 374: /* literal ::= NK_FLOAT */
-#line 677 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
-#line 6552 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 375: /* literal ::= NK_STRING */
-#line 678 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
-#line 6558 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 376: /* literal ::= NK_BOOL */
-#line 679 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
-#line 6564 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 377: /* literal ::= TIMESTAMP NK_STRING */
-#line 680 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
-#line 6570 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 378: /* literal ::= duration_literal */
@@ -6591,87 +5676,61 @@ static YYACTIONTYPE yy_reduce(
case 575: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==575);
case 578: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==578);
case 580: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==580);
-#line 681 "sql.y"
{ yylhsminor.yy952 = yymsp[0].minor.yy952; }
-#line 6596 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 379: /* literal ::= NULL */
-#line 682 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
-#line 6602 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 380: /* literal ::= NK_QUESTION */
-#line 683 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 6608 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 381: /* duration_literal ::= NK_VARIABLE */
-#line 685 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 6614 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 382: /* signed ::= NK_INTEGER */
-#line 687 "sql.y"
{ yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
-#line 6620 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 383: /* signed ::= NK_PLUS NK_INTEGER */
-#line 688 "sql.y"
{ yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
-#line 6626 "sql.c"
break;
case 384: /* signed ::= NK_MINUS NK_INTEGER */
-#line 689 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
-#line 6635 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 385: /* signed ::= NK_FLOAT */
-#line 694 "sql.y"
{ yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
-#line 6641 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 386: /* signed ::= NK_PLUS NK_FLOAT */
-#line 695 "sql.y"
{ yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
-#line 6647 "sql.c"
break;
case 387: /* signed ::= NK_MINUS NK_FLOAT */
-#line 696 "sql.y"
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
-#line 6656 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 389: /* signed_literal ::= NK_STRING */
-#line 703 "sql.y"
{ yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
-#line 6662 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 390: /* signed_literal ::= NK_BOOL */
-#line 704 "sql.y"
{ yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
-#line 6668 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 391: /* signed_literal ::= TIMESTAMP NK_STRING */
-#line 705 "sql.y"
{ yymsp[-1].minor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 6674 "sql.c"
break;
case 392: /* signed_literal ::= duration_literal */
case 394: /* signed_literal ::= literal_func */ yytestcase(yyruleno==394);
@@ -6681,138 +5740,106 @@ static YYACTIONTYPE yy_reduce(
case 579: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==579);
case 581: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==581);
case 594: /* search_condition ::= common_expression */ yytestcase(yyruleno==594);
-#line 706 "sql.y"
{ yylhsminor.yy952 = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); }
-#line 6686 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 393: /* signed_literal ::= NULL */
-#line 707 "sql.y"
{ yylhsminor.yy952 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
-#line 6692 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 395: /* signed_literal ::= NK_QUESTION */
-#line 709 "sql.y"
{ yylhsminor.yy952 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
-#line 6698 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 415: /* expression ::= NK_LP expression NK_RP */
case 499: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==499);
case 593: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==593);
-#line 770 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); }
-#line 6706 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 416: /* expression ::= NK_PLUS expr_or_subquery */
-#line 771 "sql.y"
{
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy952));
}
-#line 6715 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 417: /* expression ::= NK_MINUS expr_or_subquery */
-#line 775 "sql.y"
{
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy952), NULL));
}
-#line 6724 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 418: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
-#line 779 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6734 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 419: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
-#line 784 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6744 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 420: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
-#line 789 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6754 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 421: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
-#line 794 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6764 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 422: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
-#line 799 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6774 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 423: /* expression ::= column_reference NK_ARROW NK_STRING */
-#line 804 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
-#line 6783 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 424: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
-#line 808 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6793 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 425: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
-#line 813 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6803 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 428: /* column_reference ::= column_name */
-#line 824 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy169, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy169)); }
-#line 6809 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 429: /* column_reference ::= table_name NK_DOT column_name */
-#line 825 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169, createColumnNode(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy169)); }
-#line 6815 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 430: /* pseudo_column ::= ROWTS */
@@ -6827,278 +5854,191 @@ static YYACTIONTYPE yy_reduce(
case 440: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==440);
case 441: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==441);
case 447: /* literal_func ::= NOW */ yytestcase(yyruleno==447);
-#line 827 "sql.y"
{ yylhsminor.yy952 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
-#line 6832 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 432: /* pseudo_column ::= table_name NK_DOT TBNAME */
-#line 829 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy169)))); }
-#line 6838 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 442: /* function_expression ::= function_name NK_LP expression_list NK_RP */
case 443: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==443);
-#line 840 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy169, yymsp[-1].minor.yy824)); }
-#line 6845 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 444: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
-#line 843 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy84)); }
-#line 6851 "sql.c"
yymsp[-5].minor.yy952 = yylhsminor.yy952;
break;
case 446: /* literal_func ::= noarg_func NK_LP NK_RP */
-#line 846 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy169, NULL)); }
-#line 6857 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 461: /* star_func_para_list ::= NK_STAR */
-#line 870 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
-#line 6863 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 466: /* star_func_para ::= table_name NK_DOT NK_STAR */
case 534: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==534);
-#line 879 "sql.y"
{ yylhsminor.yy952 = createColumnNode(pCxt, &yymsp[-2].minor.yy169, &yymsp[0].minor.yy0); }
-#line 6870 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 467: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
-#line 882 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy824, yymsp[-1].minor.yy952)); }
-#line 6876 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 468: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
-#line 884 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-2].minor.yy824, yymsp[-1].minor.yy952)); }
-#line 6882 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 471: /* when_then_expr ::= WHEN common_expression THEN common_expression */
-#line 891 "sql.y"
{ yymsp[-3].minor.yy952 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)); }
-#line 6888 "sql.c"
break;
case 473: /* case_when_else_opt ::= ELSE common_expression */
-#line 894 "sql.y"
{ yymsp[-1].minor.yy952 = releaseRawExprNode(pCxt, yymsp[0].minor.yy952); }
-#line 6893 "sql.c"
break;
case 474: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
case 479: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==479);
-#line 897 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy520, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6903 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 475: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
-#line 904 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy952), releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6913 "sql.c"
yymsp[-4].minor.yy952 = yylhsminor.yy952;
break;
case 476: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
-#line 910 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy952), releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 6923 "sql.c"
yymsp[-5].minor.yy952 = yylhsminor.yy952;
break;
case 477: /* predicate ::= expr_or_subquery IS NULL */
-#line 915 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), NULL));
}
-#line 6932 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 478: /* predicate ::= expr_or_subquery IS NOT NULL */
-#line 919 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL));
}
-#line 6941 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 480: /* compare_op ::= NK_LT */
-#line 931 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_LOWER_THAN; }
-#line 6947 "sql.c"
break;
case 481: /* compare_op ::= NK_GT */
-#line 932 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_GREATER_THAN; }
-#line 6952 "sql.c"
break;
case 482: /* compare_op ::= NK_LE */
-#line 933 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_LOWER_EQUAL; }
-#line 6957 "sql.c"
break;
case 483: /* compare_op ::= NK_GE */
-#line 934 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_GREATER_EQUAL; }
-#line 6962 "sql.c"
break;
case 484: /* compare_op ::= NK_NE */
-#line 935 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_NOT_EQUAL; }
-#line 6967 "sql.c"
break;
case 485: /* compare_op ::= NK_EQ */
-#line 936 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_EQUAL; }
-#line 6972 "sql.c"
break;
case 486: /* compare_op ::= LIKE */
-#line 937 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_LIKE; }
-#line 6977 "sql.c"
break;
case 487: /* compare_op ::= NOT LIKE */
-#line 938 "sql.y"
{ yymsp[-1].minor.yy520 = OP_TYPE_NOT_LIKE; }
-#line 6982 "sql.c"
break;
case 488: /* compare_op ::= MATCH */
-#line 939 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_MATCH; }
-#line 6987 "sql.c"
break;
case 489: /* compare_op ::= NMATCH */
-#line 940 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_NMATCH; }
-#line 6992 "sql.c"
break;
case 490: /* compare_op ::= CONTAINS */
-#line 941 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_JSON_CONTAINS; }
-#line 6997 "sql.c"
break;
case 491: /* in_op ::= IN */
-#line 945 "sql.y"
{ yymsp[0].minor.yy520 = OP_TYPE_IN; }
-#line 7002 "sql.c"
break;
case 492: /* in_op ::= NOT IN */
-#line 946 "sql.y"
{ yymsp[-1].minor.yy520 = OP_TYPE_NOT_IN; }
-#line 7007 "sql.c"
break;
case 493: /* in_predicate_value ::= NK_LP literal_list NK_RP */
-#line 948 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); }
-#line 7012 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 495: /* boolean_value_expression ::= NOT boolean_primary */
-#line 952 "sql.y"
{
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy952), NULL));
}
-#line 7021 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 496: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
-#line 957 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 7031 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 497: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
-#line 963 "sql.y"
{
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy952);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy952);
yylhsminor.yy952 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), releaseRawExprNode(pCxt, yymsp[0].minor.yy952)));
}
-#line 7041 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 505: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-#line 981 "sql.y"
{ yylhsminor.yy952 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy952, yymsp[0].minor.yy952, NULL); }
-#line 7047 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 508: /* table_primary ::= table_name alias_opt */
-#line 987 "sql.y"
{ yylhsminor.yy952 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); }
-#line 7053 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 509: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-#line 988 "sql.y"
{ yylhsminor.yy952 = createRealTableNode(pCxt, &yymsp[-3].minor.yy169, &yymsp[-1].minor.yy169, &yymsp[0].minor.yy169); }
-#line 7059 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 510: /* table_primary ::= subquery alias_opt */
-#line 989 "sql.y"
{ yylhsminor.yy952 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952), &yymsp[0].minor.yy169); }
-#line 7065 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 512: /* alias_opt ::= */
-#line 994 "sql.y"
{ yymsp[1].minor.yy169 = nil_token; }
-#line 7071 "sql.c"
break;
case 514: /* alias_opt ::= AS table_alias */
-#line 996 "sql.y"
{ yymsp[-1].minor.yy169 = yymsp[0].minor.yy169; }
-#line 7076 "sql.c"
break;
case 515: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case 516: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==516);
-#line 998 "sql.y"
{ yymsp[-2].minor.yy952 = yymsp[-1].minor.yy952; }
-#line 7082 "sql.c"
break;
case 517: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
-#line 1003 "sql.y"
{ yylhsminor.yy952 = createJoinTableNode(pCxt, yymsp[-4].minor.yy932, yymsp[-5].minor.yy952, yymsp[-2].minor.yy952, yymsp[0].minor.yy952); }
-#line 7087 "sql.c"
yymsp[-5].minor.yy952 = yylhsminor.yy952;
break;
case 518: /* join_type ::= */
-#line 1007 "sql.y"
{ yymsp[1].minor.yy932 = JOIN_TYPE_INNER; }
-#line 7093 "sql.c"
break;
case 519: /* join_type ::= INNER */
-#line 1008 "sql.y"
{ yymsp[0].minor.yy932 = JOIN_TYPE_INNER; }
-#line 7098 "sql.c"
break;
case 520: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
-#line 1014 "sql.y"
{
yymsp[-13].minor.yy952 = createSelectStmt(pCxt, yymsp[-11].minor.yy957, yymsp[-9].minor.yy824, yymsp[-8].minor.yy952, yymsp[-12].minor.yy824);
yymsp[-13].minor.yy952 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy952, yymsp[-10].minor.yy957);
@@ -7111,224 +6051,145 @@ static YYACTIONTYPE yy_reduce(
yymsp[-13].minor.yy952 = addEveryClause(pCxt, yymsp[-13].minor.yy952, yymsp[-4].minor.yy952);
yymsp[-13].minor.yy952 = addFillClause(pCxt, yymsp[-13].minor.yy952, yymsp[-3].minor.yy952);
}
-#line 7114 "sql.c"
break;
case 521: /* hint_list ::= */
-#line 1029 "sql.y"
{ yymsp[1].minor.yy824 = createHintNodeList(pCxt, NULL); }
-#line 7119 "sql.c"
break;
case 522: /* hint_list ::= NK_HINT */
-#line 1030 "sql.y"
{ yylhsminor.yy824 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); }
-#line 7124 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 527: /* set_quantifier_opt ::= ALL */
-#line 1041 "sql.y"
{ yymsp[0].minor.yy957 = false; }
-#line 7130 "sql.c"
break;
case 530: /* select_item ::= NK_STAR */
-#line 1048 "sql.y"
{ yylhsminor.yy952 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
-#line 7135 "sql.c"
yymsp[0].minor.yy952 = yylhsminor.yy952;
break;
case 532: /* select_item ::= common_expression column_alias */
case 542: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==542);
-#line 1050 "sql.y"
{ yylhsminor.yy952 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952), &yymsp[0].minor.yy169); }
-#line 7142 "sql.c"
yymsp[-1].minor.yy952 = yylhsminor.yy952;
break;
case 533: /* select_item ::= common_expression AS column_alias */
case 543: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==543);
-#line 1051 "sql.y"
{ yylhsminor.yy952 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), &yymsp[0].minor.yy169); }
-#line 7149 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 538: /* partition_by_clause_opt ::= PARTITION BY partition_list */
case 563: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==563);
case 583: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==583);
-#line 1060 "sql.y"
{ yymsp[-2].minor.yy824 = yymsp[0].minor.yy824; }
-#line 7157 "sql.c"
break;
case 545: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
-#line 1073 "sql.y"
{ yymsp[-5].minor.yy952 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); }
-#line 7162 "sql.c"
break;
case 546: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
-#line 1074 "sql.y"
{ yymsp[-3].minor.yy952 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); }
-#line 7167 "sql.c"
break;
case 547: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
-#line 1076 "sql.y"
{ yymsp[-5].minor.yy952 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), NULL, yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 7172 "sql.c"
break;
case 548: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
-#line 1079 "sql.y"
{ yymsp[-7].minor.yy952 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy952), releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), yymsp[-1].minor.yy952, yymsp[0].minor.yy952); }
-#line 7177 "sql.c"
break;
case 549: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
-#line 1081 "sql.y"
{ yymsp[-6].minor.yy952 = createEventWindowNode(pCxt, yymsp[-3].minor.yy952, yymsp[0].minor.yy952); }
-#line 7182 "sql.c"
break;
case 553: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-#line 1087 "sql.y"
{ yymsp[-3].minor.yy952 = createFillNode(pCxt, yymsp[-1].minor.yy214, NULL); }
-#line 7187 "sql.c"
break;
case 554: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */
-#line 1088 "sql.y"
{ yymsp[-5].minor.yy952 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); }
-#line 7192 "sql.c"
break;
case 555: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */
-#line 1089 "sql.y"
{ yymsp[-5].minor.yy952 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy824)); }
-#line 7197 "sql.c"
break;
case 556: /* fill_mode ::= NONE */
-#line 1093 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_NONE; }
-#line 7202 "sql.c"
break;
case 557: /* fill_mode ::= PREV */
-#line 1094 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_PREV; }
-#line 7207 "sql.c"
break;
case 558: /* fill_mode ::= NULL */
-#line 1095 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_NULL; }
-#line 7212 "sql.c"
break;
case 559: /* fill_mode ::= NULL_F */
-#line 1096 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_NULL_F; }
-#line 7217 "sql.c"
break;
case 560: /* fill_mode ::= LINEAR */
-#line 1097 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_LINEAR; }
-#line 7222 "sql.c"
break;
case 561: /* fill_mode ::= NEXT */
-#line 1098 "sql.y"
{ yymsp[0].minor.yy214 = FILL_MODE_NEXT; }
-#line 7227 "sql.c"
break;
case 564: /* group_by_list ::= expr_or_subquery */
-#line 1107 "sql.y"
{ yylhsminor.yy824 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952))); }
-#line 7232 "sql.c"
yymsp[0].minor.yy824 = yylhsminor.yy824;
break;
case 565: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
-#line 1108 "sql.y"
{ yylhsminor.yy824 = addNodeToList(pCxt, yymsp[-2].minor.yy824, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy952))); }
-#line 7238 "sql.c"
yymsp[-2].minor.yy824 = yylhsminor.yy824;
break;
case 569: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
-#line 1115 "sql.y"
{ yymsp[-5].minor.yy952 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy952), releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); }
-#line 7244 "sql.c"
break;
case 570: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */
-#line 1117 "sql.y"
{ yymsp[-3].minor.yy952 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy952)); }
-#line 7249 "sql.c"
break;
case 573: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
-#line 1124 "sql.y"
{
yylhsminor.yy952 = addOrderByClause(pCxt, yymsp[-3].minor.yy952, yymsp[-2].minor.yy824);
yylhsminor.yy952 = addSlimitClause(pCxt, yylhsminor.yy952, yymsp[-1].minor.yy952);
yylhsminor.yy952 = addLimitClause(pCxt, yylhsminor.yy952, yymsp[0].minor.yy952);
}
-#line 7258 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 576: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
-#line 1134 "sql.y"
{ yylhsminor.yy952 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy952, yymsp[0].minor.yy952); }
-#line 7264 "sql.c"
yymsp[-3].minor.yy952 = yylhsminor.yy952;
break;
case 577: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
-#line 1136 "sql.y"
{ yylhsminor.yy952 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy952, yymsp[0].minor.yy952); }
-#line 7270 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 585: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case 589: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==589);
-#line 1150 "sql.y"
{ yymsp[-1].minor.yy952 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 7277 "sql.c"
break;
case 586: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case 590: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==590);
-#line 1151 "sql.y"
{ yymsp[-3].minor.yy952 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
-#line 7283 "sql.c"
break;
case 587: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case 591: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==591);
-#line 1152 "sql.y"
{ yymsp[-3].minor.yy952 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
-#line 7289 "sql.c"
break;
case 592: /* subquery ::= NK_LP query_expression NK_RP */
-#line 1160 "sql.y"
{ yylhsminor.yy952 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy952); }
-#line 7294 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 597: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
-#line 1174 "sql.y"
{ yylhsminor.yy952 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy952), yymsp[-1].minor.yy498, yymsp[0].minor.yy977); }
-#line 7300 "sql.c"
yymsp[-2].minor.yy952 = yylhsminor.yy952;
break;
case 598: /* ordering_specification_opt ::= */
-#line 1178 "sql.y"
{ yymsp[1].minor.yy498 = ORDER_ASC; }
-#line 7306 "sql.c"
break;
case 599: /* ordering_specification_opt ::= ASC */
-#line 1179 "sql.y"
{ yymsp[0].minor.yy498 = ORDER_ASC; }
-#line 7311 "sql.c"
break;
case 600: /* ordering_specification_opt ::= DESC */
-#line 1180 "sql.y"
{ yymsp[0].minor.yy498 = ORDER_DESC; }
-#line 7316 "sql.c"
break;
case 601: /* null_ordering_opt ::= */
-#line 1184 "sql.y"
{ yymsp[1].minor.yy977 = NULL_ORDER_DEFAULT; }
-#line 7321 "sql.c"
break;
case 602: /* null_ordering_opt ::= NULLS FIRST */
-#line 1185 "sql.y"
{ yymsp[-1].minor.yy977 = NULL_ORDER_FIRST; }
-#line 7326 "sql.c"
break;
case 603: /* null_ordering_opt ::= NULLS LAST */
-#line 1186 "sql.y"
{ yymsp[-1].minor.yy977 = NULL_ORDER_LAST; }
-#line 7331 "sql.c"
break;
default:
break;
@@ -7390,7 +6251,6 @@ static void yy_syntax_error(
ParseCTX_FETCH
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
-#line 29 "sql.y"
if (TSDB_CODE_SUCCESS == pCxt->errCode) {
if(TOKEN.z) {
@@ -7401,7 +6261,6 @@ static void yy_syntax_error(
} else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) {
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
}
-#line 7404 "sql.c"
/************ End %syntax_error code ******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
@@ -7487,56 +6346,12 @@ void Parse(
}
#endif
- while(1){ /* Exit by "break" */
- assert( yypParser->yytos>=yypParser->yystack );
+ do{
assert( yyact==yypParser->yytos->stateno );
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){
- unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
-#ifndef NDEBUG
- assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
- if( yyTraceFILE ){
- int yysize = yyRuleInfoNRhs[yyruleno];
- if( yysize ){
- fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
- yyTracePrompt,
- yyruleno, yyRuleName[yyruleno],
- yyrulenoyytos[yysize].stateno);
- }else{
- fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
- yyTracePrompt, yyruleno, yyRuleName[yyruleno],
- yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){
- yypParser->yyhwm++;
- assert( yypParser->yyhwm ==
- (int)(yypParser->yytos - yypParser->yystack));
- }
-#endif
-#if YYSTACKDEPTH>0
- if( yypParser->yytos>=yypParser->yystackEnd ){
- yyStackOverflow(yypParser);
- break;
- }
-#else
- if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
- if( yyGrowStack(yypParser) ){
- yyStackOverflow(yypParser);
- break;
- }
- }
-#endif
- }
- yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM);
+ yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
+ yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
@@ -7592,13 +6407,14 @@ void Parse(
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
- while( yypParser->yytos > yypParser->yystack ){
- yyact = yy_find_reduce_action(yypParser->yytos->stateno,
- YYERRORSYMBOL);
- if( yyact<=YY_MAX_SHIFTREDUCE ) break;
+ while( yypParser->yytos >= yypParser->yystack
+ && (yyact = yy_find_reduce_action(
+ yypParser->yytos->stateno,
+ YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
+ ){
yy_pop_parser_stack(yypParser);
}
- if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
+ if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
@@ -7648,7 +6464,7 @@ void Parse(
break;
#endif
}
- }
+ }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
diff --git a/source/libs/parser/test/parShowToUse.cpp b/source/libs/parser/test/parShowToUse.cpp
index 3e1482d420..ee71950621 100644
--- a/source/libs/parser/test/parShowToUse.cpp
+++ b/source/libs/parser/test/parShowToUse.cpp
@@ -286,7 +286,7 @@ TEST_F(ParserShowToUseTest, trimDatabase) {
run("TRIM DATABASE wxy_db");
setTrimDbReq("wxy_db", 100);
- run("TRIM DATABASE wxy_db MAX_SPEED 100");
+ run("TRIM DATABASE wxy_db BWLIMIT 100");
}
TEST_F(ParserShowToUseTest, useDatabase) {
diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c
index a32417b24a..1177ff562e 100644
--- a/source/os/src/osFile.c
+++ b/source/os/src/osFile.c
@@ -889,13 +889,16 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
char *data = taosMemoryMalloc(compressSize);
gzFile dstFp = NULL;
- TdFilePtr pSrcFile = taosOpenFile(srcFileName, TD_FILE_READ | TD_FILE_STREAM);
+ TdFilePtr pFile = NULL;
+ TdFilePtr pSrcFile = NULL;
+
+ pSrcFile = taosOpenFile(srcFileName, TD_FILE_READ | TD_FILE_STREAM);
if (pSrcFile == NULL) {
ret = -1;
goto cmp_end;
}
- TdFilePtr pFile = taosOpenFile(destFileName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC);
+ pFile = taosOpenFile(destFileName, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC);
if (pFile == NULL) {
ret = -2;
goto cmp_end;
@@ -914,6 +917,9 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
}
cmp_end:
+ if (pFile) {
+ taosCloseFile(&pFile);
+ }
if (pSrcFile) {
taosCloseFile(&pSrcFile);
}
diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task
index 326a754654..5d0a590c0f 100644
--- a/tests/parallel_test/cases.task
+++ b/tests/parallel_test/cases.task
@@ -772,6 +772,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/odbc.py
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/fill_with_group.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insertMix.py -N 3
diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py
index f7788d1d50..0239f41c0a 100644
--- a/tests/system-test/0-others/information_schema.py
+++ b/tests/system-test/0-others/information_schema.py
@@ -215,7 +215,13 @@ class TDTestCase:
for t in range (2):
tdSql.query(f'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"')
tdSql.checkEqual(20470,len(tdSql.queryResult))
-
+
+ tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'")
+ tdSql.checkEqual(195, len(tdSql.queryResult))
+
+ tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'")
+ tdSql.checkEqual(54, len(tdSql.queryResult))
+
def ins_dnodes_check(self):
tdSql.execute('drop database if exists db2')
tdSql.execute('create database if not exists db2 vgroups 1 replica 1')
diff --git a/tests/system-test/0-others/walRetention.py b/tests/system-test/0-others/walRetention.py
index 5257b7644a..0fdeb84a5b 100644
--- a/tests/system-test/0-others/walRetention.py
+++ b/tests/system-test/0-others/walRetention.py
@@ -147,13 +147,13 @@ class VNode :
if self.lastVer != -1 and ret:
# first wal file ignore
if walFile.startVer == self.firstVer:
- tdLog.info(f" {walFile.pathFile} can del, but is first. snapVer={self.snapVer} firstVer={self.firstVer}")
+ tdLog.info(f" can del {walFile.pathFile}, but is first. snapVer={self.snapVer} firstVer={self.firstVer}")
return False
# ver in stay range
smallVer = self.snapVer - self.walStayRange -1
if walFile.startVer >= smallVer:
- tdLog.info(f" {walFile.pathFile} can del, but range not arrived. snapVer={self.snapVer} smallVer={smallVer}")
+ tdLog.info(f" can del {walFile.pathFile}, but range not arrived. snapVer={self.snapVer} smallVer={smallVer}")
return False
return ret
@@ -161,9 +161,20 @@ class VNode :
# get log size
def getWalsSize(self):
size = 0
+ lastSize = 0
+ max = -1
for walFile in self.walFiles:
- size += walFile.fsize
+ if self.canDelete(walFile) == False:
+ tdLog.info(f" calc vnode size {walFile.pathFile} size={walFile.fsize} startVer={walFile.startVer}")
+ size += walFile.fsize
+ if max < walFile.startVer:
+ max = walFile.startVer
+ lastSize = walFile.fsize
+
+ if lastSize > 0:
+ tdLog.info(f" last file size need reduct . lastSize={lastSize}")
+ size -= lastSize
return size
# vnode
@@ -183,7 +194,7 @@ class VNode :
delTs = delTsLine.timestamp()
for walFile in self.walFiles:
mt = datetime.fromtimestamp(walFile.mtime)
- info = f" {walFile.pathFile} mt={mt} line={delTsLine} start={walFile.startVer} snap={self.snapVer} end= {walFile.endVer}"
+ info = f" {walFile.pathFile} size={walFile.fsize} mt={mt} line={delTsLine} start={walFile.startVer} snap={self.snapVer} end= {walFile.endVer}"
tdLog.info(info)
if walFile.mtime < delTs and self.canDelete(walFile):
# wait a moment then check file exist
@@ -199,25 +210,16 @@ class VNode :
if self.walSize == 0:
return True
+ time.sleep(2)
vnodeSize = self.getWalsSize()
- if vnodeSize < self.walSize:
- tdLog.info(f" wal size valid. {self.path} real = {vnodeSize} set = {self.walSize} ")
+ # need over 20%
+ if vnodeSize < self.walSize * 1.2:
+ tdLog.info(f" wal size valid. {self.path} real = {vnodeSize} set = {self.walSize}. allow over 20%.")
return True
- # check valid
- tdLog.info(f" wal size over set. {self.path} real = {vnodeSize} set = {self.walSize} ")
- for walFile in self.walFiles:
- if self.canDelete(walFile):
- # wait a moment then check file exist
- time.sleep(1)
- if os.path.exists(walFile.pathFile):
- tdLog.exit(f" wal file size over .\
- \n wal file = {walFile.pathFile}\
- \n snapVer = {self.snapVer}\
- \n real = {vnodeSize} bytes\
- \n set = {self.walSize} bytes")
- return False
- return True
+ # check over
+ tdLog.exit(f" wal size over set. {self.path} real = {vnodeSize} set = {self.walSize} ")
+ return False
# insert by async
diff --git a/tests/system-test/2-query/fill_with_group.py b/tests/system-test/2-query/fill_with_group.py
new file mode 100644
index 0000000000..393102c8ed
--- /dev/null
+++ b/tests/system-test/2-query/fill_with_group.py
@@ -0,0 +1,153 @@
+import taos
+import sys
+import time
+import socket
+import os
+import threading
+import math
+
+from util.log import *
+from util.sql import *
+from util.cases import *
+from util.dnodes import *
+from util.common import *
+# from tmqCommon import *
+
+class TDTestCase:
+ def __init__(self):
+ self.vgroups = 4
+ self.ctbNum = 10
+ self.rowsPerTbl = 10000
+ self.duraion = '1h'
+
+ def init(self, conn, logSql, replicaVar=1):
+ self.replicaVar = int(replicaVar)
+ tdLog.debug(f"start to excute {__file__}")
+ tdSql.init(conn.cursor(), False)
+
+ def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
+ if dropFlag == 1:
+ tsql.execute("drop database if exists %s"%(dbName))
+
+ tsql.execute("create database if not exists %s vgroups %d replica %d duration %s"%(dbName, vgroups, replica, duration))
+ tdLog.debug("complete to create database %s"%(dbName))
+ return
+
+ def create_stable(self,tsql, paraDict):
+ colString = tdCom.gen_column_type_str(colname_prefix=paraDict["colPrefix"], column_elm_list=paraDict["colSchema"])
+ tagString = tdCom.gen_tag_type_str(tagname_prefix=paraDict["tagPrefix"], tag_elm_list=paraDict["tagSchema"])
+ sqlString = f"create table if not exists %s.%s (%s) tags (%s)"%(paraDict["dbName"], paraDict["stbName"], colString, tagString)
+ tdLog.debug("%s"%(sqlString))
+ tsql.execute(sqlString)
+ return
+
+ def create_ctable(self,tsql=None, dbName='dbx',stbName='stb',ctbPrefix='ctb',ctbNum=1,ctbStartIdx=0):
+ for i in range(ctbNum):
+ sqlString = "create table %s.%s%d using %s.%s tags(%d, 'tb%d', 'tb%d', %d, %d, %d)" % \
+ (dbName,ctbPrefix,i+ctbStartIdx,dbName,stbName,(i+ctbStartIdx) % 5,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx,i+ctbStartIdx)
+ tsql.execute(sqlString)
+
+ tdLog.debug("complete to create %d child tables by %s.%s" %(ctbNum, dbName, stbName))
+ return
+
+ def insert_data(self,tsql,dbName,ctbPrefix,ctbNum,rowsPerTbl,batchNum,startTs,tsStep):
+ tdLog.debug("start to insert data ............")
+ tsql.execute("use %s" %dbName)
+ pre_insert = "insert into "
+ sql = pre_insert
+
+ for i in range(ctbNum):
+ rowsBatched = 0
+ sql += " %s%d values "%(ctbPrefix,i)
+ for j in range(rowsPerTbl):
+ if (i < ctbNum/2):
+ sql += "(%d, %d, %d, %d,%d,%d,%d,true,'binary%d', 'nchar%d') "%(startTs + j*tsStep, j%10, j%10, j%10, j%10, j%10, j%10, j%10, j%10)
+ else:
+ sql += "(%d, %d, NULL, %d,NULL,%d,%d,true,'binary%d', 'nchar%d') "%(startTs + j*tsStep, j%10, j%10, j%10, j%10, j%10, j%10)
+ rowsBatched += 1
+ if ((rowsBatched == batchNum) or (j == rowsPerTbl - 1)):
+ tsql.execute(sql)
+ rowsBatched = 0
+ if j < rowsPerTbl - 1:
+ sql = "insert into %s%d values " %(ctbPrefix,i)
+ else:
+ sql = "insert into "
+ if sql != pre_insert:
+ tsql.execute(sql)
+ tdLog.debug("insert data ............ [OK]")
+ return
+
+ def prepareTestEnv(self):
+ tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")
+ paraDict = {'dbName': 'test',
+ 'dropFlag': 1,
+ 'vgroups': 2,
+ 'stbName': 'meters',
+ 'colPrefix': 'c',
+ 'tagPrefix': 't',
+ 'colSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'FLOAT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'smallint', 'count':1},{'type': 'tinyint', 'count':1},{'type': 'bool', 'count':1},{'type': 'binary', 'len':10, 'count':1},{'type': 'nchar', 'len':10, 'count':1}],
+ 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'nchar', 'len':20, 'count':1},{'type': 'binary', 'len':20, 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'smallint', 'count':1},{'type': 'DOUBLE', 'count':1}],
+ 'ctbPrefix': 't',
+ 'ctbStartIdx': 0,
+ 'ctbNum': 100,
+ 'rowsPerTbl': 10000,
+ 'batchNum': 3000,
+ 'startTs': 1537146000000,
+ 'tsStep': 600000}
+
+ paraDict['vgroups'] = self.vgroups
+ paraDict['ctbNum'] = self.ctbNum
+ paraDict['rowsPerTbl'] = self.rowsPerTbl
+
+ tdLog.info("create database")
+ self.create_database(tsql=tdSql, dbName=paraDict["dbName"], dropFlag=paraDict["dropFlag"], vgroups=paraDict["vgroups"], replica=self.replicaVar, duration=self.duraion)
+
+ tdLog.info("create stb")
+ self.create_stable(tsql=tdSql, paraDict=paraDict)
+
+ tdLog.info("create child tables")
+ self.create_ctable(tsql=tdSql, dbName=paraDict["dbName"], \
+ stbName=paraDict["stbName"],ctbPrefix=paraDict["ctbPrefix"],\
+ ctbNum=paraDict["ctbNum"],ctbStartIdx=paraDict["ctbStartIdx"])
+ self.insert_data(tsql=tdSql, dbName=paraDict["dbName"],\
+ ctbPrefix=paraDict["ctbPrefix"],ctbNum=paraDict["ctbNum"],\
+ rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"],\
+ startTs=paraDict["startTs"],tsStep=paraDict["tsStep"])
+ return
+
+ def test_partition_by_with_interval_fill_prev_new_group_fill_error(self):
+ ## every table has 1500 rows after fill, 10 tables, total 15000 rows.
+ ## there is no data from 9-17 08:00:00 ~ 9-17 09:00:00, so first 60 rows of every group will be NULL, cause no prev value.
+ sql = "select _wstart, count(*),tbname from meters where ts > '2018-09-17 08:00:00.000' and ts < '2018-09-18 09:00:00.000' partition by tbname interval(1m) fill(PREV) order by tbname, _wstart"
+ tdSql.query(sql)
+ for i in range(0,10):
+ for j in range(0,60):
+ tdSql.checkData(i*1500+j, 1, None)
+
+ sql = "select _wstart, count(*),tbname from meters where ts > '2018-09-17 08:00:00.000' and ts < '2018-09-18 09:00:00.000' partition by tbname interval(1m) fill(LINEAR) order by tbname, _wstart"
+ tdSql.query(sql)
+ for i in range(0,10):
+ for j in range(0,60):
+ tdSql.checkData(i*1500+j, 1, None)
+
+ def test_fill_with_order_by(self):
+ sql = "select _wstart, _wend, count(ts), sum(c1) from meters where ts > '2018-11-25 00:00:00.000' and ts < '2018-11-26 00:00:00.00' interval(1d) fill(NULL) order by _wstart"
+ tdSql.query(sql)
+ tdSql.checkRows(1)
+ sql = "select _wstart, _wend, count(ts), sum(c1) from meters where ts > '2018-11-25 00:00:00.000' and ts < '2018-11-26 00:00:00.00' interval(1d) fill(NULL) order by _wstart desc"
+ tdSql.query(sql)
+ tdSql.checkRows(1)
+
+ def run(self):
+ self.prepareTestEnv()
+ self.test_partition_by_with_interval_fill_prev_new_group_fill_error()
+ self.test_fill_with_order_by()
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success(f"{__file__} successfully executed")
+
+event = threading.Event()
+
+tdCases.addLinux(__file__, TDTestCase())
+tdCases.addWindows(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/sml_TS-3724.py b/tests/system-test/2-query/sml_TS-3724.py
index a8b16c4662..410e266f10 100644
--- a/tests/system-test/2-query/sml_TS-3724.py
+++ b/tests/system-test/2-query/sml_TS-3724.py
@@ -67,7 +67,7 @@ class TDTestCase:
tdSql.query(f"select distinct tbname from {dbname}.`sys_if_bytes_out`")
tdSql.checkRows(2)
- tdSql.query(f"select * from {dbname}.t_fc70dec6677d4277c5d9799c4da806da order by times")
+ tdSql.query(f"select * from {dbname}.t_f67972b49aa8adf8bca5d0d54f0d850d order by times")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1.300000000)
tdSql.checkData(1, 1, 13.000000000)
diff --git a/tests/system-test/7-tmq/subscribeDb0.py b/tests/system-test/7-tmq/subscribeDb0.py
index ed13fcbe06..d4dfe425dc 100644
--- a/tests/system-test/7-tmq/subscribeDb0.py
+++ b/tests/system-test/7-tmq/subscribeDb0.py
@@ -237,7 +237,7 @@ class TDTestCase:
for i in range(expectRows):
totalConsumeRows += resultList[i]
- if totalConsumeRows != expectrowcnt:
+ if totalConsumeRows < expectrowcnt:
tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, expectrowcnt))
tdLog.exit("tmq consume rows error!")
diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c
index af7f13c69c..ff2e5efdd4 100644
--- a/tools/shell/src/shellWebsocket.c
+++ b/tools/shell/src/shellWebsocket.c
@@ -278,7 +278,7 @@ void shellRunSingleCommandWebsocketImp(char *command) {
}
if (code == TSDB_CODE_WS_SEND_TIMEOUT
|| code == TSDB_CODE_WS_RECV_TIMEOUT) {
- fprintf(stderr, "Hint: use -t to increase the timeout in seconds\n");
+ fprintf(stderr, "Hint: use -T to increase the timeout in seconds\n");
} else if (code == TSDB_CODE_WS_INTERNAL_ERRO
|| code == TSDB_CODE_WS_CLOSED) {
shell.ws_conn = NULL;
@@ -373,8 +373,6 @@ void shellRunSingleCommandWebsocketImp(char *command) {
} else {
printf("Query interrupted, %d row(s) in set (%.6fs)\n", numOfRows,
(et - st)/1E6);
- printf("Execute: %.2f ms Network: %.2f ms Total: %.2f ms\n",
- execute_time, net_time, total_time);
}
}
printf("\n");
diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c
index 237bfc5092..963b18dbc3 100644
--- a/utils/test/c/sml_test.c
+++ b/utils/test/c/sml_test.c
@@ -1533,6 +1533,7 @@ int sml_ts3724_Test() {
const char *sql[] = {
"stb.2,t1=1 f1=283i32 1632299372000",
+ "stb_2,t1=1 f1=283i32 1632299372000",
".stb2,t1=1 f1=106i32 1632299378000",
"stb2.,t1=1 f1=106i32 1632299378000",
};
@@ -1547,6 +1548,18 @@ int sml_ts3724_Test() {
printf("%s result0:%s\n", __FUNCTION__, taos_errstr(pRes));
taos_free_result(pRes);
+ pRes = taos_query(taos, "select * from stb_2");
+ TAOS_ROW row = taos_fetch_row(pRes);
+ int numRows = taos_affected_rows(pRes);
+ ASSERT(numRows == 1);
+ taos_free_result(pRes);
+
+ pRes = taos_query(taos, "show stables");
+ row = taos_fetch_row(pRes);
+ numRows = taos_affected_rows(pRes);
+ ASSERT(numRows == 3);
+ taos_free_result(pRes);
+
taos_close(taos);
return code;