diff --git a/cmake/cmake.define b/cmake/cmake.define index 12e1b50539..f1a5cef67e 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -180,18 +180,20 @@ ELSE () SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") ENDIF() MESSAGE(STATUS "SIMD instructions (FMA/AVX/AVX2) is ACTIVATED") + ENDIF() -# IF (COMPILER_SUPPORT_AVX512F AND COMPILER_SUPPORT_AVX512BMI) -# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512f -mavx512vbmi") -# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512vbmi") -# MESSAGE(STATUS "avx512f/avx512bmi supported by compiler") -# ENDIF() -# -# IF (COMPILER_SUPPORT_AVX512VL) -# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512vl") -# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512vl") -# MESSAGE(STATUS "avx512vl supported by compiler") -# ENDIF() + IF ("${SIMD_AVX512_SUPPORT}" MATCHES "true") + IF (COMPILER_SUPPORT_AVX512F AND COMPILER_SUPPORT_AVX512BMI) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512f -mavx512vbmi") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512vbmi") + MESSAGE(STATUS "avx512f/avx512bmi enabled by compiler") + ENDIF() + + IF (COMPILER_SUPPORT_AVX512VL) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512vl") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512vl") + MESSAGE(STATUS "avx512vl enabled by compiler") + ENDIF() ENDIF() # build mode diff --git a/cmake/libuv_CMakeLists.txt.in b/cmake/libuv_CMakeLists.txt.in index 9c48ddefef..673c771fb0 100644 --- a/cmake/libuv_CMakeLists.txt.in +++ b/cmake/libuv_CMakeLists.txt.in @@ -2,7 +2,7 @@ # libuv ExternalProject_Add(libuv GIT_REPOSITORY https://github.com/libuv/libuv.git - GIT_TAG v1.44.2 + GIT_TAG v1.48.0 SOURCE_DIR "${TD_CONTRIB_DIR}/libuv" BINARY_DIR "${TD_CONTRIB_DIR}/libuv" CONFIGURE_COMMAND "" diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 9bbda8309f..9a6a5329ae 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG main + GIT_TAG 3.0 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/10-deployment/03-k8s.md b/docs/en/10-deployment/03-k8s.md index affb492169..3e5ba4c349 100644 --- a/docs/en/10-deployment/03-k8s.md +++ b/docs/en/10-deployment/03-k8s.md @@ -243,7 +243,7 @@ curl -u root:taosdata -d "show databases" 127.0.0.1:6041/rest/sql {"code":0,"column_meta":[["name","VARCHAR",64]],"data":[["information_schema"],["performance_schema"],["test"],["test1"]],"rows":4} ``` -## Test cluster +## Test cluster ### Data preparation @@ -335,7 +335,7 @@ tdengine-1 1/1 Running 1 (6m48s ago) 20m 10.244.0.59 node84 tdengine-2 1/1 Running 0 21m 10.244.1.223 node85 ``` -At this time, the cluster mnode has a re-election, and the monde on dnode1 becomes the leader. +At this time, the cluster mnode has a re-election, and the monde on dnode2 becomes the leader. ```Bash kubectl exec -it tdengine-1 -n tdengine-test -- taos -s "show mnodes\G" diff --git a/docs/en/12-taos-sql/03-table.md b/docs/en/12-taos-sql/03-table.md index ca22a6ace7..487ce92e03 100644 --- a/docs/en/12-taos-sql/03-table.md +++ b/docs/en/12-taos-sql/03-table.md @@ -25,7 +25,7 @@ create_definition: col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... @@ -52,9 +52,9 @@ table_option: { **Parameter description** -1. COMMENT: specifies comments for the table. This parameter can be used with supertables, standard tables, and subtables. +1. COMMENT: specifies comments for the table. This parameter can be used with supertables, standard tables, and subtables. The maximum length of the comment is 1024 bytes. 2. SMA: specifies functions on which to enable small materialized aggregates (SMA). SMA is user-defined precomputation of aggregates based on data blocks. Enter one of the following values: max, min, or sum This parameter can be used with supertables and standard tables. -3. TTL: specifies the time to live (TTL) for the table. If TTL is specified when creatinga table, after the time period for which the table has been existing is over TTL, TDengine will automatically delete the table. Please be noted that the system may not delete the table at the exact moment that the TTL expires but guarantee there is such a system and finally the table will be deleted. The unit of TTL is in days. The default value is 0, i.e. never expire. +3. TTL: specifies the time to live (TTL) for the table. If TTL is specified when creatinga table, after the time period for which the table has been existing is over TTL, TDengine will automatically delete the table. Please be noted that the system may not delete the table at the exact moment that the TTL expires but guarantee there is such a system and finally the table will be deleted. The unit of TTL is in days. The value range is [0, 2147483647]. The default value is 0, i.e. never expire. ## Create Subtables @@ -112,6 +112,11 @@ You can perform the following modifications on existing tables: 4. RENAME COLUMN: renames a specified column in the table. 5. The primary key column of a table cannot be modified or added or deleted using ADD/DROP COLUMN. +**Parameter description** + +1. COMMENT: specifies comments for the table. This parameter can be used with supertables, standard tables, and subtables. The maximum length of the comment is 1024 bytes. +2. TTL: specifies the time to live (TTL) for the table. If TTL is specified when creatinga table, after the time period for which the table has been existing is over TTL, TDengine will automatically delete the table. Please be noted that the system may not delete the table at the exact moment that the TTL expires but guarantee there is such a system and finally the table will be deleted. The unit of TTL is in days. The value range is [0, 2147483647]. The default value is 0, i.e. never expire. + ### Add a Column ```sql @@ -136,6 +141,18 @@ ALTER TABLE tb_name MODIFY COLUMN field_name data_type(length); ALTER TABLE tb_name RENAME COLUMN old_col_name new_col_name ``` +### Alter Table TTL + +```sql +ALTER TABLE tb_name TTL value +``` + +### Alter Table Comment + +```sql +ALTER TABLE tb_name COMMENT 'string_value' +``` + ## Modify a Subtable ```sql @@ -159,12 +176,29 @@ alter_table_option: { 1. Only the value of a tag can be modified directly. For all other modifications, you must modify the supertable from which the subtable was created. +**Parameter description** + +1. COMMENT: specifies comments for the table. This parameter can be used with supertables, standard tables, and subtables. The maximum length of the comment is 1024 bytes. +2. TTL: specifies the time to live (TTL) for the table. If TTL is specified when creatinga table, after the time period for which the table has been existing is over TTL, TDengine will automatically delete the table. Please be noted that the system may not delete the table at the exact moment that the TTL expires but guarantee there is such a system and finally the table will be deleted. The unit of TTL is in days. The value range is [0, 2147483647]. The default value is 0, i.e. never expire. + ### Change Tag Value Of Sub Table ``` ALTER TABLE tb_name SET TAG tag_name=new_tag_value; ``` +### Alter Table TTL + +```sql +ALTER TABLE tb_name TTL value +``` + +### Alter Table Comment + +```sql +ALTER TABLE tb_name COMMENT 'string_value' +``` + ## Delete a Table The following SQL statement deletes one or more tables. diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md index e7cefc1d7a..fcd782b429 100644 --- a/docs/en/12-taos-sql/14-stream.md +++ b/docs/en/12-taos-sql/14-stream.md @@ -47,7 +47,7 @@ window_clause: { } ``` -`SESSION` indicates a session window, and `tol_val` indicates the maximum range of the time interval. If the time interval between two continuous rows are within the time interval specified by `tol_val` they belong to the same session window; otherwise a new session window is started automatically. +`SESSION` indicates a session window, and `tol_val` indicates the maximum range of the time interval. If the time interval between two continuous rows are within the time interval specified by `tol_val` they belong to the same session window; otherwise a new session window is started automatically.The `_wend` of this window is the time of the last data plus `tol_val`. `EVENT_WINDOW` is determined according to the window start condition and the window close condition. The window is started when `start_trigger_condition` is evaluated to true, the window is closed when `end_trigger_condition` is evaluated to true. `start_trigger_condition` and `end_trigger_condition` can be any conditional expressions supported by TDengine and can include multiple columns. diff --git a/docs/en/12-taos-sql/20-keywords.md b/docs/en/12-taos-sql/20-keywords.md index 36cbc0948f..91be44c561 100644 --- a/docs/en/12-taos-sql/20-keywords.md +++ b/docs/en/12-taos-sql/20-keywords.md @@ -151,7 +151,7 @@ The following list shows all reserved keywords: - INTERVAL - INTO - IS -- ISNULL +- IS NULL ### J @@ -197,7 +197,7 @@ The following list shows all reserved keywords: - NMATCH - NONE - NOT -- NOTNULL +- NOT NULL - NOW - NULL - NULLS diff --git a/docs/en/12-taos-sql/25-grant.md b/docs/en/12-taos-sql/25-grant.md index 5ebed12b59..6575d2d7f4 100644 --- a/docs/en/12-taos-sql/25-grant.md +++ b/docs/en/12-taos-sql/25-grant.md @@ -39,10 +39,10 @@ This is an example: ```sql taos> show users; - name | super | enable | sysinfo | create_time | -================================================================================ - test | 0 | 1 | 1 | 2022-08-29 15:10:27.315 | - root | 1 | 1 | 1 | 2022-08-29 15:03:34.710 | + name | super | enable | sysinfo | createdb | create_time | allowed_host | +========================================================================================================= + test | 0 | 1 | 1 | 0 |2022-08-29 15:10:27.315 | 127.0.0.1 | + root | 1 | 1 | 1 | 1 |2022-08-29 15:03:34.710 | 127.0.0.1 | Query OK, 2 rows in database (0.001657s) ``` @@ -50,10 +50,10 @@ Alternatively, you can get the user information by querying a built-in table, IN ```sql taos> select * from information_schema.ins_users; - name | super | enable | sysinfo | create_time | -================================================================================ - test | 0 | 1 | 1 | 2022-08-29 15:10:27.315 | - root | 1 | 1 | 1 | 2022-08-29 15:03:34.710 | + name | super | enable | sysinfo | createdb | create_time | allowed_host | +========================================================================================================= + test | 0 | 1 | 1 | 0 |2022-08-29 15:10:27.315 | 127.0.0.1 | + root | 1 | 1 | 1 | 1 |2022-08-29 15:03:34.710 | 127.0.0.1 | Query OK, 2 rows in database (0.001953s) ``` @@ -67,17 +67,19 @@ DROP USER user_name; ```sql ALTER USER user_name alter_user_clause - + alter_user_clause: { PASS 'literal' | ENABLE value | SYSINFO value + | CREATEDB value } ``` - PASS: Modify the user password. - ENABLE: Specify whether the user is enabled or disabled. 1 indicates enabled and 0 indicates disabled. - SYSINFO: Specify whether the user can query system information. 1 indicates that the user can query system information and 0 indicates that the user cannot query system information. +- CREATEDB: Specify whether the user can create databases. 1 indicates that the user can create databases and 0 indicates that the user cannot create databases. For example, you can use below command to disable user `test`: diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md index 5e4eadcceb..f50551b5de 100755 --- a/docs/en/14-reference/12-config/index.md +++ b/docs/en/14-reference/12-config/index.md @@ -432,7 +432,7 @@ The charset that takes effect is UTF-8. | Applicable | Server Only | | Meaning | Maximum number of threads to commit | | Value Range | 0-1024 | -| Default Value | | +| Default Value | 4 | ## Log Parameters diff --git a/docs/en/21-tdinternal/08-compress.md b/docs/en/21-tdinternal/08-compress.md index a3b073c3a7..10a06a4c91 100644 --- a/docs/en/21-tdinternal/08-compress.md +++ b/docs/en/21-tdinternal/08-compress.md @@ -1,12 +1,8 @@ - --- - title: Configurable Column Compression description: Configurable column storage compression method --- -# Configurable Storage Compression - Since TDengine 3.3.0.0, more advanced compression feature is introduced, you can specify compression or not, the compression method and compression level for each column. ## Compression Terminology Definition @@ -32,16 +28,14 @@ In this article, it specifically refers to the level within the secondary compre - Default compression algorithm list and applicable range for each data type -| Data Type | Optional Encoding Algorithm | Default Encoding Algorithm | Optional Compression Algorithm|Default Compression Algorithm| Default Compression Level| +| Data Type | Optional Encoding Algorithm | Default Encoding Algorithm | Optional Compression Algorithm|Default Compression Algorithm| Default Compression Level| | :-----------:|:----------:|:-------:|:-------:|:----------:|:----:| - tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium| +| tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium| | bigint/ubigint/timestamp | simple8b/delta-i | delta-i |lz4/zlib/zstd/xz | lz4| medium| -|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|tsz| medium| +|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|lz4| medium| |binary/nchar| disabled| disabled|lz4/zlib/zstd/xz| lz4| medium| |bool| bit-packing| bit-packing| lz4/zlib/zstd/xz| lz4| medium| -Note: For floating point types, if configured as tsz, its precision is determined by the global configuration of taosd. If configured as tsz, but the lossy compression flag is not configured, lz4 is used for compression by default. - ## SQL ### Create Table with Compression @@ -76,7 +70,7 @@ ALTER TABLE [db_name.]tabName MODIFY COLUMN colName [ENCODE 'ecode_type'] [COMPR - Change the compression method of the column -### View Compression Dethod +### View Compression Method ```sql DESCRIBE [dbname.]tabName diff --git a/docs/zh/10-deployment/03-k8s.md b/docs/zh/10-deployment/03-k8s.md index 31e909f02d..8be7ec9e9e 100644 --- a/docs/zh/10-deployment/03-k8s.md +++ b/docs/zh/10-deployment/03-k8s.md @@ -10,9 +10,9 @@ description: 利用 Kubernetes 部署 TDengine 集群的详细指南 为了满足[高可用](https://docs.taosdata.com/tdinternal/high-availability/)的需求,集群需要满足如下要求: -- 3个及以上 dnode :TDengine 的同一个 vgroup 中的多个 vnode ,不允许同时分布在一个 dnode ,所以如果创建3副本的数据库,则 dnode 数大于等于3 -- 3个 mnode :mnode 负责整个集群的管理工作,TDengine 默认是一个 mnode。如果这个 mnode 所在的 dnode 掉线,则整个集群不可用。 -- 数据库的3副本:TDengine 的副本配置是数据库级别,所以数据库3副本可满足在3个 dnode 的集群中,任意一个 dnode 下线,都不影响集群的正常使用。**如果下线** **dnode** **个数为2时,此时集群不可用,****因为****RAFT无法完成选举****。**(企业版:在灾难恢复场景,任一节点数据文件损坏,都可以通过重新拉起dnode进行恢复) +- 3 个及以上 dnode :TDengine 的同一个 vgroup 中的多个 vnode ,不允许同时分布在一个 dnode ,所以如果创建 3 副本的数据库,则 dnode 数大于等于 3 +- 3 个 mnode :mnode 负责整个集群的管理工作,TDengine 默认是一个 mnode。如果这个 mnode 所在的 dnode 掉线,则整个集群不可用。 +- 数据库的 3 副本:TDengine 的副本配置是数据库级别,所以数据库 3 副本可满足在 3 个 dnode 的集群中,任意一个 dnode 下线,都不影响集群的正常使用。**如果下线** **dnode** **个数为 2 时,此时集群不可用,\*\***因为\***\*RAFT 无法完成选举\*\***。\*\*(企业版:在灾难恢复场景,任一节点数据文件损坏,都可以通过重新拉起 dnode 进行恢复) ## 前置条件 @@ -52,7 +52,7 @@ spec: 根据 Kubernetes 对各类部署的说明,我们将使用 StatefulSet 作为 TDengine 的部署资源类型。 创建文件 `tdengine.yaml`,其中 replicas 定义集群节点的数量为 3。节点时区为中国(Asia/Shanghai),每个节点分配 5G 标准(standard)存储(参考[Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 配置 storage class )。你也可以根据实际情况进行相应修改。 -请特别注意startupProbe的配置,在 dnode 的 Pod 掉线一段时间后,再重新启动,这个时候新上线的 dnode 会短暂不可用。如果startupProbe配置过小,Kubernetes 会认为该 Pod 处于不正常的状态,并尝试重启该 Pod,该 dnode 的 Pod 会频繁重启,始终无法恢复到正常状态。参考 [Configure Liveness, Readiness and Startup Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) +请特别注意 startupProbe 的配置,在 dnode 的 Pod 掉线一段时间后,再重新启动,这个时候新上线的 dnode 会短暂不可用。如果 startupProbe 配置过小,Kubernetes 会认为该 Pod 处于不正常的状态,并尝试重启该 Pod,该 dnode 的 Pod 会频繁重启,始终无法恢复到正常状态。参考 [Configure Liveness, Readiness and Startup Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) ```YAML --- @@ -176,7 +176,7 @@ taos> show dnodes Query OK, 3 row(s) in set (0.001853s) ``` -查看当前mnode +查看当前 mnode ```Bash kubectl exec -it tdengine-1 -n tdengine-test -- taos -s "show mnodes\G" @@ -191,14 +191,14 @@ reboot_time: 2023-07-19 17:54:19.520 Query OK, 1 row(s) in set (0.001282s) ``` -## 创建mnode +## 创建 mnode ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- taos -s "create mnode on dnode 2" kubectl exec -it tdengine-0 -n tdengine-test -- taos -s "create mnode on dnode 3" ``` -查看mnode +查看 mnode ```Bash kubectl exec -it tdengine-1 -n tdengine-test -- taos -s "show mnodes\G" @@ -249,7 +249,7 @@ curl -u root:taosdata -d "show databases" 127.0.0.1:6041/rest/sql #### taosBenchmark -通过taosBenchmark 创建一个3副本的数据库,同时写入1亿条数据,同时查看数据 +通过 taosBenchmark 创建一个 3 副本的数据库,同时写入 1 亿条数据,同时查看数据 ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- taosBenchmark -I stmt -d test -n 10000 -t 10000 -a 3 @@ -264,7 +264,7 @@ taos> select count(*) from test.meters; Query OK, 1 row(s) in set (0.103537s) ``` -查看vnode分布,通过show dnodes +查看 vnode 分布,通过 show dnodes ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- taos -s "show dnodes" @@ -278,7 +278,7 @@ taos> show dnodes Query OK, 3 row(s) in set (0.001357s) ``` -通过show vgroup 查看 vnode 分布情况 +通过 show vgroup 查看 vnode 分布情况 ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- taos -s "show test.vgroups" @@ -299,7 +299,7 @@ Query OK, 8 row(s) in set (0.001488s) #### 手工创建 -常见一个三副本的test1,并创建一张表,写入2条数据 +常见一个三副本的 test1,并创建一张表,写入 2 条数据 ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- \ @@ -310,7 +310,7 @@ kubectl exec -it tdengine-0 -n tdengine-test -- \ insert into t1 values(now, 1)(now+1s, 2);" ``` -通过show test1.vgroup 查看xnode分布情况 +通过 show test1.vgroup 查看 xnode 分布情况 ```Bash kubectl exec -it tdengine-0 -n tdengine-test -- taos -s "show test1.vgroups" @@ -335,7 +335,7 @@ tdengine-1 1/1 Running 1 (6m48s ago) 20m 10.244.0.59 node84 tdengine-2 1/1 Running 0 21m 10.244.1.223 node85 ``` -此时集群mnode发生重新选举,dnode1上的monde 成为leader +此时集群 mnode 发生重新选举,dnode2 上的 monde 成为 leader ```Bash kubectl exec -it tdengine-1 -n tdengine-test -- taos -s "show mnodes\G" @@ -389,7 +389,7 @@ taos> select *from test1.t1 Query OK, 4 row(s) in set (0.001994s) ``` -同理,至于非leader得mnode掉线,读写当然可以正常进行,这里就不做过多的展示。 +同理,至于非 leader 得 mnode 掉线,读写当然可以正常进行,这里就不做过多的展示。 ## 集群扩容 @@ -436,7 +436,7 @@ Query OK, 4 row(s) in set (0.003628s) ## 集群缩容 -由于 TDengine 集群在扩缩容时会对数据进行节点间迁移,使用 kubectl 命令进行缩容需要首先使用 "drop dnodes" 命令(**如果集群中存在3副本的db,那么缩容后的** **dnode** **个数也要必须大于等于3,否则drop dnode操作会被中止**),然后再节点删除完成后再进行 Kubernetes 集群缩容。 +由于 TDengine 集群在扩缩容时会对数据进行节点间迁移,使用 kubectl 命令进行缩容需要首先使用 "drop dnodes" 命令(**如果集群中存在 3 副本的 db,那么缩容后的** **dnode** **个数也要必须大于等于 3,否则 drop dnode 操作会被中止**),然后再节点删除完成后再进行 Kubernetes 集群缩容。 注意:由于 Kubernetes Statefulset 中 Pod 的只能按创建顺序逆序移除,所以 TDengine drop dnode 也需要按照创建顺序逆序移除,否则会导致 Pod 处于错误状态。 @@ -459,7 +459,7 @@ Query OK, 3 row(s) in set (0.003324s) kubectl scale statefulsets tdengine --replicas=3 -n tdengine-test ``` -最后一个 POD 将会被删除。使用命令 kubectl get pods -l app=tdengine 查看POD状态: +最后一个 POD 将会被删除。使用命令 kubectl get pods -l app=tdengine 查看 POD 状态: ```Plain kubectl get pod -l app=tdengine -n tdengine-test -o wide @@ -469,7 +469,7 @@ tdengine-1 1/1 Running 1 (7h9m ago) 7h23m 10.244.0.59 node84 < tdengine-2 1/1 Running 0 5h45m 10.244.1.224 node85 ``` -POD删除后,需要手动删除PVC,否则下次扩容时会继续使用以前的数据导致无法正常加入集群。 +POD 删除后,需要手动删除 PVC,否则下次扩容时会继续使用以前的数据导致无法正常加入集群。 ```Bash kubectl delete pvc aosdata-tdengine-3 -n tdengine-test @@ -502,7 +502,7 @@ Query OK, 4 row(s) in set (0.003881s) ## 清理 TDengine 集群 -> **删除pvc时需要注意下pv persistentVolumeReclaimPolicy策略,建议改为Delete,这样在删除pvc时才会自动清理pv,同时会清理底层的csi存储资源,如果没有配置删除pvc自动清理pv的策略,再删除pvc后,在手动清理pv时,pv对应的csi存储资源可能不会被释放。** +> **删除 pvc 时需要注意下 pv persistentVolumeReclaimPolicy 策略,建议改为 Delete,这样在删除 pvc 时才会自动清理 pv,同时会清理底层的 csi 存储资源,如果没有配置删除 pvc 自动清理 pv 的策略,再删除 pvc 后,在手动清理 pv 时,pv 对应的 csi 存储资源可能不会被释放。** 完整移除 TDengine 集群,需要分别清理 statefulset、svc、configmap、pvc。 @@ -537,8 +537,8 @@ Query OK, 4 row(s) in set (0.003862s) 对于在 Kubernetes 环境下 TDengine 的高可用和高可靠来说,对于硬件损坏、灾难恢复,分为两个层面来讲: 1. 底层的分布式块存储具备的灾难恢复能力,块存储的多副本,当下流行的分布式块存储如 Ceph,就具备多副本能力,将存储副本扩展到不同的机架、机柜、机房、数据中心(或者直接使用公有云厂商提供的块存储服务) -2. TDengine的灾难恢复,在 TDengine Enterprise 中,本身具备了当一个 dnode 永久下线(物理机磁盘损坏,数据分拣丢失)后,重新拉起一个空白的dnode来恢复原dnode的工作。 +2. TDengine 的灾难恢复,在 TDengine Enterprise 中,本身具备了当一个 dnode 永久下线(物理机磁盘损坏,数据分拣丢失)后,重新拉起一个空白的 dnode 来恢复原 dnode 的工作。 -最后,欢迎使用[TDengine Cloud](https://cloud.taosdata.com/),来体验一站式全托管的TDengine云服务。 +最后,欢迎使用[TDengine Cloud](https://cloud.taosdata.com/),来体验一站式全托管的 TDengine 云服务。 > TDengine Cloud 是一个极简的全托管时序数据处理云服务平台,它是基于开源的时序数据库 TDengine 而开发的。除高性能的时序数据库之外,它还具有缓存、订阅和流计算等系统功能,而且提供了便利而又安全的数据分享、以及众多的企业级功能。它可以让物联网、工业互联网、金融、IT 运维监控等领域企业在时序数据的管理上大幅降低人力成本和运营成本。 diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 773ce75430..09580fb788 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -23,10 +23,10 @@ create_subtable_clause: { } create_definition: - col_name column_definition + col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... @@ -52,9 +52,9 @@ table_option: { **参数说明** -1. COMMENT:表注释。可用于超级表、子表和普通表。 +1. COMMENT:表注释。可用于超级表、子表和普通表。最大长度为 1024 个字节。 2. SMA:Small Materialized Aggregates,提供基于数据块的自定义预计算功能。预计算类型包括 MAX、MIN 和 SUM。可用于超级表/普通表。 -3. TTL:Time to Live,是用户用来指定表的生命周期的参数。如果创建表时指定了这个参数,当该表的存在时间超过 TTL 指定的时间后,TDengine 自动删除该表。这个 TTL 的时间只是一个大概时间,系统不保证到了时间一定会将其删除,而只保证存在这样一个机制且最终一定会删除。TTL 单位是天,默认为 0,表示不限制,到期时间为表创建时间加上 TTL 时间。TTL 与数据库 KEEP 参数没有关联,如果 KEEP 比 TTL 小,在表被删除之前数据也可能已经被删除。 +3. TTL:Time to Live,是用户用来指定表的生命周期的参数。如果创建表时指定了这个参数,当该表的存在时间超过 TTL 指定的时间后,TDengine 自动删除该表。这个 TTL 的时间只是一个大概时间,系统不保证到了时间一定会将其删除,而只保证存在这样一个机制且最终一定会删除。TTL 单位是天,取值范围为[0, 2147483647],默认为 0,表示不限制,到期时间为表创建时间加上 TTL 时间。TTL 与数据库 KEEP 参数没有关联,如果 KEEP 比 TTL 小,在表被删除之前数据也可能已经被删除。 ## 创建子表 @@ -112,6 +112,11 @@ alter_table_option: { 4. RENAME COLUMN:修改列名称。 5. 普通表的主键列不能被修改,也不能通过 ADD/DROP COLUMN 来添加/删除主键列。 +**参数说明** + +1. COMMENT:表注释。可用于超级表、子表和普通表。最大长度为 1024 个字节。 +2. TTL:Time to Live,是用户用来指定表的生命周期的参数。如果创建表时指定了这个参数,当该表的存在时间超过 TTL 指定的时间后,TDengine 自动删除该表。这个 TTL 的时间只是一个大概时间,系统不保证到了时间一定会将其删除,而只保证存在这样一个机制且最终一定会删除。TTL 单位是天,取值范围为[0, 2147483647],默认为 0,表示不限制,到期时间为表创建时间加上 TTL 时间。TTL 与数据库 KEEP 参数没有关联,如果 KEEP 比 TTL 小,在表被删除之前数据也可能已经被删除。 + ### 增加列 ```sql @@ -136,6 +141,18 @@ ALTER TABLE tb_name MODIFY COLUMN field_name data_type(length); ALTER TABLE tb_name RENAME COLUMN old_col_name new_col_name ``` +### 修改表生命周期 + +```sql +ALTER TABLE tb_name TTL value +``` + +### 修改表注释 + +```sql +ALTER TABLE tb_name COMMENT 'string_value' +``` + ## 修改子表 ```sql @@ -159,12 +176,29 @@ alter_table_option: { 1. 对子表的列和标签的修改,除了更改标签值以外,都要通过超级表才能进行。 +**参数说明** + +1. COMMENT:表注释。可用于超级表、子表和普通表。最大长度为 1024 个字节。 +2. TTL:Time to Live,是用户用来指定表的生命周期的参数。如果创建表时指定了这个参数,当该表的存在时间超过 TTL 指定的时间后,TDengine 自动删除该表。这个 TTL 的时间只是一个大概时间,系统不保证到了时间一定会将其删除,而只保证存在这样一个机制且最终一定会删除。TTL 单位是天,取值范围为[0, 2147483647],默认为 0,表示不限制,到期时间为表创建时间加上 TTL 时间。TTL 与数据库 KEEP 参数没有关联,如果 KEEP 比 TTL 小,在表被删除之前数据也可能已经被删除。 + ### 修改子表标签值 ``` ALTER TABLE tb_name SET TAG tag_name=new_tag_value; ``` +### 修改表生命周期 + +```sql +ALTER TABLE tb_name TTL value +``` + +### 修改表注释 + +```sql +ALTER TABLE tb_name COMMENT 'string_value' +``` + ## 删除表 可以在一条 SQL 语句中删除一个或多个普通表或子表。 diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md index cc057c3b72..38d913dfaf 100644 --- a/docs/zh/12-taos-sql/14-stream.md +++ b/docs/zh/12-taos-sql/14-stream.md @@ -54,8 +54,10 @@ window_clause: { } ``` -其中,SESSION 是会话窗口,tol_val 是时间间隔的最大范围。在 tol_val 时间间隔范围内的数据都属于同一个窗口,如果连续的两条数据的时间超过 tol_val,则自动开启下一个窗口。 +其中,SESSION 是会话窗口,tol_val 是时间间隔的最大范围。在 tol_val 时间间隔范围内的数据都属于同一个窗口,如果连续的两条数据的时间超过 tol_val,则自动开启下一个窗口。该窗口的 _wend 等于最后一条数据的时间加上 tol_val。 + EVENT_WINDOW 是事件窗口,根据开始条件和结束条件来划定窗口。当 start_trigger_condition 满足时则窗口开始,直到 end_trigger_condition 满足时窗口关闭。 start_trigger_condition 和 end_trigger_condition 可以是任意 TDengine 支持的条件表达式,且可以包含不同的列。 + COUNT_WINDOW 是计数窗口,按固定的数据行数来划分窗口。 count_val 是常量,是正整数,必须大于等于2,小于2147483648。 count_val 表示每个 COUNT_WINDOW 包含的最大数据行数,总数据行数不能整除 count_val 时,最后一个窗口的行数会小于 count_val 。 sliding_val 是常量,表示窗口滑动的数量,类似于 INTERVAL 的 SLIDING 。 窗口的定义与时序数据特色查询中的定义完全相同,详见 [TDengine 特色查询](../distinguished) diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md index f59eda1689..4d2454ed5a 100644 --- a/docs/zh/12-taos-sql/20-keywords.md +++ b/docs/zh/12-taos-sql/20-keywords.md @@ -151,7 +151,7 @@ description: TDengine 保留关键字的详细列表 - INTERVAL - INTO - IS -- ISNULL +- IS NULL ### J @@ -197,7 +197,7 @@ description: TDengine 保留关键字的详细列表 - NMATCH - NONE - NOT -- NOTNULL +- NOT NULL - NOW - NULL - NULLS diff --git a/docs/zh/12-taos-sql/25-grant.md b/docs/zh/12-taos-sql/25-grant.md new file mode 100644 index 0000000000..a77a5d6a67 --- /dev/null +++ b/docs/zh/12-taos-sql/25-grant.md @@ -0,0 +1,91 @@ +--- +title: 用户管理 +sidebar_label: 用户管理 +description: 本节讲述基本的用户管理功能 +--- + +用户和权限管理是 TDengine 企业版的功能,本节只讲述基本的用户管理部分。要想了解和获取全面的权限管理功能,请联系 TDengine 销售团队。 + +## 创建用户 + +```sql +CREATE USER user_name PASS 'password' [SYSINFO {1|0}]; +``` + +用户名最长不超过 23 个字节。 + +密码最长不超过 31 个字节。密码可以包含字母、数字以及除单引号、双引号、反引号、反斜杠和空格以外的特殊字符,密码不能为空字符串。 + +`SYSINFO` 表示该用户是否能够查看系统信息。`1` 表示可以查看,`0` 表示无权查看。系统信息包括服务配置、dnode、vnode、存储等信息。缺省值为 `1`。 + +在下面的示例中,我们创建一个密码为 `123456` 且可以查看系统信息的用户。 + +```sql +taos> create user test pass '123456' sysinfo 1; +Query OK, 0 of 0 rows affected (0.001254s) +``` + +## 查看用户 + +可以使用如下命令查看系统中的用户。 + +```sql +SHOW USERS; +``` + +以下是示例: + +```sql +taos> show users; + name | super | enable | sysinfo | createdb | create_time | allowed_host | +========================================================================================================= + test | 0 | 1 | 1 | 0 |2022-08-29 15:10:27.315 | 127.0.0.1 | + root | 1 | 1 | 1 | 1 |2022-08-29 15:03:34.710 | 127.0.0.1 | +Query OK, 2 rows in database (0.001657s) +``` + +或者,可以查询内置系统表 INFORMATION_SCHEMA.INS_USERS 来获取用户信息。 + +```sql +taos> select * from information_schema.ins_users; + name | super | enable | sysinfo | createdb | create_time | allowed_host | +========================================================================================================= + test | 0 | 1 | 1 | 0 |2022-08-29 15:10:27.315 | 127.0.0.1 | + root | 1 | 1 | 1 | 1 |2022-08-29 15:03:34.710 | 127.0.0.1 | +Query OK, 2 rows in database (0.001953s) +``` + +## 删除用户 + +```sql +DROP USER user_name; +``` + +## 修改用户配置 + +```sql +ALTER USER user_name alter_user_clause + +alter_user_clause: { + PASS 'literal' + | ENABLE value + | SYSINFO value + | CREATEDB value +} +``` + +- PASS: 修改密码,后跟新密码 +- ENABLE: 启用或禁用该用户,`1` 表示启用,`0` 表示禁用 +- SYSINFO: 允许或禁止查看系统信息,`1` 表示允许,`0` 表示禁止 +- CREATEDB: 允许或禁止创建数据库,`1` 表示允许,`0` 表示禁止 + +下面的示例禁用了名为 `test` 的用户: + +```sql +taos> alter user test enable 0; +Query OK, 0 of 0 rows affected (0.001160s) +``` + +## 授权管理 + +授权管理仅在 TDengine 企业版中可用,请联系 TDengine 销售团队。 \ No newline at end of file diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md index 6fce985927..effa72099a 100755 --- a/docs/zh/14-reference/12-config/index.md +++ b/docs/zh/14-reference/12-config/index.md @@ -430,7 +430,7 @@ charset 的有效值是 UTF-8。 | 适用范围 | 仅服务端适用 | | 含义 | 设置写入线程的最大数量 | | 取值范围 | 0-1024 | -| 缺省值 | | +| 缺省值 | 4 | ## 日志相关 diff --git a/docs/zh/21-tdinternal/08-compress.md b/docs/zh/21-tdinternal/08-compress.md index 9653a9366b..dfec63c212 100644 --- a/docs/zh/21-tdinternal/08-compress.md +++ b/docs/zh/21-tdinternal/08-compress.md @@ -3,8 +3,6 @@ title: 可配置压缩算法 description: 可配置压缩算法 --- -# 可配置存储压缩 - 从 TDengine 3.3.0.0 版本开始,TDengine 提供了更高级的压缩功能,用户可以在建表时针对每一列配置是否进行压缩、以及使用的压缩算法和压缩级别。 ## 压缩术语定义 @@ -30,16 +28,14 @@ description: 可配置压缩算法 - 各个数据类型的默认压缩算法列表和适用范围 -| 数据类型 | 可选编码算法 | 编码算法默认值 | 可选压缩算法|可选压缩算法| 压缩等级默认值| +| 数据类型 | 可选编码算法 | 编码算法默认值 | 可选压缩算法|压缩算法默认值| 压缩等级默认值| | :-----------:|:----------:|:-------:|:-------:|:----------:|:----:| - tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium| +| tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium| | bigint/ubigint/timestamp | simple8b/delta-i | delta-i |lz4/zlib/zstd/xz | lz4| medium| -|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|tsz| medium| +|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|lz4| medium| |binary/nchar| disabled| disabled|lz4/zlib/zstd/xz| lz4| medium| |bool| bit-packing| bit-packing| lz4/zlib/zstd/xz| lz4| medium| -注意: 针对浮点类型,如果配置为tsz, 其精度由taosd的全局配置决定,如果配置为tsz, 但是没有配置有损压缩标志, 则使用lz4进行压缩 - ## SQL 语法 ### 建表时指定压缩 diff --git a/include/client/taos.h b/include/client/taos.h index a22c8e5138..1d2b3a913c 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -366,7 +366,7 @@ typedef enum { } TSDB_SERVER_STATUS; DLL_EXPORT TSDB_SERVER_STATUS taos_check_server_status(const char *fqdn, int port, char *details, int maxlen); - +DLL_EXPORT char* getBuildInfo(); #ifdef __cplusplus } #endif diff --git a/include/common/systable.h b/include/common/systable.h index 615b0e4656..65b3b36af8 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -40,6 +40,7 @@ extern "C" { #define TSDB_INS_TABLE_COLS "ins_columns" #define TSDB_INS_TABLE_TABLE_DISTRIBUTED "ins_table_distributed" #define TSDB_INS_TABLE_USERS "ins_users" +#define TSDB_INS_TABLE_USERS_FULL "ins_users_full" #define TSDB_INS_TABLE_LICENCES "ins_grants" #define TSDB_INS_TABLE_VGROUPS "ins_vgroups" #define TSDB_INS_TABLE_VNODES "ins_vnodes" diff --git a/include/common/taosdef.h b/include/common/taosdef.h index 9e92e2f569..c6e03dc1d8 100644 --- a/include/common/taosdef.h +++ b/include/common/taosdef.h @@ -30,10 +30,6 @@ typedef int64_t tb_uid_t; #define IS_TSWINDOW_SPECIFIED(win) (((win).skey != INT64_MIN) || ((win).ekey != INT64_MAX)) #define TSWINDOW_IS_EQUAL(t1, t2) (((t1).skey == (t2).skey) && ((t1).ekey == (t2).ekey)) -//define show cluster alive and show db.alive -#define SHOW_STATUS_NOT_AVAILABLE 0 -#define SHOW_STATUS_AVAILABLE 1 -#define SHOW_STATUS_HALF_AVAILABLE 2 typedef enum { TSDB_SUPER_TABLE = 1, // super table diff --git a/include/common/tcommon.h b/include/common/tcommon.h index a5a805ff40..5714990dd5 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -240,7 +240,7 @@ typedef struct SDataBlockInfo { } SDataBlockInfo; typedef struct SSDataBlock { - SColumnDataAgg** pBlockAgg; + SColumnDataAgg* pBlockAgg; SArray* pDataBlock; // SArray SDataBlockInfo info; } SSDataBlock; diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h index 197fa125f5..ec998e9365 100644 --- a/include/common/tdatablock.h +++ b/include/common/tdatablock.h @@ -102,7 +102,7 @@ static FORCE_INLINE bool colDataIsNull(const SColumnInfoData* pColumnInfoData, u return false; } - if (pColAgg != NULL) { + if (pColAgg != NULL && pColAgg->colId != -1) { if (pColAgg->numOfNull == totalRows) { ASSERT(pColumnInfoData->nullbitmap == NULL); return true; @@ -282,6 +282,8 @@ int32_t buildCtbNameByGroupIdImpl(const char* stbName, uint64_t groupId, char* p void trimDataBlock(SSDataBlock* pBlock, int32_t totalRows, const bool* pBoolList); +void copyPkVal(SDataBlockInfo* pDst, const SDataBlockInfo* pSrc); + #ifdef __cplusplus } #endif diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 58dc8fb354..74a2ae4f29 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -87,6 +87,7 @@ extern int32_t tsNumOfQnodeFetchThreads; extern int32_t tsNumOfSnodeStreamThreads; extern int32_t tsNumOfSnodeWriteThreads; extern int64_t tsRpcQueueMemoryAllowed; +extern int32_t tsRetentionSpeedLimitMB; // sync raft extern int32_t tsElectInterval; diff --git a/include/common/tgrant.h b/include/common/tgrant.h index b707045bd1..42adabd6f7 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -28,11 +28,13 @@ extern "C" { #define GRANTS_COL_MAX_LEN 196 #endif -#define GRANT_HEART_BEAT_MIN 2 -#define GRANT_ACTIVE_CODE "activeCode" -#define GRANT_FLAG_ALL (0x01) -#define GRANT_FLAG_AUDIT (0x02) -#define GRANT_FLAG_VIEW (0x04) +#define GRANT_HEART_BEAT_MIN 2 +#define GRANT_EXPIRE_VALUE (31556995201) +#define GRANT_EXPIRE_UNLIMITED(v) ((v) == GRANT_EXPIRE_VALUE) +#define GRANT_ACTIVE_CODE "activeCode" +#define GRANT_FLAG_ALL (0x01) +#define GRANT_FLAG_AUDIT (0x02) +#define GRANT_FLAG_VIEW (0x04) typedef enum { TSDB_GRANT_ALL, diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 4907d2a643..4b3905d34c 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -158,6 +158,7 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_MACHINES, TSDB_MGMT_TABLE_ARBGROUP, TSDB_MGMT_TABLE_ENCRYPTIONS, + TSDB_MGMT_TABLE_USER_FULL, TSDB_MGMT_TABLE_MAX, } EShowType; @@ -362,6 +363,7 @@ typedef enum ENodeType { QUERY_NODE_SHOW_TABLES_STMT, QUERY_NODE_SHOW_TAGS_STMT, QUERY_NODE_SHOW_USERS_STMT, + QUERY_NODE_SHOW_USERS_FULL_STMT, QUERY_NODE_SHOW_LICENCES_STMT, QUERY_NODE_SHOW_VGROUPS_STMT, QUERY_NODE_SHOW_TOPICS_STMT, @@ -1026,6 +1028,8 @@ typedef struct { SIpV4Range* pIpRanges; int32_t sqlLen; char* sql; + int8_t isImport; + int8_t createDb; } SCreateUserReq; int32_t tSerializeSCreateUserReq(void* buf, int32_t bufLen, SCreateUserReq* pReq); @@ -1063,10 +1067,10 @@ typedef struct { int8_t enable; int8_t isView; union { - int8_t flag; + uint8_t flag; struct { - int8_t createdb : 1; - int8_t reserve : 7; + uint8_t createdb : 1; + uint8_t reserve : 7; }; }; char user[TSDB_USER_LEN]; @@ -2127,6 +2131,7 @@ typedef struct { char filterTb[TSDB_TABLE_NAME_LEN]; // for ins_columns int64_t showId; int64_t compactId; // for compact + bool withFull; // for show users full } SRetrieveTableReq; typedef struct SSysTableSchema { @@ -3511,9 +3516,9 @@ typedef struct SVUpdateCheckpointInfoReq { int64_t checkpointVer; int64_t checkpointTs; int32_t transId; - int8_t dropRelHTask; - int64_t hStreamId; + int64_t hStreamId; // add encode/decode int64_t hTaskId; + int8_t dropRelHTask; } SVUpdateCheckpointInfoReq; typedef struct { @@ -3666,10 +3671,6 @@ typedef struct { int32_t taskId; } SVPauseStreamTaskReq, SVResetStreamTaskReq; -typedef struct { - int8_t reserved; -} SVPauseStreamTaskRsp; - typedef struct { char name[TSDB_STREAM_FNAME_LEN]; int8_t igNotExists; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index aff17e5de5..c79e66f2e2 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -225,9 +225,9 @@ TD_DEF_MSG_TYPE(TDMT_MND_RESTORE_DNODE, "restore-dnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_PAUSE_STREAM, "pause-stream", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_RESUME_STREAM, "resume-stream", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHECKPOINT_TIMER, "stream-checkpoint-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_STREAM_UPDATE_CHKPT_EVT, "stream-update-chkpt-evt", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_STREAM_BEGIN_CHECKPOINT, "stream-begin-checkpoint", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHECKPOINT_CANDIDITATE, "stream-checkpoint-remain", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHKPT_REPORT, "stream-chkpt-report", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_STREAM_NODECHANGE_CHECK, "stream-nodechange-check", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_TRIM_DB_TIMER, "trim-db-tmr", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_MND_GRANT_NOTIFY, "grant-notify", NULL, NULL) @@ -390,6 +390,7 @@ TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TASK_RESET, "vnode-stream-reset", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TASK_CHECK, "vnode-stream-task-check", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_UNUSED, "vnd-stream-unused", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_GET_STREAM_PROGRESS, "vnd-stream-progress", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_STREAM_MAX_MSG, "vnd-stream-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_VND_STREAM_MSG) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 9060c145a4..a276329c42 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -50,348 +50,349 @@ #define TK_STATE 32 #define TK_NK_COMMA 33 #define TK_HOST 34 -#define TK_USER 35 -#define TK_ENABLE 36 -#define TK_NK_INTEGER 37 -#define TK_SYSINFO 38 -#define TK_CREATEDB 39 -#define TK_ADD 40 -#define TK_DROP 41 -#define TK_GRANT 42 -#define TK_ON 43 -#define TK_TO 44 -#define TK_REVOKE 45 -#define TK_FROM 46 -#define TK_SUBSCRIBE 47 -#define TK_READ 48 -#define TK_WRITE 49 -#define TK_NK_DOT 50 -#define TK_WITH 51 -#define TK_ENCRYPT_KEY 52 -#define TK_DNODE 53 -#define TK_PORT 54 -#define TK_DNODES 55 -#define TK_RESTORE 56 -#define TK_NK_IPTOKEN 57 -#define TK_FORCE 58 -#define TK_UNSAFE 59 -#define TK_CLUSTER 60 -#define TK_LOCAL 61 -#define TK_QNODE 62 -#define TK_BNODE 63 -#define TK_SNODE 64 -#define TK_MNODE 65 -#define TK_VNODE 66 -#define TK_DATABASE 67 -#define TK_USE 68 -#define TK_FLUSH 69 -#define TK_TRIM 70 -#define TK_S3MIGRATE 71 -#define TK_COMPACT 72 -#define TK_IF 73 -#define TK_NOT 74 -#define TK_EXISTS 75 -#define TK_BUFFER 76 -#define TK_CACHEMODEL 77 -#define TK_CACHESIZE 78 -#define TK_COMP 79 -#define TK_DURATION 80 -#define TK_NK_VARIABLE 81 -#define TK_MAXROWS 82 -#define TK_MINROWS 83 -#define TK_KEEP 84 -#define TK_PAGES 85 -#define TK_PAGESIZE 86 -#define TK_TSDB_PAGESIZE 87 -#define TK_PRECISION 88 -#define TK_REPLICA 89 -#define TK_VGROUPS 90 -#define TK_SINGLE_STABLE 91 -#define TK_RETENTIONS 92 -#define TK_SCHEMALESS 93 -#define TK_WAL_LEVEL 94 -#define TK_WAL_FSYNC_PERIOD 95 -#define TK_WAL_RETENTION_PERIOD 96 -#define TK_WAL_RETENTION_SIZE 97 -#define TK_WAL_ROLL_PERIOD 98 -#define TK_WAL_SEGMENT_SIZE 99 -#define TK_STT_TRIGGER 100 -#define TK_TABLE_PREFIX 101 -#define TK_TABLE_SUFFIX 102 -#define TK_S3_CHUNKSIZE 103 -#define TK_S3_KEEPLOCAL 104 -#define TK_S3_COMPACT 105 -#define TK_KEEP_TIME_OFFSET 106 -#define TK_ENCRYPT_ALGORITHM 107 -#define TK_NK_COLON 108 -#define TK_BWLIMIT 109 -#define TK_START 110 -#define TK_TIMESTAMP 111 -#define TK_END 112 -#define TK_TABLE 113 -#define TK_NK_LP 114 -#define TK_NK_RP 115 -#define TK_STABLE 116 -#define TK_COLUMN 117 -#define TK_MODIFY 118 -#define TK_RENAME 119 -#define TK_TAG 120 -#define TK_SET 121 -#define TK_NK_EQ 122 -#define TK_USING 123 -#define TK_TAGS 124 -#define TK_BOOL 125 -#define TK_TINYINT 126 -#define TK_SMALLINT 127 -#define TK_INT 128 -#define TK_INTEGER 129 -#define TK_BIGINT 130 -#define TK_FLOAT 131 -#define TK_DOUBLE 132 -#define TK_BINARY 133 -#define TK_NCHAR 134 -#define TK_UNSIGNED 135 -#define TK_JSON 136 -#define TK_VARCHAR 137 -#define TK_MEDIUMBLOB 138 -#define TK_BLOB 139 -#define TK_VARBINARY 140 -#define TK_GEOMETRY 141 -#define TK_DECIMAL 142 -#define TK_COMMENT 143 -#define TK_MAX_DELAY 144 -#define TK_WATERMARK 145 -#define TK_ROLLUP 146 -#define TK_TTL 147 -#define TK_SMA 148 -#define TK_DELETE_MARK 149 -#define TK_FIRST 150 -#define TK_LAST 151 -#define TK_SHOW 152 -#define TK_PRIVILEGES 153 -#define TK_DATABASES 154 -#define TK_TABLES 155 -#define TK_STABLES 156 -#define TK_MNODES 157 -#define TK_QNODES 158 -#define TK_ARBGROUPS 159 -#define TK_FUNCTIONS 160 -#define TK_INDEXES 161 -#define TK_ACCOUNTS 162 -#define TK_APPS 163 -#define TK_CONNECTIONS 164 -#define TK_LICENCES 165 -#define TK_GRANTS 166 -#define TK_FULL 167 -#define TK_LOGS 168 -#define TK_MACHINES 169 -#define TK_ENCRYPTIONS 170 -#define TK_QUERIES 171 -#define TK_SCORES 172 -#define TK_TOPICS 173 -#define TK_VARIABLES 174 -#define TK_BNODES 175 -#define TK_SNODES 176 -#define TK_TRANSACTIONS 177 -#define TK_DISTRIBUTED 178 -#define TK_CONSUMERS 179 -#define TK_SUBSCRIPTIONS 180 -#define TK_VNODES 181 -#define TK_ALIVE 182 -#define TK_VIEWS 183 -#define TK_VIEW 184 -#define TK_COMPACTS 185 -#define TK_NORMAL 186 -#define TK_CHILD 187 -#define TK_LIKE 188 -#define TK_TBNAME 189 -#define TK_QTAGS 190 -#define TK_AS 191 -#define TK_SYSTEM 192 -#define TK_TSMA 193 -#define TK_INTERVAL 194 -#define TK_RECURSIVE 195 -#define TK_TSMAS 196 -#define TK_FUNCTION 197 -#define TK_INDEX 198 -#define TK_COUNT 199 -#define TK_LAST_ROW 200 -#define TK_META 201 -#define TK_ONLY 202 -#define TK_TOPIC 203 -#define TK_CONSUMER 204 -#define TK_GROUP 205 -#define TK_DESC 206 -#define TK_DESCRIBE 207 -#define TK_RESET 208 -#define TK_QUERY 209 -#define TK_CACHE 210 -#define TK_EXPLAIN 211 -#define TK_ANALYZE 212 -#define TK_VERBOSE 213 -#define TK_NK_BOOL 214 -#define TK_RATIO 215 -#define TK_NK_FLOAT 216 -#define TK_OUTPUTTYPE 217 -#define TK_AGGREGATE 218 -#define TK_BUFSIZE 219 -#define TK_LANGUAGE 220 -#define TK_REPLACE 221 -#define TK_STREAM 222 -#define TK_INTO 223 -#define TK_PAUSE 224 -#define TK_RESUME 225 -#define TK_PRIMARY 226 -#define TK_KEY 227 -#define TK_TRIGGER 228 -#define TK_AT_ONCE 229 -#define TK_WINDOW_CLOSE 230 -#define TK_IGNORE 231 -#define TK_EXPIRED 232 -#define TK_FILL_HISTORY 233 -#define TK_UPDATE 234 -#define TK_SUBTABLE 235 -#define TK_UNTREATED 236 -#define TK_KILL 237 -#define TK_CONNECTION 238 -#define TK_TRANSACTION 239 -#define TK_BALANCE 240 -#define TK_VGROUP 241 -#define TK_LEADER 242 -#define TK_MERGE 243 -#define TK_REDISTRIBUTE 244 -#define TK_SPLIT 245 -#define TK_DELETE 246 -#define TK_INSERT 247 -#define TK_NK_BIN 248 -#define TK_NK_HEX 249 -#define TK_NULL 250 -#define TK_NK_QUESTION 251 -#define TK_NK_ALIAS 252 -#define TK_NK_ARROW 253 -#define TK_ROWTS 254 -#define TK_QSTART 255 -#define TK_QEND 256 -#define TK_QDURATION 257 -#define TK_WSTART 258 -#define TK_WEND 259 -#define TK_WDURATION 260 -#define TK_IROWTS 261 -#define TK_ISFILLED 262 -#define TK_CAST 263 -#define TK_NOW 264 -#define TK_TODAY 265 -#define TK_TIMEZONE 266 -#define TK_CLIENT_VERSION 267 -#define TK_SERVER_VERSION 268 -#define TK_SERVER_STATUS 269 -#define TK_CURRENT_USER 270 -#define TK_CASE 271 -#define TK_WHEN 272 -#define TK_THEN 273 -#define TK_ELSE 274 -#define TK_BETWEEN 275 -#define TK_IS 276 -#define TK_NK_LT 277 -#define TK_NK_GT 278 -#define TK_NK_LE 279 -#define TK_NK_GE 280 -#define TK_NK_NE 281 -#define TK_MATCH 282 -#define TK_NMATCH 283 -#define TK_CONTAINS 284 -#define TK_IN 285 -#define TK_JOIN 286 -#define TK_INNER 287 -#define TK_LEFT 288 -#define TK_RIGHT 289 -#define TK_OUTER 290 -#define TK_SEMI 291 -#define TK_ANTI 292 -#define TK_ASOF 293 -#define TK_WINDOW 294 -#define TK_WINDOW_OFFSET 295 -#define TK_JLIMIT 296 -#define TK_SELECT 297 -#define TK_NK_HINT 298 -#define TK_DISTINCT 299 -#define TK_WHERE 300 -#define TK_PARTITION 301 -#define TK_BY 302 -#define TK_SESSION 303 -#define TK_STATE_WINDOW 304 -#define TK_EVENT_WINDOW 305 -#define TK_COUNT_WINDOW 306 -#define TK_SLIDING 307 -#define TK_FILL 308 -#define TK_VALUE 309 -#define TK_VALUE_F 310 -#define TK_NONE 311 -#define TK_PREV 312 -#define TK_NULL_F 313 -#define TK_LINEAR 314 -#define TK_NEXT 315 -#define TK_HAVING 316 -#define TK_RANGE 317 -#define TK_EVERY 318 -#define TK_ORDER 319 -#define TK_SLIMIT 320 -#define TK_SOFFSET 321 -#define TK_LIMIT 322 -#define TK_OFFSET 323 -#define TK_ASC 324 -#define TK_NULLS 325 -#define TK_ABORT 326 -#define TK_AFTER 327 -#define TK_ATTACH 328 -#define TK_BEFORE 329 -#define TK_BEGIN 330 -#define TK_BITAND 331 -#define TK_BITNOT 332 -#define TK_BITOR 333 -#define TK_BLOCKS 334 -#define TK_CHANGE 335 -#define TK_COMMA 336 -#define TK_CONCAT 337 -#define TK_CONFLICT 338 -#define TK_COPY 339 -#define TK_DEFERRED 340 -#define TK_DELIMITERS 341 -#define TK_DETACH 342 -#define TK_DIVIDE 343 -#define TK_DOT 344 -#define TK_EACH 345 -#define TK_FAIL 346 -#define TK_FILE 347 -#define TK_FOR 348 -#define TK_GLOB 349 -#define TK_ID 350 -#define TK_IMMEDIATE 351 -#define TK_IMPORT 352 -#define TK_INITIALLY 353 -#define TK_INSTEAD 354 -#define TK_ISNULL 355 -#define TK_MODULES 356 -#define TK_NK_BITNOT 357 -#define TK_NK_SEMI 358 -#define TK_NOTNULL 359 -#define TK_OF 360 -#define TK_PLUS 361 -#define TK_PRIVILEGE 362 -#define TK_RAISE 363 -#define TK_RESTRICT 364 -#define TK_ROW 365 -#define TK_STAR 366 -#define TK_STATEMENT 367 -#define TK_STRICT 368 -#define TK_STRING 369 -#define TK_TIMES 370 -#define TK_VALUES 371 -#define TK_VARIABLE 372 -#define TK_WAL 373 -#define TK_ENCODE 374 -#define TK_COMPRESS 375 -#define TK_LEVEL 376 +#define TK_IS_IMPORT 35 +#define TK_NK_INTEGER 36 +#define TK_CREATEDB 37 +#define TK_USER 38 +#define TK_ENABLE 39 +#define TK_SYSINFO 40 +#define TK_ADD 41 +#define TK_DROP 42 +#define TK_GRANT 43 +#define TK_ON 44 +#define TK_TO 45 +#define TK_REVOKE 46 +#define TK_FROM 47 +#define TK_SUBSCRIBE 48 +#define TK_READ 49 +#define TK_WRITE 50 +#define TK_NK_DOT 51 +#define TK_WITH 52 +#define TK_ENCRYPT_KEY 53 +#define TK_DNODE 54 +#define TK_PORT 55 +#define TK_DNODES 56 +#define TK_RESTORE 57 +#define TK_NK_IPTOKEN 58 +#define TK_FORCE 59 +#define TK_UNSAFE 60 +#define TK_CLUSTER 61 +#define TK_LOCAL 62 +#define TK_QNODE 63 +#define TK_BNODE 64 +#define TK_SNODE 65 +#define TK_MNODE 66 +#define TK_VNODE 67 +#define TK_DATABASE 68 +#define TK_USE 69 +#define TK_FLUSH 70 +#define TK_TRIM 71 +#define TK_S3MIGRATE 72 +#define TK_COMPACT 73 +#define TK_IF 74 +#define TK_NOT 75 +#define TK_EXISTS 76 +#define TK_BUFFER 77 +#define TK_CACHEMODEL 78 +#define TK_CACHESIZE 79 +#define TK_COMP 80 +#define TK_DURATION 81 +#define TK_NK_VARIABLE 82 +#define TK_MAXROWS 83 +#define TK_MINROWS 84 +#define TK_KEEP 85 +#define TK_PAGES 86 +#define TK_PAGESIZE 87 +#define TK_TSDB_PAGESIZE 88 +#define TK_PRECISION 89 +#define TK_REPLICA 90 +#define TK_VGROUPS 91 +#define TK_SINGLE_STABLE 92 +#define TK_RETENTIONS 93 +#define TK_SCHEMALESS 94 +#define TK_WAL_LEVEL 95 +#define TK_WAL_FSYNC_PERIOD 96 +#define TK_WAL_RETENTION_PERIOD 97 +#define TK_WAL_RETENTION_SIZE 98 +#define TK_WAL_ROLL_PERIOD 99 +#define TK_WAL_SEGMENT_SIZE 100 +#define TK_STT_TRIGGER 101 +#define TK_TABLE_PREFIX 102 +#define TK_TABLE_SUFFIX 103 +#define TK_S3_CHUNKSIZE 104 +#define TK_S3_KEEPLOCAL 105 +#define TK_S3_COMPACT 106 +#define TK_KEEP_TIME_OFFSET 107 +#define TK_ENCRYPT_ALGORITHM 108 +#define TK_NK_COLON 109 +#define TK_BWLIMIT 110 +#define TK_START 111 +#define TK_TIMESTAMP 112 +#define TK_END 113 +#define TK_TABLE 114 +#define TK_NK_LP 115 +#define TK_NK_RP 116 +#define TK_STABLE 117 +#define TK_COLUMN 118 +#define TK_MODIFY 119 +#define TK_RENAME 120 +#define TK_TAG 121 +#define TK_SET 122 +#define TK_NK_EQ 123 +#define TK_USING 124 +#define TK_TAGS 125 +#define TK_BOOL 126 +#define TK_TINYINT 127 +#define TK_SMALLINT 128 +#define TK_INT 129 +#define TK_INTEGER 130 +#define TK_BIGINT 131 +#define TK_FLOAT 132 +#define TK_DOUBLE 133 +#define TK_BINARY 134 +#define TK_NCHAR 135 +#define TK_UNSIGNED 136 +#define TK_JSON 137 +#define TK_VARCHAR 138 +#define TK_MEDIUMBLOB 139 +#define TK_BLOB 140 +#define TK_VARBINARY 141 +#define TK_GEOMETRY 142 +#define TK_DECIMAL 143 +#define TK_COMMENT 144 +#define TK_MAX_DELAY 145 +#define TK_WATERMARK 146 +#define TK_ROLLUP 147 +#define TK_TTL 148 +#define TK_SMA 149 +#define TK_DELETE_MARK 150 +#define TK_FIRST 151 +#define TK_LAST 152 +#define TK_SHOW 153 +#define TK_FULL 154 +#define TK_PRIVILEGES 155 +#define TK_DATABASES 156 +#define TK_TABLES 157 +#define TK_STABLES 158 +#define TK_MNODES 159 +#define TK_QNODES 160 +#define TK_ARBGROUPS 161 +#define TK_FUNCTIONS 162 +#define TK_INDEXES 163 +#define TK_ACCOUNTS 164 +#define TK_APPS 165 +#define TK_CONNECTIONS 166 +#define TK_LICENCES 167 +#define TK_GRANTS 168 +#define TK_LOGS 169 +#define TK_MACHINES 170 +#define TK_ENCRYPTIONS 171 +#define TK_QUERIES 172 +#define TK_SCORES 173 +#define TK_TOPICS 174 +#define TK_VARIABLES 175 +#define TK_BNODES 176 +#define TK_SNODES 177 +#define TK_TRANSACTIONS 178 +#define TK_DISTRIBUTED 179 +#define TK_CONSUMERS 180 +#define TK_SUBSCRIPTIONS 181 +#define TK_VNODES 182 +#define TK_ALIVE 183 +#define TK_VIEWS 184 +#define TK_VIEW 185 +#define TK_COMPACTS 186 +#define TK_NORMAL 187 +#define TK_CHILD 188 +#define TK_LIKE 189 +#define TK_TBNAME 190 +#define TK_QTAGS 191 +#define TK_AS 192 +#define TK_SYSTEM 193 +#define TK_TSMA 194 +#define TK_INTERVAL 195 +#define TK_RECURSIVE 196 +#define TK_TSMAS 197 +#define TK_FUNCTION 198 +#define TK_INDEX 199 +#define TK_COUNT 200 +#define TK_LAST_ROW 201 +#define TK_META 202 +#define TK_ONLY 203 +#define TK_TOPIC 204 +#define TK_CONSUMER 205 +#define TK_GROUP 206 +#define TK_DESC 207 +#define TK_DESCRIBE 208 +#define TK_RESET 209 +#define TK_QUERY 210 +#define TK_CACHE 211 +#define TK_EXPLAIN 212 +#define TK_ANALYZE 213 +#define TK_VERBOSE 214 +#define TK_NK_BOOL 215 +#define TK_RATIO 216 +#define TK_NK_FLOAT 217 +#define TK_OUTPUTTYPE 218 +#define TK_AGGREGATE 219 +#define TK_BUFSIZE 220 +#define TK_LANGUAGE 221 +#define TK_REPLACE 222 +#define TK_STREAM 223 +#define TK_INTO 224 +#define TK_PAUSE 225 +#define TK_RESUME 226 +#define TK_PRIMARY 227 +#define TK_KEY 228 +#define TK_TRIGGER 229 +#define TK_AT_ONCE 230 +#define TK_WINDOW_CLOSE 231 +#define TK_IGNORE 232 +#define TK_EXPIRED 233 +#define TK_FILL_HISTORY 234 +#define TK_UPDATE 235 +#define TK_SUBTABLE 236 +#define TK_UNTREATED 237 +#define TK_KILL 238 +#define TK_CONNECTION 239 +#define TK_TRANSACTION 240 +#define TK_BALANCE 241 +#define TK_VGROUP 242 +#define TK_LEADER 243 +#define TK_MERGE 244 +#define TK_REDISTRIBUTE 245 +#define TK_SPLIT 246 +#define TK_DELETE 247 +#define TK_INSERT 248 +#define TK_NK_BIN 249 +#define TK_NK_HEX 250 +#define TK_NULL 251 +#define TK_NK_QUESTION 252 +#define TK_NK_ALIAS 253 +#define TK_NK_ARROW 254 +#define TK_ROWTS 255 +#define TK_QSTART 256 +#define TK_QEND 257 +#define TK_QDURATION 258 +#define TK_WSTART 259 +#define TK_WEND 260 +#define TK_WDURATION 261 +#define TK_IROWTS 262 +#define TK_ISFILLED 263 +#define TK_CAST 264 +#define TK_NOW 265 +#define TK_TODAY 266 +#define TK_TIMEZONE 267 +#define TK_CLIENT_VERSION 268 +#define TK_SERVER_VERSION 269 +#define TK_SERVER_STATUS 270 +#define TK_CURRENT_USER 271 +#define TK_CASE 272 +#define TK_WHEN 273 +#define TK_THEN 274 +#define TK_ELSE 275 +#define TK_BETWEEN 276 +#define TK_IS 277 +#define TK_NK_LT 278 +#define TK_NK_GT 279 +#define TK_NK_LE 280 +#define TK_NK_GE 281 +#define TK_NK_NE 282 +#define TK_MATCH 283 +#define TK_NMATCH 284 +#define TK_CONTAINS 285 +#define TK_IN 286 +#define TK_JOIN 287 +#define TK_INNER 288 +#define TK_LEFT 289 +#define TK_RIGHT 290 +#define TK_OUTER 291 +#define TK_SEMI 292 +#define TK_ANTI 293 +#define TK_ASOF 294 +#define TK_WINDOW 295 +#define TK_WINDOW_OFFSET 296 +#define TK_JLIMIT 297 +#define TK_SELECT 298 +#define TK_NK_HINT 299 +#define TK_DISTINCT 300 +#define TK_WHERE 301 +#define TK_PARTITION 302 +#define TK_BY 303 +#define TK_SESSION 304 +#define TK_STATE_WINDOW 305 +#define TK_EVENT_WINDOW 306 +#define TK_COUNT_WINDOW 307 +#define TK_SLIDING 308 +#define TK_FILL 309 +#define TK_VALUE 310 +#define TK_VALUE_F 311 +#define TK_NONE 312 +#define TK_PREV 313 +#define TK_NULL_F 314 +#define TK_LINEAR 315 +#define TK_NEXT 316 +#define TK_HAVING 317 +#define TK_RANGE 318 +#define TK_EVERY 319 +#define TK_ORDER 320 +#define TK_SLIMIT 321 +#define TK_SOFFSET 322 +#define TK_LIMIT 323 +#define TK_OFFSET 324 +#define TK_ASC 325 +#define TK_NULLS 326 +#define TK_ABORT 327 +#define TK_AFTER 328 +#define TK_ATTACH 329 +#define TK_BEFORE 330 +#define TK_BEGIN 331 +#define TK_BITAND 332 +#define TK_BITNOT 333 +#define TK_BITOR 334 +#define TK_BLOCKS 335 +#define TK_CHANGE 336 +#define TK_COMMA 337 +#define TK_CONCAT 338 +#define TK_CONFLICT 339 +#define TK_COPY 340 +#define TK_DEFERRED 341 +#define TK_DELIMITERS 342 +#define TK_DETACH 343 +#define TK_DIVIDE 344 +#define TK_DOT 345 +#define TK_EACH 346 +#define TK_FAIL 347 +#define TK_FILE 348 +#define TK_FOR 349 +#define TK_GLOB 350 +#define TK_ID 351 +#define TK_IMMEDIATE 352 +#define TK_IMPORT 353 +#define TK_INITIALLY 354 +#define TK_INSTEAD 355 +#define TK_ISNULL 356 +#define TK_MODULES 357 +#define TK_NK_BITNOT 358 +#define TK_NK_SEMI 359 +#define TK_NOTNULL 360 +#define TK_OF 361 +#define TK_PLUS 362 +#define TK_PRIVILEGE 363 +#define TK_RAISE 364 +#define TK_RESTRICT 365 +#define TK_ROW 366 +#define TK_STAR 367 +#define TK_STATEMENT 368 +#define TK_STRICT 369 +#define TK_STRING 370 +#define TK_TIMES 371 +#define TK_VALUES 372 +#define TK_VARIABLE 373 +#define TK_WAL 374 +#define TK_ENCODE 375 +#define TK_COMPRESS 376 +#define TK_LEVEL 377 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/dnode/vnode/tqCommon.h b/include/dnode/vnode/tqCommon.h index 0076d79312..f0ab2a0e95 100644 --- a/include/dnode/vnode/tqCommon.h +++ b/include/dnode/vnode/tqCommon.h @@ -28,6 +28,7 @@ int32_t tqStreamTaskProcessCheckRsp(SStreamMeta* pMeta, SRpcMsg* pMsg, bool isLe int32_t tqStreamTaskProcessCheckpointReadyMsg(SStreamMeta* pMeta, SRpcMsg* pMsg); int32_t tqStreamProcessStreamHbRsp(SStreamMeta* pMeta, SRpcMsg* pMsg); int32_t tqStreamProcessReqCheckpointRsp(SStreamMeta* pMeta, SRpcMsg* pMsg); +int32_t tqStreamProcessChkptReportRsp(SStreamMeta* pMeta, SRpcMsg* pMsg); int32_t tqStreamProcessCheckpointReadyRsp(SStreamMeta* pMeta, SRpcMsg* pMsg); int32_t tqStreamTaskProcessDeployReq(SStreamMeta* pMeta, SMsgCb* cb, int64_t sversion, char* msg, int32_t msgLen, bool isLeader, bool restored); @@ -42,7 +43,7 @@ int32_t tqStreamTaskProcessTaskPauseReq(SStreamMeta* pMeta, char* pMsg); int32_t tqStreamTaskProcessTaskResumeReq(void* handle, int64_t sversion, char* pMsg, bool fromVnode); int32_t tqStreamTaskProcessUpdateCheckpointReq(SStreamMeta* pMeta, char* msg, int32_t msgLen); -int32_t tqExpandStreamTask(SStreamTask* pTask, SStreamMeta* pMeta); void tqSetRestoreVersionInfo(SStreamTask* pTask); +int32_t tqExpandStreamTask(SStreamTask* pTask); #endif // TDENGINE_TQ_COMMON_H diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h index 330ba31c65..45f9f73fb1 100644 --- a/include/libs/executor/storageapi.h +++ b/include/libs/executor/storageapi.h @@ -329,7 +329,7 @@ typedef struct { typedef struct SStateStore { int32_t (*streamStatePutParName)(SStreamState* pState, int64_t groupId, const char* tbname); - int32_t (*streamStateGetParName)(SStreamState* pState, int64_t groupId, void** pVal); + int32_t (*streamStateGetParName)(SStreamState* pState, int64_t groupId, void** pVal, bool onlyCache); int32_t (*streamStateAddIfNotExist)(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t (*streamStateReleaseBuf)(SStreamState* pState, void* pVal, bool used); @@ -410,7 +410,7 @@ typedef struct SStateStore { void (*streamFileStateClear)(struct SStreamFileState* pFileState); bool (*needClearDiskBuff)(struct SStreamFileState* pFileState); - SStreamState* (*streamStateOpen)(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages); + SStreamState* (*streamStateOpen)(const char* path, void* pTask, int64_t streamId, int32_t taskId); void (*streamStateClose)(SStreamState* pState, bool remove); int32_t (*streamStateBegin)(SStreamState* pState); int32_t (*streamStateCommit)(SStreamState* pState); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 112411d524..e2337dc6da 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -258,6 +258,8 @@ typedef struct SCreateUserStmt { char userName[TSDB_USER_LEN]; char password[TSDB_USET_PASSWORD_LEN]; int8_t sysinfo; + int8_t createDb; + int8_t isImport; int32_t numIpRanges; SIpV4Range* pIpRanges; @@ -311,6 +313,7 @@ typedef struct SShowStmt { SNode* pTbName; // SValueNode EOperatorType tableCondType; EShowKind showKind; // show databases: user/system, show tables: normal/child, others NULL + bool withFull; // for show users full; } SShowStmt; typedef struct SShowCreateDatabaseStmt { diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index befd6afce9..457937835d 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -628,6 +628,7 @@ char* nodesGetStrValueFromNode(SValueNode* pNode); void nodesValueNodeToVariant(const SValueNode* pNode, SVariant* pVal); SValueNode* nodesMakeValueNodeFromString(char* literal); SValueNode* nodesMakeValueNodeFromBool(bool b); +SNode* nodesMakeValueNodeFromInt32(int32_t value); char* nodesGetFillModeString(EFillMode mode); int32_t nodesMergeConds(SNode** pDst, SNodeList** pSrc); diff --git a/include/libs/scalar/filter.h b/include/libs/scalar/filter.h index c1ce1e6fd8..750179ee3b 100644 --- a/include/libs/scalar/filter.h +++ b/include/libs/scalar/filter.h @@ -58,7 +58,7 @@ extern int32_t filterGetTimeRange(SNode *pNode, STimeWindow *win, bool *isStrict extern int32_t filterConverNcharColumns(SFilterInfo *pFilterInfo, int32_t rows, bool *gotNchar); extern int32_t filterFreeNcharColumns(SFilterInfo *pFilterInfo); extern void filterFreeInfo(SFilterInfo *info); -extern bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pColsAgg, int32_t numOfCols, int32_t numOfRows); +extern bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pColsAgg, int32_t numOfCols, int32_t numOfRows); /* condition split interface */ int32_t filterPartitionCond(SNode **pCondition, SNode **pPrimaryKeyCond, SNode **pTagIndexCond, SNode **pTagCond, diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h index ae5a733ae9..5768160fdb 100644 --- a/include/libs/stream/streamState.h +++ b/include/libs/stream/streamState.h @@ -29,7 +29,7 @@ extern "C" { #include "storageapi.h" -SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages); +SStreamState* streamStateOpen(const char* path, void* pTask, int64_t streamId, int32_t taskId); void streamStateClose(SStreamState* pState, bool remove); int32_t streamStateBegin(SStreamState* pState); int32_t streamStateCommit(SStreamState* pState); @@ -101,7 +101,7 @@ int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char* tbname); -int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal); +int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal, bool onlyCache); void streamStateReloadInfo(SStreamState* pState, TSKEY ts); diff --git a/include/libs/stream/streammsg.h b/include/libs/stream/streammsg.h index 91bfc6afc8..723c9fd099 100644 --- a/include/libs/stream/streammsg.h +++ b/include/libs/stream/streammsg.h @@ -190,6 +190,20 @@ typedef struct SCheckpointTriggerRsp { int32_t rspCode; } SCheckpointTriggerRsp; +typedef struct SCheckpointReport { + int64_t streamId; + int32_t taskId; + int32_t nodeId; + int64_t checkpointId; + int64_t checkpointVer; + int64_t checkpointTs; + int32_t transId; + int8_t dropHTask; +} SCheckpointReport; + +int32_t tEncodeStreamTaskChkptReport(SEncoder* pEncoder, const SCheckpointReport* pReq); +int32_t tDecodeStreamTaskChkptReport(SDecoder* pDecoder, SCheckpointReport* pReq); + typedef struct { SMsgHead head; int64_t streamId; diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index d07a302920..03c42e5c7e 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -157,7 +157,8 @@ typedef enum EStreamTaskEvent { typedef void FTbSink(SStreamTask* pTask, void* vnode, void* data); typedef void FSmaSink(void* vnode, int64_t smaId, const SArray* data); -typedef int32_t FTaskExpand(void* ahandle, SStreamTask* pTask, int64_t ver); +typedef int32_t FTaskBuild(void* ahandle, SStreamTask* pTask, int64_t ver); +typedef int32_t FTaskExpand(SStreamTask* pTask); typedef struct { int8_t type; @@ -205,7 +206,6 @@ typedef struct { typedef struct { char stbFullName[TSDB_TABLE_FNAME_LEN]; - int32_t waitingRspCnt; SUseDbRsp dbInfo; } STaskDispatcherShuffle; @@ -312,15 +312,18 @@ typedef struct SMetaHbInfo SMetaHbInfo; typedef struct SDispatchMsgInfo { SStreamDispatchReq* pData; // current dispatch data - int8_t dispatchMsgType; - int64_t checkpointId;// checkpoint id msg - int32_t transId; // transId for current checkpoint - int16_t msgType; // dispatch msg type - int32_t retryCount; // retry send data count - int64_t startTs; // dispatch start time, record total elapsed time for dispatch - SArray* pRetryList; // current dispatch successfully completed node of downstream - void* pRetryTmr; // used to dispatch data after a given time duration - void* pRspTmr; // used to dispatch data after a given time duration + + int8_t dispatchMsgType; + int64_t checkpointId; // checkpoint id msg + int32_t transId; // transId for current checkpoint + int16_t msgType; // dispatch msg type + int32_t msgId; + int64_t startTs; // dispatch start time, record total elapsed time for dispatch + int64_t rspTs; // latest rsp time + void* pRetryTmr; // used to dispatch data after a given time duration + TdThreadMutex lock; + int8_t inMonitor; + SArray* pSendInfo; // SArray } SDispatchMsgInfo; typedef struct STaskQueue { @@ -484,7 +487,8 @@ typedef struct SStreamMeta { SArray* pTaskList; // SArray void* ahandle; TXN* txn; - FTaskExpand* expandFunc; + FTaskBuild* buildTaskFn; + FTaskExpand* expandTaskFn; int32_t vgId; int64_t stage; int32_t role; @@ -708,8 +712,8 @@ SScanhistoryDataInfo streamScanHistoryData(SStreamTask* pTask, int64_t st); // stream task meta void streamMetaInit(); void streamMetaCleanup(); -SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc, int32_t vgId, int64_t stage, - startComplete_fn_t fn); +SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskBuild expandFunc, FTaskExpand expandTaskFn, + int32_t vgId, int64_t stage, startComplete_fn_t fn); void streamMetaClose(SStreamMeta* streamMeta); int32_t streamMetaSaveTask(SStreamMeta* pMeta, SStreamTask* pTask); // save to stream meta store int32_t streamMetaRemoveTask(SStreamMeta* pMeta, STaskId* pKey); @@ -734,6 +738,9 @@ int32_t streamMetaAddFailedTask(SStreamMeta* pMeta, int64_t streamId, int32 void streamMetaAddFailedTaskSelf(SStreamTask* pTask, int64_t failedTs); void streamMetaAddIntoUpdateTaskList(SStreamMeta* pMeta, SStreamTask* pTask, SStreamTask* pHTask, int32_t transId, int64_t startTs); +void streamMetaClearUpdateTaskList(SStreamMeta* pMeta); +void streamMetaInitUpdateTaskList(SStreamMeta* pMeta, int32_t transId); + void streamMetaRLock(SStreamMeta* pMeta); void streamMetaRUnLock(SStreamMeta* pMeta); void streamMetaWLock(SStreamMeta* pMeta); @@ -762,8 +769,7 @@ int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskI int32_t streamAddCheckpointSourceRspMsg(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SStreamTask* pTask); int32_t streamTaskBuildCheckpointSourceRsp(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SRpcMsg* pMsg, int32_t setCode); -int32_t streamBuildAndSendCheckpointUpdateMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, STaskId* pHTaskId, - SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask); +int32_t streamSendChkptReportMsg(SStreamTask* pTask, SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask); int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpointInfoReq* pReq); SActiveCheckpointInfo* streamTaskCreateActiveChkptInfo(); diff --git a/include/libs/wal/wal.h b/include/libs/wal/wal.h index 7f779609eb..155da9d116 100644 --- a/include/libs/wal/wal.h +++ b/include/libs/wal/wal.h @@ -60,6 +60,7 @@ typedef struct { EWalType level; // wal level int32_t encryptAlgorithm; char encryptKey[ENCRYPT_KEY_LEN + 1]; + int8_t clearFiles; } SWalCfg; typedef struct { diff --git a/include/os/osEnv.h b/include/os/osEnv.h index ac4ecd4212..4f4a58d4e8 100644 --- a/include/os/osEnv.h +++ b/include/os/osEnv.h @@ -37,11 +37,12 @@ extern float tsNumOfCores; extern int64_t tsTotalMemoryKB; extern char *tsProcPath; extern char tsSIMDEnable; -extern char tsSSE42Enable; -extern char tsAVXEnable; -extern char tsAVX2Enable; -extern char tsFMAEnable; -extern char tsAVX512Enable; +extern char tsSSE42Supported; +extern char tsAVXSupported; +extern char tsAVX2Supported; +extern char tsFMASupported; +extern char tsAVX512Supported; +extern char tsAVX512Enable; extern char tsTagFilterCache; extern char configDir[]; diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 8f8434dfc1..6dc9b46db5 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -24,6 +24,14 @@ extern "C" { // clang-format off +typedef struct { + int32_t val; + const char* str; + const char* macro; +} STaosError; + +extern STaosError errors[]; + #define TAOS_DEF_ERROR_CODE(mod, code) ((int32_t)((0x80000000 | ((mod)<<16) | (code)))) #define TAOS_SYSTEM_ERROR(code) (0x80ff0000 | (code)) @@ -38,6 +46,7 @@ const char* terrstr(); char* taosGetErrMsgReturn(); char* taosGetErrMsg(); int32_t* taosGetErrno(); +int32_t taosGetErrSize(); #define terrno (*taosGetErrno()) #define terrMsg (taosGetErrMsg()) @@ -316,7 +325,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_DB_OPTION_UNCHANGED TAOS_DEF_ERROR_CODE(0, 0x038A) // #define TSDB_CODE_MND_DB_INDEX_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x038B) #define TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO TAOS_DEF_ERROR_CODE(0, 0x038C) -#define TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038D) +// #define TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038D) // unused #define TSDB_CODE_MND_INVALID_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038E) // #define TSDB_CODE_MND_INVALID_DB_OPTION_DAYS TAOS_DEF_ERROR_CODE(0, 0x0390) // 2.x // #define TSDB_CODE_MND_INVALID_DB_OPTION_KEEP TAOS_DEF_ERROR_CODE(0, 0x0391) // 2.x @@ -327,6 +336,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_DB_IN_CREATING TAOS_DEF_ERROR_CODE(0, 0x0396) // #define TSDB_CODE_MND_INVALID_SYS_TABLENAME TAOS_DEF_ERROR_CODE(0, 0x039A) #define TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE TAOS_DEF_ERROR_CODE(0, 0x039B) +#define TSDB_CODE_MND_INVALID_WAL_LEVEL TAOS_DEF_ERROR_CODE(0, 0x039C) // mnode-node #define TSDB_CODE_MND_MNODE_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A0) diff --git a/include/util/tdef.h b/include/util/tdef.h index 905a50886a..9e61ec8fe6 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -549,6 +549,7 @@ typedef struct { char dir[TSDB_FILENAME_LEN]; int32_t level; int32_t primary; + int8_t disable; // disable create new file } SDiskCfg; typedef struct { diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 5a83cdc6a8..03e0a0b5f5 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -795,10 +795,10 @@ function is_version_compatible() { if [ -f ${script_dir}/driver/vercomp.txt ]; then min_compatible_version=$(cat ${script_dir}/driver/vercomp.txt) else - min_compatible_version=$(${script_dir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 5) + min_compatible_version=$(${script_dir}/bin/${serverName} -V | grep version | head -1 | cut -d ' ' -f 5) fi - exist_version=$(${installDir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 3) + exist_version=$(${installDir}/bin/${serverName} -V | grep version | head -1 | cut -d ' ' -f 3) vercomp $exist_version "3.0.0.0" case $? in 2) diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index d808f32403..b588615945 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -134,14 +134,15 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat if (pTscObj->whiteListInfo.fp) { SWhiteListInfo *whiteListInfo = &pTscObj->whiteListInfo; - int64_t oldVer = atomic_load_64(&whiteListInfo->ver); - if (oldVer < pRsp->whiteListVer) { + int64_t oldVer = atomic_load_64(&whiteListInfo->ver); + + if (oldVer < pRsp->whiteListVer || pRsp->whiteListVer == 0) { atomic_store_64(&whiteListInfo->ver, pRsp->whiteListVer); if (whiteListInfo->fp) { (*whiteListInfo->fp)(whiteListInfo->param, &pRsp->whiteListVer, TAOS_NOTIFY_WHITELIST_VER); } - tscDebug("update whitelist version of user %s from %"PRId64" to %"PRId64", tscRid:%" PRIi64, pRsp->user, oldVer, - atomic_load_64(&whiteListInfo->ver), pTscObj->id); + tscDebug("update whitelist version of user %s from %" PRId64 " to %" PRId64 ", tscRid:%" PRIi64, pRsp->user, + oldVer, atomic_load_64(&whiteListInfo->ver), pTscObj->id); } } releaseTscObj(pReq->connKey.tscRid); @@ -203,8 +204,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog for (int32_t i = 0; i < numOfBatchs; ++i) { SDbHbRsp *rsp = taosArrayGet(batchRsp.pArray, i); if (rsp->useDbRsp) { - tscDebug("hb use db rsp, db:%s, vgVersion:%d, stateTs:%" PRId64 ", uid:%" PRIx64, - rsp->useDbRsp->db, rsp->useDbRsp->vgVersion, rsp->useDbRsp->stateTs, rsp->useDbRsp->uid); + tscDebug("hb use db rsp, db:%s, vgVersion:%d, stateTs:%" PRId64 ", uid:%" PRIx64, rsp->useDbRsp->db, + rsp->useDbRsp->vgVersion, rsp->useDbRsp->stateTs, rsp->useDbRsp->uid); if (rsp->useDbRsp->vgVersion < 0) { tscDebug("hb to remove db, db:%s", rsp->useDbRsp->db); @@ -226,7 +227,9 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog goto _return; } - catalogUpdateDBVgInfo(pCatalog, (rsp->useDbRsp->db[0] == 'i') ? TSDB_PERFORMANCE_SCHEMA_DB : TSDB_INFORMATION_SCHEMA_DB, rsp->useDbRsp->uid, vgInfo); + catalogUpdateDBVgInfo(pCatalog, + (rsp->useDbRsp->db[0] == 'i') ? TSDB_PERFORMANCE_SCHEMA_DB : TSDB_INFORMATION_SCHEMA_DB, + rsp->useDbRsp->uid, vgInfo); } } } @@ -239,7 +242,7 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog if (rsp->pTsmaRsp) { if (rsp->pTsmaRsp->pTsmas) { for (int32_t i = 0; i < rsp->pTsmaRsp->pTsmas->size; ++i) { - STableTSMAInfo* pTsma = taosArrayGetP(rsp->pTsmaRsp->pTsmas, i); + STableTSMAInfo *pTsma = taosArrayGetP(rsp->pTsmaRsp->pTsmas, i); catalogAsyncUpdateTSMA(pCatalog, &pTsma, rsp->dbTsmaVersion); } taosArrayClear(rsp->pTsmaRsp->pTsmas); @@ -295,16 +298,15 @@ static int32_t hbProcessStbInfoRsp(void *value, int32_t valueLen, struct SCatalo return TSDB_CODE_SUCCESS; } - static int32_t hbProcessDynViewRsp(void *value, int32_t valueLen, struct SCatalog *pCatalog) { - return catalogUpdateDynViewVer(pCatalog, (SDynViewVersion*)value); + return catalogUpdateDynViewVer(pCatalog, (SDynViewVersion *)value); } -static void hbFreeSViewMetaInRsp(void* p) { - if (NULL == p || NULL == *(void**)p) { +static void hbFreeSViewMetaInRsp(void *p) { + if (NULL == p || NULL == *(void **)p) { return; } - SViewMetaRsp *pRsp = *(SViewMetaRsp**)p; + SViewMetaRsp *pRsp = *(SViewMetaRsp **)p; tFreeSViewMetaRsp(pRsp); taosMemoryFreeClear(pRsp); } @@ -338,7 +340,7 @@ static int32_t hbProcessViewInfoRsp(void *value, int32_t valueLen, struct SCatal return TSDB_CODE_SUCCESS; } -static int32_t hbprocessTSMARsp(void* value, int32_t valueLen, struct SCatalog* pCatalog) { +static int32_t hbprocessTSMARsp(void *value, int32_t valueLen, struct SCatalog *pCatalog) { int32_t code = 0; STSMAHbRsp hbRsp = {0}; @@ -349,7 +351,7 @@ static int32_t hbprocessTSMARsp(void* value, int32_t valueLen, struct SCatalog* int32_t numOfTsma = taosArrayGetSize(hbRsp.pTsmas); for (int32_t i = 0; i < numOfTsma; ++i) { - STableTSMAInfo* pTsmaInfo = taosArrayGetP(hbRsp.pTsmas, i); + STableTSMAInfo *pTsmaInfo = taosArrayGetP(hbRsp.pTsmas, i); if (!pTsmaInfo->pFuncs) { tscDebug("hb to remove tsma: %s.%s", pTsmaInfo->dbFName, pTsmaInfo->name); @@ -366,7 +368,7 @@ static int32_t hbprocessTSMARsp(void* value, int32_t valueLen, struct SCatalog* return TSDB_CODE_SUCCESS; } -static void hbProcessQueryRspKvs(int32_t kvNum, SArray* pKvs, struct SCatalog *pCatalog, SAppHbMgr *pAppHbMgr) { +static void hbProcessQueryRspKvs(int32_t kvNum, SArray *pKvs, struct SCatalog *pCatalog, SAppHbMgr *pAppHbMgr) { for (int32_t i = 0; i < kvNum; ++i) { SKv *kv = taosArrayGet(pKvs, i); switch (kv->key) { @@ -490,14 +492,14 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) { if (kvNum > 0) { struct SCatalog *pCatalog = NULL; - int32_t code = catalogGetHandle(pReq->clusterId, &pCatalog); + int32_t code = catalogGetHandle(pReq->clusterId, &pCatalog); if (code != TSDB_CODE_SUCCESS) { tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pReq->clusterId, tstrerror(code)); } else { hbProcessQueryRspKvs(kvNum, pRsp->info, pCatalog, pAppHbMgr); } } - + taosHashRelease(pAppHbMgr->activeInfo, pReq); return TSDB_CODE_SUCCESS; @@ -802,8 +804,9 @@ int32_t hbGetExpiredDBInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SCl for (int32_t i = 0; i < dbNum; ++i) { SDbCacheInfo *db = &dbs[i]; - tscDebug("the %dth expired dbFName:%s, dbId:%" PRId64 ", vgVersion:%d, cfgVersion:%d, numOfTable:%d, startTs:%" PRId64, - i, db->dbFName, db->dbId, db->vgVersion, db->cfgVersion, db->numOfTable, db->stateTs); + tscDebug("the %dth expired dbFName:%s, dbId:%" PRId64 + ", vgVersion:%d, cfgVersion:%d, numOfTable:%d, startTs:%" PRId64, + i, db->dbFName, db->dbId, db->vgVersion, db->cfgVersion, db->numOfTable, db->stateTs); db->dbId = htobe64(db->dbId); db->vgVersion = htonl(db->vgVersion); @@ -919,7 +922,7 @@ int32_t hbGetExpiredViewInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, S return TSDB_CODE_SUCCESS; } -int32_t hbGetExpiredTSMAInfo(SClientHbKey* connKey, struct SCatalog* pCatalog, SClientHbReq* pReq) { +int32_t hbGetExpiredTSMAInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SClientHbReq *pReq) { int32_t code = 0; uint32_t tsmaNum = 0; STSMAVersion *tsmas = NULL; @@ -936,7 +939,7 @@ int32_t hbGetExpiredTSMAInfo(SClientHbKey* connKey, struct SCatalog* pCatalog, S } for (int32_t i = 0; i < tsmaNum; ++i) { - STSMAVersion* tsma = &tsmas[i]; + STSMAVersion *tsma = &tsmas[i]; tsma->dbId = htobe64(tsma->dbId); tsma->tsmaId = htobe64(tsma->tsmaId); tsma->version = htonl(tsma->version); @@ -1015,7 +1018,7 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req if (TSDB_CODE_SUCCESS != code) { return code; } -#endif +#endif code = hbGetExpiredTSMAInfo(connKey, pCatalog, req); } else { req->app.appId = 0; @@ -1154,7 +1157,8 @@ static void *hbThreadFunc(void *param) { if (sz > 0) { hbGatherAppInfo(); if (sz > 1 && !clientHbMgr.appHbHash) { - clientHbMgr.appHbHash = taosHashInit(0, taosGetDefaultHashFunction(TSDB_DATA_TYPE_UBIGINT), false, HASH_NO_LOCK); + clientHbMgr.appHbHash = + taosHashInit(0, taosGetDefaultHashFunction(TSDB_DATA_TYPE_UBIGINT), false, HASH_NO_LOCK); } taosHashClear(clientHbMgr.appHbHash); } @@ -1436,6 +1440,4 @@ void hbDeregisterConn(STscObj *pTscObj, SClientHbKey connKey) { } // set heart beat thread quit mode , if quicByKill 1 then kill thread else quit from inner -void taos_set_hb_quit(int8_t quitByKill) { - clientHbMgr.quitByKill = quitByKill; -} +void taos_set_hb_quit(int8_t quitByKill) { clientHbMgr.quitByKill = quitByKill; } diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index ba9493258b..9108cae14a 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -1849,3 +1849,7 @@ int taos_set_conn_mode(TAOS* taos, int mode, int value) { } return 0; } + +char* getBuildInfo(){ + return buildinfo; +} \ No newline at end of file diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp index 1bc1fb2240..c13b95afdd 100644 --- a/source/client/test/clientTests.cpp +++ b/source/client/test/clientTests.cpp @@ -828,12 +828,8 @@ TEST(clientCase, projection_query_tables) { // printf("error in create db, reason:%s\n", taos_errstr(pRes)); // } // taos_free_result(pRes); -/* - TAOS_RES* pRes = taos_query(pConn, "select last(ts), ts from cache_1.t1"); -// pRes = taos_query(pConn, "select last(ts), ts from cache_1.no_pk_t1"); - if (taos_errno(pRes) != 0) { - printf("failed to create table tu, reason:%s\n", taos_errstr(pRes)); - } + + pRes= taos_query(pConn, "use abc1"); taos_free_result(pRes); pRes = taos_query(pConn, "create table tu using st2 tags(2)"); @@ -868,7 +864,6 @@ TEST(clientCase, projection_query_tables) { createNewTable(pConn, i, 100000, 0, pstr); } } -*/ pRes = taos_query(pConn, "select * from abc1.st2"); if (taos_errno(pRes) != 0) { diff --git a/source/common/src/rsync.c b/source/common/src/rsync.c index 2ed21616dc..84e9615ddd 100644 --- a/source/common/src/rsync.c +++ b/source/common/src/rsync.c @@ -169,15 +169,22 @@ int32_t uploadByRsync(const char* id, const char* path) { #else if (path[strlen(path) - 1] != '/') { #endif - snprintf(command, PATH_MAX, "rsync -av --delete --timeout=10 --bwlimit=100000 %s/ rsync://%s/checkpoint/%s/", + snprintf(command, PATH_MAX, + "rsync -av --debug=all --log-file=%s/rsynclog --delete --timeout=10 --bwlimit=100000 %s/ " + "rsync://%s/checkpoint/%s/", + tsLogDir, #ifdef WINDOWS pathTransform #else path #endif - , tsSnodeAddress, id); + , + tsSnodeAddress, id); } else { - snprintf(command, PATH_MAX, "rsync -av --delete --timeout=10 --bwlimit=100000 %s rsync://%s/checkpoint/%s/", + snprintf(command, PATH_MAX, + "rsync -av --debug=all --log-file=%s/rsynclog --delete --timeout=10 --bwlimit=100000 %s " + "rsync://%s/checkpoint/%s/", + tsLogDir, #ifdef WINDOWS pathTransform #else @@ -213,14 +220,15 @@ int32_t downloadRsync(const char* id, const char* path) { #endif char command[PATH_MAX] = {0}; - snprintf(command, PATH_MAX, "rsync -av --debug=all --timeout=10 --bwlimit=100000 rsync://%s/checkpoint/%s/ %s", - tsSnodeAddress, id, + snprintf(command, PATH_MAX, + "rsync -av --debug=all --log-file=%s/rsynclog --timeout=10 --bwlimit=100000 rsync://%s/checkpoint/%s/ %s", + tsLogDir, tsSnodeAddress, id, #ifdef WINDOWS pathTransform #else path #endif - ); + ); uDebug("[rsync] %s start to sync data from remote to:%s, %s", id, path, command); @@ -249,7 +257,9 @@ int32_t deleteRsync(const char* id) { } char command[PATH_MAX] = {0}; - snprintf(command, PATH_MAX, "rsync -av --delete --timeout=10 %s rsync://%s/checkpoint/%s/", tmp, tsSnodeAddress, id); + snprintf(command, PATH_MAX, + "rsync -av --debug=all --log-file=%s/rsynclog --delete --timeout=10 %s rsync://%s/checkpoint/%s/", tsLogDir, + tmp, tsSnodeAddress, id); code = execCommand(command); taosRemoveDir(tmp); diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 6558df1fc1..1693e5c480 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -85,7 +85,7 @@ static const SSysDbTableSchema clusterSchema[] = { {.name = "uptime", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, {.name = "version", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, - {.name = "expire_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, + {.name = "expire_time", .bytes = 19 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; static const SSysDbTableSchema userDBSchema[] = { @@ -269,6 +269,16 @@ static const SSysDbTableSchema userUsersSchema[] = { {.name = "allowed_host", .bytes = TSDB_PRIVILEDGE_HOST_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, }; +static const SSysDbTableSchema userUsersFullSchema[] = { + {.name = "name", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "super", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, + {.name = "enable", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, + {.name = "sysinfo", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, + {.name = "createdb", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, + {.name = "encrypted_pass", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "allowed_host", .bytes = TSDB_PRIVILEDGE_HOST_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +}; + GRANTS_SCHEMA; static const SSysDbTableSchema vgroupsSchema[] = { @@ -438,6 +448,7 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_COLS, userColsSchema, tListLen(userColsSchema), false}, // {TSDB_INS_TABLE_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)}, {TSDB_INS_TABLE_USERS, userUsersSchema, tListLen(userUsersSchema), true}, + {TSDB_INS_TABLE_USERS_FULL, userUsersFullSchema, tListLen(userUsersFullSchema), true}, {TSDB_INS_TABLE_LICENCES, grantsSchema, tListLen(grantsSchema), true}, {TSDB_INS_TABLE_VGROUPS, vgroupsSchema, tListLen(vgroupsSchema), true}, {TSDB_INS_TABLE_CONFIGS, configSchema, tListLen(configSchema), false}, diff --git a/source/common/src/tcol.c b/source/common/src/tcol.c index ba36558587..a949d0793a 100644 --- a/source/common/src/tcol.c +++ b/source/common/src/tcol.c @@ -327,7 +327,9 @@ int32_t setColCompressByOption(uint8_t type, uint8_t encode, uint16_t compressTy return TSDB_CODE_SUCCESS; } -bool useCompress(uint8_t tableType) { return TSDB_SUPER_TABLE == tableType || TSDB_NORMAL_TABLE == tableType; } +bool useCompress(uint8_t tableType) { + return TSDB_SUPER_TABLE == tableType || TSDB_NORMAL_TABLE == tableType || TSDB_CHILD_TABLE == tableType; +} int8_t validColCompressLevel(uint8_t type, uint8_t level) { if (level == TSDB_COLVAL_LEVEL_DISABLED) return 1; diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index ac4811fb1b..809721d606 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -21,7 +21,7 @@ #define MALLOC_ALIGN_BYTES 32 -static void copyPkVal(SDataBlockInfo* pDst, const SDataBlockInfo* pSrc); + int32_t colDataGetLength(const SColumnInfoData* pColumnInfoData, int32_t numOfRows) { if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { @@ -848,7 +848,7 @@ SSDataBlock* blockDataExtractBlock(SSDataBlock* pBlock, int32_t startIndex, int3 if (pBlock->pBlockAgg == NULL) { isNull = colDataIsNull_s(pColData, j); } else { - isNull = colDataIsNull(pColData, pBlock->info.rows, j, pBlock->pBlockAgg[i]); + isNull = colDataIsNull(pColData, pBlock->info.rows, j, &pBlock->pBlockAgg[i]); } if (isNull) { @@ -1362,6 +1362,8 @@ void blockDataEmpty(SSDataBlock* pDataBlock) { return; } + taosMemoryFreeClear(pDataBlock->pBlockAgg); + size_t numOfCols = taosArrayGetSize(pDataBlock->pDataBlock); for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* p = taosArrayGet(pDataBlock->pDataBlock, i); diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 627a800b0b..d8b38a8f35 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -74,6 +74,7 @@ int32_t tsNumOfSnodeStreamThreads = 4; int32_t tsNumOfSnodeWriteThreads = 1; int32_t tsMaxStreamBackendCache = 128; // M int32_t tsPQSortMemThreshold = 16; // M +int32_t tsRetentionSpeedLimitMB = 0; // unlimited // sync raft int32_t tsElectInterval = 25 * 1000; @@ -328,6 +329,7 @@ int32_t taosSetTfsCfg(SConfig *pCfg) { tstrncpy(tsDiskCfg[0].dir, pItem->str, TSDB_FILENAME_LEN); tsDiskCfg[0].level = 0; tsDiskCfg[0].primary = 1; + tsDiskCfg[0].disable = 0; tstrncpy(tsDataDir, pItem->str, PATH_MAX); if (taosMulMkDir(tsDataDir) != 0) { uError("failed to create dataDir:%s", tsDataDir); @@ -591,12 +593,13 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "enableCoreFile", 1, CFG_SCOPE_BOTH, CFG_DYN_CLIENT) != 0) return -1; if (cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; - if (cfgAddBool(pCfg, "ssd42", tsSSE42Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; - if (cfgAddBool(pCfg, "avx", tsAVXEnable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; - if (cfgAddBool(pCfg, "avx2", tsAVX2Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; - if (cfgAddBool(pCfg, "fma", tsFMAEnable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; - if (cfgAddBool(pCfg, "avx512", tsAVX512Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "ssd42", tsSSE42Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "avx", tsAVXSupported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "avx2", tsAVX2Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "fma", tsFMASupported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "avx512", tsAVX512Supported, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; if (cfgAddBool(pCfg, "simdEnable", tsSIMDEnable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; + if (cfgAddBool(pCfg, "AVX512Enable", tsAVX512Enable, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; if (cfgAddBool(pCfg, "tagFilterCache", tsTagFilterCache, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; if (cfgAddInt64(pCfg, "openMax", tsOpenMax, 0, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_NONE) != 0) return -1; @@ -664,6 +667,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddInt32(pCfg, "queryBufferSize", tsQueryBufferSize, -1, 500000000000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; if (cfgAddInt32(pCfg, "queryRspPolicy", tsQueryRspPolicy, 0, 1, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; if (cfgAddInt32(pCfg, "numOfCommitThreads", tsNumOfCommitThreads, 1, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; + if (cfgAddInt32(pCfg, "retentionSpeedLimitMB", tsRetentionSpeedLimitMB, 0, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; if (cfgAddInt32(pCfg, "numOfMnodeReadThreads", tsNumOfMnodeReadThreads, 1, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; if (cfgAddInt32(pCfg, "numOfVnodeQueryThreads", tsNumOfVnodeQueryThreads, 4, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; @@ -1128,6 +1132,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32; tsNumOfCommitThreads = cfgGetItem(pCfg, "numOfCommitThreads")->i32; + tsRetentionSpeedLimitMB = cfgGetItem(pCfg, "retentionSpeedLimitMB")->i32; tsNumOfMnodeReadThreads = cfgGetItem(pCfg, "numOfMnodeReadThreads")->i32; tsNumOfVnodeQueryThreads = cfgGetItem(pCfg, "numOfVnodeQueryThreads")->i32; tsRatioOfVnodeStreamThreads = cfgGetItem(pCfg, "ratioOfVnodeStreamThreads")->fval; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index cd663d8ee1..5b782e62b2 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -840,7 +840,6 @@ int32_t tDeserializeSMAlterStbReq(void *buf, int32_t bufLen, SMAlterStbReq *pReq for (int32_t i = 0; i < pReq->numOfFields; ++i) { if (pReq->alterType == TSDB_ALTER_TABLE_ADD_COLUMN_WITH_COMPRESS_OPTION) { - taosArrayDestroy(pReq->pFields); pReq->pFields = taosArrayInit(pReq->numOfFields, sizeof(SFieldWithOptions)); SFieldWithOptions field = {0}; @@ -1670,8 +1669,10 @@ int32_t tSerializeSCreateUserReq(void *buf, int32_t bufLen, SCreateUserReq *pReq if (tEncodeU32(&encoder, pReq->pIpRanges[i].ip) < 0) return -1; if (tEncodeU32(&encoder, pReq->pIpRanges[i].mask) < 0) return -1; } - ENCODESQL(); + if (tEncodeI8(&encoder, pReq->isImport) < 0) return -1; + if (tEncodeI8(&encoder, pReq->createDb) < 0) return -1; + tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -1697,8 +1698,12 @@ int32_t tDeserializeSCreateUserReq(void *buf, int32_t bufLen, SCreateUserReq *pR if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].ip)) < 0) return -1; if (tDecodeU32(&decoder, &(pReq->pIpRanges[i].mask)) < 0) return -1; } - DECODESQL(); + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pReq->createDb) < 0) return -1; + if (tDecodeI8(&decoder, &pReq->isImport) < 0) return -1; + } + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -1846,7 +1851,7 @@ int32_t tSerializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq) } if (tEncodeI64(&encoder, pReq->privileges) < 0) return -1; ENCODESQL(); - if (tEncodeI8(&encoder, pReq->flag) < 0) return -1; + if (tEncodeU8(&encoder, pReq->flag) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -1887,7 +1892,7 @@ int32_t tDeserializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq if (tDecodeI64(&decoder, &pReq->privileges) < 0) return -1; DECODESQL(); if (!tDecodeIsEnd(&decoder)) { - if (tDecodeI8(&decoder, &pReq->flag) < 0) return -1; + if (tDecodeU8(&decoder, &pReq->flag) < 0) return -1; } tEndDecode(&decoder); @@ -4637,6 +4642,7 @@ int32_t tSerializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableReq if (tEncodeCStr(&encoder, pReq->filterTb) < 0) return -1; if (tEncodeCStr(&encoder, pReq->user) < 0) return -1; if (tEncodeI64(&encoder, pReq->compactId) < 0) return -1; + if (tEncodeI8(&encoder, pReq->withFull) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -4659,7 +4665,9 @@ int32_t tDeserializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableR } else { pReq->compactId = -1; } - + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, (int8_t *)&pReq->withFull) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); return 0; diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c index ae2c8c0c14..aad877312b 100644 --- a/source/common/src/tvariant.c +++ b/source/common/src/tvariant.c @@ -88,7 +88,7 @@ static int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { return TSDB_CODE_FAILED; } - if (val > UINT64_MAX) { + if (val > (double)UINT64_MAX) { errno = ERANGE; return TSDB_CODE_FAILED; } @@ -172,7 +172,7 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) { } break; case TK_NK_FLOAT: { double val = round(taosStr2Double(z, &endPtr)); - if (!IS_VALID_INT64(val)) { + if(val < (double)INT64_MIN || val > (double)INT64_MAX){ return TSDB_CODE_FAILED; } if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { @@ -271,7 +271,7 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) { } break; case TK_NK_FLOAT: { double val = round(taosStr2Double(p, &endPtr)); - if (!IS_VALID_UINT64(val)) { + if (val < 0 || val > (double)UINT64_MAX) { return TSDB_CODE_FAILED; } if (errno == ERANGE || errno == EINVAL || endPtr - z != n) { diff --git a/source/common/test/CMakeLists.txt b/source/common/test/CMakeLists.txt index bacc766990..2fe3ef652d 100644 --- a/source/common/test/CMakeLists.txt +++ b/source/common/test/CMakeLists.txt @@ -40,12 +40,24 @@ add_test( COMMAND dataformatTest ) -# tmsg test -add_executable(tmsgTest "") -target_sources(tmsgTest +if (${TD_LINUX}) + # tmsg test + add_executable(tmsgTest "") + target_sources(tmsgTest PRIVATE "tmsgTest.cpp" "../src/tmsg.c" -) -target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/") -target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main) \ No newline at end of file + ) + target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/") + target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main) + add_test( + NAME tmsgTest + COMMAND tmsgTest + ) + + # config file for msg type table + SET(MSG_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/msgTypeTable.ini) + add_custom_command(TARGET tmsgTest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MSG_TBL_FILE} $ + ) +endif () \ No newline at end of file diff --git a/source/common/test/msgTypeTable.ini b/source/common/test/msgTypeTable.ini new file mode 100644 index 0000000000..bdb6aece0c --- /dev/null +++ b/source/common/test/msgTypeTable.ini @@ -0,0 +1,556 @@ +TDMT_DND_CREATE_MNODE = 1 +TDMT_DND_CREATE_MNODE_RSP = 2 +TDMT_DND_DROP_MNODE = 3 +TDMT_DND_DROP_MNODE_RSP = 4 +TDMT_DND_CREATE_QNODE = 5 +TDMT_DND_CREATE_QNODE_RSP = 6 +TDMT_DND_DROP_QNODE = 7 +TDMT_DND_DROP_QNODE_RSP = 8 +TDMT_DND_CREATE_SNODE = 9 +TDMT_DND_CREATE_SNODE_RSP = 10 +TDMT_DND_DROP_SNODE = 11 +TDMT_DND_DROP_SNODE_RSP = 12 +TDMT_DND_CREATE_BNODE = 13 +TDMT_DND_CREATE_BNODE_RSP = 14 +TDMT_DND_DROP_BNODE = 15 +TDMT_DND_DROP_BNODE_RSP = 16 +TDMT_DND_CREATE_VNODE = 17 +TDMT_DND_CREATE_VNODE_RSP = 18 +TDMT_DND_DROP_VNODE = 19 +TDMT_DND_DROP_VNODE_RSP = 20 +TDMT_DND_SERVER_STATUS = 21 +TDMT_DND_SERVER_STATUS_RSP = 22 +TDMT_DND_NET_TEST = 23 +TDMT_DND_NET_TEST_RSP = 24 +TDMT_DND_CONFIG_DNODE = 25 +TDMT_DND_CONFIG_DNODE_RSP = 26 +TDMT_DND_SYSTABLE_RETRIEVE = 27 +TDMT_DND_SYSTABLE_RETRIEVE_RSP = 28 +TDMT_DND_UNUSED_CODE = 29 +TDMT_DND_UNUSED_CODE_RSP = 30 +TDMT_DND_ALTER_MNODE_TYPE = 31 +TDMT_DND_ALTER_MNODE_TYPE_RSP = 32 +TDMT_DND_ALTER_VNODE_TYPE = 33 +TDMT_DND_ALTER_VNODE_TYPE_RSP = 34 +TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP = 35 +TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP_RSP = 36 +TDMT_DND_CREATE_ENCRYPT_KEY = 37 +TDMT_DND_CREATE_ENCRYPT_KEY_RSP = 38 +TDMT_DND_MAX_MSG = 39 +TDMT_DND_MAX_MSG_RSP = 40 +TDMT_MND_CONNECT = 257 +TDMT_MND_CONNECT_RSP = 258 +TDMT_MND_CREATE_ACCT = 259 +TDMT_MND_CREATE_ACCT_RSP = 260 +TDMT_MND_ALTER_ACCT = 261 +TDMT_MND_ALTER_ACCT_RSP = 262 +TDMT_MND_DROP_ACCT = 263 +TDMT_MND_DROP_ACCT_RSP = 264 +TDMT_MND_CREATE_USER = 265 +TDMT_MND_CREATE_USER_RSP = 266 +TDMT_MND_ALTER_USER = 267 +TDMT_MND_ALTER_USER_RSP = 268 +TDMT_MND_DROP_USER = 269 +TDMT_MND_DROP_USER_RSP = 270 +TDMT_MND_GET_USER_AUTH = 271 +TDMT_MND_GET_USER_AUTH_RSP = 272 +TDMT_MND_CREATE_DNODE = 273 +TDMT_MND_CREATE_DNODE_RSP = 274 +TDMT_MND_CONFIG_DNODE = 275 +TDMT_MND_CONFIG_DNODE_RSP = 276 +TDMT_MND_DROP_DNODE = 277 +TDMT_MND_DROP_DNODE_RSP = 278 +TDMT_MND_CREATE_MNODE = 279 +TDMT_MND_CREATE_MNODE_RSP = 280 +TDMT_MND_ALTER_MNODE = 281 +TDMT_MND_ALTER_MNODE_RSP = 282 +TDMT_MND_DROP_MNODE = 283 +TDMT_MND_DROP_MNODE_RSP = 284 +TDMT_MND_CREATE_QNODE = 285 +TDMT_MND_CREATE_QNODE_RSP = 286 +TDMT_MND_ALTER_QNODE = 287 +TDMT_MND_ALTER_QNODE_RSP = 288 +TDMT_MND_DROP_QNODE = 289 +TDMT_MND_DROP_QNODE_RSP = 290 +TDMT_MND_QNODE_LIST = 291 +TDMT_MND_QNODE_LIST_RSP = 292 +TDMT_MND_DNODE_LIST = 293 +TDMT_MND_DNODE_LIST_RSP = 294 +TDMT_MND_CREATE_SNODE = 295 +TDMT_MND_CREATE_SNODE_RSP = 296 +TDMT_MND_ALTER_SNODE = 297 +TDMT_MND_ALTER_SNODE_RSP = 298 +TDMT_MND_DROP_SNODE = 299 +TDMT_MND_DROP_SNODE_RSP = 300 +TDMT_MND_CREATE_BNODE = 301 +TDMT_MND_CREATE_BNODE_RSP = 302 +TDMT_MND_ALTER_BNODE = 303 +TDMT_MND_ALTER_BNODE_RSP = 304 +TDMT_MND_DROP_BNODE = 305 +TDMT_MND_DROP_BNODE_RSP = 306 +TDMT_MND_CREATE_DB = 307 +TDMT_MND_CREATE_DB_RSP = 308 +TDMT_MND_DROP_DB = 309 +TDMT_MND_DROP_DB_RSP = 310 +TDMT_MND_USE_DB = 311 +TDMT_MND_USE_DB_RSP = 312 +TDMT_MND_ALTER_DB = 313 +TDMT_MND_ALTER_DB_RSP = 314 +TDMT_MND_SYNC_DB = 315 +TDMT_MND_SYNC_DB_RSP = 316 +TDMT_MND_COMPACT_DB = 317 +TDMT_MND_COMPACT_DB_RSP = 318 +TDMT_MND_TRIM_DB = 319 +TDMT_MND_TRIM_DB_RSP = 320 +TDMT_MND_GET_DB_CFG = 321 +TDMT_MND_GET_DB_CFG_RSP = 322 +TDMT_MND_VGROUP_LIST = 323 +TDMT_MND_VGROUP_LIST_RSP = 324 +TDMT_MND_CREATE_FUNC = 325 +TDMT_MND_CREATE_FUNC_RSP = 326 +TDMT_MND_RETRIEVE_FUNC = 327 +TDMT_MND_RETRIEVE_FUNC_RSP = 328 +TDMT_MND_DROP_FUNC = 329 +TDMT_MND_DROP_FUNC_RSP = 330 +TDMT_MND_CREATE_STB = 331 +TDMT_MND_CREATE_STB_RSP = 332 +TDMT_MND_ALTER_STB = 333 +TDMT_MND_ALTER_STB_RSP = 334 +TDMT_MND_DROP_STB = 335 +TDMT_MND_DROP_STB_RSP = 336 +TDMT_MND_TABLE_META = 337 +TDMT_MND_TABLE_META_RSP = 338 +TDMT_MND_CREATE_SMA = 339 +TDMT_MND_CREATE_SMA_RSP = 340 +TDMT_MND_DROP_SMA = 341 +TDMT_MND_DROP_SMA_RSP = 342 +TDMT_MND_CREATE_STREAM = 343 +TDMT_MND_CREATE_STREAM_RSP = 344 +TDMT_MND_ALTER_STREAM = 345 +TDMT_MND_ALTER_STREAM_RSP = 346 +TDMT_MND_DROP_STREAM = 347 +TDMT_MND_DROP_STREAM_RSP = 348 +TDMT_MND_RECOVER_STREAM = 349 +TDMT_MND_RECOVER_STREAM_RSP = 350 +TDMT_MND_CREATE_INDEX = 351 +TDMT_MND_CREATE_INDEX_RSP = 352 +TDMT_MND_DROP_INDEX = 353 +TDMT_MND_DROP_INDEX_RSP = 354 +TDMT_MND_GET_INDEX = 355 +TDMT_MND_GET_INDEX_RSP = 356 +TDMT_MND_GET_TABLE_INDEX = 357 +TDMT_MND_GET_TABLE_INDEX_RSP = 358 +TDMT_MND_BATCH_META = 359 +TDMT_MND_BATCH_META_RSP = 360 +TDMT_MND_TABLE_CFG = 361 +TDMT_MND_TABLE_CFG_RSP = 362 +TDMT_MND_TMQ_CREATE_TOPIC = 363 +TDMT_MND_TMQ_CREATE_TOPIC_RSP = 364 +TDMT_MND_UNUSED1 = 365 +TDMT_MND_UNUSED1_RSP = 366 +TDMT_MND_TMQ_DROP_TOPIC = 367 +TDMT_MND_TMQ_DROP_TOPIC_RSP = 368 +TDMT_MND_TMQ_SUBSCRIBE = 369 +TDMT_MND_TMQ_SUBSCRIBE_RSP = 370 +TDMT_MND_TMQ_ASK_EP = 371 +TDMT_MND_TMQ_ASK_EP_RSP = 372 +TDMT_MND_TMQ_CONSUMER_RECOVER = 373 +TDMT_MND_TMQ_CONSUMER_RECOVER_RSP = 374 +TDMT_MND_TMQ_HB = 375 +TDMT_MND_TMQ_HB_RSP = 376 +TDMT_MND_TMQ_DO_REBALANCE = 377 +TDMT_MND_TMQ_DO_REBALANCE_RSP = 378 +TDMT_MND_TMQ_DROP_CGROUP = 379 +TDMT_MND_TMQ_DROP_CGROUP_RSP = 380 +TDMT_MND_CREATE_VG = 381 +TDMT_MND_CREATE_VG_RSP = 382 +TDMT_MND_TMQ_TIMER = 383 +TDMT_MND_TMQ_TIMER_RSP = 384 +TDMT_MND_TELEM_TIMER = 385 +TDMT_MND_TELEM_TIMER_RSP = 386 +TDMT_MND_TRANS_TIMER = 387 +TDMT_MND_TRANS_TIMER_RSP = 388 +TDMT_MND_TTL_TIMER = 389 +TDMT_MND_TTL_TIMER_RSP = 390 +TDMT_MND_GRANT_HB_TIMER = 391 +TDMT_MND_GRANT_HB_TIMER_RSP = 392 +TDMT_MND_NODECHECK_TIMER = 393 +TDMT_MND_NODECHECK_TIMER_RSP = 394 +TDMT_MND_KILL_TRANS = 395 +TDMT_MND_KILL_TRANS_RSP = 396 +TDMT_MND_KILL_QUERY = 397 +TDMT_MND_KILL_QUERY_RSP = 398 +TDMT_MND_KILL_CONN = 399 +TDMT_MND_KILL_CONN_RSP = 400 +TDMT_MND_HEARTBEAT = 401 +TDMT_MND_HEARTBEAT_RSP = 402 +TDMT_MND_STATUS = 403 +TDMT_MND_STATUS_RSP = 404 +TDMT_MND_SHOW = 405 +TDMT_MND_SHOW_RSP = 406 +TDMT_MND_SYSTABLE_RETRIEVE = 407 +TDMT_MND_SYSTABLE_RETRIEVE_RSP = 408 +TDMT_MND_GRANT = 409 +TDMT_MND_GRANT_RSP = 410 +TDMT_MND_AUTH = 411 +TDMT_MND_AUTH_RSP = 412 +TDMT_MND_APPLY_MSG = 413 +TDMT_MND_APPLY_MSG_RSP = 414 +TDMT_MND_BALANCE_VGROUP = 415 +TDMT_MND_BALANCE_VGROUP_RSP = 416 +TDMT_MND_MERGE_VGROUP = 417 +TDMT_MND_MERGE_VGROUP_RSP = 418 +TDMT_MND_REDISTRIBUTE_VGROUP = 419 +TDMT_MND_REDISTRIBUTE_VGROUP_RSP = 420 +TDMT_MND_SPLIT_VGROUP = 421 +TDMT_MND_SPLIT_VGROUP_RSP = 422 +TDMT_MND_SHOW_VARIABLES = 423 +TDMT_MND_SHOW_VARIABLES_RSP = 424 +TDMT_MND_SERVER_VERSION = 425 +TDMT_MND_SERVER_VERSION_RSP = 426 +TDMT_MND_UPTIME_TIMER = 427 +TDMT_MND_UPTIME_TIMER_RSP = 428 +TDMT_MND_TMQ_LOST_CONSUMER_CLEAR = 429 +TDMT_MND_TMQ_LOST_CONSUMER_CLEAR_RSP = 430 +TDMT_MND_STREAM_HEARTBEAT = 431 +TDMT_MND_STREAM_HEARTBEAT_RSP = 432 +TDMT_MND_RETRIEVE_IP_WHITE = 433 +TDMT_MND_RETRIEVE_IP_WHITE_RSP = 434 +TDMT_MND_GET_USER_WHITELIST = 435 +TDMT_MND_GET_USER_WHITELIST_RSP = 436 +TDMT_MND_NOTIFY = 437 +TDMT_MND_NOTIFY_RSP = 438 +TDMT_MND_BALANCE_VGROUP_LEADER = 439 +TDMT_MND_BALANCE_VGROUP_LEADER_RSP = 440 +TDMT_MND_RESTORE_DNODE = 441 +TDMT_MND_RESTORE_DNODE_RSP = 442 +TDMT_MND_PAUSE_STREAM = 443 +TDMT_MND_PAUSE_STREAM_RSP = 444 +TDMT_MND_RESUME_STREAM = 445 +TDMT_MND_RESUME_STREAM_RSP = 446 +TDMT_MND_STREAM_UPDATE_CHKPT_EVT = 447 +TDMT_MND_STREAM_UPDATE_CHKPT_EVT_RSP = 448 +TDMT_MND_STREAM_BEGIN_CHECKPOINT = 449 +TDMT_MND_STREAM_BEGIN_CHECKPOINT_RSP = 450 +TDMT_MND_STREAM_CHKPT_REPORT = 451 +TDMT_MND_STREAM_CHKPT_REPORT_RSP = 452 +TDMT_MND_STREAM_NODECHANGE_CHECK = 453 +TDMT_MND_STREAM_NODECHANGE_CHECK_RSP = 454 +TDMT_MND_TRIM_DB_TIMER = 455 +TDMT_MND_TRIM_DB_TIMER_RSP = 456 +TDMT_MND_GRANT_NOTIFY = 457 +TDMT_MND_GRANT_NOTIFY_RSP = 458 +TDMT_MND_CREATE_VIEW = 459 +TDMT_MND_CREATE_VIEW_RSP = 460 +TDMT_MND_DROP_VIEW = 461 +TDMT_MND_DROP_VIEW_RSP = 462 +TDMT_MND_VIEW_META = 463 +TDMT_MND_VIEW_META_RSP = 464 +TDMT_MND_STATIS = 465 +TDMT_MND_STATIS_RSP = 466 +TDMT_MND_KILL_COMPACT = 467 +TDMT_MND_KILL_COMPACT_RSP = 468 +TDMT_MND_COMPACT_TIMER = 469 +TDMT_MND_COMPACT_TIMER_RSP = 470 +TDMT_MND_STREAM_REQ_CHKPT = 471 +TDMT_MND_STREAM_REQ_CHKPT_RSP = 472 +TDMT_MND_CONFIG_CLUSTER = 473 +TDMT_MND_CONFIG_CLUSTER_RSP = 474 +TDMT_MND_CREATE_ENCRYPT_KEY = 475 +TDMT_MND_CREATE_ENCRYPT_KEY_RSP = 476 +TDMT_MND_S3MIGRATE_DB = 477 +TDMT_MND_S3MIGRATE_DB_RSP = 478 +TDMT_MND_S3MIGRATE_DB_TIMER = 479 +TDMT_MND_S3MIGRATE_DB_TIMER_RSP = 480 +TDMT_MND_UNUSED2 = 481 +TDMT_MND_UNUSED2_RSP = 482 +TDMT_MND_CREATE_TSMA = 483 +TDMT_MND_CREATE_TSMA_RSP = 484 +TDMT_MND_DROP_TSMA = 485 +TDMT_MND_DROP_TSMA_RSP = 486 +TDMT_MND_STB_DROP = 487 +TDMT_MND_STB_DROP_RSP = 488 +TDMT_MND_GET_TABLE_TSMA = 489 +TDMT_MND_GET_TABLE_TSMA_RSP = 490 +TDMT_MND_GET_TSMA = 491 +TDMT_MND_GET_TSMA_RSP = 492 +TDMT_MND_DROP_TB_WITH_TSMA = 493 +TDMT_MND_DROP_TB_WITH_TSMA_RSP = 494 +TDMT_MND_MAX_MSG = 495 +TDMT_MND_MAX_MSG_RSP = 496 +TDMT_VND_SUBMIT = 513 +TDMT_VND_SUBMIT_RSP = 514 +TDMT_VND_CREATE_TABLE = 515 +TDMT_VND_CREATE_TABLE_RSP = 516 +TDMT_VND_ALTER_TABLE = 517 +TDMT_VND_ALTER_TABLE_RSP = 518 +TDMT_VND_DROP_TABLE = 519 +TDMT_VND_DROP_TABLE_RSP = 520 +TDMT_VND_UPDATE_TAG_VAL = 521 +TDMT_VND_UPDATE_TAG_VAL_RSP = 522 +TDMT_VND_TABLE_META = 523 +TDMT_VND_TABLE_META_RSP = 524 +TDMT_VND_TABLES_META = 525 +TDMT_VND_TABLES_META_RSP = 526 +TDMT_VND_TABLE_CFG = 527 +TDMT_VND_TABLE_CFG_RSP = 528 +TDMT_VND_BATCH_META = 529 +TDMT_VND_BATCH_META_RSP = 530 +TDMT_VND_CREATE_STB = 531 +TDMT_VND_CREATE_STB_RSP = 532 +TDMT_VND_ALTER_STB = 533 +TDMT_VND_ALTER_STB_RSP = 534 +TDMT_VND_DROP_STB = 535 +TDMT_VND_DROP_STB_RSP = 536 +TDMT_VND_UNUSED1 = 537 +TDMT_VND_UNUSED1_RSP = 538 +TDMT_VND_UNUSED2 = 539 +TDMT_VND_UNUSED2_RSP = 540 +TDMT_VND_UNUSED3 = 541 +TDMT_VND_UNUSED3_RSP = 542 +TDMT_VND_UNUSED4 = 543 +TDMT_VND_UNUSED4_RSP = 544 +TDMT_VND_UNUSED5 = 545 +TDMT_VND_UNUSED5_RSP = 546 +TDMT_VND_UNUSED6 = 547 +TDMT_VND_UNUSED6_RSP = 548 +TDMT_VND_UNUSED7 = 549 +TDMT_VND_UNUSED7_RSP = 550 +TDMT_VND_UNUSED8 = 551 +TDMT_VND_UNUSED8_RSP = 552 +TDMT_VND_UNUSED9 = 553 +TDMT_VND_UNUSED9_RSP = 554 +TDMT_VND_UNUSED10 = 555 +TDMT_VND_UNUSED10_RSP = 556 +TDMT_VND_UNUSED11 = 557 +TDMT_VND_UNUSED11_RSP = 558 +TDMT_VND_UNUSED12 = 559 +TDMT_VND_UNUSED12_RSP = 560 +TDMT_VND_UNUSED13 = 561 +TDMT_VND_UNUSED13_RSP = 562 +TDMT_VND_UNUSED14 = 563 +TDMT_VND_UNUSED14_RSP = 564 +TDMT_VND_UNUSED15 = 565 +TDMT_VND_UNUSED15_RSP = 566 +TDMT_VND_CREATE_SMA = 567 +TDMT_VND_CREATE_SMA_RSP = 568 +TDMT_VND_CANCEL_SMA = 569 +TDMT_VND_CANCEL_SMA_RSP = 570 +TDMT_VND_DROP_SMA = 571 +TDMT_VND_DROP_SMA_RSP = 572 +TDMT_VND_SUBMIT_RSMA = 573 +TDMT_VND_SUBMIT_RSMA_RSP = 574 +TDMT_VND_FETCH_RSMA = 575 +TDMT_VND_FETCH_RSMA_RSP = 576 +TDMT_VND_EXEC_RSMA = 577 +TDMT_VND_EXEC_RSMA_RSP = 578 +TDMT_VND_DELETE = 579 +TDMT_VND_DELETE_RSP = 580 +TDMT_VND_BATCH_DEL = 581 +TDMT_VND_BATCH_DEL_RSP = 582 +TDMT_VND_ALTER_CONFIG = 583 +TDMT_VND_ALTER_CONFIG_RSP = 584 +TDMT_VND_ALTER_REPLICA = 585 +TDMT_VND_ALTER_REPLICA_RSP = 586 +TDMT_VND_ALTER_CONFIRM = 587 +TDMT_VND_ALTER_CONFIRM_RSP = 588 +TDMT_VND_ALTER_HASHRANGE = 589 +TDMT_VND_ALTER_HASHRANGE_RSP = 590 +TDMT_VND_COMPACT = 591 +TDMT_VND_COMPACT_RSP = 592 +TDMT_VND_DROP_TTL_TABLE = 593 +TDMT_VND_DROP_TTL_TABLE_RSP = 594 +TDMT_VND_TRIM = 595 +TDMT_VND_TRIM_RSP = 596 +TDMT_VND_COMMIT = 597 +TDMT_VND_COMMIT_RSP = 598 +TDMT_VND_CREATE_INDEX = 599 +TDMT_VND_CREATE_INDEX_RSP = 600 +TDMT_VND_DROP_INDEX = 601 +TDMT_VND_DROP_INDEX_RSP = 602 +TDMT_VND_DISABLE_WRITE = 603 +TDMT_VND_DISABLE_WRITE_RSP = 604 +TDMT_VND_QUERY_COMPACT_PROGRESS = 605 +TDMT_VND_QUERY_COMPACT_PROGRESS_RSP = 606 +TDMT_VND_KILL_COMPACT = 607 +TDMT_VND_KILL_COMPACT_RSP = 608 +TDMT_VND_S3MIGRATE = 609 +TDMT_VND_S3MIGRATE_RSP = 610 +TDMT_VND_ARB_HEARTBEAT = 611 +TDMT_VND_ARB_HEARTBEAT_RSP = 612 +TDMT_VND_ARB_CHECK_SYNC = 613 +TDMT_VND_ARB_CHECK_SYNC_RSP = 614 +TDMT_VND_FETCH_TTL_EXPIRED_TBS = 615 +TDMT_VND_FETCH_TTL_EXPIRED_TBS_RSP = 616 +TDMT_VND_MAX_MSG = 617 +TDMT_VND_MAX_MSG_RSP = 618 +TDMT_SCH_QUERY = 769 +TDMT_SCH_QUERY_RSP = 770 +TDMT_SCH_MERGE_QUERY = 771 +TDMT_SCH_MERGE_QUERY_RSP = 772 +TDMT_SCH_QUERY_CONTINUE = 773 +TDMT_SCH_QUERY_CONTINUE_RSP = 774 +TDMT_SCH_QUERY_HEARTBEAT = 775 +TDMT_SCH_QUERY_HEARTBEAT_RSP = 776 +TDMT_SCH_FETCH = 777 +TDMT_SCH_FETCH_RSP = 778 +TDMT_SCH_MERGE_FETCH = 779 +TDMT_SCH_MERGE_FETCH_RSP = 780 +TDMT_SCH_CANCEL_TASK = 781 +TDMT_SCH_CANCEL_TASK_RSP = 782 +TDMT_SCH_DROP_TASK = 783 +TDMT_SCH_DROP_TASK_RSP = 784 +TDMT_SCH_EXPLAIN = 785 +TDMT_SCH_EXPLAIN_RSP = 786 +TDMT_SCH_LINK_BROKEN = 787 +TDMT_SCH_LINK_BROKEN_RSP = 788 +TDMT_SCH_TASK_NOTIFY = 789 +TDMT_SCH_TASK_NOTIFY_RSP = 790 +TDMT_SCH_MAX_MSG = 791 +TDMT_SCH_MAX_MSG_RSP = 792 +TDMT_STREAM_TASK_DEPLOY = 1025 +TDMT_STREAM_TASK_DEPLOY_RSP = 1026 +TDMT_STREAM_TASK_DROP = 1027 +TDMT_STREAM_TASK_DROP_RSP = 1028 +TDMT_STREAM_TASK_RUN = 1029 +TDMT_STREAM_TASK_RUN_RSP = 1030 +TDMT_STREAM_TASK_DISPATCH = 1031 +TDMT_STREAM_TASK_DISPATCH_RSP = 1032 +TDMT_STREAM_TASK_UPDATE_CHKPT = 1033 +TDMT_STREAM_TASK_UPDATE_CHKPT_RSP = 1034 +TDMT_STREAM_RETRIEVE = 1035 +TDMT_STREAM_RETRIEVE_RSP = 1036 +TDMT_STREAM_TASK_CHECKPOINT_READY = 1037 +TDMT_STREAM_TASK_CHECKPOINT_READY_RSP = 1038 +TDMT_STREAM_TASK_REPORT_CHECKPOINT = 1039 +TDMT_STREAM_TASK_REPORT_CHECKPOINT_RSP = 1040 +TDMT_STREAM_TASK_RESTORE_CHECKPOINT = 1041 +TDMT_STREAM_TASK_RESTORE_CHECKPOINT_RSP = 1042 +TDMT_STREAM_TASK_PAUSE = 1043 +TDMT_STREAM_TASK_PAUSE_RSP = 1044 +TDMT_STREAM_TASK_RESUME = 1045 +TDMT_STREAM_TASK_RESUME_RSP = 1046 +TDMT_STREAM_TASK_STOP = 1047 +TDMT_STREAM_TASK_STOP_RSP = 1048 +TDMT_STREAM_UNUSED = 1049 +TDMT_STREAM_UNUSED_RSP = 1050 +TDMT_STREAM_CREATE = 1051 +TDMT_STREAM_CREATE_RSP = 1052 +TDMT_STREAM_DROP = 1053 +TDMT_STREAM_DROP_RSP = 1054 +TDMT_STREAM_RETRIEVE_TRIGGER = 1055 +TDMT_STREAM_RETRIEVE_TRIGGER_RSP = 1056 +TDMT_STREAM_MAX_MSG = 1057 +TDMT_STREAM_MAX_MSG_RSP = 1058 +TDMT_MON_MAX_MSG = 1281 +TDMT_MON_MAX_MSG_RSP = 1282 +TDMT_SYNC_TIMEOUT = 1537 +TDMT_SYNC_TIMEOUT_RSP = 1538 +TDMT_SYNC_TIMEOUT_ELECTION = 1539 +TDMT_SYNC_TIMEOUT_ELECTION_RSP = 1540 +TDMT_SYNC_PING_REPLY = 1541 +TDMT_SYNC_PING_REPLY_RSP = 1542 +TDMT_SYNC_CLIENT_REQUEST = 1543 +TDMT_SYNC_CLIENT_REQUEST_RSP = 1544 +TDMT_SYNC_CLIENT_REQUEST_BATCH = 1545 +TDMT_SYNC_CLIENT_REQUEST_BATCH_RSP = 1546 +TDMT_SYNC_CLIENT_REQUEST_REPLY = 1547 +TDMT_SYNC_CLIENT_REQUEST_REPLY_RSP = 1548 +TDMT_SYNC_REQUEST_VOTE = 1549 +TDMT_SYNC_REQUEST_VOTE_RSP = 1550 +TDMT_SYNC_REQUEST_VOTE_REPLY = 1551 +TDMT_SYNC_REQUEST_VOTE_REPLY_RSP = 1552 +TDMT_SYNC_APPEND_ENTRIES = 1553 +TDMT_SYNC_APPEND_ENTRIES_RSP = 1554 +TDMT_SYNC_APPEND_ENTRIES_BATCH = 1555 +TDMT_SYNC_APPEND_ENTRIES_BATCH_RSP = 1556 +TDMT_SYNC_APPEND_ENTRIES_REPLY = 1557 +TDMT_SYNC_APPEND_ENTRIES_REPLY_RSP = 1558 +TDMT_SYNC_NOOP = 1559 +TDMT_SYNC_NOOP_RSP = 1560 +TDMT_SYNC_UNKNOWN = 1561 +TDMT_SYNC_UNKNOWN_RSP = 1562 +TDMT_SYNC_COMMON_RESPONSE = 1563 +TDMT_SYNC_COMMON_RESPONSE_RSP = 1564 +TDMT_SYNC_APPLY_MSG = 1565 +TDMT_SYNC_APPLY_MSG_RSP = 1566 +TDMT_SYNC_CONFIG_CHANGE = 1567 +TDMT_SYNC_CONFIG_CHANGE_RSP = 1568 +TDMT_SYNC_CONFIG_CHANGE_FINISH = 1569 +TDMT_SYNC_CONFIG_CHANGE_FINISH_RSP = 1570 +TDMT_SYNC_SNAPSHOT_SEND = 1571 +TDMT_SYNC_SNAPSHOT_SEND_RSP = 1572 +TDMT_SYNC_SNAPSHOT_RSP = 1573 +TDMT_SYNC_SNAPSHOT_RSP_RSP = 1574 +TDMT_SYNC_LEADER_TRANSFER = 1575 +TDMT_SYNC_LEADER_TRANSFER_RSP = 1576 +TDMT_SYNC_SET_MNODE_STANDBY = 1577 +TDMT_SYNC_SET_MNODE_STANDBY_RSP = 1578 +TDMT_SYNC_SET_VNODE_STANDBY = 1579 +TDMT_SYNC_SET_VNODE_STANDBY_RSP = 1580 +TDMT_SYNC_HEARTBEAT = 1581 +TDMT_SYNC_HEARTBEAT_RSP = 1582 +TDMT_SYNC_HEARTBEAT_REPLY = 1583 +TDMT_SYNC_HEARTBEAT_REPLY_RSP = 1584 +TDMT_SYNC_LOCAL_CMD = 1585 +TDMT_SYNC_LOCAL_CMD_RSP = 1586 +TDMT_SYNC_PREP_SNAPSHOT = 1587 +TDMT_SYNC_PREP_SNAPSHOT_RSP = 1588 +TDMT_SYNC_PREP_SNAPSHOT_REPLY = 1589 +TDMT_SYNC_PREP_SNAPSHOT_REPLY_RSP = 1590 +TDMT_SYNC_UNUSED_CODE = 1591 +TDMT_SYNC_UNUSED_CODE_RSP = 1592 +TDMT_SYNC_FORCE_FOLLOWER = 1593 +TDMT_SYNC_FORCE_FOLLOWER_RSP = 1594 +TDMT_SYNC_SET_ASSIGNED_LEADER = 1595 +TDMT_SYNC_SET_ASSIGNED_LEADER_RSP = 1596 +TDMT_SYNC_MAX_MSG = 1597 +TDMT_SYNC_MAX_MSG_RSP = 1598 +TDMT_VND_STREAM_SCAN_HISTORY = 1793 +TDMT_VND_STREAM_SCAN_HISTORY_RSP = 1794 +TDMT_VND_STREAM_CHECK_POINT_SOURCE = 1795 +TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP = 1796 +TDMT_VND_STREAM_TASK_UPDATE = 1797 +TDMT_VND_STREAM_TASK_UPDATE_RSP = 1798 +TDMT_VND_STREAM_TASK_RESET = 1799 +TDMT_VND_STREAM_TASK_RESET_RSP = 1800 +TDMT_VND_STREAM_TASK_CHECK = 1801 +TDMT_VND_STREAM_TASK_CHECK_RSP = 1802 +TDMT_VND_STREAM_UNUSED = 1803 +TDMT_VND_STREAM_UNUSED_RSP = 1804 +TDMT_VND_GET_STREAM_PROGRESS = 1805 +TDMT_VND_GET_STREAM_PROGRESS_RSP = 1806 +TDMT_VND_STREAM_MAX_MSG = 1807 +TDMT_VND_STREAM_MAX_MSG_RSP = 1808 +TDMT_VND_TMQ_SUBSCRIBE = 2049 +TDMT_VND_TMQ_SUBSCRIBE_RSP = 2050 +TDMT_VND_TMQ_DELETE_SUB = 2051 +TDMT_VND_TMQ_DELETE_SUB_RSP = 2052 +TDMT_VND_TMQ_COMMIT_OFFSET = 2053 +TDMT_VND_TMQ_COMMIT_OFFSET_RSP = 2054 +TDMT_VND_TMQ_SEEK = 2055 +TDMT_VND_TMQ_SEEK_RSP = 2056 +TDMT_VND_TMQ_ADD_CHECKINFO = 2057 +TDMT_VND_TMQ_ADD_CHECKINFO_RSP = 2058 +TDMT_VND_TMQ_DEL_CHECKINFO = 2059 +TDMT_VND_TMQ_DEL_CHECKINFO_RSP = 2060 +TDMT_VND_TMQ_CONSUME = 2061 +TDMT_VND_TMQ_CONSUME_RSP = 2062 +TDMT_VND_TMQ_CONSUME_PUSH = 2063 +TDMT_VND_TMQ_CONSUME_PUSH_RSP = 2064 +TDMT_VND_TMQ_VG_WALINFO = 2065 +TDMT_VND_TMQ_VG_WALINFO_RSP = 2066 +TDMT_VND_TMQ_VG_COMMITTEDINFO = 2067 +TDMT_VND_TMQ_VG_COMMITTEDINFO_RSP = 2068 +TDMT_VND_TMQ_MAX_MSG = 2069 +TDMT_VND_TMQ_MAX_MSG_RSP = 2070 +TDMT_MND_ARB_HEARTBEAT_TIMER = 2305 +TDMT_MND_ARB_HEARTBEAT_TIMER_RSP = 2306 +TDMT_MND_ARB_CHECK_SYNC_TIMER = 2307 +TDMT_MND_ARB_CHECK_SYNC_TIMER_RSP = 2308 +TDMT_MND_ARB_UPDATE_GROUP = 2309 +TDMT_MND_ARB_UPDATE_GROUP_RSP = 2310 +TDMT_MND_ARB_UPDATE_GROUP_BATCH = 2311 +TDMT_MND_ARB_UPDATE_GROUP_BATCH_RSP = 2312 +TDMT_MND_ARB_MAX_MSG = 2313 +TDMT_MND_ARB_MAX_MSG_RSP = 2314 diff --git a/source/common/test/tmsgTest.cpp b/source/common/test/tmsgTest.cpp index 910e133c64..34b0026b17 100644 --- a/source/common/test/tmsgTest.cpp +++ b/source/common/test/tmsgTest.cpp @@ -1,5 +1,14 @@ #include - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "tmsg.h" @@ -12,15 +21,260 @@ #undef TD_MSG_SEG_CODE_ #include "tmsgdef.h" -TEST(td_msg_test, simple_msg_test) { - // std::cout << TMSG_INFO(TDMT_VND_DROP_TABLE) << std::endl; - // std::cout << TMSG_INFO(TDMT_MND_DROP_SUPER_TABLE) << std::endl; - // std::cout << TMSG_INFO(TDMT_MND_CREATE_SUPER_TABLE) << std::endl; +#undef getline +#undef close - int32_t msgSize = sizeof(tMsgTypeInfo) / sizeof(SMsgTypeInfo); - for (int32_t i = 0; i < msgSize; ++i) { - SMsgTypeInfo *pInfo = &tMsgTypeInfo[i]; - std::cout << i * 2 + 1 << " " << pInfo->name << " " << pInfo->type << std::endl; - std::cout << i * 2 + 2 << " " << pInfo->rspName << " " << pInfo->rspType << std::endl; +using namespace std; + +enum class ParseStatus { + Success, + FileNotExist, + FileNotOpen, + ResponseWithoutRequest, + RequestWithoutResponse +}; + +typedef struct { + string name; + string rspName; + int32_t type; + int32_t rspType; +} STestMsgTypeInfo; + +string getExecutableDirectory() { + char result[PATH_MAX]; + ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); + if (count != -1) { + result[count] = '\0'; + string path(result); + size_t pos = path.rfind('/'); + if (pos != string::npos) { + path.erase(pos + 1); + } + return path; + } else { + throw std::runtime_error("Failed to get the executable's directory"); } +} + + +// parses key-value pairs from strings +pair parseKeyValuePair(const string &line, char delim = '=') { + size_t pos = line.find(delim); + if (pos == string::npos) + return make_pair("", 0); + + string key = line.substr(0, pos); + + // remove leading spaces + size_t firstNotSpace = key.find_first_not_of(" "); + if (firstNotSpace != string::npos) { + key = key.substr(firstNotSpace); + } else { + key.clear(); + } + + // remove ending spaces + size_t lastNotSpace = key.find_last_not_of(" "); + if (lastNotSpace != string::npos) { + key = key.substr(0, lastNotSpace + 1); + } + + if (key.front() == '"' && key.back() == '"') + key = key.substr(1, key.size() - 2); + + if (key.front() == '\'' && key.back() == '\'') + key = key.substr(1, key.size() - 2); + + string valStr = line.substr(pos + 1); + int32_t val = stoi(valStr); + return make_pair(key, val); +} + +// read the configuration file and parse it into the STestMsgTypeInfo array +ParseStatus readConfig(const string& filePath, vector& msgTypes) { + ifstream file(filePath); + if (!file.is_open()) { + if (file.fail() && errno == ENOENT) { + cerr << "Error: The file does not exist, file: " << filePath << endl; + return ParseStatus::FileNotExist; + } else { + cerr << "Error: Could not open the file, file: " << filePath << endl; + return ParseStatus::FileNotOpen; + } + } + + auto endsWith = [](const string& str, const string& suffix) { + if (str.length() < suffix.length()) { + return false; + } + return equal(str.end() - suffix.length(), str.end(), suffix.begin()); + }; + + + bool evenLine = true; + string line; + string suffix("_RSP"); + pair reqKwInfo; + while (std::getline(file, line)) { + char delim = '#'; + if (line.find('=') != string::npos) { + delim = '='; + } else if (line.find(':') != string::npos) { + delim = ':'; + } else if (line.find('{') != string::npos || line.find('}') != string::npos) { + // TODO: parse json format + continue; + } else { + continue; + } + + auto curKwInfo = parseKeyValuePair(line, delim); + evenLine = ! evenLine; + + // check message type + if (evenLine == false) { // req msg + reqKwInfo = curKwInfo; + } else { // rsp msg + if (reqKwInfo.first.empty()) { + cerr << "Error: Found a response message without a matching request, rsp: " << curKwInfo.first << endl; + return ParseStatus::ResponseWithoutRequest; + } else if (!endsWith(curKwInfo.first, suffix)) { + cerr << "Error: A request message was not followed by a matching response, req: " << reqKwInfo.first << endl; + return ParseStatus::RequestWithoutResponse; + } else { + STestMsgTypeInfo msgInfo; + msgInfo.name = reqKwInfo.first; + msgInfo.rspName = curKwInfo.first; + msgInfo.type = reqKwInfo.second; + msgInfo.rspType = curKwInfo.second; + msgTypes.push_back(msgInfo); + + // reset req info + reqKwInfo = make_pair("", -1); + } + } + } + + if (!reqKwInfo.first.empty()) { + cerr << "Error: A request message was not followed by a matching response, req: " << reqKwInfo.first << endl; + return ParseStatus::RequestWithoutResponse; + } + + return ParseStatus::Success; +} + + +TEST(td_msg_test, msg_type_compatibility_test) { + // cout << TMSG_INFO(TDMT_VND_DROP_TABLE) << endl; + // cout << TMSG_INFO(TDMT_MND_DROP_SUPER_TABLE) << endl; + // cout << TMSG_INFO(TDMT_MND_CREATE_SUPER_TABLE) << endl; + + // int32_t msgSize = sizeof(tMsgTypeInfo) / sizeof(SMsgTypeInfo); + // for (int32_t i = 0; i < msgSize; ++i) { + // SMsgTypeInfo *pInfo = &tMsgTypeInfo[i]; + // cout << i * 2 + 1 << " " << pInfo->name << " " << pInfo->type << endl; + // cout << i * 2 + 2 << " " << pInfo->rspName << " " << pInfo->rspType << endl; + // } + + + // current msgs: to map + unordered_map map; + for (const auto& info : tMsgTypeInfo) { + map[info.name] = &info; + } + + string configFileName = "msgTypeTable.ini"; + string execDir = getExecutableDirectory(); + string configFilePath(execDir + configFileName); + + vector msgTypes; + ParseStatus status = readConfig(configFilePath, msgTypes); + + switch (status) { + case ParseStatus::Success: + for (const auto& stdInfo : msgTypes) { + auto it = map.find(stdInfo.name); + if (it == map.end()) { + FAIL() << "Error: Could not find msg: " << stdInfo.name << "."; + } else { + auto newInfo = it->second; + + ASSERT_STREQ(stdInfo.name.c_str(), newInfo->name); + ASSERT_STREQ(stdInfo.rspName.c_str(), newInfo->rspName); + ASSERT_EQ(stdInfo.type, newInfo->type) + << "Message type mismatch(" << stdInfo.name << "): expected " << stdInfo.type << ", got " << newInfo->type << "."; + ASSERT_EQ(stdInfo.rspType, newInfo->rspType) + << "Message response type mismatch(" << stdInfo.rspName << "): expected " << stdInfo.rspType << ", got " << newInfo->rspType << "."; + } + } + break; + case ParseStatus::FileNotExist: + FAIL() << "Error: The file does not exist, file: " << configFileName << "."; + break; + case ParseStatus::FileNotOpen: + FAIL() << "Error: Could not open the file, file: " << configFileName << "."; + break; + case ParseStatus::ResponseWithoutRequest: + FAIL() << "Error: Found a response message without a matching request."; + break; + case ParseStatus::RequestWithoutResponse: + FAIL() << "Error: A request message was not followed by a matching response."; + break; + default: + FAIL() << "Unknown Error."; + break; + } +} + + +size_t maxLengthOfMsgType() { + size_t maxLen = 0; + for (const auto& info : tMsgTypeInfo) { + maxLen = std::max(maxLen, strlen(info.name)); + maxLen = std::max(maxLen, strlen(info.rspName)); + } + return (maxLen / 4 + 1) * 4; +} + + +void generateConfigFile(const string& filePath) { + size_t maxStringLength = maxLengthOfMsgType(); + std::ofstream file(filePath); + if (!file.is_open()) { + cerr << "Failed to open file for writing, at: " << filePath << "." << endl; + return; + } + + for (const auto& info : tMsgTypeInfo) { + file << std::left << std::setw(maxStringLength) << info.name << "= " << info.type << endl; + file << std::left << std::setw(maxStringLength) << info.rspName << "= " << info.rspType << endl; + } + + if (file.fail()) { + cerr << "An error occurred while writing to the file." << endl; + } else { + cout << "Data successfully written to file: " << filePath << endl; + } + + file.close(); +} + + +void processCommandArgs(int argc, char** argv) { + for (int i = 1; i < argc; ++i) { + if (string(argv[i]) == "--output-config") { + string configFile = (i + 1 < argc) ? argv[++i] : "./msgTypeTable.ini"; + generateConfigFile(configFile); + exit(0); + } + } +} + + +int main(int argc, char **argv) { + processCommandArgs(argc, argv); + + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); } \ No newline at end of file diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 786df6b907..65f695cb8b 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -261,7 +261,7 @@ static void dmPrintVersion() { printf("%s\ntaosd version: %s compatible_version: %s\n", TD_PRODUCT_NAME, version, compatible_version); printf("git: %s\n", gitinfo); #ifdef TD_ENTERPRISE - printf("git: %s\n", gitinfoOfInternal); + printf("gitOfInternal: %s\n", gitinfoOfInternal); #endif printf("build: %s\n", buildinfo); } diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index e4afba6722..e137bcbdec 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -232,6 +232,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_CREATE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_DROP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_CREATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -240,6 +241,7 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_KILL_COMPACT_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_snode/src/smHandle.c b/source/dnode/mgmt/mgmt_snode/src/smHandle.c index 9b07b6a3d8..6a9f2f1275 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smHandle.c +++ b/source/dnode/mgmt/mgmt_snode/src/smHandle.c @@ -75,26 +75,27 @@ SArray *smGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DEPLOY, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RUN, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER; code = 0; _OVER: diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index bfc9e92293..6053c4db80 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -144,7 +144,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { } #if defined(TD_ENTERPRISE) pCfg->tsdbCfg.encryptAlgorithm = pCreate->encryptAlgorithm; - if(pCfg->tsdbCfg.encryptAlgorithm == DND_CA_SM4){ + if (pCfg->tsdbCfg.encryptAlgorithm == DND_CA_SM4) { strncpy(pCfg->tsdbCfg.encryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } #else @@ -160,7 +160,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { pCfg->walCfg.level = pCreate->walLevel; #if defined(TD_ENTERPRISE) pCfg->walCfg.encryptAlgorithm = pCreate->encryptAlgorithm; - if(pCfg->walCfg.encryptAlgorithm == DND_CA_SM4){ + if (pCfg->walCfg.encryptAlgorithm == DND_CA_SM4) { strncpy(pCfg->walCfg.encryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } #else @@ -169,7 +169,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { #if defined(TD_ENTERPRISE) pCfg->tdbEncryptAlgorithm = pCreate->encryptAlgorithm; - if(pCfg->tdbEncryptAlgorithm == DND_CA_SM4){ + if (pCfg->tdbEncryptAlgorithm == DND_CA_SM4) { strncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } #else @@ -278,7 +278,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { req.keepTimeOffset, req.s3ChunkSize, req.s3KeepLocal, req.s3Compact, req.isTsma, req.precision, req.compression, req.minRows, req.maxRows, req.walFsyncPeriod, req.walLevel, req.walRetentionPeriod, req.walRetentionSize, req.walRollPeriod, req.walSegmentSize, req.hashMethod, req.hashBegin, req.hashEnd, req.hashPrefix, req.hashSuffix, - req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict, req.changeVersion, + req.replica, req.selfIndex, req.learnerReplica, req.learnerSelfIndex, req.strict, req.changeVersion, req.encryptAlgorithm); for (int32_t i = 0; i < req.replica; ++i) { @@ -304,8 +304,8 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return -1; } - if(req.encryptAlgorithm == DND_CA_SM4){ - if(strlen(tsEncryptKey) == 0){ + if (req.encryptAlgorithm == DND_CA_SM4) { + if (strlen(tsEncryptKey) == 0) { terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; dError("vgId:%d, failed to create vnode since encrypt key is empty", req.vgId); return -1; @@ -482,7 +482,9 @@ int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { .diskPrimary = pVnode->diskPrimary, }; tstrncpy(wrapperCfg.path, pVnode->path, sizeof(wrapperCfg.path)); - vmCloseVnode(pMgmt, pVnode, false); + + bool commitAndRemoveWal = vnodeShouldRemoveWal(pVnode->pImpl); + vmCloseVnode(pMgmt, pVnode, commitAndRemoveWal); int32_t diskPrimary = wrapperCfg.diskPrimary; char path[TSDB_FILENAME_LEN] = {0}; @@ -737,7 +739,9 @@ int32_t vmProcessAlterVnodeReplicaReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { .diskPrimary = pVnode->diskPrimary, }; tstrncpy(wrapperCfg.path, pVnode->path, sizeof(wrapperCfg.path)); - vmCloseVnode(pMgmt, pVnode, false); + + bool commitAndRemoveWal = vnodeShouldRemoveWal(pVnode->pImpl); + vmCloseVnode(pMgmt, pVnode, commitAndRemoveWal); int32_t diskPrimary = wrapperCfg.diskPrimary; char path[TSDB_FILENAME_LEN] = {0}; @@ -967,6 +971,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 5b1f31e6c6..54a118b666 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -110,10 +110,8 @@ static bool dmCheckDiskSpace() { int32_t dmDiskInit() { SDnode *pDnode = dmInstance(); - SDiskCfg dCfg = {0}; + SDiskCfg dCfg = {.level = 0, .primary = 1, .disable = 0}; tstrncpy(dCfg.dir, tsDataDir, TSDB_FILENAME_LEN); - dCfg.level = 0; - dCfg.primary = 1; SDiskCfg *pDisks = tsDiskCfg; int32_t numOfDisks = tsDiskCfgNum; if (numOfDisks <= 0 || pDisks == NULL) { diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 0bdf5c2640..46e606d3ea 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -103,8 +103,8 @@ typedef enum { TRN_CONFLICT_GLOBAL = 1, TRN_CONFLICT_DB = 2, TRN_CONFLICT_DB_INSIDE = 3, - TRN_CONFLICT_TOPIC = 4, - TRN_CONFLICT_TOPIC_INSIDE = 5, +// TRN_CONFLICT_TOPIC = 4, +// TRN_CONFLICT_TOPIC_INSIDE = 5, TRN_CONFLICT_ARBGROUP = 6, } ETrnConflct; @@ -332,10 +332,10 @@ typedef struct { int8_t sysInfo; int8_t enable; union { - int8_t flag; + uint8_t flag; struct { - int8_t createdb : 1; - int8_t reserve : 7; + uint8_t createdb : 1; + uint8_t reserve : 7; }; }; int32_t acctId; diff --git a/source/dnode/mnode/impl/inc/mndShow.h b/source/dnode/mnode/impl/inc/mndShow.h index 5a3e487e3d..de7068e9ad 100644 --- a/source/dnode/mnode/impl/inc/mndShow.h +++ b/source/dnode/mnode/impl/inc/mndShow.h @@ -23,6 +23,14 @@ extern "C" { #endif +#define COL_DATA_SET_VAL_RET(pData, isNull, pObj) \ + do { \ + if ((code = colDataSetVal(pColInfo, numOfRows, (pData), (isNull))) != 0) { \ + if (pObj) sdbRelease(pSdb, (pObj)); \ + return code; \ + } \ + } while (0) + int32_t mndInitShow(SMnode *pMnode); void mndCleanupShow(SMnode *pMnode); void mndAddShowRetrieveHandle(SMnode *pMnode, EShowType showType, ShowRetrieveFp fp); diff --git a/source/dnode/mnode/impl/inc/mndStream.h b/source/dnode/mnode/impl/inc/mndStream.h index 6aed50e508..dade7b4bdf 100644 --- a/source/dnode/mnode/impl/inc/mndStream.h +++ b/source/dnode/mnode/impl/inc/mndStream.h @@ -26,13 +26,14 @@ extern "C" { #define MND_STREAM_RESERVE_SIZE 64 #define MND_STREAM_VER_NUMBER 5 -#define MND_STREAM_CREATE_NAME "stream-create" -#define MND_STREAM_CHECKPOINT_NAME "stream-checkpoint" -#define MND_STREAM_PAUSE_NAME "stream-pause" -#define MND_STREAM_RESUME_NAME "stream-resume" -#define MND_STREAM_DROP_NAME "stream-drop" -#define MND_STREAM_TASK_RESET_NAME "stream-task-reset" -#define MND_STREAM_TASK_UPDATE_NAME "stream-task-update" +#define MND_STREAM_CREATE_NAME "stream-create" +#define MND_STREAM_CHECKPOINT_NAME "stream-checkpoint" +#define MND_STREAM_PAUSE_NAME "stream-pause" +#define MND_STREAM_RESUME_NAME "stream-resume" +#define MND_STREAM_DROP_NAME "stream-drop" +#define MND_STREAM_TASK_RESET_NAME "stream-task-reset" +#define MND_STREAM_TASK_UPDATE_NAME "stream-task-update" +#define MND_STREAM_CHKPT_UPDATE_NAME "stream-chkpt-update" typedef struct SStreamTransInfo { int64_t startTime; @@ -51,6 +52,7 @@ typedef struct SStreamTransMgmt { } SStreamTransMgmt; typedef struct SStreamExecInfo { + bool initTaskList; SArray *pNodeList; int64_t ts; // snapshot ts SStreamTransMgmt transMgmt; @@ -58,6 +60,7 @@ typedef struct SStreamExecInfo { SArray *pTaskList; TdThreadMutex lock; SHashObj *pTransferStateStreams; + SHashObj *pChkptStreams; } SStreamExecInfo; extern SStreamExecInfo execInfo; @@ -78,7 +81,18 @@ typedef struct SOrphanTask { typedef struct { SMsgHead head; -} SMStreamHbRspMsg, SMStreamReqCheckpointRspMsg; +} SMStreamHbRspMsg, SMStreamReqCheckpointRsp, SMStreamUpdateChkptRsp; + +typedef struct STaskChkptInfo { + int32_t nodeId; + int32_t taskId; + int64_t streamId; + int64_t checkpointId; + int64_t version; + int64_t ts; + int32_t transId; + int8_t dropHTask; +}STaskChkptInfo; int32_t mndInitStream(SMnode *pMnode); void mndCleanupStream(SMnode *pMnode); @@ -96,7 +110,7 @@ int32_t mndGetNumOfStreamTasks(const SStreamObj *pStream); SArray *mndTakeVgroupSnapshot(SMnode *pMnode, bool *allReady); void mndKillTransImpl(SMnode *pMnode, int32_t transId, const char *pDbName); int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset, - int32_t retryCode); + int32_t retryCode, int32_t acceptCode); STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name, const char *pMsg); int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status); SSdbRaw *mndStreamActionEncode(SStreamObj *pStream); @@ -114,14 +128,19 @@ int32_t mndStreamSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamObj *p int32_t mndStreamSetDropActionFromList(SMnode *pMnode, STrans *pTrans, SArray *pList); int32_t mndStreamSetResetTaskAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream); int32_t mndCreateStreamResetStatusTrans(SMnode *pMnode, SStreamObj *pStream); +int32_t mndStreamSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream); +int32_t mndCreateStreamChkptInfoUpdateTrans(SMnode *pMnode, SStreamObj *pStream, SArray *pChkptInfoList); +int32_t mndScanCheckpointReportInfo(SRpcMsg *pReq); +void removeTasksInBuf(SArray *pTaskIds, SStreamExecInfo *pExecInfo); SStreamTaskIter *createStreamTaskIter(SStreamObj *pStream); void destroyStreamTaskIter(SStreamTaskIter *pIter); bool streamTaskIterNextTask(SStreamTaskIter *pIter); SStreamTask *streamTaskIterGetCurrent(SStreamTaskIter *pIter); void mndInitExecInfo(); -void removeExpiredNodeInfo(const SArray *pNodeSnapshot); -void removeTasksInBuf(SArray* pTaskIds, SStreamExecInfo* pExecInfo); +void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo); +int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot); +void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/inc/mndUser.h b/source/dnode/mnode/impl/inc/mndUser.h index 907ec86623..5782890f73 100644 --- a/source/dnode/mnode/impl/inc/mndUser.h +++ b/source/dnode/mnode/impl/inc/mndUser.h @@ -53,6 +53,7 @@ void mndUpdateIpWhiteForAllUser(SMnode *pMnode, char *user, char *fqdn, int8_t t int32_t mndRefreshUserIpWhiteList(SMnode *pMnode); +int64_t mndGetUserIpWhiteListVer(SMnode *pMnode, SUserObj *pUser); #ifdef __cplusplus } #endif diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index f2b279276e..31ebc6609d 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -280,6 +280,7 @@ static int32_t mndCreateDefaultCluster(SMnode *pMnode) { static int32_t mndRetrieveClusters(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { SMnode *pMnode = pMsg->info.node; SSdb *pSdb = pMnode->pSdb; + int32_t code = 0; int32_t numOfRows = 0; int32_t cols = 0; SClusterObj *pCluster = NULL; @@ -290,31 +291,44 @@ static int32_t mndRetrieveClusters(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock * cols = 0; SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, (const char *)&pCluster->id, false); + COL_DATA_SET_VAL_RET((const char *)&pCluster->id, false, pCluster); char buf[tListLen(pCluster->name) + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(buf, pCluster->name, pShow->pMeta->pSchemas[cols].bytes); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, buf, false); + COL_DATA_SET_VAL_RET(buf, false, pCluster); int32_t upTime = mndGetClusterUpTimeImp(pCluster); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, (const char *)&upTime, false); + COL_DATA_SET_VAL_RET((const char *)&upTime, false, pCluster); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, (const char *)&pCluster->createdTime, false); + COL_DATA_SET_VAL_RET((const char *)&pCluster->createdTime, false, pCluster); char ver[12] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(ver, tsVersionName, pShow->pMeta->pSchemas[cols].bytes); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataSetVal(pColInfo, numOfRows, (const char *)ver, false); + COL_DATA_SET_VAL_RET((const char *)ver, false, pCluster); - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - if (tsExpireTime <= 0) { + char expireTime[25] = {0}; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + if (GRANT_EXPIRE_UNLIMITED(tsExpireTime / 1000)) { + STR_WITH_MAXSIZE_TO_VARSTR(expireTime, "unlimited", pShow->pMeta->pSchemas[cols].bytes); + COL_DATA_SET_VAL_RET(expireTime, false, pCluster); + } else if (tsExpireTime <= 0) { colDataSetNULL(pColInfo, numOfRows); } else { - colDataSetVal(pColInfo, numOfRows, (const char *)&tsExpireTime, false); + char ts[20] = {0}; + time_t expireSec = tsExpireTime / 1000; + struct tm ptm; + if (taosLocalTime(&expireSec, &ptm, ts) != NULL) { + strftime(ts, 20, "%Y-%m-%d %H:%M:%S", &ptm); + } else { + ts[0] = 0; + } + STR_WITH_MAXSIZE_TO_VARSTR(expireTime, ts, pShow->pMeta->pSchemas[cols].bytes); + COL_DATA_SET_VAL_RET(expireTime, false, pCluster); } sdbRelease(pSdb, pCluster); diff --git a/source/dnode/mnode/impl/src/mndCompact.c b/source/dnode/mnode/impl/src/mndCompact.c index 75b4531dbb..abbcb52db4 100644 --- a/source/dnode/mnode/impl/src/mndCompact.c +++ b/source/dnode/mnode/impl/src/mndCompact.c @@ -13,20 +13,19 @@ * along with this program. If not, see . */ #include "mndCompact.h" -#include "mndTrans.h" -#include "mndShow.h" -#include "mndDb.h" -#include "mndCompactDetail.h" -#include "mndVgroup.h" -#include "tmsgcb.h" -#include "mndDnode.h" -#include "tmisce.h" #include "audit.h" +#include "mndCompactDetail.h" +#include "mndDb.h" +#include "mndDnode.h" #include "mndPrivilege.h" +#include "mndShow.h" #include "mndTrans.h" +#include "mndVgroup.h" +#include "tmisce.h" +#include "tmsgcb.h" #define MND_COMPACT_VER_NUMBER 1 -#define MND_COMPACT_ID_LEN 11 +#define MND_COMPACT_ID_LEN 11 static int32_t mndProcessCompactTimer(SRpcMsg *pReq); @@ -50,12 +49,9 @@ int32_t mndInitCompact(SMnode *pMnode) { return sdbSetTable(pMnode->pSdb, table); } -void mndCleanupCompact(SMnode *pMnode) { - mDebug("mnd compact cleanup"); -} +void mndCleanupCompact(SMnode *pMnode) { mDebug("mnd compact cleanup"); } -void tFreeCompactObj(SCompactObj *pCompact) { -} +void tFreeCompactObj(SCompactObj *pCompact) {} int32_t tSerializeSCompactObj(void *buf, int32_t bufLen, const SCompactObj *pObj) { SEncoder encoder = {0}; @@ -75,7 +71,7 @@ int32_t tSerializeSCompactObj(void *buf, int32_t bufLen, const SCompactObj *pObj } int32_t tDeserializeSCompactObj(void *buf, int32_t bufLen, SCompactObj *pObj) { - int8_t ex = 0; + int8_t ex = 0; SDecoder decoder = {0}; tDecoderInit(&decoder, buf, bufLen); @@ -94,7 +90,7 @@ int32_t tDeserializeSCompactObj(void *buf, int32_t bufLen, SCompactObj *pObj) { SSdbRaw *mndCompactActionEncode(SCompactObj *pCompact) { terrno = TSDB_CODE_SUCCESS; - void *buf = NULL; + void *buf = NULL; SSdbRaw *pRaw = NULL; int32_t tlen = tSerializeSCompactObj(NULL, 0, pCompact); @@ -102,8 +98,8 @@ SSdbRaw *mndCompactActionEncode(SCompactObj *pCompact) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto OVER; } - - int32_t size = sizeof(int32_t) + tlen; + + int32_t size = sizeof(int32_t) + tlen; pRaw = sdbAllocRaw(SDB_COMPACT, MND_COMPACT_VER_NUMBER, size); if (pRaw == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -127,7 +123,6 @@ SSdbRaw *mndCompactActionEncode(SCompactObj *pCompact) { SDB_SET_BINARY(pRaw, dataPos, buf, tlen, OVER); SDB_SET_DATALEN(pRaw, dataPos, OVER); - OVER: taosMemoryFreeClear(buf); if (terrno != TSDB_CODE_SUCCESS) { @@ -141,9 +136,9 @@ OVER: } SSdbRow *mndCompactActionDecode(SSdbRaw *pRaw) { - SSdbRow *pRow = NULL; - SCompactObj *pCompact = NULL; - void *buf = NULL; + SSdbRow *pRow = NULL; + SCompactObj *pCompact = NULL; + void *buf = NULL; terrno = TSDB_CODE_SUCCESS; int8_t sver = 0; @@ -184,7 +179,7 @@ SSdbRow *mndCompactActionDecode(SSdbRaw *pRaw) { goto OVER; } - //taosInitRWLatch(&pView->lock); + // taosInitRWLatch(&pView->lock); OVER: taosMemoryFreeClear(buf); @@ -210,15 +205,15 @@ int32_t mndCompactActionDelete(SSdb *pSdb, SCompactObj *pCompact) { } int32_t mndCompactActionUpdate(SSdb *pSdb, SCompactObj *pOldCompact, SCompactObj *pNewCompact) { - mTrace("compact:%" PRId32 ", perform update action, old row:%p new row:%p", - pOldCompact->compactId, pOldCompact, pNewCompact); + mTrace("compact:%" PRId32 ", perform update action, old row:%p new row:%p", pOldCompact->compactId, pOldCompact, + pNewCompact); return 0; } SCompactObj *mndAcquireCompact(SMnode *pMnode, int64_t compactId) { - SSdb *pSdb = pMnode->pSdb; - SCompactObj *pCompact = sdbAcquire(pSdb, SDB_COMPACT, &compactId); + SSdb *pSdb = pMnode->pSdb; + SCompactObj *pCompact = sdbAcquire(pSdb, SDB_COMPACT, &compactId); if (pCompact == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { terrno = TSDB_CODE_SUCCESS; } @@ -230,8 +225,8 @@ void mndReleaseCompact(SMnode *pMnode, SCompactObj *pCompact) { sdbRelease(pSdb, pCompact); } -//compact db -int32_t mndAddCompactToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompact, SDbObj *pDb, SCompactDbRsp *rsp){ +// compact db +int32_t mndAddCompactToTran(SMnode *pMnode, STrans *pTrans, SCompactObj *pCompact, SDbObj *pDb, SCompactDbRsp *rsp) { pCompact->compactId = tGenIdPI32(); strcpy(pCompact->dbname, pDb->name); @@ -251,18 +246,19 @@ int32_t mndAddCompactToTran(SMnode *pMnode, STrans *pTrans, SCompactObj* pCompac return 0; } -//retrieve compact -int32_t mndRetrieveCompact(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows){ - SMnode *pMnode = pReq->info.node; - SSdb *pSdb = pMnode->pSdb; - int32_t numOfRows = 0; - SCompactObj *pCompact = NULL; - char *sep = NULL; - SDbObj *pDb = NULL; - +// retrieve compact +int32_t mndRetrieveCompact(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + SCompactObj *pCompact = NULL; + char *sep = NULL; + SDbObj *pDb = NULL; + if (strlen(pShow->db) > 0) { sep = strchr(pShow->db, '.'); - if (sep && ((0 == strcmp(sep + 1, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcmp(sep + 1, TSDB_PERFORMANCE_SCHEMA_DB))))) { + if (sep && + ((0 == strcmp(sep + 1, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcmp(sep + 1, TSDB_PERFORMANCE_SCHEMA_DB))))) { sep++; } else { pDb = mndAcquireDb(pMnode, pShow->db); @@ -306,9 +302,9 @@ int32_t mndRetrieveCompact(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, return numOfRows; } -//kill compact -static void *mndBuildKillCompactReq(SMnode *pMnode, SVgObj *pVgroup, int32_t *pContLen, - int32_t compactId, int32_t dnodeid) { +// kill compact +static void *mndBuildKillCompactReq(SMnode *pMnode, SVgObj *pVgroup, int32_t *pContLen, int32_t compactId, + int32_t dnodeid) { SVKillCompactReq req = {0}; req.compactId = compactId; req.vgId = pVgroup->vgId; @@ -337,8 +333,8 @@ static void *mndBuildKillCompactReq(SMnode *pMnode, SVgObj *pVgroup, int32_t *pC return pReq; } -static int32_t mndAddKillCompactAction(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, - int32_t compactId, int32_t dnodeid) { +static int32_t mndAddKillCompactAction(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, int32_t compactId, + int32_t dnodeid) { STransAction action = {0}; SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeid); @@ -365,7 +361,7 @@ static int32_t mndAddKillCompactAction(SMnode *pMnode, STrans *pTrans, SVgObj *p static int32_t mndKillCompact(SMnode *pMnode, SRpcMsg *pReq, SCompactObj *pCompact) { STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB, pReq, "kill-compact"); if (pTrans == NULL) { - mError("compact:%" PRId32 ", failed to drop since %s" , pCompact->compactId, terrstr()); + mError("compact:%" PRId32 ", failed to drop since %s", pCompact->compactId, terrstr()); return -1; } mInfo("trans:%d, used to kill compact:%" PRId32, pTrans->id, pCompact->compactId); @@ -388,13 +384,13 @@ static int32_t mndKillCompact(SMnode *pMnode, SRpcMsg *pReq, SCompactObj *pCompa if (pDetail->compactId == pCompact->compactId) { SVgObj *pVgroup = mndAcquireVgroup(pMnode, pDetail->vgId); - if(pVgroup == NULL){ + if (pVgroup == NULL) { mError("trans:%d, failed to append redo action since %s", pTrans->id, terrstr()); mndTransDrop(pTrans); return -1; } - if(mndAddKillCompactAction(pMnode, pTrans, pVgroup, pCompact->compactId, pDetail->dnodeId) != 0){ + if (mndAddKillCompactAction(pMnode, pTrans, pVgroup, pCompact->compactId, pDetail->dnodeId) != 0) { mError("trans:%d, failed to append redo action since %s", pTrans->id, terrstr()); mndTransDrop(pTrans); return -1; @@ -426,7 +422,7 @@ static int32_t mndKillCompact(SMnode *pMnode, SRpcMsg *pReq, SCompactObj *pCompa return 0; } -int32_t mndProcessKillCompactReq(SRpcMsg *pReq){ +int32_t mndProcessKillCompactReq(SRpcMsg *pReq) { SKillCompactReq killCompactReq = {0}; if (tDeserializeSKillCompactReq(pReq->pCont, pReq->contLen, &killCompactReq) != 0) { terrno = TSDB_CODE_INVALID_MSG; @@ -435,10 +431,10 @@ int32_t mndProcessKillCompactReq(SRpcMsg *pReq){ mInfo("start to kill compact:%" PRId32, killCompactReq.compactId); - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SCompactObj *pCompact = mndAcquireCompact(pMnode, killCompactReq.compactId); - if(pCompact == NULL){ + SMnode *pMnode = pReq->info.node; + int32_t code = -1; + SCompactObj *pCompact = mndAcquireCompact(pMnode, killCompactReq.compactId); + if (pCompact == NULL) { terrno = TSDB_CODE_MND_INVALID_COMPACT_ID; tFreeSKillCompactReq(&killCompactReq); return -1; @@ -470,9 +466,10 @@ _OVER: return code; } -//update progress -static int32_t mndUpdateCompactProgress(SMnode *pMnode, SRpcMsg *pReq, int32_t compactId, SQueryCompactProgressRsp* rsp) { - void* pIter = NULL; +// update progress +static int32_t mndUpdateCompactProgress(SMnode *pMnode, SRpcMsg *pReq, int32_t compactId, + SQueryCompactProgressRsp *rsp) { + void *pIter = NULL; while (1) { SCompactDetailObj *pDetail = NULL; pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); @@ -493,36 +490,36 @@ static int32_t mndUpdateCompactProgress(SMnode *pMnode, SRpcMsg *pReq, int32_t c return TSDB_CODE_MND_COMPACT_DETAIL_NOT_EXIST; } -int32_t mndProcessQueryCompactRsp(SRpcMsg *pReq){ +int32_t mndProcessQueryCompactRsp(SRpcMsg *pReq) { SQueryCompactProgressRsp req = {0}; - int32_t code = 0; + int32_t code = 0; code = tDeserializeSQueryCompactProgressRsp(pReq->pCont, pReq->contLen, &req); if (code != 0) { terrno = TSDB_CODE_INVALID_MSG; - mError("failed to deserialize vnode-query-compact-progress-rsp, ret:%d, pCont:%p, len:%d", - code, pReq->pCont, pReq->contLen); + mError("failed to deserialize vnode-query-compact-progress-rsp, ret:%d, pCont:%p, len:%d", code, pReq->pCont, + pReq->contLen); return -1; } - mDebug("compact:%d, receive query response, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", - req.compactId, req.vgId, req.dnodeId, req.numberFileset, req.finished); + mDebug("compact:%d, receive query response, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", req.compactId, + req.vgId, req.dnodeId, req.numberFileset, req.finished); - SMnode *pMnode = pReq->info.node; + SMnode *pMnode = pReq->info.node; code = mndUpdateCompactProgress(pMnode, pReq, req.compactId, &req); - if(code != 0){ + if (code != 0) { terrno = code; - mError("compact:%d, failed to update progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", - req.compactId, req.vgId, req.dnodeId, req.numberFileset, req.finished); + mError("compact:%d, failed to update progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", req.compactId, + req.vgId, req.dnodeId, req.numberFileset, req.finished); return -1; } return 0; } -//timer -void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact){ - void *pIter = NULL; +// timer +void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact) { + void *pIter = NULL; while (1) { SCompactDetailObj *pDetail = NULL; @@ -532,8 +529,8 @@ void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact){ if (pDetail->compactId == pCompact->compactId) { SEpSet epSet = {0}; - SDnodeObj *pDnode = mndAcquireDnode(pMnode, pDetail->dnodeId); - if(pDnode == NULL) break; + SDnodeObj *pDnode = mndAcquireDnode(pMnode, pDetail->dnodeId); + if (pDnode == NULL) break; addEpIntoEpSet(&epSet, pDnode->fqdn, pDnode->port); mndReleaseDnode(pMnode, pDnode); @@ -555,31 +552,29 @@ void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact){ sdbCancelFetch(pMnode->pSdb, pDetail); sdbRelease(pMnode->pSdb, pDetail); continue; - } + } pHead->contLen = htonl(contLen); pHead->vgId = htonl(pDetail->vgId); tSerializeSQueryCompactProgressReq((char *)pHead + sizeof(SMsgHead), contLen - sizeof(SMsgHead), &req); - SRpcMsg rpcMsg = {.msgType = TDMT_VND_QUERY_COMPACT_PROGRESS, - .contLen = contLen}; - - //rpcMsg.pCont = rpcMallocCont(contLen); - //if (rpcMsg.pCont == NULL) { - // return; - //} + SRpcMsg rpcMsg = {.msgType = TDMT_VND_QUERY_COMPACT_PROGRESS, .contLen = contLen}; - //memcpy(rpcMsg.pCont, pHead, contLen); + // rpcMsg.pCont = rpcMallocCont(contLen); + // if (rpcMsg.pCont == NULL) { + // return; + // } + + // memcpy(rpcMsg.pCont, pHead, contLen); rpcMsg.pCont = pHead; char detail[1024] = {0}; - int32_t len = snprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", TMSG_INFO(TDMT_VND_QUERY_COMPACT_PROGRESS), - epSet.numOfEps, epSet.inUse); + int32_t len = snprintf(detail, sizeof(detail), "msgType:%s numOfEps:%d inUse:%d", + TMSG_INFO(TDMT_VND_QUERY_COMPACT_PROGRESS), epSet.numOfEps, epSet.inUse); for (int32_t i = 0; i < epSet.numOfEps; ++i) { - len += snprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, epSet.eps[i].fqdn, - epSet.eps[i].port); + len += snprintf(detail + len, sizeof(detail) - len, " ep:%d-%s:%u", i, epSet.eps[i].fqdn, epSet.eps[i].port); } mDebug("compact:%d, send update progress msg to %s", pDetail->compactId, detail); @@ -592,40 +587,51 @@ void mndCompactSendProgressReq(SMnode *pMnode, SCompactObj *pCompact){ } static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { - bool needSave = false; - void* pIter = NULL; + bool needSave = false; + void *pIter = NULL; while (1) { SCompactDetailObj *pDetail = NULL; pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); if (pIter == NULL) break; if (pDetail->compactId == compactId) { - mDebug("compact:%d, check save progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " - "newNumberFileset:%d, newFinished:%d", - pDetail->compactId, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, - pDetail->newNumberFileset, pDetail->newFinished); + mDebug( + "compact:%d, check save progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " + "newNumberFileset:%d, newFinished:%d", + pDetail->compactId, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, + pDetail->newNumberFileset, pDetail->newFinished); - //these 2 number will jump back after dnode restart, so < is not used here - if(pDetail->numberFileset != pDetail->newNumberFileset || pDetail->finished != pDetail->newFinished) + // these 2 number will jump back after dnode restart, so < is not used here + if (pDetail->numberFileset != pDetail->newNumberFileset || pDetail->finished != pDetail->newFinished) needSave = true; } sdbRelease(pMnode->pSdb, pDetail); } - if(!needSave) { - mDebug("compact:%" PRId32 ", no need to save" , compactId); + SCompactObj *pCompact = mndAcquireCompact(pMnode, compactId); + if (pCompact == NULL) return 0; + + SDbObj *pDb = mndAcquireDb(pMnode, pCompact->dbname); + if (pDb == NULL) { + needSave = true; + mWarn("compact:%" PRId32 ", no db exist, set needSave:%s", compactId, pCompact->dbname); + } else { + mndReleaseDb(pMnode, pDb); + pDb = NULL; + } + + if (!needSave) { + mDebug("compact:%" PRId32 ", no need to save", compactId); return 0; } STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB, NULL, "update-compact-progress"); if (pTrans == NULL) { - mError("trans:%" PRId32 ", failed to create since %s" , pTrans->id, terrstr()); + mError("trans:%" PRId32 ", failed to create since %s", pTrans->id, terrstr()); return -1; } mInfo("compact:%d, trans:%d, used to update compact progress.", compactId, pTrans->id); - - SCompactObj *pCompact = mndAcquireCompact(pMnode, compactId); mndTransSetDbName(pTrans, pCompact->dbname, NULL); @@ -636,14 +642,15 @@ static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { if (pIter == NULL) break; if (pDetail->compactId == compactId) { - mInfo("compact:%d, trans:%d, check compact progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " - "newNumberFileset:%d, newFinished:%d", - pDetail->compactId, pTrans->id, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, - pDetail->newNumberFileset, pDetail->newFinished); + mInfo( + "compact:%d, trans:%d, check compact progress, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d, " + "newNumberFileset:%d, newFinished:%d", + pDetail->compactId, pTrans->id, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished, + pDetail->newNumberFileset, pDetail->newFinished); pDetail->numberFileset = pDetail->newNumberFileset; pDetail->finished = pDetail->newFinished; - + SSdbRaw *pCommitRaw = mndCompactDetailActionEncode(pDetail); if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { mError("compact:%d, trans:%d, failed to append commit log since %s", pDetail->compactId, pTrans->id, terrstr()); @@ -657,22 +664,22 @@ static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { } bool allFinished = true; + pIter = NULL; while (1) { SCompactDetailObj *pDetail = NULL; pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); if (pIter == NULL) break; - if(pDetail->compactId == compactId){ - mInfo("compact:%d, trans:%d, check compact finished, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", - pDetail->compactId, pTrans->id, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished); + if (pDetail->compactId == compactId) { + mInfo("compact:%d, trans:%d, check compact finished, vgId:%d, dnodeId:%d, numberFileset:%d, finished:%d", + pDetail->compactId, pTrans->id, pDetail->vgId, pDetail->dnodeId, pDetail->numberFileset, pDetail->finished); - if(pDetail->numberFileset == -1 && pDetail->finished == -1){ + if (pDetail->numberFileset == -1 && pDetail->finished == -1) { allFinished = false; sdbRelease(pMnode->pSdb, pDetail); break; } - if (pDetail->numberFileset != -1 && pDetail->finished != -1 && - pDetail->numberFileset != pDetail->finished) { + if (pDetail->numberFileset != -1 && pDetail->finished != -1 && pDetail->numberFileset != pDetail->finished) { allFinished = false; sdbRelease(pMnode->pSdb, pDetail); break; @@ -682,21 +689,33 @@ static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { sdbRelease(pMnode->pSdb, pDetail); } - if(allFinished){ + pDb = mndAcquireDb(pMnode, pCompact->dbname); + if (pDb == NULL) { + allFinished = true; + mWarn("compact:%" PRId32 ", no db exist, set all finished:%s", compactId, pCompact->dbname); + } else { + mndReleaseDb(pMnode, pDb); + pDb = NULL; + } + + if (allFinished) { mInfo("compact:%d, all finished", pCompact->compactId); + pIter = NULL; while (1) { SCompactDetailObj *pDetail = NULL; pIter = sdbFetch(pMnode->pSdb, SDB_COMPACT_DETAIL, pIter, (void **)&pDetail); if (pIter == NULL) break; - if (pDetail->compactId == pCompact->compactId) { + if (pDetail->compactId == pCompact->compactId) { SSdbRaw *pCommitRaw = mndCompactDetailActionEncode(pDetail); if (pCommitRaw == NULL || mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) { - mError("compact:%d, trans:%d, failed to append commit log since %s", pDetail->compactId, pTrans->id, terrstr()); + mError("compact:%d, trans:%d, failed to append commit log since %s", pDetail->compactId, pTrans->id, + terrstr()); mndTransDrop(pTrans); return -1; } (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED); + mInfo("compact:%d, add drop compactdetail action", pDetail->compactDetailId); } sdbRelease(pMnode->pSdb, pDetail); @@ -709,6 +728,7 @@ static int32_t mndSaveCompactProgress(SMnode *pMnode, int32_t compactId) { return -1; } (void)sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED); + mInfo("compact:%d, add drop compact action", pCompact->compactId); } if (mndTransPrepare(pMnode, pTrans) != 0) { @@ -739,8 +759,8 @@ void mndCompactPullup(SMnode *pMnode) { for (int32_t i = 0; i < taosArrayGetSize(pArray); ++i) { mInfo("begin to pull up"); - int32_t *pCompactId = taosArrayGet(pArray, i); - SCompactObj *pCompact = mndAcquireCompact(pMnode, *pCompactId); + int32_t *pCompactId = taosArrayGet(pArray, i); + SCompactObj *pCompact = mndAcquireCompact(pMnode, *pCompactId); if (pCompact != NULL) { mInfo("compact:%d, begin to pull up", pCompact->compactId); mndCompactSendProgressReq(pMnode, pCompact); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 3eef2afcc1..9a7a8155ec 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -91,7 +91,7 @@ void mndSendConsumerMsg(SMnode *pMnode, int64_t consumerId, uint16_t msgType, SR } } -static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *pMnode, const char *pUser, +static int32_t validateTopics(const SArray *pTopicList, SMnode *pMnode, const char *pUser, bool enableReplay) { SMqTopicObj *pTopic = NULL; int32_t code = 0; @@ -135,11 +135,6 @@ static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode * } } - mndTransSetDbName(pTrans, pOneTopic, NULL); - if (mndTransCheckConflict(pMnode, pTrans) != 0) { - code = -1; - goto FAILED; - } mndReleaseTopic(pMnode, pTopic); } @@ -177,12 +172,12 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) { goto END; } - pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC, pMsg, "recover-csm"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pMsg, "recover-csm"); if (pTrans == NULL) { code = -1; goto END; } - code = validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false); + code = validateTopics(pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false); if (code != 0) { goto END; } @@ -675,13 +670,13 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { goto _over; } - pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "subscribe"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pMsg, "subscribe"); if (pTrans == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _over; } - code = validateTopics(pTrans, subscribe.topicNames, pMnode, pMsg->info.conn.user, subscribe.enableReplay); + code = validateTopics(subscribe.topicNames, pMnode, pMsg->info.conn.user, subscribe.enableReplay); if (code != TSDB_CODE_SUCCESS) { goto _over; } diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index d12f73cee6..78e3ceabce 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -495,6 +495,16 @@ static int32_t mndCheckInChangeDbCfg(SMnode *pMnode, SDbCfg *pOldCfg, SDbCfg *pN #else if (pNewCfg->replications != 1 && pNewCfg->replications != 3) return -1; #endif + + if (pNewCfg->walLevel == 0 && pOldCfg->replications > 1) { + terrno = TSDB_CODE_MND_INVALID_WAL_LEVEL; + return -1; + } + if (pNewCfg->replications > 1 && pOldCfg->walLevel == 0) { + terrno = TSDB_CODE_MND_INVALID_WAL_LEVEL; + return -1; + } + if (pNewCfg->sstTrigger < TSDB_MIN_STT_TRIGGER || pNewCfg->sstTrigger > TSDB_MAX_STT_TRIGGER) return -1; if (pNewCfg->minRows < TSDB_MIN_MINROWS_FBLOCK || pNewCfg->minRows > TSDB_MAX_MINROWS_FBLOCK) return -1; if (pNewCfg->maxRows < TSDB_MIN_MAXROWS_FBLOCK || pNewCfg->maxRows > TSDB_MAX_MAXROWS_FBLOCK) return -1; diff --git a/source/dnode/mnode/impl/src/mndInfoSchema.c b/source/dnode/mnode/impl/src/mndInfoSchema.c index 2c7eca28ae..0a98a01b22 100644 --- a/source/dnode/mnode/impl/src/mndInfoSchema.c +++ b/source/dnode/mnode/impl/src/mndInfoSchema.c @@ -75,7 +75,13 @@ int32_t mndBuildInsTableSchema(SMnode *pMnode, const char *dbFName, const char * return -1; } - STableMetaRsp *pMeta = taosHashGet(pMnode->infosMeta, tbName, strlen(tbName)); + STableMetaRsp *pMeta = NULL; + if (strcmp(tbName, TSDB_INS_TABLE_USERS_FULL) == 0) { + pMeta = taosHashGet(pMnode->infosMeta, TSDB_INS_TABLE_USERS_FULL, strlen(tbName)); + } else { + pMeta = taosHashGet(pMnode->infosMeta, tbName, strlen(tbName)); + } + if (NULL == pMeta) { mError("invalid information schema table name:%s", tbName); terrno = TSDB_CODE_PAR_TABLE_NOT_EXIST; diff --git a/source/dnode/mnode/impl/src/mndPrivilege.c b/source/dnode/mnode/impl/src/mndPrivilege.c index 13a80cb1a6..fd7f9e5fb3 100644 --- a/source/dnode/mnode/impl/src/mndPrivilege.c +++ b/source/dnode/mnode/impl/src/mndPrivilege.c @@ -31,7 +31,6 @@ int32_t mndCheckDbPrivilegeByName(SMnode *pMnode, const char *user, EOperType op int32_t mndCheckTopicPrivilege(SMnode *pMnode, const char *user, EOperType operType, SMqTopicObj *pTopic) { return 0; } - int32_t mndSetUserWhiteListRsp(SMnode *pMnode, SUserObj *pUser, SGetUserWhiteListRsp *pWhiteListRsp) { memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN); pWhiteListRsp->numWhiteLists = 1; @@ -41,25 +40,6 @@ int32_t mndSetUserWhiteListRsp(SMnode *pMnode, SUserObj *pUser, SGetUserWhiteLis } memset(pWhiteListRsp->pWhiteLists, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// if (tsEnableWhiteList) { -// memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN); -// pWhiteListRsp->numWhiteLists = pUser->pIpWhiteList->num; -// pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// if (pWhiteListRsp->pWhiteLists == NULL) { -// return TSDB_CODE_OUT_OF_MEMORY; -// } -// memcpy(pWhiteListRsp->pWhiteLists, pUser->pIpWhiteList->pIpRange, -// pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// } else { -// memcpy(pWhiteListRsp->user, pUser->user, TSDB_USER_LEN); -// pWhiteListRsp->numWhiteLists = 1; -// pWhiteListRsp->pWhiteLists = taosMemoryMalloc(pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// if (pWhiteListRsp->pWhiteLists == NULL) { -// return TSDB_CODE_OUT_OF_MEMORY; -// } -// memset(pWhiteListRsp->pWhiteLists, 0, pWhiteListRsp->numWhiteLists * sizeof(SIpV4Range)); -// } - return 0; } @@ -70,7 +50,7 @@ int32_t mndSetUserAuthRsp(SMnode *pMnode, SUserObj *pUser, SGetUserAuthRsp *pRsp pRsp->sysInfo = pUser->sysInfo; pRsp->version = pUser->authVersion; pRsp->passVer = pUser->passVersion; - pRsp->whiteListVer = pUser->ipWhiteListVer; + pRsp->whiteListVer = mndGetUserIpWhiteListVer(pMnode, pUser); return 0; } diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index 2b83419dce..db268c28de 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -299,7 +299,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) { connectRsp.svrTimestamp = taosGetTimestampSec(); connectRsp.passVer = pUser->passVersion; connectRsp.authVer = pUser->authVersion; - connectRsp.whiteListVer = pUser->ipWhiteListVer; + connectRsp.whiteListVer = mndGetUserIpWhiteListVer(pMnode, pUser); connectRsp.monitorParas.tsEnableMonitor = tsEnableMonitor; connectRsp.monitorParas.tsMonitorInterval = tsMonitorInterval; connectRsp.monitorParas.tsSlowLogScope = tsSlowLogScope; diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 5dcd7b3d38..444ed3d750 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -89,6 +89,8 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { // type = TSDB_MGMT_TABLE_DIST; } else if (strncasecmp(name, TSDB_INS_TABLE_USERS, len) == 0) { type = TSDB_MGMT_TABLE_USER; + } else if (strncasecmp(name, TSDB_INS_TABLE_USERS_FULL, len) == 0) { + type = TSDB_MGMT_TABLE_USER_FULL; } else if (strncasecmp(name, TSDB_INS_TABLE_LICENCES, len) == 0) { type = TSDB_MGMT_TABLE_GRANTS; } else if (strncasecmp(name, TSDB_INS_TABLE_VGROUPS, len) == 0) { @@ -276,6 +278,13 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { if (retrieveReq.db[0] && mndCheckShowPrivilege(pMnode, pReq->info.conn.user, pShow->type, retrieveReq.db) != 0) { return -1; } + if (pShow->type == TSDB_MGMT_TABLE_USER_FULL) { + if(strcmp(pReq->info.conn.user, "root") != 0){ + mError("The operation is not permitted, user:%s, pShow->type:%d", pReq->info.conn.user, pShow->type); + terrno = TSDB_CODE_MND_NO_RIGHTS; + return -1; + } + } int32_t numOfCols = pShow->pMeta->numOfColumns; diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 0d3affe6e5..8abcd1e9c8 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -1766,7 +1766,7 @@ static int32_t mndUpdateSuperTableColumnCompress(SMnode *pMnode, const SStbObj * uint32_t dst = 0; updated = tUpdateCompress(pCmpr->alg, p->bytes, TSDB_COLVAL_COMPRESS_DISABLED, TSDB_COLVAL_LEVEL_DISABLED, TSDB_COLVAL_LEVEL_MEDIUM, &dst); - if (updated) pCmpr->alg = dst; + if (updated > 0) pCmpr->alg = dst; break; } } @@ -1774,7 +1774,11 @@ static int32_t mndUpdateSuperTableColumnCompress(SMnode *pMnode, const SStbObj * if (updated == 0) { terrno = TSDB_CODE_MND_COLUMN_COMPRESS_ALREADY_EXIST; return -1; + } else if (updated == -1) { + terrno = TSDB_CODE_TSC_COMPRESS_LEVEL_ERROR; + return -1; } + pNew->colVer++; return 0; diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 5fc6e465ad..c9598c4b38 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -56,13 +56,14 @@ static int32_t mndBuildStreamCheckpointSourceReq(void **pBuf, int32_t *pLen, int int64_t streamId, int32_t taskId, int32_t transId, int8_t mndTrigger); static int32_t mndProcessNodeCheck(SRpcMsg *pReq); static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg); -static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList); +static int32_t extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList); static int32_t mndProcessStreamReqCheckpoint(SRpcMsg *pReq); +static int32_t mndProcessCheckpointReport(SRpcMsg *pReq); static SVgroupChangeInfo mndFindChangedNodeInfo(SMnode *pMnode, const SArray *pPrevNodeList, const SArray *pNodeList); -void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode); -static int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot); +static void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo *pExecInfo); +static void removeExpiredNodeInfo(const SArray *pNodeSnapshot); static int32_t doKillCheckpointTrans(SMnode *pMnode, const char *pDbName, size_t len); static SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw); @@ -103,6 +104,7 @@ int32_t mndInitStream(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_STOP_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_VND_STREAM_TASK_UPDATE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_VND_STREAM_TASK_RESET_RSP, mndTransProcessRsp); + mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_UPDATE_CHKPT_RSP, mndTransProcessRsp); // for msgs inside mnode // TODO change the name @@ -114,8 +116,10 @@ int32_t mndInitStream(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_MND_STREAM_BEGIN_CHECKPOINT, mndProcessStreamCheckpoint); mndSetMsgHandle(pMnode, TDMT_MND_STREAM_REQ_CHKPT, mndProcessStreamReqCheckpoint); - mndSetMsgHandle(pMnode, TDMT_MND_STREAM_HEARTBEAT, mndProcessStreamHb); + mndSetMsgHandle(pMnode, TDMT_MND_STREAM_CHKPT_REPORT, mndProcessCheckpointReport); + mndSetMsgHandle(pMnode, TDMT_MND_STREAM_UPDATE_CHKPT_EVT, mndScanCheckpointReportInfo); mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_REPORT_CHECKPOINT, mndTransProcessRsp); + mndSetMsgHandle(pMnode, TDMT_MND_STREAM_HEARTBEAT, mndProcessStreamHb); mndSetMsgHandle(pMnode, TDMT_MND_STREAM_NODECHANGE_CHECK, mndProcessNodeCheckReq); mndSetMsgHandle(pMnode, TDMT_MND_PAUSE_STREAM, mndProcessPauseStreamReq); @@ -131,9 +135,11 @@ int32_t mndInitStream(SMnode *pMnode) { if (sdbSetTable(pMnode->pSdb, table) != 0) { return -1; } + if (sdbSetTable(pMnode->pSdb, tableSeq) != 0) { return -1; } + return 0; } @@ -143,6 +149,7 @@ void mndCleanupStream(SMnode *pMnode) { taosHashCleanup(execInfo.pTaskMap); taosHashCleanup(execInfo.transMgmt.pDBTrans); taosHashCleanup(execInfo.pTransferStateStreams); + taosHashCleanup(execInfo.pChkptStreams); taosThreadMutexDestroy(&execInfo.lock); mDebug("mnd stream exec info cleanup"); } @@ -508,7 +515,7 @@ int32_t mndPersistTaskDeployReq(STrans *pTrans, SStreamTask *pTask) { tEncodeStreamTask(&encoder, pTask); tEncoderClear(&encoder); - int32_t code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0); + int32_t code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0, 0); if (code != 0) { taosMemoryFree(buf); return -1; @@ -952,7 +959,7 @@ static int32_t doSetCheckpointAction(SMnode *pMnode, STrans *pTrans, SStreamTask return -1; } - code = setTransAction(pTrans, buf, tlen, TDMT_VND_STREAM_CHECK_POINT_SOURCE, &epset, TSDB_CODE_SYN_PROPOSE_NOT_READY); + code = setTransAction(pTrans, buf, tlen, TDMT_VND_STREAM_CHECK_POINT_SOURCE, &epset, TSDB_CODE_SYN_PROPOSE_NOT_READY, 0); if (code != 0) { taosMemoryFree(buf); } @@ -1088,7 +1095,7 @@ static bool taskNodeIsUpdated(SMnode *pMnode) { } static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) { - bool ready = true; + bool ready = true; if (taskNodeIsUpdated(pMnode)) { return -1; } @@ -1099,6 +1106,8 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) { ASSERT(taosArrayGetSize(execInfo.pTaskList) == 0); } + SArray* pInvalidList = taosArrayInit(4, sizeof(STaskId)); + for (int32_t i = 0; i < taosArrayGetSize(execInfo.pTaskList); ++i) { STaskId *p = taosArrayGet(execInfo.pTaskList, i); STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, p, sizeof(*p)); @@ -1106,11 +1115,20 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) { continue; } + if (pEntry->status == TASK_STATUS__STOP) { + for(int32_t j = 0; j < taosArrayGetSize(pInvalidList); ++j) { + STaskId* pId = taosArrayGet(pInvalidList, j); + if (pEntry->id.streamId == pId->streamId) { + taosArrayPush(pInvalidList, &pEntry->id); + break; + } + } + } + if (pEntry->status != TASK_STATUS__READY) { - mDebug("s-task:0x%" PRIx64 "-0x%x (nodeId:%d) status:%s not ready, checkpoint msg not issued", + mDebug("s-task:0x%" PRIx64 "-0x%x (nodeId:%d) status:%s, checkpoint not issued", pEntry->id.streamId, (int32_t)pEntry->id.taskId, pEntry->nodeId, streamTaskGetStatusStr(pEntry->status)); ready = false; - break; } if (pEntry->hTaskId != 0) { @@ -1123,6 +1141,9 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) { } } + removeTasksInBuf(pInvalidList, &execInfo); + taosArrayDestroy(pInvalidList); + taosThreadMutexUnlock(&execInfo.lock); return ready ? 0 : -1; } @@ -1151,7 +1172,8 @@ static int32_t mndProcessStreamCheckpoint(SRpcMsg *pReq) { int32_t numOfCheckpointTrans = 0; if ((code = mndCheckTaskAndNodeStatus(pMnode)) != 0) { - return code; + terrno = TSDB_CODE_STREAM_TASK_IVLD_STATUS; + return -1; } SArray* pList = taosArrayInit(4, sizeof(SCheckpointInterval)); @@ -1798,6 +1820,10 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock int32_t numOfRows = 0; SStreamObj *pStream = NULL; + taosThreadMutexLock(&execInfo.lock); + mndInitStreamExecInfo(pMnode, &execInfo); + taosThreadMutexUnlock(&execInfo.lock); + while (numOfRows < rowsCapacity) { pShow->pIter = sdbFetch(pSdb, SDB_STREAM, pShow->pIter, (void **)&pStream); if (pShow->pIter == NULL) { @@ -2169,7 +2195,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange return 0; } -static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) { +static int32_t extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) { SSdb *pSdb = pMnode->pSdb; SStreamObj *pStream = NULL; void *pIter = NULL; @@ -2215,48 +2241,6 @@ static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) { return TSDB_CODE_SUCCESS; } -static bool taskNodeExists(SArray *pList, int32_t nodeId) { - size_t num = taosArrayGetSize(pList); - - for (int32_t i = 0; i < num; ++i) { - SNodeEntry *pEntry = taosArrayGet(pList, i); - if (pEntry->nodeId == nodeId) { - return true; - } - } - - return false; -} - -int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot) { - SArray *pRemovedTasks = taosArrayInit(4, sizeof(STaskId)); - - int32_t numOfTask = taosArrayGetSize(execInfo.pTaskList); - for (int32_t i = 0; i < numOfTask; ++i) { - STaskId *pId = taosArrayGet(execInfo.pTaskList, i); - - STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, pId, sizeof(*pId)); - if (pEntry->nodeId == SNODE_HANDLE) { - continue; - } - - bool existed = taskNodeExists(pNodeSnapshot, pEntry->nodeId); - if (!existed) { - taosArrayPush(pRemovedTasks, pId); - } - } - - removeTasksInBuf(pRemovedTasks, &execInfo); - - mDebug("remove invalid stream tasks:%d, remain:%d", (int32_t)taosArrayGetSize(pRemovedTasks), - (int32_t)taosArrayGetSize(execInfo.pTaskList)); - - removeExpiredNodeInfo(pNodeSnapshot); - - taosArrayDestroy(pRemovedTasks); - return 0; -} - // this function runs by only one thread, so it is not multi-thread safe static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) { int32_t code = 0; @@ -2476,13 +2460,137 @@ int32_t mndProcessStreamReqCheckpoint(SRpcMsg *pReq) { taosThreadMutexUnlock(&execInfo.lock); { - SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamReqCheckpointRspMsg)}; + SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamReqCheckpointRsp)}; rsp.pCont = rpcMallocCont(rsp.contLen); SMsgHead *pHead = rsp.pCont; pHead->vgId = htonl(req.nodeId); tmsgSendRsp(&rsp); + pReq->info.handle = NULL; // disable auto rsp + } + return 0; +} + +static void doAddTaskInfo(SArray* pList, SCheckpointReport* pReport) { + bool existed = false; + for(int32_t i = 0; i < taosArrayGetSize(pList); ++i) { + STaskChkptInfo* p = taosArrayGet(pList ,i); + if (p->taskId == pReport->taskId) { + existed = true; + break; + } + } + + if (!existed) { + STaskChkptInfo info = { + .streamId = pReport->streamId, + .taskId = pReport->taskId, + .transId = pReport->transId, + .dropHTask = pReport->dropHTask, + .version = pReport->checkpointVer, + .ts = pReport->checkpointTs, + .checkpointId = pReport->checkpointId, + .nodeId = pReport->nodeId, + }; + taosArrayPush(pList, &info); + } +} + +int32_t mndProcessCheckpointReport(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SCheckpointReport req = {0}; + + SDecoder decoder = {0}; + tDecoderInit(&decoder, pReq->pCont, pReq->contLen); + + if (tDecodeStreamTaskChkptReport(&decoder, &req)) { + tDecoderClear(&decoder); + terrno = TSDB_CODE_INVALID_MSG; + mError("invalid task checkpoint-report msg received"); + return -1; + } + tDecoderClear(&decoder); + + mDebug("receive stream task checkpoint-report msg, vgId:%d, s-task:0x%x, checkpointId:%" PRId64 + " checkpointVer:%" PRId64 " transId:%d", + req.nodeId, req.taskId, req.checkpointId, req.checkpointVer, req.transId); + + // register to the stream task done map, if all tasks has sent this kinds of message, start the checkpoint trans. + taosThreadMutexLock(&execInfo.lock); + + SStreamObj *pStream = mndGetStreamObj(pMnode, req.streamId); + if (pStream == NULL) { + mWarn("failed to find the stream:0x%" PRIx64 ", not handle checkpoint-report, try to acquire in buf", + req.streamId); + + // not in meta-store yet, try to acquire the task in exec buffer + // the checkpoint req arrives too soon before the completion of the create stream trans. + STaskId id = {.streamId = req.streamId, .taskId = req.taskId}; + void *p = taosHashGet(execInfo.pTaskMap, &id, sizeof(id)); + if (p == NULL) { + mError("failed to find the stream:0x%" PRIx64 " in buf, not handle the checkpoint-report", req.streamId); + terrno = TSDB_CODE_MND_STREAM_NOT_EXIST; + taosThreadMutexUnlock(&execInfo.lock); + return -1; + } else { + mDebug("s-task:0x%" PRIx64 "-0x%x in buf not in mnode/meta, create stream trans may not complete yet", + req.streamId, req.taskId); + } + } + + int32_t numOfTasks = (pStream == NULL) ? 0 : mndGetNumOfStreamTasks(pStream); + + SArray **pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId)); + if (pReqTaskList == NULL) { + SArray *pList = taosArrayInit(4, sizeof(STaskChkptInfo)); + doAddTaskInfo(pList, &req); + taosHashPut(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId), &pList, POINTER_BYTES); + + pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId)); + } else { + doAddTaskInfo(*pReqTaskList, &req); + } + + int32_t total = taosArrayGetSize(*pReqTaskList); + if (total == numOfTasks) { // all tasks has send the reqs + mInfo("stream:0x%" PRIx64 " %s all %d tasks send checkpoint-report, checkpoint meta-info for checkpointId:%" PRId64 + " will be issued soon", + req.streamId, pStream->name, total, req.checkpointId); + + // if (pStream != NULL) { + // bool conflict = mndStreamTransConflictCheck(pMnode, pStream->uid, MND_STREAM_CHKPT_UPDATE_NAME, false); + // if (conflict) { + // mDebug("stream:0x%"PRIx64" active checkpoint trans not finished yet, wait", req.streamId); + // } else { + // int32_t code = mndCreateStreamChkptInfoUpdateTrans(pMnode, pStream, *pReqTaskList); + // if (code == TSDB_CODE_SUCCESS) { // remove this entry + // taosHashRemove(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId)); + // + // int32_t numOfStreams = taosHashGetSize(execInfo.pChkptStreams); + // mDebug("stream:0x%" PRIx64 " removed, remain streams:%d in checkpoint procedure", req.streamId, + // numOfStreams); + // } else { + // mDebug("stream:0x%" PRIx64 " not launch chkpt update trans, due to checkpoint not finished yet", + // req.streamId); + // } + // } + // } + } + + if (pStream != NULL) { + mndReleaseStream(pMnode, pStream); + } + + taosThreadMutexUnlock(&execInfo.lock); + + { + SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamUpdateChkptRsp)}; + rsp.pCont = rpcMallocCont(rsp.contLen); + SMsgHead *pHead = rsp.pCont; + pHead->vgId = htonl(req.nodeId); + + tmsgSendRsp(&rsp); pReq->info.handle = NULL; // disable auto rsp } @@ -2510,3 +2618,63 @@ static int32_t mndProcessDropStreamReqFromMNode(SRpcMsg *pReq) { } return code; } + +void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo) { + if (pExecInfo->initTaskList || pMnode == NULL) { + return; + } + + addAllStreamTasksIntoBuf(pMnode, pExecInfo); + extractNodeListFromStream(pMnode, pExecInfo->pNodeList); + pExecInfo->initTaskList = true; +} + +void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo* pExecInfo) { + SSdb *pSdb = pMnode->pSdb; + SStreamObj *pStream = NULL; + void *pIter = NULL; + + while (1) { + pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream); + if (pIter == NULL) { + break; + } + + saveTaskAndNodeInfoIntoBuf(pStream, pExecInfo); + sdbRelease(pSdb, pStream); + } +} + +int32_t mndCreateStreamChkptInfoUpdateTrans(SMnode *pMnode, SStreamObj *pStream, SArray* pChkptInfoList) { + STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_CHKPT_UPDATE_NAME, "update checkpoint-info"); + if (pTrans == NULL) { + return terrno; + } + + /*int32_t code = */mndStreamRegisterTrans(pTrans, MND_STREAM_CHKPT_UPDATE_NAME, pStream->uid); + int32_t code = mndStreamSetUpdateChkptAction(pMnode, pTrans, pStream); + if (code != 0) { + sdbRelease(pMnode->pSdb, pStream); + mndTransDrop(pTrans); + return code; + } + + code = mndPersistTransLog(pStream, pTrans, SDB_STATUS_READY); + if (code != TSDB_CODE_SUCCESS) { + sdbRelease(pMnode->pSdb, pStream); + mndTransDrop(pTrans); + return -1; + } + + if (mndTransPrepare(pMnode, pTrans) != 0) { + mError("trans:%d, failed to prepare update checkpoint-info meta trans since %s", pTrans->id, terrstr()); + sdbRelease(pMnode->pSdb, pStream); + mndTransDrop(pTrans); + return -1; + } + + sdbRelease(pMnode->pSdb, pStream); + mndTransDrop(pTrans); + + return TSDB_CODE_ACTION_IN_PROGRESS; +} \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndStreamHb.c b/source/dnode/mnode/impl/src/mndStreamHb.c index 42efb6589e..a79fe0cf0a 100644 --- a/source/dnode/mnode/impl/src/mndStreamHb.c +++ b/source/dnode/mnode/impl/src/mndStreamHb.c @@ -22,54 +22,7 @@ typedef struct SFailedCheckpointInfo { int32_t transId; } SFailedCheckpointInfo; -static void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo* pExecInfo) { - SSdb *pSdb = pMnode->pSdb; - SStreamObj *pStream = NULL; - void *pIter = NULL; - - while (1) { - pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream); - if (pIter == NULL) { - break; - } - - saveTaskAndNodeInfoIntoBuf(pStream, pExecInfo); - sdbRelease(pSdb, pStream); - } -} - -static void removeDroppedStreamTasksInBuf(SMnode *pMnode, SStreamExecInfo *pExecInfo) { - if (pMnode == NULL) { - return; - } - - int32_t num = taosArrayGetSize(pExecInfo->pTaskList); - - SHashObj *pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK); - SArray *pIdList = taosArrayInit(4, sizeof(STaskId)); - - for (int32_t i = 0; i < num; ++i) { - STaskId* pId = taosArrayGet(pExecInfo->pTaskList, i); - - void* p = taosHashGet(pHash, &pId->streamId, sizeof(int64_t)); - if (p != NULL) { - continue; - } - - void* pObj = mndGetStreamObj(pMnode, pId->streamId); - if (pObj != NULL) { - mndReleaseStream(pMnode, pObj); - taosHashPut(pHash, &pId->streamId, sizeof(int64_t), NULL, 0); - } else { - taosArrayPush(pIdList, pId); - } - } - - removeTasksInBuf(pIdList, &execInfo); - - taosArrayDestroy(pIdList); - taosHashCleanup(pHash); -} +static void mndStreamStartUpdateCheckpointInfo(SMnode *pMnode); static void updateStageInfo(STaskStatusEntry *pTaskEntry, int64_t stage) { int32_t numOfNodes = taosArrayGetSize(execInfo.pNodeList); @@ -290,16 +243,7 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) { taosThreadMutexLock(&execInfo.lock); - // extract stream task list - if (taosHashGetSize(execInfo.pTaskMap) == 0) { - addAllStreamTasksIntoBuf(pMnode, &execInfo); - } else { - // the already dropped tasks may be added by hb from vnode at the time when the pTaskMap happens to be empty. - // let's drop them here. - removeDroppedStreamTasksInBuf(pMnode, &execInfo); - } - - extractStreamNodeList(pMnode); + mndInitStreamExecInfo(pMnode, &execInfo); int32_t numOfUpdated = taosArrayGetSize(req.pUpdateNodes); if (numOfUpdated > 0) { @@ -326,18 +270,6 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) { snodeChanged = true; } } else { - // task is idle for more than 50 sec. -// if (fabs(pTaskEntry->inputQUsed - p->inputQUsed) <= DBL_EPSILON) { -// if (!pTaskEntry->inputQChanging) { -// pTaskEntry->inputQUnchangeCounter++; -// } else { -// pTaskEntry->inputQChanging = false; -// } -// } else { -// pTaskEntry->inputQChanging = true; -// pTaskEntry->inputQUnchangeCounter = 0; -// } - streamTaskStatusCopy(pTaskEntry, p); STaskCkptInfo *pChkInfo = &p->checkpointInfo; @@ -348,6 +280,9 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) { SFailedCheckpointInfo info = { .transId = pChkInfo->activeTransId, .checkpointId = pChkInfo->activeId, .streamUid = p->id.streamId}; addIntoCheckpointList(pFailedChkpt, &info); + + // remove failed trans from pChkptStreams + taosHashRemove(execInfo.pChkptStreams, &p->id.streamId, sizeof(p->id.streamId)); } } @@ -393,6 +328,10 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) { mndDropOrphanTasks(pMnode, pOrphanTasks); } + if (pMnode != NULL) { // make sure that the unit test case can work + mndStreamStartUpdateCheckpointInfo(pMnode); + } + taosThreadMutexUnlock(&execInfo.lock); tCleanupStreamHbMsg(&req); @@ -411,3 +350,12 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) { return TSDB_CODE_SUCCESS; } + +void mndStreamStartUpdateCheckpointInfo(SMnode *pMnode) { // here reuse the doCheckpointmsg + SMStreamDoCheckpointMsg *pMsg = rpcMallocCont(sizeof(SMStreamDoCheckpointMsg)); + if (pMsg != NULL) { + int32_t size = sizeof(SMStreamDoCheckpointMsg); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_STREAM_UPDATE_CHKPT_EVT, .pCont = pMsg, .contLen = size}; + tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); + } +} \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndStreamTrans.c b/source/dnode/mnode/impl/src/mndStreamTrans.c index ff31aa0f7d..0daa383d3e 100644 --- a/source/dnode/mnode/impl/src/mndStreamTrans.c +++ b/source/dnode/mnode/impl/src/mndStreamTrans.c @@ -127,7 +127,7 @@ bool mndStreamTransConflictCheck(SMnode* pMnode, int64_t streamId, const char* p return false; } -int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamUid) { +int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamId) { taosThreadMutexLock(&execInfo.lock); int32_t num = taosHashGetSize(execInfo.transMgmt.pDBTrans); if (num <= 0) { @@ -136,12 +136,13 @@ int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamUid) { } mndStreamClearFinishedTrans(pMnode, NULL); - SStreamTransInfo* pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, &streamUid, sizeof(streamUid)); + SStreamTransInfo* pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, &streamId, sizeof(streamId)); if (pEntry != NULL) { SStreamTransInfo tInfo = *pEntry; taosThreadMutexUnlock(&execInfo.lock); - if (strcmp(tInfo.name, MND_STREAM_CHECKPOINT_NAME) == 0 || strcmp(tInfo.name, MND_STREAM_TASK_UPDATE_NAME) == 0) { + if (strcmp(tInfo.name, MND_STREAM_CHECKPOINT_NAME) == 0 || strcmp(tInfo.name, MND_STREAM_TASK_UPDATE_NAME) == 0 || + strcmp(tInfo.name, MND_STREAM_CHKPT_UPDATE_NAME) == 0) { return tInfo.transId; } } else { @@ -159,7 +160,7 @@ STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnCo return NULL; } - mInfo("s-task:0x%" PRIx64 " start to build trans %s, transId:%d", pStream->uid, pMsg, pTrans->id); + mInfo("stream:0x%" PRIx64 " start to build trans %s, transId:%d", pStream->uid, pMsg, pTrans->id); mndTransSetDbName(pTrans, pStream->sourceDb, pStream->targetSTbName); if (mndTransCheckConflict(pMnode, pTrans) != 0) { @@ -246,8 +247,9 @@ int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status) } int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset, - int32_t retryCode) { - STransAction action = {.epSet = *pEpset, .contLen = contLen, .pCont = pCont, .msgType = msgType, .retryCode = retryCode}; + int32_t retryCode, int32_t acceptCode) { + STransAction action = {.epSet = *pEpset, .contLen = contLen, .pCont = pCont, .msgType = msgType, .retryCode = retryCode, + .acceptableCode = acceptCode}; return mndTransAppendRedoAction(pTrans, &action); } diff --git a/source/dnode/mnode/impl/src/mndStreamUtil.c b/source/dnode/mnode/impl/src/mndStreamUtil.c index d138254afd..e47f28c309 100644 --- a/source/dnode/mnode/impl/src/mndStreamUtil.c +++ b/source/dnode/mnode/impl/src/mndStreamUtil.c @@ -230,7 +230,7 @@ static int32_t doSetResumeAction(STrans *pTrans, SMnode *pMnode, SStreamTask *pT return -1; } - code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0); + code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0, 0); if (code != 0) { taosMemoryFree(pReq); return -1; @@ -308,7 +308,7 @@ static int32_t doSetPauseAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa epsetToStr(&epset, buf, tListLen(buf)); mDebug("pause stream task in node:%d, epset:%s", pTask->info.nodeId, buf); - code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0); + code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0, 0); if (code != 0) { taosMemoryFree(pReq); return -1; @@ -356,7 +356,7 @@ static int32_t doSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTas } // The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode. - code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0); + code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0); if (code != 0) { taosMemoryFree(pReq); return -1; @@ -400,7 +400,7 @@ static int32_t doSetDropActionFromId(SMnode *pMnode, STrans *pTrans, SOrphanTask } // The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode. - code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0); + code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0); if (code != 0) { taosMemoryFree(pReq); return -1; @@ -484,7 +484,7 @@ static int32_t doSetUpdateTaskAction(SMnode *pMnode, STrans *pTrans, SStreamTask return code; } - code = setTransAction(pTrans, pBuf, len, TDMT_VND_STREAM_TASK_UPDATE, &epset, TSDB_CODE_VND_INVALID_VGROUP_ID); + code = setTransAction(pTrans, pBuf, len, TDMT_VND_STREAM_TASK_UPDATE, &epset, TSDB_CODE_VND_INVALID_VGROUP_ID, 0); if (code != TSDB_CODE_SUCCESS) { taosMemoryFree(pBuf); } @@ -534,7 +534,7 @@ static int32_t doSetResetAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa return code; } - code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0); + code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0, 0); if (code != TSDB_CODE_SUCCESS) { taosMemoryFree(pReq); } @@ -574,9 +574,11 @@ void mndInitExecInfo() { execInfo.pTaskMap = taosHashInit(64, fn, true, HASH_NO_LOCK); execInfo.transMgmt.pDBTrans = taosHashInit(32, fn, true, HASH_NO_LOCK); execInfo.pTransferStateStreams = taosHashInit(32, fn, true, HASH_NO_LOCK); + execInfo.pChkptStreams = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK); execInfo.pNodeList = taosArrayInit(4, sizeof(SNodeEntry)); taosHashSetFreeFp(execInfo.pTransferStateStreams, freeTaskList); + taosHashSetFreeFp(execInfo.pChkptStreams, freeTaskList); } void removeExpiredNodeInfo(const SArray *pNodeSnapshot) { @@ -645,4 +647,174 @@ void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode) { taosThreadMutexUnlock(&pExecNode->lock); destroyStreamTaskIter(pIter); +} + +static bool taskNodeExists(SArray *pList, int32_t nodeId) { + size_t num = taosArrayGetSize(pList); + + for (int32_t i = 0; i < num; ++i) { + SNodeEntry *pEntry = taosArrayGet(pList, i); + if (pEntry->nodeId == nodeId) { + return true; + } + } + + return false; +} + +int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot) { + SArray *pRemovedTasks = taosArrayInit(4, sizeof(STaskId)); + + int32_t numOfTask = taosArrayGetSize(execInfo.pTaskList); + for (int32_t i = 0; i < numOfTask; ++i) { + STaskId *pId = taosArrayGet(execInfo.pTaskList, i); + + STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, pId, sizeof(*pId)); + if (pEntry->nodeId == SNODE_HANDLE) { + continue; + } + + bool existed = taskNodeExists(pNodeSnapshot, pEntry->nodeId); + if (!existed) { + taosArrayPush(pRemovedTasks, pId); + } + } + + removeTasksInBuf(pRemovedTasks, &execInfo); + + mDebug("remove invalid stream tasks:%d, remain:%d", (int32_t)taosArrayGetSize(pRemovedTasks), + (int32_t)taosArrayGetSize(execInfo.pTaskList)); + + removeExpiredNodeInfo(pNodeSnapshot); + + taosArrayDestroy(pRemovedTasks); + return 0; +} + +static int32_t doSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTask) { + SVUpdateCheckpointInfoReq *pReq = taosMemoryCalloc(1, sizeof(SVUpdateCheckpointInfoReq)); + if (pReq == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + mError("failed to malloc in reset stream, size:%" PRIzu ", code:%s", sizeof(SVUpdateCheckpointInfoReq), + tstrerror(TSDB_CODE_OUT_OF_MEMORY)); + return terrno; + } + + pReq->head.vgId = htonl(pTask->info.nodeId); + pReq->taskId = pTask->id.taskId; + pReq->streamId = pTask->id.streamId; + + SArray **pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &pTask->id.streamId, sizeof(pTask->id.streamId)); + ASSERT(pReqTaskList); + + int32_t size = taosArrayGetSize(*pReqTaskList); + for(int32_t i = 0; i < size; ++i) { + STaskChkptInfo* pInfo = taosArrayGet(*pReqTaskList, i); + if (pInfo->taskId == pTask->id.taskId) { + pReq->checkpointId = pInfo->checkpointId; + pReq->checkpointVer = pInfo->version; + pReq->checkpointTs = pInfo->ts; + pReq->dropRelHTask = pInfo->dropHTask; + pReq->transId = pInfo->transId; + pReq->hStreamId = pTask->hTaskInfo.id.streamId; + pReq->hTaskId = pTask->hTaskInfo.id.taskId; + } + } + + SEpSet epset = {0}; + bool hasEpset = false; + int32_t code = extractNodeEpset(pMnode, &epset, &hasEpset, pTask->id.taskId, pTask->info.nodeId); + if (code != TSDB_CODE_SUCCESS || !hasEpset) { + taosMemoryFree(pReq); + return code; + } + + code = setTransAction(pTrans, pReq, sizeof(SVUpdateCheckpointInfoReq), TDMT_STREAM_TASK_UPDATE_CHKPT, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID); + if (code != TSDB_CODE_SUCCESS) { + taosMemoryFree(pReq); + } + + return code; +} + +int32_t mndStreamSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream) { + taosWLockLatch(&pStream->lock); + + SStreamTaskIter *pIter = createStreamTaskIter(pStream); + while (streamTaskIterNextTask(pIter)) { + SStreamTask *pTask = streamTaskIterGetCurrent(pIter); + + int32_t code = doSetUpdateChkptAction(pMnode, pTrans, pTask); + if (code != TSDB_CODE_SUCCESS) { + destroyStreamTaskIter(pIter); + taosWUnLockLatch(&pStream->lock); + return -1; + } + } + + destroyStreamTaskIter(pIter); + taosWUnLockLatch(&pStream->lock); + return 0; +} + +int32_t mndScanCheckpointReportInfo(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + void *pIter = NULL; + SArray *pDropped = taosArrayInit(4, sizeof(int64_t)); + + mDebug("start to scan checkpoint report info"); + + while ((pIter = taosHashIterate(execInfo.pChkptStreams, pIter)) != NULL) { + SArray *pList = *(SArray **)pIter; + + STaskChkptInfo* pInfo = taosArrayGet(pList, 0); + SStreamObj* pStream = mndGetStreamObj(pMnode, pInfo->streamId); + if (pStream == NULL) { + mDebug("failed to acquire stream:0x%" PRIx64 " remove it from checkpoint-report list", pInfo->streamId); + taosArrayPush(pDropped, &pInfo->streamId); + continue; + } + + int32_t total = mndGetNumOfStreamTasks(pStream); + int32_t existed = (int32_t) taosArrayGetSize(pList); + + if (total == existed) { + mDebug("stream:0x%" PRIx64 " %s all %d tasks send checkpoint-report, start to update checkpoint-info", + pStream->uid, pStream->name, total); + + bool conflict = mndStreamTransConflictCheck(pMnode, pStream->uid, MND_STREAM_CHKPT_UPDATE_NAME, false); + if (!conflict) { + int32_t code = mndCreateStreamChkptInfoUpdateTrans(pMnode, pStream, pList); + if (code == TSDB_CODE_SUCCESS || code == TSDB_CODE_ACTION_IN_PROGRESS) { // remove this entry + taosArrayPush(pDropped, &pInfo->streamId); + mDebug("stream:0x%" PRIx64 " removed", pInfo->streamId); + } else { + mDebug("stream:0x%" PRIx64 " not launch chkpt-meta update trans, due to checkpoint not finished yet", + pInfo->streamId); + } + break; + } else { + mDebug("stream:0x%"PRIx64" active checkpoint trans not finished yet, wait", pInfo->streamId); + } + } else { + mDebug("stream:0x%" PRIx64 " %s %d/%d tasks send checkpoint-report, %d not send", pInfo->streamId, pStream->name, + existed, total, total - existed); + } + + sdbRelease(pMnode->pSdb, pStream); + } + + int32_t size = taosArrayGetSize(pDropped); + if (size > 0) { + for (int32_t i = 0; i < size; ++i) { + int64_t streamId = *(int64_t *)taosArrayGet(pDropped, i); + taosHashRemove(execInfo.pChkptStreams, &streamId, sizeof(streamId)); + } + + int32_t numOfStreams = taosHashGetSize(execInfo.pChkptStreams); + mDebug("drop %d stream(s) in checkpoint-report list, remain:%d", size, numOfStreams); + } + + taosArrayDestroy(pDropped); + return TSDB_CODE_SUCCESS; } \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index 0068b582cf..ffb723756c 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -618,13 +618,13 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu char cgroup[TSDB_CGROUP_LEN] = {0}; mndSplitSubscribeKey(pOutput->pSub->key, topic, cgroup, true); - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "tmq-reb"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pMsg, "tmq-reb"); if (pTrans == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto END; } - mndTransSetDbName(pTrans, topic, cgroup); + mndTransSetDbName(pTrans, pOutput->pSub->dbName, cgroup); code = mndTransCheckConflict(pMnode, pTrans); if (code != 0) { goto END; @@ -908,33 +908,37 @@ END: } static int32_t sendDeleteSubToVnode(SMnode *pMnode, SMqSubscribeObj *pSub, STrans *pTrans){ - // iter all vnode to delete handle - int32_t sz = taosArrayGetSize(pSub->unassignedVgs); - for (int32_t i = 0; i < sz; i++) { - SMqVgEp *pVgEp = taosArrayGetP(pSub->unassignedVgs, i); + void* pIter = NULL; + SVgObj* pVgObj = NULL; + while (1) { + pIter = sdbFetch(pMnode->pSdb, SDB_VGROUP, pIter, (void**)&pVgObj); + if (pIter == NULL) { + break; + } + + if (!mndVgroupInDb(pVgObj, pSub->dbUid)) { + sdbRelease(pMnode->pSdb, pVgObj); + continue; + } SMqVDeleteReq *pReq = taosMemoryCalloc(1, sizeof(SMqVDeleteReq)); if(pReq == NULL){ terrno = TSDB_CODE_OUT_OF_MEMORY; + sdbRelease(pMnode->pSdb, pVgObj); return -1; } - pReq->head.vgId = htonl(pVgEp->vgId); - pReq->vgId = pVgEp->vgId; + pReq->head.vgId = htonl(pVgObj->vgId); + pReq->vgId = pVgObj->vgId; pReq->consumerId = -1; memcpy(pReq->subKey, pSub->key, TSDB_SUBSCRIBE_KEY_LEN); - SVgObj *pVgObj = mndAcquireVgroup(pMnode, pVgEp->vgId); - if (pVgObj == NULL) { - taosMemoryFree(pReq); - terrno = TSDB_CODE_MND_VGROUP_NOT_EXIST; - return -1; - } STransAction action = {0}; action.epSet = mndGetVgroupEpset(pMnode, pVgObj);; action.pCont = pReq; action.contLen = sizeof(SMqVDeleteReq); action.msgType = TDMT_VND_TMQ_DELETE_SUB; + action.acceptableCode = TSDB_CODE_MND_VGROUP_NOT_EXIST; - mndReleaseVgroup(pMnode, pVgObj); + sdbRelease(pMnode->pSdb, pVgObj); if (mndTransAppendRedoAction(pTrans, &action) != 0) { taosMemoryFree(pReq); return -1; @@ -996,7 +1000,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) { goto end; } - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "drop-cgroup"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pMsg, "drop-cgroup"); if (pTrans == NULL) { mError("cgroup: %s on topic:%s, failed to drop since %s", dropReq.cgroup, dropReq.topic, terrstr()); code = -1; @@ -1004,7 +1008,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) { } mInfo("trans:%d, used to drop cgroup:%s on topic %s", pTrans->id, dropReq.cgroup, dropReq.topic); - mndTransSetDbName(pTrans, dropReq.topic, dropReq.cgroup); + mndTransSetDbName(pTrans, pSub->dbName, dropReq.cgroup); code = mndTransCheckConflict(pMnode, pTrans); if (code != 0) { goto end; diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c index 8a06b4a613..bcb38a3902 100644 --- a/source/dnode/mnode/impl/src/mndTopic.c +++ b/source/dnode/mnode/impl/src/mndTopic.c @@ -422,14 +422,14 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq * SQueryPlan *pPlan = NULL; SMqTopicObj topicObj = {0}; - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC, pReq, "create-topic"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB, pReq, "create-topic"); if (pTrans == NULL) { mError("topic:%s, failed to create since %s", pCreate->name, terrstr()); code = -1; goto _OUT; } - mndTransSetDbName(pTrans, pCreate->name, NULL); + mndTransSetDbName(pTrans, pDb->name, NULL); code = mndTransCheckConflict(pMnode, pTrans); if (code != 0) { goto _OUT; @@ -779,14 +779,14 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) { } } - pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC, pReq, "drop-topic"); + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB, pReq, "drop-topic"); if (pTrans == NULL) { mError("topic:%s, failed to drop since %s", pTopic->name, terrstr()); code = -1; goto end; } - mndTransSetDbName(pTrans, pTopic->name, NULL); + mndTransSetDbName(pTrans, pTopic->db, NULL); code = mndTransCheckConflict(pMnode, pTrans); if (code != 0) { goto end; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 05f685ecb4..2176cf4e39 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -836,26 +836,26 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { } } - if (pNew->conflict == TRN_CONFLICT_TOPIC) { - if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; - if (pTrans->conflict == TRN_CONFLICT_TOPIC || pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) { - if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true; - } - } - if (pNew->conflict == TRN_CONFLICT_TOPIC_INSIDE) { - if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; - if (pTrans->conflict == TRN_CONFLICT_TOPIC) { - if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true; - } - if (pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) { - if (strcasecmp(pNew->dbname, pTrans->dbname) == 0 && strcasecmp(pNew->stbname, pTrans->stbname) == 0) - conflict = true; - } - } +// if (pNew->conflict == TRN_CONFLICT_TOPIC) { +// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; +// if (pTrans->conflict == TRN_CONFLICT_TOPIC || pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) { +// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true; +// } +// } +// if (pNew->conflict == TRN_CONFLICT_TOPIC_INSIDE) { +// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; +// if (pTrans->conflict == TRN_CONFLICT_TOPIC) { +// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true; +// } +// if (pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) { +// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0 && strcasecmp(pNew->stbname, pTrans->stbname) == 0) +// conflict = true; +// } +// } if (pNew->conflict == TRN_CONFLICT_ARBGROUP) { if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) { - void *pIter = taosHashIterate(pNew->arbGroupIds, NULL); + pIter = taosHashIterate(pNew->arbGroupIds, NULL); while (pIter != NULL) { int32_t groupId = *(int32_t *)pIter; if (taosHashGet(pTrans->arbGroupIds, &groupId, sizeof(int32_t)) != NULL) { diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index 9a85d405ca..68c935d3be 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -45,35 +45,55 @@ #define ALTER_USER_DEL_PRIVS(_type) ((_type) == TSDB_ALTER_USER_DEL_PRIVILEGES) #define ALTER_USER_ALL_PRIV(_priv) (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) -#define ALTER_USER_READ_PRIV(_priv) (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_READ) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) -#define ALTER_USER_WRITE_PRIV(_priv) (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_WRITE) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) -#define ALTER_USER_ALTER_PRIV(_priv) (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALTER) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) +#define ALTER_USER_READ_PRIV(_priv) \ + (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_READ) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) +#define ALTER_USER_WRITE_PRIV(_priv) \ + (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_WRITE) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) +#define ALTER_USER_ALTER_PRIV(_priv) \ + (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALTER) || BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_ALL)) #define ALTER_USER_SUBSCRIBE_PRIV(_priv) (BIT_FLAG_TEST_MASK((_priv), PRIVILEGE_TYPE_SUBSCRIBE)) #define ALTER_USER_TARGET_DB(_tbname) (0 == (_tbname)[0]) #define ALTER_USER_TARGET_TB(_tbname) (0 != (_tbname)[0]) -#define ALTER_USER_ADD_READ_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_DEL_READ_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_ADD_WRITE_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_DEL_WRITE_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_ADD_ALTER_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_DEL_ALTER_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_ADD_ALL_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_DEL_ALL_DB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_ADD_READ_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_DEL_READ_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_ADD_WRITE_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_DEL_WRITE_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_ADD_ALTER_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_DEL_ALTER_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_ADD_ALL_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) +#define ALTER_USER_DEL_ALL_DB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_DB(_tbname)) -#define ALTER_USER_ADD_READ_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_DEL_READ_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_ADD_WRITE_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_DEL_WRITE_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_ADD_ALTER_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_DEL_ALTER_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_ADD_ALL_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) -#define ALTER_USER_DEL_ALL_TB_PRIV(_type, _priv, _tbname) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) - -#define ALTER_USER_ADD_SUBSCRIBE_TOPIC_PRIV(_type, _priv) (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_SUBSCRIBE_PRIV(_priv)) -#define ALTER_USER_DEL_SUBSCRIBE_TOPIC_PRIV(_type, _priv) (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_SUBSCRIBE_PRIV(_priv)) +#define ALTER_USER_ADD_READ_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_DEL_READ_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_READ_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_ADD_WRITE_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_DEL_WRITE_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_WRITE_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_ADD_ALTER_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_DEL_ALTER_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALTER_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_ADD_ALL_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_DEL_ALL_TB_PRIV(_type, _priv, _tbname) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_ALL_PRIV(_priv) && ALTER_USER_TARGET_TB(_tbname)) +#define ALTER_USER_ADD_SUBSCRIBE_TOPIC_PRIV(_type, _priv) \ + (ALTER_USER_ADD_PRIVS(_type) && ALTER_USER_SUBSCRIBE_PRIV(_priv)) +#define ALTER_USER_DEL_SUBSCRIBE_TOPIC_PRIV(_type, _priv) \ + (ALTER_USER_DEL_PRIVS(_type) && ALTER_USER_SUBSCRIBE_PRIV(_priv)) static SIpWhiteList *createDefaultIpWhiteList(); SIpWhiteList *createIpWhiteList(void *buf, int32_t len); @@ -97,6 +117,7 @@ static int32_t mndProcessDropUserReq(SRpcMsg *pReq); static int32_t mndProcessGetUserAuthReq(SRpcMsg *pReq); static int32_t mndProcessGetUserWhiteListReq(SRpcMsg *pReq); static int32_t mndRetrieveUsers(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); +static int32_t mndRetrieveUsersFull(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextUser(SMnode *pMnode, void *pIter); static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextPrivileges(SMnode *pMnode, void *pIter); @@ -502,6 +523,8 @@ int32_t mndInitUser(SMnode *pMnode) { mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_USER, mndRetrieveUsers); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_USER, mndCancelGetNextUser); + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_USER_FULL, mndRetrieveUsersFull); + mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_USER_FULL, mndCancelGetNextUser); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_PRIVILEGES, mndRetrievePrivileges); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_PRIVILEGES, mndCancelGetNextPrivileges); return sdbSetTable(pMnode->pSdb, table); @@ -818,7 +841,7 @@ SSdbRaw *mndUserActionEncode(SUserObj *pUser) { SDB_SET_INT8(pRaw, dataPos, pUser->superUser, _OVER) SDB_SET_INT8(pRaw, dataPos, pUser->sysInfo, _OVER) SDB_SET_INT8(pRaw, dataPos, pUser->enable, _OVER) - SDB_SET_INT8(pRaw, dataPos, pUser->flag, _OVER) + SDB_SET_UINT8(pRaw, dataPos, pUser->flag, _OVER) SDB_SET_INT32(pRaw, dataPos, pUser->authVersion, _OVER) SDB_SET_INT32(pRaw, dataPos, pUser->passVersion, _OVER) SDB_SET_INT32(pRaw, dataPos, numOfReadDbs, _OVER) @@ -1002,7 +1025,7 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) { SDB_GET_INT8(pRaw, dataPos, &pUser->superUser, _OVER) SDB_GET_INT8(pRaw, dataPos, &pUser->sysInfo, _OVER) SDB_GET_INT8(pRaw, dataPos, &pUser->enable, _OVER) - SDB_GET_INT8(pRaw, dataPos, &pUser->flag, _OVER) + SDB_GET_UINT8(pRaw, dataPos, &pUser->flag, _OVER) if (pUser->superUser) pUser->createdb = 1; SDB_GET_INT32(pRaw, dataPos, &pUser->authVersion, _OVER) if (sver >= 4) { @@ -1440,7 +1463,12 @@ void mndReleaseUser(SMnode *pMnode, SUserObj *pUser) { static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate, SRpcMsg *pReq) { SUserObj userObj = {0}; - taosEncryptPass_c((uint8_t *)pCreate->pass, strlen(pCreate->pass), userObj.pass); + if (pCreate->isImport != 1) { + taosEncryptPass_c((uint8_t *)pCreate->pass, strlen(pCreate->pass), userObj.pass); + } else { + // mInfo("pCreate->pass:%s", pCreate->pass) + strncpy(userObj.pass, pCreate->pass, TSDB_PASSWORD_LEN); + } tstrncpy(userObj.user, pCreate->user, TSDB_USER_LEN); tstrncpy(userObj.acct, acct, TSDB_USER_LEN); userObj.createdTime = taosGetTimestampMs(); @@ -1448,7 +1476,7 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate userObj.superUser = 0; // pCreate->superUser; userObj.sysInfo = pCreate->sysInfo; userObj.enable = pCreate->enable; - userObj.createdb = 0; + userObj.createdb = pCreate->createDb; if (pCreate->numIpRanges == 0) { userObj.pIpWhiteList = createDefaultIpWhiteList(); @@ -1534,10 +1562,25 @@ static int32_t mndProcessCreateUserReq(SRpcMsg *pReq) { goto _OVER; } - mInfo("user:%s, start to create", createReq.user); - if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_USER) != 0) { + mInfo("user:%s, start to create, createdb:%d, is_import:%d", createReq.user, createReq.isImport, createReq.createDb); + +#ifndef TD_ENTERPRISE + if (createReq.isImport == 1) { goto _OVER; } +#endif + + if (createReq.isImport != 1) { + if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_USER) != 0) { + goto _OVER; + } + } else { + if (strcmp(pReq->info.conn.user, "root") != 0) { + mError("The operation is not permitted, user:%s", pReq->info.conn.user); + terrno = TSDB_CODE_MND_NO_RIGHTS; + goto _OVER; + } + } if (createReq.user[0] == 0) { terrno = TSDB_CODE_MND_INVALID_USER_FORMAT; @@ -1549,9 +1592,11 @@ static int32_t mndProcessCreateUserReq(SRpcMsg *pReq) { goto _OVER; } - if (strlen(createReq.pass) >= TSDB_PASSWORD_LEN) { - terrno = TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG; - goto _OVER; + if (createReq.isImport != 1) { + if (strlen(createReq.pass) >= TSDB_PASSWORD_LEN) { + terrno = TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG; + goto _OVER; + } } pUser = mndAcquireUser(pMnode, createReq.user); @@ -1575,10 +1620,16 @@ static int32_t mndProcessCreateUserReq(SRpcMsg *pReq) { if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; char detail[1000] = {0}; - sprintf(detail, "enable:%d, superUser:%d, sysInfo:%d, password:xxx", - createReq.enable, createReq.superUser, createReq.sysInfo); + sprintf(detail, "enable:%d, superUser:%d, sysInfo:%d, password:xxx", createReq.enable, createReq.superUser, + createReq.sysInfo); + char operation[15] = {0}; + if (createReq.isImport == 1) { + strcpy(operation, "importUser"); + } else { + strcpy(operation, "createUser"); + } - auditRecord(pReq, pMnode->clusterId, "createUser", "", createReq.user, detail, strlen(detail)); + auditRecord(pReq, pMnode->clusterId, operation, "", createReq.user, detail, strlen(detail)); _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { @@ -1766,7 +1817,7 @@ static int32_t mndRemoveTablePriviledge(SMnode *pMnode, SHashObj *hash, SHashObj if (NULL == currRef) { return 0; } - + if (1 == *currRef) { if (taosHashRemove(useDbHash, alterReq->objname, dbKeyLen) != 0) { return -1; @@ -1800,12 +1851,12 @@ static char *mndUserAuditTypeStr(int32_t type) { return "error"; } -static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode *pMnode, SUserObj* pNewUser) { - SSdb *pSdb = pMnode->pSdb; - void *pIter = NULL; +static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode *pMnode, SUserObj *pNewUser) { + SSdb *pSdb = pMnode->pSdb; + void *pIter = NULL; - if (ALTER_USER_ADD_READ_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || - ALTER_USER_ADD_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_ADD_READ_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_ADD_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (strcmp(pAlterReq->objname, "1.*") != 0) { int32_t len = strlen(pAlterReq->objname) + 1; SDbObj *pDb = mndAcquireDb(pMnode, pAlterReq->objname); @@ -1830,7 +1881,8 @@ static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode } } - if (ALTER_USER_ADD_WRITE_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_ADD_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_ADD_WRITE_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_ADD_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (strcmp(pAlterReq->objname, "1.*") != 0) { int32_t len = strlen(pAlterReq->objname) + 1; SDbObj *pDb = mndAcquireDb(pMnode, pAlterReq->objname); @@ -1855,7 +1907,8 @@ static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode } } - if (ALTER_USER_DEL_READ_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_DEL_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_DEL_READ_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_DEL_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (strcmp(pAlterReq->objname, "1.*") != 0) { int32_t len = strlen(pAlterReq->objname) + 1; SDbObj *pDb = mndAcquireDb(pMnode, pAlterReq->objname); @@ -1870,7 +1923,8 @@ static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode } } - if (ALTER_USER_DEL_WRITE_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_DEL_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_DEL_WRITE_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_DEL_ALL_DB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (strcmp(pAlterReq->objname, "1.*") != 0) { int32_t len = strlen(pAlterReq->objname) + 1; SDbObj *pDb = mndAcquireDb(pMnode, pAlterReq->objname); @@ -1885,9 +1939,9 @@ static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode } } - SHashObj* pReadTbs = pNewUser->readTbs; - SHashObj* pWriteTbs = pNewUser->writeTbs; - SHashObj* pAlterTbs = pNewUser->alterTbs; + SHashObj *pReadTbs = pNewUser->readTbs; + SHashObj *pWriteTbs = pNewUser->writeTbs; + SHashObj *pAlterTbs = pNewUser->alterTbs; #ifdef TD_ENTERPRISE if (pAlterReq->isView) { @@ -1897,15 +1951,18 @@ static int32_t mndProcessAlterUserPrivilegesReq(SAlterUserReq *pAlterReq, SMnode } #endif - if (ALTER_USER_ADD_READ_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_ADD_READ_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (mndTablePriviledge(pMnode, pReadTbs, pNewUser->useDbs, pAlterReq, pSdb) != 0) return -1; } - if (ALTER_USER_ADD_WRITE_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_ADD_WRITE_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (mndTablePriviledge(pMnode, pWriteTbs, pNewUser->useDbs, pAlterReq, pSdb) != 0) return -1; } - if (ALTER_USER_ADD_ALTER_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { + if (ALTER_USER_ADD_ALTER_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName) || + ALTER_USER_ADD_ALL_TB_PRIV(pAlterReq->alterType, pAlterReq->privileges, pAlterReq->tabName)) { if (mndTablePriviledge(pMnode, pAlterTbs, pNewUser->useDbs, pAlterReq, pSdb) != 0) return -1; } @@ -2016,7 +2073,7 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) { newUser.sysInfo = alterReq.sysInfo; } - if(alterReq.alterType == TSDB_ALTER_USER_CREATEDB) { + if (alterReq.alterType == TSDB_ALTER_USER_CREATEDB) { newUser.createdb = alterReq.createdb; } @@ -2119,52 +2176,43 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) { code = mndAlterUser(pMnode, pUser, &newUser, pReq); if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; - if(alterReq.alterType == TSDB_ALTER_USER_PASSWD){ + if (alterReq.alterType == TSDB_ALTER_USER_PASSWD) { char detail[1000] = {0}; sprintf(detail, "alterType:%s, enable:%d, superUser:%d, sysInfo:%d, createdb:%d, tabName:%s, password:xxx", mndUserAuditTypeStr(alterReq.alterType), alterReq.enable, alterReq.superUser, alterReq.sysInfo, alterReq.createdb ? 1 : 0, alterReq.tabName); auditRecord(pReq, pMnode->clusterId, "alterUser", "", alterReq.user, detail, strlen(detail)); - } - else if(alterReq.alterType == TSDB_ALTER_USER_SUPERUSER || - alterReq.alterType == TSDB_ALTER_USER_ENABLE || - alterReq.alterType == TSDB_ALTER_USER_SYSINFO || - alterReq.alterType == TSDB_ALTER_USER_CREATEDB){ + } else if (alterReq.alterType == TSDB_ALTER_USER_SUPERUSER || alterReq.alterType == TSDB_ALTER_USER_ENABLE || + alterReq.alterType == TSDB_ALTER_USER_SYSINFO || alterReq.alterType == TSDB_ALTER_USER_CREATEDB) { auditRecord(pReq, pMnode->clusterId, "alterUser", "", alterReq.user, alterReq.sql, alterReq.sqlLen); - } - else if(ALTER_USER_ADD_READ_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)|| - ALTER_USER_ADD_WRITE_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)|| - ALTER_USER_ADD_ALL_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)|| - ALTER_USER_ADD_READ_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)|| - ALTER_USER_ADD_WRITE_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)|| - ALTER_USER_ADD_ALL_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)){ - if (strcmp(alterReq.objname, "1.*") != 0){ + } else if (ALTER_USER_ADD_READ_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName) || + ALTER_USER_ADD_WRITE_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName) || + ALTER_USER_ADD_ALL_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName) || + ALTER_USER_ADD_READ_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName) || + ALTER_USER_ADD_WRITE_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName) || + ALTER_USER_ADD_ALL_TB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)) { + if (strcmp(alterReq.objname, "1.*") != 0) { SName name = {0}; tNameFromString(&name, alterReq.objname, T_NAME_ACCT | T_NAME_DB); - auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", name.dbname, alterReq.user, - alterReq.sql, alterReq.sqlLen); - }else{ - auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", "", alterReq.user, - alterReq.sql, alterReq.sqlLen); + auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", name.dbname, alterReq.user, alterReq.sql, + alterReq.sqlLen); + } else { + auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", "", alterReq.user, alterReq.sql, alterReq.sqlLen); } - } - else if(ALTER_USER_ADD_SUBSCRIBE_TOPIC_PRIV(alterReq.alterType, alterReq.privileges)){ - auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", alterReq.objname, alterReq.user, - alterReq.sql, alterReq.sqlLen); - } - else if(ALTER_USER_DEL_SUBSCRIBE_TOPIC_PRIV(alterReq.alterType, alterReq.privileges)){ - auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", alterReq.objname, alterReq.user, - alterReq.sql, alterReq.sqlLen); - } - else{ - if (strcmp(alterReq.objname, "1.*") != 0){ + } else if (ALTER_USER_ADD_SUBSCRIBE_TOPIC_PRIV(alterReq.alterType, alterReq.privileges)) { + auditRecord(pReq, pMnode->clusterId, "GrantPrivileges", alterReq.objname, alterReq.user, alterReq.sql, + alterReq.sqlLen); + } else if (ALTER_USER_DEL_SUBSCRIBE_TOPIC_PRIV(alterReq.alterType, alterReq.privileges)) { + auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", alterReq.objname, alterReq.user, alterReq.sql, + alterReq.sqlLen); + } else { + if (strcmp(alterReq.objname, "1.*") != 0) { SName name = {0}; tNameFromString(&name, alterReq.objname, T_NAME_ACCT | T_NAME_DB); - auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", name.dbname, alterReq.user, - alterReq.sql, alterReq.sqlLen); - }else{ - auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", "", alterReq.user, - alterReq.sql, alterReq.sqlLen); + auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", name.dbname, alterReq.user, alterReq.sql, + alterReq.sqlLen); + } else { + auditRecord(pReq, pMnode->clusterId, "RevokePrivileges", "", alterReq.user, alterReq.sql, alterReq.sqlLen); } } @@ -2364,6 +2412,88 @@ static int32_t mndRetrieveUsers(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl return numOfRows; } +static int32_t mndRetrieveUsersFull(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { + int32_t numOfRows = 0; +#ifdef TD_ENTERPRISE + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SUserObj *pUser = NULL; + int32_t cols = 0; + int8_t flag = 0; + char *pWrite; + int32_t code = 0; + + while (numOfRows < rows) { + pShow->pIter = sdbFetch(pSdb, SDB_USER, pShow->pIter, (void **)&pUser); + if (pShow->pIter == NULL) break; + + cols = 0; + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + char name[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(name, pUser->user, pShow->pMeta->pSchemas[cols].bytes); + code = colDataSetVal(pColInfo, numOfRows, (const char *)name, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + cols++; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)&pUser->superUser, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + cols++; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)&pUser->enable, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + cols++; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)&pUser->sysInfo, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + cols++; + flag = pUser->createdb ? 1 : 0; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)&flag, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + // mInfo("pUser->pass:%s", pUser->pass); + cols++; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + char pass[TSDB_PASSWORD_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(pass, pUser->pass, pShow->pMeta->pSchemas[cols].bytes); + code = colDataSetVal(pColInfo, numOfRows, (const char *)pass, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + cols++; + + char *buf = NULL; + int32_t tlen = convertIpWhiteListToStr(pUser->pIpWhiteList, &buf); + // int32_t tlen = mndFetchIpWhiteList(pUser->pIpWhiteList, &buf); + if (tlen != 0) { + char *varstr = taosMemoryCalloc(1, VARSTR_HEADER_SIZE + tlen); + varDataSetLen(varstr, tlen); + memcpy(varDataVal(varstr), buf, tlen); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)varstr, false); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + + taosMemoryFree(varstr); + taosMemoryFree(buf); + } else { + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); + code = colDataSetVal(pColInfo, numOfRows, (const char *)NULL, true); + if (code != 0) mError("User:%s, failed to retrieve at columns:%d, cause %s", pUser->acct, cols, tstrerror(code)); + } + + numOfRows++; + sdbRelease(pSdb, pUser); + } + + pShow->numOfRows += numOfRows; +#endif + return numOfRows; +} + static void mndCancelGetNextUser(SMnode *pMnode, void *pIter) { SSdb *pSdb = pMnode->pSdb; sdbCancelFetch(pSdb, pIter); @@ -2480,11 +2610,14 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock int32_t numOfReadViews = taosHashGetSize(pUser->readViews); int32_t numOfWriteViews = taosHashGetSize(pUser->writeViews); int32_t numOfAlterViews = taosHashGetSize(pUser->alterViews); - if (numOfRows + numOfReadDbs + numOfWriteDbs + numOfTopics + numOfReadTbs + numOfWriteTbs + numOfAlterTbs + numOfReadViews + numOfWriteViews + numOfAlterViews >= rows) { + if (numOfRows + numOfReadDbs + numOfWriteDbs + numOfTopics + numOfReadTbs + numOfWriteTbs + numOfAlterTbs + + numOfReadViews + numOfWriteViews + numOfAlterViews >= + rows) { mInfo( "will restore. current num of rows: %d, read dbs %d, write dbs %d, topics %d, read tables %d, write tables " "%d, alter tables %d, read views %d, write views %d, alter views %d", - numOfRows, numOfReadDbs, numOfWriteDbs, numOfTopics, numOfReadTbs, numOfWriteTbs, numOfAlterTbs, numOfReadViews, numOfWriteViews, numOfAlterViews); + numOfRows, numOfReadDbs, numOfWriteDbs, numOfTopics, numOfReadTbs, numOfWriteTbs, numOfAlterTbs, + numOfReadViews, numOfWriteViews, numOfAlterViews); pShow->restore = true; sdbRelease(pSdb, pUser); break; @@ -2870,7 +3003,6 @@ int32_t mndUserRemoveView(SMnode *pMnode, STrans *pTrans, char *view) { return code; } - int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) { int32_t code = 0; SSdb *pSdb = pMnode->pSdb; @@ -2910,3 +3042,9 @@ int32_t mndUserRemoveTopic(SMnode *pMnode, STrans *pTrans, char *topic) { mndUserFreeObj(&newUser); return code; } + +int64_t mndGetUserIpWhiteListVer(SMnode *pMnode, SUserObj *pUser) { + // ver = 0, disable ip white list + // ver > 0, enable ip white list + return tsEnableWhiteList ? pUser->ipWhiteListVer : 0; +} diff --git a/source/dnode/mnode/impl/test/func/func.cpp b/source/dnode/mnode/impl/test/func/func.cpp index ee60556639..0fc903f5db 100644 --- a/source/dnode/mnode/impl/test/func/func.cpp +++ b/source/dnode/mnode/impl/test/func/func.cpp @@ -169,7 +169,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 1; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "f1"); + char name[TSDB_FUNC_NAME_LEN] = "f1"; + taosArrayPush(retrieveReq.pFuncNames, name); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); @@ -220,7 +221,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { retrieveReq.numOfFuncs = TSDB_FUNC_MAX_RETRIEVE + 1; retrieveReq.pFuncNames = taosArrayInit(TSDB_FUNC_MAX_RETRIEVE + 1, TSDB_FUNC_NAME_LEN); for (int32_t i = 0; i < TSDB_FUNC_MAX_RETRIEVE + 1; ++i) { - taosArrayPush(retrieveReq.pFuncNames, "1"); + char name[TSDB_FUNC_NAME_LEN] = "1"; + taosArrayPush(retrieveReq.pFuncNames, name); } int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); @@ -237,7 +239,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 1; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "f2"); + char name[TSDB_FUNC_NAME_LEN] = "f2"; + taosArrayPush(retrieveReq.pFuncNames, name); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); @@ -279,7 +282,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 1; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "f2"); + char name[TSDB_FUNC_NAME_LEN] = "f2"; + taosArrayPush(retrieveReq.pFuncNames, name); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); @@ -316,8 +320,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 2; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "f2"); - taosArrayPush(retrieveReq.pFuncNames, "f1"); + char name1[TSDB_FUNC_NAME_LEN] = "f2"; + taosArrayPush(retrieveReq.pFuncNames, name1); + char name2[TSDB_FUNC_NAME_LEN] = "f1"; + taosArrayPush(retrieveReq.pFuncNames, name2); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); @@ -367,8 +373,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 2; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "f2"); - taosArrayPush(retrieveReq.pFuncNames, "f3"); + char name1[TSDB_FUNC_NAME_LEN] = "f2"; + taosArrayPush(retrieveReq.pFuncNames, name1); + char name2[TSDB_FUNC_NAME_LEN] = "f3"; + taosArrayPush(retrieveReq.pFuncNames, name2); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); @@ -483,7 +491,8 @@ TEST_F(MndTestFunc, 05_Actual_code) { SRetrieveFuncReq retrieveReq = {0}; retrieveReq.numOfFuncs = 1; retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN); - taosArrayPush(retrieveReq.pFuncNames, "udf1"); + char name[TSDB_FUNC_NAME_LEN] = "udf1"; + taosArrayPush(retrieveReq.pFuncNames, name); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); void* pReq = rpcMallocCont(contLen); diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index 0b2de2b151..fc9b89a141 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -57,6 +57,7 @@ extern "C" { #define SDB_GET_INT32(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt32, int32_t) #define SDB_GET_INT16(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt16, int16_t) #define SDB_GET_INT8(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt8, int8_t) +#define SDB_GET_UINT8(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawUInt8, uint8_t) #define SDB_GET_RESERVE(pRaw, dataPos, valLen, pos) \ { \ @@ -76,6 +77,7 @@ extern "C" { #define SDB_SET_INT32(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt32, int32_t) #define SDB_SET_INT16(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt16, int16_t) #define SDB_SET_INT8(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt8, int8_t) +#define SDB_SET_UINT8(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawUInt8, uint8_t) #define SDB_SET_BINARY(pRaw, dataPos, val, valLen, pos) \ { \ @@ -388,6 +390,7 @@ void sdbGetCommitInfo(SSdb *pSdb, int64_t *index, int64_t *term, int64_t *config SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen); void sdbFreeRaw(SSdbRaw *pRaw); int32_t sdbSetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t val); +int32_t sdbSetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t val); int32_t sdbSetRawInt16(SSdbRaw *pRaw, int32_t dataPos, int16_t val); int32_t sdbSetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t val); int32_t sdbSetRawInt64(SSdbRaw *pRaw, int32_t dataPos, int64_t val); @@ -395,6 +398,7 @@ int32_t sdbSetRawBinary(SSdbRaw *pRaw, int32_t dataPos, const char *pVal, int32 int32_t sdbSetRawDataLen(SSdbRaw *pRaw, int32_t dataLen); int32_t sdbSetRawStatus(SSdbRaw *pRaw, ESdbStatus status); int32_t sdbGetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t *val); +int32_t sdbGetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t *val); int32_t sdbGetRawInt16(SSdbRaw *pRaw, int32_t dataPos, int16_t *val); int32_t sdbGetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t *val); int32_t sdbGetRawInt64(SSdbRaw *pRaw, int32_t dataPos, int64_t *val); diff --git a/source/dnode/mnode/sdb/src/sdbRaw.c b/source/dnode/mnode/sdb/src/sdbRaw.c index 244e50b52e..4f68139155 100644 --- a/source/dnode/mnode/sdb/src/sdbRaw.c +++ b/source/dnode/mnode/sdb/src/sdbRaw.c @@ -67,6 +67,21 @@ int32_t sdbSetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t val) { return 0; } +int32_t sdbSetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t val) { + if (pRaw == NULL) { + terrno = TSDB_CODE_INVALID_PTR; + return -1; + } + + if (dataPos + sizeof(uint8_t) > pRaw->dataLen) { + terrno = TSDB_CODE_SDB_INVALID_DATA_LEN; + return -1; + } + + *(uint8_t *)(pRaw->pData + dataPos) = val; + return 0; +} + int32_t sdbSetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t val) { if (pRaw == NULL) { terrno = TSDB_CODE_INVALID_PTR; @@ -174,6 +189,21 @@ int32_t sdbGetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t *val) { return 0; } +int32_t sdbGetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t *val) { + if (pRaw == NULL) { + terrno = TSDB_CODE_INVALID_PTR; + return -1; + } + + if (dataPos + sizeof(uint8_t) > pRaw->dataLen) { + terrno = TSDB_CODE_SDB_INVALID_DATA_LEN; + return -1; + } + + *val = *(uint8_t *)(pRaw->pData + dataPos); + return 0; +} + int32_t sdbGetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t *val) { if (pRaw == NULL) { terrno = TSDB_CODE_INVALID_PTR; diff --git a/source/dnode/snode/src/snode.c b/source/dnode/snode/src/snode.c index c61988574c..481033508b 100644 --- a/source/dnode/snode/src/snode.c +++ b/source/dnode/snode/src/snode.c @@ -25,20 +25,6 @@ #define sndDebug(...) do { if (sndDebugFlag & DEBUG_DEBUG) { taosPrintLog("SND ", DEBUG_DEBUG, sndDebugFlag, __VA_ARGS__);}} while (0) // clang-format on -static STaskId replaceStreamTaskId(SStreamTask *pTask) { - ASSERT(pTask->info.fillHistory); - STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId}; - pTask->id.streamId = pTask->streamTaskId.streamId; - pTask->id.taskId = pTask->streamTaskId.taskId; - return id; -} - -static void restoreStreamTaskId(SStreamTask *pTask, STaskId *pId) { - ASSERT(pTask->info.fillHistory); - pTask->id.taskId = pId->taskId; - pTask->id.streamId = pId->streamId; -} - int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t nextProcessVer) { ASSERT(pTask->info.taskLevel == TASK_LEVEL__AGG && taosArrayGetSize(pTask->upstreamInfo.pList) != 0); int32_t code = streamTaskInit(pTask, pSnode->pMeta, &pSnode->msgCb, nextProcessVer); @@ -85,7 +71,7 @@ SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) { startRsync(); pSnode->msgCb = pOption->msgCb; - pSnode->pMeta = streamMetaOpen(path, pSnode, (FTaskExpand *)sndExpandTask, SNODE_HANDLE, taosGetTimestampMs(), tqStartTaskCompleteCallback); + pSnode->pMeta = streamMetaOpen(path, pSnode, (FTaskBuild *)sndExpandTask, tqExpandStreamTask, SNODE_HANDLE, taosGetTimestampMs(), tqStartTaskCompleteCallback); if (pSnode->pMeta == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto FAIL; @@ -136,6 +122,8 @@ int32_t sndProcessStreamMsg(SSnode *pSnode, SRpcMsg *pMsg) { return tqStreamProcessReqCheckpointRsp(pSnode->pMeta, pMsg); case TDMT_STREAM_TASK_CHECKPOINT_READY_RSP: return tqStreamProcessCheckpointReadyRsp(pSnode->pMeta, pMsg); + case TDMT_MND_STREAM_CHKPT_REPORT_RSP: + return tqStreamProcessChkptReportRsp(pSnode->pMeta, pMsg); case TDMT_STREAM_RETRIEVE_TRIGGER: return tqStreamTaskProcessRetrieveTriggerReq(pSnode->pMeta, pMsg); case TDMT_STREAM_RETRIEVE_TRIGGER_RSP: diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 21d967ad93..fccba91db7 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -52,6 +52,7 @@ extern const SVnodeCfg vnodeCfgDefault; int32_t vnodeInit(int32_t nthreads); void vnodeCleanup(); int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs *pTfs); +bool vnodeShouldRemoveWal(SVnode *pVnode); int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t diskPrimary, STfs *pTfs); int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnodeHashRangeReq *pReq, int32_t diskPrimary, STfs *pTfs); @@ -181,7 +182,7 @@ void tsdbReaderSetNotifyCb(STsdbReader *pReader, TsdReaderNotifyCbFn not int32_t tsdbReuseCacherowsReader(void *pReader, void *pTableIdList, int32_t numOfTables); int32_t tsdbCacherowsReaderOpen(void *pVnode, int32_t type, void *pTableIdList, int32_t numOfTables, int32_t numOfCols, SArray *pCidList, int32_t *pSlotIds, uint64_t suid, void **pReader, const char *idstr, - SArray *pFuncTypeList, SColumnInfo* pkCol, int32_t numOfPks); + SArray *pFuncTypeList, SColumnInfo *pkCol, int32_t numOfPks); int32_t tsdbRetrieveCacheRows(void *pReader, SSDataBlock *pResBlock, const int32_t *slotIds, const int32_t *dstSlotIds, SArray *pTableUids); void *tsdbCacherowsReaderClose(void *pReader); @@ -218,8 +219,8 @@ typedef struct STqReader { STqReader *tqReaderOpen(SVnode *pVnode); void tqReaderClose(STqReader *); -bool tqGetTablePrimaryKey(STqReader* pReader); -void tqSetTablePrimaryKey(STqReader* pReader, int64_t uid); +bool tqGetTablePrimaryKey(STqReader *pReader); +void tqSetTablePrimaryKey(STqReader *pReader, int64_t uid); void tqReaderSetColIdList(STqReader *pReader, SArray *pColIdList); int32_t tqReaderSetTbUidList(STqReader *pReader, const SArray *tbUidList, const char *id); @@ -278,8 +279,8 @@ struct STsdbCfg { int32_t keep2; // just for save config, don't use in tsdbRead/tsdbCommit/..., and use STsdbKeepCfg in STsdb instead int32_t keepTimeOffset; // just for save config, use STsdbKeepCfg in STsdb instead SRetention retentions[TSDB_RETENTION_MAX]; - int32_t encryptAlgorithm; - char encryptKey[ENCRYPT_KEY_LEN + 1]; + int32_t encryptAlgorithm; + char encryptKey[ENCRYPT_KEY_LEN + 1]; }; typedef struct { diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 8222af4d60..22b26498e4 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -261,9 +261,10 @@ int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessTaskResetReq(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessStreamHbRsp(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessStreamReqCheckpointRsp(STQ* pTq, SRpcMsg* pMsg); +int32_t tqProcessTaskChkptReportRsp(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessTaskCheckpointReadyRsp(STQ* pTq, SRpcMsg* pMsg); -int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver); +int32_t tqBuildStreamTask(void* pTq, SStreamTask* pTask, int64_t ver); int32_t tqScanWal(STQ* pTq); int tqCommit(STQ*); diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 2a122081b8..58eef3caa6 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -2240,7 +2240,7 @@ int32_t metaUpdateTableColCompress(SMeta *pMeta, int64_t version, SVAlterTbReq * uint32_t dst = 0; updated = tUpdateCompress(p->alg, pReq->compress, TSDB_COLVAL_COMPRESS_DISABLED, TSDB_COLVAL_LEVEL_DISABLED, TSDB_COLVAL_LEVEL_MEDIUM, &dst); - if (updated) { + if (updated > 0) { p->alg = dst; } } @@ -2250,6 +2250,11 @@ int32_t metaUpdateTableColCompress(SMeta *pMeta, int64_t version, SVAlterTbReq * tDecoderClear(&dc); terrno = TSDB_CODE_VND_COLUMN_COMPRESS_ALREADY_EXIST; goto _err; + } else if (updated < 0) { + tdbFree(pVal); + tDecoderClear(&dc); + terrno = TSDB_CODE_TSC_COMPRESS_LEVEL_ERROR; + goto _err; } tbEntry.version = version; diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index 3cc7c6ec66..81bb519b27 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -299,7 +299,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat tdRSmaTaskInit(pStreamTask->pMeta, pItem, &pStreamTask->id); pStreamTask->status.pSM = streamCreateStateMachine(pStreamTask); pStreamTask->chkInfo.pActiveInfo = streamTaskCreateActiveChkptInfo(); - pStreamState = streamStateOpen(taskInfDir, pStreamTask, true, -1, -1); + pStreamState = streamStateOpen(taskInfDir, pStreamTask, pStreamTask->id.streamId, pStreamTask->id.taskId); if (!pStreamState) { terrno = TSDB_CODE_RSMA_STREAM_STATE_OPEN; return TSDB_CODE_FAILED; diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 712cfbaa55..08fdda0e29 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -50,6 +50,9 @@ void tqDestroyTqHandle(void* data) { if (pData->block != NULL) { blockDataDestroy(pData->block); } + if (pData->pRef) { + walCloseRef(pData->pRef->pWal, pData->pRef->refId); + } } static bool tqOffsetEqual(const STqOffset* pLeft, const STqOffset* pRight) { @@ -87,7 +90,8 @@ STQ* tqOpen(const char* path, SVnode* pVnode) { int32_t tqInitialize(STQ* pTq) { int32_t vgId = TD_VID(pTq->pVnode); - pTq->pStreamMeta = streamMetaOpen(pTq->path, pTq, (FTaskExpand*)tqExpandTask, vgId, -1, tqStartTaskCompleteCallback); + pTq->pStreamMeta = + streamMetaOpen(pTq->path, pTq, tqBuildStreamTask, tqExpandStreamTask, vgId, -1, tqStartTaskCompleteCallback); if (pTq->pStreamMeta == NULL) { return -1; } @@ -571,9 +575,6 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg taosMsleep(10); continue; } - if (pHandle->pRef) { - walCloseRef(pTq->pVnode->pWal, pHandle->pRef->refId); - } tqUnregisterPushHandle(pTq, pHandle); @@ -658,12 +659,10 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg taosRLockLatch(&pTq->lock); ret = tqMetaGetHandle(pTq, req.subKey); taosRUnLockLatch(&pTq->lock); - if (ret < 0) { break; } } - if (pHandle == NULL) { if (req.oldConsumerId != -1) { tqError("vgId:%d, build new consumer handle %s for consumer:0x%" PRIx64 ", but old consumerId:0x%" PRIx64, @@ -708,14 +707,16 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg } } -end: + end: tDecoderClear(&dc); return ret; } static void freePtr(void* ptr) { taosMemoryFree(*(void**)ptr); } -int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) { +int32_t tqBuildStreamTask(void* pTqObj, SStreamTask* pTask, int64_t nextProcessVer) { + STQ* pTq = (STQ*) pTqObj; + int32_t vgId = TD_VID(pTq->pVnode); tqDebug("s-task:0x%x start to build task", pTask->id.taskId); @@ -1012,16 +1013,6 @@ int32_t tqProcessTaskDropReq(STQ* pTq, char* msg, int32_t msgLen) { } int32_t tqProcessTaskUpdateCheckpointReq(STQ* pTq, char* msg, int32_t msgLen) { - int32_t vgId = TD_VID(pTq->pVnode); - SVUpdateCheckpointInfoReq* pReq = (SVUpdateCheckpointInfoReq*)msg; - -// if (!pTq->pVnode->restored) { -// tqDebug("vgId:%d update-checkpoint-info msg received during restoring, checkpointId:%" PRId64 -// ", transId:%d s-task:0x%x ignore it", -// vgId, pReq->checkpointId, pReq->transId, pReq->taskId); -// return TSDB_CODE_SUCCESS; -// } - return tqStreamTaskProcessUpdateCheckpointReq(pTq->pStreamMeta, msg, msgLen); } @@ -1278,3 +1269,7 @@ int32_t tqProcessStreamReqCheckpointRsp(STQ* pTq, SRpcMsg* pMsg) { int32_t tqProcessTaskCheckpointReadyRsp(STQ* pTq, SRpcMsg* pMsg) { return tqStreamProcessCheckpointReadyRsp(pTq->pStreamMeta, pMsg); } + +int32_t tqProcessTaskChkptReportRsp(STQ* pTq, SRpcMsg* pMsg) { + return tqStreamProcessChkptReportRsp(pTq->pStreamMeta, pMsg); +} diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c index 404cbf26dd..02184f1d50 100644 --- a/source/dnode/vnode/src/tq/tqMeta.c +++ b/source/dnode/vnode/src/tq/tqMeta.c @@ -352,7 +352,6 @@ int32_t tqCreateHandle(STQ* pTq, SMqRebVgReq* req, STqHandle* handle){ memcpy(handle->subKey, req->subKey, TSDB_SUBSCRIBE_KEY_LEN); handle->consumerId = req->newConsumerId; - handle->epoch = -1; handle->execHandle.subType = req->subType; handle->fetchMeta = req->withMeta; @@ -371,7 +370,7 @@ int32_t tqCreateHandle(STQ* pTq, SMqRebVgReq* req, STqHandle* handle){ if(buildHandle(pTq, handle) < 0){ return -1; } - tqInfo("tqCreateHandle %s consumer 0x%" PRIx64 " vgId:%d", handle->subKey, handle->consumerId, vgId); + tqInfo("tqCreateHandle %s consumer 0x%" PRIx64 " vgId:%d, snapshotVer:%" PRId64, handle->subKey, handle->consumerId, vgId, handle->snapshotVer); return taosHashPut(pTq->pHandle, handle->subKey, strlen(handle->subKey), handle, sizeof(STqHandle)); } diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index 71e6771370..7375478e61 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -87,7 +87,7 @@ int tqUnregisterPushHandle(STQ* pTq, void *handle) { int32_t ret = taosHashRemove(pTq->pPushMgr, pHandle->subKey, strlen(pHandle->subKey)); tqInfo("vgId:%d remove pHandle:%p,ret:%d consumer Id:0x%" PRIx64, vgId, pHandle, ret, pHandle->consumerId); - if(pHandle->msg != NULL) { + if(ret == 0 && pHandle->msg != NULL) { // tqPushDataRsp(pHandle, vgId); tqPushEmptyDataRsp(pHandle, vgId); diff --git a/source/dnode/vnode/src/tq/tqUtil.c b/source/dnode/vnode/src/tq/tqUtil.c index 33e3414a7d..5290c39d42 100644 --- a/source/dnode/vnode/src/tq/tqUtil.c +++ b/source/dnode/vnode/src/tq/tqUtil.c @@ -605,14 +605,15 @@ int32_t tqGetStreamExecInfo(SVnode* pVnode, int64_t streamId, int64_t* pDelay, b numOfTasks = taosArrayGetSize(pMeta->pTaskList); for (int32_t i = 0; i < numOfTasks; ++i) { - STaskId* pId = taosArrayGet(pMeta->pTaskList, i); + SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i); if (pId->streamId != streamId) { continue; } - SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, pId, sizeof(*pId)); + STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId}; + SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id)); if (ppTask == NULL) { - tqError("vgId:%d failed to acquire task:0x%" PRIx64 " in retrieving progress", pMeta->vgId, pId->taskId); + tqError("vgId:%d failed to acquire task:0x%x in retrieving progress", pMeta->vgId, pId->taskId); continue; } diff --git a/source/dnode/vnode/src/tqCommon/tqCommon.c b/source/dnode/vnode/src/tqCommon/tqCommon.c index c55745e5c5..50a52e58c5 100644 --- a/source/dnode/vnode/src/tqCommon/tqCommon.c +++ b/source/dnode/vnode/src/tqCommon/tqCommon.c @@ -30,37 +30,26 @@ typedef struct SMStreamCheckpointReadyRspMsg { static int32_t doProcessDummyRspMsg(SStreamMeta* pMeta, SRpcMsg* pMsg); -static STaskId replaceStreamTaskId(SStreamTask* pTask) { - ASSERT(pTask->info.fillHistory); - STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId}; - - pTask->id.streamId = pTask->streamTaskId.streamId; - pTask->id.taskId = pTask->streamTaskId.taskId; - - return id; -} - -static void restoreStreamTaskId(SStreamTask* pTask, STaskId* pId) { - ASSERT(pTask->info.fillHistory); - pTask->id.taskId = pId->taskId; - pTask->id.streamId = pId->streamId; -} - int32_t tqExpandStreamTask(SStreamTask* pTask) { SStreamMeta* pMeta = pTask->pMeta; int32_t vgId = pMeta->vgId; - STaskId taskId = {0}; int64_t st = taosGetTimestampMs(); + int64_t streamId = 0; + int32_t taskId = 0; tqDebug("s-task:%s vgId:%d start to expand stream task", pTask->id.idStr, vgId); if (pTask->info.fillHistory) { - taskId = replaceStreamTaskId(pTask); + streamId = pTask->streamTaskId.streamId; + taskId = pTask->streamTaskId.taskId; + } else { + streamId = pTask->id.streamId; + taskId = pTask->id.taskId; } // sink task does not need the pState if (pTask->info.taskLevel != TASK_LEVEL__SINK) { - pTask->pState = streamStateOpen(pMeta->path, pTask, false, -1, -1); + pTask->pState = streamStateOpen(pMeta->path, pTask, streamId, taskId); if (pTask->pState == NULL) { tqError("s-task:%s (vgId:%d) failed to open state for task, expand task failed", pTask->id.idStr, vgId); return -1; @@ -69,10 +58,6 @@ int32_t tqExpandStreamTask(SStreamTask* pTask) { } } - if (pTask->info.fillHistory) { - restoreStreamTaskId(pTask, &taskId); - } - SReadHandle handle = { .checkpointId = pTask->chkInfo.checkpointId, .pStateBackend = pTask->pState, @@ -185,7 +170,7 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM SStreamTask* pTask = *ppTask; const char* idstr = pTask->id.idStr; - if (pMeta->updateInfo.transId != req.transId) { + if ((pMeta->updateInfo.transId != req.transId) && (pMeta->updateInfo.transId != -1)) { if (req.transId < pMeta->updateInfo.transId) { tqError("s-task:%s vgId:%d disorder update nodeEp msg recv, discarded, newest transId:%d, recv:%d", idstr, vgId, pMeta->updateInfo.transId, req.transId); @@ -197,10 +182,8 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM } else { tqInfo("s-task:%s vgId:%d receive new trans to update nodeEp msg from mnode, transId:%d, prev transId:%d", idstr, vgId, req.transId, pMeta->updateInfo.transId); - // info needs to be kept till the new trans to update the nodeEp arrived. - taosHashClear(pMeta->updateInfo.pTasks); - pMeta->updateInfo.transId = req.transId; + streamMetaInitUpdateTaskList(pMeta, req.transId); } } else { tqDebug("s-task:%s vgId:%d recv trans to update nodeEp from mnode, transId:%d", idstr, vgId, req.transId); @@ -280,6 +263,8 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM // persist to disk } + streamMetaClearUpdateTaskList(pMeta); + if (!restored) { tqDebug("vgId:%d vnode restore not completed, not start the tasks, clear the start after nodeUpdate flag", vgId); pMeta->startInfo.tasksWillRestart = 0; @@ -362,6 +347,7 @@ int32_t tqStreamTaskProcessDispatchRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { SStreamDispatchRsp* pRsp = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)); int32_t vgId = pMeta->vgId; + pRsp->upstreamNodeId = htonl(pRsp->upstreamNodeId); pRsp->upstreamTaskId = htonl(pRsp->upstreamTaskId); pRsp->streamId = htobe64(pRsp->streamId); pRsp->downstreamTaskId = htonl(pRsp->downstreamTaskId); @@ -369,6 +355,9 @@ int32_t tqStreamTaskProcessDispatchRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { pRsp->stage = htobe64(pRsp->stage); pRsp->msgId = htonl(pRsp->msgId); + tqDebug("s-task:0x%x vgId:%d recv dispatch-rsp from 0x%x vgId:%d", pRsp->upstreamTaskId, pRsp->upstreamNodeId, + pRsp->downstreamTaskId, pRsp->downstreamNodeId); + SStreamTask* pTask = streamMetaAcquireTask(pMeta, pRsp->streamId, pRsp->upstreamTaskId); if (pTask) { streamProcessDispatchRsp(pTask, pRsp, pMsg->code); @@ -414,7 +403,9 @@ int32_t tqStreamTaskProcessRetrieveReq(SStreamMeta* pMeta, SRpcMsg* pMsg) { streamMetaReleaseTask(pMeta, pTask); tCleanupStreamRetrieveReq(&req); - return code; + + // always return success, to disable the auto rsp + return TSDB_CODE_SUCCESS; } int32_t tqStreamTaskProcessCheckReq(SStreamMeta* pMeta, SRpcMsg* pMsg) { @@ -629,8 +620,8 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen // drop the related fill-history task firstly if (hTaskId.taskId != 0 && hTaskId.streamId != 0) { - streamMetaUnregisterTask(pMeta, hTaskId.streamId, hTaskId.taskId); tqDebug("s-task:0x%x vgId:%d drop rel fill-history task:0x%x firstly", pReq->taskId, vgId, (int32_t)hTaskId.taskId); + streamMetaUnregisterTask(pMeta, hTaskId.streamId, hTaskId.taskId); } // drop the stream task now @@ -646,8 +637,6 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen } streamMetaWUnLock(pMeta); - -// tqStreamRemoveTaskBackend(pMeta, &id); return 0; } @@ -1078,6 +1067,8 @@ int32_t tqStreamProcessStreamHbRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { return d int32_t tqStreamProcessReqCheckpointRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { return doProcessDummyRspMsg(pMeta, pMsg); } +int32_t tqStreamProcessChkptReportRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) {return doProcessDummyRspMsg(pMeta, pMsg);} + int32_t tqStreamProcessCheckpointReadyRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { SMStreamCheckpointReadyRspMsg* pRsp = pMsg->pCont; diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 2a49c1ba0a..57b8a99fb1 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -46,6 +46,12 @@ SSttBlockLoadInfo *tCreateSttBlockLoadInfo(STSchema *pSchema, int16_t *colList, } pLoadInfo->aSttBlk = taosArrayInit(4, sizeof(SSttBlk)); + if (pLoadInfo->aSttBlk == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + taosMemoryFreeClear(pLoadInfo); + return NULL; + } + pLoadInfo->pSchema = pSchema; pLoadInfo->colIds = colList; pLoadInfo->numOfCols = numOfCols; @@ -107,15 +113,21 @@ void *destroySttBlockReader(SArray *pLDataIterArray, SSttBlockLoadCostInfo *pLoa SArray *pList = taosArrayGetP(pLDataIterArray, i); for (int32_t j = 0; j < taosArrayGetSize(pList); ++j) { SLDataIter *pIter = taosArrayGetP(pList, j); + if (pIter->pBlockLoadInfo == NULL) { + continue; + } + + SSttBlockLoadCostInfo* pCost = &pIter->pBlockLoadInfo->cost; if (pLoadCost != NULL) { - pLoadCost->loadBlocks += pIter->pBlockLoadInfo->cost.loadBlocks; - pLoadCost->loadStatisBlocks += pIter->pBlockLoadInfo->cost.loadStatisBlocks; - pLoadCost->blockElapsedTime += pIter->pBlockLoadInfo->cost.blockElapsedTime; - pLoadCost->statisElapsedTime += pIter->pBlockLoadInfo->cost.statisElapsedTime; + pLoadCost->loadBlocks += pCost->loadBlocks; + pLoadCost->loadStatisBlocks += pCost->loadStatisBlocks; + pLoadCost->blockElapsedTime += pCost->blockElapsedTime; + pLoadCost->statisElapsedTime += pCost->statisElapsedTime; } destroyLDataIter(pIter); } + taosArrayDestroy(pList); } @@ -903,6 +915,10 @@ int32_t tMergeTreeOpen2(SMergeTree *pMTree, SMergeTreeConf *pConf, SSttDataInfoF if (pLoadInfo == NULL) { pLoadInfo = tCreateSttBlockLoadInfo(pConf->pSchema, pConf->pCols, pConf->numOfCols); + if (pLoadInfo == NULL) { + code = terrno; + goto _end; + } } memset(pIter, 0, sizeof(SLDataIter)); diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index e1cfcba070..c6f13bc0a8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -2240,7 +2240,8 @@ static bool initSttBlockReader(SSttBlockReader* pSttBlockReader, STableBlockScan }; SSttDataInfoForTable info = {.pKeyRangeList = taosArrayInit(4, sizeof(SSttKeyRange))}; - int32_t code = tMergeTreeOpen2(&pSttBlockReader->mergeTree, &conf, &info); + + int32_t code = tMergeTreeOpen2(&pSttBlockReader->mergeTree, &conf, &info); if (code != TSDB_CODE_SUCCESS) { return false; } @@ -4896,7 +4897,7 @@ static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_ } int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, bool* allHave, bool* hasNullSMA) { - SColumnDataAgg*** pBlockSMA = &pDataBlock->pBlockAgg; + SColumnDataAgg** pBlockSMA = &pDataBlock->pBlockAgg; int32_t code = 0; *allHave = false; @@ -4951,7 +4952,13 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, if (pResBlock->pBlockAgg == NULL) { size_t num = taosArrayGetSize(pResBlock->pDataBlock); - pResBlock->pBlockAgg = taosMemoryCalloc(num, POINTER_BYTES); + pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg)); + if (pResBlock->pBlockAgg == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + for(int i = 0; i < num; ++i) { + pResBlock->pBlockAgg[i].colId = -1; + } } // do fill all null column value SMA info @@ -4963,13 +4970,12 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, while (j < numOfCols && i < size) { SColumnDataAgg* pAgg = &pSup->colAggArray.data[i]; if (pAgg->colId == pSup->colId[j]) { - pResBlock->pBlockAgg[pSup->slotId[j]] = pAgg; + pResBlock->pBlockAgg[pSup->slotId[j]] = *pAgg; i += 1; j += 1; } else if (pAgg->colId < pSup->colId[j]) { i += 1; } else if (pSup->colId[j] < pAgg->colId) { - pResBlock->pBlockAgg[pSup->slotId[j]] = NULL; *allHave = false; j += 1; } diff --git a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c index 8ab7f7eeef..273ec6d797 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c @@ -985,6 +985,10 @@ int32_t tsdbGetRowsInSttFiles(STFileSet* pFileSet, SArray* pSttFileBlockIterArra if (pIter->pBlockLoadInfo == NULL) { pIter->pBlockLoadInfo = tCreateSttBlockLoadInfo(pConf->pSchema, pConf->pCols, pConf->numOfCols); + if (pIter->pBlockLoadInfo == NULL) { + tsdbError("failed to create block load info, code: out of memory, %s", pstr); + continue; + } } // load stt blocks statis for all stt-blocks, to decide if the data of queried table exists in current stt file diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c index 3d53d1ada3..0d3994d78e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRetention.c +++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c @@ -38,6 +38,34 @@ static int32_t tsdbDoRemoveFileObject(SRTNer *rtner, const STFileObj *fobj) { return TARRAY2_APPEND(&rtner->fopArr, op); } +static int64_t tsdbCopyFileWithLimitedSpeed(TdFilePtr from, TdFilePtr to, int64_t size, uint32_t limitMB) { + int64_t total = 0; + int64_t interval = 1000; // 1s + int64_t limit = limitMB ? limitMB * 1024 * 1024 : INT64_MAX; + int64_t offset = 0; + int64_t remain = size; + + while (remain > 0) { + int64_t n; + int64_t last = taosGetTimestampMs(); + if ((n = taosFSendFile(to, from, &offset, TMIN(limit, remain))) < 0) { + return -1; + } + + total += n; + remain -= n; + + if (remain > 0) { + int64_t elapsed = taosGetTimestampMs() - last; + if (elapsed < interval) { + taosMsleep(interval - elapsed); + } + } + } + + return total; +} + static int32_t tsdbDoCopyFileLC(SRTNer *rtner, const STFileObj *from, const STFile *to) { int32_t code = 0; int32_t lino = 0; @@ -98,7 +126,8 @@ static int32_t tsdbDoCopyFile(SRTNer *rtner, const STFileObj *from, const STFile if (fdTo == NULL) code = terrno; TSDB_CHECK_CODE(code, lino, _exit); - int64_t n = taosFSendFile(fdTo, fdFrom, 0, tsdbLogicToFileSize(from->f->size, rtner->szPage)); + int64_t n = tsdbCopyFileWithLimitedSpeed(fdFrom, fdTo, tsdbLogicToFileSize(from->f->size, rtner->szPage), + tsRetentionSpeedLimitMB); if (n < 0) { code = TAOS_SYSTEM_ERROR(errno); TSDB_CHECK_CODE(code, lino, _exit); diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index cd6863fd89..c7b54d36b6 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -13,9 +13,9 @@ * along with this program. If not, see . */ +#include "tglobal.h" #include "tutil.h" #include "vnd.h" -#include "tglobal.h" const SVnodeCfg vnodeCfgDefault = {.vgId = -1, .dbname = "", @@ -47,6 +47,7 @@ const SVnodeCfg vnodeCfgDefault = {.vgId = -1, .segSize = 0, .retentionSize = -1, .level = TAOS_WAL_WRITE, + .clearFiles = 0, }, .hashBegin = 0, .hashEnd = 0, @@ -142,6 +143,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { if (tjsonAddIntegerToObject(pJson, "wal.retentionSize", pCfg->walCfg.retentionSize) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "wal.segSize", pCfg->walCfg.segSize) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "wal.level", pCfg->walCfg.level) < 0) return -1; + if (tjsonAddIntegerToObject(pJson, "wal.clearFiles", pCfg->walCfg.clearFiles) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "wal.encryptAlgorithm", pCfg->walCfg.encryptAlgorithm) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "tdbEncryptAlgorithm", pCfg->tdbEncryptAlgorithm) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "sstTrigger", pCfg->sttTrigger) < 0) return -1; @@ -249,12 +251,11 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { tjsonGetNumberValue(pJson, "tsdb.encryptAlgorithm", pCfg->tsdbCfg.encryptAlgorithm, code); if (code < 0) return -1; #if defined(TD_ENTERPRISE) - if(pCfg->tsdbCfg.encryptAlgorithm == DND_CA_SM4){ - if(tsEncryptKey[0] == 0){ + if (pCfg->tsdbCfg.encryptAlgorithm == DND_CA_SM4) { + if (tsEncryptKey[0] == 0) { terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; return -1; - } - else{ + } else { strncpy(pCfg->tsdbCfg.encryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } } @@ -273,15 +274,16 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { if (code < 0) return -1; tjsonGetNumberValue(pJson, "wal.level", pCfg->walCfg.level, code); if (code < 0) return -1; + tjsonGetNumberValue(pJson, "wal.clearFiles", pCfg->walCfg.clearFiles, code); + if (code < 0) return -1; tjsonGetNumberValue(pJson, "wal.encryptAlgorithm", pCfg->walCfg.encryptAlgorithm, code); if (code < 0) return -1; #if defined(TD_ENTERPRISE) - if(pCfg->walCfg.encryptAlgorithm == DND_CA_SM4){ - if(tsEncryptKey[0] == 0){ + if (pCfg->walCfg.encryptAlgorithm == DND_CA_SM4) { + if (tsEncryptKey[0] == 0) { terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; return -1; - } - else{ + } else { strncpy(pCfg->walCfg.encryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } } @@ -289,12 +291,11 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { tjsonGetNumberValue(pJson, "tdbEncryptAlgorithm", pCfg->tdbEncryptAlgorithm, code); if (code < 0) return -1; #if defined(TD_ENTERPRISE) - if(pCfg->tdbEncryptAlgorithm == DND_CA_SM4){ - if(tsEncryptKey[0] == 0){ + if (pCfg->tdbEncryptAlgorithm == DND_CA_SM4) { + if (tsEncryptKey[0] == 0) { terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; return -1; - } - else{ + } else { strncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } } diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index da8c3a6cad..ea9209c6b4 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -81,6 +81,8 @@ int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs return 0; } +bool vnodeShouldRemoveWal(SVnode *pVnode) { return pVnode->config.walCfg.clearFiles == 1; } + int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t diskPrimary, STfs *pTfs) { SVnodeInfo info = {0}; char dir[TSDB_FILENAME_LEN] = {0}; @@ -129,6 +131,12 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t } pCfg->changeVersion = pReq->changeVersion; + if (info.config.walCfg.clearFiles) { + info.config.walCfg.clearFiles = 0; + + vInfo("vgId:%d, reset wal clearFiles", pReq->vgId); + } + vInfo("vgId:%d, save config while alter, replicas:%d totalReplicas:%d selfIndex:%d changeVersion:%d", pReq->vgId, pCfg->replicaNum, pCfg->totalReplicaNum, pCfg->myIndex, pCfg->changeVersion); @@ -486,15 +494,14 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC if (tsEnableMonitor && pVnode->monitor.insertCounter == NULL) { taos_counter_t *counter = NULL; - int32_t label_count = 7; - const char *sample_labels[] = {VNODE_METRIC_TAG_NAME_SQL_TYPE, VNODE_METRIC_TAG_NAME_CLUSTER_ID, - VNODE_METRIC_TAG_NAME_DNODE_ID, VNODE_METRIC_TAG_NAME_DNODE_EP, - VNODE_METRIC_TAG_NAME_VGROUP_ID, VNODE_METRIC_TAG_NAME_USERNAME, - VNODE_METRIC_TAG_NAME_RESULT}; - counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", - label_count, sample_labels); - vInfo("vgId:%d, new metric:%p",TD_VID(pVnode), counter); - if(taos_collector_registry_register_metric(counter) == 1){ + int32_t label_count = 7; + const char *sample_labels[] = {VNODE_METRIC_TAG_NAME_SQL_TYPE, VNODE_METRIC_TAG_NAME_CLUSTER_ID, + VNODE_METRIC_TAG_NAME_DNODE_ID, VNODE_METRIC_TAG_NAME_DNODE_EP, + VNODE_METRIC_TAG_NAME_VGROUP_ID, VNODE_METRIC_TAG_NAME_USERNAME, + VNODE_METRIC_TAG_NAME_RESULT}; + counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", label_count, sample_labels); + vInfo("vgId:%d, new metric:%p", TD_VID(pVnode), counter); + if (taos_collector_registry_register_metric(counter) == 1) { taos_counter_destroy(counter); counter = taos_collector_registry_get_metric(VNODE_METRIC_SQL_COUNT); vInfo("vgId:%d, get metric from registry:%p", TD_VID(pVnode), counter); diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index 19be7e7ebd..5b17e0f1da 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -120,7 +120,8 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { memcpy(metaRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols); } if (metaRsp.pSchemaExt) { - code = fillTableColCmpr(&mer1, metaRsp.pSchemaExt, metaRsp.numOfColumns); + SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1; + code = fillTableColCmpr(pReader, metaRsp.pSchemaExt, metaRsp.numOfColumns); if (code < 0) { code = TSDB_CODE_INVALID_MSG; goto _exit; @@ -254,15 +255,18 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { memcpy(cfgRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols); } - if (useCompress(cfgRsp.tableType)) { - SColCmprWrapper *pColCmpr = &mer1.me.colCmpr; - for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) { - SColCmpr *pCmpr = &pColCmpr->pColCmpr[i]; - SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i; - pSchExt->colId = pCmpr->id; - pSchExt->compress = pCmpr->alg; - } + // if (useCompress(cfgRsp.tableType)) { + + SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1; + SColCmprWrapper *pColCmpr = &pReader->me.colCmpr; + + for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) { + SColCmpr *pCmpr = &pColCmpr->pColCmpr[i]; + SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i; + pSchExt->colId = pCmpr->id; + pSchExt->compress = pCmpr->alg; } + //} // encode and send response rspLen = tSerializeSTableCfgRsp(NULL, 0, &cfgRsp); @@ -752,13 +756,13 @@ int32_t vnodeGetTableSchema(void *pVnode, int64_t uid, STSchema **pSchema, int64 return tsdbGetTableSchema(((SVnode *)pVnode)->pMeta, uid, pSchema, suid); } -int32_t vnodeGetStreamProgress(SVnode* pVnode, SRpcMsg* pMsg, bool direct) { - int32_t code = 0; - SStreamProgressReq req; - SStreamProgressRsp rsp = {0}; - SRpcMsg rpcMsg = {.info = pMsg->info, .code = 0}; - char * buf = NULL; - int32_t rspLen = 0; +int32_t vnodeGetStreamProgress(SVnode *pVnode, SRpcMsg *pMsg, bool direct) { + int32_t code = 0; + SStreamProgressReq req; + SStreamProgressRsp rsp = {0}; + SRpcMsg rpcMsg = {.info = pMsg->info, .code = 0}; + char *buf = NULL; + int32_t rspLen = 0; code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req); if (code == TSDB_CODE_SUCCESS) { diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 002f04b8a7..f9bb636be3 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -854,6 +854,8 @@ int32_t vnodeProcessStreamMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) return tqProcessStreamReqCheckpointRsp(pVnode->pTq, pMsg); case TDMT_VND_GET_STREAM_PROGRESS: return tqStreamProgressRetrieveReq(pVnode->pTq, pMsg); + case TDMT_MND_STREAM_CHKPT_REPORT_RSP: + return tqProcessTaskChkptReportRsp(pVnode->pTq, pMsg); default: vError("unknown msg type:%d in stream queue", pMsg->msgType); return TSDB_CODE_APP_ERROR; @@ -2021,6 +2023,9 @@ static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pRe } if (pVnode->config.walCfg.level != req.walLevel) { + if (pVnode->config.walCfg.level == 0) { + pVnode->config.walCfg.clearFiles = 1; + } pVnode->config.walCfg.level = req.walLevel; walChanged = true; } diff --git a/source/dnode/vnode/test/tsdbSmaTest.cpp b/source/dnode/vnode/test/tsdbSmaTest.cpp index 43eaacfff9..8b19c0dc95 100644 --- a/source/dnode/vnode/test/tsdbSmaTest.cpp +++ b/source/dnode/vnode/test/tsdbSmaTest.cpp @@ -368,6 +368,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) { SDiskCfg pDisks = {0}; pDisks.level = 0; pDisks.primary = 1; + pDisks.disable = 0; strncpy(pDisks.dir, TD_DATA_DIR_PATH, TSDB_FILENAME_LEN); int32_t numOfDisks = 1; pTsdb->pTfs = tfsOpen(&pDisks, numOfDisks); diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 4cc496e4a0..40e85e90d2 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -239,23 +239,6 @@ static int32_t buildCreateDBResultDataBlock(SSDataBlock** pOutput) { return code; } -static int32_t buildAliveResultDataBlock(SSDataBlock** pOutput) { - SSDataBlock* pBlock = createDataBlock(); - if (NULL == pBlock) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - SColumnInfoData infoData = createColumnInfoData(TSDB_DATA_TYPE_INT, sizeof(int32_t), 1); - int32_t code = blockDataAppendColInfo(pBlock, &infoData); - - if (TSDB_CODE_SUCCESS == code) { - *pOutput = pBlock; - } else { - blockDataDestroy(pBlock); - } - return code; -} - int64_t getValOfDiffPrecision(int8_t unit, int64_t val) { int64_t v = 0; switch (unit) { @@ -403,110 +386,6 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbName, ch colDataSetVal(pCol2, 0, buf2, false); } -#define CHECK_LEADER(n) \ - (row[n] && (fields[n].type == TSDB_DATA_TYPE_VARCHAR && \ - strncasecmp(row[n], "leader", varDataLen((char*)row[n] - VARSTR_HEADER_SIZE)) == 0)) -// on this row, if have leader return true else return false -bool existLeaderRole(TAOS_ROW row, TAOS_FIELD* fields, int nFields) { - // vgroup_id | db_name | tables | v1_dnode | v1_status | v2_dnode | v2_status | v3_dnode | v3_status | v4_dnode | - // v4_status | cacheload | tsma | - if (nFields != 14) { - return false; - } - - // check have leader on cloumn v*_status on 4 6 8 10 - if (CHECK_LEADER(4) || CHECK_LEADER(6) || CHECK_LEADER(8) || CHECK_LEADER(10)) { - return true; - } - - return false; -} - -// get db alive status, return 1 is alive else return 0 -int32_t getAliveStatusFromApi(int64_t* pConnId, char* dbName, int32_t* pStatus) { - char sql[128 + TSDB_DB_NAME_LEN] = "select * from information_schema.ins_vgroups"; - int32_t code; - - // filter with db name - if (dbName && dbName[0] != 0) { - char str[64 + TSDB_DB_NAME_LEN] = ""; - // test db name exist - sprintf(str, "show create database %s ;", dbName); - TAOS_RES* dbRes = taos_query(pConnId, str); - code = taos_errno(dbRes); - if (code != TSDB_CODE_SUCCESS) { - taos_free_result(dbRes); - return code; - } - taos_free_result(dbRes); - - sprintf(str, " where db_name='%s' ;", dbName); - strcat(sql, str); - } - - TAOS_RES* res = taos_query(pConnId, sql); - code = taos_errno(res); - if (code != TSDB_CODE_SUCCESS) { - taos_free_result(res); - return code; - } - - TAOS_ROW row = NULL; - TAOS_FIELD* fields = taos_fetch_fields(res); - int32_t nFields = taos_num_fields(res); - int32_t nAvailble = 0; - int32_t nUnAvailble = 0; - - while ((row = taos_fetch_row(res)) != NULL) { - if (existLeaderRole(row, fields, nFields)) { - nAvailble++; - } else { - nUnAvailble++; - } - } - taos_free_result(res); - - int32_t status = 0; - if (nAvailble + nUnAvailble == 0 || nUnAvailble == 0) { - status = SHOW_STATUS_AVAILABLE; - } else if (nAvailble > 0 && nUnAvailble > 0) { - status = SHOW_STATUS_HALF_AVAILABLE; - } else { - status = SHOW_STATUS_NOT_AVAILABLE; - } - - if (pStatus) { - *pStatus = status; - } - return TSDB_CODE_SUCCESS; -} - -static int32_t setAliveResultIntoDataBlock(int64_t* pConnId, SSDataBlock* pBlock, char* dbName) { - blockDataEnsureCapacity(pBlock, 1); - pBlock->info.rows = 1; - - SColumnInfoData* pCol1 = taosArrayGet(pBlock->pDataBlock, 0); - int32_t status = 0; - int32_t code = getAliveStatusFromApi(pConnId, dbName, &status); - if (code == TSDB_CODE_SUCCESS) { - colDataSetVal(pCol1, 0, (const char*)&status, false); - } - return code; -} - -static int32_t execShowAliveStatus(int64_t* pConnId, SShowAliveStmt* pStmt, SRetrieveTableRsp** pRsp) { - SSDataBlock* pBlock = NULL; - int32_t code = buildAliveResultDataBlock(&pBlock); - if (TSDB_CODE_SUCCESS == code) { - code = setAliveResultIntoDataBlock(pConnId, pBlock, pStmt->dbName); - } - if (TSDB_CODE_SUCCESS == code) { - code = buildRetrieveTableRsp(pBlock, SHOW_ALIVE_RESULT_COLS, pRsp); - } - blockDataDestroy(pBlock); - return code; -} - static int32_t execShowCreateDatabase(SShowCreateDatabaseStmt* pStmt, SRetrieveTableRsp** pRsp) { SSDataBlock* pBlock = NULL; int32_t code = buildCreateDBResultDataBlock(&pBlock); @@ -1075,9 +954,6 @@ int32_t qExecCommand(int64_t* pConnId, bool sysInfoUser, SNode* pStmt, SRetrieve return execShowLocalVariables(pRsp); case QUERY_NODE_SELECT_STMT: return execSelectWithoutFrom((SSelectStmt*)pStmt, pRsp); - case QUERY_NODE_SHOW_DB_ALIVE_STMT: - case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT: - return execShowAliveStatus(pConnId, (SShowAliveStmt*)pStmt, pRsp); default: break; } diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h index 592231f043..c48c359fad 100644 --- a/source/libs/executor/inc/executorInt.h +++ b/source/libs/executor/inc/executorInt.h @@ -624,6 +624,8 @@ typedef struct SDataGroupInfo { uint64_t groupId; int64_t numOfRows; SArray* pPageList; + SArray* blockForNotLoaded; // SSDataBlock that data is not loaded + int32_t offsetForNotLoaded; // read offset for SSDataBlock that data is not loaded } SDataGroupInfo; typedef struct SWindowRowsSup { @@ -861,7 +863,7 @@ void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, void setVgIdColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, int32_t vgId); void setVgVerColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, int64_t vgVer); -void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset); +int32_t setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset); void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput); SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pResultRowInfo, char* pData, diff --git a/source/libs/executor/src/aggregateoperator.c b/source/libs/executor/src/aggregateoperator.c index b5a49831c5..a7b4532bd0 100644 --- a/source/libs/executor/src/aggregateoperator.c +++ b/source/libs/executor/src/aggregateoperator.c @@ -406,7 +406,10 @@ void doSetTableGroupOutputBuf(SOperatorInfo* pOperator, int32_t numOfOutput, uin } } - setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset); + int32_t ret = setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset); + if (ret != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, ret); + } } // a new buffer page for each table. Needs to opt this design diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 29907e6f1f..d73274f85e 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -221,8 +221,7 @@ static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWi (*pResult)->win = *win; - setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); - return TSDB_CODE_SUCCESS; + return setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); } static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSup, int32_t startIndex, int32_t endIndex, diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index d06beebd6b..cb2a75407a 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -2178,9 +2178,25 @@ int32_t buildGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle* return code; } if (group == NULL || groupByTbname) { - for (int32_t i = 0; i < numOfTables; i++) { - STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i); - info->groupId = groupByTbname ? info->uid : 0; + if (tsCountAlwaysReturnValue && QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN == nodeType(pScanNode) && ((STableScanPhysiNode*)pScanNode)->needCountEmptyTable) { + pTableListInfo->remainGroups = + taosHashInit(numOfTables, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK); + if (pTableListInfo->remainGroups == NULL) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + for (int i = 0; i < numOfTables; i++) { + STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i); + info->groupId = info->uid; + + taosHashPut(pTableListInfo->remainGroups, &(info->groupId), sizeof(info->groupId), &(info->uid), + sizeof(info->uid)); + } + } else { + for (int32_t i = 0; i < numOfTables; i++) { + STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i); + info->groupId = groupByTbname ? info->uid : 0; + } } pTableListInfo->oneTableForEachGroup = groupByTbname; @@ -2193,8 +2209,6 @@ int32_t buildGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle* pTableListInfo->numOfOuputGroups = numOfTables; } else if (groupByTbname && pScanNode->groupOrderScan) { pTableListInfo->numOfOuputGroups = numOfTables; - } else if (groupByTbname && tsCountAlwaysReturnValue && ((STableScanPhysiNode*)pScanNode)->needCountEmptyTable) { - pTableListInfo->numOfOuputGroups = numOfTables; } else { pTableListInfo->numOfOuputGroups = 1; } @@ -2354,7 +2368,7 @@ int32_t compKeys(const SArray* pSortGroupCols, const char* oldkeyBuf, int32_t ol for (int32_t i = 0; i < pSortGroupCols->size; ++i) { const SColumn* pCol = (SColumn*)TARRAY_GET_ELEM(pSortGroupCols, i); const SColumnInfoData* pColInfoData = TARRAY_GET_ELEM(pBlock->pDataBlock, pCol->slotId); - if (pBlock->pBlockAgg) pColAgg = pBlock->pBlockAgg[pCol->slotId]; + if (pBlock->pBlockAgg) pColAgg = &pBlock->pBlockAgg[pCol->slotId]; if (colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg)) { if (isNull[i] != 1) return 1; @@ -2389,7 +2403,7 @@ int32_t buildKeys(char* keyBuf, const SArray* pSortGroupCols, const SSDataBlock* const SColumnInfoData* pColInfoData = TARRAY_GET_ELEM(pBlock->pDataBlock, pCol->slotId); if (pCol->slotId > pBlock->pDataBlock->size) continue; - if (pBlock->pBlockAgg) pColAgg = pBlock->pBlockAgg[pCol->slotId]; + if (pBlock->pBlockAgg) pColAgg = &pBlock->pBlockAgg[pCol->slotId]; if (colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg)) { isNull[i] = 1; diff --git a/source/libs/executor/src/executorInt.c b/source/libs/executor/src/executorInt.c index 43c04ca8d9..3de8468bb8 100644 --- a/source/libs/executor/src/executorInt.c +++ b/source/libs/executor/src/executorInt.c @@ -434,8 +434,8 @@ void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, SSDataBlock* pB if (pFuncParam->type == FUNC_PARAM_TYPE_COLUMN) { int32_t slotId = pFuncParam->pCol->slotId; - pInput->pColumnDataAgg[j] = pBlock->pBlockAgg[slotId]; - if (pInput->pColumnDataAgg[j] == NULL) { + pInput->pColumnDataAgg[j] = &pBlock->pBlockAgg[slotId]; + if (pInput->pColumnDataAgg[j]->colId == -1) { pInput->colDataSMAIsSet = false; } @@ -468,7 +468,7 @@ STimeWindow getAlignQueryTimeWindow(const SInterval* pInterval, int64_t key) { return win; } -void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) { +int32_t setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) { bool init = false; for (int32_t i = 0; i < numOfOutput; ++i) { pCtx[i].resultInfo = getResultEntryInfo(pResult, i, rowEntryInfoOffset); @@ -487,7 +487,11 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO if (!pResInfo->initialized) { if (pCtx[i].functionId != -1) { - pCtx[i].fpSet.init(&pCtx[i], pResInfo); + bool ini = pCtx[i].fpSet.init(&pCtx[i], pResInfo); + if (!ini && fmIsUserDefinedFunc(pCtx[i].functionId)){ + pResInfo->initialized = false; + return TSDB_CODE_UDF_FUNC_EXEC_FAILURE; + } } else { pResInfo->initialized = true; } @@ -495,6 +499,7 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO init = true; } } + return TSDB_CODE_SUCCESS; } void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput) { diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 9a31e993b2..3a124197e0 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -131,7 +131,7 @@ static bool groupKeyCompare(SArray* pGroupCols, SArray* pGroupColVals, SSDataBlo SColumn* pCol = taosArrayGet(pGroupCols, i); SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pCol->slotId); if (pBlock->pBlockAgg != NULL) { - pColAgg = pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched? + pColAgg = &pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched? } bool isNull = colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg); @@ -187,7 +187,7 @@ static void recordNewGroupKeys(SArray* pGroupCols, SArray* pGroupColVals, SSData } if (pBlock->pBlockAgg != NULL) { - pColAgg = pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched? + pColAgg = &pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched? } SGroupKeys* pkey = taosArrayGet(pGroupColVals, i); @@ -319,7 +319,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf, len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code - T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); + T_LONG_JMP(pTaskInfo->env, ret); } int32_t rowIndex = j - num; @@ -337,7 +337,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) { int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf, len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup); if (ret != TSDB_CODE_SUCCESS) { - T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); + T_LONG_JMP(pTaskInfo->env, ret); } int32_t rowIndex = pBlock->info.rows - num; @@ -563,6 +563,55 @@ _error: return NULL; } +SSDataBlock* createBlockDataNotLoaded(const SOperatorInfo* pOperator, SSDataBlock* pDataBlock) { + if (pDataBlock == NULL) { + return NULL; + } + + SSDataBlock* pDstBlock = createDataBlock(); + pDstBlock->info = pDataBlock->info; + pDstBlock->info.id.blockId = pOperator->resultDataBlockId; + pDstBlock->info.capacity = 0; + pDstBlock->info.rowSize = 0; + + size_t numOfCols = pOperator->exprSupp.numOfExprs; + if (pDataBlock->pBlockAgg) { + pDstBlock->pBlockAgg = taosMemoryCalloc(numOfCols, sizeof(SColumnDataAgg)); + if (pDstBlock->pBlockAgg == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + blockDataDestroy(pDstBlock); + return NULL; + } + for(int i = 0; i < numOfCols; ++i) { + pDstBlock->pBlockAgg[i].colId = -1; + } + } + + for (int32_t i = 0; i < pOperator->exprSupp.numOfExprs; ++i) { + SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i]; + int32_t slotId = pExpr->base.pParam[0].pCol->slotId; + SColumnInfoData* pSrc = taosArrayGet(pDataBlock->pDataBlock, slotId); + SColumnInfoData colInfo = {.hasNull = true, .info = pSrc->info}; + blockDataAppendColInfo(pDstBlock, &colInfo); + + SColumnInfoData* pDst = taosArrayGet(pDstBlock->pDataBlock, i); + if (pDataBlock->pBlockAgg && pDataBlock->pBlockAgg[slotId].colId != -1) { + pDstBlock->pBlockAgg[i] = pDataBlock->pBlockAgg[slotId]; + } else { + int32_t code = doEnsureCapacity(pDst, &pDstBlock->info, pDataBlock->info.rows, false); + if (code != TSDB_CODE_SUCCESS) { + terrno = code; + blockDataDestroy(pDstBlock); + return NULL; + } + + colDataAssign(pDst, pSrc, pDataBlock->info.rows, &pDataBlock->info); + } + } + + return pDstBlock; +} + static void doHashPartition(SOperatorInfo* pOperator, SSDataBlock* pBlock) { SPartitionOperatorInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -584,71 +633,86 @@ static void doHashPartition(SOperatorInfo* pOperator, SSDataBlock* pBlock) { pGroupInfo->groupId = calcGroupId(pInfo->keyBuf, len); } - // number of rows - int32_t* rows = (int32_t*)pPage; + if (pBlock->info.dataLoad) { + // number of rows + int32_t* rows = (int32_t*)pPage; - size_t numOfCols = pOperator->exprSupp.numOfExprs; - for (int32_t i = 0; i < numOfCols; ++i) { - SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i]; - int32_t slotId = pExpr->base.pParam[0].pCol->slotId; + size_t numOfCols = pOperator->exprSupp.numOfExprs; + for (int32_t i = 0; i < numOfCols; ++i) { + SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i]; + int32_t slotId = pExpr->base.pParam[0].pCol->slotId; - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId); + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId); - int32_t bytes = pColInfoData->info.bytes; - int32_t startOffset = pInfo->columnOffset[i]; + int32_t bytes = pColInfoData->info.bytes; + int32_t startOffset = pInfo->columnOffset[i]; - int32_t* columnLen = NULL; - int32_t contentLen = 0; + int32_t* columnLen = NULL; + int32_t contentLen = 0; - if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { - int32_t* offset = (int32_t*)((char*)pPage + startOffset); - columnLen = (int32_t*)((char*)pPage + startOffset + sizeof(int32_t) * pInfo->rowCapacity); - char* data = (char*)((char*)columnLen + sizeof(int32_t)); + if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) { + int32_t* offset = (int32_t*)((char*)pPage + startOffset); + columnLen = (int32_t*)((char*)pPage + startOffset + sizeof(int32_t) * pInfo->rowCapacity); + char* data = (char*)((char*)columnLen + sizeof(int32_t)); - if (colDataIsNull_s(pColInfoData, j)) { - offset[(*rows)] = -1; - contentLen = 0; - } else if (pColInfoData->info.type == TSDB_DATA_TYPE_JSON) { - offset[*rows] = (*columnLen); - char* src = colDataGetData(pColInfoData, j); - int32_t dataLen = getJsonValueLen(src); + if (colDataIsNull_s(pColInfoData, j)) { + offset[(*rows)] = -1; + contentLen = 0; + } else if (pColInfoData->info.type == TSDB_DATA_TYPE_JSON) { + offset[*rows] = (*columnLen); + char* src = colDataGetData(pColInfoData, j); + int32_t dataLen = getJsonValueLen(src); - memcpy(data + (*columnLen), src, dataLen); - int32_t v = (data + (*columnLen) + dataLen - (char*)pPage); - ASSERT(v > 0); + memcpy(data + (*columnLen), src, dataLen); + int32_t v = (data + (*columnLen) + dataLen - (char*)pPage); + ASSERT(v > 0); - contentLen = dataLen; + contentLen = dataLen; + } else { + offset[*rows] = (*columnLen); + char* src = colDataGetData(pColInfoData, j); + memcpy(data + (*columnLen), src, varDataTLen(src)); + int32_t v = (data + (*columnLen) + varDataTLen(src) - (char*)pPage); + ASSERT(v > 0); + + contentLen = varDataTLen(src); + } } else { - offset[*rows] = (*columnLen); - char* src = colDataGetData(pColInfoData, j); - memcpy(data + (*columnLen), src, varDataTLen(src)); - int32_t v = (data + (*columnLen) + varDataTLen(src) - (char*)pPage); - ASSERT(v > 0); + char* bitmap = (char*)pPage + startOffset; + columnLen = (int32_t*)((char*)pPage + startOffset + BitmapLen(pInfo->rowCapacity)); + char* data = (char*)columnLen + sizeof(int32_t); - contentLen = varDataTLen(src); + bool isNull = colDataIsNull_f(pColInfoData->nullbitmap, j); + if (isNull) { + colDataSetNull_f(bitmap, (*rows)); + } else { + memcpy(data + (*columnLen), colDataGetData(pColInfoData, j), bytes); + ASSERT((data + (*columnLen) + bytes - (char*)pPage) <= getBufPageSize(pInfo->pBuf)); + } + contentLen = bytes; } - } else { - char* bitmap = (char*)pPage + startOffset; - columnLen = (int32_t*)((char*)pPage + startOffset + BitmapLen(pInfo->rowCapacity)); - char* data = (char*)columnLen + sizeof(int32_t); - bool isNull = colDataIsNull_f(pColInfoData->nullbitmap, j); - if (isNull) { - colDataSetNull_f(bitmap, (*rows)); - } else { - memcpy(data + (*columnLen), colDataGetData(pColInfoData, j), bytes); - ASSERT((data + (*columnLen) + bytes - (char*)pPage) <= getBufPageSize(pInfo->pBuf)); - } - contentLen = bytes; + (*columnLen) += contentLen; } - (*columnLen) += contentLen; + (*rows) += 1; + + setBufPageDirty(pPage, true); + releaseBufPage(pInfo->pBuf, pPage); + } else { + SSDataBlock* dataNotLoadBlock = createBlockDataNotLoaded(pOperator, pBlock); + if (dataNotLoadBlock == NULL) { + T_LONG_JMP(pTaskInfo->env, terrno); + } + if (pGroupInfo->blockForNotLoaded == NULL) { + pGroupInfo->blockForNotLoaded = taosArrayInit(0, sizeof(SSDataBlock*)); + pGroupInfo->offsetForNotLoaded = 0; + } + dataNotLoadBlock->info.id.groupId = pGroupInfo->groupId; + dataNotLoadBlock->info.dataLoad = 0; + taosArrayPush(pGroupInfo->blockForNotLoaded, &dataNotLoadBlock); + break; } - - (*rows) += 1; - - setBufPageDirty(pPage, true); - releaseBufPage(pInfo->pBuf, pPage); } } @@ -730,6 +794,14 @@ static void clearPartitionOperator(SPartitionOperatorInfo* pInfo) { int32_t size = taosArrayGetSize(pInfo->sortedGroupArray); for (int32_t i = 0; i < size; i++) { SDataGroupInfo* pGp = taosArrayGet(pInfo->sortedGroupArray, i); + if (pGp->blockForNotLoaded) { + for (int32_t i = 0; i < pGp->blockForNotLoaded->size; i++) { + SSDataBlock** pBlock = taosArrayGet(pGp->blockForNotLoaded, i); + blockDataDestroy(*pBlock); + } + taosArrayClear(pGp->blockForNotLoaded); + pGp->offsetForNotLoaded = 0; + } taosArrayDestroy(pGp->pPageList); } taosArrayClear(pInfo->sortedGroupArray); @@ -747,6 +819,15 @@ static int compareDataGroupInfo(const void* group1, const void* group2) { return (pGroupInfo1->groupId < pGroupInfo2->groupId) ? -1 : 1; } +static SSDataBlock* buildPartitionResultForNotLoadBlock(SDataGroupInfo* pGroupInfo) { + if (pGroupInfo->blockForNotLoaded && pGroupInfo->offsetForNotLoaded < pGroupInfo->blockForNotLoaded->size) { + SSDataBlock** pBlock = taosArrayGet(pGroupInfo->blockForNotLoaded, pGroupInfo->offsetForNotLoaded); + pGroupInfo->offsetForNotLoaded++; + return *pBlock; + } + return NULL; +} + static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { SPartitionOperatorInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -756,13 +837,17 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { SDataGroupInfo* pGroupInfo = (pInfo->groupIndex != -1) ? taosArrayGet(pInfo->sortedGroupArray, pInfo->groupIndex) : NULL; if (pInfo->groupIndex == -1 || pInfo->pageIndex >= taosArrayGetSize(pGroupInfo->pPageList)) { + if(pGroupInfo != NULL) { + SSDataBlock* ret = buildPartitionResultForNotLoadBlock(pGroupInfo); + if(ret != NULL) return ret; + } // try next group data - ++pInfo->groupIndex; - if (pInfo->groupIndex >= taosArrayGetSize(pInfo->sortedGroupArray)) { + if (pInfo->groupIndex + 1 >= taosArrayGetSize(pInfo->sortedGroupArray)) { setOperatorCompleted(pOperator); clearPartitionOperator(pInfo); return NULL; } + ++pInfo->groupIndex; pGroupInfo = taosArrayGet(pInfo->sortedGroupArray, pInfo->groupIndex); pInfo->pageIndex = 0; @@ -774,6 +859,20 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { qError("failed to get buffer, code:%s, %s", tstrerror(terrno), GET_TASKID(pTaskInfo)); T_LONG_JMP(pTaskInfo->env, terrno); } + if (*(int32_t*)page == 0) { + releaseBufPage(pInfo->pBuf, page); + SSDataBlock* ret = buildPartitionResultForNotLoadBlock(pGroupInfo); + if (ret != NULL) return ret; + if (pInfo->groupIndex + 1 < taosArrayGetSize(pInfo->sortedGroupArray)) { + pInfo->groupIndex++; + pInfo->pageIndex = 0; + } else { + setOperatorCompleted(pOperator); + clearPartitionOperator(pInfo); + return NULL; + } + return buildPartitionResult(pOperator); + } blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->rowCapacity); blockDataFromBuf1(pInfo->binfo.pRes, page, pInfo->rowCapacity); @@ -783,6 +882,8 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { pInfo->binfo.pRes->info.id.groupId = pGroupInfo->groupId; pInfo->binfo.pRes->info.dataLoad = 1; pInfo->orderedRows = 0; + } else if (pInfo->pOrderInfoArr == NULL) { + qError("Exception, remainRows not zero, but pOrderInfoArr is NULL"); } if (pInfo->pOrderInfoArr) { @@ -1009,8 +1110,7 @@ int32_t setGroupResultOutputBuf(SOperatorInfo* pOperator, SOptrBasicInfo* binfo, SResultRow* pResultRow = doSetResultOutBufByKey(pBuf, pResultRowInfo, (char*)pData, bytes, true, groupId, pTaskInfo, false, pAggSup, false); - setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset); - return TSDB_CODE_SUCCESS; + return setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset); } uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t rowId) { @@ -1057,7 +1157,7 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { pDest->info.parTbName[0] = 0; if (pInfo->tbnameCalSup.numOfExprs > 0) { void* tbname = NULL; - if (pAPI->stateStore.streamStateGetParName(pOperator->pTaskInfo->streamInfo.pState, pParInfo->groupId, &tbname) == 0) { + if (pAPI->stateStore.streamStateGetParName(pOperator->pTaskInfo->streamInfo.pState, pParInfo->groupId, &tbname, false) == 0) { memcpy(pDest->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); pAPI->stateStore.streamStateFreeVal(tbname); } @@ -1078,7 +1178,7 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { void appendCreateTableRow(void* pState, SExprSupp* pTableSup, SExprSupp* pTagSup, uint64_t groupId, SSDataBlock* pSrcBlock, int32_t rowId, SSDataBlock* pDestBlock, SStateStore* pAPI) { void* pValue = NULL; - if (pAPI->streamStateGetParName(pState, groupId, &pValue) != 0) { + if (pAPI->streamStateGetParName(pState, groupId, &pValue, true) != 0) { SSDataBlock* pTmpBlock = blockCopyOneRow(pSrcBlock, rowId); memset(pTmpBlock->info.parTbName, 0, TSDB_TABLE_NAME_LEN); pTmpBlock->info.id.groupId = groupId; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index eef8b06ac5..cda4b67f97 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -220,7 +220,7 @@ static int32_t doDynamicPruneDataBlock(SOperatorInfo* pOperator, SDataBlockInfo* return code; } -static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg** pColsAgg, int32_t numOfCols, +static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg* pColsAgg, int32_t numOfCols, int32_t numOfRows) { if (pColsAgg == NULL || pFilterInfo == NULL) { return true; @@ -725,7 +725,7 @@ void markGroupProcessed(STableScanInfo* pInfo, uint64_t groupId) { if (pInfo->countState == TABLE_COUNT_STATE_END) { return; } - if (pInfo->base.pTableListInfo->oneTableForEachGroup || pInfo->base.pTableListInfo->groupOffset) { + if (pInfo->base.pTableListInfo->groupOffset) { pInfo->countState = TABLE_COUNT_STATE_PROCESSED; } else { taosHashRemove(pInfo->base.pTableListInfo->remainGroups, &groupId, sizeof(groupId)); @@ -769,6 +769,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) { SSDataBlock* pBlock = pTableScanInfo->pResBlock; bool hasNext = false; int32_t code = TSDB_CODE_SUCCESS; + pBlock->info.dataLoad = false; int64_t st = taosGetTimestampUs(); @@ -890,7 +891,7 @@ static SSDataBlock* doGroupedTableScan(SOperatorInfo* pOperator) { if (pTableScanInfo->countState < TABLE_COUNT_STATE_END) { STableListInfo* pTableListInfo = pTableScanInfo->base.pTableListInfo; - if (pTableListInfo->oneTableForEachGroup || pTableListInfo->groupOffset) { // group by tbname, group by tag + sort + if (pTableListInfo->groupOffset) { // group by tbname, group by tag + sort if (pTableScanInfo->countState < TABLE_COUNT_STATE_PROCESSED) { pTableScanInfo->countState = TABLE_COUNT_STATE_PROCESSED; STableKeyInfo* pStart = @@ -1891,7 +1892,7 @@ static int32_t generatePartitionDelResBlock(SStreamScanInfo* pInfo, SSDataBlock* groupId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, preJ); if (pInfo->pPartTbnameSup) { void* parTbname = NULL; - int32_t code = pInfo->stateStore.streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, groupId, &parTbname); + int32_t code = pInfo->stateStore.streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, groupId, &parTbname, false); if (code != TSDB_CODE_SUCCESS) { calBlockTbName(pInfo, pPreRes, preJ); memcpy(varDataVal(tbname), pPreRes->info.parTbName, strlen(pPreRes->info.parTbName)); @@ -1937,7 +1938,7 @@ static int32_t generateDeleteResultBlockImpl(SStreamScanInfo* pInfo, SSDataBlock } if (pInfo->tbnameCalSup.pExprInfo) { void* parTbname = NULL; - int32_t code = pInfo->stateStore.streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, groupId, &parTbname); + int32_t code = pInfo->stateStore.streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, groupId, &parTbname, false); if (code != TSDB_CODE_SUCCESS) { SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, srcUid, srcStartTsCol[i], srcStartTsCol[i], ver); printDataBlock(pPreRes, "pre res", GET_TASKID(pInfo->pStreamScanOp->pTaskInfo)); @@ -4960,6 +4961,7 @@ static SSDataBlock* buildSysDbTableCount(SOperatorInfo* pOperator, STableCountSc size_t infodbTableNum; getInfosDbMeta(NULL, &infodbTableNum); + infodbTableNum -= 1; size_t perfdbTableNum; getPerfDbMeta(NULL, &perfdbTableNum); diff --git a/source/libs/executor/src/streamfilloperator.c b/source/libs/executor/src/streamfilloperator.c index b54802e2c6..1cdd7d2d87 100644 --- a/source/libs/executor/src/streamfilloperator.c +++ b/source/libs/executor/src/streamfilloperator.c @@ -707,7 +707,7 @@ static void buildDeleteRange(SOperatorInfo* pOp, TSKEY start, TSKEY end, uint64_ SColumnInfoData* pTableCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX); void* tbname = NULL; - pAPI->stateStore.streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, groupId, &tbname); + pAPI->stateStore.streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, groupId, &tbname, false); if (tbname == NULL) { colDataSetNULL(pTableCol, pBlock->info.rows); } else { diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index 2224942893..4d567f729e 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -376,7 +376,7 @@ static void doBuildDeleteResult(SStreamIntervalOperatorInfo* pInfo, SArray* pWin for (int32_t i = *index; i < size; i++) { SWinKey* pWin = taosArrayGet(pWins, i); void* tbname = NULL; - pInfo->stateStore.streamStateGetParName(pInfo->pState, pWin->groupId, &tbname); + pInfo->stateStore.streamStateGetParName(pInfo->pState, pWin->groupId, &tbname, false); if (tbname == NULL) { appendDataToSpecialBlock(pBlock, &pWin->ts, &pWin->ts, &uid, &pWin->groupId, NULL); } else { @@ -750,7 +750,7 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, void* pState, SSDat if (pBlock->info.id.groupId == 0) { pBlock->info.id.groupId = groupId; void* tbname = NULL; - if (pAPI->stateStore.streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { + if (pAPI->stateStore.streamStateGetParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname, false) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); @@ -1975,8 +1975,7 @@ static int32_t initSessionOutputBuf(SResultWindowInfo* pWinInfo, SResultRow** pR *pResult = (SResultRow*)pWinInfo->pStatePos->pRowBuff; // set time window for current result (*pResult)->win = pWinInfo->sessionWin.win; - setResultRowInitCtx(*pResult, pCtx, numOfOutput, rowEntryInfoOffset); - return TSDB_CODE_SUCCESS; + return setResultRowInitCtx(*pResult, pCtx, numOfOutput, rowEntryInfoOffset); } int32_t doOneWindowAggImpl(SColumnInfoData* pTimeWindowData, SResultWindowInfo* pCurWin, SResultRow** pResult, @@ -2277,7 +2276,7 @@ void doBuildDeleteDataBlock(SOperatorInfo* pOp, SSHashObj* pStDeleted, SSDataBlo SColumnInfoData* pTableCol = taosArrayGet(pBlock->pDataBlock, TABLE_NAME_COLUMN_INDEX); void* tbname = NULL; - pAPI->stateStore.streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, res->groupId, &tbname); + pAPI->stateStore.streamStateGetParName(pOp->pTaskInfo->streamInfo.pState, res->groupId, &tbname, false); if (tbname == NULL) { colDataSetNULL(pTableCol, pBlock->info.rows); } else { @@ -2447,7 +2446,7 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, void* pState, SSDa void* tbname = NULL; if (pAPI->stateStore.streamStateGetParName((void*)pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, - &tbname) < 0) { + &tbname, false) < 0) { pBlock->info.parTbName[0] = 0; } else { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 10d38b3d95..415c7d1f0e 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1090,6 +1090,10 @@ int32_t buildDbTableInfoBlock(bool sysInfo, const SSDataBlock* p, const SSysTabl continue; } + if(strcmp(pm->name, TSDB_INS_TABLE_USERS_FULL) == 0){ + continue; + } + SColumnInfoData* pColInfoData = taosArrayGet(p->pDataBlock, 0); STR_TO_VARSTR(n, pm->name); diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index b72811cdcc..8b151edb27 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -84,9 +84,7 @@ static int32_t setTimeWindowOutputBuf(SResultRowInfo* pResultRowInfo, STimeWindo pResultRow->win = (*win); *pResult = pResultRow; - setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset); - - return TSDB_CODE_SUCCESS; + return setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset); } static void doKeepTuple(SWindowRowsSup* pRowSup, int64_t ts, uint64_t groupId) { @@ -911,7 +909,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI struct SColumnDataAgg* pAgg = NULL; for (int32_t j = 0; j < pBlock->info.rows; ++j) { - pAgg = (pBlock->pBlockAgg != NULL) ? pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL; + pAgg = (pBlock->pBlockAgg != NULL) ? &pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL; if (colDataIsNull(pStateColInfoData, pBlock->info.rows, j, pAgg)) { continue; } @@ -1647,8 +1645,7 @@ static int32_t setSingleOutputTupleBuf(SResultRowInfo* pResultRowInfo, STimeWind // set time window for current result (*pResult)->win = (*win); - setResultRowInitCtx((*pResult), pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); - return TSDB_CODE_SUCCESS; + return setResultRowInitCtx((*pResult), pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); } static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResultRowInfo, diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index 8ab388830f..d9bcc954a4 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -651,7 +651,7 @@ int32_t tsortComparBlockCell(SSDataBlock* pLeftBlock, SSDataBlock* pRightBlock, leftNull = colDataIsNull_t(pLeftColInfoData, leftRowIndex, isVarType); } else { leftNull = - colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, leftRowIndex, pLeftBlock->pBlockAgg[pOrder->slotId]); + colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, leftRowIndex, &pLeftBlock->pBlockAgg[pOrder->slotId]); } } @@ -661,7 +661,7 @@ int32_t tsortComparBlockCell(SSDataBlock* pLeftBlock, SSDataBlock* pRightBlock, rightNull = colDataIsNull_t(pRightColInfoData, rightRowIndex, isVarType); } else { rightNull = colDataIsNull(pRightColInfoData, pRightBlock->info.rows, rightRowIndex, - pRightBlock->pBlockAgg[pOrder->slotId]); + &pRightBlock->pBlockAgg[pOrder->slotId]); } } @@ -742,7 +742,7 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) { leftNull = colDataIsNull_t(pLeftColInfoData, pLeftSource->src.rowIndex, isVarType); } else { leftNull = colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, pLeftSource->src.rowIndex, - pLeftBlock->pBlockAgg[i]); + &pLeftBlock->pBlockAgg[i]); } } @@ -752,7 +752,7 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) { rightNull = colDataIsNull_t(pRightColInfoData, pRightSource->src.rowIndex, isVarType); } else { rightNull = colDataIsNull(pRightColInfoData, pRightBlock->info.rows, pRightSource->src.rowIndex, - pRightBlock->pBlockAgg[i]); + &pRightBlock->pBlockAgg[i]); } } diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 699865a9bf..1aa92479b9 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -3631,7 +3631,7 @@ int32_t saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* SColumnInfoData* pColInfo = taosArrayGet(pSrcBlock->pDataBlock, pCtx->saveHandle.pState->tsIndex); ASSERT(pColInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP); key.groupId = pSrcBlock->info.id.groupId; - key.ts = *(int64_t*)colDataGetData(pColInfo, rowIndex);; + key.ts = *(int64_t*)colDataGetData(pColInfo, rowIndex); } char* buf = serializeTupleData(pSrcBlock, rowIndex, &pCtx->subsidiaries, pCtx->subsidiaries.buf); diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 66ed092f76..3d51f0cd16 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -565,7 +565,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { numOfElem = pInput->numOfRows; pAvgRes->count += pInput->numOfRows; - bool simdAvailable = tsAVXEnable && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE); + bool simdAvailable = tsAVXSupported && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE); switch(type) { case TSDB_DATA_TYPE_UTINYINT: diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c index a6c91a57ce..590a15c753 100644 --- a/source/libs/function/src/detail/tminmax.c +++ b/source/libs/function/src/detail/tminmax.c @@ -370,7 +370,7 @@ static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Supported && tsSIMDEnable) { pBuf->v = i8VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -404,7 +404,7 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Supported && tsSIMDEnable) { pBuf->v = i16VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -438,7 +438,7 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Supported && tsSIMDEnable) { pBuf->v = i32VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -502,7 +502,7 @@ static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRo float* val = (float*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXSupported && tsSIMDEnable) { *val = floatVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { @@ -533,7 +533,7 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR double* val = (double*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXSupported && tsSIMDEnable) { *val = (double)doubleVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { @@ -702,23 +702,16 @@ static void doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFunct } } -static int32_t saveRelatedTuple(SqlFunctionCtx* pCtx, SInputColumnInfoData* pInput, int32_t index, void* tval) { +static int32_t saveRelatedTupleTag(SqlFunctionCtx* pCtx, SInputColumnInfoData* pInput, void* tval) { SColumnInfoData* pCol = pInput->pData[0]; SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); SMinmaxResInfo* pBuf = GET_ROWCELL_INTERBUF(pResInfo); - int32_t code = 0; + int32_t code = TSDB_CODE_SUCCESS; if (pCtx->subsidiaries.num > 0) { - index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval); - if (index >= 0) { - code = saveTupleData(pCtx, index, pCtx->pSrcBlock, &pBuf->tuplePos); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - } + code = saveTupleData(pCtx, 0, pCtx->pSrcBlock, &pBuf->tuplePos); } - return code; } @@ -758,7 +751,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) pBuf->v = GET_INT64_VAL(tval); } - code = saveRelatedTuple(pCtx, pInput, index, tval); + code = saveRelatedTupleTag(pCtx, pInput, tval); } else { if (IS_SIGNED_NUMERIC_TYPE(type)) { int64_t prev = 0; @@ -767,7 +760,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) int64_t val = GET_INT64_VAL(tval); if ((prev < val) ^ isMinFunc) { GET_INT64_VAL(&pBuf->v) = val; - code = saveRelatedTuple(pCtx, pInput, index, tval); + code = saveRelatedTupleTag(pCtx, pInput, tval); } } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { uint64_t prev = 0; @@ -776,7 +769,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) uint64_t val = GET_UINT64_VAL(tval); if ((prev < val) ^ isMinFunc) { GET_UINT64_VAL(&pBuf->v) = val; - code = saveRelatedTuple(pCtx, pInput, index, tval); + code = saveRelatedTupleTag(pCtx, pInput, tval); } } else if (type == TSDB_DATA_TYPE_DOUBLE) { double prev = 0; @@ -785,7 +778,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) double val = GET_DOUBLE_VAL(tval); if ((prev < val) ^ isMinFunc) { GET_DOUBLE_VAL(&pBuf->v) = val; - code = saveRelatedTuple(pCtx, pInput, index, tval); + code = saveRelatedTupleTag(pCtx, pInput, tval); } } else if (type == TSDB_DATA_TYPE_FLOAT) { float prev = 0; @@ -794,7 +787,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems) float val = GET_DOUBLE_VAL(tval); if ((prev < val) ^ isMinFunc) { GET_FLOAT_VAL(&pBuf->v) = val; - code = saveRelatedTuple(pCtx, pInput, index, tval); + code = saveRelatedTupleTag(pCtx, pInput, tval); } } } diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index c671e7717c..776a7fb95a 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -64,7 +64,7 @@ static SFilePage *loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx) static void resetBoundingBox(MinMaxEntry *range, int32_t type) { if (IS_SIGNED_NUMERIC_TYPE(type)) { range->dMaxVal = INT64_MIN; - range->dMinVal = INT64_MAX; + range->dMinVal = (double)INT64_MAX; } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { range->u64MaxVal = 0; range->u64MinVal = UINT64_MAX; diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 7e344866a5..5f7764f342 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -26,6 +26,10 @@ #include "tudf.h" #include "tudfInt.h" +#ifdef _TD_DARWIN_64 +#include +#endif + typedef struct SUdfdData { bool startCalled; bool needCleanUp; diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 54745951cc..df97e873aa 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -691,7 +691,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { convertDataBlockToUdfDataBlock(&call->block, &input); code = udf->scriptPlugin->udfScalarProcFunc(&input, &output, udf->scriptUdfCtx); freeUdfDataDataBlock(&input); - convertUdfColumnToDataBlock(&output, &response.callRsp.resultData); + if(code == 0) convertUdfColumnToDataBlock(&output, &response.callRsp.resultData); freeUdfColumn(&output); break; } diff --git a/source/libs/function/test/udf2.c b/source/libs/function/test/udf2.c index faf4daa4e5..273b9c49c2 100644 --- a/source/libs/function/test/udf2.c +++ b/source/libs/function/test/udf2.c @@ -10,6 +10,7 @@ DLL_EXPORT int32_t udf2_init() { return 0; } DLL_EXPORT int32_t udf2_destroy() { return 0; } DLL_EXPORT int32_t udf2_start(SUdfInterBuf* buf) { + if(buf->buf == NULL || buf->bufLen < (sizeof(int64_t))) return TSDB_CODE_UDF_INVALID_BUFSIZE; *(int64_t*)(buf->buf) = 0; buf->bufLen = sizeof(double); buf->numOfResult = 1; @@ -17,6 +18,7 @@ DLL_EXPORT int32_t udf2_start(SUdfInterBuf* buf) { } DLL_EXPORT int32_t udf2(SUdfDataBlock* block, SUdfInterBuf* interBuf, SUdfInterBuf* newInterBuf) { + if(newInterBuf->buf == NULL || newInterBuf->bufLen < (sizeof(double))) return TSDB_CODE_UDF_INVALID_BUFSIZE; double sumSquares = 0; if (interBuf->numOfResult == 1) { sumSquares = *(double*)interBuf->buf; diff --git a/source/libs/monitorfw/inc/taos_assert.h b/source/libs/monitorfw/inc/taos_assert.h index d3226eed26..9d2732acc5 100644 --- a/source/libs/monitorfw/inc/taos_assert.h +++ b/source/libs/monitorfw/inc/taos_assert.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/inc/taos_collector_registry_i.h b/source/libs/monitorfw/inc/taos_collector_registry_i.h index ed5bb1fe19..c69abf54c0 100644 --- a/source/libs/monitorfw/inc/taos_collector_registry_i.h +++ b/source/libs/monitorfw/inc/taos_collector_registry_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "taos_collector_registry_t.h" diff --git a/source/libs/monitorfw/inc/taos_collector_registry_t.h b/source/libs/monitorfw/inc/taos_collector_registry_t.h index 8e8a881fca..9c00270abd 100644 --- a/source/libs/monitorfw/inc/taos_collector_registry_t.h +++ b/source/libs/monitorfw/inc/taos_collector_registry_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_REGISTRY_T_H diff --git a/source/libs/monitorfw/inc/taos_collector_t.h b/source/libs/monitorfw/inc/taos_collector_t.h index 264e8e9ad9..b7748357fc 100644 --- a/source/libs/monitorfw/inc/taos_collector_t.h +++ b/source/libs/monitorfw/inc/taos_collector_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_COLLECTOR_T_H diff --git a/source/libs/monitorfw/inc/taos_errors.h b/source/libs/monitorfw/inc/taos_errors.h index ee2a894df3..50e92c3093 100644 --- a/source/libs/monitorfw/inc/taos_errors.h +++ b/source/libs/monitorfw/inc/taos_errors.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #define TAOS_STDIO_CLOSE_DIR_ERROR "failed to close dir" diff --git a/source/libs/monitorfw/inc/taos_linked_list_i.h b/source/libs/monitorfw/inc/taos_linked_list_i.h index 015f8a57ad..73be405023 100644 --- a/source/libs/monitorfw/inc/taos_linked_list_i.h +++ b/source/libs/monitorfw/inc/taos_linked_list_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_LIST_I_INCLUDED diff --git a/source/libs/monitorfw/inc/taos_linked_list_t.h b/source/libs/monitorfw/inc/taos_linked_list_t.h index ccd82ffb61..abb7ff5418 100644 --- a/source/libs/monitorfw/inc/taos_linked_list_t.h +++ b/source/libs/monitorfw/inc/taos_linked_list_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_LIST_T_H diff --git a/source/libs/monitorfw/inc/taos_log.h b/source/libs/monitorfw/inc/taos_log.h index fecbda59e5..3b3be4efbf 100644 --- a/source/libs/monitorfw/inc/taos_log.h +++ b/source/libs/monitorfw/inc/taos_log.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/inc/taos_map_i.h b/source/libs/monitorfw/inc/taos_map_i.h index 55f248b96a..c9d584315b 100644 --- a/source/libs/monitorfw/inc/taos_map_i.h +++ b/source/libs/monitorfw/inc/taos_map_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_MAP_I_INCLUDED diff --git a/source/libs/monitorfw/inc/taos_map_t.h b/source/libs/monitorfw/inc/taos_map_t.h index 6fcbda1366..8119397e5d 100644 --- a/source/libs/monitorfw/inc/taos_map_t.h +++ b/source/libs/monitorfw/inc/taos_map_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_MAP_T_H diff --git a/source/libs/monitorfw/inc/taos_metric_formatter_custom_i.h b/source/libs/monitorfw/inc/taos_metric_formatter_custom_i.h index f3e4ebae75..169e170e1a 100644 --- a/source/libs/monitorfw/inc/taos_metric_formatter_custom_i.h +++ b/source/libs/monitorfw/inc/taos_metric_formatter_custom_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_METRIC_FORMATTER_CUSTOMV2_I_H diff --git a/source/libs/monitorfw/inc/taos_metric_formatter_i.h b/source/libs/monitorfw/inc/taos_metric_formatter_i.h index fba30d9eeb..ab60359f4a 100644 --- a/source/libs/monitorfw/inc/taos_metric_formatter_i.h +++ b/source/libs/monitorfw/inc/taos_metric_formatter_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_METRIC_FORMATTER_I_H diff --git a/source/libs/monitorfw/inc/taos_metric_formatter_t.h b/source/libs/monitorfw/inc/taos_metric_formatter_t.h index 0d7425aa59..0a629469a8 100644 --- a/source/libs/monitorfw/inc/taos_metric_formatter_t.h +++ b/source/libs/monitorfw/inc/taos_metric_formatter_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_METRIC_FORMATTER_T_H diff --git a/source/libs/monitorfw/inc/taos_metric_i.h b/source/libs/monitorfw/inc/taos_metric_i.h index e8ae799547..489ba2ac0b 100644 --- a/source/libs/monitorfw/inc/taos_metric_i.h +++ b/source/libs/monitorfw/inc/taos_metric_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ // Private diff --git a/source/libs/monitorfw/inc/taos_metric_sample_i.h b/source/libs/monitorfw/inc/taos_metric_sample_i.h index b5e90f1933..a354432774 100644 --- a/source/libs/monitorfw/inc/taos_metric_sample_i.h +++ b/source/libs/monitorfw/inc/taos_metric_sample_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "taos_metric_sample_t.h" diff --git a/source/libs/monitorfw/inc/taos_metric_sample_t.h b/source/libs/monitorfw/inc/taos_metric_sample_t.h index 387512af9d..59dd92aba8 100644 --- a/source/libs/monitorfw/inc/taos_metric_sample_t.h +++ b/source/libs/monitorfw/inc/taos_metric_sample_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_METRIC_SAMPLE_T_H diff --git a/source/libs/monitorfw/inc/taos_metric_t.h b/source/libs/monitorfw/inc/taos_metric_t.h index da237aa814..d285b56d33 100644 --- a/source/libs/monitorfw/inc/taos_metric_t.h +++ b/source/libs/monitorfw/inc/taos_metric_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_METRIC_T_H diff --git a/source/libs/monitorfw/inc/taos_monitor_util_i.h b/source/libs/monitorfw/inc/taos_monitor_util_i.h index fe072204a3..8ac048c8b5 100644 --- a/source/libs/monitorfw/inc/taos_monitor_util_i.h +++ b/source/libs/monitorfw/inc/taos_monitor_util_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_MONITOR_UTIL_I_H diff --git a/source/libs/monitorfw/inc/taos_string_builder_i.h b/source/libs/monitorfw/inc/taos_string_builder_i.h index 142ca020ba..933d778691 100644 --- a/source/libs/monitorfw/inc/taos_string_builder_i.h +++ b/source/libs/monitorfw/inc/taos_string_builder_i.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_STRING_BUILDER_I_H diff --git a/source/libs/monitorfw/inc/taos_string_builder_t.h b/source/libs/monitorfw/inc/taos_string_builder_t.h index edd3d574fa..c0d487865c 100644 --- a/source/libs/monitorfw/inc/taos_string_builder_t.h +++ b/source/libs/monitorfw/inc/taos_string_builder_t.h @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TAOS_STRING_BUILDER_T_H diff --git a/source/libs/monitorfw/src/taos_collector.c b/source/libs/monitorfw/src/taos_collector.c index 414c02121d..8be4edaef9 100644 --- a/source/libs/monitorfw/src/taos_collector.c +++ b/source/libs/monitorfw/src/taos_collector.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/src/taos_collector_registry.c b/source/libs/monitorfw/src/taos_collector_registry.c index d4838ef301..0c8385791d 100644 --- a/source/libs/monitorfw/src/taos_collector_registry.c +++ b/source/libs/monitorfw/src/taos_collector_registry.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/src/taos_counter.c b/source/libs/monitorfw/src/taos_counter.c index d522411b2b..b4c867c66f 100644 --- a/source/libs/monitorfw/src/taos_counter.c +++ b/source/libs/monitorfw/src/taos_counter.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ // Public diff --git a/source/libs/monitorfw/src/taos_gauge.c b/source/libs/monitorfw/src/taos_gauge.c index 7793f4c464..1f9fa6fc9c 100644 --- a/source/libs/monitorfw/src/taos_gauge.c +++ b/source/libs/monitorfw/src/taos_gauge.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ // Public diff --git a/source/libs/monitorfw/src/taos_linked_list.c b/source/libs/monitorfw/src/taos_linked_list.c index 2becb08a07..7c46e89ab0 100644 --- a/source/libs/monitorfw/src/taos_linked_list.c +++ b/source/libs/monitorfw/src/taos_linked_list.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ // Public diff --git a/source/libs/monitorfw/src/taos_map.c b/source/libs/monitorfw/src/taos_map.c index ffb7d000fc..55aaabf1a7 100644 --- a/source/libs/monitorfw/src/taos_map.c +++ b/source/libs/monitorfw/src/taos_map.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/src/taos_metric.c b/source/libs/monitorfw/src/taos_metric.c index 5cecbc927f..056bf131f2 100644 --- a/source/libs/monitorfw/src/taos_metric.c +++ b/source/libs/monitorfw/src/taos_metric.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/src/taos_metric_formatter.c b/source/libs/monitorfw/src/taos_metric_formatter.c index 53012935ba..5f34edf3e6 100644 --- a/source/libs/monitorfw/src/taos_metric_formatter.c +++ b/source/libs/monitorfw/src/taos_metric_formatter.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/monitorfw/src/taos_metric_formatter_custom.c b/source/libs/monitorfw/src/taos_metric_formatter_custom.c index 3b1318dfc0..553227c801 100644 --- a/source/libs/monitorfw/src/taos_metric_formatter_custom.c +++ b/source/libs/monitorfw/src/taos_metric_formatter_custom.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #define ALLOW_FORBID_FUNC diff --git a/source/libs/monitorfw/src/taos_metric_sample.c b/source/libs/monitorfw/src/taos_metric_sample.c index c6d817b513..4688672835 100644 --- a/source/libs/monitorfw/src/taos_metric_sample.c +++ b/source/libs/monitorfw/src/taos_metric_sample.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ diff --git a/source/libs/monitorfw/src/taos_monitor_util.c b/source/libs/monitorfw/src/taos_monitor_util.c index 182402b3ff..d338215426 100644 --- a/source/libs/monitorfw/src/taos_monitor_util.c +++ b/source/libs/monitorfw/src/taos_monitor_util.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ diff --git a/source/libs/monitorfw/src/taos_string_builder.c b/source/libs/monitorfw/src/taos_string_builder.c index 0f3940cdab..e1bfa4142c 100644 --- a/source/libs/monitorfw/src/taos_string_builder.c +++ b/source/libs/monitorfw/src/taos_string_builder.c @@ -1,16 +1,17 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. +/** + * Copyright 2019-2020 DigitalOcean Inc. * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 84d3f734fe..f02fefd977 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -843,6 +843,7 @@ static int32_t selectStmtCopy(const SSelectStmt* pSrc, SSelectStmt* pDst) { CLONE_NODE_FIELD_EX(pLimit, SLimitNode*); COPY_CHAR_ARRAY_FIELD(stmtName); COPY_SCALAR_FIELD(precision); + COPY_SCALAR_FIELD(isSubquery); COPY_SCALAR_FIELD(isEmptyResult); COPY_SCALAR_FIELD(timeLineResMode); COPY_SCALAR_FIELD(timeLineFromOrderBy); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 96eb664134..d5b36aa1a8 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -236,6 +236,7 @@ const char* nodesNodeName(ENodeType type) { case QUERY_NODE_SHOW_TAGS_STMT: return "ShowTagsStmt"; case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: return "ShowUsersStmt"; case QUERY_NODE_SHOW_LICENCES_STMT: return "ShowGrantsStmt"; @@ -7655,6 +7656,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_SHOW_TAGS_STMT: return showTagsStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: return showUsersStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_VGROUPS_STMT: return showVgroupsStmtToJson(pObj, pJson); @@ -8004,6 +8006,7 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_SHOW_TAGS_STMT: return jsonToShowTagsStmt(pJson, pObj); case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: return jsonToShowUsersStmt(pJson, pObj); case QUERY_NODE_SHOW_VGROUPS_STMT: return jsonToShowVgroupsStmt(pJson, pObj); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index beedffc4f2..79a6fcd5d8 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -524,6 +524,7 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_STREAMS_STMT: case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: case QUERY_NODE_SHOW_LICENCES_STMT: case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_TOPICS_STMT: @@ -963,12 +964,14 @@ void nodesDestroyNode(SNode* pNode) { break; case QUERY_NODE_WHEN_THEN: { SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode; + destroyExprNode((SExprNode*)pNode); nodesDestroyNode(pWhenThen->pWhen); nodesDestroyNode(pWhenThen->pThen); break; } case QUERY_NODE_CASE_WHEN: { SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)pNode; + destroyExprNode((SExprNode*)pNode); nodesDestroyNode(pCaseWhen->pCase); nodesDestroyNode(pCaseWhen->pElse); nodesDestroyList(pCaseWhen->pWhenThenList); @@ -1215,6 +1218,7 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_STREAMS_STMT: case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: case QUERY_NODE_SHOW_LICENCES_STMT: case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_TOPICS_STMT: @@ -2674,6 +2678,18 @@ SValueNode* nodesMakeValueNodeFromBool(bool b) { return pValNode; } +SNode* nodesMakeValueNodeFromInt32(int32_t value) { + SValueNode* pValNode = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); + if (pValNode) { + pValNode->node.resType.type = TSDB_DATA_TYPE_INT; + pValNode->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_INT].bytes; + nodesSetValueNodeValue(pValNode, &value); + pValNode->translate = true; + pValNode->isNull = false; + } + return (SNode*)pValNode; +} + bool nodesIsStar(SNode* pNode) { return (QUERY_NODE_COLUMN == nodeType(pNode)) && ('\0' == ((SColumnNode*)pNode)->tableAlias[0]) && (0 == strcmp(((SColumnNode*)pNode)->colName, "*")); diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 90c3753ed0..6c1fff05da 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -222,6 +222,7 @@ SNode* setAlterSuperTableType(SNode* pStmt); SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind); SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type); +SNode* createShowStmtWithFull(SAstCreateContext* pCxt, ENodeType type); SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, EOperatorType tableCondType); SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName, @@ -234,7 +235,8 @@ SNode* createShowTableDistributedStmt(SAstCreateContext* pCxt, SNode* pRealTable SNode* createShowDnodeVariablesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pLikePattern); SNode* createShowVnodesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pDnodeEndpoint); SNode* createShowTableTagsStmt(SAstCreateContext* pCxt, SNode* pTbName, SNode* pDbName, SNodeList* pTags); -SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo); +SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo, + int8_t createdb, int8_t is_import); SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pStmt, SNodeList* pIpRangesNodeList); SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, void* pAlterInfo); SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 170d51b1bf..8a18a84fae 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -95,10 +95,19 @@ white_list(A) ::= HOST ip_range_list(B). white_list_opt(A) ::= . { A = NULL; } white_list_opt(A) ::= white_list(B). { A = B; } +%type is_import_opt { int8_t } +%destructor is_import_opt { } +is_import_opt(A) ::= . { A = 0; } +is_import_opt(A) ::= IS_IMPORT NK_INTEGER(B). { A = taosStr2Int8(B.z, NULL, 10); } + +%type is_createdb_opt { int8_t } +%destructor is_createdb_opt { } +is_createdb_opt(A) ::= . { A = 0; } +is_createdb_opt(A) ::= CREATEDB NK_INTEGER(B). { A = taosStr2Int8(B.z, NULL, 10); } /************************************************ create/alter/drop user **********************************************/ -cmd ::= CREATE USER user_name(A) PASS NK_STRING(B) sysinfo_opt(C) +cmd ::= CREATE USER user_name(A) PASS NK_STRING(B) sysinfo_opt(C) is_createdb_opt(F) is_import_opt(E) white_list_opt(D). { - pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B, C); + pCxt->pRootNode = createCreateUserStmt(pCxt, &A, &B, C, E, F); pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, D); } cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B); } @@ -494,6 +503,7 @@ col_name(A) ::= column_name(B). /************************************************ show ****************************************************************/ cmd ::= SHOW DNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } cmd ::= SHOW USERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } +cmd ::= SHOW USERS FULL. { pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } cmd ::= SHOW USER PRIVILEGES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } cmd ::= SHOW db_kind_opt(A) DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 64d1260719..2c41572488 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -2010,6 +2010,15 @@ SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { CHECK_PARSER_STATUS(pCxt); SShowStmt* pStmt = (SShowStmt*)nodesMakeNode(type); CHECK_OUT_OF_MEM(pStmt); + pStmt->withFull = false; + return (SNode*)pStmt; +} + +SNode* createShowStmtWithFull(SAstCreateContext* pCxt, ENodeType type) { + CHECK_PARSER_STATUS(pCxt); + SShowStmt* pStmt = (SShowStmt*)nodesMakeNode(type); + CHECK_OUT_OF_MEM(pStmt); + pStmt->withFull = true; return (SNode*)pStmt; } @@ -2250,7 +2259,8 @@ SNode* addCreateUserStmtWhiteList(SAstCreateContext* pCxt, SNode* pCreateUserStm return pCreateUserStmt; } -SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo) { +SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo, + int8_t createDb, int8_t is_import) { CHECK_PARSER_STATUS(pCxt); char password[TSDB_USET_PASSWORD_LEN + 3] = {0}; if (!checkUserName(pCxt, pUserName) || !checkPassword(pCxt, pPassword, password)) { @@ -2261,6 +2271,8 @@ SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const ST COPY_STRING_FORM_ID_TOKEN(pStmt->userName, pUserName); strcpy(pStmt->password, password); pStmt->sysinfo = sysinfo; + pStmt->createDb = createDb; + pStmt->isImport = is_import; return (SNode*)pStmt; } @@ -2902,7 +2914,8 @@ SNode* createSyncdbStmt(SAstCreateContext* pCxt, const SToken* pDbName) { SNode* createGrantStmt(SAstCreateContext* pCxt, int64_t privileges, STokenPair* pPrivLevel, SToken* pUserName, SNode* pTagCond) { CHECK_PARSER_STATUS(pCxt); - if (!checkDbName(pCxt, &pPrivLevel->first, false) || !checkUserName(pCxt, pUserName)) { + if (!checkDbName(pCxt, &pPrivLevel->first, false) || !checkUserName(pCxt, pUserName) || + !checkTableName(pCxt, &pPrivLevel->second)) { return NULL; } SGrantStmt* pStmt = (SGrantStmt*)nodesMakeNode(QUERY_NODE_GRANT_STMT); diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 122118b71c..fe9804baef 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -557,6 +557,11 @@ static int32_t collectMetaKeyFromShowUsers(SCollectMetaKeyCxt* pCxt, SShowStmt* pCxt->pMetaCache); } +static int32_t collectMetaKeyFromShowUsersFull(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS_FULL, + pCxt->pMetaCache); +} + static int32_t collectMetaKeyFromShowLicence(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_LICENCES, pCxt->pMetaCache); @@ -821,6 +826,16 @@ static int32_t collectMetaKeyFromShowTSMASStmt(SCollectMetaKeyCxt* pCxt, SShowSt pCxt->pMetaCache); } +static int32_t collectMetaKeyFromShowAlive(SCollectMetaKeyCxt* pCxt, SShowAliveStmt* pStmt) { + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, + pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + // just to verify whether the database exists + code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); + } + return code; +} + static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { pCxt->pStmt = pStmt; switch (nodeType(pStmt)) { @@ -896,6 +911,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowStableTags(pCxt, (SShowTableTagsStmt*)pStmt); case QUERY_NODE_SHOW_USERS_STMT: return collectMetaKeyFromShowUsers(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_USERS_FULL_STMT: + return collectMetaKeyFromShowUsersFull(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_LICENCES_STMT: return collectMetaKeyFromShowLicence(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_VGROUPS_STMT: @@ -960,6 +977,9 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { break; case QUERY_NODE_SHOW_TSMAS_STMT: return collectMetaKeyFromShowTSMASStmt(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_DB_ALIVE_STMT: + case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT: + return collectMetaKeyFromShowAlive(pCxt, (SShowAliveStmt*)pStmt); default: break; } diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index cf389e249f..5490d0dc49 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -351,6 +351,7 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { case QUERY_NODE_SHOW_VNODES_STMT: case QUERY_NODE_SHOW_SCORES_STMT: case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT: case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 326ec092a9..ff48f81fc1 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -334,6 +334,7 @@ static SKeyword keywordTable[] = { {"COMPRESS", TK_COMPRESS}, {"LEVEL", TK_LEVEL}, {"ARBGROUPS", TK_ARBGROUPS}, + {"IS_IMPORT", TK_IS_IMPORT}, }; // clang-format on diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 7e55f2cfeb..2d5edcb01b 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -33,6 +33,20 @@ #define SYSTABLE_SHOW_TYPE_OFFSET QUERY_NODE_SHOW_DNODES_STMT +#define CHECK_RES_OUT_OF_MEM(p) \ + do { \ + if (TSDB_CODE_SUCCESS != (p)) { \ + return TSDB_CODE_OUT_OF_MEMORY; \ + } \ + } while (0) + +#define CHECK_POINTER_OUT_OF_MEM(p) \ + do { \ + if (NULL == (p)) { \ + return TSDB_CODE_OUT_OF_MEMORY; \ + } \ + } while (0) + typedef struct SRewriteTbNameContext { int32_t errCode; char* pTbName; @@ -183,6 +197,13 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { + .showType = QUERY_NODE_SHOW_USERS_FULL_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_USERS_FULL, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, { .showType = QUERY_NODE_SHOW_LICENCES_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, @@ -3203,6 +3224,27 @@ static bool fromSingleTable(SNode* table) { return false; } +static bool IsEqualTbNameFuncNode(SSelectStmt* pSelect, SNode* pFunc1, SNode* pFunc2) { + if (isTbnameFuction(pFunc1) && isTbnameFuction(pFunc2)) { + SValueNode* pVal1 = (SValueNode*)nodesListGetNode(((SFunctionNode*)pFunc1)->pParameterList, 0); + SValueNode* pVal2 = (SValueNode*)nodesListGetNode(((SFunctionNode*)pFunc1)->pParameterList, 0); + if (!pVal1 && !pVal2) { + return true; + } else if (pVal1 && pVal2) { + return strcmp(pVal1->literal, pVal2->literal) == 0; + } + + if (pSelect->pFromTable && + (pSelect->pFromTable->type == QUERY_NODE_REAL_TABLE || pSelect->pFromTable->type == QUERY_NODE_TEMP_TABLE)) { + STableNode* pTable = (STableNode*)pSelect->pFromTable; + return true; + } else { + return false; + } + } + return false; +} + static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) { STranslateContext* pCxt = (STranslateContext*)pContext; SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt; @@ -3222,6 +3264,9 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) { ((SColumnNode*)*pNode)->colType == COLUMN_TYPE_TAG) { return rewriteExprToGroupKeyFunc(pCxt, pNode); } + if (IsEqualTbNameFuncNode(pSelect, pActualNode, *pNode)) { + return rewriteExprToGroupKeyFunc(pCxt, pNode); + } } SNode* pPartKey = NULL; bool partionByTbname = hasTbnameFunction(pSelect->pPartitionByList); @@ -3233,6 +3278,9 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) { ((SColumnNode*)*pNode)->colType == COLUMN_TYPE_TAG) { return rewriteExprToGroupKeyFunc(pCxt, pNode); } + if (IsEqualTbNameFuncNode(pSelect, pPartKey, *pNode)) { + return rewriteExprToGroupKeyFunc(pCxt, pNode); + } } if (NULL != pSelect->pWindow && QUERY_NODE_STATE_WINDOW == nodeType(pSelect->pWindow)) { if (nodesEqualNode(((SStateWindowNode*)pSelect->pWindow)->pExpr, *pNode)) { @@ -6578,8 +6626,8 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS } static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int64_t val, int64_t minVal, - int64_t maxVal) { - if (val >= 0 && (val < minVal || val > maxVal)) { + int64_t maxVal, bool skipUndef) { + if (skipUndef ? ((val >= 0) && (val < minVal || val > maxVal)) : (val < minVal || val > maxVal)) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, "Invalid option %s: %" PRId64 ", valid range: [%" PRId64 ", %" PRId64 "]", pName, val, minVal, maxVal); @@ -6589,12 +6637,12 @@ static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const cha static int32_t checkDbRangeOption(STranslateContext* pCxt, const char* pName, int32_t val, int32_t minVal, int32_t maxVal) { - return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal); + return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal, true); } static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int64_t val, int64_t minVal, int64_t maxVal) { - return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal); + return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal, true); } static int32_t checkDbS3KeepLocalOption(STranslateContext* pCxt, SDatabaseOptions* pOptions) { @@ -7275,7 +7323,17 @@ static int32_t translateAlterDatabase(STranslateContext* pCxt, SAlterDatabaseStm "Invalid option, wal_level 0 should be used with replica 1"); } } - +#if 0 + if (pStmt->pOptions->replica > 1 && pStmt->pOptions->walLevel < 1) { + SDbCfgInfo dbCfg = {0}; + dbCfg.walLevel = -1; + int32_t code = getDBCfg(pCxt, pStmt->dbName, &dbCfg); + if (TSDB_CODE_SUCCESS == code && dbCfg.walLevel == 0) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, + "Invalid option, wal_level 0 should be used with replica 1"); + } + } +#endif int32_t code = checkDatabaseOptions(pCxt, pStmt->dbName, pStmt->pOptions); if (TSDB_CODE_SUCCESS != code) { return code; @@ -8458,7 +8516,7 @@ static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* p static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pStmt) { int32_t code = 0; SCreateUserReq createReq = {0}; - if ((code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1))) { + if ((code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1, false))) { return code; } strcpy(createReq.user, pStmt->userName); @@ -8467,6 +8525,8 @@ static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pSt createReq.sysInfo = pStmt->sysinfo; createReq.enable = 1; strcpy(createReq.pass, pStmt->password); + createReq.isImport = pStmt->isImport; + createReq.createDb = pStmt->createDb; createReq.numIpRanges = pStmt->numIpRanges; if (pStmt->numIpRanges > 0) { @@ -8482,13 +8542,13 @@ static int32_t checkAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt) { int32_t code = 0; switch (pStmt->alterType) { case TSDB_ALTER_USER_ENABLE: - code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "enable", pStmt->enable, 0, 1); + code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "enable", pStmt->enable, 0, 1, false); break; case TSDB_ALTER_USER_SYSINFO: - code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1); + code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1, false); break; case TSDB_ALTER_USER_CREATEDB: - code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "createdb", pStmt->createdb, 0, 1); + code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "createdb", pStmt->createdb, 0, 1, false); break; } return code; @@ -11570,20 +11630,6 @@ static int32_t extractShowCreateDatabaseResultSchema(int32_t* numOfCols, SSchema return TSDB_CODE_SUCCESS; } -static int32_t extractShowAliveResultSchema(int32_t* numOfCols, SSchema** pSchema) { - *numOfCols = 1; - *pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema)); - if (NULL == (*pSchema)) { - return TSDB_CODE_OUT_OF_MEMORY; - } - - (*pSchema)[0].type = TSDB_DATA_TYPE_INT; - (*pSchema)[0].bytes = sizeof(int32_t); - strcpy((*pSchema)[0].name, "status"); - - return TSDB_CODE_SUCCESS; -} - static int32_t extractShowCreateTableResultSchema(int32_t* numOfCols, SSchema** pSchema) { *numOfCols = 2; *pSchema = taosMemoryCalloc((*numOfCols), sizeof(SSchema)); @@ -11681,9 +11727,6 @@ int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pS } case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: return extractShowCreateDatabaseResultSchema(numOfCols, pSchema); - case QUERY_NODE_SHOW_DB_ALIVE_STMT: - case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT: - return extractShowAliveResultSchema(numOfCols, pSchema); case QUERY_NODE_SHOW_CREATE_TABLE_STMT: case QUERY_NODE_SHOW_CREATE_STABLE_STMT: return extractShowCreateTableResultSchema(numOfCols, pSchema); @@ -11810,6 +11853,24 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN return TSDB_CODE_SUCCESS; } +static int32_t createParOperatorNode(EOperatorType opType, const char* pLeftCol, const char* pRightCol, SNode** ppResOp) { + SOperatorNode* pOper = (SOperatorNode*)nodesMakeNode(QUERY_NODE_OPERATOR); + CHECK_POINTER_OUT_OF_MEM(pOper); + + pOper->opType = opType; + pOper->pLeft = nodesMakeNode(QUERY_NODE_COLUMN); + pOper->pRight = nodesMakeNode(QUERY_NODE_COLUMN); + if (NULL == pOper->pLeft || NULL == pOper->pRight) { + nodesDestroyNode((SNode*)pOper); + return TSDB_CODE_OUT_OF_MEMORY; + } + strcpy(((SColumnNode*)pOper->pLeft)->colName, pLeftCol); + strcpy(((SColumnNode*)pOper->pRight)->colName, pRightCol); + + *ppResOp = (SNode*)pOper; + return TSDB_CODE_SUCCESS; +} + static const char* getTbNameColName(ENodeType type) { const char* colName; switch (type) { @@ -13337,6 +13398,203 @@ static int32_t rewriteShowCompactDetailsStmt(STranslateContext* pCxt, SQuery* pQ return code; } +static int32_t createParWhenThenNode(SNode* pWhen, SNode* pThen, SNode** ppResWhenThen) { + SWhenThenNode* pWThen = (SWhenThenNode*)nodesMakeNode(QUERY_NODE_WHEN_THEN); + CHECK_POINTER_OUT_OF_MEM(pWThen); + + pWThen->pWhen = pWhen; + pWThen->pThen = pThen; + *ppResWhenThen = (SNode*)pWThen; + return TSDB_CODE_SUCCESS; +} + +static int32_t createParCaseWhenNode(SNode* pCase, SNodeList* pWhenThenList, SNode* pElse, const char* pAias, SNode** ppResCaseWhen) { + SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)nodesMakeNode(QUERY_NODE_CASE_WHEN); + CHECK_POINTER_OUT_OF_MEM(pCaseWhen); + + pCaseWhen->pCase = pCase; + pCaseWhen->pWhenThenList = pWhenThenList; + pCaseWhen->pElse = pElse; + if (pAias) { + strcpy(pCaseWhen->node.aliasName, pAias); + strcpy(pCaseWhen->node.userAlias, pAias); + } + *ppResCaseWhen = (SNode*)pCaseWhen; + return TSDB_CODE_SUCCESS; +} + +static int32_t createParFunctionNode(const char* pFunName, const char* pAias, SNodeList* pParameterList, SNode** ppResFunc) { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + CHECK_POINTER_OUT_OF_MEM(pFunc); + strcpy(pFunc->functionName, pFunName); + strcpy(pFunc->node.aliasName, pAias); + strcpy(pFunc->node.userAlias, pAias); + pFunc->pParameterList = pParameterList; + *ppResFunc = (SNode*)pFunc; + return TSDB_CODE_SUCCESS; +} + +static int32_t createParListNode(SNode* pItem, SNodeList** ppResList) { + SNodeList* pList = nodesMakeList(); + CHECK_POINTER_OUT_OF_MEM(pList); + CHECK_RES_OUT_OF_MEM(nodesListStrictAppend(pList, pItem)); + *ppResList = pList; + return TSDB_CODE_SUCCESS; +} + +static int32_t createParTempTableNode(SSelectStmt* pSubquery, SNode** ppResTempTable) { + STempTableNode* pTempTable = (STempTableNode*)nodesMakeNode(QUERY_NODE_TEMP_TABLE); + CHECK_POINTER_OUT_OF_MEM(pTempTable); + pTempTable->pSubquery = (SNode*)pSubquery; + taosRandStr(pTempTable->table.tableAlias, 8); + strcpy(pSubquery->stmtName, pTempTable->table.tableAlias); + pSubquery->isSubquery = true; + *ppResTempTable = (SNode*)pTempTable; + return TSDB_CODE_SUCCESS; +} + +static int32_t rewriteShowAliveStmt(STranslateContext* pCxt, SQuery* pQuery) { + int32_t code = TSDB_CODE_SUCCESS; + char* pDbName = ((SShowAliveStmt*)pQuery->pRoot)->dbName; + if (pDbName && pDbName[0] != 0) { + SDbCfgInfo dbCfg = {0}; + code = getDBCfg(pCxt, pDbName, &dbCfg); + if (TSDB_CODE_SUCCESS != code) { + return code; + } + } + + SValueNode* pValNode = nodesMakeValueNodeFromString("leader"); + CHECK_POINTER_OUT_OF_MEM(pValNode); + + SNode* pCond1 = NULL; + SNode* pCond2 = NULL; + SNode* pCond3 = NULL; + SNode* pCond4 = NULL; + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v1_status", (SNode*)pValNode, &pCond1)); + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v2_status", (SNode*)pValNode, &pCond2)); + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v3_status", (SNode*)pValNode, &pCond3)); + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "v4_status", (SNode*)pValNode, &pCond4)); + nodesDestroyNode((SNode*)pValNode); + + SNode* pTemp1 = NULL; + SNode* pTemp2 = NULL; + SNode* pFullCond = NULL; + CHECK_RES_OUT_OF_MEM(createLogicCondNode(pCond1, pCond2, &pTemp1, LOGIC_COND_TYPE_OR)); + CHECK_RES_OUT_OF_MEM(createLogicCondNode(pTemp1, pCond3, &pTemp2, LOGIC_COND_TYPE_OR)); + CHECK_RES_OUT_OF_MEM(createLogicCondNode(pTemp2, pCond4, &pFullCond, LOGIC_COND_TYPE_OR)); + + SNode* pThen = nodesMakeValueNodeFromInt32(1); + CHECK_POINTER_OUT_OF_MEM(pThen); + + SNode* pWhenThen = NULL; + CHECK_RES_OUT_OF_MEM(createParWhenThenNode(pFullCond, pThen, &pWhenThen)); + SNodeList* pWhenThenlist = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pWhenThen, &pWhenThenlist)); + + SNode* pElse = nodesMakeValueNodeFromInt32(0); + CHECK_POINTER_OUT_OF_MEM(pElse); + + // case when (v1_status = "leader" or v2_status = "lead er" or v3_status = "leader" or v4_status = "leader") then 1 else 0 end + SNode* pCaseWhen = NULL; + CHECK_RES_OUT_OF_MEM(createParCaseWhenNode(NULL, pWhenThenlist, pElse, NULL, &pCaseWhen)); + + SNodeList* pParaList = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pCaseWhen, &pParaList)); + + + // sum( case when ... end) as leader_col + SNode* pSumFun = NULL; + const char* pSumColAlias = "leader_col"; + CHECK_RES_OUT_OF_MEM(createParFunctionNode("sum", pSumColAlias, pParaList, &pSumFun)); + + SNode* pPara1 = nodesMakeValueNodeFromInt32(1); + CHECK_POINTER_OUT_OF_MEM(pThen); + pParaList = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pPara1, &pParaList)); + + // count(1) as count_col + SNode* pCountFun = NULL; + const char* pCountColAlias = "count_col"; + CHECK_RES_OUT_OF_MEM(createParFunctionNode("count", pCountColAlias, pParaList, &pCountFun)); + + SNodeList* pProjList = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pSumFun, &pProjList)); + CHECK_RES_OUT_OF_MEM(nodesListStrictAppend(pProjList, pCountFun)); + + SSelectStmt* pSubSelect = NULL; + // select sum( case when .... end) as leader_col, count(*) as count_col from information_schema.ins_vgroups + CHECK_RES_OUT_OF_MEM(createSimpleSelectStmtFromProjList(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, pProjList, &pSubSelect)); + + if (pDbName && pDbName[0] != 0) { + // for show db.alive + // select sum( case when .... end) as leader_col, count(*) as count_col from information_schema.ins_vgroups where db_name = "..." + SNode* pDbCond = NULL; + pValNode = nodesMakeValueNodeFromString(pDbName); + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_EQUAL, "db_name", (SNode*)pValNode, &pDbCond)); + nodesDestroyNode((SNode*)pValNode); + pCxt->showRewrite = false; + pQuery->showRewrite = false; + pSubSelect->pWhere = pDbCond; + } + + + + pCond1 = NULL; + CHECK_RES_OUT_OF_MEM(createParOperatorNode(OP_TYPE_EQUAL, pSumColAlias, pCountColAlias, &pCond1)); + pCond2 = NULL; + SNode* pTempVal = nodesMakeValueNodeFromInt32(0); + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_GREATER_THAN, pSumColAlias, pTempVal, &pCond2)); + //leader_col = count_col and leader_col > 0 + pTemp1 = NULL; + CHECK_RES_OUT_OF_MEM(createLogicCondNode(pCond1, pCond2, &pTemp1, LOGIC_COND_TYPE_AND)); + + pThen = nodesMakeValueNodeFromInt32(1); + CHECK_POINTER_OUT_OF_MEM(pThen); + pWhenThen = NULL; + CHECK_RES_OUT_OF_MEM(createParWhenThenNode(pTemp1, pThen, &pWhenThen)); + pWhenThenlist = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pWhenThen, &pWhenThenlist)); + + pCond1 = NULL; + CHECK_RES_OUT_OF_MEM(createParOperatorNode(OP_TYPE_LOWER_THAN, pSumColAlias, pCountColAlias, &pCond1)); + pCond2 = NULL; + CHECK_RES_OUT_OF_MEM(createOperatorNode(OP_TYPE_GREATER_THAN, pSumColAlias, pTempVal, &pCond2)); + // leader_col < count_col and leader_col > 0 + pTemp2 = NULL; + CHECK_RES_OUT_OF_MEM(createLogicCondNode(pCond1, pCond2, &pTemp2, LOGIC_COND_TYPE_AND)); + nodesDestroyNode((SNode*)pTempVal); + + pThen = nodesMakeValueNodeFromInt32(2); + CHECK_POINTER_OUT_OF_MEM(pThen); + pWhenThen = NULL; + CHECK_RES_OUT_OF_MEM(createParWhenThenNode(pTemp2, pThen, &pWhenThen)); + CHECK_RES_OUT_OF_MEM(nodesListStrictAppend(pWhenThenlist, pWhenThen)); + + // case when leader_col = count_col and count_col > 0 then 1 when leader_col < count_col and count_col > 0 then 2 else 0 end as status + pCaseWhen = NULL; + pElse = nodesMakeValueNodeFromInt32(0); + CHECK_POINTER_OUT_OF_MEM(pElse); + CHECK_RES_OUT_OF_MEM(createParCaseWhenNode(NULL, pWhenThenlist, pElse, "status", &pCaseWhen)); + + pProjList = NULL; + CHECK_RES_OUT_OF_MEM(createParListNode(pCaseWhen, &pProjList)); + + SNode* pTempTblNode = NULL; + CHECK_RES_OUT_OF_MEM(createParTempTableNode(pSubSelect, &pTempTblNode)); + + + SSelectStmt* pStmt = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT); + CHECK_POINTER_OUT_OF_MEM(pStmt); + pStmt->pProjectionList = pProjList; + pStmt->pFromTable = pTempTblNode; + sprintf(pStmt->stmtName, "%p", pStmt); + + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + return TSDB_CODE_SUCCESS; +} + static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { int32_t code = TSDB_CODE_SUCCESS; switch (nodeType(pQuery->pRoot)) { @@ -13345,6 +13603,7 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_STABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: + case QUERY_NODE_SHOW_USERS_FULL_STMT: case QUERY_NODE_SHOW_DNODES_STMT: case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: @@ -13413,6 +13672,10 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: code = rewriteShowCompactDetailsStmt(pCxt, pQuery); break; + case QUERY_NODE_SHOW_DB_ALIVE_STMT: + case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT: + code = rewriteShowAliveStmt(pCxt, pQuery); + break; default: break; } @@ -13504,8 +13767,6 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) { break; case QUERY_NODE_DESCRIBE_STMT: case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: - case QUERY_NODE_SHOW_DB_ALIVE_STMT: - case QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT: case QUERY_NODE_SHOW_CREATE_TABLE_STMT: case QUERY_NODE_SHOW_CREATE_STABLE_STMT: case QUERY_NODE_SHOW_CREATE_VIEW_STMT: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index bc409dd6cf..ade8c2d94a 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -1,3 +1,5 @@ +/* This file is automatically generated by Lemon from input grammar +** source file "sql.y". */ /* ** 2000-05-29 ** @@ -22,10 +24,7 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ -#include -#include /************ Begin %include sections from the grammar ************************/ - #include #include #include @@ -42,11 +41,388 @@ #define YYSTACKDEPTH 0 /**************** End of %include directives **********************************/ -/* 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 ***************************/ +/* 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_NK_COMMA 33 +#define TK_HOST 34 +#define TK_IS_IMPORT 35 +#define TK_NK_INTEGER 36 +#define TK_CREATEDB 37 +#define TK_USER 38 +#define TK_ENABLE 39 +#define TK_SYSINFO 40 +#define TK_ADD 41 +#define TK_DROP 42 +#define TK_GRANT 43 +#define TK_ON 44 +#define TK_TO 45 +#define TK_REVOKE 46 +#define TK_FROM 47 +#define TK_SUBSCRIBE 48 +#define TK_READ 49 +#define TK_WRITE 50 +#define TK_NK_DOT 51 +#define TK_WITH 52 +#define TK_ENCRYPT_KEY 53 +#define TK_DNODE 54 +#define TK_PORT 55 +#define TK_DNODES 56 +#define TK_RESTORE 57 +#define TK_NK_IPTOKEN 58 +#define TK_FORCE 59 +#define TK_UNSAFE 60 +#define TK_CLUSTER 61 +#define TK_LOCAL 62 +#define TK_QNODE 63 +#define TK_BNODE 64 +#define TK_SNODE 65 +#define TK_MNODE 66 +#define TK_VNODE 67 +#define TK_DATABASE 68 +#define TK_USE 69 +#define TK_FLUSH 70 +#define TK_TRIM 71 +#define TK_S3MIGRATE 72 +#define TK_COMPACT 73 +#define TK_IF 74 +#define TK_NOT 75 +#define TK_EXISTS 76 +#define TK_BUFFER 77 +#define TK_CACHEMODEL 78 +#define TK_CACHESIZE 79 +#define TK_COMP 80 +#define TK_DURATION 81 +#define TK_NK_VARIABLE 82 +#define TK_MAXROWS 83 +#define TK_MINROWS 84 +#define TK_KEEP 85 +#define TK_PAGES 86 +#define TK_PAGESIZE 87 +#define TK_TSDB_PAGESIZE 88 +#define TK_PRECISION 89 +#define TK_REPLICA 90 +#define TK_VGROUPS 91 +#define TK_SINGLE_STABLE 92 +#define TK_RETENTIONS 93 +#define TK_SCHEMALESS 94 +#define TK_WAL_LEVEL 95 +#define TK_WAL_FSYNC_PERIOD 96 +#define TK_WAL_RETENTION_PERIOD 97 +#define TK_WAL_RETENTION_SIZE 98 +#define TK_WAL_ROLL_PERIOD 99 +#define TK_WAL_SEGMENT_SIZE 100 +#define TK_STT_TRIGGER 101 +#define TK_TABLE_PREFIX 102 +#define TK_TABLE_SUFFIX 103 +#define TK_S3_CHUNKSIZE 104 +#define TK_S3_KEEPLOCAL 105 +#define TK_S3_COMPACT 106 +#define TK_KEEP_TIME_OFFSET 107 +#define TK_ENCRYPT_ALGORITHM 108 +#define TK_NK_COLON 109 +#define TK_BWLIMIT 110 +#define TK_START 111 +#define TK_TIMESTAMP 112 +#define TK_END 113 +#define TK_TABLE 114 +#define TK_NK_LP 115 +#define TK_NK_RP 116 +#define TK_STABLE 117 +#define TK_COLUMN 118 +#define TK_MODIFY 119 +#define TK_RENAME 120 +#define TK_TAG 121 +#define TK_SET 122 +#define TK_NK_EQ 123 +#define TK_USING 124 +#define TK_TAGS 125 +#define TK_BOOL 126 +#define TK_TINYINT 127 +#define TK_SMALLINT 128 +#define TK_INT 129 +#define TK_INTEGER 130 +#define TK_BIGINT 131 +#define TK_FLOAT 132 +#define TK_DOUBLE 133 +#define TK_BINARY 134 +#define TK_NCHAR 135 +#define TK_UNSIGNED 136 +#define TK_JSON 137 +#define TK_VARCHAR 138 +#define TK_MEDIUMBLOB 139 +#define TK_BLOB 140 +#define TK_VARBINARY 141 +#define TK_GEOMETRY 142 +#define TK_DECIMAL 143 +#define TK_COMMENT 144 +#define TK_MAX_DELAY 145 +#define TK_WATERMARK 146 +#define TK_ROLLUP 147 +#define TK_TTL 148 +#define TK_SMA 149 +#define TK_DELETE_MARK 150 +#define TK_FIRST 151 +#define TK_LAST 152 +#define TK_SHOW 153 +#define TK_FULL 154 +#define TK_PRIVILEGES 155 +#define TK_DATABASES 156 +#define TK_TABLES 157 +#define TK_STABLES 158 +#define TK_MNODES 159 +#define TK_QNODES 160 +#define TK_ARBGROUPS 161 +#define TK_FUNCTIONS 162 +#define TK_INDEXES 163 +#define TK_ACCOUNTS 164 +#define TK_APPS 165 +#define TK_CONNECTIONS 166 +#define TK_LICENCES 167 +#define TK_GRANTS 168 +#define TK_LOGS 169 +#define TK_MACHINES 170 +#define TK_ENCRYPTIONS 171 +#define TK_QUERIES 172 +#define TK_SCORES 173 +#define TK_TOPICS 174 +#define TK_VARIABLES 175 +#define TK_BNODES 176 +#define TK_SNODES 177 +#define TK_TRANSACTIONS 178 +#define TK_DISTRIBUTED 179 +#define TK_CONSUMERS 180 +#define TK_SUBSCRIPTIONS 181 +#define TK_VNODES 182 +#define TK_ALIVE 183 +#define TK_VIEWS 184 +#define TK_VIEW 185 +#define TK_COMPACTS 186 +#define TK_NORMAL 187 +#define TK_CHILD 188 +#define TK_LIKE 189 +#define TK_TBNAME 190 +#define TK_QTAGS 191 +#define TK_AS 192 +#define TK_SYSTEM 193 +#define TK_TSMA 194 +#define TK_INTERVAL 195 +#define TK_RECURSIVE 196 +#define TK_TSMAS 197 +#define TK_FUNCTION 198 +#define TK_INDEX 199 +#define TK_COUNT 200 +#define TK_LAST_ROW 201 +#define TK_META 202 +#define TK_ONLY 203 +#define TK_TOPIC 204 +#define TK_CONSUMER 205 +#define TK_GROUP 206 +#define TK_DESC 207 +#define TK_DESCRIBE 208 +#define TK_RESET 209 +#define TK_QUERY 210 +#define TK_CACHE 211 +#define TK_EXPLAIN 212 +#define TK_ANALYZE 213 +#define TK_VERBOSE 214 +#define TK_NK_BOOL 215 +#define TK_RATIO 216 +#define TK_NK_FLOAT 217 +#define TK_OUTPUTTYPE 218 +#define TK_AGGREGATE 219 +#define TK_BUFSIZE 220 +#define TK_LANGUAGE 221 +#define TK_REPLACE 222 +#define TK_STREAM 223 +#define TK_INTO 224 +#define TK_PAUSE 225 +#define TK_RESUME 226 +#define TK_PRIMARY 227 +#define TK_KEY 228 +#define TK_TRIGGER 229 +#define TK_AT_ONCE 230 +#define TK_WINDOW_CLOSE 231 +#define TK_IGNORE 232 +#define TK_EXPIRED 233 +#define TK_FILL_HISTORY 234 +#define TK_UPDATE 235 +#define TK_SUBTABLE 236 +#define TK_UNTREATED 237 +#define TK_KILL 238 +#define TK_CONNECTION 239 +#define TK_TRANSACTION 240 +#define TK_BALANCE 241 +#define TK_VGROUP 242 +#define TK_LEADER 243 +#define TK_MERGE 244 +#define TK_REDISTRIBUTE 245 +#define TK_SPLIT 246 +#define TK_DELETE 247 +#define TK_INSERT 248 +#define TK_NK_BIN 249 +#define TK_NK_HEX 250 +#define TK_NULL 251 +#define TK_NK_QUESTION 252 +#define TK_NK_ALIAS 253 +#define TK_NK_ARROW 254 +#define TK_ROWTS 255 +#define TK_QSTART 256 +#define TK_QEND 257 +#define TK_QDURATION 258 +#define TK_WSTART 259 +#define TK_WEND 260 +#define TK_WDURATION 261 +#define TK_IROWTS 262 +#define TK_ISFILLED 263 +#define TK_CAST 264 +#define TK_NOW 265 +#define TK_TODAY 266 +#define TK_TIMEZONE 267 +#define TK_CLIENT_VERSION 268 +#define TK_SERVER_VERSION 269 +#define TK_SERVER_STATUS 270 +#define TK_CURRENT_USER 271 +#define TK_CASE 272 +#define TK_WHEN 273 +#define TK_THEN 274 +#define TK_ELSE 275 +#define TK_BETWEEN 276 +#define TK_IS 277 +#define TK_NK_LT 278 +#define TK_NK_GT 279 +#define TK_NK_LE 280 +#define TK_NK_GE 281 +#define TK_NK_NE 282 +#define TK_MATCH 283 +#define TK_NMATCH 284 +#define TK_CONTAINS 285 +#define TK_IN 286 +#define TK_JOIN 287 +#define TK_INNER 288 +#define TK_LEFT 289 +#define TK_RIGHT 290 +#define TK_OUTER 291 +#define TK_SEMI 292 +#define TK_ANTI 293 +#define TK_ASOF 294 +#define TK_WINDOW 295 +#define TK_WINDOW_OFFSET 296 +#define TK_JLIMIT 297 +#define TK_SELECT 298 +#define TK_NK_HINT 299 +#define TK_DISTINCT 300 +#define TK_WHERE 301 +#define TK_PARTITION 302 +#define TK_BY 303 +#define TK_SESSION 304 +#define TK_STATE_WINDOW 305 +#define TK_EVENT_WINDOW 306 +#define TK_COUNT_WINDOW 307 +#define TK_SLIDING 308 +#define TK_FILL 309 +#define TK_VALUE 310 +#define TK_VALUE_F 311 +#define TK_NONE 312 +#define TK_PREV 313 +#define TK_NULL_F 314 +#define TK_LINEAR 315 +#define TK_NEXT 316 +#define TK_HAVING 317 +#define TK_RANGE 318 +#define TK_EVERY 319 +#define TK_ORDER 320 +#define TK_SLIMIT 321 +#define TK_SOFFSET 322 +#define TK_LIMIT 323 +#define TK_OFFSET 324 +#define TK_ASC 325 +#define TK_NULLS 326 +#define TK_ABORT 327 +#define TK_AFTER 328 +#define TK_ATTACH 329 +#define TK_BEFORE 330 +#define TK_BEGIN 331 +#define TK_BITAND 332 +#define TK_BITNOT 333 +#define TK_BITOR 334 +#define TK_BLOCKS 335 +#define TK_CHANGE 336 +#define TK_COMMA 337 +#define TK_CONCAT 338 +#define TK_CONFLICT 339 +#define TK_COPY 340 +#define TK_DEFERRED 341 +#define TK_DELIMITERS 342 +#define TK_DETACH 343 +#define TK_DIVIDE 344 +#define TK_DOT 345 +#define TK_EACH 346 +#define TK_FAIL 347 +#define TK_FILE 348 +#define TK_FOR 349 +#define TK_GLOB 350 +#define TK_ID 351 +#define TK_IMMEDIATE 352 +#define TK_IMPORT 353 +#define TK_INITIALLY 354 +#define TK_INSTEAD 355 +#define TK_ISNULL 356 +#define TK_MODULES 357 +#define TK_NK_BITNOT 358 +#define TK_NK_SEMI 359 +#define TK_NOTNULL 360 +#define TK_OF 361 +#define TK_PLUS 362 +#define TK_PRIVILEGE 363 +#define TK_RAISE 364 +#define TK_RESTRICT 365 +#define TK_ROW 366 +#define TK_STAR 367 +#define TK_STATEMENT 368 +#define TK_STRICT 369 +#define TK_STRING 370 +#define TK_TIMES 371 +#define TK_VALUES 372 +#define TK_VARIABLE 373 +#define TK_WAL 374 +#define TK_ENCODE 375 +#define TK_COMPRESS 376 +#define TK_LEVEL 377 +#endif +/**************** End token definitions ***************************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. @@ -104,30 +480,30 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 555 +#define YYNOCODE 558 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SNodeList* yy34; - EShowKind yy39; - int32_t yy100; - EJoinType yy162; - int8_t yy323; - SShowTablesOption yy397; - bool yy437; - EOperatorType yy440; - EJoinSubType yy444; - SNode* yy452; - SAlterOption yy455; - SToken yy479; - EOrder yy548; - int64_t yy579; - STokenPair yy687; - ENullOrder yy817; - SDataType yy874; - EFillMode yy984; + SAlterOption yy101; + bool yy209; + SNodeList* yy316; + SNode* yy416; + EOrder yy506; + EJoinSubType yy630; + EShowKind yy681; + int32_t yy820; + EOperatorType yy848; + STokenPair yy849; + EFillMode yy882; + SShowTablesOption yy925; + SDataType yy952; + EJoinType yy972; + int8_t yy1043; + ENullOrder yy1045; + int64_t yy1089; + SToken yy1109; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -143,18 +519,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 967 -#define YYNRULE 749 -#define YYNRULE_WITH_ACTION 749 -#define YYNTOKEN 377 -#define YY_MAX_SHIFT 966 -#define YY_MIN_SHIFTREDUCE 1434 -#define YY_MAX_SHIFTREDUCE 2182 -#define YY_ERROR_ACTION 2183 -#define YY_ACCEPT_ACTION 2184 -#define YY_NO_ACTION 2185 -#define YY_MIN_REDUCE 2186 -#define YY_MAX_REDUCE 2934 +#define YYNSTATE 972 +#define YYNRULE 754 +#define YYNRULE_WITH_ACTION 754 +#define YYNTOKEN 378 +#define YY_MAX_SHIFT 971 +#define YY_MIN_SHIFTREDUCE 1441 +#define YY_MAX_SHIFTREDUCE 2194 +#define YY_ERROR_ACTION 2195 +#define YY_ACCEPT_ACTION 2196 +#define YY_NO_ACTION 2197 +#define YY_MIN_REDUCE 2198 +#define YY_MAX_REDUCE 2951 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -221,951 +597,905 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3285) +#define YY_ACTTAB_COUNT (3045) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 792, 37, 338, 2543, 190, 2380, 315, 2905, 2900, 804, - /* 10 */ 155, 2449, 47, 45, 2099, 2900, 859, 2389, 2668, 464, - /* 20 */ 471, 487, 1920, 2186, 2541, 849, 791, 217, 661, 2710, - /* 30 */ 2447, 2901, 793, 182, 2904, 2008, 146, 1918, 2901, 2903, - /* 40 */ 197, 2323, 807, 687, 804, 155, 3, 145, 144, 143, - /* 50 */ 142, 141, 140, 139, 138, 137, 40, 39, 9, 53, - /* 60 */ 46, 44, 43, 42, 41, 1475, 439, 2003, 2516, 476, - /* 70 */ 2728, 40, 39, 781, 19, 46, 44, 43, 42, 41, - /* 80 */ 863, 1926, 476, 2449, 1482, 2543, 2675, 2530, 844, 662, - /* 90 */ 183, 437, 2198, 863, 496, 495, 804, 155, 859, 2389, - /* 100 */ 466, 2728, 2447, 122, 1934, 66, 2540, 849, 1477, 1480, - /* 110 */ 1481, 963, 489, 2391, 15, 2209, 2710, 2008, 221, 1927, - /* 120 */ 40, 39, 377, 2628, 46, 44, 43, 42, 41, 845, - /* 130 */ 806, 185, 2810, 2811, 2709, 153, 2815, 2748, 782, 553, - /* 140 */ 2512, 119, 2711, 848, 2713, 2714, 843, 1945, 863, 2003, - /* 150 */ 2010, 2011, 252, 199, 2124, 2802, 644, 2728, 2238, 467, - /* 160 */ 2798, 804, 155, 1926, 455, 2590, 192, 2810, 803, 2125, - /* 170 */ 147, 802, 2675, 2675, 780, 844, 858, 758, 2900, 218, - /* 180 */ 792, 516, 2074, 454, 2590, 2900, 431, 2849, 2900, 1981, - /* 190 */ 1991, 641, 232, 832, 642, 2230, 791, 217, 858, 2009, - /* 200 */ 2012, 2901, 793, 2906, 217, 223, 791, 217, 2901, 793, - /* 210 */ 658, 2901, 793, 2123, 1921, 62, 1919, 2905, 125, 2810, - /* 220 */ 2811, 2709, 153, 2815, 2748, 2900, 98, 777, 119, 2711, - /* 230 */ 848, 2713, 2714, 843, 2037, 863, 869, 2393, 157, 123, - /* 240 */ 166, 2773, 2802, 441, 2904, 62, 467, 2798, 2901, 2902, - /* 250 */ 1924, 1925, 1978, 2384, 1980, 1983, 1984, 1985, 1986, 1987, - /* 260 */ 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, 2006, - /* 270 */ 2007, 2, 47, 45, 659, 2536, 1502, 415, 1501, 1943, - /* 280 */ 471, 741, 1920, 186, 2810, 2811, 588, 153, 2815, 609, - /* 290 */ 496, 495, 50, 151, 608, 2008, 1935, 1918, 1930, 738, - /* 300 */ 2038, 2822, 2071, 2072, 2073, 2822, 2822, 2822, 2822, 2822, - /* 310 */ 646, 33, 567, 1503, 610, 1927, 643, 40, 39, 416, - /* 320 */ 569, 46, 44, 43, 42, 41, 649, 2003, 664, 642, - /* 330 */ 2230, 547, 1938, 1940, 19, 2187, 783, 778, 771, 767, - /* 340 */ 12, 1926, 10, 858, 742, 180, 861, 860, 2002, 2004, - /* 350 */ 2005, 2006, 2007, 236, 489, 2391, 136, 657, 2074, 135, - /* 360 */ 134, 133, 132, 131, 130, 129, 128, 127, 51, 289, - /* 370 */ 1978, 963, 440, 288, 15, 900, 172, 171, 897, 896, - /* 380 */ 895, 169, 98, 555, 868, 867, 866, 36, 469, 2032, - /* 390 */ 2033, 2034, 2035, 2036, 2040, 2041, 2042, 2043, 322, 92, - /* 400 */ 40, 39, 91, 660, 46, 44, 43, 42, 41, 2385, - /* 410 */ 2010, 2011, 1949, 2523, 2502, 739, 596, 595, 594, 593, - /* 420 */ 592, 587, 586, 585, 584, 423, 651, 2582, 322, 574, - /* 430 */ 573, 572, 571, 570, 564, 563, 562, 50, 557, 556, - /* 440 */ 438, 2074, 2373, 418, 548, 1754, 1755, 101, 181, 1981, - /* 450 */ 1991, 1773, 426, 390, 1945, 453, 62, 730, 136, 2009, - /* 460 */ 2012, 135, 134, 133, 132, 131, 130, 129, 128, 127, - /* 470 */ 90, 388, 76, 728, 1921, 75, 1919, 2822, 2071, 2072, - /* 480 */ 2073, 2822, 2822, 2822, 2822, 2822, 417, 828, 726, 2774, - /* 490 */ 724, 722, 286, 285, 1930, 2710, 1949, 210, 250, 623, - /* 500 */ 621, 618, 616, 2076, 2077, 2078, 2079, 2080, 807, 197, - /* 510 */ 1924, 1925, 1978, 2436, 1980, 1983, 1984, 1985, 1986, 1987, - /* 520 */ 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, 2006, - /* 530 */ 2007, 2, 12, 47, 45, 1946, 2728, 2517, 1920, 2208, - /* 540 */ 1945, 471, 544, 1920, 62, 46, 44, 43, 42, 41, - /* 550 */ 1654, 322, 2675, 1918, 844, 535, 2008, 534, 1918, 521, - /* 560 */ 2485, 2071, 2072, 2073, 1645, 892, 891, 890, 1649, 889, - /* 570 */ 1651, 1652, 888, 885, 2710, 1660, 882, 1662, 1663, 879, - /* 580 */ 876, 873, 63, 213, 2543, 474, 2132, 845, 2003, 533, - /* 590 */ 835, 606, 604, 179, 411, 19, 2675, 1926, 230, 473, - /* 600 */ 2709, 834, 1926, 2748, 2394, 2540, 849, 119, 2711, 848, - /* 610 */ 2713, 2714, 843, 1946, 863, 2728, 445, 444, 691, 199, - /* 620 */ 322, 2802, 690, 1766, 1767, 467, 2798, 963, 559, 2512, - /* 630 */ 180, 2675, 963, 844, 62, 15, 86, 85, 540, 322, - /* 640 */ 2392, 229, 2669, 2817, 1950, 774, 773, 2130, 2131, 2133, - /* 650 */ 2134, 2135, 902, 2850, 532, 530, 40, 39, 859, 2389, - /* 660 */ 46, 44, 43, 42, 41, 1793, 1794, 414, 12, 2814, - /* 670 */ 519, 2010, 2011, 515, 511, 507, 504, 533, 146, 2709, - /* 680 */ 491, 234, 2748, 2442, 2444, 692, 119, 2711, 848, 2713, - /* 690 */ 2714, 843, 2905, 863, 443, 442, 525, 689, 2777, 1502, - /* 700 */ 2802, 1501, 859, 2389, 467, 2798, 476, 117, 2468, 1948, - /* 710 */ 1981, 1991, 2103, 1482, 1792, 1795, 1945, 863, 1945, 691, - /* 720 */ 2009, 2012, 55, 690, 158, 527, 523, 322, 1950, 581, - /* 730 */ 1921, 1654, 1919, 2381, 580, 1921, 1503, 1919, 1480, 1481, - /* 740 */ 600, 2685, 579, 1693, 1694, 1645, 892, 891, 890, 1649, - /* 750 */ 889, 1651, 1652, 839, 838, 2710, 1660, 837, 1662, 1663, - /* 760 */ 836, 876, 873, 2143, 1949, 757, 1924, 1925, 845, 2689, - /* 770 */ 2240, 1924, 1925, 1978, 377, 1980, 1983, 1984, 1985, 1986, - /* 780 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, - /* 790 */ 2006, 2007, 2, 47, 45, 2013, 2728, 482, 2710, 590, - /* 800 */ 2512, 471, 148, 1920, 2167, 916, 241, 485, 43, 42, - /* 810 */ 41, 845, 2675, 2857, 844, 88, 2008, 322, 1918, 2365, - /* 820 */ 2691, 2694, 40, 39, 1926, 2710, 46, 44, 43, 42, - /* 830 */ 41, 863, 599, 240, 715, 1949, 2591, 2018, 845, 2728, - /* 840 */ 2870, 638, 830, 1945, 2774, 2207, 597, 2206, 2003, 729, - /* 850 */ 636, 2817, 239, 632, 628, 2675, 2363, 844, 859, 2389, - /* 860 */ 2709, 919, 1926, 2748, 2349, 287, 2728, 119, 2711, 848, - /* 870 */ 2713, 2714, 843, 918, 863, 583, 582, 2813, 541, 2920, - /* 880 */ 320, 2802, 2675, 718, 844, 467, 2798, 1982, 859, 2389, - /* 890 */ 712, 710, 963, 2685, 254, 48, 893, 284, 644, 2449, - /* 900 */ 2238, 2449, 2675, 2709, 2675, 60, 2748, 475, 542, 490, - /* 910 */ 119, 2711, 848, 2713, 2714, 843, 755, 863, 2447, 1484, - /* 920 */ 2447, 2689, 2920, 1948, 2802, 1944, 492, 2039, 467, 2798, - /* 930 */ 2709, 2010, 2011, 2748, 179, 208, 2629, 119, 2711, 848, - /* 940 */ 2713, 2714, 843, 72, 863, 2394, 71, 742, 1979, 2920, - /* 950 */ 1979, 2802, 1945, 40, 39, 467, 2798, 46, 44, 43, - /* 960 */ 42, 41, 900, 172, 171, 897, 896, 895, 169, 2710, - /* 970 */ 1981, 1991, 2691, 2693, 468, 2378, 1889, 2205, 29, 1593, - /* 980 */ 2009, 2012, 845, 863, 769, 2096, 1888, 859, 2389, 2364, - /* 990 */ 758, 859, 2389, 859, 2389, 1921, 1950, 1919, 2900, 900, - /* 1000 */ 172, 171, 897, 896, 895, 169, 212, 561, 481, 480, - /* 1010 */ 2728, 575, 1982, 576, 34, 2184, 2906, 217, 484, 483, - /* 1020 */ 2174, 2901, 793, 1595, 2044, 2596, 2675, 372, 844, 744, - /* 1030 */ 2582, 1924, 1925, 1978, 2675, 1980, 1983, 1984, 1985, 1986, - /* 1040 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, - /* 1050 */ 2006, 2007, 2, 47, 45, 2710, 2443, 2444, 2204, 1588, - /* 1060 */ 2144, 471, 902, 1920, 1505, 1506, 156, 1950, 845, 2773, - /* 1070 */ 2893, 2904, 859, 2389, 2709, 1979, 2008, 2748, 1918, 2261, - /* 1080 */ 290, 119, 2711, 848, 2713, 2714, 843, 291, 863, 859, - /* 1090 */ 2389, 2710, 577, 2920, 320, 2802, 2728, 14, 13, 467, - /* 1100 */ 2798, 709, 502, 1589, 845, 2203, 2834, 501, 2003, 663, - /* 1110 */ 859, 2389, 2675, 1605, 844, 2675, 708, 707, 706, 859, - /* 1120 */ 2389, 1982, 1926, 698, 152, 702, 329, 330, 1604, 701, - /* 1130 */ 2386, 328, 2728, 2817, 700, 705, 448, 447, 2173, 292, - /* 1140 */ 699, 859, 2389, 2202, 446, 695, 694, 693, 2675, 2199, - /* 1150 */ 844, 786, 963, 859, 2389, 48, 758, 2201, 735, 2812, - /* 1160 */ 2709, 300, 2675, 2748, 2900, 1847, 1848, 119, 2711, 848, - /* 1170 */ 2713, 2714, 843, 810, 863, 859, 2389, 859, 2389, 2920, - /* 1180 */ 2200, 2802, 2906, 217, 1979, 467, 2798, 2901, 793, 859, - /* 1190 */ 2389, 2010, 2011, 859, 2389, 333, 2709, 824, 102, 2748, - /* 1200 */ 2675, 1609, 611, 119, 2711, 848, 2713, 2714, 843, 340, - /* 1210 */ 863, 2051, 758, 856, 2675, 2920, 1608, 2802, 2197, 2085, - /* 1220 */ 2900, 467, 2798, 421, 420, 859, 2389, 859, 2389, 2710, - /* 1230 */ 1981, 1991, 1821, 477, 859, 2389, 211, 2675, 2906, 217, - /* 1240 */ 2009, 2012, 845, 2901, 793, 857, 2008, 368, 486, 2376, - /* 1250 */ 683, 682, 685, 684, 493, 1921, 2615, 1919, 111, 2196, - /* 1260 */ 2449, 2195, 2194, 2193, 704, 703, 2449, 2192, 2191, 2190, - /* 1270 */ 2728, 2189, 930, 928, 170, 2675, 2710, 537, 2003, 811, - /* 1280 */ 2095, 2324, 536, 179, 2382, 819, 2675, 2619, 844, 845, - /* 1290 */ 613, 1924, 1925, 1978, 2395, 1980, 1983, 1984, 1985, 1986, - /* 1300 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, - /* 1310 */ 2006, 2007, 2, 47, 45, 78, 2675, 2728, 2675, 2675, - /* 1320 */ 2675, 471, 2495, 1920, 2675, 2675, 2675, 894, 2675, 796, - /* 1330 */ 2440, 758, 2449, 2675, 2709, 844, 2008, 2748, 1918, 2900, - /* 1340 */ 509, 119, 2711, 848, 2713, 2714, 843, 384, 863, 743, - /* 1350 */ 2426, 2448, 2366, 2775, 2259, 2802, 54, 2906, 217, 467, - /* 1360 */ 2798, 898, 2901, 793, 2440, 551, 40, 39, 2003, 89, - /* 1370 */ 46, 44, 43, 42, 41, 899, 711, 808, 2440, 2214, - /* 1380 */ 958, 2709, 1926, 277, 2748, 161, 275, 795, 119, 2711, - /* 1390 */ 848, 2713, 2714, 843, 279, 863, 281, 278, 283, 280, - /* 1400 */ 829, 282, 2802, 758, 696, 162, 467, 2798, 697, 799, - /* 1410 */ 35, 2900, 963, 2710, 2250, 15, 40, 39, 2248, 376, - /* 1420 */ 46, 44, 43, 42, 41, 1911, 845, 1887, 1586, 2906, - /* 1430 */ 217, 758, 1584, 301, 2901, 793, 713, 162, 765, 2900, - /* 1440 */ 716, 732, 49, 731, 2176, 2177, 14, 13, 833, 49, - /* 1450 */ 2696, 2010, 2011, 297, 2728, 200, 170, 2906, 217, 479, - /* 1460 */ 478, 1912, 2901, 793, 327, 77, 64, 49, 49, 383, - /* 1470 */ 2675, 2393, 844, 2115, 1929, 861, 860, 2002, 2004, 2005, - /* 1480 */ 2006, 2007, 103, 347, 346, 349, 348, 1837, 351, 350, - /* 1490 */ 1981, 1991, 77, 167, 170, 353, 352, 190, 207, 316, - /* 1500 */ 2009, 2012, 2274, 355, 354, 357, 356, 359, 358, 361, - /* 1510 */ 360, 363, 362, 2863, 2698, 1921, 775, 1919, 2709, 1845, - /* 1520 */ 2119, 2748, 365, 364, 2129, 120, 2711, 848, 2713, 2714, - /* 1530 */ 843, 2128, 863, 367, 366, 308, 74, 306, 809, 2802, - /* 1540 */ 805, 871, 1928, 2801, 2798, 168, 331, 816, 2045, 1992, - /* 1550 */ 1790, 1924, 1925, 1978, 150, 1980, 1983, 1984, 1985, 1986, - /* 1560 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, - /* 1570 */ 2006, 2007, 2, 170, 1780, 343, 1636, 149, 936, 935, - /* 1580 */ 934, 933, 499, 167, 932, 931, 160, 926, 925, 924, - /* 1590 */ 923, 922, 921, 920, 159, 914, 913, 912, 498, 497, - /* 1600 */ 909, 908, 907, 196, 195, 906, 494, 905, 904, 903, - /* 1610 */ 740, 2729, 1566, 910, 911, 2242, 1539, 797, 382, 2316, - /* 1620 */ 116, 2315, 2710, 1667, 2029, 2521, 2231, 1675, 966, 113, - /* 1630 */ 2853, 772, 456, 460, 779, 845, 813, 1558, 1556, 500, - /* 1640 */ 518, 2237, 2522, 2437, 374, 751, 2854, 2864, 787, 788, - /* 1650 */ 318, 2710, 313, 1932, 321, 1682, 1567, 2350, 503, 1680, - /* 1660 */ 1540, 956, 206, 2728, 845, 173, 508, 5, 435, 954, - /* 1670 */ 1943, 952, 948, 944, 940, 517, 371, 1953, 529, 2675, - /* 1680 */ 528, 844, 224, 225, 531, 227, 1814, 375, 1944, 545, - /* 1690 */ 238, 552, 2728, 554, 565, 558, 560, 602, 578, 800, - /* 1700 */ 589, 2514, 598, 591, 601, 603, 614, 612, 2675, 615, - /* 1710 */ 844, 244, 243, 617, 619, 620, 247, 622, 624, 1951, - /* 1720 */ 639, 1931, 118, 4, 647, 344, 640, 2709, 650, 648, - /* 1730 */ 2748, 255, 94, 1946, 120, 2711, 848, 2713, 2714, 843, - /* 1740 */ 2277, 863, 652, 258, 1952, 653, 1954, 261, 2802, 2710, - /* 1750 */ 656, 654, 831, 2798, 263, 1955, 846, 820, 95, 2748, - /* 1760 */ 96, 1956, 842, 120, 2711, 848, 2713, 2714, 843, 2531, - /* 1770 */ 863, 2537, 97, 2710, 665, 686, 270, 2802, 124, 719, - /* 1780 */ 720, 430, 2798, 688, 2379, 274, 845, 409, 734, 2375, - /* 1790 */ 2728, 276, 2605, 736, 175, 100, 378, 2602, 121, 2377, - /* 1800 */ 2372, 176, 342, 1947, 826, 177, 2675, 325, 844, 293, - /* 1810 */ 163, 2583, 324, 746, 2728, 745, 708, 707, 706, 296, - /* 1820 */ 2601, 747, 753, 698, 152, 702, 750, 298, 776, 701, - /* 1830 */ 2675, 294, 844, 2869, 700, 705, 448, 447, 762, 814, - /* 1840 */ 699, 8, 2710, 785, 446, 695, 694, 693, 2841, 2868, - /* 1850 */ 752, 763, 303, 307, 2709, 845, 305, 2748, 761, 2710, - /* 1860 */ 309, 406, 2711, 848, 2713, 2714, 843, 841, 863, 827, - /* 1870 */ 2767, 760, 845, 790, 311, 189, 310, 312, 2709, 789, - /* 1880 */ 461, 2748, 2923, 2728, 314, 184, 2711, 848, 2713, 2714, - /* 1890 */ 843, 801, 863, 2899, 798, 1948, 317, 154, 2818, 2675, - /* 1900 */ 2728, 844, 2093, 812, 2091, 2821, 323, 203, 272, 379, - /* 1910 */ 164, 380, 2551, 817, 2550, 2549, 2675, 1, 844, 219, - /* 1920 */ 818, 465, 165, 822, 61, 336, 191, 852, 2783, 850, - /* 1930 */ 341, 825, 759, 2860, 854, 681, 677, 673, 669, 2710, - /* 1940 */ 271, 381, 110, 855, 2390, 112, 1458, 2709, 865, 957, - /* 1950 */ 2748, 2667, 845, 2666, 187, 2711, 848, 2713, 2714, 843, - /* 1960 */ 370, 863, 960, 962, 2709, 2662, 2661, 2748, 385, 174, - /* 1970 */ 2627, 120, 2711, 848, 2713, 2714, 843, 410, 863, 2653, - /* 1980 */ 2728, 389, 2652, 2644, 2643, 2802, 99, 52, 2626, 269, - /* 1990 */ 2799, 2659, 387, 2658, 2650, 2649, 2675, 2638, 844, 2637, - /* 2000 */ 2656, 2655, 2647, 2646, 2635, 2634, 397, 427, 2632, 2631, - /* 2010 */ 2441, 419, 422, 794, 2921, 2625, 2620, 408, 738, 398, - /* 2020 */ 83, 505, 506, 1871, 1872, 510, 222, 2618, 512, 513, - /* 2030 */ 514, 1870, 2710, 436, 2614, 520, 2613, 522, 2612, 524, - /* 2040 */ 428, 2617, 2616, 2611, 2709, 845, 526, 2748, 1858, 2587, - /* 2050 */ 226, 184, 2711, 848, 2713, 2714, 843, 257, 863, 2586, - /* 2060 */ 228, 1817, 84, 1816, 2564, 2563, 268, 538, 539, 2561, - /* 2070 */ 259, 266, 2562, 2728, 2560, 2504, 264, 655, 543, 1753, - /* 2080 */ 2501, 546, 2500, 2494, 549, 550, 2491, 231, 2490, 2675, - /* 2090 */ 2489, 844, 87, 2488, 2493, 256, 235, 566, 233, 2861, - /* 2100 */ 2492, 2487, 2486, 2484, 2483, 2482, 2481, 568, 2479, 2478, - /* 2110 */ 2477, 2710, 2476, 2475, 458, 2499, 2474, 2473, 2472, 2497, - /* 2120 */ 2480, 2471, 2470, 2469, 845, 2467, 2466, 2465, 2464, 2463, - /* 2130 */ 2710, 2462, 2461, 93, 237, 2460, 2459, 2709, 2458, 2457, - /* 2140 */ 2748, 2529, 2498, 845, 407, 2711, 848, 2713, 2714, 843, - /* 2150 */ 2496, 863, 2728, 2456, 2710, 2455, 1759, 2454, 242, 2453, - /* 2160 */ 605, 2452, 2451, 607, 2450, 1606, 1610, 845, 2675, 2281, - /* 2170 */ 844, 2728, 2280, 2279, 245, 424, 2278, 1602, 246, 2276, - /* 2180 */ 2273, 425, 625, 2272, 2265, 2252, 629, 2675, 2226, 844, - /* 2190 */ 627, 633, 251, 459, 631, 2728, 1483, 2225, 2585, 2710, - /* 2200 */ 248, 626, 637, 635, 249, 630, 80, 198, 2695, 634, - /* 2210 */ 253, 2675, 842, 844, 81, 2581, 2709, 209, 645, 2748, - /* 2220 */ 2571, 2559, 2558, 407, 2711, 848, 2713, 2714, 843, 260, - /* 2230 */ 863, 262, 2535, 2528, 2367, 2709, 2275, 265, 2748, 267, - /* 2240 */ 2728, 2271, 400, 2711, 848, 2713, 2714, 843, 666, 863, - /* 2250 */ 1532, 2710, 667, 668, 2269, 670, 2675, 671, 844, 2709, - /* 2260 */ 672, 2267, 2748, 674, 845, 675, 187, 2711, 848, 2713, - /* 2270 */ 2714, 843, 2264, 863, 676, 678, 679, 2247, 680, 2245, - /* 2280 */ 2246, 2244, 2222, 2369, 1687, 1686, 2368, 1592, 1591, 2710, - /* 2290 */ 273, 2262, 2728, 784, 1590, 1587, 1574, 1585, 2260, 73, - /* 2300 */ 927, 1583, 845, 1582, 2709, 1581, 1580, 2748, 2675, 929, - /* 2310 */ 844, 406, 2711, 848, 2713, 2714, 843, 449, 863, 2710, - /* 2320 */ 2768, 1579, 1576, 450, 1575, 1573, 2922, 2251, 451, 2249, - /* 2330 */ 2728, 452, 845, 470, 717, 2221, 2710, 2220, 2219, 721, - /* 2340 */ 2218, 723, 2217, 2216, 714, 725, 2675, 727, 844, 845, - /* 2350 */ 126, 1852, 1854, 1851, 1856, 2584, 2709, 28, 67, 2748, - /* 2360 */ 2728, 2580, 295, 407, 2711, 848, 2713, 2714, 843, 56, - /* 2370 */ 863, 472, 1825, 1823, 2570, 748, 2675, 2728, 844, 2557, - /* 2380 */ 2556, 2905, 20, 57, 30, 302, 749, 1802, 2146, 764, - /* 2390 */ 2120, 1801, 766, 2675, 2709, 844, 457, 2748, 299, 17, - /* 2400 */ 770, 407, 2711, 848, 2713, 2714, 843, 737, 863, 754, - /* 2410 */ 756, 178, 768, 2710, 1827, 6, 7, 21, 1842, 22, - /* 2420 */ 304, 202, 2127, 214, 733, 2114, 845, 2748, 32, 2086, - /* 2430 */ 215, 402, 2711, 848, 2713, 2714, 843, 188, 863, 2696, - /* 2440 */ 201, 2709, 31, 2088, 2748, 82, 216, 2710, 392, 2711, - /* 2450 */ 848, 2713, 2714, 843, 2728, 863, 2084, 65, 24, 2166, - /* 2460 */ 845, 2167, 319, 2161, 2160, 462, 2165, 2164, 463, 2068, - /* 2470 */ 2675, 2067, 844, 59, 193, 2555, 2710, 2534, 105, 2533, - /* 2480 */ 104, 106, 326, 2122, 204, 332, 815, 2527, 2728, 845, - /* 2490 */ 69, 334, 58, 823, 107, 25, 821, 335, 11, 2020, - /* 2500 */ 13, 847, 2019, 1936, 2675, 23, 844, 18, 1995, 194, - /* 2510 */ 337, 1994, 2030, 878, 881, 884, 887, 2728, 2709, 38, - /* 2520 */ 205, 2748, 1993, 16, 26, 391, 2711, 848, 2713, 2714, - /* 2530 */ 843, 1963, 863, 2675, 1971, 844, 27, 70, 2526, 853, - /* 2540 */ 108, 113, 345, 864, 2182, 2181, 2180, 851, 339, 2179, - /* 2550 */ 109, 2753, 2709, 2752, 870, 2748, 1997, 862, 68, 393, - /* 2560 */ 2711, 848, 2713, 2714, 843, 1668, 863, 488, 1665, 872, - /* 2570 */ 2710, 875, 874, 1664, 877, 1661, 880, 883, 1655, 1653, - /* 2580 */ 886, 2709, 1659, 845, 2748, 369, 114, 1658, 399, 2711, - /* 2590 */ 848, 2713, 2714, 843, 2710, 863, 1657, 115, 1681, 79, - /* 2600 */ 1656, 1677, 1530, 901, 1570, 1569, 1568, 845, 1565, 2710, - /* 2610 */ 1562, 2728, 1561, 1560, 1559, 1557, 915, 1555, 1554, 917, - /* 2620 */ 1553, 220, 845, 1600, 1551, 1599, 1550, 2675, 1549, 844, - /* 2630 */ 1548, 1547, 1596, 1546, 1545, 2728, 1594, 1542, 1541, 2710, - /* 2640 */ 1538, 1537, 1536, 1535, 2270, 938, 937, 2268, 939, 941, - /* 2650 */ 2728, 2675, 845, 844, 943, 942, 2266, 947, 945, 2263, - /* 2660 */ 946, 949, 951, 950, 2243, 2241, 2675, 953, 844, 1472, - /* 2670 */ 955, 2215, 1459, 959, 373, 2709, 961, 2185, 2748, 1922, - /* 2680 */ 2728, 964, 403, 2711, 848, 2713, 2714, 843, 386, 863, - /* 2690 */ 965, 2710, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2709, - /* 2700 */ 2185, 2185, 2748, 2185, 845, 2185, 394, 2711, 848, 2713, - /* 2710 */ 2714, 843, 2185, 863, 2709, 2185, 2185, 2748, 2185, 2185, - /* 2720 */ 2185, 404, 2711, 848, 2713, 2714, 843, 2710, 863, 2185, - /* 2730 */ 2185, 2185, 2728, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 2740 */ 845, 2185, 2185, 2185, 2709, 2185, 2185, 2748, 2675, 2185, - /* 2750 */ 844, 395, 2711, 848, 2713, 2714, 843, 2710, 863, 2185, - /* 2760 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2728, 2185, - /* 2770 */ 845, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185, - /* 2780 */ 2185, 2185, 2185, 2185, 2675, 2185, 844, 845, 2185, 2185, - /* 2790 */ 2185, 2185, 2185, 2185, 2185, 2185, 2709, 2185, 2728, 2748, - /* 2800 */ 2185, 2185, 2185, 405, 2711, 848, 2713, 2714, 843, 2185, - /* 2810 */ 863, 2185, 2185, 2185, 2675, 2728, 844, 2185, 2185, 2185, - /* 2820 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 2830 */ 2185, 2675, 2709, 844, 2185, 2748, 2185, 2185, 2185, 396, - /* 2840 */ 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185, 2185, - /* 2850 */ 2185, 2710, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 2860 */ 2185, 2185, 2709, 2185, 845, 2748, 2185, 2185, 2185, 412, - /* 2870 */ 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185, 2709, - /* 2880 */ 2185, 2185, 2748, 2185, 2185, 2710, 413, 2711, 848, 2713, - /* 2890 */ 2714, 843, 2728, 863, 2185, 2185, 2185, 2185, 845, 2185, - /* 2900 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2675, 2185, - /* 2910 */ 844, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185, - /* 2920 */ 2185, 2185, 2185, 2185, 2185, 2185, 2728, 845, 2185, 2185, - /* 2930 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 2940 */ 2185, 2185, 2675, 2185, 844, 2185, 2185, 2185, 2185, 2185, - /* 2950 */ 2185, 2185, 2185, 2185, 2185, 2728, 2709, 2185, 2185, 2748, - /* 2960 */ 2185, 2185, 2185, 2722, 2711, 848, 2713, 2714, 843, 2185, - /* 2970 */ 863, 2675, 2185, 844, 2185, 2710, 2185, 2185, 2185, 2185, - /* 2980 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 845, 2185, - /* 2990 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 2721, 2711, 848, - /* 3000 */ 2713, 2714, 843, 2185, 863, 2185, 2185, 2185, 2710, 2185, - /* 3010 */ 2185, 2185, 2185, 2185, 2185, 2185, 2728, 2185, 2185, 2709, - /* 3020 */ 2185, 845, 2748, 2185, 2185, 2185, 2720, 2711, 848, 2713, - /* 3030 */ 2714, 843, 2675, 863, 844, 2185, 2185, 2185, 2185, 2185, - /* 3040 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2728, - /* 3050 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3060 */ 2185, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2185, 2185, - /* 3070 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3080 */ 2709, 2185, 2185, 2748, 2185, 2710, 2185, 432, 2711, 848, - /* 3090 */ 2713, 2714, 843, 2185, 863, 2185, 2185, 2185, 845, 2185, - /* 3100 */ 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3110 */ 2185, 2185, 2185, 2709, 2185, 845, 2748, 2185, 2185, 2185, - /* 3120 */ 433, 2711, 848, 2713, 2714, 843, 2728, 863, 2710, 2185, - /* 3130 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3140 */ 2185, 845, 2675, 2728, 844, 2185, 2185, 2185, 2185, 2185, - /* 3150 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2675, - /* 3160 */ 2185, 844, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2728, - /* 3170 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 845, 2185, - /* 3180 */ 2185, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2185, 2185, - /* 3190 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 429, 2711, 848, - /* 3200 */ 2713, 2714, 843, 2185, 863, 2185, 2728, 2709, 2185, 2185, - /* 3210 */ 2748, 2185, 2185, 2185, 434, 2711, 848, 2713, 2714, 843, - /* 3220 */ 2185, 863, 2675, 2185, 844, 2185, 2185, 2185, 2185, 2185, - /* 3230 */ 2185, 2185, 2185, 846, 2185, 2185, 2748, 2185, 2185, 2185, - /* 3240 */ 402, 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185, - /* 3250 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3260 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, - /* 3270 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 401, 2711, 848, - /* 3280 */ 2713, 2714, 843, 2185, 863, + /* 0 */ 644, 2409, 652, 645, 2246, 645, 2246, 494, 37, 338, + /* 10 */ 2458, 2460, 47, 45, 2111, 2394, 2685, 862, 2405, 490, + /* 20 */ 474, 2199, 1932, 40, 39, 2645, 861, 46, 44, 43, + /* 30 */ 42, 41, 2632, 795, 862, 2405, 1930, 146, 2020, 2290, + /* 40 */ 1957, 2917, 136, 2727, 690, 135, 134, 133, 132, 131, + /* 50 */ 130, 129, 128, 127, 221, 807, 155, 9, 810, 794, + /* 60 */ 217, 807, 155, 741, 2918, 796, 40, 39, 2015, 2465, + /* 70 */ 46, 44, 43, 42, 41, 19, 2922, 439, 1961, 761, + /* 80 */ 479, 182, 1938, 111, 2917, 861, 2745, 2917, 2463, 2339, + /* 90 */ 136, 866, 2560, 135, 134, 133, 132, 131, 130, 129, + /* 100 */ 128, 127, 2692, 2921, 847, 2923, 217, 2918, 2920, 2398, + /* 110 */ 2918, 796, 968, 2558, 852, 15, 939, 938, 937, 936, + /* 120 */ 502, 50, 935, 934, 160, 929, 928, 927, 926, 925, + /* 130 */ 924, 923, 159, 917, 916, 915, 501, 500, 912, 911, + /* 140 */ 910, 196, 195, 909, 497, 908, 907, 906, 2389, 420, + /* 150 */ 2726, 2022, 2023, 2765, 661, 2485, 2136, 119, 2728, 851, + /* 160 */ 2730, 2731, 846, 190, 866, 315, 795, 2086, 197, 199, + /* 170 */ 2137, 2819, 98, 2396, 2917, 470, 2815, 192, 2827, 806, + /* 180 */ 50, 147, 805, 125, 2827, 2828, 210, 153, 2832, 2917, + /* 190 */ 1993, 2003, 794, 217, 441, 218, 2533, 2918, 796, 2401, + /* 200 */ 2021, 2024, 2452, 2866, 807, 155, 98, 794, 217, 66, + /* 210 */ 1778, 1779, 2918, 796, 2198, 1933, 2135, 1931, 662, 2553, + /* 220 */ 1957, 2834, 2186, 444, 40, 39, 556, 2529, 46, 44, + /* 230 */ 43, 42, 41, 2400, 2727, 861, 547, 479, 145, 144, + /* 240 */ 143, 142, 141, 140, 139, 138, 137, 2831, 866, 848, + /* 250 */ 213, 1936, 1937, 1990, 2086, 1992, 1995, 1996, 1997, 1998, + /* 260 */ 1999, 2000, 2001, 2002, 843, 864, 863, 2014, 2016, 2017, + /* 270 */ 2018, 2019, 2, 47, 45, 207, 649, 2745, 417, 232, + /* 280 */ 1955, 474, 646, 1932, 540, 609, 607, 591, 413, 539, + /* 290 */ 443, 433, 230, 2692, 1513, 847, 1512, 1930, 611, 2020, + /* 300 */ 2839, 2083, 2084, 2085, 2839, 2839, 2839, 2839, 2839, 586, + /* 310 */ 151, 1962, 2196, 1958, 570, 183, 613, 2210, 2144, 197, + /* 320 */ 62, 418, 572, 62, 585, 809, 185, 2827, 2828, 2015, + /* 330 */ 153, 2832, 1514, 550, 485, 1957, 19, 2465, 761, 2049, + /* 340 */ 2185, 2726, 117, 1938, 2765, 467, 2917, 2534, 119, 2728, + /* 350 */ 851, 2730, 2731, 846, 744, 866, 2463, 1958, 157, 158, + /* 360 */ 166, 2790, 2819, 322, 2923, 217, 470, 2815, 2397, 2918, + /* 370 */ 796, 289, 1960, 968, 442, 288, 15, 777, 776, 2142, + /* 380 */ 2143, 2145, 2146, 2147, 745, 558, 2380, 2839, 2083, 2084, + /* 390 */ 2085, 2839, 2839, 2839, 2839, 2839, 2088, 2089, 2090, 2091, + /* 400 */ 2092, 505, 660, 40, 39, 2050, 504, 46, 44, 43, + /* 410 */ 42, 41, 2022, 2023, 2502, 1932, 2540, 2519, 2086, 599, + /* 420 */ 598, 597, 596, 595, 590, 589, 588, 587, 425, 1930, + /* 430 */ 62, 577, 576, 575, 574, 573, 567, 566, 565, 663, + /* 440 */ 560, 559, 440, 785, 1704, 1705, 551, 1766, 1767, 101, + /* 450 */ 51, 1993, 2003, 1785, 428, 761, 760, 456, 33, 733, + /* 460 */ 905, 2021, 2024, 2917, 40, 39, 654, 2599, 46, 44, + /* 470 */ 43, 42, 41, 838, 667, 1938, 1933, 2922, 1931, 448, + /* 480 */ 447, 2923, 217, 780, 837, 2917, 2918, 796, 1805, 1806, + /* 490 */ 862, 2405, 36, 472, 2044, 2045, 2046, 2047, 2048, 2052, + /* 500 */ 2053, 2054, 2055, 322, 2921, 968, 322, 2921, 2918, 2919, + /* 510 */ 55, 2155, 1936, 1937, 1990, 1901, 1992, 1995, 1996, 1997, + /* 520 */ 1998, 1999, 2000, 2001, 2002, 843, 864, 863, 2014, 2016, + /* 530 */ 2017, 2018, 2019, 2, 12, 47, 45, 1804, 1807, 1604, + /* 540 */ 2727, 122, 2108, 474, 320, 1932, 180, 484, 483, 1665, + /* 550 */ 492, 2407, 2083, 2084, 2085, 810, 2408, 446, 445, 1930, + /* 560 */ 692, 2020, 2465, 1656, 895, 894, 893, 1660, 892, 1662, + /* 570 */ 1663, 891, 888, 2727, 1671, 885, 1673, 1674, 882, 879, + /* 580 */ 876, 814, 694, 2745, 584, 1606, 693, 488, 848, 583, + /* 590 */ 2256, 2015, 786, 781, 774, 770, 60, 582, 19, 2692, + /* 600 */ 2381, 847, 458, 2607, 12, 1938, 10, 758, 1933, 922, + /* 610 */ 1931, 2379, 2365, 322, 40, 39, 2745, 379, 46, 44, + /* 620 */ 43, 42, 41, 40, 39, 745, 2922, 46, 44, 43, + /* 630 */ 42, 41, 2692, 322, 847, 968, 62, 116, 15, 29, + /* 640 */ 2686, 1961, 1957, 1960, 1936, 1937, 113, 2726, 2560, 831, + /* 650 */ 2765, 2791, 718, 2702, 119, 2728, 851, 2730, 2731, 846, + /* 660 */ 603, 866, 2221, 469, 905, 2115, 199, 732, 2819, 2557, + /* 670 */ 852, 1957, 470, 2815, 2022, 2023, 1990, 731, 252, 2608, + /* 680 */ 2726, 2706, 647, 2765, 2254, 742, 287, 119, 2728, 851, + /* 690 */ 2730, 2731, 846, 725, 866, 729, 727, 286, 285, 2937, + /* 700 */ 2867, 2819, 721, 12, 479, 470, 2815, 747, 2599, 715, + /* 710 */ 713, 2727, 519, 1993, 2003, 866, 284, 524, 499, 498, + /* 720 */ 180, 2692, 2156, 2021, 2024, 2834, 848, 241, 2874, 492, + /* 730 */ 2407, 2127, 2708, 2710, 471, 538, 223, 537, 1933, 2179, + /* 740 */ 1931, 379, 1939, 866, 903, 172, 171, 900, 899, 898, + /* 750 */ 169, 2830, 602, 240, 2745, 903, 172, 171, 900, 899, + /* 760 */ 898, 169, 72, 2459, 2460, 71, 600, 254, 1900, 536, + /* 770 */ 2692, 647, 847, 2254, 1936, 1937, 1990, 2702, 1992, 1995, + /* 780 */ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 843, 864, 863, + /* 790 */ 2014, 2016, 2017, 2018, 2019, 2, 47, 45, 2025, 2727, + /* 800 */ 487, 486, 457, 2607, 474, 2706, 1932, 46, 44, 43, + /* 810 */ 42, 41, 1994, 208, 848, 320, 2887, 2646, 2726, 322, + /* 820 */ 1930, 2765, 2020, 784, 798, 119, 2728, 851, 2730, 2731, + /* 830 */ 846, 1961, 866, 2727, 664, 1516, 1517, 2937, 2107, 2819, + /* 840 */ 2560, 1994, 2745, 470, 2815, 862, 2405, 872, 848, 1938, + /* 850 */ 772, 2745, 2015, 2220, 528, 476, 2708, 2711, 2692, 236, + /* 860 */ 847, 2557, 852, 499, 498, 146, 1938, 866, 833, 641, + /* 870 */ 2791, 761, 695, 1946, 1962, 1991, 2745, 896, 639, 2917, + /* 880 */ 2219, 635, 631, 530, 526, 2392, 2051, 1939, 2465, 2020, + /* 890 */ 862, 2405, 2692, 2547, 847, 665, 968, 2923, 217, 48, + /* 900 */ 562, 2529, 2918, 796, 1991, 92, 2726, 822, 91, 2765, + /* 910 */ 544, 1486, 2692, 119, 2728, 851, 2730, 2731, 846, 2015, + /* 920 */ 866, 862, 2405, 1942, 783, 2937, 738, 2819, 593, 2529, + /* 930 */ 1493, 470, 2815, 1938, 156, 2022, 2023, 2790, 746, 2692, + /* 940 */ 2726, 545, 1493, 2765, 862, 2405, 2218, 119, 2728, 851, + /* 950 */ 2730, 2731, 846, 234, 866, 1488, 1491, 1492, 2217, 2937, + /* 960 */ 2834, 2819, 2216, 835, 564, 470, 2815, 1961, 1491, 1492, + /* 970 */ 862, 2405, 2727, 34, 1993, 2003, 90, 290, 862, 2405, + /* 980 */ 761, 239, 2277, 2056, 2021, 2024, 2829, 848, 2917, 2910, + /* 990 */ 578, 372, 761, 862, 2405, 871, 870, 869, 579, 1933, + /* 1000 */ 2917, 1931, 2030, 212, 712, 2692, 2923, 217, 1957, 862, + /* 1010 */ 2405, 2918, 796, 580, 1495, 2745, 919, 2692, 2923, 217, + /* 1020 */ 1956, 2692, 378, 2918, 796, 807, 155, 329, 330, 666, + /* 1030 */ 2613, 2692, 328, 847, 694, 1936, 1937, 1990, 693, 1992, + /* 1040 */ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 843, 864, + /* 1050 */ 863, 2014, 2016, 2017, 2018, 2019, 2, 47, 45, 686, + /* 1060 */ 685, 477, 1859, 1860, 1962, 474, 1947, 1932, 1942, 179, + /* 1070 */ 903, 172, 171, 900, 899, 898, 169, 862, 2405, 2726, + /* 1080 */ 2410, 1930, 2765, 2020, 2293, 921, 119, 2728, 851, 2730, + /* 1090 */ 2731, 846, 291, 866, 297, 2727, 2215, 2402, 2937, 385, + /* 1100 */ 2819, 3, 1950, 1952, 470, 2815, 862, 2405, 688, 687, + /* 1110 */ 848, 2409, 2851, 2015, 1665, 53, 864, 863, 2014, 2016, + /* 1120 */ 2017, 2018, 2019, 170, 2214, 102, 292, 1938, 1656, 895, + /* 1130 */ 894, 893, 1660, 892, 1662, 1663, 842, 841, 2745, 1671, + /* 1140 */ 840, 1673, 1674, 839, 879, 876, 789, 186, 2827, 2828, + /* 1150 */ 386, 153, 2832, 2442, 2692, 2692, 847, 968, 2727, 1833, + /* 1160 */ 48, 711, 710, 709, 862, 2405, 862, 2405, 701, 152, + /* 1170 */ 705, 707, 706, 848, 704, 862, 2405, 1957, 1994, 703, + /* 1180 */ 708, 451, 450, 2692, 300, 702, 813, 862, 2405, 449, + /* 1190 */ 698, 697, 696, 2226, 961, 333, 2022, 2023, 862, 2405, + /* 1200 */ 1962, 2745, 2726, 933, 931, 2765, 54, 827, 2213, 119, + /* 1210 */ 2728, 851, 2730, 2731, 846, 2097, 866, 2692, 340, 847, + /* 1220 */ 735, 2937, 734, 2819, 2212, 40, 39, 470, 2815, 46, + /* 1230 */ 44, 43, 42, 41, 2465, 1993, 2003, 862, 2405, 862, + /* 1240 */ 2405, 1991, 478, 862, 2405, 2021, 2024, 2465, 14, 13, + /* 1250 */ 495, 862, 2405, 2463, 1513, 493, 1512, 859, 179, 860, + /* 1260 */ 1933, 2209, 1931, 368, 2208, 2726, 2463, 2692, 2765, 2410, + /* 1270 */ 2636, 496, 119, 2728, 851, 2730, 2731, 846, 211, 866, + /* 1280 */ 1616, 1620, 2207, 2692, 2794, 148, 2819, 43, 42, 41, + /* 1290 */ 470, 2815, 1514, 78, 1615, 1619, 1936, 1937, 1990, 88, + /* 1300 */ 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 843, + /* 1310 */ 864, 863, 2014, 2016, 2017, 2018, 2019, 2, 47, 45, + /* 1320 */ 2692, 179, 2727, 2692, 512, 181, 474, 2206, 1932, 2465, + /* 1330 */ 392, 897, 2411, 2205, 2456, 2204, 2203, 848, 2340, 811, + /* 1340 */ 2202, 2692, 1930, 2201, 2020, 35, 2467, 89, 2464, 390, + /* 1350 */ 76, 40, 39, 75, 2727, 46, 44, 43, 42, 41, + /* 1360 */ 2512, 1599, 799, 2063, 419, 2745, 699, 802, 162, 848, + /* 1370 */ 614, 616, 901, 2382, 2015, 2456, 250, 626, 624, 621, + /* 1380 */ 619, 2692, 902, 847, 277, 2456, 2692, 275, 1938, 1597, + /* 1390 */ 423, 422, 2692, 761, 2692, 2692, 170, 2745, 162, 2692, + /* 1400 */ 480, 2917, 2692, 836, 554, 279, 161, 1600, 278, 123, + /* 1410 */ 1991, 700, 768, 2692, 489, 847, 2020, 2211, 968, 2923, + /* 1420 */ 217, 15, 62, 281, 2918, 796, 280, 283, 2258, 2726, + /* 1430 */ 282, 2275, 2765, 2880, 1595, 301, 119, 2728, 851, 2730, + /* 1440 */ 2731, 846, 49, 866, 2266, 2264, 2015, 49, 2792, 1941, + /* 1450 */ 2819, 1849, 200, 714, 470, 2815, 2713, 2022, 2023, 327, + /* 1460 */ 63, 2726, 2188, 2189, 2765, 913, 716, 719, 119, 2728, + /* 1470 */ 851, 2730, 2731, 846, 743, 866, 14, 13, 1940, 812, + /* 1480 */ 832, 1857, 2819, 957, 103, 1577, 470, 2815, 1569, 347, + /* 1490 */ 346, 190, 971, 349, 348, 2131, 1993, 2003, 77, 914, + /* 1500 */ 612, 64, 49, 49, 316, 77, 2021, 2024, 778, 167, + /* 1510 */ 1550, 376, 308, 808, 86, 85, 543, 150, 2746, 229, + /* 1520 */ 2715, 1933, 1567, 1931, 74, 2141, 959, 206, 2332, 170, + /* 1530 */ 2140, 1578, 535, 533, 2331, 306, 955, 951, 947, 943, + /* 1540 */ 874, 371, 331, 351, 350, 416, 353, 352, 522, 168, + /* 1550 */ 170, 518, 514, 510, 507, 536, 1551, 1936, 1937, 1990, + /* 1560 */ 2538, 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + /* 1570 */ 843, 864, 863, 2014, 2016, 2017, 2018, 2019, 2, 2041, + /* 1580 */ 149, 819, 355, 354, 2057, 2004, 1802, 118, 1792, 2247, + /* 1590 */ 344, 2727, 343, 1923, 2870, 1899, 40, 39, 357, 356, + /* 1600 */ 46, 44, 43, 42, 41, 322, 848, 384, 359, 358, + /* 1610 */ 361, 360, 1647, 363, 362, 365, 364, 367, 366, 775, + /* 1620 */ 167, 463, 823, 1678, 782, 459, 816, 482, 481, 1924, + /* 1630 */ 1944, 503, 1686, 1693, 2745, 521, 2539, 2253, 2453, 754, + /* 1640 */ 2871, 2881, 790, 864, 863, 2014, 2016, 2017, 2018, 2019, + /* 1650 */ 2692, 800, 847, 791, 318, 313, 2727, 321, 803, 1943, + /* 1660 */ 2366, 506, 5, 1691, 511, 437, 1955, 342, 1965, 829, + /* 1670 */ 532, 848, 325, 520, 224, 531, 225, 324, 227, 534, + /* 1680 */ 1826, 377, 1956, 548, 238, 2727, 555, 557, 561, 563, + /* 1690 */ 605, 568, 581, 594, 592, 2531, 294, 601, 2726, 2745, + /* 1700 */ 848, 2765, 604, 173, 617, 120, 2728, 851, 2730, 2731, + /* 1710 */ 846, 606, 866, 615, 244, 2692, 618, 847, 620, 2819, + /* 1720 */ 243, 622, 623, 2818, 2815, 247, 2727, 625, 2745, 1963, + /* 1730 */ 711, 710, 709, 627, 4, 642, 643, 701, 152, 705, + /* 1740 */ 650, 845, 651, 704, 2692, 255, 847, 653, 703, 708, + /* 1750 */ 451, 450, 94, 258, 702, 1958, 655, 1964, 449, 698, + /* 1760 */ 697, 696, 1966, 2726, 657, 2727, 2765, 656, 261, 2745, + /* 1770 */ 120, 2728, 851, 2730, 2731, 846, 263, 866, 659, 1967, + /* 1780 */ 848, 2554, 1968, 668, 2819, 2692, 95, 847, 834, 2815, + /* 1790 */ 2548, 96, 849, 97, 270, 2765, 2727, 124, 689, 120, + /* 1800 */ 2728, 851, 2730, 2731, 846, 722, 866, 691, 2745, 2395, + /* 1810 */ 274, 848, 411, 2819, 723, 2391, 276, 432, 2815, 175, + /* 1820 */ 121, 2393, 739, 2388, 2692, 176, 847, 177, 737, 100, + /* 1830 */ 1959, 293, 163, 2726, 2622, 380, 2765, 2600, 749, 2745, + /* 1840 */ 408, 2728, 851, 2730, 2731, 846, 844, 866, 830, 2784, + /* 1850 */ 750, 2619, 2618, 748, 756, 2692, 298, 847, 753, 779, + /* 1860 */ 765, 2886, 817, 2885, 788, 303, 8, 2858, 296, 305, + /* 1870 */ 307, 766, 2726, 309, 755, 2765, 764, 189, 2727, 184, + /* 1880 */ 2728, 851, 2730, 2731, 846, 763, 866, 793, 314, 310, + /* 1890 */ 312, 311, 464, 848, 804, 2838, 792, 801, 154, 2940, + /* 1900 */ 1960, 2835, 2105, 2726, 815, 317, 2765, 1, 2103, 2916, + /* 1910 */ 187, 2728, 851, 2730, 2731, 846, 203, 866, 2727, 381, + /* 1920 */ 323, 2745, 272, 164, 2568, 2567, 762, 2877, 2566, 468, + /* 1930 */ 219, 165, 382, 848, 820, 825, 821, 2692, 191, 847, + /* 1940 */ 336, 828, 61, 2727, 2800, 855, 853, 684, 680, 676, + /* 1950 */ 672, 2684, 271, 857, 858, 341, 383, 110, 848, 2406, + /* 1960 */ 2683, 2745, 2679, 2678, 2670, 2669, 2661, 2660, 2676, 797, + /* 1970 */ 2938, 112, 2675, 2667, 868, 2666, 387, 2692, 1465, 847, + /* 1980 */ 2655, 2654, 2673, 2672, 2664, 2726, 2745, 370, 2765, 963, + /* 1990 */ 964, 2663, 120, 2728, 851, 2730, 2731, 846, 99, 866, + /* 2000 */ 2652, 269, 2692, 965, 847, 2651, 2819, 2649, 2648, 2727, + /* 2010 */ 174, 2816, 2457, 373, 960, 421, 374, 967, 429, 52, + /* 2020 */ 424, 430, 399, 391, 848, 2726, 741, 461, 2765, 2644, + /* 2030 */ 410, 2727, 184, 2728, 851, 2730, 2731, 846, 400, 866, + /* 2040 */ 2643, 412, 389, 2642, 83, 2637, 848, 508, 509, 1883, + /* 2050 */ 2726, 2727, 2745, 2765, 1884, 222, 513, 409, 2728, 851, + /* 2060 */ 2730, 2731, 846, 2635, 866, 517, 848, 515, 2692, 257, + /* 2070 */ 847, 516, 1882, 2634, 2745, 438, 2631, 523, 268, 2633, + /* 2080 */ 2878, 2630, 259, 266, 525, 2629, 527, 2628, 264, 658, + /* 2090 */ 2692, 529, 847, 462, 2745, 1870, 2604, 226, 2603, 228, + /* 2100 */ 2581, 84, 1829, 1828, 2580, 2579, 541, 256, 542, 2578, + /* 2110 */ 2692, 2577, 847, 546, 2727, 2521, 2726, 1765, 2518, 2765, + /* 2120 */ 549, 2517, 2511, 409, 2728, 851, 2730, 2731, 846, 845, + /* 2130 */ 866, 552, 553, 2508, 231, 2507, 2727, 87, 2726, 2506, + /* 2140 */ 2505, 2765, 2510, 233, 2509, 402, 2728, 851, 2730, 2731, + /* 2150 */ 846, 848, 866, 2504, 2503, 2501, 2727, 2745, 2726, 2500, + /* 2160 */ 2499, 2765, 235, 569, 2498, 187, 2728, 851, 2730, 2731, + /* 2170 */ 846, 848, 866, 2692, 571, 847, 2496, 2495, 2494, 2745, + /* 2180 */ 237, 2478, 2477, 2727, 2493, 2492, 2516, 2491, 2490, 2489, + /* 2190 */ 2514, 2497, 2488, 2487, 2486, 2692, 787, 847, 848, 2745, + /* 2200 */ 2484, 2483, 2482, 2481, 2480, 2479, 2476, 2475, 93, 2474, + /* 2210 */ 2546, 2515, 2513, 2473, 2472, 2692, 2471, 847, 1771, 2470, + /* 2220 */ 473, 2726, 242, 608, 2765, 2939, 2745, 2469, 408, 2728, + /* 2230 */ 851, 2730, 2731, 846, 2468, 866, 2466, 2785, 2297, 1617, + /* 2240 */ 475, 610, 2692, 2726, 847, 1621, 2765, 426, 2296, 2295, + /* 2250 */ 409, 2728, 851, 2730, 2731, 846, 1613, 866, 2294, 2292, + /* 2260 */ 427, 2289, 628, 2726, 2727, 2288, 2765, 245, 632, 630, + /* 2270 */ 409, 2728, 851, 2730, 2731, 846, 629, 866, 2281, 848, + /* 2280 */ 636, 634, 633, 246, 637, 638, 248, 2268, 2727, 640, + /* 2290 */ 736, 80, 249, 2765, 2242, 198, 2712, 404, 2728, 851, + /* 2300 */ 2730, 2731, 846, 848, 866, 209, 1494, 2745, 648, 2727, + /* 2310 */ 251, 2241, 253, 81, 2602, 2598, 2588, 2576, 260, 262, + /* 2320 */ 2575, 265, 2552, 2692, 848, 847, 267, 2545, 2383, 2727, + /* 2330 */ 670, 2745, 1543, 2291, 2287, 669, 2285, 671, 673, 674, + /* 2340 */ 675, 2283, 677, 678, 848, 679, 2280, 2692, 681, 847, + /* 2350 */ 2263, 2727, 2745, 683, 682, 2261, 2262, 2260, 2238, 2385, + /* 2360 */ 1698, 273, 73, 2384, 1697, 1603, 848, 1602, 2692, 1585, + /* 2370 */ 847, 2726, 2745, 1601, 2765, 1598, 1596, 930, 394, 2728, + /* 2380 */ 851, 2730, 2731, 846, 1594, 866, 2278, 1593, 2692, 1592, + /* 2390 */ 847, 452, 2276, 2267, 2745, 2726, 1591, 1590, 2765, 932, + /* 2400 */ 1587, 1586, 393, 2728, 851, 2730, 2731, 846, 1584, 866, + /* 2410 */ 2692, 453, 847, 454, 2727, 2265, 2726, 455, 717, 2765, + /* 2420 */ 720, 2237, 2236, 395, 2728, 851, 2730, 2731, 846, 848, + /* 2430 */ 866, 2235, 2234, 724, 2727, 726, 2726, 2233, 728, 2765, + /* 2440 */ 2232, 730, 1864, 401, 2728, 851, 2730, 2731, 846, 848, + /* 2450 */ 866, 1868, 1866, 126, 1863, 2601, 2727, 2745, 2726, 1854, + /* 2460 */ 28, 2765, 740, 56, 67, 405, 2728, 851, 2730, 2731, + /* 2470 */ 846, 848, 866, 2692, 1839, 847, 295, 2745, 2597, 1835, + /* 2480 */ 57, 1837, 2587, 751, 178, 2574, 2573, 752, 299, 1814, + /* 2490 */ 2922, 20, 30, 2692, 2158, 847, 1813, 302, 767, 2745, + /* 2500 */ 757, 17, 460, 2132, 6, 759, 7, 21, 22, 769, + /* 2510 */ 202, 771, 773, 32, 214, 2692, 304, 847, 2713, 2139, + /* 2520 */ 188, 2726, 201, 31, 2765, 2126, 82, 2098, 396, 2728, + /* 2530 */ 851, 2730, 2731, 846, 215, 866, 23, 65, 216, 2727, + /* 2540 */ 2096, 2726, 2100, 2178, 2765, 2179, 24, 2173, 406, 2728, + /* 2550 */ 851, 2730, 2731, 846, 848, 866, 2172, 465, 18, 2177, + /* 2560 */ 2176, 2727, 466, 2726, 2080, 2079, 2765, 319, 58, 59, + /* 2570 */ 397, 2728, 851, 2730, 2731, 846, 848, 866, 2727, 193, + /* 2580 */ 2572, 2551, 2745, 104, 105, 326, 2134, 204, 332, 2550, + /* 2590 */ 106, 2544, 107, 848, 69, 25, 2032, 824, 2692, 818, + /* 2600 */ 847, 13, 2727, 335, 2745, 2031, 11, 826, 337, 334, + /* 2610 */ 1948, 2007, 2006, 881, 884, 887, 194, 848, 2042, 890, + /* 2620 */ 2692, 2745, 847, 38, 205, 2005, 1975, 16, 1983, 26, + /* 2630 */ 850, 2543, 27, 856, 70, 345, 108, 2692, 854, 847, + /* 2640 */ 339, 2194, 109, 2193, 2770, 2745, 2726, 2769, 865, 2765, + /* 2650 */ 2192, 873, 68, 407, 2728, 851, 2730, 2731, 846, 113, + /* 2660 */ 866, 2692, 2191, 847, 867, 2009, 1679, 875, 2726, 491, + /* 2670 */ 1676, 2765, 2727, 877, 878, 398, 2728, 851, 2730, 2731, + /* 2680 */ 846, 880, 866, 1675, 1672, 2726, 883, 848, 2765, 2727, + /* 2690 */ 1666, 886, 414, 2728, 851, 2730, 2731, 846, 1664, 866, + /* 2700 */ 889, 114, 1670, 369, 848, 1669, 1668, 1667, 115, 2726, + /* 2710 */ 1692, 2727, 2765, 79, 1688, 2745, 415, 2728, 851, 2730, + /* 2720 */ 2731, 846, 1541, 866, 904, 1581, 848, 1580, 220, 1579, + /* 2730 */ 1576, 2692, 2745, 847, 1573, 1572, 1571, 1570, 1568, 1611, + /* 2740 */ 1566, 1565, 1564, 918, 1610, 920, 1562, 1561, 2692, 1560, + /* 2750 */ 847, 1559, 2727, 1558, 2745, 1557, 1556, 1607, 1605, 1553, + /* 2760 */ 1552, 1549, 1548, 1547, 1546, 2286, 940, 848, 941, 2284, + /* 2770 */ 2692, 942, 847, 944, 2282, 945, 946, 2727, 948, 2726, + /* 2780 */ 950, 2279, 2765, 952, 954, 949, 2739, 2728, 851, 2730, + /* 2790 */ 2731, 846, 848, 866, 2727, 2745, 2726, 953, 2259, 2765, + /* 2800 */ 956, 2257, 958, 2738, 2728, 851, 2730, 2731, 846, 848, + /* 2810 */ 866, 2692, 1483, 847, 2231, 1466, 962, 375, 2726, 1934, + /* 2820 */ 2745, 2765, 1471, 1473, 966, 2737, 2728, 851, 2730, 2731, + /* 2830 */ 846, 388, 866, 969, 2197, 970, 2692, 2745, 847, 2197, + /* 2840 */ 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, + /* 2850 */ 2197, 2197, 2197, 2692, 2197, 847, 2197, 2727, 2197, 2726, + /* 2860 */ 2197, 2197, 2765, 2197, 2197, 2197, 434, 2728, 851, 2730, + /* 2870 */ 2731, 846, 848, 866, 2197, 2197, 2197, 2197, 2197, 2197, + /* 2880 */ 2197, 2197, 2197, 2197, 2726, 2197, 2197, 2765, 2197, 2197, + /* 2890 */ 2197, 435, 2728, 851, 2730, 2731, 846, 2197, 866, 2727, + /* 2900 */ 2745, 2726, 2197, 2197, 2765, 2197, 2197, 2197, 431, 2728, + /* 2910 */ 851, 2730, 2731, 846, 848, 866, 2692, 2197, 847, 2197, + /* 2920 */ 2197, 2197, 2197, 2727, 2197, 2197, 2197, 2197, 2197, 2197, + /* 2930 */ 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 848, 2197, + /* 2940 */ 2197, 2197, 2745, 2197, 2197, 2197, 2197, 2197, 2197, 2197, + /* 2950 */ 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2692, 2197, + /* 2960 */ 847, 2197, 2197, 2197, 2726, 2197, 2745, 2765, 2197, 2197, + /* 2970 */ 2197, 436, 2728, 851, 2730, 2731, 846, 2197, 866, 2197, + /* 2980 */ 2197, 2197, 2692, 2197, 847, 2197, 2197, 2197, 2197, 2197, + /* 2990 */ 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, + /* 3000 */ 2197, 2197, 2197, 2197, 2197, 2197, 849, 2197, 2197, 2765, + /* 3010 */ 2197, 2197, 2197, 404, 2728, 851, 2730, 2731, 846, 2197, + /* 3020 */ 866, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, 2197, + /* 3030 */ 2726, 2197, 2197, 2765, 2197, 2197, 2197, 403, 2728, 851, + /* 3040 */ 2730, 2731, 846, 2197, 866, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 518, 507, 508, 439, 520, 424, 522, 518, 526, 392, - /* 10 */ 393, 421, 12, 13, 14, 526, 392, 393, 424, 429, - /* 20 */ 20, 427, 22, 0, 460, 461, 544, 545, 392, 380, - /* 30 */ 440, 549, 550, 402, 545, 35, 412, 37, 549, 550, - /* 40 */ 421, 410, 393, 419, 392, 393, 33, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 8, 9, 43, 46, - /* 60 */ 12, 13, 14, 15, 16, 4, 447, 67, 449, 488, - /* 70 */ 421, 8, 9, 393, 74, 12, 13, 14, 15, 16, - /* 80 */ 499, 81, 488, 421, 23, 439, 437, 451, 439, 453, - /* 90 */ 379, 429, 381, 499, 12, 13, 392, 393, 392, 393, - /* 100 */ 454, 421, 440, 421, 22, 4, 460, 461, 47, 48, - /* 110 */ 49, 111, 430, 431, 114, 380, 380, 35, 412, 37, - /* 120 */ 8, 9, 421, 464, 12, 13, 14, 15, 16, 393, - /* 130 */ 513, 514, 515, 516, 485, 518, 519, 488, 20, 392, - /* 140 */ 393, 492, 493, 494, 495, 496, 497, 20, 499, 67, - /* 150 */ 150, 151, 388, 504, 22, 506, 392, 421, 394, 510, - /* 160 */ 511, 392, 393, 81, 482, 483, 514, 515, 516, 37, - /* 170 */ 518, 519, 437, 437, 494, 439, 20, 518, 526, 530, - /* 180 */ 518, 43, 167, 482, 483, 526, 74, 538, 526, 189, - /* 190 */ 190, 387, 445, 111, 390, 391, 544, 545, 20, 199, - /* 200 */ 200, 549, 550, 544, 545, 67, 544, 545, 549, 550, - /* 210 */ 392, 549, 550, 81, 214, 114, 216, 518, 514, 515, - /* 220 */ 516, 485, 518, 519, 488, 526, 401, 194, 492, 493, - /* 230 */ 494, 495, 496, 497, 122, 499, 226, 422, 502, 191, - /* 240 */ 504, 505, 506, 418, 545, 114, 510, 511, 549, 550, - /* 250 */ 250, 251, 252, 428, 254, 255, 256, 257, 258, 259, + /* 0 */ 390, 425, 390, 393, 394, 393, 394, 438, 510, 511, + /* 10 */ 441, 442, 12, 13, 14, 425, 427, 395, 396, 430, + /* 20 */ 20, 0, 22, 8, 9, 467, 20, 12, 13, 14, + /* 30 */ 15, 16, 0, 521, 395, 396, 36, 415, 38, 0, + /* 40 */ 20, 529, 21, 381, 422, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 415, 395, 396, 44, 396, 547, + /* 60 */ 548, 395, 396, 487, 552, 553, 8, 9, 68, 424, + /* 70 */ 12, 13, 14, 15, 16, 75, 521, 432, 20, 521, + /* 80 */ 491, 405, 82, 402, 529, 20, 424, 529, 443, 413, + /* 90 */ 21, 502, 442, 24, 25, 26, 27, 28, 29, 30, + /* 100 */ 31, 32, 440, 548, 442, 547, 548, 552, 553, 428, + /* 110 */ 552, 553, 112, 463, 464, 115, 77, 78, 79, 80, + /* 120 */ 81, 115, 83, 84, 85, 86, 87, 88, 89, 90, + /* 130 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + /* 140 */ 101, 102, 103, 104, 105, 106, 107, 108, 425, 426, + /* 150 */ 488, 151, 152, 491, 395, 0, 22, 495, 496, 497, + /* 160 */ 498, 499, 500, 523, 502, 525, 521, 154, 424, 507, + /* 170 */ 36, 509, 404, 427, 529, 513, 514, 517, 518, 519, + /* 180 */ 115, 521, 522, 517, 518, 519, 423, 521, 522, 529, + /* 190 */ 190, 191, 547, 548, 450, 533, 452, 552, 553, 431, + /* 200 */ 200, 201, 439, 541, 395, 396, 404, 547, 548, 4, + /* 210 */ 190, 191, 552, 553, 0, 215, 82, 217, 459, 460, + /* 220 */ 20, 494, 207, 421, 8, 9, 395, 396, 12, 13, + /* 230 */ 14, 15, 16, 431, 381, 20, 395, 491, 24, 25, + /* 240 */ 26, 27, 28, 29, 30, 31, 32, 520, 502, 396, + /* 250 */ 192, 251, 252, 253, 154, 255, 256, 257, 258, 259, /* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 270 */ 270, 271, 12, 13, 456, 457, 20, 18, 22, 20, - /* 280 */ 20, 20, 22, 514, 515, 516, 27, 518, 519, 30, - /* 290 */ 12, 13, 114, 37, 35, 35, 214, 37, 216, 484, - /* 300 */ 188, 286, 287, 288, 289, 290, 291, 292, 293, 294, - /* 310 */ 14, 2, 53, 57, 55, 37, 20, 8, 9, 60, - /* 320 */ 61, 12, 13, 14, 15, 16, 387, 67, 73, 390, - /* 330 */ 391, 72, 250, 251, 74, 0, 303, 304, 305, 306, - /* 340 */ 272, 81, 274, 20, 392, 421, 264, 265, 266, 267, - /* 350 */ 268, 269, 270, 67, 430, 431, 21, 20, 167, 24, - /* 360 */ 25, 26, 27, 28, 29, 30, 31, 32, 114, 145, - /* 370 */ 252, 111, 113, 149, 114, 143, 144, 145, 146, 147, - /* 380 */ 148, 149, 401, 124, 374, 375, 376, 275, 276, 277, - /* 390 */ 278, 279, 280, 281, 282, 283, 284, 285, 297, 113, - /* 400 */ 8, 9, 116, 20, 12, 13, 14, 15, 16, 428, - /* 410 */ 150, 151, 20, 154, 155, 124, 157, 158, 159, 160, - /* 420 */ 161, 162, 163, 164, 165, 166, 474, 475, 297, 170, - /* 430 */ 171, 172, 173, 174, 175, 176, 177, 114, 179, 180, - /* 440 */ 181, 167, 422, 423, 185, 186, 187, 223, 18, 189, - /* 450 */ 190, 192, 228, 23, 20, 231, 114, 233, 21, 199, - /* 460 */ 200, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 470 */ 184, 41, 42, 21, 214, 45, 216, 286, 287, 288, - /* 480 */ 289, 290, 291, 292, 293, 294, 56, 503, 36, 505, - /* 490 */ 38, 39, 40, 41, 216, 380, 20, 420, 68, 69, - /* 500 */ 70, 71, 72, 290, 291, 292, 293, 294, 393, 421, - /* 510 */ 250, 251, 252, 436, 254, 255, 256, 257, 258, 259, - /* 520 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 530 */ 270, 271, 272, 12, 13, 20, 421, 449, 22, 380, - /* 540 */ 20, 20, 392, 22, 114, 12, 13, 14, 15, 16, - /* 550 */ 111, 297, 437, 37, 439, 213, 35, 215, 37, 72, - /* 560 */ 0, 287, 288, 289, 125, 126, 127, 128, 129, 130, - /* 570 */ 131, 132, 133, 134, 380, 136, 137, 138, 139, 140, - /* 580 */ 141, 142, 152, 191, 439, 413, 250, 393, 67, 247, - /* 590 */ 422, 441, 442, 421, 444, 74, 437, 81, 448, 454, - /* 600 */ 485, 433, 81, 488, 432, 460, 461, 492, 493, 494, - /* 610 */ 495, 496, 497, 20, 499, 421, 40, 41, 143, 504, - /* 620 */ 297, 506, 147, 189, 190, 510, 511, 111, 392, 393, - /* 630 */ 421, 437, 111, 439, 114, 114, 206, 207, 208, 297, - /* 640 */ 431, 211, 424, 491, 252, 309, 310, 311, 312, 313, - /* 650 */ 314, 315, 73, 538, 224, 225, 8, 9, 392, 393, - /* 660 */ 12, 13, 14, 15, 16, 150, 151, 237, 272, 517, - /* 670 */ 240, 150, 151, 243, 244, 245, 246, 247, 412, 485, - /* 680 */ 435, 445, 488, 438, 439, 419, 492, 493, 494, 495, - /* 690 */ 496, 497, 3, 499, 118, 119, 209, 121, 504, 20, - /* 700 */ 506, 22, 392, 393, 510, 511, 488, 399, 0, 20, - /* 710 */ 189, 190, 14, 23, 199, 200, 20, 499, 20, 143, - /* 720 */ 199, 200, 412, 147, 416, 238, 239, 297, 252, 169, - /* 730 */ 214, 111, 216, 425, 174, 214, 57, 216, 48, 49, - /* 740 */ 90, 409, 182, 150, 151, 125, 126, 127, 128, 129, - /* 750 */ 130, 131, 132, 133, 134, 380, 136, 137, 138, 139, - /* 760 */ 140, 141, 142, 115, 20, 51, 250, 251, 393, 437, - /* 770 */ 395, 250, 251, 252, 421, 254, 255, 256, 257, 258, - /* 780 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 790 */ 269, 270, 271, 12, 13, 14, 421, 37, 380, 392, - /* 800 */ 393, 20, 33, 22, 115, 13, 156, 37, 14, 15, - /* 810 */ 16, 393, 437, 395, 439, 46, 35, 297, 37, 0, - /* 820 */ 488, 489, 8, 9, 81, 380, 12, 13, 14, 15, - /* 830 */ 16, 499, 182, 183, 4, 20, 483, 14, 393, 421, - /* 840 */ 395, 53, 503, 20, 505, 380, 196, 380, 67, 19, - /* 850 */ 62, 491, 445, 65, 66, 437, 0, 439, 392, 393, - /* 860 */ 485, 408, 81, 488, 411, 35, 421, 492, 493, 494, - /* 870 */ 495, 496, 497, 81, 499, 167, 168, 517, 412, 504, - /* 880 */ 191, 506, 437, 53, 439, 510, 511, 189, 392, 393, - /* 890 */ 60, 61, 111, 409, 388, 114, 124, 67, 392, 421, - /* 900 */ 394, 421, 437, 485, 437, 191, 488, 429, 412, 429, - /* 910 */ 492, 493, 494, 495, 496, 497, 202, 499, 440, 14, - /* 920 */ 440, 437, 504, 20, 506, 20, 413, 188, 510, 511, - /* 930 */ 485, 150, 151, 488, 421, 191, 464, 492, 493, 494, - /* 940 */ 495, 496, 497, 113, 499, 432, 116, 392, 252, 504, - /* 950 */ 252, 506, 20, 8, 9, 510, 511, 12, 13, 14, - /* 960 */ 15, 16, 143, 144, 145, 146, 147, 148, 149, 380, - /* 970 */ 189, 190, 488, 489, 490, 422, 216, 380, 33, 37, - /* 980 */ 199, 200, 393, 499, 395, 4, 216, 392, 393, 0, - /* 990 */ 518, 392, 393, 392, 393, 214, 252, 216, 526, 143, - /* 1000 */ 144, 145, 146, 147, 148, 149, 191, 412, 248, 249, - /* 1010 */ 421, 412, 189, 412, 275, 377, 544, 545, 248, 249, - /* 1020 */ 206, 549, 550, 81, 285, 417, 437, 34, 439, 474, - /* 1030 */ 475, 250, 251, 252, 437, 254, 255, 256, 257, 258, - /* 1040 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 1050 */ 269, 270, 271, 12, 13, 380, 438, 439, 380, 37, - /* 1060 */ 115, 20, 73, 22, 58, 59, 502, 252, 393, 505, - /* 1070 */ 395, 3, 392, 393, 485, 252, 35, 488, 37, 0, - /* 1080 */ 144, 492, 493, 494, 495, 496, 497, 479, 499, 392, - /* 1090 */ 393, 380, 412, 504, 191, 506, 421, 1, 2, 510, - /* 1100 */ 511, 22, 464, 81, 393, 380, 395, 469, 67, 412, - /* 1110 */ 392, 393, 437, 22, 439, 437, 76, 77, 78, 392, - /* 1120 */ 393, 189, 81, 83, 84, 85, 144, 145, 37, 89, - /* 1130 */ 412, 149, 421, 491, 94, 95, 96, 97, 324, 412, - /* 1140 */ 100, 392, 393, 380, 104, 105, 106, 107, 437, 381, - /* 1150 */ 439, 13, 111, 392, 393, 114, 518, 380, 464, 517, - /* 1160 */ 485, 412, 437, 488, 526, 229, 230, 492, 493, 494, - /* 1170 */ 495, 496, 497, 412, 499, 392, 393, 392, 393, 504, - /* 1180 */ 380, 506, 544, 545, 252, 510, 511, 549, 550, 392, - /* 1190 */ 393, 150, 151, 392, 393, 412, 485, 412, 184, 488, - /* 1200 */ 437, 22, 111, 492, 493, 494, 495, 496, 497, 412, - /* 1210 */ 499, 115, 518, 412, 437, 504, 37, 506, 380, 81, - /* 1220 */ 526, 510, 511, 12, 13, 392, 393, 392, 393, 380, - /* 1230 */ 189, 190, 218, 22, 392, 393, 470, 437, 544, 545, - /* 1240 */ 199, 200, 393, 549, 550, 412, 35, 412, 37, 422, - /* 1250 */ 397, 398, 397, 398, 412, 214, 0, 216, 399, 380, - /* 1260 */ 421, 380, 380, 380, 406, 407, 421, 380, 380, 380, - /* 1270 */ 421, 380, 406, 407, 33, 437, 380, 464, 67, 440, - /* 1280 */ 299, 410, 469, 421, 425, 440, 437, 0, 439, 393, - /* 1290 */ 111, 250, 251, 252, 432, 254, 255, 256, 257, 258, - /* 1300 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 1310 */ 269, 270, 271, 12, 13, 124, 437, 421, 437, 437, - /* 1320 */ 437, 20, 0, 22, 437, 437, 437, 434, 437, 33, - /* 1330 */ 437, 518, 421, 437, 485, 439, 35, 488, 37, 526, - /* 1340 */ 53, 492, 493, 494, 495, 496, 497, 414, 499, 464, - /* 1350 */ 417, 440, 0, 504, 0, 506, 115, 544, 545, 510, - /* 1360 */ 511, 434, 549, 550, 437, 43, 8, 9, 67, 178, - /* 1370 */ 12, 13, 14, 15, 16, 434, 22, 464, 437, 383, - /* 1380 */ 384, 485, 81, 117, 488, 33, 120, 319, 492, 493, - /* 1390 */ 494, 495, 496, 497, 117, 499, 117, 120, 117, 120, - /* 1400 */ 504, 120, 506, 518, 13, 33, 510, 511, 13, 33, - /* 1410 */ 2, 526, 111, 380, 0, 114, 8, 9, 0, 422, - /* 1420 */ 12, 13, 14, 15, 16, 214, 393, 216, 37, 544, - /* 1430 */ 545, 518, 37, 67, 549, 550, 22, 33, 33, 526, - /* 1440 */ 22, 232, 33, 234, 150, 151, 1, 2, 74, 33, - /* 1450 */ 50, 150, 151, 422, 421, 33, 33, 544, 545, 248, - /* 1460 */ 249, 250, 549, 550, 33, 33, 33, 33, 33, 422, - /* 1470 */ 437, 422, 439, 115, 37, 264, 265, 266, 267, 268, - /* 1480 */ 269, 270, 116, 12, 13, 12, 13, 115, 12, 13, - /* 1490 */ 189, 190, 33, 33, 33, 12, 13, 520, 242, 553, - /* 1500 */ 199, 200, 0, 12, 13, 12, 13, 12, 13, 12, - /* 1510 */ 13, 12, 13, 450, 114, 214, 542, 216, 485, 115, - /* 1520 */ 115, 488, 12, 13, 115, 492, 493, 494, 495, 496, - /* 1530 */ 497, 115, 499, 12, 13, 535, 33, 115, 115, 506, - /* 1540 */ 521, 33, 37, 510, 511, 33, 115, 115, 115, 115, - /* 1550 */ 115, 250, 251, 252, 396, 254, 255, 256, 257, 258, - /* 1560 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 1570 */ 269, 270, 271, 33, 115, 115, 115, 33, 76, 77, - /* 1580 */ 78, 79, 80, 33, 82, 83, 84, 85, 86, 87, - /* 1590 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - /* 1600 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - /* 1610 */ 1, 421, 37, 13, 13, 0, 37, 321, 115, 409, - /* 1620 */ 114, 409, 380, 115, 250, 450, 391, 115, 19, 123, - /* 1630 */ 450, 541, 463, 541, 541, 393, 541, 37, 37, 396, - /* 1640 */ 486, 393, 450, 436, 35, 471, 450, 450, 525, 525, - /* 1650 */ 546, 380, 512, 216, 528, 115, 81, 411, 465, 115, - /* 1660 */ 81, 52, 53, 421, 393, 115, 53, 300, 487, 54, - /* 1670 */ 20, 62, 63, 64, 65, 392, 67, 20, 476, 437, - /* 1680 */ 231, 439, 481, 401, 476, 401, 212, 467, 20, 392, - /* 1690 */ 46, 393, 421, 446, 443, 393, 446, 188, 392, 323, - /* 1700 */ 393, 392, 443, 446, 443, 443, 112, 110, 437, 405, - /* 1710 */ 439, 392, 404, 392, 109, 403, 392, 392, 392, 20, - /* 1720 */ 385, 216, 113, 51, 385, 116, 389, 485, 476, 389, - /* 1730 */ 488, 401, 401, 20, 492, 493, 494, 495, 496, 497, - /* 1740 */ 0, 499, 439, 401, 20, 394, 20, 401, 506, 380, - /* 1750 */ 394, 466, 510, 511, 401, 20, 485, 148, 401, 488, - /* 1760 */ 401, 20, 393, 492, 493, 494, 495, 496, 497, 451, - /* 1770 */ 499, 457, 401, 380, 392, 385, 401, 506, 392, 383, - /* 1780 */ 383, 510, 511, 421, 421, 421, 393, 385, 235, 421, - /* 1790 */ 421, 421, 437, 480, 421, 114, 476, 437, 421, 421, - /* 1800 */ 421, 421, 193, 20, 195, 421, 437, 198, 439, 399, - /* 1810 */ 478, 475, 203, 220, 421, 219, 76, 77, 78, 472, - /* 1820 */ 437, 473, 392, 83, 84, 85, 439, 399, 308, 89, - /* 1830 */ 437, 222, 439, 534, 94, 95, 96, 97, 437, 307, - /* 1840 */ 100, 316, 380, 205, 104, 105, 106, 107, 537, 534, - /* 1850 */ 465, 318, 458, 536, 485, 393, 458, 488, 317, 380, - /* 1860 */ 533, 492, 493, 494, 495, 496, 497, 498, 499, 500, - /* 1870 */ 501, 301, 393, 296, 531, 534, 532, 465, 485, 295, - /* 1880 */ 325, 488, 554, 421, 523, 492, 493, 494, 495, 496, - /* 1890 */ 497, 322, 499, 548, 320, 20, 547, 393, 491, 437, - /* 1900 */ 421, 439, 124, 437, 298, 524, 399, 394, 35, 458, - /* 1910 */ 399, 458, 437, 197, 437, 437, 437, 529, 439, 527, - /* 1920 */ 455, 437, 399, 437, 114, 399, 53, 437, 509, 197, - /* 1930 */ 399, 451, 539, 540, 452, 62, 63, 64, 65, 380, - /* 1940 */ 67, 417, 399, 451, 393, 114, 22, 485, 426, 38, - /* 1950 */ 488, 437, 393, 437, 492, 493, 494, 495, 496, 497, - /* 1960 */ 399, 499, 382, 385, 485, 437, 437, 488, 392, 386, - /* 1970 */ 0, 492, 493, 494, 495, 496, 497, 477, 499, 437, - /* 1980 */ 421, 378, 437, 437, 437, 506, 113, 468, 0, 116, - /* 1990 */ 511, 437, 400, 437, 437, 437, 437, 437, 439, 437, - /* 2000 */ 437, 437, 437, 437, 437, 437, 415, 459, 437, 437, - /* 2010 */ 437, 423, 423, 551, 552, 0, 0, 415, 484, 415, - /* 2020 */ 46, 37, 241, 37, 37, 241, 37, 0, 37, 37, - /* 2030 */ 241, 37, 380, 241, 0, 37, 0, 37, 0, 22, - /* 2040 */ 459, 0, 0, 0, 485, 393, 37, 488, 236, 0, - /* 2050 */ 222, 492, 493, 494, 495, 496, 497, 184, 499, 0, - /* 2060 */ 222, 216, 223, 214, 0, 0, 193, 210, 209, 0, - /* 2070 */ 197, 198, 0, 421, 0, 155, 203, 204, 50, 50, - /* 2080 */ 0, 37, 0, 0, 37, 53, 0, 50, 0, 437, - /* 2090 */ 0, 439, 46, 0, 0, 222, 174, 37, 50, 540, - /* 2100 */ 0, 0, 0, 0, 0, 0, 0, 174, 0, 0, - /* 2110 */ 0, 380, 0, 0, 462, 0, 0, 0, 0, 0, - /* 2120 */ 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, - /* 2130 */ 380, 0, 0, 46, 50, 0, 0, 485, 0, 0, - /* 2140 */ 488, 0, 0, 393, 492, 493, 494, 495, 496, 497, - /* 2150 */ 0, 499, 421, 0, 380, 0, 22, 0, 155, 0, - /* 2160 */ 154, 0, 0, 153, 0, 22, 22, 393, 437, 0, - /* 2170 */ 439, 421, 0, 0, 67, 51, 0, 37, 67, 0, - /* 2180 */ 0, 51, 37, 0, 0, 0, 37, 437, 0, 439, - /* 2190 */ 43, 37, 46, 462, 43, 421, 14, 0, 0, 380, - /* 2200 */ 67, 53, 37, 43, 67, 53, 43, 33, 50, 53, - /* 2210 */ 44, 437, 393, 439, 43, 0, 485, 50, 50, 488, - /* 2220 */ 0, 0, 0, 492, 493, 494, 495, 496, 497, 43, - /* 2230 */ 499, 205, 0, 0, 0, 485, 0, 50, 488, 50, - /* 2240 */ 421, 0, 492, 493, 494, 495, 496, 497, 37, 499, - /* 2250 */ 75, 380, 53, 43, 0, 37, 437, 53, 439, 485, - /* 2260 */ 43, 0, 488, 37, 393, 53, 492, 493, 494, 495, - /* 2270 */ 496, 497, 0, 499, 43, 37, 53, 0, 43, 0, - /* 2280 */ 0, 0, 0, 0, 37, 22, 0, 22, 37, 380, - /* 2290 */ 120, 0, 421, 543, 37, 37, 22, 37, 0, 122, - /* 2300 */ 33, 37, 393, 37, 485, 37, 37, 488, 437, 33, - /* 2310 */ 439, 492, 493, 494, 495, 496, 497, 22, 499, 380, - /* 2320 */ 501, 37, 37, 22, 37, 37, 552, 0, 22, 0, - /* 2330 */ 421, 22, 393, 462, 37, 0, 380, 0, 0, 37, - /* 2340 */ 0, 37, 0, 0, 55, 37, 437, 22, 439, 393, - /* 2350 */ 20, 37, 37, 37, 115, 0, 485, 114, 114, 488, - /* 2360 */ 421, 0, 50, 492, 493, 494, 495, 496, 497, 191, - /* 2370 */ 499, 462, 22, 37, 0, 22, 437, 421, 439, 0, - /* 2380 */ 0, 3, 33, 191, 114, 114, 191, 191, 115, 37, - /* 2390 */ 115, 191, 114, 437, 485, 439, 37, 488, 197, 302, - /* 2400 */ 110, 492, 493, 494, 495, 496, 497, 226, 499, 201, - /* 2410 */ 201, 217, 112, 380, 221, 51, 51, 33, 227, 33, - /* 2420 */ 115, 33, 115, 50, 485, 115, 393, 488, 33, 81, - /* 2430 */ 33, 492, 493, 494, 495, 496, 497, 114, 499, 50, - /* 2440 */ 114, 485, 114, 37, 488, 114, 114, 380, 492, 493, - /* 2450 */ 494, 495, 496, 497, 421, 499, 115, 3, 33, 115, - /* 2460 */ 393, 115, 50, 37, 37, 37, 37, 37, 37, 115, - /* 2470 */ 437, 115, 439, 33, 50, 0, 380, 0, 43, 0, - /* 2480 */ 114, 43, 115, 115, 114, 114, 194, 0, 421, 393, - /* 2490 */ 114, 198, 286, 194, 43, 33, 115, 114, 273, 112, - /* 2500 */ 2, 253, 112, 22, 437, 302, 439, 302, 115, 50, - /* 2510 */ 193, 115, 250, 114, 114, 114, 114, 421, 485, 114, - /* 2520 */ 50, 488, 115, 114, 114, 492, 493, 494, 495, 496, - /* 2530 */ 497, 115, 499, 437, 22, 439, 114, 114, 0, 194, - /* 2540 */ 43, 123, 50, 124, 22, 22, 22, 115, 114, 227, - /* 2550 */ 114, 114, 485, 114, 37, 488, 115, 114, 114, 492, - /* 2560 */ 493, 494, 495, 496, 497, 115, 499, 37, 115, 114, - /* 2570 */ 380, 114, 37, 115, 37, 115, 37, 37, 115, 115, - /* 2580 */ 37, 485, 135, 393, 488, 33, 114, 135, 492, 493, - /* 2590 */ 494, 495, 496, 497, 380, 499, 135, 114, 37, 114, - /* 2600 */ 135, 22, 75, 74, 22, 37, 37, 393, 37, 380, - /* 2610 */ 37, 421, 37, 37, 37, 37, 108, 37, 37, 108, - /* 2620 */ 37, 33, 393, 81, 37, 81, 37, 437, 37, 439, - /* 2630 */ 22, 37, 81, 37, 37, 421, 37, 37, 37, 380, - /* 2640 */ 37, 37, 22, 37, 0, 53, 37, 0, 43, 37, - /* 2650 */ 421, 437, 393, 439, 43, 53, 0, 43, 37, 0, - /* 2660 */ 53, 37, 43, 53, 0, 0, 437, 37, 439, 37, - /* 2670 */ 22, 0, 22, 33, 22, 485, 21, 555, 488, 22, - /* 2680 */ 421, 21, 492, 493, 494, 495, 496, 497, 22, 499, - /* 2690 */ 20, 380, 555, 555, 555, 555, 437, 555, 439, 485, - /* 2700 */ 555, 555, 488, 555, 393, 555, 492, 493, 494, 495, - /* 2710 */ 496, 497, 555, 499, 485, 555, 555, 488, 555, 555, - /* 2720 */ 555, 492, 493, 494, 495, 496, 497, 380, 499, 555, - /* 2730 */ 555, 555, 421, 555, 555, 555, 555, 555, 555, 555, - /* 2740 */ 393, 555, 555, 555, 485, 555, 555, 488, 437, 555, - /* 2750 */ 439, 492, 493, 494, 495, 496, 497, 380, 499, 555, - /* 2760 */ 555, 555, 555, 555, 555, 555, 555, 555, 421, 555, - /* 2770 */ 393, 555, 555, 555, 380, 555, 555, 555, 555, 555, - /* 2780 */ 555, 555, 555, 555, 437, 555, 439, 393, 555, 555, - /* 2790 */ 555, 555, 555, 555, 555, 555, 485, 555, 421, 488, - /* 2800 */ 555, 555, 555, 492, 493, 494, 495, 496, 497, 555, - /* 2810 */ 499, 555, 555, 555, 437, 421, 439, 555, 555, 555, - /* 2820 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 2830 */ 555, 437, 485, 439, 555, 488, 555, 555, 555, 492, - /* 2840 */ 493, 494, 495, 496, 497, 555, 499, 555, 555, 555, - /* 2850 */ 555, 380, 555, 555, 555, 555, 555, 555, 555, 555, - /* 2860 */ 555, 555, 485, 555, 393, 488, 555, 555, 555, 492, - /* 2870 */ 493, 494, 495, 496, 497, 555, 499, 555, 555, 485, - /* 2880 */ 555, 555, 488, 555, 555, 380, 492, 493, 494, 495, - /* 2890 */ 496, 497, 421, 499, 555, 555, 555, 555, 393, 555, - /* 2900 */ 555, 555, 555, 555, 555, 555, 555, 555, 437, 555, - /* 2910 */ 439, 555, 555, 555, 380, 555, 555, 555, 555, 555, - /* 2920 */ 555, 555, 555, 555, 555, 555, 421, 393, 555, 555, - /* 2930 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 2940 */ 555, 555, 437, 555, 439, 555, 555, 555, 555, 555, - /* 2950 */ 555, 555, 555, 555, 555, 421, 485, 555, 555, 488, - /* 2960 */ 555, 555, 555, 492, 493, 494, 495, 496, 497, 555, - /* 2970 */ 499, 437, 555, 439, 555, 380, 555, 555, 555, 555, - /* 2980 */ 555, 555, 555, 555, 555, 555, 555, 555, 393, 555, - /* 2990 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494, - /* 3000 */ 495, 496, 497, 555, 499, 555, 555, 555, 380, 555, - /* 3010 */ 555, 555, 555, 555, 555, 555, 421, 555, 555, 485, - /* 3020 */ 555, 393, 488, 555, 555, 555, 492, 493, 494, 495, - /* 3030 */ 496, 497, 437, 499, 439, 555, 555, 555, 555, 555, - /* 3040 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 421, - /* 3050 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 3060 */ 555, 555, 555, 555, 555, 437, 555, 439, 555, 555, - /* 3070 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 3080 */ 485, 555, 555, 488, 555, 380, 555, 492, 493, 494, - /* 3090 */ 495, 496, 497, 555, 499, 555, 555, 555, 393, 555, - /* 3100 */ 555, 555, 380, 555, 555, 555, 555, 555, 555, 555, - /* 3110 */ 555, 555, 555, 485, 555, 393, 488, 555, 555, 555, - /* 3120 */ 492, 493, 494, 495, 496, 497, 421, 499, 380, 555, - /* 3130 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 3140 */ 555, 393, 437, 421, 439, 555, 555, 555, 555, 555, - /* 3150 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 437, - /* 3160 */ 555, 439, 555, 555, 555, 380, 555, 555, 555, 421, - /* 3170 */ 555, 555, 555, 555, 555, 555, 555, 555, 393, 555, - /* 3180 */ 555, 555, 555, 555, 555, 437, 555, 439, 555, 555, - /* 3190 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494, - /* 3200 */ 495, 496, 497, 555, 499, 555, 421, 485, 555, 555, - /* 3210 */ 488, 555, 555, 555, 492, 493, 494, 495, 496, 497, - /* 3220 */ 555, 499, 437, 555, 439, 555, 555, 555, 555, 555, - /* 3230 */ 555, 555, 555, 485, 555, 555, 488, 555, 555, 555, - /* 3240 */ 492, 493, 494, 495, 496, 497, 555, 499, 555, 555, - /* 3250 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 3260 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - /* 3270 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494, - /* 3280 */ 495, 496, 497, 555, 499, 377, 377, 377, 377, 377, - /* 3290 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3300 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3310 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3320 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3330 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3340 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3350 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3360 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3370 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3380 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3390 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3400 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3410 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3420 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3430 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3440 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3450 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3460 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3470 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3480 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3490 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3500 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3510 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3520 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3530 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3540 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3550 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3560 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3570 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3580 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3590 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3600 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3610 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3620 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3630 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3640 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3650 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, - /* 3660 */ 377, 377, + /* 270 */ 270, 271, 272, 12, 13, 243, 14, 424, 18, 448, + /* 280 */ 20, 20, 20, 22, 467, 444, 445, 27, 447, 472, + /* 290 */ 30, 75, 451, 440, 20, 442, 22, 36, 38, 38, + /* 300 */ 287, 288, 289, 290, 291, 292, 293, 294, 295, 154, + /* 310 */ 36, 253, 378, 20, 54, 380, 56, 382, 251, 424, + /* 320 */ 115, 61, 62, 115, 169, 516, 517, 518, 519, 68, + /* 330 */ 521, 522, 58, 73, 36, 20, 75, 424, 521, 123, + /* 340 */ 325, 488, 402, 82, 491, 432, 529, 452, 495, 496, + /* 350 */ 497, 498, 499, 500, 20, 502, 443, 20, 505, 419, + /* 360 */ 507, 508, 509, 298, 547, 548, 513, 514, 428, 552, + /* 370 */ 553, 146, 20, 112, 114, 150, 115, 310, 311, 312, + /* 380 */ 313, 314, 315, 316, 395, 125, 0, 287, 288, 289, + /* 390 */ 290, 291, 292, 293, 294, 295, 291, 292, 293, 294, + /* 400 */ 295, 467, 20, 8, 9, 189, 472, 12, 13, 14, + /* 410 */ 15, 16, 151, 152, 0, 22, 156, 157, 154, 159, + /* 420 */ 160, 161, 162, 163, 164, 165, 166, 167, 168, 36, + /* 430 */ 115, 171, 172, 173, 174, 175, 176, 177, 178, 20, + /* 440 */ 180, 181, 182, 20, 151, 152, 186, 187, 188, 224, + /* 450 */ 115, 190, 191, 193, 229, 521, 52, 232, 2, 234, + /* 460 */ 74, 200, 201, 529, 8, 9, 477, 478, 12, 13, + /* 470 */ 14, 15, 16, 425, 74, 82, 215, 521, 217, 41, + /* 480 */ 42, 547, 548, 195, 436, 529, 552, 553, 151, 152, + /* 490 */ 395, 396, 276, 277, 278, 279, 280, 281, 282, 283, + /* 500 */ 284, 285, 286, 298, 548, 112, 298, 3, 552, 553, + /* 510 */ 415, 116, 251, 252, 253, 217, 255, 256, 257, 258, + /* 520 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + /* 530 */ 269, 270, 271, 272, 273, 12, 13, 200, 201, 36, + /* 540 */ 381, 424, 4, 20, 192, 22, 424, 249, 250, 112, + /* 550 */ 433, 434, 288, 289, 290, 396, 434, 119, 120, 36, + /* 560 */ 122, 38, 424, 126, 127, 128, 129, 130, 131, 132, + /* 570 */ 133, 134, 135, 381, 137, 138, 139, 140, 141, 142, + /* 580 */ 143, 443, 144, 424, 170, 82, 148, 36, 396, 175, + /* 590 */ 398, 68, 304, 305, 306, 307, 192, 183, 75, 440, + /* 600 */ 0, 442, 485, 486, 273, 82, 275, 203, 215, 411, + /* 610 */ 217, 0, 414, 298, 8, 9, 424, 424, 12, 13, + /* 620 */ 14, 15, 16, 8, 9, 395, 3, 12, 13, 14, + /* 630 */ 15, 16, 440, 298, 442, 112, 115, 115, 115, 33, + /* 640 */ 427, 20, 20, 20, 251, 252, 124, 488, 442, 506, + /* 650 */ 491, 508, 4, 412, 495, 496, 497, 498, 499, 500, + /* 660 */ 91, 502, 381, 457, 74, 14, 507, 19, 509, 463, + /* 670 */ 464, 20, 513, 514, 151, 152, 253, 21, 391, 486, + /* 680 */ 488, 440, 395, 491, 397, 125, 38, 495, 496, 497, + /* 690 */ 498, 499, 500, 37, 502, 39, 40, 41, 42, 507, + /* 700 */ 541, 509, 54, 273, 491, 513, 514, 477, 478, 61, + /* 710 */ 62, 381, 44, 190, 191, 502, 68, 73, 12, 13, + /* 720 */ 424, 440, 116, 200, 201, 494, 396, 158, 398, 433, + /* 730 */ 434, 116, 491, 492, 493, 214, 68, 216, 215, 116, + /* 740 */ 217, 424, 36, 502, 144, 145, 146, 147, 148, 149, + /* 750 */ 150, 520, 183, 184, 424, 144, 145, 146, 147, 148, + /* 760 */ 149, 150, 114, 441, 442, 117, 197, 391, 217, 248, + /* 770 */ 440, 395, 442, 397, 251, 252, 253, 412, 255, 256, + /* 780 */ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + /* 790 */ 267, 268, 269, 270, 271, 272, 12, 13, 14, 381, + /* 800 */ 249, 250, 485, 486, 20, 440, 22, 12, 13, 14, + /* 810 */ 15, 16, 190, 192, 396, 192, 398, 467, 488, 298, + /* 820 */ 36, 491, 38, 396, 320, 495, 496, 497, 498, 499, + /* 830 */ 500, 20, 502, 381, 395, 59, 60, 507, 300, 509, + /* 840 */ 442, 190, 424, 513, 514, 395, 396, 227, 396, 82, + /* 850 */ 398, 424, 68, 381, 210, 457, 491, 492, 440, 68, + /* 860 */ 442, 463, 464, 12, 13, 415, 82, 502, 506, 54, + /* 870 */ 508, 521, 422, 22, 253, 253, 424, 125, 63, 529, + /* 880 */ 381, 66, 67, 239, 240, 425, 189, 36, 424, 38, + /* 890 */ 395, 396, 440, 454, 442, 456, 112, 547, 548, 115, + /* 900 */ 395, 396, 552, 553, 253, 114, 488, 443, 117, 491, + /* 910 */ 415, 4, 440, 495, 496, 497, 498, 499, 500, 68, + /* 920 */ 502, 395, 396, 217, 497, 507, 467, 509, 395, 396, + /* 930 */ 23, 513, 514, 82, 505, 151, 152, 508, 467, 440, + /* 940 */ 488, 415, 23, 491, 395, 396, 381, 495, 496, 497, + /* 950 */ 498, 499, 500, 448, 502, 48, 49, 50, 381, 507, + /* 960 */ 494, 509, 381, 112, 415, 513, 514, 20, 49, 50, + /* 970 */ 395, 396, 381, 276, 190, 191, 185, 145, 395, 396, + /* 980 */ 521, 448, 0, 286, 200, 201, 520, 396, 529, 398, + /* 990 */ 415, 34, 521, 395, 396, 375, 376, 377, 415, 215, + /* 1000 */ 529, 217, 14, 192, 22, 440, 547, 548, 20, 395, + /* 1010 */ 396, 552, 553, 415, 14, 424, 13, 440, 547, 548, + /* 1020 */ 20, 440, 425, 552, 553, 395, 396, 145, 146, 415, + /* 1030 */ 420, 440, 150, 442, 144, 251, 252, 253, 148, 255, + /* 1040 */ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + /* 1050 */ 266, 267, 268, 269, 270, 271, 272, 12, 13, 400, + /* 1060 */ 401, 416, 230, 231, 253, 20, 215, 22, 217, 424, + /* 1070 */ 144, 145, 146, 147, 148, 149, 150, 395, 396, 488, + /* 1080 */ 435, 36, 491, 38, 0, 82, 495, 496, 497, 498, + /* 1090 */ 499, 500, 482, 502, 425, 381, 381, 415, 507, 425, + /* 1100 */ 509, 33, 251, 252, 513, 514, 395, 396, 400, 401, + /* 1110 */ 396, 425, 398, 68, 112, 47, 265, 266, 267, 268, + /* 1120 */ 269, 270, 271, 33, 381, 185, 415, 82, 126, 127, + /* 1130 */ 128, 129, 130, 131, 132, 133, 134, 135, 424, 137, + /* 1140 */ 138, 139, 140, 141, 142, 143, 13, 517, 518, 519, + /* 1150 */ 417, 521, 522, 420, 440, 440, 442, 112, 381, 219, + /* 1160 */ 115, 77, 78, 79, 395, 396, 395, 396, 84, 85, + /* 1170 */ 86, 409, 410, 396, 90, 395, 396, 20, 190, 95, + /* 1180 */ 96, 97, 98, 440, 415, 101, 415, 395, 396, 105, + /* 1190 */ 106, 107, 108, 384, 385, 415, 151, 152, 395, 396, + /* 1200 */ 253, 424, 488, 409, 410, 491, 116, 415, 381, 495, + /* 1210 */ 496, 497, 498, 499, 500, 82, 502, 440, 415, 442, + /* 1220 */ 233, 507, 235, 509, 381, 8, 9, 513, 514, 12, + /* 1230 */ 13, 14, 15, 16, 424, 190, 191, 395, 396, 395, + /* 1240 */ 396, 253, 432, 395, 396, 200, 201, 424, 1, 2, + /* 1250 */ 416, 395, 396, 443, 20, 432, 22, 415, 424, 415, + /* 1260 */ 215, 381, 217, 415, 381, 488, 443, 440, 491, 435, + /* 1270 */ 0, 415, 495, 496, 497, 498, 499, 500, 473, 502, + /* 1280 */ 22, 22, 381, 440, 507, 33, 509, 14, 15, 16, + /* 1290 */ 513, 514, 58, 125, 36, 36, 251, 252, 253, 47, + /* 1300 */ 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + /* 1310 */ 265, 266, 267, 268, 269, 270, 271, 272, 12, 13, + /* 1320 */ 440, 424, 381, 440, 54, 18, 20, 381, 22, 424, + /* 1330 */ 23, 437, 435, 381, 440, 381, 381, 396, 413, 467, + /* 1340 */ 381, 440, 36, 381, 38, 2, 0, 179, 443, 42, + /* 1350 */ 43, 8, 9, 46, 381, 12, 13, 14, 15, 16, + /* 1360 */ 0, 36, 33, 116, 57, 424, 13, 33, 33, 396, + /* 1370 */ 112, 112, 437, 0, 68, 440, 69, 70, 71, 72, + /* 1380 */ 73, 440, 437, 442, 118, 440, 440, 121, 82, 36, + /* 1390 */ 12, 13, 440, 521, 440, 440, 33, 424, 33, 440, + /* 1400 */ 22, 529, 440, 75, 44, 118, 33, 82, 121, 192, + /* 1410 */ 253, 13, 33, 440, 36, 442, 38, 382, 112, 547, + /* 1420 */ 548, 115, 115, 118, 552, 553, 121, 118, 0, 488, + /* 1430 */ 121, 0, 491, 453, 36, 68, 495, 496, 497, 498, + /* 1440 */ 499, 500, 33, 502, 0, 0, 68, 33, 507, 36, + /* 1450 */ 509, 116, 33, 22, 513, 514, 51, 151, 152, 33, + /* 1460 */ 153, 488, 151, 152, 491, 13, 22, 22, 495, 496, + /* 1470 */ 497, 498, 499, 500, 1, 502, 1, 2, 36, 116, + /* 1480 */ 507, 116, 509, 55, 117, 36, 513, 514, 36, 12, + /* 1490 */ 13, 523, 19, 12, 13, 116, 190, 191, 33, 13, + /* 1500 */ 154, 33, 33, 33, 556, 33, 200, 201, 545, 33, + /* 1510 */ 36, 38, 538, 524, 207, 208, 209, 399, 424, 212, + /* 1520 */ 115, 215, 36, 217, 33, 116, 53, 54, 412, 33, + /* 1530 */ 116, 82, 225, 226, 412, 116, 63, 64, 65, 66, + /* 1540 */ 33, 68, 116, 12, 13, 238, 12, 13, 241, 33, + /* 1550 */ 33, 244, 245, 246, 247, 248, 82, 251, 252, 253, + /* 1560 */ 453, 255, 256, 257, 258, 259, 260, 261, 262, 263, + /* 1570 */ 264, 265, 266, 267, 268, 269, 270, 271, 272, 251, + /* 1580 */ 33, 116, 12, 13, 116, 116, 116, 114, 116, 394, + /* 1590 */ 117, 381, 116, 215, 453, 217, 8, 9, 12, 13, + /* 1600 */ 12, 13, 14, 15, 16, 298, 396, 116, 12, 13, + /* 1610 */ 12, 13, 116, 12, 13, 12, 13, 12, 13, 544, + /* 1620 */ 33, 544, 149, 116, 544, 466, 544, 249, 250, 251, + /* 1630 */ 217, 399, 116, 116, 424, 489, 453, 396, 439, 474, + /* 1640 */ 453, 453, 528, 265, 266, 267, 268, 269, 270, 271, + /* 1650 */ 440, 322, 442, 528, 549, 515, 381, 531, 324, 217, + /* 1660 */ 414, 468, 301, 116, 54, 490, 20, 194, 20, 196, + /* 1670 */ 479, 396, 199, 395, 484, 232, 404, 204, 404, 479, + /* 1680 */ 213, 470, 20, 395, 47, 381, 396, 449, 396, 449, + /* 1690 */ 189, 446, 395, 449, 396, 395, 223, 446, 488, 424, + /* 1700 */ 396, 491, 446, 116, 113, 495, 496, 497, 498, 499, + /* 1710 */ 500, 446, 502, 111, 395, 440, 408, 442, 395, 509, + /* 1720 */ 407, 110, 406, 513, 514, 395, 381, 395, 424, 20, + /* 1730 */ 77, 78, 79, 395, 52, 388, 392, 84, 85, 86, + /* 1740 */ 388, 396, 392, 90, 440, 404, 442, 479, 95, 96, + /* 1750 */ 97, 98, 404, 404, 101, 20, 442, 20, 105, 106, + /* 1760 */ 107, 108, 20, 488, 469, 381, 491, 397, 404, 424, + /* 1770 */ 495, 496, 497, 498, 499, 500, 404, 502, 397, 20, + /* 1780 */ 396, 460, 20, 395, 509, 440, 404, 442, 513, 514, + /* 1790 */ 454, 404, 488, 404, 404, 491, 381, 395, 388, 495, + /* 1800 */ 496, 497, 498, 499, 500, 384, 502, 424, 424, 424, + /* 1810 */ 424, 396, 388, 509, 384, 424, 424, 513, 514, 424, + /* 1820 */ 424, 424, 483, 424, 440, 424, 442, 424, 236, 115, + /* 1830 */ 20, 402, 481, 488, 440, 479, 491, 478, 221, 424, + /* 1840 */ 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + /* 1850 */ 476, 440, 440, 220, 395, 440, 402, 442, 442, 309, + /* 1860 */ 440, 537, 308, 537, 206, 461, 317, 540, 475, 461, + /* 1870 */ 539, 319, 488, 536, 468, 491, 318, 537, 381, 495, + /* 1880 */ 496, 497, 498, 499, 500, 302, 502, 297, 526, 535, + /* 1890 */ 468, 534, 326, 396, 323, 527, 296, 321, 396, 557, + /* 1900 */ 20, 494, 125, 488, 440, 550, 491, 532, 299, 551, + /* 1910 */ 495, 496, 497, 498, 499, 500, 397, 502, 381, 461, + /* 1920 */ 402, 424, 38, 402, 440, 440, 542, 543, 440, 440, + /* 1930 */ 530, 402, 461, 396, 198, 440, 458, 440, 54, 442, + /* 1940 */ 402, 454, 115, 381, 512, 440, 198, 63, 64, 65, + /* 1950 */ 66, 440, 68, 455, 454, 402, 420, 402, 396, 396, + /* 1960 */ 440, 424, 440, 440, 440, 440, 440, 440, 440, 554, + /* 1970 */ 555, 115, 440, 440, 429, 440, 395, 440, 22, 442, + /* 1980 */ 440, 440, 440, 440, 440, 488, 424, 402, 491, 383, + /* 1990 */ 35, 440, 495, 496, 497, 498, 499, 500, 114, 502, + /* 2000 */ 440, 117, 440, 37, 442, 440, 509, 440, 440, 381, + /* 2010 */ 386, 514, 440, 387, 40, 426, 389, 388, 462, 471, + /* 2020 */ 426, 462, 418, 379, 396, 488, 487, 465, 491, 0, + /* 2030 */ 418, 381, 495, 496, 497, 498, 499, 500, 418, 502, + /* 2040 */ 0, 480, 403, 0, 47, 0, 396, 36, 242, 36, + /* 2050 */ 488, 381, 424, 491, 36, 36, 242, 495, 496, 497, + /* 2060 */ 498, 499, 500, 0, 502, 242, 396, 36, 440, 185, + /* 2070 */ 442, 36, 36, 0, 424, 242, 0, 36, 194, 0, + /* 2080 */ 543, 0, 198, 199, 36, 0, 22, 0, 204, 205, + /* 2090 */ 440, 36, 442, 465, 424, 237, 0, 223, 0, 223, + /* 2100 */ 0, 224, 217, 215, 0, 0, 211, 223, 210, 0, + /* 2110 */ 440, 0, 442, 51, 381, 157, 488, 51, 0, 491, + /* 2120 */ 36, 0, 0, 495, 496, 497, 498, 499, 500, 396, + /* 2130 */ 502, 36, 54, 0, 51, 0, 381, 47, 488, 0, + /* 2140 */ 0, 491, 0, 51, 0, 495, 496, 497, 498, 499, + /* 2150 */ 500, 396, 502, 0, 0, 0, 381, 424, 488, 0, + /* 2160 */ 0, 491, 175, 36, 0, 495, 496, 497, 498, 499, + /* 2170 */ 500, 396, 502, 440, 175, 442, 0, 0, 0, 424, + /* 2180 */ 51, 0, 0, 381, 0, 0, 0, 0, 0, 0, + /* 2190 */ 0, 0, 0, 0, 0, 440, 546, 442, 396, 424, + /* 2200 */ 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, + /* 2210 */ 0, 0, 0, 0, 0, 440, 0, 442, 22, 0, + /* 2220 */ 465, 488, 157, 156, 491, 555, 424, 0, 495, 496, + /* 2230 */ 497, 498, 499, 500, 0, 502, 0, 504, 0, 22, + /* 2240 */ 465, 155, 440, 488, 442, 22, 491, 52, 0, 0, + /* 2250 */ 495, 496, 497, 498, 499, 500, 36, 502, 0, 0, + /* 2260 */ 52, 0, 36, 488, 381, 0, 491, 68, 36, 44, + /* 2270 */ 495, 496, 497, 498, 499, 500, 54, 502, 0, 396, + /* 2280 */ 36, 44, 54, 68, 54, 44, 68, 0, 381, 36, + /* 2290 */ 488, 44, 68, 491, 0, 33, 51, 495, 496, 497, + /* 2300 */ 498, 499, 500, 396, 502, 51, 14, 424, 51, 381, + /* 2310 */ 47, 0, 45, 44, 0, 0, 0, 0, 44, 206, + /* 2320 */ 0, 51, 0, 440, 396, 442, 51, 0, 0, 381, + /* 2330 */ 54, 424, 76, 0, 0, 36, 0, 44, 36, 54, + /* 2340 */ 44, 0, 36, 54, 396, 44, 0, 440, 36, 442, + /* 2350 */ 0, 381, 424, 44, 54, 0, 0, 0, 0, 0, + /* 2360 */ 36, 121, 123, 0, 22, 22, 396, 36, 440, 22, + /* 2370 */ 442, 488, 424, 36, 491, 36, 36, 33, 495, 496, + /* 2380 */ 497, 498, 499, 500, 36, 502, 0, 36, 440, 36, + /* 2390 */ 442, 22, 0, 0, 424, 488, 36, 36, 491, 33, + /* 2400 */ 36, 36, 495, 496, 497, 498, 499, 500, 36, 502, + /* 2410 */ 440, 22, 442, 22, 381, 0, 488, 22, 56, 491, + /* 2420 */ 36, 0, 0, 495, 496, 497, 498, 499, 500, 396, + /* 2430 */ 502, 0, 0, 36, 381, 36, 488, 0, 36, 491, + /* 2440 */ 0, 22, 36, 495, 496, 497, 498, 499, 500, 396, + /* 2450 */ 502, 116, 36, 20, 36, 0, 381, 424, 488, 228, + /* 2460 */ 115, 491, 227, 192, 115, 495, 496, 497, 498, 499, + /* 2470 */ 500, 396, 502, 440, 222, 442, 51, 424, 0, 36, + /* 2480 */ 192, 22, 0, 22, 218, 0, 0, 192, 198, 192, + /* 2490 */ 3, 33, 115, 440, 116, 442, 192, 115, 36, 424, + /* 2500 */ 202, 303, 36, 116, 52, 202, 52, 33, 33, 115, + /* 2510 */ 33, 113, 111, 33, 51, 440, 116, 442, 51, 116, + /* 2520 */ 115, 488, 115, 115, 491, 116, 115, 82, 495, 496, + /* 2530 */ 497, 498, 499, 500, 33, 502, 303, 3, 115, 381, + /* 2540 */ 116, 488, 36, 116, 491, 116, 33, 36, 495, 496, + /* 2550 */ 497, 498, 499, 500, 396, 502, 36, 36, 303, 36, + /* 2560 */ 36, 381, 36, 488, 116, 116, 491, 51, 287, 33, + /* 2570 */ 495, 496, 497, 498, 499, 500, 396, 502, 381, 51, + /* 2580 */ 0, 0, 424, 115, 44, 116, 116, 115, 115, 0, + /* 2590 */ 44, 0, 44, 396, 115, 33, 113, 116, 440, 195, + /* 2600 */ 442, 2, 381, 115, 424, 113, 274, 195, 194, 199, + /* 2610 */ 22, 116, 116, 115, 115, 115, 51, 396, 251, 115, + /* 2620 */ 440, 424, 442, 115, 51, 116, 116, 115, 22, 115, + /* 2630 */ 254, 0, 115, 195, 115, 51, 44, 440, 116, 442, + /* 2640 */ 115, 22, 115, 22, 115, 424, 488, 115, 115, 491, + /* 2650 */ 22, 36, 115, 495, 496, 497, 498, 499, 500, 124, + /* 2660 */ 502, 440, 228, 442, 125, 116, 116, 115, 488, 36, + /* 2670 */ 116, 491, 381, 36, 115, 495, 496, 497, 498, 499, + /* 2680 */ 500, 36, 502, 116, 116, 488, 36, 396, 491, 381, + /* 2690 */ 116, 36, 495, 496, 497, 498, 499, 500, 116, 502, + /* 2700 */ 36, 115, 136, 33, 396, 136, 136, 136, 115, 488, + /* 2710 */ 36, 381, 491, 115, 22, 424, 495, 496, 497, 498, + /* 2720 */ 499, 500, 76, 502, 75, 22, 396, 36, 33, 36, + /* 2730 */ 36, 440, 424, 442, 36, 36, 36, 36, 36, 82, + /* 2740 */ 36, 36, 36, 109, 82, 109, 36, 36, 440, 36, + /* 2750 */ 442, 22, 381, 36, 424, 36, 36, 82, 36, 36, + /* 2760 */ 36, 36, 36, 22, 36, 0, 36, 396, 54, 0, + /* 2770 */ 440, 44, 442, 36, 0, 54, 44, 381, 36, 488, + /* 2780 */ 44, 0, 491, 36, 44, 54, 495, 496, 497, 498, + /* 2790 */ 499, 500, 396, 502, 381, 424, 488, 54, 0, 491, + /* 2800 */ 36, 0, 22, 495, 496, 497, 498, 499, 500, 396, + /* 2810 */ 502, 440, 36, 442, 0, 22, 33, 22, 488, 22, + /* 2820 */ 424, 491, 36, 36, 21, 495, 496, 497, 498, 499, + /* 2830 */ 500, 22, 502, 21, 558, 20, 440, 424, 442, 558, + /* 2840 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 2850 */ 558, 558, 558, 440, 558, 442, 558, 381, 558, 488, + /* 2860 */ 558, 558, 491, 558, 558, 558, 495, 496, 497, 498, + /* 2870 */ 499, 500, 396, 502, 558, 558, 558, 558, 558, 558, + /* 2880 */ 558, 558, 558, 558, 488, 558, 558, 491, 558, 558, + /* 2890 */ 558, 495, 496, 497, 498, 499, 500, 558, 502, 381, + /* 2900 */ 424, 488, 558, 558, 491, 558, 558, 558, 495, 496, + /* 2910 */ 497, 498, 499, 500, 396, 502, 440, 558, 442, 558, + /* 2920 */ 558, 558, 558, 381, 558, 558, 558, 558, 558, 558, + /* 2930 */ 558, 558, 558, 558, 558, 558, 558, 558, 396, 558, + /* 2940 */ 558, 558, 424, 558, 558, 558, 558, 558, 558, 558, + /* 2950 */ 558, 558, 558, 558, 558, 558, 558, 558, 440, 558, + /* 2960 */ 442, 558, 558, 558, 488, 558, 424, 491, 558, 558, + /* 2970 */ 558, 495, 496, 497, 498, 499, 500, 558, 502, 558, + /* 2980 */ 558, 558, 440, 558, 442, 558, 558, 558, 558, 558, + /* 2990 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3000 */ 558, 558, 558, 558, 558, 558, 488, 558, 558, 491, + /* 3010 */ 558, 558, 558, 495, 496, 497, 498, 499, 500, 558, + /* 3020 */ 502, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3030 */ 488, 558, 558, 491, 558, 558, 558, 495, 496, 497, + /* 3040 */ 498, 499, 500, 558, 502, 558, 558, 558, 558, 558, + /* 3050 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3060 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3070 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3080 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3090 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3100 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3110 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3120 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3130 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3140 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3150 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3160 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3170 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3180 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3190 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3200 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + /* 3210 */ 558, 558, 558, 558, 378, 378, 378, 378, 378, 378, + /* 3220 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3230 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3240 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3250 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3260 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3270 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3280 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3290 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3300 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3310 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3320 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3330 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3340 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3350 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3360 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3370 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3380 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3390 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3400 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3410 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + /* 3420 */ 378, 378, 378, }; -#define YY_SHIFT_COUNT (966) +#define YY_SHIFT_COUNT (971) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2671) +#define YY_SHIFT_MAX (2815) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 430, 0, 260, 0, 521, 521, 521, 521, 521, 521, - /* 10 */ 521, 521, 521, 521, 521, 521, 781, 1041, 1041, 1301, - /* 20 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - /* 30 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - /* 40 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, - /* 50 */ 323, 520, 342, 178, 131, 254, 131, 131, 178, 178, - /* 60 */ 131, 82, 131, 259, 82, 101, 131, 127, 1211, 515, - /* 70 */ 515, 156, 156, 1211, 1211, 61, 61, 515, 434, 593, - /* 80 */ 296, 296, 118, 156, 156, 156, 156, 156, 156, 156, - /* 90 */ 156, 156, 156, 156, 261, 337, 383, 156, 156, 255, - /* 100 */ 127, 156, 261, 156, 127, 156, 156, 156, 156, 127, - /* 110 */ 156, 156, 127, 156, 127, 127, 127, 156, 579, 112, - /* 120 */ 112, 439, 439, 620, 1040, 15, 437, 516, 516, 516, - /* 130 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - /* 140 */ 516, 516, 516, 516, 516, 516, 576, 689, 434, 593, - /* 150 */ 1006, 1006, 942, 903, 903, 903, 68, 68, 989, 792, - /* 160 */ 942, 255, 127, 291, 127, 127, 396, 127, 127, 743, - /* 170 */ 127, 743, 743, 772, 993, 439, 439, 439, 439, 439, - /* 180 */ 439, 1609, 1740, 335, 392, 191, 191, 814, 336, 33, - /* 190 */ 213, 256, 274, 698, 823, 278, 278, 744, 690, 815, - /* 200 */ 132, 132, 132, 714, 132, 932, 679, 138, 476, 905, - /* 210 */ 475, 1014, 476, 476, 696, 1138, 1138, 1068, 13, 981, - /* 220 */ 792, 1367, 1613, 1650, 1657, 1449, 255, 1657, 255, 1474, - /* 230 */ 1650, 1668, 1644, 1668, 1644, 1509, 1650, 1668, 1650, 1644, - /* 240 */ 1509, 1509, 1509, 1594, 1597, 1650, 1650, 1605, 1650, 1650, - /* 250 */ 1650, 1699, 1672, 1699, 1672, 1657, 255, 255, 1713, 255, - /* 260 */ 1724, 1726, 255, 1724, 255, 1735, 255, 1741, 255, 255, - /* 270 */ 1650, 255, 1699, 127, 127, 127, 127, 127, 127, 127, - /* 280 */ 127, 127, 127, 127, 1650, 993, 993, 1699, 743, 743, - /* 290 */ 743, 1553, 1681, 1657, 579, 1783, 1593, 1596, 1713, 579, - /* 300 */ 1367, 1650, 743, 1520, 1532, 1520, 1532, 1525, 1638, 1520, - /* 310 */ 1533, 1541, 1570, 1367, 1577, 1584, 1555, 1569, 1574, 1668, - /* 320 */ 1875, 1778, 1606, 1724, 579, 579, 1532, 743, 743, 743, - /* 330 */ 743, 1532, 743, 1716, 579, 743, 1741, 579, 1810, 743, - /* 340 */ 1732, 1741, 579, 772, 579, 1668, 743, 743, 743, 743, - /* 350 */ 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, - /* 360 */ 743, 743, 743, 743, 743, 743, 743, 743, 1831, 743, - /* 370 */ 1650, 579, 1924, 1911, 1699, 3285, 3285, 3285, 3285, 3285, - /* 380 */ 3285, 3285, 3285, 3285, 3285, 3285, 3285, 1502, 1873, 23, - /* 390 */ 830, 945, 648, 1358, 309, 1408, 48, 819, 856, 63, - /* 400 */ 63, 63, 63, 63, 63, 63, 63, 63, 232, 452, - /* 410 */ 224, 650, 533, 533, 487, 286, 560, 788, 10, 10, - /* 420 */ 760, 770, 10, 708, 1091, 1179, 936, 982, 982, 794, - /* 430 */ 1096, 739, 794, 794, 794, 1287, 1256, 1241, 1322, 769, - /* 440 */ 1191, 1352, 1266, 1277, 1279, 1281, 1022, 1391, 1395, 1079, - /* 450 */ 1354, 1414, 1418, 1209, 1372, 1404, 1366, 1405, 1409, 1416, - /* 460 */ 1422, 1294, 1296, 1376, 1423, 1431, 1432, 1445, 1433, 1374, - /* 470 */ 1434, 1400, 1435, 1459, 1460, 1461, 1471, 1473, 1476, 1483, - /* 480 */ 1491, 1493, 1495, 1497, 1499, 1510, 1521, 1503, 1508, 1512, - /* 490 */ 1540, 1544, 1550, 1506, 1575, 1437, 1505, 1600, 1601, 1579, - /* 500 */ 1615, 1970, 1988, 2015, 1974, 2016, 1984, 1781, 1986, 1987, - /* 510 */ 1989, 1784, 2027, 1991, 1992, 1789, 1994, 2041, 2042, 1792, - /* 520 */ 2034, 1998, 2036, 2000, 2038, 2017, 2043, 2009, 1812, 2049, - /* 530 */ 1828, 2059, 1838, 1839, 1845, 1849, 2064, 2065, 2072, 1857, - /* 540 */ 1859, 2069, 2074, 1920, 2028, 2029, 2080, 2044, 2082, 2083, - /* 550 */ 2047, 2032, 2086, 2037, 2088, 2046, 2090, 2093, 2094, 2048, - /* 560 */ 2100, 2101, 2102, 2103, 2104, 2105, 1922, 2060, 2106, 1933, - /* 570 */ 2108, 2109, 2110, 2112, 2113, 2115, 2116, 2117, 2118, 2119, - /* 580 */ 2120, 2121, 2122, 2123, 2125, 2126, 2127, 2128, 2129, 2131, - /* 590 */ 2084, 2132, 2087, 2135, 2136, 2138, 2139, 2141, 2142, 2150, - /* 600 */ 2153, 2155, 2134, 2157, 2003, 2159, 2006, 2161, 2010, 2162, - /* 610 */ 2164, 2143, 2124, 2144, 2130, 2169, 2107, 2172, 2111, 2140, - /* 620 */ 2173, 2133, 2176, 2137, 2179, 2180, 2145, 2148, 2147, 2183, - /* 630 */ 2149, 2152, 2151, 2184, 2154, 2156, 2160, 2185, 2165, 2188, - /* 640 */ 2146, 2163, 2174, 2158, 2167, 2182, 2168, 2197, 2166, 2171, - /* 650 */ 2198, 2215, 2220, 2221, 2186, 2026, 2222, 2158, 2187, 2232, - /* 660 */ 2158, 2189, 2233, 2234, 2175, 2236, 2241, 2211, 2199, 2210, - /* 670 */ 2254, 2218, 2204, 2217, 2261, 2226, 2212, 2231, 2272, 2238, - /* 680 */ 2223, 2235, 2277, 2279, 2280, 2281, 2282, 2283, 2177, 2170, - /* 690 */ 2247, 2263, 2286, 2265, 2251, 2257, 2258, 2260, 2264, 2266, - /* 700 */ 2268, 2269, 2284, 2267, 2276, 2285, 2287, 2274, 2288, 2291, - /* 710 */ 2295, 2298, 2301, 2327, 2306, 2289, 2329, 2309, 2297, 2335, - /* 720 */ 2337, 2338, 2302, 2340, 2304, 2342, 2308, 2343, 2325, 2330, - /* 730 */ 2314, 2315, 2316, 2239, 2243, 2355, 2178, 2191, 2181, 2244, - /* 740 */ 2193, 2158, 2312, 2361, 2192, 2336, 2350, 2374, 2194, 2353, - /* 750 */ 2195, 2201, 2379, 2380, 2196, 2208, 2200, 2209, 2378, 2349, - /* 760 */ 2097, 2270, 2273, 2271, 2275, 2352, 2359, 2278, 2364, 2300, - /* 770 */ 2365, 2290, 2305, 2384, 2386, 2307, 2323, 2326, 2328, 2310, - /* 780 */ 2388, 2373, 2389, 2331, 2395, 2203, 2348, 2341, 2397, 2332, - /* 790 */ 2406, 2344, 2346, 2454, 2425, 2205, 2426, 2427, 2428, 2429, - /* 800 */ 2430, 2431, 2354, 2356, 2412, 2206, 2440, 2424, 2475, 2477, - /* 810 */ 2366, 2435, 2367, 2368, 2370, 2371, 2292, 2376, 2479, 2438, - /* 820 */ 2293, 2487, 2381, 2383, 2299, 2451, 2317, 2462, 2387, 2225, - /* 830 */ 2390, 2498, 2481, 2262, 2393, 2396, 2399, 2400, 2401, 2402, - /* 840 */ 2405, 2407, 2459, 2409, 2410, 2470, 2416, 2512, 2248, 2422, - /* 850 */ 2423, 2538, 2432, 2434, 2345, 2497, 2436, 2418, 2158, 2492, - /* 860 */ 2437, 2439, 2441, 2443, 2444, 2419, 2522, 2523, 2524, 2322, - /* 870 */ 2450, 2517, 2530, 2455, 2453, 2535, 2457, 2458, 2537, 2399, - /* 880 */ 2460, 2539, 2400, 2463, 2540, 2401, 2464, 2543, 2402, 2447, - /* 890 */ 2452, 2461, 2465, 2472, 2552, 2483, 2561, 2485, 2552, 2552, - /* 900 */ 2579, 2527, 2529, 2582, 2568, 2569, 2571, 2573, 2575, 2576, - /* 910 */ 2577, 2578, 2580, 2581, 2583, 2542, 2508, 2544, 2511, 2588, - /* 920 */ 2587, 2589, 2591, 2608, 2594, 2596, 2597, 2551, 2267, 2599, - /* 930 */ 2276, 2600, 2601, 2603, 2604, 2620, 2606, 2644, 2609, 2592, - /* 940 */ 2605, 2647, 2612, 2602, 2611, 2656, 2621, 2607, 2614, 2659, - /* 950 */ 2624, 2610, 2619, 2664, 2630, 2665, 2648, 2632, 2671, 2650, - /* 960 */ 2640, 2652, 2655, 2657, 2666, 2660, 2670, + /* 0 */ 1307, 0, 261, 0, 523, 523, 523, 523, 523, 523, + /* 10 */ 523, 523, 523, 523, 523, 523, 784, 1045, 1045, 1306, + /* 20 */ 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + /* 30 */ 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + /* 40 */ 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + /* 50 */ 65, 315, 521, 6, 208, 335, 208, 208, 6, 6, + /* 60 */ 208, 851, 208, 260, 851, 205, 208, 200, 1378, 337, + /* 70 */ 337, 215, 215, 1378, 1378, 907, 907, 337, 20, 293, + /* 80 */ 262, 262, 423, 215, 215, 215, 215, 215, 215, 215, + /* 90 */ 215, 215, 215, 215, 334, 382, 419, 215, 215, 400, + /* 100 */ 200, 215, 334, 215, 200, 215, 215, 215, 215, 200, + /* 110 */ 215, 215, 200, 215, 200, 200, 200, 215, 590, 216, + /* 120 */ 216, 437, 437, 1002, 1653, 13, 69, 393, 393, 393, + /* 130 */ 393, 393, 393, 393, 393, 393, 393, 393, 393, 393, + /* 140 */ 393, 393, 393, 393, 393, 393, 438, 623, 20, 293, + /* 150 */ 776, 776, 503, 352, 352, 352, 331, 331, 386, 1003, + /* 160 */ 503, 400, 200, 560, 200, 200, 430, 200, 200, 767, + /* 170 */ 200, 767, 767, 752, 957, 437, 437, 437, 437, 437, + /* 180 */ 437, 1473, 1084, 21, 58, 100, 100, 15, 67, 288, + /* 190 */ 105, 274, 264, 651, 988, 706, 706, 621, 919, 811, + /* 200 */ 134, 134, 134, 404, 134, 622, 1234, 668, 947, 1000, + /* 210 */ 890, 940, 947, 947, 1157, 1133, 1133, 504, 1068, 538, + /* 220 */ 1003, 1361, 1610, 1646, 1648, 1443, 400, 1648, 400, 1467, + /* 230 */ 1646, 1662, 1637, 1662, 1637, 1501, 1646, 1662, 1646, 1637, + /* 240 */ 1501, 1501, 1501, 1591, 1602, 1646, 1646, 1611, 1646, 1646, + /* 250 */ 1646, 1709, 1682, 1709, 1682, 1648, 400, 400, 1735, 400, + /* 260 */ 1737, 1742, 400, 1737, 400, 1759, 400, 1762, 400, 400, + /* 270 */ 1646, 400, 1709, 200, 200, 200, 200, 200, 200, 200, + /* 280 */ 200, 200, 200, 200, 1646, 957, 957, 1709, 767, 767, + /* 290 */ 767, 1592, 1714, 1648, 590, 1810, 1617, 1633, 1735, 590, + /* 300 */ 1361, 1646, 767, 1550, 1554, 1550, 1554, 1549, 1658, 1550, + /* 310 */ 1552, 1558, 1583, 1361, 1590, 1600, 1566, 1571, 1576, 1662, + /* 320 */ 1880, 1777, 1609, 1737, 590, 590, 1554, 767, 767, 767, + /* 330 */ 767, 1554, 767, 1736, 590, 767, 1762, 590, 1827, 767, + /* 340 */ 1748, 1762, 590, 752, 590, 1662, 767, 767, 767, 767, + /* 350 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 360 */ 767, 767, 767, 767, 767, 767, 767, 767, 1856, 767, + /* 370 */ 1646, 590, 1956, 1955, 1966, 1974, 1709, 3045, 3045, 3045, + /* 380 */ 3045, 3045, 3045, 3045, 3045, 3045, 3045, 3045, 3045, 39, + /* 390 */ 1884, 214, 648, 606, 395, 615, 456, 1343, 1217, 600, + /* 400 */ 611, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + /* 410 */ 926, 656, 225, 569, 795, 795, 644, 791, 414, 815, + /* 420 */ 620, 620, 298, 551, 620, 155, 1258, 1259, 832, 882, + /* 430 */ 882, 1273, 1247, 697, 1273, 1273, 1273, 1270, 32, 1090, + /* 440 */ 1360, 1252, 1168, 1346, 1373, 1266, 1287, 1305, 1309, 1325, + /* 450 */ 1353, 1398, 982, 1431, 1444, 1445, 987, 1335, 1365, 1367, + /* 460 */ 1379, 1409, 1414, 1419, 1311, 1329, 1334, 1363, 1426, 1465, + /* 470 */ 1475, 1468, 1328, 1469, 1405, 1470, 1472, 1476, 1496, 1477, + /* 480 */ 1481, 1531, 1534, 1570, 1586, 1596, 1598, 1601, 1603, 1605, + /* 490 */ 1491, 1507, 1516, 1517, 1547, 1587, 522, 1449, 1413, 1442, + /* 500 */ 1452, 1486, 1474, 1428, 2029, 2040, 2043, 1997, 2045, 2011, + /* 510 */ 1806, 2013, 2018, 2019, 1814, 2063, 2031, 2035, 1823, 2036, + /* 520 */ 2073, 2079, 1833, 2076, 2041, 2081, 2048, 2085, 2064, 2087, + /* 530 */ 2055, 1858, 2096, 1874, 2098, 1876, 1877, 1885, 1888, 2100, + /* 540 */ 2104, 2105, 1895, 1898, 2109, 2111, 1958, 2062, 2066, 2118, + /* 550 */ 2084, 2121, 2122, 2095, 2078, 2133, 2083, 2135, 2090, 2139, + /* 560 */ 2140, 2142, 2092, 2144, 2153, 2154, 2155, 2159, 2160, 1987, + /* 570 */ 2127, 2164, 1999, 2176, 2177, 2178, 2184, 2185, 2186, 2187, + /* 580 */ 2188, 2189, 2190, 2191, 2192, 2193, 2194, 2200, 2201, 2202, + /* 590 */ 2203, 2204, 2205, 2129, 2181, 2161, 2182, 2206, 2207, 2209, + /* 600 */ 2210, 2211, 2212, 2213, 2214, 2196, 2216, 2065, 2219, 2067, + /* 610 */ 2227, 2086, 2234, 2236, 2217, 2195, 2223, 2208, 2238, 2199, + /* 620 */ 2248, 2215, 2220, 2249, 2218, 2258, 2224, 2259, 2261, 2226, + /* 630 */ 2222, 2225, 2265, 2232, 2228, 2237, 2278, 2244, 2230, 2241, + /* 640 */ 2287, 2253, 2294, 2263, 2247, 2262, 2245, 2254, 2292, 2257, + /* 650 */ 2311, 2267, 2269, 2314, 2315, 2316, 2317, 2274, 2113, 2320, + /* 660 */ 2245, 2270, 2322, 2245, 2275, 2327, 2328, 2256, 2333, 2334, + /* 670 */ 2299, 2276, 2293, 2336, 2302, 2285, 2296, 2341, 2306, 2289, + /* 680 */ 2301, 2346, 2312, 2300, 2309, 2350, 2355, 2356, 2357, 2358, + /* 690 */ 2359, 2239, 2240, 2324, 2342, 2363, 2343, 2331, 2337, 2339, + /* 700 */ 2340, 2348, 2351, 2353, 2360, 2361, 2344, 2366, 2364, 2365, + /* 710 */ 2347, 2372, 2386, 2369, 2392, 2389, 2393, 2391, 2362, 2415, + /* 720 */ 2395, 2384, 2421, 2422, 2431, 2397, 2432, 2399, 2437, 2402, + /* 730 */ 2440, 2419, 2433, 2406, 2416, 2418, 2335, 2345, 2455, 2271, + /* 740 */ 2231, 2235, 2349, 2252, 2245, 2425, 2478, 2288, 2443, 2459, + /* 750 */ 2482, 2266, 2461, 2295, 2290, 2485, 2486, 2297, 2298, 2304, + /* 760 */ 2303, 2487, 2458, 2198, 2377, 2378, 2382, 2387, 2462, 2466, + /* 770 */ 2394, 2452, 2398, 2454, 2401, 2400, 2474, 2475, 2403, 2405, + /* 780 */ 2407, 2408, 2409, 2477, 2463, 2467, 2411, 2480, 2233, 2445, + /* 790 */ 2424, 2501, 2423, 2506, 2427, 2429, 2534, 2513, 2255, 2511, + /* 800 */ 2520, 2521, 2523, 2524, 2526, 2448, 2449, 2516, 2281, 2536, + /* 810 */ 2528, 2580, 2581, 2468, 2540, 2469, 2470, 2472, 2473, 2404, + /* 820 */ 2479, 2589, 2546, 2410, 2591, 2481, 2488, 2412, 2548, 2414, + /* 830 */ 2562, 2483, 2332, 2492, 2599, 2588, 2367, 2495, 2496, 2498, + /* 840 */ 2499, 2500, 2504, 2508, 2509, 2565, 2512, 2514, 2573, 2510, + /* 850 */ 2606, 2376, 2517, 2519, 2631, 2522, 2525, 2438, 2592, 2527, + /* 860 */ 2535, 2245, 2584, 2529, 2532, 2549, 2533, 2537, 2539, 2619, + /* 870 */ 2621, 2628, 2434, 2550, 2615, 2633, 2552, 2554, 2637, 2559, + /* 880 */ 2567, 2645, 2498, 2568, 2650, 2499, 2574, 2655, 2500, 2582, + /* 890 */ 2664, 2504, 2566, 2569, 2570, 2571, 2586, 2670, 2593, 2674, + /* 900 */ 2598, 2670, 2670, 2692, 2646, 2649, 2703, 2691, 2693, 2694, + /* 910 */ 2698, 2699, 2700, 2701, 2702, 2704, 2705, 2706, 2657, 2634, + /* 920 */ 2662, 2636, 2695, 2710, 2711, 2713, 2729, 2717, 2719, 2720, + /* 930 */ 2675, 2344, 2722, 2366, 2723, 2724, 2725, 2726, 2741, 2728, + /* 940 */ 2765, 2730, 2714, 2727, 2769, 2737, 2721, 2732, 2774, 2742, + /* 950 */ 2731, 2736, 2781, 2747, 2743, 2740, 2798, 2764, 2801, 2780, + /* 960 */ 2776, 2814, 2793, 2783, 2786, 2787, 2795, 2803, 2797, 2809, + /* 970 */ 2812, 2815, }; -#define YY_REDUCE_COUNT (386) -#define YY_REDUCE_MIN (-518) -#define YY_REDUCE_MAX (2785) +#define YY_REDUCE_COUNT (388) +#define YY_REDUCE_MIN (-502) +#define YY_REDUCE_MAX (2542) static const short yy_reduce_ofst[] = { - /* 0 */ 638, -351, -264, 115, 375, 418, 445, 589, 675, 711, - /* 10 */ 194, 849, 896, 1033, 1242, 1271, 1369, 1393, 1462, 1479, - /* 20 */ 1559, 1652, 1731, 1750, 1774, 1819, 1871, 1909, 1939, 1956, - /* 30 */ 2033, 2067, 2096, 2190, 2214, 2229, 2259, 2311, 2347, 2377, - /* 40 */ 2394, 2471, 2505, 2534, 2595, 2628, 2705, 2722, 2748, 2785, - /* 50 */ -348, -338, 813, -383, -341, 472, 694, 885, -296, -231, - /* 60 */ 913, 484, -518, 150, 332, -511, -301, -318, -406, -354, - /* 70 */ 145, -376, 266, -419, 218, -196, -61, -436, -381, 245, - /* 80 */ -236, 506, -320, -294, 310, 466, 496, -253, 236, 595, - /* 90 */ 599, 601, 680, 407, -48, -182, -364, 697, 718, -175, - /* 100 */ -299, 727, 555, 749, -410, 761, 783, 785, 797, 172, - /* 110 */ 801, 833, 478, 835, -76, 480, 513, 842, 308, -506, - /* 120 */ -506, 20, -185, 168, -369, -516, -289, -265, 159, 465, - /* 130 */ 467, 597, 678, 725, 763, 777, 800, 838, 879, 881, - /* 140 */ 882, 883, 887, 888, 889, 891, 77, 152, 88, 618, - /* 150 */ 853, 855, 858, 152, 360, 642, -16, 339, 859, 453, - /* 160 */ 866, -19, 353, 608, 839, 845, 564, 862, 209, 893, - /* 170 */ 911, 927, 941, 933, 996, 553, 827, 997, 1031, 1047, - /* 180 */ 1049, 766, 871, 768, 1063, 977, 977, 946, 974, 1000, - /* 190 */ 1019, 1158, 977, 1190, 1190, 1210, 1212, 1175, 1235, 1180, - /* 200 */ 1090, 1092, 1093, 1169, 1095, 1190, 1243, 1154, 1192, 1248, - /* 210 */ 1207, 1174, 1196, 1197, 1190, 1123, 1124, 1104, 1140, 1126, - /* 220 */ 1246, 1193, 1181, 1283, 1202, 1201, 1282, 1208, 1284, 1220, - /* 230 */ 1297, 1298, 1247, 1302, 1250, 1251, 1306, 1307, 1309, 1257, - /* 240 */ 1259, 1261, 1262, 1304, 1308, 1319, 1321, 1312, 1324, 1325, - /* 250 */ 1326, 1335, 1337, 1339, 1340, 1252, 1330, 1331, 1303, 1342, - /* 260 */ 1351, 1285, 1346, 1356, 1353, 1314, 1357, 1318, 1359, 1371, - /* 270 */ 1382, 1375, 1390, 1362, 1363, 1364, 1368, 1370, 1373, 1377, - /* 280 */ 1378, 1379, 1380, 1384, 1386, 1396, 1397, 1402, 1355, 1360, - /* 290 */ 1383, 1313, 1332, 1320, 1410, 1336, 1348, 1347, 1387, 1428, - /* 300 */ 1385, 1430, 1401, 1299, 1394, 1315, 1398, 1311, 1317, 1341, - /* 310 */ 1327, 1344, 1343, 1412, 1381, 1361, 1328, 1345, 1349, 1504, - /* 320 */ 1407, 1388, 1392, 1513, 1507, 1511, 1451, 1466, 1475, 1477, - /* 330 */ 1478, 1453, 1484, 1465, 1523, 1486, 1480, 1526, 1419, 1490, - /* 340 */ 1482, 1492, 1531, 1524, 1543, 1551, 1514, 1516, 1528, 1529, - /* 350 */ 1542, 1545, 1546, 1547, 1554, 1556, 1557, 1558, 1560, 1562, - /* 360 */ 1563, 1564, 1565, 1566, 1567, 1568, 1571, 1572, 1522, 1573, - /* 370 */ 1576, 1561, 1580, 1583, 1578, 1519, 1588, 1534, 1500, 1548, - /* 380 */ 1581, 1591, 1602, 1589, 1604, 1592, 1603, + /* 0 */ -66, -338, -147, 159, 192, 330, 418, 452, 591, 714, + /* 10 */ 777, 941, 973, 1210, 1275, 1304, 1345, 1384, 1415, 1497, + /* 20 */ 1537, 1562, 1628, 1650, 1670, 1733, 1755, 1775, 1802, 1883, + /* 30 */ 1907, 1928, 1948, 1970, 2033, 2053, 2075, 2158, 2180, 2197, + /* 40 */ 2221, 2291, 2308, 2330, 2371, 2396, 2413, 2476, 2518, 2542, + /* 50 */ -340, -355, -183, -191, -442, 350, 459, 471, -334, 630, + /* 60 */ 872, 241, -488, -159, 365, -445, -44, 117, -411, 206, + /* 70 */ 398, -378, 450, -254, 213, -390, -388, -350, -256, -431, + /* 80 */ 287, 376, 427, -361, 95, 495, 526, -169, 505, 549, + /* 90 */ 575, 583, 598, 533, -11, -241, 439, 614, 682, -198, + /* 100 */ 317, 711, 230, 769, -87, 771, 780, 792, 803, 645, + /* 110 */ 842, 844, 810, 848, 296, 823, 834, 856, -60, -502, + /* 120 */ -502, -277, -424, 48, -324, -360, -65, 281, 472, 499, + /* 130 */ 565, 577, 581, 715, 743, 827, 843, 880, 883, 901, + /* 140 */ 946, 952, 954, 955, 959, 962, -237, -273, -105, 322, + /* 150 */ 659, 708, 762, -273, 231, 466, 143, 362, -319, 198, + /* 160 */ 794, -232, 193, 610, 138, 464, 429, 897, 122, 894, + /* 170 */ 905, 935, 945, 733, 809, -410, 460, 597, 669, 674, + /* 180 */ 686, 805, 925, 1035, 980, 968, 968, 948, 963, 974, + /* 190 */ 989, 1118, 968, 1094, 1094, 1116, 1122, 1107, 1195, 1141, + /* 200 */ 1075, 1077, 1080, 1159, 1082, 1094, 1232, 1146, 1183, 1241, + /* 210 */ 1199, 1165, 1187, 1188, 1094, 1114, 1125, 1105, 1140, 1126, + /* 220 */ 1246, 1193, 1175, 1278, 1191, 1190, 1272, 1200, 1274, 1211, + /* 230 */ 1288, 1290, 1238, 1292, 1240, 1245, 1297, 1298, 1300, 1244, + /* 240 */ 1251, 1256, 1265, 1308, 1313, 1319, 1323, 1316, 1330, 1332, + /* 250 */ 1338, 1347, 1344, 1352, 1350, 1268, 1341, 1348, 1314, 1349, + /* 260 */ 1370, 1295, 1364, 1381, 1372, 1321, 1382, 1336, 1387, 1389, + /* 270 */ 1388, 1390, 1410, 1383, 1385, 1386, 1391, 1392, 1395, 1396, + /* 280 */ 1397, 1399, 1401, 1403, 1402, 1421, 1430, 1424, 1394, 1411, + /* 290 */ 1412, 1339, 1351, 1356, 1429, 1359, 1374, 1393, 1416, 1454, + /* 300 */ 1406, 1459, 1420, 1324, 1404, 1326, 1408, 1327, 1331, 1340, + /* 310 */ 1337, 1354, 1357, 1422, 1368, 1362, 1342, 1358, 1355, 1502, + /* 320 */ 1407, 1375, 1400, 1519, 1518, 1521, 1458, 1464, 1484, 1485, + /* 330 */ 1488, 1471, 1489, 1478, 1529, 1495, 1487, 1538, 1432, 1505, + /* 340 */ 1498, 1500, 1553, 1536, 1555, 1563, 1511, 1520, 1522, 1523, + /* 350 */ 1524, 1525, 1526, 1527, 1528, 1532, 1533, 1535, 1540, 1541, + /* 360 */ 1542, 1543, 1544, 1551, 1560, 1565, 1567, 1568, 1545, 1572, + /* 370 */ 1581, 1585, 1606, 1624, 1626, 1627, 1629, 1548, 1589, 1539, + /* 380 */ 1561, 1556, 1559, 1604, 1612, 1594, 1620, 1639, 1644, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 10 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 20 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 30 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 40 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 50 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 60 */ 2552, 2183, 2183, 2508, 2183, 2183, 2183, 2183, 2183, 2183, - /* 70 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2515, 2183, - /* 80 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 90 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2285, - /* 100 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 110 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2283, 2804, - /* 120 */ 2183, 2930, 2593, 2183, 2183, 2833, 2183, 2183, 2183, 2183, - /* 130 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 140 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2816, 2183, 2183, - /* 150 */ 2256, 2256, 2183, 2816, 2816, 2816, 2776, 2776, 2283, 2183, - /* 160 */ 2183, 2285, 2183, 2595, 2183, 2183, 2183, 2183, 2183, 2183, - /* 170 */ 2183, 2183, 2183, 2425, 2213, 2183, 2183, 2183, 2183, 2183, - /* 180 */ 2183, 2578, 2183, 2183, 2862, 2808, 2809, 2924, 2183, 2865, - /* 190 */ 2827, 2183, 2822, 2183, 2183, 2183, 2183, 2520, 2183, 2852, - /* 200 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2621, 2183, 2183, - /* 210 */ 2370, 2572, 2183, 2183, 2183, 2183, 2183, 2908, 2806, 2846, - /* 220 */ 2183, 2856, 2183, 2183, 2183, 2609, 2285, 2183, 2285, 2565, - /* 230 */ 2503, 2183, 2513, 2183, 2513, 2510, 2183, 2183, 2183, 2513, - /* 240 */ 2510, 2510, 2510, 2359, 2355, 2183, 2183, 2353, 2183, 2183, - /* 250 */ 2183, 2183, 2239, 2183, 2239, 2183, 2285, 2285, 2183, 2285, - /* 260 */ 2183, 2183, 2285, 2183, 2285, 2183, 2285, 2183, 2285, 2285, - /* 270 */ 2183, 2285, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 280 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 290 */ 2183, 2607, 2588, 2183, 2283, 2183, 2576, 2574, 2183, 2283, - /* 300 */ 2856, 2183, 2183, 2878, 2873, 2878, 2873, 2892, 2888, 2878, - /* 310 */ 2897, 2894, 2858, 2856, 2839, 2835, 2927, 2914, 2910, 2183, - /* 320 */ 2183, 2844, 2842, 2183, 2283, 2283, 2873, 2183, 2183, 2183, - /* 330 */ 2183, 2873, 2183, 2183, 2283, 2183, 2183, 2283, 2183, 2183, - /* 340 */ 2183, 2183, 2283, 2183, 2283, 2183, 2183, 2183, 2183, 2183, - /* 350 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 360 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2387, 2183, - /* 370 */ 2183, 2283, 2183, 2223, 2183, 2567, 2930, 2593, 2598, 2548, - /* 380 */ 2548, 2428, 2428, 2930, 2428, 2286, 2188, 2183, 2183, 2183, - /* 390 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2891, - /* 400 */ 2890, 2727, 2183, 2780, 2779, 2778, 2769, 2726, 2383, 2183, - /* 410 */ 2183, 2183, 2725, 2724, 2183, 2183, 2183, 2183, 2374, 2371, - /* 420 */ 2183, 2183, 2396, 2183, 2183, 2183, 2183, 2539, 2538, 2718, - /* 430 */ 2183, 2183, 2719, 2717, 2716, 2183, 2183, 2183, 2183, 2183, - /* 440 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 450 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 460 */ 2183, 2183, 2911, 2915, 2183, 2183, 2183, 2805, 2183, 2183, - /* 470 */ 2183, 2697, 2183, 2183, 2183, 2183, 2665, 2660, 2651, 2642, - /* 480 */ 2657, 2648, 2636, 2654, 2645, 2633, 2630, 2183, 2183, 2183, - /* 490 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 500 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 510 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 520 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 530 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 540 */ 2183, 2183, 2183, 2509, 2183, 2183, 2183, 2183, 2183, 2183, - /* 550 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 560 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 570 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 580 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 590 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 600 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2524, 2183, - /* 610 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 620 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 630 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 640 */ 2183, 2183, 2228, 2704, 2183, 2183, 2183, 2183, 2183, 2183, - /* 650 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2707, 2183, 2183, - /* 660 */ 2708, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 670 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 680 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 690 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 700 */ 2183, 2183, 2183, 2330, 2329, 2183, 2183, 2183, 2183, 2183, - /* 710 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 720 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 730 */ 2183, 2183, 2183, 2709, 2183, 2183, 2183, 2183, 2592, 2183, - /* 740 */ 2183, 2699, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 750 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2907, 2859, - /* 760 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 770 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 780 */ 2183, 2183, 2697, 2183, 2889, 2183, 2183, 2183, 2183, 2183, - /* 790 */ 2183, 2183, 2905, 2183, 2909, 2183, 2183, 2183, 2183, 2183, - /* 800 */ 2183, 2183, 2815, 2811, 2183, 2183, 2807, 2183, 2183, 2183, - /* 810 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 820 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2766, 2183, 2183, - /* 830 */ 2183, 2800, 2183, 2183, 2183, 2183, 2424, 2423, 2422, 2421, - /* 840 */ 2183, 2183, 2183, 2183, 2183, 2183, 2709, 2183, 2712, 2183, - /* 850 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2696, 2183, - /* 860 */ 2751, 2750, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 870 */ 2183, 2183, 2183, 2418, 2183, 2183, 2183, 2183, 2183, 2183, - /* 880 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2402, - /* 890 */ 2400, 2399, 2398, 2183, 2435, 2183, 2183, 2183, 2431, 2430, - /* 900 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 910 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2304, - /* 920 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2296, 2183, - /* 930 */ 2295, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 940 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 950 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, - /* 960 */ 2212, 2183, 2183, 2183, 2183, 2183, 2183, + /* 0 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 10 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 20 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 30 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 40 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 50 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 60 */ 2569, 2195, 2195, 2525, 2195, 2195, 2195, 2195, 2195, 2195, + /* 70 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2532, 2195, + /* 80 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 90 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2301, + /* 100 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 110 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2299, 2821, + /* 120 */ 2195, 2947, 2610, 2195, 2195, 2850, 2195, 2195, 2195, 2195, + /* 130 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 140 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2833, 2195, 2195, + /* 150 */ 2272, 2272, 2195, 2833, 2833, 2833, 2793, 2793, 2299, 2195, + /* 160 */ 2195, 2301, 2195, 2612, 2195, 2195, 2195, 2195, 2195, 2195, + /* 170 */ 2195, 2195, 2195, 2441, 2225, 2195, 2195, 2195, 2195, 2195, + /* 180 */ 2195, 2595, 2195, 2195, 2879, 2825, 2826, 2941, 2195, 2882, + /* 190 */ 2844, 2195, 2839, 2195, 2195, 2195, 2195, 2537, 2195, 2869, + /* 200 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2638, 2195, 2195, + /* 210 */ 2386, 2589, 2195, 2195, 2195, 2195, 2195, 2925, 2823, 2863, + /* 220 */ 2195, 2873, 2195, 2195, 2195, 2626, 2301, 2195, 2301, 2582, + /* 230 */ 2520, 2195, 2530, 2195, 2530, 2527, 2195, 2195, 2195, 2530, + /* 240 */ 2527, 2527, 2527, 2375, 2371, 2195, 2195, 2369, 2195, 2195, + /* 250 */ 2195, 2195, 2255, 2195, 2255, 2195, 2301, 2301, 2195, 2301, + /* 260 */ 2195, 2195, 2301, 2195, 2301, 2195, 2301, 2195, 2301, 2301, + /* 270 */ 2195, 2301, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 280 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 290 */ 2195, 2624, 2605, 2195, 2299, 2195, 2593, 2591, 2195, 2299, + /* 300 */ 2873, 2195, 2195, 2895, 2890, 2895, 2890, 2909, 2905, 2895, + /* 310 */ 2914, 2911, 2875, 2873, 2856, 2852, 2944, 2931, 2927, 2195, + /* 320 */ 2195, 2861, 2859, 2195, 2299, 2299, 2890, 2195, 2195, 2195, + /* 330 */ 2195, 2890, 2195, 2195, 2299, 2195, 2195, 2299, 2195, 2195, + /* 340 */ 2195, 2195, 2299, 2195, 2299, 2195, 2195, 2195, 2195, 2195, + /* 350 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 360 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2403, 2195, + /* 370 */ 2195, 2299, 2195, 2227, 2229, 2239, 2195, 2584, 2947, 2610, + /* 380 */ 2615, 2565, 2565, 2444, 2444, 2947, 2444, 2302, 2200, 2195, + /* 390 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 400 */ 2195, 2908, 2907, 2744, 2195, 2797, 2796, 2795, 2786, 2743, + /* 410 */ 2399, 2195, 2195, 2195, 2742, 2741, 2195, 2195, 2195, 2195, + /* 420 */ 2390, 2387, 2195, 2195, 2412, 2195, 2195, 2195, 2195, 2556, + /* 430 */ 2555, 2735, 2195, 2195, 2736, 2734, 2733, 2195, 2195, 2195, + /* 440 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 450 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 460 */ 2195, 2195, 2195, 2195, 2195, 2928, 2932, 2195, 2195, 2195, + /* 470 */ 2822, 2195, 2195, 2195, 2714, 2195, 2195, 2195, 2195, 2682, + /* 480 */ 2677, 2668, 2659, 2674, 2665, 2653, 2671, 2662, 2650, 2647, + /* 490 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 500 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 510 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 520 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 530 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 540 */ 2195, 2195, 2195, 2195, 2195, 2195, 2526, 2195, 2195, 2195, + /* 550 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 560 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 570 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 580 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 590 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 600 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 610 */ 2195, 2541, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 620 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 630 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 640 */ 2195, 2195, 2195, 2195, 2195, 2244, 2721, 2195, 2195, 2195, + /* 650 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 660 */ 2724, 2195, 2195, 2725, 2195, 2195, 2195, 2195, 2195, 2195, + /* 670 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 680 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 690 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 700 */ 2195, 2195, 2195, 2195, 2195, 2195, 2346, 2345, 2195, 2195, + /* 710 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 720 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 730 */ 2195, 2195, 2195, 2195, 2195, 2195, 2726, 2195, 2195, 2195, + /* 740 */ 2195, 2609, 2195, 2195, 2716, 2195, 2195, 2195, 2195, 2195, + /* 750 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 760 */ 2195, 2924, 2876, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 770 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 780 */ 2195, 2195, 2195, 2195, 2195, 2714, 2195, 2906, 2195, 2195, + /* 790 */ 2195, 2195, 2195, 2195, 2195, 2922, 2195, 2926, 2195, 2195, + /* 800 */ 2195, 2195, 2195, 2195, 2195, 2832, 2828, 2195, 2195, 2824, + /* 810 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 820 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 830 */ 2783, 2195, 2195, 2195, 2817, 2195, 2195, 2195, 2195, 2440, + /* 840 */ 2439, 2438, 2437, 2195, 2195, 2195, 2195, 2195, 2195, 2726, + /* 850 */ 2195, 2729, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 860 */ 2195, 2713, 2195, 2768, 2767, 2195, 2195, 2195, 2195, 2195, + /* 870 */ 2195, 2195, 2195, 2195, 2195, 2195, 2434, 2195, 2195, 2195, + /* 880 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 890 */ 2195, 2195, 2418, 2416, 2415, 2414, 2195, 2451, 2195, 2195, + /* 900 */ 2195, 2447, 2446, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 910 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 920 */ 2195, 2195, 2320, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 930 */ 2195, 2312, 2195, 2311, 2195, 2195, 2195, 2195, 2195, 2195, + /* 940 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 950 */ 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, 2195, + /* 960 */ 2195, 2195, 2195, 2224, 2195, 2195, 2195, 2195, 2195, 2195, + /* 970 */ 2195, 2195, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1220,11 +1550,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* STATE => nothing */ 0, /* NK_COMMA => nothing */ 0, /* HOST => nothing */ + 0, /* IS_IMPORT => nothing */ + 0, /* NK_INTEGER => nothing */ + 0, /* CREATEDB => nothing */ 0, /* USER => nothing */ 0, /* ENABLE => nothing */ - 0, /* NK_INTEGER => nothing */ 0, /* SYSINFO => nothing */ - 0, /* CREATEDB => nothing */ 0, /* ADD => nothing */ 0, /* DROP => nothing */ 0, /* GRANT => nothing */ @@ -1297,7 +1628,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 326, /* END => ABORT */ + 327, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1338,6 +1669,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* FIRST => nothing */ 0, /* LAST => nothing */ 0, /* SHOW => nothing */ + 0, /* FULL => nothing */ 0, /* PRIVILEGES => nothing */ 0, /* DATABASES => nothing */ 0, /* TABLES => nothing */ @@ -1352,7 +1684,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* CONNECTIONS => nothing */ 0, /* LICENCES => nothing */ 0, /* GRANTS => nothing */ - 0, /* FULL => nothing */ 0, /* LOGS => nothing */ 0, /* MACHINES => nothing */ 0, /* ENCRYPTIONS => nothing */ @@ -1369,7 +1700,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 326, /* VIEW => ABORT */ + 327, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1412,7 +1743,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* PAUSE => nothing */ 0, /* RESUME => nothing */ 0, /* PRIMARY => nothing */ - 326, /* KEY => ABORT */ + 327, /* KEY => ABORT */ 0, /* TRIGGER => nothing */ 0, /* AT_ONCE => nothing */ 0, /* WINDOW_CLOSE => nothing */ @@ -1476,7 +1807,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* LEFT => nothing */ 0, /* RIGHT => nothing */ 0, /* OUTER => nothing */ - 326, /* SEMI => ABORT */ + 327, /* SEMI => ABORT */ 0, /* ANTI => nothing */ 0, /* ASOF => nothing */ 0, /* WINDOW => nothing */ @@ -1512,53 +1843,53 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 326, /* AFTER => ABORT */ - 326, /* ATTACH => ABORT */ - 326, /* BEFORE => ABORT */ - 326, /* BEGIN => ABORT */ - 326, /* BITAND => ABORT */ - 326, /* BITNOT => ABORT */ - 326, /* BITOR => ABORT */ - 326, /* BLOCKS => ABORT */ - 326, /* CHANGE => ABORT */ - 326, /* COMMA => ABORT */ - 326, /* CONCAT => ABORT */ - 326, /* CONFLICT => ABORT */ - 326, /* COPY => ABORT */ - 326, /* DEFERRED => ABORT */ - 326, /* DELIMITERS => ABORT */ - 326, /* DETACH => ABORT */ - 326, /* DIVIDE => ABORT */ - 326, /* DOT => ABORT */ - 326, /* EACH => ABORT */ - 326, /* FAIL => ABORT */ - 326, /* FILE => ABORT */ - 326, /* FOR => ABORT */ - 326, /* GLOB => ABORT */ - 326, /* ID => ABORT */ - 326, /* IMMEDIATE => ABORT */ - 326, /* IMPORT => ABORT */ - 326, /* INITIALLY => ABORT */ - 326, /* INSTEAD => ABORT */ - 326, /* ISNULL => ABORT */ - 326, /* MODULES => ABORT */ - 326, /* NK_BITNOT => ABORT */ - 326, /* NK_SEMI => ABORT */ - 326, /* NOTNULL => ABORT */ - 326, /* OF => ABORT */ - 326, /* PLUS => ABORT */ - 326, /* PRIVILEGE => ABORT */ - 326, /* RAISE => ABORT */ - 326, /* RESTRICT => ABORT */ - 326, /* ROW => ABORT */ - 326, /* STAR => ABORT */ - 326, /* STATEMENT => ABORT */ - 326, /* STRICT => ABORT */ - 326, /* STRING => ABORT */ - 326, /* TIMES => ABORT */ - 326, /* VALUES => ABORT */ - 326, /* VARIABLE => ABORT */ - 326, /* WAL => ABORT */ + 327, /* AFTER => ABORT */ + 327, /* ATTACH => ABORT */ + 327, /* BEFORE => ABORT */ + 327, /* BEGIN => ABORT */ + 327, /* BITAND => ABORT */ + 327, /* BITNOT => ABORT */ + 327, /* BITOR => ABORT */ + 327, /* BLOCKS => ABORT */ + 327, /* CHANGE => ABORT */ + 327, /* COMMA => ABORT */ + 327, /* CONCAT => ABORT */ + 327, /* CONFLICT => ABORT */ + 327, /* COPY => ABORT */ + 327, /* DEFERRED => ABORT */ + 327, /* DELIMITERS => ABORT */ + 327, /* DETACH => ABORT */ + 327, /* DIVIDE => ABORT */ + 327, /* DOT => ABORT */ + 327, /* EACH => ABORT */ + 327, /* FAIL => ABORT */ + 327, /* FILE => ABORT */ + 327, /* FOR => ABORT */ + 327, /* GLOB => ABORT */ + 327, /* ID => ABORT */ + 327, /* IMMEDIATE => ABORT */ + 327, /* IMPORT => ABORT */ + 327, /* INITIALLY => ABORT */ + 327, /* INSTEAD => ABORT */ + 327, /* ISNULL => ABORT */ + 327, /* MODULES => ABORT */ + 327, /* NK_BITNOT => ABORT */ + 327, /* NK_SEMI => ABORT */ + 327, /* NOTNULL => ABORT */ + 327, /* OF => ABORT */ + 327, /* PLUS => ABORT */ + 327, /* PRIVILEGE => ABORT */ + 327, /* RAISE => ABORT */ + 327, /* RESTRICT => ABORT */ + 327, /* ROW => ABORT */ + 327, /* STAR => ABORT */ + 327, /* STATEMENT => ABORT */ + 327, /* STRICT => ABORT */ + 327, /* STRING => ABORT */ + 327, /* TIMES => ABORT */ + 327, /* VALUES => ABORT */ + 327, /* VARIABLE => ABORT */ + 327, /* WAL => ABORT */ 0, /* ENCODE => nothing */ 0, /* COMPRESS => nothing */ 0, /* LEVEL => nothing */ @@ -1613,6 +1944,7 @@ struct yyParser { }; typedef struct yyParser yyParser; +#include #ifndef NDEBUG #include static FILE *yyTraceFILE = 0; @@ -1684,526 +2016,529 @@ static const char *const yyTokenName[] = { /* 32 */ "STATE", /* 33 */ "NK_COMMA", /* 34 */ "HOST", - /* 35 */ "USER", - /* 36 */ "ENABLE", - /* 37 */ "NK_INTEGER", - /* 38 */ "SYSINFO", - /* 39 */ "CREATEDB", - /* 40 */ "ADD", - /* 41 */ "DROP", - /* 42 */ "GRANT", - /* 43 */ "ON", - /* 44 */ "TO", - /* 45 */ "REVOKE", - /* 46 */ "FROM", - /* 47 */ "SUBSCRIBE", - /* 48 */ "READ", - /* 49 */ "WRITE", - /* 50 */ "NK_DOT", - /* 51 */ "WITH", - /* 52 */ "ENCRYPT_KEY", - /* 53 */ "DNODE", - /* 54 */ "PORT", - /* 55 */ "DNODES", - /* 56 */ "RESTORE", - /* 57 */ "NK_IPTOKEN", - /* 58 */ "FORCE", - /* 59 */ "UNSAFE", - /* 60 */ "CLUSTER", - /* 61 */ "LOCAL", - /* 62 */ "QNODE", - /* 63 */ "BNODE", - /* 64 */ "SNODE", - /* 65 */ "MNODE", - /* 66 */ "VNODE", - /* 67 */ "DATABASE", - /* 68 */ "USE", - /* 69 */ "FLUSH", - /* 70 */ "TRIM", - /* 71 */ "S3MIGRATE", - /* 72 */ "COMPACT", - /* 73 */ "IF", - /* 74 */ "NOT", - /* 75 */ "EXISTS", - /* 76 */ "BUFFER", - /* 77 */ "CACHEMODEL", - /* 78 */ "CACHESIZE", - /* 79 */ "COMP", - /* 80 */ "DURATION", - /* 81 */ "NK_VARIABLE", - /* 82 */ "MAXROWS", - /* 83 */ "MINROWS", - /* 84 */ "KEEP", - /* 85 */ "PAGES", - /* 86 */ "PAGESIZE", - /* 87 */ "TSDB_PAGESIZE", - /* 88 */ "PRECISION", - /* 89 */ "REPLICA", - /* 90 */ "VGROUPS", - /* 91 */ "SINGLE_STABLE", - /* 92 */ "RETENTIONS", - /* 93 */ "SCHEMALESS", - /* 94 */ "WAL_LEVEL", - /* 95 */ "WAL_FSYNC_PERIOD", - /* 96 */ "WAL_RETENTION_PERIOD", - /* 97 */ "WAL_RETENTION_SIZE", - /* 98 */ "WAL_ROLL_PERIOD", - /* 99 */ "WAL_SEGMENT_SIZE", - /* 100 */ "STT_TRIGGER", - /* 101 */ "TABLE_PREFIX", - /* 102 */ "TABLE_SUFFIX", - /* 103 */ "S3_CHUNKSIZE", - /* 104 */ "S3_KEEPLOCAL", - /* 105 */ "S3_COMPACT", - /* 106 */ "KEEP_TIME_OFFSET", - /* 107 */ "ENCRYPT_ALGORITHM", - /* 108 */ "NK_COLON", - /* 109 */ "BWLIMIT", - /* 110 */ "START", - /* 111 */ "TIMESTAMP", - /* 112 */ "END", - /* 113 */ "TABLE", - /* 114 */ "NK_LP", - /* 115 */ "NK_RP", - /* 116 */ "STABLE", - /* 117 */ "COLUMN", - /* 118 */ "MODIFY", - /* 119 */ "RENAME", - /* 120 */ "TAG", - /* 121 */ "SET", - /* 122 */ "NK_EQ", - /* 123 */ "USING", - /* 124 */ "TAGS", - /* 125 */ "BOOL", - /* 126 */ "TINYINT", - /* 127 */ "SMALLINT", - /* 128 */ "INT", - /* 129 */ "INTEGER", - /* 130 */ "BIGINT", - /* 131 */ "FLOAT", - /* 132 */ "DOUBLE", - /* 133 */ "BINARY", - /* 134 */ "NCHAR", - /* 135 */ "UNSIGNED", - /* 136 */ "JSON", - /* 137 */ "VARCHAR", - /* 138 */ "MEDIUMBLOB", - /* 139 */ "BLOB", - /* 140 */ "VARBINARY", - /* 141 */ "GEOMETRY", - /* 142 */ "DECIMAL", - /* 143 */ "COMMENT", - /* 144 */ "MAX_DELAY", - /* 145 */ "WATERMARK", - /* 146 */ "ROLLUP", - /* 147 */ "TTL", - /* 148 */ "SMA", - /* 149 */ "DELETE_MARK", - /* 150 */ "FIRST", - /* 151 */ "LAST", - /* 152 */ "SHOW", - /* 153 */ "PRIVILEGES", - /* 154 */ "DATABASES", - /* 155 */ "TABLES", - /* 156 */ "STABLES", - /* 157 */ "MNODES", - /* 158 */ "QNODES", - /* 159 */ "ARBGROUPS", - /* 160 */ "FUNCTIONS", - /* 161 */ "INDEXES", - /* 162 */ "ACCOUNTS", - /* 163 */ "APPS", - /* 164 */ "CONNECTIONS", - /* 165 */ "LICENCES", - /* 166 */ "GRANTS", - /* 167 */ "FULL", - /* 168 */ "LOGS", - /* 169 */ "MACHINES", - /* 170 */ "ENCRYPTIONS", - /* 171 */ "QUERIES", - /* 172 */ "SCORES", - /* 173 */ "TOPICS", - /* 174 */ "VARIABLES", - /* 175 */ "BNODES", - /* 176 */ "SNODES", - /* 177 */ "TRANSACTIONS", - /* 178 */ "DISTRIBUTED", - /* 179 */ "CONSUMERS", - /* 180 */ "SUBSCRIPTIONS", - /* 181 */ "VNODES", - /* 182 */ "ALIVE", - /* 183 */ "VIEWS", - /* 184 */ "VIEW", - /* 185 */ "COMPACTS", - /* 186 */ "NORMAL", - /* 187 */ "CHILD", - /* 188 */ "LIKE", - /* 189 */ "TBNAME", - /* 190 */ "QTAGS", - /* 191 */ "AS", - /* 192 */ "SYSTEM", - /* 193 */ "TSMA", - /* 194 */ "INTERVAL", - /* 195 */ "RECURSIVE", - /* 196 */ "TSMAS", - /* 197 */ "FUNCTION", - /* 198 */ "INDEX", - /* 199 */ "COUNT", - /* 200 */ "LAST_ROW", - /* 201 */ "META", - /* 202 */ "ONLY", - /* 203 */ "TOPIC", - /* 204 */ "CONSUMER", - /* 205 */ "GROUP", - /* 206 */ "DESC", - /* 207 */ "DESCRIBE", - /* 208 */ "RESET", - /* 209 */ "QUERY", - /* 210 */ "CACHE", - /* 211 */ "EXPLAIN", - /* 212 */ "ANALYZE", - /* 213 */ "VERBOSE", - /* 214 */ "NK_BOOL", - /* 215 */ "RATIO", - /* 216 */ "NK_FLOAT", - /* 217 */ "OUTPUTTYPE", - /* 218 */ "AGGREGATE", - /* 219 */ "BUFSIZE", - /* 220 */ "LANGUAGE", - /* 221 */ "REPLACE", - /* 222 */ "STREAM", - /* 223 */ "INTO", - /* 224 */ "PAUSE", - /* 225 */ "RESUME", - /* 226 */ "PRIMARY", - /* 227 */ "KEY", - /* 228 */ "TRIGGER", - /* 229 */ "AT_ONCE", - /* 230 */ "WINDOW_CLOSE", - /* 231 */ "IGNORE", - /* 232 */ "EXPIRED", - /* 233 */ "FILL_HISTORY", - /* 234 */ "UPDATE", - /* 235 */ "SUBTABLE", - /* 236 */ "UNTREATED", - /* 237 */ "KILL", - /* 238 */ "CONNECTION", - /* 239 */ "TRANSACTION", - /* 240 */ "BALANCE", - /* 241 */ "VGROUP", - /* 242 */ "LEADER", - /* 243 */ "MERGE", - /* 244 */ "REDISTRIBUTE", - /* 245 */ "SPLIT", - /* 246 */ "DELETE", - /* 247 */ "INSERT", - /* 248 */ "NK_BIN", - /* 249 */ "NK_HEX", - /* 250 */ "NULL", - /* 251 */ "NK_QUESTION", - /* 252 */ "NK_ALIAS", - /* 253 */ "NK_ARROW", - /* 254 */ "ROWTS", - /* 255 */ "QSTART", - /* 256 */ "QEND", - /* 257 */ "QDURATION", - /* 258 */ "WSTART", - /* 259 */ "WEND", - /* 260 */ "WDURATION", - /* 261 */ "IROWTS", - /* 262 */ "ISFILLED", - /* 263 */ "CAST", - /* 264 */ "NOW", - /* 265 */ "TODAY", - /* 266 */ "TIMEZONE", - /* 267 */ "CLIENT_VERSION", - /* 268 */ "SERVER_VERSION", - /* 269 */ "SERVER_STATUS", - /* 270 */ "CURRENT_USER", - /* 271 */ "CASE", - /* 272 */ "WHEN", - /* 273 */ "THEN", - /* 274 */ "ELSE", - /* 275 */ "BETWEEN", - /* 276 */ "IS", - /* 277 */ "NK_LT", - /* 278 */ "NK_GT", - /* 279 */ "NK_LE", - /* 280 */ "NK_GE", - /* 281 */ "NK_NE", - /* 282 */ "MATCH", - /* 283 */ "NMATCH", - /* 284 */ "CONTAINS", - /* 285 */ "IN", - /* 286 */ "JOIN", - /* 287 */ "INNER", - /* 288 */ "LEFT", - /* 289 */ "RIGHT", - /* 290 */ "OUTER", - /* 291 */ "SEMI", - /* 292 */ "ANTI", - /* 293 */ "ASOF", - /* 294 */ "WINDOW", - /* 295 */ "WINDOW_OFFSET", - /* 296 */ "JLIMIT", - /* 297 */ "SELECT", - /* 298 */ "NK_HINT", - /* 299 */ "DISTINCT", - /* 300 */ "WHERE", - /* 301 */ "PARTITION", - /* 302 */ "BY", - /* 303 */ "SESSION", - /* 304 */ "STATE_WINDOW", - /* 305 */ "EVENT_WINDOW", - /* 306 */ "COUNT_WINDOW", - /* 307 */ "SLIDING", - /* 308 */ "FILL", - /* 309 */ "VALUE", - /* 310 */ "VALUE_F", - /* 311 */ "NONE", - /* 312 */ "PREV", - /* 313 */ "NULL_F", - /* 314 */ "LINEAR", - /* 315 */ "NEXT", - /* 316 */ "HAVING", - /* 317 */ "RANGE", - /* 318 */ "EVERY", - /* 319 */ "ORDER", - /* 320 */ "SLIMIT", - /* 321 */ "SOFFSET", - /* 322 */ "LIMIT", - /* 323 */ "OFFSET", - /* 324 */ "ASC", - /* 325 */ "NULLS", - /* 326 */ "ABORT", - /* 327 */ "AFTER", - /* 328 */ "ATTACH", - /* 329 */ "BEFORE", - /* 330 */ "BEGIN", - /* 331 */ "BITAND", - /* 332 */ "BITNOT", - /* 333 */ "BITOR", - /* 334 */ "BLOCKS", - /* 335 */ "CHANGE", - /* 336 */ "COMMA", - /* 337 */ "CONCAT", - /* 338 */ "CONFLICT", - /* 339 */ "COPY", - /* 340 */ "DEFERRED", - /* 341 */ "DELIMITERS", - /* 342 */ "DETACH", - /* 343 */ "DIVIDE", - /* 344 */ "DOT", - /* 345 */ "EACH", - /* 346 */ "FAIL", - /* 347 */ "FILE", - /* 348 */ "FOR", - /* 349 */ "GLOB", - /* 350 */ "ID", - /* 351 */ "IMMEDIATE", - /* 352 */ "IMPORT", - /* 353 */ "INITIALLY", - /* 354 */ "INSTEAD", - /* 355 */ "ISNULL", - /* 356 */ "MODULES", - /* 357 */ "NK_BITNOT", - /* 358 */ "NK_SEMI", - /* 359 */ "NOTNULL", - /* 360 */ "OF", - /* 361 */ "PLUS", - /* 362 */ "PRIVILEGE", - /* 363 */ "RAISE", - /* 364 */ "RESTRICT", - /* 365 */ "ROW", - /* 366 */ "STAR", - /* 367 */ "STATEMENT", - /* 368 */ "STRICT", - /* 369 */ "STRING", - /* 370 */ "TIMES", - /* 371 */ "VALUES", - /* 372 */ "VARIABLE", - /* 373 */ "WAL", - /* 374 */ "ENCODE", - /* 375 */ "COMPRESS", - /* 376 */ "LEVEL", - /* 377 */ "cmd", - /* 378 */ "account_options", - /* 379 */ "alter_account_options", - /* 380 */ "literal", - /* 381 */ "alter_account_option", - /* 382 */ "ip_range_list", - /* 383 */ "white_list", - /* 384 */ "white_list_opt", - /* 385 */ "user_name", - /* 386 */ "sysinfo_opt", - /* 387 */ "privileges", - /* 388 */ "priv_level", - /* 389 */ "with_opt", - /* 390 */ "priv_type_list", - /* 391 */ "priv_type", - /* 392 */ "db_name", - /* 393 */ "table_name", - /* 394 */ "topic_name", - /* 395 */ "search_condition", - /* 396 */ "dnode_endpoint", - /* 397 */ "force_opt", - /* 398 */ "unsafe_opt", - /* 399 */ "not_exists_opt", - /* 400 */ "db_options", - /* 401 */ "exists_opt", - /* 402 */ "alter_db_options", - /* 403 */ "speed_opt", - /* 404 */ "start_opt", - /* 405 */ "end_opt", - /* 406 */ "integer_list", - /* 407 */ "variable_list", - /* 408 */ "retention_list", - /* 409 */ "signed", - /* 410 */ "alter_db_option", - /* 411 */ "retention", - /* 412 */ "full_table_name", - /* 413 */ "column_def_list", - /* 414 */ "tags_def_opt", - /* 415 */ "table_options", - /* 416 */ "multi_create_clause", - /* 417 */ "tags_def", - /* 418 */ "multi_drop_clause", - /* 419 */ "alter_table_clause", - /* 420 */ "alter_table_options", - /* 421 */ "column_name", - /* 422 */ "type_name", - /* 423 */ "column_options", - /* 424 */ "tags_literal", - /* 425 */ "create_subtable_clause", - /* 426 */ "specific_cols_opt", - /* 427 */ "tags_literal_list", - /* 428 */ "drop_table_clause", - /* 429 */ "col_name_list", - /* 430 */ "tag_def_list", - /* 431 */ "tag_def", - /* 432 */ "column_def", - /* 433 */ "type_name_default_len", - /* 434 */ "duration_list", - /* 435 */ "rollup_func_list", - /* 436 */ "alter_table_option", - /* 437 */ "duration_literal", - /* 438 */ "rollup_func_name", - /* 439 */ "function_name", - /* 440 */ "col_name", - /* 441 */ "db_kind_opt", - /* 442 */ "table_kind_db_name_cond_opt", - /* 443 */ "like_pattern_opt", - /* 444 */ "db_name_cond_opt", - /* 445 */ "table_name_cond", - /* 446 */ "from_db_opt", - /* 447 */ "tag_list_opt", - /* 448 */ "table_kind", - /* 449 */ "tag_item", - /* 450 */ "column_alias", - /* 451 */ "tsma_name", - /* 452 */ "tsma_func_list", - /* 453 */ "full_tsma_name", - /* 454 */ "func_list", - /* 455 */ "index_options", - /* 456 */ "full_index_name", - /* 457 */ "index_name", - /* 458 */ "sliding_opt", - /* 459 */ "sma_stream_opt", - /* 460 */ "func", - /* 461 */ "sma_func_name", - /* 462 */ "expression_list", - /* 463 */ "with_meta", - /* 464 */ "query_or_subquery", - /* 465 */ "where_clause_opt", - /* 466 */ "cgroup_name", - /* 467 */ "analyze_opt", - /* 468 */ "explain_options", - /* 469 */ "insert_query", - /* 470 */ "or_replace_opt", - /* 471 */ "agg_func_opt", - /* 472 */ "bufsize_opt", - /* 473 */ "language_opt", - /* 474 */ "full_view_name", - /* 475 */ "view_name", - /* 476 */ "stream_name", - /* 477 */ "stream_options", - /* 478 */ "col_list_opt", - /* 479 */ "tag_def_or_ref_opt", - /* 480 */ "subtable_opt", - /* 481 */ "ignore_opt", - /* 482 */ "column_stream_def_list", - /* 483 */ "column_stream_def", - /* 484 */ "stream_col_options", - /* 485 */ "expression", - /* 486 */ "on_vgroup_id", - /* 487 */ "dnode_list", - /* 488 */ "literal_func", - /* 489 */ "signed_literal", - /* 490 */ "literal_list", - /* 491 */ "table_alias", - /* 492 */ "expr_or_subquery", - /* 493 */ "pseudo_column", - /* 494 */ "column_reference", - /* 495 */ "function_expression", - /* 496 */ "case_when_expression", - /* 497 */ "star_func", - /* 498 */ "star_func_para_list", - /* 499 */ "noarg_func", - /* 500 */ "other_para_list", - /* 501 */ "star_func_para", - /* 502 */ "when_then_list", - /* 503 */ "case_when_else_opt", - /* 504 */ "common_expression", - /* 505 */ "when_then_expr", - /* 506 */ "predicate", - /* 507 */ "compare_op", - /* 508 */ "in_op", - /* 509 */ "in_predicate_value", - /* 510 */ "boolean_value_expression", - /* 511 */ "boolean_primary", - /* 512 */ "from_clause_opt", - /* 513 */ "table_reference_list", - /* 514 */ "table_reference", - /* 515 */ "table_primary", - /* 516 */ "joined_table", - /* 517 */ "alias_opt", - /* 518 */ "subquery", - /* 519 */ "parenthesized_joined_table", - /* 520 */ "join_type", - /* 521 */ "join_subtype", - /* 522 */ "join_on_clause_opt", - /* 523 */ "window_offset_clause_opt", - /* 524 */ "jlimit_clause_opt", - /* 525 */ "window_offset_literal", - /* 526 */ "query_specification", - /* 527 */ "hint_list", - /* 528 */ "set_quantifier_opt", - /* 529 */ "tag_mode_opt", - /* 530 */ "select_list", - /* 531 */ "partition_by_clause_opt", - /* 532 */ "range_opt", - /* 533 */ "every_opt", - /* 534 */ "fill_opt", - /* 535 */ "twindow_clause_opt", - /* 536 */ "group_by_clause_opt", - /* 537 */ "having_clause_opt", - /* 538 */ "select_item", - /* 539 */ "partition_list", - /* 540 */ "partition_item", - /* 541 */ "interval_sliding_duration_literal", - /* 542 */ "fill_mode", - /* 543 */ "group_by_list", - /* 544 */ "query_expression", - /* 545 */ "query_simple", - /* 546 */ "order_by_clause_opt", - /* 547 */ "slimit_clause_opt", - /* 548 */ "limit_clause_opt", - /* 549 */ "union_query_expression", - /* 550 */ "query_simple_or_subquery", - /* 551 */ "sort_specification_list", - /* 552 */ "sort_specification", - /* 553 */ "ordering_specification_opt", - /* 554 */ "null_ordering_opt", + /* 35 */ "IS_IMPORT", + /* 36 */ "NK_INTEGER", + /* 37 */ "CREATEDB", + /* 38 */ "USER", + /* 39 */ "ENABLE", + /* 40 */ "SYSINFO", + /* 41 */ "ADD", + /* 42 */ "DROP", + /* 43 */ "GRANT", + /* 44 */ "ON", + /* 45 */ "TO", + /* 46 */ "REVOKE", + /* 47 */ "FROM", + /* 48 */ "SUBSCRIBE", + /* 49 */ "READ", + /* 50 */ "WRITE", + /* 51 */ "NK_DOT", + /* 52 */ "WITH", + /* 53 */ "ENCRYPT_KEY", + /* 54 */ "DNODE", + /* 55 */ "PORT", + /* 56 */ "DNODES", + /* 57 */ "RESTORE", + /* 58 */ "NK_IPTOKEN", + /* 59 */ "FORCE", + /* 60 */ "UNSAFE", + /* 61 */ "CLUSTER", + /* 62 */ "LOCAL", + /* 63 */ "QNODE", + /* 64 */ "BNODE", + /* 65 */ "SNODE", + /* 66 */ "MNODE", + /* 67 */ "VNODE", + /* 68 */ "DATABASE", + /* 69 */ "USE", + /* 70 */ "FLUSH", + /* 71 */ "TRIM", + /* 72 */ "S3MIGRATE", + /* 73 */ "COMPACT", + /* 74 */ "IF", + /* 75 */ "NOT", + /* 76 */ "EXISTS", + /* 77 */ "BUFFER", + /* 78 */ "CACHEMODEL", + /* 79 */ "CACHESIZE", + /* 80 */ "COMP", + /* 81 */ "DURATION", + /* 82 */ "NK_VARIABLE", + /* 83 */ "MAXROWS", + /* 84 */ "MINROWS", + /* 85 */ "KEEP", + /* 86 */ "PAGES", + /* 87 */ "PAGESIZE", + /* 88 */ "TSDB_PAGESIZE", + /* 89 */ "PRECISION", + /* 90 */ "REPLICA", + /* 91 */ "VGROUPS", + /* 92 */ "SINGLE_STABLE", + /* 93 */ "RETENTIONS", + /* 94 */ "SCHEMALESS", + /* 95 */ "WAL_LEVEL", + /* 96 */ "WAL_FSYNC_PERIOD", + /* 97 */ "WAL_RETENTION_PERIOD", + /* 98 */ "WAL_RETENTION_SIZE", + /* 99 */ "WAL_ROLL_PERIOD", + /* 100 */ "WAL_SEGMENT_SIZE", + /* 101 */ "STT_TRIGGER", + /* 102 */ "TABLE_PREFIX", + /* 103 */ "TABLE_SUFFIX", + /* 104 */ "S3_CHUNKSIZE", + /* 105 */ "S3_KEEPLOCAL", + /* 106 */ "S3_COMPACT", + /* 107 */ "KEEP_TIME_OFFSET", + /* 108 */ "ENCRYPT_ALGORITHM", + /* 109 */ "NK_COLON", + /* 110 */ "BWLIMIT", + /* 111 */ "START", + /* 112 */ "TIMESTAMP", + /* 113 */ "END", + /* 114 */ "TABLE", + /* 115 */ "NK_LP", + /* 116 */ "NK_RP", + /* 117 */ "STABLE", + /* 118 */ "COLUMN", + /* 119 */ "MODIFY", + /* 120 */ "RENAME", + /* 121 */ "TAG", + /* 122 */ "SET", + /* 123 */ "NK_EQ", + /* 124 */ "USING", + /* 125 */ "TAGS", + /* 126 */ "BOOL", + /* 127 */ "TINYINT", + /* 128 */ "SMALLINT", + /* 129 */ "INT", + /* 130 */ "INTEGER", + /* 131 */ "BIGINT", + /* 132 */ "FLOAT", + /* 133 */ "DOUBLE", + /* 134 */ "BINARY", + /* 135 */ "NCHAR", + /* 136 */ "UNSIGNED", + /* 137 */ "JSON", + /* 138 */ "VARCHAR", + /* 139 */ "MEDIUMBLOB", + /* 140 */ "BLOB", + /* 141 */ "VARBINARY", + /* 142 */ "GEOMETRY", + /* 143 */ "DECIMAL", + /* 144 */ "COMMENT", + /* 145 */ "MAX_DELAY", + /* 146 */ "WATERMARK", + /* 147 */ "ROLLUP", + /* 148 */ "TTL", + /* 149 */ "SMA", + /* 150 */ "DELETE_MARK", + /* 151 */ "FIRST", + /* 152 */ "LAST", + /* 153 */ "SHOW", + /* 154 */ "FULL", + /* 155 */ "PRIVILEGES", + /* 156 */ "DATABASES", + /* 157 */ "TABLES", + /* 158 */ "STABLES", + /* 159 */ "MNODES", + /* 160 */ "QNODES", + /* 161 */ "ARBGROUPS", + /* 162 */ "FUNCTIONS", + /* 163 */ "INDEXES", + /* 164 */ "ACCOUNTS", + /* 165 */ "APPS", + /* 166 */ "CONNECTIONS", + /* 167 */ "LICENCES", + /* 168 */ "GRANTS", + /* 169 */ "LOGS", + /* 170 */ "MACHINES", + /* 171 */ "ENCRYPTIONS", + /* 172 */ "QUERIES", + /* 173 */ "SCORES", + /* 174 */ "TOPICS", + /* 175 */ "VARIABLES", + /* 176 */ "BNODES", + /* 177 */ "SNODES", + /* 178 */ "TRANSACTIONS", + /* 179 */ "DISTRIBUTED", + /* 180 */ "CONSUMERS", + /* 181 */ "SUBSCRIPTIONS", + /* 182 */ "VNODES", + /* 183 */ "ALIVE", + /* 184 */ "VIEWS", + /* 185 */ "VIEW", + /* 186 */ "COMPACTS", + /* 187 */ "NORMAL", + /* 188 */ "CHILD", + /* 189 */ "LIKE", + /* 190 */ "TBNAME", + /* 191 */ "QTAGS", + /* 192 */ "AS", + /* 193 */ "SYSTEM", + /* 194 */ "TSMA", + /* 195 */ "INTERVAL", + /* 196 */ "RECURSIVE", + /* 197 */ "TSMAS", + /* 198 */ "FUNCTION", + /* 199 */ "INDEX", + /* 200 */ "COUNT", + /* 201 */ "LAST_ROW", + /* 202 */ "META", + /* 203 */ "ONLY", + /* 204 */ "TOPIC", + /* 205 */ "CONSUMER", + /* 206 */ "GROUP", + /* 207 */ "DESC", + /* 208 */ "DESCRIBE", + /* 209 */ "RESET", + /* 210 */ "QUERY", + /* 211 */ "CACHE", + /* 212 */ "EXPLAIN", + /* 213 */ "ANALYZE", + /* 214 */ "VERBOSE", + /* 215 */ "NK_BOOL", + /* 216 */ "RATIO", + /* 217 */ "NK_FLOAT", + /* 218 */ "OUTPUTTYPE", + /* 219 */ "AGGREGATE", + /* 220 */ "BUFSIZE", + /* 221 */ "LANGUAGE", + /* 222 */ "REPLACE", + /* 223 */ "STREAM", + /* 224 */ "INTO", + /* 225 */ "PAUSE", + /* 226 */ "RESUME", + /* 227 */ "PRIMARY", + /* 228 */ "KEY", + /* 229 */ "TRIGGER", + /* 230 */ "AT_ONCE", + /* 231 */ "WINDOW_CLOSE", + /* 232 */ "IGNORE", + /* 233 */ "EXPIRED", + /* 234 */ "FILL_HISTORY", + /* 235 */ "UPDATE", + /* 236 */ "SUBTABLE", + /* 237 */ "UNTREATED", + /* 238 */ "KILL", + /* 239 */ "CONNECTION", + /* 240 */ "TRANSACTION", + /* 241 */ "BALANCE", + /* 242 */ "VGROUP", + /* 243 */ "LEADER", + /* 244 */ "MERGE", + /* 245 */ "REDISTRIBUTE", + /* 246 */ "SPLIT", + /* 247 */ "DELETE", + /* 248 */ "INSERT", + /* 249 */ "NK_BIN", + /* 250 */ "NK_HEX", + /* 251 */ "NULL", + /* 252 */ "NK_QUESTION", + /* 253 */ "NK_ALIAS", + /* 254 */ "NK_ARROW", + /* 255 */ "ROWTS", + /* 256 */ "QSTART", + /* 257 */ "QEND", + /* 258 */ "QDURATION", + /* 259 */ "WSTART", + /* 260 */ "WEND", + /* 261 */ "WDURATION", + /* 262 */ "IROWTS", + /* 263 */ "ISFILLED", + /* 264 */ "CAST", + /* 265 */ "NOW", + /* 266 */ "TODAY", + /* 267 */ "TIMEZONE", + /* 268 */ "CLIENT_VERSION", + /* 269 */ "SERVER_VERSION", + /* 270 */ "SERVER_STATUS", + /* 271 */ "CURRENT_USER", + /* 272 */ "CASE", + /* 273 */ "WHEN", + /* 274 */ "THEN", + /* 275 */ "ELSE", + /* 276 */ "BETWEEN", + /* 277 */ "IS", + /* 278 */ "NK_LT", + /* 279 */ "NK_GT", + /* 280 */ "NK_LE", + /* 281 */ "NK_GE", + /* 282 */ "NK_NE", + /* 283 */ "MATCH", + /* 284 */ "NMATCH", + /* 285 */ "CONTAINS", + /* 286 */ "IN", + /* 287 */ "JOIN", + /* 288 */ "INNER", + /* 289 */ "LEFT", + /* 290 */ "RIGHT", + /* 291 */ "OUTER", + /* 292 */ "SEMI", + /* 293 */ "ANTI", + /* 294 */ "ASOF", + /* 295 */ "WINDOW", + /* 296 */ "WINDOW_OFFSET", + /* 297 */ "JLIMIT", + /* 298 */ "SELECT", + /* 299 */ "NK_HINT", + /* 300 */ "DISTINCT", + /* 301 */ "WHERE", + /* 302 */ "PARTITION", + /* 303 */ "BY", + /* 304 */ "SESSION", + /* 305 */ "STATE_WINDOW", + /* 306 */ "EVENT_WINDOW", + /* 307 */ "COUNT_WINDOW", + /* 308 */ "SLIDING", + /* 309 */ "FILL", + /* 310 */ "VALUE", + /* 311 */ "VALUE_F", + /* 312 */ "NONE", + /* 313 */ "PREV", + /* 314 */ "NULL_F", + /* 315 */ "LINEAR", + /* 316 */ "NEXT", + /* 317 */ "HAVING", + /* 318 */ "RANGE", + /* 319 */ "EVERY", + /* 320 */ "ORDER", + /* 321 */ "SLIMIT", + /* 322 */ "SOFFSET", + /* 323 */ "LIMIT", + /* 324 */ "OFFSET", + /* 325 */ "ASC", + /* 326 */ "NULLS", + /* 327 */ "ABORT", + /* 328 */ "AFTER", + /* 329 */ "ATTACH", + /* 330 */ "BEFORE", + /* 331 */ "BEGIN", + /* 332 */ "BITAND", + /* 333 */ "BITNOT", + /* 334 */ "BITOR", + /* 335 */ "BLOCKS", + /* 336 */ "CHANGE", + /* 337 */ "COMMA", + /* 338 */ "CONCAT", + /* 339 */ "CONFLICT", + /* 340 */ "COPY", + /* 341 */ "DEFERRED", + /* 342 */ "DELIMITERS", + /* 343 */ "DETACH", + /* 344 */ "DIVIDE", + /* 345 */ "DOT", + /* 346 */ "EACH", + /* 347 */ "FAIL", + /* 348 */ "FILE", + /* 349 */ "FOR", + /* 350 */ "GLOB", + /* 351 */ "ID", + /* 352 */ "IMMEDIATE", + /* 353 */ "IMPORT", + /* 354 */ "INITIALLY", + /* 355 */ "INSTEAD", + /* 356 */ "ISNULL", + /* 357 */ "MODULES", + /* 358 */ "NK_BITNOT", + /* 359 */ "NK_SEMI", + /* 360 */ "NOTNULL", + /* 361 */ "OF", + /* 362 */ "PLUS", + /* 363 */ "PRIVILEGE", + /* 364 */ "RAISE", + /* 365 */ "RESTRICT", + /* 366 */ "ROW", + /* 367 */ "STAR", + /* 368 */ "STATEMENT", + /* 369 */ "STRICT", + /* 370 */ "STRING", + /* 371 */ "TIMES", + /* 372 */ "VALUES", + /* 373 */ "VARIABLE", + /* 374 */ "WAL", + /* 375 */ "ENCODE", + /* 376 */ "COMPRESS", + /* 377 */ "LEVEL", + /* 378 */ "cmd", + /* 379 */ "account_options", + /* 380 */ "alter_account_options", + /* 381 */ "literal", + /* 382 */ "alter_account_option", + /* 383 */ "ip_range_list", + /* 384 */ "white_list", + /* 385 */ "white_list_opt", + /* 386 */ "is_import_opt", + /* 387 */ "is_createdb_opt", + /* 388 */ "user_name", + /* 389 */ "sysinfo_opt", + /* 390 */ "privileges", + /* 391 */ "priv_level", + /* 392 */ "with_opt", + /* 393 */ "priv_type_list", + /* 394 */ "priv_type", + /* 395 */ "db_name", + /* 396 */ "table_name", + /* 397 */ "topic_name", + /* 398 */ "search_condition", + /* 399 */ "dnode_endpoint", + /* 400 */ "force_opt", + /* 401 */ "unsafe_opt", + /* 402 */ "not_exists_opt", + /* 403 */ "db_options", + /* 404 */ "exists_opt", + /* 405 */ "alter_db_options", + /* 406 */ "speed_opt", + /* 407 */ "start_opt", + /* 408 */ "end_opt", + /* 409 */ "integer_list", + /* 410 */ "variable_list", + /* 411 */ "retention_list", + /* 412 */ "signed", + /* 413 */ "alter_db_option", + /* 414 */ "retention", + /* 415 */ "full_table_name", + /* 416 */ "column_def_list", + /* 417 */ "tags_def_opt", + /* 418 */ "table_options", + /* 419 */ "multi_create_clause", + /* 420 */ "tags_def", + /* 421 */ "multi_drop_clause", + /* 422 */ "alter_table_clause", + /* 423 */ "alter_table_options", + /* 424 */ "column_name", + /* 425 */ "type_name", + /* 426 */ "column_options", + /* 427 */ "tags_literal", + /* 428 */ "create_subtable_clause", + /* 429 */ "specific_cols_opt", + /* 430 */ "tags_literal_list", + /* 431 */ "drop_table_clause", + /* 432 */ "col_name_list", + /* 433 */ "tag_def_list", + /* 434 */ "tag_def", + /* 435 */ "column_def", + /* 436 */ "type_name_default_len", + /* 437 */ "duration_list", + /* 438 */ "rollup_func_list", + /* 439 */ "alter_table_option", + /* 440 */ "duration_literal", + /* 441 */ "rollup_func_name", + /* 442 */ "function_name", + /* 443 */ "col_name", + /* 444 */ "db_kind_opt", + /* 445 */ "table_kind_db_name_cond_opt", + /* 446 */ "like_pattern_opt", + /* 447 */ "db_name_cond_opt", + /* 448 */ "table_name_cond", + /* 449 */ "from_db_opt", + /* 450 */ "tag_list_opt", + /* 451 */ "table_kind", + /* 452 */ "tag_item", + /* 453 */ "column_alias", + /* 454 */ "tsma_name", + /* 455 */ "tsma_func_list", + /* 456 */ "full_tsma_name", + /* 457 */ "func_list", + /* 458 */ "index_options", + /* 459 */ "full_index_name", + /* 460 */ "index_name", + /* 461 */ "sliding_opt", + /* 462 */ "sma_stream_opt", + /* 463 */ "func", + /* 464 */ "sma_func_name", + /* 465 */ "expression_list", + /* 466 */ "with_meta", + /* 467 */ "query_or_subquery", + /* 468 */ "where_clause_opt", + /* 469 */ "cgroup_name", + /* 470 */ "analyze_opt", + /* 471 */ "explain_options", + /* 472 */ "insert_query", + /* 473 */ "or_replace_opt", + /* 474 */ "agg_func_opt", + /* 475 */ "bufsize_opt", + /* 476 */ "language_opt", + /* 477 */ "full_view_name", + /* 478 */ "view_name", + /* 479 */ "stream_name", + /* 480 */ "stream_options", + /* 481 */ "col_list_opt", + /* 482 */ "tag_def_or_ref_opt", + /* 483 */ "subtable_opt", + /* 484 */ "ignore_opt", + /* 485 */ "column_stream_def_list", + /* 486 */ "column_stream_def", + /* 487 */ "stream_col_options", + /* 488 */ "expression", + /* 489 */ "on_vgroup_id", + /* 490 */ "dnode_list", + /* 491 */ "literal_func", + /* 492 */ "signed_literal", + /* 493 */ "literal_list", + /* 494 */ "table_alias", + /* 495 */ "expr_or_subquery", + /* 496 */ "pseudo_column", + /* 497 */ "column_reference", + /* 498 */ "function_expression", + /* 499 */ "case_when_expression", + /* 500 */ "star_func", + /* 501 */ "star_func_para_list", + /* 502 */ "noarg_func", + /* 503 */ "other_para_list", + /* 504 */ "star_func_para", + /* 505 */ "when_then_list", + /* 506 */ "case_when_else_opt", + /* 507 */ "common_expression", + /* 508 */ "when_then_expr", + /* 509 */ "predicate", + /* 510 */ "compare_op", + /* 511 */ "in_op", + /* 512 */ "in_predicate_value", + /* 513 */ "boolean_value_expression", + /* 514 */ "boolean_primary", + /* 515 */ "from_clause_opt", + /* 516 */ "table_reference_list", + /* 517 */ "table_reference", + /* 518 */ "table_primary", + /* 519 */ "joined_table", + /* 520 */ "alias_opt", + /* 521 */ "subquery", + /* 522 */ "parenthesized_joined_table", + /* 523 */ "join_type", + /* 524 */ "join_subtype", + /* 525 */ "join_on_clause_opt", + /* 526 */ "window_offset_clause_opt", + /* 527 */ "jlimit_clause_opt", + /* 528 */ "window_offset_literal", + /* 529 */ "query_specification", + /* 530 */ "hint_list", + /* 531 */ "set_quantifier_opt", + /* 532 */ "tag_mode_opt", + /* 533 */ "select_list", + /* 534 */ "partition_by_clause_opt", + /* 535 */ "range_opt", + /* 536 */ "every_opt", + /* 537 */ "fill_opt", + /* 538 */ "twindow_clause_opt", + /* 539 */ "group_by_clause_opt", + /* 540 */ "having_clause_opt", + /* 541 */ "select_item", + /* 542 */ "partition_list", + /* 543 */ "partition_item", + /* 544 */ "interval_sliding_duration_literal", + /* 545 */ "fill_mode", + /* 546 */ "group_by_list", + /* 547 */ "query_expression", + /* 548 */ "query_simple", + /* 549 */ "order_by_clause_opt", + /* 550 */ "slimit_clause_opt", + /* 551 */ "limit_clause_opt", + /* 552 */ "union_query_expression", + /* 553 */ "query_simple_or_subquery", + /* 554 */ "sort_specification_list", + /* 555 */ "sort_specification", + /* 556 */ "ordering_specification_opt", + /* 557 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2240,726 +2575,731 @@ static const char *const yyRuleName[] = { /* 26 */ "white_list ::= HOST ip_range_list", /* 27 */ "white_list_opt ::=", /* 28 */ "white_list_opt ::= white_list", - /* 29 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt", - /* 30 */ "cmd ::= ALTER USER user_name PASS NK_STRING", - /* 31 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER", - /* 32 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER", - /* 33 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER", - /* 34 */ "cmd ::= ALTER USER user_name ADD white_list", - /* 35 */ "cmd ::= ALTER USER user_name DROP white_list", - /* 36 */ "cmd ::= DROP USER user_name", - /* 37 */ "sysinfo_opt ::=", - /* 38 */ "sysinfo_opt ::= SYSINFO NK_INTEGER", - /* 39 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name", - /* 40 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name", - /* 41 */ "privileges ::= ALL", - /* 42 */ "privileges ::= priv_type_list", - /* 43 */ "privileges ::= SUBSCRIBE", - /* 44 */ "priv_type_list ::= priv_type", - /* 45 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type", - /* 46 */ "priv_type ::= READ", - /* 47 */ "priv_type ::= WRITE", - /* 48 */ "priv_type ::= ALTER", - /* 49 */ "priv_level ::= NK_STAR NK_DOT NK_STAR", - /* 50 */ "priv_level ::= db_name NK_DOT NK_STAR", - /* 51 */ "priv_level ::= db_name NK_DOT table_name", - /* 52 */ "priv_level ::= topic_name", - /* 53 */ "with_opt ::=", - /* 54 */ "with_opt ::= WITH search_condition", - /* 55 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", - /* 56 */ "cmd ::= CREATE DNODE dnode_endpoint", - /* 57 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", - /* 58 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", - /* 59 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", - /* 60 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", - /* 61 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", - /* 62 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", - /* 63 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", - /* 64 */ "cmd ::= ALTER ALL DNODES NK_STRING", - /* 65 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", - /* 66 */ "cmd ::= RESTORE DNODE NK_INTEGER", - /* 67 */ "dnode_endpoint ::= NK_STRING", - /* 68 */ "dnode_endpoint ::= NK_ID", - /* 69 */ "dnode_endpoint ::= NK_IPTOKEN", - /* 70 */ "force_opt ::=", - /* 71 */ "force_opt ::= FORCE", - /* 72 */ "unsafe_opt ::= UNSAFE", - /* 73 */ "cmd ::= ALTER CLUSTER NK_STRING", - /* 74 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", - /* 75 */ "cmd ::= ALTER LOCAL NK_STRING", - /* 76 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", - /* 77 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 78 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", - /* 79 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", - /* 80 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", - /* 81 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", - /* 82 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", - /* 83 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", - /* 84 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", - /* 85 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", - /* 86 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", - /* 87 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", - /* 88 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 89 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 90 */ "cmd ::= USE db_name", - /* 91 */ "cmd ::= ALTER DATABASE db_name alter_db_options", - /* 92 */ "cmd ::= FLUSH DATABASE db_name", - /* 93 */ "cmd ::= TRIM DATABASE db_name speed_opt", - /* 94 */ "cmd ::= S3MIGRATE DATABASE db_name", - /* 95 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", - /* 96 */ "not_exists_opt ::= IF NOT EXISTS", - /* 97 */ "not_exists_opt ::=", - /* 98 */ "exists_opt ::= IF EXISTS", - /* 99 */ "exists_opt ::=", - /* 100 */ "db_options ::=", - /* 101 */ "db_options ::= db_options BUFFER NK_INTEGER", - /* 102 */ "db_options ::= db_options CACHEMODEL NK_STRING", - /* 103 */ "db_options ::= db_options CACHESIZE NK_INTEGER", - /* 104 */ "db_options ::= db_options COMP NK_INTEGER", - /* 105 */ "db_options ::= db_options DURATION NK_INTEGER", - /* 106 */ "db_options ::= db_options DURATION NK_VARIABLE", - /* 107 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 108 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 109 */ "db_options ::= db_options KEEP integer_list", - /* 110 */ "db_options ::= db_options KEEP variable_list", - /* 111 */ "db_options ::= db_options PAGES NK_INTEGER", - /* 112 */ "db_options ::= db_options PAGESIZE NK_INTEGER", - /* 113 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", - /* 114 */ "db_options ::= db_options PRECISION NK_STRING", - /* 115 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 116 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 117 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 118 */ "db_options ::= db_options RETENTIONS retention_list", - /* 119 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 120 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 121 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 122 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 123 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 124 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 125 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 126 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 127 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 128 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 129 */ "db_options ::= db_options TABLE_PREFIX signed", - /* 130 */ "db_options ::= db_options TABLE_SUFFIX signed", - /* 131 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", - /* 132 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", - /* 133 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", - /* 134 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", - /* 135 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", - /* 136 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", - /* 137 */ "alter_db_options ::= alter_db_option", - /* 138 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 139 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 140 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 141 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 142 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 143 */ "alter_db_option ::= KEEP integer_list", - /* 144 */ "alter_db_option ::= KEEP variable_list", - /* 145 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 146 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 147 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 148 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 149 */ "alter_db_option ::= MINROWS NK_INTEGER", - /* 150 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", - /* 151 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 152 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", - /* 153 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 154 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", - /* 155 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", - /* 156 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", - /* 157 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", - /* 158 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", - /* 159 */ "integer_list ::= NK_INTEGER", - /* 160 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 161 */ "variable_list ::= NK_VARIABLE", - /* 162 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 163 */ "retention_list ::= retention", - /* 164 */ "retention_list ::= retention_list NK_COMMA retention", - /* 165 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 166 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", - /* 167 */ "speed_opt ::=", - /* 168 */ "speed_opt ::= BWLIMIT NK_INTEGER", - /* 169 */ "start_opt ::=", - /* 170 */ "start_opt ::= START WITH NK_INTEGER", - /* 171 */ "start_opt ::= START WITH NK_STRING", - /* 172 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", - /* 173 */ "end_opt ::=", - /* 174 */ "end_opt ::= END WITH NK_INTEGER", - /* 175 */ "end_opt ::= END WITH NK_STRING", - /* 176 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", - /* 177 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 178 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 179 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 180 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 181 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 182 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 183 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 184 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 185 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", - /* 186 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 187 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 188 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", - /* 189 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 190 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 191 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 192 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 193 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 194 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", - /* 195 */ "multi_create_clause ::= create_subtable_clause", - /* 196 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 197 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", - /* 198 */ "multi_drop_clause ::= drop_table_clause", - /* 199 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 200 */ "drop_table_clause ::= exists_opt full_table_name", - /* 201 */ "specific_cols_opt ::=", - /* 202 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 203 */ "full_table_name ::= table_name", - /* 204 */ "full_table_name ::= db_name NK_DOT table_name", - /* 205 */ "tag_def_list ::= tag_def", - /* 206 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", - /* 207 */ "tag_def ::= column_name type_name", - /* 208 */ "column_def_list ::= column_def", - /* 209 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 210 */ "column_def ::= column_name type_name column_options", - /* 211 */ "type_name ::= BOOL", - /* 212 */ "type_name ::= TINYINT", - /* 213 */ "type_name ::= SMALLINT", - /* 214 */ "type_name ::= INT", - /* 215 */ "type_name ::= INTEGER", - /* 216 */ "type_name ::= BIGINT", - /* 217 */ "type_name ::= FLOAT", - /* 218 */ "type_name ::= DOUBLE", - /* 219 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 220 */ "type_name ::= TIMESTAMP", - /* 221 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 222 */ "type_name ::= TINYINT UNSIGNED", - /* 223 */ "type_name ::= SMALLINT UNSIGNED", - /* 224 */ "type_name ::= INT UNSIGNED", - /* 225 */ "type_name ::= BIGINT UNSIGNED", - /* 226 */ "type_name ::= JSON", - /* 227 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 228 */ "type_name ::= MEDIUMBLOB", - /* 229 */ "type_name ::= BLOB", - /* 230 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 231 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 232 */ "type_name ::= DECIMAL", - /* 233 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 234 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 235 */ "type_name_default_len ::= BINARY", - /* 236 */ "type_name_default_len ::= NCHAR", - /* 237 */ "type_name_default_len ::= VARCHAR", - /* 238 */ "type_name_default_len ::= VARBINARY", - /* 239 */ "tags_def_opt ::=", - /* 240 */ "tags_def_opt ::= tags_def", - /* 241 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", - /* 242 */ "table_options ::=", - /* 243 */ "table_options ::= table_options COMMENT NK_STRING", - /* 244 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 245 */ "table_options ::= table_options WATERMARK duration_list", - /* 246 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 247 */ "table_options ::= table_options TTL NK_INTEGER", - /* 248 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 249 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 250 */ "alter_table_options ::= alter_table_option", - /* 251 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 252 */ "alter_table_option ::= COMMENT NK_STRING", - /* 253 */ "alter_table_option ::= TTL NK_INTEGER", - /* 254 */ "duration_list ::= duration_literal", - /* 255 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 256 */ "rollup_func_list ::= rollup_func_name", - /* 257 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 258 */ "rollup_func_name ::= function_name", - /* 259 */ "rollup_func_name ::= FIRST", - /* 260 */ "rollup_func_name ::= LAST", - /* 261 */ "col_name_list ::= col_name", - /* 262 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 263 */ "col_name ::= column_name", - /* 264 */ "cmd ::= SHOW DNODES", - /* 265 */ "cmd ::= SHOW USERS", - /* 266 */ "cmd ::= SHOW USER PRIVILEGES", - /* 267 */ "cmd ::= SHOW db_kind_opt DATABASES", - /* 268 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", - /* 269 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 270 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 271 */ "cmd ::= SHOW MNODES", - /* 272 */ "cmd ::= SHOW QNODES", - /* 273 */ "cmd ::= SHOW ARBGROUPS", - /* 274 */ "cmd ::= SHOW FUNCTIONS", - /* 275 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 276 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 277 */ "cmd ::= SHOW STREAMS", - /* 278 */ "cmd ::= SHOW ACCOUNTS", - /* 279 */ "cmd ::= SHOW APPS", - /* 280 */ "cmd ::= SHOW CONNECTIONS", - /* 281 */ "cmd ::= SHOW LICENCES", - /* 282 */ "cmd ::= SHOW GRANTS", - /* 283 */ "cmd ::= SHOW GRANTS FULL", - /* 284 */ "cmd ::= SHOW GRANTS LOGS", - /* 285 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 286 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 287 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 288 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 289 */ "cmd ::= SHOW ENCRYPTIONS", - /* 290 */ "cmd ::= SHOW QUERIES", - /* 291 */ "cmd ::= SHOW SCORES", - /* 292 */ "cmd ::= SHOW TOPICS", - /* 293 */ "cmd ::= SHOW VARIABLES", - /* 294 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 295 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 296 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 297 */ "cmd ::= SHOW BNODES", - /* 298 */ "cmd ::= SHOW SNODES", - /* 299 */ "cmd ::= SHOW CLUSTER", - /* 300 */ "cmd ::= SHOW TRANSACTIONS", - /* 301 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 302 */ "cmd ::= SHOW CONSUMERS", - /* 303 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 304 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 305 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 306 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 307 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 308 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 309 */ "cmd ::= SHOW VNODES", - /* 310 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 311 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 312 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 313 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 314 */ "cmd ::= SHOW COMPACTS", - /* 315 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 316 */ "table_kind_db_name_cond_opt ::=", - /* 317 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 318 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 319 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 320 */ "table_kind ::= NORMAL", - /* 321 */ "table_kind ::= CHILD", - /* 322 */ "db_name_cond_opt ::=", - /* 323 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 324 */ "like_pattern_opt ::=", - /* 325 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 326 */ "table_name_cond ::= table_name", - /* 327 */ "from_db_opt ::=", - /* 328 */ "from_db_opt ::= FROM db_name", - /* 329 */ "tag_list_opt ::=", - /* 330 */ "tag_list_opt ::= tag_item", - /* 331 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 332 */ "tag_item ::= TBNAME", - /* 333 */ "tag_item ::= QTAGS", - /* 334 */ "tag_item ::= column_name", - /* 335 */ "tag_item ::= column_name column_alias", - /* 336 */ "tag_item ::= column_name AS column_alias", - /* 337 */ "db_kind_opt ::=", - /* 338 */ "db_kind_opt ::= USER", - /* 339 */ "db_kind_opt ::= SYSTEM", - /* 340 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", - /* 341 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", - /* 342 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", - /* 343 */ "cmd ::= SHOW db_name_cond_opt TSMAS", - /* 344 */ "full_tsma_name ::= tsma_name", - /* 345 */ "full_tsma_name ::= db_name NK_DOT tsma_name", - /* 346 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", - /* 347 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 348 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 349 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 350 */ "full_index_name ::= index_name", - /* 351 */ "full_index_name ::= db_name NK_DOT index_name", - /* 352 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 353 */ "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", - /* 354 */ "func_list ::= func", - /* 355 */ "func_list ::= func_list NK_COMMA func", - /* 356 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 357 */ "sma_func_name ::= function_name", - /* 358 */ "sma_func_name ::= COUNT", - /* 359 */ "sma_func_name ::= FIRST", - /* 360 */ "sma_func_name ::= LAST", - /* 361 */ "sma_func_name ::= LAST_ROW", - /* 362 */ "sma_stream_opt ::=", - /* 363 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 364 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 365 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 366 */ "with_meta ::= AS", - /* 367 */ "with_meta ::= WITH META AS", - /* 368 */ "with_meta ::= ONLY META AS", - /* 369 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 370 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 371 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 372 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 373 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 374 */ "cmd ::= DESC full_table_name", - /* 375 */ "cmd ::= DESCRIBE full_table_name", - /* 376 */ "cmd ::= RESET QUERY CACHE", - /* 377 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 378 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 379 */ "analyze_opt ::=", - /* 380 */ "analyze_opt ::= ANALYZE", - /* 381 */ "explain_options ::=", - /* 382 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 383 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 384 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 385 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 386 */ "agg_func_opt ::=", - /* 387 */ "agg_func_opt ::= AGGREGATE", - /* 388 */ "bufsize_opt ::=", - /* 389 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 390 */ "language_opt ::=", - /* 391 */ "language_opt ::= LANGUAGE NK_STRING", - /* 392 */ "or_replace_opt ::=", - /* 393 */ "or_replace_opt ::= OR REPLACE", - /* 394 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 395 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 396 */ "full_view_name ::= view_name", - /* 397 */ "full_view_name ::= db_name NK_DOT view_name", - /* 398 */ "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", - /* 399 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 400 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 401 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 402 */ "col_list_opt ::=", - /* 403 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", - /* 404 */ "column_stream_def_list ::= column_stream_def", - /* 405 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", - /* 406 */ "column_stream_def ::= column_name stream_col_options", - /* 407 */ "stream_col_options ::=", - /* 408 */ "stream_col_options ::= stream_col_options PRIMARY KEY", - /* 409 */ "tag_def_or_ref_opt ::=", - /* 410 */ "tag_def_or_ref_opt ::= tags_def", - /* 411 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", - /* 412 */ "stream_options ::=", - /* 413 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 414 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 415 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 416 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 417 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 418 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 419 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 420 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 421 */ "subtable_opt ::=", - /* 422 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 423 */ "ignore_opt ::=", - /* 424 */ "ignore_opt ::= IGNORE UNTREATED", - /* 425 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 426 */ "cmd ::= KILL QUERY NK_STRING", - /* 427 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 428 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 429 */ "cmd ::= BALANCE VGROUP", - /* 430 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 431 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", - /* 432 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 433 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 434 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 435 */ "on_vgroup_id ::=", - /* 436 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 437 */ "dnode_list ::= DNODE NK_INTEGER", - /* 438 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 439 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 440 */ "cmd ::= query_or_subquery", - /* 441 */ "cmd ::= insert_query", - /* 442 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 443 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 444 */ "tags_literal ::= NK_INTEGER", - /* 445 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", - /* 446 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", - /* 447 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 448 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", - /* 449 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", - /* 450 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 451 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", - /* 452 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", - /* 453 */ "tags_literal ::= NK_FLOAT", - /* 454 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 455 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 456 */ "tags_literal ::= NK_BIN", - /* 457 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", - /* 458 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", - /* 459 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 460 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", - /* 461 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", - /* 462 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 463 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", - /* 464 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", - /* 465 */ "tags_literal ::= NK_HEX", - /* 466 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", - /* 467 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", - /* 468 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 469 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", - /* 470 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", - /* 471 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 472 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", - /* 473 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", - /* 474 */ "tags_literal ::= NK_STRING", - /* 475 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", - /* 476 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", - /* 477 */ "tags_literal ::= NK_BOOL", - /* 478 */ "tags_literal ::= NULL", - /* 479 */ "tags_literal ::= literal_func", - /* 480 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 481 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 482 */ "tags_literal_list ::= tags_literal", - /* 483 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 484 */ "literal ::= NK_INTEGER", - /* 485 */ "literal ::= NK_FLOAT", - /* 486 */ "literal ::= NK_STRING", - /* 487 */ "literal ::= NK_BOOL", - /* 488 */ "literal ::= TIMESTAMP NK_STRING", - /* 489 */ "literal ::= duration_literal", - /* 490 */ "literal ::= NULL", - /* 491 */ "literal ::= NK_QUESTION", - /* 492 */ "duration_literal ::= NK_VARIABLE", - /* 493 */ "signed ::= NK_INTEGER", - /* 494 */ "signed ::= NK_PLUS NK_INTEGER", - /* 495 */ "signed ::= NK_MINUS NK_INTEGER", - /* 496 */ "signed ::= NK_FLOAT", - /* 497 */ "signed ::= NK_PLUS NK_FLOAT", - /* 498 */ "signed ::= NK_MINUS NK_FLOAT", - /* 499 */ "signed_literal ::= signed", - /* 500 */ "signed_literal ::= NK_STRING", - /* 501 */ "signed_literal ::= NK_BOOL", - /* 502 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 503 */ "signed_literal ::= duration_literal", - /* 504 */ "signed_literal ::= NULL", - /* 505 */ "signed_literal ::= literal_func", - /* 506 */ "signed_literal ::= NK_QUESTION", - /* 507 */ "literal_list ::= signed_literal", - /* 508 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 509 */ "db_name ::= NK_ID", - /* 510 */ "table_name ::= NK_ID", - /* 511 */ "column_name ::= NK_ID", - /* 512 */ "function_name ::= NK_ID", - /* 513 */ "view_name ::= NK_ID", - /* 514 */ "table_alias ::= NK_ID", - /* 515 */ "column_alias ::= NK_ID", - /* 516 */ "column_alias ::= NK_ALIAS", - /* 517 */ "user_name ::= NK_ID", - /* 518 */ "topic_name ::= NK_ID", - /* 519 */ "stream_name ::= NK_ID", - /* 520 */ "cgroup_name ::= NK_ID", - /* 521 */ "index_name ::= NK_ID", - /* 522 */ "tsma_name ::= NK_ID", - /* 523 */ "expr_or_subquery ::= expression", - /* 524 */ "expression ::= literal", - /* 525 */ "expression ::= pseudo_column", - /* 526 */ "expression ::= column_reference", - /* 527 */ "expression ::= function_expression", - /* 528 */ "expression ::= case_when_expression", - /* 529 */ "expression ::= NK_LP expression NK_RP", - /* 530 */ "expression ::= NK_PLUS expr_or_subquery", - /* 531 */ "expression ::= NK_MINUS expr_or_subquery", - /* 532 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 533 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 534 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 535 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 536 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 537 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 538 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 539 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 540 */ "expression_list ::= expr_or_subquery", - /* 541 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 542 */ "column_reference ::= column_name", - /* 543 */ "column_reference ::= table_name NK_DOT column_name", - /* 544 */ "column_reference ::= NK_ALIAS", - /* 545 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 546 */ "pseudo_column ::= ROWTS", - /* 547 */ "pseudo_column ::= TBNAME", - /* 548 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 549 */ "pseudo_column ::= QSTART", - /* 550 */ "pseudo_column ::= QEND", - /* 551 */ "pseudo_column ::= QDURATION", - /* 552 */ "pseudo_column ::= WSTART", - /* 553 */ "pseudo_column ::= WEND", - /* 554 */ "pseudo_column ::= WDURATION", - /* 555 */ "pseudo_column ::= IROWTS", - /* 556 */ "pseudo_column ::= ISFILLED", - /* 557 */ "pseudo_column ::= QTAGS", - /* 558 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 559 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 560 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 561 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", - /* 562 */ "function_expression ::= literal_func", - /* 563 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 564 */ "literal_func ::= NOW", - /* 565 */ "literal_func ::= TODAY", - /* 566 */ "noarg_func ::= NOW", - /* 567 */ "noarg_func ::= TODAY", - /* 568 */ "noarg_func ::= TIMEZONE", - /* 569 */ "noarg_func ::= DATABASE", - /* 570 */ "noarg_func ::= CLIENT_VERSION", - /* 571 */ "noarg_func ::= SERVER_VERSION", - /* 572 */ "noarg_func ::= SERVER_STATUS", - /* 573 */ "noarg_func ::= CURRENT_USER", - /* 574 */ "noarg_func ::= USER", - /* 575 */ "star_func ::= COUNT", - /* 576 */ "star_func ::= FIRST", - /* 577 */ "star_func ::= LAST", - /* 578 */ "star_func ::= LAST_ROW", - /* 579 */ "star_func_para_list ::= NK_STAR", - /* 580 */ "star_func_para_list ::= other_para_list", - /* 581 */ "other_para_list ::= star_func_para", - /* 582 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 583 */ "star_func_para ::= expr_or_subquery", - /* 584 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 585 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 586 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 587 */ "when_then_list ::= when_then_expr", - /* 588 */ "when_then_list ::= when_then_list when_then_expr", - /* 589 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 590 */ "case_when_else_opt ::=", - /* 591 */ "case_when_else_opt ::= ELSE common_expression", - /* 592 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 593 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 594 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 595 */ "predicate ::= expr_or_subquery IS NULL", - /* 596 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 597 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 598 */ "compare_op ::= NK_LT", - /* 599 */ "compare_op ::= NK_GT", - /* 600 */ "compare_op ::= NK_LE", - /* 601 */ "compare_op ::= NK_GE", - /* 602 */ "compare_op ::= NK_NE", - /* 603 */ "compare_op ::= NK_EQ", - /* 604 */ "compare_op ::= LIKE", - /* 605 */ "compare_op ::= NOT LIKE", - /* 606 */ "compare_op ::= MATCH", - /* 607 */ "compare_op ::= NMATCH", - /* 608 */ "compare_op ::= CONTAINS", - /* 609 */ "in_op ::= IN", - /* 610 */ "in_op ::= NOT IN", - /* 611 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 612 */ "boolean_value_expression ::= boolean_primary", - /* 613 */ "boolean_value_expression ::= NOT boolean_primary", - /* 614 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 615 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 616 */ "boolean_primary ::= predicate", - /* 617 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 618 */ "common_expression ::= expr_or_subquery", - /* 619 */ "common_expression ::= boolean_value_expression", - /* 620 */ "from_clause_opt ::=", - /* 621 */ "from_clause_opt ::= FROM table_reference_list", - /* 622 */ "table_reference_list ::= table_reference", - /* 623 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 624 */ "table_reference ::= table_primary", - /* 625 */ "table_reference ::= joined_table", - /* 626 */ "table_primary ::= table_name alias_opt", - /* 627 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 628 */ "table_primary ::= subquery alias_opt", - /* 629 */ "table_primary ::= parenthesized_joined_table", - /* 630 */ "alias_opt ::=", - /* 631 */ "alias_opt ::= table_alias", - /* 632 */ "alias_opt ::= AS table_alias", - /* 633 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 634 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 635 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 636 */ "join_type ::=", - /* 637 */ "join_type ::= INNER", - /* 638 */ "join_type ::= LEFT", - /* 639 */ "join_type ::= RIGHT", - /* 640 */ "join_type ::= FULL", - /* 641 */ "join_subtype ::=", - /* 642 */ "join_subtype ::= OUTER", - /* 643 */ "join_subtype ::= SEMI", - /* 644 */ "join_subtype ::= ANTI", - /* 645 */ "join_subtype ::= ASOF", - /* 646 */ "join_subtype ::= WINDOW", - /* 647 */ "join_on_clause_opt ::=", - /* 648 */ "join_on_clause_opt ::= ON search_condition", - /* 649 */ "window_offset_clause_opt ::=", - /* 650 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 651 */ "window_offset_literal ::= NK_VARIABLE", - /* 652 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 653 */ "jlimit_clause_opt ::=", - /* 654 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 655 */ "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", - /* 656 */ "hint_list ::=", - /* 657 */ "hint_list ::= NK_HINT", - /* 658 */ "tag_mode_opt ::=", - /* 659 */ "tag_mode_opt ::= TAGS", - /* 660 */ "set_quantifier_opt ::=", - /* 661 */ "set_quantifier_opt ::= DISTINCT", - /* 662 */ "set_quantifier_opt ::= ALL", - /* 663 */ "select_list ::= select_item", - /* 664 */ "select_list ::= select_list NK_COMMA select_item", - /* 665 */ "select_item ::= NK_STAR", - /* 666 */ "select_item ::= common_expression", - /* 667 */ "select_item ::= common_expression column_alias", - /* 668 */ "select_item ::= common_expression AS column_alias", - /* 669 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 670 */ "where_clause_opt ::=", - /* 671 */ "where_clause_opt ::= WHERE search_condition", - /* 672 */ "partition_by_clause_opt ::=", - /* 673 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 674 */ "partition_list ::= partition_item", - /* 675 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 676 */ "partition_item ::= expr_or_subquery", - /* 677 */ "partition_item ::= expr_or_subquery column_alias", - /* 678 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 679 */ "twindow_clause_opt ::=", - /* 680 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 681 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 682 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 683 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 684 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 685 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 686 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 687 */ "sliding_opt ::=", - /* 688 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 689 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 690 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 691 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 692 */ "fill_opt ::=", - /* 693 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 694 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 695 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 696 */ "fill_mode ::= NONE", - /* 697 */ "fill_mode ::= PREV", - /* 698 */ "fill_mode ::= NULL", - /* 699 */ "fill_mode ::= NULL_F", - /* 700 */ "fill_mode ::= LINEAR", - /* 701 */ "fill_mode ::= NEXT", - /* 702 */ "group_by_clause_opt ::=", - /* 703 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 704 */ "group_by_list ::= expr_or_subquery", - /* 705 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 706 */ "having_clause_opt ::=", - /* 707 */ "having_clause_opt ::= HAVING search_condition", - /* 708 */ "range_opt ::=", - /* 709 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 710 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 711 */ "every_opt ::=", - /* 712 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 713 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 714 */ "query_simple ::= query_specification", - /* 715 */ "query_simple ::= union_query_expression", - /* 716 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 717 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 718 */ "query_simple_or_subquery ::= query_simple", - /* 719 */ "query_simple_or_subquery ::= subquery", - /* 720 */ "query_or_subquery ::= query_expression", - /* 721 */ "query_or_subquery ::= subquery", - /* 722 */ "order_by_clause_opt ::=", - /* 723 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 724 */ "slimit_clause_opt ::=", - /* 725 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 726 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 727 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 728 */ "limit_clause_opt ::=", - /* 729 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 730 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 731 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 732 */ "subquery ::= NK_LP query_expression NK_RP", - /* 733 */ "subquery ::= NK_LP subquery NK_RP", - /* 734 */ "search_condition ::= common_expression", - /* 735 */ "sort_specification_list ::= sort_specification", - /* 736 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 737 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 738 */ "ordering_specification_opt ::=", - /* 739 */ "ordering_specification_opt ::= ASC", - /* 740 */ "ordering_specification_opt ::= DESC", - /* 741 */ "null_ordering_opt ::=", - /* 742 */ "null_ordering_opt ::= NULLS FIRST", - /* 743 */ "null_ordering_opt ::= NULLS LAST", - /* 744 */ "column_options ::=", - /* 745 */ "column_options ::= column_options PRIMARY KEY", - /* 746 */ "column_options ::= column_options ENCODE NK_STRING", - /* 747 */ "column_options ::= column_options COMPRESS NK_STRING", - /* 748 */ "column_options ::= column_options LEVEL NK_STRING", + /* 29 */ "is_import_opt ::=", + /* 30 */ "is_import_opt ::= IS_IMPORT NK_INTEGER", + /* 31 */ "is_createdb_opt ::=", + /* 32 */ "is_createdb_opt ::= CREATEDB NK_INTEGER", + /* 33 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt", + /* 34 */ "cmd ::= ALTER USER user_name PASS NK_STRING", + /* 35 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER", + /* 36 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER", + /* 37 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER", + /* 38 */ "cmd ::= ALTER USER user_name ADD white_list", + /* 39 */ "cmd ::= ALTER USER user_name DROP white_list", + /* 40 */ "cmd ::= DROP USER user_name", + /* 41 */ "sysinfo_opt ::=", + /* 42 */ "sysinfo_opt ::= SYSINFO NK_INTEGER", + /* 43 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name", + /* 44 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name", + /* 45 */ "privileges ::= ALL", + /* 46 */ "privileges ::= priv_type_list", + /* 47 */ "privileges ::= SUBSCRIBE", + /* 48 */ "priv_type_list ::= priv_type", + /* 49 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type", + /* 50 */ "priv_type ::= READ", + /* 51 */ "priv_type ::= WRITE", + /* 52 */ "priv_type ::= ALTER", + /* 53 */ "priv_level ::= NK_STAR NK_DOT NK_STAR", + /* 54 */ "priv_level ::= db_name NK_DOT NK_STAR", + /* 55 */ "priv_level ::= db_name NK_DOT table_name", + /* 56 */ "priv_level ::= topic_name", + /* 57 */ "with_opt ::=", + /* 58 */ "with_opt ::= WITH search_condition", + /* 59 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", + /* 60 */ "cmd ::= CREATE DNODE dnode_endpoint", + /* 61 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", + /* 62 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", + /* 63 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", + /* 64 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", + /* 65 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", + /* 66 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", + /* 67 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", + /* 68 */ "cmd ::= ALTER ALL DNODES NK_STRING", + /* 69 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", + /* 70 */ "cmd ::= RESTORE DNODE NK_INTEGER", + /* 71 */ "dnode_endpoint ::= NK_STRING", + /* 72 */ "dnode_endpoint ::= NK_ID", + /* 73 */ "dnode_endpoint ::= NK_IPTOKEN", + /* 74 */ "force_opt ::=", + /* 75 */ "force_opt ::= FORCE", + /* 76 */ "unsafe_opt ::= UNSAFE", + /* 77 */ "cmd ::= ALTER CLUSTER NK_STRING", + /* 78 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", + /* 79 */ "cmd ::= ALTER LOCAL NK_STRING", + /* 80 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", + /* 81 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", + /* 82 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 83 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", + /* 84 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", + /* 85 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", + /* 86 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", + /* 87 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", + /* 88 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", + /* 89 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", + /* 90 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", + /* 91 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", + /* 92 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 93 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 94 */ "cmd ::= USE db_name", + /* 95 */ "cmd ::= ALTER DATABASE db_name alter_db_options", + /* 96 */ "cmd ::= FLUSH DATABASE db_name", + /* 97 */ "cmd ::= TRIM DATABASE db_name speed_opt", + /* 98 */ "cmd ::= S3MIGRATE DATABASE db_name", + /* 99 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", + /* 100 */ "not_exists_opt ::= IF NOT EXISTS", + /* 101 */ "not_exists_opt ::=", + /* 102 */ "exists_opt ::= IF EXISTS", + /* 103 */ "exists_opt ::=", + /* 104 */ "db_options ::=", + /* 105 */ "db_options ::= db_options BUFFER NK_INTEGER", + /* 106 */ "db_options ::= db_options CACHEMODEL NK_STRING", + /* 107 */ "db_options ::= db_options CACHESIZE NK_INTEGER", + /* 108 */ "db_options ::= db_options COMP NK_INTEGER", + /* 109 */ "db_options ::= db_options DURATION NK_INTEGER", + /* 110 */ "db_options ::= db_options DURATION NK_VARIABLE", + /* 111 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 112 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 113 */ "db_options ::= db_options KEEP integer_list", + /* 114 */ "db_options ::= db_options KEEP variable_list", + /* 115 */ "db_options ::= db_options PAGES NK_INTEGER", + /* 116 */ "db_options ::= db_options PAGESIZE NK_INTEGER", + /* 117 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", + /* 118 */ "db_options ::= db_options PRECISION NK_STRING", + /* 119 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 120 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 121 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 122 */ "db_options ::= db_options RETENTIONS retention_list", + /* 123 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 124 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 125 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 126 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 127 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 128 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 129 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 130 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 131 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 132 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 133 */ "db_options ::= db_options TABLE_PREFIX signed", + /* 134 */ "db_options ::= db_options TABLE_SUFFIX signed", + /* 135 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", + /* 136 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", + /* 137 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", + /* 138 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", + /* 139 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", + /* 140 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", + /* 141 */ "alter_db_options ::= alter_db_option", + /* 142 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 143 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 144 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 145 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 146 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 147 */ "alter_db_option ::= KEEP integer_list", + /* 148 */ "alter_db_option ::= KEEP variable_list", + /* 149 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 150 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 151 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 152 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 153 */ "alter_db_option ::= MINROWS NK_INTEGER", + /* 154 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", + /* 155 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 156 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", + /* 157 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 158 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", + /* 159 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", + /* 160 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", + /* 161 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", + /* 162 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", + /* 163 */ "integer_list ::= NK_INTEGER", + /* 164 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 165 */ "variable_list ::= NK_VARIABLE", + /* 166 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 167 */ "retention_list ::= retention", + /* 168 */ "retention_list ::= retention_list NK_COMMA retention", + /* 169 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 170 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", + /* 171 */ "speed_opt ::=", + /* 172 */ "speed_opt ::= BWLIMIT NK_INTEGER", + /* 173 */ "start_opt ::=", + /* 174 */ "start_opt ::= START WITH NK_INTEGER", + /* 175 */ "start_opt ::= START WITH NK_STRING", + /* 176 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", + /* 177 */ "end_opt ::=", + /* 178 */ "end_opt ::= END WITH NK_INTEGER", + /* 179 */ "end_opt ::= END WITH NK_STRING", + /* 180 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", + /* 181 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 182 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 183 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 184 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 185 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 186 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 187 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 188 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 189 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", + /* 190 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 191 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 192 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", + /* 193 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 194 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 195 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 196 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 197 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 198 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", + /* 199 */ "multi_create_clause ::= create_subtable_clause", + /* 200 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 201 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", + /* 202 */ "multi_drop_clause ::= drop_table_clause", + /* 203 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", + /* 204 */ "drop_table_clause ::= exists_opt full_table_name", + /* 205 */ "specific_cols_opt ::=", + /* 206 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 207 */ "full_table_name ::= table_name", + /* 208 */ "full_table_name ::= db_name NK_DOT table_name", + /* 209 */ "tag_def_list ::= tag_def", + /* 210 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", + /* 211 */ "tag_def ::= column_name type_name", + /* 212 */ "column_def_list ::= column_def", + /* 213 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 214 */ "column_def ::= column_name type_name column_options", + /* 215 */ "type_name ::= BOOL", + /* 216 */ "type_name ::= TINYINT", + /* 217 */ "type_name ::= SMALLINT", + /* 218 */ "type_name ::= INT", + /* 219 */ "type_name ::= INTEGER", + /* 220 */ "type_name ::= BIGINT", + /* 221 */ "type_name ::= FLOAT", + /* 222 */ "type_name ::= DOUBLE", + /* 223 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 224 */ "type_name ::= TIMESTAMP", + /* 225 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 226 */ "type_name ::= TINYINT UNSIGNED", + /* 227 */ "type_name ::= SMALLINT UNSIGNED", + /* 228 */ "type_name ::= INT UNSIGNED", + /* 229 */ "type_name ::= BIGINT UNSIGNED", + /* 230 */ "type_name ::= JSON", + /* 231 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 232 */ "type_name ::= MEDIUMBLOB", + /* 233 */ "type_name ::= BLOB", + /* 234 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 235 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 236 */ "type_name ::= DECIMAL", + /* 237 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 238 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 239 */ "type_name_default_len ::= BINARY", + /* 240 */ "type_name_default_len ::= NCHAR", + /* 241 */ "type_name_default_len ::= VARCHAR", + /* 242 */ "type_name_default_len ::= VARBINARY", + /* 243 */ "tags_def_opt ::=", + /* 244 */ "tags_def_opt ::= tags_def", + /* 245 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", + /* 246 */ "table_options ::=", + /* 247 */ "table_options ::= table_options COMMENT NK_STRING", + /* 248 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 249 */ "table_options ::= table_options WATERMARK duration_list", + /* 250 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 251 */ "table_options ::= table_options TTL NK_INTEGER", + /* 252 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 253 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 254 */ "alter_table_options ::= alter_table_option", + /* 255 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 256 */ "alter_table_option ::= COMMENT NK_STRING", + /* 257 */ "alter_table_option ::= TTL NK_INTEGER", + /* 258 */ "duration_list ::= duration_literal", + /* 259 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 260 */ "rollup_func_list ::= rollup_func_name", + /* 261 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 262 */ "rollup_func_name ::= function_name", + /* 263 */ "rollup_func_name ::= FIRST", + /* 264 */ "rollup_func_name ::= LAST", + /* 265 */ "col_name_list ::= col_name", + /* 266 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 267 */ "col_name ::= column_name", + /* 268 */ "cmd ::= SHOW DNODES", + /* 269 */ "cmd ::= SHOW USERS", + /* 270 */ "cmd ::= SHOW USERS FULL", + /* 271 */ "cmd ::= SHOW USER PRIVILEGES", + /* 272 */ "cmd ::= SHOW db_kind_opt DATABASES", + /* 273 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", + /* 274 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 275 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 276 */ "cmd ::= SHOW MNODES", + /* 277 */ "cmd ::= SHOW QNODES", + /* 278 */ "cmd ::= SHOW ARBGROUPS", + /* 279 */ "cmd ::= SHOW FUNCTIONS", + /* 280 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 281 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 282 */ "cmd ::= SHOW STREAMS", + /* 283 */ "cmd ::= SHOW ACCOUNTS", + /* 284 */ "cmd ::= SHOW APPS", + /* 285 */ "cmd ::= SHOW CONNECTIONS", + /* 286 */ "cmd ::= SHOW LICENCES", + /* 287 */ "cmd ::= SHOW GRANTS", + /* 288 */ "cmd ::= SHOW GRANTS FULL", + /* 289 */ "cmd ::= SHOW GRANTS LOGS", + /* 290 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 291 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 292 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 293 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 294 */ "cmd ::= SHOW ENCRYPTIONS", + /* 295 */ "cmd ::= SHOW QUERIES", + /* 296 */ "cmd ::= SHOW SCORES", + /* 297 */ "cmd ::= SHOW TOPICS", + /* 298 */ "cmd ::= SHOW VARIABLES", + /* 299 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 300 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 301 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 302 */ "cmd ::= SHOW BNODES", + /* 303 */ "cmd ::= SHOW SNODES", + /* 304 */ "cmd ::= SHOW CLUSTER", + /* 305 */ "cmd ::= SHOW TRANSACTIONS", + /* 306 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 307 */ "cmd ::= SHOW CONSUMERS", + /* 308 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 309 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 310 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 311 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 312 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 313 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 314 */ "cmd ::= SHOW VNODES", + /* 315 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 316 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 317 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 318 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 319 */ "cmd ::= SHOW COMPACTS", + /* 320 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 321 */ "table_kind_db_name_cond_opt ::=", + /* 322 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 323 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 324 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 325 */ "table_kind ::= NORMAL", + /* 326 */ "table_kind ::= CHILD", + /* 327 */ "db_name_cond_opt ::=", + /* 328 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 329 */ "like_pattern_opt ::=", + /* 330 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 331 */ "table_name_cond ::= table_name", + /* 332 */ "from_db_opt ::=", + /* 333 */ "from_db_opt ::= FROM db_name", + /* 334 */ "tag_list_opt ::=", + /* 335 */ "tag_list_opt ::= tag_item", + /* 336 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 337 */ "tag_item ::= TBNAME", + /* 338 */ "tag_item ::= QTAGS", + /* 339 */ "tag_item ::= column_name", + /* 340 */ "tag_item ::= column_name column_alias", + /* 341 */ "tag_item ::= column_name AS column_alias", + /* 342 */ "db_kind_opt ::=", + /* 343 */ "db_kind_opt ::= USER", + /* 344 */ "db_kind_opt ::= SYSTEM", + /* 345 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", + /* 346 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", + /* 347 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", + /* 348 */ "cmd ::= SHOW db_name_cond_opt TSMAS", + /* 349 */ "full_tsma_name ::= tsma_name", + /* 350 */ "full_tsma_name ::= db_name NK_DOT tsma_name", + /* 351 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", + /* 352 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 353 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 354 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 355 */ "full_index_name ::= index_name", + /* 356 */ "full_index_name ::= db_name NK_DOT index_name", + /* 357 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 358 */ "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", + /* 359 */ "func_list ::= func", + /* 360 */ "func_list ::= func_list NK_COMMA func", + /* 361 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 362 */ "sma_func_name ::= function_name", + /* 363 */ "sma_func_name ::= COUNT", + /* 364 */ "sma_func_name ::= FIRST", + /* 365 */ "sma_func_name ::= LAST", + /* 366 */ "sma_func_name ::= LAST_ROW", + /* 367 */ "sma_stream_opt ::=", + /* 368 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 369 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 370 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 371 */ "with_meta ::= AS", + /* 372 */ "with_meta ::= WITH META AS", + /* 373 */ "with_meta ::= ONLY META AS", + /* 374 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 375 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 376 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 377 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 378 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 379 */ "cmd ::= DESC full_table_name", + /* 380 */ "cmd ::= DESCRIBE full_table_name", + /* 381 */ "cmd ::= RESET QUERY CACHE", + /* 382 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 383 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 384 */ "analyze_opt ::=", + /* 385 */ "analyze_opt ::= ANALYZE", + /* 386 */ "explain_options ::=", + /* 387 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 388 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 389 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 390 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 391 */ "agg_func_opt ::=", + /* 392 */ "agg_func_opt ::= AGGREGATE", + /* 393 */ "bufsize_opt ::=", + /* 394 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 395 */ "language_opt ::=", + /* 396 */ "language_opt ::= LANGUAGE NK_STRING", + /* 397 */ "or_replace_opt ::=", + /* 398 */ "or_replace_opt ::= OR REPLACE", + /* 399 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 400 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 401 */ "full_view_name ::= view_name", + /* 402 */ "full_view_name ::= db_name NK_DOT view_name", + /* 403 */ "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", + /* 404 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 405 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 406 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 407 */ "col_list_opt ::=", + /* 408 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", + /* 409 */ "column_stream_def_list ::= column_stream_def", + /* 410 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", + /* 411 */ "column_stream_def ::= column_name stream_col_options", + /* 412 */ "stream_col_options ::=", + /* 413 */ "stream_col_options ::= stream_col_options PRIMARY KEY", + /* 414 */ "tag_def_or_ref_opt ::=", + /* 415 */ "tag_def_or_ref_opt ::= tags_def", + /* 416 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", + /* 417 */ "stream_options ::=", + /* 418 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 419 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 420 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 421 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 422 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 423 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 424 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 425 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 426 */ "subtable_opt ::=", + /* 427 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 428 */ "ignore_opt ::=", + /* 429 */ "ignore_opt ::= IGNORE UNTREATED", + /* 430 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 431 */ "cmd ::= KILL QUERY NK_STRING", + /* 432 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 433 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 434 */ "cmd ::= BALANCE VGROUP", + /* 435 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 436 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", + /* 437 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 438 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 439 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 440 */ "on_vgroup_id ::=", + /* 441 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 442 */ "dnode_list ::= DNODE NK_INTEGER", + /* 443 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 444 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 445 */ "cmd ::= query_or_subquery", + /* 446 */ "cmd ::= insert_query", + /* 447 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 448 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 449 */ "tags_literal ::= NK_INTEGER", + /* 450 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", + /* 451 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", + /* 452 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 453 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", + /* 454 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", + /* 455 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 456 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", + /* 457 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", + /* 458 */ "tags_literal ::= NK_FLOAT", + /* 459 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 460 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 461 */ "tags_literal ::= NK_BIN", + /* 462 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", + /* 463 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", + /* 464 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 465 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", + /* 466 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", + /* 467 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 468 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", + /* 469 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", + /* 470 */ "tags_literal ::= NK_HEX", + /* 471 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", + /* 472 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", + /* 473 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 474 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", + /* 475 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", + /* 476 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 477 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", + /* 478 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", + /* 479 */ "tags_literal ::= NK_STRING", + /* 480 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", + /* 481 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", + /* 482 */ "tags_literal ::= NK_BOOL", + /* 483 */ "tags_literal ::= NULL", + /* 484 */ "tags_literal ::= literal_func", + /* 485 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 486 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 487 */ "tags_literal_list ::= tags_literal", + /* 488 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 489 */ "literal ::= NK_INTEGER", + /* 490 */ "literal ::= NK_FLOAT", + /* 491 */ "literal ::= NK_STRING", + /* 492 */ "literal ::= NK_BOOL", + /* 493 */ "literal ::= TIMESTAMP NK_STRING", + /* 494 */ "literal ::= duration_literal", + /* 495 */ "literal ::= NULL", + /* 496 */ "literal ::= NK_QUESTION", + /* 497 */ "duration_literal ::= NK_VARIABLE", + /* 498 */ "signed ::= NK_INTEGER", + /* 499 */ "signed ::= NK_PLUS NK_INTEGER", + /* 500 */ "signed ::= NK_MINUS NK_INTEGER", + /* 501 */ "signed ::= NK_FLOAT", + /* 502 */ "signed ::= NK_PLUS NK_FLOAT", + /* 503 */ "signed ::= NK_MINUS NK_FLOAT", + /* 504 */ "signed_literal ::= signed", + /* 505 */ "signed_literal ::= NK_STRING", + /* 506 */ "signed_literal ::= NK_BOOL", + /* 507 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 508 */ "signed_literal ::= duration_literal", + /* 509 */ "signed_literal ::= NULL", + /* 510 */ "signed_literal ::= literal_func", + /* 511 */ "signed_literal ::= NK_QUESTION", + /* 512 */ "literal_list ::= signed_literal", + /* 513 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 514 */ "db_name ::= NK_ID", + /* 515 */ "table_name ::= NK_ID", + /* 516 */ "column_name ::= NK_ID", + /* 517 */ "function_name ::= NK_ID", + /* 518 */ "view_name ::= NK_ID", + /* 519 */ "table_alias ::= NK_ID", + /* 520 */ "column_alias ::= NK_ID", + /* 521 */ "column_alias ::= NK_ALIAS", + /* 522 */ "user_name ::= NK_ID", + /* 523 */ "topic_name ::= NK_ID", + /* 524 */ "stream_name ::= NK_ID", + /* 525 */ "cgroup_name ::= NK_ID", + /* 526 */ "index_name ::= NK_ID", + /* 527 */ "tsma_name ::= NK_ID", + /* 528 */ "expr_or_subquery ::= expression", + /* 529 */ "expression ::= literal", + /* 530 */ "expression ::= pseudo_column", + /* 531 */ "expression ::= column_reference", + /* 532 */ "expression ::= function_expression", + /* 533 */ "expression ::= case_when_expression", + /* 534 */ "expression ::= NK_LP expression NK_RP", + /* 535 */ "expression ::= NK_PLUS expr_or_subquery", + /* 536 */ "expression ::= NK_MINUS expr_or_subquery", + /* 537 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 538 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 539 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 540 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 541 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 542 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 543 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 544 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 545 */ "expression_list ::= expr_or_subquery", + /* 546 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 547 */ "column_reference ::= column_name", + /* 548 */ "column_reference ::= table_name NK_DOT column_name", + /* 549 */ "column_reference ::= NK_ALIAS", + /* 550 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 551 */ "pseudo_column ::= ROWTS", + /* 552 */ "pseudo_column ::= TBNAME", + /* 553 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 554 */ "pseudo_column ::= QSTART", + /* 555 */ "pseudo_column ::= QEND", + /* 556 */ "pseudo_column ::= QDURATION", + /* 557 */ "pseudo_column ::= WSTART", + /* 558 */ "pseudo_column ::= WEND", + /* 559 */ "pseudo_column ::= WDURATION", + /* 560 */ "pseudo_column ::= IROWTS", + /* 561 */ "pseudo_column ::= ISFILLED", + /* 562 */ "pseudo_column ::= QTAGS", + /* 563 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 564 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 565 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 566 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", + /* 567 */ "function_expression ::= literal_func", + /* 568 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 569 */ "literal_func ::= NOW", + /* 570 */ "literal_func ::= TODAY", + /* 571 */ "noarg_func ::= NOW", + /* 572 */ "noarg_func ::= TODAY", + /* 573 */ "noarg_func ::= TIMEZONE", + /* 574 */ "noarg_func ::= DATABASE", + /* 575 */ "noarg_func ::= CLIENT_VERSION", + /* 576 */ "noarg_func ::= SERVER_VERSION", + /* 577 */ "noarg_func ::= SERVER_STATUS", + /* 578 */ "noarg_func ::= CURRENT_USER", + /* 579 */ "noarg_func ::= USER", + /* 580 */ "star_func ::= COUNT", + /* 581 */ "star_func ::= FIRST", + /* 582 */ "star_func ::= LAST", + /* 583 */ "star_func ::= LAST_ROW", + /* 584 */ "star_func_para_list ::= NK_STAR", + /* 585 */ "star_func_para_list ::= other_para_list", + /* 586 */ "other_para_list ::= star_func_para", + /* 587 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 588 */ "star_func_para ::= expr_or_subquery", + /* 589 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 590 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 591 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 592 */ "when_then_list ::= when_then_expr", + /* 593 */ "when_then_list ::= when_then_list when_then_expr", + /* 594 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 595 */ "case_when_else_opt ::=", + /* 596 */ "case_when_else_opt ::= ELSE common_expression", + /* 597 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 598 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 599 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 600 */ "predicate ::= expr_or_subquery IS NULL", + /* 601 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 602 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 603 */ "compare_op ::= NK_LT", + /* 604 */ "compare_op ::= NK_GT", + /* 605 */ "compare_op ::= NK_LE", + /* 606 */ "compare_op ::= NK_GE", + /* 607 */ "compare_op ::= NK_NE", + /* 608 */ "compare_op ::= NK_EQ", + /* 609 */ "compare_op ::= LIKE", + /* 610 */ "compare_op ::= NOT LIKE", + /* 611 */ "compare_op ::= MATCH", + /* 612 */ "compare_op ::= NMATCH", + /* 613 */ "compare_op ::= CONTAINS", + /* 614 */ "in_op ::= IN", + /* 615 */ "in_op ::= NOT IN", + /* 616 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 617 */ "boolean_value_expression ::= boolean_primary", + /* 618 */ "boolean_value_expression ::= NOT boolean_primary", + /* 619 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 620 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 621 */ "boolean_primary ::= predicate", + /* 622 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 623 */ "common_expression ::= expr_or_subquery", + /* 624 */ "common_expression ::= boolean_value_expression", + /* 625 */ "from_clause_opt ::=", + /* 626 */ "from_clause_opt ::= FROM table_reference_list", + /* 627 */ "table_reference_list ::= table_reference", + /* 628 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 629 */ "table_reference ::= table_primary", + /* 630 */ "table_reference ::= joined_table", + /* 631 */ "table_primary ::= table_name alias_opt", + /* 632 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 633 */ "table_primary ::= subquery alias_opt", + /* 634 */ "table_primary ::= parenthesized_joined_table", + /* 635 */ "alias_opt ::=", + /* 636 */ "alias_opt ::= table_alias", + /* 637 */ "alias_opt ::= AS table_alias", + /* 638 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 639 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 640 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 641 */ "join_type ::=", + /* 642 */ "join_type ::= INNER", + /* 643 */ "join_type ::= LEFT", + /* 644 */ "join_type ::= RIGHT", + /* 645 */ "join_type ::= FULL", + /* 646 */ "join_subtype ::=", + /* 647 */ "join_subtype ::= OUTER", + /* 648 */ "join_subtype ::= SEMI", + /* 649 */ "join_subtype ::= ANTI", + /* 650 */ "join_subtype ::= ASOF", + /* 651 */ "join_subtype ::= WINDOW", + /* 652 */ "join_on_clause_opt ::=", + /* 653 */ "join_on_clause_opt ::= ON search_condition", + /* 654 */ "window_offset_clause_opt ::=", + /* 655 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 656 */ "window_offset_literal ::= NK_VARIABLE", + /* 657 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 658 */ "jlimit_clause_opt ::=", + /* 659 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 660 */ "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", + /* 661 */ "hint_list ::=", + /* 662 */ "hint_list ::= NK_HINT", + /* 663 */ "tag_mode_opt ::=", + /* 664 */ "tag_mode_opt ::= TAGS", + /* 665 */ "set_quantifier_opt ::=", + /* 666 */ "set_quantifier_opt ::= DISTINCT", + /* 667 */ "set_quantifier_opt ::= ALL", + /* 668 */ "select_list ::= select_item", + /* 669 */ "select_list ::= select_list NK_COMMA select_item", + /* 670 */ "select_item ::= NK_STAR", + /* 671 */ "select_item ::= common_expression", + /* 672 */ "select_item ::= common_expression column_alias", + /* 673 */ "select_item ::= common_expression AS column_alias", + /* 674 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 675 */ "where_clause_opt ::=", + /* 676 */ "where_clause_opt ::= WHERE search_condition", + /* 677 */ "partition_by_clause_opt ::=", + /* 678 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 679 */ "partition_list ::= partition_item", + /* 680 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 681 */ "partition_item ::= expr_or_subquery", + /* 682 */ "partition_item ::= expr_or_subquery column_alias", + /* 683 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 684 */ "twindow_clause_opt ::=", + /* 685 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 686 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 687 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 688 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 689 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 690 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 691 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 692 */ "sliding_opt ::=", + /* 693 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 694 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 695 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 696 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 697 */ "fill_opt ::=", + /* 698 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 699 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 700 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 701 */ "fill_mode ::= NONE", + /* 702 */ "fill_mode ::= PREV", + /* 703 */ "fill_mode ::= NULL", + /* 704 */ "fill_mode ::= NULL_F", + /* 705 */ "fill_mode ::= LINEAR", + /* 706 */ "fill_mode ::= NEXT", + /* 707 */ "group_by_clause_opt ::=", + /* 708 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 709 */ "group_by_list ::= expr_or_subquery", + /* 710 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 711 */ "having_clause_opt ::=", + /* 712 */ "having_clause_opt ::= HAVING search_condition", + /* 713 */ "range_opt ::=", + /* 714 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 715 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 716 */ "every_opt ::=", + /* 717 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 718 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 719 */ "query_simple ::= query_specification", + /* 720 */ "query_simple ::= union_query_expression", + /* 721 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 722 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 723 */ "query_simple_or_subquery ::= query_simple", + /* 724 */ "query_simple_or_subquery ::= subquery", + /* 725 */ "query_or_subquery ::= query_expression", + /* 726 */ "query_or_subquery ::= subquery", + /* 727 */ "order_by_clause_opt ::=", + /* 728 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 729 */ "slimit_clause_opt ::=", + /* 730 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 731 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 732 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 733 */ "limit_clause_opt ::=", + /* 734 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 735 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 736 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 737 */ "subquery ::= NK_LP query_expression NK_RP", + /* 738 */ "subquery ::= NK_LP subquery NK_RP", + /* 739 */ "search_condition ::= common_expression", + /* 740 */ "sort_specification_list ::= sort_specification", + /* 741 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 742 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 743 */ "ordering_specification_opt ::=", + /* 744 */ "ordering_specification_opt ::= ASC", + /* 745 */ "ordering_specification_opt ::= DESC", + /* 746 */ "null_ordering_opt ::=", + /* 747 */ "null_ordering_opt ::= NULLS FIRST", + /* 748 */ "null_ordering_opt ::= NULLS LAST", + /* 749 */ "column_options ::=", + /* 750 */ "column_options ::= column_options PRIMARY KEY", + /* 751 */ "column_options ::= column_options ENCODE NK_STRING", + /* 752 */ "column_options ::= column_options COMPRESS NK_STRING", + /* 753 */ "column_options ::= column_options LEVEL NK_STRING", }; #endif /* NDEBUG */ @@ -3086,256 +3426,258 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 377: /* cmd */ - case 380: /* literal */ - case 389: /* with_opt */ - case 395: /* search_condition */ - case 400: /* db_options */ - case 402: /* alter_db_options */ - case 404: /* start_opt */ - case 405: /* end_opt */ - case 409: /* signed */ - case 411: /* retention */ - case 412: /* full_table_name */ - case 415: /* table_options */ - case 419: /* alter_table_clause */ - case 420: /* alter_table_options */ - case 423: /* column_options */ - case 424: /* tags_literal */ - case 425: /* create_subtable_clause */ - case 428: /* drop_table_clause */ - case 431: /* tag_def */ - case 432: /* column_def */ - case 437: /* duration_literal */ - case 438: /* rollup_func_name */ - case 440: /* col_name */ - case 443: /* like_pattern_opt */ - case 444: /* db_name_cond_opt */ - case 445: /* table_name_cond */ - case 446: /* from_db_opt */ - case 449: /* tag_item */ - case 453: /* full_tsma_name */ - case 455: /* index_options */ - case 456: /* full_index_name */ - case 458: /* sliding_opt */ - case 459: /* sma_stream_opt */ - case 460: /* func */ - case 464: /* query_or_subquery */ - case 465: /* where_clause_opt */ - case 468: /* explain_options */ - case 469: /* insert_query */ - case 474: /* full_view_name */ - case 477: /* stream_options */ - case 480: /* subtable_opt */ - case 483: /* column_stream_def */ - case 484: /* stream_col_options */ - case 485: /* expression */ - case 488: /* literal_func */ - case 489: /* signed_literal */ - case 492: /* expr_or_subquery */ - case 493: /* pseudo_column */ - case 494: /* column_reference */ - case 495: /* function_expression */ - case 496: /* case_when_expression */ - case 501: /* star_func_para */ - case 503: /* case_when_else_opt */ - case 504: /* common_expression */ - case 505: /* when_then_expr */ - case 506: /* predicate */ - case 509: /* in_predicate_value */ - case 510: /* boolean_value_expression */ - case 511: /* boolean_primary */ - case 512: /* from_clause_opt */ - case 513: /* table_reference_list */ - case 514: /* table_reference */ - case 515: /* table_primary */ - case 516: /* joined_table */ - case 518: /* subquery */ - case 519: /* parenthesized_joined_table */ - case 522: /* join_on_clause_opt */ - case 523: /* window_offset_clause_opt */ - case 524: /* jlimit_clause_opt */ - case 525: /* window_offset_literal */ - case 526: /* query_specification */ - case 532: /* range_opt */ - case 533: /* every_opt */ - case 534: /* fill_opt */ - case 535: /* twindow_clause_opt */ - case 537: /* having_clause_opt */ - case 538: /* select_item */ - case 540: /* partition_item */ - case 541: /* interval_sliding_duration_literal */ - case 544: /* query_expression */ - case 545: /* query_simple */ - case 547: /* slimit_clause_opt */ - case 548: /* limit_clause_opt */ - case 549: /* union_query_expression */ - case 550: /* query_simple_or_subquery */ - case 552: /* sort_specification */ + case 378: /* cmd */ + case 381: /* literal */ + case 392: /* with_opt */ + case 398: /* search_condition */ + case 403: /* db_options */ + case 405: /* alter_db_options */ + case 407: /* start_opt */ + case 408: /* end_opt */ + case 412: /* signed */ + case 414: /* retention */ + case 415: /* full_table_name */ + case 418: /* table_options */ + case 422: /* alter_table_clause */ + case 423: /* alter_table_options */ + case 426: /* column_options */ + case 427: /* tags_literal */ + case 428: /* create_subtable_clause */ + case 431: /* drop_table_clause */ + case 434: /* tag_def */ + case 435: /* column_def */ + case 440: /* duration_literal */ + case 441: /* rollup_func_name */ + case 443: /* col_name */ + case 446: /* like_pattern_opt */ + case 447: /* db_name_cond_opt */ + case 448: /* table_name_cond */ + case 449: /* from_db_opt */ + case 452: /* tag_item */ + case 456: /* full_tsma_name */ + case 458: /* index_options */ + case 459: /* full_index_name */ + case 461: /* sliding_opt */ + case 462: /* sma_stream_opt */ + case 463: /* func */ + case 467: /* query_or_subquery */ + case 468: /* where_clause_opt */ + case 471: /* explain_options */ + case 472: /* insert_query */ + case 477: /* full_view_name */ + case 480: /* stream_options */ + case 483: /* subtable_opt */ + case 486: /* column_stream_def */ + case 487: /* stream_col_options */ + case 488: /* expression */ + case 491: /* literal_func */ + case 492: /* signed_literal */ + case 495: /* expr_or_subquery */ + case 496: /* pseudo_column */ + case 497: /* column_reference */ + case 498: /* function_expression */ + case 499: /* case_when_expression */ + case 504: /* star_func_para */ + case 506: /* case_when_else_opt */ + case 507: /* common_expression */ + case 508: /* when_then_expr */ + case 509: /* predicate */ + case 512: /* in_predicate_value */ + case 513: /* boolean_value_expression */ + case 514: /* boolean_primary */ + case 515: /* from_clause_opt */ + case 516: /* table_reference_list */ + case 517: /* table_reference */ + case 518: /* table_primary */ + case 519: /* joined_table */ + case 521: /* subquery */ + case 522: /* parenthesized_joined_table */ + case 525: /* join_on_clause_opt */ + case 526: /* window_offset_clause_opt */ + case 527: /* jlimit_clause_opt */ + case 528: /* window_offset_literal */ + case 529: /* query_specification */ + case 535: /* range_opt */ + case 536: /* every_opt */ + case 537: /* fill_opt */ + case 538: /* twindow_clause_opt */ + case 540: /* having_clause_opt */ + case 541: /* select_item */ + case 543: /* partition_item */ + case 544: /* interval_sliding_duration_literal */ + case 547: /* query_expression */ + case 548: /* query_simple */ + case 550: /* slimit_clause_opt */ + case 551: /* limit_clause_opt */ + case 552: /* union_query_expression */ + case 553: /* query_simple_or_subquery */ + case 555: /* sort_specification */ { - nodesDestroyNode((yypminor->yy452)); + nodesDestroyNode((yypminor->yy416)); } break; - case 378: /* account_options */ - case 379: /* alter_account_options */ - case 381: /* alter_account_option */ - case 403: /* speed_opt */ - case 463: /* with_meta */ - case 472: /* bufsize_opt */ + case 379: /* account_options */ + case 380: /* alter_account_options */ + case 382: /* alter_account_option */ + case 406: /* speed_opt */ + case 466: /* with_meta */ + case 475: /* bufsize_opt */ { } break; - case 382: /* ip_range_list */ - case 383: /* white_list */ - case 384: /* white_list_opt */ - case 406: /* integer_list */ - case 407: /* variable_list */ - case 408: /* retention_list */ - case 413: /* column_def_list */ - case 414: /* tags_def_opt */ - case 416: /* multi_create_clause */ - case 417: /* tags_def */ - case 418: /* multi_drop_clause */ - case 426: /* specific_cols_opt */ - case 427: /* tags_literal_list */ - case 429: /* col_name_list */ - case 430: /* tag_def_list */ - case 434: /* duration_list */ - case 435: /* rollup_func_list */ - case 447: /* tag_list_opt */ - case 454: /* func_list */ - case 462: /* expression_list */ - case 478: /* col_list_opt */ - case 479: /* tag_def_or_ref_opt */ - case 482: /* column_stream_def_list */ - case 487: /* dnode_list */ - case 490: /* literal_list */ - case 498: /* star_func_para_list */ - case 500: /* other_para_list */ - case 502: /* when_then_list */ - case 527: /* hint_list */ - case 530: /* select_list */ - case 531: /* partition_by_clause_opt */ - case 536: /* group_by_clause_opt */ - case 539: /* partition_list */ - case 543: /* group_by_list */ - case 546: /* order_by_clause_opt */ - case 551: /* sort_specification_list */ + case 383: /* ip_range_list */ + case 384: /* white_list */ + case 385: /* white_list_opt */ + case 409: /* integer_list */ + case 410: /* variable_list */ + case 411: /* retention_list */ + case 416: /* column_def_list */ + case 417: /* tags_def_opt */ + case 419: /* multi_create_clause */ + case 420: /* tags_def */ + case 421: /* multi_drop_clause */ + case 429: /* specific_cols_opt */ + case 430: /* tags_literal_list */ + case 432: /* col_name_list */ + case 433: /* tag_def_list */ + case 437: /* duration_list */ + case 438: /* rollup_func_list */ + case 450: /* tag_list_opt */ + case 457: /* func_list */ + case 465: /* expression_list */ + case 481: /* col_list_opt */ + case 482: /* tag_def_or_ref_opt */ + case 485: /* column_stream_def_list */ + case 490: /* dnode_list */ + case 493: /* literal_list */ + case 501: /* star_func_para_list */ + case 503: /* other_para_list */ + case 505: /* when_then_list */ + case 530: /* hint_list */ + case 533: /* select_list */ + case 534: /* partition_by_clause_opt */ + case 539: /* group_by_clause_opt */ + case 542: /* partition_list */ + case 546: /* group_by_list */ + case 549: /* order_by_clause_opt */ + case 554: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy34)); + nodesDestroyList((yypminor->yy316)); } break; - case 385: /* user_name */ - case 392: /* db_name */ - case 393: /* table_name */ - case 394: /* topic_name */ - case 396: /* dnode_endpoint */ - case 421: /* column_name */ - case 439: /* function_name */ - case 450: /* column_alias */ - case 451: /* tsma_name */ - case 457: /* index_name */ - case 461: /* sma_func_name */ - case 466: /* cgroup_name */ - case 473: /* language_opt */ - case 475: /* view_name */ - case 476: /* stream_name */ - case 486: /* on_vgroup_id */ - case 491: /* table_alias */ - case 497: /* star_func */ - case 499: /* noarg_func */ - case 517: /* alias_opt */ + case 386: /* is_import_opt */ + case 387: /* is_createdb_opt */ + case 389: /* sysinfo_opt */ { } break; - case 386: /* sysinfo_opt */ + case 388: /* user_name */ + case 395: /* db_name */ + case 396: /* table_name */ + case 397: /* topic_name */ + case 399: /* dnode_endpoint */ + case 424: /* column_name */ + case 442: /* function_name */ + case 453: /* column_alias */ + case 454: /* tsma_name */ + case 460: /* index_name */ + case 464: /* sma_func_name */ + case 469: /* cgroup_name */ + case 476: /* language_opt */ + case 478: /* view_name */ + case 479: /* stream_name */ + case 489: /* on_vgroup_id */ + case 494: /* table_alias */ + case 500: /* star_func */ + case 502: /* noarg_func */ + case 520: /* alias_opt */ { } break; - case 387: /* privileges */ - case 390: /* priv_type_list */ - case 391: /* priv_type */ + case 390: /* privileges */ + case 393: /* priv_type_list */ + case 394: /* priv_type */ { } break; - case 388: /* priv_level */ + case 391: /* priv_level */ { } break; - case 397: /* force_opt */ - case 398: /* unsafe_opt */ - case 399: /* not_exists_opt */ - case 401: /* exists_opt */ - case 467: /* analyze_opt */ - case 470: /* or_replace_opt */ - case 471: /* agg_func_opt */ - case 481: /* ignore_opt */ - case 528: /* set_quantifier_opt */ - case 529: /* tag_mode_opt */ + case 400: /* force_opt */ + case 401: /* unsafe_opt */ + case 402: /* not_exists_opt */ + case 404: /* exists_opt */ + case 470: /* analyze_opt */ + case 473: /* or_replace_opt */ + case 474: /* agg_func_opt */ + case 484: /* ignore_opt */ + case 531: /* set_quantifier_opt */ + case 532: /* tag_mode_opt */ { } break; - case 410: /* alter_db_option */ - case 436: /* alter_table_option */ + case 413: /* alter_db_option */ + case 439: /* alter_table_option */ { } break; - case 422: /* type_name */ - case 433: /* type_name_default_len */ + case 425: /* type_name */ + case 436: /* type_name_default_len */ { } break; - case 441: /* db_kind_opt */ - case 448: /* table_kind */ + case 444: /* db_kind_opt */ + case 451: /* table_kind */ { } break; - case 442: /* table_kind_db_name_cond_opt */ + case 445: /* table_kind_db_name_cond_opt */ { } break; - case 452: /* tsma_func_list */ + case 455: /* tsma_func_list */ { - nodesDestroyNode((yypminor->yy452)); + nodesDestroyNode((yypminor->yy416)); } break; - case 507: /* compare_op */ - case 508: /* in_op */ + case 510: /* compare_op */ + case 511: /* in_op */ { } break; - case 520: /* join_type */ + case 523: /* join_type */ { } break; - case 521: /* join_subtype */ + case 524: /* join_subtype */ { } break; - case 542: /* fill_mode */ + case 545: /* fill_mode */ { } break; - case 553: /* ordering_specification_opt */ + case 556: /* ordering_specification_opt */ { } break; - case 554: /* null_ordering_opt */ + case 557: /* null_ordering_opt */ { } @@ -3504,7 +3846,7 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ - assert( i>=0 && i=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); return yy_action[i]; } }while(1); @@ -3626,755 +3968,760 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 377, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 377, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 378, /* (2) account_options ::= */ - 378, /* (3) account_options ::= account_options PPS literal */ - 378, /* (4) account_options ::= account_options TSERIES literal */ - 378, /* (5) account_options ::= account_options STORAGE literal */ - 378, /* (6) account_options ::= account_options STREAMS literal */ - 378, /* (7) account_options ::= account_options QTIME literal */ - 378, /* (8) account_options ::= account_options DBS literal */ - 378, /* (9) account_options ::= account_options USERS literal */ - 378, /* (10) account_options ::= account_options CONNS literal */ - 378, /* (11) account_options ::= account_options STATE literal */ - 379, /* (12) alter_account_options ::= alter_account_option */ - 379, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 381, /* (14) alter_account_option ::= PASS literal */ - 381, /* (15) alter_account_option ::= PPS literal */ - 381, /* (16) alter_account_option ::= TSERIES literal */ - 381, /* (17) alter_account_option ::= STORAGE literal */ - 381, /* (18) alter_account_option ::= STREAMS literal */ - 381, /* (19) alter_account_option ::= QTIME literal */ - 381, /* (20) alter_account_option ::= DBS literal */ - 381, /* (21) alter_account_option ::= USERS literal */ - 381, /* (22) alter_account_option ::= CONNS literal */ - 381, /* (23) alter_account_option ::= STATE literal */ - 382, /* (24) ip_range_list ::= NK_STRING */ - 382, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 383, /* (26) white_list ::= HOST ip_range_list */ - 384, /* (27) white_list_opt ::= */ - 384, /* (28) white_list_opt ::= white_list */ - 377, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 377, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 377, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 377, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 377, /* (33) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - 377, /* (34) cmd ::= ALTER USER user_name ADD white_list */ - 377, /* (35) cmd ::= ALTER USER user_name DROP white_list */ - 377, /* (36) cmd ::= DROP USER user_name */ - 386, /* (37) sysinfo_opt ::= */ - 386, /* (38) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 377, /* (39) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 377, /* (40) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 387, /* (41) privileges ::= ALL */ - 387, /* (42) privileges ::= priv_type_list */ - 387, /* (43) privileges ::= SUBSCRIBE */ - 390, /* (44) priv_type_list ::= priv_type */ - 390, /* (45) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 391, /* (46) priv_type ::= READ */ - 391, /* (47) priv_type ::= WRITE */ - 391, /* (48) priv_type ::= ALTER */ - 388, /* (49) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 388, /* (50) priv_level ::= db_name NK_DOT NK_STAR */ - 388, /* (51) priv_level ::= db_name NK_DOT table_name */ - 388, /* (52) priv_level ::= topic_name */ - 389, /* (53) with_opt ::= */ - 389, /* (54) with_opt ::= WITH search_condition */ - 377, /* (55) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - 377, /* (56) cmd ::= CREATE DNODE dnode_endpoint */ - 377, /* (57) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 377, /* (58) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 377, /* (59) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 377, /* (60) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 377, /* (61) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 377, /* (62) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 377, /* (63) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 377, /* (64) cmd ::= ALTER ALL DNODES NK_STRING */ - 377, /* (65) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 377, /* (66) cmd ::= RESTORE DNODE NK_INTEGER */ - 396, /* (67) dnode_endpoint ::= NK_STRING */ - 396, /* (68) dnode_endpoint ::= NK_ID */ - 396, /* (69) dnode_endpoint ::= NK_IPTOKEN */ - 397, /* (70) force_opt ::= */ - 397, /* (71) force_opt ::= FORCE */ - 398, /* (72) unsafe_opt ::= UNSAFE */ - 377, /* (73) cmd ::= ALTER CLUSTER NK_STRING */ - 377, /* (74) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 377, /* (75) cmd ::= ALTER LOCAL NK_STRING */ - 377, /* (76) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 377, /* (77) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 377, /* (78) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 377, /* (79) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 377, /* (80) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 377, /* (81) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 377, /* (82) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 377, /* (83) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 377, /* (84) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 377, /* (85) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 377, /* (86) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 377, /* (87) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 377, /* (88) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 377, /* (89) cmd ::= DROP DATABASE exists_opt db_name */ - 377, /* (90) cmd ::= USE db_name */ - 377, /* (91) cmd ::= ALTER DATABASE db_name alter_db_options */ - 377, /* (92) cmd ::= FLUSH DATABASE db_name */ - 377, /* (93) cmd ::= TRIM DATABASE db_name speed_opt */ - 377, /* (94) cmd ::= S3MIGRATE DATABASE db_name */ - 377, /* (95) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 399, /* (96) not_exists_opt ::= IF NOT EXISTS */ - 399, /* (97) not_exists_opt ::= */ - 401, /* (98) exists_opt ::= IF EXISTS */ - 401, /* (99) exists_opt ::= */ - 400, /* (100) db_options ::= */ - 400, /* (101) db_options ::= db_options BUFFER NK_INTEGER */ - 400, /* (102) db_options ::= db_options CACHEMODEL NK_STRING */ - 400, /* (103) db_options ::= db_options CACHESIZE NK_INTEGER */ - 400, /* (104) db_options ::= db_options COMP NK_INTEGER */ - 400, /* (105) db_options ::= db_options DURATION NK_INTEGER */ - 400, /* (106) db_options ::= db_options DURATION NK_VARIABLE */ - 400, /* (107) db_options ::= db_options MAXROWS NK_INTEGER */ - 400, /* (108) db_options ::= db_options MINROWS NK_INTEGER */ - 400, /* (109) db_options ::= db_options KEEP integer_list */ - 400, /* (110) db_options ::= db_options KEEP variable_list */ - 400, /* (111) db_options ::= db_options PAGES NK_INTEGER */ - 400, /* (112) db_options ::= db_options PAGESIZE NK_INTEGER */ - 400, /* (113) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 400, /* (114) db_options ::= db_options PRECISION NK_STRING */ - 400, /* (115) db_options ::= db_options REPLICA NK_INTEGER */ - 400, /* (116) db_options ::= db_options VGROUPS NK_INTEGER */ - 400, /* (117) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 400, /* (118) db_options ::= db_options RETENTIONS retention_list */ - 400, /* (119) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 400, /* (120) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 400, /* (121) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 400, /* (122) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 400, /* (123) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 400, /* (124) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 400, /* (125) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 400, /* (126) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 400, /* (127) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 400, /* (128) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 400, /* (129) db_options ::= db_options TABLE_PREFIX signed */ - 400, /* (130) db_options ::= db_options TABLE_SUFFIX signed */ - 400, /* (131) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - 400, /* (132) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - 400, /* (133) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - 400, /* (134) db_options ::= db_options S3_COMPACT NK_INTEGER */ - 400, /* (135) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 400, /* (136) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - 402, /* (137) alter_db_options ::= alter_db_option */ - 402, /* (138) alter_db_options ::= alter_db_options alter_db_option */ - 410, /* (139) alter_db_option ::= BUFFER NK_INTEGER */ - 410, /* (140) alter_db_option ::= CACHEMODEL NK_STRING */ - 410, /* (141) alter_db_option ::= CACHESIZE NK_INTEGER */ - 410, /* (142) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 410, /* (143) alter_db_option ::= KEEP integer_list */ - 410, /* (144) alter_db_option ::= KEEP variable_list */ - 410, /* (145) alter_db_option ::= PAGES NK_INTEGER */ - 410, /* (146) alter_db_option ::= REPLICA NK_INTEGER */ - 410, /* (147) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 410, /* (148) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 410, /* (149) alter_db_option ::= MINROWS NK_INTEGER */ - 410, /* (150) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 410, /* (151) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 410, /* (152) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 410, /* (153) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 410, /* (154) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - 410, /* (155) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - 410, /* (156) alter_db_option ::= S3_COMPACT NK_INTEGER */ - 410, /* (157) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 410, /* (158) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - 406, /* (159) integer_list ::= NK_INTEGER */ - 406, /* (160) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 407, /* (161) variable_list ::= NK_VARIABLE */ - 407, /* (162) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 408, /* (163) retention_list ::= retention */ - 408, /* (164) retention_list ::= retention_list NK_COMMA retention */ - 411, /* (165) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 411, /* (166) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 403, /* (167) speed_opt ::= */ - 403, /* (168) speed_opt ::= BWLIMIT NK_INTEGER */ - 404, /* (169) start_opt ::= */ - 404, /* (170) start_opt ::= START WITH NK_INTEGER */ - 404, /* (171) start_opt ::= START WITH NK_STRING */ - 404, /* (172) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 405, /* (173) end_opt ::= */ - 405, /* (174) end_opt ::= END WITH NK_INTEGER */ - 405, /* (175) end_opt ::= END WITH NK_STRING */ - 405, /* (176) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 377, /* (177) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 377, /* (178) cmd ::= CREATE TABLE multi_create_clause */ - 377, /* (179) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 377, /* (180) cmd ::= DROP TABLE multi_drop_clause */ - 377, /* (181) cmd ::= DROP STABLE exists_opt full_table_name */ - 377, /* (182) cmd ::= ALTER TABLE alter_table_clause */ - 377, /* (183) cmd ::= ALTER STABLE alter_table_clause */ - 419, /* (184) alter_table_clause ::= full_table_name alter_table_options */ - 419, /* (185) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - 419, /* (186) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 419, /* (187) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 419, /* (188) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - 419, /* (189) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 419, /* (190) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 419, /* (191) alter_table_clause ::= full_table_name DROP TAG column_name */ - 419, /* (192) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 419, /* (193) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 419, /* (194) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 416, /* (195) multi_create_clause ::= create_subtable_clause */ - 416, /* (196) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 425, /* (197) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 418, /* (198) multi_drop_clause ::= drop_table_clause */ - 418, /* (199) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 428, /* (200) drop_table_clause ::= exists_opt full_table_name */ - 426, /* (201) specific_cols_opt ::= */ - 426, /* (202) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 412, /* (203) full_table_name ::= table_name */ - 412, /* (204) full_table_name ::= db_name NK_DOT table_name */ - 430, /* (205) tag_def_list ::= tag_def */ - 430, /* (206) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - 431, /* (207) tag_def ::= column_name type_name */ - 413, /* (208) column_def_list ::= column_def */ - 413, /* (209) column_def_list ::= column_def_list NK_COMMA column_def */ - 432, /* (210) column_def ::= column_name type_name column_options */ - 422, /* (211) type_name ::= BOOL */ - 422, /* (212) type_name ::= TINYINT */ - 422, /* (213) type_name ::= SMALLINT */ - 422, /* (214) type_name ::= INT */ - 422, /* (215) type_name ::= INTEGER */ - 422, /* (216) type_name ::= BIGINT */ - 422, /* (217) type_name ::= FLOAT */ - 422, /* (218) type_name ::= DOUBLE */ - 422, /* (219) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 422, /* (220) type_name ::= TIMESTAMP */ - 422, /* (221) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 422, /* (222) type_name ::= TINYINT UNSIGNED */ - 422, /* (223) type_name ::= SMALLINT UNSIGNED */ - 422, /* (224) type_name ::= INT UNSIGNED */ - 422, /* (225) type_name ::= BIGINT UNSIGNED */ - 422, /* (226) type_name ::= JSON */ - 422, /* (227) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 422, /* (228) type_name ::= MEDIUMBLOB */ - 422, /* (229) type_name ::= BLOB */ - 422, /* (230) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 422, /* (231) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 422, /* (232) type_name ::= DECIMAL */ - 422, /* (233) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 422, /* (234) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 433, /* (235) type_name_default_len ::= BINARY */ - 433, /* (236) type_name_default_len ::= NCHAR */ - 433, /* (237) type_name_default_len ::= VARCHAR */ - 433, /* (238) type_name_default_len ::= VARBINARY */ - 414, /* (239) tags_def_opt ::= */ - 414, /* (240) tags_def_opt ::= tags_def */ - 417, /* (241) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 415, /* (242) table_options ::= */ - 415, /* (243) table_options ::= table_options COMMENT NK_STRING */ - 415, /* (244) table_options ::= table_options MAX_DELAY duration_list */ - 415, /* (245) table_options ::= table_options WATERMARK duration_list */ - 415, /* (246) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 415, /* (247) table_options ::= table_options TTL NK_INTEGER */ - 415, /* (248) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 415, /* (249) table_options ::= table_options DELETE_MARK duration_list */ - 420, /* (250) alter_table_options ::= alter_table_option */ - 420, /* (251) alter_table_options ::= alter_table_options alter_table_option */ - 436, /* (252) alter_table_option ::= COMMENT NK_STRING */ - 436, /* (253) alter_table_option ::= TTL NK_INTEGER */ - 434, /* (254) duration_list ::= duration_literal */ - 434, /* (255) duration_list ::= duration_list NK_COMMA duration_literal */ - 435, /* (256) rollup_func_list ::= rollup_func_name */ - 435, /* (257) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 438, /* (258) rollup_func_name ::= function_name */ - 438, /* (259) rollup_func_name ::= FIRST */ - 438, /* (260) rollup_func_name ::= LAST */ - 429, /* (261) col_name_list ::= col_name */ - 429, /* (262) col_name_list ::= col_name_list NK_COMMA col_name */ - 440, /* (263) col_name ::= column_name */ - 377, /* (264) cmd ::= SHOW DNODES */ - 377, /* (265) cmd ::= SHOW USERS */ - 377, /* (266) cmd ::= SHOW USER PRIVILEGES */ - 377, /* (267) cmd ::= SHOW db_kind_opt DATABASES */ - 377, /* (268) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 377, /* (269) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 377, /* (270) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 377, /* (271) cmd ::= SHOW MNODES */ - 377, /* (272) cmd ::= SHOW QNODES */ - 377, /* (273) cmd ::= SHOW ARBGROUPS */ - 377, /* (274) cmd ::= SHOW FUNCTIONS */ - 377, /* (275) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 377, /* (276) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 377, /* (277) cmd ::= SHOW STREAMS */ - 377, /* (278) cmd ::= SHOW ACCOUNTS */ - 377, /* (279) cmd ::= SHOW APPS */ - 377, /* (280) cmd ::= SHOW CONNECTIONS */ - 377, /* (281) cmd ::= SHOW LICENCES */ - 377, /* (282) cmd ::= SHOW GRANTS */ - 377, /* (283) cmd ::= SHOW GRANTS FULL */ - 377, /* (284) cmd ::= SHOW GRANTS LOGS */ - 377, /* (285) cmd ::= SHOW CLUSTER MACHINES */ - 377, /* (286) cmd ::= SHOW CREATE DATABASE db_name */ - 377, /* (287) cmd ::= SHOW CREATE TABLE full_table_name */ - 377, /* (288) cmd ::= SHOW CREATE STABLE full_table_name */ - 377, /* (289) cmd ::= SHOW ENCRYPTIONS */ - 377, /* (290) cmd ::= SHOW QUERIES */ - 377, /* (291) cmd ::= SHOW SCORES */ - 377, /* (292) cmd ::= SHOW TOPICS */ - 377, /* (293) cmd ::= SHOW VARIABLES */ - 377, /* (294) cmd ::= SHOW CLUSTER VARIABLES */ - 377, /* (295) cmd ::= SHOW LOCAL VARIABLES */ - 377, /* (296) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 377, /* (297) cmd ::= SHOW BNODES */ - 377, /* (298) cmd ::= SHOW SNODES */ - 377, /* (299) cmd ::= SHOW CLUSTER */ - 377, /* (300) cmd ::= SHOW TRANSACTIONS */ - 377, /* (301) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 377, /* (302) cmd ::= SHOW CONSUMERS */ - 377, /* (303) cmd ::= SHOW SUBSCRIPTIONS */ - 377, /* (304) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 377, /* (305) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 377, /* (306) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 377, /* (307) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 377, /* (308) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 377, /* (309) cmd ::= SHOW VNODES */ - 377, /* (310) cmd ::= SHOW db_name_cond_opt ALIVE */ - 377, /* (311) cmd ::= SHOW CLUSTER ALIVE */ - 377, /* (312) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 377, /* (313) cmd ::= SHOW CREATE VIEW full_table_name */ - 377, /* (314) cmd ::= SHOW COMPACTS */ - 377, /* (315) cmd ::= SHOW COMPACT NK_INTEGER */ - 442, /* (316) table_kind_db_name_cond_opt ::= */ - 442, /* (317) table_kind_db_name_cond_opt ::= table_kind */ - 442, /* (318) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 442, /* (319) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 448, /* (320) table_kind ::= NORMAL */ - 448, /* (321) table_kind ::= CHILD */ - 444, /* (322) db_name_cond_opt ::= */ - 444, /* (323) db_name_cond_opt ::= db_name NK_DOT */ - 443, /* (324) like_pattern_opt ::= */ - 443, /* (325) like_pattern_opt ::= LIKE NK_STRING */ - 445, /* (326) table_name_cond ::= table_name */ - 446, /* (327) from_db_opt ::= */ - 446, /* (328) from_db_opt ::= FROM db_name */ - 447, /* (329) tag_list_opt ::= */ - 447, /* (330) tag_list_opt ::= tag_item */ - 447, /* (331) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 449, /* (332) tag_item ::= TBNAME */ - 449, /* (333) tag_item ::= QTAGS */ - 449, /* (334) tag_item ::= column_name */ - 449, /* (335) tag_item ::= column_name column_alias */ - 449, /* (336) tag_item ::= column_name AS column_alias */ - 441, /* (337) db_kind_opt ::= */ - 441, /* (338) db_kind_opt ::= USER */ - 441, /* (339) db_kind_opt ::= SYSTEM */ - 377, /* (340) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - 377, /* (341) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - 377, /* (342) cmd ::= DROP TSMA exists_opt full_tsma_name */ - 377, /* (343) cmd ::= SHOW db_name_cond_opt TSMAS */ - 453, /* (344) full_tsma_name ::= tsma_name */ - 453, /* (345) full_tsma_name ::= db_name NK_DOT tsma_name */ - 452, /* (346) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - 377, /* (347) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 377, /* (348) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 377, /* (349) cmd ::= DROP INDEX exists_opt full_index_name */ - 456, /* (350) full_index_name ::= index_name */ - 456, /* (351) full_index_name ::= db_name NK_DOT index_name */ - 455, /* (352) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 455, /* (353) 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 */ - 454, /* (354) func_list ::= func */ - 454, /* (355) func_list ::= func_list NK_COMMA func */ - 460, /* (356) func ::= sma_func_name NK_LP expression_list NK_RP */ - 461, /* (357) sma_func_name ::= function_name */ - 461, /* (358) sma_func_name ::= COUNT */ - 461, /* (359) sma_func_name ::= FIRST */ - 461, /* (360) sma_func_name ::= LAST */ - 461, /* (361) sma_func_name ::= LAST_ROW */ - 459, /* (362) sma_stream_opt ::= */ - 459, /* (363) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 459, /* (364) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 459, /* (365) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 463, /* (366) with_meta ::= AS */ - 463, /* (367) with_meta ::= WITH META AS */ - 463, /* (368) with_meta ::= ONLY META AS */ - 377, /* (369) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 377, /* (370) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 377, /* (371) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 377, /* (372) cmd ::= DROP TOPIC exists_opt topic_name */ - 377, /* (373) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 377, /* (374) cmd ::= DESC full_table_name */ - 377, /* (375) cmd ::= DESCRIBE full_table_name */ - 377, /* (376) cmd ::= RESET QUERY CACHE */ - 377, /* (377) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 377, /* (378) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 467, /* (379) analyze_opt ::= */ - 467, /* (380) analyze_opt ::= ANALYZE */ - 468, /* (381) explain_options ::= */ - 468, /* (382) explain_options ::= explain_options VERBOSE NK_BOOL */ - 468, /* (383) explain_options ::= explain_options RATIO NK_FLOAT */ - 377, /* (384) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 377, /* (385) cmd ::= DROP FUNCTION exists_opt function_name */ - 471, /* (386) agg_func_opt ::= */ - 471, /* (387) agg_func_opt ::= AGGREGATE */ - 472, /* (388) bufsize_opt ::= */ - 472, /* (389) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 473, /* (390) language_opt ::= */ - 473, /* (391) language_opt ::= LANGUAGE NK_STRING */ - 470, /* (392) or_replace_opt ::= */ - 470, /* (393) or_replace_opt ::= OR REPLACE */ - 377, /* (394) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 377, /* (395) cmd ::= DROP VIEW exists_opt full_view_name */ - 474, /* (396) full_view_name ::= view_name */ - 474, /* (397) full_view_name ::= db_name NK_DOT view_name */ - 377, /* (398) 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 */ - 377, /* (399) cmd ::= DROP STREAM exists_opt stream_name */ - 377, /* (400) cmd ::= PAUSE STREAM exists_opt stream_name */ - 377, /* (401) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 478, /* (402) col_list_opt ::= */ - 478, /* (403) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - 482, /* (404) column_stream_def_list ::= column_stream_def */ - 482, /* (405) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - 483, /* (406) column_stream_def ::= column_name stream_col_options */ - 484, /* (407) stream_col_options ::= */ - 484, /* (408) stream_col_options ::= stream_col_options PRIMARY KEY */ - 479, /* (409) tag_def_or_ref_opt ::= */ - 479, /* (410) tag_def_or_ref_opt ::= tags_def */ - 479, /* (411) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 477, /* (412) stream_options ::= */ - 477, /* (413) stream_options ::= stream_options TRIGGER AT_ONCE */ - 477, /* (414) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 477, /* (415) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 477, /* (416) stream_options ::= stream_options WATERMARK duration_literal */ - 477, /* (417) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 477, /* (418) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 477, /* (419) stream_options ::= stream_options DELETE_MARK duration_literal */ - 477, /* (420) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 480, /* (421) subtable_opt ::= */ - 480, /* (422) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 481, /* (423) ignore_opt ::= */ - 481, /* (424) ignore_opt ::= IGNORE UNTREATED */ - 377, /* (425) cmd ::= KILL CONNECTION NK_INTEGER */ - 377, /* (426) cmd ::= KILL QUERY NK_STRING */ - 377, /* (427) cmd ::= KILL TRANSACTION NK_INTEGER */ - 377, /* (428) cmd ::= KILL COMPACT NK_INTEGER */ - 377, /* (429) cmd ::= BALANCE VGROUP */ - 377, /* (430) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 377, /* (431) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - 377, /* (432) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 377, /* (433) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 377, /* (434) cmd ::= SPLIT VGROUP NK_INTEGER */ - 486, /* (435) on_vgroup_id ::= */ - 486, /* (436) on_vgroup_id ::= ON NK_INTEGER */ - 487, /* (437) dnode_list ::= DNODE NK_INTEGER */ - 487, /* (438) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 377, /* (439) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 377, /* (440) cmd ::= query_or_subquery */ - 377, /* (441) cmd ::= insert_query */ - 469, /* (442) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 469, /* (443) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 424, /* (444) tags_literal ::= NK_INTEGER */ - 424, /* (445) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - 424, /* (446) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - 424, /* (447) tags_literal ::= NK_PLUS NK_INTEGER */ - 424, /* (448) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - 424, /* (449) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - 424, /* (450) tags_literal ::= NK_MINUS NK_INTEGER */ - 424, /* (451) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - 424, /* (452) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - 424, /* (453) tags_literal ::= NK_FLOAT */ - 424, /* (454) tags_literal ::= NK_PLUS NK_FLOAT */ - 424, /* (455) tags_literal ::= NK_MINUS NK_FLOAT */ - 424, /* (456) tags_literal ::= NK_BIN */ - 424, /* (457) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - 424, /* (458) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - 424, /* (459) tags_literal ::= NK_PLUS NK_BIN */ - 424, /* (460) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - 424, /* (461) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - 424, /* (462) tags_literal ::= NK_MINUS NK_BIN */ - 424, /* (463) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - 424, /* (464) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - 424, /* (465) tags_literal ::= NK_HEX */ - 424, /* (466) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - 424, /* (467) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - 424, /* (468) tags_literal ::= NK_PLUS NK_HEX */ - 424, /* (469) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - 424, /* (470) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - 424, /* (471) tags_literal ::= NK_MINUS NK_HEX */ - 424, /* (472) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - 424, /* (473) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - 424, /* (474) tags_literal ::= NK_STRING */ - 424, /* (475) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - 424, /* (476) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - 424, /* (477) tags_literal ::= NK_BOOL */ - 424, /* (478) tags_literal ::= NULL */ - 424, /* (479) tags_literal ::= literal_func */ - 424, /* (480) tags_literal ::= literal_func NK_PLUS duration_literal */ - 424, /* (481) tags_literal ::= literal_func NK_MINUS duration_literal */ - 427, /* (482) tags_literal_list ::= tags_literal */ - 427, /* (483) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 380, /* (484) literal ::= NK_INTEGER */ - 380, /* (485) literal ::= NK_FLOAT */ - 380, /* (486) literal ::= NK_STRING */ - 380, /* (487) literal ::= NK_BOOL */ - 380, /* (488) literal ::= TIMESTAMP NK_STRING */ - 380, /* (489) literal ::= duration_literal */ - 380, /* (490) literal ::= NULL */ - 380, /* (491) literal ::= NK_QUESTION */ - 437, /* (492) duration_literal ::= NK_VARIABLE */ - 409, /* (493) signed ::= NK_INTEGER */ - 409, /* (494) signed ::= NK_PLUS NK_INTEGER */ - 409, /* (495) signed ::= NK_MINUS NK_INTEGER */ - 409, /* (496) signed ::= NK_FLOAT */ - 409, /* (497) signed ::= NK_PLUS NK_FLOAT */ - 409, /* (498) signed ::= NK_MINUS NK_FLOAT */ - 489, /* (499) signed_literal ::= signed */ - 489, /* (500) signed_literal ::= NK_STRING */ - 489, /* (501) signed_literal ::= NK_BOOL */ - 489, /* (502) signed_literal ::= TIMESTAMP NK_STRING */ - 489, /* (503) signed_literal ::= duration_literal */ - 489, /* (504) signed_literal ::= NULL */ - 489, /* (505) signed_literal ::= literal_func */ - 489, /* (506) signed_literal ::= NK_QUESTION */ - 490, /* (507) literal_list ::= signed_literal */ - 490, /* (508) literal_list ::= literal_list NK_COMMA signed_literal */ - 392, /* (509) db_name ::= NK_ID */ - 393, /* (510) table_name ::= NK_ID */ - 421, /* (511) column_name ::= NK_ID */ - 439, /* (512) function_name ::= NK_ID */ - 475, /* (513) view_name ::= NK_ID */ - 491, /* (514) table_alias ::= NK_ID */ - 450, /* (515) column_alias ::= NK_ID */ - 450, /* (516) column_alias ::= NK_ALIAS */ - 385, /* (517) user_name ::= NK_ID */ - 394, /* (518) topic_name ::= NK_ID */ - 476, /* (519) stream_name ::= NK_ID */ - 466, /* (520) cgroup_name ::= NK_ID */ - 457, /* (521) index_name ::= NK_ID */ - 451, /* (522) tsma_name ::= NK_ID */ - 492, /* (523) expr_or_subquery ::= expression */ - 485, /* (524) expression ::= literal */ - 485, /* (525) expression ::= pseudo_column */ - 485, /* (526) expression ::= column_reference */ - 485, /* (527) expression ::= function_expression */ - 485, /* (528) expression ::= case_when_expression */ - 485, /* (529) expression ::= NK_LP expression NK_RP */ - 485, /* (530) expression ::= NK_PLUS expr_or_subquery */ - 485, /* (531) expression ::= NK_MINUS expr_or_subquery */ - 485, /* (532) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 485, /* (533) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 485, /* (534) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 485, /* (535) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 485, /* (536) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 485, /* (537) expression ::= column_reference NK_ARROW NK_STRING */ - 485, /* (538) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 485, /* (539) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 462, /* (540) expression_list ::= expr_or_subquery */ - 462, /* (541) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 494, /* (542) column_reference ::= column_name */ - 494, /* (543) column_reference ::= table_name NK_DOT column_name */ - 494, /* (544) column_reference ::= NK_ALIAS */ - 494, /* (545) column_reference ::= table_name NK_DOT NK_ALIAS */ - 493, /* (546) pseudo_column ::= ROWTS */ - 493, /* (547) pseudo_column ::= TBNAME */ - 493, /* (548) pseudo_column ::= table_name NK_DOT TBNAME */ - 493, /* (549) pseudo_column ::= QSTART */ - 493, /* (550) pseudo_column ::= QEND */ - 493, /* (551) pseudo_column ::= QDURATION */ - 493, /* (552) pseudo_column ::= WSTART */ - 493, /* (553) pseudo_column ::= WEND */ - 493, /* (554) pseudo_column ::= WDURATION */ - 493, /* (555) pseudo_column ::= IROWTS */ - 493, /* (556) pseudo_column ::= ISFILLED */ - 493, /* (557) pseudo_column ::= QTAGS */ - 495, /* (558) function_expression ::= function_name NK_LP expression_list NK_RP */ - 495, /* (559) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 495, /* (560) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 495, /* (561) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - 495, /* (562) function_expression ::= literal_func */ - 488, /* (563) literal_func ::= noarg_func NK_LP NK_RP */ - 488, /* (564) literal_func ::= NOW */ - 488, /* (565) literal_func ::= TODAY */ - 499, /* (566) noarg_func ::= NOW */ - 499, /* (567) noarg_func ::= TODAY */ - 499, /* (568) noarg_func ::= TIMEZONE */ - 499, /* (569) noarg_func ::= DATABASE */ - 499, /* (570) noarg_func ::= CLIENT_VERSION */ - 499, /* (571) noarg_func ::= SERVER_VERSION */ - 499, /* (572) noarg_func ::= SERVER_STATUS */ - 499, /* (573) noarg_func ::= CURRENT_USER */ - 499, /* (574) noarg_func ::= USER */ - 497, /* (575) star_func ::= COUNT */ - 497, /* (576) star_func ::= FIRST */ - 497, /* (577) star_func ::= LAST */ - 497, /* (578) star_func ::= LAST_ROW */ - 498, /* (579) star_func_para_list ::= NK_STAR */ - 498, /* (580) star_func_para_list ::= other_para_list */ - 500, /* (581) other_para_list ::= star_func_para */ - 500, /* (582) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 501, /* (583) star_func_para ::= expr_or_subquery */ - 501, /* (584) star_func_para ::= table_name NK_DOT NK_STAR */ - 496, /* (585) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 496, /* (586) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 502, /* (587) when_then_list ::= when_then_expr */ - 502, /* (588) when_then_list ::= when_then_list when_then_expr */ - 505, /* (589) when_then_expr ::= WHEN common_expression THEN common_expression */ - 503, /* (590) case_when_else_opt ::= */ - 503, /* (591) case_when_else_opt ::= ELSE common_expression */ - 506, /* (592) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 506, /* (593) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 506, /* (594) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 506, /* (595) predicate ::= expr_or_subquery IS NULL */ - 506, /* (596) predicate ::= expr_or_subquery IS NOT NULL */ - 506, /* (597) predicate ::= expr_or_subquery in_op in_predicate_value */ - 507, /* (598) compare_op ::= NK_LT */ - 507, /* (599) compare_op ::= NK_GT */ - 507, /* (600) compare_op ::= NK_LE */ - 507, /* (601) compare_op ::= NK_GE */ - 507, /* (602) compare_op ::= NK_NE */ - 507, /* (603) compare_op ::= NK_EQ */ - 507, /* (604) compare_op ::= LIKE */ - 507, /* (605) compare_op ::= NOT LIKE */ - 507, /* (606) compare_op ::= MATCH */ - 507, /* (607) compare_op ::= NMATCH */ - 507, /* (608) compare_op ::= CONTAINS */ - 508, /* (609) in_op ::= IN */ - 508, /* (610) in_op ::= NOT IN */ - 509, /* (611) in_predicate_value ::= NK_LP literal_list NK_RP */ - 510, /* (612) boolean_value_expression ::= boolean_primary */ - 510, /* (613) boolean_value_expression ::= NOT boolean_primary */ - 510, /* (614) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 510, /* (615) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 511, /* (616) boolean_primary ::= predicate */ - 511, /* (617) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 504, /* (618) common_expression ::= expr_or_subquery */ - 504, /* (619) common_expression ::= boolean_value_expression */ - 512, /* (620) from_clause_opt ::= */ - 512, /* (621) from_clause_opt ::= FROM table_reference_list */ - 513, /* (622) table_reference_list ::= table_reference */ - 513, /* (623) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 514, /* (624) table_reference ::= table_primary */ - 514, /* (625) table_reference ::= joined_table */ - 515, /* (626) table_primary ::= table_name alias_opt */ - 515, /* (627) table_primary ::= db_name NK_DOT table_name alias_opt */ - 515, /* (628) table_primary ::= subquery alias_opt */ - 515, /* (629) table_primary ::= parenthesized_joined_table */ - 517, /* (630) alias_opt ::= */ - 517, /* (631) alias_opt ::= table_alias */ - 517, /* (632) alias_opt ::= AS table_alias */ - 519, /* (633) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 519, /* (634) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 516, /* (635) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 520, /* (636) join_type ::= */ - 520, /* (637) join_type ::= INNER */ - 520, /* (638) join_type ::= LEFT */ - 520, /* (639) join_type ::= RIGHT */ - 520, /* (640) join_type ::= FULL */ - 521, /* (641) join_subtype ::= */ - 521, /* (642) join_subtype ::= OUTER */ - 521, /* (643) join_subtype ::= SEMI */ - 521, /* (644) join_subtype ::= ANTI */ - 521, /* (645) join_subtype ::= ASOF */ - 521, /* (646) join_subtype ::= WINDOW */ - 522, /* (647) join_on_clause_opt ::= */ - 522, /* (648) join_on_clause_opt ::= ON search_condition */ - 523, /* (649) window_offset_clause_opt ::= */ - 523, /* (650) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 525, /* (651) window_offset_literal ::= NK_VARIABLE */ - 525, /* (652) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 524, /* (653) jlimit_clause_opt ::= */ - 524, /* (654) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 526, /* (655) 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 */ - 527, /* (656) hint_list ::= */ - 527, /* (657) hint_list ::= NK_HINT */ - 529, /* (658) tag_mode_opt ::= */ - 529, /* (659) tag_mode_opt ::= TAGS */ - 528, /* (660) set_quantifier_opt ::= */ - 528, /* (661) set_quantifier_opt ::= DISTINCT */ - 528, /* (662) set_quantifier_opt ::= ALL */ - 530, /* (663) select_list ::= select_item */ - 530, /* (664) select_list ::= select_list NK_COMMA select_item */ - 538, /* (665) select_item ::= NK_STAR */ - 538, /* (666) select_item ::= common_expression */ - 538, /* (667) select_item ::= common_expression column_alias */ - 538, /* (668) select_item ::= common_expression AS column_alias */ - 538, /* (669) select_item ::= table_name NK_DOT NK_STAR */ - 465, /* (670) where_clause_opt ::= */ - 465, /* (671) where_clause_opt ::= WHERE search_condition */ - 531, /* (672) partition_by_clause_opt ::= */ - 531, /* (673) partition_by_clause_opt ::= PARTITION BY partition_list */ - 539, /* (674) partition_list ::= partition_item */ - 539, /* (675) partition_list ::= partition_list NK_COMMA partition_item */ - 540, /* (676) partition_item ::= expr_or_subquery */ - 540, /* (677) partition_item ::= expr_or_subquery column_alias */ - 540, /* (678) partition_item ::= expr_or_subquery AS column_alias */ - 535, /* (679) twindow_clause_opt ::= */ - 535, /* (680) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 535, /* (681) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 535, /* (682) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 535, /* (683) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 535, /* (684) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 535, /* (685) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 535, /* (686) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 458, /* (687) sliding_opt ::= */ - 458, /* (688) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 541, /* (689) interval_sliding_duration_literal ::= NK_VARIABLE */ - 541, /* (690) interval_sliding_duration_literal ::= NK_STRING */ - 541, /* (691) interval_sliding_duration_literal ::= NK_INTEGER */ - 534, /* (692) fill_opt ::= */ - 534, /* (693) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 534, /* (694) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 534, /* (695) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 542, /* (696) fill_mode ::= NONE */ - 542, /* (697) fill_mode ::= PREV */ - 542, /* (698) fill_mode ::= NULL */ - 542, /* (699) fill_mode ::= NULL_F */ - 542, /* (700) fill_mode ::= LINEAR */ - 542, /* (701) fill_mode ::= NEXT */ - 536, /* (702) group_by_clause_opt ::= */ - 536, /* (703) group_by_clause_opt ::= GROUP BY group_by_list */ - 543, /* (704) group_by_list ::= expr_or_subquery */ - 543, /* (705) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 537, /* (706) having_clause_opt ::= */ - 537, /* (707) having_clause_opt ::= HAVING search_condition */ - 532, /* (708) range_opt ::= */ - 532, /* (709) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 532, /* (710) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 533, /* (711) every_opt ::= */ - 533, /* (712) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 544, /* (713) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 545, /* (714) query_simple ::= query_specification */ - 545, /* (715) query_simple ::= union_query_expression */ - 549, /* (716) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 549, /* (717) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 550, /* (718) query_simple_or_subquery ::= query_simple */ - 550, /* (719) query_simple_or_subquery ::= subquery */ - 464, /* (720) query_or_subquery ::= query_expression */ - 464, /* (721) query_or_subquery ::= subquery */ - 546, /* (722) order_by_clause_opt ::= */ - 546, /* (723) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 547, /* (724) slimit_clause_opt ::= */ - 547, /* (725) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 547, /* (726) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 547, /* (727) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 548, /* (728) limit_clause_opt ::= */ - 548, /* (729) limit_clause_opt ::= LIMIT NK_INTEGER */ - 548, /* (730) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 548, /* (731) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 518, /* (732) subquery ::= NK_LP query_expression NK_RP */ - 518, /* (733) subquery ::= NK_LP subquery NK_RP */ - 395, /* (734) search_condition ::= common_expression */ - 551, /* (735) sort_specification_list ::= sort_specification */ - 551, /* (736) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 552, /* (737) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 553, /* (738) ordering_specification_opt ::= */ - 553, /* (739) ordering_specification_opt ::= ASC */ - 553, /* (740) ordering_specification_opt ::= DESC */ - 554, /* (741) null_ordering_opt ::= */ - 554, /* (742) null_ordering_opt ::= NULLS FIRST */ - 554, /* (743) null_ordering_opt ::= NULLS LAST */ - 423, /* (744) column_options ::= */ - 423, /* (745) column_options ::= column_options PRIMARY KEY */ - 423, /* (746) column_options ::= column_options ENCODE NK_STRING */ - 423, /* (747) column_options ::= column_options COMPRESS NK_STRING */ - 423, /* (748) column_options ::= column_options LEVEL NK_STRING */ + 378, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 378, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 379, /* (2) account_options ::= */ + 379, /* (3) account_options ::= account_options PPS literal */ + 379, /* (4) account_options ::= account_options TSERIES literal */ + 379, /* (5) account_options ::= account_options STORAGE literal */ + 379, /* (6) account_options ::= account_options STREAMS literal */ + 379, /* (7) account_options ::= account_options QTIME literal */ + 379, /* (8) account_options ::= account_options DBS literal */ + 379, /* (9) account_options ::= account_options USERS literal */ + 379, /* (10) account_options ::= account_options CONNS literal */ + 379, /* (11) account_options ::= account_options STATE literal */ + 380, /* (12) alter_account_options ::= alter_account_option */ + 380, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 382, /* (14) alter_account_option ::= PASS literal */ + 382, /* (15) alter_account_option ::= PPS literal */ + 382, /* (16) alter_account_option ::= TSERIES literal */ + 382, /* (17) alter_account_option ::= STORAGE literal */ + 382, /* (18) alter_account_option ::= STREAMS literal */ + 382, /* (19) alter_account_option ::= QTIME literal */ + 382, /* (20) alter_account_option ::= DBS literal */ + 382, /* (21) alter_account_option ::= USERS literal */ + 382, /* (22) alter_account_option ::= CONNS literal */ + 382, /* (23) alter_account_option ::= STATE literal */ + 383, /* (24) ip_range_list ::= NK_STRING */ + 383, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 384, /* (26) white_list ::= HOST ip_range_list */ + 385, /* (27) white_list_opt ::= */ + 385, /* (28) white_list_opt ::= white_list */ + 386, /* (29) is_import_opt ::= */ + 386, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ + 387, /* (31) is_createdb_opt ::= */ + 387, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ + 378, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + 378, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ + 378, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 378, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 378, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + 378, /* (38) cmd ::= ALTER USER user_name ADD white_list */ + 378, /* (39) cmd ::= ALTER USER user_name DROP white_list */ + 378, /* (40) cmd ::= DROP USER user_name */ + 389, /* (41) sysinfo_opt ::= */ + 389, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 378, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 378, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 390, /* (45) privileges ::= ALL */ + 390, /* (46) privileges ::= priv_type_list */ + 390, /* (47) privileges ::= SUBSCRIBE */ + 393, /* (48) priv_type_list ::= priv_type */ + 393, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 394, /* (50) priv_type ::= READ */ + 394, /* (51) priv_type ::= WRITE */ + 394, /* (52) priv_type ::= ALTER */ + 391, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 391, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ + 391, /* (55) priv_level ::= db_name NK_DOT table_name */ + 391, /* (56) priv_level ::= topic_name */ + 392, /* (57) with_opt ::= */ + 392, /* (58) with_opt ::= WITH search_condition */ + 378, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + 378, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + 378, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 378, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 378, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 378, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 378, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 378, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 378, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 378, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + 378, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 378, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + 399, /* (71) dnode_endpoint ::= NK_STRING */ + 399, /* (72) dnode_endpoint ::= NK_ID */ + 399, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + 400, /* (74) force_opt ::= */ + 400, /* (75) force_opt ::= FORCE */ + 401, /* (76) unsafe_opt ::= UNSAFE */ + 378, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + 378, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 378, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + 378, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 378, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 378, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 378, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 378, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 378, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 378, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 378, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 378, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 378, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 378, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 378, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 378, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 378, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + 378, /* (94) cmd ::= USE db_name */ + 378, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + 378, /* (96) cmd ::= FLUSH DATABASE db_name */ + 378, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + 378, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + 378, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 402, /* (100) not_exists_opt ::= IF NOT EXISTS */ + 402, /* (101) not_exists_opt ::= */ + 404, /* (102) exists_opt ::= IF EXISTS */ + 404, /* (103) exists_opt ::= */ + 403, /* (104) db_options ::= */ + 403, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + 403, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + 403, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + 403, /* (108) db_options ::= db_options COMP NK_INTEGER */ + 403, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + 403, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + 403, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + 403, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + 403, /* (113) db_options ::= db_options KEEP integer_list */ + 403, /* (114) db_options ::= db_options KEEP variable_list */ + 403, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + 403, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + 403, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 403, /* (118) db_options ::= db_options PRECISION NK_STRING */ + 403, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + 403, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + 403, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 403, /* (122) db_options ::= db_options RETENTIONS retention_list */ + 403, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 403, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 403, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 403, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 403, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 403, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 403, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 403, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 403, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 403, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 403, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + 403, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + 403, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + 403, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + 403, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + 403, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + 403, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 403, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + 405, /* (141) alter_db_options ::= alter_db_option */ + 405, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + 413, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + 413, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + 413, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + 413, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 413, /* (147) alter_db_option ::= KEEP integer_list */ + 413, /* (148) alter_db_option ::= KEEP variable_list */ + 413, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + 413, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + 413, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 413, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 413, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + 413, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 413, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 413, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 413, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 413, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + 413, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + 413, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + 413, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 413, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + 409, /* (163) integer_list ::= NK_INTEGER */ + 409, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 410, /* (165) variable_list ::= NK_VARIABLE */ + 410, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 411, /* (167) retention_list ::= retention */ + 411, /* (168) retention_list ::= retention_list NK_COMMA retention */ + 414, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 414, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 406, /* (171) speed_opt ::= */ + 406, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + 407, /* (173) start_opt ::= */ + 407, /* (174) start_opt ::= START WITH NK_INTEGER */ + 407, /* (175) start_opt ::= START WITH NK_STRING */ + 407, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 408, /* (177) end_opt ::= */ + 408, /* (178) end_opt ::= END WITH NK_INTEGER */ + 408, /* (179) end_opt ::= END WITH NK_STRING */ + 408, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 378, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 378, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + 378, /* (183) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 378, /* (184) cmd ::= DROP TABLE multi_drop_clause */ + 378, /* (185) cmd ::= DROP STABLE exists_opt full_table_name */ + 378, /* (186) cmd ::= ALTER TABLE alter_table_clause */ + 378, /* (187) cmd ::= ALTER STABLE alter_table_clause */ + 422, /* (188) alter_table_clause ::= full_table_name alter_table_options */ + 422, /* (189) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + 422, /* (190) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 422, /* (191) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 422, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + 422, /* (193) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 422, /* (194) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 422, /* (195) alter_table_clause ::= full_table_name DROP TAG column_name */ + 422, /* (196) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 422, /* (197) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 422, /* (198) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 419, /* (199) multi_create_clause ::= create_subtable_clause */ + 419, /* (200) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 428, /* (201) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 421, /* (202) multi_drop_clause ::= drop_table_clause */ + 421, /* (203) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 431, /* (204) drop_table_clause ::= exists_opt full_table_name */ + 429, /* (205) specific_cols_opt ::= */ + 429, /* (206) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 415, /* (207) full_table_name ::= table_name */ + 415, /* (208) full_table_name ::= db_name NK_DOT table_name */ + 433, /* (209) tag_def_list ::= tag_def */ + 433, /* (210) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + 434, /* (211) tag_def ::= column_name type_name */ + 416, /* (212) column_def_list ::= column_def */ + 416, /* (213) column_def_list ::= column_def_list NK_COMMA column_def */ + 435, /* (214) column_def ::= column_name type_name column_options */ + 425, /* (215) type_name ::= BOOL */ + 425, /* (216) type_name ::= TINYINT */ + 425, /* (217) type_name ::= SMALLINT */ + 425, /* (218) type_name ::= INT */ + 425, /* (219) type_name ::= INTEGER */ + 425, /* (220) type_name ::= BIGINT */ + 425, /* (221) type_name ::= FLOAT */ + 425, /* (222) type_name ::= DOUBLE */ + 425, /* (223) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 425, /* (224) type_name ::= TIMESTAMP */ + 425, /* (225) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 425, /* (226) type_name ::= TINYINT UNSIGNED */ + 425, /* (227) type_name ::= SMALLINT UNSIGNED */ + 425, /* (228) type_name ::= INT UNSIGNED */ + 425, /* (229) type_name ::= BIGINT UNSIGNED */ + 425, /* (230) type_name ::= JSON */ + 425, /* (231) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 425, /* (232) type_name ::= MEDIUMBLOB */ + 425, /* (233) type_name ::= BLOB */ + 425, /* (234) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 425, /* (235) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 425, /* (236) type_name ::= DECIMAL */ + 425, /* (237) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 425, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 436, /* (239) type_name_default_len ::= BINARY */ + 436, /* (240) type_name_default_len ::= NCHAR */ + 436, /* (241) type_name_default_len ::= VARCHAR */ + 436, /* (242) type_name_default_len ::= VARBINARY */ + 417, /* (243) tags_def_opt ::= */ + 417, /* (244) tags_def_opt ::= tags_def */ + 420, /* (245) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 418, /* (246) table_options ::= */ + 418, /* (247) table_options ::= table_options COMMENT NK_STRING */ + 418, /* (248) table_options ::= table_options MAX_DELAY duration_list */ + 418, /* (249) table_options ::= table_options WATERMARK duration_list */ + 418, /* (250) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 418, /* (251) table_options ::= table_options TTL NK_INTEGER */ + 418, /* (252) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 418, /* (253) table_options ::= table_options DELETE_MARK duration_list */ + 423, /* (254) alter_table_options ::= alter_table_option */ + 423, /* (255) alter_table_options ::= alter_table_options alter_table_option */ + 439, /* (256) alter_table_option ::= COMMENT NK_STRING */ + 439, /* (257) alter_table_option ::= TTL NK_INTEGER */ + 437, /* (258) duration_list ::= duration_literal */ + 437, /* (259) duration_list ::= duration_list NK_COMMA duration_literal */ + 438, /* (260) rollup_func_list ::= rollup_func_name */ + 438, /* (261) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 441, /* (262) rollup_func_name ::= function_name */ + 441, /* (263) rollup_func_name ::= FIRST */ + 441, /* (264) rollup_func_name ::= LAST */ + 432, /* (265) col_name_list ::= col_name */ + 432, /* (266) col_name_list ::= col_name_list NK_COMMA col_name */ + 443, /* (267) col_name ::= column_name */ + 378, /* (268) cmd ::= SHOW DNODES */ + 378, /* (269) cmd ::= SHOW USERS */ + 378, /* (270) cmd ::= SHOW USERS FULL */ + 378, /* (271) cmd ::= SHOW USER PRIVILEGES */ + 378, /* (272) cmd ::= SHOW db_kind_opt DATABASES */ + 378, /* (273) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 378, /* (274) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 378, /* (275) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 378, /* (276) cmd ::= SHOW MNODES */ + 378, /* (277) cmd ::= SHOW QNODES */ + 378, /* (278) cmd ::= SHOW ARBGROUPS */ + 378, /* (279) cmd ::= SHOW FUNCTIONS */ + 378, /* (280) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 378, /* (281) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 378, /* (282) cmd ::= SHOW STREAMS */ + 378, /* (283) cmd ::= SHOW ACCOUNTS */ + 378, /* (284) cmd ::= SHOW APPS */ + 378, /* (285) cmd ::= SHOW CONNECTIONS */ + 378, /* (286) cmd ::= SHOW LICENCES */ + 378, /* (287) cmd ::= SHOW GRANTS */ + 378, /* (288) cmd ::= SHOW GRANTS FULL */ + 378, /* (289) cmd ::= SHOW GRANTS LOGS */ + 378, /* (290) cmd ::= SHOW CLUSTER MACHINES */ + 378, /* (291) cmd ::= SHOW CREATE DATABASE db_name */ + 378, /* (292) cmd ::= SHOW CREATE TABLE full_table_name */ + 378, /* (293) cmd ::= SHOW CREATE STABLE full_table_name */ + 378, /* (294) cmd ::= SHOW ENCRYPTIONS */ + 378, /* (295) cmd ::= SHOW QUERIES */ + 378, /* (296) cmd ::= SHOW SCORES */ + 378, /* (297) cmd ::= SHOW TOPICS */ + 378, /* (298) cmd ::= SHOW VARIABLES */ + 378, /* (299) cmd ::= SHOW CLUSTER VARIABLES */ + 378, /* (300) cmd ::= SHOW LOCAL VARIABLES */ + 378, /* (301) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 378, /* (302) cmd ::= SHOW BNODES */ + 378, /* (303) cmd ::= SHOW SNODES */ + 378, /* (304) cmd ::= SHOW CLUSTER */ + 378, /* (305) cmd ::= SHOW TRANSACTIONS */ + 378, /* (306) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 378, /* (307) cmd ::= SHOW CONSUMERS */ + 378, /* (308) cmd ::= SHOW SUBSCRIPTIONS */ + 378, /* (309) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 378, /* (310) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 378, /* (311) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 378, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 378, /* (313) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 378, /* (314) cmd ::= SHOW VNODES */ + 378, /* (315) cmd ::= SHOW db_name_cond_opt ALIVE */ + 378, /* (316) cmd ::= SHOW CLUSTER ALIVE */ + 378, /* (317) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 378, /* (318) cmd ::= SHOW CREATE VIEW full_table_name */ + 378, /* (319) cmd ::= SHOW COMPACTS */ + 378, /* (320) cmd ::= SHOW COMPACT NK_INTEGER */ + 445, /* (321) table_kind_db_name_cond_opt ::= */ + 445, /* (322) table_kind_db_name_cond_opt ::= table_kind */ + 445, /* (323) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 445, /* (324) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 451, /* (325) table_kind ::= NORMAL */ + 451, /* (326) table_kind ::= CHILD */ + 447, /* (327) db_name_cond_opt ::= */ + 447, /* (328) db_name_cond_opt ::= db_name NK_DOT */ + 446, /* (329) like_pattern_opt ::= */ + 446, /* (330) like_pattern_opt ::= LIKE NK_STRING */ + 448, /* (331) table_name_cond ::= table_name */ + 449, /* (332) from_db_opt ::= */ + 449, /* (333) from_db_opt ::= FROM db_name */ + 450, /* (334) tag_list_opt ::= */ + 450, /* (335) tag_list_opt ::= tag_item */ + 450, /* (336) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 452, /* (337) tag_item ::= TBNAME */ + 452, /* (338) tag_item ::= QTAGS */ + 452, /* (339) tag_item ::= column_name */ + 452, /* (340) tag_item ::= column_name column_alias */ + 452, /* (341) tag_item ::= column_name AS column_alias */ + 444, /* (342) db_kind_opt ::= */ + 444, /* (343) db_kind_opt ::= USER */ + 444, /* (344) db_kind_opt ::= SYSTEM */ + 378, /* (345) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + 378, /* (346) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + 378, /* (347) cmd ::= DROP TSMA exists_opt full_tsma_name */ + 378, /* (348) cmd ::= SHOW db_name_cond_opt TSMAS */ + 456, /* (349) full_tsma_name ::= tsma_name */ + 456, /* (350) full_tsma_name ::= db_name NK_DOT tsma_name */ + 455, /* (351) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + 378, /* (352) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 378, /* (353) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 378, /* (354) cmd ::= DROP INDEX exists_opt full_index_name */ + 459, /* (355) full_index_name ::= index_name */ + 459, /* (356) full_index_name ::= db_name NK_DOT index_name */ + 458, /* (357) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 458, /* (358) 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 */ + 457, /* (359) func_list ::= func */ + 457, /* (360) func_list ::= func_list NK_COMMA func */ + 463, /* (361) func ::= sma_func_name NK_LP expression_list NK_RP */ + 464, /* (362) sma_func_name ::= function_name */ + 464, /* (363) sma_func_name ::= COUNT */ + 464, /* (364) sma_func_name ::= FIRST */ + 464, /* (365) sma_func_name ::= LAST */ + 464, /* (366) sma_func_name ::= LAST_ROW */ + 462, /* (367) sma_stream_opt ::= */ + 462, /* (368) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 462, /* (369) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 462, /* (370) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 466, /* (371) with_meta ::= AS */ + 466, /* (372) with_meta ::= WITH META AS */ + 466, /* (373) with_meta ::= ONLY META AS */ + 378, /* (374) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 378, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 378, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 378, /* (377) cmd ::= DROP TOPIC exists_opt topic_name */ + 378, /* (378) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 378, /* (379) cmd ::= DESC full_table_name */ + 378, /* (380) cmd ::= DESCRIBE full_table_name */ + 378, /* (381) cmd ::= RESET QUERY CACHE */ + 378, /* (382) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 378, /* (383) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 470, /* (384) analyze_opt ::= */ + 470, /* (385) analyze_opt ::= ANALYZE */ + 471, /* (386) explain_options ::= */ + 471, /* (387) explain_options ::= explain_options VERBOSE NK_BOOL */ + 471, /* (388) explain_options ::= explain_options RATIO NK_FLOAT */ + 378, /* (389) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 378, /* (390) cmd ::= DROP FUNCTION exists_opt function_name */ + 474, /* (391) agg_func_opt ::= */ + 474, /* (392) agg_func_opt ::= AGGREGATE */ + 475, /* (393) bufsize_opt ::= */ + 475, /* (394) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 476, /* (395) language_opt ::= */ + 476, /* (396) language_opt ::= LANGUAGE NK_STRING */ + 473, /* (397) or_replace_opt ::= */ + 473, /* (398) or_replace_opt ::= OR REPLACE */ + 378, /* (399) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 378, /* (400) cmd ::= DROP VIEW exists_opt full_view_name */ + 477, /* (401) full_view_name ::= view_name */ + 477, /* (402) full_view_name ::= db_name NK_DOT view_name */ + 378, /* (403) 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 */ + 378, /* (404) cmd ::= DROP STREAM exists_opt stream_name */ + 378, /* (405) cmd ::= PAUSE STREAM exists_opt stream_name */ + 378, /* (406) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 481, /* (407) col_list_opt ::= */ + 481, /* (408) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + 485, /* (409) column_stream_def_list ::= column_stream_def */ + 485, /* (410) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + 486, /* (411) column_stream_def ::= column_name stream_col_options */ + 487, /* (412) stream_col_options ::= */ + 487, /* (413) stream_col_options ::= stream_col_options PRIMARY KEY */ + 482, /* (414) tag_def_or_ref_opt ::= */ + 482, /* (415) tag_def_or_ref_opt ::= tags_def */ + 482, /* (416) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 480, /* (417) stream_options ::= */ + 480, /* (418) stream_options ::= stream_options TRIGGER AT_ONCE */ + 480, /* (419) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 480, /* (420) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 480, /* (421) stream_options ::= stream_options WATERMARK duration_literal */ + 480, /* (422) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 480, /* (423) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 480, /* (424) stream_options ::= stream_options DELETE_MARK duration_literal */ + 480, /* (425) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 483, /* (426) subtable_opt ::= */ + 483, /* (427) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 484, /* (428) ignore_opt ::= */ + 484, /* (429) ignore_opt ::= IGNORE UNTREATED */ + 378, /* (430) cmd ::= KILL CONNECTION NK_INTEGER */ + 378, /* (431) cmd ::= KILL QUERY NK_STRING */ + 378, /* (432) cmd ::= KILL TRANSACTION NK_INTEGER */ + 378, /* (433) cmd ::= KILL COMPACT NK_INTEGER */ + 378, /* (434) cmd ::= BALANCE VGROUP */ + 378, /* (435) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 378, /* (436) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + 378, /* (437) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 378, /* (438) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 378, /* (439) cmd ::= SPLIT VGROUP NK_INTEGER */ + 489, /* (440) on_vgroup_id ::= */ + 489, /* (441) on_vgroup_id ::= ON NK_INTEGER */ + 490, /* (442) dnode_list ::= DNODE NK_INTEGER */ + 490, /* (443) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 378, /* (444) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 378, /* (445) cmd ::= query_or_subquery */ + 378, /* (446) cmd ::= insert_query */ + 472, /* (447) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 472, /* (448) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 427, /* (449) tags_literal ::= NK_INTEGER */ + 427, /* (450) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + 427, /* (451) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + 427, /* (452) tags_literal ::= NK_PLUS NK_INTEGER */ + 427, /* (453) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + 427, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + 427, /* (455) tags_literal ::= NK_MINUS NK_INTEGER */ + 427, /* (456) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + 427, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + 427, /* (458) tags_literal ::= NK_FLOAT */ + 427, /* (459) tags_literal ::= NK_PLUS NK_FLOAT */ + 427, /* (460) tags_literal ::= NK_MINUS NK_FLOAT */ + 427, /* (461) tags_literal ::= NK_BIN */ + 427, /* (462) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + 427, /* (463) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + 427, /* (464) tags_literal ::= NK_PLUS NK_BIN */ + 427, /* (465) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + 427, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + 427, /* (467) tags_literal ::= NK_MINUS NK_BIN */ + 427, /* (468) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + 427, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + 427, /* (470) tags_literal ::= NK_HEX */ + 427, /* (471) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + 427, /* (472) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + 427, /* (473) tags_literal ::= NK_PLUS NK_HEX */ + 427, /* (474) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + 427, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + 427, /* (476) tags_literal ::= NK_MINUS NK_HEX */ + 427, /* (477) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + 427, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + 427, /* (479) tags_literal ::= NK_STRING */ + 427, /* (480) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + 427, /* (481) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + 427, /* (482) tags_literal ::= NK_BOOL */ + 427, /* (483) tags_literal ::= NULL */ + 427, /* (484) tags_literal ::= literal_func */ + 427, /* (485) tags_literal ::= literal_func NK_PLUS duration_literal */ + 427, /* (486) tags_literal ::= literal_func NK_MINUS duration_literal */ + 430, /* (487) tags_literal_list ::= tags_literal */ + 430, /* (488) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 381, /* (489) literal ::= NK_INTEGER */ + 381, /* (490) literal ::= NK_FLOAT */ + 381, /* (491) literal ::= NK_STRING */ + 381, /* (492) literal ::= NK_BOOL */ + 381, /* (493) literal ::= TIMESTAMP NK_STRING */ + 381, /* (494) literal ::= duration_literal */ + 381, /* (495) literal ::= NULL */ + 381, /* (496) literal ::= NK_QUESTION */ + 440, /* (497) duration_literal ::= NK_VARIABLE */ + 412, /* (498) signed ::= NK_INTEGER */ + 412, /* (499) signed ::= NK_PLUS NK_INTEGER */ + 412, /* (500) signed ::= NK_MINUS NK_INTEGER */ + 412, /* (501) signed ::= NK_FLOAT */ + 412, /* (502) signed ::= NK_PLUS NK_FLOAT */ + 412, /* (503) signed ::= NK_MINUS NK_FLOAT */ + 492, /* (504) signed_literal ::= signed */ + 492, /* (505) signed_literal ::= NK_STRING */ + 492, /* (506) signed_literal ::= NK_BOOL */ + 492, /* (507) signed_literal ::= TIMESTAMP NK_STRING */ + 492, /* (508) signed_literal ::= duration_literal */ + 492, /* (509) signed_literal ::= NULL */ + 492, /* (510) signed_literal ::= literal_func */ + 492, /* (511) signed_literal ::= NK_QUESTION */ + 493, /* (512) literal_list ::= signed_literal */ + 493, /* (513) literal_list ::= literal_list NK_COMMA signed_literal */ + 395, /* (514) db_name ::= NK_ID */ + 396, /* (515) table_name ::= NK_ID */ + 424, /* (516) column_name ::= NK_ID */ + 442, /* (517) function_name ::= NK_ID */ + 478, /* (518) view_name ::= NK_ID */ + 494, /* (519) table_alias ::= NK_ID */ + 453, /* (520) column_alias ::= NK_ID */ + 453, /* (521) column_alias ::= NK_ALIAS */ + 388, /* (522) user_name ::= NK_ID */ + 397, /* (523) topic_name ::= NK_ID */ + 479, /* (524) stream_name ::= NK_ID */ + 469, /* (525) cgroup_name ::= NK_ID */ + 460, /* (526) index_name ::= NK_ID */ + 454, /* (527) tsma_name ::= NK_ID */ + 495, /* (528) expr_or_subquery ::= expression */ + 488, /* (529) expression ::= literal */ + 488, /* (530) expression ::= pseudo_column */ + 488, /* (531) expression ::= column_reference */ + 488, /* (532) expression ::= function_expression */ + 488, /* (533) expression ::= case_when_expression */ + 488, /* (534) expression ::= NK_LP expression NK_RP */ + 488, /* (535) expression ::= NK_PLUS expr_or_subquery */ + 488, /* (536) expression ::= NK_MINUS expr_or_subquery */ + 488, /* (537) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 488, /* (538) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 488, /* (539) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 488, /* (540) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 488, /* (541) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 488, /* (542) expression ::= column_reference NK_ARROW NK_STRING */ + 488, /* (543) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 488, /* (544) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 465, /* (545) expression_list ::= expr_or_subquery */ + 465, /* (546) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 497, /* (547) column_reference ::= column_name */ + 497, /* (548) column_reference ::= table_name NK_DOT column_name */ + 497, /* (549) column_reference ::= NK_ALIAS */ + 497, /* (550) column_reference ::= table_name NK_DOT NK_ALIAS */ + 496, /* (551) pseudo_column ::= ROWTS */ + 496, /* (552) pseudo_column ::= TBNAME */ + 496, /* (553) pseudo_column ::= table_name NK_DOT TBNAME */ + 496, /* (554) pseudo_column ::= QSTART */ + 496, /* (555) pseudo_column ::= QEND */ + 496, /* (556) pseudo_column ::= QDURATION */ + 496, /* (557) pseudo_column ::= WSTART */ + 496, /* (558) pseudo_column ::= WEND */ + 496, /* (559) pseudo_column ::= WDURATION */ + 496, /* (560) pseudo_column ::= IROWTS */ + 496, /* (561) pseudo_column ::= ISFILLED */ + 496, /* (562) pseudo_column ::= QTAGS */ + 498, /* (563) function_expression ::= function_name NK_LP expression_list NK_RP */ + 498, /* (564) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 498, /* (565) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 498, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + 498, /* (567) function_expression ::= literal_func */ + 491, /* (568) literal_func ::= noarg_func NK_LP NK_RP */ + 491, /* (569) literal_func ::= NOW */ + 491, /* (570) literal_func ::= TODAY */ + 502, /* (571) noarg_func ::= NOW */ + 502, /* (572) noarg_func ::= TODAY */ + 502, /* (573) noarg_func ::= TIMEZONE */ + 502, /* (574) noarg_func ::= DATABASE */ + 502, /* (575) noarg_func ::= CLIENT_VERSION */ + 502, /* (576) noarg_func ::= SERVER_VERSION */ + 502, /* (577) noarg_func ::= SERVER_STATUS */ + 502, /* (578) noarg_func ::= CURRENT_USER */ + 502, /* (579) noarg_func ::= USER */ + 500, /* (580) star_func ::= COUNT */ + 500, /* (581) star_func ::= FIRST */ + 500, /* (582) star_func ::= LAST */ + 500, /* (583) star_func ::= LAST_ROW */ + 501, /* (584) star_func_para_list ::= NK_STAR */ + 501, /* (585) star_func_para_list ::= other_para_list */ + 503, /* (586) other_para_list ::= star_func_para */ + 503, /* (587) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 504, /* (588) star_func_para ::= expr_or_subquery */ + 504, /* (589) star_func_para ::= table_name NK_DOT NK_STAR */ + 499, /* (590) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 499, /* (591) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 505, /* (592) when_then_list ::= when_then_expr */ + 505, /* (593) when_then_list ::= when_then_list when_then_expr */ + 508, /* (594) when_then_expr ::= WHEN common_expression THEN common_expression */ + 506, /* (595) case_when_else_opt ::= */ + 506, /* (596) case_when_else_opt ::= ELSE common_expression */ + 509, /* (597) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 509, /* (598) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 509, /* (599) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 509, /* (600) predicate ::= expr_or_subquery IS NULL */ + 509, /* (601) predicate ::= expr_or_subquery IS NOT NULL */ + 509, /* (602) predicate ::= expr_or_subquery in_op in_predicate_value */ + 510, /* (603) compare_op ::= NK_LT */ + 510, /* (604) compare_op ::= NK_GT */ + 510, /* (605) compare_op ::= NK_LE */ + 510, /* (606) compare_op ::= NK_GE */ + 510, /* (607) compare_op ::= NK_NE */ + 510, /* (608) compare_op ::= NK_EQ */ + 510, /* (609) compare_op ::= LIKE */ + 510, /* (610) compare_op ::= NOT LIKE */ + 510, /* (611) compare_op ::= MATCH */ + 510, /* (612) compare_op ::= NMATCH */ + 510, /* (613) compare_op ::= CONTAINS */ + 511, /* (614) in_op ::= IN */ + 511, /* (615) in_op ::= NOT IN */ + 512, /* (616) in_predicate_value ::= NK_LP literal_list NK_RP */ + 513, /* (617) boolean_value_expression ::= boolean_primary */ + 513, /* (618) boolean_value_expression ::= NOT boolean_primary */ + 513, /* (619) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 513, /* (620) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 514, /* (621) boolean_primary ::= predicate */ + 514, /* (622) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 507, /* (623) common_expression ::= expr_or_subquery */ + 507, /* (624) common_expression ::= boolean_value_expression */ + 515, /* (625) from_clause_opt ::= */ + 515, /* (626) from_clause_opt ::= FROM table_reference_list */ + 516, /* (627) table_reference_list ::= table_reference */ + 516, /* (628) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 517, /* (629) table_reference ::= table_primary */ + 517, /* (630) table_reference ::= joined_table */ + 518, /* (631) table_primary ::= table_name alias_opt */ + 518, /* (632) table_primary ::= db_name NK_DOT table_name alias_opt */ + 518, /* (633) table_primary ::= subquery alias_opt */ + 518, /* (634) table_primary ::= parenthesized_joined_table */ + 520, /* (635) alias_opt ::= */ + 520, /* (636) alias_opt ::= table_alias */ + 520, /* (637) alias_opt ::= AS table_alias */ + 522, /* (638) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 522, /* (639) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 519, /* (640) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 523, /* (641) join_type ::= */ + 523, /* (642) join_type ::= INNER */ + 523, /* (643) join_type ::= LEFT */ + 523, /* (644) join_type ::= RIGHT */ + 523, /* (645) join_type ::= FULL */ + 524, /* (646) join_subtype ::= */ + 524, /* (647) join_subtype ::= OUTER */ + 524, /* (648) join_subtype ::= SEMI */ + 524, /* (649) join_subtype ::= ANTI */ + 524, /* (650) join_subtype ::= ASOF */ + 524, /* (651) join_subtype ::= WINDOW */ + 525, /* (652) join_on_clause_opt ::= */ + 525, /* (653) join_on_clause_opt ::= ON search_condition */ + 526, /* (654) window_offset_clause_opt ::= */ + 526, /* (655) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 528, /* (656) window_offset_literal ::= NK_VARIABLE */ + 528, /* (657) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 527, /* (658) jlimit_clause_opt ::= */ + 527, /* (659) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 529, /* (660) 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 */ + 530, /* (661) hint_list ::= */ + 530, /* (662) hint_list ::= NK_HINT */ + 532, /* (663) tag_mode_opt ::= */ + 532, /* (664) tag_mode_opt ::= TAGS */ + 531, /* (665) set_quantifier_opt ::= */ + 531, /* (666) set_quantifier_opt ::= DISTINCT */ + 531, /* (667) set_quantifier_opt ::= ALL */ + 533, /* (668) select_list ::= select_item */ + 533, /* (669) select_list ::= select_list NK_COMMA select_item */ + 541, /* (670) select_item ::= NK_STAR */ + 541, /* (671) select_item ::= common_expression */ + 541, /* (672) select_item ::= common_expression column_alias */ + 541, /* (673) select_item ::= common_expression AS column_alias */ + 541, /* (674) select_item ::= table_name NK_DOT NK_STAR */ + 468, /* (675) where_clause_opt ::= */ + 468, /* (676) where_clause_opt ::= WHERE search_condition */ + 534, /* (677) partition_by_clause_opt ::= */ + 534, /* (678) partition_by_clause_opt ::= PARTITION BY partition_list */ + 542, /* (679) partition_list ::= partition_item */ + 542, /* (680) partition_list ::= partition_list NK_COMMA partition_item */ + 543, /* (681) partition_item ::= expr_or_subquery */ + 543, /* (682) partition_item ::= expr_or_subquery column_alias */ + 543, /* (683) partition_item ::= expr_or_subquery AS column_alias */ + 538, /* (684) twindow_clause_opt ::= */ + 538, /* (685) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 538, /* (686) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 538, /* (687) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 538, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 538, /* (689) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 538, /* (690) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 538, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 461, /* (692) sliding_opt ::= */ + 461, /* (693) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 544, /* (694) interval_sliding_duration_literal ::= NK_VARIABLE */ + 544, /* (695) interval_sliding_duration_literal ::= NK_STRING */ + 544, /* (696) interval_sliding_duration_literal ::= NK_INTEGER */ + 537, /* (697) fill_opt ::= */ + 537, /* (698) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 537, /* (699) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 537, /* (700) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 545, /* (701) fill_mode ::= NONE */ + 545, /* (702) fill_mode ::= PREV */ + 545, /* (703) fill_mode ::= NULL */ + 545, /* (704) fill_mode ::= NULL_F */ + 545, /* (705) fill_mode ::= LINEAR */ + 545, /* (706) fill_mode ::= NEXT */ + 539, /* (707) group_by_clause_opt ::= */ + 539, /* (708) group_by_clause_opt ::= GROUP BY group_by_list */ + 546, /* (709) group_by_list ::= expr_or_subquery */ + 546, /* (710) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 540, /* (711) having_clause_opt ::= */ + 540, /* (712) having_clause_opt ::= HAVING search_condition */ + 535, /* (713) range_opt ::= */ + 535, /* (714) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 535, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 536, /* (716) every_opt ::= */ + 536, /* (717) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 547, /* (718) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 548, /* (719) query_simple ::= query_specification */ + 548, /* (720) query_simple ::= union_query_expression */ + 552, /* (721) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 552, /* (722) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 553, /* (723) query_simple_or_subquery ::= query_simple */ + 553, /* (724) query_simple_or_subquery ::= subquery */ + 467, /* (725) query_or_subquery ::= query_expression */ + 467, /* (726) query_or_subquery ::= subquery */ + 549, /* (727) order_by_clause_opt ::= */ + 549, /* (728) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 550, /* (729) slimit_clause_opt ::= */ + 550, /* (730) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 550, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 550, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 551, /* (733) limit_clause_opt ::= */ + 551, /* (734) limit_clause_opt ::= LIMIT NK_INTEGER */ + 551, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 551, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 521, /* (737) subquery ::= NK_LP query_expression NK_RP */ + 521, /* (738) subquery ::= NK_LP subquery NK_RP */ + 398, /* (739) search_condition ::= common_expression */ + 554, /* (740) sort_specification_list ::= sort_specification */ + 554, /* (741) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 555, /* (742) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 556, /* (743) ordering_specification_opt ::= */ + 556, /* (744) ordering_specification_opt ::= ASC */ + 556, /* (745) ordering_specification_opt ::= DESC */ + 557, /* (746) null_ordering_opt ::= */ + 557, /* (747) null_ordering_opt ::= NULLS FIRST */ + 557, /* (748) null_ordering_opt ::= NULLS LAST */ + 426, /* (749) column_options ::= */ + 426, /* (750) column_options ::= column_options PRIMARY KEY */ + 426, /* (751) column_options ::= column_options ENCODE NK_STRING */ + 426, /* (752) column_options ::= column_options COMPRESS NK_STRING */ + 426, /* (753) column_options ::= column_options LEVEL NK_STRING */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4409,726 +4756,731 @@ static const signed char yyRuleInfoNRhs[] = { -2, /* (26) white_list ::= HOST ip_range_list */ 0, /* (27) white_list_opt ::= */ -1, /* (28) white_list_opt ::= white_list */ - -7, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - -5, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - -5, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - -5, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - -5, /* (33) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - -5, /* (34) cmd ::= ALTER USER user_name ADD white_list */ - -5, /* (35) cmd ::= ALTER USER user_name DROP white_list */ - -3, /* (36) cmd ::= DROP USER user_name */ - 0, /* (37) sysinfo_opt ::= */ - -2, /* (38) sysinfo_opt ::= SYSINFO NK_INTEGER */ - -7, /* (39) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - -7, /* (40) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - -1, /* (41) privileges ::= ALL */ - -1, /* (42) privileges ::= priv_type_list */ - -1, /* (43) privileges ::= SUBSCRIBE */ - -1, /* (44) priv_type_list ::= priv_type */ - -3, /* (45) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - -1, /* (46) priv_type ::= READ */ - -1, /* (47) priv_type ::= WRITE */ - -1, /* (48) priv_type ::= ALTER */ - -3, /* (49) priv_level ::= NK_STAR NK_DOT NK_STAR */ - -3, /* (50) priv_level ::= db_name NK_DOT NK_STAR */ - -3, /* (51) priv_level ::= db_name NK_DOT table_name */ - -1, /* (52) priv_level ::= topic_name */ - 0, /* (53) with_opt ::= */ - -2, /* (54) with_opt ::= WITH search_condition */ - -3, /* (55) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - -3, /* (56) cmd ::= CREATE DNODE dnode_endpoint */ - -5, /* (57) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - -4, /* (58) cmd ::= DROP DNODE NK_INTEGER force_opt */ - -4, /* (59) cmd ::= DROP DNODE dnode_endpoint force_opt */ - -4, /* (60) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - -4, /* (61) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - -4, /* (62) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - -5, /* (63) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - -4, /* (64) cmd ::= ALTER ALL DNODES NK_STRING */ - -5, /* (65) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - -3, /* (66) cmd ::= RESTORE DNODE NK_INTEGER */ - -1, /* (67) dnode_endpoint ::= NK_STRING */ - -1, /* (68) dnode_endpoint ::= NK_ID */ - -1, /* (69) dnode_endpoint ::= NK_IPTOKEN */ - 0, /* (70) force_opt ::= */ - -1, /* (71) force_opt ::= FORCE */ - -1, /* (72) unsafe_opt ::= UNSAFE */ - -3, /* (73) cmd ::= ALTER CLUSTER NK_STRING */ - -4, /* (74) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - -3, /* (75) cmd ::= ALTER LOCAL NK_STRING */ - -4, /* (76) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - -5, /* (77) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - -5, /* (78) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - -5, /* (79) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - -5, /* (80) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - -5, /* (81) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - -5, /* (82) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - -5, /* (83) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - -5, /* (84) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - -5, /* (85) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - -5, /* (86) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - -5, /* (87) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - -5, /* (88) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - -4, /* (89) cmd ::= DROP DATABASE exists_opt db_name */ - -2, /* (90) cmd ::= USE db_name */ - -4, /* (91) cmd ::= ALTER DATABASE db_name alter_db_options */ - -3, /* (92) cmd ::= FLUSH DATABASE db_name */ - -4, /* (93) cmd ::= TRIM DATABASE db_name speed_opt */ - -3, /* (94) cmd ::= S3MIGRATE DATABASE db_name */ - -5, /* (95) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - -3, /* (96) not_exists_opt ::= IF NOT EXISTS */ - 0, /* (97) not_exists_opt ::= */ - -2, /* (98) exists_opt ::= IF EXISTS */ - 0, /* (99) exists_opt ::= */ - 0, /* (100) db_options ::= */ - -3, /* (101) db_options ::= db_options BUFFER NK_INTEGER */ - -3, /* (102) db_options ::= db_options CACHEMODEL NK_STRING */ - -3, /* (103) db_options ::= db_options CACHESIZE NK_INTEGER */ - -3, /* (104) db_options ::= db_options COMP NK_INTEGER */ - -3, /* (105) db_options ::= db_options DURATION NK_INTEGER */ - -3, /* (106) db_options ::= db_options DURATION NK_VARIABLE */ - -3, /* (107) db_options ::= db_options MAXROWS NK_INTEGER */ - -3, /* (108) db_options ::= db_options MINROWS NK_INTEGER */ - -3, /* (109) db_options ::= db_options KEEP integer_list */ - -3, /* (110) db_options ::= db_options KEEP variable_list */ - -3, /* (111) db_options ::= db_options PAGES NK_INTEGER */ - -3, /* (112) db_options ::= db_options PAGESIZE NK_INTEGER */ - -3, /* (113) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - -3, /* (114) db_options ::= db_options PRECISION NK_STRING */ - -3, /* (115) db_options ::= db_options REPLICA NK_INTEGER */ - -3, /* (116) db_options ::= db_options VGROUPS NK_INTEGER */ - -3, /* (117) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - -3, /* (118) db_options ::= db_options RETENTIONS retention_list */ - -3, /* (119) db_options ::= db_options SCHEMALESS NK_INTEGER */ - -3, /* (120) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - -3, /* (121) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - -3, /* (122) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - -4, /* (123) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -3, /* (124) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - -4, /* (125) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -3, /* (126) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - -3, /* (127) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - -3, /* (128) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - -3, /* (129) db_options ::= db_options TABLE_PREFIX signed */ - -3, /* (130) db_options ::= db_options TABLE_SUFFIX signed */ - -3, /* (131) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - -3, /* (132) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - -3, /* (133) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - -3, /* (134) db_options ::= db_options S3_COMPACT NK_INTEGER */ - -3, /* (135) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - -3, /* (136) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (137) alter_db_options ::= alter_db_option */ - -2, /* (138) alter_db_options ::= alter_db_options alter_db_option */ - -2, /* (139) alter_db_option ::= BUFFER NK_INTEGER */ - -2, /* (140) alter_db_option ::= CACHEMODEL NK_STRING */ - -2, /* (141) alter_db_option ::= CACHESIZE NK_INTEGER */ - -2, /* (142) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - -2, /* (143) alter_db_option ::= KEEP integer_list */ - -2, /* (144) alter_db_option ::= KEEP variable_list */ - -2, /* (145) alter_db_option ::= PAGES NK_INTEGER */ - -2, /* (146) alter_db_option ::= REPLICA NK_INTEGER */ - -2, /* (147) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - -2, /* (148) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - -2, /* (149) alter_db_option ::= MINROWS NK_INTEGER */ - -2, /* (150) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - -3, /* (151) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -2, /* (152) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - -3, /* (153) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -2, /* (154) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - -2, /* (155) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - -2, /* (156) alter_db_option ::= S3_COMPACT NK_INTEGER */ - -2, /* (157) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - -2, /* (158) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (159) integer_list ::= NK_INTEGER */ - -3, /* (160) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - -1, /* (161) variable_list ::= NK_VARIABLE */ - -3, /* (162) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - -1, /* (163) retention_list ::= retention */ - -3, /* (164) retention_list ::= retention_list NK_COMMA retention */ - -3, /* (165) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - -3, /* (166) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 0, /* (167) speed_opt ::= */ - -2, /* (168) speed_opt ::= BWLIMIT NK_INTEGER */ - 0, /* (169) start_opt ::= */ - -3, /* (170) start_opt ::= START WITH NK_INTEGER */ - -3, /* (171) start_opt ::= START WITH NK_STRING */ - -4, /* (172) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 0, /* (173) end_opt ::= */ - -3, /* (174) end_opt ::= END WITH NK_INTEGER */ - -3, /* (175) end_opt ::= END WITH NK_STRING */ - -4, /* (176) end_opt ::= END WITH TIMESTAMP NK_STRING */ - -9, /* (177) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - -3, /* (178) cmd ::= CREATE TABLE multi_create_clause */ - -9, /* (179) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - -3, /* (180) cmd ::= DROP TABLE multi_drop_clause */ - -4, /* (181) cmd ::= DROP STABLE exists_opt full_table_name */ - -3, /* (182) cmd ::= ALTER TABLE alter_table_clause */ - -3, /* (183) cmd ::= ALTER STABLE alter_table_clause */ - -2, /* (184) alter_table_clause ::= full_table_name alter_table_options */ - -6, /* (185) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - -4, /* (186) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -5, /* (187) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - -5, /* (188) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - -5, /* (189) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -5, /* (190) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - -4, /* (191) alter_table_clause ::= full_table_name DROP TAG column_name */ - -5, /* (192) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - -5, /* (193) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (194) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - -1, /* (195) multi_create_clause ::= create_subtable_clause */ - -2, /* (196) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -10, /* (197) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - -1, /* (198) multi_drop_clause ::= drop_table_clause */ - -3, /* (199) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - -2, /* (200) drop_table_clause ::= exists_opt full_table_name */ - 0, /* (201) specific_cols_opt ::= */ - -3, /* (202) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - -1, /* (203) full_table_name ::= table_name */ - -3, /* (204) full_table_name ::= db_name NK_DOT table_name */ - -1, /* (205) tag_def_list ::= tag_def */ - -3, /* (206) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - -2, /* (207) tag_def ::= column_name type_name */ - -1, /* (208) column_def_list ::= column_def */ - -3, /* (209) column_def_list ::= column_def_list NK_COMMA column_def */ - -3, /* (210) column_def ::= column_name type_name column_options */ - -1, /* (211) type_name ::= BOOL */ - -1, /* (212) type_name ::= TINYINT */ - -1, /* (213) type_name ::= SMALLINT */ - -1, /* (214) type_name ::= INT */ - -1, /* (215) type_name ::= INTEGER */ - -1, /* (216) type_name ::= BIGINT */ - -1, /* (217) type_name ::= FLOAT */ - -1, /* (218) type_name ::= DOUBLE */ - -4, /* (219) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (220) type_name ::= TIMESTAMP */ - -4, /* (221) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (222) type_name ::= TINYINT UNSIGNED */ - -2, /* (223) type_name ::= SMALLINT UNSIGNED */ - -2, /* (224) type_name ::= INT UNSIGNED */ - -2, /* (225) type_name ::= BIGINT UNSIGNED */ - -1, /* (226) type_name ::= JSON */ - -4, /* (227) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (228) type_name ::= MEDIUMBLOB */ - -1, /* (229) type_name ::= BLOB */ - -4, /* (230) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (231) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (232) type_name ::= DECIMAL */ - -4, /* (233) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (234) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -1, /* (235) type_name_default_len ::= BINARY */ - -1, /* (236) type_name_default_len ::= NCHAR */ - -1, /* (237) type_name_default_len ::= VARCHAR */ - -1, /* (238) type_name_default_len ::= VARBINARY */ - 0, /* (239) tags_def_opt ::= */ - -1, /* (240) tags_def_opt ::= tags_def */ - -4, /* (241) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 0, /* (242) table_options ::= */ - -3, /* (243) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (244) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (245) table_options ::= table_options WATERMARK duration_list */ - -5, /* (246) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (247) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (248) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (249) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (250) alter_table_options ::= alter_table_option */ - -2, /* (251) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (252) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (253) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (254) duration_list ::= duration_literal */ - -3, /* (255) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (256) rollup_func_list ::= rollup_func_name */ - -3, /* (257) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (258) rollup_func_name ::= function_name */ - -1, /* (259) rollup_func_name ::= FIRST */ - -1, /* (260) rollup_func_name ::= LAST */ - -1, /* (261) col_name_list ::= col_name */ - -3, /* (262) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (263) col_name ::= column_name */ - -2, /* (264) cmd ::= SHOW DNODES */ - -2, /* (265) cmd ::= SHOW USERS */ - -3, /* (266) cmd ::= SHOW USER PRIVILEGES */ - -3, /* (267) cmd ::= SHOW db_kind_opt DATABASES */ - -4, /* (268) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (269) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (270) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (271) cmd ::= SHOW MNODES */ - -2, /* (272) cmd ::= SHOW QNODES */ - -2, /* (273) cmd ::= SHOW ARBGROUPS */ - -2, /* (274) cmd ::= SHOW FUNCTIONS */ - -5, /* (275) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (276) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (277) cmd ::= SHOW STREAMS */ - -2, /* (278) cmd ::= SHOW ACCOUNTS */ - -2, /* (279) cmd ::= SHOW APPS */ - -2, /* (280) cmd ::= SHOW CONNECTIONS */ - -2, /* (281) cmd ::= SHOW LICENCES */ - -2, /* (282) cmd ::= SHOW GRANTS */ - -3, /* (283) cmd ::= SHOW GRANTS FULL */ - -3, /* (284) cmd ::= SHOW GRANTS LOGS */ - -3, /* (285) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (286) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (287) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (288) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (289) cmd ::= SHOW ENCRYPTIONS */ - -2, /* (290) cmd ::= SHOW QUERIES */ - -2, /* (291) cmd ::= SHOW SCORES */ - -2, /* (292) cmd ::= SHOW TOPICS */ - -2, /* (293) cmd ::= SHOW VARIABLES */ - -3, /* (294) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (295) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (296) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (297) cmd ::= SHOW BNODES */ - -2, /* (298) cmd ::= SHOW SNODES */ - -2, /* (299) cmd ::= SHOW CLUSTER */ - -2, /* (300) cmd ::= SHOW TRANSACTIONS */ - -4, /* (301) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (302) cmd ::= SHOW CONSUMERS */ - -2, /* (303) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (304) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (305) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (306) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (307) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (308) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (309) cmd ::= SHOW VNODES */ - -3, /* (310) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (311) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (312) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (313) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (314) cmd ::= SHOW COMPACTS */ - -3, /* (315) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (316) table_kind_db_name_cond_opt ::= */ - -1, /* (317) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (318) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (319) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (320) table_kind ::= NORMAL */ - -1, /* (321) table_kind ::= CHILD */ - 0, /* (322) db_name_cond_opt ::= */ - -2, /* (323) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (324) like_pattern_opt ::= */ - -2, /* (325) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (326) table_name_cond ::= table_name */ - 0, /* (327) from_db_opt ::= */ - -2, /* (328) from_db_opt ::= FROM db_name */ - 0, /* (329) tag_list_opt ::= */ - -1, /* (330) tag_list_opt ::= tag_item */ - -3, /* (331) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (332) tag_item ::= TBNAME */ - -1, /* (333) tag_item ::= QTAGS */ - -1, /* (334) tag_item ::= column_name */ - -2, /* (335) tag_item ::= column_name column_alias */ - -3, /* (336) tag_item ::= column_name AS column_alias */ - 0, /* (337) db_kind_opt ::= */ - -1, /* (338) db_kind_opt ::= USER */ - -1, /* (339) db_kind_opt ::= SYSTEM */ - -11, /* (340) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - -11, /* (341) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - -4, /* (342) cmd ::= DROP TSMA exists_opt full_tsma_name */ - -3, /* (343) cmd ::= SHOW db_name_cond_opt TSMAS */ - -1, /* (344) full_tsma_name ::= tsma_name */ - -3, /* (345) full_tsma_name ::= db_name NK_DOT tsma_name */ - -4, /* (346) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - -8, /* (347) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (348) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (349) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (350) full_index_name ::= index_name */ - -3, /* (351) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (352) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (353) 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 */ - -1, /* (354) func_list ::= func */ - -3, /* (355) func_list ::= func_list NK_COMMA func */ - -4, /* (356) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (357) sma_func_name ::= function_name */ - -1, /* (358) sma_func_name ::= COUNT */ - -1, /* (359) sma_func_name ::= FIRST */ - -1, /* (360) sma_func_name ::= LAST */ - -1, /* (361) sma_func_name ::= LAST_ROW */ - 0, /* (362) sma_stream_opt ::= */ - -3, /* (363) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (364) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (365) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (366) with_meta ::= AS */ - -3, /* (367) with_meta ::= WITH META AS */ - -3, /* (368) with_meta ::= ONLY META AS */ - -6, /* (369) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (370) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (371) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (372) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (373) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (374) cmd ::= DESC full_table_name */ - -2, /* (375) cmd ::= DESCRIBE full_table_name */ - -3, /* (376) cmd ::= RESET QUERY CACHE */ - -4, /* (377) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (378) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (379) analyze_opt ::= */ - -1, /* (380) analyze_opt ::= ANALYZE */ - 0, /* (381) explain_options ::= */ - -3, /* (382) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (383) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (384) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (385) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (386) agg_func_opt ::= */ - -1, /* (387) agg_func_opt ::= AGGREGATE */ - 0, /* (388) bufsize_opt ::= */ - -2, /* (389) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (390) language_opt ::= */ - -2, /* (391) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (392) or_replace_opt ::= */ - -2, /* (393) or_replace_opt ::= OR REPLACE */ - -6, /* (394) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (395) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (396) full_view_name ::= view_name */ - -3, /* (397) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (398) 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 */ - -4, /* (399) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (400) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (401) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (402) col_list_opt ::= */ - -3, /* (403) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - -1, /* (404) column_stream_def_list ::= column_stream_def */ - -3, /* (405) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - -2, /* (406) column_stream_def ::= column_name stream_col_options */ - 0, /* (407) stream_col_options ::= */ - -3, /* (408) stream_col_options ::= stream_col_options PRIMARY KEY */ - 0, /* (409) tag_def_or_ref_opt ::= */ - -1, /* (410) tag_def_or_ref_opt ::= tags_def */ - -4, /* (411) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 0, /* (412) stream_options ::= */ - -3, /* (413) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (414) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (415) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (416) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (417) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (418) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (419) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (420) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (421) subtable_opt ::= */ - -4, /* (422) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (423) ignore_opt ::= */ - -2, /* (424) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (425) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (426) cmd ::= KILL QUERY NK_STRING */ - -3, /* (427) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (428) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (429) cmd ::= BALANCE VGROUP */ - -4, /* (430) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -5, /* (431) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - -4, /* (432) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (433) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (434) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (435) on_vgroup_id ::= */ - -2, /* (436) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (437) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (438) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (439) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (440) cmd ::= query_or_subquery */ - -1, /* (441) cmd ::= insert_query */ - -7, /* (442) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (443) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (444) tags_literal ::= NK_INTEGER */ - -3, /* (445) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - -3, /* (446) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - -2, /* (447) tags_literal ::= NK_PLUS NK_INTEGER */ - -4, /* (448) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (449) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - -2, /* (450) tags_literal ::= NK_MINUS NK_INTEGER */ - -4, /* (451) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (452) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - -1, /* (453) tags_literal ::= NK_FLOAT */ - -2, /* (454) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (455) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (456) tags_literal ::= NK_BIN */ - -3, /* (457) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - -3, /* (458) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - -2, /* (459) tags_literal ::= NK_PLUS NK_BIN */ - -4, /* (460) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - -4, /* (461) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - -2, /* (462) tags_literal ::= NK_MINUS NK_BIN */ - -4, /* (463) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - -4, /* (464) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - -1, /* (465) tags_literal ::= NK_HEX */ - -3, /* (466) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - -3, /* (467) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - -2, /* (468) tags_literal ::= NK_PLUS NK_HEX */ - -4, /* (469) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - -4, /* (470) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - -2, /* (471) tags_literal ::= NK_MINUS NK_HEX */ - -4, /* (472) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - -4, /* (473) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - -1, /* (474) tags_literal ::= NK_STRING */ - -3, /* (475) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - -3, /* (476) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - -1, /* (477) tags_literal ::= NK_BOOL */ - -1, /* (478) tags_literal ::= NULL */ - -1, /* (479) tags_literal ::= literal_func */ - -3, /* (480) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (481) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (482) tags_literal_list ::= tags_literal */ - -3, /* (483) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (484) literal ::= NK_INTEGER */ - -1, /* (485) literal ::= NK_FLOAT */ - -1, /* (486) literal ::= NK_STRING */ - -1, /* (487) literal ::= NK_BOOL */ - -2, /* (488) literal ::= TIMESTAMP NK_STRING */ - -1, /* (489) literal ::= duration_literal */ - -1, /* (490) literal ::= NULL */ - -1, /* (491) literal ::= NK_QUESTION */ - -1, /* (492) duration_literal ::= NK_VARIABLE */ - -1, /* (493) signed ::= NK_INTEGER */ - -2, /* (494) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (495) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (496) signed ::= NK_FLOAT */ - -2, /* (497) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (498) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (499) signed_literal ::= signed */ - -1, /* (500) signed_literal ::= NK_STRING */ - -1, /* (501) signed_literal ::= NK_BOOL */ - -2, /* (502) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (503) signed_literal ::= duration_literal */ - -1, /* (504) signed_literal ::= NULL */ - -1, /* (505) signed_literal ::= literal_func */ - -1, /* (506) signed_literal ::= NK_QUESTION */ - -1, /* (507) literal_list ::= signed_literal */ - -3, /* (508) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (509) db_name ::= NK_ID */ - -1, /* (510) table_name ::= NK_ID */ - -1, /* (511) column_name ::= NK_ID */ - -1, /* (512) function_name ::= NK_ID */ - -1, /* (513) view_name ::= NK_ID */ - -1, /* (514) table_alias ::= NK_ID */ - -1, /* (515) column_alias ::= NK_ID */ - -1, /* (516) column_alias ::= NK_ALIAS */ - -1, /* (517) user_name ::= NK_ID */ - -1, /* (518) topic_name ::= NK_ID */ - -1, /* (519) stream_name ::= NK_ID */ - -1, /* (520) cgroup_name ::= NK_ID */ - -1, /* (521) index_name ::= NK_ID */ - -1, /* (522) tsma_name ::= NK_ID */ - -1, /* (523) expr_or_subquery ::= expression */ - -1, /* (524) expression ::= literal */ - -1, /* (525) expression ::= pseudo_column */ - -1, /* (526) expression ::= column_reference */ - -1, /* (527) expression ::= function_expression */ - -1, /* (528) expression ::= case_when_expression */ - -3, /* (529) expression ::= NK_LP expression NK_RP */ - -2, /* (530) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (531) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (532) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (533) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (534) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (535) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (536) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (537) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (538) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (539) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (540) expression_list ::= expr_or_subquery */ - -3, /* (541) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (542) column_reference ::= column_name */ - -3, /* (543) column_reference ::= table_name NK_DOT column_name */ - -1, /* (544) column_reference ::= NK_ALIAS */ - -3, /* (545) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (546) pseudo_column ::= ROWTS */ - -1, /* (547) pseudo_column ::= TBNAME */ - -3, /* (548) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (549) pseudo_column ::= QSTART */ - -1, /* (550) pseudo_column ::= QEND */ - -1, /* (551) pseudo_column ::= QDURATION */ - -1, /* (552) pseudo_column ::= WSTART */ - -1, /* (553) pseudo_column ::= WEND */ - -1, /* (554) pseudo_column ::= WDURATION */ - -1, /* (555) pseudo_column ::= IROWTS */ - -1, /* (556) pseudo_column ::= ISFILLED */ - -1, /* (557) pseudo_column ::= QTAGS */ - -4, /* (558) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (559) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (560) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -6, /* (561) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - -1, /* (562) function_expression ::= literal_func */ - -3, /* (563) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (564) literal_func ::= NOW */ - -1, /* (565) literal_func ::= TODAY */ - -1, /* (566) noarg_func ::= NOW */ - -1, /* (567) noarg_func ::= TODAY */ - -1, /* (568) noarg_func ::= TIMEZONE */ - -1, /* (569) noarg_func ::= DATABASE */ - -1, /* (570) noarg_func ::= CLIENT_VERSION */ - -1, /* (571) noarg_func ::= SERVER_VERSION */ - -1, /* (572) noarg_func ::= SERVER_STATUS */ - -1, /* (573) noarg_func ::= CURRENT_USER */ - -1, /* (574) noarg_func ::= USER */ - -1, /* (575) star_func ::= COUNT */ - -1, /* (576) star_func ::= FIRST */ - -1, /* (577) star_func ::= LAST */ - -1, /* (578) star_func ::= LAST_ROW */ - -1, /* (579) star_func_para_list ::= NK_STAR */ - -1, /* (580) star_func_para_list ::= other_para_list */ - -1, /* (581) other_para_list ::= star_func_para */ - -3, /* (582) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (583) star_func_para ::= expr_or_subquery */ - -3, /* (584) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (585) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (586) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (587) when_then_list ::= when_then_expr */ - -2, /* (588) when_then_list ::= when_then_list when_then_expr */ - -4, /* (589) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (590) case_when_else_opt ::= */ - -2, /* (591) case_when_else_opt ::= ELSE common_expression */ - -3, /* (592) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (593) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (594) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (595) predicate ::= expr_or_subquery IS NULL */ - -4, /* (596) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (597) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (598) compare_op ::= NK_LT */ - -1, /* (599) compare_op ::= NK_GT */ - -1, /* (600) compare_op ::= NK_LE */ - -1, /* (601) compare_op ::= NK_GE */ - -1, /* (602) compare_op ::= NK_NE */ - -1, /* (603) compare_op ::= NK_EQ */ - -1, /* (604) compare_op ::= LIKE */ - -2, /* (605) compare_op ::= NOT LIKE */ - -1, /* (606) compare_op ::= MATCH */ - -1, /* (607) compare_op ::= NMATCH */ - -1, /* (608) compare_op ::= CONTAINS */ - -1, /* (609) in_op ::= IN */ - -2, /* (610) in_op ::= NOT IN */ - -3, /* (611) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (612) boolean_value_expression ::= boolean_primary */ - -2, /* (613) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (614) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (615) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (616) boolean_primary ::= predicate */ - -3, /* (617) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (618) common_expression ::= expr_or_subquery */ - -1, /* (619) common_expression ::= boolean_value_expression */ - 0, /* (620) from_clause_opt ::= */ - -2, /* (621) from_clause_opt ::= FROM table_reference_list */ - -1, /* (622) table_reference_list ::= table_reference */ - -3, /* (623) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (624) table_reference ::= table_primary */ - -1, /* (625) table_reference ::= joined_table */ - -2, /* (626) table_primary ::= table_name alias_opt */ - -4, /* (627) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (628) table_primary ::= subquery alias_opt */ - -1, /* (629) table_primary ::= parenthesized_joined_table */ - 0, /* (630) alias_opt ::= */ - -1, /* (631) alias_opt ::= table_alias */ - -2, /* (632) alias_opt ::= AS table_alias */ - -3, /* (633) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (634) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (635) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (636) join_type ::= */ - -1, /* (637) join_type ::= INNER */ - -1, /* (638) join_type ::= LEFT */ - -1, /* (639) join_type ::= RIGHT */ - -1, /* (640) join_type ::= FULL */ - 0, /* (641) join_subtype ::= */ - -1, /* (642) join_subtype ::= OUTER */ - -1, /* (643) join_subtype ::= SEMI */ - -1, /* (644) join_subtype ::= ANTI */ - -1, /* (645) join_subtype ::= ASOF */ - -1, /* (646) join_subtype ::= WINDOW */ - 0, /* (647) join_on_clause_opt ::= */ - -2, /* (648) join_on_clause_opt ::= ON search_condition */ - 0, /* (649) window_offset_clause_opt ::= */ - -6, /* (650) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (651) window_offset_literal ::= NK_VARIABLE */ - -2, /* (652) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (653) jlimit_clause_opt ::= */ - -2, /* (654) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (655) 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 */ - 0, /* (656) hint_list ::= */ - -1, /* (657) hint_list ::= NK_HINT */ - 0, /* (658) tag_mode_opt ::= */ - -1, /* (659) tag_mode_opt ::= TAGS */ - 0, /* (660) set_quantifier_opt ::= */ - -1, /* (661) set_quantifier_opt ::= DISTINCT */ - -1, /* (662) set_quantifier_opt ::= ALL */ - -1, /* (663) select_list ::= select_item */ - -3, /* (664) select_list ::= select_list NK_COMMA select_item */ - -1, /* (665) select_item ::= NK_STAR */ - -1, /* (666) select_item ::= common_expression */ - -2, /* (667) select_item ::= common_expression column_alias */ - -3, /* (668) select_item ::= common_expression AS column_alias */ - -3, /* (669) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (670) where_clause_opt ::= */ - -2, /* (671) where_clause_opt ::= WHERE search_condition */ - 0, /* (672) partition_by_clause_opt ::= */ - -3, /* (673) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (674) partition_list ::= partition_item */ - -3, /* (675) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (676) partition_item ::= expr_or_subquery */ - -2, /* (677) partition_item ::= expr_or_subquery column_alias */ - -3, /* (678) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (679) twindow_clause_opt ::= */ - -6, /* (680) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (681) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (682) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (683) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (684) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (685) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (686) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (687) sliding_opt ::= */ - -4, /* (688) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (689) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (690) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (691) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (692) fill_opt ::= */ - -4, /* (693) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (694) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (695) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (696) fill_mode ::= NONE */ - -1, /* (697) fill_mode ::= PREV */ - -1, /* (698) fill_mode ::= NULL */ - -1, /* (699) fill_mode ::= NULL_F */ - -1, /* (700) fill_mode ::= LINEAR */ - -1, /* (701) fill_mode ::= NEXT */ - 0, /* (702) group_by_clause_opt ::= */ - -3, /* (703) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (704) group_by_list ::= expr_or_subquery */ - -3, /* (705) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (706) having_clause_opt ::= */ - -2, /* (707) having_clause_opt ::= HAVING search_condition */ - 0, /* (708) range_opt ::= */ - -6, /* (709) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (710) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (711) every_opt ::= */ - -4, /* (712) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (713) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (714) query_simple ::= query_specification */ - -1, /* (715) query_simple ::= union_query_expression */ - -4, /* (716) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (717) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (718) query_simple_or_subquery ::= query_simple */ - -1, /* (719) query_simple_or_subquery ::= subquery */ - -1, /* (720) query_or_subquery ::= query_expression */ - -1, /* (721) query_or_subquery ::= subquery */ - 0, /* (722) order_by_clause_opt ::= */ - -3, /* (723) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (724) slimit_clause_opt ::= */ - -2, /* (725) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (726) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (727) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (728) limit_clause_opt ::= */ - -2, /* (729) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (730) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (731) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (732) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (733) subquery ::= NK_LP subquery NK_RP */ - -1, /* (734) search_condition ::= common_expression */ - -1, /* (735) sort_specification_list ::= sort_specification */ - -3, /* (736) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (737) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (738) ordering_specification_opt ::= */ - -1, /* (739) ordering_specification_opt ::= ASC */ - -1, /* (740) ordering_specification_opt ::= DESC */ - 0, /* (741) null_ordering_opt ::= */ - -2, /* (742) null_ordering_opt ::= NULLS FIRST */ - -2, /* (743) null_ordering_opt ::= NULLS LAST */ - 0, /* (744) column_options ::= */ - -3, /* (745) column_options ::= column_options PRIMARY KEY */ - -3, /* (746) column_options ::= column_options ENCODE NK_STRING */ - -3, /* (747) column_options ::= column_options COMPRESS NK_STRING */ - -3, /* (748) column_options ::= column_options LEVEL NK_STRING */ + 0, /* (29) is_import_opt ::= */ + -2, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ + 0, /* (31) is_createdb_opt ::= */ + -2, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ + -9, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + -5, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ + -5, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + -5, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + -5, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + -5, /* (38) cmd ::= ALTER USER user_name ADD white_list */ + -5, /* (39) cmd ::= ALTER USER user_name DROP white_list */ + -3, /* (40) cmd ::= DROP USER user_name */ + 0, /* (41) sysinfo_opt ::= */ + -2, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ + -7, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + -7, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + -1, /* (45) privileges ::= ALL */ + -1, /* (46) privileges ::= priv_type_list */ + -1, /* (47) privileges ::= SUBSCRIBE */ + -1, /* (48) priv_type_list ::= priv_type */ + -3, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + -1, /* (50) priv_type ::= READ */ + -1, /* (51) priv_type ::= WRITE */ + -1, /* (52) priv_type ::= ALTER */ + -3, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ + -3, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ + -3, /* (55) priv_level ::= db_name NK_DOT table_name */ + -1, /* (56) priv_level ::= topic_name */ + 0, /* (57) with_opt ::= */ + -2, /* (58) with_opt ::= WITH search_condition */ + -3, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + -3, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + -5, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + -4, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + -4, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + -4, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + -4, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + -4, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + -5, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + -4, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + -5, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + -3, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + -1, /* (71) dnode_endpoint ::= NK_STRING */ + -1, /* (72) dnode_endpoint ::= NK_ID */ + -1, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + 0, /* (74) force_opt ::= */ + -1, /* (75) force_opt ::= FORCE */ + -1, /* (76) unsafe_opt ::= UNSAFE */ + -3, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + -4, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + -3, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + -4, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + -5, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + -5, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + -5, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + -5, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + -5, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + -5, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + -5, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + -5, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + -5, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + -5, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + -5, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + -5, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + -4, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + -2, /* (94) cmd ::= USE db_name */ + -4, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + -3, /* (96) cmd ::= FLUSH DATABASE db_name */ + -4, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + -3, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + -5, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + -3, /* (100) not_exists_opt ::= IF NOT EXISTS */ + 0, /* (101) not_exists_opt ::= */ + -2, /* (102) exists_opt ::= IF EXISTS */ + 0, /* (103) exists_opt ::= */ + 0, /* (104) db_options ::= */ + -3, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + -3, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + -3, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + -3, /* (108) db_options ::= db_options COMP NK_INTEGER */ + -3, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + -3, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + -3, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + -3, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + -3, /* (113) db_options ::= db_options KEEP integer_list */ + -3, /* (114) db_options ::= db_options KEEP variable_list */ + -3, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + -3, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + -3, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + -3, /* (118) db_options ::= db_options PRECISION NK_STRING */ + -3, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + -3, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + -3, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + -3, /* (122) db_options ::= db_options RETENTIONS retention_list */ + -3, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + -3, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + -3, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + -3, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + -4, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -3, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + -4, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -3, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + -3, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + -3, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + -3, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + -3, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + -3, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + -3, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + -3, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + -3, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + -3, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + -3, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (141) alter_db_options ::= alter_db_option */ + -2, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + -2, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + -2, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + -2, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + -2, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + -2, /* (147) alter_db_option ::= KEEP integer_list */ + -2, /* (148) alter_db_option ::= KEEP variable_list */ + -2, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + -2, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + -2, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + -2, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + -2, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + -2, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + -3, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -2, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + -3, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -2, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + -2, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + -2, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + -2, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + -2, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (163) integer_list ::= NK_INTEGER */ + -3, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + -1, /* (165) variable_list ::= NK_VARIABLE */ + -3, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + -1, /* (167) retention_list ::= retention */ + -3, /* (168) retention_list ::= retention_list NK_COMMA retention */ + -3, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + -3, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 0, /* (171) speed_opt ::= */ + -2, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + 0, /* (173) start_opt ::= */ + -3, /* (174) start_opt ::= START WITH NK_INTEGER */ + -3, /* (175) start_opt ::= START WITH NK_STRING */ + -4, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 0, /* (177) end_opt ::= */ + -3, /* (178) end_opt ::= END WITH NK_INTEGER */ + -3, /* (179) end_opt ::= END WITH NK_STRING */ + -4, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + -9, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + -3, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + -9, /* (183) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + -3, /* (184) cmd ::= DROP TABLE multi_drop_clause */ + -4, /* (185) cmd ::= DROP STABLE exists_opt full_table_name */ + -3, /* (186) cmd ::= ALTER TABLE alter_table_clause */ + -3, /* (187) cmd ::= ALTER STABLE alter_table_clause */ + -2, /* (188) alter_table_clause ::= full_table_name alter_table_options */ + -6, /* (189) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + -4, /* (190) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + -5, /* (191) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + -5, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + -5, /* (193) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + -5, /* (194) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + -4, /* (195) alter_table_clause ::= full_table_name DROP TAG column_name */ + -5, /* (196) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + -5, /* (197) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + -6, /* (198) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + -1, /* (199) multi_create_clause ::= create_subtable_clause */ + -2, /* (200) multi_create_clause ::= multi_create_clause create_subtable_clause */ + -10, /* (201) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + -1, /* (202) multi_drop_clause ::= drop_table_clause */ + -3, /* (203) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + -2, /* (204) drop_table_clause ::= exists_opt full_table_name */ + 0, /* (205) specific_cols_opt ::= */ + -3, /* (206) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + -1, /* (207) full_table_name ::= table_name */ + -3, /* (208) full_table_name ::= db_name NK_DOT table_name */ + -1, /* (209) tag_def_list ::= tag_def */ + -3, /* (210) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + -2, /* (211) tag_def ::= column_name type_name */ + -1, /* (212) column_def_list ::= column_def */ + -3, /* (213) column_def_list ::= column_def_list NK_COMMA column_def */ + -3, /* (214) column_def ::= column_name type_name column_options */ + -1, /* (215) type_name ::= BOOL */ + -1, /* (216) type_name ::= TINYINT */ + -1, /* (217) type_name ::= SMALLINT */ + -1, /* (218) type_name ::= INT */ + -1, /* (219) type_name ::= INTEGER */ + -1, /* (220) type_name ::= BIGINT */ + -1, /* (221) type_name ::= FLOAT */ + -1, /* (222) type_name ::= DOUBLE */ + -4, /* (223) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + -1, /* (224) type_name ::= TIMESTAMP */ + -4, /* (225) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + -2, /* (226) type_name ::= TINYINT UNSIGNED */ + -2, /* (227) type_name ::= SMALLINT UNSIGNED */ + -2, /* (228) type_name ::= INT UNSIGNED */ + -2, /* (229) type_name ::= BIGINT UNSIGNED */ + -1, /* (230) type_name ::= JSON */ + -4, /* (231) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + -1, /* (232) type_name ::= MEDIUMBLOB */ + -1, /* (233) type_name ::= BLOB */ + -4, /* (234) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + -4, /* (235) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (236) type_name ::= DECIMAL */ + -4, /* (237) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + -1, /* (239) type_name_default_len ::= BINARY */ + -1, /* (240) type_name_default_len ::= NCHAR */ + -1, /* (241) type_name_default_len ::= VARCHAR */ + -1, /* (242) type_name_default_len ::= VARBINARY */ + 0, /* (243) tags_def_opt ::= */ + -1, /* (244) tags_def_opt ::= tags_def */ + -4, /* (245) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 0, /* (246) table_options ::= */ + -3, /* (247) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (248) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (249) table_options ::= table_options WATERMARK duration_list */ + -5, /* (250) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (251) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (252) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (253) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (254) alter_table_options ::= alter_table_option */ + -2, /* (255) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (256) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (257) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (258) duration_list ::= duration_literal */ + -3, /* (259) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (260) rollup_func_list ::= rollup_func_name */ + -3, /* (261) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (262) rollup_func_name ::= function_name */ + -1, /* (263) rollup_func_name ::= FIRST */ + -1, /* (264) rollup_func_name ::= LAST */ + -1, /* (265) col_name_list ::= col_name */ + -3, /* (266) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (267) col_name ::= column_name */ + -2, /* (268) cmd ::= SHOW DNODES */ + -2, /* (269) cmd ::= SHOW USERS */ + -3, /* (270) cmd ::= SHOW USERS FULL */ + -3, /* (271) cmd ::= SHOW USER PRIVILEGES */ + -3, /* (272) cmd ::= SHOW db_kind_opt DATABASES */ + -4, /* (273) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (274) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (275) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (276) cmd ::= SHOW MNODES */ + -2, /* (277) cmd ::= SHOW QNODES */ + -2, /* (278) cmd ::= SHOW ARBGROUPS */ + -2, /* (279) cmd ::= SHOW FUNCTIONS */ + -5, /* (280) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (281) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (282) cmd ::= SHOW STREAMS */ + -2, /* (283) cmd ::= SHOW ACCOUNTS */ + -2, /* (284) cmd ::= SHOW APPS */ + -2, /* (285) cmd ::= SHOW CONNECTIONS */ + -2, /* (286) cmd ::= SHOW LICENCES */ + -2, /* (287) cmd ::= SHOW GRANTS */ + -3, /* (288) cmd ::= SHOW GRANTS FULL */ + -3, /* (289) cmd ::= SHOW GRANTS LOGS */ + -3, /* (290) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (291) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (292) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (293) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (294) cmd ::= SHOW ENCRYPTIONS */ + -2, /* (295) cmd ::= SHOW QUERIES */ + -2, /* (296) cmd ::= SHOW SCORES */ + -2, /* (297) cmd ::= SHOW TOPICS */ + -2, /* (298) cmd ::= SHOW VARIABLES */ + -3, /* (299) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (300) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (301) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (302) cmd ::= SHOW BNODES */ + -2, /* (303) cmd ::= SHOW SNODES */ + -2, /* (304) cmd ::= SHOW CLUSTER */ + -2, /* (305) cmd ::= SHOW TRANSACTIONS */ + -4, /* (306) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (307) cmd ::= SHOW CONSUMERS */ + -2, /* (308) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (309) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (310) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (311) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (313) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (314) cmd ::= SHOW VNODES */ + -3, /* (315) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (316) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (317) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (318) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (319) cmd ::= SHOW COMPACTS */ + -3, /* (320) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (321) table_kind_db_name_cond_opt ::= */ + -1, /* (322) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (323) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (324) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (325) table_kind ::= NORMAL */ + -1, /* (326) table_kind ::= CHILD */ + 0, /* (327) db_name_cond_opt ::= */ + -2, /* (328) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (329) like_pattern_opt ::= */ + -2, /* (330) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (331) table_name_cond ::= table_name */ + 0, /* (332) from_db_opt ::= */ + -2, /* (333) from_db_opt ::= FROM db_name */ + 0, /* (334) tag_list_opt ::= */ + -1, /* (335) tag_list_opt ::= tag_item */ + -3, /* (336) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (337) tag_item ::= TBNAME */ + -1, /* (338) tag_item ::= QTAGS */ + -1, /* (339) tag_item ::= column_name */ + -2, /* (340) tag_item ::= column_name column_alias */ + -3, /* (341) tag_item ::= column_name AS column_alias */ + 0, /* (342) db_kind_opt ::= */ + -1, /* (343) db_kind_opt ::= USER */ + -1, /* (344) db_kind_opt ::= SYSTEM */ + -11, /* (345) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + -11, /* (346) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + -4, /* (347) cmd ::= DROP TSMA exists_opt full_tsma_name */ + -3, /* (348) cmd ::= SHOW db_name_cond_opt TSMAS */ + -1, /* (349) full_tsma_name ::= tsma_name */ + -3, /* (350) full_tsma_name ::= db_name NK_DOT tsma_name */ + -4, /* (351) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + -8, /* (352) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (353) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (354) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (355) full_index_name ::= index_name */ + -3, /* (356) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (357) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (358) 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 */ + -1, /* (359) func_list ::= func */ + -3, /* (360) func_list ::= func_list NK_COMMA func */ + -4, /* (361) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (362) sma_func_name ::= function_name */ + -1, /* (363) sma_func_name ::= COUNT */ + -1, /* (364) sma_func_name ::= FIRST */ + -1, /* (365) sma_func_name ::= LAST */ + -1, /* (366) sma_func_name ::= LAST_ROW */ + 0, /* (367) sma_stream_opt ::= */ + -3, /* (368) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (369) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (370) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (371) with_meta ::= AS */ + -3, /* (372) with_meta ::= WITH META AS */ + -3, /* (373) with_meta ::= ONLY META AS */ + -6, /* (374) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (377) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (378) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (379) cmd ::= DESC full_table_name */ + -2, /* (380) cmd ::= DESCRIBE full_table_name */ + -3, /* (381) cmd ::= RESET QUERY CACHE */ + -4, /* (382) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (383) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (384) analyze_opt ::= */ + -1, /* (385) analyze_opt ::= ANALYZE */ + 0, /* (386) explain_options ::= */ + -3, /* (387) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (388) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (389) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (390) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (391) agg_func_opt ::= */ + -1, /* (392) agg_func_opt ::= AGGREGATE */ + 0, /* (393) bufsize_opt ::= */ + -2, /* (394) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (395) language_opt ::= */ + -2, /* (396) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (397) or_replace_opt ::= */ + -2, /* (398) or_replace_opt ::= OR REPLACE */ + -6, /* (399) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (400) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (401) full_view_name ::= view_name */ + -3, /* (402) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (403) 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 */ + -4, /* (404) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (405) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (406) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (407) col_list_opt ::= */ + -3, /* (408) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + -1, /* (409) column_stream_def_list ::= column_stream_def */ + -3, /* (410) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + -2, /* (411) column_stream_def ::= column_name stream_col_options */ + 0, /* (412) stream_col_options ::= */ + -3, /* (413) stream_col_options ::= stream_col_options PRIMARY KEY */ + 0, /* (414) tag_def_or_ref_opt ::= */ + -1, /* (415) tag_def_or_ref_opt ::= tags_def */ + -4, /* (416) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 0, /* (417) stream_options ::= */ + -3, /* (418) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (419) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (420) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (421) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (422) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (423) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (424) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (425) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (426) subtable_opt ::= */ + -4, /* (427) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (428) ignore_opt ::= */ + -2, /* (429) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (430) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (431) cmd ::= KILL QUERY NK_STRING */ + -3, /* (432) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (433) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (434) cmd ::= BALANCE VGROUP */ + -4, /* (435) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -5, /* (436) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + -4, /* (437) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (438) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (439) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (440) on_vgroup_id ::= */ + -2, /* (441) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (442) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (443) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (444) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (445) cmd ::= query_or_subquery */ + -1, /* (446) cmd ::= insert_query */ + -7, /* (447) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (448) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (449) tags_literal ::= NK_INTEGER */ + -3, /* (450) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + -3, /* (451) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + -2, /* (452) tags_literal ::= NK_PLUS NK_INTEGER */ + -4, /* (453) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + -2, /* (455) tags_literal ::= NK_MINUS NK_INTEGER */ + -4, /* (456) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + -1, /* (458) tags_literal ::= NK_FLOAT */ + -2, /* (459) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (460) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (461) tags_literal ::= NK_BIN */ + -3, /* (462) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + -3, /* (463) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + -2, /* (464) tags_literal ::= NK_PLUS NK_BIN */ + -4, /* (465) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + -4, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + -2, /* (467) tags_literal ::= NK_MINUS NK_BIN */ + -4, /* (468) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + -4, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + -1, /* (470) tags_literal ::= NK_HEX */ + -3, /* (471) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + -3, /* (472) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + -2, /* (473) tags_literal ::= NK_PLUS NK_HEX */ + -4, /* (474) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + -4, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + -2, /* (476) tags_literal ::= NK_MINUS NK_HEX */ + -4, /* (477) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + -4, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + -1, /* (479) tags_literal ::= NK_STRING */ + -3, /* (480) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + -3, /* (481) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + -1, /* (482) tags_literal ::= NK_BOOL */ + -1, /* (483) tags_literal ::= NULL */ + -1, /* (484) tags_literal ::= literal_func */ + -3, /* (485) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (486) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (487) tags_literal_list ::= tags_literal */ + -3, /* (488) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (489) literal ::= NK_INTEGER */ + -1, /* (490) literal ::= NK_FLOAT */ + -1, /* (491) literal ::= NK_STRING */ + -1, /* (492) literal ::= NK_BOOL */ + -2, /* (493) literal ::= TIMESTAMP NK_STRING */ + -1, /* (494) literal ::= duration_literal */ + -1, /* (495) literal ::= NULL */ + -1, /* (496) literal ::= NK_QUESTION */ + -1, /* (497) duration_literal ::= NK_VARIABLE */ + -1, /* (498) signed ::= NK_INTEGER */ + -2, /* (499) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (500) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (501) signed ::= NK_FLOAT */ + -2, /* (502) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (503) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (504) signed_literal ::= signed */ + -1, /* (505) signed_literal ::= NK_STRING */ + -1, /* (506) signed_literal ::= NK_BOOL */ + -2, /* (507) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (508) signed_literal ::= duration_literal */ + -1, /* (509) signed_literal ::= NULL */ + -1, /* (510) signed_literal ::= literal_func */ + -1, /* (511) signed_literal ::= NK_QUESTION */ + -1, /* (512) literal_list ::= signed_literal */ + -3, /* (513) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (514) db_name ::= NK_ID */ + -1, /* (515) table_name ::= NK_ID */ + -1, /* (516) column_name ::= NK_ID */ + -1, /* (517) function_name ::= NK_ID */ + -1, /* (518) view_name ::= NK_ID */ + -1, /* (519) table_alias ::= NK_ID */ + -1, /* (520) column_alias ::= NK_ID */ + -1, /* (521) column_alias ::= NK_ALIAS */ + -1, /* (522) user_name ::= NK_ID */ + -1, /* (523) topic_name ::= NK_ID */ + -1, /* (524) stream_name ::= NK_ID */ + -1, /* (525) cgroup_name ::= NK_ID */ + -1, /* (526) index_name ::= NK_ID */ + -1, /* (527) tsma_name ::= NK_ID */ + -1, /* (528) expr_or_subquery ::= expression */ + -1, /* (529) expression ::= literal */ + -1, /* (530) expression ::= pseudo_column */ + -1, /* (531) expression ::= column_reference */ + -1, /* (532) expression ::= function_expression */ + -1, /* (533) expression ::= case_when_expression */ + -3, /* (534) expression ::= NK_LP expression NK_RP */ + -2, /* (535) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (536) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (537) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (538) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (539) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (540) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (541) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (542) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (543) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (544) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (545) expression_list ::= expr_or_subquery */ + -3, /* (546) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (547) column_reference ::= column_name */ + -3, /* (548) column_reference ::= table_name NK_DOT column_name */ + -1, /* (549) column_reference ::= NK_ALIAS */ + -3, /* (550) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (551) pseudo_column ::= ROWTS */ + -1, /* (552) pseudo_column ::= TBNAME */ + -3, /* (553) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (554) pseudo_column ::= QSTART */ + -1, /* (555) pseudo_column ::= QEND */ + -1, /* (556) pseudo_column ::= QDURATION */ + -1, /* (557) pseudo_column ::= WSTART */ + -1, /* (558) pseudo_column ::= WEND */ + -1, /* (559) pseudo_column ::= WDURATION */ + -1, /* (560) pseudo_column ::= IROWTS */ + -1, /* (561) pseudo_column ::= ISFILLED */ + -1, /* (562) pseudo_column ::= QTAGS */ + -4, /* (563) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (564) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (565) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -6, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + -1, /* (567) function_expression ::= literal_func */ + -3, /* (568) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (569) literal_func ::= NOW */ + -1, /* (570) literal_func ::= TODAY */ + -1, /* (571) noarg_func ::= NOW */ + -1, /* (572) noarg_func ::= TODAY */ + -1, /* (573) noarg_func ::= TIMEZONE */ + -1, /* (574) noarg_func ::= DATABASE */ + -1, /* (575) noarg_func ::= CLIENT_VERSION */ + -1, /* (576) noarg_func ::= SERVER_VERSION */ + -1, /* (577) noarg_func ::= SERVER_STATUS */ + -1, /* (578) noarg_func ::= CURRENT_USER */ + -1, /* (579) noarg_func ::= USER */ + -1, /* (580) star_func ::= COUNT */ + -1, /* (581) star_func ::= FIRST */ + -1, /* (582) star_func ::= LAST */ + -1, /* (583) star_func ::= LAST_ROW */ + -1, /* (584) star_func_para_list ::= NK_STAR */ + -1, /* (585) star_func_para_list ::= other_para_list */ + -1, /* (586) other_para_list ::= star_func_para */ + -3, /* (587) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (588) star_func_para ::= expr_or_subquery */ + -3, /* (589) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (590) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (591) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (592) when_then_list ::= when_then_expr */ + -2, /* (593) when_then_list ::= when_then_list when_then_expr */ + -4, /* (594) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (595) case_when_else_opt ::= */ + -2, /* (596) case_when_else_opt ::= ELSE common_expression */ + -3, /* (597) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (598) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (599) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (600) predicate ::= expr_or_subquery IS NULL */ + -4, /* (601) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (602) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (603) compare_op ::= NK_LT */ + -1, /* (604) compare_op ::= NK_GT */ + -1, /* (605) compare_op ::= NK_LE */ + -1, /* (606) compare_op ::= NK_GE */ + -1, /* (607) compare_op ::= NK_NE */ + -1, /* (608) compare_op ::= NK_EQ */ + -1, /* (609) compare_op ::= LIKE */ + -2, /* (610) compare_op ::= NOT LIKE */ + -1, /* (611) compare_op ::= MATCH */ + -1, /* (612) compare_op ::= NMATCH */ + -1, /* (613) compare_op ::= CONTAINS */ + -1, /* (614) in_op ::= IN */ + -2, /* (615) in_op ::= NOT IN */ + -3, /* (616) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (617) boolean_value_expression ::= boolean_primary */ + -2, /* (618) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (619) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (620) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (621) boolean_primary ::= predicate */ + -3, /* (622) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (623) common_expression ::= expr_or_subquery */ + -1, /* (624) common_expression ::= boolean_value_expression */ + 0, /* (625) from_clause_opt ::= */ + -2, /* (626) from_clause_opt ::= FROM table_reference_list */ + -1, /* (627) table_reference_list ::= table_reference */ + -3, /* (628) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (629) table_reference ::= table_primary */ + -1, /* (630) table_reference ::= joined_table */ + -2, /* (631) table_primary ::= table_name alias_opt */ + -4, /* (632) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (633) table_primary ::= subquery alias_opt */ + -1, /* (634) table_primary ::= parenthesized_joined_table */ + 0, /* (635) alias_opt ::= */ + -1, /* (636) alias_opt ::= table_alias */ + -2, /* (637) alias_opt ::= AS table_alias */ + -3, /* (638) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (639) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (640) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (641) join_type ::= */ + -1, /* (642) join_type ::= INNER */ + -1, /* (643) join_type ::= LEFT */ + -1, /* (644) join_type ::= RIGHT */ + -1, /* (645) join_type ::= FULL */ + 0, /* (646) join_subtype ::= */ + -1, /* (647) join_subtype ::= OUTER */ + -1, /* (648) join_subtype ::= SEMI */ + -1, /* (649) join_subtype ::= ANTI */ + -1, /* (650) join_subtype ::= ASOF */ + -1, /* (651) join_subtype ::= WINDOW */ + 0, /* (652) join_on_clause_opt ::= */ + -2, /* (653) join_on_clause_opt ::= ON search_condition */ + 0, /* (654) window_offset_clause_opt ::= */ + -6, /* (655) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (656) window_offset_literal ::= NK_VARIABLE */ + -2, /* (657) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (658) jlimit_clause_opt ::= */ + -2, /* (659) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (660) 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 */ + 0, /* (661) hint_list ::= */ + -1, /* (662) hint_list ::= NK_HINT */ + 0, /* (663) tag_mode_opt ::= */ + -1, /* (664) tag_mode_opt ::= TAGS */ + 0, /* (665) set_quantifier_opt ::= */ + -1, /* (666) set_quantifier_opt ::= DISTINCT */ + -1, /* (667) set_quantifier_opt ::= ALL */ + -1, /* (668) select_list ::= select_item */ + -3, /* (669) select_list ::= select_list NK_COMMA select_item */ + -1, /* (670) select_item ::= NK_STAR */ + -1, /* (671) select_item ::= common_expression */ + -2, /* (672) select_item ::= common_expression column_alias */ + -3, /* (673) select_item ::= common_expression AS column_alias */ + -3, /* (674) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (675) where_clause_opt ::= */ + -2, /* (676) where_clause_opt ::= WHERE search_condition */ + 0, /* (677) partition_by_clause_opt ::= */ + -3, /* (678) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (679) partition_list ::= partition_item */ + -3, /* (680) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (681) partition_item ::= expr_or_subquery */ + -2, /* (682) partition_item ::= expr_or_subquery column_alias */ + -3, /* (683) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (684) twindow_clause_opt ::= */ + -6, /* (685) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (686) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (687) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (689) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (690) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (692) sliding_opt ::= */ + -4, /* (693) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (694) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (695) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (696) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (697) fill_opt ::= */ + -4, /* (698) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (699) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (700) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (701) fill_mode ::= NONE */ + -1, /* (702) fill_mode ::= PREV */ + -1, /* (703) fill_mode ::= NULL */ + -1, /* (704) fill_mode ::= NULL_F */ + -1, /* (705) fill_mode ::= LINEAR */ + -1, /* (706) fill_mode ::= NEXT */ + 0, /* (707) group_by_clause_opt ::= */ + -3, /* (708) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (709) group_by_list ::= expr_or_subquery */ + -3, /* (710) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (711) having_clause_opt ::= */ + -2, /* (712) having_clause_opt ::= HAVING search_condition */ + 0, /* (713) range_opt ::= */ + -6, /* (714) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (716) every_opt ::= */ + -4, /* (717) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (718) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (719) query_simple ::= query_specification */ + -1, /* (720) query_simple ::= union_query_expression */ + -4, /* (721) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (722) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (723) query_simple_or_subquery ::= query_simple */ + -1, /* (724) query_simple_or_subquery ::= subquery */ + -1, /* (725) query_or_subquery ::= query_expression */ + -1, /* (726) query_or_subquery ::= subquery */ + 0, /* (727) order_by_clause_opt ::= */ + -3, /* (728) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (729) slimit_clause_opt ::= */ + -2, /* (730) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (733) limit_clause_opt ::= */ + -2, /* (734) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (737) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (738) subquery ::= NK_LP subquery NK_RP */ + -1, /* (739) search_condition ::= common_expression */ + -1, /* (740) sort_specification_list ::= sort_specification */ + -3, /* (741) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (742) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (743) ordering_specification_opt ::= */ + -1, /* (744) ordering_specification_opt ::= ASC */ + -1, /* (745) ordering_specification_opt ::= DESC */ + 0, /* (746) null_ordering_opt ::= */ + -2, /* (747) null_ordering_opt ::= NULLS FIRST */ + -2, /* (748) null_ordering_opt ::= NULLS LAST */ + 0, /* (749) column_options ::= */ + -3, /* (750) column_options ::= column_options PRIMARY KEY */ + -3, /* (751) column_options ::= column_options ENCODE NK_STRING */ + -3, /* (752) column_options ::= column_options COMPRESS NK_STRING */ + -3, /* (753) column_options ::= column_options LEVEL NK_STRING */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -5158,54 +5510,6 @@ static YYACTIONTYPE yy_reduce( (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; -#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 @@ -5220,11 +5524,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,378,&yymsp[0].minor); + yy_destructor(yypParser,379,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,379,&yymsp[0].minor); + yy_destructor(yypParser,380,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -5238,20 +5542,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); 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,378,&yymsp[-2].minor); +{ yy_destructor(yypParser,379,&yymsp[-2].minor); { } - yy_destructor(yypParser,380,&yymsp[0].minor); + yy_destructor(yypParser,381,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,381,&yymsp[0].minor); +{ yy_destructor(yypParser,382,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,379,&yymsp[-1].minor); +{ yy_destructor(yypParser,380,&yymsp[-1].minor); { } - yy_destructor(yypParser,381,&yymsp[0].minor); + yy_destructor(yypParser,382,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -5265,2053 +5569,2062 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,380,&yymsp[0].minor); + yy_destructor(yypParser,381,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy34 = yylhsminor.yy34; +{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy34 = yymsp[0].minor.yy34; } +{ yymsp[-1].minor.yy316 = yymsp[0].minor.yy316; } break; case 27: /* white_list_opt ::= */ - case 201: /* specific_cols_opt ::= */ yytestcase(yyruleno==201); - case 239: /* tags_def_opt ::= */ yytestcase(yyruleno==239); - case 329: /* tag_list_opt ::= */ yytestcase(yyruleno==329); - case 402: /* col_list_opt ::= */ yytestcase(yyruleno==402); - case 409: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==409); - case 672: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==672); - case 702: /* group_by_clause_opt ::= */ yytestcase(yyruleno==702); - case 722: /* order_by_clause_opt ::= */ yytestcase(yyruleno==722); -{ yymsp[1].minor.yy34 = NULL; } + case 205: /* specific_cols_opt ::= */ yytestcase(yyruleno==205); + case 243: /* tags_def_opt ::= */ yytestcase(yyruleno==243); + case 334: /* tag_list_opt ::= */ yytestcase(yyruleno==334); + case 407: /* col_list_opt ::= */ yytestcase(yyruleno==407); + case 414: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==414); + case 677: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==677); + case 707: /* group_by_clause_opt ::= */ yytestcase(yyruleno==707); + case 727: /* order_by_clause_opt ::= */ yytestcase(yyruleno==727); +{ yymsp[1].minor.yy316 = NULL; } break; case 28: /* white_list_opt ::= white_list */ - case 240: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==240); - case 410: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==410); - case 580: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==580); -{ yylhsminor.yy34 = yymsp[0].minor.yy34; } - yymsp[0].minor.yy34 = yylhsminor.yy34; + case 244: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==244); + case 415: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==415); + case 585: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==585); +{ yylhsminor.yy316 = yymsp[0].minor.yy316; } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + case 29: /* is_import_opt ::= */ + case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); +{ yymsp[1].minor.yy1043 = 0; } + break; + case 30: /* is_import_opt ::= IS_IMPORT NK_INTEGER */ + case 32: /* is_createdb_opt ::= CREATEDB NK_INTEGER */ yytestcase(yyruleno==32); + case 42: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ yytestcase(yyruleno==42); +{ yymsp[-1].minor.yy1043 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy479, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy323); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy34); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy1043, yymsp[-1].minor.yy1043, yymsp[-2].minor.yy1043); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy316); } break; - case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } + case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; - case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } + case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; - case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } + case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; - case 33: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } + case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } break; - case 34: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy34); } + case 38: /* cmd ::= ALTER USER user_name ADD white_list */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy316); } break; - case 35: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy34); } + case 39: /* cmd ::= ALTER USER user_name DROP white_list */ +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy316); } break; - case 36: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy479); } + case 40: /* cmd ::= DROP USER user_name */ +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 37: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy323 = 1; } + case 41: /* sysinfo_opt ::= */ +{ yymsp[1].minor.yy1043 = 1; } break; - case 38: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy323 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } + case 43: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } break; - case 39: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy579, &yymsp[-3].minor.yy687, &yymsp[0].minor.yy479, yymsp[-2].minor.yy452); } + case 44: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } break; - case 40: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy579, &yymsp[-3].minor.yy687, &yymsp[0].minor.yy479, yymsp[-2].minor.yy452); } + case 45: /* privileges ::= ALL */ +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALL; } break; - case 41: /* privileges ::= ALL */ -{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_ALL; } + case 46: /* privileges ::= priv_type_list */ + case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); +{ yylhsminor.yy1089 = yymsp[0].minor.yy1089; } + yymsp[0].minor.yy1089 = yylhsminor.yy1089; break; - case 42: /* privileges ::= priv_type_list */ - case 44: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==44); -{ yylhsminor.yy579 = yymsp[0].minor.yy579; } - yymsp[0].minor.yy579 = yylhsminor.yy579; + case 47: /* privileges ::= SUBSCRIBE */ +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_SUBSCRIBE; } break; - case 43: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_SUBSCRIBE; } + case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ +{ yylhsminor.yy1089 = yymsp[-2].minor.yy1089 | yymsp[0].minor.yy1089; } + yymsp[-2].minor.yy1089 = yylhsminor.yy1089; break; - case 45: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy579 = yymsp[-2].minor.yy579 | yymsp[0].minor.yy579; } - yymsp[-2].minor.yy579 = yylhsminor.yy579; + case 50: /* priv_type ::= READ */ +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_READ; } break; - case 46: /* priv_type ::= READ */ -{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_READ; } + case 51: /* priv_type ::= WRITE */ +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_WRITE; } break; - case 47: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_WRITE; } + case 52: /* priv_type ::= ALTER */ +{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALTER; } break; - case 48: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_ALTER; } + case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ +{ yylhsminor.yy849.first = yymsp[-2].minor.yy0; yylhsminor.yy849.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; - case 49: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy687.first = yymsp[-2].minor.yy0; yylhsminor.yy687.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy687 = yylhsminor.yy687; + case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ +{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; - case 50: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy687.first = yymsp[-2].minor.yy479; yylhsminor.yy687.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy687 = yylhsminor.yy687; + case 55: /* priv_level ::= db_name NK_DOT table_name */ +{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy1109; } + yymsp[-2].minor.yy849 = yylhsminor.yy849; break; - case 51: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy687.first = yymsp[-2].minor.yy479; yylhsminor.yy687.second = yymsp[0].minor.yy479; } - yymsp[-2].minor.yy687 = yylhsminor.yy687; + case 56: /* priv_level ::= topic_name */ +{ yylhsminor.yy849.first = yymsp[0].minor.yy1109; yylhsminor.yy849.second = nil_token; } + yymsp[0].minor.yy849 = yylhsminor.yy849; break; - case 52: /* priv_level ::= topic_name */ -{ yylhsminor.yy687.first = yymsp[0].minor.yy479; yylhsminor.yy687.second = nil_token; } - yymsp[0].minor.yy687 = yylhsminor.yy687; + case 57: /* with_opt ::= */ + case 173: /* start_opt ::= */ yytestcase(yyruleno==173); + case 177: /* end_opt ::= */ yytestcase(yyruleno==177); + case 329: /* like_pattern_opt ::= */ yytestcase(yyruleno==329); + case 426: /* subtable_opt ::= */ yytestcase(yyruleno==426); + case 595: /* case_when_else_opt ::= */ yytestcase(yyruleno==595); + case 625: /* from_clause_opt ::= */ yytestcase(yyruleno==625); + case 652: /* join_on_clause_opt ::= */ yytestcase(yyruleno==652); + case 654: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==654); + case 658: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==658); + case 675: /* where_clause_opt ::= */ yytestcase(yyruleno==675); + case 684: /* twindow_clause_opt ::= */ yytestcase(yyruleno==684); + case 692: /* sliding_opt ::= */ yytestcase(yyruleno==692); + case 697: /* fill_opt ::= */ yytestcase(yyruleno==697); + case 711: /* having_clause_opt ::= */ yytestcase(yyruleno==711); + case 713: /* range_opt ::= */ yytestcase(yyruleno==713); + case 716: /* every_opt ::= */ yytestcase(yyruleno==716); + case 729: /* slimit_clause_opt ::= */ yytestcase(yyruleno==729); + case 733: /* limit_clause_opt ::= */ yytestcase(yyruleno==733); +{ yymsp[1].minor.yy416 = NULL; } break; - case 53: /* with_opt ::= */ - case 169: /* start_opt ::= */ yytestcase(yyruleno==169); - case 173: /* end_opt ::= */ yytestcase(yyruleno==173); - case 324: /* like_pattern_opt ::= */ yytestcase(yyruleno==324); - case 421: /* subtable_opt ::= */ yytestcase(yyruleno==421); - case 590: /* case_when_else_opt ::= */ yytestcase(yyruleno==590); - case 620: /* from_clause_opt ::= */ yytestcase(yyruleno==620); - case 647: /* join_on_clause_opt ::= */ yytestcase(yyruleno==647); - case 649: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==649); - case 653: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==653); - case 670: /* where_clause_opt ::= */ yytestcase(yyruleno==670); - case 679: /* twindow_clause_opt ::= */ yytestcase(yyruleno==679); - case 687: /* sliding_opt ::= */ yytestcase(yyruleno==687); - case 692: /* fill_opt ::= */ yytestcase(yyruleno==692); - case 706: /* having_clause_opt ::= */ yytestcase(yyruleno==706); - case 708: /* range_opt ::= */ yytestcase(yyruleno==708); - case 711: /* every_opt ::= */ yytestcase(yyruleno==711); - case 724: /* slimit_clause_opt ::= */ yytestcase(yyruleno==724); - case 728: /* limit_clause_opt ::= */ yytestcase(yyruleno==728); -{ yymsp[1].minor.yy452 = NULL; } + case 58: /* with_opt ::= WITH search_condition */ + case 626: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==626); + case 653: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==653); + case 676: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==676); + case 712: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==712); +{ yymsp[-1].minor.yy416 = yymsp[0].minor.yy416; } break; - case 54: /* with_opt ::= WITH search_condition */ - case 621: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==621); - case 648: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==648); - case 671: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==671); - case 707: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==707); -{ yymsp[-1].minor.yy452 = yymsp[0].minor.yy452; } - break; - case 55: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ { pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 56: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy479, NULL); } + case 60: /* cmd ::= CREATE DNODE dnode_endpoint */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy1109, NULL); } break; - case 57: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0); } + case 61: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } break; - case 58: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy437, false); } + case 62: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy209, false); } break; - case 59: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy437, false); } + case 63: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy209, false); } break; - case 60: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy437); } + case 64: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy209); } break; - case 61: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy479, false, yymsp[0].minor.yy437); } + case 65: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, false, yymsp[0].minor.yy209); } break; - case 62: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + case 66: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } break; - case 63: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + case 67: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 64: /* cmd ::= ALTER ALL DNODES NK_STRING */ + case 68: /* cmd ::= ALTER ALL DNODES NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } break; - case 65: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + case 69: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 66: /* cmd ::= RESTORE DNODE NK_INTEGER */ + case 70: /* cmd ::= RESTORE DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } break; - case 67: /* dnode_endpoint ::= NK_STRING */ - case 68: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==68); - case 69: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==69); - case 358: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==358); - case 359: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==359); - case 360: /* sma_func_name ::= LAST */ yytestcase(yyruleno==360); - case 361: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==361); - case 509: /* db_name ::= NK_ID */ yytestcase(yyruleno==509); - case 510: /* table_name ::= NK_ID */ yytestcase(yyruleno==510); - case 511: /* column_name ::= NK_ID */ yytestcase(yyruleno==511); - case 512: /* function_name ::= NK_ID */ yytestcase(yyruleno==512); - case 513: /* view_name ::= NK_ID */ yytestcase(yyruleno==513); - case 514: /* table_alias ::= NK_ID */ yytestcase(yyruleno==514); - case 515: /* column_alias ::= NK_ID */ yytestcase(yyruleno==515); - case 516: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==516); - case 517: /* user_name ::= NK_ID */ yytestcase(yyruleno==517); - case 518: /* topic_name ::= NK_ID */ yytestcase(yyruleno==518); - case 519: /* stream_name ::= NK_ID */ yytestcase(yyruleno==519); - case 520: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==520); - case 521: /* index_name ::= NK_ID */ yytestcase(yyruleno==521); - case 522: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==522); - case 566: /* noarg_func ::= NOW */ yytestcase(yyruleno==566); - case 567: /* noarg_func ::= TODAY */ yytestcase(yyruleno==567); - case 568: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==568); - case 569: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==569); - case 570: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==570); - case 571: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==571); - case 572: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==572); - case 573: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==573); - case 574: /* noarg_func ::= USER */ yytestcase(yyruleno==574); - case 575: /* star_func ::= COUNT */ yytestcase(yyruleno==575); - case 576: /* star_func ::= FIRST */ yytestcase(yyruleno==576); - case 577: /* star_func ::= LAST */ yytestcase(yyruleno==577); - case 578: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==578); -{ yylhsminor.yy479 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy479 = yylhsminor.yy479; + case 71: /* dnode_endpoint ::= NK_STRING */ + case 72: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==72); + case 73: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==73); + case 363: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==363); + case 364: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==364); + case 365: /* sma_func_name ::= LAST */ yytestcase(yyruleno==365); + case 366: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==366); + case 514: /* db_name ::= NK_ID */ yytestcase(yyruleno==514); + case 515: /* table_name ::= NK_ID */ yytestcase(yyruleno==515); + case 516: /* column_name ::= NK_ID */ yytestcase(yyruleno==516); + case 517: /* function_name ::= NK_ID */ yytestcase(yyruleno==517); + case 518: /* view_name ::= NK_ID */ yytestcase(yyruleno==518); + case 519: /* table_alias ::= NK_ID */ yytestcase(yyruleno==519); + case 520: /* column_alias ::= NK_ID */ yytestcase(yyruleno==520); + case 521: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==521); + case 522: /* user_name ::= NK_ID */ yytestcase(yyruleno==522); + case 523: /* topic_name ::= NK_ID */ yytestcase(yyruleno==523); + case 524: /* stream_name ::= NK_ID */ yytestcase(yyruleno==524); + case 525: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==525); + case 526: /* index_name ::= NK_ID */ yytestcase(yyruleno==526); + case 527: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==527); + case 571: /* noarg_func ::= NOW */ yytestcase(yyruleno==571); + case 572: /* noarg_func ::= TODAY */ yytestcase(yyruleno==572); + case 573: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==573); + case 574: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==574); + case 575: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==575); + case 576: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==576); + case 577: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==577); + case 578: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==578); + case 579: /* noarg_func ::= USER */ yytestcase(yyruleno==579); + case 580: /* star_func ::= COUNT */ yytestcase(yyruleno==580); + case 581: /* star_func ::= FIRST */ yytestcase(yyruleno==581); + case 582: /* star_func ::= LAST */ yytestcase(yyruleno==582); + case 583: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==583); +{ yylhsminor.yy1109 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy1109 = yylhsminor.yy1109; break; - case 70: /* force_opt ::= */ - case 97: /* not_exists_opt ::= */ yytestcase(yyruleno==97); - case 99: /* exists_opt ::= */ yytestcase(yyruleno==99); - case 379: /* analyze_opt ::= */ yytestcase(yyruleno==379); - case 386: /* agg_func_opt ::= */ yytestcase(yyruleno==386); - case 392: /* or_replace_opt ::= */ yytestcase(yyruleno==392); - case 423: /* ignore_opt ::= */ yytestcase(yyruleno==423); - case 658: /* tag_mode_opt ::= */ yytestcase(yyruleno==658); - case 660: /* set_quantifier_opt ::= */ yytestcase(yyruleno==660); -{ yymsp[1].minor.yy437 = false; } + case 74: /* force_opt ::= */ + case 101: /* not_exists_opt ::= */ yytestcase(yyruleno==101); + case 103: /* exists_opt ::= */ yytestcase(yyruleno==103); + case 384: /* analyze_opt ::= */ yytestcase(yyruleno==384); + case 391: /* agg_func_opt ::= */ yytestcase(yyruleno==391); + case 397: /* or_replace_opt ::= */ yytestcase(yyruleno==397); + case 428: /* ignore_opt ::= */ yytestcase(yyruleno==428); + case 663: /* tag_mode_opt ::= */ yytestcase(yyruleno==663); + case 665: /* set_quantifier_opt ::= */ yytestcase(yyruleno==665); +{ yymsp[1].minor.yy209 = false; } break; - case 71: /* force_opt ::= FORCE */ - case 72: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==72); - case 380: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==380); - case 387: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==387); - case 659: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==659); - case 661: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==661); -{ yymsp[0].minor.yy437 = true; } + case 75: /* force_opt ::= FORCE */ + case 76: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==76); + case 385: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==385); + case 392: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==392); + case 664: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==664); + case 666: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==666); +{ yymsp[0].minor.yy209 = true; } break; - case 73: /* cmd ::= ALTER CLUSTER NK_STRING */ + case 77: /* cmd ::= ALTER CLUSTER NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 74: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + case 78: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 75: /* cmd ::= ALTER LOCAL NK_STRING */ + case 79: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 76: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + case 80: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 77: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + case 81: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 78: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + case 82: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 79: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + case 83: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } break; - case 80: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + case 84: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 81: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + case 85: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } break; - case 82: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + case 86: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 83: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + case 87: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } break; - case 84: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + case 88: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 85: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + case 89: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 86: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + case 90: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } break; - case 87: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + case 91: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; - case 88: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy437, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); } + case 92: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy209, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } break; - case 89: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 93: /* cmd ::= DROP DATABASE exists_opt db_name */ +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 90: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy479); } + case 94: /* cmd ::= USE db_name */ +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 91: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); } + case 95: /* cmd ::= ALTER DATABASE db_name alter_db_options */ +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } break; - case 92: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy479); } + case 96: /* cmd ::= FLUSH DATABASE db_name */ +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 93: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy100); } + case 97: /* cmd ::= TRIM DATABASE db_name speed_opt */ +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy820); } break; - case 94: /* cmd ::= S3MIGRATE DATABASE db_name */ -{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy479); } + case 98: /* cmd ::= S3MIGRATE DATABASE db_name */ +{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 95: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 99: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 96: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy437 = true; } + case 100: /* not_exists_opt ::= IF NOT EXISTS */ +{ yymsp[-2].minor.yy209 = true; } break; - case 98: /* exists_opt ::= IF EXISTS */ - case 393: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==393); - case 424: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==424); -{ yymsp[-1].minor.yy437 = true; } + case 102: /* exists_opt ::= IF EXISTS */ + case 398: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==398); + case 429: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==429); +{ yymsp[-1].minor.yy209 = true; } break; - case 100: /* db_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultDatabaseOptions(pCxt); } + case 104: /* db_options ::= */ +{ yymsp[1].minor.yy416 = createDefaultDatabaseOptions(pCxt); } break; - case 101: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 105: /* db_options ::= db_options BUFFER NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 102: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 106: /* db_options ::= db_options CACHEMODEL NK_STRING */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 103: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 107: /* db_options ::= db_options CACHESIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 104: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 108: /* db_options ::= db_options COMP NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 105: /* db_options ::= db_options DURATION NK_INTEGER */ - case 106: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==106); -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 109: /* db_options ::= db_options DURATION NK_INTEGER */ + case 110: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==110); +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 107: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 111: /* db_options ::= db_options MAXROWS NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 108: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 112: /* db_options ::= db_options MINROWS NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 109: /* db_options ::= db_options KEEP integer_list */ - case 110: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==110); -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP, yymsp[0].minor.yy34); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 113: /* db_options ::= db_options KEEP integer_list */ + case 114: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==114); +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP, yymsp[0].minor.yy316); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 111: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 115: /* db_options ::= db_options PAGES NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 112: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 116: /* db_options ::= db_options PAGESIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 113: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 117: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 114: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 118: /* db_options ::= db_options PRECISION NK_STRING */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 115: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 119: /* db_options ::= db_options REPLICA NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 116: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 120: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 117: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 121: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 118: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_RETENTIONS, yymsp[0].minor.yy34); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 122: /* db_options ::= db_options RETENTIONS retention_list */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_RETENTIONS, yymsp[0].minor.yy316); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 119: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 123: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 120: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 124: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 121: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 125: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 122: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 126: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 123: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 127: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 124: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 128: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 125: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 129: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 126: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 130: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 127: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 131: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 128: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 132: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 129: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 133: /* db_options ::= db_options TABLE_PREFIX signed */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy416); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 130: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 134: /* db_options ::= db_options TABLE_SUFFIX signed */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy416); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 131: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 135: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 132: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - case 133: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==133); -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 136: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + case 137: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==137); +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 134: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 138: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 135: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 139: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 136: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ -{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 140: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ +{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 137: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy452 = createAlterDatabaseOptions(pCxt); yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yylhsminor.yy452, &yymsp[0].minor.yy455); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 141: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy416 = createAlterDatabaseOptions(pCxt); yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yylhsminor.yy416, &yymsp[0].minor.yy101); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 138: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy452, &yymsp[0].minor.yy455); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 142: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy416, &yymsp[0].minor.yy101); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 139: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 143: /* alter_db_option ::= BUFFER NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 140: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 144: /* alter_db_option ::= CACHEMODEL NK_STRING */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 141: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 145: /* alter_db_option ::= CACHESIZE NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 142: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 146: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 143: /* alter_db_option ::= KEEP integer_list */ - case 144: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==144); -{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP; yymsp[-1].minor.yy455.pList = yymsp[0].minor.yy34; } + case 147: /* alter_db_option ::= KEEP integer_list */ + case 148: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==148); +{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP; yymsp[-1].minor.yy101.pList = yymsp[0].minor.yy316; } break; - case 145: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_PAGES; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 149: /* alter_db_option ::= PAGES NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_PAGES; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 146: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 150: /* alter_db_option ::= REPLICA NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 147: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 151: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 148: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 152: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 149: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 153: /* alter_db_option ::= MINROWS NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 150: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 154: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 151: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 155: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { 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.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy455.val = t; + yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy101.val = t; } break; - case 152: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 156: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 153: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 157: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { 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.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy455.val = t; + yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy101.val = t; } break; - case 154: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - case 155: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==155); -{ yymsp[-1].minor.yy455.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } - break; - case 156: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } - break; - case 157: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } - break; - case 158: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ -{ yymsp[-1].minor.yy455.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } - break; - case 159: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy34 = yylhsminor.yy34; - break; - case 160: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 438: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==438); -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; - break; - case 161: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy34 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy34 = yylhsminor.yy34; - break; - case 162: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; - break; - case 163: /* retention_list ::= retention */ - case 195: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==195); - case 198: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==198); - case 205: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==205); - case 208: /* column_def_list ::= column_def */ yytestcase(yyruleno==208); - case 256: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==256); - case 261: /* col_name_list ::= col_name */ yytestcase(yyruleno==261); - case 330: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==330); - case 354: /* func_list ::= func */ yytestcase(yyruleno==354); - case 404: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==404); - case 482: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==482); - case 507: /* literal_list ::= signed_literal */ yytestcase(yyruleno==507); - case 581: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==581); - case 587: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==587); - case 663: /* select_list ::= select_item */ yytestcase(yyruleno==663); - case 674: /* partition_list ::= partition_item */ yytestcase(yyruleno==674); - case 735: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==735); -{ yylhsminor.yy34 = createNodeList(pCxt, yymsp[0].minor.yy452); } - yymsp[0].minor.yy34 = yylhsminor.yy34; - break; - case 164: /* retention_list ::= retention_list NK_COMMA retention */ - case 199: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==199); - case 206: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==206); - case 209: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==209); - case 257: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==257); - case 262: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==262); - case 331: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==331); - case 355: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==355); - case 405: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==405); - case 483: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==483); - case 508: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==508); - case 582: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==582); - case 664: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==664); - case 675: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==675); - case 736: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==736); -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; - break; - case 165: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - case 166: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==166); -{ yylhsminor.yy452 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; - break; - case 167: /* speed_opt ::= */ - case 388: /* bufsize_opt ::= */ yytestcase(yyruleno==388); -{ yymsp[1].minor.yy100 = 0; } - break; - case 168: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 389: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==389); -{ yymsp[-1].minor.yy100 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 170: /* start_opt ::= START WITH NK_INTEGER */ - case 174: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==174); -{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } - break; - case 171: /* start_opt ::= START WITH NK_STRING */ - case 175: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==175); -{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 172: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ - case 176: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==176); -{ yymsp[-3].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } - break; - case 177: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 179: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==179); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy437, yymsp[-5].minor.yy452, yymsp[-3].minor.yy34, yymsp[-1].minor.yy34, yymsp[0].minor.yy452); } - break; - case 178: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy34); } - break; - case 180: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy34); } - break; - case 181: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); } - break; - case 182: /* cmd ::= ALTER TABLE alter_table_clause */ - case 440: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==440); - case 441: /* cmd ::= insert_query */ yytestcase(yyruleno==441); -{ pCxt->pRootNode = yymsp[0].minor.yy452; } - break; - case 183: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy452); } - break; - case 184: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy452 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; - break; - case 185: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ -{ yylhsminor.yy452 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy452, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy874, yymsp[0].minor.yy452); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; - break; - case 186: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy479); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; - break; - case 187: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; - break; - case 188: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ -{ yylhsminor.yy452 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; - break; - case 189: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; - break; - case 190: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; - break; - case 191: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy479); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 158: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + case 159: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==159); +{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } + break; + case 160: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } + break; + case 161: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } + break; + case 162: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ +{ yymsp[-1].minor.yy101.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } + break; + case 163: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy316 = yylhsminor.yy316; + break; + case 164: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 443: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==443); +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; + break; + case 165: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy316 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy316 = yylhsminor.yy316; + break; + case 166: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; + break; + case 167: /* retention_list ::= retention */ + case 199: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==199); + case 202: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==202); + case 209: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==209); + case 212: /* column_def_list ::= column_def */ yytestcase(yyruleno==212); + case 260: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==260); + case 265: /* col_name_list ::= col_name */ yytestcase(yyruleno==265); + case 335: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==335); + case 359: /* func_list ::= func */ yytestcase(yyruleno==359); + case 409: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==409); + case 487: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==487); + case 512: /* literal_list ::= signed_literal */ yytestcase(yyruleno==512); + case 586: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==586); + case 592: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==592); + case 668: /* select_list ::= select_item */ yytestcase(yyruleno==668); + case 679: /* partition_list ::= partition_item */ yytestcase(yyruleno==679); + case 740: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==740); +{ yylhsminor.yy316 = createNodeList(pCxt, yymsp[0].minor.yy416); } + yymsp[0].minor.yy316 = yylhsminor.yy316; + break; + case 168: /* retention_list ::= retention_list NK_COMMA retention */ + case 203: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==203); + case 210: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==210); + case 213: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==213); + case 261: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==261); + case 266: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==266); + case 336: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==336); + case 360: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==360); + case 410: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==410); + case 488: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==488); + case 513: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==513); + case 587: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==587); + case 669: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==669); + case 680: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==680); + case 741: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==741); +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; + break; + case 169: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 170: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==170); +{ yylhsminor.yy416 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; + break; + case 171: /* speed_opt ::= */ + case 393: /* bufsize_opt ::= */ yytestcase(yyruleno==393); +{ yymsp[1].minor.yy820 = 0; } + break; + case 172: /* speed_opt ::= BWLIMIT NK_INTEGER */ + case 394: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==394); +{ yymsp[-1].minor.yy820 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 174: /* start_opt ::= START WITH NK_INTEGER */ + case 178: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==178); +{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 175: /* start_opt ::= START WITH NK_STRING */ + case 179: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==179); +{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 176: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ + case 180: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==180); +{ yymsp[-3].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 181: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 183: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==183); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy316, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } + break; + case 182: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy316); } + break; + case 184: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy316); } + break; + case 185: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } + break; + case 186: /* cmd ::= ALTER TABLE alter_table_clause */ + case 445: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==445); + case 446: /* cmd ::= insert_query */ yytestcase(yyruleno==446); +{ pCxt->pRootNode = yymsp[0].minor.yy416; } + break; + case 187: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy416); } + break; + case 188: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy416 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; + break; + case 189: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ +{ yylhsminor.yy416 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy416, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } + yymsp[-5].minor.yy416 = yylhsminor.yy416; + break; + case 190: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy1109); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; + break; + case 191: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; + break; + case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ +{ yylhsminor.yy416 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; + break; + case 193: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; + break; + case 194: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; + break; + case 195: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy1109); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 192: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + case 196: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 193: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + case 197: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 194: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy452 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy452, &yymsp[-2].minor.yy479, yymsp[0].minor.yy452); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; + case 198: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ +{ yylhsminor.yy416 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy416, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 196: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 588: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==588); -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-1].minor.yy34, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy34 = yylhsminor.yy34; + case 200: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 593: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==593); +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } + yymsp[-1].minor.yy316 = yylhsminor.yy316; break; - case 197: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -{ yylhsminor.yy452 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy437, yymsp[-8].minor.yy452, yymsp[-6].minor.yy452, yymsp[-5].minor.yy34, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); } - yymsp[-9].minor.yy452 = yylhsminor.yy452; + case 201: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ +{ yylhsminor.yy416 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy209, yymsp[-8].minor.yy416, yymsp[-6].minor.yy416, yymsp[-5].minor.yy316, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } + yymsp[-9].minor.yy416 = yylhsminor.yy416; break; - case 200: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy452 = createDropTableClause(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 204: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy416 = createDropTableClause(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 202: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 403: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==403); -{ yymsp[-2].minor.yy34 = yymsp[-1].minor.yy34; } + case 206: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 408: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==408); +{ yymsp[-2].minor.yy316 = yymsp[-1].minor.yy316; } break; - case 203: /* full_table_name ::= table_name */ - case 344: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==344); -{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy479, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 207: /* full_table_name ::= table_name */ + case 349: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==349); +{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy1109, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 204: /* full_table_name ::= db_name NK_DOT table_name */ - case 345: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==345); -{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 208: /* full_table_name ::= db_name NK_DOT table_name */ + case 350: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==350); +{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, NULL); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 207: /* tag_def ::= column_name type_name */ -{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874, NULL); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 211: /* tag_def ::= column_name type_name */ +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952, NULL); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 210: /* column_def ::= column_name type_name column_options */ -{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy874, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 214: /* column_def ::= column_name type_name column_options */ +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 211: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 215: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 212: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 216: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 213: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 217: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 214: /* type_name ::= INT */ - case 215: /* type_name ::= INTEGER */ yytestcase(yyruleno==215); -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_INT); } + case 218: /* type_name ::= INT */ + case 219: /* type_name ::= INTEGER */ yytestcase(yyruleno==219); +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 216: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 220: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 217: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 221: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 218: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 222: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 219: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 223: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 220: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 224: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 221: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 225: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 222: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 226: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 223: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 227: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 224: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UINT); } + case 228: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 225: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 229: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 226: /* type_name ::= JSON */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_JSON); } + case 230: /* type_name ::= JSON */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 227: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 231: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 228: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 232: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 229: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 233: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 230: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 234: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 231: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } + case 235: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } break; - case 232: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 236: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 233: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 237: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 234: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 238: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 235: /* type_name_default_len ::= BINARY */ -{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } + case 239: /* type_name_default_len ::= BINARY */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } break; - case 236: /* type_name_default_len ::= NCHAR */ -{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } + case 240: /* type_name_default_len ::= NCHAR */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } break; - case 237: /* type_name_default_len ::= VARCHAR */ -{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } + case 241: /* type_name_default_len ::= VARCHAR */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } break; - case 238: /* type_name_default_len ::= VARBINARY */ -{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } + case 242: /* type_name_default_len ::= VARBINARY */ +{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } break; - case 241: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - case 411: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==411); -{ yymsp[-3].minor.yy34 = yymsp[-1].minor.yy34; } + case 245: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + case 416: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==416); +{ yymsp[-3].minor.yy316 = yymsp[-1].minor.yy316; } break; - case 242: /* table_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultTableOptions(pCxt); } + case 246: /* table_options ::= */ +{ yymsp[1].minor.yy416 = createDefaultTableOptions(pCxt); } break; - case 243: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 247: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 244: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy34); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 248: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy316); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 245: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy34); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 249: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy316); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 246: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy34); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + case 250: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy316); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 247: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 251: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 248: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_SMA, yymsp[-1].minor.yy34); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + case 252: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_SMA, yymsp[-1].minor.yy316); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 249: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy34); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 253: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy316); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 250: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy452 = createAlterTableOptions(pCxt); yylhsminor.yy452 = setTableOption(pCxt, yylhsminor.yy452, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 254: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy416 = createAlterTableOptions(pCxt); yylhsminor.yy416 = setTableOption(pCxt, yylhsminor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 251: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 255: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 252: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy455.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 256: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy101.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 253: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy455.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; } + case 257: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy101.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } break; - case 254: /* duration_list ::= duration_literal */ - case 540: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==540); -{ yylhsminor.yy34 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[0].minor.yy34 = yylhsminor.yy34; + case 258: /* duration_list ::= duration_literal */ + case 545: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==545); +{ yylhsminor.yy316 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 255: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 541: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==541); -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; + case 259: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 546: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==546); +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; - case 258: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy479, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 262: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy1109, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 259: /* rollup_func_name ::= FIRST */ - case 260: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==260); - case 333: /* tag_item ::= QTAGS */ yytestcase(yyruleno==333); -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 263: /* rollup_func_name ::= FIRST */ + case 264: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==264); + case 338: /* tag_item ::= QTAGS */ yytestcase(yyruleno==338); +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 263: /* col_name ::= column_name */ - case 334: /* tag_item ::= column_name */ yytestcase(yyruleno==334); -{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy479); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 267: /* col_name ::= column_name */ + case 339: /* tag_item ::= column_name */ yytestcase(yyruleno==339); +{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 264: /* cmd ::= SHOW DNODES */ + case 268: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 265: /* cmd ::= SHOW USERS */ + case 269: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 266: /* cmd ::= SHOW USER PRIVILEGES */ + case 270: /* cmd ::= SHOW USERS FULL */ +{ pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } + break; + case 271: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 267: /* cmd ::= SHOW db_kind_opt DATABASES */ + case 272: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy39); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy681); } break; - case 268: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + case 273: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy397, yymsp[0].minor.yy452, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy925, yymsp[0].minor.yy416, OP_TYPE_LIKE); } break; - case 269: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, OP_TYPE_LIKE); } + case 274: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } break; - case 270: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy452, NULL, OP_TYPE_LIKE); } + case 275: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy416, NULL, OP_TYPE_LIKE); } break; - case 271: /* cmd ::= SHOW MNODES */ + case 276: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 272: /* cmd ::= SHOW QNODES */ + case 277: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 273: /* cmd ::= SHOW ARBGROUPS */ + case 278: /* cmd ::= SHOW ARBGROUPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } break; - case 274: /* cmd ::= SHOW FUNCTIONS */ + case 279: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 275: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); } + case 280: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } break; - case 276: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), OP_TYPE_EQUAL); } + case 281: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } break; - case 277: /* cmd ::= SHOW STREAMS */ + case 282: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 278: /* cmd ::= SHOW ACCOUNTS */ + case 283: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 279: /* cmd ::= SHOW APPS */ + case 284: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 280: /* cmd ::= SHOW CONNECTIONS */ + case 285: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 281: /* cmd ::= SHOW LICENCES */ - case 282: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==282); + case 286: /* cmd ::= SHOW LICENCES */ + case 287: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==287); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 283: /* cmd ::= SHOW GRANTS FULL */ + case 288: /* cmd ::= SHOW GRANTS FULL */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } break; - case 284: /* cmd ::= SHOW GRANTS LOGS */ + case 289: /* cmd ::= SHOW GRANTS LOGS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } break; - case 285: /* cmd ::= SHOW CLUSTER MACHINES */ + case 290: /* cmd ::= SHOW CLUSTER MACHINES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } break; - case 286: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy479); } + case 291: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 287: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy452); } + case 292: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy416); } break; - case 288: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 293: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, -yymsp[0].minor.yy452); } +yymsp[0].minor.yy416); } break; - case 289: /* cmd ::= SHOW ENCRYPTIONS */ + case 294: /* cmd ::= SHOW ENCRYPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } break; - case 290: /* cmd ::= SHOW QUERIES */ + case 295: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 291: /* cmd ::= SHOW SCORES */ + case 296: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 292: /* cmd ::= SHOW TOPICS */ + case 297: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 293: /* cmd ::= SHOW VARIABLES */ - case 294: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==294); + case 298: /* cmd ::= SHOW VARIABLES */ + case 299: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==299); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 295: /* cmd ::= SHOW LOCAL VARIABLES */ + case 300: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 296: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy452); } + case 301: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy416); } break; - case 297: /* cmd ::= SHOW BNODES */ + case 302: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 298: /* cmd ::= SHOW SNODES */ + case 303: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 299: /* cmd ::= SHOW CLUSTER */ + case 304: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 300: /* cmd ::= SHOW TRANSACTIONS */ + case 305: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 301: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy452); } + case 306: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy416); } break; - case 302: /* cmd ::= SHOW CONSUMERS */ + case 307: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 303: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 308: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 304: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); } + case 309: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } break; - case 305: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), OP_TYPE_EQUAL); } + case 310: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } break; - case 306: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452, yymsp[-3].minor.yy34); } + case 311: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416, yymsp[-3].minor.yy316); } break; - case 307: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), yymsp[-4].minor.yy34); } + case 312: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), yymsp[-4].minor.yy316); } break; - case 308: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 313: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 309: /* cmd ::= SHOW VNODES */ + case 314: /* cmd ::= SHOW VNODES */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; - case 310: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy452, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 315: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy416, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 311: /* cmd ::= SHOW CLUSTER ALIVE */ + case 316: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 312: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, OP_TYPE_LIKE); } + case 317: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } break; - case 313: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy452); } + case 318: /* cmd ::= SHOW CREATE VIEW full_table_name */ +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy416); } break; - case 314: /* cmd ::= SHOW COMPACTS */ + case 319: /* cmd ::= SHOW COMPACTS */ { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } break; - case 315: /* cmd ::= SHOW COMPACT NK_INTEGER */ + case 320: /* cmd ::= SHOW COMPACT NK_INTEGER */ { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 316: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy397.kind = SHOW_KIND_ALL; yymsp[1].minor.yy397.dbName = nil_token; } + case 321: /* table_kind_db_name_cond_opt ::= */ +{ yymsp[1].minor.yy925.kind = SHOW_KIND_ALL; yymsp[1].minor.yy925.dbName = nil_token; } break; - case 317: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy397.kind = yymsp[0].minor.yy39; yylhsminor.yy397.dbName = nil_token; } - yymsp[0].minor.yy397 = yylhsminor.yy397; + case 322: /* table_kind_db_name_cond_opt ::= table_kind */ +{ yylhsminor.yy925.kind = yymsp[0].minor.yy681; yylhsminor.yy925.dbName = nil_token; } + yymsp[0].minor.yy925 = yylhsminor.yy925; break; - case 318: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy397.kind = SHOW_KIND_ALL; yylhsminor.yy397.dbName = yymsp[-1].minor.yy479; } - yymsp[-1].minor.yy397 = yylhsminor.yy397; + case 323: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy925.kind = SHOW_KIND_ALL; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } + yymsp[-1].minor.yy925 = yylhsminor.yy925; break; - case 319: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy397.kind = yymsp[-2].minor.yy39; yylhsminor.yy397.dbName = yymsp[-1].minor.yy479; } - yymsp[-2].minor.yy397 = yylhsminor.yy397; + case 324: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +{ yylhsminor.yy925.kind = yymsp[-2].minor.yy681; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } + yymsp[-2].minor.yy925 = yylhsminor.yy925; break; - case 320: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy39 = SHOW_KIND_TABLES_NORMAL; } + case 325: /* table_kind ::= NORMAL */ +{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_NORMAL; } break; - case 321: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy39 = SHOW_KIND_TABLES_CHILD; } + case 326: /* table_kind ::= CHILD */ +{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_CHILD; } break; - case 322: /* db_name_cond_opt ::= */ - case 327: /* from_db_opt ::= */ yytestcase(yyruleno==327); -{ yymsp[1].minor.yy452 = createDefaultDatabaseCondValue(pCxt); } + case 327: /* db_name_cond_opt ::= */ + case 332: /* from_db_opt ::= */ yytestcase(yyruleno==332); +{ yymsp[1].minor.yy416 = createDefaultDatabaseCondValue(pCxt); } break; - case 323: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy479); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 328: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy1109); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 325: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 330: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 326: /* table_name_cond ::= table_name */ -{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 331: /* table_name_cond ::= table_name */ +{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 328: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479); } + case 333: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } break; - case 332: /* tag_item ::= TBNAME */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 337: /* tag_item ::= TBNAME */ +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 335: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy479), &yymsp[0].minor.yy479); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 340: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy1109), &yymsp[0].minor.yy1109); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 336: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy479), &yymsp[0].minor.yy479); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 341: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy1109), &yymsp[0].minor.yy1109); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 337: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy39 = SHOW_KIND_ALL; } + case 342: /* db_kind_opt ::= */ +{ yymsp[1].minor.yy681 = SHOW_KIND_ALL; } break; - case 338: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy39 = SHOW_KIND_DATABASES_USER; } + case 343: /* db_kind_opt ::= USER */ +{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_USER; } break; - case 339: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy39 = SHOW_KIND_DATABASES_SYSTEM; } + case 344: /* db_kind_opt ::= SYSTEM */ +{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_SYSTEM; } break; - case 340: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy437, &yymsp[-7].minor.yy479, yymsp[-4].minor.yy452, yymsp[-5].minor.yy452, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 345: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy209, &yymsp[-7].minor.yy1109, yymsp[-4].minor.yy416, yymsp[-5].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 341: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy437, &yymsp[-6].minor.yy479, NULL, yymsp[-4].minor.yy452, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 346: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ +{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy209, &yymsp[-6].minor.yy1109, NULL, yymsp[-4].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 342: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ -{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); } + case 347: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ +{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } break; - case 343: /* cmd ::= SHOW db_name_cond_opt TSMAS */ -{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy452); } + case 348: /* cmd ::= SHOW db_name_cond_opt TSMAS */ +{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy416); } break; - case 346: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ -{ yymsp[-3].minor.yy452 = createTSMAOptions(pCxt, yymsp[-1].minor.yy34); } + case 351: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ +{ yymsp[-3].minor.yy416 = createTSMAOptions(pCxt, yymsp[-1].minor.yy316); } break; - case 347: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy437, yymsp[-3].minor.yy452, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); } + case 352: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy209, yymsp[-3].minor.yy416, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } break; - case 348: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy437, yymsp[-5].minor.yy452, yymsp[-3].minor.yy452, yymsp[-1].minor.yy34, NULL); } + case 353: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy416, yymsp[-1].minor.yy316, NULL); } break; - case 349: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); } + case 354: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } break; - case 350: /* full_index_name ::= index_name */ -{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy479); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 355: /* full_index_name ::= index_name */ +{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy1109); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 351: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 356: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 352: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy452 = createIndexOption(pCxt, yymsp[-7].minor.yy34, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 357: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy416 = createIndexOption(pCxt, yymsp[-7].minor.yy316, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 353: /* 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 */ -{ yymsp[-11].minor.yy452 = createIndexOption(pCxt, yymsp[-9].minor.yy34, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 358: /* 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 */ +{ yymsp[-11].minor.yy416 = createIndexOption(pCxt, yymsp[-9].minor.yy316, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 356: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[-3].minor.yy479, yymsp[-1].minor.yy34); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 361: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 357: /* sma_func_name ::= function_name */ - case 631: /* alias_opt ::= table_alias */ yytestcase(yyruleno==631); -{ yylhsminor.yy479 = yymsp[0].minor.yy479; } - yymsp[0].minor.yy479 = yylhsminor.yy479; + case 362: /* sma_func_name ::= function_name */ + case 636: /* alias_opt ::= table_alias */ yytestcase(yyruleno==636); +{ yylhsminor.yy1109 = yymsp[0].minor.yy1109; } + yymsp[0].minor.yy1109 = yylhsminor.yy1109; break; - case 362: /* sma_stream_opt ::= */ - case 412: /* stream_options ::= */ yytestcase(yyruleno==412); -{ yymsp[1].minor.yy452 = createStreamOptions(pCxt); } + case 367: /* sma_stream_opt ::= */ + case 417: /* stream_options ::= */ yytestcase(yyruleno==417); +{ yymsp[1].minor.yy416 = createStreamOptions(pCxt); } break; - case 363: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 368: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 364: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 369: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 365: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 370: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 366: /* with_meta ::= AS */ -{ yymsp[0].minor.yy100 = 0; } + case 371: /* with_meta ::= AS */ +{ yymsp[0].minor.yy820 = 0; } break; - case 367: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy100 = 1; } + case 372: /* with_meta ::= WITH META AS */ +{ yymsp[-2].minor.yy820 = 1; } break; - case 368: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy100 = 2; } + case 373: /* with_meta ::= ONLY META AS */ +{ yymsp[-2].minor.yy820 = 2; } break; - case 369: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy437, &yymsp[-2].minor.yy479, yymsp[0].minor.yy452); } + case 374: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } break; - case 370: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy437, &yymsp[-3].minor.yy479, &yymsp[0].minor.yy479, yymsp[-2].minor.yy100); } + case 375: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy209, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy820); } break; - case 371: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy437, &yymsp[-4].minor.yy479, yymsp[-1].minor.yy452, yymsp[-3].minor.yy100, yymsp[0].minor.yy452); } + case 376: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy209, &yymsp[-4].minor.yy1109, yymsp[-1].minor.yy416, yymsp[-3].minor.yy820, yymsp[0].minor.yy416); } break; - case 372: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 377: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 373: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy437, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); } + case 378: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } break; - case 374: /* cmd ::= DESC full_table_name */ - case 375: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==375); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy452); } + case 379: /* cmd ::= DESC full_table_name */ + case 380: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==380); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy416); } break; - case 376: /* cmd ::= RESET QUERY CACHE */ + case 381: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 377: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 378: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==378); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy437, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 382: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 383: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==383); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 381: /* explain_options ::= */ -{ yymsp[1].minor.yy452 = createDefaultExplainOptions(pCxt); } + case 386: /* explain_options ::= */ +{ yymsp[1].minor.yy416 = createDefaultExplainOptions(pCxt); } break; - case 382: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy452 = setExplainVerbose(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 387: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy416 = setExplainVerbose(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 383: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy452 = setExplainRatio(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 388: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy416 = setExplainRatio(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 384: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy437, yymsp[-9].minor.yy437, &yymsp[-6].minor.yy479, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy874, yymsp[-1].minor.yy100, &yymsp[0].minor.yy479, yymsp[-10].minor.yy437); } + case 389: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy209, yymsp[-9].minor.yy209, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy952, yymsp[-1].minor.yy820, &yymsp[0].minor.yy1109, yymsp[-10].minor.yy209); } break; - case 385: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 390: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 390: /* language_opt ::= */ - case 435: /* on_vgroup_id ::= */ yytestcase(yyruleno==435); -{ yymsp[1].minor.yy479 = nil_token; } + case 395: /* language_opt ::= */ + case 440: /* on_vgroup_id ::= */ yytestcase(yyruleno==440); +{ yymsp[1].minor.yy1109 = nil_token; } break; - case 391: /* language_opt ::= LANGUAGE NK_STRING */ - case 436: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==436); -{ yymsp[-1].minor.yy479 = yymsp[0].minor.yy0; } + case 396: /* language_opt ::= LANGUAGE NK_STRING */ + case 441: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==441); +{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy0; } break; - case 394: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy437, yymsp[-2].minor.yy452, &yymsp[-1].minor.yy0, yymsp[0].minor.yy452); } + case 399: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy209, yymsp[-2].minor.yy416, &yymsp[-1].minor.yy0, yymsp[0].minor.yy416); } break; - case 395: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); } + case 400: /* cmd ::= DROP VIEW exists_opt full_view_name */ +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } break; - case 396: /* full_view_name ::= view_name */ -{ yylhsminor.yy452 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy479); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 401: /* full_view_name ::= view_name */ +{ yylhsminor.yy416 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy1109); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 397: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy452 = createViewNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 402: /* full_view_name ::= db_name NK_DOT view_name */ +{ yylhsminor.yy416 = createViewNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 398: /* 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 */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy437, &yymsp[-8].minor.yy479, yymsp[-5].minor.yy452, yymsp[-7].minor.yy452, yymsp[-3].minor.yy34, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, yymsp[-4].minor.yy34); } + case 403: /* 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 */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy209, &yymsp[-8].minor.yy1109, yymsp[-5].minor.yy416, yymsp[-7].minor.yy416, yymsp[-3].minor.yy316, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, yymsp[-4].minor.yy316); } break; - case 399: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 404: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 400: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 405: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 401: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy437, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); } + case 406: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } break; - case 406: /* column_stream_def ::= column_name stream_col_options */ -{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy479, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy452); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 411: /* column_stream_def ::= column_name stream_col_options */ +{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy416); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 407: /* stream_col_options ::= */ - case 744: /* column_options ::= */ yytestcase(yyruleno==744); -{ yymsp[1].minor.yy452 = createDefaultColumnOptions(pCxt); } + case 412: /* stream_col_options ::= */ + case 749: /* column_options ::= */ yytestcase(yyruleno==749); +{ yymsp[1].minor.yy416 = createDefaultColumnOptions(pCxt); } break; - case 408: /* stream_col_options ::= stream_col_options PRIMARY KEY */ - case 745: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==745); -{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_PRIMARYKEY, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 413: /* stream_col_options ::= stream_col_options PRIMARY KEY */ + case 750: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==750); +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_PRIMARYKEY, NULL); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 413: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 414: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==414); -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 418: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 419: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==419); +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 415: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 420: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 416: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 421: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 417: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 422: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 418: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 423: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 419: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 424: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 420: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 425: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 422: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 688: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==688); - case 712: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==712); -{ yymsp[-3].minor.yy452 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy452); } + case 427: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 693: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==693); + case 717: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==717); +{ yymsp[-3].minor.yy416 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy416); } break; - case 425: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 430: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 426: /* cmd ::= KILL QUERY NK_STRING */ + case 431: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 427: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 432: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 428: /* cmd ::= KILL COMPACT NK_INTEGER */ + case 433: /* cmd ::= KILL COMPACT NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } break; - case 429: /* cmd ::= BALANCE VGROUP */ + case 434: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 430: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy479); } + case 435: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 431: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ -{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy479); } + case 436: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ +{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy1109); } break; - case 432: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 437: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 433: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy34); } + case 438: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy316); } break; - case 434: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 439: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 437: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 442: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 439: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 444: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 442: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy452 = createInsertStmt(pCxt, yymsp[-4].minor.yy452, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); } + case 447: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy416 = createInsertStmt(pCxt, yymsp[-4].minor.yy416, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } break; - case 443: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy452 = createInsertStmt(pCxt, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); } + case 448: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy416 = createInsertStmt(pCxt, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } break; - case 444: /* tags_literal ::= NK_INTEGER */ - case 456: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==456); - case 465: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==465); -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 449: /* tags_literal ::= NK_INTEGER */ + case 461: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==461); + case 470: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==470); +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 445: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - case 446: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==446); - case 457: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==457); - case 458: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==458); - case 466: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==466); - case 467: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==467); - case 475: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==475); - case 476: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==476); + case 450: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + case 451: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==451); + case 462: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==462); + case 463: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==463); + case 471: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==471); + case 472: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==472); + case 480: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==480); + case 481: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==481); { SToken l = yymsp[-2].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy452); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 447: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 450: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==450); - case 459: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==459); - case 462: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==462); - case 468: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==468); - case 471: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==471); + case 452: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 455: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==455); + case 464: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==464); + case 467: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==467); + case 473: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==473); + case 476: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==476); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 448: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - case 449: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==449); - case 451: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==451); - case 452: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==452); - case 460: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==460); - case 461: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==461); - case 463: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==463); - case 464: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==464); - case 469: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==469); - case 470: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==470); - case 472: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==472); - case 473: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==473); + case 453: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + case 454: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==454); + case 456: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==456); + case 457: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==457); + case 465: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==465); + case 466: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==466); + case 468: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==468); + case 469: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==469); + case 474: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==474); + case 475: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==475); + case 477: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==477); + case 478: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==478); { SToken l = yymsp[-3].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy452); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 453: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 458: /* tags_literal ::= NK_FLOAT */ +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 454: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 455: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==455); + case 459: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 460: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==460); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 474: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 479: /* tags_literal ::= NK_STRING */ +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 477: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 482: /* tags_literal ::= NK_BOOL */ +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 478: /* tags_literal ::= NULL */ -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 483: /* tags_literal ::= NULL */ +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 479: /* tags_literal ::= literal_func */ -{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy452); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 484: /* tags_literal ::= literal_func */ +{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy416); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 480: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 481: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==481); + case 485: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 486: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==486); { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); l.n = (r.z + r.n) - l.z; - yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy452, yymsp[0].minor.yy452); + yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 484: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 489: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 485: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 490: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 486: /* literal ::= NK_STRING */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 491: /* literal ::= NK_STRING */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 487: /* literal ::= NK_BOOL */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 492: /* literal ::= NK_BOOL */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 488: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 493: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 489: /* literal ::= duration_literal */ - case 499: /* signed_literal ::= signed */ yytestcase(yyruleno==499); - case 523: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==523); - case 524: /* expression ::= literal */ yytestcase(yyruleno==524); - case 526: /* expression ::= column_reference */ yytestcase(yyruleno==526); - case 527: /* expression ::= function_expression */ yytestcase(yyruleno==527); - case 528: /* expression ::= case_when_expression */ yytestcase(yyruleno==528); - case 562: /* function_expression ::= literal_func */ yytestcase(yyruleno==562); - case 612: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==612); - case 616: /* boolean_primary ::= predicate */ yytestcase(yyruleno==616); - case 618: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==618); - case 619: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==619); - case 622: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==622); - case 624: /* table_reference ::= table_primary */ yytestcase(yyruleno==624); - case 625: /* table_reference ::= joined_table */ yytestcase(yyruleno==625); - case 629: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==629); - case 714: /* query_simple ::= query_specification */ yytestcase(yyruleno==714); - case 715: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==715); - case 718: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==718); - case 720: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==720); -{ yylhsminor.yy452 = yymsp[0].minor.yy452; } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 494: /* literal ::= duration_literal */ + case 504: /* signed_literal ::= signed */ yytestcase(yyruleno==504); + case 528: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==528); + case 529: /* expression ::= literal */ yytestcase(yyruleno==529); + case 531: /* expression ::= column_reference */ yytestcase(yyruleno==531); + case 532: /* expression ::= function_expression */ yytestcase(yyruleno==532); + case 533: /* expression ::= case_when_expression */ yytestcase(yyruleno==533); + case 567: /* function_expression ::= literal_func */ yytestcase(yyruleno==567); + case 617: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==617); + case 621: /* boolean_primary ::= predicate */ yytestcase(yyruleno==621); + case 623: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==623); + case 624: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==624); + case 627: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==627); + case 629: /* table_reference ::= table_primary */ yytestcase(yyruleno==629); + case 630: /* table_reference ::= joined_table */ yytestcase(yyruleno==630); + case 634: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==634); + case 719: /* query_simple ::= query_specification */ yytestcase(yyruleno==719); + case 720: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==720); + case 723: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==723); + case 725: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==725); +{ yylhsminor.yy416 = yymsp[0].minor.yy416; } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 490: /* literal ::= NULL */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 495: /* literal ::= NULL */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 491: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 496: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 492: /* duration_literal ::= NK_VARIABLE */ - case 689: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==689); - case 690: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==690); - case 691: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==691); -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 497: /* duration_literal ::= NK_VARIABLE */ + case 694: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==694); + case 695: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==695); + case 696: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==696); +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 493: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 498: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 494: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 499: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 495: /* signed ::= NK_MINUS NK_INTEGER */ + case 500: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 496: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 501: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 497: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 502: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 498: /* signed ::= NK_MINUS NK_FLOAT */ + case 503: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 500: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 505: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 501: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 506: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 502: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 507: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 503: /* signed_literal ::= duration_literal */ - case 505: /* signed_literal ::= literal_func */ yytestcase(yyruleno==505); - case 583: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==583); - case 666: /* select_item ::= common_expression */ yytestcase(yyruleno==666); - case 676: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==676); - case 719: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==719); - case 721: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==721); - case 734: /* search_condition ::= common_expression */ yytestcase(yyruleno==734); -{ yylhsminor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 508: /* signed_literal ::= duration_literal */ + case 510: /* signed_literal ::= literal_func */ yytestcase(yyruleno==510); + case 588: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==588); + case 671: /* select_item ::= common_expression */ yytestcase(yyruleno==671); + case 681: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==681); + case 724: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==724); + case 726: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==726); + case 739: /* search_condition ::= common_expression */ yytestcase(yyruleno==739); +{ yylhsminor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 504: /* signed_literal ::= NULL */ -{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 509: /* signed_literal ::= NULL */ +{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 506: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy452 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 511: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy416 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 525: /* expression ::= pseudo_column */ -{ yylhsminor.yy452 = yymsp[0].minor.yy452; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy452, true); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 530: /* expression ::= pseudo_column */ +{ yylhsminor.yy416 = yymsp[0].minor.yy416; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy416, true); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 529: /* expression ::= NK_LP expression NK_RP */ - case 617: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==617); - case 733: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==733); -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 534: /* expression ::= NK_LP expression NK_RP */ + case 622: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==622); + case 738: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==738); +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 530: /* expression ::= NK_PLUS expr_or_subquery */ + case 535: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 531: /* expression ::= NK_MINUS expr_or_subquery */ + case 536: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 532: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 537: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 533: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 538: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 534: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 539: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 535: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 540: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 536: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 541: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 537: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 542: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 538: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 543: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 539: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 544: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 542: /* column_reference ::= column_name */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy479, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy479)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 547: /* column_reference ::= column_name */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy1109, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 543: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479, createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 548: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 544: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 549: /* column_reference ::= NK_ALIAS */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 545: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 550: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 546: /* pseudo_column ::= ROWTS */ - case 547: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==547); - case 549: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==549); - case 550: /* pseudo_column ::= QEND */ yytestcase(yyruleno==550); - case 551: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==551); - case 552: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==552); - case 553: /* pseudo_column ::= WEND */ yytestcase(yyruleno==553); - case 554: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==554); - case 555: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==555); - case 556: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==556); - case 557: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==557); - case 564: /* literal_func ::= NOW */ yytestcase(yyruleno==564); - case 565: /* literal_func ::= TODAY */ yytestcase(yyruleno==565); -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 551: /* pseudo_column ::= ROWTS */ + case 552: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==552); + case 554: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==554); + case 555: /* pseudo_column ::= QEND */ yytestcase(yyruleno==555); + case 556: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==556); + case 557: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==557); + case 558: /* pseudo_column ::= WEND */ yytestcase(yyruleno==558); + case 559: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==559); + case 560: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==560); + case 561: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==561); + case 562: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==562); + case 569: /* literal_func ::= NOW */ yytestcase(yyruleno==569); + case 570: /* literal_func ::= TODAY */ yytestcase(yyruleno==570); +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 548: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy479)))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 553: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy1109)))); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 558: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 559: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==559); -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy479, yymsp[-1].minor.yy34)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 563: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 564: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==564); +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316)); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 560: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - case 561: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==561); -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy874)); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; + case 565: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 566: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==566); +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy952)); } + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 563: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy479, NULL)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 568: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy1109, NULL)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 579: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy34 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy34 = yylhsminor.yy34; + case 584: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy316 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 584: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 669: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==669); -{ yylhsminor.yy452 = createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 589: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 674: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==674); +{ yylhsminor.yy416 = createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 585: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy34, yymsp[-1].minor.yy452)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 590: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 586: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-2].minor.yy34, yymsp[-1].minor.yy452)); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + case 591: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 589: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy452 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); } + case 594: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy416 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } break; - case 591: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); } + case 596: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } break; - case 592: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 597: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==597); + case 597: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 602: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==602); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy440, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy848, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 593: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 598: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-4].minor.yy452 = yylhsminor.yy452; + yymsp[-4].minor.yy416 = yylhsminor.yy416; break; - case 594: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 599: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-5].minor.yy452 = yylhsminor.yy452; + yymsp[-5].minor.yy416 = yylhsminor.yy416; break; - case 595: /* predicate ::= expr_or_subquery IS NULL */ + case 600: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), NULL)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 596: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 601: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL)); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 598: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_THAN; } + case 603: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_THAN; } break; - case 599: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_THAN; } + case 604: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_THAN; } break; - case 600: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_EQUAL; } + case 605: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_EQUAL; } break; - case 601: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_EQUAL; } + case 606: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_EQUAL; } break; - case 602: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy440 = OP_TYPE_NOT_EQUAL; } + case 607: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy848 = OP_TYPE_NOT_EQUAL; } break; - case 603: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy440 = OP_TYPE_EQUAL; } + case 608: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy848 = OP_TYPE_EQUAL; } break; - case 604: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy440 = OP_TYPE_LIKE; } + case 609: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy848 = OP_TYPE_LIKE; } break; - case 605: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_LIKE; } + case 610: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_LIKE; } break; - case 606: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy440 = OP_TYPE_MATCH; } + case 611: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy848 = OP_TYPE_MATCH; } break; - case 607: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy440 = OP_TYPE_NMATCH; } + case 612: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy848 = OP_TYPE_NMATCH; } break; - case 608: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy440 = OP_TYPE_JSON_CONTAINS; } + case 613: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy848 = OP_TYPE_JSON_CONTAINS; } break; - case 609: /* in_op ::= IN */ -{ yymsp[0].minor.yy440 = OP_TYPE_IN; } + case 614: /* in_op ::= IN */ +{ yymsp[0].minor.yy848 = OP_TYPE_IN; } break; - case 610: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_IN; } + case 615: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_IN; } break; - case 611: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 616: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 613: /* boolean_value_expression ::= NOT boolean_primary */ + case 618: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 614: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 619: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 615: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 620: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452); - yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); + yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 623: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy452 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, NULL); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 628: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy416 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, NULL); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 626: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 631: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 627: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-3].minor.yy479, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 632: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-3].minor.yy1109, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 628: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy452 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy479); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 633: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy416 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 630: /* alias_opt ::= */ -{ yymsp[1].minor.yy479 = nil_token; } + case 635: /* alias_opt ::= */ +{ yymsp[1].minor.yy1109 = nil_token; } break; - case 632: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy479 = yymsp[0].minor.yy479; } + case 637: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy1109; } break; - case 633: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 634: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==634); -{ yymsp[-2].minor.yy452 = yymsp[-1].minor.yy452; } + case 638: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 639: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==639); +{ yymsp[-2].minor.yy416 = yymsp[-1].minor.yy416; } break; - case 635: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + case 640: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ { - yylhsminor.yy452 = createJoinTableNode(pCxt, yymsp[-6].minor.yy162, yymsp[-5].minor.yy444, yymsp[-7].minor.yy452, yymsp[-3].minor.yy452, yymsp[-2].minor.yy452); - yylhsminor.yy452 = addWindowOffsetClause(pCxt, yylhsminor.yy452, yymsp[-1].minor.yy452); - yylhsminor.yy452 = addJLimitClause(pCxt, yylhsminor.yy452, yymsp[0].minor.yy452); + yylhsminor.yy416 = createJoinTableNode(pCxt, yymsp[-6].minor.yy972, yymsp[-5].minor.yy630, yymsp[-7].minor.yy416, yymsp[-3].minor.yy416, yymsp[-2].minor.yy416); + yylhsminor.yy416 = addWindowOffsetClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); + yylhsminor.yy416 = addJLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); } - yymsp[-7].minor.yy452 = yylhsminor.yy452; + yymsp[-7].minor.yy416 = yylhsminor.yy416; break; - case 636: /* join_type ::= */ -{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; } + case 641: /* join_type ::= */ +{ yymsp[1].minor.yy972 = JOIN_TYPE_INNER; } break; - case 637: /* join_type ::= INNER */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; } + case 642: /* join_type ::= INNER */ +{ yymsp[0].minor.yy972 = JOIN_TYPE_INNER; } break; - case 638: /* join_type ::= LEFT */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_LEFT; } + case 643: /* join_type ::= LEFT */ +{ yymsp[0].minor.yy972 = JOIN_TYPE_LEFT; } break; - case 639: /* join_type ::= RIGHT */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_RIGHT; } + case 644: /* join_type ::= RIGHT */ +{ yymsp[0].minor.yy972 = JOIN_TYPE_RIGHT; } break; - case 640: /* join_type ::= FULL */ -{ yymsp[0].minor.yy162 = JOIN_TYPE_FULL; } + case 645: /* join_type ::= FULL */ +{ yymsp[0].minor.yy972 = JOIN_TYPE_FULL; } break; - case 641: /* join_subtype ::= */ -{ yymsp[1].minor.yy444 = JOIN_STYPE_NONE; } + case 646: /* join_subtype ::= */ +{ yymsp[1].minor.yy630 = JOIN_STYPE_NONE; } break; - case 642: /* join_subtype ::= OUTER */ -{ yymsp[0].minor.yy444 = JOIN_STYPE_OUTER; } + case 647: /* join_subtype ::= OUTER */ +{ yymsp[0].minor.yy630 = JOIN_STYPE_OUTER; } break; - case 643: /* join_subtype ::= SEMI */ -{ yymsp[0].minor.yy444 = JOIN_STYPE_SEMI; } + case 648: /* join_subtype ::= SEMI */ +{ yymsp[0].minor.yy630 = JOIN_STYPE_SEMI; } break; - case 644: /* join_subtype ::= ANTI */ -{ yymsp[0].minor.yy444 = JOIN_STYPE_ANTI; } + case 649: /* join_subtype ::= ANTI */ +{ yymsp[0].minor.yy630 = JOIN_STYPE_ANTI; } break; - case 645: /* join_subtype ::= ASOF */ -{ yymsp[0].minor.yy444 = JOIN_STYPE_ASOF; } + case 650: /* join_subtype ::= ASOF */ +{ yymsp[0].minor.yy630 = JOIN_STYPE_ASOF; } break; - case 646: /* join_subtype ::= WINDOW */ -{ yymsp[0].minor.yy444 = JOIN_STYPE_WIN; } + case 651: /* join_subtype ::= WINDOW */ +{ yymsp[0].minor.yy630 = JOIN_STYPE_WIN; } break; - case 650: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -{ yymsp[-5].minor.yy452 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 655: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ +{ yymsp[-5].minor.yy416 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 651: /* window_offset_literal ::= NK_VARIABLE */ -{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 656: /* window_offset_literal ::= NK_VARIABLE */ +{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 652: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ + case 657: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy452 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + yylhsminor.yy416 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 654: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 725: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==725); - case 729: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==729); -{ yymsp[-1].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 659: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 730: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==730); + case 734: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==734); +{ yymsp[-1].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 655: /* 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 */ + case 660: /* 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 */ { - yymsp[-13].minor.yy452 = createSelectStmt(pCxt, yymsp[-11].minor.yy437, yymsp[-9].minor.yy34, yymsp[-8].minor.yy452, yymsp[-12].minor.yy34); - yymsp[-13].minor.yy452 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy452, yymsp[-10].minor.yy437); - yymsp[-13].minor.yy452 = addWhereClause(pCxt, yymsp[-13].minor.yy452, yymsp[-7].minor.yy452); - yymsp[-13].minor.yy452 = addPartitionByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-6].minor.yy34); - yymsp[-13].minor.yy452 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy452, yymsp[-2].minor.yy452); - yymsp[-13].minor.yy452 = addGroupByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-1].minor.yy34); - yymsp[-13].minor.yy452 = addHavingClause(pCxt, yymsp[-13].minor.yy452, yymsp[0].minor.yy452); - yymsp[-13].minor.yy452 = addRangeClause(pCxt, yymsp[-13].minor.yy452, yymsp[-5].minor.yy452); - yymsp[-13].minor.yy452 = addEveryClause(pCxt, yymsp[-13].minor.yy452, yymsp[-4].minor.yy452); - yymsp[-13].minor.yy452 = addFillClause(pCxt, yymsp[-13].minor.yy452, yymsp[-3].minor.yy452); + yymsp[-13].minor.yy416 = createSelectStmt(pCxt, yymsp[-11].minor.yy209, yymsp[-9].minor.yy316, yymsp[-8].minor.yy416, yymsp[-12].minor.yy316); + yymsp[-13].minor.yy416 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy416, yymsp[-10].minor.yy209); + yymsp[-13].minor.yy416 = addWhereClause(pCxt, yymsp[-13].minor.yy416, yymsp[-7].minor.yy416); + yymsp[-13].minor.yy416 = addPartitionByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-6].minor.yy316); + yymsp[-13].minor.yy416 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy416, yymsp[-2].minor.yy416); + yymsp[-13].minor.yy416 = addGroupByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-1].minor.yy316); + yymsp[-13].minor.yy416 = addHavingClause(pCxt, yymsp[-13].minor.yy416, yymsp[0].minor.yy416); + yymsp[-13].minor.yy416 = addRangeClause(pCxt, yymsp[-13].minor.yy416, yymsp[-5].minor.yy416); + yymsp[-13].minor.yy416 = addEveryClause(pCxt, yymsp[-13].minor.yy416, yymsp[-4].minor.yy416); + yymsp[-13].minor.yy416 = addFillClause(pCxt, yymsp[-13].minor.yy416, yymsp[-3].minor.yy416); } break; - case 656: /* hint_list ::= */ -{ yymsp[1].minor.yy34 = createHintNodeList(pCxt, NULL); } + case 661: /* hint_list ::= */ +{ yymsp[1].minor.yy316 = createHintNodeList(pCxt, NULL); } break; - case 657: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy34 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy34 = yylhsminor.yy34; + case 662: /* hint_list ::= NK_HINT */ +{ yylhsminor.yy316 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 662: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy437 = false; } + case 667: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy209 = false; } break; - case 665: /* select_item ::= NK_STAR */ -{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy452 = yylhsminor.yy452; + case 670: /* select_item ::= NK_STAR */ +{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy416 = yylhsminor.yy416; break; - case 667: /* select_item ::= common_expression column_alias */ - case 677: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==677); -{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy479); } - yymsp[-1].minor.yy452 = yylhsminor.yy452; + case 672: /* select_item ::= common_expression column_alias */ + case 682: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==682); +{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } + yymsp[-1].minor.yy416 = yylhsminor.yy416; break; - case 668: /* select_item ::= common_expression AS column_alias */ - case 678: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==678); -{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), &yymsp[0].minor.yy479); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 673: /* select_item ::= common_expression AS column_alias */ + case 683: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==683); +{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), &yymsp[0].minor.yy1109); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 673: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 703: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==703); - case 723: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==723); -{ yymsp[-2].minor.yy34 = yymsp[0].minor.yy34; } + case 678: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 708: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==708); + case 728: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==728); +{ yymsp[-2].minor.yy316 = yymsp[0].minor.yy316; } break; - case 680: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy452 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 685: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy416 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 681: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy452 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 686: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy416 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 682: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 687: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 683: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); } + case 688: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } break; - case 684: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy452 = createEventWindowNode(pCxt, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); } + case 689: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy416 = createEventWindowNode(pCxt, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } break; - case 685: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy452 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 690: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 686: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy452 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 691: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 693: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy452 = createFillNode(pCxt, yymsp[-1].minor.yy984, NULL); } + case 698: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy416 = createFillNode(pCxt, yymsp[-1].minor.yy882, NULL); } break; - case 694: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); } + case 699: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } break; - case 695: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); } + case 700: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } break; - case 696: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy984 = FILL_MODE_NONE; } + case 701: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy882 = FILL_MODE_NONE; } break; - case 697: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy984 = FILL_MODE_PREV; } + case 702: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy882 = FILL_MODE_PREV; } break; - case 698: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy984 = FILL_MODE_NULL; } + case 703: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy882 = FILL_MODE_NULL; } break; - case 699: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy984 = FILL_MODE_NULL_F; } + case 704: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy882 = FILL_MODE_NULL_F; } break; - case 700: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy984 = FILL_MODE_LINEAR; } + case 705: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy882 = FILL_MODE_LINEAR; } break; - case 701: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy984 = FILL_MODE_NEXT; } + case 706: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy882 = FILL_MODE_NEXT; } break; - case 704: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy34 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); } - yymsp[0].minor.yy34 = yylhsminor.yy34; + case 709: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy316 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } + yymsp[0].minor.yy316 = yylhsminor.yy316; break; - case 705: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); } - yymsp[-2].minor.yy34 = yylhsminor.yy34; + case 710: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } + yymsp[-2].minor.yy316 = yylhsminor.yy316; break; - case 709: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy452 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 714: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy416 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 710: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy452 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); } + case 715: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy416 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } break; - case 713: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 718: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy452 = addOrderByClause(pCxt, yymsp[-3].minor.yy452, yymsp[-2].minor.yy34); - yylhsminor.yy452 = addSlimitClause(pCxt, yylhsminor.yy452, yymsp[-1].minor.yy452); - yylhsminor.yy452 = addLimitClause(pCxt, yylhsminor.yy452, yymsp[0].minor.yy452); + yylhsminor.yy416 = addOrderByClause(pCxt, yymsp[-3].minor.yy416, yymsp[-2].minor.yy316); + yylhsminor.yy416 = addSlimitClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); + yylhsminor.yy416 = addLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 716: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-3].minor.yy452 = yylhsminor.yy452; + case 721: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } + yymsp[-3].minor.yy416 = yylhsminor.yy416; break; - case 717: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy452, yymsp[0].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 722: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 726: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 730: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==730); -{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 731: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 735: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==735); +{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 727: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 731: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==731); -{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 732: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 736: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==736); +{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 732: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy452); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 737: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy416); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 737: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy452 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), yymsp[-1].minor.yy548, yymsp[0].minor.yy817); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 742: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy416 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), yymsp[-1].minor.yy506, yymsp[0].minor.yy1045); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 738: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy548 = ORDER_ASC; } + case 743: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy506 = ORDER_ASC; } break; - case 739: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy548 = ORDER_ASC; } + case 744: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy506 = ORDER_ASC; } break; - case 740: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy548 = ORDER_DESC; } + case 745: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy506 = ORDER_DESC; } break; - case 741: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy817 = NULL_ORDER_DEFAULT; } + case 746: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy1045 = NULL_ORDER_DEFAULT; } break; - case 742: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy817 = NULL_ORDER_FIRST; } + case 747: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy1045 = NULL_ORDER_FIRST; } break; - case 743: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy817 = NULL_ORDER_LAST; } + case 748: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy1045 = NULL_ORDER_LAST; } break; - case 746: /* column_options ::= column_options ENCODE NK_STRING */ -{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 751: /* column_options ::= column_options ENCODE NK_STRING */ +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 747: /* column_options ::= column_options COMPRESS NK_STRING */ -{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 752: /* column_options ::= column_options COMPRESS NK_STRING */ +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; - case 748: /* column_options ::= column_options LEVEL NK_STRING */ -{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy452 = yylhsminor.yy452; + case 753: /* column_options ::= column_options LEVEL NK_STRING */ +{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy416 = yylhsminor.yy416; break; default: break; @@ -7468,12 +7781,56 @@ void Parse( } #endif - do{ + while(1){ /* Exit by "break" */ + assert( yypParser->yytos>=yypParser->yystack ); assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact >= YY_MIN_REDUCE ){ - yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, - yyminor ParseCTX_PARAM); + 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); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); #ifndef YYNOERRORRECOVERY @@ -7529,14 +7886,13 @@ 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)) > YY_MAX_SHIFTREDUCE - ){ + while( yypParser->yytos > yypParser->yystack ){ + yyact = yy_find_reduce_action(yypParser->yytos->stateno, + YYERRORSYMBOL); + if( yyact<=YY_MAX_SHIFTREDUCE ) break; 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 @@ -7586,7 +7942,7 @@ void Parse( break; #endif } - }while( yypParser->yytos>yypParser->yystack ); + } #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index b271c83678..b00767b6b6 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -3011,7 +3011,9 @@ static SNode* partTagsCreateWrapperFunc(const char* pFuncName, SNode* pNode) { } snprintf(pFunc->functionName, sizeof(pFunc->functionName), "%s", pFuncName); - if (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME != ((SColumnNode*)pNode)->colType) { + if ((QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME != ((SColumnNode*)pNode)->colType) || + (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType && + ((SColumnNode*)pNode)->tableAlias[0] != '\0')){ SColumnNode* pCol = (SColumnNode*)pNode; partTagsSetAlias(pFunc->node.aliasName, pCol->tableAlias, pCol->colName); } else { diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index b9cf5d48f0..72e38c7a0d 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -3782,7 +3782,7 @@ int32_t fltSclBuildRangeFromBlockSma(SFltSclColumnRange *colRange, SColumnDataAg return TSDB_CODE_SUCCESS; } -bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t numOfCols, int32_t numOfRows) { +bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pDataStatis, int32_t numOfCols, int32_t numOfRows) { if (info->scalarMode) { SArray *colRanges = info->sclCtx.fltSclRange; for (int32_t i = 0; i < taosArrayGetSize(colRanges); ++i) { @@ -3790,13 +3790,13 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t bool foundCol = false; int32_t j = 0; for (; j < numOfCols; ++j) { - if (pDataStatis[j] != NULL && pDataStatis[j]->colId == colRange->colNode->colId) { + if (pDataStatis[j].colId == colRange->colNode->colId) { foundCol = true; break; } } if (foundCol) { - SColumnDataAgg *pAgg = pDataStatis[j]; + SColumnDataAgg *pAgg = &pDataStatis[j]; SArray *points = taosArrayInit(2, sizeof(SFltSclPoint)); fltSclBuildRangeFromBlockSma(colRange, pAgg, numOfRows, points); qDebug("column data agg: nulls %d, rows %d, max %" PRId64 " min %" PRId64, pAgg->numOfNull, numOfRows, @@ -3833,7 +3833,7 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t int32_t index = -1; SFilterRangeCtx *ctx = info->colRange[k]; for (int32_t i = 0; i < numOfCols; ++i) { - if (pDataStatis[i] != NULL && pDataStatis[i]->colId == ctx->colId) { + if (pDataStatis[i].colId == ctx->colId) { index = i; break; } @@ -3849,13 +3849,13 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t break; } - if (pDataStatis[index]->numOfNull <= 0) { + if (pDataStatis[index].numOfNull <= 0) { if (ctx->isnull && !ctx->notnull && !ctx->isrange) { ret = false; break; } - } else if (pDataStatis[index]->numOfNull > 0) { - if (pDataStatis[index]->numOfNull == numOfRows) { + } else if (pDataStatis[index].numOfNull > 0) { + if (pDataStatis[index].numOfNull == numOfRows) { if ((ctx->notnull || ctx->isrange) && (!ctx->isnull)) { ret = false; break; @@ -3869,7 +3869,7 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t } } - SColumnDataAgg *pDataBlockst = pDataStatis[index]; + SColumnDataAgg *pDataBlockst = &pDataStatis[index]; SFilterRangeNode *r = ctx->rs; float minv = 0; diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index da26d7e3b9..48bedde91a 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -737,9 +737,10 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp int32_t code = TSDB_CODE_SUCCESS; char *convBuf = taosMemoryMalloc(inputLen); char *output = taosMemoryCalloc(1, outputLen + TSDB_NCHAR_SIZE); - char buf[400] = {0}; + int32_t bufSize = TSDB_MAX_FIELD_LEN + 1; + char *buf = taosMemoryMalloc(bufSize); - if (convBuf == NULL || output == NULL) { + if (convBuf == NULL || output == NULL || buf == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _end; } @@ -991,7 +992,7 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp memcpy(varDataVal(output), convBuf, len); varDataSetLen(output, len); } else { - NUM_TO_STRING(inputType, input, sizeof(buf), buf); + NUM_TO_STRING(inputType, input, bufSize, buf); int32_t len = (int32_t)strlen(buf); len = (outputLen - VARSTR_HEADER_SIZE) > len ? len : (outputLen - VARSTR_HEADER_SIZE); memcpy(varDataVal(output), buf, len); @@ -1037,7 +1038,7 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp memcpy(output, input, len + VARSTR_HEADER_SIZE); varDataSetLen(output, len); } else { - NUM_TO_STRING(inputType, input, sizeof(buf), buf); + NUM_TO_STRING(inputType, input, bufSize, buf); len = (int32_t)strlen(buf); len = outputCharLen > len ? len : outputCharLen; bool ret = taosMbsToUcs4(buf, len, (TdUcs4 *)varDataVal(output), outputLen - VARSTR_HEADER_SIZE, &len); @@ -1067,6 +1068,7 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp pOutput->numOfRows = pInput->numOfRows; _end: + taosMemoryFree(buf); taosMemoryFree(output); taosMemoryFree(convBuf); return code; diff --git a/source/libs/scheduler/src/schJob.c b/source/libs/scheduler/src/schJob.c index 380862f745..278768981a 100644 --- a/source/libs/scheduler/src/schJob.c +++ b/source/libs/scheduler/src/schJob.c @@ -567,7 +567,7 @@ int32_t schLaunchJobLowerLevel(SSchJob *pJob, SSchTask *pTask) { } SSchLevel *pLevel = pTask->level; - int32_t doneNum = atomic_add_fetch_32(&pLevel->taskExecDoneNum, 1); + int32_t doneNum = atomic_load_32(&pLevel->taskExecDoneNum); if (doneNum == pLevel->taskNum) { atomic_sub_fetch_32(&pJob->levelIdx, 1); diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index 97c3c7d276..c317a63ce1 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -248,6 +248,8 @@ int32_t schProcessOnTaskSuccess(SSchJob *pJob, SSchTask *pTask) { SCH_LOG_TASK_END_TS(pTask); + int32_t taskDone = atomic_add_fetch_32(&pTask->level->taskExecDoneNum, 1); + SCH_SET_TASK_STATUS(pTask, JOB_TASK_STATUS_PART_SUCC); SCH_ERR_RET(schRecordTaskSucceedNode(pJob, pTask)); @@ -317,8 +319,10 @@ int32_t schProcessOnTaskSuccess(SSchJob *pJob, SSchTask *pTask) { } } - SCH_ERR_RET(schLaunchJobLowerLevel(pJob, pTask)); - + if (taskDone == pTask->level->taskNum) { + SCH_ERR_RET(schLaunchJobLowerLevel(pJob, pTask)); + } + return TSDB_CODE_SUCCESS; } @@ -483,6 +487,34 @@ _return: SCH_RET(schProcessOnTaskFailure(pJob, pTask, code)); } +int32_t schResetTaskSetLevelInfo(SSchJob *pJob, SSchTask *pTask) { + SSchLevel *pLevel = pTask->level; + + SCH_TASK_DLOG("start to reset level for current task set, execDone:%d, launched:%d", + atomic_load_32(&pLevel->taskExecDoneNum), atomic_load_32(&pLevel->taskLaunchedNum)); + + if (SCH_GET_TASK_STATUS(pTask) >= JOB_TASK_STATUS_PART_SUCC) { + atomic_sub_fetch_32(&pLevel->taskExecDoneNum, 1); + } + + atomic_sub_fetch_32(&pLevel->taskLaunchedNum, 1); + + int32_t childrenNum = taosArrayGetSize(pTask->children); + for (int32_t i = 0; i < childrenNum; ++i) { + SSchTask *pChild = taosArrayGetP(pTask->children, i); + SCH_LOCK_TASK(pChild); + pLevel = pChild->level; + atomic_sub_fetch_32(&pLevel->taskExecDoneNum, 1); + atomic_sub_fetch_32(&pLevel->taskLaunchedNum, 1); + SCH_UNLOCK_TASK(pChild); + } + + SCH_TASK_DLOG("end to reset level for current task set, execDone:%d, launched:%d", + atomic_load_32(&pLevel->taskExecDoneNum), atomic_load_32(&pLevel->taskLaunchedNum)); + + return TSDB_CODE_SUCCESS; +} + int32_t schHandleTaskSetRetry(SSchJob *pJob, SSchTask *pTask, SDataBuf *pData, int32_t rspCode) { int32_t code = 0; @@ -498,12 +530,7 @@ int32_t schHandleTaskSetRetry(SSchJob *pJob, SSchTask *pTask, SDataBuf *pData, i SCH_TASK_DLOG("start to redirect current task set cause of error: %s", tstrerror(rspCode)); - for (int32_t i = 0; i < pJob->levelNum; ++i) { - SSchLevel *pLevel = taosArrayGet(pJob->levels, i); - - pLevel->taskExecDoneNum = 0; - pLevel->taskLaunchedNum = 0; - } + SCH_ERR_JRET(schResetTaskSetLevelInfo(pJob, pTask)); SCH_RESET_JOB_LEVEL_IDX(pJob); diff --git a/source/libs/stream/inc/streamInt.h b/source/libs/stream/inc/streamInt.h index f3ec01cf7a..be3da64c6a 100644 --- a/source/libs/stream/inc/streamInt.h +++ b/source/libs/stream/inc/streamInt.h @@ -26,20 +26,16 @@ extern "C" { #endif -#define CHECK_RSP_CHECK_INTERVAL 300 -#define LAUNCH_HTASK_INTERVAL 100 -#define WAIT_FOR_MINIMAL_INTERVAL 100.00 -#define MAX_RETRY_LAUNCH_HISTORY_TASK 40 -#define RETRY_LAUNCH_INTERVAL_INC_RATE 1.2 - -#define MAX_BLOCK_NAME_NUM 1024 -#define DISPATCH_RETRY_INTERVAL_MS 300 -#define MAX_CONTINUE_RETRY_COUNT 5 - -#define META_HB_CHECK_INTERVAL 200 -#define META_HB_SEND_IDLE_COUNTER 25 // send hb every 5 sec -#define STREAM_TASK_KEY_LEN ((sizeof(int64_t)) << 1) - +#define CHECK_RSP_CHECK_INTERVAL 300 +#define LAUNCH_HTASK_INTERVAL 100 +#define WAIT_FOR_MINIMAL_INTERVAL 100.00 +#define MAX_RETRY_LAUNCH_HISTORY_TASK 40 +#define RETRY_LAUNCH_INTERVAL_INC_RATE 1.2 +#define MAX_BLOCK_NAME_NUM 1024 +#define DISPATCH_RETRY_INTERVAL_MS 300 +#define META_HB_CHECK_INTERVAL 200 +#define META_HB_SEND_IDLE_COUNTER 25 // send hb every 5 sec +#define STREAM_TASK_KEY_LEN ((sizeof(int64_t)) << 1) #define STREAM_TASK_QUEUE_CAPACITY 20480 #define STREAM_TASK_QUEUE_CAPACITY_IN_SIZE (30) @@ -118,6 +114,14 @@ typedef struct { int32_t taskId; } STaskTriggerSendInfo; +typedef struct { + int32_t nodeId; + int32_t status; + int64_t sendTs; + int64_t rspTs; + int32_t retryCount; +} SDispatchEntry; + typedef struct { int64_t streamId; int64_t recvTs; @@ -143,6 +147,12 @@ typedef enum { EXEC_AFTER_IDLE = 0x1, } EExtractDataCode; +typedef enum ECHECKPOINT_BACKUP_TYPE { + DATA_UPLOAD_DISABLE = -1, + DATA_UPLOAD_S3 = 0, + DATA_UPLOAD_RSYNC = 1, +} ECHECKPOINT_BACKUP_TYPE; + extern void* streamTimer; extern int32_t streamBackendId; extern int32_t streamBackendCfWrapperId; @@ -153,10 +163,9 @@ void streamTimerCleanUp(); void initRpcMsg(SRpcMsg* pMsg, int32_t msgType, void* pCont, int32_t contLen); -void streamRetryDispatchData(SStreamTask* pTask, int64_t waitDuration); +void streamStartMonitorDispatchData(SStreamTask* pTask, int64_t waitDuration); int32_t streamDispatchStreamBlock(SStreamTask* pTask); void destroyDispatchMsg(SStreamDispatchReq* pReq, int32_t numOfVgroups); -int32_t getNumOfDispatchBranch(SStreamTask* pTask); void clearBufferedDispatchMsg(SStreamTask* pTask); int32_t streamProcessCheckpointTriggerBlock(SStreamTask* pTask, SStreamDataBlock* pBlock); @@ -165,7 +174,7 @@ SStreamDataBlock* createStreamBlockFromResults(SStreamQueueItem* pItem, SStreamT SArray* pRes); void destroyStreamDataBlock(SStreamDataBlock* pBlock); -int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData); +int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData, const char* idstr); int32_t streamBroadcastToUpTasks(SStreamTask* pTask, const SSDataBlock* pBlock); int32_t streamSendCheckMsg(SStreamTask* pTask, const SStreamTaskCheckReq* pReq, int32_t nodeId, SEpSet* pEpSet); @@ -204,12 +213,6 @@ int32_t streamQueueGetItemSize(const SStreamQueue* pQueue); void streamMetaRemoveDB(void* arg, char* key); -typedef enum ECHECKPOINT_BACKUP_TYPE { - DATA_UPLOAD_DISABLE = -1, - DATA_UPLOAD_S3 = 0, - DATA_UPLOAD_RSYNC = 1, -} ECHECKPOINT_BACKUP_TYPE; - ECHECKPOINT_BACKUP_TYPE streamGetCheckpointBackupType(); int32_t streamTaskDownloadCheckpointData(const char* id, char* path); diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index 597d6035d6..f614ecfd48 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -141,6 +141,7 @@ int32_t valueToString(void* k, char* buf); int32_t valueIsStale(void* k, int64_t ts); void destroyCompare(void* arg); +static void cleanDir(const char* pPath, const char* id); static bool streamStateIterSeekAndValid(rocksdb_iterator_t* iter, char* buf, size_t len); static rocksdb_iterator_t* streamStateIterCreate(SStreamState* pState, const char* cfName, @@ -212,12 +213,7 @@ int32_t rebuildDirFromCheckpoint(const char* path, int64_t chkpId, char** dst) { char* chkp = taosMemoryCalloc(1, strlen(path) + 64); sprintf(chkp, "%s%s%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, "checkpoints", TD_DIRSEP, chkpId); if (taosIsDir(chkp) && isValidCheckpoint(chkp)) { - if (taosIsDir(state)) { - // remove dir if exists - // taosRenameFile(const char *oldName, const char *newName) - taosRemoveDir(state); - } - taosMkDir(state); + cleanDir(state, ""); code = backendCopyFiles(chkp, state); stInfo("copy snap file from %s to %s", chkp, state); if (code != 0) { @@ -322,6 +318,22 @@ int32_t remoteChkp_validAndCvtMeta(char* path, SArray* list, int64_t chkpId) { return complete == 1 ? 0 : -1; } +void cleanDir(const char* pPath, const char* id) { + ASSERT(pPath != NULL); + + if (taosIsDir(pPath)) { + taosRemoveDir(pPath); + taosMkDir(pPath); + stInfo("%s clear dir:%s, succ", id, pPath); + } +} + +void validateDir(const char* pPath) { + if (!taosIsDir(pPath)) { + taosMulMkDir(pPath); + } +} + int32_t rebuildFromRemoteChkp_rsync(const char* key, char* chkptPath, int64_t checkpointId, char* defaultPath) { int32_t code = 0; if (taosIsDir(chkptPath)) { @@ -329,11 +341,8 @@ int32_t rebuildFromRemoteChkp_rsync(const char* key, char* chkptPath, int64_t ch stDebug("remove local checkpoint data dir:%s succ", chkptPath); } - if (taosIsDir(defaultPath)) { - taosRemoveDir(defaultPath); - taosMulMkDir(defaultPath); - stDebug("clear local default dir before downloading checkpoint data:%s succ", defaultPath); - } + cleanDir(defaultPath, key); + stDebug("clear local default dir before downloading checkpoint data:%s succ", defaultPath); code = streamTaskDownloadCheckpointData(key, chkptPath); if (code != 0) { @@ -484,21 +493,14 @@ int32_t backendCopyFiles(const char* src, const char* dst) { static int32_t rebuildFromLocalCheckpoint(const char* pTaskIdStr, const char* checkpointPath, int64_t checkpointId, const char* defaultPath) { int32_t code = 0; - - if (taosIsDir(defaultPath)) { - taosRemoveDir(defaultPath); - taosMkDir(defaultPath); - stInfo("%s clear local backend dir:%s, succ", pTaskIdStr, defaultPath); - } + cleanDir(defaultPath, pTaskIdStr); if (taosIsDir(checkpointPath) && isValidCheckpoint(checkpointPath)) { stDebug("%s local checkpoint data existed, checkpointId:%" PRId64 " copy to backend dir", pTaskIdStr, checkpointId); code = backendCopyFiles(checkpointPath, defaultPath); if (code != TSDB_CODE_SUCCESS) { - taosRemoveDir(defaultPath); - taosMkDir(defaultPath); - + cleanDir(defaultPath, pTaskIdStr); stError("%s failed to start stream backend from local %s, reason:%s, try download checkpoint from remote", pTaskIdStr, checkpointPath, tstrerror(TAOS_SYSTEM_ERROR(errno))); code = TSDB_CODE_SUCCESS; @@ -520,26 +522,18 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId char* prefixPath = taosMemoryCalloc(1, strlen(path) + 128); sprintf(prefixPath, "%s%s%s", path, TD_DIRSEP, key); - if (!taosIsDir(prefixPath)) { - code = taosMkDir(prefixPath); - ASSERT(code == 0); - } + validateDir(prefixPath); char* defaultPath = taosMemoryCalloc(1, strlen(path) + 256); sprintf(defaultPath, "%s%s%s", prefixPath, TD_DIRSEP, "state"); - if (!taosIsDir(defaultPath)) { - taosMulMkDir(defaultPath); - } - + validateDir(defaultPath); int32_t pathLen = strlen(path) + 256; char* checkpointRoot = taosMemoryCalloc(1, pathLen); sprintf(checkpointRoot, "%s%s%s", prefixPath, TD_DIRSEP, "checkpoints"); - if (!taosIsDir(checkpointRoot)) { - taosMulMkDir(checkpointRoot); - } + validateDir(checkpointRoot); taosMemoryFree(checkpointRoot); stDebug("%s check local backend dir:%s, checkpointId:%" PRId64 " succ", key, defaultPath, chkptId); @@ -559,7 +553,8 @@ int32_t restoreCheckpointData(const char* path, const char* key, int64_t chkptId code = 0; // reset the error code } } else { // no valid checkpoint id - stInfo("%s no valid checkpoint ever generated, no need to copy checkpoint data", key); + stInfo("%s no valid checkpoint ever generated, no need to copy checkpoint data, clean defaultPath:%s", key, defaultPath); + cleanDir(defaultPath, key); } taosMemoryFree(chkptPath); @@ -2055,7 +2050,7 @@ STaskDbWrapper* taskDbOpenImpl(const char* key, char* statePath, char* dbPath) { cfNames = rocksdb_list_column_families(pTaskDb->dbOpt, dbPath, &nCf, &err); if (nCf == 0) { - stInfo("%s newly create db, need to restart", key); + stInfo("%s newly create db in state-backend", key); // pre create db pTaskDb->db = rocksdb_open(pTaskDb->pCfOpts[0], dbPath, &err); if (pTaskDb->db == NULL) goto _EXIT; @@ -2215,13 +2210,12 @@ int32_t taskDbGenChkpUploadData__s3(STaskDbWrapper* pDb, void* bkdChkpMgt, int64 sprintf(temp, "%s%s%s%" PRId64 "", pDb->path, TD_DIRSEP, "tmp", chkpId); if (taosDirExist(temp)) { - taosRemoveDir(temp); - taosMkDir(temp); + cleanDir(temp, ""); } else { taosMkDir(temp); } - code = bkdMgtGetDelta(p, pDb->idstr, chkpId, list, temp); + code = bkdMgtGetDelta(p, pDb->idstr, chkpId, list, temp); *path = temp; return code; @@ -4329,4 +4323,4 @@ int32_t bkdMgtDumpTo(SBkdMgt* bm, char* taskId, char* dname) { taosThreadRwlockUnlock(&bm->rwLock); return code; } -#endif \ No newline at end of file +#endif diff --git a/source/libs/stream/src/streamCheckStatus.c b/source/libs/stream/src/streamCheckStatus.c index 11fecf7683..b64e0bb6d2 100644 --- a/source/libs/stream/src/streamCheckStatus.c +++ b/source/libs/stream/src/streamCheckStatus.c @@ -299,12 +299,10 @@ int32_t streamTaskStartMonitorCheckRsp(SStreamTask* pTask) { int32_t streamTaskStopMonitorCheckRsp(STaskCheckInfo* pInfo, const char* id) { taosThreadMutexLock(&pInfo->checkInfoLock); - streamTaskCompleteCheckRsp(pInfo, false, id); - pInfo->stopCheckProcess = 1; taosThreadMutexUnlock(&pInfo->checkInfoLock); - stDebug("s-task:%s set stop check-rsp monit", id); + stDebug("s-task:%s set stop check-rsp monitor flag", id); return TSDB_CODE_SUCCESS; } @@ -438,6 +436,7 @@ int32_t streamTaskStartCheckDownstream(STaskCheckInfo* pInfo, const char* id) { ASSERT(pInfo->startTs > 0); stError("s-task:%s already in check procedure, checkTs:%" PRId64 ", start monitor check rsp failed", id, pInfo->startTs); + pInfo->stopCheckProcess = 0; // disable auto stop of check process return TSDB_CODE_FAILED; } @@ -509,7 +508,7 @@ void doSendCheckMsg(SStreamTask* pTask, SDownstreamStatusInfo* p) { STaskOutputInfo* pOutputInfo = &pTask->outputInfo; if (pOutputInfo->type == TASK_OUTPUT__FIXED_DISPATCH) { STaskDispatcherFixed* pDispatch = &pOutputInfo->fixedDispatcher; - setCheckDownstreamReqInfo(&req, p->reqId, pDispatch->taskId, pDispatch->taskId); + setCheckDownstreamReqInfo(&req, p->reqId, pDispatch->taskId, pDispatch->nodeId); stDebug("s-task:%s (vgId:%d) stage:%" PRId64 " re-send check downstream task:0x%x(vgId:%d) reqId:0x%" PRIx64, id, pTask->info.nodeId, req.stage, req.downstreamTaskId, req.downstreamNodeId, req.reqId); diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c index ab3b5d6fa0..eedd8f20d6 100644 --- a/source/libs/stream/src/streamCheckpoint.c +++ b/source/libs/stream/src/streamCheckpoint.c @@ -40,26 +40,8 @@ static void checkpointTriggerMonitorFn(void* param, void* tmrId); static SStreamDataBlock* createChkptTriggerBlock(SStreamTask* pTask, int32_t checkpointType, int64_t checkpointId, int32_t transId); -bool streamTaskIsAllUpstreamSendTrigger(SStreamTask* pTask) { - SActiveCheckpointInfo* pActiveInfo = pTask->chkInfo.pActiveInfo; - int32_t numOfUpstreams = taosArrayGetSize(pTask->upstreamInfo.pList); - bool allSend = true; - - taosThreadMutexLock(&pActiveInfo->lock); - int32_t numOfRecv = taosArrayGetSize(pActiveInfo->pReadyMsgList); - - if (numOfRecv < numOfUpstreams) { - stDebug("s-task:%s received checkpoint-trigger block, idx:%d, %d upstream tasks not send yet, total:%d", - pTask->id.idStr, pTask->info.selfChildId, (numOfUpstreams - numOfRecv), numOfUpstreams); - allSend = false; - } - - taosThreadMutexUnlock(&pActiveInfo->lock); - return allSend; -} - SStreamDataBlock* createChkptTriggerBlock(SStreamTask* pTask, int32_t checkpointType, int64_t checkpointId, - int32_t transId) { + int32_t transId) { SStreamDataBlock* pChkpoint = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, sizeof(SSDataBlock)); if (pChkpoint == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -441,8 +423,10 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin if (pReq->checkpointId <= pInfo->checkpointId) { stDebug("s-task:%s vgId:%d latest checkpointId:%" PRId64 " checkpointVer:%" PRId64 - " no need to update the checkpoint info, updated checkpointId:%" PRId64 " checkpointVer:%" PRId64 " ignored", - id, vgId, pInfo->checkpointId, pInfo->checkpointVer, pReq->checkpointId, pReq->checkpointVer); + " no need to update the checkpoint info, updated checkpointId:%" PRId64 " checkpointVer:%" PRId64 + " transId:%d ignored", + id, vgId, pInfo->checkpointId, pInfo->checkpointVer, pReq->checkpointId, pReq->checkpointVer, + pReq->transId); taosThreadMutexUnlock(&pTask->lock); { // destroy the related fill-history tasks @@ -454,7 +438,6 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped in update checkpointInfo, remain tasks:%d", id, vgId, pReq->taskId, numOfTasks); } - streamMetaWLock(pMeta); } @@ -516,7 +499,8 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin if (pReq->dropRelHTask) { streamMetaUnregisterTask(pMeta, pReq->hStreamId, pReq->hTaskId); int32_t numOfTasks = streamMetaGetNumOfTasks(pMeta); - stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped, remain tasks:%d", id, vgId, (int32_t) pReq->hTaskId, numOfTasks); + stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped, remain tasks:%d", id, vgId, + (int32_t)pReq->hTaskId, numOfTasks); } streamMetaWLock(pMeta); @@ -703,9 +687,7 @@ int32_t streamTaskBuildCheckpoint(SStreamTask* pTask) { // update the latest checkpoint info if all works are done successfully, for rsma, the pMsgCb is null. if (code == TSDB_CODE_SUCCESS && (pTask->pMsgCb != NULL)) { - STaskId* pHTaskId = &pTask->hTaskInfo.id; - code = streamBuildAndSendCheckpointUpdateMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id, pHTaskId, &pTask->chkInfo, - dropRelHTask); + code = streamSendChkptReportMsg(pTask, &pTask->chkInfo, dropRelHTask); if (code == TSDB_CODE_SUCCESS) { code = streamTaskRemoteBackupCheckpoint(pTask, ckId, (char*)id); if (code != TSDB_CODE_SUCCESS) { @@ -770,6 +752,18 @@ void checkpointTriggerMonitorFn(void* param, void* tmrId) { streamMetaReleaseTask(pTask->pMeta, pTask); return; } + + // checkpoint-trigger recv flag is set, quit + if (pActiveInfo->allUpstreamTriggerRecv) { + int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); + stDebug("s-task:%s vgId:%d all checkpoint-trigger recv, quit from monitor checkpoint-trigger, ref:%d", + pTask->id.idStr, vgId, ref); + + taosThreadMutexUnlock(&pTask->lock); + streamMetaReleaseTask(pTask->pMeta, pTask); + return; + } + taosThreadMutexUnlock(&pTask->lock); taosThreadMutexLock(&pActiveInfo->lock); diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c index fa4efc3c6e..fae90f4db8 100644 --- a/source/libs/stream/src/streamData.c +++ b/source/libs/stream/src/streamData.c @@ -104,10 +104,12 @@ void destroyStreamDataBlock(SStreamDataBlock* pBlock) { taosFreeQitem(pBlock); } -int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData) { +int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData, const char* id) { SArray* pArray = taosArrayInit(1, sizeof(SSDataBlock)); if (pArray == NULL) { - return -1; + terrno = TSDB_CODE_OUT_OF_MEMORY; + stError("failed to prepare retrieve block, %s", id); + return terrno; } taosArrayPush(pArray, &(SSDataBlock){0}); @@ -126,7 +128,7 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock pData->reqId = pReq->reqId; pData->blocks = pArray; - return 0; + return TSDB_CODE_SUCCESS; } SStreamDataSubmit* streamDataSubmitNew(SPackedData* pData, int32_t type) { diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c index 9cdc668ec4..b17d0206f0 100644 --- a/source/libs/stream/src/streamDispatch.c +++ b/source/libs/stream/src/streamDispatch.c @@ -23,13 +23,16 @@ typedef struct SBlockName { char parTbName[TSDB_TABLE_NAME_LEN]; } SBlockName; -static void doRetryDispatchData(void* param, void* tmrId); +static void doMonitorDispatchData(void* param, void* tmrId); static int32_t doSendDispatchMsg(SStreamTask* pTask, const SStreamDispatchReq* pReq, int32_t vgId, SEpSet* pEpSet); static int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatchReq* pReq); static int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock, - int32_t vgSz, int64_t groupId); + int64_t groupId, int64_t now); static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTask* pTask, int32_t vgId, int32_t numOfBlocks, int64_t dstTaskId, int32_t type); +static int32_t getFailedDispatchInfo(SDispatchMsgInfo* pMsgInfo, int64_t now); +static bool isDispatchRspTimeout(SDispatchEntry* pEntry, int64_t now); +static void addDispatchEntry(SDispatchMsgInfo* pMsgInfo, int32_t nodeId, int64_t now, bool lock); void initRpcMsg(SRpcMsg* pMsg, int32_t msgType, void* pCont, int32_t contLen) { pMsg->msgType = msgType; @@ -42,7 +45,7 @@ static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTas pReq->streamId = pTask->id.streamId; pReq->srcVgId = vgId; pReq->stage = pTask->pMeta->stage; - pReq->msgId = pTask->execInfo.dispatch; + pReq->msgId = pTask->msgInfo.msgId; pReq->upstreamTaskId = pTask->id.taskId; pReq->upstreamChildId = pTask->info.selfChildId; pReq->upstreamNodeId = pTask->info.nodeId; @@ -65,6 +68,7 @@ static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTas void streamTaskSendRetrieveRsp(SStreamRetrieveReq *pReq, SRpcMsg* pRsp){ void* buf = rpcMallocCont(sizeof(SMsgHead) + sizeof(SStreamRetrieveRsp)); ((SMsgHead*)buf)->vgId = htonl(pReq->srcNodeId); + SStreamRetrieveRsp* pCont = POINTER_SHIFT(buf, sizeof(SMsgHead)); pCont->streamId = pReq->streamId; pCont->rspToTaskId = pReq->srcTaskId; @@ -216,26 +220,66 @@ void destroyDispatchMsg(SStreamDispatchReq* pReq, int32_t numOfVgroups) { taosMemoryFree(pReq); } -int32_t getNumOfDispatchBranch(SStreamTask* pTask) { - return (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH) - ? 1 - : taosArrayGetSize(pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos); -} - void clearBufferedDispatchMsg(SStreamTask* pTask) { SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo; if (pMsgInfo->pData != NULL) { - destroyDispatchMsg(pMsgInfo->pData, getNumOfDispatchBranch(pTask)); + destroyDispatchMsg(pMsgInfo->pData, streamTaskGetNumOfDownstream(pTask)); } pMsgInfo->checkpointId = -1; pMsgInfo->transId = -1; pMsgInfo->pData = NULL; pMsgInfo->dispatchMsgType = 0; + + taosThreadMutexLock(&pMsgInfo->lock); + taosArrayClear(pTask->msgInfo.pSendInfo); + taosThreadMutexUnlock(&pMsgInfo->lock); +} + +static SStreamDispatchReq* createDispatchDataReq(SStreamTask* pTask, const SStreamDataBlock* pData) { + int32_t code = 0; + int32_t type = pTask->outputInfo.type; + int32_t num = streamTaskGetNumOfDownstream(pTask); + + ASSERT(type == TASK_OUTPUT__SHUFFLE_DISPATCH || type == TASK_OUTPUT__FIXED_DISPATCH); + + SStreamDispatchReq* pReqs = taosMemoryCalloc(num, sizeof(SStreamDispatchReq)); + if (pReqs == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + if (type == TASK_OUTPUT__SHUFFLE_DISPATCH) { + SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; + int32_t numOfVgroups = taosArrayGetSize(vgInfo); + + for (int32_t i = 0; i < numOfVgroups; i++) { + SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, i); + code = tInitStreamDispatchReq(&pReqs[i], pTask, pData->srcVgId, 0, pVgInfo->taskId, pData->type); + if (code != TSDB_CODE_SUCCESS) { + destroyDispatchMsg(pReqs, numOfVgroups); + terrno = code; + return NULL; + } + } + } else { + int32_t numOfBlocks = taosArrayGetSize(pData->blocks); + int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId; + + code = tInitStreamDispatchReq(pReqs, pTask, pData->srcVgId, numOfBlocks, downstreamTaskId, pData->type); + if (code != TSDB_CODE_SUCCESS) { + taosMemoryFree(pReqs); + terrno = code; + return NULL; + } + } + + return pReqs; } static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pData) { int32_t code = 0; + int64_t now = taosGetTimestampMs(); int32_t numOfBlocks = taosArrayGetSize(pData->blocks); ASSERT(numOfBlocks != 0 && pTask->msgInfo.pData == NULL); @@ -247,48 +291,29 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD pTask->msgInfo.transId = p->info.window.ekey; } + SStreamDispatchReq* pReqs = createDispatchDataReq(pTask, pData); + if (pReqs == NULL) { + stError("s-task:%s failed to create dispatch req", pTask->id.idStr); + return terrno; + } + if (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH) { - SStreamDispatchReq* pReq = taosMemoryCalloc(1, sizeof(SStreamDispatchReq)); - - int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId; - code = tInitStreamDispatchReq(pReq, pTask, pData->srcVgId, numOfBlocks, downstreamTaskId, pData->type); - if (code != TSDB_CODE_SUCCESS) { - taosMemoryFree(pReq); - return code; - } - for (int32_t i = 0; i < numOfBlocks; i++) { SSDataBlock* pDataBlock = taosArrayGet(pData->blocks, i); - code = streamAddBlockIntoDispatchMsg(pDataBlock, pReq); + code = streamAddBlockIntoDispatchMsg(pDataBlock, pReqs); if (code != TSDB_CODE_SUCCESS) { - destroyDispatchMsg(pReq, 1); + destroyDispatchMsg(pReqs, 1); return code; } } - pTask->msgInfo.pData = pReq; + addDispatchEntry(&pTask->msgInfo, pTask->outputInfo.fixedDispatcher.nodeId, now, true); + pTask->msgInfo.pData = pReqs; } else if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) { - int32_t rspCnt = atomic_load_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt); - ASSERT(rspCnt == 0); SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; int32_t numOfVgroups = taosArrayGetSize(vgInfo); - SStreamDispatchReq* pReqs = taosMemoryCalloc(numOfVgroups, sizeof(SStreamDispatchReq)); - if (pReqs == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; - } - - for (int32_t i = 0; i < numOfVgroups; i++) { - SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, i); - code = tInitStreamDispatchReq(&pReqs[i], pTask, pData->srcVgId, 0, pVgInfo->taskId, pData->type); - if (code != TSDB_CODE_SUCCESS) { - destroyDispatchMsg(pReqs, numOfVgroups); - return code; - } - } - for (int32_t i = 0; i < numOfBlocks; i++) { SSDataBlock* pDataBlock = taosArrayGet(pData->blocks, i); @@ -304,7 +329,8 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD // it's a new vnode to receive dispatch msg, so add one if (pReqs[j].blockNum == 0) { - atomic_add_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1); + SVgroupInfo* pDstVgroupInfo = taosArrayGet(vgInfo, j); + addDispatchEntry(&pTask->msgInfo, pDstVgroupInfo->vgId, now, true); } pReqs[j].blockNum++; @@ -313,7 +339,7 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD continue; } - code = streamSearchAndAddBlock(pTask, pReqs, pDataBlock, numOfVgroups, pDataBlock->info.id.groupId); + code = streamSearchAndAddBlock(pTask, pReqs, pDataBlock, pDataBlock->info.id.groupId, now); if (code != 0) { destroyDispatchMsg(pReqs, numOfVgroups); return code; @@ -327,9 +353,9 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD stDebug("s-task:%s build dispatch msg success, msgId:%d, stage:%" PRId64 " %p", pTask->id.idStr, pTask->execInfo.dispatch, pTask->pMeta->stage, pTask->msgInfo.pData); } else { + int32_t numOfBranches = taosArrayGetSize(pTask->msgInfo.pSendInfo); stDebug("s-task:%s build dispatch msg success, msgId:%d, stage:%" PRId64 " dstVgNum:%d %p", pTask->id.idStr, - pTask->execInfo.dispatch, pTask->pMeta->stage, pTask->outputInfo.shuffleDispatcher.waitingRspCnt, - pTask->msgInfo.pData); + pTask->execInfo.dispatch, pTask->pMeta->stage, numOfBranches, pTask->msgInfo.pData); } return code; @@ -337,8 +363,8 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatchMsg) { int32_t code = 0; - int32_t msgId = pTask->execInfo.dispatch; const char* id = pTask->id.idStr; + int32_t msgId = pTask->msgInfo.msgId; if (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH) { int32_t vgId = pTask->outputInfo.fixedDispatcher.nodeId; @@ -352,10 +378,10 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch } else { SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; int32_t numOfVgroups = taosArrayGetSize(vgInfo); + int32_t numOfBranches = taosArrayGetSize(pTask->msgInfo.pSendInfo); - int32_t actualVgroups = pTask->outputInfo.shuffleDispatcher.waitingRspCnt; stDebug("s-task:%s (child taskId:%d) start to shuffle-dispatch blocks to %d/%d vgroup(s), msgId:%d", id, - pTask->info.selfChildId, actualVgroups, numOfVgroups, msgId); + pTask->info.selfChildId, numOfBranches, numOfVgroups, msgId); int32_t numOfSend = 0; for (int32_t i = 0; i < numOfVgroups; i++) { @@ -370,7 +396,7 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch } // no need to try remain, all already send. - if (++numOfSend == actualVgroups) { + if (++numOfSend == numOfBranches) { break; } } @@ -382,102 +408,168 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch return code; } -static void doRetryDispatchData(void* param, void* tmrId) { - SStreamTask* pTask = param; - const char* id = pTask->id.idStr; - int32_t msgId = pTask->execInfo.dispatch; +static void setNotInDispatchMonitor(SDispatchMsgInfo* pMsgInfo) { + taosThreadMutexLock(&pMsgInfo->lock); + pMsgInfo->inMonitor = 0; + taosThreadMutexUnlock(&pMsgInfo->lock); +} + +static void setResendInfo(SDispatchEntry* pEntry, int64_t now) { + pEntry->sendTs = now; + pEntry->rspTs = -1; + pEntry->retryCount += 1; +} + +static void addDispatchEntry(SDispatchMsgInfo* pMsgInfo, int32_t nodeId, int64_t now, bool lock) { + SDispatchEntry entry = {.nodeId = nodeId, .rspTs = -1, .status = 0, .sendTs = now}; + + if (lock) { + taosThreadMutexLock(&pMsgInfo->lock); + } + + taosArrayPush(pMsgInfo->pSendInfo, &entry); + + if (lock) { + taosThreadMutexUnlock(&pMsgInfo->lock); + } +} + +static void doSendFailedDispatch(SStreamTask* pTask, SDispatchEntry* pEntry, int64_t now, const char* pMsg) { + SStreamDispatchReq* pReq = pTask->msgInfo.pData; + + int32_t msgId = pTask->msgInfo.msgId; + SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; + int32_t numOfVgroups = taosArrayGetSize(vgInfo); + + setResendInfo(pEntry, now); + for (int32_t j = 0; j < numOfVgroups; ++j) { + SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j); + if (pVgInfo->vgId == pEntry->nodeId) { + int32_t code = doSendDispatchMsg(pTask, &pReq[j], pVgInfo->vgId, &pVgInfo->epSet); + stDebug("s-task:%s (child taskId:%d) shuffle-dispatch blocks:%d to vgId:%d for %s, msgId:%d, code:%s", + pTask->id.idStr, pTask->info.selfChildId, pReq[j].blockNum, pVgInfo->vgId, pMsg, msgId, tstrerror(code)); + break; + } + } +} + +static void doMonitorDispatchData(void* param, void* tmrId) { + SStreamTask* pTask = param; + const char* id = pTask->id.idStr; + int32_t vgId = pTask->pMeta->vgId; + SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo; + int32_t msgId = pMsgInfo->msgId; + int32_t code = 0; + int64_t now = taosGetTimestampMs(); + + stDebug("s-task:%s start monitor dispatch data", id); if (streamTaskShouldStop(pTask)) { int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref); + setNotInDispatchMonitor(pMsgInfo); return; } - ASSERT(pTask->outputq.status == TASK_OUTPUT_STATUS__WAIT); + // slave task not handle the dispatch, downstream not ready will break the monitor timer + // follower not handle the dispatch rsp + if ((pTask->pMeta->role == NODE_ROLE_FOLLOWER) || (pTask->status.downstreamReady != 1)) { + int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); + stError("s-task:%s vgId:%d follower or downstream not ready, jump out of monitor tmr, ref:%d", id, vgId, ref); + setNotInDispatchMonitor(pMsgInfo); + return; + } - int32_t code = 0; + taosThreadMutexLock(&pMsgInfo->lock); + if (pTask->outputq.status == TASK_OUTPUT_STATUS__NORMAL) { + int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); + stDebug("s-task:%s not in dispatch procedure, abort from timer, ref:%d", pTask->id.idStr, ref); + + pTask->msgInfo.inMonitor = 0; + taosThreadMutexUnlock(&pMsgInfo->lock); + return; + } + taosThreadMutexUnlock(&pMsgInfo->lock); + + int32_t numOfFailed = getFailedDispatchInfo(pMsgInfo, now); + if (numOfFailed == 0) { + stDebug("s-task:%s no error occurs, check again in %dms", id, DISPATCH_RETRY_INTERVAL_MS); + streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); + return; + } { - SArray* pList = taosArrayDup(pTask->msgInfo.pRetryList, NULL); - taosArrayClear(pTask->msgInfo.pRetryList); - SStreamDispatchReq* pReq = pTask->msgInfo.pData; if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) { - SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; - int32_t numOfVgroups = taosArrayGetSize(vgInfo); + stDebug("s-task:%s (child taskId:%d) retry shuffle-dispatch to down streams, msgId:%d", id, + pTask->info.selfChildId, msgId); - int32_t numOfFailed = taosArrayGetSize(pList); - stDebug("s-task:%s (child taskId:%d) retry shuffle-dispatch blocks to %d vgroup(s), msgId:%d", id, - pTask->info.selfChildId, numOfFailed, msgId); + int32_t numOfRetry = 0; + for (int32_t i = 0; i < taosArrayGetSize(pTask->msgInfo.pSendInfo); ++i) { + SDispatchEntry* pEntry = taosArrayGet(pTask->msgInfo.pSendInfo, i); + if (pEntry->status == TSDB_CODE_SUCCESS && pEntry->rspTs > 0) { + continue; + } - for (int32_t i = 0; i < numOfFailed; i++) { - int32_t vgId = *(int32_t*)taosArrayGet(pList, i); + // downstream not rsp yet beyond threshold that is 10s + if (isDispatchRspTimeout(pEntry, now)) { // not respond yet beyonds 30s, re-send data + doSendFailedDispatch(pTask, pEntry, now, "timeout"); + numOfRetry += 1; + continue; + } - for (int32_t j = 0; j < numOfVgroups; ++j) { - SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j); - if (pVgInfo->vgId == vgId) { - stDebug("s-task:%s (child taskId:%d) shuffle-dispatch blocks:%d to vgId:%d", pTask->id.idStr, - pTask->info.selfChildId, pReq[j].blockNum, pVgInfo->vgId); + // downstream inputQ is closed + if (pEntry->status == TASK_INPUT_STATUS__BLOCKED) { + doSendFailedDispatch(pTask, pEntry, now, "downstream inputQ blocked"); + numOfRetry += 1; + continue; + } - code = doSendDispatchMsg(pTask, &pReq[j], pVgInfo->vgId, &pVgInfo->epSet); - if (code < 0) { - break; - } - } + // handle other errors + if (pEntry->status != TSDB_CODE_SUCCESS) { + doSendFailedDispatch(pTask, pEntry, now, "downstream error"); + numOfRetry += 1; } } stDebug("s-task:%s complete retry shuffle-dispatch blocks to all %d vnodes, msgId:%d", pTask->id.idStr, - numOfFailed, msgId); + numOfRetry, msgId); } else { - int32_t vgId = pTask->outputInfo.fixedDispatcher.nodeId; + int32_t dstVgId = pTask->outputInfo.fixedDispatcher.nodeId; SEpSet* pEpSet = &pTask->outputInfo.fixedDispatcher.epSet; int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId; - stDebug("s-task:%s (child taskId:%d) fix-dispatch %d block(s) to s-task:0x%x (vgId:%d), msgId:%d", id, - pTask->info.selfChildId, 1, downstreamTaskId, vgId, msgId); + ASSERT(taosArrayGetSize(pTask->msgInfo.pSendInfo) == 1); + SDispatchEntry* pEntry = taosArrayGet(pTask->msgInfo.pSendInfo, 0); - code = doSendDispatchMsg(pTask, pReq, vgId, pEpSet); + setResendInfo(pEntry, now); + code = doSendDispatchMsg(pTask, pReq, dstVgId, pEpSet); + + stDebug("s-task:%s (child taskId:%d) fix-dispatch %d block(s) to s-task:0x%x (vgId:%d), msgId:%d, code:%s", id, + pTask->info.selfChildId, 1, downstreamTaskId, dstVgId, msgId, tstrerror(code)); } - - taosArrayDestroy(pList); } - if (code != TSDB_CODE_SUCCESS) { - if (!streamTaskShouldStop(pTask)) { - // stDebug("s-task:%s reset the waitRspCnt to be 0 before launch retry dispatch", pTask->id.idStr); - // atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 0); - if (streamTaskShouldPause(pTask)) { - streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS * 10); - } else { - streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); - } - } else { - int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); - stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref); - } - } else { + if (streamTaskShouldStop(pTask)) { int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); - stDebug("s-task:%s send success, jump out of timer, ref:%d", pTask->id.idStr, ref); - } -} - -void streamRetryDispatchData(SStreamTask* pTask, int64_t waitDuration) { - pTask->msgInfo.retryCount++; - - stTrace("s-task:%s retry send dispatch data in %" PRId64 "ms, in timer msgId:%d, retryTimes:%d", pTask->id.idStr, - waitDuration, pTask->execInfo.dispatch, pTask->msgInfo.retryCount); - - if (pTask->msgInfo.pRetryTmr != NULL) { - taosTmrReset(doRetryDispatchData, waitDuration, pTask, streamTimer, &pTask->msgInfo.pRetryTmr); + stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref); + setNotInDispatchMonitor(pMsgInfo); } else { - pTask->msgInfo.pRetryTmr = taosTmrStart(doRetryDispatchData, waitDuration, pTask, streamTimer); + streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); } } -int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock, int32_t vgSz, - int64_t groupId) { +void streamStartMonitorDispatchData(SStreamTask* pTask, int64_t waitDuration) { + if (pTask->msgInfo.pRetryTmr != NULL) { + taosTmrReset(doMonitorDispatchData, waitDuration, pTask, streamTimer, &pTask->msgInfo.pRetryTmr); + } else { + pTask->msgInfo.pRetryTmr = taosTmrStart(doMonitorDispatchData, waitDuration, pTask, streamTimer); + } +} + +int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock, + int64_t groupId, int64_t now) { uint32_t hashValue = 0; SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos; if (pTask->pNameMap == NULL) { @@ -495,23 +587,24 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S } else { char ctbName[TSDB_TABLE_FNAME_LEN] = {0}; if (pDataBlock->info.parTbName[0]) { - if(pTask->subtableWithoutMd5 != 1 && - !isAutoTableName(pDataBlock->info.parTbName) && - !alreadyAddGroupId(pDataBlock->info.parTbName, groupId) && - groupId != 0){ - if(pTask->ver == SSTREAM_TASK_SUBTABLE_CHANGED_VER){ + if (pTask->subtableWithoutMd5 != 1 && !isAutoTableName(pDataBlock->info.parTbName) && + !alreadyAddGroupId(pDataBlock->info.parTbName, groupId) && groupId != 0) { + if (pTask->ver == SSTREAM_TASK_SUBTABLE_CHANGED_VER) { buildCtbNameAddGroupId(NULL, pDataBlock->info.parTbName, groupId); - }else if(pTask->ver > SSTREAM_TASK_SUBTABLE_CHANGED_VER) { + } else if (pTask->ver > SSTREAM_TASK_SUBTABLE_CHANGED_VER) { buildCtbNameAddGroupId(pTask->outputInfo.shuffleDispatcher.stbFullName, pDataBlock->info.parTbName, groupId); } } } else { buildCtbNameByGroupIdImpl(pTask->outputInfo.shuffleDispatcher.stbFullName, groupId, pDataBlock->info.parTbName); } - snprintf(ctbName, TSDB_TABLE_NAME_LEN, "%s.%s", pTask->outputInfo.shuffleDispatcher.dbInfo.db, pDataBlock->info.parTbName); + + snprintf(ctbName, TSDB_TABLE_NAME_LEN, "%s.%s", pTask->outputInfo.shuffleDispatcher.dbInfo.db, + pDataBlock->info.parTbName); /*uint32_t hashValue = MurmurHash3_32(ctbName, strlen(ctbName));*/ SUseDbRsp* pDbInfo = &pTask->outputInfo.shuffleDispatcher.dbInfo; - hashValue = taosGetTbHashVal(ctbName, strlen(ctbName), pDbInfo->hashMethod, pDbInfo->hashPrefix, pDbInfo->hashSuffix); + hashValue = + taosGetTbHashVal(ctbName, strlen(ctbName), pDbInfo->hashMethod, pDbInfo->hashPrefix, pDbInfo->hashSuffix); SBlockName bln = {0}; bln.hashValue = hashValue; memcpy(bln.parTbName, pDataBlock->info.parTbName, strlen(pDataBlock->info.parTbName)); @@ -520,20 +613,24 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S } } - bool found = false; + bool found = false; + int32_t numOfVgroups = taosArrayGetSize(vgInfo); + // TODO: optimize search - int32_t j; - for (j = 0; j < vgSz; j++) { + taosThreadMutexLock(&pTask->msgInfo.lock); + + for (int32_t j = 0; j < numOfVgroups; j++) { SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j); - ASSERT(pVgInfo->vgId > 0); if (hashValue >= pVgInfo->hashBegin && hashValue <= pVgInfo->hashEnd) { if (streamAddBlockIntoDispatchMsg(pDataBlock, &pReqs[j]) < 0) { + taosThreadMutexUnlock(&pTask->msgInfo.lock); return -1; } if (pReqs[j].blockNum == 0) { - atomic_add_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1); + SVgroupInfo* pDstVgroupInfo = taosArrayGet(vgInfo, j); + addDispatchEntry(&pTask->msgInfo, pDstVgroupInfo->vgId, now, false); } pReqs[j].blockNum++; @@ -541,10 +638,28 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S break; } } + + taosThreadMutexUnlock(&pTask->msgInfo.lock); ASSERT(found); return 0; } +static void initDispatchInfo(SDispatchMsgInfo* pInfo, int32_t msgId) { + pInfo->startTs = taosGetTimestampMs(); + pInfo->rspTs = -1; + pInfo->msgId = msgId; +} + +static void clearDispatchInfo(SDispatchMsgInfo* pInfo) { + pInfo->startTs = -1; + pInfo->msgId = -1; + pInfo->rspTs = -1; +} + +static void updateDispatchInfo(SDispatchMsgInfo* pInfo, int64_t recvTs) { + pInfo->rspTs = recvTs; +} + int32_t streamDispatchStreamBlock(SStreamTask* pTask) { ASSERT((pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH || pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH)); @@ -587,7 +702,7 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) { type == STREAM_INPUT__TRANS_STATE); pTask->execInfo.dispatch += 1; - pTask->msgInfo.startTs = taosGetTimestampMs(); + initDispatchInfo(&pTask->msgInfo, pTask->execInfo.dispatch); int32_t code = doBuildDispatchMsg(pTask, pBlock); if (code == 0) { @@ -599,34 +714,21 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) { streamTaskInitTriggerDispatchInfo(pTask); } - int32_t retryCount = 0; - while (1) { - code = sendDispatchMsg(pTask, pTask->msgInfo.pData); - if (code == TSDB_CODE_SUCCESS) { - break; - } + code = sendDispatchMsg(pTask, pTask->msgInfo.pData); - stDebug("s-task:%s failed to dispatch msg:%d to downstream, code:%s, output status:%d, retry cnt:%d", id, - pTask->execInfo.dispatch, tstrerror(terrno), pTask->outputq.status, retryCount); - - // todo deal with only partially success dispatch case - atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 0); - if (terrno == TSDB_CODE_APP_IS_STOPPING) { // in case of this error, do not retry anymore - clearBufferedDispatchMsg(pTask); - return code; - } - - if (++retryCount > MAX_CONTINUE_RETRY_COUNT) { // add to timer to retry - int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1); - stDebug( - "s-task:%s failed to dispatch msg to downstream for %d times, code:%s, add timer to retry in %dms, ref:%d", - pTask->id.idStr, retryCount, tstrerror(terrno), DISPATCH_RETRY_INTERVAL_MS, ref); - - streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); - break; - } + taosThreadMutexLock(&pTask->msgInfo.lock); + if (pTask->msgInfo.inMonitor == 0) { + int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1); + stDebug("s-task:%s start dispatch monitor tmr in %dms, ref:%d, dispatch code:%s", id, DISPATCH_RETRY_INTERVAL_MS, ref, + tstrerror(code)); + streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); + pTask->msgInfo.inMonitor = 1; + } else { + stDebug("s-task:%s already in dispatch monitor tmr", id); } + taosThreadMutexUnlock(&pTask->msgInfo.lock); + // this block can not be deleted until it has been sent to downstream task successfully. return TSDB_CODE_SUCCESS; } @@ -817,8 +919,10 @@ int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatch int32_t dataStrLen = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN; ASSERT(dataStrLen > 0); - void* buf = taosMemoryCalloc(1, dataStrLen); - if (buf == NULL) return -1; + void* buf = taosMemoryCalloc(1, dataStrLen); + if (buf == NULL) { + return -1; + } SRetrieveTableRsp* pRetrieve = (SRetrieveTableRsp*)buf; pRetrieve->useconds = 0; @@ -1031,23 +1135,6 @@ static int32_t handleDispatchSuccessRsp(SStreamTask* pTask, int32_t downstreamId stDebug("s-task:%s destroy dispatch msg:%p", pTask->id.idStr, pTask->msgInfo.pData); bool delayDispatch = (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER); - if (delayDispatch) { - taosThreadMutexLock(&pTask->lock); - // we only set the dispatch msg info for current checkpoint trans - if (streamTaskGetStatus(pTask)->state == TASK_STATUS__CK && - pTask->chkInfo.pActiveInfo->activeId == pTask->msgInfo.checkpointId) { - ASSERT(pTask->chkInfo.pActiveInfo->transId == pTask->msgInfo.transId); - stDebug("s-task:%s checkpoint-trigger msg to 0x%x rsp for checkpointId:%" PRId64 " transId:%d confirmed", - pTask->id.idStr, downstreamId, pTask->msgInfo.checkpointId, pTask->msgInfo.transId); - - streamTaskSetTriggerDispatchConfirmed(pTask, downstreamNodeId); - } else { - stWarn("s-task:%s checkpoint-trigger msg rsp for checkpointId:%" PRId64 " transId:%d discard, since expired", - pTask->id.idStr, pTask->msgInfo.checkpointId, pTask->msgInfo.transId); - } - taosThreadMutexUnlock(&pTask->lock); - } - clearBufferedDispatchMsg(pTask); int64_t el = taosGetTimestampMs() - pTask->msgInfo.startTs; @@ -1074,17 +1161,59 @@ static int32_t handleDispatchSuccessRsp(SStreamTask* pTask, int32_t downstreamId return 0; } -int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, int32_t code) { - const char* id = pTask->id.idStr; - int32_t vgId = pTask->pMeta->vgId; - int32_t msgId = pTask->execInfo.dispatch; +static int32_t setDispatchRspInfo(SDispatchMsgInfo* pMsgInfo, int32_t vgId, int32_t code, int64_t now, const char* id) { + int32_t numOfRsp = 0; + bool alreadySet = false; + bool updated = false; -#if 0 - // for test purpose, build the failure case - if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER) { - pRsp->inputStatus = TASK_INPUT_STATUS__REFUSED; + taosThreadMutexLock(&pMsgInfo->lock); + for(int32_t j = 0; j < taosArrayGetSize(pMsgInfo->pSendInfo); ++j) { + SDispatchEntry* pEntry = taosArrayGet(pMsgInfo->pSendInfo, j); + if (pEntry->nodeId == vgId) { + ASSERT(!alreadySet); + pEntry->rspTs = now; + pEntry->status = code; + alreadySet = true; + updated = true; + stDebug("s-task:%s record the rsp recv, ts:%"PRId64" code:%d, idx:%d", id, now, code, j); + } + + if (pEntry->rspTs != -1) { + numOfRsp += 1; + } } -#endif + + taosThreadMutexUnlock(&pMsgInfo->lock); + ASSERT(updated); + + return numOfRsp; +} + +bool isDispatchRspTimeout(SDispatchEntry* pEntry, int64_t now) { + return (pEntry->rspTs == -1) && (now - pEntry->sendTs) > 30 * 1000; +} + +int32_t getFailedDispatchInfo(SDispatchMsgInfo* pMsgInfo, int64_t now) { + int32_t numOfFailed = 0; + taosThreadMutexLock(&pMsgInfo->lock); + + for (int32_t j = 0; j < taosArrayGetSize(pMsgInfo->pSendInfo); ++j) { + SDispatchEntry* pEntry = taosArrayGet(pMsgInfo->pSendInfo, j); + if (pEntry->status != TSDB_CODE_SUCCESS || isDispatchRspTimeout(pEntry, now)) { + numOfFailed += 1; + } + } + taosThreadMutexUnlock(&pMsgInfo->lock); + return numOfFailed; +} + +int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, int32_t code) { + const char* id = pTask->id.idStr; + int32_t vgId = pTask->pMeta->vgId; + SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo; + int32_t msgId = pMsgInfo->msgId; + int64_t now = taosGetTimestampMs(); + int32_t totalRsp = 0; // follower not handle the dispatch rsp if ((pTask->pMeta->role == NODE_ROLE_FOLLOWER) || (pTask->status.downstreamReady != 1)) { @@ -1109,53 +1238,61 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i if (code == TSDB_CODE_STREAM_TASK_NOT_EXIST) { // destination task does not exist, not retry anymore stError("s-task:%s failed to dispatch msg to task:0x%x(vgId:%d), msgId:%d no retry, since task destroyed already", id, pRsp->downstreamTaskId, pRsp->downstreamNodeId, msgId); + totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, TSDB_CODE_SUCCESS, now, id); } else { stError("s-task:%s failed to dispatch msgId:%d to task:0x%x(vgId:%d), code:%s, add to retry list", id, msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, tstrerror(code)); - taosThreadMutexLock(&pTask->lock); - taosArrayPush(pTask->msgInfo.pRetryList, &pRsp->downstreamNodeId); - taosThreadMutexUnlock(&pTask->lock); + totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, code, now, id); } } else { // code == 0 if (pRsp->inputStatus == TASK_INPUT_STATUS__BLOCKED) { pTask->inputq.status = TASK_INPUT_STATUS__BLOCKED; // block the input of current task, to push pressure to upstream - taosThreadMutexLock(&pTask->lock); - taosArrayPush(pTask->msgInfo.pRetryList, &pRsp->downstreamNodeId); - taosThreadMutexUnlock(&pTask->lock); + totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, pRsp->inputStatus, now, id); + stTrace("s-task:%s inputQ of downstream task:0x%x(vgId:%d) is full, wait for retry dispatch", id, + pRsp->downstreamTaskId, pRsp->downstreamNodeId); + } else { + if (pRsp->inputStatus == TASK_INPUT_STATUS__REFUSED) { + // todo handle the role-changed during checkpoint generation, add test case + stError( + "s-task:%s downstream task:0x%x(vgId:%d) refused the dispatch msg, downstream may become follower or " + "restart already, treat it as success", + id, pRsp->downstreamTaskId, pRsp->downstreamNodeId); + } - stTrace("s-task:%s inputQ of downstream task:0x%x(vgId:%d) is full, wait for %dms and retry dispatch", id, - pRsp->downstreamTaskId, pRsp->downstreamNodeId, DISPATCH_RETRY_INTERVAL_MS); - } else if (pRsp->inputStatus == TASK_INPUT_STATUS__REFUSED) { - // todo handle the agg task failure, add test case - if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER && - pTask->info.taskLevel == TASK_LEVEL__SOURCE) { - stError("s-task:%s failed to dispatch checkpoint-trigger msg, checkpointId:%" PRId64 - ", set the current checkpoint failed, and send rsp to mnode", - id, pTask->chkInfo.pActiveInfo->activeId); - { // send checkpoint failure msg to mnode directly - pTask->chkInfo.pActiveInfo->failedId = pTask->chkInfo.pActiveInfo->activeId; // record the latest failed checkpoint id - pTask->chkInfo.pActiveInfo->activeId = pTask->chkInfo.pActiveInfo->activeId; - streamTaskSendCheckpointSourceRsp(pTask); + totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, TSDB_CODE_SUCCESS, now, id); + + { + bool delayDispatch = (pMsgInfo->dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER); + if (delayDispatch) { + taosThreadMutexLock(&pTask->lock); + // we only set the dispatch msg info for current checkpoint trans + if (streamTaskGetStatus(pTask)->state == TASK_STATUS__CK && + pTask->chkInfo.pActiveInfo->activeId == pMsgInfo->checkpointId) { + ASSERT(pTask->chkInfo.pActiveInfo->transId == pMsgInfo->transId); + stDebug("s-task:%s checkpoint-trigger msg to 0x%x rsp for checkpointId:%" PRId64 " transId:%d confirmed", + pTask->id.idStr, pRsp->downstreamTaskId, pMsgInfo->checkpointId, pMsgInfo->transId); + + streamTaskSetTriggerDispatchConfirmed(pTask, pRsp->downstreamNodeId); + } else { + stWarn("s-task:%s checkpoint-trigger msg rsp for checkpointId:%" PRId64 + " transId:%d discard, since expired", + pTask->id.idStr, pMsgInfo->checkpointId, pMsgInfo->transId); + } + taosThreadMutexUnlock(&pTask->lock); } - } else { - stError("s-task:%s downstream task:0x%x(vgId:%d) refused the dispatch msg, treat it as success", id, - pRsp->downstreamTaskId, pRsp->downstreamNodeId); } } } - int32_t leftRsp = 0; + int32_t notRsp = taosArrayGetSize(pMsgInfo->pSendInfo) - totalRsp; if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) { - leftRsp = atomic_sub_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1); - ASSERT(leftRsp >= 0); - - if (leftRsp > 0) { + if (notRsp > 0) { stDebug( "s-task:%s recv dispatch rsp, msgId:%d from 0x%x(vgId:%d), downstream task input status:%d code:%s, waiting " "for %d rsp", - id, msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code), leftRsp); + id, msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code), notRsp); } else { stDebug( "s-task:%s recv dispatch rsp, msgId:%d from 0x%x(vgId:%d), downstream task input status:%d code:%s, all rsp", @@ -1166,31 +1303,17 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code)); } - ASSERT(leftRsp >= 0); - // all msg rsp already, continue - if (leftRsp == 0) { + if (notRsp == 0) { ASSERT(pTask->outputq.status == TASK_OUTPUT_STATUS__WAIT); // we need to re-try send dispatch msg to downstream tasks - int32_t numOfFailed = taosArrayGetSize(pTask->msgInfo.pRetryList); - if (numOfFailed > 0) { - if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) { - atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, numOfFailed); - stDebug("s-task:%s waiting rsp set to be %d", id, pTask->outputInfo.shuffleDispatcher.waitingRspCnt); - } - - int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1); - stDebug("s-task:%s failed to dispatch msg to downstream, add into timer to retry in %dms, ref:%d", - pTask->id.idStr, DISPATCH_RETRY_INTERVAL_MS, ref); - - streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS); - } else { // this message has been sent successfully, let's try next one. - pTask->msgInfo.retryCount = 0; - + int32_t numOfFailed = getFailedDispatchInfo(pMsgInfo, now); + if (numOfFailed == 0) { // this message has been sent successfully, let's try next one. // trans-state msg has been sent to downstream successfully. let's transfer the fill-history task state - if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__TRANS_STATE) { - stDebug("s-task:%s dispatch trans-state msgId:%d to downstream successfully, start to prepare transfer state", id, msgId); + if (pMsgInfo->dispatchMsgType == STREAM_INPUT__TRANS_STATE) { + stDebug("s-task:%s dispatch trans-state msgId:%d to downstream successfully, start to prepare transfer state", + id, msgId); ASSERT(pTask->info.fillHistory == 1); code = streamTransferStatePrepare(pTask); @@ -1309,7 +1432,5 @@ int32_t streamProcessDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pReq, S } streamTrySchedExec(pTask); - return 0; } - diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 1828409f89..b0915640cc 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -541,14 +541,14 @@ int32_t streamProcessTransstateBlock(SStreamTask* pTask, SStreamDataBlock* pBloc //static void streamTaskSetIdleInfo(SStreamTask* pTask, int32_t idleTime) { pTask->status.schedIdleTime = idleTime; } static void setLastExecTs(SStreamTask* pTask, int64_t ts) { pTask->status.lastExecTs = ts; } -static void doStreamTaskExecImpl(SStreamTask* pTask, SStreamQueueItem* pBlock) { +static void doStreamTaskExecImpl(SStreamTask* pTask, SStreamQueueItem* pBlock, int32_t num) { const char* id = pTask->id.idStr; int32_t blockSize = 0; int64_t st = taosGetTimestampMs(); SCheckpointInfo* pInfo = &pTask->chkInfo; int64_t ver = pInfo->processedVer; - stDebug("s-task:%s start to process batch of blocks, num:%d, type:%s", id, 1, "checkpoint-trigger"); + stDebug("s-task:%s start to process batch blocks, num:%d, type:%s", id, num, streamQueueItemGetTypeStr(pBlock->type)); doSetStreamInputBlock(pTask, pBlock, &ver, id); @@ -607,7 +607,7 @@ void flushStateDataInExecutor(SStreamTask* pTask, SStreamQueueItem* pCheckpointB } // 2. flush data in executor to K/V store, which should be completed before do checkpoint in the K/V. - doStreamTaskExecImpl(pTask, pCheckpointBlock); + doStreamTaskExecImpl(pTask, pCheckpointBlock, 1); } /** @@ -615,7 +615,7 @@ void flushStateDataInExecutor(SStreamTask* pTask, SStreamQueueItem* pCheckpointB * appropriate batch of blocks should be handled in 5 to 10 sec. */ static int32_t doStreamExecTask(SStreamTask* pTask) { - const char* id = pTask->id.idStr; + const char* id = pTask->id.idStr; // merge multiple input data if possible in the input queue. stDebug("s-task:%s start to extract data block from inputQ", id); @@ -643,7 +643,7 @@ static int32_t doStreamExecTask(SStreamTask* pTask) { } if (taosGetTimestampMs() - pTask->status.lastExecTs < MIN_INVOKE_INTERVAL) { - stDebug("s-task:%s invoke with high frequency, idle and retry exec in 50ms", id); + stDebug("s-task:%s invoke exec too fast, idle and retry in 50ms", id); streamTaskSetIdleInfo(pTask, MIN_INVOKE_INTERVAL); return 0; } @@ -698,21 +698,16 @@ static int32_t doStreamExecTask(SStreamTask* pTask) { } if (type != STREAM_INPUT__CHECKPOINT) { - doStreamTaskExecImpl(pTask, pInput); - } - - streamFreeQitem(pInput); - - // todo other thread may change the status + doStreamTaskExecImpl(pTask, pInput, numOfBlocks); + streamFreeQitem(pInput); + } else { // todo other thread may change the status // do nothing after sync executor state to storage backend, untill the vnode-level checkpoint is completed. - if (type == STREAM_INPUT__CHECKPOINT) { - // todo add lock + taosThreadMutexLock(&pTask->lock); SStreamTaskState* pState = streamTaskGetStatus(pTask); if (pState->state == TASK_STATUS__CK) { stDebug("s-task:%s checkpoint block received, set status:%s", id, pState->name); streamTaskBuildCheckpoint(pTask); - } else { - // todo refactor + } else { // todo refactor int32_t code = 0; if (pTask->info.taskLevel == TASK_LEVEL__SOURCE) { code = streamTaskSendCheckpointSourceRsp(pTask); @@ -727,6 +722,8 @@ static int32_t doStreamExecTask(SStreamTask* pTask) { } } + taosThreadMutexUnlock(&pTask->lock); + streamFreeQitem(pInput); return 0; } } diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index f6449829a3..e8800c3370 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -299,8 +299,8 @@ void streamMetaRemoveDB(void* arg, char* key) { taosThreadMutexUnlock(&pMeta->backendMutex); } -SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc, int32_t vgId, int64_t stage, - startComplete_fn_t fn) { +SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskBuild buildTaskFn, FTaskExpand expandTaskFn, + int32_t vgId, int64_t stage, startComplete_fn_t fn) { SStreamMeta* pMeta = taosMemoryCalloc(1, sizeof(SStreamMeta)); if (pMeta == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -369,9 +369,11 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF pMeta->scanInfo.scanCounter = 0; pMeta->vgId = vgId; pMeta->ahandle = ahandle; - pMeta->expandFunc = expandFunc; + pMeta->buildTaskFn = buildTaskFn; + pMeta->expandTaskFn = expandTaskFn; pMeta->stage = stage; pMeta->role = (vgId == SNODE_HANDLE) ? NODE_ROLE_LEADER : NODE_ROLE_UNINIT; + pMeta->updateInfo.transId = -1; pMeta->startInfo.completeFn = fn; pMeta->pTaskDbUnique = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); @@ -601,11 +603,12 @@ int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTa return 0; } - if (pMeta->expandFunc(pMeta->ahandle, pTask, ver) < 0) { + if (pMeta->buildTaskFn(pMeta->ahandle, pTask, ver) < 0) { return -1; } taosArrayPush(pMeta->pTaskList, &pTask->id); + taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES); if (streamMetaSaveTask(pMeta, pTask) < 0) { return -1; @@ -615,7 +618,6 @@ int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTa return -1; } - taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES); if (pTask->info.fillHistory == 0) { atomic_add_fetch_32(&pMeta->numOfStreamTasks, 1); } @@ -670,14 +672,17 @@ void streamMetaReleaseTask(SStreamMeta* UNUSED_PARAM(pMeta), SStreamTask* pTask) } } -static void doRemoveIdFromList(SStreamMeta* pMeta, int32_t num, SStreamTaskId* id) { +static void doRemoveIdFromList(SArray* pTaskList, int32_t num, SStreamTaskId* id) { + bool remove = false; for (int32_t i = 0; i < num; ++i) { - SStreamTaskId* pTaskId = taosArrayGet(pMeta->pTaskList, i); + SStreamTaskId* pTaskId = taosArrayGet(pTaskList, i); if (pTaskId->streamId == id->streamId && pTaskId->taskId == id->taskId) { - taosArrayRemove(pMeta->pTaskList, i); + taosArrayRemove(pTaskList, i); + remove = true; break; } } + ASSERT(remove); } static int32_t streamTaskSendTransSuccessMsg(SStreamTask* pTask, void* param) { @@ -713,7 +718,7 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t } streamMetaWUnLock(pMeta); - stDebug("s-task:0x%x set task status:dropping and start to unregister it", taskId); + stDebug("s-task:0x%x vgId:%d set task status:dropping and start to unregister it", taskId, pMeta->vgId); while (1) { streamMetaRLock(pMeta); @@ -740,18 +745,19 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t ppTask = (SStreamTask**)taosHashGet(pMeta->pTasksMap, &id, sizeof(id)); if (ppTask) { pTask = *ppTask; - // it is an fill-history task, remove the related stream task's id that points to it - atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1); + if (pTask->info.fillHistory == 0) { + atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1); + } taosHashRemove(pMeta->pTasksMap, &id, sizeof(id)); - doRemoveIdFromList(pMeta, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id); + doRemoveIdFromList(pMeta->pTaskList, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id); streamMetaRemoveTask(pMeta, &id); + ASSERT(taosHashGetSize(pMeta->pTasksMap) == taosArrayGetSize(pMeta->pTaskList)); streamMetaWUnLock(pMeta); ASSERT(pTask->status.timerActive == 0); - if (pTask->info.delaySchedParam != 0 && pTask->info.fillHistory == 0) { stDebug("s-task:%s stop schedTimer, and (before) desc ref:%d", pTask->id.idStr, pTask->refCnt); taosTmrStop(pTask->schedInfo.pDelayTimer); @@ -900,7 +906,7 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta) { STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId}; void* p = taosHashGet(pMeta->pTasksMap, &id, sizeof(id)); if (p == NULL) { - code = pMeta->expandFunc(pMeta->ahandle, pTask, pTask->chkInfo.checkpointVer + 1); + code = pMeta->buildTaskFn(pMeta->ahandle, pTask, pTask->chkInfo.checkpointVer + 1); if (code < 0) { stError("failed to expand s-task:0x%"PRIx64", code:%s, continue", id.taskId, tstrerror(terrno)); tFreeStreamTask(pTask); @@ -1005,9 +1011,10 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) { hbMsg.pUpdateNodes = taosArrayInit(numOfTasks, sizeof(int32_t)); for (int32_t i = 0; i < numOfTasks; ++i) { - STaskId* pId = taosArrayGet(pMeta->pTaskList, i); + SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i); - SStreamTask** pTask = taosHashGet(pMeta->pTasksMap, pId, sizeof(*pId)); + STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId}; + SStreamTask** pTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id)); if (pTask == NULL) { continue; } @@ -1018,7 +1025,7 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) { } STaskStatusEntry entry = { - .id = *pId, + .id = id, .status = streamTaskGetStatus(*pTask)->state, .nodeId = hbMsg.vgId, .stage = pMeta->stage, @@ -1506,8 +1513,9 @@ int32_t streamMetaStopAllTasks(SStreamMeta* pMeta) { bool streamMetaAllTasksReady(const SStreamMeta* pMeta) { int32_t num = taosArrayGetSize(pMeta->pTaskList); for (int32_t i = 0; i < num; ++i) { - STaskId* pTaskId = taosArrayGet(pMeta->pTaskList, i); - SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, pTaskId, sizeof(*pTaskId)); + SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i); + STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId}; + SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id)); if (ppTask == NULL) { continue; } @@ -1521,6 +1529,7 @@ bool streamMetaAllTasksReady(const SStreamMeta* pMeta) { } int32_t streamMetaStartOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId, __stream_task_expand_fn expandFn) { + int32_t code = 0; int32_t vgId = pMeta->vgId; stInfo("vgId:%d start task:0x%x by checking it's downstream status", vgId, taskId); @@ -1540,40 +1549,22 @@ int32_t streamMetaStartOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t tas ASSERT(pTask->status.downstreamReady == 0); if (pTask->pBackend == NULL) { - int32_t code = expandFn(pTask); + code = expandFn(pTask); if (code != TSDB_CODE_SUCCESS) { streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs); - streamMetaReleaseTask(pMeta, pTask); - return code; - } - - if (HAS_RELATED_FILLHISTORY_TASK(pTask)) { - SStreamTask* pHTask = streamMetaAcquireTask(pMeta, pTask->hTaskInfo.id.streamId, pTask->hTaskInfo.id.taskId); - if (pHTask != NULL) { - if (pHTask->pBackend == NULL) { - code = expandFn(pHTask); - if (code != TSDB_CODE_SUCCESS) { - streamMetaAddFailedTaskSelf(pHTask, pInfo->readyTs); - - streamMetaReleaseTask(pMeta, pHTask); - streamMetaReleaseTask(pMeta, pTask); - return code; - } - } - - streamMetaReleaseTask(pMeta, pHTask); - } } } - int32_t ret = streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_INIT); - if (ret != TSDB_CODE_SUCCESS) { - stError("s-task:%s vgId:%d failed to handle event:%d", pTask->id.idStr, pMeta->vgId, TASK_EVENT_INIT); - streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs); + if (code == TSDB_CODE_SUCCESS) { + code = streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_INIT); + if (code != TSDB_CODE_SUCCESS) { + stError("s-task:%s vgId:%d failed to handle event:%d", pTask->id.idStr, pMeta->vgId, TASK_EVENT_INIT); + streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs); + } } streamMetaReleaseTask(pMeta, pTask); - return ret; + return code; } static void displayStatusInfo(SStreamMeta* pMeta, SHashObj* pTaskSet, bool succ) { @@ -1740,4 +1731,14 @@ void streamMetaAddIntoUpdateTaskList(SStreamMeta* pMeta, SStreamTask* pTask, SSt stDebug("s-task:%s vgId:%d transId:%d task nodeEp update completed, streamTask closed, elapsed time:%" PRId64 "ms", id, vgId, transId, el); } +} + +void streamMetaClearUpdateTaskList(SStreamMeta* pMeta) { + taosHashClear(pMeta->updateInfo.pTasks); + pMeta->updateInfo.transId = -1; +} + +void streamMetaInitUpdateTaskList(SStreamMeta* pMeta, int32_t transId) { + taosHashClear(pMeta->updateInfo.pTasks); + pMeta->updateInfo.transId = transId; } \ No newline at end of file diff --git a/source/libs/stream/src/streamSessionState.c b/source/libs/stream/src/streamSessionState.c index 4c61e6da1d..84db657392 100644 --- a/source/libs/stream/src/streamSessionState.c +++ b/source/libs/stream/src/streamSessionState.c @@ -516,24 +516,25 @@ SStreamStateCur* countWinStateSeekKeyPrev(SStreamFileState* pFileState, const SS return pBuffCur; } winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE)))); + taosMemoryFreeClear(pVal); + streamStateFreeCur(pBuffCur); if (sessionRangeKeyCmpr(pWinKey, &key) != 0 && winCount == count) { - streamStateFreeCur(pCur); - return pBuffCur; + streamStateCurNext(pFileStore, pCur); + return pCur; } streamStateCurPrev(pFileStore, pCur); while (1) { code = streamStateSessionGetKVByCur_rocksdb(pCur, &key, &pVal, &len); if (code == TSDB_CODE_FAILED) { streamStateCurNext(pFileStore, pCur); - streamStateFreeCur(pBuffCur); return pCur; } winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE)))); + taosMemoryFreeClear(pVal); if (sessionRangeKeyCmpr(pWinKey, &key) == 0 || winCount < count) { streamStateCurPrev(pFileStore, pCur); } else { streamStateCurNext(pFileStore, pCur); - streamStateFreeCur(pBuffCur); return pCur; } } @@ -568,7 +569,7 @@ int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void void* pData = NULL; code = streamStateSessionGetKVByCur_rocksdb(pCur, pKey, &pData, pVLen); if (taosArrayGetSize(pWinStates) > 0 && - (code == TSDB_CODE_FAILED || sessionStateKeyCompare(pKey, pWinStates, 0) >= 0)) { + (code == TSDB_CODE_FAILED || sessionStateRangeKeyCompare(pKey, pWinStates, 0) >= 0)) { transformCursor(pCur->pStreamFileState, pCur); SRowBuffPos* pPos = taosArrayGetP(pWinStates, pCur->buffIndex); if (pVal) { @@ -590,6 +591,7 @@ int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void } int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur) { + qTrace("move cursor to next"); if (pCur && pCur->buffIndex >= 0) { pCur->buffIndex++; } else { @@ -872,9 +874,8 @@ int32_t createCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey void* pFileStore = getStateFileStore(pFileState); void* p = NULL; - SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileStore, pKey->groupId); - int32_t code_file = streamStateSessionGetKVByCur_rocksdb(pCur, pWinKey, &p, pVLen); - if (code_file == TSDB_CODE_SUCCESS || isFlushedState(pFileState, endTs, 0)) { + int32_t code_file = getCountWinStateFromDisc(pFileStore, pWinKey, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS && isFlushedState(pFileState, endTs, 0)) { (*pVal) = createSessionWinBuff(pFileState, pWinKey, p, pVLen); code = code_file; qDebug("===stream===0 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code_file); @@ -883,7 +884,6 @@ int32_t createCountWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey code = TSDB_CODE_FAILED; taosMemoryFree(p); } - streamStateFreeCur(pCur); goto _end; } else { (*pVal) = addNewSessionWindow(pFileState, pWinStates, pWinKey); diff --git a/source/libs/stream/src/streamStartHistory.c b/source/libs/stream/src/streamStartHistory.c index 7a864a60d2..050d88aaf1 100644 --- a/source/libs/stream/src/streamStartHistory.c +++ b/source/libs/stream/src/streamStartHistory.c @@ -197,6 +197,9 @@ int32_t streamLaunchFillHistoryTask(SStreamTask* pTask) { const char* idStr = pTask->id.idStr; int64_t hStreamId = pTask->hTaskInfo.id.streamId; int32_t hTaskId = pTask->hTaskInfo.id.taskId; + int64_t now = taosGetTimestampMs(); + int32_t code = 0; + ASSERT(hTaskId != 0); // check stream task status in the first place. @@ -226,7 +229,18 @@ int32_t streamLaunchFillHistoryTask(SStreamTask* pTask) { stDebug("s-task:%s fill-history task is ready, no need to check downstream", pHisTask->id.idStr); streamMetaAddTaskLaunchResult(pMeta, hStreamId, hTaskId, pExecInfo->checkTs, pExecInfo->readyTs, true); } else { // exist, but not ready, continue check downstream task status - checkFillhistoryTaskStatus(pTask, pHisTask); + if (pHisTask->pBackend == NULL) { + code = pMeta->expandTaskFn(pHisTask); + if (code != TSDB_CODE_SUCCESS) { + streamMetaAddFailedTaskSelf(pHisTask, now); + stError("s-task:%s failed to expand fill-history task, code:%s", pHisTask->id.idStr, tstrerror(code)); + } + } + + if (code == TSDB_CODE_SUCCESS) { + checkFillhistoryTaskStatus(pTask, pHisTask); + } + } streamMetaReleaseTask(pMeta, pHisTask); @@ -306,6 +320,7 @@ void tryLaunchHistoryTask(void* param, void* tmrId) { SLaunchHTaskInfo* pInfo = param; SStreamMeta* pMeta = pInfo->pMeta; int64_t now = taosGetTimestampMs(); + int32_t code = 0; streamMetaWLock(pMeta); @@ -362,13 +377,22 @@ void tryLaunchHistoryTask(void* param, void* tmrId) { streamMetaReleaseTask(pMeta, pTask); return; } else { - checkFillhistoryTaskStatus(pTask, pHTask); - streamMetaReleaseTask(pMeta, pHTask); + if (pHTask->pBackend == NULL) { + code = pMeta->expandTaskFn(pHTask); + if (code != TSDB_CODE_SUCCESS) { + streamMetaAddFailedTaskSelf(pHTask, now); + stError("failed to expand fill-history task:%s, code:%s", pHTask->id.idStr, tstrerror(code)); + } + } - // not in timer anymore - int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); - stDebug("s-task:0x%x fill-history task launch completed, retry times:%d, ref:%d", (int32_t)pInfo->id.taskId, - pHTaskInfo->retryTimes, ref); + if (code == TSDB_CODE_SUCCESS) { + checkFillhistoryTaskStatus(pTask, pHTask); + // not in timer anymore + int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1); + stDebug("s-task:0x%x fill-history task launch completed, retry times:%d, ref:%d", (int32_t)pInfo->id.taskId, + pHTaskInfo->retryTimes, ref); + } + streamMetaReleaseTask(pMeta, pHTask); } } diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index 47324bd8c9..a817070d5b 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -98,7 +98,7 @@ int stateKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2) { return winKeyCmprImpl(&pWin1->key, &pWin2->key); } -SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages) { +SStreamState* streamStateOpen(const char* path, void* pTask, int64_t streamId, int32_t taskId) { SStreamState* pState = taosMemoryCalloc(1, sizeof(SStreamState)); stDebug("open stream state %p, %s", pState, path); if (pState == NULL) { @@ -114,8 +114,8 @@ SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int3 } SStreamTask* pStreamTask = pTask; - pState->taskId = pStreamTask->id.taskId; - pState->streamId = pStreamTask->id.streamId; + pState->streamId = streamId; + pState->taskId = taskId; sprintf(pState->pTdbState->idstr, "0x%" PRIx64 "-0x%x", pState->streamId, pState->taskId); streamTaskSetDb(pStreamTask->pMeta, pTask, pState->pTdbState->idstr); @@ -654,6 +654,7 @@ int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur) { int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur) { #ifdef USE_ROCKSDB + qTrace("move cursor to next"); return streamStateCurPrev_rocksdb(pCur); #else if (!pCur) { @@ -1095,7 +1096,9 @@ _end: int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char tbname[TSDB_TABLE_NAME_LEN]) { #ifdef USE_ROCKSDB if (tSimpleHashGet(pState->parNameMap, &groupId, sizeof(int64_t)) == NULL) { - tSimpleHashPut(pState->parNameMap, &groupId, sizeof(int64_t), tbname, TSDB_TABLE_NAME_LEN); + if (tSimpleHashGetSize(pState->parNameMap) < MAX_TABLE_NAME_NUM) { + tSimpleHashPut(pState->parNameMap, &groupId, sizeof(int64_t), tbname, TSDB_TABLE_NAME_LEN); + } streamStatePutParName_rocksdb(pState, groupId, tbname); } return TSDB_CODE_SUCCESS; @@ -1105,12 +1108,15 @@ int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char #endif } -int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal) { +int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal, bool onlyCache) { #ifdef USE_ROCKSDB void* pStr = tSimpleHashGet(pState->parNameMap, &groupId, sizeof(int64_t)); if (!pStr) { + if (onlyCache && tSimpleHashGetSize(pState->parNameMap) < MAX_TABLE_NAME_NUM) { + return TSDB_CODE_FAILED; + } int32_t code = streamStateGetParName_rocksdb(pState, groupId, pVal); - if (code == TSDB_CODE_SUCCESS) { + if (code == TSDB_CODE_SUCCESS && tSimpleHashGetSize(pState->parNameMap) < MAX_TABLE_NAME_NUM) { tSimpleHashPut(pState->parNameMap, &groupId, sizeof(int64_t), *pVal, TSDB_TABLE_NAME_LEN); } return code; diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index dc9d2166e6..7d869ce538 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -283,10 +283,12 @@ void tFreeStreamTask(SStreamTask* pTask) { pTask->status.pSM = streamDestroyStateMachine(pTask->status.pSM); streamTaskDestroyUpstreamInfo(&pTask->upstreamInfo); - pTask->msgInfo.pRetryList = taosArrayDestroy(pTask->msgInfo.pRetryList); taosMemoryFree(pTask->outputInfo.pTokenBucket); taosThreadMutexDestroy(&pTask->lock); + pTask->msgInfo.pSendInfo = taosArrayDestroy(pTask->msgInfo.pSendInfo); + taosThreadMutexDestroy(&pTask->msgInfo.lock); + pTask->outputInfo.pNodeEpsetUpdateList = taosArrayDestroy(pTask->outputInfo.pNodeEpsetUpdateList); if ((pTask->status.removeBackendFiles) && (pTask->pMeta != NULL)) { @@ -373,7 +375,13 @@ int32_t streamTaskInit(SStreamTask* pTask, SStreamMeta* pMeta, SMsgCb* pMsgCb, i pTask->pMeta = pMeta; pTask->pMsgCb = pMsgCb; - pTask->msgInfo.pRetryList = taosArrayInit(4, sizeof(int32_t)); + pTask->msgInfo.pSendInfo = taosArrayInit(4, sizeof(SDispatchEntry)); + if (pTask->msgInfo.pSendInfo == NULL) { + stError("s-task:%s failed to create sendInfo struct for stream task, code:Out of memory", pTask->id.idStr); + return terrno; + } + + taosThreadMutexInit(&pTask->msgInfo.lock, NULL); TdThreadMutexAttr attr = {0}; @@ -731,35 +739,50 @@ int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskI return code; } -int32_t streamBuildAndSendCheckpointUpdateMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, STaskId* pHTaskId, - SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask) { - SVUpdateCheckpointInfoReq* pReq = rpcMallocCont(sizeof(SVUpdateCheckpointInfoReq)); - if (pReq == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; +int32_t streamSendChkptReportMsg(SStreamTask* pTask, SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask) { + int32_t code; + int32_t tlen = 0; + int32_t vgId = pTask->pMeta->vgId; + const char* id = pTask->id.idStr; + SActiveCheckpointInfo* pActive = pCheckpointInfo->pActiveInfo; + + SCheckpointReport req = {.streamId = pTask->id.streamId, + .taskId = pTask->id.taskId, + .nodeId = vgId, + .dropHTask = dropRelHTask, + .transId = pActive->transId, + .checkpointId = pActive->activeId, + .checkpointVer = pCheckpointInfo->processedVer, + .checkpointTs = pCheckpointInfo->startTs}; + + tEncodeSize(tEncodeStreamTaskChkptReport, &req, tlen, code); + if (code < 0) { + stError("s-task:%s vgId:%d encode stream task checkpoint-report failed, code:%s", id, vgId, tstrerror(code)); return -1; } - pReq->head.vgId = vgId; - pReq->taskId = pTaskId->taskId; - pReq->streamId = pTaskId->streamId; - pReq->dropRelHTask = dropRelHTask; - pReq->hStreamId = pHTaskId->streamId; - pReq->hTaskId = pHTaskId->taskId; - pReq->transId = pCheckpointInfo->pActiveInfo->transId; - - pReq->checkpointId = pCheckpointInfo->pActiveInfo->activeId; - pReq->checkpointVer = pCheckpointInfo->processedVer; - pReq->checkpointTs = pCheckpointInfo->startTs; - - SRpcMsg msg = {.msgType = TDMT_STREAM_TASK_UPDATE_CHKPT, .pCont = pReq, .contLen = sizeof(SVUpdateCheckpointInfoReq)}; - int32_t code = tmsgPutToQueue(pMsgCb, WRITE_QUEUE, &msg); - - if (code != TSDB_CODE_SUCCESS) { - stError("vgId:%d task:0x%x failed to send update checkpoint info msg, code:%s", vgId, pTaskId->taskId, tstrerror(code)); - } else { - stDebug("vgId:%d task:0x%x build and send update checkpoint info msg msg", vgId, pTaskId->taskId); + void* buf = rpcMallocCont(tlen); + if (buf == NULL) { + stError("s-task:%s vgId:%d encode stream task checkpoint-report msg failed, code:%s", id, vgId, + tstrerror(TSDB_CODE_OUT_OF_MEMORY)); + return -1; } - return code; + + SEncoder encoder; + tEncoderInit(&encoder, buf, tlen); + if ((code = tEncodeStreamTaskChkptReport(&encoder, &req)) < 0) { + rpcFreeCont(buf); + stError("s-task:%s vgId:%d encode stream task checkpoint-report msg failed, code:%s", id, vgId, tstrerror(code)); + return -1; + } + tEncoderClear(&encoder); + + SRpcMsg msg = {0}; + initRpcMsg(&msg, TDMT_MND_STREAM_CHKPT_REPORT, buf, tlen); + stDebug("s-task:%s vgId:%d build and send task checkpoint-report to mnode", id, vgId); + + tmsgSendReq(&pTask->info.mnodeEpset, &msg); + return 0; } STaskId streamTaskGetTaskId(const SStreamTask* pTask) { @@ -921,32 +944,36 @@ char* createStreamTaskIdStr(int64_t streamId, int32_t taskId) { static int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq) { SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, sizeof(SStreamDataBlock)); - int8_t status = TASK_INPUT_STATUS__NORMAL; - - // enqueue - if (pData != NULL) { - stDebug("s-task:%s (child %d) recv retrieve req from task:0x%x(vgId:%d), reqId:0x%" PRIx64, pTask->id.idStr, - pTask->info.selfChildId, pReq->srcTaskId, pReq->srcNodeId, pReq->reqId); - - pData->type = STREAM_INPUT__DATA_RETRIEVE; - pData->srcVgId = 0; - streamRetrieveReqToData(pReq, pData); - if (streamTaskPutDataIntoInputQ(pTask, (SStreamQueueItem*)pData) == 0) { - status = TASK_INPUT_STATUS__NORMAL; - } else { - status = TASK_INPUT_STATUS__FAILED; - } - } else { // todo handle oom - /*streamTaskInputFail(pTask);*/ - /*status = TASK_INPUT_STATUS__FAILED;*/ + if (pData == NULL) { + stError("s-task:%s failed to allocated retrieve-block", pTask->id.idStr); + return terrno; } - return status == TASK_INPUT_STATUS__NORMAL ? 0 : -1; + // enqueue + stDebug("s-task:%s (vgId:%d level:%d) recv retrieve req from task:0x%x(vgId:%d), reqId:0x%" PRIx64, pTask->id.idStr, + pTask->pMeta->vgId, pTask->info.taskLevel, pReq->srcTaskId, pReq->srcNodeId, pReq->reqId); + + pData->type = STREAM_INPUT__DATA_RETRIEVE; + pData->srcVgId = 0; + + int32_t code = streamRetrieveReqToData(pReq, pData, pTask->id.idStr); + if (code != TSDB_CODE_SUCCESS) { + taosFreeQitem(pData); + return code; + } + + code = streamTaskPutDataIntoInputQ(pTask, (SStreamQueueItem*)pData); + if (code != TSDB_CODE_SUCCESS) { + stError("s-task:%s failed to put retrieve-block into inputQ, inputQ is full, discard the retrieve msg", + pTask->id.idStr); + } + + return code; } int32_t streamProcessRetrieveReq(SStreamTask* pTask, SStreamRetrieveReq* pReq) { int32_t code = streamTaskEnqueueRetrieve(pTask, pReq); - if(code != 0){ + if (code != 0) { return code; } return streamTrySchedExec(pTask); diff --git a/source/libs/stream/src/streammsg.c b/source/libs/stream/src/streammsg.c index 705406f044..a6ab6a60c2 100644 --- a/source/libs/stream/src/streammsg.c +++ b/source/libs/stream/src/streammsg.c @@ -594,6 +594,34 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) { } if (tDecodeCStrTo(pDecoder, pTask->reserve) < 0) return -1; + tEndDecode(pDecoder); + return 0; +} + +int32_t tEncodeStreamTaskChkptReport(SEncoder* pEncoder, const SCheckpointReport* pReq) { + if (tStartEncode(pEncoder) < 0) return -1; + if (tEncodeI64(pEncoder, pReq->streamId) < 0) return -1; + if (tEncodeI32(pEncoder, pReq->taskId) < 0) return -1; + if (tEncodeI32(pEncoder, pReq->nodeId) < 0) return -1; + if (tEncodeI64(pEncoder, pReq->checkpointId) < 0) return -1; + if (tEncodeI64(pEncoder, pReq->checkpointVer) < 0) return -1; + if (tEncodeI64(pEncoder, pReq->checkpointTs) < 0) return -1; + if (tEncodeI32(pEncoder, pReq->transId) < 0) return -1; + if (tEncodeI8(pEncoder, pReq->dropHTask) < 0) return -1; + tEndEncode(pEncoder); + return 0; +} + +int32_t tDecodeStreamTaskChkptReport(SDecoder* pDecoder, SCheckpointReport* pReq) { + if (tStartDecode(pDecoder) < 0) return -1; + if (tDecodeI64(pDecoder, &pReq->streamId) < 0) return -1; + if (tDecodeI32(pDecoder, &pReq->taskId) < 0) return -1; + if (tDecodeI32(pDecoder, &pReq->nodeId) < 0) return -1; + if (tDecodeI64(pDecoder, &pReq->checkpointId) < 0) return -1; + if (tDecodeI64(pDecoder, &pReq->checkpointVer) < 0) return -1; + if (tDecodeI64(pDecoder, &pReq->checkpointTs) < 0) return -1; + if (tDecodeI32(pDecoder, &pReq->transId) < 0) return -1; + if (tDecodeI8(pDecoder, &pReq->dropHTask) < 0) return -1; tEndDecode(pDecoder); return 0; } \ No newline at end of file diff --git a/source/libs/stream/test/backendTest.cpp b/source/libs/stream/test/backendTest.cpp index c9b981e5f9..2fb257fe4e 100644 --- a/source/libs/stream/test/backendTest.cpp +++ b/source/libs/stream/test/backendTest.cpp @@ -43,10 +43,10 @@ SStreamState *stateCreate(const char *path) { pTask->ver = 1024; pTask->id.streamId = 1023; pTask->id.taskId = 1111111; - SStreamMeta *pMeta = streamMetaOpen((path), NULL, NULL, 0, 0, NULL); + SStreamMeta *pMeta = streamMetaOpen((path), NULL, NULL, NULL, 0, 0, NULL); pTask->pMeta = pMeta; - SStreamState *p = streamStateOpen((char *)path, pTask, true, 32, 32 * 1024); + SStreamState *p = streamStateOpen((char *)path, pTask, 0, 0); ASSERT(p != NULL); return p; } diff --git a/source/libs/tfs/inc/tfsInt.h b/source/libs/tfs/inc/tfsInt.h index 713f548e9e..b3bde3abba 100644 --- a/source/libs/tfs/inc/tfsInt.h +++ b/source/libs/tfs/inc/tfsInt.h @@ -38,6 +38,7 @@ typedef struct { int32_t level; int32_t id; + int8_t disable; // disable create new file char *path; SDiskSize size; } STfsDisk; @@ -73,7 +74,7 @@ typedef struct STfs { SHashObj *hash; // name to did map } STfs; -STfsDisk *tfsNewDisk(int32_t level, int32_t id, const char *dir); +STfsDisk *tfsNewDisk(int32_t level, int32_t id, int8_t disable, const char *dir); STfsDisk *tfsFreeDisk(STfsDisk *pDisk); int32_t tfsUpdateDiskSize(STfsDisk *pDisk); diff --git a/source/libs/tfs/src/tfs.c b/source/libs/tfs/src/tfs.c index e7c4573c14..1c64885bf5 100644 --- a/source/libs/tfs/src/tfs.c +++ b/source/libs/tfs/src/tfs.c @@ -519,6 +519,18 @@ static int32_t tfsCheckAndFormatCfg(STfs *pTfs, SDiskCfg *pCfg) { return -1; } + if (pCfg->primary < 0 || pCfg->primary > 1) { + fError("failed to mount %s to FS since invalid primary %d", pCfg->dir, pCfg->primary); + terrno = TSDB_CODE_FS_INVLD_CFG; + return -1; + } + + if (pCfg->disable < 0 || pCfg->disable > 1) { + fError("failed to mount %s to FS since invalid disable %" PRIi8, pCfg->dir, pCfg->disable); + terrno = TSDB_CODE_FS_INVLD_CFG; + return -1; + } + if (pCfg->primary) { if (pCfg->level != 0) { fError("failed to mount %s to FS since disk is primary but level %d not 0", pCfg->dir, pCfg->level); @@ -595,6 +607,15 @@ static int32_t tfsCheck(STfs *pTfs) { terrno = TSDB_CODE_FS_NO_MOUNT_AT_TIER; return -1; } + + if (level == 0) { + tfsUpdateTierSize(TFS_TIER_AT(pTfs, level)); + if (TFS_TIER_AT(pTfs, level)->nAvailDisks == 0) { + fError("no disk to create new file at level %d", level); + terrno = TSDB_CODE_FS_NO_VALID_DISK; + return -1; + } + } } return 0; diff --git a/source/libs/tfs/src/tfsDisk.c b/source/libs/tfs/src/tfsDisk.c index 3717bf1a6d..06eb1cd42e 100644 --- a/source/libs/tfs/src/tfsDisk.c +++ b/source/libs/tfs/src/tfsDisk.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "tfsInt.h" -STfsDisk *tfsNewDisk(int32_t level, int32_t id, const char *path) { +STfsDisk *tfsNewDisk(int32_t level, int32_t id, int8_t disable, const char *path) { STfsDisk *pDisk = taosMemoryCalloc(1, sizeof(STfsDisk)); if (pDisk == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -32,6 +32,7 @@ STfsDisk *tfsNewDisk(int32_t level, int32_t id, const char *path) { pDisk->level = level; pDisk->id = id; + pDisk->disable = disable; taosGetDiskSize(pDisk->path, &pDisk->size); return pDisk; } diff --git a/source/libs/tfs/src/tfsTier.c b/source/libs/tfs/src/tfsTier.c index 911fdc52b7..cb79c334bf 100644 --- a/source/libs/tfs/src/tfsTier.c +++ b/source/libs/tfs/src/tfsTier.c @@ -65,7 +65,7 @@ STfsDisk *tfsMountDiskToTier(STfsTier *pTier, SDiskCfg *pCfg) { return NULL; } - STfsDisk *pDisk = tfsNewDisk(pCfg->level, id, pCfg->dir); + STfsDisk *pDisk = tfsNewDisk(pCfg->level, id, pCfg->disable, pCfg->dir); if (pDisk == NULL) return NULL; pTier->disks[id] = pDisk; @@ -89,7 +89,7 @@ void tfsUpdateTierSize(STfsTier *pTier) { size.total += pDisk->size.total; size.used += pDisk->size.used; size.avail += pDisk->size.avail; - nAvailDisks++; + if (pDisk->disable == 0) nAvailDisks++; } pTier->size = size; @@ -118,6 +118,12 @@ int32_t tfsAllocDiskOnTier(STfsTier *pTier) { if (pDisk == NULL) continue; + if (pDisk->disable == 1) { + uTrace("disk %s is disabled and skip it, level:%d id:%d disable:%" PRIi8, pDisk->path, pDisk->level, pDisk->id, + pDisk->disable); + continue; + } + if (pDisk->size.avail < tsMinDiskFreeSize) { uInfo("disk %s is full and skip it, level:%d id:%d free size:%" PRId64 " min free size:%" PRId64, pDisk->path, pDisk->level, pDisk->id, pDisk->size.avail, tsMinDiskFreeSize); diff --git a/source/libs/tfs/test/tfsTest.cpp b/source/libs/tfs/test/tfsTest.cpp index 1f16e585ae..d8c117818e 100644 --- a/source/libs/tfs/test/tfsTest.cpp +++ b/source/libs/tfs/test/tfsTest.cpp @@ -37,6 +37,7 @@ TEST_F(TfsTest, 01_Open_Close) { tstrncpy(dCfg.dir, root, TSDB_FILENAME_LEN); dCfg.level = 0; dCfg.primary = 1; + dCfg.disable = 0; taosRemoveDir(root); STfs *pTfs = tfsOpen(&dCfg, 1); @@ -63,6 +64,7 @@ TEST_F(TfsTest, 02_AllocDisk) { tstrncpy(dCfg.dir, root, TSDB_FILENAME_LEN); dCfg.level = 0; dCfg.primary = 1; + dCfg.disable = 0; taosRemoveDir(root); taosMkDir(root); @@ -114,6 +116,7 @@ TEST_F(TfsTest, 03_Dir) { tstrncpy(dCfg.dir, root, TSDB_FILENAME_LEN); dCfg.level = 0; dCfg.primary = 1; + dCfg.disable = 0; taosRemoveDir(root); taosMkDir(root); @@ -330,30 +333,39 @@ TEST_F(TfsTest, 05_MultiDisk) { tstrncpy(dCfg[0].dir, root01, TSDB_FILENAME_LEN); dCfg[0].level = 0; dCfg[0].primary = 0; + dCfg[0].disable = 0; tstrncpy(dCfg[1].dir, root00, TSDB_FILENAME_LEN); dCfg[1].level = 0; dCfg[1].primary = 0; + dCfg[1].disable = 0; tstrncpy(dCfg[2].dir, root20, TSDB_FILENAME_LEN); dCfg[2].level = 2; dCfg[2].primary = 0; + dCfg[2].disable = 0; tstrncpy(dCfg[3].dir, root21, TSDB_FILENAME_LEN); dCfg[3].level = 2; dCfg[3].primary = 0; + dCfg[3].disable = 0; tstrncpy(dCfg[4].dir, root22, TSDB_FILENAME_LEN); dCfg[4].level = 2; dCfg[4].primary = 0; + dCfg[4].disable = 0; tstrncpy(dCfg[5].dir, root23, TSDB_FILENAME_LEN); dCfg[5].level = 2; dCfg[5].primary = 0; + dCfg[5].disable = 0; tstrncpy(dCfg[6].dir, root10, TSDB_FILENAME_LEN); dCfg[6].level = 1; dCfg[6].primary = 0; + dCfg[6].disable = 0; tstrncpy(dCfg[7].dir, root11, TSDB_FILENAME_LEN); dCfg[7].level = 1; dCfg[7].primary = 0; + dCfg[7].disable = 0; tstrncpy(dCfg[8].dir, root12, TSDB_FILENAME_LEN); dCfg[8].level = 1; dCfg[8].primary = 0; + dCfg[8].disable = 0; taosRemoveDir(root00); taosRemoveDir(root01); diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 049554a7c9..c205c1412c 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -363,7 +363,7 @@ static bool uvHandleReq(SSvrConn* pConn) { memcpy(pConn->user, pHead->user, strlen(pHead->user)); int8_t forbiddenIp = 0; - if (pThrd->enableIpWhiteList) { + if (pThrd->enableIpWhiteList && tsEnableWhiteList) { forbiddenIp = !uvWhiteListCheckConn(pThrd->pWhiteList, pConn) ? 1 : 0; if (forbiddenIp == 0) { uvWhiteListSetConnVer(pThrd->pWhiteList, pConn); diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index 54e6abd85a..3dbaed1bc7 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -232,6 +232,12 @@ void walClose(SWal *pWal) { pWal->pRefHash = NULL; taosThreadMutexUnlock(&pWal->mutex); + if (pWal->cfg.level == TAOS_WAL_SKIP) { + wInfo("vgId:%d, remove all wals, path:%s", pWal->cfg.vgId, pWal->path); + taosRemoveDir(pWal->path); + taosMkDir(pWal->path); + } + taosRemoveRef(tsWal.refSetId, pWal->refId); } diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index 3ebf20e94e..948040ac76 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -38,11 +38,12 @@ int64_t tsTotalMemoryKB = 0; char *tsProcPath = NULL; char tsSIMDEnable = 0; -char tsSSE42Enable = 0; -char tsAVXEnable = 0; -char tsAVX2Enable = 0; -char tsFMAEnable = 0; char tsAVX512Enable = 0; +char tsSSE42Supported = 0; +char tsAVXSupported = 0; +char tsAVX2Supported = 0; +char tsFMASupported = 0; +char tsAVX512Supported = 0; void osDefaultInit() { taosSeedRand(taosSafeRand()); diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 187461826a..50eb8413c0 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -250,7 +250,7 @@ void taosGetSystemInfo() { taosGetCpuCores(&tsNumOfCores, false); taosGetTotalMemory(&tsTotalMemoryKB); taosGetCpuUsage(NULL, NULL); - taosGetCpuInstructions(&tsSSE42Enable, &tsAVXEnable, &tsAVX2Enable, &tsFMAEnable, &tsAVX512Enable); + taosGetCpuInstructions(&tsSSE42Supported, &tsAVXSupported, &tsAVX2Supported, &tsFMASupported, &tsAVX512Supported); #endif } diff --git a/source/os/src/osTimer.c b/source/os/src/osTimer.c index b8eb54e10e..36d364382a 100644 --- a/source/os/src/osTimer.c +++ b/source/os/src/osTimer.c @@ -86,8 +86,9 @@ static void taosDeleteTimer(void *tharg) { static TdThread timerThread; static timer_t timerId; static volatile bool stopTimer = false; -static void *taosProcessAlarmSignal(void *tharg) { - // Block the signal + +static void *taosProcessAlarmSignal(void *tharg) { + // Block the signal sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGALRM); diff --git a/source/util/src/tcompression.c b/source/util/src/tcompression.c index 4635ec340d..884d7ea1b6 100644 --- a/source/util/src/tcompression.c +++ b/source/util/src/tcompression.c @@ -822,9 +822,9 @@ int32_t tsDecompressTimestampImp(const char *const input, const int32_t nelement memcpy(output, input + 1, nelements * longBytes); return nelements * longBytes; } else if (input[0] == 1) { // Decompress - if (tsSIMDEnable && tsAVX512Enable) { + if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { tsDecompressTimestampAvx512(input, nelements, output, false); - } else if (tsSIMDEnable && tsAVX2Enable) { + } else if (tsSIMDEnable && tsAVX2Supported) { tsDecompressTimestampAvx2(input, nelements, output, false); } else { int64_t *ostream = (int64_t *)output; @@ -1198,9 +1198,9 @@ int32_t tsDecompressFloatImp(const char *const input, const int32_t nelements, c return nelements * FLOAT_BYTES; } - if (tsSIMDEnable && tsAVX2Enable) { + if (tsSIMDEnable && tsAVX2Supported) { tsDecompressFloatImplAvx2(input, nelements, output); - } else if (tsSIMDEnable && tsAVX512Enable) { + } else if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { tsDecompressFloatImplAvx512(input, nelements, output); } else { // alternative implementation without SIMD instructions. tsDecompressFloatHelper(input, nelements, (float *)output); @@ -2713,7 +2713,7 @@ int32_t tsDecompressBigint(void *pIn, int32_t nIn, int32_t nEle, void *pOut, int int8_t alvl = tsGetCompressL2Level(l2, lvl); \ return compressL2Dict[l2].comprFn(pIn, nIn, pOut, nOut, type, alvl); \ } else { \ - uTrace("dencode:%s, dcompress:%s, level:%d, type:%s", "disabled", compressL2Dict[l1].name, lvl, \ + uTrace("dencode:%s, decompress:%s, level:%d, type:%s", "disabled", compressL2Dict[l1].name, lvl, \ tDataTypes[type].name); \ return compressL2Dict[l2].decomprFn(pIn, nIn, pOut, nOut, type); \ } \ @@ -2916,8 +2916,11 @@ int32_t tcompressDebug(uint32_t cmprAlg, uint8_t *l1Alg, uint8_t *l2Alg, uint8_t *level = lvl; return 0; } + int8_t tUpdateCompress(uint32_t oldCmpr, uint32_t newCmpr, uint8_t l2Disabled, uint8_t lvlDiabled, uint8_t lvlDefault, + uint32_t *dst) { + int8_t update = 0; uint8_t ol1 = COMPRESS_L1_TYPE_U32(oldCmpr); uint8_t ol2 = COMPRESS_L2_TYPE_U32(oldCmpr); uint8_t olvl = COMPRESS_L2_TYPE_LEVEL_U32(oldCmpr); @@ -2925,10 +2928,17 @@ int8_t tUpdateCompress(uint32_t oldCmpr, uint32_t newCmpr, uint8_t l2Disabled, u uint8_t nl1 = COMPRESS_L1_TYPE_U32(newCmpr); uint8_t nl2 = COMPRESS_L2_TYPE_U32(newCmpr); uint8_t nlvl = COMPRESS_L2_TYPE_LEVEL_U32(newCmpr); + + // nl1 == 0, not update encode + // nl2 == 0, not update compress + // nl3 == 0, not update level if (nl1 != 0 && ol1 != nl1) { SET_COMPRESS(nl1, ol2, olvl, *dst); - return 1; - } else if (nl2 != 0 && ol2 != nl2) { + update = 1; + ol1 = nl1; + } + + if (nl2 != 0 && ol2 != nl2) { if (nl2 == l2Disabled) { SET_COMPRESS(ol1, nl2, lvlDiabled, *dst); } else { @@ -2938,10 +2948,20 @@ int8_t tUpdateCompress(uint32_t oldCmpr, uint32_t newCmpr, uint8_t l2Disabled, u SET_COMPRESS(ol1, nl2, olvl, *dst); } } - return 1; - } else if (nlvl != 0 && olvl != nlvl) { - SET_COMPRESS(ol1, ol2, nlvl, *dst); - return 1; + update = 1; + ol2 = nl2; } - return 0; + + if (nlvl != 0 && olvl != nlvl) { + if (update == 0) { + if (ol2 == L2_DISABLED) { + update = -1; + return update; + } + } + SET_COMPRESS(ol1, ol2, nlvl, *dst); + update = 1; + } + + return update; } diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index d05d616233..8be38a811f 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -259,7 +259,7 @@ static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType } static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value, const char *level, const char *primary, - ECfgSrcType stype) { + const char *disable, ECfgSrcType stype) { taosThreadMutexLock(&pCfg->lock); SConfigItem *pItem = cfgGetItem(pCfg, name); @@ -283,6 +283,7 @@ static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value, tstrncpy(cfg.dir, pItem->str, sizeof(cfg.dir)); cfg.level = level ? atoi(level) : 0; cfg.primary = primary ? atoi(primary) : 1; + cfg.disable = disable ? atoi(disable) : 0; void *ret = taosArrayPush(pItem->array, &cfg); if (ret == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -899,16 +900,16 @@ void cfgDumpCfg(SConfig *pCfg, bool tsc, bool dump) { } int32_t cfgLoadFromEnvVar(SConfig *pConfig) { - char line[1024], *name, *value, *value2, *value3; - int32_t olen, vlen, vlen2, vlen3; + char line[1024], *name, *value, *value2, *value3, *value4; + int32_t olen, vlen, vlen2, vlen3, vlen4; int32_t code = 0; char **pEnv = environ; line[1023] = 0; if (pEnv == NULL) return 0; while (*pEnv != NULL) { - name = value = value2 = value3 = NULL; - olen = vlen = vlen2 = vlen3 = 0; + name = value = value2 = value3 = value4 = NULL; + olen = vlen = vlen2 = vlen3 = vlen4 = 0; strncpy(line, *pEnv, sizeof(line) - 1); pEnv++; @@ -926,14 +927,18 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) { if (vlen2 != 0) { value2[vlen2] = 0; paGetToken(value2 + vlen2 + 1, &value3, &vlen3); - if (vlen3 != 0) value3[vlen3] = 0; + if (vlen3 != 0) { + value3[vlen3] = 0; + paGetToken(value3 + vlen3 + 1, &value4, &vlen4); + if(vlen4 != 0) value4[vlen4] = 0; + } } code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_VAR, true); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; if (strcasecmp(name, "dataDir") == 0) { - code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_VAR); + code = cfgSetTfsItem(pConfig, name, value, value2, value3, value4, CFG_STYPE_ENV_VAR); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } @@ -943,8 +948,8 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) { } int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { - char buf[1024], *name, *value, *value2, *value3; - int32_t olen, vlen, vlen2, vlen3; + char buf[1024], *name, *value, *value2, *value3, *value4; + int32_t olen, vlen, vlen2, vlen3, vlen4; int32_t code = 0; int32_t index = 0; if (envCmd == NULL) return 0; @@ -954,8 +959,8 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { taosEnvToCfg(buf, buf); index++; - name = value = value2 = value3 = NULL; - olen = vlen = vlen2 = vlen3 = 0; + name = value = value2 = value3 = value4 = NULL; + olen = vlen = vlen2 = vlen3 = vlen4 = 0; paGetToken(buf, &name, &olen); if (olen == 0) continue; @@ -969,14 +974,18 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { if (vlen2 != 0) { value2[vlen2] = 0; paGetToken(value2 + vlen2 + 1, &value3, &vlen3); - if (vlen3 != 0) value3[vlen3] = 0; + if (vlen3 != 0) { + value3[vlen3] = 0; + paGetToken(value3 + vlen3 + 1, &value4, &vlen4); + if(vlen4 != 0) value4[vlen4] = 0; + } } code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_CMD, true); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; if (strcasecmp(name, "dataDir") == 0) { - code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_CMD); + code = cfgSetTfsItem(pConfig, name, value, value2, value3, value4, CFG_STYPE_ENV_CMD); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } @@ -986,8 +995,8 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) { } int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { - char line[1024], *name, *value, *value2, *value3; - int32_t olen, vlen, vlen2, vlen3; + char line[1024], *name, *value, *value2, *value3, *value4; + int32_t olen, vlen, vlen2, vlen3, vlen4; int32_t code = 0; ssize_t _bytes = 0; @@ -1012,8 +1021,8 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { } while (!taosEOFFile(pFile)) { - name = value = value2 = value3 = NULL; - olen = vlen = vlen2 = vlen3 = 0; + name = value = value2 = value3 = value4 = NULL; + olen = vlen = vlen2 = vlen3 = vlen4 = 0; _bytes = taosGetsFile(pFile, sizeof(line), line); if (_bytes <= 0) { @@ -1034,14 +1043,18 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { if (vlen2 != 0) { value2[vlen2] = 0; paGetToken(value2 + vlen2 + 1, &value3, &vlen3); - if (vlen3 != 0) value3[vlen3] = 0; + if (vlen3 != 0) { + value3[vlen3] = 0; + paGetToken(value3 + vlen3 + 1, &value4, &vlen4); + if(vlen4 != 0) value4[vlen4] = 0; + } } code = cfgSetItem(pConfig, name, value, CFG_STYPE_ENV_FILE, true); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; if (strcasecmp(name, "dataDir") == 0) { - code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_ENV_FILE); + code = cfgSetTfsItem(pConfig, name, value, value2, value3, value4, CFG_STYPE_ENV_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } @@ -1053,8 +1066,8 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) { } int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { - char line[1024], *name, *value, *value2, *value3; - int32_t olen, vlen, vlen2, vlen3; + char line[1024], *name, *value, *value2, *value3, *value4; + int32_t olen, vlen, vlen2, vlen3, vlen4; ssize_t _bytes = 0; int32_t code = 0; @@ -1072,8 +1085,8 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { } while (!taosEOFFile(pFile)) { - name = value = value2 = value3 = NULL; - olen = vlen = vlen2 = vlen3 = 0; + name = value = value2 = value3 = value4 = NULL; + olen = vlen = vlen2 = vlen3 = vlen4 = 0; _bytes = taosGetsFile(pFile, sizeof(line), line); if (_bytes <= 0) { @@ -1114,7 +1127,11 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { if (vlen2 != 0) { value2[vlen2] = 0; paGetToken(value2 + vlen2 + 1, &value3, &vlen3); - if (vlen3 != 0) value3[vlen3] = 0; + if (vlen3 != 0) { + value3[vlen3] = 0; + paGetToken(value3 + vlen3 + 1, &value4, &vlen4); + if (vlen4 != 0) value4[vlen4] = 0; + } } code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE, true); @@ -1122,7 +1139,7 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { } if (strcasecmp(name, "dataDir") == 0) { - code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_CFG_FILE); + code = cfgSetTfsItem(pConfig, name, value, value2, value3, value4, CFG_STYPE_CFG_FILE); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } @@ -1212,8 +1229,8 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) { // } int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) { - char *cfgLineBuf = NULL, *name, *value, *value2, *value3; - int32_t olen, vlen, vlen2, vlen3; + char *cfgLineBuf = NULL, *name, *value, *value2, *value3, *value4; + int32_t olen, vlen, vlen2, vlen3, vlen4; int32_t code = 0; if (url == NULL || strlen(url) == 0) { uInfo("apoll url not load"); @@ -1289,14 +1306,18 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) { if (vlen2 != 0) { value2[vlen2] = 0; paGetToken(value2 + vlen2 + 1, &value3, &vlen3); - if (vlen3 != 0) value3[vlen3] = 0; + if (vlen3 != 0) { + value3[vlen3] = 0; + paGetToken(value3 + vlen3 + 1, &value4, &vlen4); + if (vlen4 != 0) value4[vlen4] = 0; + } } code = cfgSetItem(pConfig, name, value, CFG_STYPE_APOLLO_URL, true); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; if (strcasecmp(name, "dataDir") == 0) { - code = cfgSetTfsItem(pConfig, name, value, value2, value3, CFG_STYPE_APOLLO_URL); + code = cfgSetTfsItem(pConfig, name, value, value2, value3, value4, CFG_STYPE_APOLLO_URL); if (code != 0 && terrno != TSDB_CODE_CFG_NOT_FOUND) break; } } diff --git a/source/util/src/tdecompress.c b/source/util/src/tdecompress.c index f212bf5231..470e43c957 100644 --- a/source/util/src/tdecompress.c +++ b/source/util/src/tdecompress.c @@ -52,7 +52,7 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, int32_t _pos = 0; int64_t prevValue = 0; -#if __AVX2__ +#if __AVX2__ || __AVX512F__ while (_pos < nelements) { uint64_t w = *(uint64_t*) ip; @@ -72,10 +72,33 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, int32_t gRemainder = (nelements - _pos); int32_t num = (gRemainder > elems)? elems:gRemainder; - int32_t batch = num >> 2; - int32_t remain = num & 0x03; + int32_t batch = 0; + int32_t remain = 0; + if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { +#if __AVX512F__ + batch = num >> 3; + remain = num & 0x07; +#endif + } else if (tsSIMDEnable && tsAVX2Supported) { +#if __AVX2__ + batch = num >> 2; + remain = num & 0x03; +#endif + } + if (selector == 0 || selector == 1) { - if (tsSIMDEnable && tsAVX2Enable) { + if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { +#if __AVX512F__ + for (int32_t i = 0; i < batch; ++i) { + __m512i prev = _mm512_set1_epi64(prevValue); + _mm512_storeu_si512((__m512i *)&p[_pos], prev); + _pos += 8; //handle 64bit x 8 = 512bit + } + for (int32_t i = 0; i < remain; ++i) { + p[_pos++] = prevValue; + } +#endif + } else if (tsSIMDEnable && tsAVX2Supported) { for (int32_t i = 0; i < batch; ++i) { __m256i prev = _mm256_set1_epi64x(prevValue); _mm256_storeu_si256((__m256i *)&p[_pos], prev); @@ -85,10 +108,7 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, for (int32_t i = 0; i < remain; ++i) { p[_pos++] = prevValue; } - } else if (tsSIMDEnable && tsAVX512Enable) { -#if __AVX512F__ - // todo add avx512 impl -#endif + } else { // alternative implementation without SIMD instructions. for (int32_t i = 0; i < elems && count < nelements; i++, count++) { p[_pos++] = prevValue; @@ -96,7 +116,73 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, } } } else { - if (tsSIMDEnable && tsAVX2Enable) { + if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) { + #if __AVX512F__ + __m512i sum_mask1 = _mm512_set_epi64(6, 6, 4, 4, 2, 2, 0, 0); + __m512i sum_mask2 = _mm512_set_epi64(5, 5, 5, 5, 1, 1, 1, 1); + __m512i sum_mask3 = _mm512_set_epi64(3, 3, 3, 3, 3, 3, 3, 3); + __m512i base = _mm512_set1_epi64(w); + __m512i maskVal = _mm512_set1_epi64(mask); + __m512i shiftBits = _mm512_set_epi64(bit * 7 + 4, bit * 6 + 4, bit * 5 + 4, bit * 4 + 4, bit * 3 + 4, bit * 2 + 4, bit + 4, 4); + __m512i inc = _mm512_set1_epi64(bit << 3); + + for (int32_t i = 0; i < batch; ++i) { + + __m512i after = _mm512_srlv_epi64(base, shiftBits); + __m512i zigzagVal = _mm512_and_si512(after, maskVal); + + // ZIGZAG_DECODE(T, v) (((v) >> 1) ^ -((T)((v)&1))) + __m512i signmask = _mm512_and_si512(_mm512_set1_epi64(1), zigzagVal); + signmask = _mm512_sub_epi64(_mm512_setzero_si512(), signmask); + __m512i delta = _mm512_xor_si512(_mm512_srli_epi64(zigzagVal, 1), signmask); + + // calculate the cumulative sum (prefix sum) for each number + // decode[0] = prevValue + final[0] + // decode[1] = decode[0] + final[1] -----> prevValue + final[0] + final[1] + // decode[2] = decode[1] + final[2] -----> prevValue + final[0] + final[1] + final[2] + // decode[3] = decode[2] + final[3] -----> prevValue + final[0] + final[1] + final[2] + final[3] + + + //7 6 5 4 3 2 1 0 + //D7 D6 D5 D4 D3 D2 D1 D0 + //D6 0 D4 0 D2 0 D0 0 + //D7+D6 D6 D5+D4 D4 D3+D2 D2 D1+D0 D0 + //13 6 9 4 5 2 1 0 + __m512i prev = _mm512_set1_epi64(prevValue); + __m512i cum_sum = _mm512_add_epi64(delta, _mm512_maskz_permutexvar_epi64(0xaa, sum_mask1, delta)); + cum_sum = _mm512_add_epi64(cum_sum, _mm512_maskz_permutexvar_epi64(0xcc, sum_mask2, cum_sum)); + cum_sum = _mm512_add_epi64(cum_sum, _mm512_maskz_permutexvar_epi64(0xf0, sum_mask3, cum_sum)); + + + + //13 6 9 4 5 2 1 0 + //D7,D6 D6 D5,D4 D4 D3,D2 D2 D1,D0 D0 + //+D5,D4 D5,D4, 0 0 D1,D0 D1,D0 0 0 + //D7~D4 D6~D4 D5~D4 D4 D3~D0 D2~D0 D1~D0 D0 + //22 15 9 4 6 3 1 0 + // + //D3~D0 D3~D0 D3~D0 D3~D0 0 0 0 0 + //28 21 15 10 6 3 1 0 + + + cum_sum = _mm512_add_epi64(cum_sum, prev); + _mm512_storeu_si512((__m512i *)&p[_pos], cum_sum); + + shiftBits = _mm512_add_epi64(shiftBits, inc); + prevValue = p[_pos + 7]; + _pos += 8; + + } + // handle the remain value + for (int32_t i = 0; i < remain; i++) { + zigzag_value = ((w >> (v + (batch * bit * 8))) & mask); + prevValue += ZIGZAG_DECODE(int64_t, zigzag_value); + + p[_pos++] = prevValue; + v += bit; + } +#endif + } else if (tsSIMDEnable && tsAVX2Supported) { __m256i base = _mm256_set1_epi64x(w); __m256i maskVal = _mm256_set1_epi64x(mask); @@ -157,10 +243,6 @@ int32_t tsDecompressIntImpl_Hw(const char *const input, const int32_t nelements, p[_pos++] = prevValue; v += bit; } - } else if (tsSIMDEnable && tsAVX512Enable) { -#if __AVX512F__ - // todo add avx512 impl -#endif } else { // alternative implementation without SIMD instructions. for (int32_t i = 0; i < elems && count < nelements; i++, count++) { zigzag_value = ((w >> v) & mask); @@ -247,18 +329,19 @@ int32_t tsDecompressFloatImplAvx2(const char *const input, const int32_t nelemen return 0; } +// decode two timestamps in one loop. int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelements, char *const output, bool bigEndian) { -#if 0 int64_t *ostream = (int64_t *)output; int32_t ipos = 1, opos = 0; + +#if __AVX2__ __m128i prevVal = _mm_setzero_si128(); __m128i prevDelta = _mm_setzero_si128(); -#if __AVX2__ int32_t batch = nelements >> 1; int32_t remainder = nelements & 0x01; - __mmask16 mask2[16] = {0, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff}; +// __mmask16 mask2[16] = {0, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff}; int32_t i = 0; if (batch > 1) { @@ -268,18 +351,18 @@ int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelemen int8_t nbytes1 = flags & INT8MASK(4); // range of nbytes starts from 0 to 7 int8_t nbytes2 = (flags >> 4) & INT8MASK(4); - __m128i data1; - if (nbytes1 == 0) { - data1 = _mm_setzero_si128(); - } else { - memcpy(&data1, (const void*) (input + ipos), nbytes1); + __m128i data1 = _mm_setzero_si128(); + if (nbytes1 > 0) { + int64_t tmp = 0; + memcpy(&tmp, (const void*) (input + ipos), nbytes1); + data1 = _mm_set1_epi64x(tmp); } - __m128i data2; - if (nbytes2 == 0) { - data2 = _mm_setzero_si128(); - } else { - memcpy(&data2, (const void*) (input + ipos + nbytes1), nbytes2); + __m128i data2 = _mm_setzero_si128(); + if (nbytes2 > 0) { + int64_t tmp = 0; + memcpy(&tmp, (const void*) (input + ipos + nbytes1), nbytes2); + data2 = _mm_set1_epi64x(tmp); } data2 = _mm_broadcastq_epi64(data2); @@ -293,13 +376,13 @@ int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelemen __m128i deltaOfDelta = _mm_xor_si128(_mm_srli_epi64(zzVal, 1), signmask); __m128i deltaCurrent = _mm_add_epi64(deltaOfDelta, prevDelta); - deltaCurrent = _mm_add_epi64(_mm_slli_si128(deltaCurrent, 8), deltaCurrent); + deltaCurrent = _mm_add_epi64(_mm_slli_si128(deltaOfDelta, 8), deltaCurrent); - __m128i val = _mm_add_epi64(deltaCurrent, prevVal); - _mm_storeu_si128((__m128i *)&ostream[opos], val); + __m128i finalVal = _mm_add_epi64(deltaCurrent, prevVal); + _mm_storeu_si128((__m128i *)&ostream[opos], finalVal); // keep the previous value - prevVal = _mm_shuffle_epi32 (val, 0xEE); + prevVal = _mm_shuffle_epi32 (finalVal, 0xEE); // keep the previous delta of delta, for the first item prevDelta = _mm_shuffle_epi32(deltaOfDelta, 0xEE); @@ -316,21 +399,15 @@ int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelemen int8_t nbytes1 = flags & INT8MASK(4); // range of nbytes starts from 0 to 7 int8_t nbytes2 = (flags >> 4) & INT8MASK(4); -// __m128i data1 = _mm_maskz_loadu_epi8(mask2[nbytes1], (const void*)(input + ipos)); -// __m128i data2 = _mm_maskz_loadu_epi8(mask2[nbytes2], (const void*)(input + ipos + nbytes1)); - __m128i data1; - if (nbytes1 == 0) { - data1 = _mm_setzero_si128(); - } else { + __m128i data1 = _mm_setzero_si128(); + if (nbytes1 > 0) { int64_t dd = 0; memcpy(&dd, (const void*) (input + ipos), nbytes1); data1 = _mm_loadu_si64(&dd); } - __m128i data2; - if (nbytes2 == 0) { - data2 = _mm_setzero_si128(); - } else { + __m128i data2 = _mm_setzero_si128(); + if (nbytes2 > 0) { int64_t dd = 0; memcpy(&dd, (const void*) (input + ipos + nbytes1), nbytes2); data2 = _mm_loadu_si64(&dd); @@ -348,17 +425,18 @@ int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelemen __m128i deltaOfDelta = _mm_xor_si128(_mm_srli_epi64(zzVal, 1), signmask); __m128i deltaCurrent = _mm_add_epi64(deltaOfDelta, prevDelta); - deltaCurrent = _mm_add_epi64(_mm_slli_si128(deltaCurrent, 8), deltaCurrent); + deltaCurrent = _mm_add_epi64(_mm_slli_si128(deltaOfDelta, 8), deltaCurrent); - __m128i val = _mm_add_epi64(deltaCurrent, prevVal); - _mm_storeu_si128((__m128i *)&ostream[opos], val); + __m128i finalVal = _mm_add_epi64(deltaCurrent, prevVal); + finalVal = _mm_add_epi64(_mm_slli_si128(deltaCurrent, 8), finalVal); + + _mm_storeu_si128((__m128i *)&ostream[opos], finalVal); // keep the previous value - prevVal = _mm_shuffle_epi32 (val, 0xEE); + prevVal = _mm_shuffle_epi32 (finalVal, 0xEE); // keep the previous delta of delta - __m128i delta = _mm_add_epi64(_mm_slli_si128(deltaOfDelta, 8), deltaOfDelta); - prevDelta = _mm_shuffle_epi32(_mm_add_epi64(delta, prevDelta), 0xEE); + prevDelta = _mm_shuffle_epi32 (deltaCurrent, 0xEE); opos += 2; ipos += nbytes1 + nbytes2; @@ -389,7 +467,6 @@ int32_t tsDecompressTimestampAvx2(const char *const input, const int32_t nelemen ostream[opos++] = prevVal[1] + prevDeltaX; } } -#endif #endif return 0; } @@ -507,4 +584,4 @@ int32_t tsDecompressTimestampAvx512(const char *const input, const int32_t nelem #endif return 0; -} \ No newline at end of file +} diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 0f594af0e9..fb2f4be487 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -21,11 +21,6 @@ #define TAOS_ERROR_C -typedef struct { - int32_t val; - const char* str; -} STaosError; - static threadlocal int32_t tsErrno; static threadlocal char tsErrMsgDetail[ERR_MSG_LEN] = {0}; static threadlocal char tsErrMsgReturn[ERR_MSG_LEN] = {0}; @@ -35,7 +30,7 @@ char* taosGetErrMsg() { return tsErrMsgDetail; } char* taosGetErrMsgReturn() { return tsErrMsgReturn; } #ifdef TAOS_ERROR_C -#define TAOS_DEFINE_ERROR(name, msg) {.val = (name), .str = (msg)}, +#define TAOS_DEFINE_ERROR(name, msg) {.val = (name), .str = (msg), .macro = #name}, #else #define TAOS_DEFINE_ERROR(name, mod, code, msg) static const int32_t name = TAOS_DEF_ERROR_CODE(mod, code); #endif @@ -46,7 +41,7 @@ char* taosGetErrMsgReturn() { return tsErrMsgReturn; } #ifdef TAOS_ERROR_C STaosError errors[] = { - {.val = 0, .str = "success"}, + TAOS_DEFINE_ERROR(TSDB_CODE_SUCCESS, "success") #endif // rpc @@ -250,15 +245,15 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB, "Invalid database name TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_DATABASES, "Too many databases for account") TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_DROPPING, "Database in dropping status") TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_NOT_EXIST, "Database not exist") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO, "WAL retention period is zero") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_ACCT, "Invalid database account") TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_OPTION_UNCHANGED, "Database options not changed") TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_INDEX_NOT_EXIST, "Index not exist") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SYS_TABLENAME, "Invalid system table name") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_CREATING, "Database in creating status") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE, "Encryption is not allowed to be changed after database is created") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY, "Inconsistent encryption key") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO, "WAL retention period is zero") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_ENCRYPT_KEY, "The cluster has not been set properly for database encryption") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_CREATING, "Database in creating status") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SYS_TABLENAME, "Invalid system table name") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE, "Encryption is not allowed to be changed after database is created") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_WAL_LEVEL, "Invalid option, wal_level 0 should be used with replica 1") // mnode-node TAOS_DEFINE_ERROR(TSDB_CODE_MND_MNODE_ALREADY_EXIST, "Mnode already exists") @@ -837,3 +832,5 @@ const char* tstrerror(int32_t err) { } const char* terrstr() { return tstrerror(terrno); } + +int32_t taosGetErrSize() { return sizeof(errors)/sizeof(errors[0]); } diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 0c09174970..b224eac8c2 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -66,6 +66,7 @@ typedef struct { int32_t lines; int32_t flag; int32_t openInProgress; + int64_t lastKeepFileSec; pid_t pid; char logName[LOG_FILE_NAME_LEN]; SLogBuff *logHandle; @@ -267,19 +268,33 @@ static void taosUnLockLogFile(TdFilePtr pFile) { } } -static void taosKeepOldLog(char *oldName) { - if (tsLogKeepDays == 0) return; +static void taosReserveOldLog(char *oldName, char *keepName) { + if (tsLogKeepDays <= 0) { + keepName[0] = 0; + return; + } + int32_t code = 0; int64_t fileSec = taosGetTimestampSec(); - char fileName[LOG_FILE_NAME_LEN + 20]; - snprintf(fileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64, tsLogObj.logName, fileSec); + if (tsLogObj.lastKeepFileSec < fileSec) { + tsLogObj.lastKeepFileSec = fileSec; + } else { + fileSec = ++tsLogObj.lastKeepFileSec; + } + snprintf(keepName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64, tsLogObj.logName, fileSec); + if ((code = taosRenameFile(oldName, keepName))) { + keepName[0] = 0; + uError("failed to rename file:%s to %s since %s", oldName, keepName, tstrerror(code)); + } +} - (void)taosRenameFile(oldName, fileName); - - char compressFileName[LOG_FILE_NAME_LEN + 20]; - snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64 ".gz", tsLogObj.logName, fileSec); - if (taosCompressFile(fileName, compressFileName) == 0) { - (void)taosRemoveFile(fileName); +static void taosKeepOldLog(char *oldName) { + if (oldName[0] != 0) { + char compressFileName[LOG_FILE_NAME_LEN + 20]; + snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.gz", oldName); + if (taosCompressFile(oldName, compressFileName) == 0) { + (void)taosRemoveFile(oldName); + } } if (tsLogKeepDays > 0) { @@ -316,13 +331,13 @@ static OldFileKeeper *taosOpenNewFile() { tsLogObj.logHandle->pFile = pFile; tsLogObj.lines = 0; tsLogObj.openInProgress = 0; - OldFileKeeper* oldFileKeeper = taosMemoryMalloc(sizeof(OldFileKeeper)); + OldFileKeeper *oldFileKeeper = taosMemoryMalloc(sizeof(OldFileKeeper)); if (oldFileKeeper == NULL) { uError("create old log keep info faild! mem is not enough."); return NULL; } oldFileKeeper->pOldFile = pOldFile; - memcpy(oldFileKeeper->keepName, keepName, LOG_FILE_NAME_LEN + 20); + taosReserveOldLog(keepName, oldFileKeeper->keepName); uInfo(" new log file:%d is opened", tsLogObj.flag); uInfo("=================================="); diff --git a/source/util/src/tunit.c b/source/util/src/tunit.c index 09f59f1e40..4ec9e39fde 100644 --- a/source/util/src/tunit.c +++ b/source/util/src/tunit.c @@ -24,7 +24,7 @@ #define UNIT_ONE_EXBIBYTE (UNIT_ONE_PEBIBYTE * UNIT_SIZE_CONVERT_FACTOR) static int32_t parseCfgIntWithUnit(const char* str, double *res) { - double val, temp = INT64_MAX; + double val, temp = (double)INT64_MAX; char* endPtr; errno = 0; val = taosStr2Int64(str, &endPtr, 0); diff --git a/source/util/src/version.c.in b/source/util/src/version.c.in index 2446bf9278..c91b46e18d 100644 --- a/source/util/src/version.c.in +++ b/source/util/src/version.c.in @@ -4,4 +4,4 @@ char gitinfo[48] = "${TD_VER_GIT}"; char gitinfoOfInternal[48] = "${TD_VER_GIT_INTERNAL}"; char buildinfo[64] = "${TD_VER_OSTYPE}-${TD_VER_CPUTYPE} ${TD_VER_DATE}"; -void libtaos_${TD_LIB_VER_NUMBER}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {}; +void libtaos_${TD_LIB_VER_NUMBER}_${TD_VER_OSTYPE}_${TD_VER_CPUTYPE}_${TD_VER_VERTYPE}() {}; \ No newline at end of file diff --git a/source/util/test/CMakeLists.txt b/source/util/test/CMakeLists.txt index e8e3348343..e8aabfe338 100644 --- a/source/util/test/CMakeLists.txt +++ b/source/util/test/CMakeLists.txt @@ -12,6 +12,7 @@ IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR)) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST) LIST(REMOVE_ITEM SOURCE_LIST ${CMAKE_CURRENT_SOURCE_DIR}/trefTest.c) + LIST(REMOVE_ITEM SOURCE_LIST ${CMAKE_CURRENT_SOURCE_DIR}/terrorTest.cpp) ADD_EXECUTABLE(utilTest ${SOURCE_LIST}) TARGET_LINK_LIBRARIES(utilTest util common os gtest pthread) @@ -123,4 +124,20 @@ add_test( #add_test( # NAME decompressTest # COMMAND decompressTest -#) \ No newline at end of file +#) + +if (${TD_LINUX}) + # terrorTest + add_executable(terrorTest "terrorTest.cpp") + target_link_libraries(terrorTest os util common gtest_main) + add_test( + NAME terrorTest + COMMAND terrorTest + ) + + # config + SET(ERR_TBL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/errorCodeTable.ini) + add_custom_command(TARGET terrorTest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ERR_TBL_FILE} $ + ) +endif () \ No newline at end of file diff --git a/source/util/test/decompressTest.cpp b/source/util/test/decompressTest.cpp index 2ddef3f595..dfcd682255 100644 --- a/source/util/test/decompressTest.cpp +++ b/source/util/test/decompressTest.cpp @@ -4,9 +4,16 @@ #include #include "ttypes.h" -namespace {} // namespace +namespace { + +} // namespace + +TEST(utilTest, decompress_ts_test) { + { + tsSIMDEnable = 1; + tsAVX2Supported = 1; + } -TEST(utilTest, decompress_test) { int64_t tsList[10] = {1700000000, 1700000100, 1700000200, 1700000300, 1700000400, 1700000500, 1700000600, 1700000700, 1700000800, 1700000900}; @@ -30,6 +37,20 @@ TEST(utilTest, decompress_test) { std::cout << ((int64_t*)decompOutput)[i] << std::endl; } + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + tsList[0] = 1286; tsList[1] = 1124; tsList[2]=2681; tsList[3] = 2823; + +// char* pOutput[4 * sizeof(int64_t)] = {0}; + len = tsCompressTimestamp(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 4, + ONE_STAGE_COMP, NULL, 0); + + decompOutput[4 * 8] = {0}; + tsDecompressTimestamp(pOutput, len, 4, decompOutput, sizeof(int64_t) * 4, ONE_STAGE_COMP, NULL, 0); + + for (int32_t i = 0; i < 4; ++i) { + std::cout << ((int64_t*)decompOutput)[i] << std::endl; + } + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int64_t tsList1[7] = {1700000000, 1700000000, 1700000000, 1700000000, 1700000000, 1700000000, 1700000900}; int32_t len1 = tsCompressTimestamp(tsList1, sizeof(tsList1), sizeof(tsList1) / sizeof(tsList1[0]), pOutput, 7, @@ -57,6 +78,49 @@ TEST(utilTest, decompress_test) { } } +TEST(utilTest, decompress_bigint_avx2_test) { + { + tsSIMDEnable = 1; + tsAVX2Supported = 1; + } + + int64_t tsList[10] = {1700000000, 1700000100, 1700000200, 1700000300, 1700000400, + 1700000500, 1700000600, 1700000700, 1700000800, 1700000900}; + + char* pOutput[10 * sizeof(int64_t)] = {0}; + int32_t len = tsCompressBigint(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 10, + ONE_STAGE_COMP, NULL, 0); + + char* decompOutput[10 * 8] = {0}; + + tsDecompressBigint(pOutput, len, 10, decompOutput, sizeof(int64_t) * 10, ONE_STAGE_COMP, NULL, 0); + + for (int32_t i = 0; i < 10; ++i) { + std::cout << ((int64_t*)decompOutput)[i] << std::endl; + } +} + +TEST(utilTest, decompress_int_avx2_test) { + { + tsSIMDEnable = 1; + tsAVX2Supported = 1; + } + + int32_t tsList[10] = {17000000, 17000001, 17000002, 17000003, 17000004, + 17000005, 17000006, 17000007, 17000008, 17000009}; + + char* pOutput[10 * sizeof(int32_t)] = {0}; + int32_t len = + tsCompressInt(tsList, sizeof(tsList), sizeof(tsList) / sizeof(tsList[0]), pOutput, 10, ONE_STAGE_COMP, NULL, 0); + + char* decompOutput[10 * 8] = {0}; + tsDecompressInt(pOutput, len, 10, decompOutput, sizeof(int32_t) * 10, ONE_STAGE_COMP, NULL, 0); + + for (int32_t i = 0; i < 10; ++i) { + std::cout << ((int32_t*)decompOutput)[i] << std::endl; + } +} + TEST(utilTest, decompress_perf_test) { int32_t num = 10000; diff --git a/source/util/test/errorCodeTable.ini b/source/util/test/errorCodeTable.ini new file mode 100644 index 0000000000..1da1fd7d21 --- /dev/null +++ b/source/util/test/errorCodeTable.ini @@ -0,0 +1,632 @@ +TSDB_CODE_SUCCESS = 0 +TSDB_CODE_RPC_NETWORK_UNAVAIL = -2147483637 +TSDB_CODE_RPC_FQDN_ERROR = -2147483627 +TSDB_CODE_RPC_PORT_EADDRINUSE = -2147483625 +TSDB_CODE_RPC_BROKEN_LINK = -2147483624 +TSDB_CODE_RPC_TIMEOUT = -2147483623 +TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED = -2147483616 +TSDB_CODE_RPC_MAX_SESSIONS = -2147483614 +TSDB_CODE_RPC_NETWORK_ERROR = -2147483613 +TSDB_CODE_RPC_NETWORK_BUSY = -2147483612 +TSDB_CODE_TIME_UNSYNCED = -2147483629 +TSDB_CODE_OPS_NOT_SUPPORT = -2147483392 +TSDB_CODE_OUT_OF_MEMORY = -2147483390 +TSDB_CODE_FILE_CORRUPTED = -2147483388 +TSDB_CODE_REF_FULL = -2147483386 +TSDB_CODE_REF_ID_REMOVED = -2147483385 +TSDB_CODE_REF_INVALID_ID = -2147483384 +TSDB_CODE_REF_ALREADY_EXIST = -2147483383 +TSDB_CODE_REF_NOT_EXIST = -2147483382 +TSDB_CODE_APP_ERROR = -2147483376 +TSDB_CODE_ACTION_IN_PROGRESS = -2147483375 +TSDB_CODE_OUT_OF_RANGE = -2147483374 +TSDB_CODE_INVALID_MSG = -2147483371 +TSDB_CODE_INVALID_MSG_LEN = -2147483370 +TSDB_CODE_INVALID_PTR = -2147483369 +TSDB_CODE_INVALID_PARA = -2147483368 +TSDB_CODE_INVALID_CFG = -2147483367 +TSDB_CODE_INVALID_OPTION = -2147483366 +TSDB_CODE_INVALID_JSON_FORMAT = -2147483365 +TSDB_CODE_INVALID_VERSION_NUMBER = -2147483364 +TSDB_CODE_INVALID_VERSION_STRING = -2147483363 +TSDB_CODE_VERSION_NOT_COMPATIBLE = -2147483362 +TSDB_CODE_CHECKSUM_ERROR = -2147483361 +TSDB_CODE_COMPRESS_ERROR = -2147483360 +TSDB_CODE_MSG_NOT_PROCESSED = -2147483359 +TSDB_CODE_CFG_NOT_FOUND = -2147483358 +TSDB_CODE_REPEAT_INIT = -2147483357 +TSDB_CODE_DUP_KEY = -2147483356 +TSDB_CODE_NEED_RETRY = -2147483355 +TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE = -2147483354 +TSDB_CODE_INVALID_TIMESTAMP = -2147483353 +TSDB_CODE_MSG_DECODE_ERROR = -2147483352 +TSDB_CODE_MSG_ENCODE_ERROR = -2147483347 +TSDB_CODE_NO_AVAIL_DISK = -2147483351 +TSDB_CODE_NOT_FOUND = -2147483350 +TSDB_CODE_NO_DISKSPACE = -2147483349 +TSDB_CODE_TIMEOUT_ERROR = -2147483348 +TSDB_CODE_NO_ENOUGH_DISKSPACE = -2147483346 +TSDB_CODE_APP_IS_STARTING = -2147483344 +TSDB_CODE_APP_IS_STOPPING = -2147483343 +TSDB_CODE_INVALID_DATA_FMT = -2147483342 +TSDB_CODE_INVALID_CFG_VALUE = -2147483341 +TSDB_CODE_IP_NOT_IN_WHITE_LIST = -2147483340 +TSDB_CODE_FAILED_TO_CONNECT_S3 = -2147483339 +TSDB_CODE_MSG_PREPROCESSED = -2147483338 +TSDB_CODE_TSC_INVALID_OPERATION = -2147483136 +TSDB_CODE_TSC_INVALID_QHANDLE = -2147483135 +TSDB_CODE_TSC_INVALID_TIME_STAMP = -2147483134 +TSDB_CODE_TSC_INVALID_VALUE = -2147483133 +TSDB_CODE_TSC_INVALID_VERSION = -2147483132 +TSDB_CODE_TSC_INVALID_IE = -2147483131 +TSDB_CODE_TSC_INVALID_FQDN = -2147483130 +TSDB_CODE_TSC_INVALID_USER_LENGTH = -2147483129 +TSDB_CODE_TSC_INVALID_PASS_LENGTH = -2147483128 +TSDB_CODE_TSC_INVALID_DB_LENGTH = -2147483127 +TSDB_CODE_TSC_INVALID_TABLE_ID_LENGTH = -2147483126 +TSDB_CODE_TSC_INVALID_CONNECTION = -2147483125 +TSDB_CODE_TSC_QUERY_CACHE_ERASED = -2147483122 +TSDB_CODE_TSC_QUERY_CANCELLED = -2147483121 +TSDB_CODE_TSC_SORTED_RES_TOO_MANY = -2147483120 +TSDB_CODE_TSC_ACTION_IN_PROGRESS = -2147483118 +TSDB_CODE_TSC_DISCONNECTED = -2147483117 +TSDB_CODE_TSC_NO_WRITE_AUTH = -2147483116 +TSDB_CODE_TSC_CONN_KILLED = -2147483115 +TSDB_CODE_TSC_SQL_SYNTAX_ERROR = -2147483114 +TSDB_CODE_TSC_DB_NOT_SELECTED = -2147483113 +TSDB_CODE_TSC_EXCEED_SQL_LIMIT = -2147483111 +TSDB_CODE_TSC_FILE_EMPTY = -2147483110 +TSDB_CODE_TSC_LINE_SYNTAX_ERROR = -2147483109 +TSDB_CODE_TSC_NO_META_CACHED = -2147483108 +TSDB_CODE_TSC_DUP_COL_NAMES = -2147483107 +TSDB_CODE_TSC_INVALID_TAG_LENGTH = -2147483106 +TSDB_CODE_TSC_INVALID_COLUMN_LENGTH = -2147483105 +TSDB_CODE_TSC_DUP_NAMES = -2147483104 +TSDB_CODE_TSC_INVALID_JSON = -2147483103 +TSDB_CODE_TSC_INVALID_JSON_TYPE = -2147483102 +TSDB_CODE_TSC_VALUE_OUT_OF_RANGE = -2147483100 +TSDB_CODE_TSC_INVALID_INPUT = -2147483095 +TSDB_CODE_TSC_STMT_API_ERROR = -2147483094 +TSDB_CODE_TSC_STMT_TBNAME_ERROR = -2147483093 +TSDB_CODE_TSC_STMT_CLAUSE_ERROR = -2147483092 +TSDB_CODE_TSC_QUERY_KILLED = -2147483091 +TSDB_CODE_TSC_NO_EXEC_NODE = -2147483090 +TSDB_CODE_TSC_NOT_STABLE_ERROR = -2147483089 +TSDB_CODE_TSC_STMT_CACHE_ERROR = -2147483088 +TSDB_CODE_TSC_ENCODE_PARAM_ERROR = -2147483087 +TSDB_CODE_TSC_ENCODE_PARAM_NULL = -2147483086 +TSDB_CODE_TSC_COMPRESS_PARAM_ERROR = -2147483085 +TSDB_CODE_TSC_COMPRESS_LEVEL_ERROR = -2147483084 +TSDB_CODE_TSC_INTERNAL_ERROR = -2147482881 +TSDB_CODE_MND_REQ_REJECTED = -2147482880 +TSDB_CODE_MND_NO_RIGHTS = -2147482877 +TSDB_CODE_MND_INVALID_SHOWOBJ = -2147482869 +TSDB_CODE_MND_INVALID_QUERY_ID = -2147482868 +TSDB_CODE_MND_INVALID_CONN_ID = -2147482866 +TSDB_CODE_MND_USER_DISABLED = -2147482859 +TSDB_CODE_MND_INVALID_PLATFORM = -2147482858 +TSDB_CODE_SDB_OBJ_ALREADY_THERE = -2147482848 +TSDB_CODE_SDB_INVALID_TABLE_TYPE = -2147482846 +TSDB_CODE_SDB_OBJ_NOT_THERE = -2147482845 +TSDB_CODE_SDB_INVALID_ACTION_TYPE = -2147482842 +TSDB_CODE_SDB_INVALID_DATA_VER = -2147482840 +TSDB_CODE_SDB_INVALID_DATA_LEN = -2147482839 +TSDB_CODE_SDB_INVALID_DATA_CONTENT = -2147482838 +TSDB_CODE_SDB_OBJ_CREATING = -2147482836 +TSDB_CODE_SDB_OBJ_DROPPING = -2147482835 +TSDB_CODE_MND_DNODE_ALREADY_EXIST = -2147482832 +TSDB_CODE_MND_DNODE_NOT_EXIST = -2147482831 +TSDB_CODE_MND_VGROUP_NOT_EXIST = -2147482830 +TSDB_CODE_MND_CANT_DROP_LEADER = -2147482829 +TSDB_CODE_MND_NO_ENOUGH_DNODES = -2147482828 +TSDB_CODE_MND_INVALID_CLUSTER_CFG = -2147482827 +TSDB_CODE_MND_VGROUP_NOT_IN_DNODE = -2147482824 +TSDB_CODE_MND_VGROUP_ALREADY_IN_DNODE = -2147482823 +TSDB_CODE_MND_INVALID_CLUSTER_ID = -2147482821 +TSDB_CODE_MND_ACCT_ALREADY_EXIST = -2147482816 +TSDB_CODE_MND_INVALID_ACCT_OPTION = -2147482814 +TSDB_CODE_MND_ACCT_EXPIRED = -2147482813 +TSDB_CODE_MND_ACCT_NOT_EXIST = -2147482812 +TSDB_CODE_MND_TOO_MANY_ACCTS = -2147482811 +TSDB_CODE_MND_USER_ALREADY_EXIST = -2147482800 +TSDB_CODE_MND_USER_NOT_EXIST = -2147482799 +TSDB_CODE_MND_INVALID_USER_FORMAT = -2147482798 +TSDB_CODE_MND_USER_NOT_AVAILABLE = -2147482792 +TSDB_CODE_MND_INVALID_PASS_FORMAT = -2147482797 +TSDB_CODE_MND_NO_USER_FROM_CONN = -2147482796 +TSDB_CODE_MND_TOO_MANY_USERS = -2147482795 +TSDB_CODE_MND_INVALID_ALTER_OPER = -2147482794 +TSDB_CODE_MND_AUTH_FAILURE = -2147482793 +TSDB_CODE_MND_PRIVILEDGE_EXIST = -2147482791 +TSDB_CODE_MND_USER_HOST_EXIST = -2147482790 +TSDB_CODE_MND_USER_HOST_NOT_EXIST = -2147482789 +TSDB_CODE_MND_TOO_MANY_USER_HOST = -2147482788 +TSDB_CODE_MND_USER_LOCAL_HOST_NOT_DROP = -2147482787 +TSDB_CODE_MND_STB_ALREADY_EXIST = -2147482784 +TSDB_CODE_MND_STB_NOT_EXIST = -2147482782 +TSDB_CODE_MND_TOO_MANY_TAGS = -2147482780 +TSDB_CODE_MND_TOO_MANY_COLUMNS = -2147482779 +TSDB_CODE_MND_TAG_ALREADY_EXIST = -2147482775 +TSDB_CODE_MND_TAG_NOT_EXIST = -2147482774 +TSDB_CODE_MND_COLUMN_ALREADY_EXIST = -2147482773 +TSDB_CODE_MND_COLUMN_NOT_EXIST = -2147482772 +TSDB_CODE_MND_INVALID_STB_OPTION = -2147482770 +TSDB_CODE_MND_INVALID_ROW_BYTES = -2147482769 +TSDB_CODE_MND_FIELD_VALUE_OVERFLOW = -2147482768 +TSDB_CODE_MND_COLUMN_COMPRESS_ALREADY_EXIST = -2147482632 +TSDB_CODE_MND_INVALID_FUNC_NAME = -2147482768 +TSDB_CODE_MND_INVALID_FUNC_CODE = -2147482766 +TSDB_CODE_MND_FUNC_ALREADY_EXIST = -2147482765 +TSDB_CODE_MND_FUNC_NOT_EXIST = -2147482764 +TSDB_CODE_MND_INVALID_FUNC_BUFSIZE = -2147482763 +TSDB_CODE_MND_INVALID_FUNC_COMMENT = -2147482760 +TSDB_CODE_MND_INVALID_FUNC_RETRIEVE = -2147482759 +TSDB_CODE_MND_TAG_INDEX_ALREADY_EXIST = -2147482493 +TSDB_CODE_MND_TAG_INDEX_NOT_EXIST = -2147482492 +TSDB_CODE_MND_DB_NOT_SELECTED = -2147482752 +TSDB_CODE_MND_DB_ALREADY_EXIST = -2147482751 +TSDB_CODE_MND_INVALID_DB_OPTION = -2147482750 +TSDB_CODE_MND_INVALID_DB = -2147482749 +TSDB_CODE_MND_TOO_MANY_DATABASES = -2147482747 +TSDB_CODE_MND_DB_IN_DROPPING = -2147482746 +TSDB_CODE_MND_DB_NOT_EXIST = -2147482744 +TSDB_CODE_MND_INVALID_DB_ACCT = -2147482743 +TSDB_CODE_MND_DB_OPTION_UNCHANGED = -2147482742 +TSDB_CODE_MND_DB_INDEX_NOT_EXIST = -2147482741 +TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO = -2147482740 +TSDB_CODE_MND_INVALID_ENCRYPT_KEY = -2147482738 +TSDB_CODE_MND_DB_IN_CREATING = -2147482730 +TSDB_CODE_MND_INVALID_SYS_TABLENAME = -2147482726 +TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE = -2147482725 +TSDB_CODE_MND_MNODE_ALREADY_EXIST = -2147482720 +TSDB_CODE_MND_MNODE_NOT_EXIST = -2147482719 +TSDB_CODE_MND_QNODE_ALREADY_EXIST = -2147482718 +TSDB_CODE_MND_QNODE_NOT_EXIST = -2147482717 +TSDB_CODE_MND_SNODE_ALREADY_EXIST = -2147482716 +TSDB_CODE_MND_SNODE_NOT_EXIST = -2147482715 +TSDB_CODE_MND_TOO_FEW_MNODES = -2147482712 +TSDB_CODE_MND_TOO_MANY_MNODES = -2147482711 +TSDB_CODE_MND_ARBGROUP_ALREADY_EXIST = -2147482710 +TSDB_CODE_MND_ARBGROUP_NOT_EXIST = -2147482709 +TSDB_CODE_MND_ARB_TOKEN_MISMATCH = -2147482708 +TSDB_CODE_MND_TOO_MANY_DNODES = -2147482704 +TSDB_CODE_MND_NO_ENOUGH_MEM_IN_DNODE = -2147482703 +TSDB_CODE_MND_INVALID_DNODE_CFG = -2147482702 +TSDB_CODE_MND_INVALID_DNODE_EP = -2147482701 +TSDB_CODE_MND_INVALID_DNODE_ID = -2147482700 +TSDB_CODE_MND_VGROUP_UN_CHANGED = -2147482699 +TSDB_CODE_MND_HAS_OFFLINE_DNODE = -2147482698 +TSDB_CODE_MND_INVALID_REPLICA = -2147482697 +TSDB_CODE_MND_NO_ENOUGH_VNODES = -2147482694 +TSDB_CODE_MND_NAME_CONFLICT_WITH_TOPIC = -2147482688 +TSDB_CODE_MND_TOO_MANY_STBS = -2147482687 +TSDB_CODE_MND_INVALID_STB_ALTER_OPTION = -2147482686 +TSDB_CODE_MND_STB_OPTION_UNCHNAGED = -2147482685 +TSDB_CODE_MND_FIELD_CONFLICT_WITH_TOPIC = -2147482684 +TSDB_CODE_MND_SINGLE_STB_MODE_DB = -2147482683 +TSDB_CODE_MND_INVALID_SCHEMA_VER = -2147482682 +TSDB_CODE_MND_STABLE_UID_NOT_MATCH = -2147482681 +TSDB_CODE_MND_FIELD_CONFLICT_WITH_TSMA = -2147482680 +TSDB_CODE_MND_DNODE_IN_CREATING = -2147482696 +TSDB_CODE_MND_DNODE_IN_DROPPING = -2147482695 +TSDB_CODE_MND_TRANS_ALREADY_EXIST = -2147482672 +TSDB_CODE_MND_TRANS_NOT_EXIST = -2147482671 +TSDB_CODE_MND_TRANS_INVALID_STAGE = -2147482670 +TSDB_CODE_MND_TRANS_CONFLICT = -2147482669 +TSDB_CODE_MND_TRANS_CLOG_IS_NULL = -2147482668 +TSDB_CODE_MND_TRANS_NETWORK_UNAVAILL = -2147482667 +TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED = -2147482666 +TSDB_CODE_MND_TRANS_SYNC_TIMEOUT = -2147482665 +TSDB_CODE_MND_TRANS_CTX_SWITCH = -2147482664 +TSDB_CODE_MND_TRANS_UNKNOW_ERROR = -2147482657 +TSDB_CODE_MND_TOPIC_ALREADY_EXIST = -2147482656 +TSDB_CODE_MND_TOPIC_NOT_EXIST = -2147482655 +TSDB_CODE_MND_TOO_MANY_TOPICS = -2147482654 +TSDB_CODE_MND_INVALID_TOPIC = -2147482653 +TSDB_CODE_MND_INVALID_TOPIC_QUERY = -2147482652 +TSDB_CODE_MND_INVALID_TOPIC_OPTION = -2147482651 +TSDB_CODE_MND_CONSUMER_NOT_EXIST = -2147482650 +TSDB_CODE_MND_TOPIC_OPTION_UNCHNAGED = -2147482649 +TSDB_CODE_MND_SUBSCRIBE_NOT_EXIST = -2147482648 +TSDB_CODE_MND_OFFSET_NOT_EXIST = -2147482647 +TSDB_CODE_MND_CONSUMER_NOT_READY = -2147482646 +TSDB_CODE_MND_TOPIC_SUBSCRIBED = -2147482645 +TSDB_CODE_MND_CGROUP_USED = -2147482644 +TSDB_CODE_MND_TOPIC_MUST_BE_DELETED = -2147482643 +TSDB_CODE_MND_INVALID_SUB_OPTION = -2147482642 +TSDB_CODE_MND_IN_REBALANCE = -2147482641 +TSDB_CODE_MND_STREAM_ALREADY_EXIST = -2147482640 +TSDB_CODE_MND_STREAM_NOT_EXIST = -2147482639 +TSDB_CODE_MND_INVALID_STREAM_OPTION = -2147482638 +TSDB_CODE_MND_STREAM_MUST_BE_DELETED = -2147482637 +TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB = -2147482635 +TSDB_CODE_MND_TOO_MANY_STREAMS = -2147482634 +TSDB_CODE_MND_INVALID_TARGET_TABLE = -2147482633 +TSDB_CODE_MND_SMA_ALREADY_EXIST = -2147482496 +TSDB_CODE_MND_SMA_NOT_EXIST = -2147482495 +TSDB_CODE_MND_INVALID_SMA_OPTION = -2147482494 +TSDB_CODE_MND_INVALID_DROP_TSMA = -2147482491 +TSDB_CODE_MND_MAX_TSMA_NUM_EXCEEDED = -2147482490 +TSDB_CODE_MND_VIEW_ALREADY_EXIST = -2147482464 +TSDB_CODE_MND_VIEW_NOT_EXIST = -2147482463 +TSDB_CODE_MND_INVALID_COMPACT_ID = -2147482447 +TSDB_CODE_MND_COMPACT_DETAIL_NOT_EXIST = -2147482446 +TSDB_CODE_DNODE_OFFLINE = -2147482616 +TSDB_CODE_MNODE_NOT_FOUND = -2147482614 +TSDB_CODE_MNODE_ALREADY_DEPLOYED = -2147482615 +TSDB_CODE_MNODE_NOT_DEPLOYED = -2147482613 +TSDB_CODE_QNODE_NOT_FOUND = -2147482611 +TSDB_CODE_QNODE_ALREADY_DEPLOYED = -2147482612 +TSDB_CODE_QNODE_NOT_DEPLOYED = -2147482610 +TSDB_CODE_SNODE_NOT_FOUND = -2147482608 +TSDB_CODE_SNODE_ALREADY_DEPLOYED = -2147482609 +TSDB_CODE_SNODE_NOT_DEPLOYED = -2147482607 +TSDB_CODE_MNODE_NOT_CATCH_UP = -2147482606 +TSDB_CODE_MNODE_ALREADY_IS_VOTER = -2147482605 +TSDB_CODE_MNODE_ONLY_TWO_MNODE = -2147482604 +TSDB_CODE_MNODE_NO_NEED_RESTORE = -2147482603 +TSDB_CODE_DNODE_ONLY_USE_WHEN_OFFLINE = -2147482602 +TSDB_CODE_DNODE_NO_MACHINE_CODE = -2147482601 +TSDB_CODE_DNODE_NO_ENCRYPT_KEY = -2147482600 +TSDB_CODE_DNODE_INVALID_ENCRYPT_CONFIG = -2147482599 +TSDB_CODE_DNODE_INVALID_ENCRYPTKEY = -2147482592 +TSDB_CODE_DNODE_ENCRYPTKEY_CHANGED = -2147482591 +TSDB_CODE_DNODE_INVALID_ENCRYPT_KLEN = -2147482590 +TSDB_CODE_DNODE_INVALID_STATUS_INTERVAL = -2147482589 +TSDB_CODE_DNODE_INVALID_TIMEZONE = -2147482588 +TSDB_CODE_DNODE_INVALID_CHARSET = -2147482587 +TSDB_CODE_DNODE_INVALID_LOCALE = -2147482586 +TSDB_CODE_DNODE_INVALID_TTL_CHG_ON_WR = -2147482585 +TSDB_CODE_DNODE_INVALID_EN_WHITELIST = -2147482584 +TSDB_CODE_VND_INVALID_VGROUP_ID = -2147482365 +TSDB_CODE_VND_INIT_FAILED = -2147482364 +TSDB_CODE_VND_NO_WRITE_AUTH = -2147482350 +TSDB_CODE_VND_NOT_EXIST = -2147482336 +TSDB_CODE_VND_ALREADY_EXIST = -2147482335 +TSDB_CODE_VND_HASH_MISMATCH = -2147482334 +TSDB_CODE_VND_INVALID_TABLE_ACTION = -2147482332 +TSDB_CODE_VND_COL_ALREADY_EXISTS = -2147482331 +TSDB_CODE_VND_COL_NOT_EXISTS = -2147482330 +TSDB_CODE_VND_COL_SUBSCRIBED = -2147482329 +TSDB_CODE_VND_NO_AVAIL_BUFPOOL = -2147482328 +TSDB_CODE_VND_STOPPED = -2147482327 +TSDB_CODE_VND_DUP_REQUEST = -2147482320 +TSDB_CODE_VND_QUERY_BUSY = -2147482319 +TSDB_CODE_VND_NOT_CATCH_UP = -2147482318 +TSDB_CODE_VND_ALREADY_IS_VOTER = -2147482317 +TSDB_CODE_VND_DIR_ALREADY_EXIST = -2147482316 +TSDB_CODE_VND_META_DATA_UNSAFE_DELETE = -2147482315 +TSDB_CODE_VND_ARB_NOT_SYNCED = -2147482314 +TSDB_CODE_VND_COLUMN_COMPRESS_ALREADY_EXIST = -2147482314 +TSDB_CODE_TDB_INVALID_TABLE_ID = -2147482112 +TSDB_CODE_TDB_INVALID_TABLE_TYPE = -2147482111 +TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION = -2147482110 +TSDB_CODE_TDB_TABLE_ALREADY_EXIST = -2147482109 +TSDB_CODE_TDB_INVALID_CONFIG = -2147482108 +TSDB_CODE_TDB_INIT_FAILED = -2147482107 +TSDB_CODE_TDB_NO_DISK_PERMISSIONS = -2147482105 +TSDB_CODE_TDB_TAG_VER_OUT_OF_DATE = -2147482102 +TSDB_CODE_TDB_TIMESTAMP_OUT_OF_RANGE = -2147482101 +TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP = -2147482100 +TSDB_CODE_TDB_INVALID_ACTION = -2147482099 +TSDB_CODE_TDB_INVALID_CREATE_TB_MSG = -2147482098 +TSDB_CODE_TDB_NO_TABLE_DATA_IN_MEM = -2147482097 +TSDB_CODE_TDB_FILE_ALREADY_EXISTS = -2147482096 +TSDB_CODE_TDB_TABLE_RECONFIGURE = -2147482095 +TSDB_CODE_TDB_IVD_CREATE_TABLE_INFO = -2147482094 +TSDB_CODE_TDB_NO_AVAIL_DISK = -2147482093 +TSDB_CODE_TDB_MESSED_MSG = -2147482092 +TSDB_CODE_TDB_IVLD_TAG_VAL = -2147482091 +TSDB_CODE_TDB_NO_CACHE_LAST_ROW = -2147482090 +TSDB_CODE_TDB_TABLE_NOT_EXIST = -2147482088 +TSDB_CODE_TDB_STB_ALREADY_EXIST = -2147482087 +TSDB_CODE_TDB_STB_NOT_EXIST = -2147482086 +TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER = -2147482085 +TSDB_CODE_TDB_TDB_ENV_OPEN_ERROR = -2147482084 +TSDB_CODE_TDB_TABLE_IN_OTHER_STABLE = -2147482083 +TSDB_CODE_QRY_INVALID_QHANDLE = -2147481856 +TSDB_CODE_QRY_INVALID_MSG = -2147481855 +TSDB_CODE_QRY_DUP_JOIN_KEY = -2147481851 +TSDB_CODE_QRY_EXCEED_TAGS_LIMIT = -2147481850 +TSDB_CODE_QRY_NOT_READY = -2147481849 +TSDB_CODE_QRY_HAS_RSP = -2147481848 +TSDB_CODE_QRY_IN_EXEC = -2147481847 +TSDB_CODE_QRY_TOO_MANY_TIMEWINDOW = -2147481846 +TSDB_CODE_QRY_NOT_ENOUGH_BUFFER = -2147481845 +TSDB_CODE_QRY_INCONSISTAN = -2147481844 +TSDB_CODE_QRY_SYS_ERROR = -2147481843 +TSDB_CODE_QRY_INVALID_TIME_CONDITION = -2147481842 +TSDB_CODE_QRY_INVALID_INPUT = -2147481841 +TSDB_CODE_QRY_SCH_NOT_EXIST = -2147481824 +TSDB_CODE_QRY_TASK_NOT_EXIST = -2147481823 +TSDB_CODE_QRY_TASK_ALREADY_EXIST = -2147481822 +TSDB_CODE_QRY_TASK_CTX_NOT_EXIST = -2147481821 +TSDB_CODE_QRY_TASK_CANCELLED = -2147481820 +TSDB_CODE_QRY_TASK_DROPPED = -2147481819 +TSDB_CODE_QRY_TASK_CANCELLING = -2147481818 +TSDB_CODE_QRY_TASK_DROPPING = -2147481817 +TSDB_CODE_QRY_DUPLICATED_OPERATION = -2147481816 +TSDB_CODE_QRY_TASK_MSG_ERROR = -2147481815 +TSDB_CODE_QRY_JOB_FREED = -2147481814 +TSDB_CODE_QRY_TASK_STATUS_ERROR = -2147481813 +TSDB_CODE_QRY_JSON_IN_ERROR = -2147481812 +TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR = -2147481811 +TSDB_CODE_QRY_JSON_IN_GROUP_ERROR = -2147481810 +TSDB_CODE_QRY_JOB_NOT_EXIST = -2147481809 +TSDB_CODE_QRY_QWORKER_QUIT = -2147481808 +TSDB_CODE_QRY_GEO_NOT_SUPPORT_ERROR = -2147481807 +TSDB_CODE_QRY_INVALID_WINDOW_CONDITION = -2147481838 +TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR = -2147481806 +TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR = -2147481806 +TSDB_CODE_QRY_INVALID_JOIN_CONDITION = -2147481805 +TSDB_CODE_GRANT_EXPIRED = -2147481600 +TSDB_CODE_GRANT_DNODE_LIMITED = -2147481599 +TSDB_CODE_GRANT_ACCT_LIMITED = -2147481598 +TSDB_CODE_GRANT_TIMESERIES_LIMITED = -2147481597 +TSDB_CODE_GRANT_DB_LIMITED = -2147481596 +TSDB_CODE_GRANT_USER_LIMITED = -2147481595 +TSDB_CODE_GRANT_CONN_LIMITED = -2147481594 +TSDB_CODE_GRANT_STREAM_LIMITED = -2147481593 +TSDB_CODE_GRANT_SPEED_LIMITED = -2147481592 +TSDB_CODE_GRANT_STORAGE_LIMITED = -2147481591 +TSDB_CODE_GRANT_SUBSCRIPTION_LIMITED = -2147481590 +TSDB_CODE_GRANT_CPU_LIMITED = -2147481589 +TSDB_CODE_GRANT_STABLE_LIMITED = -2147481588 +TSDB_CODE_GRANT_TABLE_LIMITED = -2147481587 +TSDB_CODE_GRANT_PAR_IVLD_ACTIVE = -2147481586 +TSDB_CODE_GRANT_PAR_IVLD_KEY = -2147481585 +TSDB_CODE_GRANT_PAR_DEC_IVLD_KEY = -2147481584 +TSDB_CODE_GRANT_PAR_DEC_IVLD_KLEN = -2147481583 +TSDB_CODE_GRANT_GEN_IVLD_KEY = -2147481582 +TSDB_CODE_GRANT_GEN_ACTIVE_LEN = -2147481581 +TSDB_CODE_GRANT_GEN_ENC_IVLD_KLEN = -2147481580 +TSDB_CODE_GRANT_PAR_IVLD_DIST = -2147481579 +TSDB_CODE_GRANT_UNLICENSED_CLUSTER = -2147481578 +TSDB_CODE_GRANT_LACK_OF_BASIC = -2147481577 +TSDB_CODE_GRANT_OBJ_NOT_EXIST = -2147481576 +TSDB_CODE_GRANT_LAST_ACTIVE_NOT_FOUND = -2147481575 +TSDB_CODE_GRANT_MACHINES_MISMATCH = -2147481568 +TSDB_CODE_GRANT_OPT_EXPIRE_TOO_LARGE = -2147481567 +TSDB_CODE_GRANT_DUPLICATED_ACTIVE = -2147481566 +TSDB_CODE_GRANT_VIEW_LIMITED = -2147481565 +TSDB_CODE_GRANT_BASIC_EXPIRED = -2147481564 +TSDB_CODE_GRANT_STREAM_EXPIRED = -2147481563 +TSDB_CODE_GRANT_SUBSCRIPTION_EXPIRED = -2147481562 +TSDB_CODE_GRANT_VIEW_EXPIRED = -2147481561 +TSDB_CODE_GRANT_AUDIT_EXPIRED = -2147481560 +TSDB_CODE_GRANT_CSV_EXPIRED = -2147481559 +TSDB_CODE_GRANT_MULTI_STORAGE_EXPIRED = -2147481558 +TSDB_CODE_GRANT_OBJECT_STROAGE_EXPIRED = -2147481557 +TSDB_CODE_GRANT_DUAL_REPLICA_HA_EXPIRED = -2147481556 +TSDB_CODE_GRANT_DB_ENCRYPTION_EXPIRED = -2147481555 +TSDB_CODE_SYN_TIMEOUT = -2147481341 +TSDB_CODE_SYN_MISMATCHED_SIGNATURE = -2147481337 +TSDB_CODE_SYN_NOT_LEADER = -2147481332 +TSDB_CODE_SYN_NEW_CONFIG_ERROR = -2147481329 +TSDB_CODE_SYN_PROPOSE_NOT_READY = -2147481327 +TSDB_CODE_SYN_RESTORING = -2147481324 +TSDB_CODE_SYN_INVALID_SNAPSHOT_MSG = -2147481323 +TSDB_CODE_SYN_BUFFER_FULL = -2147481322 +TSDB_CODE_SYN_WRITE_STALL = -2147481321 +TSDB_CODE_SYN_NEGOTIATION_WIN_FULL = -2147481320 +TSDB_CODE_SYN_INTERNAL_ERROR = -2147481089 +TSDB_CODE_TQ_INVALID_CONFIG = -2147481088 +TSDB_CODE_TQ_INIT_FAILED = -2147481087 +TSDB_CODE_TQ_NO_DISK_PERMISSIONS = -2147481085 +TSDB_CODE_TQ_FILE_ALREADY_EXISTS = -2147481082 +TSDB_CODE_TQ_FAILED_TO_CREATE_DIR = -2147481081 +TSDB_CODE_TQ_META_NO_SUCH_KEY = -2147481080 +TSDB_CODE_TQ_META_KEY_NOT_IN_TXN = -2147481079 +TSDB_CODE_TQ_META_KEY_DUP_IN_TXN = -2147481078 +TSDB_CODE_TQ_GROUP_NOT_SET = -2147481077 +TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND = -2147481076 +TSDB_CODE_TQ_NO_COMMITTED_OFFSET = -2147481075 +TSDB_CODE_WAL_FILE_CORRUPTED = -2147479551 +TSDB_CODE_WAL_INVALID_VER = -2147479549 +TSDB_CODE_WAL_LOG_NOT_EXIST = -2147479547 +TSDB_CODE_WAL_CHKSUM_MISMATCH = -2147479546 +TSDB_CODE_WAL_LOG_INCOMPLETE = -2147479545 +TSDB_CODE_FS_INVLD_CFG = -2147474943 +TSDB_CODE_FS_TOO_MANY_MOUNT = -2147474942 +TSDB_CODE_FS_DUP_PRIMARY = -2147474941 +TSDB_CODE_FS_NO_PRIMARY_DISK = -2147474940 +TSDB_CODE_FS_NO_MOUNT_AT_TIER = -2147474939 +TSDB_CODE_FS_FILE_ALREADY_EXISTS = -2147474938 +TSDB_CODE_FS_INVLD_LEVEL = -2147474937 +TSDB_CODE_FS_NO_VALID_DISK = -2147474936 +TSDB_CODE_CTG_INTERNAL_ERROR = -2147474432 +TSDB_CODE_CTG_INVALID_INPUT = -2147474431 +TSDB_CODE_CTG_NOT_READY = -2147474430 +TSDB_CODE_CTG_SYS_ERROR = -2147474429 +TSDB_CODE_CTG_DB_DROPPED = -2147474428 +TSDB_CODE_CTG_OUT_OF_SERVICE = -2147474427 +TSDB_CODE_CTG_VG_META_MISMATCH = -2147474426 +TSDB_CODE_CTG_EXIT = -2147474425 +TSDB_CODE_QW_MSG_ERROR = -2147474096 +TSDB_CODE_SCH_STATUS_ERROR = -2147474175 +TSDB_CODE_SCH_INTERNAL_ERROR = -2147474174 +TSDB_CODE_SCH_TIMEOUT_ERROR = -2147474172 +TSDB_CODE_SCH_JOB_IS_DROPPING = -2147474171 +TSDB_CODE_SCH_JOB_NOT_EXISTS = -2147474170 +TSDB_CODE_PAR_SYNTAX_ERROR = -2147473920 +TSDB_CODE_PAR_INCOMPLETE_SQL = -2147473919 +TSDB_CODE_PAR_INVALID_COLUMN = -2147473918 +TSDB_CODE_PAR_TABLE_NOT_EXIST = -2147473917 +TSDB_CODE_PAR_AMBIGUOUS_COLUMN = -2147473916 +TSDB_CODE_PAR_WRONG_VALUE_TYPE = -2147473915 +TSDB_CODE_PAR_ILLEGAL_USE_AGG_FUNCTION = -2147473912 +TSDB_CODE_PAR_WRONG_NUMBER_OF_SELECT = -2147473911 +TSDB_CODE_PAR_GROUPBY_LACK_EXPRESSION = -2147473910 +TSDB_CODE_PAR_NOT_SELECTED_EXPRESSION = -2147473909 +TSDB_CODE_PAR_NOT_SINGLE_GROUP = -2147473908 +TSDB_CODE_PAR_TAGS_NOT_MATCHED = -2147473907 +TSDB_CODE_PAR_INVALID_TAG_NAME = -2147473906 +TSDB_CODE_PAR_NAME_OR_PASSWD_TOO_LONG = -2147473904 +TSDB_CODE_PAR_PASSWD_EMPTY = -2147473903 +TSDB_CODE_PAR_INVALID_PORT = -2147473902 +TSDB_CODE_PAR_INVALID_ENDPOINT = -2147473901 +TSDB_CODE_PAR_EXPRIE_STATEMENT = -2147473900 +TSDB_CODE_PAR_INTER_VALUE_TOO_SMALL = -2147473899 +TSDB_CODE_PAR_INTER_VALUE_TOO_BIG = -2147473893 +TSDB_CODE_PAR_DB_NOT_SPECIFIED = -2147473898 +TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME = -2147473897 +TSDB_CODE_PAR_CORRESPONDING_STABLE_ERR = -2147473896 +TSDB_CODE_PAR_INVALID_DB_OPTION = -2147473895 +TSDB_CODE_PAR_INVALID_TABLE_OPTION = -2147473894 +TSDB_CODE_PAR_GROUPBY_WINDOW_COEXIST = -2147473884 +TSDB_CODE_PAR_AGG_FUNC_NESTING = -2147473881 +TSDB_CODE_PAR_INVALID_STATE_WIN_TYPE = -2147473880 +TSDB_CODE_PAR_INVALID_STATE_WIN_COL = -2147473879 +TSDB_CODE_PAR_INVALID_STATE_WIN_TABLE = -2147473878 +TSDB_CODE_PAR_INTER_SESSION_GAP = -2147473877 +TSDB_CODE_PAR_INTER_SESSION_COL = -2147473876 +TSDB_CODE_PAR_INTER_OFFSET_NEGATIVE = -2147473875 +TSDB_CODE_PAR_INTER_OFFSET_UNIT = -2147473874 +TSDB_CODE_PAR_INTER_OFFSET_TOO_BIG = -2147473873 +TSDB_CODE_PAR_INTER_SLIDING_UNIT = -2147473872 +TSDB_CODE_PAR_INTER_SLIDING_TOO_BIG = -2147473871 +TSDB_CODE_PAR_INTER_SLIDING_TOO_SMALL = -2147473870 +TSDB_CODE_PAR_ONLY_ONE_JSON_TAG = -2147473869 +TSDB_CODE_PAR_INCORRECT_NUM_OF_COL = -2147473868 +TSDB_CODE_PAR_INCORRECT_TIMESTAMP_VAL = -2147473867 +TSDB_CODE_PAR_OFFSET_LESS_ZERO = -2147473865 +TSDB_CODE_PAR_SLIMIT_LEAK_PARTITION_GROUP_BY = -2147473864 +TSDB_CODE_PAR_INVALID_TOPIC_QUERY = -2147473863 +TSDB_CODE_PAR_INVALID_DROP_STABLE = -2147473862 +TSDB_CODE_PAR_INVALID_FILL_TIME_RANGE = -2147473861 +TSDB_CODE_PAR_DUPLICATED_COLUMN = -2147473860 +TSDB_CODE_PAR_INVALID_TAGS_LENGTH = -2147473859 +TSDB_CODE_PAR_INVALID_ROW_LENGTH = -2147473858 +TSDB_CODE_PAR_INVALID_COLUMNS_NUM = -2147473857 +TSDB_CODE_PAR_TOO_MANY_COLUMNS = -2147473856 +TSDB_CODE_PAR_INVALID_FIRST_COLUMN = -2147473855 +TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN = -2147473854 +TSDB_CODE_PAR_INVALID_TAGS_NUM = -2147473853 +TSDB_CODE_PAR_PERMISSION_DENIED = -2147473852 +TSDB_CODE_PAR_INVALID_STREAM_QUERY = -2147473851 +TSDB_CODE_PAR_INVALID_INTERNAL_PK = -2147473850 +TSDB_CODE_PAR_INVALID_TIMELINE_FUNC = -2147473849 +TSDB_CODE_PAR_INVALID_PASSWD = -2147473848 +TSDB_CODE_PAR_INVALID_ALTER_TABLE = -2147473847 +TSDB_CODE_PAR_CANNOT_DROP_PRIMARY_KEY = -2147473846 +TSDB_CODE_PAR_INVALID_MODIFY_COL = -2147473845 +TSDB_CODE_PAR_INVALID_TBNAME = -2147473844 +TSDB_CODE_PAR_INVALID_FUNCTION_NAME = -2147473843 +TSDB_CODE_PAR_COMMENT_TOO_LONG = -2147473842 +TSDB_CODE_PAR_NOT_ALLOWED_FUNC = -2147473841 +TSDB_CODE_PAR_NOT_ALLOWED_WIN_QUERY = -2147473840 +TSDB_CODE_PAR_INVALID_DROP_COL = -2147473839 +TSDB_CODE_PAR_INVALID_COL_JSON = -2147473838 +TSDB_CODE_PAR_VALUE_TOO_LONG = -2147473837 +TSDB_CODE_PAR_INVALID_DELETE_WHERE = -2147473835 +TSDB_CODE_PAR_INVALID_REDISTRIBUTE_VG = -2147473834 +TSDB_CODE_PAR_FILL_NOT_ALLOWED_FUNC = -2147473833 +TSDB_CODE_PAR_INVALID_WINDOW_PC = -2147473832 +TSDB_CODE_PAR_WINDOW_NOT_ALLOWED_FUNC = -2147473831 +TSDB_CODE_PAR_STREAM_NOT_ALLOWED_FUNC = -2147473830 +TSDB_CODE_PAR_GROUP_BY_NOT_ALLOWED_FUNC = -2147473829 +TSDB_CODE_PAR_INVALID_INTERP_CLAUSE = -2147473827 +TSDB_CODE_PAR_NO_VALID_FUNC_IN_WIN = -2147473826 +TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE = -2147473825 +TSDB_CODE_PAR_INVALID_SMA_INDEX = -2147473824 +TSDB_CODE_PAR_INVALID_SELECTED_EXPR = -2147473823 +TSDB_CODE_PAR_GET_META_ERROR = -2147473822 +TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS = -2147473821 +TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED_FUNC = -2147473816 +TSDB_CODE_PAR_SYSTABLE_NOT_ALLOWED = -2147473815 +TSDB_CODE_PAR_INVALID_VARBINARY = -2147473814 +TSDB_CODE_PAR_INVALID_IP_RANGE = -2147473813 +TSDB_CODE_PAR_INVALID_STREAM_QUERY = -2147473851 +TSDB_CODE_PAR_INVALID_VIEW_QUERY = -2147473812 +TSDB_CODE_PAR_COL_QUERY_MISMATCH = -2147473811 +TSDB_CODE_PAR_VIEW_CONFLICT_WITH_TABLE = -2147473810 +TSDB_CODE_PAR_NOT_SUPPORT_MULTI_RESULT = -2147473808 +TSDB_CODE_PAR_INVALID_WJOIN_HAVING_EXPR = -2147473806 +TSDB_CODE_PAR_GRP_WINDOW_NOT_ALLOWED = -2147473807 +TSDB_CODE_PAR_INVALID_WIN_OFFSET_UNIT = -2147473805 +TSDB_CODE_PAR_VALID_PRIM_TS_REQUIRED = -2147473804 +TSDB_CODE_PAR_ORDERBY_UNKNOWN_EXPR = -2147473803 +TSDB_CODE_PAR_NOT_WIN_FUNC = -2147473802 +TSDB_CODE_PAR_TAG_IS_PRIMARY_KEY = -2147473801 +TSDB_CODE_PAR_SECOND_COL_PK = -2147473800 +TSDB_CODE_PAR_COL_PK_TYPE = -2147473799 +TSDB_CODE_PAR_INVALID_PK_OP = -2147473798 +TSDB_CODE_PAR_PRIMARY_KEY_IS_NULL = -2147473797 +TSDB_CODE_PAR_PRIMARY_KEY_IS_NONE = -2147473796 +TSDB_CODE_PAR_INTERNAL_ERROR = -2147473665 +TSDB_CODE_PLAN_INTERNAL_ERROR = -2147473664 +TSDB_CODE_PLAN_EXPECTED_TS_EQUAL = -2147473663 +TSDB_CODE_PLAN_NOT_SUPPORT_CROSS_JOIN = -2147473662 +TSDB_CODE_PLAN_NOT_SUPPORT_JOIN_COND = -2147473661 +TSDB_CODE_FUNC_FUNTION_ERROR = -2147473408 +TSDB_CODE_FUNC_FUNTION_PARA_NUM = -2147473407 +TSDB_CODE_FUNC_FUNTION_PARA_TYPE = -2147473406 +TSDB_CODE_FUNC_FUNTION_PARA_VALUE = -2147473405 +TSDB_CODE_FUNC_NOT_BUILTIN_FUNTION = -2147473404 +TSDB_CODE_FUNC_DUP_TIMESTAMP = -2147473403 +TSDB_CODE_FUNC_TO_TIMESTAMP_FAILED_FORMAT_ERR = -2147473402 +TSDB_CODE_FUNC_TO_TIMESTAMP_FAILED_TS_ERR = -2147473401 +TSDB_CODE_FUNC_TO_TIMESTAMP_FAILED_NOT_SUPPORTED = -2147473400 +TSDB_CODE_FUNC_TO_CHAR_NOT_SUPPORTED = -2147473399 +TSDB_CODE_UDF_STOPPING = -2147473151 +TSDB_CODE_UDF_PIPE_READ_ERR = -2147473150 +TSDB_CODE_UDF_PIPE_CONNECT_ERR = -2147473149 +TSDB_CODE_UDF_PIPE_NOT_EXIST = -2147473148 +TSDB_CODE_UDF_LOAD_UDF_FAILURE = -2147473147 +TSDB_CODE_UDF_INVALID_INPUT = -2147473146 +TSDB_CODE_UDF_INVALID_BUFSIZE = -2147473145 +TSDB_CODE_UDF_INVALID_OUTPUT_TYPE = -2147473144 +TSDB_CODE_UDF_SCRIPT_NOT_SUPPORTED = -2147473143 +TSDB_CODE_UDF_FUNC_EXEC_FAILURE = -2147473142 +TSDB_CODE_SML_INVALID_PROTOCOL_TYPE = -2147471360 +TSDB_CODE_SML_INVALID_PRECISION_TYPE = -2147471359 +TSDB_CODE_SML_INVALID_DATA = -2147471358 +TSDB_CODE_SML_INVALID_DB_CONF = -2147471357 +TSDB_CODE_SML_NOT_SAME_TYPE = -2147471356 +TSDB_CODE_SML_INTERNAL_ERROR = -2147471355 +TSDB_CODE_SML_NOT_SUPPORT_PK = -2147471354 +TSDB_CODE_TSMA_INIT_FAILED = -2147471104 +TSDB_CODE_TSMA_ALREADY_EXIST = -2147471103 +TSDB_CODE_TSMA_INVALID_ENV = -2147471102 +TSDB_CODE_TSMA_INVALID_STAT = -2147471101 +TSDB_CODE_TSMA_INVALID_PTR = -2147471100 +TSDB_CODE_TSMA_INVALID_PARA = -2147471099 +TSDB_CODE_TSMA_INVALID_TB = -2147471098 +TSDB_CODE_TSMA_INVALID_INTERVAL = -2147471097 +TSDB_CODE_TSMA_INVALID_FUNC_PARAM = -2147471096 +TSDB_CODE_TSMA_UNSUPPORTED_FUNC = -2147471095 +TSDB_CODE_TSMA_MUST_BE_DROPPED = -2147471088 +TSDB_CODE_TSMA_NAME_TOO_LONG = -2147471087 +TSDB_CODE_RSMA_INVALID_ENV = -2147471024 +TSDB_CODE_RSMA_INVALID_STAT = -2147471023 +TSDB_CODE_RSMA_QTASKINFO_CREATE = -2147471022 +TSDB_CODE_RSMA_INVALID_SCHEMA = -2147471021 +TSDB_CODE_RSMA_STREAM_STATE_OPEN = -2147471020 +TSDB_CODE_RSMA_STREAM_STATE_COMMIT = -2147471019 +TSDB_CODE_RSMA_FS_SYNC = -2147471018 +TSDB_CODE_RSMA_RESULT = -2147471017 +TSDB_CODE_INDEX_REBUILDING = -2147470848 +TSDB_CODE_INDEX_INVALID_FILE = -2147470847 +TSDB_CODE_SCALAR_CONVERT_ERROR = -2147470768 +TSDB_CODE_TMQ_INVALID_MSG = -2147467264 +TSDB_CODE_TMQ_NEED_INITIALIZED = -2147467248 +TSDB_CODE_TMQ_SNAPSHOT_ERROR = -2147467258 +TSDB_CODE_TMQ_NO_COMMITTED = -2147467247 +TSDB_CODE_TMQ_VERSION_OUT_OF_RANGE = -2147467257 +TSDB_CODE_TMQ_INVALID_VGID = -2147467256 +TSDB_CODE_TMQ_INVALID_TOPIC = -2147467255 +TSDB_CODE_TMQ_CONSUMER_MISMATCH = -2147467263 +TSDB_CODE_TMQ_CONSUMER_CLOSED = -2147467262 +TSDB_CODE_TMQ_CONSUMER_ERROR = -2147467261 +TSDB_CODE_TMQ_TOPIC_OUT_OF_RANGE = -2147467260 +TSDB_CODE_TMQ_GROUP_OUT_OF_RANGE = -2147467259 +TSDB_CODE_TMQ_SAME_COMMITTED_VALUE = -2147467246 +TSDB_CODE_TMQ_REPLAY_NEED_ONE_VGROUP = -2147467245 +TSDB_CODE_TMQ_REPLAY_NOT_SUPPORT = -2147467244 +TSDB_CODE_STREAM_TASK_NOT_EXIST = -2147467008 +TSDB_CODE_STREAM_EXEC_CANCELLED = -2147467006 +TSDB_CODE_STREAM_INVALID_STATETRANS = -2147467005 +TSDB_CODE_STREAM_TASK_IVLD_STATUS = -2147467004 +TSDB_CODE_TDLITE_IVLD_OPEN_FLAGS = -2147462912 +TSDB_CODE_TDLITE_IVLD_OPEN_DIR = -2147462911 +TSDB_CODE_UTIL_QUEUE_OUT_OF_MEMORY = -2147459072 diff --git a/source/util/test/terrorTest.cpp b/source/util/test/terrorTest.cpp new file mode 100644 index 0000000000..0e968edbe3 --- /dev/null +++ b/source/util/test/terrorTest.cpp @@ -0,0 +1,220 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "taoserror.h" + +using namespace std; + +enum class ParseStatus { + Success, + FileNotExist, + FileNotOpen, +}; + +typedef struct { + int32_t val; + string str; // unused + string macro; +} STestTaosError; + +string getExecutableDirectory() { + char result[PATH_MAX]; + ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); + if (count != -1) { + result[count] = '\0'; + string path(result); + size_t pos = path.rfind('/'); + if (pos != string::npos) { + path.erase(pos + 1); + } + return path; + } else { + throw std::runtime_error("Failed to get the executable's directory"); + } +} + +// parses key-value pairs from strings +pair parseKeyValuePair(const string &line, char delim = '=') { + size_t pos = line.find(delim); + if (pos == string::npos) + return make_pair("", 0); + + string key = line.substr(0, pos); + + // remove leading spaces + size_t firstNotSpace = key.find_first_not_of(" "); + if (firstNotSpace != string::npos) { + key = key.substr(firstNotSpace); + } else { + key.clear(); + } + + // remove ending spaces + size_t lastNotSpace = key.find_last_not_of(" "); + if (lastNotSpace != string::npos) { + key = key.substr(0, lastNotSpace + 1); + } + + if (key.front() == '"' && key.back() == '"') + key = key.substr(1, key.size() - 2); + + if (key.front() == '\'' && key.back() == '\'') + key = key.substr(1, key.size() - 2); + + string valStr = line.substr(pos + 1); + int32_t val = stoi(valStr); + return make_pair(key, val); +} + +// read the configuration file and parse it into the STestTaosError array +ParseStatus readConfig(const string& filePath, vector& errorInfos) { + ifstream file(filePath); + if (!file.is_open()) { + if (file.fail() && errno == ENOENT) { + cerr << "Error: The file does not exist, file: " << filePath << endl; + return ParseStatus::FileNotExist; + } else { + cerr << "Error: Could not open the file, file: " << filePath << endl; + return ParseStatus::FileNotOpen; + } + } + + string line; + while (std::getline(file, line)) { + char delim = '#'; + if (line.find('=') != string::npos) { + delim = '='; + } else if (line.find(':') != string::npos) { + delim = ':'; + } else if (line.find('{') != string::npos || line.find('}') != string::npos) { + // TODO: parse json format + continue; + } else { + continue; + } + + auto curKwInfo = parseKeyValuePair(line, delim); + + STestTaosError errorInfo; + errorInfo.macro = curKwInfo.first; + errorInfo.val = curKwInfo.second; + errorInfos.push_back(errorInfo); + } + + return ParseStatus::Success; +} + + +TEST(TAOS_ERROR_TEST, terror_compatibility_test) { + int32_t errSize = taosGetErrSize(); + // for (int32_t i = 0; i < errSize; ++i) { + // STaosError *pInfo = &errors[i]; + // std::cout << i + 1 << " " << pInfo->macro << " " << pInfo->val << std::endl; + // } + + + // current errors: to map + unordered_map map; + for (int32_t i = 0; i < errSize; ++i) { + STaosError *pInfo = &errors[i]; + map[pInfo->macro] = pInfo; + } + + string configFileName = "errorCodeTable.ini"; + string execDir = getExecutableDirectory(); + string configFilePath(execDir + configFileName); + + vector errorInfos; + ParseStatus status = readConfig(configFilePath, errorInfos); + + switch (status) { + case ParseStatus::Success: + for (const auto& stdInfo : errorInfos) { + auto it = map.find(stdInfo.macro); + if (it == map.end()) { + FAIL() << "Error: Could not find error: " << stdInfo.macro << "."; + } else { + auto newInfo = it->second; + + ASSERT_STREQ(stdInfo.macro.c_str(), newInfo->macro); + ASSERT_EQ(stdInfo.val, newInfo->val) + << "Error code mismatch(" << stdInfo.macro << "): expected " << stdInfo.val << ", got " << newInfo->val << "."; + } + } + break; + case ParseStatus::FileNotExist: + FAIL() << "Error: The file does not exist, file: " << configFileName << "."; + break; + case ParseStatus::FileNotOpen: + FAIL() << "Error: Could not open the file, file: " << configFileName << "."; + break; + default: + FAIL() << "Unknown Error."; + break; + } +} + + +size_t maxLengthOfErrorMacro() { + size_t maxLen = 0; + int32_t errSize = taosGetErrSize(); + for (int32_t i = 0; i < errSize; ++i) { + STaosError *pInfo = &errors[i]; + maxLen = std::max(maxLen, strlen(pInfo->macro)); + } + return (maxLen / 4 + 1) * 4; +} + + +void generateConfigFile(const string& filePath) { + int32_t errSize = taosGetErrSize(); + size_t maxStringLength = maxLengthOfErrorMacro(); + std::ofstream file(filePath); + if (!file.is_open()) { + cerr << "Failed to open file for writing, at: " << filePath << "." << endl; + return; + } + + for (int32_t i = 0; i < errSize; ++i) { + STaosError *pInfo = &errors[i]; + file << std::left << std::setw(maxStringLength) << pInfo->macro << "= " << pInfo->val << endl; + } + + if (file.fail()) { + cerr << "An error occurred while writing to the file." << endl; + } else { + cout << "Data successfully written to file: " << filePath << endl; + } + + file.close(); +} + + +void processCommandArgs(int argc, char** argv) { + for (int i = 1; i < argc; ++i) { + if (string(argv[i]) == "--output-config") { + string configFile = (i + 1 < argc) ? argv[++i] : "./errorCodeTable.ini"; + generateConfigFile(configFile); + exit(0); + } + } +} + + +int main(int argc, char **argv) { + processCommandArgs(argc, argv); + + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/tests/army/test.py b/tests/army/test.py index dda5d7d5b0..332d7f29c4 100644 --- a/tests/army/test.py +++ b/tests/army/test.py @@ -657,8 +657,10 @@ if __name__ == "__main__": conn = taos.connect(host=f"{host}", config=tdDnodes.getSimCfgPath()) if fileName == "all": + tdLog.info("Procedures for testing runAllLinux") tdCases.runAllLinux(conn) else: + tdLog.info(f"Procedures for testing runOneLinux {fileName}") tdCases.runOneLinux(conn, fileName, replicaVar) # do restart option diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1eaf17ccb1..6114a560dc 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -536,6 +536,8 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py @@ -780,6 +782,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 2 @@ -875,6 +878,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 3 @@ -972,6 +976,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 4 @@ -1485,6 +1490,7 @@ ,,y,script,./test.sh -f tsim/view/view.sim ,,y,script,./test.sh -f tsim/query/cache_last.sim ,,y,script,./test.sh -f tsim/query/const.sim +,,y,script,./test.sh -f tsim/query/nestedJoinView.sim #develop test diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh index 76d890b26a..b69f1eba4f 100755 --- a/tests/script/sh/deploy.sh +++ b/tests/script/sh/deploy.sh @@ -121,7 +121,7 @@ echo "tmrDebugFlag 131" >> $TAOS_CFG echo "uDebugFlag 131" >> $TAOS_CFG echo "rpcDebugFlag 135" >> $TAOS_CFG echo "jniDebugFlag 131" >> $TAOS_CFG -echo "qDebugFlag 131" >> $TAOS_CFG +echo "qDebugFlag 135" >> $TAOS_CFG echo "cDebugFlag 135" >> $TAOS_CFG echo "dDebugFlag 131" >> $TAOS_CFG echo "vDebugFlag 131" >> $TAOS_CFG @@ -136,7 +136,7 @@ echo "idxDebugFlag 135" >> $TAOS_CFG echo "udfDebugFlag 135" >> $TAOS_CFG echo "smaDebugFlag 135" >> $TAOS_CFG echo "metaDebugFlag 135" >> $TAOS_CFG -echo "stDebugFlag 135" >> $TAOS_CFG +echo "stDebugFlag 143" >> $TAOS_CFG echo "numOfLogLines 20000000" >> $TAOS_CFG echo "asyncLog 0" >> $TAOS_CFG echo "locale en_US.UTF-8" >> $TAOS_CFG diff --git a/tests/script/tsim/compress/compress2.sim b/tests/script/tsim/compress/compress2.sim index a439d75a59..0af6f87de4 100644 --- a/tests/script/tsim/compress/compress2.sim +++ b/tests/script/tsim/compress/compress2.sim @@ -163,6 +163,31 @@ sql alter table $stb modify column f compress 'zlib' sql desc $stb sql alter table $stb modify column f compress 'zstd' + +sql alter table $stb modify column f compress 'zstd' level 'h' +sql_error alter table $stb modify column f compress 'zstd' level 'h' + +sql alter table $stb modify column f compress 'lz4' level 'h' +sql_error alter table $stb modify column f compress 'lz4' level 'h' + + +sql alter table $stb modify column f level 'low' +sql_error alter table $stb modify column f compress 'lz4' + +sql_error alter table $stb modify column f compress 'lz4' level 'low' + +sql alter table $stb modify column f compress 'zstd' level 'h' + +sql_error alter table $stb modify column f compress 'zstd' +sql_error alter table $stb modify column f level 'h' + + + +sql alter table $stb modify column f compress 'lz4' + + + + sql_error alter table $stb modify column d compress 'lz4' # same with init sql alter table $stb modify column d compress 'disabled' sql desc $stb diff --git a/tests/script/tsim/query/nestedJoinView.sim b/tests/script/tsim/query/nestedJoinView.sim new file mode 100644 index 0000000000..efdec9fcbc --- /dev/null +++ b/tests/script/tsim/query/nestedJoinView.sim @@ -0,0 +1,19 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +sql create database test; +sql use test; + +sql CREATE TABLE `resource_info` ( job_id_ts TIMESTAMP , role VARCHAR(20) primary key, start_time TIMESTAMP, ip VARCHAR(15), cpu FLOAT, memory FLOAT, io_write FLOAT, io_read FLOAT, net_write FLOAT, net_read FLOAT) TAGS ( end_time TIMESTAMP); + +sql CREATE STABLE `test_results` ( `job_id_ts` TIMESTAMP , `end_time` VARCHAR(40) PRIMARY KEY, `job_id` BIGINT, `time_cost` FLOAT, `write_speed` FLOAT, `qps` FLOAT, `min_delay` FLOAT, `p90_delay` FLOAT, `p95_delay` FLOAT, `p99_delay` FLOAT, `max_delay` FLOAT, `avg_delay` FLOAT, `hostname` VARCHAR(15), `tdengine_commit_id` VARCHAR(50), `tdinternal_commit_id` VARCHAR(50), `load_type` VARCHAR(50), `cpu` FLOAT, `memory` FLOAT, `io_write` FLOAT, `io_read` FLOAT) TAGS ( `branch` VARCHAR(50), `scenario` VARCHAR(50), `test_case` VARCHAR(1000), `env_id` INT, `type` VARCHAR(50)); + +sql CREATE TABLE `job_info` ( `start_time` TIMESTAMP , `finish_time` TIMESTAMP , `job_id` INT, `job_status` VARCHAR(20), `test_type` VARCHAR(50), `environment` INT, `version` VARCHAR(20), `tdengine_commit_id` VARCHAR(50), `tdinternal_commit_id` VARCHAR(50), `type` VARCHAR(50), `scenario` VARCHAR(50), `note` VARCHAR(500), `version_number` VARCHAR(20)); + +sql create view abc as select * from ( select a.job_id, a.start_time as job_start_time, a.finish_time as job_end_time, a.job_status, a.test_type, a.environment, case when a.version_number <> null then a.version else CONCAT(a.version,'_',a.version_number) end as version_info, a.tdengine_commit_id, a.tdinternal_commit_id, a.type, a.scenario, a.note, a.version_number, b.end_time as tc_end_time, b.time_cost, b.write_speed, b.qps, b.min_delay, b.p90_delay, b.p95_delay, b.p99_delay, b.`max_delay`, b.avg_delay, b.hostname, b.load_type, b.scenario, b.test_case, b.type from job_info a, test_results b where a.start_time=b.job_id_ts and a.job_status='finished') s1 inner join resource_info s2 on s1.job_start_time=s2.job_id_ts and s1.job_id=2 and s1.tc_end_time=s2.end_time; + +sql select * from abc; + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/scalar/scalar.sim b/tests/script/tsim/scalar/scalar.sim index 900f7c0904..e28c3d1a4d 100644 --- a/tests/script/tsim/scalar/scalar.sim +++ b/tests/script/tsim/scalar/scalar.sim @@ -48,6 +48,8 @@ if $data00 != @70-02-01 08:00:00.001@ then return -1 endi +sql select cast('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as double); + sql select 1-1n; if $rows != 1 then return -1 diff --git a/tests/script/tsim/show/showalive.sim b/tests/script/tsim/show/showalive.sim new file mode 100644 index 0000000000..4cad1da01d --- /dev/null +++ b/tests/script/tsim/show/showalive.sim @@ -0,0 +1,167 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/deploy.sh -n dnode2 -i 2 +system sh/deploy.sh -n dnode3 -i 3 +system sh/deploy.sh -n dnode4 -i 4 +system sh/exec.sh -n dnode1 -s start +system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start +system sh/exec.sh -n dnode4 -s start + +sleep 1000 + +sql connect + + +print =============== add dnode into cluster +sql create dnode $hostname1 port 7200 +sql create dnode $hostname2 port 7300 +sql create dnode $hostname3 port 7400 +sql create dnode $hostname4 port 7500 + +sleep 1000 + +print =============== create database, stable, table +sql create database test vgroups 6; +sql use test; +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql insert into t1 values(1648791211000,1,2,3); +sql insert into t1 values(1648791222001,2,2,3); +sql insert into t2 values(1648791211000,1,2,3); +sql insert into t2 values(1648791222001,2,2,3); + +$loop_count = 0 + +loop0: + +sleep 1000 + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +print show cluster alive; +sql show cluster alive; + +if $data00 != 1 then + print =====data00=$data00 + goto loop0 +endi + +print show test.alive; +sql show test.alive; + +if $data00 != 1 then + print =====data00=$data00 + goto loop0 +endi + +print stop dnode3 +print stop dnode4 +system sh/exec.sh -n dnode3 -s stop -x SIGKILL +system sh/exec.sh -n dnode4 -s stop -x SIGKILL + +$loop_count = 0 + +loop1: + +sleep 1000 + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +print show cluster alive; +sql show cluster alive; + +if $data00 != 2 then + print =====data00=$data00 + goto loop1 +endi + +print show test.alive +sql show test.alive; + +if $data00 != 2 then + print =====data00=$data00 + goto loop1 +endi + + +sql create database test1 vgroups 2; + +$loop_count = 0 + +loop2: + +sleep 1000 + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +print show cluster alive; +sql show cluster alive; + +if $data00 != 2 then + goto loop2 +endi + +print show test1.alive; +sql show test1.alive; + +if $data00 != 1 then + print =====data00=$data00 + goto loop2 +endi + +print stop dnode2 + +system sh/exec.sh -n dnode2 -s stop -x SIGKILL + + +$loop_count = 0 + +loop3: + +sleep 1000 + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + + +print show cluster alive; +sql show cluster alive; + +if $data00 != 2 then + print =====data00=$data00 + goto loop3 +endi + +print show test.alive; +sql show test.alive; + +if $data00 != 2 then + print =====data00=$data00 + goto loop3 +endi + +sql show test1.alive; + +if $data00 != 2 then + print =====data00=$data00 + goto loop3 +endi + + +system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/exec.sh -n dnode2 -s stop -x SIGINT +system sh/exec.sh -n dnode3 -s stop -x SIGINT +system sh/exec.sh -n dnode4 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/checkStreamSTable1.sim b/tests/script/tsim/stream/checkStreamSTable1.sim index dd44f5c102..d5781a4e85 100644 --- a/tests/script/tsim/stream/checkStreamSTable1.sim +++ b/tests/script/tsim/stream/checkStreamSTable1.sim @@ -15,7 +15,7 @@ sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); sql create table t1 using st tags(1,1,1); sql create table t2 using st tags(2,2,2); sql create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(a) c2 from st interval(1s) ; -sleep 500 +sleep 1000 sql insert into t1 values(1648791211000,1,2,3); sql insert into t1 values(1648791212000,2,2,3); @@ -46,7 +46,7 @@ sql alter table streamt1 add column c3 double; print create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(a) c2, avg(b) c3 from st interval(1s) ; sql create stream streams1 trigger at_once into streamt1 as select _wstart, count(*) c1, count(a) c2, avg(b) c3 from st interval(1s) ; -sleep 500 +sleep 1000 sql insert into t2 values(1648791213000,1,2,3); sql insert into t1 values(1648791214000,1,2,3); @@ -57,7 +57,7 @@ loop1: sleep 1000 $loop_count = $loop_count + 1 -if $loop_count == 10 then +if $loop_count == 100 then return -1 endi diff --git a/tests/script/tsim/stream/pauseAndResume.sim b/tests/script/tsim/stream/pauseAndResume.sim index 9a05e645c2..b9d6e141be 100644 --- a/tests/script/tsim/stream/pauseAndResume.sim +++ b/tests/script/tsim/stream/pauseAndResume.sim @@ -336,6 +336,8 @@ sql create table ts3 using st tags(3,2,2); sql create table ts4 using st tags(4,2,2); sql create stream streams6 trigger at_once IGNORE EXPIRED 0 IGNORE UPDATE 0 watermark 1d into streamt6 as select _wstart, count(*) c1 from st interval(10s); +sleep 1000 + sql insert into ts1 values(1648791213001,1,12,3,1.0); sql insert into ts2 values(1648791213001,1,12,3,1.0); @@ -354,6 +356,8 @@ sql insert into ts2 values(1648791233001,1,12,3,1.0); sql resume stream streams6; +sleep 1000 + sql insert into ts3 values(1648791243001,1,12,3,1.0); sql insert into ts4 values(1648791253001,1,12,3,1.0); diff --git a/tests/script/tsim/user/basic.sim b/tests/script/tsim/user/basic.sim index 353e1d080a..0e1fbb5b40 100644 --- a/tests/script/tsim/user/basic.sim +++ b/tests/script/tsim/user/basic.sim @@ -217,14 +217,18 @@ endi sql_error CREATE USER u100 PASS 'taosdata' SYSINFO -1; sql_error CREATE USER u101 PASS 'taosdata' SYSINFO 2; sql_error CREATE USER u102 PASS 'taosdata' SYSINFO 20000; +sql_error CREATE USER u103 PASS 'taosdata' SYSINFO 1000; sql_error ALTER USER u1 enable -1 sql_error ALTER USER u1 enable 2 +sql_error ALTER USER u1 enable 1000 sql_error ALTER USER u1 enable 10000 sql_error ALTER USER u1 sysinfo -1 sql_error ALTER USER u1 sysinfo 2 +sql_error ALTER USER u1 sysinfo 1000 sql_error ALTER USER u1 sysinfo -20000 sql_error ALTER USER u1 createdb -1 sql_error ALTER USER u1 createdb 3 +sql_error ALTER USER u1 createdb 1000 sql_error ALTER USER u1 createdb 100000 system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 7a0d1b048a..d5754b1063 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -222,7 +222,7 @@ class TDTestCase: tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'") tdLog.info(len(tdSql.queryResult)) - tdSql.checkEqual(True, len(tdSql.queryResult) in range(261, 262)) + tdSql.checkEqual(True, len(tdSql.queryResult) in range(261, 269)) tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'") tdSql.checkEqual(54, len(tdSql.queryResult)) diff --git a/tests/system-test/0-others/multilevel.py b/tests/system-test/0-others/multilevel.py index 7b0ebb4b78..3ed4002fcd 100644 --- a/tests/system-test/0-others/multilevel.py +++ b/tests/system-test/0-others/multilevel.py @@ -52,7 +52,7 @@ class TDTestCase: tdLog.info("============== basic test ===============") cfg={ '/mnt/data1' : 'dataDir', - '/mnt/data2 0 0' : 'dataDir' + '/mnt/data2 0 0 0' : 'dataDir' } tdSql.createDir('/mnt/data1') tdSql.createDir('/mnt/data2') @@ -112,9 +112,9 @@ class TDTestCase: cfg={ '/mnt/data00 0 1' : 'dataDir', '/mnt/data01 0 0' : 'dataDir', - '/mnt/data02 0 0' : 'dataDir', + '/mnt/data02 0 0 0' : 'dataDir', '/mnt/data03 0 0' : 'dataDir', - '/mnt/data04 0 0' : 'dataDir' + '/mnt/data04 0 0 0' : 'dataDir' } dir_list = ['/mnt/data00','/mnt/data01','/mnt/data02','/mnt/data03','/mnt/data04'] for i in dir_list: @@ -160,15 +160,15 @@ class TDTestCase: tdDnodes.stop(1) # Test1 1 dataDir cfg={ - '/mnt/data000 0 1' : 'dataDir', + '/mnt/data000 0 1 0' : 'dataDir', '/mnt/data001 0 0' : 'dataDir', - '/mnt/data002 0 0' : 'dataDir', + '/mnt/data002 0 0 0' : 'dataDir', '/mnt/data010 1 0' : 'dataDir', - '/mnt/data011 1 0' : 'dataDir', + '/mnt/data011 1 0 0' : 'dataDir', '/mnt/data012 1 0' : 'dataDir', - '/mnt/data020 2 0' : 'dataDir', - '/mnt/data021 2 0' : 'dataDir', - '/mnt/data022 2 0' : 'dataDir' + '/mnt/data020 2 0 0' : 'dataDir', + '/mnt/data021 2 0 0' : 'dataDir', + '/mnt/data022 2 0 0' : 'dataDir' } dir_list = ['/mnt/data000','/mnt/data001','/mnt/data002','/mnt/data010','/mnt/data011','/mnt/data012','/mnt/data020','/mnt/data021''/mnt/data022'] for i in dir_list: @@ -189,7 +189,7 @@ class TDTestCase: if i == 0 : datadir = '/mnt/data%d 0 1' % (i+1) else: - datadir = '/mnt/data%d 0 0' % (i+1) + datadir = '/mnt/data%d 0 0 0' % (i+1) cfg.update({ datadir : 'dataDir' }) tdSql.createDir('/mnt/data%d' % (i+1)) @@ -227,6 +227,22 @@ class TDTestCase: tdSql.taosdStatus(0) + def disable_create_new_file(self): + tdLog.info("============== disable_create_new_file_0_not_exist test ===============") + cfg={ + '/mnt/data1 0 1 1' : 'dataDir', + '/mnt/data2 0 0 1' : 'dataDir' + } + tdSql.createDir('/mnt/data1') + tdSql.createDir('/mnt/data2') + + tdLog.info("================= step1") + tdDnodes.deploy(1,cfg) + tdDnodes.startWithoutSleep(1) + + tdLog.info("================= step2") + tdSql.taosdStatus(0) + def trim_database(self): tdLog.info("============== trim_database test ===============") tdDnodes.stop(1) @@ -242,7 +258,7 @@ class TDTestCase: tdSql.execute('use dbtest') tdSql.execute('create table stb (ts timestamp,c0 int) tags(t0 int)') tdSql.execute('create table tb1 using stb tags(1)') - for i in range(10,30): + for i in range(1,600, 30): tdSql.execute(f'insert into tb1 values(now-{i}d,10)') tdSql.execute('flush database dbtest') time.sleep(3) @@ -250,21 +266,26 @@ class TDTestCase: tdDnodes.stop(1) cfg={ '/mnt/data1 0 1' : 'dataDir', - '/mnt/data2 1 0' : 'dataDir', - '/mnt/data3 2 0' : 'dataDir', + '/mnt/data2 1 0 0' : 'dataDir', + '/mnt/data3 1 0 1' : 'dataDir', + '/mnt/data4 2 0' : 'dataDir', } tdSql.createDir('/mnt/data2') tdSql.createDir('/mnt/data3') + tdSql.createDir('/mnt/data4') tdDnodes.deploy(1,cfg) tdDnodes.start(1) checkFiles('/mnt/data1/vnode/*/tsdb/v*',1) checkFiles('/mnt/data2/vnode/*/tsdb/v*',0) checkFiles('/mnt/data3/vnode/*/tsdb/v*',0) + checkFiles('/mnt/data4/vnode/*/tsdb/v*',0) tdSql.execute('alter database dbtest keep 10d,365d,3650d') tdSql.execute('trim database dbtest') time.sleep(3) checkFiles('/mnt/data1/vnode/*/tsdb/v*',1) checkFiles('/mnt/data2/vnode/*/tsdb/v*',1) + checkFiles('/mnt/data3/vnode/*/tsdb/v*',0) + checkFiles('/mnt/data4/vnode/*/tsdb/v*',1) def run(self): self.basic() @@ -275,6 +296,7 @@ class TDTestCase: self.more_than_128_disks() self.trim_database() self.missing_middle_level() + self.disable_create_new_file() diff --git a/tests/system-test/0-others/user_control.py b/tests/system-test/0-others/user_control.py index c29170e112..c4d24582e4 100644 --- a/tests/system-test/0-others/user_control.py +++ b/tests/system-test/0-others/user_control.py @@ -514,7 +514,7 @@ class TDTestCase: def test_alter_user(self): options = ["enable", "sysinfo", "createdb"] - optionErrVals = [-10000, -128, -1, 2, 127, 10000] + optionErrVals = [-10000, -128, -1, 2, 127, 1000, 10000] for optionErrVal in optionErrVals: tdSql.error("create user user_alter pass 'taosdata' sysinfo %d" % optionErrVal) tdSql.execute("create user user_alter pass 'taosdata'") diff --git a/tests/system-test/2-query/agg_group_AlwaysReturnValue.py b/tests/system-test/2-query/agg_group_AlwaysReturnValue.py index 9ed0e3fc4a..0cac9cb03b 100755 --- a/tests/system-test/2-query/agg_group_AlwaysReturnValue.py +++ b/tests/system-test/2-query/agg_group_AlwaysReturnValue.py @@ -640,6 +640,15 @@ class TDTestCase(TDTestCase): sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname,count(*) " self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a group by tbname order by a.tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + sql1 = f"select * from ({sql})" self.data_check_tbname(sql1,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') @@ -647,7 +656,16 @@ class TDTestCase(TDTestCase): self.data_check_tbname(sql2,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 where ts is null group by tbname order by tbname,count(*) " - self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by a.tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by a.tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by tbname,count(*) " + self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') sql1 = f"select * from ({sql})" self.data_check_tbname(sql1,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') @@ -1011,7 +1029,19 @@ class TDTestCase(TDTestCase): #union all sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname,AGG(COLUMN),count(*)" sql = f"({sql}) union all ({sql}) order by tb" - self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by tbname,AGG(COLUMN),count(*)" + sql = f"({sql}) union all ({sql}) order by tb" + self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,AGG(COLUMN),count(*)" + sql = f"({sql}) union all ({sql}) order by tb" + self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by tbname order by a.tbname,AGG(COLUMN),count(*)" + sql = f"({sql}) union all ({sql}) order by tb" + self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') sql1 = f"select * from ({sql})" self.data_check_tbname(sql1,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') @@ -1572,16 +1602,79 @@ class TDTestCase(TDTestCase): tdSql.execute('alter stable stable_1 drop column q_binary5;') tdSql.execute('alter stable stable_1 drop column q_nchar4;') tdSql.execute('alter stable stable_1 drop column q_binary4;') - + + def testTBNameUseJoin(self): + tdSql.execute('CREATE STABLE `meter1` (`ts` TIMESTAMP, `v1` INT) TAGS (`t1` INT)') + tdSql.execute('CREATE STABLE `meter2` (`ts` TIMESTAMP, `v1` INT) TAGS (`t1` INT)') + + tdSql.execute('CREATE TABLE `d1` USING `meter1` (`t1`) TAGS (1)') + tdSql.execute('CREATE TABLE `d2` USING `meter1` (`t1`) TAGS (2)') + tdSql.execute('CREATE TABLE `d21` USING `meter2` (`t1`) TAGS (21)') + tdSql.execute('CREATE TABLE `d22` USING `meter2` (`t1`) TAGS (22)') + + time.sleep(1) + tdSql.query('select tbname,count(*) from d2') + tdSql.checkData(0, 1, 0) + + tdSql.execute('insert into `d1` VALUES (now, 1)') + tdSql.execute('insert into `d1` VALUES (now+1s, 2)') + tdSql.execute('insert into `d1` VALUES (now+2s, 3)') + tdSql.execute('insert into `d2` VALUES (now+3s, 11)') + tdSql.execute('insert into `d2` VALUES (now+4s, 22)') + tdSql.execute('insert into `d2` VALUES (now+5s, 33)') + tdSql.execute('insert into `d21` select * from `d1`') + + # tdSql.query('select b.tbname, count(*) from d1 a, d2 b where a.ts = b.ts group by b.tbname') + # tdSql.checkData(0, 0, 'd2') + + tdSql.query('select meter1.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname') + tdSql.checkData(0, 0, 'd1') + tdSql.checkData(0, 1, 3) + # tdSql.checkData(1, 0, 'd2') + tdSql.query('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter2.tbname order by meter2.tbname') + tdSql.checkData(0, 0, 'd21') + tdSql.checkData(0, 1, 3) + # tdSql.checkData(1, 0, 'd22') + tdSql.query('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by meter2.tbname order by meter2.tbname') + tdSql.checkData(0, 0, 'd21') + tdSql.checkData(0, 1, 3) + # tdSql.checkData(1, 0, 'd22') + tdSql.query('select m2.tbname, count(*) from meter1 m1, meter2 m2 where m1.ts = m2.ts partition by m2.tbname order by m2.tbname') + tdSql.checkData(0, 0, 'd21') + tdSql.checkData(0, 1, 3) + # tdSql.checkData(1, 0, 'd22') + + tdSql.execute('insert into `d22` select * from `d1`') + + tdSql.query('select meter1.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname') + tdSql.checkData(0, 0, 'd1') + tdSql.checkData(0, 1, 6) + + tdSql.query('select m2.tbname, count(*) from meter1 m1, meter2 m2 where m1.ts = m2.ts partition by m2.tbname order by m2.tbname') + tdSql.checkData(0, 0, 'd21') + tdSql.checkData(0, 1, 3) + tdSql.checkData(1, 0, 'd22') + tdSql.checkData(1, 1, 3) + + tdSql.error('select tbname, count(*) from d1 a, d2 b where a.ts = b.ts group by b.tbname') + # tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname') + tdSql.error('select tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter2.tbname order by meter2.tbname') + tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by meter2.tbname order by meter.tbname') + tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by tbname order by meter2.tbname') + tdSql.error('select m2.tbname, count(*) from meter1 m1, meter2 m2 where meter1.ts = meter2.ts partition by m2.tbname order by meter2.tbname') + def run(self): tdSql.prepare() startTime = time.time() # self.create_tables() - # self.insert_data() - + # self.insert_data() + + #self.testTBNameUseJoin() self.dropandcreateDB_random("nested", 1) + self.testTBNameUseJoin() + self.modify_tables() for i in range(1): @@ -1590,6 +1683,8 @@ class TDTestCase(TDTestCase): self.tbname_agg_all() + + endTime = time.time() print("total time %ds" % (endTime - startTime)) diff --git a/tests/system-test/2-query/agg_group_NotReturnValue.py b/tests/system-test/2-query/agg_group_NotReturnValue.py index 73a8fe04c3..83f0acd362 100755 --- a/tests/system-test/2-query/agg_group_NotReturnValue.py +++ b/tests/system-test/2-query/agg_group_NotReturnValue.py @@ -382,7 +382,11 @@ class TDTestCase(TDTestCase): #union all sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname " sql = f"({sql}) union all ({sql}) order by tb" - self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') + + sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by tbname " + sql = f"({sql}) union all ({sql}) order by tb" + self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') sql1 = f"select * from ({sql})" self.data_check_tbname(sql1,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}') diff --git a/tests/system-test/2-query/compa4096_tsma.json b/tests/system-test/2-query/compa4096_tsma.json index 66d98ceebe..993eb8ae58 100644 --- a/tests/system-test/2-query/compa4096_tsma.json +++ b/tests/system-test/2-query/compa4096_tsma.json @@ -1,66 +1,80 @@ { - "filetype": "insert", - "cfgdir": "/etc/taos", - "host": "localhost", - "port": 6030, - "rest_port": 6041, - "user": "root", - "password": "taosdata", - "thread_count": 100, - "create_table_thread_count": 24, - "result_file": "taosBenchmark_result.log", - "confirm_parameter_prompt": "no", - "insert_interval": 0, - "num_of_records_per_req": 1000000, - "max_sql_len": 1024000, - "databases": [ - { - "dbinfo": { - "name": "db4096", - "drop": "yes", - "replica": 1, - "duration": 10, - "precision": "ms", - "keep": 3650, - "comp": 2, - "vgroups": 2, - "buffer": 1000 - }, - "super_tables": [ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "localhost", + "port": 6030, + "rest_port": 6041, + "user": "root", + "password": "taosdata", + "thread_count": 100, + "create_table_thread_count": 24, + "result_file": "taosBenchmark_result.log", + "confirm_parameter_prompt": "no", + "insert_interval": 0, + "num_of_records_per_req": 1000000, + "max_sql_len": 1024000, + "databases": [ { - "name": "stb0", - "child_table_exists": "no", - "childtable_count":2, - "childtable_prefix": "ctb0", - "escape_character": "no", - "auto_create_table": "no", - "batch_create_tbl_num": 500, - "data_source": "rand", - "insert_mode": "taosc", - "rollup": null, - "interlace_rows": 0, - "line_protocol": null, - "tcp_transfer": "no", - "insert_rows": 10, - "childtable_limit": 0, - "childtable_offset": 0, - "rows_per_tbl": 0, - "max_sql_len": 1048576, - "disorder_ratio": 0, - "disorder_range": 1000, - "timestamp_step": 1000, - "start_timestamp": "2022-10-22 17:20:36", - "sample_format": "csv", - "sample_file": "./sample.csv", - "tags_file": "", - "columns": [{ "type": "INT","count": 4093}], - "tags": [{"type": "TINYINT", "count": 1},{"type": "NCHAR","count": 1}] + "dbinfo": { + "name": "db4096", + "drop": "yes", + "replica": 1, + "duration": 10, + "precision": "ms", + "keep": 3650, + "comp": 2, + "vgroups": 2, + "buffer": 1000 + }, + "super_tables": [ + { + "name": "stb0", + "child_table_exists": "no", + "childtable_count": 2, + "childtable_prefix": "ctb0", + "escape_character": "no", + "auto_create_table": "no", + "batch_create_tbl_num": 500, + "data_source": "rand", + "insert_mode": "taosc", + "rollup": null, + "interlace_rows": 0, + "line_protocol": null, + "tcp_transfer": "no", + "insert_rows": 10, + "childtable_limit": 0, + "childtable_offset": 0, + "rows_per_tbl": 0, + "max_sql_len": 1048576, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1000, + "start_timestamp": "2022-10-22 17:20:36", + "sample_format": "csv", + "sample_file": "./sample.csv", + "tags_file": "", + "columns": [ + { + "type": "INT", + "count": 4093 + } + ], + "tags": [ + { + "type": "TINYINT", + "count": 1 + }, + { + "type": "NCHAR", + "count": 1 + } + ] + } + ] } - ] - } - ], - "prepare_rand": 10000, - "chinese": "no", - "streams": false, - "test_log": "/root/testlog/" -} + ], + "prepare_rand": 10000, + "chinese": "no", + "streams": false, + "test_log": "/root/testlog/" +} \ No newline at end of file diff --git a/tests/system-test/2-query/partition_limit_interval.py b/tests/system-test/2-query/partition_limit_interval.py new file mode 100755 index 0000000000..dc0aabbfdd --- /dev/null +++ b/tests/system-test/2-query/partition_limit_interval.py @@ -0,0 +1,105 @@ +from util.log import * +from util.sql import * +from util.cases import * + +class TDTestCase: + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), True) + + self.row_nums = 1000 + self.tb_nums = 10 + self.ts = 1537146000000 + self.dbname = "db1" + self.stable = "meters" + + def prepare_datas(self, stb_name , tb_nums , row_nums, dbname="db" ): + tdSql.execute(f'''create database {self.dbname} MAXROWS 4096 MINROWS 100''') + tdSql.execute(f'''use {self.dbname}''') + tdSql.execute(f'''CREATE STABLE {self.dbname}.{self.stable} (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` TINYINT, `location` VARCHAR(16))''') + + for i in range(self.tb_nums): + tbname = f"{self.dbname}.sub_{self.stable}_{i}" + ts = self.ts + i*10000 + tdSql.execute(f"create table {tbname} using {self.dbname}.{self.stable} tags({i} ,'nchar_{i}')") + tdLog.info(f"create table {tbname} using {self.dbname}.{self.stable} tags({i} ,'nchar_{i}')") + if i < (self.tb_nums - 2): + for row in range(row_nums): + ts = self.ts + row*1000 + tdSql.execute(f"insert into {tbname} values({ts} , {row/10}, {215 + (row % 100)})") + + for null in range(5): + ts = self.ts + row_nums*1000 + null*1000 + tdSql.execute(f"insert into {tbname} values({ts} , NULL , NULL)") + + def basic_query(self): + tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by groupid interval(1d) limit 100") + tdSql.checkRows(8) + tdSql.checkData(0, 1, 1005) + + tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by tbname interval(1d) order by groupid limit 100;") + tdSql.checkRows(8) + tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 1, 1005) + tdSql.checkData(7, 0, 7) + tdSql.checkData(7, 1, 1005) + + tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) order by groupid limit 10") + tdSql.checkRows(8) + tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 1, 1005) + tdSql.checkData(7, 0, 7) + tdSql.checkData(7, 1, 1005) + + tdSql.query(f"select groupid, count(*), min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) order by groupid limit 10;") + tdSql.checkRows(8) + tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 1, 1005) + tdSql.checkData(0, 2, 0) + tdSql.checkData(7, 0, 7) + tdSql.checkData(7, 1, 1005) + tdSql.checkData(7, 2, 0) + + tdSql.query(f"select groupid, min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 100;") + tdSql.checkRows(8) + tdSql.checkData(0, 1, 0) + + tdSql.query(f"select groupid, avg(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 10000;") + tdSql.checkRows(8) + tdSql.checkData(0, 1, tdSql.getData(7, 1)) + + tdSql.query(f"select current, avg(current) from {self.dbname}.{self.stable} partition by current interval(5d) limit 100;") + tdSql.checkData(0, 0, tdSql.getData(0, 1)) + + tdSql.query(f"select groupid, last(voltage), min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 10") + tdSql.checkRows(8) + tdSql.checkData(0, 1, tdSql.getData(7, 1)) + tdSql.checkData(0, 2, tdSql.getData(7, 2)) + + tdSql.query(f"select groupid, min(current), min(voltage) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) limit 100;") + tdSql.checkRows(8) + tdSql.checkData(0, 1, 0) + tdSql.checkData(0, 2, 215) + tdSql.checkData(7, 1, 0) + tdSql.checkData(7, 2, 215) + + tdSql.query(f"select groupid, min(voltage), min(current) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) limit 100;") + tdSql.checkRows(8) + tdSql.checkData(0, 2, 0) + tdSql.checkData(0, 1, 215) + tdSql.checkData(7, 2, 0) + tdSql.checkData(7, 1, 215) + + def run(self): + tdSql.prepare() + self.prepare_datas("stb",self.tb_nums,self.row_nums) + self.basic_query() + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/2-query/tsma.py b/tests/system-test/2-query/tsma.py index f80aab0e82..d7dc1d24f3 100644 --- a/tests/system-test/2-query/tsma.py +++ b/tests/system-test/2-query/tsma.py @@ -1270,15 +1270,14 @@ class TDTestCase: def test_drop_tsma(self): function_name = sys._getframe().f_code.co_name tdLog.debug(f'-----{function_name}------') - self.create_tsma('tsma1', 'test', 'meters', [ - 'avg(c1)', 'avg(c2)'], '5m') + self.create_tsma('tsma1', 'test', 'meters', ['avg(c1)', 'avg(c2)'], '5m') self.create_recursive_tsma('tsma1', 'tsma2', 'test', '15m', 'meters') # drop recursive tsma first tdSql.error('drop tsma test.tsma1', -2147482491) tdSql.execute('drop tsma test.tsma2', queryTimes=1) tdSql.execute('drop tsma test.tsma1', queryTimes=1) - self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo') + self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u') tdSql.execute('drop database test', queryTimes=1) self.init_data() @@ -1319,7 +1318,7 @@ class TDTestCase: 'create tsma tsma1 on nsdb.meters function(avg(c1), avg(c2), avg(t3)) interval(5m)', -2147471096) tdSql.execute('alter table nsdb.meters drop tag t3', queryTimes=1) - self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo') + self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u') tdSql.execute('drop database nsdb') # drop norm table @@ -1346,7 +1345,7 @@ class TDTestCase: # test drop stream tdSql.error('drop stream tsma1', -2147471088) ## TSMA must be dropped first - self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo') + self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u') tdSql.execute('drop database test', queryTimes=1) self.init_data() @@ -1449,7 +1448,7 @@ class TDTestCase: tdSql.error( 'create tsma tsma1 on test.meters function(avg(c1), avg(c2)) interval(2h)', -2147471097) - self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo') + self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u') tdSql.execute('drop database nsdb') def test_create_tsma_on_norm_table(self): diff --git a/tests/system-test/6-cluster/clusterCommonCheck.py b/tests/system-test/6-cluster/clusterCommonCheck.py index 694227cea7..be99d01a5c 100644 --- a/tests/system-test/6-cluster/clusterCommonCheck.py +++ b/tests/system-test/6-cluster/clusterCommonCheck.py @@ -237,21 +237,19 @@ class ClusterComCheck: last_number=vgroup_numbers-1 while count < count_number: time.sleep(1) + count+=1 + print("check vgroup count :", count) tdSql.query(f"show {db_name}.vgroups;") - if count == 0 : - if tdSql.checkRows(vgroup_numbers) : - tdLog.success(f"{db_name} has {vgroup_numbers} vgroups" ) - else: - tdLog.exit(f"vgroup number of {db_name} is not correct") + if tdSql.getRows() != vgroup_numbers : + continue if self.db_replica == 1 : if tdSql.queryResult[0][4] == 'leader' and tdSql.queryResult[last_number][4] == 'leader': tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';") print("db replica :",tdSql.queryResult[0][0]) if tdSql.queryResult[0][0] == db_replica: - ready_time= (count + 1) - tdLog.success(f"all vgroups with replica {self.db_replica} of {db_name} are leaders in {count + 1} s") + tdLog.success(f"all vgroups with replica {self.db_replica} of {db_name} are leaders in {count} s") return True - count+=1 + elif self.db_replica == 3 : vgroup_status_first=[tdSql.queryResult[0][4],tdSql.queryResult[0][6],tdSql.queryResult[0][8]] @@ -261,10 +259,8 @@ class ClusterComCheck: tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';") print("db replica :",tdSql.queryResult[0][0]) if tdSql.queryResult[0][0] == db_replica: - ready_time= (count + 1) - tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {ready_time} s") + tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {count} s") return True - count+=1 else: tdLog.debug(tdSql.queryResult) tdLog.notice(f"elections of {db_name} all vgroups with replica {self.db_replica} are failed in {count} s ") diff --git a/tests/system-test/7-tmq/subscribeDb3.py b/tests/system-test/7-tmq/subscribeDb3.py index 37e3a17100..185d1b01cf 100644 --- a/tests/system-test/7-tmq/subscribeDb3.py +++ b/tests/system-test/7-tmq/subscribeDb3.py @@ -219,7 +219,7 @@ class TDTestCase: expectrowcnt = parameterDict["rowsPerTbl"] * parameterDict["ctbNum"] topicList = topicName1 ifcheckdata = 0 - ifManualCommit = 1 + ifManualCommit = 0 keyList = 'group.id:cgrp1,\ enable.auto.commit:false,\ auto.commit.interval.ms:6000,\ diff --git a/tests/system-test/7-tmq/tmqDropStbCtb.py b/tests/system-test/7-tmq/tmqDropStbCtb.py index eacacd913b..a1929237b7 100644 --- a/tests/system-test/7-tmq/tmqDropStbCtb.py +++ b/tests/system-test/7-tmq/tmqDropStbCtb.py @@ -157,7 +157,7 @@ class TDTestCase: tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, expectrowcnt)) if self.snapshot == 0: - if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows < expectrowcnt)): + if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows <= expectrowcnt)): tdLog.exit("tmq consume rows error with snapshot = 0!") tdLog.info("wait subscriptions exit ....") @@ -249,7 +249,7 @@ class TDTestCase: tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, expectrowcnt)) if self.snapshot == 0: - if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows < expectrowcnt)): + if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows <= expectrowcnt)): tdLog.exit("tmq consume rows error with snapshot = 0!") tdLog.info("wait subscriptions exit ....") diff --git a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py index f01bf2558c..a5e61adc8d 100644 --- a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py +++ b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py @@ -200,12 +200,11 @@ class TDTestCase: # tmqCom.checkFileContent(consumerId, queryString) - time.sleep(2) for i in range(len(topicNameList)): tdSql.query("drop topic %s"%topicNameList[i]) - if deleteWal == True: - clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240) + clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240) + tdLog.printNoPrefix("======== test case 1 end ...... ") def run(self): diff --git a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py index 5e11de04cb..eb35ebc718 100644 --- a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py +++ b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py @@ -199,13 +199,11 @@ class TDTestCase: tdLog.exit("%d tmq consume rows error!"%consumerId) # tmqCom.checkFileContent(consumerId, queryString) + clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240) - time.sleep(2) + time.sleep(3) for i in range(len(topicNameList)): tdSql.query("drop topic %s"%topicNameList[i]) - - if deleteWal == True: - clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240) tdLog.printNoPrefix("======== test case 1 end ...... ") def run(self): diff --git a/tests/system-test/8-stream/stream_multi_agg.py b/tests/system-test/8-stream/stream_multi_agg.py index acb80f528b..32c2648b46 100644 --- a/tests/system-test/8-stream/stream_multi_agg.py +++ b/tests/system-test/8-stream/stream_multi_agg.py @@ -42,7 +42,7 @@ class TDTestCase: tdSql.execute("use test", queryTimes=100) tdSql.query("create stream if not exists s1 trigger at_once ignore expired 0 ignore update 0 fill_history 1 into st1 as select _wstart,sum(voltage),groupid from meters partition by groupid interval(2s)") tdLog.debug("========create stream and insert data ok========") - time.sleep(15) + time.sleep(20) tdSql.query("select _wstart,sum(voltage),groupid from meters partition by groupid interval(2s) order by groupid,_wstart") rowCnt = tdSql.getRows() @@ -68,7 +68,7 @@ class TDTestCase: # create stream tdSql.execute("use db", queryTimes=100) tdSql.execute("create stream stream1 fill_history 1 into sta as select count(*) as cnt from meters interval(10a);",show=True) - time.sleep(5) + time.sleep(10) sql = "select count(*) from sta" # loop wait max 60s to check count is ok diff --git a/tests/system-test/runAllOne.sh b/tests/system-test/runAllOne.sh index 099ae1bbd3..79fc2cd363 100644 --- a/tests/system-test/runAllOne.sh +++ b/tests/system-test/runAllOne.sh @@ -235,6 +235,8 @@ python3 ./test.py -f 2-query/mavg.py -P python3 ./test.py -f 2-query/mavg.py -P -R python3 ./test.py -f 2-query/max_partition.py -P python3 ./test.py -f 2-query/max_partition.py -P -R +python3 ./test.py -f 2-query/partition_limit_interval.py -P +python3 ./test.py -f 2-query/partition_limit_interval.py -P -R python3 ./test.py -f 2-query/max_min_last_interval.py -P python3 ./test.py -f 2-query/last_row_interval.py -P python3 ./test.py -f 2-query/max.py -P @@ -481,6 +483,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 2 python3 ./test.py -f 2-query/function_null.py -P -Q 2 python3 ./test.py -f 2-query/count_partition.py -P -Q 2 python3 ./test.py -f 2-query/max_partition.py -P -Q 2 +python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 2 python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 2 python3 ./test.py -f 2-query/last_row_interval.py -P -Q 2 python3 ./test.py -f 2-query/last_row.py -P -Q 2 @@ -576,6 +579,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 3 python3 ./test.py -f 2-query/function_null.py -P -Q 3 python3 ./test.py -f 2-query/count_partition.py -P -Q 3 python3 ./test.py -f 2-query/max_partition.py -P -Q 3 +python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 3 python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 3 python3 ./test.py -f 2-query/last_row_interval.py -P -Q 3 python3 ./test.py -f 2-query/last_row.py -P -Q 3 @@ -673,6 +677,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 4 python3 ./test.py -f 2-query/function_null.py -P -Q 4 python3 ./test.py -f 2-query/count_partition.py -P -Q 4 python3 ./test.py -f 2-query/max_partition.py -P -Q 4 +python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 4 python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 4 python3 ./test.py -f 2-query/last_row_interval.py -P -Q 4 python3 ./test.py -f 2-query/last_row.py -P -Q 4 diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c index f48b19a287..8368837cc4 100644 --- a/tools/shell/src/shellArguments.c +++ b/tools/shell/src/shellArguments.c @@ -435,8 +435,8 @@ int32_t shellParseArgs(int32_t argc, char *argv[]) { shell.info.promptSize = strlen(shell.info.promptHeader); #ifdef TD_ENTERPRISE snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), - "%s\ntaos version: %s compatible_version: %s\ngit: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, version, - compatible_version, gitinfo, gitinfoOfInternal, buildinfo); + "%s\ntaos version: %s compatible_version: %s\ngit: %s\ngitOfInternal: %s\nbuild: %s", TD_PRODUCT_NAME, + version, compatible_version, gitinfo, gitinfoOfInternal, buildinfo); #else snprintf(shell.info.programVersion, sizeof(shell.info.programVersion), "%s\ntaos version: %s compatible_version: %s\ngit: %s\nbuild: %s", TD_PRODUCT_NAME, version, diff --git a/utils/TSZ/sz/src/sz_double.c b/utils/TSZ/sz/src/sz_double.c index 0510fc612d..7fe5a07843 100644 --- a/utils/TSZ/sz/src/sz_double.c +++ b/utils/TSZ/sz/src/sz_double.c @@ -385,11 +385,11 @@ unsigned int optimize_intervals_double_1D_opt(double *oriData, size_t dataLength totalSampleSize++; pred_value = data_pos[-1]; pred_err = fabs(pred_value - *data_pos); - double dbri = (unsigned long)((pred_err/realPrecision+1)/2); + double dbri = (pred_err/realPrecision+1)/2; if(dbri >= (double)confparams_cpr->maxRangeRadius) radiusIndex = confparams_cpr->maxRangeRadius - 1; else - radiusIndex = dbri; + radiusIndex = (size_t)dbri; intervals[radiusIndex]++; data_pos += confparams_cpr->sampleDistance; diff --git a/utils/TSZ/sz/src/sz_float.c b/utils/TSZ/sz/src/sz_float.c index 4b18eb6ee8..e5dc40f003 100644 --- a/utils/TSZ/sz/src/sz_float.c +++ b/utils/TSZ/sz/src/sz_float.c @@ -53,9 +53,12 @@ unsigned int optimize_intervals_float_1D(float *oriData, size_t dataLength, doub //pred_value = 2*oriData[i-1] - oriData[i-2]; pred_value = oriData[i-1]; pred_err = fabs(pred_value - oriData[i]); - radiusIndex = (unsigned long)((pred_err/realPrecision+1)/2); - if(radiusIndex>=confparams_cpr->maxRangeRadius) - radiusIndex = confparams_cpr->maxRangeRadius - 1; + double dbri = (pred_err/realPrecision+1)/2; + if(dbri >= confparams_cpr->maxRangeRadius) { + radiusIndex = confparams_cpr->maxRangeRadius - 1; + } else { + radiusIndex = (size_t)dbri; + } intervals[radiusIndex]++; } } @@ -404,9 +407,12 @@ unsigned int optimize_intervals_float_1D_opt(float *oriData, size_t dataLength, totalSampleSize++; pred_value = data_pos[-1]; pred_err = fabs(pred_value - *data_pos); - radiusIndex = (unsigned long)((pred_err/realPrecision+1)/2); - if(radiusIndex>=confparams_cpr->maxRangeRadius) - radiusIndex = confparams_cpr->maxRangeRadius - 1; + double dbri = (pred_err/realPrecision+1)/2; + if(dbri >= confparams_cpr->maxRangeRadius) { + radiusIndex = confparams_cpr->maxRangeRadius - 1; + } else { + radiusIndex = (size_t)dbri; + } intervals[radiusIndex]++; data_pos += confparams_cpr->sampleDistance;