diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 68caf9a9ac..3c7067a9f8 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 9cb965f + GIT_TAG f169c0f SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taosws_CMakeLists.txt.in b/cmake/taosws_CMakeLists.txt.in index 506559a245..54e898ecc0 100644 --- a/cmake/taosws_CMakeLists.txt.in +++ b/cmake/taosws_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosws-rs ExternalProject_Add(taosws-rs GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git - GIT_TAG 7a54d21 + GIT_TAG 6fc47d7 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index d9dadae976..5a84bbf370 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -71,9 +71,9 @@ database_option: { - SINGLE_STABLE: specifies whether the database can contain more than one supertable. - 0: The database can contain multiple supertables. - 1: The database can contain only one supertable. -- WAL_RETENTION_PERIOD: specifies the time after which WAL files are deleted. This parameter is used for data subscription. Enter a time in seconds. The default value is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. -- WAL_RETENTION_SIZE: specifies the size at which WAL files are deleted. This parameter is used for data subscription. Enter a size in KB. The default value is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. -- WAL_ROLL_PERIOD: specifies the time after which WAL files are rotated. After this period elapses, a new WAL file is created. The default value is 0. A value of 0 indicates that a new WAL file is created only after the previous WAL file was written to disk. +- WAL_RETENTION_PERIOD: specifies the time after which WAL files are deleted. This parameter is used for data subscription. Enter a time in seconds. The default value of single copy is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. The default value of multiple copy is 4 days. +- WAL_RETENTION_SIZE: specifies the size at which WAL files are deleted. This parameter is used for data subscription. Enter a size in KB. The default value of single copy is 0. A value of 0 indicates that each WAL file is deleted immediately after its contents are written to disk. -1: WAL files are never deleted. The default value of multiple copy is -1. +- WAL_ROLL_PERIOD: specifies the time after which WAL files are rotated. After this period elapses, a new WAL file is created. The default value of single copy is 0. A value of 0 indicates that a new WAL file is created only after the previous WAL file was written to disk. The default values of multiple copy is 1 day. - WAL_SEGMENT_SIZE: specifies the maximum size of a WAL file. After the current WAL file reaches this size, a new WAL file is created. The default value is 0. A value of 0 indicates that a new WAL file is created only after the previous WAL file was written to disk. ### Example Statement diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 1dd0caed38..1f86111925 100644 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -52,11 +52,6 @@ window_clause: { | STATE_WINDOW(col) | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] -changes_option: { - DURATION duration_val - | ROWS rows_val -} - group_by_clause: GROUP BY expr [, expr] ... HAVING condition @@ -126,7 +121,6 @@ SELECT DISTINCT col_name [, col_name ...] FROM tb_name; 1. Configuration parameter `maxNumOfDistinctRes` in `taos.cfg` is used to control the number of rows to output. The minimum configurable value is 100,000, the maximum configurable value is 100,000,000, the default value is 1,000,000. If the actual number of rows exceeds the value of this parameter, only the number of rows specified by this parameter will be output. 2. It can't be guaranteed that the results selected by using `DISTINCT` on columns of `FLOAT` or `DOUBLE` are exactly unique because of the precision errors in floating point numbers. -3. `DISTINCT` can't be used in the sub-query of a nested query statement, and can't be used together with aggregate functions, `GROUP BY` or `JOIN` in the same SQL statement. ::: diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index d6905c84a1..f74d0dbe5c 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -613,6 +613,7 @@ SELECT APERCENTILE(field_name, P[, algo_type]) FROM { tb_name | stb_name } [WHER **Explanations**: - _P_ is in range [0,100], when _P_ is 0, the result is same as using function MIN; when _P_ is 100, the result is same as function MAX. - `algo_type` can only be input as `default` or `t-digest` Enter `default` to use a histogram-based algorithm. Enter `t-digest` to use the t-digest algorithm to calculate the approximation of the quantile. `default` is used by default. +- The approximation result of `t-digest` algorithm is sensitive to input data order. For example, when querying STable with different input data order there might be minor differences in calculated results. ### AVG @@ -916,7 +917,7 @@ SELECT MAX(field_name) FROM { tb_name | stb_name } [WHERE clause]; **Return value type**:Same as the data type of the column being operated upon -**Applicable data types**: Numeric +**Applicable data types**: Numeric, Timestamp **Applicable table types**: standard tables and supertables @@ -931,7 +932,7 @@ SELECT MIN(field_name) FROM {tb_name | stb_name} [WHERE clause]; **Return value type**:Same as the data type of the column being operated upon -**Applicable data types**: Numeric +**Applicable data types**: Numeric, Timestamp **Applicable table types**: standard tables and supertables diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md index deb2522309..17e4e4d1b0 100644 --- a/docs/en/12-taos-sql/14-stream.md +++ b/docs/en/12-taos-sql/14-stream.md @@ -44,7 +44,7 @@ For example, the following SQL statement creates a stream and automatically crea ```sql CREATE STREAM avg_vol_s INTO avg_vol AS -SELECT _wstartts, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL(1m) SLIDING(30s); +SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL(1m) SLIDING(30s); ``` ## Delete a Stream diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md index c9adb0cf78..5f3bef3546 100644 --- a/docs/en/12-taos-sql/24-show.md +++ b/docs/en/12-taos-sql/24-show.md @@ -5,16 +5,6 @@ title: SHOW Statement for Metadata `SHOW` command can be used to get brief system information. To get details about metatadata, information, and status in the system, please use `select` to query the tables in database `INFORMATION_SCHEMA`. -## SHOW ACCOUNTS - -```sql -SHOW ACCOUNTS; -``` - -Shows information about tenants on the system. - -Note: TDengine Enterprise Edition only. - ## SHOW APPS ```sql diff --git a/docs/zh/08-connector/09-csharp.mdx b/docs/zh/08-connector/09-csharp.mdx index be27bfb685..4e49d84835 100644 --- a/docs/zh/08-connector/09-csharp.mdx +++ b/docs/zh/08-connector/09-csharp.mdx @@ -169,9 +169,9 @@ namespace TDengineExample ### 第三方驱动 -`Maikebing.Data.Taos` 是一个 TDengine 的 ADO.NET 连接器,支持 Linux,Windows 平台。该连接器由社区贡献者`麦壳饼@@maikebing` 提供,具体请参考: +[`IoTSharp.Data.Taos`](https://github.com/IoTSharp/EntityFrameworkCore.Taos) 是一个 TDengine 的 ADO.NET 连接器,其中包含了用于EntityFrameworkCore 的提供程序 IoTSharp.EntityFrameworkCore.Taos 和健康检查组件 IoTSharp.HealthChecks.Taos ,支持 Linux,Windows 平台。该连接器由社区贡献者`麦壳饼@@maikebing` 提供,具体请参考: -* 接口下载: +* 接口下载: * 用法说明: ## 常见问题 diff --git a/docs/zh/12-taos-sql/01-data-type.md b/docs/zh/12-taos-sql/01-data-type.md index b8ef050fb7..ee7b3a4715 100644 --- a/docs/zh/12-taos-sql/01-data-type.md +++ b/docs/zh/12-taos-sql/01-data-type.md @@ -1,6 +1,6 @@ --- -sidebar_label: 支持的数据类型 -title: 支持的数据类型 +sidebar_label: 数据类型 +title: 数据类型 description: "TDengine 支持的数据类型: 时间戳、浮点型、JSON 类型等" --- diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index 1675356c49..c76311f008 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -1,6 +1,6 @@ --- -sidebar_label: 数据库管理 -title: 数据库管理 +sidebar_label: 数据库 +title: 数据库 description: "创建、删除数据库,查看、修改数据库参数" --- @@ -71,9 +71,9 @@ database_option: { - SINGLE_STABLE:表示此数据库中是否只可以创建一个超级表,用于超级表列非常多的情况。 - 0:表示可以创建多张超级表。 - 1:表示只可以创建一张超级表。 -- WAL_RETENTION_PERIOD:wal 文件的额外保留策略,用于数据订阅。wal 的保存时长,单位为 s。默认为 0,即落盘后立即删除。-1 表示不删除。 -- WAL_RETENTION_SIZE:wal 文件的额外保留策略,用于数据订阅。wal 的保存的最大上限,单位为 KB。默认为 0,即落盘后立即删除。-1 表示不删除。 -- WAL_ROLL_PERIOD:wal 文件切换时长,单位为 s。当 wal 文件创建并写入后,经过该时间,会自动创建一个新的 wal 文件。默认为 0,即仅在落盘时创建新文件。 +- WAL_RETENTION_PERIOD:wal 文件的额外保留策略,用于数据订阅。wal 的保存时长,单位为 s。单副本默认为 0,即落盘后立即删除。-1 表示不删除。多副本默认为 4 天。 +- WAL_RETENTION_SIZE:wal 文件的额外保留策略,用于数据订阅。wal 的保存的最大上限,单位为 KB。单副本默认为 0,即落盘后立即删除。多副本默认为-1,表示不删除。 +- WAL_ROLL_PERIOD:wal 文件切换时长,单位为 s。当 wal 文件创建并写入后,经过该时间,会自动创建一个新的 wal 文件。单副本默认为 0,即仅在落盘时创建新文件。多副本默认为 1 天。 - WAL_SEGMENT_SIZE:wal 单个文件大小,单位为 KB。当前写入文件大小超过上限后会自动创建一个新的 wal 文件。默认为 0,即仅在落盘时创建新文件。 ### 创建数据库示例 diff --git a/docs/zh/12-taos-sql/03-table.md b/docs/zh/12-taos-sql/03-table.md index 9c33c45efc..2337f2a272 100644 --- a/docs/zh/12-taos-sql/03-table.md +++ b/docs/zh/12-taos-sql/03-table.md @@ -1,5 +1,5 @@ --- -title: 表管理 +title: 表 sidebar_label: 表 description: 对表的各种管理操作 --- diff --git a/docs/zh/12-taos-sql/04-stable.md b/docs/zh/12-taos-sql/04-stable.md index 450ff07fd8..95ef405fa7 100644 --- a/docs/zh/12-taos-sql/04-stable.md +++ b/docs/zh/12-taos-sql/04-stable.md @@ -1,6 +1,6 @@ --- -sidebar_label: 超级表管理 -title: 超级表 STable 管理 +sidebar_label: 超级表 +title: 超级表 description: 对超级表的各种管理操作 --- diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index d8ff3f04ed..b0a7d88efe 100644 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -53,11 +53,6 @@ window_clause: { | STATE_WINDOW(col) | INTERVAL(interval_val [, interval_offset]) [SLIDING (sliding_val)] [WATERMARK(watermark_val)] [FILL(fill_mod_and_val)] -changes_option: { - DURATION duration_val - | ROWS rows_val -} - group_by_clause: GROUP BY expr [, expr] ... HAVING condition @@ -127,7 +122,6 @@ SELECT DISTINCT col_name [, col_name ...] FROM tb_name; 1. cfg 文件中的配置参数 maxNumOfDistinctRes 将对 DISTINCT 能够输出的数据行数进行限制。其最小值是 100000,最大值是 100000000,默认值是 10000000。如果实际计算结果超出了这个限制,那么会仅输出这个数量范围内的部分。 2. 由于浮点数天然的精度机制原因,在特定情况下,对 FLOAT 和 DOUBLE 列使用 DISTINCT 并不能保证输出值的完全唯一性。 -3. 在当前版本下,DISTINCT 不能在嵌套查询的子查询中使用,也不能与聚合函数、GROUP BY、或 JOIN 在同一条语句中混用。 ::: diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index f936d9182d..9c5b7f771e 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -614,6 +614,7 @@ SELECT APERCENTILE(field_name, P[, algo_type]) FROM { tb_name | stb_name } [WHER **说明**: - P值范围是[0,100],当为0时等同于MIN,为100时等同于MAX。 - algo_type 取值为 "default" 或 "t-digest"。 输入为 "default" 时函数使用基于直方图算法进行计算。输入为 "t-digest" 时使用t-digest算法计算分位数的近似结果。如果不指定 algo_type 则使用 "default" 算法。 +- "t-digest"算法的近似结果对于输入数据顺序敏感,对超级表查询时不同的输入排序结果可能会有微小的误差。 ### AVG diff --git a/docs/zh/12-taos-sql/12-distinguished.md b/docs/zh/12-taos-sql/12-distinguished.md index 016c1929fe..268712e757 100644 --- a/docs/zh/12-taos-sql/12-distinguished.md +++ b/docs/zh/12-taos-sql/12-distinguished.md @@ -1,6 +1,6 @@ --- -sidebar_label: 时序数据特色查询 -title: 时序数据特色查询 +sidebar_label: 特色查询 +title: 特色查询 description: TDengine 提供的时序数据特有的查询功能 --- diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md index 86437c762e..cd726e0a0e 100644 --- a/docs/zh/12-taos-sql/14-stream.md +++ b/docs/zh/12-taos-sql/14-stream.md @@ -44,7 +44,7 @@ window_clause: { ```sql CREATE STREAM avg_vol_s INTO avg_vol AS -SELECT _wstartts, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL(1m) SLIDING(30s); +SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL(1m) SLIDING(30s); ``` ## 流式计算的 partition diff --git a/docs/zh/12-taos-sql/17-json.md b/docs/zh/12-taos-sql/17-json.md index 4cbd8eef36..18c25cfe23 100644 --- a/docs/zh/12-taos-sql/17-json.md +++ b/docs/zh/12-taos-sql/17-json.md @@ -1,6 +1,6 @@ --- -sidebar_label: JSON 类型使用说明 -title: JSON 类型使用说明 +sidebar_label: JSON 类型 +title: JSON 类型 description: 对 JSON 类型如何使用的详细说明 --- diff --git a/docs/zh/12-taos-sql/18-escape.md b/docs/zh/12-taos-sql/18-escape.md index 7e543743a3..5e0d292d39 100644 --- a/docs/zh/12-taos-sql/18-escape.md +++ b/docs/zh/12-taos-sql/18-escape.md @@ -1,5 +1,5 @@ --- -title: 转义字符说明 +title: 转义字符 sidebar_label: 转义字符 description: TDengine 中使用转义字符的详细规则 --- diff --git a/docs/zh/12-taos-sql/19-limit.md b/docs/zh/12-taos-sql/19-limit.md index 0dbe00f800..a9743addda 100644 --- a/docs/zh/12-taos-sql/19-limit.md +++ b/docs/zh/12-taos-sql/19-limit.md @@ -1,6 +1,6 @@ --- -sidebar_label: 命名与边界限制 -title: 命名与边界限制 +sidebar_label: 命名与边界 +title: 命名与边界 description: 合法字符集和命名中的限制规则 --- diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md index 047c6b08c9..92c814067e 100644 --- a/docs/zh/12-taos-sql/20-keywords.md +++ b/docs/zh/12-taos-sql/20-keywords.md @@ -1,6 +1,6 @@ --- sidebar_label: 保留关键字 -title: TDengine 保留关键字 +title: 保留关键字 description: TDengine 保留关键字的详细列表 --- diff --git a/docs/zh/12-taos-sql/22-meta.md b/docs/zh/12-taos-sql/22-meta.md index 3ae444e8fe..c1ffc4a757 100644 --- a/docs/zh/12-taos-sql/22-meta.md +++ b/docs/zh/12-taos-sql/22-meta.md @@ -1,6 +1,6 @@ --- sidebar_label: 元数据 -title: 存储元数据的 Information_Schema 数据库 +title: 元数据 description: Information_Schema 数据库中存储了系统中所有的元数据信息 --- diff --git a/docs/zh/12-taos-sql/23-perf.md b/docs/zh/12-taos-sql/23-perf.md index 808d9ae31a..d4ee0e178c 100644 --- a/docs/zh/12-taos-sql/23-perf.md +++ b/docs/zh/12-taos-sql/23-perf.md @@ -1,6 +1,6 @@ --- sidebar_label: 统计数据 -title: 存储统计数据的 Performance_Schema 数据库 +title: 统计数据 description: Performance_Schema 数据库中存储了系统中的各种统计信息 --- diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md index b4aafdaa0a..31b7c085a1 100644 --- a/docs/zh/12-taos-sql/24-show.md +++ b/docs/zh/12-taos-sql/24-show.md @@ -1,21 +1,11 @@ --- sidebar_label: SHOW 命令 -title: 使用 SHOW 命令查看系统元数据 +title: SHOW 命令 description: SHOW 命令的完整列表 --- SHOW 命令可以用来获取简要的系统信息。若想获取系统中详细的各种元数据、系统信息和状态,请使用 select 语句查询 INFORMATION_SCHEMA 数据库中的表。 -## SHOW ACCOUNTS - -```sql -SHOW ACCOUNTS; -``` - -显示当前系统中所有租户的信息。 - -注:企业版独有 - ## SHOW APPS ```sql diff --git a/docs/zh/12-taos-sql/26-udf.md b/docs/zh/12-taos-sql/26-udf.md index 764fde6e1f..6dc1b6eb5f 100644 --- a/docs/zh/12-taos-sql/26-udf.md +++ b/docs/zh/12-taos-sql/26-udf.md @@ -1,6 +1,6 @@ --- sidebar_label: 自定义函数 -title: 用户自定义函数 +title: 自定义函数 description: 使用 UDF 的详细指南 --- diff --git a/docs/zh/12-taos-sql/27-index.md b/docs/zh/12-taos-sql/27-index.md index f88c6cf4ff..aa84140296 100644 --- a/docs/zh/12-taos-sql/27-index.md +++ b/docs/zh/12-taos-sql/27-index.md @@ -1,6 +1,6 @@ --- sidebar_label: 索引 -title: 使用索引 +title: 索引 description: 索引功能的使用细节 --- diff --git a/docs/zh/12-taos-sql/29-changes.md b/docs/zh/12-taos-sql/29-changes.md index d653c59a5c..e63825045d 100644 --- a/docs/zh/12-taos-sql/29-changes.md +++ b/docs/zh/12-taos-sql/29-changes.md @@ -1,6 +1,6 @@ --- -sidebar_label: 3.0 版本语法变更 -title: 3.0 版本语法变更 +sidebar_label: 语法变更 +title: 语法变更 description: "TDengine 3.0 版本的语法变更说明" --- diff --git a/include/common/tglobal.h b/include/common/tglobal.h index f72cb3d6d9..2de4ffdc17 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -89,11 +89,12 @@ extern uint16_t tsTelemPort; // query buffer management extern int32_t tsQueryBufferSize; // maximum allowed usage buffer size in MB for each data node during query processing -extern int64_t tsQueryBufferSizeBytes; // maximum allowed usage buffer size in byte for each data node +extern int64_t tsQueryBufferSizeBytes; // maximum allowed usage buffer size in byte for each data node // query client extern int32_t tsQueryPolicy; extern int32_t tsQuerySmaOptimize; +extern bool tsQueryPlannerTrace; // client extern int32_t tsMinSlidingTime; @@ -147,7 +148,7 @@ struct SConfig *taosGetCfg(); void taosSetAllDebugFlag(int32_t flag, bool rewrite); void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal, bool rewrite); int32_t taosSetCfg(SConfig *pCfg, char *name); -void taosLocalCfgForbiddenToChange(char* name, bool* forbidden); +void taosLocalCfgForbiddenToChange(char *name, bool *forbidden); #ifdef __cplusplus } diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 8693061d12..879f8c6928 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -784,6 +784,7 @@ typedef struct { int64_t walRetentionSize; int32_t walRollPeriod; int64_t walSegmentSize; + int32_t sstTrigger; } SCreateDbReq; int32_t tSerializeSCreateDbReq(void* buf, int32_t bufLen, SCreateDbReq* pReq); @@ -805,6 +806,7 @@ typedef struct { int8_t strict; int8_t cacheLast; int8_t replications; + int32_t sstTrigger; } SAlterDbReq; int32_t tSerializeSAlterDbReq(void* buf, int32_t bufLen, SAlterDbReq* pReq); @@ -1190,6 +1192,7 @@ typedef struct { int64_t walRetentionSize; int32_t walRollPeriod; int64_t walSegmentSize; + int16_t sstTrigger; } SCreateVnodeReq; int32_t tSerializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq); @@ -2069,9 +2072,9 @@ int32_t tDeserializeSVCreateTbBatchRsp(void* buf, int32_t bufLen, SVCreateTbBatc // TDMT_VND_DROP_TABLE ================= typedef struct { - char* name; - uint64_t suid; // for tmq in wal format - int8_t igNotExists; + char* name; + uint64_t suid; // for tmq in wal format + int8_t igNotExists; } SVDropTbReq; typedef struct { diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index b38ec66435..5bc0fc82e3 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -102,224 +102,225 @@ #define TK_WAL_RETENTION_SIZE 84 #define TK_WAL_ROLL_PERIOD 85 #define TK_WAL_SEGMENT_SIZE 86 -#define TK_NK_COLON 87 -#define TK_TABLE 88 -#define TK_NK_LP 89 -#define TK_NK_RP 90 -#define TK_STABLE 91 -#define TK_ADD 92 -#define TK_COLUMN 93 -#define TK_MODIFY 94 -#define TK_RENAME 95 -#define TK_TAG 96 -#define TK_SET 97 -#define TK_NK_EQ 98 -#define TK_USING 99 -#define TK_TAGS 100 -#define TK_COMMENT 101 -#define TK_BOOL 102 -#define TK_TINYINT 103 -#define TK_SMALLINT 104 -#define TK_INT 105 -#define TK_INTEGER 106 -#define TK_BIGINT 107 -#define TK_FLOAT 108 -#define TK_DOUBLE 109 -#define TK_BINARY 110 -#define TK_TIMESTAMP 111 -#define TK_NCHAR 112 -#define TK_UNSIGNED 113 -#define TK_JSON 114 -#define TK_VARCHAR 115 -#define TK_MEDIUMBLOB 116 -#define TK_BLOB 117 -#define TK_VARBINARY 118 -#define TK_DECIMAL 119 -#define TK_MAX_DELAY 120 -#define TK_WATERMARK 121 -#define TK_ROLLUP 122 -#define TK_TTL 123 -#define TK_SMA 124 -#define TK_FIRST 125 -#define TK_LAST 126 -#define TK_SHOW 127 -#define TK_DATABASES 128 -#define TK_TABLES 129 -#define TK_STABLES 130 -#define TK_MNODES 131 -#define TK_MODULES 132 -#define TK_QNODES 133 -#define TK_FUNCTIONS 134 -#define TK_INDEXES 135 -#define TK_ACCOUNTS 136 -#define TK_APPS 137 -#define TK_CONNECTIONS 138 -#define TK_LICENCES 139 -#define TK_GRANTS 140 -#define TK_QUERIES 141 -#define TK_SCORES 142 -#define TK_TOPICS 143 -#define TK_VARIABLES 144 -#define TK_BNODES 145 -#define TK_SNODES 146 -#define TK_CLUSTER 147 -#define TK_TRANSACTIONS 148 -#define TK_DISTRIBUTED 149 -#define TK_CONSUMERS 150 -#define TK_SUBSCRIPTIONS 151 -#define TK_LIKE 152 -#define TK_INDEX 153 -#define TK_FUNCTION 154 -#define TK_INTERVAL 155 -#define TK_TOPIC 156 -#define TK_AS 157 -#define TK_WITH 158 -#define TK_META 159 -#define TK_CONSUMER 160 -#define TK_GROUP 161 -#define TK_DESC 162 -#define TK_DESCRIBE 163 -#define TK_RESET 164 -#define TK_QUERY 165 -#define TK_CACHE 166 -#define TK_EXPLAIN 167 -#define TK_ANALYZE 168 -#define TK_VERBOSE 169 -#define TK_NK_BOOL 170 -#define TK_RATIO 171 -#define TK_NK_FLOAT 172 -#define TK_OUTPUTTYPE 173 -#define TK_AGGREGATE 174 -#define TK_BUFSIZE 175 -#define TK_STREAM 176 -#define TK_INTO 177 -#define TK_TRIGGER 178 -#define TK_AT_ONCE 179 -#define TK_WINDOW_CLOSE 180 -#define TK_IGNORE 181 -#define TK_EXPIRED 182 -#define TK_KILL 183 -#define TK_CONNECTION 184 -#define TK_TRANSACTION 185 -#define TK_BALANCE 186 -#define TK_VGROUP 187 -#define TK_MERGE 188 -#define TK_REDISTRIBUTE 189 -#define TK_SPLIT 190 -#define TK_DELETE 191 -#define TK_INSERT 192 -#define TK_NULL 193 -#define TK_NK_QUESTION 194 -#define TK_NK_ARROW 195 -#define TK_ROWTS 196 -#define TK_TBNAME 197 -#define TK_QSTART 198 -#define TK_QEND 199 -#define TK_QDURATION 200 -#define TK_WSTART 201 -#define TK_WEND 202 -#define TK_WDURATION 203 -#define TK_CAST 204 -#define TK_NOW 205 -#define TK_TODAY 206 -#define TK_TIMEZONE 207 -#define TK_CLIENT_VERSION 208 -#define TK_SERVER_VERSION 209 -#define TK_SERVER_STATUS 210 -#define TK_CURRENT_USER 211 -#define TK_COUNT 212 -#define TK_LAST_ROW 213 -#define TK_BETWEEN 214 -#define TK_IS 215 -#define TK_NK_LT 216 -#define TK_NK_GT 217 -#define TK_NK_LE 218 -#define TK_NK_GE 219 -#define TK_NK_NE 220 -#define TK_MATCH 221 -#define TK_NMATCH 222 -#define TK_CONTAINS 223 -#define TK_IN 224 -#define TK_JOIN 225 -#define TK_INNER 226 -#define TK_SELECT 227 -#define TK_DISTINCT 228 -#define TK_WHERE 229 -#define TK_PARTITION 230 -#define TK_BY 231 -#define TK_SESSION 232 -#define TK_STATE_WINDOW 233 -#define TK_SLIDING 234 -#define TK_FILL 235 -#define TK_VALUE 236 -#define TK_NONE 237 -#define TK_PREV 238 -#define TK_LINEAR 239 -#define TK_NEXT 240 -#define TK_HAVING 241 -#define TK_RANGE 242 -#define TK_EVERY 243 -#define TK_ORDER 244 -#define TK_SLIMIT 245 -#define TK_SOFFSET 246 -#define TK_LIMIT 247 -#define TK_OFFSET 248 -#define TK_ASC 249 -#define TK_NULLS 250 -#define TK_ABORT 251 -#define TK_AFTER 252 -#define TK_ATTACH 253 -#define TK_BEFORE 254 -#define TK_BEGIN 255 -#define TK_BITAND 256 -#define TK_BITNOT 257 -#define TK_BITOR 258 -#define TK_BLOCKS 259 -#define TK_CHANGE 260 -#define TK_COMMA 261 -#define TK_COMPACT 262 -#define TK_CONCAT 263 -#define TK_CONFLICT 264 -#define TK_COPY 265 -#define TK_DEFERRED 266 -#define TK_DELIMITERS 267 -#define TK_DETACH 268 -#define TK_DIVIDE 269 -#define TK_DOT 270 -#define TK_EACH 271 -#define TK_END 272 -#define TK_FAIL 273 -#define TK_FILE 274 -#define TK_FOR 275 -#define TK_GLOB 276 -#define TK_ID 277 -#define TK_IMMEDIATE 278 -#define TK_IMPORT 279 -#define TK_INITIALLY 280 -#define TK_INSTEAD 281 -#define TK_ISNULL 282 -#define TK_KEY 283 -#define TK_NK_BITNOT 284 -#define TK_NK_SEMI 285 -#define TK_NOTNULL 286 -#define TK_OF 287 -#define TK_PLUS 288 -#define TK_PRIVILEGE 289 -#define TK_RAISE 290 -#define TK_REPLACE 291 -#define TK_RESTRICT 292 -#define TK_ROW 293 -#define TK_SEMI 294 -#define TK_STAR 295 -#define TK_STATEMENT 296 -#define TK_STRING 297 -#define TK_TIMES 298 -#define TK_UPDATE 299 -#define TK_VALUES 300 -#define TK_VARIABLE 301 -#define TK_VIEW 302 -#define TK_VNODES 303 -#define TK_WAL 304 +#define TK_SST_TRIGGER 87 +#define TK_NK_COLON 88 +#define TK_TABLE 89 +#define TK_NK_LP 90 +#define TK_NK_RP 91 +#define TK_STABLE 92 +#define TK_ADD 93 +#define TK_COLUMN 94 +#define TK_MODIFY 95 +#define TK_RENAME 96 +#define TK_TAG 97 +#define TK_SET 98 +#define TK_NK_EQ 99 +#define TK_USING 100 +#define TK_TAGS 101 +#define TK_COMMENT 102 +#define TK_BOOL 103 +#define TK_TINYINT 104 +#define TK_SMALLINT 105 +#define TK_INT 106 +#define TK_INTEGER 107 +#define TK_BIGINT 108 +#define TK_FLOAT 109 +#define TK_DOUBLE 110 +#define TK_BINARY 111 +#define TK_TIMESTAMP 112 +#define TK_NCHAR 113 +#define TK_UNSIGNED 114 +#define TK_JSON 115 +#define TK_VARCHAR 116 +#define TK_MEDIUMBLOB 117 +#define TK_BLOB 118 +#define TK_VARBINARY 119 +#define TK_DECIMAL 120 +#define TK_MAX_DELAY 121 +#define TK_WATERMARK 122 +#define TK_ROLLUP 123 +#define TK_TTL 124 +#define TK_SMA 125 +#define TK_FIRST 126 +#define TK_LAST 127 +#define TK_SHOW 128 +#define TK_DATABASES 129 +#define TK_TABLES 130 +#define TK_STABLES 131 +#define TK_MNODES 132 +#define TK_MODULES 133 +#define TK_QNODES 134 +#define TK_FUNCTIONS 135 +#define TK_INDEXES 136 +#define TK_ACCOUNTS 137 +#define TK_APPS 138 +#define TK_CONNECTIONS 139 +#define TK_LICENCES 140 +#define TK_GRANTS 141 +#define TK_QUERIES 142 +#define TK_SCORES 143 +#define TK_TOPICS 144 +#define TK_VARIABLES 145 +#define TK_BNODES 146 +#define TK_SNODES 147 +#define TK_CLUSTER 148 +#define TK_TRANSACTIONS 149 +#define TK_DISTRIBUTED 150 +#define TK_CONSUMERS 151 +#define TK_SUBSCRIPTIONS 152 +#define TK_VNODES 153 +#define TK_LIKE 154 +#define TK_INDEX 155 +#define TK_FUNCTION 156 +#define TK_INTERVAL 157 +#define TK_TOPIC 158 +#define TK_AS 159 +#define TK_WITH 160 +#define TK_META 161 +#define TK_CONSUMER 162 +#define TK_GROUP 163 +#define TK_DESC 164 +#define TK_DESCRIBE 165 +#define TK_RESET 166 +#define TK_QUERY 167 +#define TK_CACHE 168 +#define TK_EXPLAIN 169 +#define TK_ANALYZE 170 +#define TK_VERBOSE 171 +#define TK_NK_BOOL 172 +#define TK_RATIO 173 +#define TK_NK_FLOAT 174 +#define TK_OUTPUTTYPE 175 +#define TK_AGGREGATE 176 +#define TK_BUFSIZE 177 +#define TK_STREAM 178 +#define TK_INTO 179 +#define TK_TRIGGER 180 +#define TK_AT_ONCE 181 +#define TK_WINDOW_CLOSE 182 +#define TK_IGNORE 183 +#define TK_EXPIRED 184 +#define TK_KILL 185 +#define TK_CONNECTION 186 +#define TK_TRANSACTION 187 +#define TK_BALANCE 188 +#define TK_VGROUP 189 +#define TK_MERGE 190 +#define TK_REDISTRIBUTE 191 +#define TK_SPLIT 192 +#define TK_DELETE 193 +#define TK_INSERT 194 +#define TK_NULL 195 +#define TK_NK_QUESTION 196 +#define TK_NK_ARROW 197 +#define TK_ROWTS 198 +#define TK_TBNAME 199 +#define TK_QSTART 200 +#define TK_QEND 201 +#define TK_QDURATION 202 +#define TK_WSTART 203 +#define TK_WEND 204 +#define TK_WDURATION 205 +#define TK_CAST 206 +#define TK_NOW 207 +#define TK_TODAY 208 +#define TK_TIMEZONE 209 +#define TK_CLIENT_VERSION 210 +#define TK_SERVER_VERSION 211 +#define TK_SERVER_STATUS 212 +#define TK_CURRENT_USER 213 +#define TK_COUNT 214 +#define TK_LAST_ROW 215 +#define TK_BETWEEN 216 +#define TK_IS 217 +#define TK_NK_LT 218 +#define TK_NK_GT 219 +#define TK_NK_LE 220 +#define TK_NK_GE 221 +#define TK_NK_NE 222 +#define TK_MATCH 223 +#define TK_NMATCH 224 +#define TK_CONTAINS 225 +#define TK_IN 226 +#define TK_JOIN 227 +#define TK_INNER 228 +#define TK_SELECT 229 +#define TK_DISTINCT 230 +#define TK_WHERE 231 +#define TK_PARTITION 232 +#define TK_BY 233 +#define TK_SESSION 234 +#define TK_STATE_WINDOW 235 +#define TK_SLIDING 236 +#define TK_FILL 237 +#define TK_VALUE 238 +#define TK_NONE 239 +#define TK_PREV 240 +#define TK_LINEAR 241 +#define TK_NEXT 242 +#define TK_HAVING 243 +#define TK_RANGE 244 +#define TK_EVERY 245 +#define TK_ORDER 246 +#define TK_SLIMIT 247 +#define TK_SOFFSET 248 +#define TK_LIMIT 249 +#define TK_OFFSET 250 +#define TK_ASC 251 +#define TK_NULLS 252 +#define TK_ABORT 253 +#define TK_AFTER 254 +#define TK_ATTACH 255 +#define TK_BEFORE 256 +#define TK_BEGIN 257 +#define TK_BITAND 258 +#define TK_BITNOT 259 +#define TK_BITOR 260 +#define TK_BLOCKS 261 +#define TK_CHANGE 262 +#define TK_COMMA 263 +#define TK_COMPACT 264 +#define TK_CONCAT 265 +#define TK_CONFLICT 266 +#define TK_COPY 267 +#define TK_DEFERRED 268 +#define TK_DELIMITERS 269 +#define TK_DETACH 270 +#define TK_DIVIDE 271 +#define TK_DOT 272 +#define TK_EACH 273 +#define TK_END 274 +#define TK_FAIL 275 +#define TK_FILE 276 +#define TK_FOR 277 +#define TK_GLOB 278 +#define TK_ID 279 +#define TK_IMMEDIATE 280 +#define TK_IMPORT 281 +#define TK_INITIALLY 282 +#define TK_INSTEAD 283 +#define TK_ISNULL 284 +#define TK_KEY 285 +#define TK_NK_BITNOT 286 +#define TK_NK_SEMI 287 +#define TK_NOTNULL 288 +#define TK_OF 289 +#define TK_PLUS 290 +#define TK_PRIVILEGE 291 +#define TK_RAISE 292 +#define TK_REPLACE 293 +#define TK_RESTRICT 294 +#define TK_ROW 295 +#define TK_SEMI 296 +#define TK_STAR 297 +#define TK_STATEMENT 298 +#define TK_STRING 299 +#define TK_TIMES 300 +#define TK_UPDATE 301 +#define TK_VALUES 302 +#define TK_VARIABLE 303 +#define TK_VIEW 304 +#define TK_WAL 305 #define TK_NK_SPACE 300 #define TK_NK_COMMENT 301 diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 3223d4cdb8..f47c309330 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -78,6 +78,10 @@ typedef struct SDatabaseOptions { int32_t walRetentionSize; int32_t walRollPeriod; int32_t walSegmentSize; + bool walRetentionPeriodIsSet; + bool walRetentionSizeIsSet; + bool walRollPeriodIsSet; + int32_t sstTrigger; } SDatabaseOptions; typedef struct SCreateDatabaseStmt { @@ -268,6 +272,12 @@ typedef struct SShowDnodeVariablesStmt { SNode* pDnodeId; } SShowDnodeVariablesStmt; +typedef struct SShowVnodesStmt { + ENodeType type; + SNode* pDnodeId; + SNode* pDnodeEndpoint; +} SShowVnodesStmt; + typedef enum EIndexType { INDEX_TYPE_SMA = 1, INDEX_TYPE_FULLTEXT } EIndexType; typedef struct SIndexOptions { diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 5743d33608..9c2fdf587b 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -183,12 +183,12 @@ typedef enum ENodeType { QUERY_NODE_SHOW_DNODE_VARIABLES_STMT, QUERY_NODE_SHOW_TRANSACTIONS_STMT, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT, + QUERY_NODE_SHOW_VNODES_STMT, QUERY_NODE_SHOW_CREATE_DATABASE_STMT, QUERY_NODE_SHOW_CREATE_TABLE_STMT, QUERY_NODE_SHOW_CREATE_STABLE_STMT, QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT, - QUERY_NODE_SHOW_VNODES_STMT, QUERY_NODE_SHOW_SCORES_STMT, QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_QUERY_STMT, @@ -244,6 +244,7 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE, QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE, QUERY_NODE_PHYSICAL_PLAN_PARTITION, + QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION, QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC, QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC, QUERY_NODE_PHYSICAL_PLAN_DISPATCH, diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 6fd6a316eb..8aeb86102a 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -488,6 +488,8 @@ typedef struct SPartitionPhysiNode { SNodeList* pTargets; } SPartitionPhysiNode; +typedef SPartitionPhysiNode SStreamPartitionPhysiNode; + typedef struct SDataSinkNode { ENodeType type; SDataBlockDescNode* pInputDataBlockDesc; diff --git a/include/os/osDir.h b/include/os/osDir.h index 9019d4f802..95b1a6ee1d 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -56,6 +56,7 @@ void taosRemoveDir(const char *dirname); bool taosDirExist(const char *dirname); int32_t taosMkDir(const char *dirname); int32_t taosMulMkDir(const char *dirname); +int32_t taosMulModeMkDir(const char *dirname, int mode); void taosRemoveOldFiles(const char *dirname, int32_t keepDays); int32_t taosExpandDir(const char *dirname, char *outname, int32_t maxlen); int32_t taosRealPath(char *dirname, char *realPath, int32_t maxlen); diff --git a/include/util/tdef.h b/include/util/tdef.h index 2bc821b873..48f37fca28 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -359,15 +359,21 @@ typedef enum ELogicConditionType { #define TSDB_DB_SCHEMALESS_ON 1 #define TSDB_DB_SCHEMALESS_OFF 0 #define TSDB_DEFAULT_DB_SCHEMALESS TSDB_DB_SCHEMALESS_OFF +#define TSDB_MIN_SST_TRIGGER 1 +#define TSDB_MAX_SST_TRIGGER 128 +#define TSDB_DEFAULT_SST_TRIGGER 8 -#define TSDB_DB_MIN_WAL_RETENTION_PERIOD -1 -#define TSDB_DEFAULT_DB_WAL_RETENTION_PERIOD (24 * 60 * 60 * 4) -#define TSDB_DB_MIN_WAL_RETENTION_SIZE -1 -#define TSDB_DEFAULT_DB_WAL_RETENTION_SIZE -1 -#define TSDB_DB_MIN_WAL_ROLL_PERIOD 0 -#define TSDB_DEFAULT_DB_WAL_ROLL_PERIOD (24 * 60 * 60 * 1) -#define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 -#define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 +#define TSDB_DB_MIN_WAL_RETENTION_PERIOD -1 +#define TSDB_REP_DEF_DB_WAL_RET_PERIOD 0 +#define TSDB_REPS_DEF_DB_WAL_RET_PERIOD (24 * 60 * 60 * 4) +#define TSDB_DB_MIN_WAL_RETENTION_SIZE -1 +#define TSDB_REP_DEF_DB_WAL_RET_SIZE 0 +#define TSDB_REPS_DEF_DB_WAL_RET_SIZE -1 +#define TSDB_DB_MIN_WAL_ROLL_PERIOD 0 +#define TSDB_REP_DEF_DB_WAL_ROLL_PERIOD 0 +#define TSDB_REPS_DEF_DB_WAL_ROLL_PERIOD (24 * 60 * 60 * 1) +#define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 +#define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 #define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond #define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) @@ -386,7 +392,7 @@ typedef enum ELogicConditionType { #define TSDB_DEFAULT_EXPLAIN_VERBOSE false -#define TSDB_EXPLAIN_RESULT_ROW_SIZE (16*1024) +#define TSDB_EXPLAIN_RESULT_ROW_SIZE (16 * 1024) #define TSDB_EXPLAIN_RESULT_COLUMN_NAME "QUERY_PLAN" #define TSDB_MAX_FIELD_LEN 16384 diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index 3db9005f95..94a24a4148 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -45,6 +45,7 @@ mkdir -p ${pkg_dir}${install_home_path}/include mkdir -p ${pkg_dir}${install_home_path}/script cp ${compile_dir}/../packaging/cfg/taos.cfg ${pkg_dir}${install_home_path}/cfg +cp ${compile_dir}/../packaging/cfg/taosd.service ${pkg_dir}${install_home_path}/cfg if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then cp ${compile_dir}/test/cfg/taosadapter.toml ${pkg_dir}${install_home_path}/cfg || : fi diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 39606ead30..f2f72acafa 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -33,6 +33,7 @@ adapterName="taosadapter" benchmarkName="taosBenchmark" dumpName="taosdump" demoName="taosdemo" +xname="taosx" data_dir=${dataDir} log_dir=${logDir} @@ -199,6 +200,7 @@ function install_bin() { ${csudo}rm -f ${bin_link_dir}/${demoName} || : ${csudo}rm -f ${bin_link_dir}/${benchmarkName} || : ${csudo}rm -f ${bin_link_dir}/${dumpName} || : + ${csudo}rm -f ${bin_link_dir}/${xname} || : ${csudo}rm -f ${bin_link_dir}/set_core || : ${csudo}rm -f ${bin_link_dir}/TDinsight.sh || : @@ -212,6 +214,7 @@ function install_bin() { [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -s ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${demoName} || : [ -x ${install_main_dir}/bin/${benchmarkName} ] && ${csudo}ln -s ${install_main_dir}/bin/${benchmarkName} ${bin_link_dir}/${benchmarkName} || : [ -x ${install_main_dir}/bin/${dumpName} ] && ${csudo}ln -s ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${dumpName} || : + [ -x ${install_main_dir}/bin/${xname} ] && ${csudo}ln -s ${install_main_dir}/bin/${dumpName} ${bin_link_dir}/${xname} || : [ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index f554942ce3..a6dceeeaad 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -172,6 +172,7 @@ function install_bin() { ${csudo}rm -f ${bin_link_dir}/udfd || : ${csudo}rm -f ${bin_link_dir}/taosdemo || : ${csudo}rm -f ${bin_link_dir}/taosdump || : + ${csudo}rm -f ${bin_link_dir}/taosx || : if [ "$osType" != "Darwin" ]; then ${csudo}rm -f ${bin_link_dir}/perfMonitor || : @@ -184,6 +185,7 @@ function install_bin() { [ -f ${binary_dir}/build/bin/taosdump ] && ${csudo}cp -r ${binary_dir}/build/bin/taosdump ${install_main_dir}/bin || : [ -f ${binary_dir}/build/bin/taosadapter ] && ${csudo}cp -r ${binary_dir}/build/bin/taosadapter ${install_main_dir}/bin || : [ -f ${binary_dir}/build/bin/udfd ] && ${csudo}cp -r ${binary_dir}/build/bin/udfd ${install_main_dir}/bin || : + [ -f ${binary_dir}/build/bin/taosx ] && ${csudo}cp -r ${binary_dir}/build/bin/taosx ${install_main_dir}/bin || : ${csudo}cp -r ${binary_dir}/build/bin/${serverName} ${install_main_dir}/bin || : ${csudo}cp -r ${script_dir}/taosd-dump-cfg.gdb ${install_main_dir}/bin || : @@ -199,6 +201,7 @@ function install_bin() { [ -x ${install_main_dir}/bin/udfd ] && ${csudo}ln -s ${install_main_dir}/bin/udfd ${bin_link_dir}/udfd || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo}ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdemo ] && ${csudo}ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : + [ -x ${install_main_dir}/bin/taosx ] && ${csudo}ln -s ${install_main_dir}/bin/taosx ${bin_link_dir}/taosx || : [ -x ${install_main_dir}/bin/perfMonitor ] && ${csudo}ln -s ${install_main_dir}/bin/perfMonitor ${bin_link_dir}/perfMonitor || : [ -x ${install_main_dir}/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : @@ -215,6 +218,7 @@ function install_bin() { [ -x ${install_main_dir}/bin/udfd ] || [ -x ${install_main_2_dir}/bin/udfd ] && ${csudo}ln -s ${install_main_dir}/bin/udfd ${bin_link_dir}/udfd || ${csudo}ln -s ${install_main_2_dir}/bin/udfd || : [ -x ${install_main_dir}/bin/taosdump ] || [ -x ${install_main_2_dir}/bin/taosdump ] && ${csudo}ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || ln -s ${install_main_2_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdemo ] || [ -x ${install_main_2_dir}/bin/taosdemo ] && ${csudo}ln -s ${install_main_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || ln -s ${install_main_2_dir}/bin/taosdemo ${bin_link_dir}/taosdemo || : + [ -x ${install_main_dir}/bin/taosx ] || [ -x ${install_main_2_dir}/bin/taosx ] && ${csudo}ln -s ${install_main_dir}/bin/taosx ${bin_link_dir}/taosx || ln -s ${install_main_2_dir}/bin/taosx ${bin_link_dir}/taosx || : fi } diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index f5e3bf1882..2305b96b36 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -80,10 +80,12 @@ else ${build_dir}/bin/taosBenchmark \ ${build_dir}/bin/TDinsight.sh \ $tdinsight_caches" + [ -f ${build_dir}/bin/taosx ] && taosx_bin="${build_dir}/bin/taosx" bin_files="${build_dir}/bin/${serverName} \ ${build_dir}/bin/${clientName} \ ${taostools_bin_files} \ + ${taosx_bin} \ ${build_dir}/bin/taosadapter \ ${build_dir}/bin/udfd \ ${script_dir}/remove.sh \ diff --git a/source/common/src/systable.c b/source/common/src/systable.c index dffef21ac4..fdacfa55b8 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -102,6 +102,7 @@ static const SSysDbTableSchema userDBSchema[] = { {.name = "wal_retention_size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, {.name = "wal_roll_period", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, {.name = "wal_segment_size", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, + {.name = "sst_trigger", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, }; static const SSysDbTableSchema userFuncSchema[] = { @@ -256,6 +257,15 @@ static const SSysDbTableSchema subscriptionSchema[] = { {.name = "consumer_id", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = false}, }; +static const SSysDbTableSchema vnodesSchema[] = { + {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, + {.name = "replica", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, + {.name = "status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "dnode_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, + {.name = "dnode_ep", .bytes = TSDB_EP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +}; + static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_DNODES, dnodesSchema, tListLen(dnodesSchema), true}, {TSDB_INS_TABLE_MNODES, mnodesSchema, tListLen(mnodesSchema), true}, @@ -279,6 +289,7 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_TOPICS, topicSchema, tListLen(topicSchema), false}, {TSDB_INS_TABLE_SUBSCRIPTIONS, subscriptionSchema, tListLen(subscriptionSchema), false}, {TSDB_INS_TABLE_STREAMS, streamSchema, tListLen(streamSchema), false}, + {TSDB_INS_TABLE_VNODES, vnodesSchema, tListLen(vnodesSchema), true}, }; static const SSysDbTableSchema connectionsSchema[] = { diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 0bab6a8611..908f7c014e 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -91,6 +91,7 @@ bool tsSmlDataFormat = // query int32_t tsQueryPolicy = 1; int32_t tsQuerySmaOptimize = 0; +bool tsQueryPlannerTrace = false; /* * denote if the server needs to compress response message at the application layer to client, including query rsp, @@ -286,6 +287,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddInt32(pCfg, "compressColData", tsCompressColData, -1, 100000000, 1) != 0) return -1; if (cfgAddInt32(pCfg, "queryPolicy", tsQueryPolicy, 1, 3, 1) != 0) return -1; if (cfgAddInt32(pCfg, "querySmaOptimize", tsQuerySmaOptimize, 0, 1, 1) != 0) return -1; + if (cfgAddBool(pCfg, "queryPlannerTrace", tsQueryPlannerTrace, true) != 0) return -1; if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1; if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1; if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; @@ -429,9 +431,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { static int32_t taosUpdateServerCfg(SConfig *pCfg) { SConfigItem *pItem; - ECfgSrcType stype; - int32_t numOfCores; - int64_t totalMemoryKB; + ECfgSrcType stype; + int32_t numOfCores; + int64_t totalMemoryKB; pItem = cfgGetItem(tsCfg, "numOfCores"); if (pItem == NULL) { @@ -572,7 +574,6 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) { return 0; } - static void taosSetClientLogCfg(SConfig *pCfg) { SConfigItem *pItem = cfgGetItem(pCfg, "logDir"); tstrncpy(tsLogDir, cfgGetItem(pCfg, "logDir")->str, PATH_MAX); @@ -643,6 +644,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsNumOfTaskQueueThreads = cfgGetItem(pCfg, "numOfTaskQueueThreads")->i32; tsQueryPolicy = cfgGetItem(pCfg, "queryPolicy")->i32; tsQuerySmaOptimize = cfgGetItem(pCfg, "querySmaOptimize")->i32; + tsQueryPlannerTrace = cfgGetItem(pCfg, "queryPlannerTrace")->bval; return 0; } @@ -972,6 +974,8 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { tsQnodeShmSize = cfgGetItem(pCfg, "qnodeShmSize")->i32; } else if (strcasecmp("qDebugFlag", name) == 0) { qDebugFlag = cfgGetItem(pCfg, "qDebugFlag")->i32; + } else if (strcasecmp("queryPlannerTrace", name) == 0) { + tsQueryPlannerTrace = cfgGetItem(pCfg, "queryPlannerTrace")->bval; } break; } @@ -1129,7 +1133,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32, false); - if (taosMulMkDir(tsLogDir) != 0) { + if (taosMulModeMkDir(tsLogDir, 0777) != 0) { uError("failed to create dir:%s since %s", tsLogDir, terrstr()); cfgCleanup(pCfg); return -1; @@ -1241,16 +1245,14 @@ void taosCfgDynamicOptions(const char *option, const char *value) { } const char *options[] = { - "dDebugFlag", "vDebugFlag", "mDebugFlag", "wDebugFlag", "sDebugFlag", "tsdbDebugFlag", - "tqDebugFlag", "fsDebugFlag", "udfDebugFlag", "smaDebugFlag", "idxDebugFlag", "tdbDebugFlag", - "tmrDebugFlag", "uDebugFlag", "smaDebugFlag", "rpcDebugFlag", "qDebugFlag", "metaDebugFlag", - "jniDebugFlag", + "dDebugFlag", "vDebugFlag", "mDebugFlag", "wDebugFlag", "sDebugFlag", "tsdbDebugFlag", "tqDebugFlag", + "fsDebugFlag", "udfDebugFlag", "smaDebugFlag", "idxDebugFlag", "tdbDebugFlag", "tmrDebugFlag", "uDebugFlag", + "smaDebugFlag", "rpcDebugFlag", "qDebugFlag", "metaDebugFlag", "jniDebugFlag", }; int32_t *optionVars[] = { - &dDebugFlag, &vDebugFlag, &mDebugFlag, &wDebugFlag, &sDebugFlag, &tsdbDebugFlag, - &tqDebugFlag, &fsDebugFlag, &udfDebugFlag, &smaDebugFlag, &idxDebugFlag, &tdbDebugFlag, - &tmrDebugFlag, &uDebugFlag, &smaDebugFlag, &rpcDebugFlag, &qDebugFlag, &metaDebugFlag, - &jniDebugFlag, + &dDebugFlag, &vDebugFlag, &mDebugFlag, &wDebugFlag, &sDebugFlag, &tsdbDebugFlag, &tqDebugFlag, + &fsDebugFlag, &udfDebugFlag, &smaDebugFlag, &idxDebugFlag, &tdbDebugFlag, &tmrDebugFlag, &uDebugFlag, + &smaDebugFlag, &rpcDebugFlag, &qDebugFlag, &metaDebugFlag, &jniDebugFlag, }; int32_t optionSize = tListLen(options); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index b056677a03..9947d0e3b2 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2024,6 +2024,7 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) { if (tEncodeI64(&encoder, pReq->walRetentionSize) < 0) return -1; if (tEncodeI32(&encoder, pReq->walRollPeriod) < 0) return -1; if (tEncodeI64(&encoder, pReq->walSegmentSize) < 0) return -1; + if (tEncodeI32(&encoder, pReq->sstTrigger) < 0) return -1; if (tEncodeI8(&encoder, pReq->ignoreExist) < 0) return -1; if (tEncodeI32(&encoder, pReq->numOfRetensions) < 0) return -1; for (int32_t i = 0; i < pReq->numOfRetensions; ++i) { @@ -2070,6 +2071,7 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) if (tDecodeI64(&decoder, &pReq->walRetentionSize) < 0) return -1; if (tDecodeI32(&decoder, &pReq->walRollPeriod) < 0) return -1; if (tDecodeI64(&decoder, &pReq->walSegmentSize) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->sstTrigger) < 0) return -1; if (tDecodeI8(&decoder, &pReq->ignoreExist) < 0) return -1; if (tDecodeI32(&decoder, &pReq->numOfRetensions) < 0) return -1; pReq->pRetensions = taosArrayInit(pReq->numOfRetensions, sizeof(SRetention)); @@ -2120,6 +2122,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tEncodeI8(&encoder, pReq->strict) < 0) return -1; if (tEncodeI8(&encoder, pReq->cacheLast) < 0) return -1; if (tEncodeI8(&encoder, pReq->replications) < 0) return -1; + if (tEncodeI32(&encoder, pReq->sstTrigger) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -2146,6 +2149,7 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tDecodeI8(&decoder, &pReq->strict) < 0) return -1; if (tDecodeI8(&decoder, &pReq->cacheLast) < 0) return -1; if (tDecodeI8(&decoder, &pReq->replications) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->sstTrigger) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); @@ -3762,6 +3766,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR if (tEncodeI64(&encoder, pReq->walRetentionSize) < 0) return -1; if (tEncodeI32(&encoder, pReq->walRollPeriod) < 0) return -1; if (tEncodeI64(&encoder, pReq->walSegmentSize) < 0) return -1; + if (tEncodeI16(&encoder, pReq->sstTrigger) < 0) return -1; tEndEncode(&encoder); @@ -3834,6 +3839,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq * if (tDecodeI64(&decoder, &pReq->walRetentionSize) < 0) return -1; if (tDecodeI32(&decoder, &pReq->walRollPeriod) < 0) return -1; if (tDecodeI64(&decoder, &pReq->walSegmentSize) < 0) return -1; + if (tDecodeI16(&decoder, &pReq->sstTrigger) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index e610b41a04..c684683ee9 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -167,6 +167,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { pCfg->walCfg.segSize = pCreate->walSegmentSize; pCfg->walCfg.level = pCreate->walLevel; + pCfg->sstTrigger = pCreate->sstTrigger; pCfg->hashBegin = pCreate->hashBegin; pCfg->hashEnd = pCreate->hashEnd; pCfg->hashMethod = pCreate->hashMethod; @@ -219,8 +220,9 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return -1; } - dDebug("vgId:%d, start to create vnode, tsma:%d standby:%d cacheLast:%d cacheLastSize:%d", createReq.vgId, - createReq.isTsma, createReq.standby, createReq.cacheLast, createReq.cacheLastSize); + dDebug("vgId:%d, start to create vnode, tsma:%d standby:%d cacheLast:%d cacheLastSize:%d sstTrigger:%d", + createReq.vgId, createReq.isTsma, createReq.standby, createReq.cacheLast, createReq.cacheLastSize, + createReq.sstTrigger); vmGenerateVnodeCfg(&createReq, &vnodeCfg); if (vmTsmaAdjustDays(&vnodeCfg, &createReq) < 0) { diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index ea05215fe9..179e7f4448 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -311,6 +311,7 @@ typedef struct { int64_t walRetentionSize; int32_t walRollPeriod; int64_t walSegmentSize; + int16_t sstTrigger; } SDbCfg; typedef struct { diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 8c1c3ba873..d1313d5a17 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -30,7 +30,7 @@ #include "systable.h" #define DB_VER_NUMBER 1 -#define DB_RESERVE_SIZE 64 +#define DB_RESERVE_SIZE 62 static SSdbRaw *mndDbActionEncode(SDbObj *pDb); static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw); @@ -124,6 +124,7 @@ static SSdbRaw *mndDbActionEncode(SDbObj *pDb) { SDB_SET_INT64(pRaw, dataPos, pDb->cfg.walRetentionSize, _OVER) SDB_SET_INT32(pRaw, dataPos, pDb->cfg.walRollPeriod, _OVER) SDB_SET_INT64(pRaw, dataPos, pDb->cfg.walSegmentSize, _OVER) + SDB_SET_INT16(pRaw, dataPos, pDb->cfg.sstTrigger, _OVER) SDB_SET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER) @@ -207,6 +208,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) { SDB_GET_INT64(pRaw, dataPos, &pDb->cfg.walRetentionSize, _OVER) SDB_GET_INT32(pRaw, dataPos, &pDb->cfg.walRollPeriod, _OVER) SDB_GET_INT64(pRaw, dataPos, &pDb->cfg.walSegmentSize, _OVER) + SDB_GET_INT16(pRaw, dataPos, &pDb->cfg.sstTrigger, _OVER) SDB_GET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) taosInitRWLatch(&pDb->lock); @@ -254,6 +256,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) { pOld->cfg.strict = pNew->cfg.strict; pOld->cfg.cacheLast = pNew->cfg.cacheLast; pOld->cfg.replications = pNew->cfg.replications; + pOld->cfg.sstTrigger = pNew->cfg.sstTrigger; taosWUnLockLatch(&pOld->lock); return 0; } @@ -330,6 +333,7 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) { if (pCfg->walRetentionSize < TSDB_DB_MIN_WAL_RETENTION_SIZE) return -1; if (pCfg->walRollPeriod < TSDB_DB_MIN_WAL_ROLL_PERIOD) return -1; if (pCfg->walSegmentSize < TSDB_DB_MIN_WAL_SEGMENT_SIZE) return -1; + if (pCfg->sstTrigger < TSDB_MIN_SST_TRIGGER || pCfg->sstTrigger > TSDB_MAX_SST_TRIGGER) return -1; terrno = 0; return terrno; @@ -358,11 +362,12 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) { if (pCfg->numOfRetensions < 0) pCfg->numOfRetensions = 0; if (pCfg->schemaless < 0) pCfg->schemaless = TSDB_DB_SCHEMALESS_OFF; if (pCfg->walRetentionPeriod < 0 && pCfg->walRetentionPeriod != -1) - pCfg->walRetentionPeriod = TSDB_DEFAULT_DB_WAL_RETENTION_PERIOD; + pCfg->walRetentionPeriod = TSDB_REPS_DEF_DB_WAL_RET_PERIOD; if (pCfg->walRetentionSize < 0 && pCfg->walRetentionSize != -1) - pCfg->walRetentionSize = TSDB_DEFAULT_DB_WAL_RETENTION_SIZE; - if (pCfg->walRollPeriod < 0) pCfg->walRollPeriod = TSDB_DEFAULT_DB_WAL_ROLL_PERIOD; + pCfg->walRetentionSize = TSDB_REPS_DEF_DB_WAL_RET_SIZE; + if (pCfg->walRollPeriod < 0) pCfg->walRollPeriod = TSDB_REPS_DEF_DB_WAL_ROLL_PERIOD; if (pCfg->walSegmentSize < 0) pCfg->walSegmentSize = TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE; + if (pCfg->sstTrigger <= 0) pCfg->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; } static int32_t mndSetCreateDbRedoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroups) { @@ -479,6 +484,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate, .walRetentionSize = pCreate->walRetentionSize, .walRollPeriod = pCreate->walRollPeriod, .walSegmentSize = pCreate->walSegmentSize, + .sstTrigger = pCreate->sstTrigger, }; dbObj.cfg.numOfRetensions = pCreate->numOfRetensions; @@ -1682,6 +1688,9 @@ static void mndDumpDbInfoData(SMnode *pMnode, SSDataBlock *pBlock, SDbObj *pDb, pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.walSegmentSize, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.sstTrigger, false); } taosMemoryFree(buf); diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 09eed7fb32..f54e831b0b 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -234,6 +234,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg createReq.walRetentionSize = pDb->cfg.walRetentionSize; createReq.walRollPeriod = pDb->cfg.walRollPeriod; createReq.walSegmentSize = pDb->cfg.walSegmentSize; + createReq.sstTrigger = pDb->cfg.sstTrigger; for (int32_t v = 0; v < pVgroup->replica; ++v) { SReplica *pReplica = &createReq.replicas[v]; @@ -791,32 +792,43 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB if (pShow->pIter == NULL) break; for (int32_t i = 0; i < pVgroup->replica && numOfRows < rows; ++i) { - SVnodeGid *pVgid = &pVgroup->vnodeGid[i]; + SVnodeGid *pVgid = &pVgroup->vnodeGid[i]; + SColumnInfoData *pColInfo = NULL; cols = 0; - SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->vgId, false); - SName name = {0}; - char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - tNameFromString(&name, pVgroup->dbName, T_NAME_ACCT | T_NAME_DB); - tNameGetDbName(&name, varDataVal(db)); - varDataSetLen(db, strlen(varDataVal(db))); - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataAppend(pColInfo, numOfRows, (const char *)db, false); - - uint32_t val = 0; - pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataAppend(pColInfo, numOfRows, (const char *)&val, false); + colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->replica, false); char buf[20] = {0}; STR_TO_VARSTR(buf, syncStr(pVgid->role)); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)buf, false); + const char *dbname = mndGetDbStr(pVgroup->dbName); + char b1[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + if (dbname != NULL) { + STR_WITH_MAXSIZE_TO_VARSTR(b1, dbname, TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE); + } else { + STR_WITH_MAXSIZE_TO_VARSTR(b1, "NULL", TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE); + } pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataAppend(pColInfo, numOfRows, (const char *)&pVgroup->replica, false); // onlines + colDataAppend(pColInfo, numOfRows, (const char *)b1, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)&pVgid->dnodeId, false); + + SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); + char b2[TSDB_EP_LEN + VARSTR_HEADER_SIZE] = {0}; + if (pDnode != NULL) { + STR_WITH_MAXSIZE_TO_VARSTR(b2, pDnode->ep, TSDB_EP_LEN + VARSTR_HEADER_SIZE); + } else { + STR_WITH_MAXSIZE_TO_VARSTR(b2, "NULL", TSDB_EP_LEN + VARSTR_HEADER_SIZE); + } + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)b2, false); numOfRows++; } diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 5d4285b7c2..a1c2265c2e 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -287,6 +287,7 @@ struct SVnodeCfg { SVnodeStats vndStats; uint32_t hashBegin; uint32_t hashEnd; + int16_t sstTrigger; }; typedef struct { diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 8c3fa25446..d00907f677 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -241,6 +241,20 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp continue; } } + if (pHandle->fetchMeta) { + SSubmitBlk* pBlk = pReader->pBlock; + if (pBlk->schemaLen > 0) { + if (pRsp->createTableNum == 0) { + pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); + pRsp->createTableReq = taosArrayInit(0, sizeof(void*)); + } + void* createReq = taosMemoryCalloc(1, pBlk->schemaLen); + memcpy(createReq, pBlk->data, pBlk->schemaLen); + taosArrayPush(pRsp->createTableLen, &pBlk->schemaLen); + taosArrayPush(pRsp->createTableReq, &createReq); + pRsp->createTableNum++; + } + } tqAddBlockDataToRsp(&block, (SMqDataRsp*)pRsp, taosArrayGetSize(block.pDataBlock)); blockDataFreeRes(&block); tqAddBlockSchemaToRsp(pExec, (SMqDataRsp*)pRsp); @@ -261,34 +275,25 @@ int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp continue; } } + if (pHandle->fetchMeta) { + SSubmitBlk* pBlk = pReader->pBlock; + if (pBlk->schemaLen > 0) { + if (pRsp->createTableNum == 0) { + pRsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); + pRsp->createTableReq = taosArrayInit(0, sizeof(void*)); + } + void* createReq = taosMemoryCalloc(1, pBlk->schemaLen); + memcpy(createReq, pBlk->data, pBlk->schemaLen); + taosArrayPush(pRsp->createTableLen, &pBlk->schemaLen); + taosArrayPush(pRsp->createTableReq, &createReq); + pRsp->createTableNum++; + } + } tqAddBlockDataToRsp(&block, (SMqDataRsp*)pRsp, taosArrayGetSize(block.pDataBlock)); blockDataFreeRes(&block); tqAddBlockSchemaToRsp(pExec, (SMqDataRsp*)pRsp); pRsp->blockNum++; } -#if 1 - if (pHandle->fetchMeta && pRsp->blockNum) { - SSubmitMsgIter iter = {0}; - tInitSubmitMsgIter(pReq, &iter); - STaosxRsp* pXrsp = (STaosxRsp*)pRsp; - while (1) { - SSubmitBlk* pBlk = NULL; - if (tGetSubmitMsgNext(&iter, &pBlk) < 0) break; - if (pBlk == NULL) break; - if (pBlk->schemaLen > 0) { - if (pXrsp->createTableNum == 0) { - pXrsp->createTableLen = taosArrayInit(0, sizeof(int32_t)); - pXrsp->createTableReq = taosArrayInit(0, sizeof(void*)); - } - void* createReq = taosMemoryCalloc(1, pBlk->schemaLen); - memcpy(createReq, pBlk->data, pBlk->schemaLen); - taosArrayPush(pXrsp->createTableLen, &pBlk->schemaLen); - taosArrayPush(pXrsp->createTableReq, &createReq); - pXrsp->createTableNum++; - } - } - } -#endif } if (pRsp->blockNum == 0) { diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 546a20134e..f60ceab163 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -184,9 +184,9 @@ static int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pR static void setComposedBlockFlag(STsdbReader* pReader, bool composed); static bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32_t order); -static void doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDelList, STSRow** pTSRow, +static int32_t doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDelList, STSRow** pTSRow, STsdbReader* pReader, bool* freeTSRow); -static void doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader, +static int32_t doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader, STSRow** pTSRow); static int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBlockScanInfo, int64_t key, STsdbReader* pReader); @@ -1395,7 +1395,11 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo* } } - tRowMergerGetRow(&merge, &pTSRow); + int32_t code = tRowMergerGetRow(&merge, &pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + doAppendRowFromTSRow(pReader->pResBlock, pReader, pTSRow, pBlockScanInfo->uid); taosMemoryFree(pTSRow); @@ -1422,7 +1426,11 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader, doMergeRowsInFileBlocks(pBlockData, pBlockScanInfo, pReader, &merge); } - tRowMergerGetRow(&merge, &pTSRow); + int32_t code = tRowMergerGetRow(&merge, &pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + doAppendRowFromTSRow(pReader->pResBlock, pReader, pTSRow, pBlockScanInfo->uid); taosMemoryFree(pTSRow); @@ -1456,12 +1464,16 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader doMergeRowsInFileBlocks(pBlockData, pBlockScanInfo, pReader, &merge); doMergeRowsInLastBlock(pLastBlockReader, pBlockScanInfo, ts, &merge); - tRowMergerGetRow(&merge, &pTSRow); + int32_t code = tRowMergerGetRow(&merge, &pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + doAppendRowFromTSRow(pReader->pResBlock, pReader, pTSRow, pBlockScanInfo->uid); taosMemoryFree(pTSRow); tRowMergerClear(&merge); - return TSDB_CODE_SUCCESS; + return code; } else { ASSERT(0); return TSDB_CODE_SUCCESS; @@ -1618,12 +1630,16 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo* } } - tRowMergerGetRow(&merge, &pTSRow); + int32_t code = tRowMergerGetRow(&merge, &pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + doAppendRowFromTSRow(pReader->pResBlock, pReader, pTSRow, pBlockScanInfo->uid); taosMemoryFree(pTSRow); tRowMergerClear(&merge); - return TSDB_CODE_SUCCESS; + return code; } #if 0 @@ -1907,7 +1923,11 @@ int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBloc tRowMergerInit(&merge, &fRow, pReader->pSchema); doMergeRowsInFileBlocks(pBlockData, pBlockScanInfo, pReader, &merge); - tRowMergerGetRow(&merge, &pTSRow); + int32_t code = tRowMergerGetRow(&merge, &pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + doAppendRowFromTSRow(pReader->pResBlock, pReader, pTSRow, pBlockScanInfo->uid); taosMemoryFree(pTSRow); @@ -3026,8 +3046,8 @@ int32_t doMergeRowsInLastBlock(SLastBlockReader* pLastBlockReader, STableBlockSc return TSDB_CODE_SUCCESS; } -void doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDelList, STSRow** pTSRow, - STsdbReader* pReader, bool* freeTSRow) { +int32_t doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SArray* pDelList, STSRow** pTSRow, + STsdbReader* pReader, bool* freeTSRow) { TSDBROW* pNextRow = NULL; TSDBROW current = *pRow; @@ -3037,19 +3057,19 @@ void doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SAr if (!pIter->hasVal) { *pTSRow = current.pTSRow; *freeTSRow = false; - return; + return TSDB_CODE_SUCCESS; } else { // has next point in mem/imem pNextRow = getValidMemRow(pIter, pDelList, pReader); if (pNextRow == NULL) { *pTSRow = current.pTSRow; *freeTSRow = false; - return; + return TSDB_CODE_SUCCESS; } if (current.pTSRow->ts != pNextRow->pTSRow->ts) { *pTSRow = current.pTSRow; *freeTSRow = false; - return; + return TSDB_CODE_SUCCESS; } } } @@ -3069,13 +3089,17 @@ void doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, SAr tRowMergerAdd(&merge, pNextRow, pTSchema1); doMergeRowsInBuf(pIter, uid, current.pTSRow->ts, pDelList, &merge, pReader); - tRowMergerGetRow(&merge, pTSRow); - tRowMergerClear(&merge); + int32_t code = tRowMergerGetRow(&merge, pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + tRowMergerClear(&merge); *freeTSRow = true; + return TSDB_CODE_SUCCESS; } -void doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader, +int32_t doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader, STSRow** pTSRow) { SRowMerger merge = {0}; @@ -3100,7 +3124,8 @@ void doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* pBlo doMergeRowsInBuf(&pBlockScanInfo->iiter, pBlockScanInfo->uid, k.ts, pBlockScanInfo->delSkyline, &merge, pReader); } - tRowMergerGetRow(&merge, pTSRow); + int32_t code = tRowMergerGetRow(&merge, pTSRow); + return code; } int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pReader, STSRow** pTSRow, int64_t endKey, @@ -3130,28 +3155,30 @@ int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pR TSDBKEY k = TSDBROW_KEY(pRow); TSDBKEY ik = TSDBROW_KEY(piRow); + int32_t code = TSDB_CODE_SUCCESS; if (ik.ts != k.ts) { if (((ik.ts < k.ts) && asc) || ((ik.ts > k.ts) && (!asc))) { // ik.ts < k.ts - doMergeMemTableMultiRows(piRow, uid, &pBlockScanInfo->iiter, pDelList, pTSRow, pReader, freeTSRow); + code = doMergeMemTableMultiRows(piRow, uid, &pBlockScanInfo->iiter, pDelList, pTSRow, pReader, freeTSRow); } else if (((k.ts < ik.ts) && asc) || ((k.ts > ik.ts) && (!asc))) { - doMergeMemTableMultiRows(pRow, uid, &pBlockScanInfo->iter, pDelList, pTSRow, pReader, freeTSRow); + code = doMergeMemTableMultiRows(pRow, uid, &pBlockScanInfo->iter, pDelList, pTSRow, pReader, freeTSRow); } } else { // ik.ts == k.ts - doMergeMemIMemRows(pRow, piRow, pBlockScanInfo, pReader, pTSRow); *freeTSRow = true; + code = doMergeMemIMemRows(pRow, piRow, pBlockScanInfo, pReader, pTSRow); + if (code != TSDB_CODE_SUCCESS) { + return code; + } } - return TSDB_CODE_SUCCESS; + return code; } if (pBlockScanInfo->iter.hasVal && pRow != NULL) { - doMergeMemTableMultiRows(pRow, pBlockScanInfo->uid, &pBlockScanInfo->iter, pDelList, pTSRow, pReader, freeTSRow); - return TSDB_CODE_SUCCESS; + return doMergeMemTableMultiRows(pRow, pBlockScanInfo->uid, &pBlockScanInfo->iter, pDelList, pTSRow, pReader, freeTSRow); } if (pBlockScanInfo->iiter.hasVal && piRow != NULL) { - doMergeMemTableMultiRows(piRow, uid, &pBlockScanInfo->iiter, pDelList, pTSRow, pReader, freeTSRow); - return TSDB_CODE_SUCCESS; + return doMergeMemTableMultiRows(piRow, uid, &pBlockScanInfo->iiter, pDelList, pTSRow, pReader, freeTSRow); } return TSDB_CODE_SUCCESS; diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 6db9d5e6f4..cfb04881e6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -2039,7 +2039,7 @@ int32_t tsdbCmprColData(SColData *pColData, int8_t cmprAlg, SBlockCol *pBlockCol size += pBlockCol->szOffset; // value - if (pColData->flag != (HAS_NULL | HAS_NONE)) { + if ((pColData->flag != (HAS_NULL | HAS_NONE)) && pColData->nData) { code = tsdbCmprData((uint8_t *)pColData->pData, pColData->nData, pColData->type, cmprAlg, ppOut, nOut + size, &pBlockCol->szValue, ppBuf); if (code) goto _exit; diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index 580ab8bc93..24dda29330 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -106,6 +106,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, "sstTrigger", pCfg->sstTrigger) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashBegin", pCfg->hashBegin) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashEnd", pCfg->hashEnd) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashMethod", pCfg->hashMethod) < 0) return -1; @@ -205,6 +206,8 @@ 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, "sstTrigger", pCfg->sstTrigger, code); + if (code < 0) return -1; tjsonGetNumberValue(pJson, "hashBegin", pCfg->hashBegin, code); if (code < 0) return -1; tjsonGetNumberValue(pJson, "hashEnd", pCfg->hashEnd, code); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 85feecff1a..cd0c7ba1f3 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -496,6 +496,7 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t version, void *pR // loop to create table for (int32_t iReq = 0; iReq < req.nReqs; iReq++) { pCreateReq = req.pReqs + iReq; + memset(&cRsp, 0, sizeof(cRsp)); if ((terrno = grantCheck(TSDB_GRANT_TIMESERIES)) < 0) { rcode = -1; diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 89e5b2da0a..3bed81f657 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -410,6 +410,7 @@ typedef enum EStreamScanMode { STREAM_SCAN_FROM_READERHANDLE = 1, STREAM_SCAN_FROM_RES, STREAM_SCAN_FROM_UPDATERES, + STREAM_SCAN_FROM_DELETERES, STREAM_SCAN_FROM_DATAREADER_RETRIEVE, STREAM_SCAN_FROM_DATAREADER_RANGE, } EStreamScanMode; @@ -438,12 +439,24 @@ typedef struct SStreamAggSupporter { SSDataBlock* pScanBlock; } SStreamAggSupporter; -typedef struct SessionWindowSupporter { +typedef struct SWindowSupporter { SStreamAggSupporter* pStreamAggSup; int64_t gap; uint16_t parentType; SAggSupporter* pIntervalAggSup; -} SessionWindowSupporter; +} SWindowSupporter; + +typedef struct SPartitionBySupporter { + SArray* pGroupCols; // group by columns, SArray + SArray* pGroupColVals; // current group column values, SArray + char* keyBuf; // group by keys for hash + bool needCalc; // partition by column +} SPartitionBySupporter; + +typedef struct SPartitionDataInfo { + uint64_t groupId; + SArray* rowIds; +} SPartitionDataInfo; typedef struct STimeWindowSupp { int8_t calTrigger; @@ -478,7 +491,9 @@ typedef struct SStreamScanInfo { SOperatorInfo* pStreamScanOp; SOperatorInfo* pTableScanOp; SArray* childIds; - SessionWindowSupporter sessionSup; + SWindowSupporter windowSup; + SPartitionBySupporter partitionSup; + SExprSupp* pPartScalarSup; bool assignBlockUid; // assign block uid to groupId, temporarily used for generating rollup SMA. int32_t scanWinIndex; // for state operator int32_t pullDataResIndex; @@ -691,7 +706,6 @@ typedef struct SPartitionOperatorInfo { SArray* sortedGroupArray; // SDataGroupInfo sorted by group id int32_t groupIndex; // group index int32_t pageIndex; // page index of current group - SSDataBlock* pUpdateRes; SExprSupp scalarSup; } SPartitionOperatorInfo; @@ -743,8 +757,8 @@ typedef struct SStreamSessionAggOperatorInfo { SSDataBlock* pWinBlock; // window result SqlFunctionCtx* pDummyCtx; // for combine SSDataBlock* pDelRes; // delete result - bool returnDelete; SSDataBlock* pUpdateRes; // update window + bool returnUpdate; SHashObj* pStDeleted; void* pDelIterator; SArray* pChildren; // cache for children's result; final stream operator @@ -753,6 +767,16 @@ typedef struct SStreamSessionAggOperatorInfo { bool ignoreExpiredData; } SStreamSessionAggOperatorInfo; +typedef struct SStreamPartitionOperatorInfo { + SOptrBasicInfo binfo; + SPartitionBySupporter partitionSup; + SExprSupp scalarSup; + SHashObj* pPartitions; + void* parIte; + SSDataBlock* pInputDataBlock; + int32_t tsColIndex; +} SStreamPartitionOperatorInfo; + typedef struct STimeSliceOperatorInfo { SSDataBlock* pRes; STimeWindow win; @@ -954,6 +978,9 @@ SOperatorInfo* createRawScanOperatorInfo(SReadHandle* pHandle, SExecTaskInfo* pT SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SFillPhysiNode* pPhyFillNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWinodwPhysiNode* pStateNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartitionPhysiNode* pPartNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SPartitionPhysiNode* pPartNode, SExecTaskInfo* pTaskInfo); + SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode* pNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t numOfDownstream, SSortMergeJoinPhysiNode* pJoinNode, SExecTaskInfo* pTaskInfo); @@ -1022,8 +1049,9 @@ bool functionNeedToExecute(SqlFunctionCtx* pCtx); bool isOverdue(TSKEY ts, STimeWindowAggSupp* pSup); bool isCloseWindow(STimeWindow* pWin, STimeWindowAggSupp* pSup); bool isDeletedWindow(STimeWindow* pWin, uint64_t groupId, SAggSupporter* pSup); -void appendOneRow(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, int32_t uidCol, uint64_t* pID); +void appendOneRow(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t* pUid, uint64_t* pGp); void printDataBlock(SSDataBlock* pBlock, const char* flag); +uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t rowId); int32_t finalizeResultRowIntoResultDataBlock(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPosition, SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, int32_t numOfExprs, const int32_t* rowCellOffset, diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 03fbda3853..3965b7e5b2 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -938,15 +938,17 @@ SArray* extractColMatchInfo(SNodeList* pNodeList, SDataBlockDescNode* pOutputNod for (int32_t i = 0; i < numOfCols; ++i) { STargetNode* pNode = (STargetNode*)nodesListGetNode(pNodeList, i); - SColumnNode* pColNode = (SColumnNode*)pNode->pExpr; + if (nodeType(pNode->pExpr) == QUERY_NODE_COLUMN) { + SColumnNode* pColNode = (SColumnNode*)pNode->pExpr; - SColMatchInfo c = {0}; - c.output = true; - c.colId = pColNode->colId; - c.srcSlotId = pColNode->slotId; - c.matchType = type; - c.targetSlotId = pNode->slotId; - taosArrayPush(pList, &c); + SColMatchInfo c = {0}; + c.output = true; + c.colId = pColNode->colId; + c.srcSlotId = pColNode->slotId; + c.matchType = type; + c.targetSlotId = pNode->slotId; + taosArrayPush(pList, &c); + } } *numOfOutputCols = 0; diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index a242db630d..12118fad72 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -810,7 +810,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT } } - // TODO after dropping table, table may be not found + // TODO after dropping table, table may not found ASSERT(found); if (pTableScanInfo->dataReader == NULL) { diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index fd3450260a..3cb4ea8702 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -263,8 +263,6 @@ SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pR ASSERT(pSup->resultRowSize > 0); pResult = getNewResultRow(pResultBuf, &pSup->currentPageId, pSup->resultRowSize); - initResultRow(pResult); - // add a new result set for a new group SResultRowPosition pos = {.pageId = pResult->pageId, .offset = pResult->offset}; tSimpleHashPut(pSup->pResultRowHashTable, pSup->keyBuf, GET_RES_WINDOW_KEY_LEN(bytes), &pos, @@ -817,13 +815,6 @@ void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, SSDataBlock* pB } else { pInput->colDataAggIsSet = false; } - - // set the statistics data for primary time stamp column - // if (pCtx->functionId == FUNCTION_SPREAD && pColumn->colId == PRIMARYKEY_TIMESTAMP_COL_ID) { - // pCtx->isAggSet = true; - // pCtx->agg.min = pBlock->info.window.skey; - // pCtx->agg.max = pBlock->info.window.ekey; - // } } bool isTaskKilled(SExecTaskInfo* pTaskInfo) { @@ -860,146 +851,6 @@ STimeWindow getAlignQueryTimeWindow(SInterval* pInterval, int32_t precision, int return win; } -#if 0 -static int32_t updateBlockLoadStatus(STaskAttr* pQuery, int32_t status) { - - bool hasFirstLastFunc = false; - bool hasOtherFunc = false; - - if (status == BLK_DATA_DATA_LOAD || status == BLK_DATA_FILTEROUT) { - return status; - } - - for (int32_t i = 0; i < pQuery->numOfOutput; ++i) { - int32_t functionId = getExprFunctionId(&pQuery->pExpr1[i]); - - if (functionId == FUNCTION_TS || functionId == FUNCTION_TS_DUMMY || functionId == FUNCTION_TAG || - functionId == FUNCTION_TAG_DUMMY) { - continue; - } - - if (functionId == FUNCTION_FIRST_DST || functionId == FUNCTION_LAST_DST) { - hasFirstLastFunc = true; - } else { - hasOtherFunc = true; - } - - } - - if (hasFirstLastFunc && status == BLK_DATA_NOT_LOAD) { - if (!hasOtherFunc) { - return BLK_DATA_FILTEROUT; - } else { - return BLK_DATA_DATA_LOAD; - } - } - - return status; -} - -#endif - -// static void updateDataCheckOrder(SQInfo *pQInfo, SQueryTableReq* pQueryMsg, bool stableQuery) { -// STaskAttr* pQueryAttr = pQInfo->runtimeEnv.pQueryAttr; -// -// // in case of point-interpolation query, use asc order scan -// char msg[] = "QInfo:0x%"PRIx64" scan order changed for %s query, old:%d, new:%d, qrange exchanged, old qrange:%" -// PRId64 -// "-%" PRId64 ", new qrange:%" PRId64 "-%" PRId64; -// -// // todo handle the case the the order irrelevant query type mixed up with order critical query type -// // descending order query for last_row query -// if (isFirstLastRowQuery(pQueryAttr)) { -// //qDebug("QInfo:0x%"PRIx64" scan order changed for last_row query, old:%d, new:%d", pQInfo->qId, -// pQueryAttr->order.order, TSDB_ORDER_ASC); -// -// pQueryAttr->order.order = TSDB_ORDER_ASC; -// if (pQueryAttr->window.skey > pQueryAttr->window.ekey) { -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// } -// -// pQueryAttr->needReverseScan = false; -// return; -// } -// -// if (pQueryAttr->groupbyColumn && pQueryAttr->order.order == TSDB_ORDER_DESC) { -// pQueryAttr->order.order = TSDB_ORDER_ASC; -// if (pQueryAttr->window.skey > pQueryAttr->window.ekey) { -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// } -// -// pQueryAttr->needReverseScan = false; -// doUpdateLastKey(pQueryAttr); -// return; -// } -// -// if (pQueryAttr->pointInterpQuery && pQueryAttr->interval.interval == 0) { -// if (!QUERY_IS_ASC_QUERY(pQueryAttr)) { -// //qDebug(msg, pQInfo->qId, "interp", pQueryAttr->order.order, TSDB_ORDER_ASC, pQueryAttr->window.skey, -// pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey); TSWAP(pQueryAttr->window.skey, -// pQueryAttr->window.ekey, TSKEY); -// } -// -// pQueryAttr->order.order = TSDB_ORDER_ASC; -// return; -// } -// -// if (pQueryAttr->interval.interval == 0) { -// if (onlyFirstQuery(pQueryAttr)) { -// if (!QUERY_IS_ASC_QUERY(pQueryAttr)) { -// //qDebug(msg, pQInfo->qId, "only-first", pQueryAttr->order.order, TSDB_ORDER_ASC, pQueryAttr->window.skey, -//// pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey); -// -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// doUpdateLastKey(pQueryAttr); -// } -// -// pQueryAttr->order.order = TSDB_ORDER_ASC; -// pQueryAttr->needReverseScan = false; -// } else if (onlyLastQuery(pQueryAttr) && notContainSessionOrStateWindow(pQueryAttr)) { -// if (QUERY_IS_ASC_QUERY(pQueryAttr)) { -// //qDebug(msg, pQInfo->qId, "only-last", pQueryAttr->order.order, TSDB_ORDER_DESC, pQueryAttr->window.skey, -//// pQueryAttr->window.ekey, pQueryAttr->window.ekey, pQueryAttr->window.skey); -// -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// doUpdateLastKey(pQueryAttr); -// } -// -// pQueryAttr->order.order = TSDB_ORDER_DESC; -// pQueryAttr->needReverseScan = false; -// } -// -// } else { // interval query -// if (stableQuery) { -// if (onlyFirstQuery(pQueryAttr)) { -// if (!QUERY_IS_ASC_QUERY(pQueryAttr)) { -// //qDebug(msg, pQInfo->qId, "only-first stable", pQueryAttr->order.order, TSDB_ORDER_ASC, -//// pQueryAttr->window.skey, pQueryAttr->window.ekey, pQueryAttr->window.ekey, -/// pQueryAttr->window.skey); -// -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// doUpdateLastKey(pQueryAttr); -// } -// -// pQueryAttr->order.order = TSDB_ORDER_ASC; -// pQueryAttr->needReverseScan = false; -// } else if (onlyLastQuery(pQueryAttr)) { -// if (QUERY_IS_ASC_QUERY(pQueryAttr)) { -// //qDebug(msg, pQInfo->qId, "only-last stable", pQueryAttr->order.order, TSDB_ORDER_DESC, -//// pQueryAttr->window.skey, pQueryAttr->window.ekey, pQueryAttr->window.ekey, -/// pQueryAttr->window.skey); -// -// TSWAP(pQueryAttr->window.skey, pQueryAttr->window.ekey); -// doUpdateLastKey(pQueryAttr); -// } -// -// pQueryAttr->order.order = TSDB_ORDER_DESC; -// pQueryAttr->needReverseScan = false; -// } -// } -// } -//} - #if 0 static bool overlapWithTimeWindow(STaskAttr* pQueryAttr, SDataBlockInfo* pBlockInfo) { STimeWindow w = {0}; @@ -1225,24 +1076,6 @@ static void updateTableQueryInfoForReverseScan(STableQueryInfo* pTableQueryInfo) if (pTableQueryInfo == NULL) { return; } - - // TSWAP(pTableQueryInfo->win.skey, pTableQueryInfo->win.ekey); - // pTableQueryInfo->lastKey = pTableQueryInfo->win.skey; - - // SWITCH_ORDER(pTableQueryInfo->cur.order); - // pTableQueryInfo->cur.vgroupIndex = -1; - - // set the index to be the end slot of result rows array - // SResultRowInfo* pResultRowInfo = &pTableQueryInfo->resInfo; - // if (pResultRowInfo->size > 0) { - // pResultRowInfo->curPos = pResultRowInfo->size - 1; - // } else { - // pResultRowInfo->curPos = -1; - // } -} - -void initResultRow(SResultRow* pResultRow) { - // pResultRow->pEntryInfo = (struct SResultRowEntryInfo*)((char*)pResultRow + sizeof(SResultRow)); } void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) { @@ -1255,15 +1088,6 @@ void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) { } } -void destroyTableQueryInfoImpl(STableQueryInfo* pTableQueryInfo) { - if (pTableQueryInfo == NULL) { - return; - } - - // taosVariantDestroy(&pTableQueryInfo->tag); - // cleanupResultRowInfo(&pTableQueryInfo->resInfo); -} - void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) { bool init = false; for (int32_t i = 0; i < numOfOutput; ++i) { @@ -3022,7 +2846,6 @@ int32_t aggDecodeResultRow(SOperatorInfo* pOperator, char* result) { resultRow->offset = pOffset; offset += valueLen; - initResultRow(resultRow); pInfo->resultRowInfo.cur = (SResultRowPosition){.pageId = resultRow->pageId, .offset = resultRow->offset}; // releaseBufPage(pSup->pResultBuf, getBufPage(pSup->pResultBuf, pageId)); } @@ -4149,6 +3972,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo pOptr = createStreamFinalSessionAggOperatorInfo(ops[0], pPhyNode, pTaskInfo, children); } else if (QUERY_NODE_PHYSICAL_PLAN_PARTITION == type) { pOptr = createPartitionOperatorInfo(ops[0], (SPartitionPhysiNode*)pPhyNode, pTaskInfo); + } else if (QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION == type) { + pOptr = createStreamPartitionOperatorInfo(ops[0], (SPartitionPhysiNode*)pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE == type) { SStateWinodwPhysiNode* pStateNode = (SStateWinodwPhysiNode*)pPhyNode; pOptr = createStatewindowOperatorInfo(ops[0], pStateNode, pTaskInfo); diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 5d123f723e..599edb0722 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -830,3 +830,205 @@ int32_t setGroupResultOutputBuf(SOperatorInfo* pOperator, SOptrBasicInfo* binfo, setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset); return TSDB_CODE_SUCCESS; } + +uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t rowId) { + if (pExprSup->pExprInfo != NULL) { + int32_t code = projectApplyFunctions(pExprSup->pExprInfo, pBlock, pBlock, pExprSup->pCtx, pExprSup->numOfExprs, NULL); + if (code != TSDB_CODE_SUCCESS) { + qError("calaculate group id error, code:%d", code); + } + } + recordNewGroupKeys(pParSup->pGroupCols, pParSup->pGroupColVals, pBlock, rowId); + int32_t len = buildGroupKeys(pParSup->keyBuf, pParSup->pGroupColVals); + uint64_t groupId = calcGroupId(pParSup->keyBuf, len); + return groupId; +} + +static bool hasRemainPartion(SStreamPartitionOperatorInfo* pInfo) { + return pInfo->parIte != NULL; +} + +static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { + SStreamPartitionOperatorInfo* pInfo = pOperator->info; + SSDataBlock* pDest = pInfo->binfo.pRes; + ASSERT(hasRemainPartion(pInfo)); + SPartitionDataInfo* pParInfo = (SPartitionDataInfo*)pInfo->parIte; + blockDataCleanup(pDest); + int32_t rows = taosArrayGetSize(pParInfo->rowIds); + SSDataBlock* pSrc = pInfo->pInputDataBlock; + for (int32_t i = 0; i < rows; i++) { + int32_t rowIndex = *(int32_t*)taosArrayGet(pParInfo->rowIds, i); + for (int32_t j = 0; j < pOperator->exprSupp.numOfExprs; j++) { + int32_t slotId = pOperator->exprSupp.pExprInfo[j].base.pParam[0].pCol->slotId; + SColumnInfoData* pSrcCol = taosArrayGet(pSrc->pDataBlock, slotId); + SColumnInfoData* pDestCol = taosArrayGet(pDest->pDataBlock, j); + bool isNull = colDataIsNull(pSrcCol, pSrc->info.rows, rowIndex, NULL); + char* pSrcData = colDataGetData(pSrcCol, rowIndex); + colDataAppend(pDestCol, pDest->info.rows, pSrcData, isNull); + } + pDest->info.rows++; + } + blockDataUpdateTsWindow(pDest, pInfo->tsColIndex); + pDest->info.groupId = pParInfo->groupId; + pOperator->resultInfo.totalRows += pDest->info.rows; + pInfo->parIte = taosHashIterate(pInfo->pPartitions, pInfo->parIte); + ASSERT(pDest->info.rows > 0); + printDataBlock(pDest, "stream partitionby"); + return pDest; +} + +static void doStreamHashPartitionImpl(SStreamPartitionOperatorInfo* pInfo, SSDataBlock* pBlock) { + pInfo->pInputDataBlock = pBlock; + for (int32_t i = 0; i < pBlock->info.rows; ++i) { + recordNewGroupKeys(pInfo->partitionSup.pGroupCols, pInfo->partitionSup.pGroupColVals, pBlock, i); + int32_t keyLen = buildGroupKeys(pInfo->partitionSup.keyBuf, pInfo->partitionSup.pGroupColVals); + SPartitionDataInfo* pParData = + (SPartitionDataInfo*) taosHashGet(pInfo->pPartitions, pInfo->partitionSup.keyBuf, keyLen); + if (pParData) { + taosArrayPush(pParData->rowIds, &i); + } else { + SPartitionDataInfo newParData = {0}; + newParData.groupId = calcGroupId(pInfo->partitionSup.keyBuf, keyLen); + newParData.rowIds = taosArrayInit(64, sizeof(int32_t)); + taosArrayPush(newParData.rowIds, &i); + taosHashPut(pInfo->pPartitions, pInfo->partitionSup.keyBuf, keyLen, &newParData, + sizeof(SPartitionDataInfo)); + } + } +} + +static SSDataBlock* doStreamHashPartition(SOperatorInfo* pOperator) { + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStreamPartitionOperatorInfo* pInfo = pOperator->info; + if (hasRemainPartion(pInfo)) { + return buildStreamPartitionResult(pOperator); + } + + int64_t st = taosGetTimestampUs(); + SOperatorInfo* downstream = pOperator->pDownstream[0]; + { + pInfo->pInputDataBlock = NULL; + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + doSetOperatorCompleted(pOperator); + return NULL; + } + printDataBlock(pBlock, "stream partitionby recv"); + switch (pBlock->info.type) { + case STREAM_NORMAL: + case STREAM_PULL_DATA: + case STREAM_INVALID: + pInfo->binfo.pRes->info.type = pBlock->info.type; + break; + default: + return pBlock; + } + + // there is an scalar expression that needs to be calculated right before apply the group aggregation. + if (pInfo->scalarSup.pExprInfo != NULL) { + pTaskInfo->code = projectApplyFunctions(pInfo->scalarSup.pExprInfo, pBlock, pBlock, + pInfo->scalarSup.pCtx, pInfo->scalarSup.numOfExprs, NULL); + if (pTaskInfo->code != TSDB_CODE_SUCCESS) { + longjmp(pTaskInfo->env, pTaskInfo->code); + } + } + taosHashClear(pInfo->pPartitions); + doStreamHashPartitionImpl(pInfo, pBlock); + } + pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; + + pInfo->parIte = taosHashIterate(pInfo->pPartitions, NULL); + return buildStreamPartitionResult(pOperator); +} + +static void destroyStreamPartitionOperatorInfo(void* param) { + SStreamPartitionOperatorInfo* pInfo = (SStreamPartitionOperatorInfo*)param; + cleanupBasicInfo(&pInfo->binfo); + taosArrayDestroy(pInfo->partitionSup.pGroupCols); + + for(int i = 0; i < taosArrayGetSize(pInfo->partitionSup.pGroupColVals); i++){ + SGroupKeys key = *(SGroupKeys*)taosArrayGet(pInfo->partitionSup.pGroupColVals, i); + taosMemoryFree(key.pData); + } + taosArrayDestroy(pInfo->partitionSup.pGroupColVals); + + taosMemoryFree(pInfo->partitionSup.keyBuf); + cleanupExprSupp(&pInfo->scalarSup); + taosMemoryFreeClear(param); +} + +void initParDownStream(SOperatorInfo* downstream, SPartitionBySupporter* pParSup, SExprSupp* pExpr) { + if (downstream->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { + return; + } + SStreamScanInfo* pScanInfo = downstream->info; + pScanInfo->partitionSup = *pParSup; + pScanInfo->pPartScalarSup = pExpr; +} + +SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStreamPartitionPhysiNode* pPartNode, SExecTaskInfo* pTaskInfo) { + SStreamPartitionOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStreamPartitionOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pInfo == NULL || pOperator == NULL) { + goto _error; + } + int32_t code = TSDB_CODE_SUCCESS; + pInfo->partitionSup.pGroupCols = extractPartitionColInfo(pPartNode->pPartitionKeys); + + if (pPartNode->pExprs != NULL) { + int32_t num = 0; + SExprInfo* pCalExprInfo = createExprInfo(pPartNode->pExprs, NULL, &num); + code = initExprSupp(&pInfo->scalarSup, pCalExprInfo, num); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } + + int32_t keyLen = 0; + code = initGroupOptrInfo(&pInfo->partitionSup.pGroupColVals, &keyLen, &pInfo->partitionSup.keyBuf, pInfo->partitionSup.pGroupCols); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + pInfo->partitionSup.needCalc = true; + + SSDataBlock* pResBlock = createResDataBlock(pPartNode->node.pOutputDataBlockDesc); + if (!pResBlock) { + goto _error; + } + blockDataEnsureCapacity(pResBlock, 4096); + pInfo->binfo.pRes = pResBlock; + pInfo->parIte = NULL; + pInfo->pInputDataBlock = NULL; + _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); + pInfo->pPartitions = taosHashInit(1024, hashFn, false, HASH_NO_LOCK); + pInfo->tsColIndex = 0; + + int32_t numOfCols = 0; + SExprInfo* pExprInfo = createExprInfo(pPartNode->pTargets, NULL, &numOfCols); + + pOperator->name = "StreamPartitionOperator"; + pOperator->blocking = false; + pOperator->status = OP_NOT_OPENED; + pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION; + pOperator->exprSupp.numOfExprs = numOfCols; + pOperator->exprSupp.pExprInfo = pExprInfo; + pOperator->info = pInfo; + pOperator->pTaskInfo = pTaskInfo; + pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamHashPartition, NULL, NULL, destroyStreamPartitionOperatorInfo, + NULL, NULL, NULL); + + initParDownStream(downstream, &pInfo->partitionSup, &pInfo->scalarSup); + code = appendDownstream(pOperator, &downstream, 1); + return pOperator; + + _error: + pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; + taosMemoryFreeClear(pInfo); + taosMemoryFreeClear(pOperator); + return NULL; +} + diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 9a5368e90e..b740ec21d3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -920,49 +920,28 @@ static void doClearBufferedBlocks(SStreamScanInfo* pInfo) { } static bool isSessionWindow(SStreamScanInfo* pInfo) { - return pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION || - pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION; + return pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION || + pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION; } static bool isStateWindow(SStreamScanInfo* pInfo) { - return pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE; + return pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE; } static bool isIntervalWindow(SStreamScanInfo* pInfo) { - return pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL || - pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL || - pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL; + return pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL || + pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL || + pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL; } static bool isSignleIntervalWindow(SStreamScanInfo* pInfo) { - return pInfo->sessionSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL; + return pInfo->windowSup.parentType == QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL; } static bool isSlidingWindow(SStreamScanInfo* pInfo) { return isIntervalWindow(pInfo) && pInfo->interval.interval != pInfo->interval.sliding; } -static uint64_t getGroupId(SOperatorInfo* pOperator, uint64_t uid) { - uint64_t* groupId = taosHashGet(pOperator->pTaskInfo->tableqinfoList.map, &uid, sizeof(int64_t)); - if (groupId) { - return *groupId; - } - return 0; - /* Todo(liuyao) for partition by column - recordNewGroupKeys(pTableScanInfo->pGroupCols, pTableScanInfo->pGroupColVals, pBlock, rowId); - int32_t len = buildGroupKeys(pTableScanInfo->keyBuf, pTableScanInfo->pGroupColVals); - uint64_t resId = 0; - uint64_t* groupId = taosHashGet(pTableScanInfo->pGroupSet, pTableScanInfo->keyBuf, len); - if (groupId) { - return *groupId; - } else if (len != 0) { - resId = calcGroupId(pTableScanInfo->keyBuf, len); - taosHashPut(pTableScanInfo->pGroupSet, pTableScanInfo->keyBuf, len, &resId, sizeof(uint64_t)); - } - return resId; - */ -} - static void setGroupId(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_t groupColIndex, int32_t rowIndex) { SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, groupColIndex); uint64_t* groupCol = (uint64_t*)pColInfo->pData; @@ -976,6 +955,62 @@ void resetTableScanInfo(STableScanInfo* pTableScanInfo, STimeWindow* pWin) { pTableScanInfo->currentGroupId = -1; } +static void freeArray(void* array) { + taosArrayDestroy(array); +} + +static void resetTableScanOperator(SOperatorInfo* pTableScanOp) { + STableScanInfo* pTableScanInfo = pTableScanOp->info; + pTableScanInfo->cond.startVersion = -1; + pTableScanInfo->cond.endVersion = -1; + SArray* gpTbls = pTableScanOp->pTaskInfo->tableqinfoList.pGroupList; + SArray* allTbls = pTableScanOp->pTaskInfo->tableqinfoList.pTableList; + taosArrayClearP(gpTbls, freeArray); + taosArrayPush(gpTbls, &allTbls); + STimeWindow win = {.skey = INT64_MIN, .ekey = INT64_MAX}; + resetTableScanInfo(pTableScanOp->info, &win); +} + +static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbUid, TSKEY startTs, TSKEY endTs, int64_t maxVersion) { + SArray* gpTbls = pTableScanOp->pTaskInfo->tableqinfoList.pGroupList; + taosArrayClear(gpTbls); + STableKeyInfo tblInfo = {.uid = tbUid, .groupId = 0}; + SArray* tbls = taosArrayInit(1, sizeof(STableKeyInfo)); + taosArrayPush(tbls, &tblInfo); + taosArrayPush(gpTbls, &tbls); + + STimeWindow win = {.skey = startTs, .ekey = endTs}; + STableScanInfo* pTableScanInfo = pTableScanOp->info; + pTableScanInfo->cond.startVersion = -1; + pTableScanInfo->cond.endVersion = maxVersion; + resetTableScanInfo(pTableScanOp->info, &win); + SSDataBlock* pRes = doTableScan(pTableScanOp); + resetTableScanOperator(pTableScanOp); + return pRes; +} + +static uint64_t getGroupIdByCol(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, int64_t maxVersion) { + SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, uid, ts, ts, maxVersion); + if (!pPreRes || pPreRes->info.rows == 0) { + return 0; + } + ASSERT(pPreRes->info.rows == 1); + return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); +} + +static uint64_t getGroupIdByData(SStreamScanInfo* pInfo, uint64_t uid, TSKEY ts, int64_t maxVersion) { + if (pInfo->partitionSup.needCalc) { + return getGroupIdByCol(pInfo, uid, ts, maxVersion); + } + + SHashObj* map = pInfo->pTableScanOp->pTaskInfo->tableqinfoList.map; + uint64_t* groupId = taosHashGet(map, &uid, sizeof(int64_t)); + if (groupId) { + return *groupId; + } + return 0; +} + static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_t* pRowIndex) { if ((*pRowIndex) == pBlock->info.rows) { return false; @@ -987,6 +1022,9 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_ SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); TSKEY* endData = (TSKEY*)pEndTsCol->pData; STimeWindow win = {.skey = startData[*pRowIndex], .ekey = endData[*pRowIndex]}; + SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* gpData = (uint64_t*)pGpCol->pData; + uint64_t groupId = gpData[*pRowIndex]; SColumnInfoData* pCalStartTsCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); TSKEY* calStartData = (TSKEY*)pCalStartTsCol->pData; @@ -1001,11 +1039,11 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_ (*pRowIndex)++; for (; *pRowIndex < pBlock->info.rows; (*pRowIndex)++) { - if (win.skey == startData[*pRowIndex]) { + if (win.skey == startData[*pRowIndex] && groupId == gpData[*pRowIndex]) { win.ekey = TMAX(win.ekey, endData[*pRowIndex]); continue; } - if (win.skey == endData[*pRowIndex]) { + if (win.skey == endData[*pRowIndex] && groupId == gpData[*pRowIndex]) { win.skey = TMIN(win.skey, startData[*pRowIndex]); continue; } @@ -1020,15 +1058,19 @@ static bool prepareRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pBlock, int32_ } static STimeWindow getSlidingWindow(TSKEY* tsCol, SInterval* pInterval, SDataBlockInfo* pDataBlockInfo, - int32_t* pRowIndex) { + int32_t* pRowIndex, bool hasGroup) { SResultRowInfo dumyInfo; dumyInfo.cur.pageId = -1; STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, tsCol[*pRowIndex], pInterval, TSDB_ORDER_ASC); STimeWindow endWin = win; STimeWindow preWin = win; while (1) { - (*pRowIndex) += getNumOfRowsInTimeWindow(pDataBlockInfo, tsCol, *pRowIndex, endWin.ekey, binarySearchForKey, NULL, - TSDB_ORDER_ASC); + if (hasGroup) { + (*pRowIndex) += 1; + } else { + (*pRowIndex) += getNumOfRowsInTimeWindow(pDataBlockInfo, tsCol, *pRowIndex, endWin.ekey, + binarySearchForKey, NULL, TSDB_ORDER_ASC); + } do { preWin = endWin; getNextTimeWindow(pInterval, &endWin, TSDB_ORDER_ASC); @@ -1060,7 +1102,26 @@ static SSDataBlock* doRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32 return NULL; } - if (pResult->info.groupId == pInfo->groupId) { + if (pInfo->partitionSup.needCalc) { + SSDataBlock* tmpBlock = createOneDataBlock(pResult, true); + blockDataCleanup(pResult); + for (int32_t i = 0; i < tmpBlock->info.rows; i++) { + if (calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, tmpBlock, i) == pInfo->groupId) { + for (int32_t j = 0; j < pInfo->pTableScanOp->exprSupp.numOfExprs; j++) { + SColumnInfoData* pSrcCol = taosArrayGet(tmpBlock->pDataBlock, j); + SColumnInfoData* pDestCol = taosArrayGet(pResult->pDataBlock, j); + bool isNull = colDataIsNull(pSrcCol, tmpBlock->info.rows, i, NULL); + char* pSrcData = colDataGetData(pSrcCol, i); + colDataAppend(pDestCol, pResult->info.rows, pSrcData, isNull); + } + pResult->info.rows++; + } + } + if (pResult->info.rows > 0) { + pResult->info.calWin = pInfo->updateWin; + return pResult; + } + } else if (pResult->info.groupId == pInfo->groupId) { pResult->info.calWin = pInfo->updateWin; return pResult; } @@ -1091,17 +1152,18 @@ static int32_t generateSessionScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSr SColumnInfoData* pDestCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pDestCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); int32_t dummy = 0; + int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < pSrcBlock->info.rows; i++) { - uint64_t groupId = getGroupId(pInfo->pTableScanOp, uidCol[i]); + uint64_t groupId = getGroupIdByData(pInfo, uidCol[i], startData[i], version); // gap must be 0. SResultWindowInfo* pStartWin = - getCurSessionWindow(pInfo->sessionSup.pStreamAggSup, startData[i], endData[i], groupId, 0, &dummy); + getCurSessionWindow(pInfo->windowSup.pStreamAggSup, startData[i], endData[i], groupId, 0, &dummy); if (!pStartWin) { // window has been closed. continue; } SResultWindowInfo* pEndWin = - getCurSessionWindow(pInfo->sessionSup.pStreamAggSup, endData[i], endData[i], groupId, 0, &dummy); + getCurSessionWindow(pInfo->windowSup.pStreamAggSup, endData[i], endData[i], groupId, 0, &dummy); ASSERT(pEndWin); TSKEY ts = INT64_MIN; colDataAppend(pDestStartCol, i, (const char*)&pStartWin->win.skey, false); @@ -1121,34 +1183,49 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS if (rows == 0) { return TSDB_CODE_SUCCESS; } - int32_t code = blockDataEnsureCapacity(pDestBlock, rows); + int32_t code = blockDataEnsureCapacity(pDestBlock, rows * 2); if (code != TSDB_CODE_SUCCESS) { return code; } - SColumnInfoData* pTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); - SColumnInfoData* pUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); - uint64_t* uidCol = (uint64_t*)pUidCol->pData; - ASSERT(pTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); - TSKEY* tsCol = (TSKEY*)pTsCol->pData; + SColumnInfoData* pSrcTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); + uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; + SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; + ASSERT(pSrcTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); + TSKEY* tsCol = (TSKEY*)pSrcTsCol->pData; SColumnInfoData* pStartTsCol = taosArrayGet(pDestBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pDestBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pDeUidCol = taosArrayGet(pDestBlock->pDataBlock, UID_COLUMN_INDEX); SColumnInfoData* pGpCol = taosArrayGet(pDestBlock->pDataBlock, GROUPID_COLUMN_INDEX); SColumnInfoData* pCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); - uint64_t groupId = getGroupId(pInfo->pTableScanOp, uidCol[0]); + int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < rows;) { - colDataAppend(pCalStartTsCol, pDestBlock->info.rows, (const char*)(tsCol + i), false); - STimeWindow win = getSlidingWindow(tsCol, &pInfo->interval, &pSrcBlock->info, &i); - colDataAppend(pCalEndTsCol, pDestBlock->info.rows, (const char*)(tsCol + i - 1), false); - + uint64_t srcUid = srcUidData[i]; + uint64_t groupId = getGroupIdByData(pInfo, srcUid, tsCol[i], version); + uint64_t srcGpId = srcGp[i]; + TSKEY calStartTs = tsCol[i]; + colDataAppend(pCalStartTsCol, pDestBlock->info.rows, (const char*)(&calStartTs), false); + STimeWindow win = getSlidingWindow(tsCol, &pInfo->interval, &pSrcBlock->info, &i, pInfo->partitionSup.needCalc); + TSKEY calEndTs = tsCol[i - 1]; + colDataAppend(pCalEndTsCol, pDestBlock->info.rows, (const char*)(&calEndTs), false); + colDataAppend(pDeUidCol, pDestBlock->info.rows, (const char*)(&srcUid), false); colDataAppend(pStartTsCol, pDestBlock->info.rows, (const char*)(&win.skey), false); colDataAppend(pEndTsCol, pDestBlock->info.rows, (const char*)(&win.ekey), false); colDataAppend(pGpCol, pDestBlock->info.rows, (const char*)(&groupId), false); pDestBlock->info.rows++; + if (pInfo->partitionSup.needCalc && srcGpId != 0 && groupId != srcGpId) { + colDataAppend(pCalStartTsCol, pDestBlock->info.rows, (const char*)(&calStartTs), false); + colDataAppend(pCalEndTsCol, pDestBlock->info.rows, (const char*)(&calEndTs), false); + colDataAppend(pDeUidCol, pDestBlock->info.rows, (const char*)(&srcUid), false); + colDataAppend(pStartTsCol, pDestBlock->info.rows, (const char*)(&win.skey), false); + colDataAppend(pEndTsCol, pDestBlock->info.rows, (const char*)(&win.ekey), false); + colDataAppend(pGpCol, pDestBlock->info.rows, (const char*)(&srcGpId), false); + pDestBlock->info.rows++; + } } - // all rows have same group id - pDestBlock->info.groupId = groupId; return TSDB_CODE_SUCCESS; } @@ -1160,17 +1237,20 @@ static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, code = generateSessionScanRange(pInfo, pSrcBlock, pDestBlock); } pDestBlock->info.type = STREAM_CLEAR; + pDestBlock->info.version = pSrcBlock->info.version; blockDataUpdateTsWindow(pDestBlock, 0); return code; } -void appendOneRow(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, int32_t uidCol, uint64_t* pID) { +void appendOneRow(SSDataBlock* pBlock, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t* pUid, uint64_t* pGp) { SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); - SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, uidCol); + SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); colDataAppend(pStartTsCol, pBlock->info.rows, (const char*)pStartTs, false); colDataAppend(pEndTsCol, pBlock->info.rows, (const char*)pEndTs, false); - colDataAppend(pUidCol, pBlock->info.rows, (const char*)pID, false); + colDataAppend(pUidCol, pBlock->info.rows, (const char*)pUid, false); + colDataAppend(pGpCol, pBlock->info.rows, (const char*)pGp, false); pBlock->info.rows++; } @@ -1195,24 +1275,18 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock // must check update info first. bool update = updateInfoIsUpdated(pInfo->pUpdateInfo, pBlock->info.uid, tsCol[rowId]); bool closedWin = isClosed && isSignleIntervalWindow(pInfo) && - isDeletedWindow(&win, pBlock->info.groupId, pInfo->sessionSup.pIntervalAggSup); + isDeletedWindow(&win, pBlock->info.groupId, pInfo->windowSup.pIntervalAggSup); if ((update || closedWin) && out) { - appendOneRow(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, UID_COLUMN_INDEX, &pBlock->info.uid); + uint64_t gpId = closedWin&&pInfo->partitionSup.needCalc ? + calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pBlock, rowId) : 0; + appendOneRow(pInfo->pUpdateDataRes, tsCol + rowId, tsCol + rowId, &pBlock->info.uid, + &gpId); } } - if (out) { + if (out && pInfo->pUpdateDataRes->info.rows > 0) { + pInfo->pUpdateDataRes->info.version = pBlock->info.version; blockDataUpdateTsWindow(pInfo->pUpdateDataRes, 0); - pInfo->pUpdateDataRes->info.type = STREAM_CLEAR; - } -} - -static void setBlockGroupId(SOperatorInfo* pOperator, SSDataBlock* pBlock, int32_t uidColIndex) { - ASSERT(taosArrayGetSize(pBlock->pDataBlock) >= 3); - SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, uidColIndex); - uint64_t* uidCol = (uint64_t*)pColDataInfo->pData; - ASSERT(pBlock->info.rows > 0); - for (int32_t i = 0; i < pBlock->info.rows; i++) { - uidCol[i] = getGroupId(pOperator, uidCol[i]); + pInfo->pUpdateDataRes->info.type = pInfo->partitionSup.needCalc ? STREAM_DELETE_DATA : STREAM_CLEAR; } } @@ -1447,6 +1521,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { default: break; } + // printDataBlock(pBlock, "stream scan recv"); return pBlock; } else if (pInfo->blockType == STREAM_INPUT__DATA_SUBMIT) { qDebug("scan mode %d", pInfo->scanMode); @@ -1456,6 +1531,14 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { pInfo->scanMode = STREAM_SCAN_FROM_READERHANDLE; return pInfo->pRes; } break; + case STREAM_SCAN_FROM_DELETERES: { + generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes); + prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); + pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RANGE; + copyDataBlock(pInfo->pDeleteDataRes, pInfo->pUpdateRes); + pInfo->pDeleteDataRes->info.type = STREAM_DELETE_DATA; + return pInfo->pDeleteDataRes; + } break; case STREAM_SCAN_FROM_UPDATERES: { generateScanRange(pInfo, pInfo->pUpdateDataRes, pInfo->pUpdateRes); prepareRangeScan(pInfo, pInfo->pUpdateRes, &pInfo->updateResIndex); @@ -1471,6 +1554,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { updateInfoSetScanRange(pInfo->pUpdateInfo, &pTableScanInfo->cond.twindows, pInfo->groupId, version); pSDB->info.type = pInfo->scanMode == STREAM_SCAN_FROM_DATAREADER_RANGE ? STREAM_NORMAL : STREAM_PULL_DATA; checkUpdateData(pInfo, true, pSDB, false); + // printDataBlock(pSDB, "stream scan update"); return pSDB; } pInfo->scanMode = STREAM_SCAN_FROM_READERHANDLE; @@ -1479,7 +1563,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { break; } - SStreamAggSupporter* pSup = pInfo->sessionSup.pStreamAggSup; + SStreamAggSupporter* pSup = pInfo->windowSup.pStreamAggSup; if (isStateWindow(pInfo) && pSup->pScanBlock->info.rows > 0) { pInfo->scanMode = STREAM_SCAN_FROM_DATAREADER_RANGE; pInfo->updateResIndex = 0; @@ -1545,7 +1629,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { // record the scan action. pInfo->numOfExec++; pOperator->resultInfo.totalRows += pBlockInfo->rows; - printDataBlock(pInfo->pRes, "stream scan"); + // printDataBlock(pInfo->pRes, "stream scan"); if (pBlockInfo->rows == 0) { updateInfoDestoryColseWinSBF(pInfo->pUpdateInfo); @@ -1554,19 +1638,20 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { checkUpdateData(pInfo, true, pInfo->pRes, true); pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, pBlockInfo->window.ekey); if (pInfo->pUpdateDataRes->info.rows > 0) { + pInfo->updateResIndex = 0; if (pInfo->pUpdateDataRes->info.type == STREAM_CLEAR) { - pInfo->updateResIndex = 0; pInfo->scanMode = STREAM_SCAN_FROM_UPDATERES; } else if (pInfo->pUpdateDataRes->info.type == STREAM_INVERT) { pInfo->scanMode = STREAM_SCAN_FROM_RES; return pInfo->pUpdateDataRes; + } else if (pInfo->pUpdateDataRes->info.type == STREAM_DELETE_DATA) { + pInfo->scanMode = STREAM_SCAN_FROM_DELETERES; } } } qDebug("scan rows: %d", pBlockInfo->rows); return (pBlockInfo->rows == 0) ? NULL : pInfo->pRes; - } else { ASSERT(0); return NULL; @@ -1830,13 +1915,8 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys ASSERT(pHandle->tqReader); pInfo->tqReader = pHandle->tqReader; } - - if (pTSInfo->pdInfo.interval.interval > 0) { - pInfo->pUpdateInfo = updateInfoInitP(&pTSInfo->pdInfo.interval, pInfo->twAggSup.waterMark); - } else { - pInfo->pUpdateInfo = NULL; - } - + + pInfo->pUpdateInfo = NULL; pInfo->pTableScanOp = pTableScanOp; pInfo->interval = pTSInfo->pdInfo.interval; @@ -1867,8 +1947,8 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys pInfo->pUpdateRes = createSpecialDataBlock(STREAM_CLEAR); pInfo->pCondition = pScanPhyNode->node.pConditions; pInfo->scanMode = STREAM_SCAN_FROM_READERHANDLE; - pInfo->sessionSup = - (SessionWindowSupporter){.pStreamAggSup = NULL, .gap = -1, .parentType = QUERY_NODE_PHYSICAL_PLAN}; + pInfo->windowSup = + (SWindowSupporter){.pStreamAggSup = NULL, .gap = -1, .parentType = QUERY_NODE_PHYSICAL_PLAN}; pInfo->groupId = 0; pInfo->pPullDataRes = createSpecialDataBlock(STREAM_RETRIEVE); pInfo->pStreamScanOp = pOperator; @@ -1877,6 +1957,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys pInfo->updateWin = (STimeWindow){.skey = INT64_MAX, .ekey = INT64_MAX}; pInfo->pUpdateDataRes = createSpecialDataBlock(STREAM_CLEAR); pInfo->assignBlockUid = pTableScanNode->assignBlockUid; + pInfo->partitionSup.needCalc = false; pOperator->name = "StreamScanOperator"; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN; diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 152bd5939d..26667cd64f 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -897,7 +897,7 @@ int64_t getWinReskey(void* data, int32_t index) { int32_t compareWinRes(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; - SWinKey* pos = taosArrayGetP(res, index); + SWinKey* pos = taosArrayGet(res, index); SResKeyPos* pData = (SResKeyPos*)pKey; if (*(int64_t*)pData->key == pos->ts) { if (pData->groupId > pos->groupId) { @@ -919,10 +919,11 @@ static void removeDeleteResults(SHashObj* pUpdatedMap, SArray* pDelWins) { } void* pIte = NULL; while ((pIte = taosHashIterate(pUpdatedMap, pIte)) != NULL) { - SResKeyPos* pResKey = (SResKeyPos*)pIte; + SResKeyPos* pResKey = *(SResKeyPos**)pIte; int32_t index = binarySearchCom(pDelWins, delSize, pResKey, TSDB_ORDER_DESC, compareWinRes); if (index >= 0 && 0 == compareWinRes(pResKey, pDelWins, index)) { taosArrayRemove(pDelWins, index); + delSize = taosArrayGetSize(pDelWins); } } } @@ -1423,7 +1424,7 @@ bool doDeleteIntervalWindow(SAggSupporter* pAggSup, TSKEY ts, uint64_t groupId) return true; } -void doDeleteSpecifyIntervalWindow(SAggSupporter* pAggSup, SSDataBlock* pBlock, SArray* pUpWins, SInterval* pInterval) { +void doDeleteSpecifyIntervalWindow(SAggSupporter* pAggSup, SSDataBlock* pBlock, SArray* pDelWins, SInterval* pInterval, SHashObj* pUpdatedMap) { SColumnInfoData* pStartCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); TSKEY* tsStarts = (TSKEY*)pStartCol->pData; SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); @@ -1433,9 +1434,12 @@ void doDeleteSpecifyIntervalWindow(SAggSupporter* pAggSup, SSDataBlock* pBlock, dumyInfo.cur.pageId = -1; STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, tsStarts[i], pInterval, TSDB_ORDER_ASC); doDeleteIntervalWindow(pAggSup, win.skey, groupIds[i]); - if (pUpWins) { - SWinKey winRes = {.ts = win.skey, .groupId = groupIds[i]}; - taosArrayPush(pUpWins, &winRes); + SWinKey winRes = {.ts = win.skey, .groupId = groupIds[i]}; + if (pDelWins) { + taosArrayPush(pDelWins, &winRes); + } + if (pUpdatedMap) { + taosHashRemove(pUpdatedMap, &winRes, sizeof(SWinKey)); } } } @@ -1446,19 +1450,14 @@ static void doClearWindows(SAggSupporter* pAggSup, SExprSupp* pSup1, SInterval* TSKEY* startTsCols = (TSKEY*)pStartTsCol->pData; SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); TSKEY* endTsCols = (TSKEY*)pEndTsCol->pData; - uint64_t* pGpDatas = NULL; - if (pBlock->info.type == STREAM_RETRIEVE) { - SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); - pGpDatas = (uint64_t*)pGpCol->pData; - } - int32_t step = 0; - int32_t startPos = 0; + SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t* pGpDatas = (uint64_t*)pGpCol->pData; for (int32_t i = 0; i < pBlock->info.rows; i++) { SResultRowInfo dumyInfo; dumyInfo.cur.pageId = -1; STimeWindow win = getActiveTimeWindow(NULL, &dumyInfo, startTsCols[i], pInterval, TSDB_ORDER_ASC); while (win.ekey <= endTsCols[i]) { - uint64_t winGpId = pGpDatas ? pGpDatas[startPos] : pBlock->info.groupId; + uint64_t winGpId = pGpDatas[i]; bool res = doClearWindow(pAggSup, pSup1, (char*)&win.skey, sizeof(TSKEY), winGpId, numOfOutput); if (pUpWins && res) { SWinKey winRes = {.ts = win.skey, .groupId = winGpId}; @@ -1571,13 +1570,10 @@ static void doBuildDeleteResult(SArray* pWins, int32_t* index, SSDataBlock* pBlo return; } blockDataEnsureCapacity(pBlock, size - *index); - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); - SColumnInfoData* pGroupCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); + uint64_t uid = 0; for (int32_t i = *index; i < size; i++) { SWinKey* pWin = taosArrayGet(pWins, i); - colDataAppend(pTsCol, pBlock->info.rows, (const char*)&pWin->ts, false); - colDataAppend(pGroupCol, pBlock->info.rows, (const char*)&pWin->groupId, false); - pBlock->info.rows++; + appendOneRow(pBlock, &pWin->ts, &pWin->ts, &uid, &pWin->groupId); (*index)++; } } @@ -1596,6 +1592,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { if (pOperator->status == OP_RES_TO_RETURN) { doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); if (pInfo->pDelRes->info.rows > 0) { + printDataBlock(pInfo->pDelRes, "single interval"); return pInfo->pDelRes; } @@ -1632,7 +1629,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { continue; } if (pBlock->info.type == STREAM_DELETE_DATA) { - doDeleteSpecifyIntervalWindow(&pInfo->aggSup, pBlock, pInfo->pDelWins, &pInfo->interval); + doDeleteSpecifyIntervalWindow(&pInfo->aggSup, pBlock, pInfo->pDelWins, &pInfo->interval, pUpdatedMap); continue; } else if (pBlock->info.type == STREAM_GET_ALL) { getAllIntervalWindow(pInfo->aggSup.pResultRowHashTable, pUpdatedMap); @@ -1707,6 +1704,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { taosHashCleanup(pUpdatedMap); doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); if (pInfo->pDelRes->info.rows > 0) { + printDataBlock(pInfo->pDelRes, "single interval"); return pInfo->pDelRes; } @@ -1828,14 +1826,16 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt return needed; } -void initIntervalDownStream(SOperatorInfo* downstream, uint16_t type, SAggSupporter* pSup) { +void initIntervalDownStream(SOperatorInfo* downstream, uint16_t type, SAggSupporter* pSup, SInterval* pInterval, int64_t waterMark) { if (downstream->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { - // Todo(liuyao) support partition by column + initIntervalDownStream(downstream->pDownstream[0], type, pSup, pInterval, waterMark); return; } SStreamScanInfo* pScanInfo = downstream->info; - pScanInfo->sessionSup.parentType = type; - pScanInfo->sessionSup.pIntervalAggSup = pSup; + pScanInfo->windowSup.parentType = type; + pScanInfo->windowSup.pIntervalAggSup = pSup; + pScanInfo->pUpdateInfo = updateInfoInitP(pInterval, waterMark); + pScanInfo->interval = *pInterval; } void initStreamFunciton(SqlFunctionCtx* pCtx, int32_t numOfExpr) { @@ -1921,7 +1921,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SExprInfo* destroyIntervalOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); if (nodeType(pPhyNode) == QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL) { - initIntervalDownStream(downstream, QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL, &pInfo->aggSup); + initIntervalDownStream(downstream, QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL, &pInfo->aggSup, &pInfo->interval, pInfo->twAggSup.waterMark); } code = appendDownstream(pOperator, &downstream, 1); @@ -2849,14 +2849,26 @@ _error: } void compactFunctions(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx, int32_t numOfOutput, - SExecTaskInfo* pTaskInfo) { + SExecTaskInfo* pTaskInfo, SColumnInfoData* pTimeWindowData) { for (int32_t k = 0; k < numOfOutput; ++k) { if (fmIsWindowPseudoColumnFunc(pDestCtx[k].functionId)) { - continue; - } - int32_t code = TSDB_CODE_SUCCESS; - if (functionNeedToExecute(&pDestCtx[k]) && pDestCtx[k].fpSet.combine != NULL) { - code = pDestCtx[k].fpSet.combine(&pDestCtx[k], &pSourceCtx[k]); + if (!pTimeWindowData) { + continue; + } + + SResultRowEntryInfo* pEntryInfo = GET_RES_INFO(&pDestCtx[k]); + char* p = GET_ROWCELL_INTERBUF(pEntryInfo); + SColumnInfoData idata = {0}; + idata.info.type = TSDB_DATA_TYPE_BIGINT; + idata.info.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; + idata.pData = p; + + SScalarParam out = {.columnData = &idata}; + SScalarParam tw = {.numOfRows = 5, .columnData = pTimeWindowData}; + pDestCtx[k].sfp.process(&tw, 1, &out); + pEntryInfo->numOfRes = 1; + }else if (functionNeedToExecute(&pDestCtx[k]) && pDestCtx[k].fpSet.combine != NULL) { + int32_t code = pDestCtx[k].fpSet.combine(&pDestCtx[k], &pSourceCtx[k]); if (code != TSDB_CODE_SUCCESS) { qError("%s apply functions error, code: %s", GET_TASKID(pTaskInfo), tstrerror(code)); pTaskInfo->code = code; @@ -2874,8 +2886,14 @@ bool hasIntervalWindow(SAggSupporter* pSup, TSKEY ts, uint64_t groupId) { return p1 != NULL; } +STimeWindow getFinalTimeWindow(int64_t ts, SInterval* pInterval) { + STimeWindow w = {.skey = ts, .ekey = INT64_MAX}; + w.ekey = taosTimeAdd(w.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1; + return w; +} + static void rebuildIntervalWindow(SStreamFinalIntervalOperatorInfo* pInfo, SExprSupp* pSup, SArray* pWinArray, - int32_t groupId, int32_t numOfOutput, SExecTaskInfo* pTaskInfo, SArray* pUpdated) { + int32_t groupId, int32_t numOfOutput, SExecTaskInfo* pTaskInfo, SHashObj* pUpdatedMap) { int32_t size = taosArrayGetSize(pWinArray); if (!pInfo->pChildren) { return; @@ -2883,11 +2901,14 @@ static void rebuildIntervalWindow(SStreamFinalIntervalOperatorInfo* pInfo, SExpr for (int32_t i = 0; i < size; i++) { SWinKey* pWinRes = taosArrayGet(pWinArray, i); SResultRow* pCurResult = NULL; - STimeWindow ParentWin = {.skey = pWinRes->ts, .ekey = pWinRes->ts + 1}; - setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &ParentWin, true, &pCurResult, pWinRes->groupId, pSup->pCtx, + STimeWindow parentWin = getFinalTimeWindow(pWinRes->ts, &pInfo->interval); + if (isDeletedWindow(&parentWin, pWinRes->groupId, &pInfo->aggSup) && isCloseWindow(&parentWin, &pInfo->twAggSup)) { + continue; + } + setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &parentWin, true, &pCurResult, pWinRes->groupId, pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo); int32_t numOfChildren = taosArrayGetSize(pInfo->pChildren); - bool find = true; + int32_t num = 0; for (int32_t j = 0; j < numOfChildren; j++) { SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, j); SIntervalAggOperatorInfo* pChInfo = pChildOp->info; @@ -2895,15 +2916,16 @@ static void rebuildIntervalWindow(SStreamFinalIntervalOperatorInfo* pInfo, SExpr if (!hasIntervalWindow(&pChInfo->aggSup, pWinRes->ts, pWinRes->groupId)) { continue; } - find = true; + num++; SResultRow* pChResult = NULL; - setTimeWindowOutputBuf(&pChInfo->binfo.resultRowInfo, &ParentWin, true, &pChResult, pWinRes->groupId, + setTimeWindowOutputBuf(&pChInfo->binfo.resultRowInfo, &parentWin, true, &pChResult, pWinRes->groupId, pChildSup->pCtx, pChildSup->numOfExprs, pChildSup->rowEntryInfoOffset, &pChInfo->aggSup, pTaskInfo); - compactFunctions(pSup->pCtx, pChildSup->pCtx, numOfOutput, pTaskInfo); + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &parentWin, true); + compactFunctions(pSup->pCtx, pChildSup->pCtx, numOfOutput, pTaskInfo, &pInfo->twAggSup.timeWindowData); } - if (find && pUpdated) { - saveResultRow(pCurResult, pWinRes->groupId, pUpdated); + if (num > 1 && pUpdatedMap) { + saveWinResultRow(pCurResult, pWinRes->groupId, pUpdatedMap); setResultBufPageDirty(pInfo->aggSup.pResultBuf, &pInfo->binfo.resultRowInfo.cur); } } @@ -2934,12 +2956,6 @@ void addPullWindow(SHashObj* pMap, SWinKey* pWinRes, int32_t size) { static int32_t getChildIndex(SSDataBlock* pBlock) { return pBlock->info.childId; } -STimeWindow getFinalTimeWindow(int64_t ts, SInterval* pInterval) { - STimeWindow w = {.skey = ts, .ekey = INT64_MAX}; - w.ekey = taosTimeAdd(w.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1; - return w; -} - static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBlock, uint64_t tableGroupId, SHashObj* pUpdatedMap) { SStreamFinalIntervalOperatorInfo* pInfo = (SStreamFinalIntervalOperatorInfo*)pOperatorInfo->info; @@ -3126,6 +3142,25 @@ void processPullOver(SSDataBlock* pBlock, SHashObj* pMap) { } } +static void addRetriveWindow(SArray* wins, SStreamFinalIntervalOperatorInfo* pInfo) { + int32_t size = taosArrayGetSize(wins); + for (int32_t i = 0; i < size; i++) { + SWinKey* winKey = taosArrayGet(wins, i); + STimeWindow nextWin = getFinalTimeWindow(winKey->ts, &pInfo->interval); + if (isCloseWindow(&nextWin, &pInfo->twAggSup) && !pInfo->ignoreExpiredData) { + void* chIds = taosHashGet(pInfo->pPullDataMap, winKey, sizeof(SWinKey)); + if (!chIds) { + SPullWindowInfo pull = {.window = nextWin, .groupId = winKey->groupId}; + // add pull data request + savePullWindow(&pull, pInfo->pPullWins); + int32_t size = taosArrayGetSize(pInfo->pChildren); + addPullWindow(pInfo->pPullDataMap, winKey, size); + qDebug("===stream===prepare retrive for delete %" PRId64 ", size:%d", winKey->ts, size); + } + } + } +} + static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { SStreamFinalIntervalOperatorInfo* pInfo = pOperator->info; @@ -3150,12 +3185,20 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { return pInfo->pPullDataRes; } + doBuildDeleteResult(pInfo->pDelWins, &pInfo->delIndex, pInfo->pDelRes); + if (pInfo->pDelRes->info.rows != 0) { + // process the rest of the data + printDataBlock(pInfo->pDelRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); + return pInfo->pDelRes; + } + doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); if (pInfo->binfo.pRes->info.rows == 0) { pOperator->status = OP_EXEC_DONE; if (!IS_FINAL_OP(pInfo)) { // semi interval operator clear disk buffer clearStreamIntervalOperator(pInfo); + qDebug("===stream===clear semi operator"); } else { freeAllPages(pInfo->pRecycledPages, pInfo->aggSup.pResultBuf); } @@ -3219,23 +3262,28 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } removeResults(pUpWins, pUpdatedMap); copyDataBlock(pInfo->pUpdateRes, pBlock); - // copyUpdateDataBlock(pInfo->pUpdateRes, pBlock, pInfo->primaryTsIndex); pInfo->returnUpdate = true; taosArrayDestroy(pUpWins); break; } else if (pBlock->info.type == STREAM_DELETE_DATA || pBlock->info.type == STREAM_DELETE_RESULT) { - doDeleteSpecifyIntervalWindow(&pInfo->aggSup, pBlock, pInfo->pDelWins, &pInfo->interval); + SArray* delWins = taosArrayInit(8, sizeof(SWinKey)); + doDeleteSpecifyIntervalWindow(&pInfo->aggSup, pBlock, delWins, &pInfo->interval, pUpdatedMap); if (IS_FINAL_OP(pInfo)) { int32_t childIndex = getChildIndex(pBlock); SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); SStreamFinalIntervalOperatorInfo* pChildInfo = pChildOp->info; SExprSupp* pChildSup = &pChildOp->exprSupp; - doDeleteSpecifyIntervalWindow(&pChildInfo->aggSup, pBlock, NULL, &pChildInfo->interval); - rebuildIntervalWindow(pInfo, pSup, pInfo->pDelWins, pInfo->binfo.pRes->info.groupId, - pOperator->exprSupp.numOfExprs, pOperator->pTaskInfo, pUpdated); + doDeleteSpecifyIntervalWindow(&pChildInfo->aggSup, pBlock, NULL, &pChildInfo->interval, NULL); + rebuildIntervalWindow(pInfo, pSup, delWins, pInfo->binfo.pRes->info.groupId, + pOperator->exprSupp.numOfExprs, pOperator->pTaskInfo, pUpdatedMap); + addRetriveWindow(delWins, pInfo); + taosArrayAddAll(pInfo->pDelWins, delWins); + taosArrayDestroy(delWins); continue; } - removeResults(pInfo->pDelWins, pUpdatedMap); + removeResults(delWins, pUpdatedMap); + taosArrayAddAll(pInfo->pDelWins, delWins); + taosArrayDestroy(delWins); break; } else if (pBlock->info.type == STREAM_GET_ALL && IS_FINAL_OP(pInfo)) { getAllIntervalWindow(pInfo->aggSup.pResultRowHashTable, pUpdatedMap); @@ -3309,6 +3357,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { return pInfo->pPullDataRes; } + // we should send result first. doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); if (pInfo->binfo.pRes->info.rows != 0) { printDataBlock(pInfo->binfo.pRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi"); @@ -3470,7 +3519,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, createOperatorFpSet(NULL, doStreamFinalIntervalAgg, NULL, NULL, destroyStreamFinalIntervalOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); if (pPhyNode->type == QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL) { - initIntervalDownStream(downstream, pPhyNode->type, &pInfo->aggSup); + initIntervalDownStream(downstream, pPhyNode->type, &pInfo->aggSup, &pInfo->interval, pInfo->twAggSup.waterMark); } code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { @@ -3567,10 +3616,18 @@ void initDummyFunction(SqlFunctionCtx* pDummy, SqlFunctionCtx* pCtx, int32_t num } void initDownStream(SOperatorInfo* downstream, SStreamAggSupporter* pAggSup, int64_t gap, int64_t waterMark, - uint16_t type) { - ASSERT(downstream->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN); + uint16_t type, int32_t tsColIndex) { + if (downstream->operatorType == QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION) { + SStreamPartitionOperatorInfo* pScanInfo = downstream->info; + pScanInfo->tsColIndex = tsColIndex; + } + + if (downstream->operatorType != QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN) { + initDownStream(downstream->pDownstream[0], pAggSup, gap, waterMark, type, tsColIndex); + return; + } SStreamScanInfo* pScanInfo = downstream->info; - pScanInfo->sessionSup = (SessionWindowSupporter){.pStreamAggSup = pAggSup, .gap = gap, .parentType = type}; + pScanInfo->windowSup = (SWindowSupporter){.pStreamAggSup = pAggSup, .gap = gap, .parentType = type}; pScanInfo->pUpdateInfo = updateInfoInit(60000, TSDB_TIME_PRECISION_MILLI, waterMark); } @@ -3642,7 +3699,6 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh pInfo->isFinal = false; pInfo->pPhyNode = pPhyNode; pInfo->ignoreExpiredData = pSessionNode->window.igExpired; - pInfo->returnDelete = false; pOperator->name = "StreamSessionWindowAggOperator"; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION; @@ -3653,7 +3709,7 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh createOperatorFpSet(operatorDummyOpenFn, doStreamSessionAgg, NULL, NULL, destroyStreamSessionAggOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); if (downstream) { - initDownStream(downstream, &pInfo->streamAggSup, pInfo->gap, pInfo->twAggSup.waterMark, pOperator->operatorType); + initDownStream(downstream, &pInfo->streamAggSup, pInfo->gap, pInfo->twAggSup.waterMark, pOperator->operatorType, pInfo->primaryTsIndex); code = appendDownstream(pOperator, &downstream, 1); } return pOperator; @@ -3683,13 +3739,13 @@ bool isInTimeWindow(STimeWindow* pWin, TSKEY ts, int64_t gap) { bool isInWindow(SResultWindowInfo* pWinInfo, TSKEY ts, int64_t gap) { return isInTimeWindow(&pWinInfo->win, ts, gap); } -static SResultWindowInfo* insertNewSessionWindow(SArray* pWinInfos, TSKEY ts, int32_t index) { - SResultWindowInfo win = {.pos.offset = -1, .pos.pageId = -1, .win.skey = ts, .win.ekey = ts, .isOutput = false}; +static SResultWindowInfo* insertNewSessionWindow(SArray* pWinInfos, TSKEY startTs, TSKEY endTs, int32_t index) { + SResultWindowInfo win = {.pos.offset = -1, .pos.pageId = -1, .win.skey = startTs, .win.ekey = endTs, .isOutput = false}; return taosArrayInsert(pWinInfos, index, &win); } -static SResultWindowInfo* addNewSessionWindow(SArray* pWinInfos, TSKEY ts) { - SResultWindowInfo win = {.pos.offset = -1, .pos.pageId = -1, .win.skey = ts, .win.ekey = ts, .isOutput = false}; +static SResultWindowInfo* addNewSessionWindow(SArray* pWinInfos, TSKEY startTs, TSKEY endTs) { + SResultWindowInfo win = {.pos.offset = -1, .pos.pageId = -1, .win.skey = startTs, .win.ekey = endTs, .isOutput = false}; return taosArrayPush(pWinInfos, &win); } @@ -3748,7 +3804,7 @@ SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY star int32_t size = taosArrayGetSize(pWinInfos); if (size == 0) { *pIndex = 0; - return addNewSessionWindow(pWinInfos, startTs); + return addNewSessionWindow(pWinInfos, startTs, endTs); } // find the first position which is smaller than the key int32_t index = binarySearch(pWinInfos, size, startTs, TSDB_ORDER_DESC, getSessionWindowEndkey); @@ -3774,10 +3830,10 @@ SResultWindowInfo* getSessionTimeWindow(SStreamAggSupporter* pAggSup, TSKEY star if (index == size - 1) { *pIndex = taosArrayGetSize(pWinInfos); - return addNewSessionWindow(pWinInfos, startTs); + return addNewSessionWindow(pWinInfos, startTs, endTs); } *pIndex = index + 1; - return insertNewSessionWindow(pWinInfos, startTs, index + 1); + return insertNewSessionWindow(pWinInfos, startTs, endTs, index + 1); } int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t groupId, @@ -3789,7 +3845,7 @@ int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TS if (pWinInfo->win.skey > pStartTs[i]) { if (pStDeleted && pWinInfo->isOutput) { SWinKey res = {.ts = pWinInfo->win.skey, .groupId = groupId}; - taosHashPut(pStDeleted, &pWinInfo->pos, sizeof(SResultRowPosition), &res, sizeof(SWinKey)); + taosHashPut(pStDeleted, &res, sizeof(SWinKey), &res, sizeof(SWinKey)); pWinInfo->isOutput = false; } pWinInfo->win.skey = pStartTs[i]; @@ -3817,7 +3873,6 @@ static int32_t setWindowOutputBuf(SResultWindowInfo* pWinInfo, SResultRow** pRes if (*pResult == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } - initResultRow(*pResult); // add a new result set for a new group pWinInfo->pos.pageId = (*pResult)->pageId; @@ -3904,11 +3959,12 @@ void compactTimeWindow(SStreamSessionAggOperatorInfo* pInfo, int32_t startIndex, setWindowOutputBuf(pWinInfo, &pWinResult, pInfo->pDummyCtx, groupId, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->streamAggSup, pTaskInfo); pCurWin->win.ekey = TMAX(pCurWin->win.ekey, pWinInfo->win.ekey); - compactFunctions(pSup->pCtx, pInfo->pDummyCtx, numOfOutput, pTaskInfo); + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pCurWin->win, true); + compactFunctions(pSup->pCtx, pInfo->pDummyCtx, numOfOutput, pTaskInfo, &pInfo->twAggSup.timeWindowData); taosHashRemove(pStUpdated, &pWinInfo->pos, sizeof(SResultRowPosition)); if (pWinInfo->isOutput) { SWinKey res = {.ts = pWinInfo->win.skey, .groupId = groupId}; - taosHashPut(pStDeleted, &pWinInfo->pos, sizeof(SResultRowPosition), &res, sizeof(SWinKey)); + taosHashPut(pStDeleted, &res, sizeof(SWinKey), &res, sizeof(SWinKey)); pWinInfo->isOutput = false; } taosArrayRemove(pInfo->streamAggSup.pCurWins, i); @@ -4005,10 +4061,11 @@ static void doDeleteTimeWindows(SStreamAggSupporter* pAggSup, SSDataBlock* pBloc if (!pCurWin) { break; } + SResultWindowInfo delWin = *pCurWin; deleteWindow(pAggSup->pCurWins, winIndex, fp); if (result) { - pCurWin->groupId = gpDatas[i]; - taosArrayPush(result, pCurWin); + delWin.groupId = gpDatas[i]; + taosArrayPush(result, &delWin); } } } @@ -4033,6 +4090,7 @@ static void doClearSessionWindows(SStreamAggSupporter* pAggSup, SExprSupp* pSup, ASSERT(isInWindow(pCurWin, tsCols[i], gap)); doClearWindowImpl(&pCurWin->pos, pAggSup->pResultBuf, pSup, numOfOutput); if (result) { + pCurWin->groupId = gpCols[i]; taosArrayPush(result, pCurWin); } } @@ -4067,10 +4125,18 @@ void doBuildDeleteDataBlock(SHashObj* pStDeleted, SSDataBlock* pBlock, void** It size_t keyLen = 0; while (((*Ite) = taosHashIterate(pStDeleted, *Ite)) != NULL) { SWinKey* res = *Ite; - SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); - colDataAppend(pTsCol, pBlock->info.rows, (const char*)&res->ts, false); + SColumnInfoData* pStartTsCol = taosArrayGet(pBlock->pDataBlock, START_TS_COLUMN_INDEX); + colDataAppend(pStartTsCol, pBlock->info.rows, (const char*)&res->ts, false); + SColumnInfoData* pEndTsCol = taosArrayGet(pBlock->pDataBlock, END_TS_COLUMN_INDEX); + colDataAppend(pEndTsCol, pBlock->info.rows, (const char*)&res->ts, false); + SColumnInfoData* pUidCol = taosArrayGet(pBlock->pDataBlock, UID_COLUMN_INDEX); + colDataAppendNULL(pUidCol, pBlock->info.rows); SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); colDataAppend(pGpCol, pBlock->info.rows, (const char*)&res->groupId, false); + SColumnInfoData* pCalStCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); + colDataAppendNULL(pCalStCol, pBlock->info.rows); + SColumnInfoData* pCalEdCol = taosArrayGet(pBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); + colDataAppendNULL(pCalEdCol, pBlock->info.rows); pBlock->info.rows += 1; if (pBlock->info.rows + 1 >= pBlock->info.capacity) { break; @@ -4081,8 +4147,8 @@ void doBuildDeleteDataBlock(SHashObj* pStDeleted, SSDataBlock* pBlock, void** It } } -static void rebuildTimeWindow(SStreamSessionAggOperatorInfo* pInfo, SArray* pWinArray, int32_t groupId, - int32_t numOfOutput, SOperatorInfo* pOperator) { +static void rebuildTimeWindow(SStreamSessionAggOperatorInfo* pInfo, SArray* pWinArray, + int32_t numOfOutput, SOperatorInfo* pOperator, SHashObj* pStUpdated, bool needCreate) { SExprSupp* pSup = &pOperator->exprSupp; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -4092,9 +4158,15 @@ static void rebuildTimeWindow(SStreamSessionAggOperatorInfo* pInfo, SArray* pWin for (int32_t i = 0; i < size; i++) { SResultWindowInfo* pParentWin = taosArrayGet(pWinArray, i); SResultRow* pCurResult = NULL; + uint64_t groupId = pParentWin->groupId; + int32_t winIndex = 0; + if (needCreate) { + pParentWin = getSessionTimeWindow(&pInfo->streamAggSup, pParentWin->win.skey, pParentWin->win.ekey, groupId, 0, &winIndex); + } setWindowOutputBuf(pParentWin, &pCurResult, pSup->pCtx, groupId, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->streamAggSup, pTaskInfo); int32_t numOfChildren = taosArrayGetSize(pInfo->pChildren); + int32_t num = 0; for (int32_t j = 0; j < numOfChildren; j++) { SOperatorInfo* pChild = taosArrayGetP(pInfo->pChildren, j); SStreamSessionAggOperatorInfo* pChInfo = pChild->info; @@ -4110,15 +4182,24 @@ static void rebuildTimeWindow(SStreamSessionAggOperatorInfo* pInfo, SArray* pWin SResultRow* pChResult = NULL; setWindowOutputBuf(pChWin, &pChResult, pChild->exprSupp.pCtx, groupId, numOfOutput, pChild->exprSupp.rowEntryInfoOffset, &pChInfo->streamAggSup, pTaskInfo); - compactFunctions(pSup->pCtx, pChild->exprSupp.pCtx, numOfOutput, pTaskInfo); + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pChWin->win, true); + compactFunctions(pSup->pCtx, pChild->exprSupp.pCtx, numOfOutput, pTaskInfo, &pInfo->twAggSup.timeWindowData); SFilePage* bufPage = getBufPage(pChInfo->streamAggSup.pResultBuf, pChWin->pos.pageId); releaseBufPage(pChInfo->streamAggSup.pResultBuf, bufPage); + num++; continue; } else if (!pChWin->isClosed) { break; } } } + if (num == 0 && needCreate) { + deleteWindow(pInfo->streamAggSup.pCurWins, winIndex, NULL); + } + if (pStUpdated && num > 0) { + SWinKey value = {.ts = pParentWin->win.skey, .groupId = groupId}; + taosHashPut(pStUpdated, &pParentWin->pos, sizeof(SResultRowPosition), &value, sizeof(SWinKey)); + } SFilePage* bufPage = getBufPage(pInfo->streamAggSup.pResultBuf, pParentWin->pos.pageId); ASSERT(size > 0); setBufPageDirty(bufPage, true); @@ -4198,7 +4279,46 @@ static void copyDeleteWindowInfo(SArray* pResWins, SHashObj* pStDeleted) { for (int32_t i = 0; i < size; i++) { SResultWindowInfo* pWinInfo = taosArrayGet(pResWins, i); SWinKey res = {.ts = pWinInfo->win.skey, .groupId = pWinInfo->groupId}; - taosHashPut(pStDeleted, &pWinInfo->pos, sizeof(SResultRowPosition), &res, sizeof(SWinKey)); + taosHashPut(pStDeleted, &res, sizeof(SWinKey), &res, sizeof(SWinKey)); + } +} + +static void removeSessionResults(SHashObj* pHashMap, SArray* pWins) { + int32_t size = taosArrayGetSize(pWins); + for (int32_t i = 0; i < size; i++) { + SResultWindowInfo* pWin = taosArrayGet(pWins, i); + taosHashRemove(pHashMap, &pWin->pos, sizeof(SResultRowPosition)); + } +} + +int32_t compareWinKey(void* pKey, void* data, int32_t index) { + SArray* res = (SArray*)data; + SResKeyPos* pos = taosArrayGetP(res, index); + SWinKey* pData = (SWinKey*)pKey; + if (pData->ts == *(int64_t*)pos->key) { + if (pData->groupId > pos->groupId) { + return 1; + } else if (pData->groupId < pos->groupId) { + return -1; + } + return 0; + } else if (pData->ts > *(int64_t*)pos->key) { + return 1; + } + return -1; +} + +static void removeSessionDeleteResults(SArray* update, SHashObj* pStDeleted) { + int32_t size = taosHashGetSize(pStDeleted); + if (size == 0) { + return; + } + + int32_t num = taosArrayGetSize(update); + for (int32_t i = 0; i < num; i++) { + SResKeyPos* pos = taosArrayGetP(update, i); + SWinKey winKey = {.ts = *(int64_t*)pos->key, .groupId = pos->groupId}; + taosHashRemove(pStDeleted, &winKey, sizeof(SWinKey)); } } @@ -4226,7 +4346,7 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); SHashObj* pStUpdated = taosHashInit(64, hashFn, true, HASH_NO_LOCK); SOperatorInfo* downstream = pOperator->pDownstream[0]; - SArray* pUpdated = taosArrayInit(16, POINTER_BYTES); + SArray* pUpdated = taosArrayInit(16, POINTER_BYTES); // SResKeyPos while (1) { SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); if (pBlock == NULL) { @@ -4242,9 +4362,9 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { int32_t childIndex = getChildIndex(pBlock); SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); SStreamSessionAggOperatorInfo* pChildInfo = pChildOp->info; - doClearSessionWindows(&pChildInfo->streamAggSup, &pChildOp->exprSupp, pBlock, START_TS_COLUMN_INDEX, - pChildOp->exprSupp.numOfExprs, 0, NULL); - rebuildTimeWindow(pInfo, pWins, pBlock->info.groupId, pOperator->exprSupp.numOfExprs, pOperator); + doClearSessionWindows(&pChildInfo->streamAggSup, &pChildOp->exprSupp, pBlock, START_TS_COLUMN_INDEX, pChildOp->exprSupp.numOfExprs, + 0, NULL); + rebuildTimeWindow(pInfo, pWins, pOperator->exprSupp.numOfExprs, pOperator, NULL, false); } taosArrayDestroy(pWins); continue; @@ -4258,9 +4378,10 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { SStreamSessionAggOperatorInfo* pChildInfo = pChildOp->info; // gap must be 0 doDeleteTimeWindows(&pChildInfo->streamAggSup, pBlock, 0, NULL, NULL); - rebuildTimeWindow(pInfo, pWins, pBlock->info.groupId, pOperator->exprSupp.numOfExprs, pOperator); + rebuildTimeWindow(pInfo, pWins, pOperator->exprSupp.numOfExprs, pOperator, pStUpdated, true); } copyDeleteWindowInfo(pWins, pInfo->pStDeleted); + removeSessionResults(pStUpdated, pWins); taosArrayDestroy(pWins); continue; } else if (pBlock->info.type == STREAM_GET_ALL) { @@ -4303,6 +4424,7 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { pInfo->ignoreExpiredData, NULL); closeChildSessionWindow(pInfo->pChildren, pInfo->twAggSup.maxTs, pInfo->ignoreExpiredData, NULL); copyUpdateResult(pStUpdated, pUpdated); + removeSessionDeleteResults(pUpdated, pInfo->pStDeleted); taosHashCleanup(pStUpdated); finalizeUpdatedResult(pSup->numOfExprs, pInfo->streamAggSup.pResultBuf, pUpdated, pSup->rowEntryInfoOffset); @@ -4333,14 +4455,6 @@ static void clearStreamSessionOperator(SStreamSessionAggOperatorInfo* pInfo) { pInfo->streamAggSup.currentPageId = -1; } -static void removeSessionResults(SHashObj* pHashMap, SArray* pWins) { - int32_t size = taosArrayGetSize(pWins); - for (int32_t i = 0; i < size; i++) { - SResultWindowInfo* pWin = taosArrayGet(pWins, i); - taosHashRemove(pHashMap, &pWin->pos, sizeof(SResultRowPosition)); - } -} - static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { SStreamSessionAggOperatorInfo* pInfo = pOperator->info; SOptrBasicInfo* pBInfo = &pInfo->binfo; @@ -4349,30 +4463,34 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { if (pOperator->status == OP_EXEC_DONE) { return NULL; - } else if (pOperator->status == OP_RES_TO_RETURN) { + } + + { doBuildResultDatablock(pOperator, pBInfo, &pInfo->groupResInfo, pInfo->streamAggSup.pResultBuf); if (pBInfo->pRes->info.rows > 0) { printDataBlock(pBInfo->pRes, "semi session"); return pBInfo->pRes; } - // doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); - if (pInfo->pDelRes->info.rows > 0 && !pInfo->returnDelete) { - pInfo->returnDelete = true; + doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); + if (pInfo->pDelRes->info.rows > 0) { printDataBlock(pInfo->pDelRes, "semi session"); return pInfo->pDelRes; } - if (pInfo->pUpdateRes->info.rows > 0) { + if (pInfo->pUpdateRes->info.rows > 0 && pInfo->returnUpdate) { + pInfo->returnUpdate = false; // process the rest of the data - pOperator->status = OP_OPENED; printDataBlock(pInfo->pUpdateRes, "semi session"); return pInfo->pUpdateRes; } - // semi interval operator clear disk buffer - clearStreamSessionOperator(pInfo); - pOperator->status = OP_EXEC_DONE; - return NULL; + + if (pOperator->status == OP_RES_TO_RETURN) { + // semi interval operator clear disk buffer + clearStreamSessionOperator(pInfo); + pOperator->status = OP_EXEC_DONE; + return NULL; + } } _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); @@ -4383,6 +4501,7 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); if (pBlock == NULL) { clearSpecialDataBlock(pInfo->pUpdateRes); + pOperator->status = OP_RES_TO_RETURN; break; } printDataBlock(pBlock, "semi session recv"); @@ -4393,12 +4512,15 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { removeSessionResults(pStUpdated, pWins); taosArrayDestroy(pWins); copyDataBlock(pInfo->pUpdateRes, pBlock); + pInfo->returnUpdate = true; break; } else if (pBlock->info.type == STREAM_DELETE_DATA || pBlock->info.type == STREAM_DELETE_RESULT) { // gap must be 0 - doDeleteTimeWindows(&pInfo->streamAggSup, pBlock, 0, NULL, NULL); - copyDataBlock(pInfo->pDelRes, pBlock); - pInfo->pDelRes->info.type = STREAM_DELETE_RESULT; + SArray* pWins = taosArrayInit(16, sizeof(SResultWindowInfo)); + doDeleteTimeWindows(&pInfo->streamAggSup, pBlock, 0, pWins, NULL); + copyDeleteWindowInfo(pWins, pInfo->pStDeleted); + removeSessionResults(pStUpdated, pWins); + taosArrayDestroy(pWins); break; } else if (pBlock->info.type == STREAM_GET_ALL) { getAllSessionWindow(pInfo->streamAggSup.pResultRows, pUpdated, getResWinForSession); @@ -4411,18 +4533,15 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { } // the pDataBlock are always the same one, no need to call this again setInputDataBlock(pOperator, pSup->pCtx, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); - doStreamSessionAggImpl(pOperator, pBlock, pStUpdated, pInfo->pStDeleted, false); + doStreamSessionAggImpl(pOperator, pBlock, pStUpdated, NULL, false); maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.window.ekey); } pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); pBInfo->pRes->info.watermark = pInfo->twAggSup.maxTs; - // restore the value - pOperator->status = OP_RES_TO_RETURN; - // semi operator - // closeSessionWindow(pInfo->streamAggSup.pResultRows, &pInfo->twAggSup, pUpdated, - // getResWinForSession); + copyUpdateResult(pStUpdated, pUpdated); + removeSessionDeleteResults(pUpdated, pInfo->pStDeleted); taosHashCleanup(pStUpdated); finalizeUpdatedResult(pOperator->exprSupp.numOfExprs, pInfo->streamAggSup.pResultBuf, pUpdated, @@ -4436,16 +4555,15 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { return pBInfo->pRes; } - // doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); - if (pInfo->pDelRes->info.rows > 0 && !pInfo->returnDelete) { - pInfo->returnDelete = true; + doBuildDeleteDataBlock(pInfo->pStDeleted, pInfo->pDelRes, &pInfo->pDelIterator); + if (pInfo->pDelRes->info.rows > 0) { printDataBlock(pInfo->pDelRes, "semi session"); return pInfo->pDelRes; } - if (pInfo->pUpdateRes->info.rows > 0) { + if (pInfo->pUpdateRes->info.rows > 0 && pInfo->returnUpdate) { + pInfo->returnUpdate = false; // process the rest of the data - pOperator->status = OP_OPENED; printDataBlock(pInfo->pUpdateRes, "semi session"); return pInfo->pUpdateRes; } @@ -4669,7 +4787,7 @@ int32_t updateStateWindowInfo(SArray* pWinInfos, int32_t winIndex, TSKEY* pTs, u if (pWinInfo->winInfo.win.skey > pTs[i]) { if (pSeDeleted && pWinInfo->winInfo.isOutput) { SWinKey res = {.ts = pWinInfo->winInfo.win.skey, .groupId = groupId}; - taosHashPut(pSeDeleted, &pWinInfo->winInfo.pos, sizeof(SResultRowPosition), &res, sizeof(SWinKey)); + taosHashPut(pSeDeleted, &res, sizeof(SWinKey), &res, sizeof(SWinKey)); pWinInfo->winInfo.isOutput = false; } pWinInfo->winInfo.win.skey = pTs[i]; @@ -4737,8 +4855,9 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl winRows = updateStateWindowInfo(pAggSup->pCurWins, winIndex, tsCols, groupId, pKeyColInfo, pSDataBlock->info.rows, i, &allEqual, pStDeleted); if (!allEqual) { - appendOneRow(pAggSup->pScanBlock, &pCurWin->winInfo.win.skey, &pCurWin->winInfo.win.ekey, GROUPID_COLUMN_INDEX, - &groupId); + uint64_t uid = 0; + appendOneRow(pAggSup->pScanBlock, &pCurWin->winInfo.win.skey, &pCurWin->winInfo.win.ekey, + &uid, &groupId); taosHashRemove(pSeUpdated, &pCurWin->winInfo.pos, sizeof(SResultRowPosition)); deleteWindow(pAggSup->pCurWins, winIndex, destroyStateWinInfo); continue; @@ -4767,6 +4886,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { SExprSupp* pSup = &pOperator->exprSupp; SStreamStateAggOperatorInfo* pInfo = pOperator->info; SOptrBasicInfo* pBInfo = &pInfo->binfo; + int64_t maxTs = INT64_MIN; if (pOperator->status == OP_RES_TO_RETURN) { doBuildDeleteDataBlock(pInfo->pSeDeleted, pInfo->pDelRes, &pInfo->pDelIterator); if (pInfo->pDelRes->info.rows > 0) { @@ -4799,6 +4919,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { SArray* pWins = taosArrayInit(16, sizeof(SResultWindowInfo)); doDeleteTimeWindows(&pInfo->streamAggSup, pBlock, 0, pWins, destroyStateWinInfo); copyDeleteWindowInfo(pWins, pInfo->pSeDeleted); + removeSessionResults(pSeUpdated, pWins); taosArrayDestroy(pWins); continue; } else if (pBlock->info.type == STREAM_GET_ALL) { @@ -4813,8 +4934,9 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { // the pDataBlock are always the same one, no need to call this again setInputDataBlock(pOperator, pSup->pCtx, pBlock, TSDB_ORDER_ASC, MAIN_SCAN, true); doStreamStateAggImpl(pOperator, pBlock, pSeUpdated, pInfo->pSeDeleted); - pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, pBlock->info.window.ekey); + maxTs = TMAX(maxTs, pBlock->info.window.ekey); } + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); // restore the value pOperator->status = OP_RES_TO_RETURN; @@ -4913,7 +5035,7 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys pOperator->info = pInfo; pOperator->fpSet = createOperatorFpSet(operatorDummyOpenFn, doStreamStateAgg, NULL, NULL, destroyStreamStateOperatorInfo, aggEncodeResultRow, aggDecodeResultRow, NULL); - initDownStream(downstream, &pInfo->streamAggSup, 0, pInfo->twAggSup.waterMark, pOperator->operatorType); + initDownStream(downstream, &pInfo->streamAggSup, 0, pInfo->twAggSup.waterMark, pOperator->operatorType, pInfo->primaryTsIndex); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { goto _error; diff --git a/source/libs/index/inc/indexInt.h b/source/libs/index/inc/indexInt.h index 065f4acb57..9605528ad6 100644 --- a/source/libs/index/inc/indexInt.h +++ b/source/libs/index/inc/indexInt.h @@ -40,26 +40,31 @@ extern "C" { #define indexTrace(...) do { if (idxDebugFlag & DEBUG_TRACE) { taosPrintLog("IDX", DEBUG_TRACE, idxDebugFlag, __VA_ARGS__);} } while (0) // clang-format on +extern void* indexQhandle; + typedef enum { LT, LE, GT, GE, CONTAINS, EQ } RangeType; typedef enum { kTypeValue, kTypeDeletion } STermValueType; typedef enum { kRebuild, kFinished } SIdxStatus; typedef struct SIndexStat { - int32_t totalAdded; // - int32_t totalDeled; // - int32_t totalUpdated; // - int32_t totalTerms; // - int32_t distinctCol; // distinct column + int32_t total; + int32_t add; // + int32_t del; // + int32_t update; // + int32_t terms; // + int32_t distCol; // distinct column } SIndexStat; struct SIndex { + SIndexOpts opts; + int64_t refId; void* cache; void* tindex; SHashObj* colObj; // < field name, field id> - int64_t suid; // current super table id, -1 is normal table - int32_t cVersion; // current version allocated to cache + int64_t suid; // current super table id, -1 is normal table + int32_t version; // current version allocated to cache SLRUCache* lru; char* path; @@ -68,7 +73,6 @@ struct SIndex { TdThreadMutex mtx; tsem_t sem; bool quit; - SIndexOpts opts; }; struct SIndexMultiTermQuery { @@ -111,14 +115,15 @@ typedef struct Iterate { void iterateValueDestroy(IterateValue* iv, bool destroy); -extern void* indexQhandle; - typedef struct TFileCacheKey { uint64_t suid; uint8_t colType; char* colName; int32_t nColName; } ICacheKey; + +int32_t idxSerialCacheKey(ICacheKey* key, char* buf); + int idxFlushCacheToTFile(SIndex* sIdx, void*, bool quit); int64_t idxAddRef(void* p); @@ -126,10 +131,6 @@ int32_t idxRemoveRef(int64_t ref); void idxAcquireRef(int64_t ref); void idxReleaseRef(int64_t ref); -int32_t idxSerialCacheKey(ICacheKey* key, char* buf); -// int32_t indexSerialKey(ICacheKey* key, char* buf); -// int32_t indexSerialTermKey(SIndexTerm* itm, char* buf); - #define IDX_TYPE_CONTAIN_EXTERN_TYPE(ty, exTy) (((ty >> 4) & (exTy)) != 0) #define IDX_TYPE_GET_TYPE(ty) (ty & 0x0F) diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c index be64a8b44d..d9a6b80f3d 100644 --- a/source/libs/index/src/index.c +++ b/source/libs/index/src/index.c @@ -25,10 +25,6 @@ #include "tref.h" #include "tsched.h" -#ifdef USE_LUCENE -#include "lucene++/Lucene_c.h" -#endif - #define INDEX_NUM_OF_THREADS 5 #define INDEX_QUEUE_SIZE 200 @@ -74,7 +70,7 @@ void indexCleanup() { typedef struct SIdxColInfo { int colId; // generated by index internal - int cVersion; + int version; } SIdxColInfo; static TdThreadOnce isInit = PTHREAD_ONCE_INIT; @@ -123,7 +119,7 @@ int indexOpen(SIndexOpts* opts, const char* path, SIndex** index) { } idx->colObj = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK); - idx->cVersion = 1; + idx->version = 1; idx->path = tstrdup(path); taosThreadMutexInit(&idx->mtx, NULL); tsem_init(&idx->sem, 0, 0); diff --git a/source/libs/index/src/indexCache.c b/source/libs/index/src/indexCache.c index 794b85d244..7e867db755 100644 --- a/source/libs/index/src/indexCache.c +++ b/source/libs/index/src/indexCache.c @@ -566,7 +566,6 @@ int idxCachePut(void* cache, SIndexTerm* term, uint64_t uid) { taosThreadMutexUnlock(&pCache->mtx); idxCacheUnRef(pCache); return 0; - // encode end } void idxCacheForceToMerge(void* cache) { IndexCache* pCache = cache; @@ -602,10 +601,10 @@ static int32_t idxQueryMem(MemTable* mem, SIndexTermQuery* query, SIdxTRslt* tr, } } int idxCacheSearch(void* cache, SIndexTermQuery* query, SIdxTRslt* result, STermValueType* s) { - int64_t st = taosGetTimestampUs(); if (cache == NULL) { return 0; } + IndexCache* pCache = cache; MemTable *mem = NULL, *imm = NULL; @@ -616,6 +615,8 @@ int idxCacheSearch(void* cache, SIndexTermQuery* query, SIdxTRslt* result, STerm idxMemRef(imm); taosThreadMutexUnlock(&pCache->mtx); + int64_t st = taosGetTimestampUs(); + int ret = (mem && mem->mem) ? idxQueryMem(mem, query, result, s) : 0; if (ret == 0 && *s != kTypeDeletion) { // continue search in imm diff --git a/source/libs/index/src/indexComm.c b/source/libs/index/src/indexComm.c index cd52d122f7..691eb6771c 100644 --- a/source/libs/index/src/indexComm.c +++ b/source/libs/index/src/indexComm.c @@ -178,9 +178,9 @@ TExeCond tDoCompare(__compar_fn_t func, int8_t comparType, void* a, void* b) { // optime later int32_t ret = func(a, b); switch (comparType) { - case QUERY_LESS_THAN: { + case QUERY_LESS_THAN: if (ret < 0) return MATCH; - } break; + break; case QUERY_LESS_EQUAL: { if (ret <= 0) return MATCH; break; diff --git a/source/libs/index/src/indexFilter.c b/source/libs/index/src/indexFilter.c index 75844ce76f..e7f221de3d 100644 --- a/source/libs/index/src/indexFilter.c +++ b/source/libs/index/src/indexFilter.c @@ -27,6 +27,44 @@ #define SIF_RET(c) do { int32_t _code = c; if (_code != TSDB_CODE_SUCCESS) { terrno = _code; } return _code; } while (0) #define SIF_ERR_JRET(c) do { code = c; if (code != TSDB_CODE_SUCCESS) { terrno = code; goto _return; } } while (0) // clang-format on + +typedef union { + uint8_t u8; + uint16_t u16; + uint32_t u32; + uint64_t u64; + + int8_t i8; + int16_t i16; + int32_t i32; + int64_t i64; + + double d; + float f; +} SDataTypeBuf; + +#define SIF_DATA_CONVERT(type, val, dst) \ + do { \ + if (type == TSDB_DATA_TYPE_DOUBLE) \ + dst = GET_DOUBLE_VAL(val); \ + else if (type == TSDB_DATA_TYPE_BIGINT) \ + dst = *(int64_t *)val; \ + else if (type == TSDB_DATA_TYPE_INT) \ + dst = *(int32_t *)val; \ + else if (type == TSDB_DATA_TYPE_SMALLINT) \ + dst = *(int16_t *)val; \ + else if (type == TSDB_DATA_TYPE_TINYINT) \ + dst = *(int8_t *)val; \ + else if (type == TSDB_DATA_TYPE_UTINYINT) \ + dst = *(uint8_t *)val; \ + else if (type == TSDB_DATA_TYPE_USMALLINT) \ + dst = *(uint16_t *)val; \ + else if (type == TSDB_DATA_TYPE_UINT) \ + dst = *(uint32_t *)val; \ + else if (type == TSDB_DATA_TYPE_UBIGINT) \ + dst = *(uint64_t *)val; \ + } while (0); + typedef struct SIFParam { SHashObj *pFilter; @@ -48,7 +86,6 @@ typedef struct SIFCtx { SHashObj *pRes; /* element is SIFParam */ bool noExec; // true: just iterate condition tree, and add hint to executor plan SIndexMetaArg arg; - // SIdxFltStatus st; } SIFCtx; static int32_t sifGetFuncFromSql(EOperatorType src, EIndexQueryType *dst) { @@ -75,11 +112,6 @@ static int32_t sifGetFuncFromSql(EOperatorType src, EIndexQueryType *dst) { typedef int32_t (*sif_func_t)(SIFParam *left, SIFParam *rigth, SIFParam *output); static sif_func_t sifNullFunc = NULL; -// typedef struct SIFWalkParm -// construct tag filter operator later -// static void destroyTagFilterOperatorInfo(void *param) { -// STagFilterOperatorInfo *pInfo = (STagFilterOperatorInfo *)param; -//} static void sifFreeParam(SIFParam *param) { if (param == NULL) return; @@ -365,42 +397,6 @@ static Filter sifGetFilterFunc(EIndexQueryType type, bool *reverse) { } return NULL; } -typedef union { - uint8_t u8; - uint16_t u16; - uint32_t u32; - uint64_t u64; - - int8_t i8; - int16_t i16; - int32_t i32; - int64_t i64; - - double d; - float f; -} SDataTypeBuf; - -#define SIF_DATA_CONVERT(type, val, dst) \ - do { \ - if (type == TSDB_DATA_TYPE_DOUBLE) \ - dst = GET_DOUBLE_VAL(val); \ - else if (type == TSDB_DATA_TYPE_BIGINT) \ - dst = *(int64_t *)val; \ - else if (type == TSDB_DATA_TYPE_INT) \ - dst = *(int32_t *)val; \ - else if (type == TSDB_DATA_TYPE_SMALLINT) \ - dst = *(int16_t *)val; \ - else if (type == TSDB_DATA_TYPE_TINYINT) \ - dst = *(int8_t *)val; \ - else if (type == TSDB_DATA_TYPE_UTINYINT) \ - dst = *(uint8_t *)val; \ - else if (type == TSDB_DATA_TYPE_USMALLINT) \ - dst = *(uint16_t *)val; \ - else if (type == TSDB_DATA_TYPE_UINT) \ - dst = *(uint32_t *)val; \ - else if (type == TSDB_DATA_TYPE_UBIGINT) \ - dst = *(uint64_t *)val; \ - } while (0); static void sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typedata, SMetaFltParam *param) { int8_t ltype = left->colValType, rtype = right->colValType; @@ -693,11 +689,8 @@ static int32_t sifExecLogic(SLogicConditionNode *node, SIFCtx *ctx, SIFParam *ou for (int32_t m = 0; m < node->pParameterList->length; m++) { if (node->condType == LOGIC_COND_TYPE_AND) { taosArrayAddAll(output->result, params[m].result); - // taosArrayDestroy(params[m].result); - // params[m].result = NULL; } else if (node->condType == LOGIC_COND_TYPE_OR) { taosArrayAddAll(output->result, params[m].result); - // params[m].result = NULL; } else if (node->condType == LOGIC_COND_TYPE_NOT) { // taosArrayAddAll(output->result, params[m].result); } diff --git a/source/libs/index/src/indexFstFile.c b/source/libs/index/src/indexFstFile.c index 1900e50973..e6d1edfeda 100644 --- a/source/libs/index/src/indexFstFile.c +++ b/source/libs/index/src/indexFstFile.c @@ -211,9 +211,7 @@ IdxFstFile* idxFileCreate(void* wrt) { return cw; } void idxFileDestroy(IdxFstFile* cw) { - // free wrt object: close fd or free mem idxFileFlush(cw); - // idxFileCtxDestroy((IFileCtx *)(cw->wrt)); taosMemoryFree(cw); } @@ -222,10 +220,8 @@ int idxFileWrite(IdxFstFile* write, uint8_t* buf, uint32_t len) { return 0; } // update checksum - // write data to file/socket or mem IFileCtx* ctx = write->wrt; - - int nWrite = ctx->write(ctx, buf, len); + int nWrite = ctx->write(ctx, buf, len); assert(nWrite == len); write->count += len; diff --git a/source/libs/index/src/indexTfile.c b/source/libs/index/src/indexTfile.c index 0a47fc0f16..48a0c631cf 100644 --- a/source/libs/index/src/indexTfile.c +++ b/source/libs/index/src/indexTfile.c @@ -183,13 +183,14 @@ TFileReader* tfileReaderCreate(IFileCtx* ctx) { return NULL; } reader->ctx = ctx; + reader->remove = false; if (0 != tfileReaderVerify(reader)) { indexError("invalid tfile, suid:%" PRIu64 ", colName:%s", reader->header.suid, reader->header.colName); tfileReaderDestroy(reader); return NULL; } - // T_REF_INC(reader); + if (0 != tfileReaderLoadHeader(reader)) { indexError("failed to load index header, suid:%" PRIu64 ", colName:%s", reader->header.suid, reader->header.colName); @@ -203,7 +204,6 @@ TFileReader* tfileReaderCreate(IFileCtx* ctx) { tfileReaderDestroy(reader); return NULL; } - reader->remove = false; return reader; } @@ -211,7 +211,6 @@ void tfileReaderDestroy(TFileReader* reader) { if (reader == NULL) { return; } - // T_REF_INC(reader); fstDestroy(reader->fst); if (reader->remove) { indexInfo("%s is removed", reader->ctx->file.buf); @@ -222,6 +221,7 @@ void tfileReaderDestroy(TFileReader* reader) { taosMemoryFree(reader); } + static int32_t tfSearchTerm(void* reader, SIndexTerm* tem, SIdxTRslt* tr) { int ret = 0; char* p = tem->colVal; @@ -494,7 +494,6 @@ int tfileReaderSearch(TFileReader* reader, SIndexTermQuery* query, SIdxTRslt* tr TFileWriter* tfileWriterOpen(char* path, uint64_t suid, int64_t version, const char* colName, uint8_t colType) { char fullname[256] = {0}; tfileGenFileFullName(fullname, path, suid, colName, version); - // indexInfo("open write file name %s", fullname); IFileCtx* wcx = idxFileCtxCreate(TFILE, fullname, false, 1024 * 1024 * 64); if (wcx == NULL) { return NULL; @@ -503,8 +502,8 @@ TFileWriter* tfileWriterOpen(char* path, uint64_t suid, int64_t version, const c TFileHeader tfh = {0}; tfh.suid = suid; tfh.version = version; - memcpy(tfh.colName, colName, strlen(colName)); tfh.colType = colType; + memcpy(tfh.colName, colName, strlen(colName)); return tfileWriterCreate(wcx, &tfh); } @@ -706,7 +705,6 @@ static bool tfileIteratorNext(Iterate* iiter) { iv->type = ADD_VALUE; // value in tfile always ADD_VALUE iv->colVal = colVal; return true; - // std::string key(ch, sz); } static IterateValue* tifileIterateGetValue(Iterate* iter) { return &iter->val; } diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 83bccbffb4..eb0b604d37 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -777,6 +777,7 @@ SNode* nodesCloneNode(const SNode* pNode) { code = physiSessionCopy((const SSessionWinodwPhysiNode*)pNode, (SSessionWinodwPhysiNode*)pDst); break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: code = physiPartitionCopy((const SPartitionPhysiNode*)pNode, (SPartitionPhysiNode*)pDst); break; default: diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 822bdec365..8976daadbd 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -265,6 +265,8 @@ const char* nodesNodeName(ENodeType type) { return "PhysiStreamStateWindow"; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return "PhysiPartition"; + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: + return "PhysiStreamPartition"; case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return "PhysiIndefRowsFunc"; case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: @@ -4485,6 +4487,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return physiStateWindowNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return physiIndefRowsFuncNodeToJson(pObj, pJson); @@ -4632,6 +4635,7 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return jsonToPhysiStateWindowNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return jsonToPhysiIndefRowsFuncNode(pJson, pObj); diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index 2e23998aad..728e173ff8 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -537,7 +537,8 @@ static EDealRes dispatchPhysiPlan(SNode* pNode, ETraversalOrder order, FNodeWalk } break; } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: { SPartitionPhysiNode* pPart = (SPartitionPhysiNode*)pNode; res = walkPhysiNode((SPhysiNode*)pNode, order, walker, pContext); if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index d13057a93e..61b2ad954f 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -322,6 +322,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SStreamStateWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return makeNode(type, sizeof(SPartitionPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: + return makeNode(type, sizeof(SStreamPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: return makeNode(type, sizeof(SIndefRowsFuncPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: @@ -951,7 +953,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pStateKey); break; } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: { SPartitionPhysiNode* pPhyNode = (SPartitionPhysiNode*)pNode; destroyPhysiNode((SPhysiNode*)pPhyNode); nodesDestroyList(pPhyNode->pExprs); diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 2a4f4c194d..eab2d40164 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -59,7 +59,8 @@ typedef enum EDatabaseOptionType { DB_OPTION_WAL_RETENTION_PERIOD, DB_OPTION_WAL_RETENTION_SIZE, DB_OPTION_WAL_ROLL_PERIOD, - DB_OPTION_WAL_SEGMENT_SIZE + DB_OPTION_WAL_SEGMENT_SIZE, + DB_OPTION_SST_TRIGGER } EDatabaseOptionType; typedef enum ETableOptionType { @@ -170,6 +171,7 @@ SNode* createShowCreateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable); SNode* createShowTableDistributedStmt(SAstCreateContext* pCxt, SNode* pRealTable); SNode* createShowDnodeVariablesStmt(SAstCreateContext* pCxt, SNode* pDnodeId); +SNode* createShowVnodesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pDnodeEndpoint); SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo); SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t alterType, const SToken* pVal); SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 9bff061d02..cfa3379e28 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -207,6 +207,7 @@ db_options(A) ::= db_options(B) WAL_RETENTION_SIZE NK_MINUS(D) NK_INTEGER(C). } db_options(A) ::= db_options(B) WAL_ROLL_PERIOD NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL_ROLL_PERIOD, &C); } db_options(A) ::= db_options(B) WAL_SEGMENT_SIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_WAL_SEGMENT_SIZE, &C); } +db_options(A) ::= db_options(B) SST_TRIGGER NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SST_TRIGGER, &C); } alter_db_options(A) ::= alter_db_option(B). { A = createAlterDatabaseOptions(pCxt); A = setAlterDatabaseOption(pCxt, A, &B); } alter_db_options(A) ::= alter_db_options(B) alter_db_option(C). { A = setAlterDatabaseOption(pCxt, B, &C); } @@ -223,6 +224,7 @@ alter_db_option(A) ::= KEEP variable_list(B). //alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } //alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } +alter_db_option(A) ::= SST_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_SST_TRIGGER; A.val = B; } %type integer_list { SNodeList* } %destructor integer_list { nodesDestroyList($$); } @@ -410,6 +412,8 @@ cmd ::= SHOW TABLE DISTRIBUTED full_table_name(A). cmd ::= SHOW CONSUMERS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } cmd ::= SHOW SUBSCRIPTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } cmd ::= SHOW TAGS FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, B, A, OP_TYPE_EQUAL); } +cmd ::= SHOW VNODES NK_INTEGER(A). { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &A), NULL); } +cmd ::= SHOW VNODES NK_STRING(A). { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &A)); } db_name_cond_opt(A) ::= . { A = createDefaultDatabaseCondValue(pCxt); } db_name_cond_opt(A) ::= db_name(B) NK_DOT. { A = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &B); } @@ -997,4 +1001,4 @@ null_ordering_opt(A) ::= NULLS LAST. %fallback ABORT AFTER ATTACH BEFORE BEGIN BITAND BITNOT BITOR BLOCKS CHANGE COMMA COMPACT CONCAT CONFLICT COPY DEFERRED DELIMITERS DETACH DIVIDE DOT EACH END FAIL FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT STRING - TIMES UPDATE VALUES VARIABLE VIEW VNODES WAL. + TIMES UPDATE VALUES VARIABLE VIEW WAL. diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 4d0b0bbb25..92c6058f07 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -795,6 +795,20 @@ SNode* createSetOperator(SAstCreateContext* pCxt, ESetOperatorType type, SNode* return (SNode*)setOp; } +static void updateWalOptionsDefault(SDatabaseOptions* pOptions) { + if (!pOptions->walRetentionPeriodIsSet) { + pOptions->walRetentionPeriod = + pOptions->replica > 1 ? TSDB_REPS_DEF_DB_WAL_RET_PERIOD : TSDB_REP_DEF_DB_WAL_RET_PERIOD; + } + if (!pOptions->walRetentionSizeIsSet) { + pOptions->walRetentionSize = pOptions->replica > 1 ? TSDB_REPS_DEF_DB_WAL_RET_SIZE : TSDB_REP_DEF_DB_WAL_RET_SIZE; + } + if (!pOptions->walRollPeriodIsSet) { + pOptions->walRollPeriod = + pOptions->replica > 1 ? TSDB_REPS_DEF_DB_WAL_ROLL_PERIOD : TSDB_REP_DEF_DB_WAL_ROLL_PERIOD; + } +} + SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { CHECK_PARSER_STATUS(pCxt); SDatabaseOptions* pOptions = (SDatabaseOptions*)nodesMakeNode(QUERY_NODE_DATABASE_OPTIONS); @@ -819,10 +833,9 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { pOptions->numOfVgroups = TSDB_DEFAULT_VN_PER_DB; pOptions->singleStable = TSDB_DEFAULT_DB_SINGLE_STABLE; pOptions->schemaless = TSDB_DEFAULT_DB_SCHEMALESS; - pOptions->walRetentionPeriod = TSDB_DEFAULT_DB_WAL_RETENTION_PERIOD; - pOptions->walRetentionSize = TSDB_DEFAULT_DB_WAL_RETENTION_SIZE; - pOptions->walRollPeriod = TSDB_DEFAULT_DB_WAL_ROLL_PERIOD; + updateWalOptionsDefault(pOptions); pOptions->walSegmentSize = TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE; + pOptions->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; return (SNode*)pOptions; } @@ -854,83 +867,92 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) { pOptions->walRetentionSize = -1; pOptions->walRollPeriod = -1; pOptions->walSegmentSize = -1; + pOptions->sstTrigger = -1; return (SNode*)pOptions; } SNode* setDatabaseOption(SAstCreateContext* pCxt, SNode* pOptions, EDatabaseOptionType type, void* pVal) { CHECK_PARSER_STATUS(pCxt); + SDatabaseOptions* pDbOptions = (SDatabaseOptions*)pOptions; switch (type) { case DB_OPTION_BUFFER: - ((SDatabaseOptions*)pOptions)->buffer = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->buffer = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_CACHEMODEL: - COPY_STRING_FORM_STR_TOKEN(((SDatabaseOptions*)pOptions)->cacheModelStr, (SToken*)pVal); + COPY_STRING_FORM_STR_TOKEN(pDbOptions->cacheModelStr, (SToken*)pVal); break; case DB_OPTION_CACHESIZE: - ((SDatabaseOptions*)pOptions)->cacheLastSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->cacheLastSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_COMP: - ((SDatabaseOptions*)pOptions)->compressionLevel = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->compressionLevel = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_DAYS: { SToken* pToken = pVal; if (TK_NK_INTEGER == pToken->type) { - ((SDatabaseOptions*)pOptions)->daysPerFile = taosStr2Int32(pToken->z, NULL, 10) * 1440; + pDbOptions->daysPerFile = taosStr2Int32(pToken->z, NULL, 10) * 1440; } else { - ((SDatabaseOptions*)pOptions)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, pToken); + pDbOptions->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, pToken); } break; } case DB_OPTION_FSYNC: - ((SDatabaseOptions*)pOptions)->fsyncPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->fsyncPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_MAXROWS: - ((SDatabaseOptions*)pOptions)->maxRowsPerBlock = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->maxRowsPerBlock = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_MINROWS: - ((SDatabaseOptions*)pOptions)->minRowsPerBlock = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->minRowsPerBlock = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_KEEP: - ((SDatabaseOptions*)pOptions)->pKeep = pVal; + pDbOptions->pKeep = pVal; break; case DB_OPTION_PAGES: - ((SDatabaseOptions*)pOptions)->pages = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->pages = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_PAGESIZE: - ((SDatabaseOptions*)pOptions)->pagesize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->pagesize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_PRECISION: - COPY_STRING_FORM_STR_TOKEN(((SDatabaseOptions*)pOptions)->precisionStr, (SToken*)pVal); + COPY_STRING_FORM_STR_TOKEN(pDbOptions->precisionStr, (SToken*)pVal); break; case DB_OPTION_REPLICA: - ((SDatabaseOptions*)pOptions)->replica = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->replica = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + updateWalOptionsDefault(pDbOptions); break; case DB_OPTION_STRICT: - COPY_STRING_FORM_STR_TOKEN(((SDatabaseOptions*)pOptions)->strictStr, (SToken*)pVal); + COPY_STRING_FORM_STR_TOKEN(pDbOptions->strictStr, (SToken*)pVal); break; case DB_OPTION_WAL: - ((SDatabaseOptions*)pOptions)->walLevel = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walLevel = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_VGROUPS: - ((SDatabaseOptions*)pOptions)->numOfVgroups = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->numOfVgroups = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_SINGLE_STABLE: - ((SDatabaseOptions*)pOptions)->singleStable = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->singleStable = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); break; case DB_OPTION_RETENTIONS: - ((SDatabaseOptions*)pOptions)->pRetentions = pVal; + pDbOptions->pRetentions = pVal; break; case DB_OPTION_WAL_RETENTION_PERIOD: - ((SDatabaseOptions*)pOptions)->walRetentionPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRetentionPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRetentionPeriodIsSet = true; break; case DB_OPTION_WAL_RETENTION_SIZE: - ((SDatabaseOptions*)pOptions)->walRetentionSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRetentionSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRetentionSizeIsSet = true; break; case DB_OPTION_WAL_ROLL_PERIOD: - ((SDatabaseOptions*)pOptions)->walRollPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRollPeriod = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walRollPeriodIsSet = true; break; case DB_OPTION_WAL_SEGMENT_SIZE: - ((SDatabaseOptions*)pOptions)->walSegmentSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + pDbOptions->walSegmentSize = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); + break; + case DB_OPTION_SST_TRIGGER: + pDbOptions->sstTrigger = taosStr2Int32(((SToken*)pVal)->z, NULL, 10); break; default: break; @@ -1251,7 +1273,8 @@ SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName) { static bool needDbShowStmt(ENodeType type) { return QUERY_NODE_SHOW_TABLES_STMT == type || QUERY_NODE_SHOW_STABLES_STMT == type || - QUERY_NODE_SHOW_VGROUPS_STMT == type; + QUERY_NODE_SHOW_VGROUPS_STMT == type || QUERY_NODE_SHOW_INDEXES_STMT == type || + QUERY_NODE_SHOW_TAGS_STMT == type; } SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { @@ -1264,7 +1287,7 @@ SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) { SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, EOperatorType tableCondType) { CHECK_PARSER_STATUS(pCxt); - if (needDbShowStmt(type) && NULL == pDbName && NULL == pCxt->pQueryCxt->db) { + if (needDbShowStmt(type) && NULL == pDbName) { snprintf(pCxt->pQueryCxt->pMsg, pCxt->pQueryCxt->msgLen, "db not specified"); pCxt->errCode = TSDB_CODE_PAR_SYNTAX_ERROR; return NULL; @@ -1316,6 +1339,15 @@ SNode* createShowDnodeVariablesStmt(SAstCreateContext* pCxt, SNode* pDnodeId) { return (SNode*)pStmt; } +SNode* createShowVnodesStmt(SAstCreateContext* pCxt, SNode* pDnodeId, SNode* pDnodeEndpoint) { + CHECK_PARSER_STATUS(pCxt); + SShowVnodesStmt* pStmt = (SShowVnodesStmt*)nodesMakeNode(QUERY_NODE_SHOW_VNODES_STMT); + CHECK_OUT_OF_MEM(pStmt); + pStmt->pDnodeId = pDnodeId; + pStmt->pDnodeEndpoint = pDnodeEndpoint; + return (SNode*)pStmt; +} + SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const SToken* pPassword, int8_t sysinfo) { CHECK_PARSER_STATUS(pCxt); char password[TSDB_USET_PASSWORD_LEN] = {0}; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 4dcd2bba5a..ec5f6c4e57 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -374,8 +374,13 @@ static int32_t collectMetaKeyFromShowIndexes(SCollectMetaKeyCxt* pCxt, SShowStmt } static int32_t collectMetaKeyFromShowStables(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, - pCxt->pMetaCache); + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, + pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, + ((SValueNode*)pStmt->pDbName)->literal, AUTH_TYPE_READ, pCxt->pMetaCache); + } + return code; } static int32_t collectMetaKeyFromShowStreams(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { @@ -387,11 +392,11 @@ static int32_t collectMetaKeyFromShowTables(SCollectMetaKeyCxt* pCxt, SShowStmt* int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLES, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { - if (NULL != pStmt->pDbName) { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); - } else { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, pCxt->pMetaCache); - } + code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); + } + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, + ((SValueNode*)pStmt->pDbName)->literal, AUTH_TYPE_READ, pCxt->pMetaCache); } return code; } @@ -400,11 +405,7 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TAGS, pCxt->pMetaCache); if (TSDB_CODE_SUCCESS == code) { - if (NULL != pStmt->pDbName) { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); - } else { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, pCxt->pMetaCache); - } + code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); } return code; } @@ -463,6 +464,11 @@ static int32_t collectMetaKeyFromShowDnodeVariables(SCollectMetaKeyCxt* pCxt, SS return code; } +static int32_t collectMetaKeyFromShowVnodes(SCollectMetaKeyCxt* pCxt, SShowVnodesStmt* pStmt) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VNODES, + pCxt->pMetaCache); +} + static int32_t collectMetaKeyFromShowCreateDatabase(SCollectMetaKeyCxt* pCxt, SShowCreateDatabaseStmt* pStmt) { return reserveDbCfgInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pCxt->pMetaCache); } @@ -603,6 +609,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowVariables(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: return collectMetaKeyFromShowDnodeVariables(pCxt, (SShowDnodeVariablesStmt*)pStmt); + case QUERY_NODE_SHOW_VNODES_STMT: + return collectMetaKeyFromShowVnodes(pCxt, (SShowVnodesStmt*)pStmt); case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: return collectMetaKeyFromShowCreateDatabase(pCxt, (SShowCreateDatabaseStmt*)pStmt); case QUERY_NODE_SHOW_CREATE_TABLE_STMT: diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index d9a5761d99..9d73be7454 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -96,6 +96,10 @@ static int32_t authInsert(SAuthCxt* pCxt, SInsertStmt* pInsert) { return code; } +static int32_t authShowTables(SAuthCxt* pCxt, SShowStmt* pStmt) { + return checkAuth(pCxt, ((SValueNode*)pStmt->pDbName)->literal, AUTH_TYPE_READ); +} + static int32_t authShowCreateTable(SAuthCxt* pCxt, SShowCreateTableStmt* pStmt) { return checkAuth(pCxt, pStmt->dbName, AUTH_TYPE_READ); } @@ -127,6 +131,9 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { case QUERY_NODE_SHOW_VNODES_STMT: case QUERY_NODE_SHOW_SCORES_STMT: return !pCxt->pParseCxt->enableSysInfo ? TSDB_CODE_PAR_PERMISSION_DENIED : TSDB_CODE_SUCCESS; + case QUERY_NODE_SHOW_TABLES_STMT: + case QUERY_NODE_SHOW_STABLES_STMT: + return authShowTables(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_CREATE_TABLE_STMT: case QUERY_NODE_SHOW_CREATE_STABLE_STMT: return authShowCreateTable(pCxt, (SShowCreateTableStmt*)pStmt); diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 3615458e31..162161b67a 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -786,6 +786,7 @@ static void buildCreateTbReq(SVCreateTbReq* pTbReq, const char* tname, STag* pTa if (sname) pTbReq->ctb.name = strdup(sname); pTbReq->ctb.pTag = (uint8_t*)pTag; pTbReq->ctb.tagName = taosArrayDup(tagName); + pTbReq->ttl = TSDB_DEFAULT_TABLE_TTL; pTbReq->commentLen = -1; return; @@ -1121,6 +1122,40 @@ static int32_t ignoreAutoCreateTableClause(SInsertParseContext* pCxt) { return code; } +static int32_t parseTableOptions(SInsertParseContext* pCxt) { + do { + int32_t index = 0; + SToken sToken; + NEXT_TOKEN_KEEP_SQL(pCxt->pSql, sToken, index); + if (TK_TTL == sToken.type) { + pCxt->pSql += index; + NEXT_TOKEN(pCxt->pSql, sToken); + if (TK_NK_INTEGER != sToken.type) { + return buildSyntaxErrMsg(&pCxt->msg, "Invalid option ttl", sToken.z); + } + pCxt->createTblReq.ttl = taosStr2Int32(sToken.z, NULL, 10); + } else if (TK_COMMENT == sToken.type) { + pCxt->pSql += index; + NEXT_TOKEN(pCxt->pSql, sToken); + if (TK_NK_STRING != sToken.type) { + return buildSyntaxErrMsg(&pCxt->msg, "Invalid option comment", sToken.z); + } + if (sToken.n >= TSDB_TB_COMMENT_LEN) { + return buildSyntaxErrMsg(&pCxt->msg, "comment too long", sToken.z); + } + int32_t len = trimString(sToken.z, sToken.n, pCxt->tmpTokenBuf, TSDB_TB_COMMENT_LEN); + pCxt->createTblReq.comment = strndup(pCxt->tmpTokenBuf, len); + if (NULL == pCxt->createTblReq.comment) { + return TSDB_CODE_OUT_OF_MEMORY; + } + pCxt->createTblReq.commentLen = len; + } else { + break; + } + } while (1); + return TSDB_CODE_SUCCESS; +} + // pSql -> stb_name [(tag1_name, ...)] TAGS (tag1_value, ...) static int32_t parseUsingClause(SInsertParseContext* pCxt, int32_t tbNo, SName* name, char* tbFName) { int32_t len = strlen(tbFName); @@ -1172,7 +1207,7 @@ static int32_t parseUsingClause(SInsertParseContext* pCxt, int32_t tbNo, SName* return buildSyntaxErrMsg(&pCxt->msg, ") is expected", sToken.z); } - return TSDB_CODE_SUCCESS; + return parseTableOptions(pCxt); } static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks, int16_t timePrec, bool* gotRow, @@ -1672,7 +1707,7 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery, SParseMetaCache if (pContext->pStmtCb) { context.pVgroupsHashObj = NULL; context.pTableBlockHashObj = NULL; - } + } destroyInsertParseContext(&context); return code; } @@ -1700,6 +1735,21 @@ static int32_t skipValuesClause(SInsertParseSyntaxCxt* pCxt) { static int32_t skipTagsClause(SInsertParseSyntaxCxt* pCxt) { return skipParentheses(pCxt); } +static int32_t skipTableOptions(SInsertParseSyntaxCxt* pCxt) { + do { + int32_t index = 0; + SToken sToken; + NEXT_TOKEN_KEEP_SQL(pCxt->pSql, sToken, index); + if (TK_TTL == sToken.type || TK_COMMENT == sToken.type) { + pCxt->pSql += index; + NEXT_TOKEN(pCxt->pSql, sToken); + } else { + break; + } + } while (1); + return TSDB_CODE_SUCCESS; +} + // pSql -> [(tag1_name, ...)] TAGS (tag1_value, ...) static int32_t skipUsingClause(SInsertParseSyntaxCxt* pCxt) { SToken sToken; @@ -1718,6 +1768,7 @@ static int32_t skipUsingClause(SInsertParseSyntaxCxt* pCxt) { return buildSyntaxErrMsg(&pCxt->msg, "( is expected", sToken.z); } CHECK_CODE(skipTagsClause(pCxt)); + CHECK_CODE(skipTableOptions(pCxt)); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 80ec447f66..750263215a 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -187,6 +187,7 @@ static SKeyword keywordTable[] = { {"SNODES", TK_SNODES}, {"SOFFSET", TK_SOFFSET}, {"SPLIT", TK_SPLIT}, + {"SST_TRIGGER", TK_SST_TRIGGER}, {"STABLE", TK_STABLE}, {"STABLES", TK_STABLES}, {"STATE", TK_STATE}, @@ -228,6 +229,7 @@ static SKeyword keywordTable[] = { {"VERBOSE", TK_VERBOSE}, {"VGROUP", TK_VGROUP}, {"VGROUPS", TK_VGROUPS}, + {"VNODES", TK_VNODES}, {"WAL_FSYNC_PERIOD", TK_WAL_FSYNC_PERIOD}, {"WAL_LEVEL", TK_WAL_LEVEL}, {"WAL_RETENTION_PERIOD", TK_WAL_RETENTION_PERIOD}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a88b7b417f..c3db67668a 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -245,6 +245,12 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { .showType = QUERY_NODE_SHOW_VNODES_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_VNODES, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, }; // clang-format on @@ -3476,6 +3482,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS pReq->walRetentionSize = pStmt->pOptions->walRetentionSize; pReq->walRollPeriod = pStmt->pOptions->walRollPeriod; pReq->walSegmentSize = pStmt->pOptions->walSegmentSize; + pReq->sstTrigger = pStmt->pOptions->sstTrigger; pReq->ignoreExist = pStmt->ignoreExists; return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } @@ -3760,6 +3767,9 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName code = checkDbRangeOption(pCxt, "walSegmentSize", pOptions->walSegmentSize, TSDB_DB_MIN_WAL_SEGMENT_SIZE, INT32_MAX); } + if (TSDB_CODE_SUCCESS == code) { + code = checkDbRangeOption(pCxt, "sstTrigger", pOptions->sstTrigger, TSDB_MIN_SST_TRIGGER, TSDB_MAX_SST_TRIGGER); + } if (TSDB_CODE_SUCCESS == code) { code = checkOptionsDependency(pCxt, pDbName, pOptions); } @@ -3833,6 +3843,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt, pReq->cacheLast = pStmt->pOptions->cacheModel; pReq->cacheLastSize = pStmt->pOptions->cacheLastSize; pReq->replications = pStmt->pOptions->replica; + pReq->sstTrigger = pStmt->pOptions->sstTrigger; return; } @@ -5837,6 +5848,25 @@ static int32_t rewriteShowDnodeVariables(STranslateContext* pCxt, SQuery* pQuery return code; } +static int32_t rewriteShowVnodes(STranslateContext* pCxt, SQuery* pQuery) { + SShowVnodesStmt* pShow = (SShowVnodesStmt*)(pQuery->pRoot); + SSelectStmt* pStmt = NULL; + int32_t code = createSelectStmtForShow(QUERY_NODE_SHOW_VNODES_STMT, &pStmt); + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pShow->pDnodeId) { + code = createOperatorNode(OP_TYPE_EQUAL, "dnode_id", pShow->pDnodeId, &pStmt->pWhere); + } else { + code = createOperatorNode(OP_TYPE_EQUAL, "dnode_endpoint", pShow->pDnodeEndpoint, &pStmt->pWhere); + } + } + if (TSDB_CODE_SUCCESS == code) { + pQuery->showRewrite = true; + nodesDestroyNode(pQuery->pRoot); + pQuery->pRoot = (SNode*)pStmt; + } + return code; +} + static SNode* createBlockDistInfoFunc() { SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { @@ -6408,7 +6438,8 @@ typedef struct SVgroupDropTableBatch { char dbName[TSDB_DB_NAME_LEN]; } SVgroupDropTableBatch; -static void addDropTbReqIntoVgroup(SHashObj* pVgroupHashmap, SDropTableClause* pClause, SVgroupInfo* pVgInfo, uint64_t suid) { +static void addDropTbReqIntoVgroup(SHashObj* pVgroupHashmap, SDropTableClause* pClause, SVgroupInfo* pVgInfo, + uint64_t suid) { SVDropTbReq req = {.name = pClause->tableName, .suid = suid, .igNotExists = pClause->ignoreNotExists}; SVgroupDropTableBatch* pTableBatch = taosHashGet(pVgroupHashmap, &pVgInfo->vgId, sizeof(pVgInfo->vgId)); if (NULL == pTableBatch) { @@ -6946,6 +6977,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: code = rewriteShowDnodeVariables(pCxt, pQuery); break; + case QUERY_NODE_SHOW_VNODES_STMT: + code = rewriteShowVnodes(pCxt, pQuery); + break; case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: code = rewriteShowTableDist(pCxt, pQuery); break; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index c4bd1aff04..d54261f0cb 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 426 +#define YYNOCODE 427 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SAlterOption yy5; - int8_t yy59; - int64_t yy69; - EJoinType yy156; - SNodeList* yy172; - EFillMode yy186; - SToken yy209; - int32_t yy232; - SNode* yy272; - bool yy293; - EOperatorType yy392; - ENullOrder yy493; - SDataType yy616; - EOrder yy818; + SAlterOption yy95; + EOperatorType yy198; + EOrder yy204; + int8_t yy215; + ENullOrder yy277; + bool yy313; + int64_t yy473; + SNodeList* yy544; + SToken yy617; + EJoinType yy708; + SDataType yy784; + EFillMode yy816; + SNode* yy840; + int32_t yy844; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 667 -#define YYNRULE 489 -#define YYNTOKEN 305 -#define YY_MAX_SHIFT 666 -#define YY_MIN_SHIFTREDUCE 972 -#define YY_MAX_SHIFTREDUCE 1460 -#define YY_ERROR_ACTION 1461 -#define YY_ACCEPT_ACTION 1462 -#define YY_NO_ACTION 1463 -#define YY_MIN_REDUCE 1464 -#define YY_MAX_REDUCE 1952 +#define YYNSTATE 672 +#define YYNRULE 493 +#define YYNTOKEN 306 +#define YY_MAX_SHIFT 671 +#define YY_MIN_SHIFTREDUCE 979 +#define YY_MAX_SHIFTREDUCE 1471 +#define YY_ERROR_ACTION 1472 +#define YY_ACCEPT_ACTION 1473 +#define YY_NO_ACTION 1474 +#define YY_MIN_REDUCE 1475 +#define YY_MAX_REDUCE 1967 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,650 +216,692 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2259) +#define YY_ACTTAB_COUNT (2522) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 433, 1930, 434, 1499, 1593, 441, 526, 434, 1499, 513, - /* 10 */ 30, 260, 39, 37, 1929, 326, 325, 117, 1927, 1702, - /* 20 */ 339, 1465, 1261, 146, 471, 40, 38, 36, 35, 34, - /* 30 */ 1786, 552, 1606, 1337, 1604, 1259, 344, 552, 1287, 1649, - /* 40 */ 1651, 378, 107, 1774, 526, 106, 105, 104, 103, 102, - /* 50 */ 101, 100, 99, 98, 1770, 117, 1332, 432, 1804, 64, - /* 60 */ 436, 14, 476, 36, 35, 34, 553, 148, 1267, 1476, - /* 70 */ 450, 1756, 1604, 577, 39, 37, 1400, 1595, 1766, 1772, - /* 80 */ 328, 1930, 339, 1526, 1261, 1804, 217, 1286, 1770, 1, - /* 90 */ 571, 1005, 1656, 542, 164, 1337, 1818, 1259, 1927, 327, - /* 100 */ 95, 1787, 580, 1789, 1790, 576, 43, 571, 1654, 158, - /* 110 */ 1864, 663, 1766, 1772, 330, 1860, 159, 513, 1332, 63, - /* 120 */ 1930, 78, 1643, 14, 571, 1339, 1340, 1703, 163, 541, - /* 130 */ 1267, 1009, 1010, 165, 33, 32, 1890, 1927, 40, 38, - /* 140 */ 36, 35, 34, 543, 63, 63, 640, 639, 638, 637, - /* 150 */ 349, 2, 636, 635, 128, 630, 629, 628, 627, 626, - /* 160 */ 625, 624, 139, 620, 619, 618, 348, 347, 615, 614, - /* 170 */ 1262, 107, 1260, 663, 106, 105, 104, 103, 102, 101, - /* 180 */ 100, 99, 98, 440, 1775, 1287, 436, 1339, 1340, 223, - /* 190 */ 224, 11, 10, 1265, 1266, 1770, 1314, 1315, 1317, 1318, - /* 200 */ 1319, 1320, 1321, 1322, 573, 569, 1330, 1331, 1333, 1334, - /* 210 */ 1335, 1336, 1338, 1341, 1464, 496, 1431, 33, 32, 1766, - /* 220 */ 1772, 40, 38, 36, 35, 34, 526, 167, 494, 150, - /* 230 */ 492, 571, 1262, 1564, 1260, 1261, 210, 55, 116, 115, - /* 240 */ 114, 113, 112, 111, 110, 109, 108, 305, 1259, 63, - /* 250 */ 516, 1701, 22, 300, 1604, 1265, 1266, 167, 1314, 1315, - /* 260 */ 1317, 1318, 1319, 1320, 1321, 1322, 573, 569, 1330, 1331, - /* 270 */ 1333, 1334, 1335, 1336, 1338, 1341, 39, 37, 1650, 1651, - /* 280 */ 1373, 1267, 167, 167, 339, 552, 1261, 613, 1286, 49, - /* 290 */ 1160, 1161, 76, 305, 1786, 1487, 516, 1337, 1421, 1259, - /* 300 */ 1118, 602, 601, 600, 1122, 599, 1124, 1125, 598, 1127, - /* 310 */ 595, 342, 1133, 592, 1135, 1136, 589, 586, 1285, 146, - /* 320 */ 1332, 1581, 1804, 173, 663, 14, 479, 478, 1606, 377, - /* 330 */ 553, 376, 1267, 1656, 1930, 1756, 1756, 577, 39, 37, - /* 340 */ 312, 535, 1419, 1420, 1422, 1423, 339, 1928, 1261, 1654, - /* 350 */ 1705, 1927, 84, 2, 42, 71, 1656, 63, 70, 1337, - /* 360 */ 1818, 1259, 1267, 343, 95, 1787, 580, 1789, 1790, 576, - /* 370 */ 605, 571, 1654, 1597, 1864, 663, 345, 1589, 330, 1860, - /* 380 */ 159, 1288, 1332, 1262, 146, 1260, 1022, 167, 1021, 1339, - /* 390 */ 1340, 33, 32, 1606, 1267, 40, 38, 36, 35, 34, - /* 400 */ 1891, 1930, 384, 39, 37, 1342, 1265, 1266, 1486, 1485, - /* 410 */ 611, 339, 1786, 1261, 165, 8, 1023, 438, 1927, 634, - /* 420 */ 632, 1080, 611, 1284, 1337, 622, 1259, 167, 549, 137, - /* 430 */ 136, 608, 607, 606, 1262, 1695, 1260, 663, 1484, 303, - /* 440 */ 1804, 137, 136, 608, 607, 606, 172, 1332, 575, 1756, - /* 450 */ 1756, 1339, 1340, 1756, 1082, 577, 127, 1265, 1266, 1267, - /* 460 */ 1314, 1315, 1317, 1318, 1319, 1320, 1321, 1322, 573, 569, - /* 470 */ 1330, 1331, 1333, 1334, 1335, 1336, 1338, 1341, 1818, 1756, - /* 480 */ 9, 1591, 293, 1787, 580, 1789, 1790, 576, 574, 571, - /* 490 */ 568, 1836, 167, 74, 125, 167, 1262, 222, 1260, 33, - /* 500 */ 32, 1529, 663, 40, 38, 36, 35, 34, 551, 160, - /* 510 */ 1872, 1873, 1587, 1877, 1483, 1600, 1339, 1340, 252, 1265, - /* 520 */ 1266, 1579, 1314, 1315, 1317, 1318, 1319, 1320, 1321, 1322, - /* 530 */ 573, 569, 1330, 1331, 1333, 1334, 1335, 1336, 1338, 1341, - /* 540 */ 1700, 526, 300, 33, 32, 1457, 91, 40, 38, 36, - /* 550 */ 35, 34, 169, 167, 316, 1756, 1241, 1242, 623, 124, - /* 560 */ 1576, 1262, 1879, 1260, 26, 482, 481, 1596, 1462, 1604, - /* 570 */ 33, 32, 123, 1582, 40, 38, 36, 35, 34, 213, - /* 580 */ 1786, 1411, 477, 480, 1265, 1266, 1876, 1314, 1315, 1317, - /* 590 */ 1318, 1319, 1320, 1321, 1322, 573, 569, 1330, 1331, 1333, - /* 600 */ 1334, 1335, 1336, 1338, 1341, 39, 37, 475, 1804, 317, - /* 610 */ 146, 315, 314, 339, 473, 1261, 578, 1361, 475, 1607, - /* 620 */ 549, 1756, 611, 577, 28, 1299, 1337, 354, 1259, 474, - /* 630 */ 33, 32, 1456, 450, 40, 38, 36, 35, 34, 538, - /* 640 */ 474, 137, 136, 608, 607, 606, 1818, 1695, 127, 1332, - /* 650 */ 96, 1787, 580, 1789, 1790, 576, 572, 571, 175, 74, - /* 660 */ 1864, 1267, 526, 609, 1863, 1860, 1647, 1930, 554, 512, - /* 670 */ 33, 32, 122, 382, 40, 38, 36, 35, 34, 27, - /* 680 */ 164, 1599, 9, 1482, 1927, 1022, 125, 1021, 7, 1366, - /* 690 */ 1604, 33, 32, 1481, 1565, 40, 38, 36, 35, 34, - /* 700 */ 469, 250, 1872, 548, 663, 547, 33, 32, 1930, 1930, - /* 710 */ 40, 38, 36, 35, 34, 1023, 544, 539, 1339, 1340, - /* 720 */ 526, 166, 164, 307, 1756, 1927, 1927, 135, 487, 1404, - /* 730 */ 526, 383, 39, 37, 1756, 1286, 1480, 302, 1879, 1284, - /* 740 */ 339, 389, 1261, 497, 307, 526, 412, 604, 1604, 424, - /* 750 */ 526, 549, 1299, 1337, 1477, 1259, 404, 209, 1604, 61, - /* 760 */ 1359, 405, 1875, 1262, 373, 1260, 397, 1479, 425, 1478, - /* 770 */ 399, 490, 255, 1604, 54, 484, 1332, 1756, 1604, 127, - /* 780 */ 208, 1359, 1475, 375, 371, 419, 1265, 1266, 1267, 1314, - /* 790 */ 1315, 1317, 1318, 1319, 1320, 1321, 1322, 573, 569, 1330, - /* 800 */ 1331, 1333, 1334, 1335, 1336, 1338, 1341, 390, 1756, 2, - /* 810 */ 1756, 1397, 58, 526, 1360, 57, 1879, 125, 505, 386, - /* 820 */ 1289, 33, 32, 1756, 448, 40, 38, 36, 35, 34, - /* 830 */ 1474, 663, 161, 1872, 1873, 1360, 1877, 177, 176, 1505, - /* 840 */ 1874, 1604, 1347, 1009, 1010, 1339, 1340, 423, 1286, 1580, - /* 850 */ 418, 417, 416, 415, 414, 411, 410, 409, 408, 407, - /* 860 */ 403, 402, 401, 400, 394, 393, 392, 391, 549, 388, - /* 870 */ 387, 1756, 1656, 616, 1473, 1393, 29, 337, 1354, 1355, - /* 880 */ 1356, 1357, 1358, 1362, 1363, 1364, 1365, 658, 1655, 468, - /* 890 */ 1262, 610, 1260, 1286, 1647, 1068, 127, 29, 337, 1354, - /* 900 */ 1355, 1356, 1357, 1358, 1362, 1363, 1364, 1365, 272, 613, - /* 910 */ 536, 1634, 1316, 1265, 1266, 1756, 1314, 1315, 1317, 1318, - /* 920 */ 1319, 1320, 1321, 1322, 573, 569, 1330, 1331, 1333, 1334, - /* 930 */ 1335, 1336, 1338, 1341, 125, 147, 1472, 1786, 561, 352, - /* 940 */ 278, 351, 1884, 1393, 1743, 482, 481, 1516, 1774, 162, - /* 950 */ 1872, 1873, 123, 1877, 276, 60, 1805, 232, 59, 1770, - /* 960 */ 526, 526, 477, 480, 1471, 1804, 44, 4, 244, 483, - /* 970 */ 145, 449, 1601, 578, 180, 429, 427, 1756, 1756, 1930, - /* 980 */ 577, 1930, 1500, 1766, 1772, 334, 1470, 1786, 1604, 1604, - /* 990 */ 526, 361, 164, 554, 164, 571, 1927, 216, 1927, 498, - /* 1000 */ 556, 499, 1469, 1818, 1468, 1756, 63, 94, 1787, 580, - /* 1010 */ 1789, 1790, 576, 526, 571, 1804, 558, 1864, 1604, 336, - /* 1020 */ 335, 306, 1860, 578, 506, 1316, 526, 1756, 1756, 1275, - /* 1030 */ 577, 201, 77, 1930, 199, 1396, 1644, 510, 526, 1930, - /* 1040 */ 1337, 1604, 1268, 1756, 93, 1756, 166, 1511, 1467, 227, - /* 1050 */ 1927, 350, 164, 1818, 1604, 1786, 1927, 95, 1787, 580, - /* 1060 */ 1789, 1790, 576, 1332, 571, 526, 1604, 1864, 41, 485, - /* 1070 */ 1316, 330, 1860, 1943, 526, 1267, 522, 53, 509, 68, - /* 1080 */ 67, 381, 1898, 1804, 171, 524, 221, 203, 526, 1756, - /* 1090 */ 202, 578, 205, 1604, 207, 204, 1756, 206, 577, 525, - /* 1100 */ 301, 1509, 1604, 369, 1894, 367, 363, 359, 356, 353, - /* 1110 */ 1270, 554, 131, 526, 1786, 1212, 1604, 1269, 566, 567, - /* 1120 */ 526, 1818, 134, 488, 261, 94, 1787, 580, 1789, 1790, - /* 1130 */ 576, 346, 571, 225, 135, 1864, 51, 550, 666, 306, - /* 1140 */ 1860, 1604, 1804, 562, 167, 236, 51, 323, 1604, 41, - /* 1150 */ 578, 1930, 267, 90, 1786, 1756, 617, 577, 41, 519, - /* 1160 */ 1777, 11, 10, 87, 164, 249, 156, 3, 1927, 229, - /* 1170 */ 254, 656, 652, 648, 644, 265, 584, 1276, 1066, 1271, - /* 1180 */ 1818, 1111, 1804, 1418, 294, 1787, 580, 1789, 1790, 576, - /* 1190 */ 578, 571, 239, 1367, 1786, 1756, 1323, 577, 1459, 1460, - /* 1200 */ 1279, 1281, 257, 1779, 259, 271, 134, 92, 135, 5, - /* 1210 */ 230, 1049, 569, 1330, 1331, 1333, 1334, 1335, 1336, 559, - /* 1220 */ 1818, 360, 1804, 1139, 95, 1787, 580, 1789, 1790, 576, - /* 1230 */ 578, 571, 268, 355, 1864, 1756, 119, 577, 330, 1860, - /* 1240 */ 1943, 134, 549, 523, 1050, 313, 1228, 1273, 174, 1921, - /* 1250 */ 385, 1351, 1284, 1143, 1272, 1150, 406, 413, 1697, 421, - /* 1260 */ 1818, 420, 422, 1786, 95, 1787, 580, 1789, 1790, 576, - /* 1270 */ 127, 571, 426, 428, 1864, 219, 430, 1290, 330, 1860, - /* 1280 */ 1943, 431, 439, 1148, 1292, 442, 183, 443, 138, 1883, - /* 1290 */ 554, 1804, 1291, 1235, 185, 212, 444, 1293, 188, 578, - /* 1300 */ 445, 190, 447, 72, 1756, 73, 577, 451, 125, 194, - /* 1310 */ 470, 472, 1594, 198, 118, 1590, 304, 1786, 200, 554, - /* 1320 */ 140, 269, 141, 250, 1872, 548, 1592, 547, 1588, 1818, - /* 1330 */ 1930, 142, 143, 285, 1787, 580, 1789, 1790, 576, 211, - /* 1340 */ 571, 500, 1736, 164, 214, 1804, 507, 1927, 504, 511, - /* 1350 */ 218, 322, 534, 578, 514, 520, 501, 1735, 1756, 1930, - /* 1360 */ 577, 132, 1707, 517, 324, 1289, 81, 1786, 521, 133, - /* 1370 */ 270, 83, 166, 554, 537, 1605, 1927, 530, 1905, 234, - /* 1380 */ 1895, 238, 6, 1818, 1786, 532, 533, 285, 1787, 580, - /* 1390 */ 1789, 1790, 576, 329, 571, 1804, 546, 531, 540, 529, - /* 1400 */ 528, 248, 1288, 578, 1393, 126, 563, 560, 1756, 48, - /* 1410 */ 577, 1880, 1804, 1930, 1904, 85, 1648, 331, 1577, 659, - /* 1420 */ 578, 582, 264, 660, 243, 1756, 164, 577, 153, 1886, - /* 1430 */ 1927, 247, 245, 1818, 1786, 246, 253, 96, 1787, 580, - /* 1440 */ 1789, 1790, 576, 1845, 571, 273, 662, 1864, 299, 275, - /* 1450 */ 1818, 565, 1860, 256, 149, 1787, 580, 1789, 1790, 576, - /* 1460 */ 1786, 571, 1804, 52, 1946, 1926, 557, 286, 296, 258, - /* 1470 */ 578, 564, 295, 1750, 277, 1756, 1749, 577, 65, 1748, - /* 1480 */ 1747, 66, 1744, 357, 358, 1253, 1254, 170, 1804, 362, - /* 1490 */ 1742, 364, 365, 527, 366, 1741, 578, 368, 555, 1944, - /* 1500 */ 1818, 1756, 1740, 577, 96, 1787, 580, 1789, 1790, 576, - /* 1510 */ 1786, 571, 370, 1739, 1864, 372, 1738, 1230, 374, 1861, - /* 1520 */ 1231, 1718, 1786, 379, 380, 1716, 1818, 1717, 1715, 1690, - /* 1530 */ 294, 1787, 580, 1789, 1790, 576, 1786, 571, 1804, 1689, - /* 1540 */ 1200, 129, 1688, 1687, 69, 1686, 578, 395, 1681, 396, - /* 1550 */ 1804, 1756, 1685, 577, 1684, 1683, 1682, 398, 578, 1680, - /* 1560 */ 1679, 1678, 1677, 1756, 1804, 577, 1676, 1675, 1674, 1673, - /* 1570 */ 1672, 1671, 575, 1670, 1669, 1668, 1818, 1756, 1667, 577, - /* 1580 */ 289, 1787, 580, 1789, 1790, 576, 130, 571, 1818, 1786, - /* 1590 */ 1666, 1665, 149, 1787, 580, 1789, 1790, 576, 1664, 571, - /* 1600 */ 1663, 1662, 1818, 1202, 1660, 1659, 293, 1787, 580, 1789, - /* 1610 */ 1790, 576, 1661, 571, 1658, 1837, 1657, 1804, 545, 1531, - /* 1620 */ 178, 1530, 338, 120, 181, 578, 196, 1528, 179, 1496, - /* 1630 */ 1756, 157, 577, 435, 1012, 437, 1011, 1945, 1495, 182, - /* 1640 */ 152, 121, 1786, 452, 453, 467, 463, 459, 455, 195, - /* 1650 */ 1731, 1725, 1714, 189, 1786, 1818, 187, 1713, 1699, 294, - /* 1660 */ 1787, 580, 1789, 1790, 576, 1583, 571, 1527, 1786, 1042, - /* 1670 */ 1804, 1525, 454, 1523, 456, 340, 458, 457, 578, 1521, - /* 1680 */ 460, 75, 1804, 1756, 193, 577, 462, 461, 1519, 464, - /* 1690 */ 578, 465, 466, 1508, 1507, 1756, 1804, 577, 1492, 1585, - /* 1700 */ 1153, 1154, 197, 1584, 578, 1079, 1074, 50, 1818, 1756, - /* 1710 */ 1517, 577, 294, 1787, 580, 1789, 1790, 576, 631, 571, - /* 1720 */ 1818, 1076, 1786, 633, 279, 1787, 580, 1789, 1790, 576, - /* 1730 */ 1075, 571, 1512, 318, 1818, 319, 1786, 1510, 280, 1787, - /* 1740 */ 580, 1789, 1790, 576, 320, 571, 192, 186, 1786, 191, - /* 1750 */ 1804, 486, 489, 446, 1491, 491, 1490, 1489, 578, 493, - /* 1760 */ 495, 97, 1730, 1756, 1804, 577, 1237, 56, 1724, 184, - /* 1770 */ 502, 1712, 578, 1710, 508, 503, 1804, 1756, 215, 577, - /* 1780 */ 1711, 1709, 321, 1708, 578, 15, 144, 220, 1818, 1756, - /* 1790 */ 1245, 577, 281, 1787, 580, 1789, 1790, 576, 1706, 571, - /* 1800 */ 1698, 226, 1818, 518, 79, 1786, 288, 1787, 580, 1789, - /* 1810 */ 1790, 576, 228, 571, 1818, 1786, 515, 80, 290, 1787, - /* 1820 */ 580, 1789, 1790, 576, 82, 571, 87, 41, 231, 23, - /* 1830 */ 47, 1786, 1433, 1804, 233, 241, 235, 1415, 237, 242, - /* 1840 */ 1417, 578, 16, 1804, 25, 1777, 1756, 151, 577, 240, - /* 1850 */ 24, 578, 46, 1410, 86, 1786, 1756, 17, 577, 1804, - /* 1860 */ 1390, 251, 1389, 1776, 154, 1450, 45, 578, 18, 1439, - /* 1870 */ 1445, 1818, 1756, 13, 577, 282, 1787, 580, 1789, 1790, - /* 1880 */ 576, 1818, 571, 1804, 1444, 291, 1787, 580, 1789, 1790, - /* 1890 */ 576, 578, 571, 332, 1449, 1448, 1756, 1818, 577, 333, - /* 1900 */ 10, 283, 1787, 580, 1789, 1790, 576, 1277, 571, 1352, - /* 1910 */ 19, 1786, 1821, 1307, 1327, 570, 155, 1325, 31, 581, - /* 1920 */ 1324, 1818, 12, 20, 168, 292, 1787, 580, 1789, 1790, - /* 1930 */ 576, 1786, 571, 21, 583, 1140, 341, 585, 579, 1804, - /* 1940 */ 1137, 587, 588, 590, 1134, 591, 593, 578, 596, 1132, - /* 1950 */ 594, 1786, 1756, 1128, 577, 1126, 1131, 597, 1117, 1804, - /* 1960 */ 1130, 88, 1149, 603, 1129, 89, 62, 578, 262, 1145, - /* 1970 */ 612, 1786, 1756, 1071, 577, 1070, 1040, 1818, 1069, 1804, - /* 1980 */ 1067, 284, 1787, 580, 1789, 1790, 576, 578, 571, 1065, - /* 1990 */ 1064, 1786, 1756, 1063, 577, 263, 1086, 1818, 1061, 1804, - /* 2000 */ 1060, 297, 1787, 580, 1789, 1790, 576, 578, 571, 621, - /* 2010 */ 1059, 1058, 1756, 1057, 577, 1056, 1055, 1818, 1083, 1804, - /* 2020 */ 1081, 298, 1787, 580, 1789, 1790, 576, 578, 571, 1052, - /* 2030 */ 1051, 1786, 1756, 1048, 577, 1047, 1046, 1818, 1045, 1524, - /* 2040 */ 641, 1798, 1787, 580, 1789, 1790, 576, 1786, 571, 642, - /* 2050 */ 643, 1522, 645, 646, 647, 1520, 649, 1818, 651, 1804, - /* 2060 */ 650, 1797, 1787, 580, 1789, 1790, 576, 578, 571, 1518, - /* 2070 */ 653, 654, 1756, 655, 577, 1804, 1506, 657, 1002, 1488, - /* 2080 */ 266, 661, 664, 578, 1263, 274, 665, 1463, 1756, 1463, - /* 2090 */ 577, 1463, 1463, 1463, 1463, 1463, 1463, 1818, 1786, 1463, - /* 2100 */ 1463, 1796, 1787, 580, 1789, 1790, 576, 1463, 571, 1463, - /* 2110 */ 1463, 1463, 1463, 1818, 1786, 1463, 1463, 310, 1787, 580, - /* 2120 */ 1789, 1790, 576, 1463, 571, 1463, 1804, 1463, 1463, 1463, - /* 2130 */ 1463, 1463, 1463, 1463, 578, 1463, 1463, 1463, 1463, 1756, - /* 2140 */ 1463, 577, 1804, 1463, 1463, 1463, 1463, 1463, 1463, 1463, - /* 2150 */ 578, 1463, 1463, 1463, 1463, 1756, 1463, 577, 1463, 1463, - /* 2160 */ 1463, 1463, 1463, 1463, 1818, 1786, 1463, 1463, 309, 1787, - /* 2170 */ 580, 1789, 1790, 576, 1463, 571, 1463, 1463, 1463, 1463, - /* 2180 */ 1818, 1786, 1463, 1463, 311, 1787, 580, 1789, 1790, 576, - /* 2190 */ 1463, 571, 1463, 1804, 1463, 1463, 1463, 1463, 1463, 1463, - /* 2200 */ 1463, 578, 1463, 1463, 1463, 1463, 1756, 1463, 577, 1804, - /* 2210 */ 1463, 1463, 1463, 1463, 1463, 1463, 1463, 578, 1463, 1463, - /* 2220 */ 1463, 1463, 1756, 1463, 577, 1463, 1463, 1463, 1463, 1463, - /* 2230 */ 1463, 1818, 1463, 1463, 1463, 308, 1787, 580, 1789, 1790, - /* 2240 */ 576, 1463, 571, 1463, 1463, 1463, 1463, 1818, 1463, 1463, - /* 2250 */ 1463, 287, 1787, 580, 1789, 1790, 576, 1463, 571, + /* 0 */ 517, 1801, 436, 530, 437, 1510, 379, 326, 1720, 64, + /* 10 */ 1717, 553, 39, 37, 117, 1606, 444, 553, 437, 1510, + /* 20 */ 340, 474, 1272, 1475, 40, 38, 36, 35, 34, 1819, + /* 30 */ 530, 1617, 530, 1348, 1029, 1270, 1028, 582, 553, 127, + /* 40 */ 556, 55, 1771, 169, 581, 127, 1945, 116, 115, 114, + /* 50 */ 113, 112, 111, 110, 109, 108, 1343, 558, 1617, 164, + /* 60 */ 1617, 14, 327, 1942, 1030, 558, 127, 1833, 1278, 1537, + /* 70 */ 146, 94, 1802, 584, 1804, 1805, 580, 125, 575, 1619, + /* 80 */ 148, 1879, 1487, 125, 1498, 306, 1875, 1298, 1012, 1281, + /* 90 */ 1, 555, 160, 1887, 1888, 63, 1892, 1945, 250, 1887, + /* 100 */ 552, 1669, 551, 345, 125, 1945, 1662, 1664, 328, 150, + /* 110 */ 166, 1595, 668, 1576, 1942, 453, 1819, 1667, 166, 161, + /* 120 */ 1887, 1888, 1942, 1892, 546, 1771, 1350, 1351, 1016, 1017, + /* 130 */ 30, 260, 645, 644, 643, 642, 350, 1476, 641, 640, + /* 140 */ 128, 635, 634, 633, 632, 631, 630, 629, 139, 625, + /* 150 */ 624, 623, 349, 348, 620, 619, 618, 628, 107, 1589, + /* 160 */ 545, 106, 105, 104, 103, 102, 101, 100, 99, 98, + /* 170 */ 556, 453, 1273, 1894, 1271, 1127, 606, 605, 604, 1131, + /* 180 */ 603, 1133, 1134, 602, 1136, 599, 542, 1142, 596, 1144, + /* 190 */ 1145, 593, 590, 1169, 1170, 1276, 1277, 1891, 1325, 1326, + /* 200 */ 1328, 1329, 1330, 1331, 1332, 1333, 577, 573, 1341, 1342, + /* 210 */ 1344, 1345, 1346, 1347, 1349, 1352, 39, 37, 1411, 1945, + /* 220 */ 1789, 302, 158, 1295, 340, 1801, 1272, 222, 1284, 167, + /* 230 */ 415, 1785, 1944, 427, 167, 1656, 1942, 1348, 107, 1270, + /* 240 */ 43, 106, 105, 104, 103, 102, 101, 100, 99, 98, + /* 250 */ 400, 556, 428, 1819, 402, 1781, 1787, 329, 74, 1297, + /* 260 */ 1343, 582, 1298, 548, 543, 14, 1771, 575, 581, 33, + /* 270 */ 32, 122, 1278, 40, 38, 36, 35, 34, 33, 32, + /* 280 */ 1612, 217, 40, 38, 36, 35, 34, 1252, 1253, 1297, + /* 290 */ 1945, 1833, 393, 91, 2, 95, 1802, 584, 1804, 1805, + /* 300 */ 580, 63, 575, 165, 389, 1879, 124, 1942, 547, 331, + /* 310 */ 1875, 1958, 1663, 1664, 1609, 63, 668, 78, 33, 32, + /* 320 */ 1913, 42, 40, 38, 36, 35, 34, 441, 1432, 63, + /* 330 */ 1350, 1351, 426, 1295, 63, 421, 420, 419, 418, 417, + /* 340 */ 414, 413, 412, 411, 410, 406, 405, 404, 403, 397, + /* 350 */ 396, 395, 394, 22, 391, 390, 314, 483, 482, 33, + /* 360 */ 32, 1442, 61, 40, 38, 36, 35, 34, 1029, 530, + /* 370 */ 1028, 539, 1430, 1431, 1433, 1434, 1273, 1710, 1271, 26, + /* 380 */ 117, 1296, 378, 472, 377, 33, 32, 479, 172, 40, + /* 390 */ 38, 36, 35, 34, 223, 224, 553, 1617, 1030, 1276, + /* 400 */ 1277, 173, 1325, 1326, 1328, 1329, 1330, 1331, 1332, 1333, + /* 410 */ 577, 573, 1341, 1342, 1344, 1345, 1346, 1347, 1349, 1352, + /* 420 */ 39, 37, 1801, 491, 127, 1468, 615, 609, 340, 1593, + /* 430 */ 1272, 36, 35, 34, 71, 1894, 435, 70, 501, 439, + /* 440 */ 167, 1348, 1422, 1270, 1801, 137, 136, 612, 611, 610, + /* 450 */ 1819, 422, 209, 305, 167, 1415, 520, 49, 582, 1890, + /* 460 */ 167, 1297, 125, 1771, 1343, 581, 494, 1669, 167, 14, + /* 470 */ 488, 500, 1819, 167, 344, 208, 1278, 162, 1887, 1888, + /* 480 */ 582, 1892, 1473, 1667, 498, 1771, 496, 581, 1833, 617, + /* 490 */ 1789, 1758, 96, 1802, 584, 1804, 1805, 580, 2, 575, + /* 500 */ 558, 1785, 1879, 617, 177, 176, 1878, 1875, 58, 1089, + /* 510 */ 1833, 57, 1467, 374, 94, 1802, 584, 1804, 1805, 580, + /* 520 */ 668, 575, 343, 1602, 1879, 1781, 1787, 335, 306, 1875, + /* 530 */ 146, 1497, 376, 372, 1350, 1351, 385, 575, 362, 1619, + /* 540 */ 1945, 355, 1091, 1278, 33, 32, 1945, 74, 40, 38, + /* 550 */ 36, 35, 34, 164, 28, 443, 1358, 1942, 439, 1943, + /* 560 */ 33, 32, 1297, 1942, 40, 38, 36, 35, 34, 1613, + /* 570 */ 33, 32, 1771, 303, 40, 38, 36, 35, 34, 1299, + /* 580 */ 1273, 1945, 1271, 33, 32, 11, 10, 40, 38, 36, + /* 590 */ 35, 34, 317, 627, 164, 1496, 167, 307, 1942, 516, + /* 600 */ 1495, 562, 210, 1276, 1277, 560, 1325, 1326, 1328, 1329, + /* 610 */ 1330, 1331, 1332, 1333, 577, 573, 1341, 1342, 1344, 1345, + /* 620 */ 1346, 1347, 1349, 1352, 39, 37, 1801, 1310, 1604, 346, + /* 630 */ 1272, 353, 340, 1372, 1272, 1370, 1771, 146, 1710, 1945, + /* 640 */ 1327, 1771, 1801, 1270, 1594, 1348, 1619, 1270, 318, 175, + /* 650 */ 316, 315, 164, 476, 1819, 255, 1942, 478, 1669, 76, + /* 660 */ 305, 530, 582, 520, 639, 637, 1310, 1771, 1343, 581, + /* 670 */ 1819, 1945, 383, 84, 1668, 1384, 1278, 1592, 557, 477, + /* 680 */ 1278, 517, 1494, 1771, 164, 581, 1016, 1017, 1942, 1617, + /* 690 */ 1371, 1718, 1833, 1600, 1610, 27, 96, 1802, 584, 1804, + /* 700 */ 1805, 580, 8, 575, 1493, 1377, 1879, 1540, 1833, 1492, + /* 710 */ 569, 1875, 95, 1802, 584, 1804, 1805, 580, 252, 575, + /* 720 */ 668, 145, 1879, 1771, 668, 1300, 331, 1875, 159, 33, + /* 730 */ 32, 7, 1491, 40, 38, 36, 35, 34, 1350, 1351, + /* 740 */ 163, 1327, 146, 1408, 1490, 1771, 615, 1716, 1905, 300, + /* 750 */ 1771, 1620, 29, 338, 1365, 1366, 1367, 1368, 1369, 1373, + /* 760 */ 1374, 1375, 1376, 530, 1489, 137, 136, 612, 611, 610, + /* 770 */ 1297, 486, 485, 1771, 384, 1715, 1669, 300, 123, 615, + /* 780 */ 1273, 509, 1271, 312, 1273, 1771, 1271, 90, 481, 484, + /* 790 */ 1486, 1617, 1667, 1485, 480, 1899, 1404, 87, 137, 136, + /* 800 */ 612, 611, 610, 1276, 1277, 1771, 563, 1276, 1277, 1484, + /* 810 */ 1325, 1326, 1328, 1329, 1330, 1331, 1332, 1333, 577, 573, + /* 820 */ 1341, 1342, 1344, 1345, 1346, 1347, 1349, 1352, 39, 37, + /* 830 */ 1353, 1771, 1483, 213, 1771, 1894, 340, 530, 1272, 1801, + /* 840 */ 565, 167, 1608, 530, 1945, 486, 485, 352, 392, 1348, + /* 850 */ 1771, 1270, 123, 1785, 407, 1790, 1482, 165, 530, 1889, + /* 860 */ 1801, 1942, 481, 484, 232, 1617, 1785, 1819, 480, 408, + /* 870 */ 530, 1617, 1343, 1771, 1481, 557, 1480, 1781, 1787, 1488, + /* 880 */ 1771, 451, 581, 1577, 1278, 540, 1617, 1945, 1819, 575, + /* 890 */ 1781, 1787, 613, 44, 4, 1660, 579, 1771, 1617, 1479, + /* 900 */ 164, 1771, 575, 581, 1942, 1833, 9, 1478, 576, 95, + /* 910 */ 1802, 584, 1804, 1805, 580, 1771, 575, 1771, 614, 1879, + /* 920 */ 1404, 1660, 471, 331, 1875, 159, 1833, 1801, 668, 478, + /* 930 */ 293, 1802, 584, 1804, 1805, 580, 578, 575, 572, 1851, + /* 940 */ 1771, 272, 1350, 1351, 1647, 1906, 244, 135, 1771, 1327, + /* 950 */ 530, 477, 33, 32, 386, 1819, 40, 38, 36, 35, + /* 960 */ 34, 452, 201, 582, 608, 199, 530, 387, 1771, 1407, + /* 970 */ 581, 203, 1820, 205, 202, 530, 204, 1614, 1617, 207, + /* 980 */ 351, 530, 206, 53, 513, 530, 503, 571, 1273, 1280, + /* 990 */ 1271, 1511, 510, 1833, 1617, 54, 514, 289, 1802, 584, + /* 1000 */ 1804, 1805, 580, 1617, 575, 307, 11, 10, 1801, 1617, + /* 1010 */ 502, 1276, 1277, 1617, 1325, 1326, 1328, 1329, 1330, 1331, + /* 1020 */ 1332, 1333, 577, 573, 1341, 1342, 1344, 1345, 1346, 1347, + /* 1030 */ 1349, 1352, 39, 37, 1801, 549, 1819, 530, 1527, 1522, + /* 1040 */ 340, 1516, 1272, 1370, 582, 530, 1520, 566, 227, 1771, + /* 1050 */ 1945, 581, 1792, 1348, 216, 1270, 526, 1657, 530, 1056, + /* 1060 */ 487, 489, 1819, 164, 1909, 1617, 554, 1942, 492, 528, + /* 1070 */ 582, 1470, 1471, 1617, 1833, 1771, 1343, 581, 149, 1802, + /* 1080 */ 584, 1804, 1805, 580, 530, 575, 1617, 41, 1278, 663, + /* 1090 */ 77, 249, 1057, 221, 131, 529, 1794, 134, 1371, 254, + /* 1100 */ 1833, 257, 530, 671, 95, 1802, 584, 1804, 1805, 580, + /* 1110 */ 9, 575, 1617, 261, 1879, 259, 530, 267, 331, 1875, + /* 1120 */ 1958, 1362, 559, 1959, 135, 3, 51, 347, 1283, 1936, + /* 1130 */ 1617, 156, 668, 621, 236, 1223, 661, 657, 653, 649, + /* 1140 */ 265, 225, 523, 5, 1617, 229, 1350, 1351, 51, 41, + /* 1150 */ 41, 588, 134, 135, 119, 1075, 134, 356, 622, 313, + /* 1160 */ 29, 338, 1365, 1366, 1367, 1368, 1369, 1373, 1374, 1375, + /* 1170 */ 1376, 361, 1120, 92, 1429, 268, 230, 1239, 174, 388, + /* 1180 */ 1073, 1295, 239, 409, 1712, 416, 423, 424, 425, 429, + /* 1190 */ 431, 433, 1273, 1301, 1271, 434, 1378, 1334, 271, 1148, + /* 1200 */ 1152, 1159, 1157, 442, 138, 1303, 445, 183, 446, 527, + /* 1210 */ 185, 1801, 1302, 447, 1304, 1276, 1277, 188, 1325, 1326, + /* 1220 */ 1328, 1329, 1330, 1331, 1332, 1333, 577, 573, 1341, 1342, + /* 1230 */ 1344, 1345, 1346, 1347, 1349, 1352, 39, 37, 190, 1819, + /* 1240 */ 450, 448, 219, 72, 340, 73, 1272, 582, 454, 194, + /* 1250 */ 473, 475, 1771, 1607, 581, 198, 1603, 1348, 200, 1270, + /* 1260 */ 1246, 304, 212, 118, 140, 1751, 141, 1605, 269, 504, + /* 1270 */ 1601, 142, 143, 505, 211, 508, 214, 1833, 511, 515, + /* 1280 */ 1343, 96, 1802, 584, 1804, 1805, 580, 218, 575, 323, + /* 1290 */ 518, 1879, 1278, 538, 524, 81, 1876, 132, 1750, 147, + /* 1300 */ 525, 1722, 521, 133, 278, 337, 336, 270, 325, 83, + /* 1310 */ 1618, 1300, 541, 534, 2, 1286, 1910, 1920, 276, 60, + /* 1320 */ 234, 536, 59, 537, 1919, 330, 1348, 238, 1279, 544, + /* 1330 */ 6, 550, 532, 535, 1901, 1299, 668, 533, 180, 432, + /* 1340 */ 430, 1801, 248, 1404, 126, 567, 564, 153, 48, 1343, + /* 1350 */ 1350, 1351, 85, 332, 243, 1895, 586, 245, 246, 1661, + /* 1360 */ 273, 1278, 1590, 664, 247, 665, 264, 667, 52, 1819, + /* 1370 */ 277, 63, 1860, 253, 324, 299, 286, 582, 275, 296, + /* 1380 */ 1941, 1765, 1771, 295, 581, 1764, 65, 561, 1763, 1762, + /* 1390 */ 1961, 568, 256, 66, 1759, 358, 1273, 258, 1271, 359, + /* 1400 */ 1264, 1265, 170, 363, 1757, 570, 365, 1833, 366, 93, + /* 1410 */ 367, 294, 1802, 584, 1804, 1805, 580, 1756, 575, 1276, + /* 1420 */ 1277, 1801, 1325, 1326, 1328, 1329, 1330, 1331, 1332, 1333, + /* 1430 */ 577, 573, 1341, 1342, 1344, 1345, 1346, 1347, 1349, 1352, + /* 1440 */ 369, 1755, 1801, 371, 1754, 68, 67, 382, 373, 1819, + /* 1450 */ 171, 1753, 1242, 375, 531, 1241, 1733, 582, 380, 381, + /* 1460 */ 1731, 1730, 1771, 1732, 581, 1287, 301, 1282, 1211, 370, + /* 1470 */ 1819, 368, 364, 360, 357, 354, 129, 1702, 582, 1705, + /* 1480 */ 1704, 1703, 1701, 1771, 1700, 581, 69, 1833, 1290, 1292, + /* 1490 */ 1699, 294, 1802, 584, 1804, 1805, 580, 1698, 575, 1697, + /* 1500 */ 573, 1341, 1342, 1344, 1345, 1346, 1347, 1696, 1833, 1695, + /* 1510 */ 167, 1694, 95, 1802, 584, 1804, 1805, 580, 399, 575, + /* 1520 */ 398, 401, 1879, 1693, 1692, 1801, 331, 1875, 1958, 1691, + /* 1530 */ 1690, 1689, 1688, 1687, 1686, 1685, 1684, 1898, 1683, 1682, + /* 1540 */ 1681, 1801, 1680, 130, 1679, 1678, 1677, 1676, 1675, 1674, + /* 1550 */ 1213, 1673, 1672, 1819, 1671, 1670, 1542, 1541, 178, 179, + /* 1560 */ 1539, 582, 1507, 181, 120, 157, 1771, 1019, 581, 1819, + /* 1570 */ 1506, 1746, 1018, 438, 1740, 1729, 189, 582, 1049, 1538, + /* 1580 */ 121, 558, 1771, 440, 581, 1728, 1714, 1596, 1536, 1534, + /* 1590 */ 182, 1833, 1532, 1530, 455, 285, 1802, 584, 1804, 1805, + /* 1600 */ 580, 459, 575, 187, 457, 1519, 461, 1833, 456, 1801, + /* 1610 */ 460, 149, 1802, 584, 1804, 1805, 580, 463, 575, 464, + /* 1620 */ 465, 1945, 469, 468, 1518, 1801, 467, 1503, 1598, 1163, + /* 1630 */ 1162, 1597, 1088, 1087, 166, 1082, 1084, 1819, 1942, 636, + /* 1640 */ 1528, 1083, 50, 638, 319, 582, 1523, 320, 490, 1521, + /* 1650 */ 1771, 321, 581, 1819, 493, 1502, 1960, 1501, 495, 1500, + /* 1660 */ 1745, 579, 97, 499, 56, 558, 1771, 497, 581, 1248, + /* 1670 */ 197, 1739, 506, 144, 507, 1833, 215, 1727, 1725, 285, + /* 1680 */ 1802, 584, 1804, 1805, 580, 1726, 575, 1801, 1256, 1721, + /* 1690 */ 519, 1833, 1724, 1723, 15, 293, 1802, 584, 1804, 1805, + /* 1700 */ 580, 220, 575, 1713, 1852, 1945, 1801, 226, 79, 80, + /* 1710 */ 82, 87, 231, 242, 1792, 1819, 41, 47, 164, 16, + /* 1720 */ 339, 1444, 1942, 582, 235, 23, 522, 322, 1771, 233, + /* 1730 */ 581, 45, 251, 237, 1819, 228, 1426, 151, 512, 341, + /* 1740 */ 241, 240, 582, 1428, 24, 25, 86, 1771, 1456, 581, + /* 1750 */ 17, 46, 1421, 1833, 1401, 1400, 1791, 294, 1802, 584, + /* 1760 */ 1804, 1805, 580, 154, 575, 18, 1461, 1801, 196, 1455, + /* 1770 */ 1450, 333, 1833, 1460, 1459, 334, 294, 1802, 584, 1804, + /* 1780 */ 1805, 580, 152, 575, 553, 1801, 1288, 470, 466, 462, + /* 1790 */ 458, 195, 10, 19, 1836, 1819, 574, 1363, 1338, 155, + /* 1800 */ 1336, 31, 12, 582, 168, 1335, 20, 1318, 1771, 583, + /* 1810 */ 581, 21, 127, 1819, 1149, 587, 585, 13, 342, 589, + /* 1820 */ 592, 582, 1146, 591, 75, 1126, 1771, 193, 581, 594, + /* 1830 */ 597, 595, 558, 1833, 1143, 1801, 1137, 279, 1802, 584, + /* 1840 */ 1804, 1805, 580, 1135, 575, 598, 600, 601, 607, 1158, + /* 1850 */ 125, 1833, 88, 89, 1154, 280, 1802, 584, 1804, 1805, + /* 1860 */ 580, 1141, 575, 1819, 62, 250, 1887, 552, 1140, 551, + /* 1870 */ 1139, 582, 1945, 1138, 262, 1047, 1771, 616, 581, 1079, + /* 1880 */ 1078, 1077, 1076, 1074, 1072, 164, 1071, 1801, 1070, 1942, + /* 1890 */ 192, 186, 1095, 191, 626, 1068, 1067, 449, 263, 1066, + /* 1900 */ 1065, 1833, 1064, 1063, 1062, 281, 1802, 584, 1804, 1805, + /* 1910 */ 580, 1092, 575, 184, 1090, 1819, 1059, 1058, 1055, 1054, + /* 1920 */ 1053, 1052, 1535, 582, 646, 647, 648, 1533, 1771, 650, + /* 1930 */ 581, 1531, 651, 1529, 652, 1801, 654, 655, 656, 658, + /* 1940 */ 659, 660, 1517, 662, 1009, 1499, 266, 1801, 1274, 666, + /* 1950 */ 670, 274, 1474, 1833, 1474, 669, 1474, 288, 1802, 584, + /* 1960 */ 1804, 1805, 580, 1819, 575, 1474, 1474, 1474, 1474, 1474, + /* 1970 */ 1474, 582, 1474, 1474, 1474, 1819, 1771, 1474, 581, 1474, + /* 1980 */ 1474, 1474, 1474, 582, 1474, 1474, 1474, 1474, 1771, 1474, + /* 1990 */ 581, 1474, 1474, 1474, 1474, 1474, 1474, 1801, 1474, 1474, + /* 2000 */ 1474, 1833, 1474, 1474, 1474, 290, 1802, 584, 1804, 1805, + /* 2010 */ 580, 1474, 575, 1833, 1801, 1474, 1474, 282, 1802, 584, + /* 2020 */ 1804, 1805, 580, 1474, 575, 1819, 1474, 1474, 1474, 1474, + /* 2030 */ 1474, 1474, 1474, 582, 1474, 1474, 1474, 1474, 1771, 1474, + /* 2040 */ 581, 1474, 1819, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2050 */ 582, 1474, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, + /* 2060 */ 1474, 1474, 1474, 1833, 1474, 1474, 1474, 291, 1802, 584, + /* 2070 */ 1804, 1805, 580, 1474, 575, 1474, 1474, 1801, 1474, 1474, + /* 2080 */ 1833, 1474, 1474, 1474, 283, 1802, 584, 1804, 1805, 580, + /* 2090 */ 1474, 575, 1474, 1801, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2100 */ 1474, 1474, 1474, 1474, 1474, 1819, 1474, 1474, 1474, 1474, + /* 2110 */ 1474, 1474, 1474, 582, 1474, 1474, 1474, 1474, 1771, 1474, + /* 2120 */ 581, 1819, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 582, + /* 2130 */ 1474, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, 1474, + /* 2140 */ 1474, 1474, 1474, 1833, 1474, 1801, 1474, 292, 1802, 584, + /* 2150 */ 1804, 1805, 580, 1474, 575, 1474, 1474, 1474, 1474, 1833, + /* 2160 */ 1474, 1801, 1474, 284, 1802, 584, 1804, 1805, 580, 1474, + /* 2170 */ 575, 1474, 1474, 1819, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2180 */ 1474, 582, 1474, 1474, 1474, 1474, 1771, 1474, 581, 1819, + /* 2190 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 582, 1474, 1474, + /* 2200 */ 1474, 1801, 1771, 1474, 581, 1474, 1474, 1474, 1474, 1474, + /* 2210 */ 1474, 1833, 1474, 1474, 1474, 297, 1802, 584, 1804, 1805, + /* 2220 */ 580, 1474, 575, 1801, 1474, 1474, 1474, 1833, 1474, 1819, + /* 2230 */ 1474, 298, 1802, 584, 1804, 1805, 580, 582, 575, 1474, + /* 2240 */ 1474, 1474, 1771, 1474, 581, 1474, 1474, 1474, 1474, 1474, + /* 2250 */ 1474, 1819, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 582, + /* 2260 */ 1474, 1474, 1474, 1801, 1771, 1474, 581, 1833, 1474, 1474, + /* 2270 */ 1474, 1813, 1802, 584, 1804, 1805, 580, 1474, 575, 1474, + /* 2280 */ 1474, 1801, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1833, + /* 2290 */ 1474, 1819, 1474, 1812, 1802, 584, 1804, 1805, 580, 582, + /* 2300 */ 575, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, 1819, + /* 2310 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 582, 1474, 1474, + /* 2320 */ 1474, 1474, 1771, 1474, 581, 1474, 1474, 1474, 1474, 1833, + /* 2330 */ 1474, 1801, 1474, 1811, 1802, 584, 1804, 1805, 580, 1474, + /* 2340 */ 575, 1474, 1474, 1801, 1474, 1474, 1474, 1833, 1474, 1474, + /* 2350 */ 1474, 310, 1802, 584, 1804, 1805, 580, 1474, 575, 1819, + /* 2360 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 582, 1474, 1474, + /* 2370 */ 1474, 1819, 1771, 1474, 581, 1474, 1474, 1474, 1474, 582, + /* 2380 */ 1474, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, 1474, + /* 2390 */ 1474, 1474, 1474, 1474, 1801, 1474, 1474, 1833, 1474, 1474, + /* 2400 */ 1474, 309, 1802, 584, 1804, 1805, 580, 1474, 575, 1833, + /* 2410 */ 1474, 1474, 1474, 311, 1802, 584, 1804, 1805, 580, 1474, + /* 2420 */ 575, 1474, 1819, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2430 */ 582, 1474, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, + /* 2440 */ 1474, 1474, 1474, 1474, 1801, 1474, 1474, 1474, 1474, 1474, + /* 2450 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2460 */ 1833, 1474, 1474, 1474, 308, 1802, 584, 1804, 1805, 580, + /* 2470 */ 1474, 575, 1819, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2480 */ 582, 1474, 1474, 1474, 1474, 1771, 1474, 581, 1474, 1474, + /* 2490 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2500 */ 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, + /* 2510 */ 1833, 1474, 1474, 1474, 287, 1802, 584, 1804, 1805, 580, + /* 2520 */ 1474, 575, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 312, 404, 314, 315, 337, 312, 316, 314, 315, 351, - /* 10 */ 389, 390, 12, 13, 417, 328, 358, 327, 421, 361, - /* 20 */ 20, 0, 22, 336, 334, 12, 13, 14, 15, 16, - /* 30 */ 308, 20, 345, 33, 344, 35, 347, 20, 20, 350, - /* 40 */ 351, 364, 21, 338, 316, 24, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 349, 327, 56, 313, 336, 4, - /* 60 */ 316, 61, 334, 14, 15, 16, 344, 307, 68, 309, - /* 70 */ 60, 349, 344, 351, 12, 13, 14, 338, 373, 374, - /* 80 */ 375, 404, 20, 0, 22, 336, 56, 20, 349, 89, - /* 90 */ 385, 4, 336, 344, 417, 33, 374, 35, 421, 343, - /* 100 */ 378, 379, 380, 381, 382, 383, 89, 385, 352, 335, - /* 110 */ 388, 111, 373, 374, 392, 393, 394, 351, 56, 89, - /* 120 */ 404, 91, 348, 61, 385, 125, 126, 361, 406, 380, - /* 130 */ 68, 44, 45, 417, 8, 9, 414, 421, 12, 13, - /* 140 */ 14, 15, 16, 20, 89, 89, 63, 64, 65, 66, - /* 150 */ 67, 89, 69, 70, 71, 72, 73, 74, 75, 76, - /* 160 */ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - /* 170 */ 170, 21, 172, 111, 24, 25, 26, 27, 28, 29, - /* 180 */ 30, 31, 32, 313, 338, 20, 316, 125, 126, 120, - /* 190 */ 121, 1, 2, 193, 194, 349, 196, 197, 198, 199, + /* 0 */ 352, 309, 313, 317, 315, 316, 365, 359, 0, 4, + /* 10 */ 362, 317, 12, 13, 328, 338, 313, 317, 315, 316, + /* 20 */ 20, 335, 22, 0, 12, 13, 14, 15, 16, 337, + /* 30 */ 317, 345, 317, 33, 20, 35, 22, 345, 317, 345, + /* 40 */ 20, 328, 350, 328, 352, 345, 405, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 56, 365, 345, 418, + /* 60 */ 345, 61, 329, 422, 50, 365, 345, 375, 68, 0, + /* 70 */ 337, 379, 380, 381, 382, 383, 384, 383, 386, 346, + /* 80 */ 308, 389, 310, 383, 309, 393, 394, 20, 4, 35, + /* 90 */ 90, 397, 398, 399, 400, 90, 402, 405, 398, 399, + /* 100 */ 400, 337, 402, 348, 383, 405, 351, 352, 344, 322, + /* 110 */ 418, 0, 112, 326, 422, 60, 337, 353, 418, 398, + /* 120 */ 399, 400, 422, 402, 345, 350, 126, 127, 44, 45, + /* 130 */ 390, 391, 63, 64, 65, 66, 67, 0, 69, 70, + /* 140 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + /* 150 */ 81, 82, 83, 84, 85, 86, 87, 325, 21, 327, + /* 160 */ 381, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 170 */ 20, 60, 172, 377, 174, 103, 104, 105, 106, 107, + /* 180 */ 108, 109, 110, 111, 112, 113, 157, 115, 116, 117, + /* 190 */ 118, 119, 120, 126, 127, 195, 196, 401, 198, 199, /* 200 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - /* 210 */ 210, 211, 212, 213, 0, 21, 90, 8, 9, 373, - /* 220 */ 374, 12, 13, 14, 15, 16, 316, 227, 34, 321, - /* 230 */ 36, 385, 170, 325, 172, 22, 121, 327, 24, 25, - /* 240 */ 26, 27, 28, 29, 30, 31, 32, 178, 35, 89, - /* 250 */ 181, 360, 43, 362, 344, 193, 194, 227, 196, 197, - /* 260 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - /* 270 */ 208, 209, 210, 211, 212, 213, 12, 13, 350, 351, - /* 280 */ 90, 68, 227, 227, 20, 20, 22, 60, 20, 89, - /* 290 */ 125, 126, 177, 178, 308, 308, 181, 33, 193, 35, - /* 300 */ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - /* 310 */ 112, 328, 114, 115, 116, 117, 118, 119, 20, 336, - /* 320 */ 56, 0, 336, 56, 111, 61, 322, 323, 345, 169, - /* 330 */ 344, 171, 68, 336, 404, 349, 349, 351, 12, 13, - /* 340 */ 343, 236, 237, 238, 239, 240, 20, 417, 22, 352, - /* 350 */ 0, 421, 318, 89, 89, 88, 336, 89, 91, 33, - /* 360 */ 374, 35, 68, 343, 378, 379, 380, 381, 382, 383, - /* 370 */ 100, 385, 352, 339, 388, 111, 328, 337, 392, 393, - /* 380 */ 394, 20, 56, 170, 336, 172, 20, 227, 22, 125, - /* 390 */ 126, 8, 9, 345, 68, 12, 13, 14, 15, 16, - /* 400 */ 414, 404, 316, 12, 13, 14, 193, 194, 308, 308, - /* 410 */ 101, 20, 308, 22, 417, 89, 50, 14, 421, 322, - /* 420 */ 323, 35, 101, 20, 33, 68, 35, 227, 316, 120, - /* 430 */ 121, 122, 123, 124, 170, 344, 172, 111, 308, 353, - /* 440 */ 336, 120, 121, 122, 123, 124, 355, 56, 344, 349, - /* 450 */ 349, 125, 126, 349, 68, 351, 344, 193, 194, 68, - /* 460 */ 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - /* 470 */ 206, 207, 208, 209, 210, 211, 212, 213, 374, 349, - /* 480 */ 89, 337, 378, 379, 380, 381, 382, 383, 384, 385, - /* 490 */ 386, 387, 227, 320, 382, 227, 170, 120, 172, 8, - /* 500 */ 9, 0, 111, 12, 13, 14, 15, 16, 396, 397, - /* 510 */ 398, 399, 337, 401, 308, 342, 125, 126, 157, 193, - /* 520 */ 194, 0, 196, 197, 198, 199, 200, 201, 202, 203, - /* 530 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - /* 540 */ 360, 316, 362, 8, 9, 162, 318, 12, 13, 14, - /* 550 */ 15, 16, 327, 227, 37, 349, 179, 180, 324, 331, - /* 560 */ 326, 170, 376, 172, 2, 64, 65, 339, 305, 344, - /* 570 */ 8, 9, 71, 0, 12, 13, 14, 15, 16, 337, - /* 580 */ 308, 90, 81, 82, 193, 194, 400, 196, 197, 198, - /* 590 */ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - /* 600 */ 209, 210, 211, 212, 213, 12, 13, 101, 336, 92, - /* 610 */ 336, 94, 95, 20, 97, 22, 344, 152, 101, 345, - /* 620 */ 316, 349, 101, 351, 2, 90, 33, 364, 35, 123, - /* 630 */ 8, 9, 249, 60, 12, 13, 14, 15, 16, 155, - /* 640 */ 123, 120, 121, 122, 123, 124, 374, 344, 344, 56, - /* 650 */ 378, 379, 380, 381, 382, 383, 337, 385, 355, 320, - /* 660 */ 388, 68, 316, 346, 392, 393, 349, 404, 364, 364, - /* 670 */ 8, 9, 333, 327, 12, 13, 14, 15, 16, 214, - /* 680 */ 417, 342, 89, 308, 421, 20, 382, 22, 39, 224, - /* 690 */ 344, 8, 9, 308, 325, 12, 13, 14, 15, 16, - /* 700 */ 35, 397, 398, 399, 111, 401, 8, 9, 404, 404, - /* 710 */ 12, 13, 14, 15, 16, 50, 232, 233, 125, 126, - /* 720 */ 316, 417, 417, 61, 349, 421, 421, 43, 4, 14, - /* 730 */ 316, 327, 12, 13, 349, 20, 308, 18, 376, 20, - /* 740 */ 20, 327, 22, 19, 61, 316, 27, 337, 344, 30, - /* 750 */ 316, 316, 90, 33, 309, 35, 327, 33, 344, 3, - /* 760 */ 98, 327, 400, 170, 165, 172, 47, 308, 49, 308, - /* 770 */ 51, 47, 424, 344, 90, 51, 56, 349, 344, 344, - /* 780 */ 56, 98, 308, 184, 185, 77, 193, 194, 68, 196, - /* 790 */ 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - /* 800 */ 207, 208, 209, 210, 211, 212, 213, 88, 349, 89, - /* 810 */ 349, 4, 88, 316, 152, 91, 376, 382, 368, 100, - /* 820 */ 20, 8, 9, 349, 327, 12, 13, 14, 15, 16, - /* 830 */ 308, 111, 397, 398, 399, 152, 401, 129, 130, 0, - /* 840 */ 400, 344, 14, 44, 45, 125, 126, 128, 20, 0, - /* 850 */ 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - /* 860 */ 141, 142, 143, 144, 145, 146, 147, 148, 316, 150, - /* 870 */ 151, 349, 336, 13, 308, 226, 214, 215, 216, 217, - /* 880 */ 218, 219, 220, 221, 222, 223, 224, 48, 352, 317, - /* 890 */ 170, 346, 172, 20, 349, 35, 344, 214, 215, 216, - /* 900 */ 217, 218, 219, 220, 221, 222, 223, 224, 329, 60, - /* 910 */ 415, 332, 197, 193, 194, 349, 196, 197, 198, 199, - /* 920 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - /* 930 */ 210, 211, 212, 213, 382, 18, 308, 308, 43, 364, - /* 940 */ 23, 364, 225, 226, 0, 64, 65, 0, 338, 397, - /* 950 */ 398, 399, 71, 401, 37, 38, 336, 157, 41, 349, - /* 960 */ 316, 316, 81, 82, 308, 336, 42, 43, 411, 22, - /* 970 */ 157, 327, 327, 344, 57, 58, 59, 349, 349, 404, - /* 980 */ 351, 404, 315, 373, 374, 375, 308, 308, 344, 344, - /* 990 */ 316, 47, 417, 364, 417, 385, 421, 56, 421, 364, - /* 1000 */ 244, 327, 308, 374, 308, 349, 89, 378, 379, 380, - /* 1010 */ 381, 382, 383, 316, 385, 336, 43, 388, 344, 12, - /* 1020 */ 13, 392, 393, 344, 327, 197, 316, 349, 349, 22, - /* 1030 */ 351, 93, 91, 404, 96, 228, 348, 327, 316, 404, - /* 1040 */ 33, 344, 35, 349, 127, 349, 417, 0, 308, 327, - /* 1050 */ 421, 317, 417, 374, 344, 308, 421, 378, 379, 380, - /* 1060 */ 381, 382, 383, 56, 385, 316, 344, 388, 43, 22, - /* 1070 */ 197, 392, 393, 394, 316, 68, 327, 157, 158, 162, - /* 1080 */ 163, 164, 403, 336, 167, 327, 43, 93, 316, 349, - /* 1090 */ 96, 344, 93, 344, 93, 96, 349, 96, 351, 327, - /* 1100 */ 183, 0, 344, 186, 377, 188, 189, 190, 191, 192, - /* 1110 */ 35, 364, 43, 316, 308, 90, 344, 35, 111, 61, - /* 1120 */ 316, 374, 43, 22, 327, 378, 379, 380, 381, 382, - /* 1130 */ 383, 327, 385, 90, 43, 388, 43, 402, 19, 392, - /* 1140 */ 393, 344, 336, 248, 227, 43, 43, 341, 344, 43, - /* 1150 */ 344, 404, 33, 89, 308, 349, 13, 351, 43, 90, - /* 1160 */ 46, 1, 2, 99, 417, 395, 47, 405, 421, 90, - /* 1170 */ 418, 52, 53, 54, 55, 56, 43, 170, 35, 172, - /* 1180 */ 374, 90, 336, 90, 378, 379, 380, 381, 382, 383, - /* 1190 */ 344, 385, 90, 90, 308, 349, 90, 351, 125, 126, - /* 1200 */ 193, 194, 418, 89, 418, 90, 43, 88, 43, 229, - /* 1210 */ 91, 35, 205, 206, 207, 208, 209, 210, 211, 246, - /* 1220 */ 374, 47, 336, 90, 378, 379, 380, 381, 382, 383, - /* 1230 */ 344, 385, 366, 372, 388, 349, 43, 351, 392, 393, - /* 1240 */ 394, 43, 316, 124, 68, 371, 168, 172, 42, 403, - /* 1250 */ 356, 193, 20, 90, 172, 90, 316, 356, 316, 152, - /* 1260 */ 374, 354, 354, 308, 378, 379, 380, 381, 382, 383, - /* 1270 */ 344, 385, 316, 316, 388, 156, 316, 20, 392, 393, - /* 1280 */ 394, 310, 310, 90, 20, 370, 320, 351, 90, 403, - /* 1290 */ 364, 336, 20, 174, 320, 176, 363, 20, 320, 344, - /* 1300 */ 365, 320, 363, 320, 349, 320, 351, 316, 382, 320, - /* 1310 */ 310, 336, 336, 336, 316, 336, 310, 308, 336, 364, - /* 1320 */ 336, 370, 336, 397, 398, 399, 336, 401, 336, 374, - /* 1330 */ 404, 336, 336, 378, 379, 380, 381, 382, 383, 318, - /* 1340 */ 385, 175, 349, 417, 318, 336, 316, 421, 351, 316, - /* 1350 */ 318, 363, 234, 344, 349, 154, 369, 349, 349, 404, - /* 1360 */ 351, 359, 349, 349, 349, 20, 318, 308, 357, 359, - /* 1370 */ 332, 318, 417, 364, 235, 344, 421, 349, 410, 359, - /* 1380 */ 377, 359, 241, 374, 308, 349, 349, 378, 379, 380, - /* 1390 */ 381, 382, 383, 349, 385, 336, 161, 243, 349, 242, - /* 1400 */ 230, 372, 20, 344, 226, 344, 247, 245, 349, 89, - /* 1410 */ 351, 376, 336, 404, 410, 89, 349, 250, 326, 36, - /* 1420 */ 344, 340, 318, 311, 412, 349, 417, 351, 410, 413, - /* 1430 */ 421, 407, 409, 374, 308, 408, 419, 378, 379, 380, - /* 1440 */ 381, 382, 383, 391, 385, 316, 310, 388, 362, 319, - /* 1450 */ 374, 392, 393, 419, 378, 379, 380, 381, 382, 383, - /* 1460 */ 308, 385, 336, 367, 425, 420, 420, 330, 330, 419, - /* 1470 */ 344, 420, 330, 0, 306, 349, 0, 351, 177, 0, - /* 1480 */ 0, 42, 0, 35, 187, 35, 35, 35, 336, 187, - /* 1490 */ 0, 35, 35, 341, 187, 0, 344, 187, 422, 423, - /* 1500 */ 374, 349, 0, 351, 378, 379, 380, 381, 382, 383, - /* 1510 */ 308, 385, 35, 0, 388, 22, 0, 170, 35, 393, - /* 1520 */ 172, 0, 308, 166, 165, 0, 374, 0, 0, 0, - /* 1530 */ 378, 379, 380, 381, 382, 383, 308, 385, 336, 0, - /* 1540 */ 46, 42, 0, 0, 149, 0, 344, 144, 0, 35, - /* 1550 */ 336, 349, 0, 351, 0, 0, 0, 144, 344, 0, - /* 1560 */ 0, 0, 0, 349, 336, 351, 0, 0, 0, 0, - /* 1570 */ 0, 0, 344, 0, 0, 0, 374, 349, 0, 351, - /* 1580 */ 378, 379, 380, 381, 382, 383, 42, 385, 374, 308, - /* 1590 */ 0, 0, 378, 379, 380, 381, 382, 383, 0, 385, - /* 1600 */ 0, 0, 374, 22, 0, 0, 378, 379, 380, 381, - /* 1610 */ 382, 383, 0, 385, 0, 387, 0, 336, 416, 0, - /* 1620 */ 56, 0, 341, 39, 42, 344, 33, 0, 56, 0, - /* 1630 */ 349, 43, 351, 46, 14, 46, 14, 423, 0, 40, - /* 1640 */ 47, 39, 308, 35, 47, 52, 53, 54, 55, 56, - /* 1650 */ 0, 0, 0, 161, 308, 374, 39, 0, 0, 378, - /* 1660 */ 379, 380, 381, 382, 383, 0, 385, 0, 308, 62, - /* 1670 */ 336, 0, 39, 0, 35, 341, 39, 47, 344, 0, - /* 1680 */ 35, 88, 336, 349, 91, 351, 39, 47, 0, 35, - /* 1690 */ 344, 47, 39, 0, 0, 349, 336, 351, 0, 0, - /* 1700 */ 22, 35, 96, 0, 344, 35, 22, 98, 374, 349, - /* 1710 */ 0, 351, 378, 379, 380, 381, 382, 383, 43, 385, - /* 1720 */ 374, 35, 308, 43, 378, 379, 380, 381, 382, 383, - /* 1730 */ 35, 385, 0, 22, 374, 22, 308, 0, 378, 379, - /* 1740 */ 380, 381, 382, 383, 22, 385, 153, 154, 308, 156, - /* 1750 */ 336, 49, 35, 160, 0, 35, 0, 0, 344, 35, - /* 1760 */ 22, 20, 0, 349, 336, 351, 35, 157, 0, 176, - /* 1770 */ 22, 0, 344, 0, 159, 157, 336, 349, 154, 351, - /* 1780 */ 0, 0, 157, 0, 344, 89, 173, 90, 374, 349, - /* 1790 */ 35, 351, 378, 379, 380, 381, 382, 383, 0, 385, - /* 1800 */ 0, 89, 374, 155, 89, 308, 378, 379, 380, 381, - /* 1810 */ 382, 383, 153, 385, 374, 308, 182, 39, 378, 379, - /* 1820 */ 380, 381, 382, 383, 89, 385, 99, 43, 46, 89, - /* 1830 */ 43, 308, 90, 336, 89, 43, 90, 90, 89, 46, - /* 1840 */ 90, 344, 231, 336, 43, 46, 349, 89, 351, 89, - /* 1850 */ 89, 344, 43, 90, 89, 308, 349, 231, 351, 336, - /* 1860 */ 90, 46, 90, 46, 46, 90, 225, 344, 43, 90, - /* 1870 */ 35, 374, 349, 231, 351, 378, 379, 380, 381, 382, - /* 1880 */ 383, 374, 385, 336, 35, 378, 379, 380, 381, 382, - /* 1890 */ 383, 344, 385, 35, 35, 35, 349, 374, 351, 35, - /* 1900 */ 2, 378, 379, 380, 381, 382, 383, 22, 385, 193, - /* 1910 */ 43, 308, 89, 22, 90, 89, 46, 90, 89, 100, - /* 1920 */ 90, 374, 89, 89, 46, 378, 379, 380, 381, 382, - /* 1930 */ 383, 308, 385, 89, 35, 90, 35, 89, 195, 336, - /* 1940 */ 90, 35, 89, 35, 90, 89, 35, 344, 35, 113, - /* 1950 */ 89, 308, 349, 90, 351, 90, 113, 89, 22, 336, - /* 1960 */ 113, 89, 35, 101, 113, 89, 89, 344, 43, 22, - /* 1970 */ 61, 308, 349, 35, 351, 35, 62, 374, 35, 336, - /* 1980 */ 35, 378, 379, 380, 381, 382, 383, 344, 385, 35, - /* 1990 */ 35, 308, 349, 35, 351, 43, 68, 374, 35, 336, - /* 2000 */ 35, 378, 379, 380, 381, 382, 383, 344, 385, 87, - /* 2010 */ 22, 35, 349, 22, 351, 35, 35, 374, 68, 336, - /* 2020 */ 35, 378, 379, 380, 381, 382, 383, 344, 385, 35, - /* 2030 */ 35, 308, 349, 35, 351, 35, 22, 374, 35, 0, - /* 2040 */ 35, 378, 379, 380, 381, 382, 383, 308, 385, 47, - /* 2050 */ 39, 0, 35, 47, 39, 0, 35, 374, 39, 336, - /* 2060 */ 47, 378, 379, 380, 381, 382, 383, 344, 385, 0, - /* 2070 */ 35, 47, 349, 39, 351, 336, 0, 35, 35, 0, - /* 2080 */ 22, 21, 21, 344, 22, 22, 20, 426, 349, 426, - /* 2090 */ 351, 426, 426, 426, 426, 426, 426, 374, 308, 426, - /* 2100 */ 426, 378, 379, 380, 381, 382, 383, 426, 385, 426, - /* 2110 */ 426, 426, 426, 374, 308, 426, 426, 378, 379, 380, - /* 2120 */ 381, 382, 383, 426, 385, 426, 336, 426, 426, 426, - /* 2130 */ 426, 426, 426, 426, 344, 426, 426, 426, 426, 349, - /* 2140 */ 426, 351, 336, 426, 426, 426, 426, 426, 426, 426, - /* 2150 */ 344, 426, 426, 426, 426, 349, 426, 351, 426, 426, - /* 2160 */ 426, 426, 426, 426, 374, 308, 426, 426, 378, 379, - /* 2170 */ 380, 381, 382, 383, 426, 385, 426, 426, 426, 426, - /* 2180 */ 374, 308, 426, 426, 378, 379, 380, 381, 382, 383, - /* 2190 */ 426, 385, 426, 336, 426, 426, 426, 426, 426, 426, - /* 2200 */ 426, 344, 426, 426, 426, 426, 349, 426, 351, 336, - /* 2210 */ 426, 426, 426, 426, 426, 426, 426, 344, 426, 426, - /* 2220 */ 426, 426, 349, 426, 351, 426, 426, 426, 426, 426, - /* 2230 */ 426, 374, 426, 426, 426, 378, 379, 380, 381, 382, - /* 2240 */ 383, 426, 385, 426, 426, 426, 426, 374, 426, 426, - /* 2250 */ 426, 378, 379, 380, 381, 382, 383, 426, 385, 426, - /* 2260 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2270 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2280 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2290 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2300 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2310 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2320 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2330 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2340 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2350 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2360 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2370 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2380 */ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - /* 2390 */ 426, 426, + /* 210 */ 210, 211, 212, 213, 214, 215, 12, 13, 14, 405, + /* 220 */ 339, 18, 336, 20, 20, 309, 22, 121, 174, 229, + /* 230 */ 27, 350, 418, 30, 229, 349, 422, 33, 21, 35, + /* 240 */ 90, 24, 25, 26, 27, 28, 29, 30, 31, 32, + /* 250 */ 47, 20, 49, 337, 51, 374, 375, 376, 321, 20, + /* 260 */ 56, 345, 20, 234, 235, 61, 350, 386, 352, 8, + /* 270 */ 9, 334, 68, 12, 13, 14, 15, 16, 8, 9, + /* 280 */ 343, 56, 12, 13, 14, 15, 16, 181, 182, 20, + /* 290 */ 405, 375, 89, 319, 90, 379, 380, 381, 382, 383, + /* 300 */ 384, 90, 386, 418, 101, 389, 332, 422, 20, 393, + /* 310 */ 394, 395, 351, 352, 340, 90, 112, 92, 8, 9, + /* 320 */ 404, 90, 12, 13, 14, 15, 16, 14, 195, 90, + /* 330 */ 126, 127, 129, 20, 90, 132, 133, 134, 135, 136, + /* 340 */ 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + /* 350 */ 147, 148, 149, 43, 151, 152, 153, 323, 324, 8, + /* 360 */ 9, 91, 3, 12, 13, 14, 15, 16, 20, 317, + /* 370 */ 22, 238, 239, 240, 241, 242, 172, 345, 174, 2, + /* 380 */ 328, 20, 171, 35, 173, 8, 9, 335, 356, 12, + /* 390 */ 13, 14, 15, 16, 121, 122, 317, 345, 50, 195, + /* 400 */ 196, 56, 198, 199, 200, 201, 202, 203, 204, 205, + /* 410 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + /* 420 */ 12, 13, 309, 4, 345, 164, 102, 101, 20, 0, + /* 430 */ 22, 14, 15, 16, 89, 377, 314, 92, 19, 317, + /* 440 */ 229, 33, 91, 35, 309, 121, 122, 123, 124, 125, + /* 450 */ 337, 77, 33, 180, 229, 14, 183, 90, 345, 401, + /* 460 */ 229, 20, 383, 350, 56, 352, 47, 337, 229, 61, + /* 470 */ 51, 21, 337, 229, 344, 56, 68, 398, 399, 400, + /* 480 */ 345, 402, 306, 353, 34, 350, 36, 352, 375, 60, + /* 490 */ 339, 0, 379, 380, 381, 382, 383, 384, 90, 386, + /* 500 */ 365, 350, 389, 60, 130, 131, 393, 394, 89, 35, + /* 510 */ 375, 92, 251, 167, 379, 380, 381, 382, 383, 384, + /* 520 */ 112, 386, 329, 338, 389, 374, 375, 376, 393, 394, + /* 530 */ 337, 309, 186, 187, 126, 127, 317, 386, 47, 346, + /* 540 */ 405, 365, 68, 68, 8, 9, 405, 321, 12, 13, + /* 550 */ 14, 15, 16, 418, 2, 314, 14, 422, 317, 418, + /* 560 */ 8, 9, 20, 422, 12, 13, 14, 15, 16, 343, + /* 570 */ 8, 9, 350, 354, 12, 13, 14, 15, 16, 20, + /* 580 */ 172, 405, 174, 8, 9, 1, 2, 12, 13, 14, + /* 590 */ 15, 16, 37, 68, 418, 309, 229, 61, 422, 365, + /* 600 */ 309, 43, 122, 195, 196, 246, 198, 199, 200, 201, + /* 610 */ 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + /* 620 */ 212, 213, 214, 215, 12, 13, 309, 91, 338, 329, + /* 630 */ 22, 365, 20, 154, 22, 99, 350, 337, 345, 405, + /* 640 */ 199, 350, 309, 35, 0, 33, 346, 35, 93, 356, + /* 650 */ 95, 96, 418, 98, 337, 425, 422, 102, 337, 179, + /* 660 */ 180, 317, 345, 183, 323, 324, 91, 350, 56, 352, + /* 670 */ 337, 405, 328, 319, 353, 91, 68, 0, 345, 124, + /* 680 */ 68, 352, 309, 350, 418, 352, 44, 45, 422, 345, + /* 690 */ 154, 362, 375, 338, 340, 216, 379, 380, 381, 382, + /* 700 */ 383, 384, 90, 386, 309, 226, 389, 0, 375, 309, + /* 710 */ 393, 394, 379, 380, 381, 382, 383, 384, 159, 386, + /* 720 */ 112, 159, 389, 350, 112, 20, 393, 394, 395, 8, + /* 730 */ 9, 39, 309, 12, 13, 14, 15, 16, 126, 127, + /* 740 */ 407, 199, 337, 4, 309, 350, 102, 361, 415, 363, + /* 750 */ 350, 346, 216, 217, 218, 219, 220, 221, 222, 223, + /* 760 */ 224, 225, 226, 317, 309, 121, 122, 123, 124, 125, + /* 770 */ 20, 64, 65, 350, 328, 361, 337, 363, 71, 102, + /* 780 */ 172, 369, 174, 344, 172, 350, 174, 90, 81, 82, + /* 790 */ 309, 345, 353, 309, 87, 227, 228, 100, 121, 122, + /* 800 */ 123, 124, 125, 195, 196, 350, 248, 195, 196, 309, + /* 810 */ 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + /* 820 */ 208, 209, 210, 211, 212, 213, 214, 215, 12, 13, + /* 830 */ 14, 350, 309, 338, 350, 377, 20, 317, 22, 309, + /* 840 */ 43, 229, 339, 317, 405, 64, 65, 365, 328, 33, + /* 850 */ 350, 35, 71, 350, 328, 339, 309, 418, 317, 401, + /* 860 */ 309, 422, 81, 82, 159, 345, 350, 337, 87, 328, + /* 870 */ 317, 345, 56, 350, 309, 345, 309, 374, 375, 310, + /* 880 */ 350, 328, 352, 326, 68, 416, 345, 405, 337, 386, + /* 890 */ 374, 375, 347, 42, 43, 350, 345, 350, 345, 309, + /* 900 */ 418, 350, 386, 352, 422, 375, 90, 309, 338, 379, + /* 910 */ 380, 381, 382, 383, 384, 350, 386, 350, 347, 389, + /* 920 */ 228, 350, 318, 393, 394, 395, 375, 309, 112, 102, + /* 930 */ 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + /* 940 */ 350, 330, 126, 127, 333, 415, 412, 43, 350, 199, + /* 950 */ 317, 124, 8, 9, 22, 337, 12, 13, 14, 15, + /* 960 */ 16, 328, 94, 345, 338, 97, 317, 35, 350, 230, + /* 970 */ 352, 94, 337, 94, 97, 317, 97, 328, 345, 94, + /* 980 */ 318, 317, 97, 159, 160, 317, 328, 61, 172, 35, + /* 990 */ 174, 316, 328, 375, 345, 91, 328, 379, 380, 381, + /* 1000 */ 382, 383, 384, 345, 386, 61, 1, 2, 309, 345, + /* 1010 */ 365, 195, 196, 345, 198, 199, 200, 201, 202, 203, + /* 1020 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + /* 1030 */ 214, 215, 12, 13, 309, 417, 337, 317, 0, 0, + /* 1040 */ 20, 0, 22, 99, 345, 317, 0, 250, 328, 350, + /* 1050 */ 405, 352, 46, 33, 56, 35, 328, 349, 317, 35, + /* 1060 */ 22, 22, 337, 418, 378, 345, 403, 422, 22, 328, + /* 1070 */ 345, 126, 127, 345, 375, 350, 56, 352, 379, 380, + /* 1080 */ 381, 382, 383, 384, 317, 386, 345, 43, 68, 48, + /* 1090 */ 92, 396, 68, 43, 43, 328, 90, 43, 154, 419, + /* 1100 */ 375, 419, 317, 19, 379, 380, 381, 382, 383, 384, + /* 1110 */ 90, 386, 345, 328, 389, 419, 317, 33, 393, 394, + /* 1120 */ 395, 195, 423, 424, 43, 406, 43, 328, 174, 404, + /* 1130 */ 345, 47, 112, 13, 43, 91, 52, 53, 54, 55, + /* 1140 */ 56, 91, 91, 231, 345, 91, 126, 127, 43, 43, + /* 1150 */ 43, 43, 43, 43, 43, 35, 43, 373, 13, 372, + /* 1160 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 1170 */ 226, 47, 91, 89, 91, 367, 92, 170, 42, 357, + /* 1180 */ 35, 20, 91, 317, 317, 357, 355, 154, 355, 317, + /* 1190 */ 317, 317, 172, 20, 174, 311, 91, 91, 91, 91, + /* 1200 */ 91, 91, 91, 311, 91, 20, 371, 321, 352, 125, + /* 1210 */ 321, 309, 20, 364, 20, 195, 196, 321, 198, 199, + /* 1220 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + /* 1230 */ 210, 211, 212, 213, 214, 215, 12, 13, 321, 337, + /* 1240 */ 364, 366, 158, 321, 20, 321, 22, 345, 317, 321, + /* 1250 */ 311, 337, 350, 337, 352, 337, 337, 33, 337, 35, + /* 1260 */ 176, 311, 178, 317, 337, 350, 337, 337, 371, 177, + /* 1270 */ 337, 337, 337, 370, 319, 352, 319, 375, 317, 317, + /* 1280 */ 56, 379, 380, 381, 382, 383, 384, 319, 386, 364, + /* 1290 */ 350, 389, 68, 236, 156, 319, 394, 360, 350, 18, + /* 1300 */ 358, 350, 350, 360, 23, 12, 13, 333, 350, 319, + /* 1310 */ 345, 20, 237, 350, 90, 22, 378, 411, 37, 38, + /* 1320 */ 360, 350, 41, 350, 411, 350, 33, 360, 35, 350, + /* 1330 */ 243, 163, 232, 245, 414, 20, 112, 244, 57, 58, + /* 1340 */ 59, 309, 373, 228, 345, 249, 247, 411, 90, 56, + /* 1350 */ 126, 127, 90, 252, 413, 377, 341, 410, 409, 350, + /* 1360 */ 317, 68, 327, 36, 408, 312, 319, 311, 368, 337, + /* 1370 */ 307, 90, 392, 420, 342, 363, 331, 345, 320, 331, + /* 1380 */ 421, 0, 350, 331, 352, 0, 179, 421, 0, 0, + /* 1390 */ 426, 421, 420, 42, 0, 35, 172, 420, 174, 189, + /* 1400 */ 35, 35, 35, 189, 0, 112, 35, 375, 35, 128, + /* 1410 */ 189, 379, 380, 381, 382, 383, 384, 0, 386, 195, + /* 1420 */ 196, 309, 198, 199, 200, 201, 202, 203, 204, 205, + /* 1430 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + /* 1440 */ 189, 0, 309, 35, 0, 164, 165, 166, 22, 337, + /* 1450 */ 169, 0, 174, 35, 342, 172, 0, 345, 168, 167, + /* 1460 */ 0, 0, 350, 0, 352, 172, 185, 174, 46, 188, + /* 1470 */ 337, 190, 191, 192, 193, 194, 42, 0, 345, 0, + /* 1480 */ 0, 0, 0, 350, 0, 352, 150, 375, 195, 196, + /* 1490 */ 0, 379, 380, 381, 382, 383, 384, 0, 386, 0, + /* 1500 */ 207, 208, 209, 210, 211, 212, 213, 0, 375, 0, + /* 1510 */ 229, 0, 379, 380, 381, 382, 383, 384, 35, 386, + /* 1520 */ 145, 145, 389, 0, 0, 309, 393, 394, 395, 0, + /* 1530 */ 0, 0, 0, 0, 0, 0, 0, 404, 0, 0, + /* 1540 */ 0, 309, 0, 42, 0, 0, 0, 0, 0, 0, + /* 1550 */ 22, 0, 0, 337, 0, 0, 0, 0, 56, 56, + /* 1560 */ 0, 345, 0, 42, 39, 43, 350, 14, 352, 337, + /* 1570 */ 0, 0, 14, 46, 0, 0, 163, 345, 62, 0, + /* 1580 */ 39, 365, 350, 46, 352, 0, 0, 0, 0, 0, + /* 1590 */ 40, 375, 0, 0, 35, 379, 380, 381, 382, 383, + /* 1600 */ 384, 35, 386, 39, 39, 0, 39, 375, 47, 309, + /* 1610 */ 47, 379, 380, 381, 382, 383, 384, 35, 386, 47, + /* 1620 */ 39, 405, 39, 47, 0, 309, 35, 0, 0, 35, + /* 1630 */ 22, 0, 35, 35, 418, 22, 35, 337, 422, 43, + /* 1640 */ 0, 35, 99, 43, 22, 345, 0, 22, 49, 0, + /* 1650 */ 350, 22, 352, 337, 35, 0, 424, 0, 35, 0, + /* 1660 */ 0, 345, 20, 22, 159, 365, 350, 35, 352, 35, + /* 1670 */ 97, 0, 22, 175, 159, 375, 156, 0, 0, 379, + /* 1680 */ 380, 381, 382, 383, 384, 0, 386, 309, 35, 0, + /* 1690 */ 184, 375, 0, 0, 90, 379, 380, 381, 382, 383, + /* 1700 */ 384, 91, 386, 0, 388, 405, 309, 90, 90, 39, + /* 1710 */ 90, 100, 46, 46, 46, 337, 43, 43, 418, 233, + /* 1720 */ 342, 91, 422, 345, 91, 90, 157, 159, 350, 90, + /* 1730 */ 352, 227, 46, 90, 337, 155, 91, 90, 161, 342, + /* 1740 */ 43, 90, 345, 91, 90, 43, 90, 350, 35, 352, + /* 1750 */ 233, 43, 91, 375, 91, 91, 46, 379, 380, 381, + /* 1760 */ 382, 383, 384, 46, 386, 43, 91, 309, 33, 35, + /* 1770 */ 91, 35, 375, 35, 35, 35, 379, 380, 381, 382, + /* 1780 */ 383, 384, 47, 386, 317, 309, 22, 52, 53, 54, + /* 1790 */ 55, 56, 2, 43, 90, 337, 90, 195, 91, 46, + /* 1800 */ 91, 90, 90, 345, 46, 91, 90, 22, 350, 197, + /* 1810 */ 352, 90, 345, 337, 91, 35, 101, 233, 35, 90, + /* 1820 */ 90, 345, 91, 35, 89, 22, 350, 92, 352, 35, + /* 1830 */ 35, 90, 365, 375, 91, 309, 91, 379, 380, 381, + /* 1840 */ 382, 383, 384, 91, 386, 90, 35, 90, 102, 35, + /* 1850 */ 383, 375, 90, 90, 22, 379, 380, 381, 382, 383, + /* 1860 */ 384, 114, 386, 337, 90, 398, 399, 400, 114, 402, + /* 1870 */ 114, 345, 405, 114, 43, 62, 350, 61, 352, 35, + /* 1880 */ 35, 35, 35, 35, 35, 418, 35, 309, 35, 422, + /* 1890 */ 155, 156, 68, 158, 88, 35, 35, 162, 43, 22, + /* 1900 */ 35, 375, 22, 35, 35, 379, 380, 381, 382, 383, + /* 1910 */ 384, 68, 386, 178, 35, 337, 35, 35, 35, 35, + /* 1920 */ 22, 35, 0, 345, 35, 47, 39, 0, 350, 35, + /* 1930 */ 352, 0, 47, 0, 39, 309, 35, 47, 39, 35, + /* 1940 */ 47, 39, 0, 35, 35, 0, 22, 309, 22, 21, + /* 1950 */ 20, 22, 427, 375, 427, 21, 427, 379, 380, 381, + /* 1960 */ 382, 383, 384, 337, 386, 427, 427, 427, 427, 427, + /* 1970 */ 427, 345, 427, 427, 427, 337, 350, 427, 352, 427, + /* 1980 */ 427, 427, 427, 345, 427, 427, 427, 427, 350, 427, + /* 1990 */ 352, 427, 427, 427, 427, 427, 427, 309, 427, 427, + /* 2000 */ 427, 375, 427, 427, 427, 379, 380, 381, 382, 383, + /* 2010 */ 384, 427, 386, 375, 309, 427, 427, 379, 380, 381, + /* 2020 */ 382, 383, 384, 427, 386, 337, 427, 427, 427, 427, + /* 2030 */ 427, 427, 427, 345, 427, 427, 427, 427, 350, 427, + /* 2040 */ 352, 427, 337, 427, 427, 427, 427, 427, 427, 427, + /* 2050 */ 345, 427, 427, 427, 427, 350, 427, 352, 427, 427, + /* 2060 */ 427, 427, 427, 375, 427, 427, 427, 379, 380, 381, + /* 2070 */ 382, 383, 384, 427, 386, 427, 427, 309, 427, 427, + /* 2080 */ 375, 427, 427, 427, 379, 380, 381, 382, 383, 384, + /* 2090 */ 427, 386, 427, 309, 427, 427, 427, 427, 427, 427, + /* 2100 */ 427, 427, 427, 427, 427, 337, 427, 427, 427, 427, + /* 2110 */ 427, 427, 427, 345, 427, 427, 427, 427, 350, 427, + /* 2120 */ 352, 337, 427, 427, 427, 427, 427, 427, 427, 345, + /* 2130 */ 427, 427, 427, 427, 350, 427, 352, 427, 427, 427, + /* 2140 */ 427, 427, 427, 375, 427, 309, 427, 379, 380, 381, + /* 2150 */ 382, 383, 384, 427, 386, 427, 427, 427, 427, 375, + /* 2160 */ 427, 309, 427, 379, 380, 381, 382, 383, 384, 427, + /* 2170 */ 386, 427, 427, 337, 427, 427, 427, 427, 427, 427, + /* 2180 */ 427, 345, 427, 427, 427, 427, 350, 427, 352, 337, + /* 2190 */ 427, 427, 427, 427, 427, 427, 427, 345, 427, 427, + /* 2200 */ 427, 309, 350, 427, 352, 427, 427, 427, 427, 427, + /* 2210 */ 427, 375, 427, 427, 427, 379, 380, 381, 382, 383, + /* 2220 */ 384, 427, 386, 309, 427, 427, 427, 375, 427, 337, + /* 2230 */ 427, 379, 380, 381, 382, 383, 384, 345, 386, 427, + /* 2240 */ 427, 427, 350, 427, 352, 427, 427, 427, 427, 427, + /* 2250 */ 427, 337, 427, 427, 427, 427, 427, 427, 427, 345, + /* 2260 */ 427, 427, 427, 309, 350, 427, 352, 375, 427, 427, + /* 2270 */ 427, 379, 380, 381, 382, 383, 384, 427, 386, 427, + /* 2280 */ 427, 309, 427, 427, 427, 427, 427, 427, 427, 375, + /* 2290 */ 427, 337, 427, 379, 380, 381, 382, 383, 384, 345, + /* 2300 */ 386, 427, 427, 427, 350, 427, 352, 427, 427, 337, + /* 2310 */ 427, 427, 427, 427, 427, 427, 427, 345, 427, 427, + /* 2320 */ 427, 427, 350, 427, 352, 427, 427, 427, 427, 375, + /* 2330 */ 427, 309, 427, 379, 380, 381, 382, 383, 384, 427, + /* 2340 */ 386, 427, 427, 309, 427, 427, 427, 375, 427, 427, + /* 2350 */ 427, 379, 380, 381, 382, 383, 384, 427, 386, 337, + /* 2360 */ 427, 427, 427, 427, 427, 427, 427, 345, 427, 427, + /* 2370 */ 427, 337, 350, 427, 352, 427, 427, 427, 427, 345, + /* 2380 */ 427, 427, 427, 427, 350, 427, 352, 427, 427, 427, + /* 2390 */ 427, 427, 427, 427, 309, 427, 427, 375, 427, 427, + /* 2400 */ 427, 379, 380, 381, 382, 383, 384, 427, 386, 375, + /* 2410 */ 427, 427, 427, 379, 380, 381, 382, 383, 384, 427, + /* 2420 */ 386, 427, 337, 427, 427, 427, 427, 427, 427, 427, + /* 2430 */ 345, 427, 427, 427, 427, 350, 427, 352, 427, 427, + /* 2440 */ 427, 427, 427, 427, 309, 427, 427, 427, 427, 427, + /* 2450 */ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + /* 2460 */ 375, 427, 427, 427, 379, 380, 381, 382, 383, 384, + /* 2470 */ 427, 386, 337, 427, 427, 427, 427, 427, 427, 427, + /* 2480 */ 345, 427, 427, 427, 427, 350, 427, 352, 427, 427, + /* 2490 */ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + /* 2500 */ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, + /* 2510 */ 375, 427, 427, 427, 379, 380, 381, 382, 383, 384, + /* 2520 */ 427, 386, }; -#define YY_SHIFT_COUNT (666) +#define YY_SHIFT_COUNT (671) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2079) +#define YY_SHIFT_MAX (1945) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 917, 0, 0, 62, 62, 264, 264, 264, 326, 326, - /* 10 */ 264, 264, 391, 593, 720, 593, 593, 593, 593, 593, - /* 20 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, - /* 30 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, - /* 40 */ 593, 593, 265, 265, 17, 17, 17, 1007, 1007, 268, - /* 50 */ 1007, 1007, 160, 30, 56, 200, 56, 11, 11, 87, - /* 60 */ 87, 55, 165, 56, 56, 11, 11, 11, 11, 11, - /* 70 */ 11, 11, 11, 11, 11, 10, 11, 11, 11, 18, - /* 80 */ 11, 11, 67, 11, 11, 67, 123, 11, 67, 67, - /* 90 */ 67, 11, 227, 719, 662, 683, 683, 150, 213, 213, - /* 100 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - /* 110 */ 213, 213, 213, 213, 213, 213, 213, 517, 881, 165, - /* 120 */ 403, 403, 573, 386, 849, 361, 361, 361, 386, 298, - /* 130 */ 298, 18, 350, 350, 67, 67, 294, 294, 270, 357, - /* 140 */ 198, 198, 198, 198, 198, 198, 198, 1119, 21, 383, - /* 150 */ 501, 105, 665, 484, 715, 828, 366, 799, 506, 800, - /* 160 */ 717, 649, 717, 924, 756, 756, 756, 807, 873, 980, - /* 170 */ 1174, 1078, 1206, 1232, 1232, 1206, 1107, 1107, 1232, 1232, - /* 180 */ 1232, 1257, 1257, 1264, 10, 18, 10, 1272, 1277, 10, - /* 190 */ 1272, 10, 10, 10, 1232, 10, 1257, 67, 67, 67, - /* 200 */ 67, 67, 67, 67, 67, 67, 67, 67, 1232, 1257, - /* 210 */ 294, 1264, 227, 1166, 18, 227, 1232, 1232, 1272, 227, - /* 220 */ 1118, 294, 294, 294, 294, 1118, 294, 1201, 227, 270, - /* 230 */ 227, 298, 1345, 294, 1139, 1118, 294, 294, 1139, 1118, - /* 240 */ 294, 294, 67, 1141, 1235, 1139, 1154, 1157, 1170, 980, - /* 250 */ 1178, 298, 1382, 1159, 1162, 1167, 1159, 1162, 1159, 1162, - /* 260 */ 1320, 1326, 294, 357, 1232, 227, 1383, 1257, 2259, 2259, - /* 270 */ 2259, 2259, 2259, 2259, 2259, 83, 1593, 214, 724, 126, - /* 280 */ 209, 491, 562, 622, 813, 535, 321, 698, 698, 698, - /* 290 */ 698, 698, 698, 698, 698, 521, 309, 13, 13, 115, - /* 300 */ 69, 599, 267, 708, 194, 377, 190, 465, 49, 49, - /* 310 */ 49, 49, 684, 944, 938, 994, 999, 1001, 947, 1047, - /* 320 */ 1101, 941, 920, 1025, 1043, 1069, 1079, 1091, 1093, 1102, - /* 330 */ 1160, 1073, 973, 895, 1103, 1075, 1082, 1058, 1106, 1114, - /* 340 */ 1115, 1133, 1163, 1165, 1193, 1198, 1064, 860, 1143, 1176, - /* 350 */ 839, 1473, 1476, 1301, 1479, 1480, 1439, 1482, 1448, 1297, - /* 360 */ 1450, 1451, 1452, 1302, 1490, 1456, 1457, 1307, 1495, 1310, - /* 370 */ 1502, 1477, 1513, 1493, 1516, 1483, 1348, 1347, 1521, 1527, - /* 380 */ 1357, 1359, 1525, 1528, 1494, 1529, 1499, 1539, 1542, 1543, - /* 390 */ 1395, 1545, 1552, 1554, 1555, 1556, 1403, 1514, 1548, 1413, - /* 400 */ 1559, 1560, 1561, 1562, 1566, 1567, 1568, 1569, 1570, 1571, - /* 410 */ 1573, 1574, 1575, 1578, 1544, 1590, 1591, 1598, 1600, 1601, - /* 420 */ 1612, 1581, 1604, 1605, 1614, 1616, 1619, 1564, 1621, 1572, - /* 430 */ 1627, 1629, 1582, 1584, 1588, 1620, 1587, 1622, 1589, 1638, - /* 440 */ 1599, 1602, 1650, 1651, 1652, 1617, 1492, 1657, 1658, 1665, - /* 450 */ 1607, 1667, 1671, 1608, 1597, 1633, 1673, 1639, 1630, 1637, - /* 460 */ 1679, 1645, 1640, 1647, 1688, 1654, 1644, 1653, 1693, 1694, - /* 470 */ 1698, 1699, 1609, 1606, 1666, 1678, 1703, 1670, 1675, 1680, - /* 480 */ 1686, 1695, 1684, 1710, 1711, 1732, 1713, 1702, 1737, 1722, - /* 490 */ 1717, 1754, 1720, 1756, 1724, 1757, 1738, 1741, 1762, 1610, - /* 500 */ 1731, 1768, 1613, 1748, 1618, 1624, 1771, 1773, 1625, 1615, - /* 510 */ 1780, 1781, 1783, 1696, 1697, 1755, 1634, 1798, 1712, 1648, - /* 520 */ 1715, 1800, 1778, 1659, 1735, 1727, 1782, 1784, 1611, 1740, - /* 530 */ 1742, 1745, 1746, 1747, 1749, 1787, 1750, 1758, 1760, 1761, - /* 540 */ 1763, 1792, 1793, 1799, 1765, 1801, 1626, 1770, 1772, 1815, - /* 550 */ 1641, 1809, 1817, 1818, 1775, 1825, 1642, 1779, 1835, 1849, - /* 560 */ 1858, 1859, 1860, 1864, 1779, 1898, 1885, 1716, 1867, 1823, - /* 570 */ 1824, 1826, 1827, 1829, 1830, 1870, 1833, 1834, 1878, 1891, - /* 580 */ 1743, 1844, 1819, 1845, 1899, 1901, 1848, 1850, 1906, 1853, - /* 590 */ 1854, 1908, 1856, 1863, 1911, 1861, 1865, 1913, 1868, 1836, - /* 600 */ 1843, 1847, 1851, 1936, 1862, 1872, 1876, 1927, 1877, 1925, - /* 610 */ 1925, 1947, 1914, 1909, 1938, 1940, 1943, 1945, 1954, 1955, - /* 620 */ 1958, 1928, 1922, 1952, 1963, 1965, 1988, 1976, 1991, 1980, - /* 630 */ 1981, 1950, 1675, 1985, 1680, 1994, 1995, 1998, 2000, 2014, - /* 640 */ 2003, 2039, 2005, 2002, 2011, 2051, 2017, 2006, 2015, 2055, - /* 650 */ 2021, 2013, 2019, 2069, 2035, 2024, 2034, 2076, 2042, 2043, - /* 660 */ 2079, 2058, 2060, 2062, 2063, 2061, 2066, + /* 0 */ 1281, 0, 0, 204, 204, 408, 408, 408, 612, 612, + /* 10 */ 408, 408, 816, 1020, 1224, 1020, 1020, 1020, 1020, 1020, + /* 20 */ 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, + /* 30 */ 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, + /* 40 */ 1020, 1020, 231, 231, 150, 150, 150, 1293, 1293, 239, + /* 50 */ 1293, 1293, 211, 225, 244, 367, 244, 20, 20, 84, + /* 60 */ 84, 5, 67, 244, 244, 20, 20, 20, 20, 20, + /* 70 */ 20, 20, 20, 20, 20, 55, 20, 20, 20, 242, + /* 80 */ 20, 20, 269, 20, 20, 269, 288, 20, 269, 269, + /* 90 */ 269, 20, 443, 203, 536, 944, 944, 217, 608, 608, + /* 100 */ 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, + /* 110 */ 608, 608, 608, 608, 608, 608, 608, 555, 781, 67, + /* 120 */ 313, 313, 111, 474, 429, 559, 559, 559, 474, 361, + /* 130 */ 361, 242, 8, 8, 269, 269, 475, 475, 326, 525, + /* 140 */ 72, 72, 72, 72, 72, 72, 72, 1084, 137, 261, + /* 150 */ 707, 133, 348, 29, 441, 542, 14, 642, 827, 705, + /* 160 */ 568, 692, 568, 851, 359, 359, 359, 739, 750, 912, + /* 170 */ 1124, 1007, 1136, 1161, 1161, 1136, 1033, 1033, 1161, 1161, + /* 180 */ 1161, 1173, 1173, 1185, 55, 242, 55, 1192, 1194, 55, + /* 190 */ 1192, 55, 55, 55, 1161, 55, 1173, 269, 269, 269, + /* 200 */ 269, 269, 269, 269, 269, 269, 269, 269, 1161, 1173, + /* 210 */ 475, 1185, 443, 1092, 242, 443, 1161, 1161, 1192, 443, + /* 220 */ 1057, 475, 475, 475, 475, 1057, 475, 1138, 443, 326, + /* 230 */ 443, 361, 1291, 475, 1075, 1057, 475, 475, 1075, 1057, + /* 240 */ 475, 475, 269, 1087, 1168, 1075, 1088, 1093, 1100, 912, + /* 250 */ 1115, 361, 1315, 1096, 1099, 1101, 1096, 1099, 1096, 1099, + /* 260 */ 1258, 1262, 475, 525, 1161, 443, 1327, 1173, 2522, 2522, + /* 270 */ 2522, 2522, 2522, 2522, 2522, 69, 1735, 23, 419, 270, + /* 280 */ 310, 351, 377, 552, 562, 575, 644, 721, 721, 721, + /* 290 */ 721, 721, 721, 721, 721, 677, 324, 12, 12, 480, + /* 300 */ 273, 346, 345, 374, 450, 106, 584, 479, 417, 417, + /* 310 */ 417, 417, 904, 491, 932, 868, 877, 879, 885, 1038, + /* 320 */ 1039, 1046, 998, 824, 1044, 1050, 1051, 1054, 1081, 1083, + /* 330 */ 1091, 1005, 945, 558, 797, 1105, 54, 954, 926, 1106, + /* 340 */ 1006, 1107, 1108, 1109, 1110, 1111, 1113, 697, 1120, 1145, + /* 350 */ 1024, 1041, 1381, 1385, 1207, 1388, 1389, 1351, 1394, 1360, + /* 360 */ 1210, 1365, 1366, 1367, 1214, 1404, 1371, 1373, 1221, 1417, + /* 370 */ 1251, 1441, 1408, 1444, 1426, 1451, 1418, 1278, 1283, 1456, + /* 380 */ 1463, 1290, 1292, 1460, 1461, 1422, 1479, 1480, 1481, 1434, + /* 390 */ 1477, 1482, 1484, 1336, 1490, 1497, 1499, 1507, 1509, 1375, + /* 400 */ 1483, 1511, 1376, 1523, 1524, 1529, 1530, 1531, 1532, 1533, + /* 410 */ 1534, 1535, 1536, 1538, 1539, 1540, 1542, 1501, 1544, 1545, + /* 420 */ 1546, 1547, 1548, 1549, 1528, 1551, 1552, 1554, 1555, 1556, + /* 430 */ 1502, 1557, 1503, 1560, 1562, 1521, 1525, 1522, 1553, 1527, + /* 440 */ 1558, 1537, 1570, 1550, 1541, 1571, 1574, 1575, 1564, 1413, + /* 450 */ 1585, 1586, 1587, 1516, 1579, 1588, 1559, 1561, 1565, 1589, + /* 460 */ 1566, 1563, 1567, 1592, 1582, 1572, 1581, 1593, 1591, 1576, + /* 470 */ 1583, 1605, 1624, 1627, 1628, 1543, 1573, 1594, 1608, 1631, + /* 480 */ 1597, 1598, 1596, 1600, 1601, 1606, 1613, 1640, 1622, 1646, + /* 490 */ 1625, 1599, 1649, 1629, 1619, 1655, 1623, 1657, 1632, 1659, + /* 500 */ 1641, 1642, 1660, 1505, 1634, 1671, 1498, 1650, 1515, 1520, + /* 510 */ 1677, 1678, 1568, 1577, 1685, 1692, 1693, 1604, 1610, 1653, + /* 520 */ 1506, 1689, 1617, 1569, 1618, 1703, 1670, 1580, 1620, 1611, + /* 530 */ 1666, 1673, 1486, 1635, 1630, 1639, 1633, 1645, 1643, 1674, + /* 540 */ 1652, 1647, 1651, 1654, 1661, 1697, 1667, 1668, 1656, 1702, + /* 550 */ 1517, 1663, 1664, 1686, 1504, 1708, 1710, 1717, 1675, 1722, + /* 560 */ 1584, 1679, 1713, 1734, 1736, 1738, 1739, 1740, 1679, 1790, + /* 570 */ 1764, 1602, 1750, 1704, 1707, 1706, 1709, 1711, 1714, 1753, + /* 580 */ 1712, 1716, 1758, 1785, 1612, 1721, 1715, 1723, 1780, 1783, + /* 590 */ 1729, 1731, 1788, 1730, 1743, 1794, 1741, 1745, 1795, 1755, + /* 600 */ 1752, 1811, 1757, 1747, 1754, 1756, 1759, 1803, 1746, 1762, + /* 610 */ 1763, 1814, 1774, 1831, 1831, 1832, 1813, 1816, 1844, 1845, + /* 620 */ 1846, 1847, 1848, 1849, 1851, 1853, 1824, 1806, 1855, 1860, + /* 630 */ 1861, 1877, 1865, 1880, 1868, 1869, 1843, 1596, 1879, 1600, + /* 640 */ 1881, 1882, 1883, 1884, 1898, 1886, 1922, 1889, 1878, 1887, + /* 650 */ 1927, 1894, 1885, 1895, 1931, 1901, 1890, 1899, 1933, 1904, + /* 660 */ 1893, 1902, 1942, 1908, 1909, 1945, 1924, 1928, 1926, 1929, + /* 670 */ 1934, 1930, }; #define YY_REDUCE_COUNT (274) -#define YY_REDUCE_MIN (-403) -#define YY_REDUCE_MAX (1873) +#define YY_REDUCE_MIN (-359) +#define YY_REDUCE_MAX (2135) static const short yy_reduce_ofst[] = { - /* 0 */ 263, 629, 747, -278, -14, 679, 846, 886, 955, 1009, - /* 10 */ 272, 1059, 104, 1076, 1126, 806, 1152, 1202, 1214, 1228, - /* 20 */ 1281, 1334, 1346, 1360, 1414, 1428, 1440, 1497, 1507, 1523, - /* 30 */ 1547, 1603, 1623, 1643, 1663, 1683, 1723, 1739, 1790, 1806, - /* 40 */ 1857, 1873, 304, 926, 112, 435, 552, -295, 610, -3, - /* 50 */ -261, -154, -323, 305, 575, 577, 635, -310, -272, -312, - /* 60 */ -307, -403, -311, -284, -70, -90, 225, 346, 404, 414, - /* 70 */ 429, 434, 497, 644, 645, 339, 674, 697, 710, -342, - /* 80 */ 722, 749, -313, 758, 772, -244, -251, 797, -17, 20, - /* 90 */ 48, 804, 228, 86, -379, -379, -379, -240, -13, 100, - /* 100 */ 101, 130, 206, 375, 385, 428, 459, 461, 474, 522, - /* 110 */ 566, 628, 656, 678, 694, 696, 740, -226, -92, -72, - /* 120 */ -256, -130, 173, 4, 34, 186, 362, 440, 97, 91, - /* 130 */ 303, -234, -109, 180, 274, 536, 317, 545, 579, 234, - /* 140 */ -333, 40, 144, 175, 242, 319, 410, 450, 445, 348, - /* 150 */ 369, 495, 572, 557, 620, 620, 734, 667, 688, 727, - /* 160 */ 735, 735, 735, 770, 752, 784, 786, 762, 620, 861, - /* 170 */ 874, 866, 894, 940, 942, 901, 907, 908, 956, 957, - /* 180 */ 960, 971, 972, 915, 966, 936, 974, 933, 935, 978, - /* 190 */ 939, 981, 983, 985, 991, 989, 1000, 975, 976, 977, - /* 200 */ 979, 982, 984, 986, 990, 992, 995, 996, 998, 1006, - /* 210 */ 993, 951, 1021, 987, 997, 1026, 1030, 1033, 988, 1032, - /* 220 */ 1002, 1005, 1008, 1013, 1014, 1010, 1015, 1011, 1048, 1038, - /* 230 */ 1053, 1031, 1003, 1028, 968, 1020, 1036, 1037, 1004, 1022, - /* 240 */ 1044, 1049, 620, 1016, 1012, 1018, 1023, 1027, 1024, 1029, - /* 250 */ 735, 1061, 1035, 1045, 1017, 1039, 1046, 1034, 1051, 1050, - /* 260 */ 1052, 1081, 1067, 1092, 1129, 1104, 1112, 1136, 1096, 1086, - /* 270 */ 1137, 1138, 1142, 1130, 1168, + /* 0 */ 176, -308, 135, 333, 530, -84, 725, 1133, 1216, 1300, + /* 10 */ 113, 317, 551, 699, 902, 1032, 1112, 618, 1232, 1316, + /* 20 */ 1378, 1397, 1458, 1476, 1526, 1578, 1626, 1638, 1688, 1705, + /* 30 */ 1768, 1784, 1836, 1852, 1892, 1914, 1954, 1972, 2022, 2034, + /* 40 */ 2085, 2135, -300, 1467, -306, -279, 79, -119, 151, 439, + /* 50 */ 503, 516, -359, 234, 266, 482, 645, -314, 52, -311, + /* 60 */ -297, -186, -245, -115, 141, -287, -285, 344, 446, 520, + /* 70 */ 526, 541, 553, 633, 649, -63, 658, 664, 668, -352, + /* 80 */ 720, 728, -267, 741, 767, -236, -221, 785, 193, 130, + /* 90 */ 300, 799, -26, 219, -260, -260, -260, -228, -225, 222, + /* 100 */ 286, 291, 373, 395, 400, 423, 435, 455, 481, 484, + /* 110 */ 500, 523, 547, 565, 567, 590, 598, -114, -213, -39, + /* 120 */ 122, 241, 226, 34, 354, -204, 58, 458, 341, 32, + /* 130 */ 293, 329, 386, 414, 405, 321, 545, 571, 611, -168, + /* 140 */ -323, 185, 290, 355, 495, 570, 626, 412, 569, 230, + /* 150 */ 557, 469, 604, 534, 635, 635, 662, 675, 708, 686, + /* 160 */ 663, 663, 663, 695, 680, 682, 696, 719, 635, 784, + /* 170 */ 787, 808, 822, 866, 867, 828, 831, 833, 872, 873, + /* 180 */ 874, 884, 892, 835, 886, 856, 889, 849, 875, 896, + /* 190 */ 876, 917, 922, 924, 931, 928, 939, 914, 916, 918, + /* 200 */ 919, 921, 927, 929, 930, 933, 934, 935, 946, 950, + /* 210 */ 915, 897, 955, 903, 923, 957, 961, 962, 925, 968, + /* 220 */ 937, 940, 948, 951, 952, 943, 958, 942, 976, 974, + /* 230 */ 990, 965, 938, 963, 906, 960, 971, 973, 913, 967, + /* 240 */ 975, 979, 635, 920, 941, 936, 947, 949, 956, 969, + /* 250 */ 663, 999, 978, 959, 953, 964, 966, 972, 970, 977, + /* 260 */ 980, 1015, 1009, 1035, 1043, 1047, 1053, 1056, 1000, 1012, + /* 270 */ 1045, 1048, 1052, 1058, 1063, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 10 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 20 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 30 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 40 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 50 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 60 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 70 */ 1461, 1461, 1461, 1461, 1461, 1535, 1461, 1461, 1461, 1461, - /* 80 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 90 */ 1461, 1461, 1533, 1691, 1461, 1866, 1461, 1461, 1461, 1461, - /* 100 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 110 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 120 */ 1461, 1461, 1535, 1461, 1533, 1878, 1878, 1878, 1461, 1461, - /* 130 */ 1461, 1461, 1732, 1732, 1461, 1461, 1461, 1461, 1633, 1461, - /* 140 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1726, 1461, 1947, - /* 150 */ 1461, 1461, 1461, 1901, 1461, 1461, 1461, 1461, 1586, 1893, - /* 160 */ 1870, 1884, 1871, 1868, 1932, 1932, 1932, 1887, 1461, 1897, - /* 170 */ 1461, 1719, 1696, 1461, 1461, 1696, 1693, 1693, 1461, 1461, - /* 180 */ 1461, 1461, 1461, 1461, 1535, 1461, 1535, 1461, 1461, 1535, - /* 190 */ 1461, 1535, 1535, 1535, 1461, 1535, 1461, 1461, 1461, 1461, - /* 200 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 210 */ 1461, 1461, 1533, 1728, 1461, 1533, 1461, 1461, 1461, 1533, - /* 220 */ 1906, 1461, 1461, 1461, 1461, 1906, 1461, 1461, 1533, 1461, - /* 230 */ 1533, 1461, 1461, 1461, 1908, 1906, 1461, 1461, 1908, 1906, - /* 240 */ 1461, 1461, 1461, 1920, 1916, 1908, 1924, 1922, 1899, 1897, - /* 250 */ 1884, 1461, 1461, 1938, 1934, 1950, 1938, 1934, 1938, 1934, - /* 260 */ 1461, 1602, 1461, 1461, 1461, 1533, 1493, 1461, 1721, 1732, - /* 270 */ 1636, 1636, 1636, 1536, 1466, 1461, 1461, 1461, 1461, 1461, - /* 280 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1803, 1919, 1918, - /* 290 */ 1842, 1841, 1840, 1838, 1802, 1461, 1598, 1801, 1800, 1461, - /* 300 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1794, 1795, - /* 310 */ 1793, 1792, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 320 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 330 */ 1867, 1461, 1935, 1939, 1461, 1461, 1461, 1461, 1461, 1778, - /* 340 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 350 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 360 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 370 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 380 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 390 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 400 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 410 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 420 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 430 */ 1461, 1461, 1461, 1461, 1498, 1461, 1461, 1461, 1461, 1461, - /* 440 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 450 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 460 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 470 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1570, 1569, - /* 480 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 490 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 500 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 510 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1736, 1461, 1461, - /* 520 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1900, 1461, 1461, - /* 530 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 540 */ 1461, 1461, 1461, 1778, 1461, 1917, 1461, 1877, 1873, 1461, - /* 550 */ 1461, 1869, 1777, 1461, 1461, 1933, 1461, 1461, 1461, 1461, - /* 560 */ 1461, 1461, 1461, 1461, 1461, 1862, 1461, 1461, 1835, 1820, - /* 570 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 580 */ 1788, 1461, 1461, 1461, 1461, 1461, 1630, 1461, 1461, 1461, - /* 590 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1615, - /* 600 */ 1613, 1612, 1611, 1461, 1608, 1461, 1461, 1461, 1461, 1639, - /* 610 */ 1638, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 620 */ 1461, 1461, 1461, 1554, 1461, 1461, 1461, 1461, 1461, 1461, - /* 630 */ 1461, 1461, 1546, 1461, 1545, 1461, 1461, 1461, 1461, 1461, - /* 640 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 650 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, - /* 660 */ 1461, 1461, 1461, 1461, 1461, 1461, 1461, + /* 0 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 10 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 20 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 30 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 40 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 50 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 60 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 70 */ 1472, 1472, 1472, 1472, 1472, 1546, 1472, 1472, 1472, 1472, + /* 80 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 90 */ 1472, 1472, 1544, 1706, 1472, 1881, 1472, 1472, 1472, 1472, + /* 100 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 110 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 120 */ 1472, 1472, 1546, 1472, 1544, 1893, 1893, 1893, 1472, 1472, + /* 130 */ 1472, 1472, 1747, 1747, 1472, 1472, 1472, 1472, 1646, 1472, + /* 140 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1741, 1472, 1962, + /* 150 */ 1472, 1472, 1472, 1916, 1472, 1472, 1472, 1472, 1599, 1908, + /* 160 */ 1885, 1899, 1886, 1883, 1947, 1947, 1947, 1902, 1472, 1912, + /* 170 */ 1472, 1734, 1711, 1472, 1472, 1711, 1708, 1708, 1472, 1472, + /* 180 */ 1472, 1472, 1472, 1472, 1546, 1472, 1546, 1472, 1472, 1546, + /* 190 */ 1472, 1546, 1546, 1546, 1472, 1546, 1472, 1472, 1472, 1472, + /* 200 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 210 */ 1472, 1472, 1544, 1743, 1472, 1544, 1472, 1472, 1472, 1544, + /* 220 */ 1921, 1472, 1472, 1472, 1472, 1921, 1472, 1472, 1544, 1472, + /* 230 */ 1544, 1472, 1472, 1472, 1923, 1921, 1472, 1472, 1923, 1921, + /* 240 */ 1472, 1472, 1472, 1935, 1931, 1923, 1939, 1937, 1914, 1912, + /* 250 */ 1899, 1472, 1472, 1953, 1949, 1965, 1953, 1949, 1953, 1949, + /* 260 */ 1472, 1615, 1472, 1472, 1472, 1544, 1504, 1472, 1736, 1747, + /* 270 */ 1649, 1649, 1649, 1547, 1477, 1472, 1472, 1472, 1472, 1472, + /* 280 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1818, 1934, 1933, + /* 290 */ 1857, 1856, 1855, 1853, 1817, 1472, 1611, 1816, 1815, 1472, + /* 300 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1809, 1810, + /* 310 */ 1808, 1807, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 320 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 330 */ 1472, 1882, 1472, 1950, 1954, 1472, 1472, 1472, 1472, 1472, + /* 340 */ 1793, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 350 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 360 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 370 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 380 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 390 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 400 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 410 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 420 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 430 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1509, 1472, 1472, + /* 440 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 450 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 460 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 470 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 480 */ 1472, 1472, 1582, 1581, 1472, 1472, 1472, 1472, 1472, 1472, + /* 490 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 500 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 510 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 520 */ 1472, 1751, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 530 */ 1472, 1915, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 540 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1793, 1472, 1932, + /* 550 */ 1472, 1892, 1888, 1472, 1472, 1884, 1792, 1472, 1472, 1948, + /* 560 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1877, + /* 570 */ 1472, 1472, 1850, 1835, 1472, 1472, 1472, 1472, 1472, 1472, + /* 580 */ 1472, 1472, 1472, 1472, 1803, 1472, 1472, 1472, 1472, 1472, + /* 590 */ 1643, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 600 */ 1472, 1472, 1472, 1628, 1626, 1625, 1624, 1472, 1621, 1472, + /* 610 */ 1472, 1472, 1472, 1652, 1651, 1472, 1472, 1472, 1472, 1472, + /* 620 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1565, 1472, + /* 630 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1557, 1472, 1556, + /* 640 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 650 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 660 */ 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, + /* 670 */ 1472, 1472, }; /********** End of lemon-generated parsing tables *****************************/ @@ -966,6 +1008,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* WAL_RETENTION_SIZE => nothing */ 0, /* WAL_ROLL_PERIOD => nothing */ 0, /* WAL_SEGMENT_SIZE => nothing */ + 0, /* SST_TRIGGER => nothing */ 0, /* NK_COLON => nothing */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ @@ -1031,6 +1074,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* DISTRIBUTED => nothing */ 0, /* CONSUMERS => nothing */ 0, /* SUBSCRIPTIONS => nothing */ + 0, /* VNODES => nothing */ 0, /* LIKE => nothing */ 0, /* INDEX => nothing */ 0, /* FUNCTION => nothing */ @@ -1131,59 +1175,58 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 251, /* AFTER => ABORT */ - 251, /* ATTACH => ABORT */ - 251, /* BEFORE => ABORT */ - 251, /* BEGIN => ABORT */ - 251, /* BITAND => ABORT */ - 251, /* BITNOT => ABORT */ - 251, /* BITOR => ABORT */ - 251, /* BLOCKS => ABORT */ - 251, /* CHANGE => ABORT */ - 251, /* COMMA => ABORT */ - 251, /* COMPACT => ABORT */ - 251, /* CONCAT => ABORT */ - 251, /* CONFLICT => ABORT */ - 251, /* COPY => ABORT */ - 251, /* DEFERRED => ABORT */ - 251, /* DELIMITERS => ABORT */ - 251, /* DETACH => ABORT */ - 251, /* DIVIDE => ABORT */ - 251, /* DOT => ABORT */ - 251, /* EACH => ABORT */ - 251, /* END => ABORT */ - 251, /* FAIL => ABORT */ - 251, /* FILE => ABORT */ - 251, /* FOR => ABORT */ - 251, /* GLOB => ABORT */ - 251, /* ID => ABORT */ - 251, /* IMMEDIATE => ABORT */ - 251, /* IMPORT => ABORT */ - 251, /* INITIALLY => ABORT */ - 251, /* INSTEAD => ABORT */ - 251, /* ISNULL => ABORT */ - 251, /* KEY => ABORT */ - 251, /* NK_BITNOT => ABORT */ - 251, /* NK_SEMI => ABORT */ - 251, /* NOTNULL => ABORT */ - 251, /* OF => ABORT */ - 251, /* PLUS => ABORT */ - 251, /* PRIVILEGE => ABORT */ - 251, /* RAISE => ABORT */ - 251, /* REPLACE => ABORT */ - 251, /* RESTRICT => ABORT */ - 251, /* ROW => ABORT */ - 251, /* SEMI => ABORT */ - 251, /* STAR => ABORT */ - 251, /* STATEMENT => ABORT */ - 251, /* STRING => ABORT */ - 251, /* TIMES => ABORT */ - 251, /* UPDATE => ABORT */ - 251, /* VALUES => ABORT */ - 251, /* VARIABLE => ABORT */ - 251, /* VIEW => ABORT */ - 251, /* VNODES => ABORT */ - 251, /* WAL => ABORT */ + 253, /* AFTER => ABORT */ + 253, /* ATTACH => ABORT */ + 253, /* BEFORE => ABORT */ + 253, /* BEGIN => ABORT */ + 253, /* BITAND => ABORT */ + 253, /* BITNOT => ABORT */ + 253, /* BITOR => ABORT */ + 253, /* BLOCKS => ABORT */ + 253, /* CHANGE => ABORT */ + 253, /* COMMA => ABORT */ + 253, /* COMPACT => ABORT */ + 253, /* CONCAT => ABORT */ + 253, /* CONFLICT => ABORT */ + 253, /* COPY => ABORT */ + 253, /* DEFERRED => ABORT */ + 253, /* DELIMITERS => ABORT */ + 253, /* DETACH => ABORT */ + 253, /* DIVIDE => ABORT */ + 253, /* DOT => ABORT */ + 253, /* EACH => ABORT */ + 253, /* END => ABORT */ + 253, /* FAIL => ABORT */ + 253, /* FILE => ABORT */ + 253, /* FOR => ABORT */ + 253, /* GLOB => ABORT */ + 253, /* ID => ABORT */ + 253, /* IMMEDIATE => ABORT */ + 253, /* IMPORT => ABORT */ + 253, /* INITIALLY => ABORT */ + 253, /* INSTEAD => ABORT */ + 253, /* ISNULL => ABORT */ + 253, /* KEY => ABORT */ + 253, /* NK_BITNOT => ABORT */ + 253, /* NK_SEMI => ABORT */ + 253, /* NOTNULL => ABORT */ + 253, /* OF => ABORT */ + 253, /* PLUS => ABORT */ + 253, /* PRIVILEGE => ABORT */ + 253, /* RAISE => ABORT */ + 253, /* REPLACE => ABORT */ + 253, /* RESTRICT => ABORT */ + 253, /* ROW => ABORT */ + 253, /* SEMI => ABORT */ + 253, /* STAR => ABORT */ + 253, /* STATEMENT => ABORT */ + 253, /* STRING => ABORT */ + 253, /* TIMES => ABORT */ + 253, /* UPDATE => ABORT */ + 253, /* VALUES => ABORT */ + 253, /* VARIABLE => ABORT */ + 253, /* VIEW => ABORT */ + 253, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1358,345 +1401,346 @@ static const char *const yyTokenName[] = { /* 84 */ "WAL_RETENTION_SIZE", /* 85 */ "WAL_ROLL_PERIOD", /* 86 */ "WAL_SEGMENT_SIZE", - /* 87 */ "NK_COLON", - /* 88 */ "TABLE", - /* 89 */ "NK_LP", - /* 90 */ "NK_RP", - /* 91 */ "STABLE", - /* 92 */ "ADD", - /* 93 */ "COLUMN", - /* 94 */ "MODIFY", - /* 95 */ "RENAME", - /* 96 */ "TAG", - /* 97 */ "SET", - /* 98 */ "NK_EQ", - /* 99 */ "USING", - /* 100 */ "TAGS", - /* 101 */ "COMMENT", - /* 102 */ "BOOL", - /* 103 */ "TINYINT", - /* 104 */ "SMALLINT", - /* 105 */ "INT", - /* 106 */ "INTEGER", - /* 107 */ "BIGINT", - /* 108 */ "FLOAT", - /* 109 */ "DOUBLE", - /* 110 */ "BINARY", - /* 111 */ "TIMESTAMP", - /* 112 */ "NCHAR", - /* 113 */ "UNSIGNED", - /* 114 */ "JSON", - /* 115 */ "VARCHAR", - /* 116 */ "MEDIUMBLOB", - /* 117 */ "BLOB", - /* 118 */ "VARBINARY", - /* 119 */ "DECIMAL", - /* 120 */ "MAX_DELAY", - /* 121 */ "WATERMARK", - /* 122 */ "ROLLUP", - /* 123 */ "TTL", - /* 124 */ "SMA", - /* 125 */ "FIRST", - /* 126 */ "LAST", - /* 127 */ "SHOW", - /* 128 */ "DATABASES", - /* 129 */ "TABLES", - /* 130 */ "STABLES", - /* 131 */ "MNODES", - /* 132 */ "MODULES", - /* 133 */ "QNODES", - /* 134 */ "FUNCTIONS", - /* 135 */ "INDEXES", - /* 136 */ "ACCOUNTS", - /* 137 */ "APPS", - /* 138 */ "CONNECTIONS", - /* 139 */ "LICENCES", - /* 140 */ "GRANTS", - /* 141 */ "QUERIES", - /* 142 */ "SCORES", - /* 143 */ "TOPICS", - /* 144 */ "VARIABLES", - /* 145 */ "BNODES", - /* 146 */ "SNODES", - /* 147 */ "CLUSTER", - /* 148 */ "TRANSACTIONS", - /* 149 */ "DISTRIBUTED", - /* 150 */ "CONSUMERS", - /* 151 */ "SUBSCRIPTIONS", - /* 152 */ "LIKE", - /* 153 */ "INDEX", - /* 154 */ "FUNCTION", - /* 155 */ "INTERVAL", - /* 156 */ "TOPIC", - /* 157 */ "AS", - /* 158 */ "WITH", - /* 159 */ "META", - /* 160 */ "CONSUMER", - /* 161 */ "GROUP", - /* 162 */ "DESC", - /* 163 */ "DESCRIBE", - /* 164 */ "RESET", - /* 165 */ "QUERY", - /* 166 */ "CACHE", - /* 167 */ "EXPLAIN", - /* 168 */ "ANALYZE", - /* 169 */ "VERBOSE", - /* 170 */ "NK_BOOL", - /* 171 */ "RATIO", - /* 172 */ "NK_FLOAT", - /* 173 */ "OUTPUTTYPE", - /* 174 */ "AGGREGATE", - /* 175 */ "BUFSIZE", - /* 176 */ "STREAM", - /* 177 */ "INTO", - /* 178 */ "TRIGGER", - /* 179 */ "AT_ONCE", - /* 180 */ "WINDOW_CLOSE", - /* 181 */ "IGNORE", - /* 182 */ "EXPIRED", - /* 183 */ "KILL", - /* 184 */ "CONNECTION", - /* 185 */ "TRANSACTION", - /* 186 */ "BALANCE", - /* 187 */ "VGROUP", - /* 188 */ "MERGE", - /* 189 */ "REDISTRIBUTE", - /* 190 */ "SPLIT", - /* 191 */ "DELETE", - /* 192 */ "INSERT", - /* 193 */ "NULL", - /* 194 */ "NK_QUESTION", - /* 195 */ "NK_ARROW", - /* 196 */ "ROWTS", - /* 197 */ "TBNAME", - /* 198 */ "QSTART", - /* 199 */ "QEND", - /* 200 */ "QDURATION", - /* 201 */ "WSTART", - /* 202 */ "WEND", - /* 203 */ "WDURATION", - /* 204 */ "CAST", - /* 205 */ "NOW", - /* 206 */ "TODAY", - /* 207 */ "TIMEZONE", - /* 208 */ "CLIENT_VERSION", - /* 209 */ "SERVER_VERSION", - /* 210 */ "SERVER_STATUS", - /* 211 */ "CURRENT_USER", - /* 212 */ "COUNT", - /* 213 */ "LAST_ROW", - /* 214 */ "BETWEEN", - /* 215 */ "IS", - /* 216 */ "NK_LT", - /* 217 */ "NK_GT", - /* 218 */ "NK_LE", - /* 219 */ "NK_GE", - /* 220 */ "NK_NE", - /* 221 */ "MATCH", - /* 222 */ "NMATCH", - /* 223 */ "CONTAINS", - /* 224 */ "IN", - /* 225 */ "JOIN", - /* 226 */ "INNER", - /* 227 */ "SELECT", - /* 228 */ "DISTINCT", - /* 229 */ "WHERE", - /* 230 */ "PARTITION", - /* 231 */ "BY", - /* 232 */ "SESSION", - /* 233 */ "STATE_WINDOW", - /* 234 */ "SLIDING", - /* 235 */ "FILL", - /* 236 */ "VALUE", - /* 237 */ "NONE", - /* 238 */ "PREV", - /* 239 */ "LINEAR", - /* 240 */ "NEXT", - /* 241 */ "HAVING", - /* 242 */ "RANGE", - /* 243 */ "EVERY", - /* 244 */ "ORDER", - /* 245 */ "SLIMIT", - /* 246 */ "SOFFSET", - /* 247 */ "LIMIT", - /* 248 */ "OFFSET", - /* 249 */ "ASC", - /* 250 */ "NULLS", - /* 251 */ "ABORT", - /* 252 */ "AFTER", - /* 253 */ "ATTACH", - /* 254 */ "BEFORE", - /* 255 */ "BEGIN", - /* 256 */ "BITAND", - /* 257 */ "BITNOT", - /* 258 */ "BITOR", - /* 259 */ "BLOCKS", - /* 260 */ "CHANGE", - /* 261 */ "COMMA", - /* 262 */ "COMPACT", - /* 263 */ "CONCAT", - /* 264 */ "CONFLICT", - /* 265 */ "COPY", - /* 266 */ "DEFERRED", - /* 267 */ "DELIMITERS", - /* 268 */ "DETACH", - /* 269 */ "DIVIDE", - /* 270 */ "DOT", - /* 271 */ "EACH", - /* 272 */ "END", - /* 273 */ "FAIL", - /* 274 */ "FILE", - /* 275 */ "FOR", - /* 276 */ "GLOB", - /* 277 */ "ID", - /* 278 */ "IMMEDIATE", - /* 279 */ "IMPORT", - /* 280 */ "INITIALLY", - /* 281 */ "INSTEAD", - /* 282 */ "ISNULL", - /* 283 */ "KEY", - /* 284 */ "NK_BITNOT", - /* 285 */ "NK_SEMI", - /* 286 */ "NOTNULL", - /* 287 */ "OF", - /* 288 */ "PLUS", - /* 289 */ "PRIVILEGE", - /* 290 */ "RAISE", - /* 291 */ "REPLACE", - /* 292 */ "RESTRICT", - /* 293 */ "ROW", - /* 294 */ "SEMI", - /* 295 */ "STAR", - /* 296 */ "STATEMENT", - /* 297 */ "STRING", - /* 298 */ "TIMES", - /* 299 */ "UPDATE", - /* 300 */ "VALUES", - /* 301 */ "VARIABLE", - /* 302 */ "VIEW", - /* 303 */ "VNODES", - /* 304 */ "WAL", - /* 305 */ "cmd", - /* 306 */ "account_options", - /* 307 */ "alter_account_options", - /* 308 */ "literal", - /* 309 */ "alter_account_option", - /* 310 */ "user_name", - /* 311 */ "sysinfo_opt", - /* 312 */ "privileges", - /* 313 */ "priv_level", - /* 314 */ "priv_type_list", - /* 315 */ "priv_type", - /* 316 */ "db_name", - /* 317 */ "dnode_endpoint", - /* 318 */ "not_exists_opt", - /* 319 */ "db_options", - /* 320 */ "exists_opt", - /* 321 */ "alter_db_options", - /* 322 */ "integer_list", - /* 323 */ "variable_list", - /* 324 */ "retention_list", - /* 325 */ "alter_db_option", - /* 326 */ "retention", - /* 327 */ "full_table_name", - /* 328 */ "column_def_list", - /* 329 */ "tags_def_opt", - /* 330 */ "table_options", - /* 331 */ "multi_create_clause", - /* 332 */ "tags_def", - /* 333 */ "multi_drop_clause", - /* 334 */ "alter_table_clause", - /* 335 */ "alter_table_options", - /* 336 */ "column_name", - /* 337 */ "type_name", - /* 338 */ "signed_literal", - /* 339 */ "create_subtable_clause", - /* 340 */ "specific_cols_opt", - /* 341 */ "expression_list", - /* 342 */ "drop_table_clause", - /* 343 */ "col_name_list", - /* 344 */ "table_name", - /* 345 */ "column_def", - /* 346 */ "duration_list", - /* 347 */ "rollup_func_list", - /* 348 */ "alter_table_option", - /* 349 */ "duration_literal", - /* 350 */ "rollup_func_name", - /* 351 */ "function_name", - /* 352 */ "col_name", - /* 353 */ "db_name_cond_opt", - /* 354 */ "like_pattern_opt", - /* 355 */ "table_name_cond", - /* 356 */ "from_db_opt", - /* 357 */ "index_options", - /* 358 */ "func_list", - /* 359 */ "sliding_opt", - /* 360 */ "sma_stream_opt", - /* 361 */ "func", - /* 362 */ "stream_options", - /* 363 */ "topic_name", - /* 364 */ "query_expression", - /* 365 */ "cgroup_name", - /* 366 */ "analyze_opt", - /* 367 */ "explain_options", - /* 368 */ "agg_func_opt", - /* 369 */ "bufsize_opt", - /* 370 */ "stream_name", - /* 371 */ "dnode_list", - /* 372 */ "where_clause_opt", - /* 373 */ "signed", - /* 374 */ "literal_func", - /* 375 */ "literal_list", - /* 376 */ "table_alias", - /* 377 */ "column_alias", - /* 378 */ "expression", - /* 379 */ "pseudo_column", - /* 380 */ "column_reference", - /* 381 */ "function_expression", - /* 382 */ "subquery", - /* 383 */ "star_func", - /* 384 */ "star_func_para_list", - /* 385 */ "noarg_func", - /* 386 */ "other_para_list", - /* 387 */ "star_func_para", - /* 388 */ "predicate", - /* 389 */ "compare_op", - /* 390 */ "in_op", - /* 391 */ "in_predicate_value", - /* 392 */ "boolean_value_expression", - /* 393 */ "boolean_primary", - /* 394 */ "common_expression", - /* 395 */ "from_clause_opt", - /* 396 */ "table_reference_list", - /* 397 */ "table_reference", - /* 398 */ "table_primary", - /* 399 */ "joined_table", - /* 400 */ "alias_opt", - /* 401 */ "parenthesized_joined_table", - /* 402 */ "join_type", - /* 403 */ "search_condition", - /* 404 */ "query_specification", - /* 405 */ "set_quantifier_opt", - /* 406 */ "select_list", - /* 407 */ "partition_by_clause_opt", - /* 408 */ "range_opt", - /* 409 */ "every_opt", - /* 410 */ "fill_opt", - /* 411 */ "twindow_clause_opt", - /* 412 */ "group_by_clause_opt", - /* 413 */ "having_clause_opt", - /* 414 */ "select_item", - /* 415 */ "fill_mode", - /* 416 */ "group_by_list", - /* 417 */ "query_expression_body", - /* 418 */ "order_by_clause_opt", - /* 419 */ "slimit_clause_opt", - /* 420 */ "limit_clause_opt", - /* 421 */ "query_primary", - /* 422 */ "sort_specification_list", - /* 423 */ "sort_specification", - /* 424 */ "ordering_specification_opt", - /* 425 */ "null_ordering_opt", + /* 87 */ "SST_TRIGGER", + /* 88 */ "NK_COLON", + /* 89 */ "TABLE", + /* 90 */ "NK_LP", + /* 91 */ "NK_RP", + /* 92 */ "STABLE", + /* 93 */ "ADD", + /* 94 */ "COLUMN", + /* 95 */ "MODIFY", + /* 96 */ "RENAME", + /* 97 */ "TAG", + /* 98 */ "SET", + /* 99 */ "NK_EQ", + /* 100 */ "USING", + /* 101 */ "TAGS", + /* 102 */ "COMMENT", + /* 103 */ "BOOL", + /* 104 */ "TINYINT", + /* 105 */ "SMALLINT", + /* 106 */ "INT", + /* 107 */ "INTEGER", + /* 108 */ "BIGINT", + /* 109 */ "FLOAT", + /* 110 */ "DOUBLE", + /* 111 */ "BINARY", + /* 112 */ "TIMESTAMP", + /* 113 */ "NCHAR", + /* 114 */ "UNSIGNED", + /* 115 */ "JSON", + /* 116 */ "VARCHAR", + /* 117 */ "MEDIUMBLOB", + /* 118 */ "BLOB", + /* 119 */ "VARBINARY", + /* 120 */ "DECIMAL", + /* 121 */ "MAX_DELAY", + /* 122 */ "WATERMARK", + /* 123 */ "ROLLUP", + /* 124 */ "TTL", + /* 125 */ "SMA", + /* 126 */ "FIRST", + /* 127 */ "LAST", + /* 128 */ "SHOW", + /* 129 */ "DATABASES", + /* 130 */ "TABLES", + /* 131 */ "STABLES", + /* 132 */ "MNODES", + /* 133 */ "MODULES", + /* 134 */ "QNODES", + /* 135 */ "FUNCTIONS", + /* 136 */ "INDEXES", + /* 137 */ "ACCOUNTS", + /* 138 */ "APPS", + /* 139 */ "CONNECTIONS", + /* 140 */ "LICENCES", + /* 141 */ "GRANTS", + /* 142 */ "QUERIES", + /* 143 */ "SCORES", + /* 144 */ "TOPICS", + /* 145 */ "VARIABLES", + /* 146 */ "BNODES", + /* 147 */ "SNODES", + /* 148 */ "CLUSTER", + /* 149 */ "TRANSACTIONS", + /* 150 */ "DISTRIBUTED", + /* 151 */ "CONSUMERS", + /* 152 */ "SUBSCRIPTIONS", + /* 153 */ "VNODES", + /* 154 */ "LIKE", + /* 155 */ "INDEX", + /* 156 */ "FUNCTION", + /* 157 */ "INTERVAL", + /* 158 */ "TOPIC", + /* 159 */ "AS", + /* 160 */ "WITH", + /* 161 */ "META", + /* 162 */ "CONSUMER", + /* 163 */ "GROUP", + /* 164 */ "DESC", + /* 165 */ "DESCRIBE", + /* 166 */ "RESET", + /* 167 */ "QUERY", + /* 168 */ "CACHE", + /* 169 */ "EXPLAIN", + /* 170 */ "ANALYZE", + /* 171 */ "VERBOSE", + /* 172 */ "NK_BOOL", + /* 173 */ "RATIO", + /* 174 */ "NK_FLOAT", + /* 175 */ "OUTPUTTYPE", + /* 176 */ "AGGREGATE", + /* 177 */ "BUFSIZE", + /* 178 */ "STREAM", + /* 179 */ "INTO", + /* 180 */ "TRIGGER", + /* 181 */ "AT_ONCE", + /* 182 */ "WINDOW_CLOSE", + /* 183 */ "IGNORE", + /* 184 */ "EXPIRED", + /* 185 */ "KILL", + /* 186 */ "CONNECTION", + /* 187 */ "TRANSACTION", + /* 188 */ "BALANCE", + /* 189 */ "VGROUP", + /* 190 */ "MERGE", + /* 191 */ "REDISTRIBUTE", + /* 192 */ "SPLIT", + /* 193 */ "DELETE", + /* 194 */ "INSERT", + /* 195 */ "NULL", + /* 196 */ "NK_QUESTION", + /* 197 */ "NK_ARROW", + /* 198 */ "ROWTS", + /* 199 */ "TBNAME", + /* 200 */ "QSTART", + /* 201 */ "QEND", + /* 202 */ "QDURATION", + /* 203 */ "WSTART", + /* 204 */ "WEND", + /* 205 */ "WDURATION", + /* 206 */ "CAST", + /* 207 */ "NOW", + /* 208 */ "TODAY", + /* 209 */ "TIMEZONE", + /* 210 */ "CLIENT_VERSION", + /* 211 */ "SERVER_VERSION", + /* 212 */ "SERVER_STATUS", + /* 213 */ "CURRENT_USER", + /* 214 */ "COUNT", + /* 215 */ "LAST_ROW", + /* 216 */ "BETWEEN", + /* 217 */ "IS", + /* 218 */ "NK_LT", + /* 219 */ "NK_GT", + /* 220 */ "NK_LE", + /* 221 */ "NK_GE", + /* 222 */ "NK_NE", + /* 223 */ "MATCH", + /* 224 */ "NMATCH", + /* 225 */ "CONTAINS", + /* 226 */ "IN", + /* 227 */ "JOIN", + /* 228 */ "INNER", + /* 229 */ "SELECT", + /* 230 */ "DISTINCT", + /* 231 */ "WHERE", + /* 232 */ "PARTITION", + /* 233 */ "BY", + /* 234 */ "SESSION", + /* 235 */ "STATE_WINDOW", + /* 236 */ "SLIDING", + /* 237 */ "FILL", + /* 238 */ "VALUE", + /* 239 */ "NONE", + /* 240 */ "PREV", + /* 241 */ "LINEAR", + /* 242 */ "NEXT", + /* 243 */ "HAVING", + /* 244 */ "RANGE", + /* 245 */ "EVERY", + /* 246 */ "ORDER", + /* 247 */ "SLIMIT", + /* 248 */ "SOFFSET", + /* 249 */ "LIMIT", + /* 250 */ "OFFSET", + /* 251 */ "ASC", + /* 252 */ "NULLS", + /* 253 */ "ABORT", + /* 254 */ "AFTER", + /* 255 */ "ATTACH", + /* 256 */ "BEFORE", + /* 257 */ "BEGIN", + /* 258 */ "BITAND", + /* 259 */ "BITNOT", + /* 260 */ "BITOR", + /* 261 */ "BLOCKS", + /* 262 */ "CHANGE", + /* 263 */ "COMMA", + /* 264 */ "COMPACT", + /* 265 */ "CONCAT", + /* 266 */ "CONFLICT", + /* 267 */ "COPY", + /* 268 */ "DEFERRED", + /* 269 */ "DELIMITERS", + /* 270 */ "DETACH", + /* 271 */ "DIVIDE", + /* 272 */ "DOT", + /* 273 */ "EACH", + /* 274 */ "END", + /* 275 */ "FAIL", + /* 276 */ "FILE", + /* 277 */ "FOR", + /* 278 */ "GLOB", + /* 279 */ "ID", + /* 280 */ "IMMEDIATE", + /* 281 */ "IMPORT", + /* 282 */ "INITIALLY", + /* 283 */ "INSTEAD", + /* 284 */ "ISNULL", + /* 285 */ "KEY", + /* 286 */ "NK_BITNOT", + /* 287 */ "NK_SEMI", + /* 288 */ "NOTNULL", + /* 289 */ "OF", + /* 290 */ "PLUS", + /* 291 */ "PRIVILEGE", + /* 292 */ "RAISE", + /* 293 */ "REPLACE", + /* 294 */ "RESTRICT", + /* 295 */ "ROW", + /* 296 */ "SEMI", + /* 297 */ "STAR", + /* 298 */ "STATEMENT", + /* 299 */ "STRING", + /* 300 */ "TIMES", + /* 301 */ "UPDATE", + /* 302 */ "VALUES", + /* 303 */ "VARIABLE", + /* 304 */ "VIEW", + /* 305 */ "WAL", + /* 306 */ "cmd", + /* 307 */ "account_options", + /* 308 */ "alter_account_options", + /* 309 */ "literal", + /* 310 */ "alter_account_option", + /* 311 */ "user_name", + /* 312 */ "sysinfo_opt", + /* 313 */ "privileges", + /* 314 */ "priv_level", + /* 315 */ "priv_type_list", + /* 316 */ "priv_type", + /* 317 */ "db_name", + /* 318 */ "dnode_endpoint", + /* 319 */ "not_exists_opt", + /* 320 */ "db_options", + /* 321 */ "exists_opt", + /* 322 */ "alter_db_options", + /* 323 */ "integer_list", + /* 324 */ "variable_list", + /* 325 */ "retention_list", + /* 326 */ "alter_db_option", + /* 327 */ "retention", + /* 328 */ "full_table_name", + /* 329 */ "column_def_list", + /* 330 */ "tags_def_opt", + /* 331 */ "table_options", + /* 332 */ "multi_create_clause", + /* 333 */ "tags_def", + /* 334 */ "multi_drop_clause", + /* 335 */ "alter_table_clause", + /* 336 */ "alter_table_options", + /* 337 */ "column_name", + /* 338 */ "type_name", + /* 339 */ "signed_literal", + /* 340 */ "create_subtable_clause", + /* 341 */ "specific_cols_opt", + /* 342 */ "expression_list", + /* 343 */ "drop_table_clause", + /* 344 */ "col_name_list", + /* 345 */ "table_name", + /* 346 */ "column_def", + /* 347 */ "duration_list", + /* 348 */ "rollup_func_list", + /* 349 */ "alter_table_option", + /* 350 */ "duration_literal", + /* 351 */ "rollup_func_name", + /* 352 */ "function_name", + /* 353 */ "col_name", + /* 354 */ "db_name_cond_opt", + /* 355 */ "like_pattern_opt", + /* 356 */ "table_name_cond", + /* 357 */ "from_db_opt", + /* 358 */ "index_options", + /* 359 */ "func_list", + /* 360 */ "sliding_opt", + /* 361 */ "sma_stream_opt", + /* 362 */ "func", + /* 363 */ "stream_options", + /* 364 */ "topic_name", + /* 365 */ "query_expression", + /* 366 */ "cgroup_name", + /* 367 */ "analyze_opt", + /* 368 */ "explain_options", + /* 369 */ "agg_func_opt", + /* 370 */ "bufsize_opt", + /* 371 */ "stream_name", + /* 372 */ "dnode_list", + /* 373 */ "where_clause_opt", + /* 374 */ "signed", + /* 375 */ "literal_func", + /* 376 */ "literal_list", + /* 377 */ "table_alias", + /* 378 */ "column_alias", + /* 379 */ "expression", + /* 380 */ "pseudo_column", + /* 381 */ "column_reference", + /* 382 */ "function_expression", + /* 383 */ "subquery", + /* 384 */ "star_func", + /* 385 */ "star_func_para_list", + /* 386 */ "noarg_func", + /* 387 */ "other_para_list", + /* 388 */ "star_func_para", + /* 389 */ "predicate", + /* 390 */ "compare_op", + /* 391 */ "in_op", + /* 392 */ "in_predicate_value", + /* 393 */ "boolean_value_expression", + /* 394 */ "boolean_primary", + /* 395 */ "common_expression", + /* 396 */ "from_clause_opt", + /* 397 */ "table_reference_list", + /* 398 */ "table_reference", + /* 399 */ "table_primary", + /* 400 */ "joined_table", + /* 401 */ "alias_opt", + /* 402 */ "parenthesized_joined_table", + /* 403 */ "join_type", + /* 404 */ "search_condition", + /* 405 */ "query_specification", + /* 406 */ "set_quantifier_opt", + /* 407 */ "select_list", + /* 408 */ "partition_by_clause_opt", + /* 409 */ "range_opt", + /* 410 */ "every_opt", + /* 411 */ "fill_opt", + /* 412 */ "twindow_clause_opt", + /* 413 */ "group_by_clause_opt", + /* 414 */ "having_clause_opt", + /* 415 */ "select_item", + /* 416 */ "fill_mode", + /* 417 */ "group_by_list", + /* 418 */ "query_expression_body", + /* 419 */ "order_by_clause_opt", + /* 420 */ "slimit_clause_opt", + /* 421 */ "limit_clause_opt", + /* 422 */ "query_primary", + /* 423 */ "sort_specification_list", + /* 424 */ "sort_specification", + /* 425 */ "ordering_specification_opt", + /* 426 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1804,395 +1848,399 @@ static const char *const yyRuleName[] = { /* 97 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", /* 98 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", /* 99 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 100 */ "alter_db_options ::= alter_db_option", - /* 101 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 102 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 103 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 104 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 105 */ "alter_db_option ::= KEEP integer_list", - /* 106 */ "alter_db_option ::= KEEP variable_list", - /* 107 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 108 */ "integer_list ::= NK_INTEGER", - /* 109 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 110 */ "variable_list ::= NK_VARIABLE", - /* 111 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 112 */ "retention_list ::= retention", - /* 113 */ "retention_list ::= retention_list NK_COMMA retention", - /* 114 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 115 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 116 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 117 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 118 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 119 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 120 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 121 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 122 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 123 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 124 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 125 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 126 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 127 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 128 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 129 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 130 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 131 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 132 */ "multi_create_clause ::= create_subtable_clause", - /* 133 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 134 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 135 */ "multi_drop_clause ::= drop_table_clause", - /* 136 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 137 */ "drop_table_clause ::= exists_opt full_table_name", - /* 138 */ "specific_cols_opt ::=", - /* 139 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 140 */ "full_table_name ::= table_name", - /* 141 */ "full_table_name ::= db_name NK_DOT table_name", - /* 142 */ "column_def_list ::= column_def", - /* 143 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 144 */ "column_def ::= column_name type_name", - /* 145 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 146 */ "type_name ::= BOOL", - /* 147 */ "type_name ::= TINYINT", - /* 148 */ "type_name ::= SMALLINT", - /* 149 */ "type_name ::= INT", - /* 150 */ "type_name ::= INTEGER", - /* 151 */ "type_name ::= BIGINT", - /* 152 */ "type_name ::= FLOAT", - /* 153 */ "type_name ::= DOUBLE", - /* 154 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 155 */ "type_name ::= TIMESTAMP", - /* 156 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 157 */ "type_name ::= TINYINT UNSIGNED", - /* 158 */ "type_name ::= SMALLINT UNSIGNED", - /* 159 */ "type_name ::= INT UNSIGNED", - /* 160 */ "type_name ::= BIGINT UNSIGNED", - /* 161 */ "type_name ::= JSON", - /* 162 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 163 */ "type_name ::= MEDIUMBLOB", - /* 164 */ "type_name ::= BLOB", - /* 165 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 166 */ "type_name ::= DECIMAL", - /* 167 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 168 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 169 */ "tags_def_opt ::=", - /* 170 */ "tags_def_opt ::= tags_def", - /* 171 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 172 */ "table_options ::=", - /* 173 */ "table_options ::= table_options COMMENT NK_STRING", - /* 174 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 175 */ "table_options ::= table_options WATERMARK duration_list", - /* 176 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 177 */ "table_options ::= table_options TTL NK_INTEGER", - /* 178 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 179 */ "alter_table_options ::= alter_table_option", - /* 180 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 181 */ "alter_table_option ::= COMMENT NK_STRING", - /* 182 */ "alter_table_option ::= TTL NK_INTEGER", - /* 183 */ "duration_list ::= duration_literal", - /* 184 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 185 */ "rollup_func_list ::= rollup_func_name", - /* 186 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 187 */ "rollup_func_name ::= function_name", - /* 188 */ "rollup_func_name ::= FIRST", - /* 189 */ "rollup_func_name ::= LAST", - /* 190 */ "col_name_list ::= col_name", - /* 191 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 192 */ "col_name ::= column_name", - /* 193 */ "cmd ::= SHOW DNODES", - /* 194 */ "cmd ::= SHOW USERS", - /* 195 */ "cmd ::= SHOW DATABASES", - /* 196 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 197 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 198 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 199 */ "cmd ::= SHOW MNODES", - /* 200 */ "cmd ::= SHOW MODULES", - /* 201 */ "cmd ::= SHOW QNODES", - /* 202 */ "cmd ::= SHOW FUNCTIONS", - /* 203 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 204 */ "cmd ::= SHOW STREAMS", - /* 205 */ "cmd ::= SHOW ACCOUNTS", - /* 206 */ "cmd ::= SHOW APPS", - /* 207 */ "cmd ::= SHOW CONNECTIONS", - /* 208 */ "cmd ::= SHOW LICENCES", - /* 209 */ "cmd ::= SHOW GRANTS", - /* 210 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 211 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 212 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 213 */ "cmd ::= SHOW QUERIES", - /* 214 */ "cmd ::= SHOW SCORES", - /* 215 */ "cmd ::= SHOW TOPICS", - /* 216 */ "cmd ::= SHOW VARIABLES", - /* 217 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 218 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES", - /* 219 */ "cmd ::= SHOW BNODES", - /* 220 */ "cmd ::= SHOW SNODES", - /* 221 */ "cmd ::= SHOW CLUSTER", - /* 222 */ "cmd ::= SHOW TRANSACTIONS", - /* 223 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 224 */ "cmd ::= SHOW CONSUMERS", - /* 225 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 226 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 227 */ "db_name_cond_opt ::=", - /* 228 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 229 */ "like_pattern_opt ::=", - /* 230 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 231 */ "table_name_cond ::= table_name", - /* 232 */ "from_db_opt ::=", - /* 233 */ "from_db_opt ::= FROM db_name", - /* 234 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 235 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 236 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 237 */ "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", - /* 238 */ "func_list ::= func", - /* 239 */ "func_list ::= func_list NK_COMMA func", - /* 240 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 241 */ "sma_stream_opt ::=", - /* 242 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 243 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 244 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", - /* 245 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 246 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 247 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 248 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 249 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 250 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 251 */ "cmd ::= DESC full_table_name", - /* 252 */ "cmd ::= DESCRIBE full_table_name", - /* 253 */ "cmd ::= RESET QUERY CACHE", - /* 254 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression", - /* 255 */ "analyze_opt ::=", - /* 256 */ "analyze_opt ::= ANALYZE", - /* 257 */ "explain_options ::=", - /* 258 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 259 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 260 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 261 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 262 */ "agg_func_opt ::=", - /* 263 */ "agg_func_opt ::= AGGREGATE", - /* 264 */ "bufsize_opt ::=", - /* 265 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 266 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression", - /* 267 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 268 */ "stream_options ::=", - /* 269 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 270 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 271 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 272 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 273 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 274 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 275 */ "cmd ::= KILL QUERY NK_STRING", - /* 276 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 277 */ "cmd ::= BALANCE VGROUP", - /* 278 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 279 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 280 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 281 */ "dnode_list ::= DNODE NK_INTEGER", - /* 282 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 283 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 284 */ "cmd ::= query_expression", - /* 285 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression", - /* 286 */ "cmd ::= INSERT INTO full_table_name query_expression", - /* 287 */ "literal ::= NK_INTEGER", - /* 288 */ "literal ::= NK_FLOAT", - /* 289 */ "literal ::= NK_STRING", - /* 290 */ "literal ::= NK_BOOL", - /* 291 */ "literal ::= TIMESTAMP NK_STRING", - /* 292 */ "literal ::= duration_literal", - /* 293 */ "literal ::= NULL", - /* 294 */ "literal ::= NK_QUESTION", - /* 295 */ "duration_literal ::= NK_VARIABLE", - /* 296 */ "signed ::= NK_INTEGER", - /* 297 */ "signed ::= NK_PLUS NK_INTEGER", - /* 298 */ "signed ::= NK_MINUS NK_INTEGER", - /* 299 */ "signed ::= NK_FLOAT", - /* 300 */ "signed ::= NK_PLUS NK_FLOAT", - /* 301 */ "signed ::= NK_MINUS NK_FLOAT", - /* 302 */ "signed_literal ::= signed", - /* 303 */ "signed_literal ::= NK_STRING", - /* 304 */ "signed_literal ::= NK_BOOL", - /* 305 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 306 */ "signed_literal ::= duration_literal", - /* 307 */ "signed_literal ::= NULL", - /* 308 */ "signed_literal ::= literal_func", - /* 309 */ "signed_literal ::= NK_QUESTION", - /* 310 */ "literal_list ::= signed_literal", - /* 311 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 312 */ "db_name ::= NK_ID", - /* 313 */ "table_name ::= NK_ID", - /* 314 */ "column_name ::= NK_ID", - /* 315 */ "function_name ::= NK_ID", - /* 316 */ "table_alias ::= NK_ID", - /* 317 */ "column_alias ::= NK_ID", - /* 318 */ "user_name ::= NK_ID", - /* 319 */ "topic_name ::= NK_ID", - /* 320 */ "stream_name ::= NK_ID", - /* 321 */ "cgroup_name ::= NK_ID", - /* 322 */ "expression ::= literal", - /* 323 */ "expression ::= pseudo_column", - /* 324 */ "expression ::= column_reference", - /* 325 */ "expression ::= function_expression", - /* 326 */ "expression ::= subquery", - /* 327 */ "expression ::= NK_LP expression NK_RP", - /* 328 */ "expression ::= NK_PLUS expression", - /* 329 */ "expression ::= NK_MINUS expression", - /* 330 */ "expression ::= expression NK_PLUS expression", - /* 331 */ "expression ::= expression NK_MINUS expression", - /* 332 */ "expression ::= expression NK_STAR expression", - /* 333 */ "expression ::= expression NK_SLASH expression", - /* 334 */ "expression ::= expression NK_REM expression", - /* 335 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 336 */ "expression ::= expression NK_BITAND expression", - /* 337 */ "expression ::= expression NK_BITOR expression", - /* 338 */ "expression_list ::= expression", - /* 339 */ "expression_list ::= expression_list NK_COMMA expression", - /* 340 */ "column_reference ::= column_name", - /* 341 */ "column_reference ::= table_name NK_DOT column_name", - /* 342 */ "pseudo_column ::= ROWTS", - /* 343 */ "pseudo_column ::= TBNAME", - /* 344 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 345 */ "pseudo_column ::= QSTART", - /* 346 */ "pseudo_column ::= QEND", - /* 347 */ "pseudo_column ::= QDURATION", - /* 348 */ "pseudo_column ::= WSTART", - /* 349 */ "pseudo_column ::= WEND", - /* 350 */ "pseudo_column ::= WDURATION", - /* 351 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 352 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 353 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", - /* 354 */ "function_expression ::= literal_func", - /* 355 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 356 */ "literal_func ::= NOW", - /* 357 */ "noarg_func ::= NOW", - /* 358 */ "noarg_func ::= TODAY", - /* 359 */ "noarg_func ::= TIMEZONE", - /* 360 */ "noarg_func ::= DATABASE", - /* 361 */ "noarg_func ::= CLIENT_VERSION", - /* 362 */ "noarg_func ::= SERVER_VERSION", - /* 363 */ "noarg_func ::= SERVER_STATUS", - /* 364 */ "noarg_func ::= CURRENT_USER", - /* 365 */ "noarg_func ::= USER", - /* 366 */ "star_func ::= COUNT", - /* 367 */ "star_func ::= FIRST", - /* 368 */ "star_func ::= LAST", - /* 369 */ "star_func ::= LAST_ROW", - /* 370 */ "star_func_para_list ::= NK_STAR", - /* 371 */ "star_func_para_list ::= other_para_list", - /* 372 */ "other_para_list ::= star_func_para", - /* 373 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 374 */ "star_func_para ::= expression", - /* 375 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 376 */ "predicate ::= expression compare_op expression", - /* 377 */ "predicate ::= expression BETWEEN expression AND expression", - /* 378 */ "predicate ::= expression NOT BETWEEN expression AND expression", - /* 379 */ "predicate ::= expression IS NULL", - /* 380 */ "predicate ::= expression IS NOT NULL", - /* 381 */ "predicate ::= expression in_op in_predicate_value", - /* 382 */ "compare_op ::= NK_LT", - /* 383 */ "compare_op ::= NK_GT", - /* 384 */ "compare_op ::= NK_LE", - /* 385 */ "compare_op ::= NK_GE", - /* 386 */ "compare_op ::= NK_NE", - /* 387 */ "compare_op ::= NK_EQ", - /* 388 */ "compare_op ::= LIKE", - /* 389 */ "compare_op ::= NOT LIKE", - /* 390 */ "compare_op ::= MATCH", - /* 391 */ "compare_op ::= NMATCH", - /* 392 */ "compare_op ::= CONTAINS", - /* 393 */ "in_op ::= IN", - /* 394 */ "in_op ::= NOT IN", - /* 395 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 396 */ "boolean_value_expression ::= boolean_primary", - /* 397 */ "boolean_value_expression ::= NOT boolean_primary", - /* 398 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 399 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 400 */ "boolean_primary ::= predicate", - /* 401 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 402 */ "common_expression ::= expression", - /* 403 */ "common_expression ::= boolean_value_expression", - /* 404 */ "from_clause_opt ::=", - /* 405 */ "from_clause_opt ::= FROM table_reference_list", - /* 406 */ "table_reference_list ::= table_reference", - /* 407 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 408 */ "table_reference ::= table_primary", - /* 409 */ "table_reference ::= joined_table", - /* 410 */ "table_primary ::= table_name alias_opt", - /* 411 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 412 */ "table_primary ::= subquery alias_opt", - /* 413 */ "table_primary ::= parenthesized_joined_table", - /* 414 */ "alias_opt ::=", - /* 415 */ "alias_opt ::= table_alias", - /* 416 */ "alias_opt ::= AS table_alias", - /* 417 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 418 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 419 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 420 */ "join_type ::=", - /* 421 */ "join_type ::= INNER", - /* 422 */ "query_specification ::= SELECT set_quantifier_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", - /* 423 */ "set_quantifier_opt ::=", - /* 424 */ "set_quantifier_opt ::= DISTINCT", - /* 425 */ "set_quantifier_opt ::= ALL", - /* 426 */ "select_list ::= select_item", - /* 427 */ "select_list ::= select_list NK_COMMA select_item", - /* 428 */ "select_item ::= NK_STAR", - /* 429 */ "select_item ::= common_expression", - /* 430 */ "select_item ::= common_expression column_alias", - /* 431 */ "select_item ::= common_expression AS column_alias", - /* 432 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 433 */ "where_clause_opt ::=", - /* 434 */ "where_clause_opt ::= WHERE search_condition", - /* 435 */ "partition_by_clause_opt ::=", - /* 436 */ "partition_by_clause_opt ::= PARTITION BY expression_list", - /* 437 */ "twindow_clause_opt ::=", - /* 438 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 439 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", - /* 440 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 441 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 442 */ "sliding_opt ::=", - /* 443 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 444 */ "fill_opt ::=", - /* 445 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 446 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 447 */ "fill_mode ::= NONE", - /* 448 */ "fill_mode ::= PREV", - /* 449 */ "fill_mode ::= NULL", - /* 450 */ "fill_mode ::= LINEAR", - /* 451 */ "fill_mode ::= NEXT", - /* 452 */ "group_by_clause_opt ::=", - /* 453 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 454 */ "group_by_list ::= expression", - /* 455 */ "group_by_list ::= group_by_list NK_COMMA expression", - /* 456 */ "having_clause_opt ::=", - /* 457 */ "having_clause_opt ::= HAVING search_condition", - /* 458 */ "range_opt ::=", - /* 459 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", - /* 460 */ "every_opt ::=", - /* 461 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 462 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 463 */ "query_expression_body ::= query_primary", - /* 464 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", - /* 465 */ "query_expression_body ::= query_expression_body UNION query_expression_body", - /* 466 */ "query_primary ::= query_specification", - /* 467 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", - /* 468 */ "order_by_clause_opt ::=", - /* 469 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 470 */ "slimit_clause_opt ::=", - /* 471 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 472 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 473 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 474 */ "limit_clause_opt ::=", - /* 475 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 476 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 477 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 478 */ "subquery ::= NK_LP query_expression NK_RP", - /* 479 */ "search_condition ::= common_expression", - /* 480 */ "sort_specification_list ::= sort_specification", - /* 481 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 482 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", - /* 483 */ "ordering_specification_opt ::=", - /* 484 */ "ordering_specification_opt ::= ASC", - /* 485 */ "ordering_specification_opt ::= DESC", - /* 486 */ "null_ordering_opt ::=", - /* 487 */ "null_ordering_opt ::= NULLS FIRST", - /* 488 */ "null_ordering_opt ::= NULLS LAST", + /* 100 */ "db_options ::= db_options SST_TRIGGER NK_INTEGER", + /* 101 */ "alter_db_options ::= alter_db_option", + /* 102 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 103 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 104 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 105 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 106 */ "alter_db_option ::= KEEP integer_list", + /* 107 */ "alter_db_option ::= KEEP variable_list", + /* 108 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 109 */ "alter_db_option ::= SST_TRIGGER NK_INTEGER", + /* 110 */ "integer_list ::= NK_INTEGER", + /* 111 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 112 */ "variable_list ::= NK_VARIABLE", + /* 113 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 114 */ "retention_list ::= retention", + /* 115 */ "retention_list ::= retention_list NK_COMMA retention", + /* 116 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 117 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 118 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 119 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 120 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 121 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 122 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 123 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 124 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 125 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 126 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 127 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 128 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 129 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 130 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 131 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 132 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 133 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 134 */ "multi_create_clause ::= create_subtable_clause", + /* 135 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 136 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 137 */ "multi_drop_clause ::= drop_table_clause", + /* 138 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 139 */ "drop_table_clause ::= exists_opt full_table_name", + /* 140 */ "specific_cols_opt ::=", + /* 141 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 142 */ "full_table_name ::= table_name", + /* 143 */ "full_table_name ::= db_name NK_DOT table_name", + /* 144 */ "column_def_list ::= column_def", + /* 145 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 146 */ "column_def ::= column_name type_name", + /* 147 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 148 */ "type_name ::= BOOL", + /* 149 */ "type_name ::= TINYINT", + /* 150 */ "type_name ::= SMALLINT", + /* 151 */ "type_name ::= INT", + /* 152 */ "type_name ::= INTEGER", + /* 153 */ "type_name ::= BIGINT", + /* 154 */ "type_name ::= FLOAT", + /* 155 */ "type_name ::= DOUBLE", + /* 156 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 157 */ "type_name ::= TIMESTAMP", + /* 158 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 159 */ "type_name ::= TINYINT UNSIGNED", + /* 160 */ "type_name ::= SMALLINT UNSIGNED", + /* 161 */ "type_name ::= INT UNSIGNED", + /* 162 */ "type_name ::= BIGINT UNSIGNED", + /* 163 */ "type_name ::= JSON", + /* 164 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 165 */ "type_name ::= MEDIUMBLOB", + /* 166 */ "type_name ::= BLOB", + /* 167 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 168 */ "type_name ::= DECIMAL", + /* 169 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 170 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 171 */ "tags_def_opt ::=", + /* 172 */ "tags_def_opt ::= tags_def", + /* 173 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 174 */ "table_options ::=", + /* 175 */ "table_options ::= table_options COMMENT NK_STRING", + /* 176 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 177 */ "table_options ::= table_options WATERMARK duration_list", + /* 178 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 179 */ "table_options ::= table_options TTL NK_INTEGER", + /* 180 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 181 */ "alter_table_options ::= alter_table_option", + /* 182 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 183 */ "alter_table_option ::= COMMENT NK_STRING", + /* 184 */ "alter_table_option ::= TTL NK_INTEGER", + /* 185 */ "duration_list ::= duration_literal", + /* 186 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 187 */ "rollup_func_list ::= rollup_func_name", + /* 188 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 189 */ "rollup_func_name ::= function_name", + /* 190 */ "rollup_func_name ::= FIRST", + /* 191 */ "rollup_func_name ::= LAST", + /* 192 */ "col_name_list ::= col_name", + /* 193 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 194 */ "col_name ::= column_name", + /* 195 */ "cmd ::= SHOW DNODES", + /* 196 */ "cmd ::= SHOW USERS", + /* 197 */ "cmd ::= SHOW DATABASES", + /* 198 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 199 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 200 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 201 */ "cmd ::= SHOW MNODES", + /* 202 */ "cmd ::= SHOW MODULES", + /* 203 */ "cmd ::= SHOW QNODES", + /* 204 */ "cmd ::= SHOW FUNCTIONS", + /* 205 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 206 */ "cmd ::= SHOW STREAMS", + /* 207 */ "cmd ::= SHOW ACCOUNTS", + /* 208 */ "cmd ::= SHOW APPS", + /* 209 */ "cmd ::= SHOW CONNECTIONS", + /* 210 */ "cmd ::= SHOW LICENCES", + /* 211 */ "cmd ::= SHOW GRANTS", + /* 212 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 213 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 214 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 215 */ "cmd ::= SHOW QUERIES", + /* 216 */ "cmd ::= SHOW SCORES", + /* 217 */ "cmd ::= SHOW TOPICS", + /* 218 */ "cmd ::= SHOW VARIABLES", + /* 219 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 220 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES", + /* 221 */ "cmd ::= SHOW BNODES", + /* 222 */ "cmd ::= SHOW SNODES", + /* 223 */ "cmd ::= SHOW CLUSTER", + /* 224 */ "cmd ::= SHOW TRANSACTIONS", + /* 225 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 226 */ "cmd ::= SHOW CONSUMERS", + /* 227 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 228 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 229 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 230 */ "cmd ::= SHOW VNODES NK_STRING", + /* 231 */ "db_name_cond_opt ::=", + /* 232 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 233 */ "like_pattern_opt ::=", + /* 234 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 235 */ "table_name_cond ::= table_name", + /* 236 */ "from_db_opt ::=", + /* 237 */ "from_db_opt ::= FROM db_name", + /* 238 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 239 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 240 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 241 */ "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", + /* 242 */ "func_list ::= func", + /* 243 */ "func_list ::= func_list NK_COMMA func", + /* 244 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 245 */ "sma_stream_opt ::=", + /* 246 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", + /* 247 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", + /* 248 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression", + /* 249 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 250 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 251 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 252 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 253 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 254 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 255 */ "cmd ::= DESC full_table_name", + /* 256 */ "cmd ::= DESCRIBE full_table_name", + /* 257 */ "cmd ::= RESET QUERY CACHE", + /* 258 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression", + /* 259 */ "analyze_opt ::=", + /* 260 */ "analyze_opt ::= ANALYZE", + /* 261 */ "explain_options ::=", + /* 262 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 263 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 264 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 265 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 266 */ "agg_func_opt ::=", + /* 267 */ "agg_func_opt ::= AGGREGATE", + /* 268 */ "bufsize_opt ::=", + /* 269 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 270 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression", + /* 271 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 272 */ "stream_options ::=", + /* 273 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 274 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 275 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 276 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 277 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 278 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 279 */ "cmd ::= KILL QUERY NK_STRING", + /* 280 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 281 */ "cmd ::= BALANCE VGROUP", + /* 282 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 283 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 284 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 285 */ "dnode_list ::= DNODE NK_INTEGER", + /* 286 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 287 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 288 */ "cmd ::= query_expression", + /* 289 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression", + /* 290 */ "cmd ::= INSERT INTO full_table_name query_expression", + /* 291 */ "literal ::= NK_INTEGER", + /* 292 */ "literal ::= NK_FLOAT", + /* 293 */ "literal ::= NK_STRING", + /* 294 */ "literal ::= NK_BOOL", + /* 295 */ "literal ::= TIMESTAMP NK_STRING", + /* 296 */ "literal ::= duration_literal", + /* 297 */ "literal ::= NULL", + /* 298 */ "literal ::= NK_QUESTION", + /* 299 */ "duration_literal ::= NK_VARIABLE", + /* 300 */ "signed ::= NK_INTEGER", + /* 301 */ "signed ::= NK_PLUS NK_INTEGER", + /* 302 */ "signed ::= NK_MINUS NK_INTEGER", + /* 303 */ "signed ::= NK_FLOAT", + /* 304 */ "signed ::= NK_PLUS NK_FLOAT", + /* 305 */ "signed ::= NK_MINUS NK_FLOAT", + /* 306 */ "signed_literal ::= signed", + /* 307 */ "signed_literal ::= NK_STRING", + /* 308 */ "signed_literal ::= NK_BOOL", + /* 309 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 310 */ "signed_literal ::= duration_literal", + /* 311 */ "signed_literal ::= NULL", + /* 312 */ "signed_literal ::= literal_func", + /* 313 */ "signed_literal ::= NK_QUESTION", + /* 314 */ "literal_list ::= signed_literal", + /* 315 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 316 */ "db_name ::= NK_ID", + /* 317 */ "table_name ::= NK_ID", + /* 318 */ "column_name ::= NK_ID", + /* 319 */ "function_name ::= NK_ID", + /* 320 */ "table_alias ::= NK_ID", + /* 321 */ "column_alias ::= NK_ID", + /* 322 */ "user_name ::= NK_ID", + /* 323 */ "topic_name ::= NK_ID", + /* 324 */ "stream_name ::= NK_ID", + /* 325 */ "cgroup_name ::= NK_ID", + /* 326 */ "expression ::= literal", + /* 327 */ "expression ::= pseudo_column", + /* 328 */ "expression ::= column_reference", + /* 329 */ "expression ::= function_expression", + /* 330 */ "expression ::= subquery", + /* 331 */ "expression ::= NK_LP expression NK_RP", + /* 332 */ "expression ::= NK_PLUS expression", + /* 333 */ "expression ::= NK_MINUS expression", + /* 334 */ "expression ::= expression NK_PLUS expression", + /* 335 */ "expression ::= expression NK_MINUS expression", + /* 336 */ "expression ::= expression NK_STAR expression", + /* 337 */ "expression ::= expression NK_SLASH expression", + /* 338 */ "expression ::= expression NK_REM expression", + /* 339 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 340 */ "expression ::= expression NK_BITAND expression", + /* 341 */ "expression ::= expression NK_BITOR expression", + /* 342 */ "expression_list ::= expression", + /* 343 */ "expression_list ::= expression_list NK_COMMA expression", + /* 344 */ "column_reference ::= column_name", + /* 345 */ "column_reference ::= table_name NK_DOT column_name", + /* 346 */ "pseudo_column ::= ROWTS", + /* 347 */ "pseudo_column ::= TBNAME", + /* 348 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 349 */ "pseudo_column ::= QSTART", + /* 350 */ "pseudo_column ::= QEND", + /* 351 */ "pseudo_column ::= QDURATION", + /* 352 */ "pseudo_column ::= WSTART", + /* 353 */ "pseudo_column ::= WEND", + /* 354 */ "pseudo_column ::= WDURATION", + /* 355 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 356 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 357 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP", + /* 358 */ "function_expression ::= literal_func", + /* 359 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 360 */ "literal_func ::= NOW", + /* 361 */ "noarg_func ::= NOW", + /* 362 */ "noarg_func ::= TODAY", + /* 363 */ "noarg_func ::= TIMEZONE", + /* 364 */ "noarg_func ::= DATABASE", + /* 365 */ "noarg_func ::= CLIENT_VERSION", + /* 366 */ "noarg_func ::= SERVER_VERSION", + /* 367 */ "noarg_func ::= SERVER_STATUS", + /* 368 */ "noarg_func ::= CURRENT_USER", + /* 369 */ "noarg_func ::= USER", + /* 370 */ "star_func ::= COUNT", + /* 371 */ "star_func ::= FIRST", + /* 372 */ "star_func ::= LAST", + /* 373 */ "star_func ::= LAST_ROW", + /* 374 */ "star_func_para_list ::= NK_STAR", + /* 375 */ "star_func_para_list ::= other_para_list", + /* 376 */ "other_para_list ::= star_func_para", + /* 377 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 378 */ "star_func_para ::= expression", + /* 379 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 380 */ "predicate ::= expression compare_op expression", + /* 381 */ "predicate ::= expression BETWEEN expression AND expression", + /* 382 */ "predicate ::= expression NOT BETWEEN expression AND expression", + /* 383 */ "predicate ::= expression IS NULL", + /* 384 */ "predicate ::= expression IS NOT NULL", + /* 385 */ "predicate ::= expression in_op in_predicate_value", + /* 386 */ "compare_op ::= NK_LT", + /* 387 */ "compare_op ::= NK_GT", + /* 388 */ "compare_op ::= NK_LE", + /* 389 */ "compare_op ::= NK_GE", + /* 390 */ "compare_op ::= NK_NE", + /* 391 */ "compare_op ::= NK_EQ", + /* 392 */ "compare_op ::= LIKE", + /* 393 */ "compare_op ::= NOT LIKE", + /* 394 */ "compare_op ::= MATCH", + /* 395 */ "compare_op ::= NMATCH", + /* 396 */ "compare_op ::= CONTAINS", + /* 397 */ "in_op ::= IN", + /* 398 */ "in_op ::= NOT IN", + /* 399 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 400 */ "boolean_value_expression ::= boolean_primary", + /* 401 */ "boolean_value_expression ::= NOT boolean_primary", + /* 402 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 403 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 404 */ "boolean_primary ::= predicate", + /* 405 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 406 */ "common_expression ::= expression", + /* 407 */ "common_expression ::= boolean_value_expression", + /* 408 */ "from_clause_opt ::=", + /* 409 */ "from_clause_opt ::= FROM table_reference_list", + /* 410 */ "table_reference_list ::= table_reference", + /* 411 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 412 */ "table_reference ::= table_primary", + /* 413 */ "table_reference ::= joined_table", + /* 414 */ "table_primary ::= table_name alias_opt", + /* 415 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 416 */ "table_primary ::= subquery alias_opt", + /* 417 */ "table_primary ::= parenthesized_joined_table", + /* 418 */ "alias_opt ::=", + /* 419 */ "alias_opt ::= table_alias", + /* 420 */ "alias_opt ::= AS table_alias", + /* 421 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 422 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 423 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 424 */ "join_type ::=", + /* 425 */ "join_type ::= INNER", + /* 426 */ "query_specification ::= SELECT set_quantifier_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", + /* 427 */ "set_quantifier_opt ::=", + /* 428 */ "set_quantifier_opt ::= DISTINCT", + /* 429 */ "set_quantifier_opt ::= ALL", + /* 430 */ "select_list ::= select_item", + /* 431 */ "select_list ::= select_list NK_COMMA select_item", + /* 432 */ "select_item ::= NK_STAR", + /* 433 */ "select_item ::= common_expression", + /* 434 */ "select_item ::= common_expression column_alias", + /* 435 */ "select_item ::= common_expression AS column_alias", + /* 436 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 437 */ "where_clause_opt ::=", + /* 438 */ "where_clause_opt ::= WHERE search_condition", + /* 439 */ "partition_by_clause_opt ::=", + /* 440 */ "partition_by_clause_opt ::= PARTITION BY expression_list", + /* 441 */ "twindow_clause_opt ::=", + /* 442 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 443 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP", + /* 444 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 445 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 446 */ "sliding_opt ::=", + /* 447 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 448 */ "fill_opt ::=", + /* 449 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 450 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 451 */ "fill_mode ::= NONE", + /* 452 */ "fill_mode ::= PREV", + /* 453 */ "fill_mode ::= NULL", + /* 454 */ "fill_mode ::= LINEAR", + /* 455 */ "fill_mode ::= NEXT", + /* 456 */ "group_by_clause_opt ::=", + /* 457 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 458 */ "group_by_list ::= expression", + /* 459 */ "group_by_list ::= group_by_list NK_COMMA expression", + /* 460 */ "having_clause_opt ::=", + /* 461 */ "having_clause_opt ::= HAVING search_condition", + /* 462 */ "range_opt ::=", + /* 463 */ "range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP", + /* 464 */ "every_opt ::=", + /* 465 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 466 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 467 */ "query_expression_body ::= query_primary", + /* 468 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body", + /* 469 */ "query_expression_body ::= query_expression_body UNION query_expression_body", + /* 470 */ "query_primary ::= query_specification", + /* 471 */ "query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP", + /* 472 */ "order_by_clause_opt ::=", + /* 473 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 474 */ "slimit_clause_opt ::=", + /* 475 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 476 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 477 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 478 */ "limit_clause_opt ::=", + /* 479 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 480 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 481 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 482 */ "subquery ::= NK_LP query_expression NK_RP", + /* 483 */ "search_condition ::= common_expression", + /* 484 */ "sort_specification_list ::= sort_specification", + /* 485 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 486 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt", + /* 487 */ "ordering_specification_opt ::=", + /* 488 */ "ordering_specification_opt ::= ASC", + /* 489 */ "ordering_specification_opt ::= DESC", + /* 490 */ "null_ordering_opt ::=", + /* 491 */ "null_ordering_opt ::= NULLS FIRST", + /* 492 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2319,179 +2367,179 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 305: /* cmd */ - case 308: /* literal */ - case 319: /* db_options */ - case 321: /* alter_db_options */ - case 326: /* retention */ - case 327: /* full_table_name */ - case 330: /* table_options */ - case 334: /* alter_table_clause */ - case 335: /* alter_table_options */ - case 338: /* signed_literal */ - case 339: /* create_subtable_clause */ - case 342: /* drop_table_clause */ - case 345: /* column_def */ - case 349: /* duration_literal */ - case 350: /* rollup_func_name */ - case 352: /* col_name */ - case 353: /* db_name_cond_opt */ - case 354: /* like_pattern_opt */ - case 355: /* table_name_cond */ - case 356: /* from_db_opt */ - case 357: /* index_options */ - case 359: /* sliding_opt */ - case 360: /* sma_stream_opt */ - case 361: /* func */ - case 362: /* stream_options */ - case 364: /* query_expression */ - case 367: /* explain_options */ - case 372: /* where_clause_opt */ - case 373: /* signed */ - case 374: /* literal_func */ - case 378: /* expression */ - case 379: /* pseudo_column */ - case 380: /* column_reference */ - case 381: /* function_expression */ - case 382: /* subquery */ - case 387: /* star_func_para */ - case 388: /* predicate */ - case 391: /* in_predicate_value */ - case 392: /* boolean_value_expression */ - case 393: /* boolean_primary */ - case 394: /* common_expression */ - case 395: /* from_clause_opt */ - case 396: /* table_reference_list */ - case 397: /* table_reference */ - case 398: /* table_primary */ - case 399: /* joined_table */ - case 401: /* parenthesized_joined_table */ - case 403: /* search_condition */ - case 404: /* query_specification */ - case 408: /* range_opt */ - case 409: /* every_opt */ - case 410: /* fill_opt */ - case 411: /* twindow_clause_opt */ - case 413: /* having_clause_opt */ - case 414: /* select_item */ - case 417: /* query_expression_body */ - case 419: /* slimit_clause_opt */ - case 420: /* limit_clause_opt */ - case 421: /* query_primary */ - case 423: /* sort_specification */ + case 306: /* cmd */ + case 309: /* literal */ + case 320: /* db_options */ + case 322: /* alter_db_options */ + case 327: /* retention */ + case 328: /* full_table_name */ + case 331: /* table_options */ + case 335: /* alter_table_clause */ + case 336: /* alter_table_options */ + case 339: /* signed_literal */ + case 340: /* create_subtable_clause */ + case 343: /* drop_table_clause */ + case 346: /* column_def */ + case 350: /* duration_literal */ + case 351: /* rollup_func_name */ + case 353: /* col_name */ + case 354: /* db_name_cond_opt */ + case 355: /* like_pattern_opt */ + case 356: /* table_name_cond */ + case 357: /* from_db_opt */ + case 358: /* index_options */ + case 360: /* sliding_opt */ + case 361: /* sma_stream_opt */ + case 362: /* func */ + case 363: /* stream_options */ + case 365: /* query_expression */ + case 368: /* explain_options */ + case 373: /* where_clause_opt */ + case 374: /* signed */ + case 375: /* literal_func */ + case 379: /* expression */ + case 380: /* pseudo_column */ + case 381: /* column_reference */ + case 382: /* function_expression */ + case 383: /* subquery */ + case 388: /* star_func_para */ + case 389: /* predicate */ + case 392: /* in_predicate_value */ + case 393: /* boolean_value_expression */ + case 394: /* boolean_primary */ + case 395: /* common_expression */ + case 396: /* from_clause_opt */ + case 397: /* table_reference_list */ + case 398: /* table_reference */ + case 399: /* table_primary */ + case 400: /* joined_table */ + case 402: /* parenthesized_joined_table */ + case 404: /* search_condition */ + case 405: /* query_specification */ + case 409: /* range_opt */ + case 410: /* every_opt */ + case 411: /* fill_opt */ + case 412: /* twindow_clause_opt */ + case 414: /* having_clause_opt */ + case 415: /* select_item */ + case 418: /* query_expression_body */ + case 420: /* slimit_clause_opt */ + case 421: /* limit_clause_opt */ + case 422: /* query_primary */ + case 424: /* sort_specification */ { - nodesDestroyNode((yypminor->yy272)); + nodesDestroyNode((yypminor->yy840)); } break; - case 306: /* account_options */ - case 307: /* alter_account_options */ - case 309: /* alter_account_option */ - case 369: /* bufsize_opt */ + case 307: /* account_options */ + case 308: /* alter_account_options */ + case 310: /* alter_account_option */ + case 370: /* bufsize_opt */ { } break; - case 310: /* user_name */ - case 313: /* priv_level */ - case 316: /* db_name */ - case 317: /* dnode_endpoint */ - case 336: /* column_name */ - case 344: /* table_name */ - case 351: /* function_name */ - case 363: /* topic_name */ - case 365: /* cgroup_name */ - case 370: /* stream_name */ - case 376: /* table_alias */ - case 377: /* column_alias */ - case 383: /* star_func */ - case 385: /* noarg_func */ - case 400: /* alias_opt */ + case 311: /* user_name */ + case 314: /* priv_level */ + case 317: /* db_name */ + case 318: /* dnode_endpoint */ + case 337: /* column_name */ + case 345: /* table_name */ + case 352: /* function_name */ + case 364: /* topic_name */ + case 366: /* cgroup_name */ + case 371: /* stream_name */ + case 377: /* table_alias */ + case 378: /* column_alias */ + case 384: /* star_func */ + case 386: /* noarg_func */ + case 401: /* alias_opt */ { } break; - case 311: /* sysinfo_opt */ + case 312: /* sysinfo_opt */ { } break; - case 312: /* privileges */ - case 314: /* priv_type_list */ - case 315: /* priv_type */ + case 313: /* privileges */ + case 315: /* priv_type_list */ + case 316: /* priv_type */ { } break; - case 318: /* not_exists_opt */ - case 320: /* exists_opt */ - case 366: /* analyze_opt */ - case 368: /* agg_func_opt */ - case 405: /* set_quantifier_opt */ + case 319: /* not_exists_opt */ + case 321: /* exists_opt */ + case 367: /* analyze_opt */ + case 369: /* agg_func_opt */ + case 406: /* set_quantifier_opt */ { } break; - case 322: /* integer_list */ - case 323: /* variable_list */ - case 324: /* retention_list */ - case 328: /* column_def_list */ - case 329: /* tags_def_opt */ - case 331: /* multi_create_clause */ - case 332: /* tags_def */ - case 333: /* multi_drop_clause */ - case 340: /* specific_cols_opt */ - case 341: /* expression_list */ - case 343: /* col_name_list */ - case 346: /* duration_list */ - case 347: /* rollup_func_list */ - case 358: /* func_list */ - case 371: /* dnode_list */ - case 375: /* literal_list */ - case 384: /* star_func_para_list */ - case 386: /* other_para_list */ - case 406: /* select_list */ - case 407: /* partition_by_clause_opt */ - case 412: /* group_by_clause_opt */ - case 416: /* group_by_list */ - case 418: /* order_by_clause_opt */ - case 422: /* sort_specification_list */ + case 323: /* integer_list */ + case 324: /* variable_list */ + case 325: /* retention_list */ + case 329: /* column_def_list */ + case 330: /* tags_def_opt */ + case 332: /* multi_create_clause */ + case 333: /* tags_def */ + case 334: /* multi_drop_clause */ + case 341: /* specific_cols_opt */ + case 342: /* expression_list */ + case 344: /* col_name_list */ + case 347: /* duration_list */ + case 348: /* rollup_func_list */ + case 359: /* func_list */ + case 372: /* dnode_list */ + case 376: /* literal_list */ + case 385: /* star_func_para_list */ + case 387: /* other_para_list */ + case 407: /* select_list */ + case 408: /* partition_by_clause_opt */ + case 413: /* group_by_clause_opt */ + case 417: /* group_by_list */ + case 419: /* order_by_clause_opt */ + case 423: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy172)); + nodesDestroyList((yypminor->yy544)); } break; - case 325: /* alter_db_option */ - case 348: /* alter_table_option */ + case 326: /* alter_db_option */ + case 349: /* alter_table_option */ { } break; - case 337: /* type_name */ + case 338: /* type_name */ { } break; - case 389: /* compare_op */ - case 390: /* in_op */ + case 390: /* compare_op */ + case 391: /* in_op */ { } break; - case 402: /* join_type */ + case 403: /* join_type */ { } break; - case 415: /* fill_mode */ + case 416: /* fill_mode */ { } break; - case 424: /* ordering_specification_opt */ + case 425: /* ordering_specification_opt */ { } break; - case 425: /* null_ordering_opt */ + case 426: /* null_ordering_opt */ { } @@ -2790,495 +2838,499 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 305, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 305, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 306, 0 }, /* (2) account_options ::= */ - { 306, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 306, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 306, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 306, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 306, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 306, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 306, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 306, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 306, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 307, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 307, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 309, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 309, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 309, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 309, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 309, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 309, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 309, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 309, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 309, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 309, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 305, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 305, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 305, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 305, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 305, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 311, 0 }, /* (29) sysinfo_opt ::= */ - { 311, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 305, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 305, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 312, -1 }, /* (33) privileges ::= ALL */ - { 312, -1 }, /* (34) privileges ::= priv_type_list */ - { 314, -1 }, /* (35) priv_type_list ::= priv_type */ - { 314, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 315, -1 }, /* (37) priv_type ::= READ */ - { 315, -1 }, /* (38) priv_type ::= WRITE */ - { 313, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 313, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ - { 305, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ - { 305, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 305, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ - { 305, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ - { 305, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 305, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 305, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ - { 305, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 317, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ - { 317, -1 }, /* (50) dnode_endpoint ::= NK_ID */ - { 317, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ - { 305, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ - { 305, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 305, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 305, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 305, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ - { 305, -2 }, /* (64) cmd ::= USE db_name */ - { 305, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 305, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */ - { 305, -3 }, /* (67) cmd ::= TRIM DATABASE db_name */ - { 318, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */ - { 318, 0 }, /* (69) not_exists_opt ::= */ - { 320, -2 }, /* (70) exists_opt ::= IF EXISTS */ - { 320, 0 }, /* (71) exists_opt ::= */ - { 319, 0 }, /* (72) db_options ::= */ - { 319, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */ - { 319, -3 }, /* (74) db_options ::= db_options CACHEMODEL NK_STRING */ - { 319, -3 }, /* (75) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 319, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */ - { 319, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */ - { 319, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */ - { 319, -3 }, /* (79) db_options ::= db_options MAXROWS NK_INTEGER */ - { 319, -3 }, /* (80) db_options ::= db_options MINROWS NK_INTEGER */ - { 319, -3 }, /* (81) db_options ::= db_options KEEP integer_list */ - { 319, -3 }, /* (82) db_options ::= db_options KEEP variable_list */ - { 319, -3 }, /* (83) db_options ::= db_options PAGES NK_INTEGER */ - { 319, -3 }, /* (84) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 319, -3 }, /* (85) db_options ::= db_options PRECISION NK_STRING */ - { 319, -3 }, /* (86) db_options ::= db_options REPLICA NK_INTEGER */ - { 319, -3 }, /* (87) db_options ::= db_options STRICT NK_STRING */ - { 319, -3 }, /* (88) db_options ::= db_options VGROUPS NK_INTEGER */ - { 319, -3 }, /* (89) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 319, -3 }, /* (90) db_options ::= db_options RETENTIONS retention_list */ - { 319, -3 }, /* (91) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 319, -3 }, /* (92) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 319, -3 }, /* (93) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 319, -3 }, /* (94) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 319, -4 }, /* (95) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 319, -3 }, /* (96) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 319, -4 }, /* (97) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 319, -3 }, /* (98) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 319, -3 }, /* (99) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 321, -1 }, /* (100) alter_db_options ::= alter_db_option */ - { 321, -2 }, /* (101) alter_db_options ::= alter_db_options alter_db_option */ - { 325, -2 }, /* (102) alter_db_option ::= CACHEMODEL NK_STRING */ - { 325, -2 }, /* (103) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 325, -2 }, /* (104) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 325, -2 }, /* (105) alter_db_option ::= KEEP integer_list */ - { 325, -2 }, /* (106) alter_db_option ::= KEEP variable_list */ - { 325, -2 }, /* (107) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 322, -1 }, /* (108) integer_list ::= NK_INTEGER */ - { 322, -3 }, /* (109) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 323, -1 }, /* (110) variable_list ::= NK_VARIABLE */ - { 323, -3 }, /* (111) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 324, -1 }, /* (112) retention_list ::= retention */ - { 324, -3 }, /* (113) retention_list ::= retention_list NK_COMMA retention */ - { 326, -3 }, /* (114) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 305, -9 }, /* (115) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 305, -3 }, /* (116) cmd ::= CREATE TABLE multi_create_clause */ - { 305, -9 }, /* (117) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 305, -3 }, /* (118) cmd ::= DROP TABLE multi_drop_clause */ - { 305, -4 }, /* (119) cmd ::= DROP STABLE exists_opt full_table_name */ - { 305, -3 }, /* (120) cmd ::= ALTER TABLE alter_table_clause */ - { 305, -3 }, /* (121) cmd ::= ALTER STABLE alter_table_clause */ - { 334, -2 }, /* (122) alter_table_clause ::= full_table_name alter_table_options */ - { 334, -5 }, /* (123) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 334, -4 }, /* (124) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 334, -5 }, /* (125) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 334, -5 }, /* (126) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 334, -5 }, /* (127) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 334, -4 }, /* (128) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 334, -5 }, /* (129) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 334, -5 }, /* (130) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 334, -6 }, /* (131) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 331, -1 }, /* (132) multi_create_clause ::= create_subtable_clause */ - { 331, -2 }, /* (133) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 339, -10 }, /* (134) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 333, -1 }, /* (135) multi_drop_clause ::= drop_table_clause */ - { 333, -2 }, /* (136) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 342, -2 }, /* (137) drop_table_clause ::= exists_opt full_table_name */ - { 340, 0 }, /* (138) specific_cols_opt ::= */ - { 340, -3 }, /* (139) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 327, -1 }, /* (140) full_table_name ::= table_name */ - { 327, -3 }, /* (141) full_table_name ::= db_name NK_DOT table_name */ - { 328, -1 }, /* (142) column_def_list ::= column_def */ - { 328, -3 }, /* (143) column_def_list ::= column_def_list NK_COMMA column_def */ - { 345, -2 }, /* (144) column_def ::= column_name type_name */ - { 345, -4 }, /* (145) column_def ::= column_name type_name COMMENT NK_STRING */ - { 337, -1 }, /* (146) type_name ::= BOOL */ - { 337, -1 }, /* (147) type_name ::= TINYINT */ - { 337, -1 }, /* (148) type_name ::= SMALLINT */ - { 337, -1 }, /* (149) type_name ::= INT */ - { 337, -1 }, /* (150) type_name ::= INTEGER */ - { 337, -1 }, /* (151) type_name ::= BIGINT */ - { 337, -1 }, /* (152) type_name ::= FLOAT */ - { 337, -1 }, /* (153) type_name ::= DOUBLE */ - { 337, -4 }, /* (154) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 337, -1 }, /* (155) type_name ::= TIMESTAMP */ - { 337, -4 }, /* (156) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 337, -2 }, /* (157) type_name ::= TINYINT UNSIGNED */ - { 337, -2 }, /* (158) type_name ::= SMALLINT UNSIGNED */ - { 337, -2 }, /* (159) type_name ::= INT UNSIGNED */ - { 337, -2 }, /* (160) type_name ::= BIGINT UNSIGNED */ - { 337, -1 }, /* (161) type_name ::= JSON */ - { 337, -4 }, /* (162) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 337, -1 }, /* (163) type_name ::= MEDIUMBLOB */ - { 337, -1 }, /* (164) type_name ::= BLOB */ - { 337, -4 }, /* (165) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 337, -1 }, /* (166) type_name ::= DECIMAL */ - { 337, -4 }, /* (167) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 337, -6 }, /* (168) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 329, 0 }, /* (169) tags_def_opt ::= */ - { 329, -1 }, /* (170) tags_def_opt ::= tags_def */ - { 332, -4 }, /* (171) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 330, 0 }, /* (172) table_options ::= */ - { 330, -3 }, /* (173) table_options ::= table_options COMMENT NK_STRING */ - { 330, -3 }, /* (174) table_options ::= table_options MAX_DELAY duration_list */ - { 330, -3 }, /* (175) table_options ::= table_options WATERMARK duration_list */ - { 330, -5 }, /* (176) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 330, -3 }, /* (177) table_options ::= table_options TTL NK_INTEGER */ - { 330, -5 }, /* (178) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 335, -1 }, /* (179) alter_table_options ::= alter_table_option */ - { 335, -2 }, /* (180) alter_table_options ::= alter_table_options alter_table_option */ - { 348, -2 }, /* (181) alter_table_option ::= COMMENT NK_STRING */ - { 348, -2 }, /* (182) alter_table_option ::= TTL NK_INTEGER */ - { 346, -1 }, /* (183) duration_list ::= duration_literal */ - { 346, -3 }, /* (184) duration_list ::= duration_list NK_COMMA duration_literal */ - { 347, -1 }, /* (185) rollup_func_list ::= rollup_func_name */ - { 347, -3 }, /* (186) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 350, -1 }, /* (187) rollup_func_name ::= function_name */ - { 350, -1 }, /* (188) rollup_func_name ::= FIRST */ - { 350, -1 }, /* (189) rollup_func_name ::= LAST */ - { 343, -1 }, /* (190) col_name_list ::= col_name */ - { 343, -3 }, /* (191) col_name_list ::= col_name_list NK_COMMA col_name */ - { 352, -1 }, /* (192) col_name ::= column_name */ - { 305, -2 }, /* (193) cmd ::= SHOW DNODES */ - { 305, -2 }, /* (194) cmd ::= SHOW USERS */ - { 305, -2 }, /* (195) cmd ::= SHOW DATABASES */ - { 305, -4 }, /* (196) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 305, -4 }, /* (197) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 305, -3 }, /* (198) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 305, -2 }, /* (199) cmd ::= SHOW MNODES */ - { 305, -2 }, /* (200) cmd ::= SHOW MODULES */ - { 305, -2 }, /* (201) cmd ::= SHOW QNODES */ - { 305, -2 }, /* (202) cmd ::= SHOW FUNCTIONS */ - { 305, -5 }, /* (203) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 305, -2 }, /* (204) cmd ::= SHOW STREAMS */ - { 305, -2 }, /* (205) cmd ::= SHOW ACCOUNTS */ - { 305, -2 }, /* (206) cmd ::= SHOW APPS */ - { 305, -2 }, /* (207) cmd ::= SHOW CONNECTIONS */ - { 305, -2 }, /* (208) cmd ::= SHOW LICENCES */ - { 305, -2 }, /* (209) cmd ::= SHOW GRANTS */ - { 305, -4 }, /* (210) cmd ::= SHOW CREATE DATABASE db_name */ - { 305, -4 }, /* (211) cmd ::= SHOW CREATE TABLE full_table_name */ - { 305, -4 }, /* (212) cmd ::= SHOW CREATE STABLE full_table_name */ - { 305, -2 }, /* (213) cmd ::= SHOW QUERIES */ - { 305, -2 }, /* (214) cmd ::= SHOW SCORES */ - { 305, -2 }, /* (215) cmd ::= SHOW TOPICS */ - { 305, -2 }, /* (216) cmd ::= SHOW VARIABLES */ - { 305, -3 }, /* (217) cmd ::= SHOW LOCAL VARIABLES */ - { 305, -4 }, /* (218) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ - { 305, -2 }, /* (219) cmd ::= SHOW BNODES */ - { 305, -2 }, /* (220) cmd ::= SHOW SNODES */ - { 305, -2 }, /* (221) cmd ::= SHOW CLUSTER */ - { 305, -2 }, /* (222) cmd ::= SHOW TRANSACTIONS */ - { 305, -4 }, /* (223) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 305, -2 }, /* (224) cmd ::= SHOW CONSUMERS */ - { 305, -2 }, /* (225) cmd ::= SHOW SUBSCRIPTIONS */ - { 305, -5 }, /* (226) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 353, 0 }, /* (227) db_name_cond_opt ::= */ - { 353, -2 }, /* (228) db_name_cond_opt ::= db_name NK_DOT */ - { 354, 0 }, /* (229) like_pattern_opt ::= */ - { 354, -2 }, /* (230) like_pattern_opt ::= LIKE NK_STRING */ - { 355, -1 }, /* (231) table_name_cond ::= table_name */ - { 356, 0 }, /* (232) from_db_opt ::= */ - { 356, -2 }, /* (233) from_db_opt ::= FROM db_name */ - { 305, -8 }, /* (234) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 305, -4 }, /* (235) cmd ::= DROP INDEX exists_opt full_table_name */ - { 357, -10 }, /* (236) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 357, -12 }, /* (237) 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 */ - { 358, -1 }, /* (238) func_list ::= func */ - { 358, -3 }, /* (239) func_list ::= func_list NK_COMMA func */ - { 361, -4 }, /* (240) func ::= function_name NK_LP expression_list NK_RP */ - { 360, 0 }, /* (241) sma_stream_opt ::= */ - { 360, -3 }, /* (242) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 360, -3 }, /* (243) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 305, -6 }, /* (244) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ - { 305, -7 }, /* (245) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 305, -9 }, /* (246) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 305, -7 }, /* (247) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 305, -9 }, /* (248) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 305, -4 }, /* (249) cmd ::= DROP TOPIC exists_opt topic_name */ - { 305, -7 }, /* (250) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 305, -2 }, /* (251) cmd ::= DESC full_table_name */ - { 305, -2 }, /* (252) cmd ::= DESCRIBE full_table_name */ - { 305, -3 }, /* (253) cmd ::= RESET QUERY CACHE */ - { 305, -4 }, /* (254) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ - { 366, 0 }, /* (255) analyze_opt ::= */ - { 366, -1 }, /* (256) analyze_opt ::= ANALYZE */ - { 367, 0 }, /* (257) explain_options ::= */ - { 367, -3 }, /* (258) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 367, -3 }, /* (259) explain_options ::= explain_options RATIO NK_FLOAT */ - { 305, -10 }, /* (260) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 305, -4 }, /* (261) cmd ::= DROP FUNCTION exists_opt function_name */ - { 368, 0 }, /* (262) agg_func_opt ::= */ - { 368, -1 }, /* (263) agg_func_opt ::= AGGREGATE */ - { 369, 0 }, /* (264) bufsize_opt ::= */ - { 369, -2 }, /* (265) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 305, -9 }, /* (266) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression */ - { 305, -4 }, /* (267) cmd ::= DROP STREAM exists_opt stream_name */ - { 362, 0 }, /* (268) stream_options ::= */ - { 362, -3 }, /* (269) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 362, -3 }, /* (270) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 362, -4 }, /* (271) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 362, -3 }, /* (272) stream_options ::= stream_options WATERMARK duration_literal */ - { 362, -4 }, /* (273) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 305, -3 }, /* (274) cmd ::= KILL CONNECTION NK_INTEGER */ - { 305, -3 }, /* (275) cmd ::= KILL QUERY NK_STRING */ - { 305, -3 }, /* (276) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 305, -2 }, /* (277) cmd ::= BALANCE VGROUP */ - { 305, -4 }, /* (278) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 305, -4 }, /* (279) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 305, -3 }, /* (280) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 371, -2 }, /* (281) dnode_list ::= DNODE NK_INTEGER */ - { 371, -3 }, /* (282) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 305, -4 }, /* (283) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 305, -1 }, /* (284) cmd ::= query_expression */ - { 305, -7 }, /* (285) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ - { 305, -4 }, /* (286) cmd ::= INSERT INTO full_table_name query_expression */ - { 308, -1 }, /* (287) literal ::= NK_INTEGER */ - { 308, -1 }, /* (288) literal ::= NK_FLOAT */ - { 308, -1 }, /* (289) literal ::= NK_STRING */ - { 308, -1 }, /* (290) literal ::= NK_BOOL */ - { 308, -2 }, /* (291) literal ::= TIMESTAMP NK_STRING */ - { 308, -1 }, /* (292) literal ::= duration_literal */ - { 308, -1 }, /* (293) literal ::= NULL */ - { 308, -1 }, /* (294) literal ::= NK_QUESTION */ - { 349, -1 }, /* (295) duration_literal ::= NK_VARIABLE */ - { 373, -1 }, /* (296) signed ::= NK_INTEGER */ - { 373, -2 }, /* (297) signed ::= NK_PLUS NK_INTEGER */ - { 373, -2 }, /* (298) signed ::= NK_MINUS NK_INTEGER */ - { 373, -1 }, /* (299) signed ::= NK_FLOAT */ - { 373, -2 }, /* (300) signed ::= NK_PLUS NK_FLOAT */ - { 373, -2 }, /* (301) signed ::= NK_MINUS NK_FLOAT */ - { 338, -1 }, /* (302) signed_literal ::= signed */ - { 338, -1 }, /* (303) signed_literal ::= NK_STRING */ - { 338, -1 }, /* (304) signed_literal ::= NK_BOOL */ - { 338, -2 }, /* (305) signed_literal ::= TIMESTAMP NK_STRING */ - { 338, -1 }, /* (306) signed_literal ::= duration_literal */ - { 338, -1 }, /* (307) signed_literal ::= NULL */ - { 338, -1 }, /* (308) signed_literal ::= literal_func */ - { 338, -1 }, /* (309) signed_literal ::= NK_QUESTION */ - { 375, -1 }, /* (310) literal_list ::= signed_literal */ - { 375, -3 }, /* (311) literal_list ::= literal_list NK_COMMA signed_literal */ - { 316, -1 }, /* (312) db_name ::= NK_ID */ - { 344, -1 }, /* (313) table_name ::= NK_ID */ - { 336, -1 }, /* (314) column_name ::= NK_ID */ - { 351, -1 }, /* (315) function_name ::= NK_ID */ - { 376, -1 }, /* (316) table_alias ::= NK_ID */ - { 377, -1 }, /* (317) column_alias ::= NK_ID */ - { 310, -1 }, /* (318) user_name ::= NK_ID */ - { 363, -1 }, /* (319) topic_name ::= NK_ID */ - { 370, -1 }, /* (320) stream_name ::= NK_ID */ - { 365, -1 }, /* (321) cgroup_name ::= NK_ID */ - { 378, -1 }, /* (322) expression ::= literal */ - { 378, -1 }, /* (323) expression ::= pseudo_column */ - { 378, -1 }, /* (324) expression ::= column_reference */ - { 378, -1 }, /* (325) expression ::= function_expression */ - { 378, -1 }, /* (326) expression ::= subquery */ - { 378, -3 }, /* (327) expression ::= NK_LP expression NK_RP */ - { 378, -2 }, /* (328) expression ::= NK_PLUS expression */ - { 378, -2 }, /* (329) expression ::= NK_MINUS expression */ - { 378, -3 }, /* (330) expression ::= expression NK_PLUS expression */ - { 378, -3 }, /* (331) expression ::= expression NK_MINUS expression */ - { 378, -3 }, /* (332) expression ::= expression NK_STAR expression */ - { 378, -3 }, /* (333) expression ::= expression NK_SLASH expression */ - { 378, -3 }, /* (334) expression ::= expression NK_REM expression */ - { 378, -3 }, /* (335) expression ::= column_reference NK_ARROW NK_STRING */ - { 378, -3 }, /* (336) expression ::= expression NK_BITAND expression */ - { 378, -3 }, /* (337) expression ::= expression NK_BITOR expression */ - { 341, -1 }, /* (338) expression_list ::= expression */ - { 341, -3 }, /* (339) expression_list ::= expression_list NK_COMMA expression */ - { 380, -1 }, /* (340) column_reference ::= column_name */ - { 380, -3 }, /* (341) column_reference ::= table_name NK_DOT column_name */ - { 379, -1 }, /* (342) pseudo_column ::= ROWTS */ - { 379, -1 }, /* (343) pseudo_column ::= TBNAME */ - { 379, -3 }, /* (344) pseudo_column ::= table_name NK_DOT TBNAME */ - { 379, -1 }, /* (345) pseudo_column ::= QSTART */ - { 379, -1 }, /* (346) pseudo_column ::= QEND */ - { 379, -1 }, /* (347) pseudo_column ::= QDURATION */ - { 379, -1 }, /* (348) pseudo_column ::= WSTART */ - { 379, -1 }, /* (349) pseudo_column ::= WEND */ - { 379, -1 }, /* (350) pseudo_column ::= WDURATION */ - { 381, -4 }, /* (351) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 381, -4 }, /* (352) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 381, -6 }, /* (353) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ - { 381, -1 }, /* (354) function_expression ::= literal_func */ - { 374, -3 }, /* (355) literal_func ::= noarg_func NK_LP NK_RP */ - { 374, -1 }, /* (356) literal_func ::= NOW */ - { 385, -1 }, /* (357) noarg_func ::= NOW */ - { 385, -1 }, /* (358) noarg_func ::= TODAY */ - { 385, -1 }, /* (359) noarg_func ::= TIMEZONE */ - { 385, -1 }, /* (360) noarg_func ::= DATABASE */ - { 385, -1 }, /* (361) noarg_func ::= CLIENT_VERSION */ - { 385, -1 }, /* (362) noarg_func ::= SERVER_VERSION */ - { 385, -1 }, /* (363) noarg_func ::= SERVER_STATUS */ - { 385, -1 }, /* (364) noarg_func ::= CURRENT_USER */ - { 385, -1 }, /* (365) noarg_func ::= USER */ - { 383, -1 }, /* (366) star_func ::= COUNT */ - { 383, -1 }, /* (367) star_func ::= FIRST */ - { 383, -1 }, /* (368) star_func ::= LAST */ - { 383, -1 }, /* (369) star_func ::= LAST_ROW */ - { 384, -1 }, /* (370) star_func_para_list ::= NK_STAR */ - { 384, -1 }, /* (371) star_func_para_list ::= other_para_list */ - { 386, -1 }, /* (372) other_para_list ::= star_func_para */ - { 386, -3 }, /* (373) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 387, -1 }, /* (374) star_func_para ::= expression */ - { 387, -3 }, /* (375) star_func_para ::= table_name NK_DOT NK_STAR */ - { 388, -3 }, /* (376) predicate ::= expression compare_op expression */ - { 388, -5 }, /* (377) predicate ::= expression BETWEEN expression AND expression */ - { 388, -6 }, /* (378) predicate ::= expression NOT BETWEEN expression AND expression */ - { 388, -3 }, /* (379) predicate ::= expression IS NULL */ - { 388, -4 }, /* (380) predicate ::= expression IS NOT NULL */ - { 388, -3 }, /* (381) predicate ::= expression in_op in_predicate_value */ - { 389, -1 }, /* (382) compare_op ::= NK_LT */ - { 389, -1 }, /* (383) compare_op ::= NK_GT */ - { 389, -1 }, /* (384) compare_op ::= NK_LE */ - { 389, -1 }, /* (385) compare_op ::= NK_GE */ - { 389, -1 }, /* (386) compare_op ::= NK_NE */ - { 389, -1 }, /* (387) compare_op ::= NK_EQ */ - { 389, -1 }, /* (388) compare_op ::= LIKE */ - { 389, -2 }, /* (389) compare_op ::= NOT LIKE */ - { 389, -1 }, /* (390) compare_op ::= MATCH */ - { 389, -1 }, /* (391) compare_op ::= NMATCH */ - { 389, -1 }, /* (392) compare_op ::= CONTAINS */ - { 390, -1 }, /* (393) in_op ::= IN */ - { 390, -2 }, /* (394) in_op ::= NOT IN */ - { 391, -3 }, /* (395) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 392, -1 }, /* (396) boolean_value_expression ::= boolean_primary */ - { 392, -2 }, /* (397) boolean_value_expression ::= NOT boolean_primary */ - { 392, -3 }, /* (398) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 392, -3 }, /* (399) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 393, -1 }, /* (400) boolean_primary ::= predicate */ - { 393, -3 }, /* (401) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 394, -1 }, /* (402) common_expression ::= expression */ - { 394, -1 }, /* (403) common_expression ::= boolean_value_expression */ - { 395, 0 }, /* (404) from_clause_opt ::= */ - { 395, -2 }, /* (405) from_clause_opt ::= FROM table_reference_list */ - { 396, -1 }, /* (406) table_reference_list ::= table_reference */ - { 396, -3 }, /* (407) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 397, -1 }, /* (408) table_reference ::= table_primary */ - { 397, -1 }, /* (409) table_reference ::= joined_table */ - { 398, -2 }, /* (410) table_primary ::= table_name alias_opt */ - { 398, -4 }, /* (411) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 398, -2 }, /* (412) table_primary ::= subquery alias_opt */ - { 398, -1 }, /* (413) table_primary ::= parenthesized_joined_table */ - { 400, 0 }, /* (414) alias_opt ::= */ - { 400, -1 }, /* (415) alias_opt ::= table_alias */ - { 400, -2 }, /* (416) alias_opt ::= AS table_alias */ - { 401, -3 }, /* (417) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 401, -3 }, /* (418) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 399, -6 }, /* (419) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 402, 0 }, /* (420) join_type ::= */ - { 402, -1 }, /* (421) join_type ::= INNER */ - { 404, -12 }, /* (422) query_specification ::= SELECT set_quantifier_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 */ - { 405, 0 }, /* (423) set_quantifier_opt ::= */ - { 405, -1 }, /* (424) set_quantifier_opt ::= DISTINCT */ - { 405, -1 }, /* (425) set_quantifier_opt ::= ALL */ - { 406, -1 }, /* (426) select_list ::= select_item */ - { 406, -3 }, /* (427) select_list ::= select_list NK_COMMA select_item */ - { 414, -1 }, /* (428) select_item ::= NK_STAR */ - { 414, -1 }, /* (429) select_item ::= common_expression */ - { 414, -2 }, /* (430) select_item ::= common_expression column_alias */ - { 414, -3 }, /* (431) select_item ::= common_expression AS column_alias */ - { 414, -3 }, /* (432) select_item ::= table_name NK_DOT NK_STAR */ - { 372, 0 }, /* (433) where_clause_opt ::= */ - { 372, -2 }, /* (434) where_clause_opt ::= WHERE search_condition */ - { 407, 0 }, /* (435) partition_by_clause_opt ::= */ - { 407, -3 }, /* (436) partition_by_clause_opt ::= PARTITION BY expression_list */ - { 411, 0 }, /* (437) twindow_clause_opt ::= */ - { 411, -6 }, /* (438) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 411, -4 }, /* (439) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ - { 411, -6 }, /* (440) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 411, -8 }, /* (441) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 359, 0 }, /* (442) sliding_opt ::= */ - { 359, -4 }, /* (443) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 410, 0 }, /* (444) fill_opt ::= */ - { 410, -4 }, /* (445) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 410, -6 }, /* (446) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 415, -1 }, /* (447) fill_mode ::= NONE */ - { 415, -1 }, /* (448) fill_mode ::= PREV */ - { 415, -1 }, /* (449) fill_mode ::= NULL */ - { 415, -1 }, /* (450) fill_mode ::= LINEAR */ - { 415, -1 }, /* (451) fill_mode ::= NEXT */ - { 412, 0 }, /* (452) group_by_clause_opt ::= */ - { 412, -3 }, /* (453) group_by_clause_opt ::= GROUP BY group_by_list */ - { 416, -1 }, /* (454) group_by_list ::= expression */ - { 416, -3 }, /* (455) group_by_list ::= group_by_list NK_COMMA expression */ - { 413, 0 }, /* (456) having_clause_opt ::= */ - { 413, -2 }, /* (457) having_clause_opt ::= HAVING search_condition */ - { 408, 0 }, /* (458) range_opt ::= */ - { 408, -6 }, /* (459) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ - { 409, 0 }, /* (460) every_opt ::= */ - { 409, -4 }, /* (461) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 364, -4 }, /* (462) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 417, -1 }, /* (463) query_expression_body ::= query_primary */ - { 417, -4 }, /* (464) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ - { 417, -3 }, /* (465) query_expression_body ::= query_expression_body UNION query_expression_body */ - { 421, -1 }, /* (466) query_primary ::= query_specification */ - { 421, -6 }, /* (467) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ - { 418, 0 }, /* (468) order_by_clause_opt ::= */ - { 418, -3 }, /* (469) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 419, 0 }, /* (470) slimit_clause_opt ::= */ - { 419, -2 }, /* (471) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 419, -4 }, /* (472) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 419, -4 }, /* (473) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 420, 0 }, /* (474) limit_clause_opt ::= */ - { 420, -2 }, /* (475) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 420, -4 }, /* (476) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 420, -4 }, /* (477) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 382, -3 }, /* (478) subquery ::= NK_LP query_expression NK_RP */ - { 403, -1 }, /* (479) search_condition ::= common_expression */ - { 422, -1 }, /* (480) sort_specification_list ::= sort_specification */ - { 422, -3 }, /* (481) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 423, -3 }, /* (482) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ - { 424, 0 }, /* (483) ordering_specification_opt ::= */ - { 424, -1 }, /* (484) ordering_specification_opt ::= ASC */ - { 424, -1 }, /* (485) ordering_specification_opt ::= DESC */ - { 425, 0 }, /* (486) null_ordering_opt ::= */ - { 425, -2 }, /* (487) null_ordering_opt ::= NULLS FIRST */ - { 425, -2 }, /* (488) null_ordering_opt ::= NULLS LAST */ + { 306, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 306, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 307, 0 }, /* (2) account_options ::= */ + { 307, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 307, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 307, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 307, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 307, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 307, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 307, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 307, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 307, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 308, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 308, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 310, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 310, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 310, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 310, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 310, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 310, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 310, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 310, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 310, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 310, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 306, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 306, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 306, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 306, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 306, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 312, 0 }, /* (29) sysinfo_opt ::= */ + { 312, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 306, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 306, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 313, -1 }, /* (33) privileges ::= ALL */ + { 313, -1 }, /* (34) privileges ::= priv_type_list */ + { 315, -1 }, /* (35) priv_type_list ::= priv_type */ + { 315, -3 }, /* (36) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 316, -1 }, /* (37) priv_type ::= READ */ + { 316, -1 }, /* (38) priv_type ::= WRITE */ + { 314, -3 }, /* (39) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 314, -3 }, /* (40) priv_level ::= db_name NK_DOT NK_STAR */ + { 306, -3 }, /* (41) cmd ::= CREATE DNODE dnode_endpoint */ + { 306, -5 }, /* (42) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 306, -3 }, /* (43) cmd ::= DROP DNODE NK_INTEGER */ + { 306, -3 }, /* (44) cmd ::= DROP DNODE dnode_endpoint */ + { 306, -4 }, /* (45) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 306, -5 }, /* (46) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 306, -4 }, /* (47) cmd ::= ALTER ALL DNODES NK_STRING */ + { 306, -5 }, /* (48) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 318, -1 }, /* (49) dnode_endpoint ::= NK_STRING */ + { 318, -1 }, /* (50) dnode_endpoint ::= NK_ID */ + { 318, -1 }, /* (51) dnode_endpoint ::= NK_IPTOKEN */ + { 306, -3 }, /* (52) cmd ::= ALTER LOCAL NK_STRING */ + { 306, -4 }, /* (53) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 306, -5 }, /* (54) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (55) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (56) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (57) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (58) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (59) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (60) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (61) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 306, -5 }, /* (62) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 306, -4 }, /* (63) cmd ::= DROP DATABASE exists_opt db_name */ + { 306, -2 }, /* (64) cmd ::= USE db_name */ + { 306, -4 }, /* (65) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 306, -3 }, /* (66) cmd ::= FLUSH DATABASE db_name */ + { 306, -3 }, /* (67) cmd ::= TRIM DATABASE db_name */ + { 319, -3 }, /* (68) not_exists_opt ::= IF NOT EXISTS */ + { 319, 0 }, /* (69) not_exists_opt ::= */ + { 321, -2 }, /* (70) exists_opt ::= IF EXISTS */ + { 321, 0 }, /* (71) exists_opt ::= */ + { 320, 0 }, /* (72) db_options ::= */ + { 320, -3 }, /* (73) db_options ::= db_options BUFFER NK_INTEGER */ + { 320, -3 }, /* (74) db_options ::= db_options CACHEMODEL NK_STRING */ + { 320, -3 }, /* (75) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 320, -3 }, /* (76) db_options ::= db_options COMP NK_INTEGER */ + { 320, -3 }, /* (77) db_options ::= db_options DURATION NK_INTEGER */ + { 320, -3 }, /* (78) db_options ::= db_options DURATION NK_VARIABLE */ + { 320, -3 }, /* (79) db_options ::= db_options MAXROWS NK_INTEGER */ + { 320, -3 }, /* (80) db_options ::= db_options MINROWS NK_INTEGER */ + { 320, -3 }, /* (81) db_options ::= db_options KEEP integer_list */ + { 320, -3 }, /* (82) db_options ::= db_options KEEP variable_list */ + { 320, -3 }, /* (83) db_options ::= db_options PAGES NK_INTEGER */ + { 320, -3 }, /* (84) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 320, -3 }, /* (85) db_options ::= db_options PRECISION NK_STRING */ + { 320, -3 }, /* (86) db_options ::= db_options REPLICA NK_INTEGER */ + { 320, -3 }, /* (87) db_options ::= db_options STRICT NK_STRING */ + { 320, -3 }, /* (88) db_options ::= db_options VGROUPS NK_INTEGER */ + { 320, -3 }, /* (89) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 320, -3 }, /* (90) db_options ::= db_options RETENTIONS retention_list */ + { 320, -3 }, /* (91) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 320, -3 }, /* (92) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 320, -3 }, /* (93) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 320, -3 }, /* (94) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 320, -4 }, /* (95) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 320, -3 }, /* (96) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 320, -4 }, /* (97) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 320, -3 }, /* (98) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 320, -3 }, /* (99) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 320, -3 }, /* (100) db_options ::= db_options SST_TRIGGER NK_INTEGER */ + { 322, -1 }, /* (101) alter_db_options ::= alter_db_option */ + { 322, -2 }, /* (102) alter_db_options ::= alter_db_options alter_db_option */ + { 326, -2 }, /* (103) alter_db_option ::= CACHEMODEL NK_STRING */ + { 326, -2 }, /* (104) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 326, -2 }, /* (105) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 326, -2 }, /* (106) alter_db_option ::= KEEP integer_list */ + { 326, -2 }, /* (107) alter_db_option ::= KEEP variable_list */ + { 326, -2 }, /* (108) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 326, -2 }, /* (109) alter_db_option ::= SST_TRIGGER NK_INTEGER */ + { 323, -1 }, /* (110) integer_list ::= NK_INTEGER */ + { 323, -3 }, /* (111) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 324, -1 }, /* (112) variable_list ::= NK_VARIABLE */ + { 324, -3 }, /* (113) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 325, -1 }, /* (114) retention_list ::= retention */ + { 325, -3 }, /* (115) retention_list ::= retention_list NK_COMMA retention */ + { 327, -3 }, /* (116) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 306, -9 }, /* (117) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 306, -3 }, /* (118) cmd ::= CREATE TABLE multi_create_clause */ + { 306, -9 }, /* (119) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 306, -3 }, /* (120) cmd ::= DROP TABLE multi_drop_clause */ + { 306, -4 }, /* (121) cmd ::= DROP STABLE exists_opt full_table_name */ + { 306, -3 }, /* (122) cmd ::= ALTER TABLE alter_table_clause */ + { 306, -3 }, /* (123) cmd ::= ALTER STABLE alter_table_clause */ + { 335, -2 }, /* (124) alter_table_clause ::= full_table_name alter_table_options */ + { 335, -5 }, /* (125) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 335, -4 }, /* (126) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 335, -5 }, /* (127) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 335, -5 }, /* (128) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 335, -5 }, /* (129) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 335, -4 }, /* (130) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 335, -5 }, /* (131) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 335, -5 }, /* (132) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 335, -6 }, /* (133) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 332, -1 }, /* (134) multi_create_clause ::= create_subtable_clause */ + { 332, -2 }, /* (135) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 340, -10 }, /* (136) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 334, -1 }, /* (137) multi_drop_clause ::= drop_table_clause */ + { 334, -2 }, /* (138) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 343, -2 }, /* (139) drop_table_clause ::= exists_opt full_table_name */ + { 341, 0 }, /* (140) specific_cols_opt ::= */ + { 341, -3 }, /* (141) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 328, -1 }, /* (142) full_table_name ::= table_name */ + { 328, -3 }, /* (143) full_table_name ::= db_name NK_DOT table_name */ + { 329, -1 }, /* (144) column_def_list ::= column_def */ + { 329, -3 }, /* (145) column_def_list ::= column_def_list NK_COMMA column_def */ + { 346, -2 }, /* (146) column_def ::= column_name type_name */ + { 346, -4 }, /* (147) column_def ::= column_name type_name COMMENT NK_STRING */ + { 338, -1 }, /* (148) type_name ::= BOOL */ + { 338, -1 }, /* (149) type_name ::= TINYINT */ + { 338, -1 }, /* (150) type_name ::= SMALLINT */ + { 338, -1 }, /* (151) type_name ::= INT */ + { 338, -1 }, /* (152) type_name ::= INTEGER */ + { 338, -1 }, /* (153) type_name ::= BIGINT */ + { 338, -1 }, /* (154) type_name ::= FLOAT */ + { 338, -1 }, /* (155) type_name ::= DOUBLE */ + { 338, -4 }, /* (156) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 338, -1 }, /* (157) type_name ::= TIMESTAMP */ + { 338, -4 }, /* (158) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 338, -2 }, /* (159) type_name ::= TINYINT UNSIGNED */ + { 338, -2 }, /* (160) type_name ::= SMALLINT UNSIGNED */ + { 338, -2 }, /* (161) type_name ::= INT UNSIGNED */ + { 338, -2 }, /* (162) type_name ::= BIGINT UNSIGNED */ + { 338, -1 }, /* (163) type_name ::= JSON */ + { 338, -4 }, /* (164) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 338, -1 }, /* (165) type_name ::= MEDIUMBLOB */ + { 338, -1 }, /* (166) type_name ::= BLOB */ + { 338, -4 }, /* (167) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 338, -1 }, /* (168) type_name ::= DECIMAL */ + { 338, -4 }, /* (169) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 338, -6 }, /* (170) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 330, 0 }, /* (171) tags_def_opt ::= */ + { 330, -1 }, /* (172) tags_def_opt ::= tags_def */ + { 333, -4 }, /* (173) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 331, 0 }, /* (174) table_options ::= */ + { 331, -3 }, /* (175) table_options ::= table_options COMMENT NK_STRING */ + { 331, -3 }, /* (176) table_options ::= table_options MAX_DELAY duration_list */ + { 331, -3 }, /* (177) table_options ::= table_options WATERMARK duration_list */ + { 331, -5 }, /* (178) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 331, -3 }, /* (179) table_options ::= table_options TTL NK_INTEGER */ + { 331, -5 }, /* (180) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 336, -1 }, /* (181) alter_table_options ::= alter_table_option */ + { 336, -2 }, /* (182) alter_table_options ::= alter_table_options alter_table_option */ + { 349, -2 }, /* (183) alter_table_option ::= COMMENT NK_STRING */ + { 349, -2 }, /* (184) alter_table_option ::= TTL NK_INTEGER */ + { 347, -1 }, /* (185) duration_list ::= duration_literal */ + { 347, -3 }, /* (186) duration_list ::= duration_list NK_COMMA duration_literal */ + { 348, -1 }, /* (187) rollup_func_list ::= rollup_func_name */ + { 348, -3 }, /* (188) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 351, -1 }, /* (189) rollup_func_name ::= function_name */ + { 351, -1 }, /* (190) rollup_func_name ::= FIRST */ + { 351, -1 }, /* (191) rollup_func_name ::= LAST */ + { 344, -1 }, /* (192) col_name_list ::= col_name */ + { 344, -3 }, /* (193) col_name_list ::= col_name_list NK_COMMA col_name */ + { 353, -1 }, /* (194) col_name ::= column_name */ + { 306, -2 }, /* (195) cmd ::= SHOW DNODES */ + { 306, -2 }, /* (196) cmd ::= SHOW USERS */ + { 306, -2 }, /* (197) cmd ::= SHOW DATABASES */ + { 306, -4 }, /* (198) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 306, -4 }, /* (199) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 306, -3 }, /* (200) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 306, -2 }, /* (201) cmd ::= SHOW MNODES */ + { 306, -2 }, /* (202) cmd ::= SHOW MODULES */ + { 306, -2 }, /* (203) cmd ::= SHOW QNODES */ + { 306, -2 }, /* (204) cmd ::= SHOW FUNCTIONS */ + { 306, -5 }, /* (205) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 306, -2 }, /* (206) cmd ::= SHOW STREAMS */ + { 306, -2 }, /* (207) cmd ::= SHOW ACCOUNTS */ + { 306, -2 }, /* (208) cmd ::= SHOW APPS */ + { 306, -2 }, /* (209) cmd ::= SHOW CONNECTIONS */ + { 306, -2 }, /* (210) cmd ::= SHOW LICENCES */ + { 306, -2 }, /* (211) cmd ::= SHOW GRANTS */ + { 306, -4 }, /* (212) cmd ::= SHOW CREATE DATABASE db_name */ + { 306, -4 }, /* (213) cmd ::= SHOW CREATE TABLE full_table_name */ + { 306, -4 }, /* (214) cmd ::= SHOW CREATE STABLE full_table_name */ + { 306, -2 }, /* (215) cmd ::= SHOW QUERIES */ + { 306, -2 }, /* (216) cmd ::= SHOW SCORES */ + { 306, -2 }, /* (217) cmd ::= SHOW TOPICS */ + { 306, -2 }, /* (218) cmd ::= SHOW VARIABLES */ + { 306, -3 }, /* (219) cmd ::= SHOW LOCAL VARIABLES */ + { 306, -4 }, /* (220) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + { 306, -2 }, /* (221) cmd ::= SHOW BNODES */ + { 306, -2 }, /* (222) cmd ::= SHOW SNODES */ + { 306, -2 }, /* (223) cmd ::= SHOW CLUSTER */ + { 306, -2 }, /* (224) cmd ::= SHOW TRANSACTIONS */ + { 306, -4 }, /* (225) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 306, -2 }, /* (226) cmd ::= SHOW CONSUMERS */ + { 306, -2 }, /* (227) cmd ::= SHOW SUBSCRIPTIONS */ + { 306, -5 }, /* (228) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 306, -3 }, /* (229) cmd ::= SHOW VNODES NK_INTEGER */ + { 306, -3 }, /* (230) cmd ::= SHOW VNODES NK_STRING */ + { 354, 0 }, /* (231) db_name_cond_opt ::= */ + { 354, -2 }, /* (232) db_name_cond_opt ::= db_name NK_DOT */ + { 355, 0 }, /* (233) like_pattern_opt ::= */ + { 355, -2 }, /* (234) like_pattern_opt ::= LIKE NK_STRING */ + { 356, -1 }, /* (235) table_name_cond ::= table_name */ + { 357, 0 }, /* (236) from_db_opt ::= */ + { 357, -2 }, /* (237) from_db_opt ::= FROM db_name */ + { 306, -8 }, /* (238) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 306, -4 }, /* (239) cmd ::= DROP INDEX exists_opt full_table_name */ + { 358, -10 }, /* (240) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 358, -12 }, /* (241) 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, -1 }, /* (242) func_list ::= func */ + { 359, -3 }, /* (243) func_list ::= func_list NK_COMMA func */ + { 362, -4 }, /* (244) func ::= function_name NK_LP expression_list NK_RP */ + { 361, 0 }, /* (245) sma_stream_opt ::= */ + { 361, -3 }, /* (246) sma_stream_opt ::= stream_options WATERMARK duration_literal */ + { 361, -3 }, /* (247) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + { 306, -6 }, /* (248) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ + { 306, -7 }, /* (249) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 306, -9 }, /* (250) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 306, -7 }, /* (251) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 306, -9 }, /* (252) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 306, -4 }, /* (253) cmd ::= DROP TOPIC exists_opt topic_name */ + { 306, -7 }, /* (254) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 306, -2 }, /* (255) cmd ::= DESC full_table_name */ + { 306, -2 }, /* (256) cmd ::= DESCRIBE full_table_name */ + { 306, -3 }, /* (257) cmd ::= RESET QUERY CACHE */ + { 306, -4 }, /* (258) cmd ::= EXPLAIN analyze_opt explain_options query_expression */ + { 367, 0 }, /* (259) analyze_opt ::= */ + { 367, -1 }, /* (260) analyze_opt ::= ANALYZE */ + { 368, 0 }, /* (261) explain_options ::= */ + { 368, -3 }, /* (262) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 368, -3 }, /* (263) explain_options ::= explain_options RATIO NK_FLOAT */ + { 306, -10 }, /* (264) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 306, -4 }, /* (265) cmd ::= DROP FUNCTION exists_opt function_name */ + { 369, 0 }, /* (266) agg_func_opt ::= */ + { 369, -1 }, /* (267) agg_func_opt ::= AGGREGATE */ + { 370, 0 }, /* (268) bufsize_opt ::= */ + { 370, -2 }, /* (269) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 306, -9 }, /* (270) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression */ + { 306, -4 }, /* (271) cmd ::= DROP STREAM exists_opt stream_name */ + { 363, 0 }, /* (272) stream_options ::= */ + { 363, -3 }, /* (273) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 363, -3 }, /* (274) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 363, -4 }, /* (275) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 363, -3 }, /* (276) stream_options ::= stream_options WATERMARK duration_literal */ + { 363, -4 }, /* (277) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 306, -3 }, /* (278) cmd ::= KILL CONNECTION NK_INTEGER */ + { 306, -3 }, /* (279) cmd ::= KILL QUERY NK_STRING */ + { 306, -3 }, /* (280) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 306, -2 }, /* (281) cmd ::= BALANCE VGROUP */ + { 306, -4 }, /* (282) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 306, -4 }, /* (283) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 306, -3 }, /* (284) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 372, -2 }, /* (285) dnode_list ::= DNODE NK_INTEGER */ + { 372, -3 }, /* (286) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 306, -4 }, /* (287) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 306, -1 }, /* (288) cmd ::= query_expression */ + { 306, -7 }, /* (289) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ + { 306, -4 }, /* (290) cmd ::= INSERT INTO full_table_name query_expression */ + { 309, -1 }, /* (291) literal ::= NK_INTEGER */ + { 309, -1 }, /* (292) literal ::= NK_FLOAT */ + { 309, -1 }, /* (293) literal ::= NK_STRING */ + { 309, -1 }, /* (294) literal ::= NK_BOOL */ + { 309, -2 }, /* (295) literal ::= TIMESTAMP NK_STRING */ + { 309, -1 }, /* (296) literal ::= duration_literal */ + { 309, -1 }, /* (297) literal ::= NULL */ + { 309, -1 }, /* (298) literal ::= NK_QUESTION */ + { 350, -1 }, /* (299) duration_literal ::= NK_VARIABLE */ + { 374, -1 }, /* (300) signed ::= NK_INTEGER */ + { 374, -2 }, /* (301) signed ::= NK_PLUS NK_INTEGER */ + { 374, -2 }, /* (302) signed ::= NK_MINUS NK_INTEGER */ + { 374, -1 }, /* (303) signed ::= NK_FLOAT */ + { 374, -2 }, /* (304) signed ::= NK_PLUS NK_FLOAT */ + { 374, -2 }, /* (305) signed ::= NK_MINUS NK_FLOAT */ + { 339, -1 }, /* (306) signed_literal ::= signed */ + { 339, -1 }, /* (307) signed_literal ::= NK_STRING */ + { 339, -1 }, /* (308) signed_literal ::= NK_BOOL */ + { 339, -2 }, /* (309) signed_literal ::= TIMESTAMP NK_STRING */ + { 339, -1 }, /* (310) signed_literal ::= duration_literal */ + { 339, -1 }, /* (311) signed_literal ::= NULL */ + { 339, -1 }, /* (312) signed_literal ::= literal_func */ + { 339, -1 }, /* (313) signed_literal ::= NK_QUESTION */ + { 376, -1 }, /* (314) literal_list ::= signed_literal */ + { 376, -3 }, /* (315) literal_list ::= literal_list NK_COMMA signed_literal */ + { 317, -1 }, /* (316) db_name ::= NK_ID */ + { 345, -1 }, /* (317) table_name ::= NK_ID */ + { 337, -1 }, /* (318) column_name ::= NK_ID */ + { 352, -1 }, /* (319) function_name ::= NK_ID */ + { 377, -1 }, /* (320) table_alias ::= NK_ID */ + { 378, -1 }, /* (321) column_alias ::= NK_ID */ + { 311, -1 }, /* (322) user_name ::= NK_ID */ + { 364, -1 }, /* (323) topic_name ::= NK_ID */ + { 371, -1 }, /* (324) stream_name ::= NK_ID */ + { 366, -1 }, /* (325) cgroup_name ::= NK_ID */ + { 379, -1 }, /* (326) expression ::= literal */ + { 379, -1 }, /* (327) expression ::= pseudo_column */ + { 379, -1 }, /* (328) expression ::= column_reference */ + { 379, -1 }, /* (329) expression ::= function_expression */ + { 379, -1 }, /* (330) expression ::= subquery */ + { 379, -3 }, /* (331) expression ::= NK_LP expression NK_RP */ + { 379, -2 }, /* (332) expression ::= NK_PLUS expression */ + { 379, -2 }, /* (333) expression ::= NK_MINUS expression */ + { 379, -3 }, /* (334) expression ::= expression NK_PLUS expression */ + { 379, -3 }, /* (335) expression ::= expression NK_MINUS expression */ + { 379, -3 }, /* (336) expression ::= expression NK_STAR expression */ + { 379, -3 }, /* (337) expression ::= expression NK_SLASH expression */ + { 379, -3 }, /* (338) expression ::= expression NK_REM expression */ + { 379, -3 }, /* (339) expression ::= column_reference NK_ARROW NK_STRING */ + { 379, -3 }, /* (340) expression ::= expression NK_BITAND expression */ + { 379, -3 }, /* (341) expression ::= expression NK_BITOR expression */ + { 342, -1 }, /* (342) expression_list ::= expression */ + { 342, -3 }, /* (343) expression_list ::= expression_list NK_COMMA expression */ + { 381, -1 }, /* (344) column_reference ::= column_name */ + { 381, -3 }, /* (345) column_reference ::= table_name NK_DOT column_name */ + { 380, -1 }, /* (346) pseudo_column ::= ROWTS */ + { 380, -1 }, /* (347) pseudo_column ::= TBNAME */ + { 380, -3 }, /* (348) pseudo_column ::= table_name NK_DOT TBNAME */ + { 380, -1 }, /* (349) pseudo_column ::= QSTART */ + { 380, -1 }, /* (350) pseudo_column ::= QEND */ + { 380, -1 }, /* (351) pseudo_column ::= QDURATION */ + { 380, -1 }, /* (352) pseudo_column ::= WSTART */ + { 380, -1 }, /* (353) pseudo_column ::= WEND */ + { 380, -1 }, /* (354) pseudo_column ::= WDURATION */ + { 382, -4 }, /* (355) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 382, -4 }, /* (356) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 382, -6 }, /* (357) function_expression ::= CAST NK_LP expression AS type_name NK_RP */ + { 382, -1 }, /* (358) function_expression ::= literal_func */ + { 375, -3 }, /* (359) literal_func ::= noarg_func NK_LP NK_RP */ + { 375, -1 }, /* (360) literal_func ::= NOW */ + { 386, -1 }, /* (361) noarg_func ::= NOW */ + { 386, -1 }, /* (362) noarg_func ::= TODAY */ + { 386, -1 }, /* (363) noarg_func ::= TIMEZONE */ + { 386, -1 }, /* (364) noarg_func ::= DATABASE */ + { 386, -1 }, /* (365) noarg_func ::= CLIENT_VERSION */ + { 386, -1 }, /* (366) noarg_func ::= SERVER_VERSION */ + { 386, -1 }, /* (367) noarg_func ::= SERVER_STATUS */ + { 386, -1 }, /* (368) noarg_func ::= CURRENT_USER */ + { 386, -1 }, /* (369) noarg_func ::= USER */ + { 384, -1 }, /* (370) star_func ::= COUNT */ + { 384, -1 }, /* (371) star_func ::= FIRST */ + { 384, -1 }, /* (372) star_func ::= LAST */ + { 384, -1 }, /* (373) star_func ::= LAST_ROW */ + { 385, -1 }, /* (374) star_func_para_list ::= NK_STAR */ + { 385, -1 }, /* (375) star_func_para_list ::= other_para_list */ + { 387, -1 }, /* (376) other_para_list ::= star_func_para */ + { 387, -3 }, /* (377) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 388, -1 }, /* (378) star_func_para ::= expression */ + { 388, -3 }, /* (379) star_func_para ::= table_name NK_DOT NK_STAR */ + { 389, -3 }, /* (380) predicate ::= expression compare_op expression */ + { 389, -5 }, /* (381) predicate ::= expression BETWEEN expression AND expression */ + { 389, -6 }, /* (382) predicate ::= expression NOT BETWEEN expression AND expression */ + { 389, -3 }, /* (383) predicate ::= expression IS NULL */ + { 389, -4 }, /* (384) predicate ::= expression IS NOT NULL */ + { 389, -3 }, /* (385) predicate ::= expression in_op in_predicate_value */ + { 390, -1 }, /* (386) compare_op ::= NK_LT */ + { 390, -1 }, /* (387) compare_op ::= NK_GT */ + { 390, -1 }, /* (388) compare_op ::= NK_LE */ + { 390, -1 }, /* (389) compare_op ::= NK_GE */ + { 390, -1 }, /* (390) compare_op ::= NK_NE */ + { 390, -1 }, /* (391) compare_op ::= NK_EQ */ + { 390, -1 }, /* (392) compare_op ::= LIKE */ + { 390, -2 }, /* (393) compare_op ::= NOT LIKE */ + { 390, -1 }, /* (394) compare_op ::= MATCH */ + { 390, -1 }, /* (395) compare_op ::= NMATCH */ + { 390, -1 }, /* (396) compare_op ::= CONTAINS */ + { 391, -1 }, /* (397) in_op ::= IN */ + { 391, -2 }, /* (398) in_op ::= NOT IN */ + { 392, -3 }, /* (399) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 393, -1 }, /* (400) boolean_value_expression ::= boolean_primary */ + { 393, -2 }, /* (401) boolean_value_expression ::= NOT boolean_primary */ + { 393, -3 }, /* (402) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 393, -3 }, /* (403) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 394, -1 }, /* (404) boolean_primary ::= predicate */ + { 394, -3 }, /* (405) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 395, -1 }, /* (406) common_expression ::= expression */ + { 395, -1 }, /* (407) common_expression ::= boolean_value_expression */ + { 396, 0 }, /* (408) from_clause_opt ::= */ + { 396, -2 }, /* (409) from_clause_opt ::= FROM table_reference_list */ + { 397, -1 }, /* (410) table_reference_list ::= table_reference */ + { 397, -3 }, /* (411) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 398, -1 }, /* (412) table_reference ::= table_primary */ + { 398, -1 }, /* (413) table_reference ::= joined_table */ + { 399, -2 }, /* (414) table_primary ::= table_name alias_opt */ + { 399, -4 }, /* (415) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 399, -2 }, /* (416) table_primary ::= subquery alias_opt */ + { 399, -1 }, /* (417) table_primary ::= parenthesized_joined_table */ + { 401, 0 }, /* (418) alias_opt ::= */ + { 401, -1 }, /* (419) alias_opt ::= table_alias */ + { 401, -2 }, /* (420) alias_opt ::= AS table_alias */ + { 402, -3 }, /* (421) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 402, -3 }, /* (422) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 400, -6 }, /* (423) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 403, 0 }, /* (424) join_type ::= */ + { 403, -1 }, /* (425) join_type ::= INNER */ + { 405, -12 }, /* (426) query_specification ::= SELECT set_quantifier_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 */ + { 406, 0 }, /* (427) set_quantifier_opt ::= */ + { 406, -1 }, /* (428) set_quantifier_opt ::= DISTINCT */ + { 406, -1 }, /* (429) set_quantifier_opt ::= ALL */ + { 407, -1 }, /* (430) select_list ::= select_item */ + { 407, -3 }, /* (431) select_list ::= select_list NK_COMMA select_item */ + { 415, -1 }, /* (432) select_item ::= NK_STAR */ + { 415, -1 }, /* (433) select_item ::= common_expression */ + { 415, -2 }, /* (434) select_item ::= common_expression column_alias */ + { 415, -3 }, /* (435) select_item ::= common_expression AS column_alias */ + { 415, -3 }, /* (436) select_item ::= table_name NK_DOT NK_STAR */ + { 373, 0 }, /* (437) where_clause_opt ::= */ + { 373, -2 }, /* (438) where_clause_opt ::= WHERE search_condition */ + { 408, 0 }, /* (439) partition_by_clause_opt ::= */ + { 408, -3 }, /* (440) partition_by_clause_opt ::= PARTITION BY expression_list */ + { 412, 0 }, /* (441) twindow_clause_opt ::= */ + { 412, -6 }, /* (442) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 412, -4 }, /* (443) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ + { 412, -6 }, /* (444) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 412, -8 }, /* (445) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 360, 0 }, /* (446) sliding_opt ::= */ + { 360, -4 }, /* (447) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 411, 0 }, /* (448) fill_opt ::= */ + { 411, -4 }, /* (449) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 411, -6 }, /* (450) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 416, -1 }, /* (451) fill_mode ::= NONE */ + { 416, -1 }, /* (452) fill_mode ::= PREV */ + { 416, -1 }, /* (453) fill_mode ::= NULL */ + { 416, -1 }, /* (454) fill_mode ::= LINEAR */ + { 416, -1 }, /* (455) fill_mode ::= NEXT */ + { 413, 0 }, /* (456) group_by_clause_opt ::= */ + { 413, -3 }, /* (457) group_by_clause_opt ::= GROUP BY group_by_list */ + { 417, -1 }, /* (458) group_by_list ::= expression */ + { 417, -3 }, /* (459) group_by_list ::= group_by_list NK_COMMA expression */ + { 414, 0 }, /* (460) having_clause_opt ::= */ + { 414, -2 }, /* (461) having_clause_opt ::= HAVING search_condition */ + { 409, 0 }, /* (462) range_opt ::= */ + { 409, -6 }, /* (463) range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ + { 410, 0 }, /* (464) every_opt ::= */ + { 410, -4 }, /* (465) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 365, -4 }, /* (466) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 418, -1 }, /* (467) query_expression_body ::= query_primary */ + { 418, -4 }, /* (468) query_expression_body ::= query_expression_body UNION ALL query_expression_body */ + { 418, -3 }, /* (469) query_expression_body ::= query_expression_body UNION query_expression_body */ + { 422, -1 }, /* (470) query_primary ::= query_specification */ + { 422, -6 }, /* (471) query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + { 419, 0 }, /* (472) order_by_clause_opt ::= */ + { 419, -3 }, /* (473) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 420, 0 }, /* (474) slimit_clause_opt ::= */ + { 420, -2 }, /* (475) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 420, -4 }, /* (476) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 420, -4 }, /* (477) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 421, 0 }, /* (478) limit_clause_opt ::= */ + { 421, -2 }, /* (479) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 421, -4 }, /* (480) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 421, -4 }, /* (481) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 383, -3 }, /* (482) subquery ::= NK_LP query_expression NK_RP */ + { 404, -1 }, /* (483) search_condition ::= common_expression */ + { 423, -1 }, /* (484) sort_specification_list ::= sort_specification */ + { 423, -3 }, /* (485) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 424, -3 }, /* (486) sort_specification ::= expression ordering_specification_opt null_ordering_opt */ + { 425, 0 }, /* (487) ordering_specification_opt ::= */ + { 425, -1 }, /* (488) ordering_specification_opt ::= ASC */ + { 425, -1 }, /* (489) ordering_specification_opt ::= DESC */ + { 426, 0 }, /* (490) null_ordering_opt ::= */ + { 426, -2 }, /* (491) null_ordering_opt ::= NULLS FIRST */ + { 426, -2 }, /* (492) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3367,11 +3419,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,306,&yymsp[0].minor); + yy_destructor(yypParser,307,&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,307,&yymsp[0].minor); + yy_destructor(yypParser,308,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3385,20 +3437,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,306,&yymsp[-2].minor); +{ yy_destructor(yypParser,307,&yymsp[-2].minor); { } - yy_destructor(yypParser,308,&yymsp[0].minor); + yy_destructor(yypParser,309,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,309,&yymsp[0].minor); +{ yy_destructor(yypParser,310,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,307,&yymsp[-1].minor); +{ yy_destructor(yypParser,308,&yymsp[-1].minor); { } - yy_destructor(yypParser,309,&yymsp[0].minor); + yy_destructor(yypParser,310,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3412,72 +3464,72 @@ 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,308,&yymsp[0].minor); + yy_destructor(yypParser,309,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy209, &yymsp[-1].minor.yy0, yymsp[0].minor.yy59); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy617, &yymsp[-1].minor.yy0, yymsp[0].minor.yy215); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy209, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy617, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy209, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy617, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy209, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy617, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy617); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy59 = 1; } +{ yymsp[1].minor.yy215 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy59 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy215 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy69, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy473, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy69, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy473, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy69 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy473 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 35: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==35); -{ yylhsminor.yy69 = yymsp[0].minor.yy69; } - yymsp[0].minor.yy69 = yylhsminor.yy69; +{ yylhsminor.yy473 = yymsp[0].minor.yy473; } + yymsp[0].minor.yy473 = yylhsminor.yy473; break; case 36: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy69 = yymsp[-2].minor.yy69 | yymsp[0].minor.yy69; } - yymsp[-2].minor.yy69 = yylhsminor.yy69; +{ yylhsminor.yy473 = yymsp[-2].minor.yy473 | yymsp[0].minor.yy473; } + yymsp[-2].minor.yy473 = yylhsminor.yy473; break; case 37: /* priv_type ::= READ */ -{ yymsp[0].minor.yy69 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy473 = PRIVILEGE_TYPE_READ; } break; case 38: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy69 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy473 = PRIVILEGE_TYPE_WRITE; } break; case 39: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy209 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy209 = yylhsminor.yy209; +{ yylhsminor.yy617 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy617 = yylhsminor.yy617; break; case 40: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy209 = yymsp[-2].minor.yy209; } - yymsp[-2].minor.yy209 = yylhsminor.yy209; +{ yylhsminor.yy617 = yymsp[-2].minor.yy617; } + yymsp[-2].minor.yy617 = yylhsminor.yy617; break; case 41: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy209, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy617, NULL); } break; case 42: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy0); } break; case 43: /* cmd ::= DROP DNODE NK_INTEGER */ { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); } break; case 44: /* cmd ::= DROP DNODE dnode_endpoint */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy617); } break; case 45: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3494,31 +3546,31 @@ static YYACTIONTYPE yy_reduce( case 49: /* dnode_endpoint ::= NK_STRING */ case 50: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==50); case 51: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==51); - case 312: /* db_name ::= NK_ID */ yytestcase(yyruleno==312); - case 313: /* table_name ::= NK_ID */ yytestcase(yyruleno==313); - case 314: /* column_name ::= NK_ID */ yytestcase(yyruleno==314); - case 315: /* function_name ::= NK_ID */ yytestcase(yyruleno==315); - case 316: /* table_alias ::= NK_ID */ yytestcase(yyruleno==316); - case 317: /* column_alias ::= NK_ID */ yytestcase(yyruleno==317); - case 318: /* user_name ::= NK_ID */ yytestcase(yyruleno==318); - case 319: /* topic_name ::= NK_ID */ yytestcase(yyruleno==319); - case 320: /* stream_name ::= NK_ID */ yytestcase(yyruleno==320); - case 321: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==321); - case 357: /* noarg_func ::= NOW */ yytestcase(yyruleno==357); - case 358: /* noarg_func ::= TODAY */ yytestcase(yyruleno==358); - case 359: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==359); - case 360: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==360); - case 361: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==361); - case 362: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==362); - case 363: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==363); - case 364: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==364); - case 365: /* noarg_func ::= USER */ yytestcase(yyruleno==365); - case 366: /* star_func ::= COUNT */ yytestcase(yyruleno==366); - case 367: /* star_func ::= FIRST */ yytestcase(yyruleno==367); - case 368: /* star_func ::= LAST */ yytestcase(yyruleno==368); - case 369: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==369); -{ yylhsminor.yy209 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy209 = yylhsminor.yy209; + case 316: /* db_name ::= NK_ID */ yytestcase(yyruleno==316); + case 317: /* table_name ::= NK_ID */ yytestcase(yyruleno==317); + case 318: /* column_name ::= NK_ID */ yytestcase(yyruleno==318); + case 319: /* function_name ::= NK_ID */ yytestcase(yyruleno==319); + case 320: /* table_alias ::= NK_ID */ yytestcase(yyruleno==320); + case 321: /* column_alias ::= NK_ID */ yytestcase(yyruleno==321); + case 322: /* user_name ::= NK_ID */ yytestcase(yyruleno==322); + case 323: /* topic_name ::= NK_ID */ yytestcase(yyruleno==323); + case 324: /* stream_name ::= NK_ID */ yytestcase(yyruleno==324); + case 325: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==325); + case 361: /* noarg_func ::= NOW */ yytestcase(yyruleno==361); + case 362: /* noarg_func ::= TODAY */ yytestcase(yyruleno==362); + case 363: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==363); + case 364: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==364); + case 365: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==365); + case 366: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==366); + case 367: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==367); + case 368: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==368); + case 369: /* noarg_func ::= USER */ yytestcase(yyruleno==369); + case 370: /* star_func ::= COUNT */ yytestcase(yyruleno==370); + case 371: /* star_func ::= FIRST */ yytestcase(yyruleno==371); + case 372: /* star_func ::= LAST */ yytestcase(yyruleno==372); + case 373: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==373); +{ yylhsminor.yy617 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy617 = yylhsminor.yy617; break; case 52: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3551,1261 +3603,1274 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 62: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy293, &yymsp[-1].minor.yy209, yymsp[0].minor.yy272); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy313, &yymsp[-1].minor.yy617, yymsp[0].minor.yy840); } break; case 63: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy293, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy313, &yymsp[0].minor.yy617); } break; case 64: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy617); } break; case 65: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy209, yymsp[0].minor.yy272); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy617, yymsp[0].minor.yy840); } break; case 66: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy617); } break; case 67: /* cmd ::= TRIM DATABASE db_name */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[0].minor.yy617); } break; case 68: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy293 = true; } +{ yymsp[-2].minor.yy313 = true; } break; case 69: /* not_exists_opt ::= */ case 71: /* exists_opt ::= */ yytestcase(yyruleno==71); - case 255: /* analyze_opt ::= */ yytestcase(yyruleno==255); - case 262: /* agg_func_opt ::= */ yytestcase(yyruleno==262); - case 423: /* set_quantifier_opt ::= */ yytestcase(yyruleno==423); -{ yymsp[1].minor.yy293 = false; } + case 259: /* analyze_opt ::= */ yytestcase(yyruleno==259); + case 266: /* agg_func_opt ::= */ yytestcase(yyruleno==266); + case 427: /* set_quantifier_opt ::= */ yytestcase(yyruleno==427); +{ yymsp[1].minor.yy313 = false; } break; case 70: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy293 = true; } +{ yymsp[-1].minor.yy313 = true; } break; case 72: /* db_options ::= */ -{ yymsp[1].minor.yy272 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy840 = createDefaultDatabaseOptions(pCxt); } break; case 73: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 74: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 75: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 76: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 77: /* db_options ::= db_options DURATION NK_INTEGER */ case 78: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==78); -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 79: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 80: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 81: /* db_options ::= db_options KEEP integer_list */ case 82: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==82); -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_KEEP, yymsp[0].minor.yy172); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_KEEP, yymsp[0].minor.yy544); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 83: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 84: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 85: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 86: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 87: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 88: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 89: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 90: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_RETENTIONS, yymsp[0].minor.yy172); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_RETENTIONS, yymsp[0].minor.yy544); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 91: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 92: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 93: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 94: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 95: /* 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.yy272 = setDatabaseOption(pCxt, yymsp[-3].minor.yy272, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-3].minor.yy840, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; case 96: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 97: /* 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.yy272 = setDatabaseOption(pCxt, yymsp[-3].minor.yy272, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-3].minor.yy840, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; case 98: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; case 99: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy272 = setDatabaseOption(pCxt, yymsp[-2].minor.yy272, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; - break; - case 100: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy272 = createAlterDatabaseOptions(pCxt); yylhsminor.yy272 = setAlterDatabaseOption(pCxt, yylhsminor.yy272, &yymsp[0].minor.yy5); } - yymsp[0].minor.yy272 = yylhsminor.yy272; - break; - case 101: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy272 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy272, &yymsp[0].minor.yy5); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; - break; - case 102: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy5.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } - break; - case 103: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy5.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } - break; - case 104: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy5.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } - break; - case 105: /* alter_db_option ::= KEEP integer_list */ - case 106: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==106); -{ yymsp[-1].minor.yy5.type = DB_OPTION_KEEP; yymsp[-1].minor.yy5.pList = yymsp[0].minor.yy172; } - break; - case 107: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy5.type = DB_OPTION_WAL; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } - break; - case 108: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy172 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy172 = yylhsminor.yy172; - break; - case 109: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 282: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==282); -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-2].minor.yy172, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy172 = yylhsminor.yy172; - break; - case 110: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy172 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy172 = yylhsminor.yy172; - break; - case 111: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-2].minor.yy172, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy172 = yylhsminor.yy172; - break; - case 112: /* retention_list ::= retention */ - case 132: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==132); - case 135: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==135); - case 142: /* column_def_list ::= column_def */ yytestcase(yyruleno==142); - case 185: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==185); - case 190: /* col_name_list ::= col_name */ yytestcase(yyruleno==190); - case 238: /* func_list ::= func */ yytestcase(yyruleno==238); - case 310: /* literal_list ::= signed_literal */ yytestcase(yyruleno==310); - case 372: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==372); - case 426: /* select_list ::= select_item */ yytestcase(yyruleno==426); - case 480: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==480); -{ yylhsminor.yy172 = createNodeList(pCxt, yymsp[0].minor.yy272); } - yymsp[0].minor.yy172 = yylhsminor.yy172; - break; - case 113: /* retention_list ::= retention_list NK_COMMA retention */ - case 143: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==143); - case 186: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==186); - case 191: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==191); - case 239: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==239); - case 311: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==311); - case 373: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==373); - case 427: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==427); - case 481: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==481); -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-2].minor.yy172, yymsp[0].minor.yy272); } - yymsp[-2].minor.yy172 = yylhsminor.yy172; - break; - case 114: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy272 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; - break; - case 115: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 117: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==117); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy293, yymsp[-5].minor.yy272, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy272); } - break; - case 116: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy172); } - break; - case 118: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy172); } - break; - case 119: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy293, yymsp[0].minor.yy272); } - break; - case 120: /* cmd ::= ALTER TABLE alter_table_clause */ - case 284: /* cmd ::= query_expression */ yytestcase(yyruleno==284); -{ pCxt->pRootNode = yymsp[0].minor.yy272; } - break; - case 121: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy272); } - break; - case 122: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy272 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; - break; - case 123: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy272 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy209, yymsp[0].minor.yy616); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; - break; - case 124: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy272 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy272, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy209); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; - break; - case 125: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy272 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy209, yymsp[0].minor.yy616); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; + break; + case 100: /* db_options ::= db_options SST_TRIGGER NK_INTEGER */ +{ yylhsminor.yy840 = setDatabaseOption(pCxt, yymsp[-2].minor.yy840, DB_OPTION_SST_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; + break; + case 101: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy840 = createAlterDatabaseOptions(pCxt); yylhsminor.yy840 = setAlterDatabaseOption(pCxt, yylhsminor.yy840, &yymsp[0].minor.yy95); } + yymsp[0].minor.yy840 = yylhsminor.yy840; + break; + case 102: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy840 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy840, &yymsp[0].minor.yy95); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; + break; + case 103: /* alter_db_option ::= CACHEMODEL NK_STRING */ +{ yymsp[-1].minor.yy95.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } + break; + case 104: /* alter_db_option ::= CACHESIZE NK_INTEGER */ +{ yymsp[-1].minor.yy95.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } + break; + case 105: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy95.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } + break; + case 106: /* alter_db_option ::= KEEP integer_list */ + case 107: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==107); +{ yymsp[-1].minor.yy95.type = DB_OPTION_KEEP; yymsp[-1].minor.yy95.pList = yymsp[0].minor.yy544; } + break; + case 108: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy95.type = DB_OPTION_WAL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } + break; + case 109: /* alter_db_option ::= SST_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy95.type = DB_OPTION_SST_TRIGGER; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } + break; + case 110: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy544 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy544 = yylhsminor.yy544; + break; + case 111: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 286: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==286); +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-2].minor.yy544, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy544 = yylhsminor.yy544; + break; + case 112: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy544 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy544 = yylhsminor.yy544; + break; + case 113: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-2].minor.yy544, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy544 = yylhsminor.yy544; + break; + case 114: /* retention_list ::= retention */ + case 134: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==134); + case 137: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==137); + case 144: /* column_def_list ::= column_def */ yytestcase(yyruleno==144); + case 187: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==187); + case 192: /* col_name_list ::= col_name */ yytestcase(yyruleno==192); + case 242: /* func_list ::= func */ yytestcase(yyruleno==242); + case 314: /* literal_list ::= signed_literal */ yytestcase(yyruleno==314); + case 376: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==376); + case 430: /* select_list ::= select_item */ yytestcase(yyruleno==430); + case 484: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==484); +{ yylhsminor.yy544 = createNodeList(pCxt, yymsp[0].minor.yy840); } + yymsp[0].minor.yy544 = yylhsminor.yy544; + break; + case 115: /* retention_list ::= retention_list NK_COMMA retention */ + case 145: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==145); + case 188: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==188); + case 193: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==193); + case 243: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==243); + case 315: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==315); + case 377: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==377); + case 431: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==431); + case 485: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==485); +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-2].minor.yy544, yymsp[0].minor.yy840); } + yymsp[-2].minor.yy544 = yylhsminor.yy544; + break; + case 116: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ +{ yylhsminor.yy840 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; + break; + case 117: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 119: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==119); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy313, yymsp[-5].minor.yy840, yymsp[-3].minor.yy544, yymsp[-1].minor.yy544, yymsp[0].minor.yy840); } + break; + case 118: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy544); } + break; + case 120: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy544); } + break; + case 121: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy313, yymsp[0].minor.yy840); } + break; + case 122: /* cmd ::= ALTER TABLE alter_table_clause */ + case 288: /* cmd ::= query_expression */ yytestcase(yyruleno==288); +{ pCxt->pRootNode = yymsp[0].minor.yy840; } + break; + case 123: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy840); } + break; + case 124: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy840 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; + break; + case 125: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ +{ yylhsminor.yy840 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy617, yymsp[0].minor.yy784); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; + break; + case 126: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy840 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy840, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy617); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; + break; + case 127: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy840 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy617, yymsp[0].minor.yy784); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 126: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy272 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + case 128: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy840 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy617, &yymsp[0].minor.yy617); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 127: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy272 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy209, yymsp[0].minor.yy616); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; - break; - case 128: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy272 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy272, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy209); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 129: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy840 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy617, yymsp[0].minor.yy784); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; + break; + case 130: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy840 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy840, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy617); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 129: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy272 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy209, yymsp[0].minor.yy616); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + case 131: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy840 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy617, yymsp[0].minor.yy784); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 130: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy272 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy272, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + case 132: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy840 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy840, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy617, &yymsp[0].minor.yy617); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 131: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy272 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy272, &yymsp[-2].minor.yy209, yymsp[0].minor.yy272); } - yymsp[-5].minor.yy272 = yylhsminor.yy272; + case 133: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ +{ yylhsminor.yy840 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy840, &yymsp[-2].minor.yy617, yymsp[0].minor.yy840); } + yymsp[-5].minor.yy840 = yylhsminor.yy840; break; - case 133: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 136: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==136); -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-1].minor.yy172, yymsp[0].minor.yy272); } - yymsp[-1].minor.yy172 = yylhsminor.yy172; + case 135: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 138: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==138); +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-1].minor.yy544, yymsp[0].minor.yy840); } + yymsp[-1].minor.yy544 = yylhsminor.yy544; break; - case 134: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy272 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy293, yymsp[-8].minor.yy272, yymsp[-6].minor.yy272, yymsp[-5].minor.yy172, yymsp[-2].minor.yy172, yymsp[0].minor.yy272); } - yymsp[-9].minor.yy272 = yylhsminor.yy272; + case 136: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ +{ yylhsminor.yy840 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy313, yymsp[-8].minor.yy840, yymsp[-6].minor.yy840, yymsp[-5].minor.yy544, yymsp[-2].minor.yy544, yymsp[0].minor.yy840); } + yymsp[-9].minor.yy840 = yylhsminor.yy840; break; - case 137: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy272 = createDropTableClause(pCxt, yymsp[-1].minor.yy293, yymsp[0].minor.yy272); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 139: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy840 = createDropTableClause(pCxt, yymsp[-1].minor.yy313, yymsp[0].minor.yy840); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 138: /* specific_cols_opt ::= */ - case 169: /* tags_def_opt ::= */ yytestcase(yyruleno==169); - case 435: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==435); - case 452: /* group_by_clause_opt ::= */ yytestcase(yyruleno==452); - case 468: /* order_by_clause_opt ::= */ yytestcase(yyruleno==468); -{ yymsp[1].minor.yy172 = NULL; } + case 140: /* specific_cols_opt ::= */ + case 171: /* tags_def_opt ::= */ yytestcase(yyruleno==171); + case 439: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==439); + case 456: /* group_by_clause_opt ::= */ yytestcase(yyruleno==456); + case 472: /* order_by_clause_opt ::= */ yytestcase(yyruleno==472); +{ yymsp[1].minor.yy544 = NULL; } break; - case 139: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy172 = yymsp[-1].minor.yy172; } + case 141: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy544 = yymsp[-1].minor.yy544; } break; - case 140: /* full_table_name ::= table_name */ -{ yylhsminor.yy272 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy209, NULL); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 142: /* full_table_name ::= table_name */ +{ yylhsminor.yy840 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy617, NULL); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 141: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy272 = createRealTableNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209, NULL); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 143: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy840 = createRealTableNode(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617, NULL); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 144: /* column_def ::= column_name type_name */ -{ yylhsminor.yy272 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy209, yymsp[0].minor.yy616, NULL); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 146: /* column_def ::= column_name type_name */ +{ yylhsminor.yy840 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy617, yymsp[0].minor.yy784, NULL); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 145: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy272 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-2].minor.yy616, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 147: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy840 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy617, yymsp[-2].minor.yy784, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 146: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 148: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 147: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 149: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 148: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 150: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 149: /* type_name ::= INT */ - case 150: /* type_name ::= INTEGER */ yytestcase(yyruleno==150); -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_INT); } + case 151: /* type_name ::= INT */ + case 152: /* type_name ::= INTEGER */ yytestcase(yyruleno==152); +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 151: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 153: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 152: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 154: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 153: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 155: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 154: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy616 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 156: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 155: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 157: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 156: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy616 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 158: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 157: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy616 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 159: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 158: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy616 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 160: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 159: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy616 = createDataType(TSDB_DATA_TYPE_UINT); } + case 161: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 160: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy616 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 162: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy784 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 161: /* type_name ::= JSON */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_JSON); } + case 163: /* type_name ::= JSON */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 162: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy616 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 164: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 163: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 165: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 164: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 166: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 165: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy616 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 167: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy784 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 166: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy616 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 168: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 167: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy616 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 169: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 168: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy616 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 170: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy784 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 170: /* tags_def_opt ::= tags_def */ - case 371: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==371); -{ yylhsminor.yy172 = yymsp[0].minor.yy172; } - yymsp[0].minor.yy172 = yylhsminor.yy172; + case 172: /* tags_def_opt ::= tags_def */ + case 375: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==375); +{ yylhsminor.yy544 = yymsp[0].minor.yy544; } + yymsp[0].minor.yy544 = yylhsminor.yy544; break; - case 171: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy172 = yymsp[-1].minor.yy172; } + case 173: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy544 = yymsp[-1].minor.yy544; } break; - case 172: /* table_options ::= */ -{ yymsp[1].minor.yy272 = createDefaultTableOptions(pCxt); } + case 174: /* table_options ::= */ +{ yymsp[1].minor.yy840 = createDefaultTableOptions(pCxt); } break; - case 173: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-2].minor.yy272, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 175: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-2].minor.yy840, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 174: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-2].minor.yy272, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy172); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 176: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-2].minor.yy840, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy544); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 175: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-2].minor.yy272, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy172); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 177: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-2].minor.yy840, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy544); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 176: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-4].minor.yy272, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy172); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + case 178: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-4].minor.yy840, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy544); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 177: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-2].minor.yy272, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 179: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-2].minor.yy840, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 178: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-4].minor.yy272, TABLE_OPTION_SMA, yymsp[-1].minor.yy172); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + case 180: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-4].minor.yy840, TABLE_OPTION_SMA, yymsp[-1].minor.yy544); } + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 179: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy272 = createAlterTableOptions(pCxt); yylhsminor.yy272 = setTableOption(pCxt, yylhsminor.yy272, yymsp[0].minor.yy5.type, &yymsp[0].minor.yy5.val); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 181: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy840 = createAlterTableOptions(pCxt); yylhsminor.yy840 = setTableOption(pCxt, yylhsminor.yy840, yymsp[0].minor.yy95.type, &yymsp[0].minor.yy95.val); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 180: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy272 = setTableOption(pCxt, yymsp[-1].minor.yy272, yymsp[0].minor.yy5.type, &yymsp[0].minor.yy5.val); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 182: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy840 = setTableOption(pCxt, yymsp[-1].minor.yy840, yymsp[0].minor.yy95.type, &yymsp[0].minor.yy95.val); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 181: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy5.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } + case 183: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy95.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } break; - case 182: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy5.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy5.val = yymsp[0].minor.yy0; } + case 184: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy95.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy95.val = yymsp[0].minor.yy0; } break; - case 183: /* duration_list ::= duration_literal */ - case 338: /* expression_list ::= expression */ yytestcase(yyruleno==338); -{ yylhsminor.yy172 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272)); } - yymsp[0].minor.yy172 = yylhsminor.yy172; + case 185: /* duration_list ::= duration_literal */ + case 342: /* expression_list ::= expression */ yytestcase(yyruleno==342); +{ yylhsminor.yy544 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy840)); } + yymsp[0].minor.yy544 = yylhsminor.yy544; break; - case 184: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 339: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==339); -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-2].minor.yy172, releaseRawExprNode(pCxt, yymsp[0].minor.yy272)); } - yymsp[-2].minor.yy172 = yylhsminor.yy172; + case 186: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 343: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==343); +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-2].minor.yy544, releaseRawExprNode(pCxt, yymsp[0].minor.yy840)); } + yymsp[-2].minor.yy544 = yylhsminor.yy544; break; - case 187: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy272 = createFunctionNode(pCxt, &yymsp[0].minor.yy209, NULL); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 189: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy840 = createFunctionNode(pCxt, &yymsp[0].minor.yy617, NULL); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 188: /* rollup_func_name ::= FIRST */ - case 189: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==189); -{ yylhsminor.yy272 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 190: /* rollup_func_name ::= FIRST */ + case 191: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==191); +{ yylhsminor.yy840 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 192: /* col_name ::= column_name */ -{ yylhsminor.yy272 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy209); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 194: /* col_name ::= column_name */ +{ yylhsminor.yy840 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy617); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 193: /* cmd ::= SHOW DNODES */ + case 195: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 194: /* cmd ::= SHOW USERS */ + case 196: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 195: /* cmd ::= SHOW DATABASES */ + case 197: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 196: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy272, yymsp[0].minor.yy272, OP_TYPE_LIKE); } + case 198: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy840, yymsp[0].minor.yy840, OP_TYPE_LIKE); } break; - case 197: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy272, yymsp[0].minor.yy272, OP_TYPE_LIKE); } + case 199: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy840, yymsp[0].minor.yy840, OP_TYPE_LIKE); } break; - case 198: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy272, NULL, OP_TYPE_LIKE); } + case 200: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy840, NULL, OP_TYPE_LIKE); } break; - case 199: /* cmd ::= SHOW MNODES */ + case 201: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 200: /* cmd ::= SHOW MODULES */ + case 202: /* cmd ::= SHOW MODULES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } break; - case 201: /* cmd ::= SHOW QNODES */ + case 203: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 202: /* cmd ::= SHOW FUNCTIONS */ + case 204: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 203: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy272, yymsp[-1].minor.yy272, OP_TYPE_EQUAL); } + case 205: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy840, yymsp[-1].minor.yy840, OP_TYPE_EQUAL); } break; - case 204: /* cmd ::= SHOW STREAMS */ + case 206: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 205: /* cmd ::= SHOW ACCOUNTS */ + case 207: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 206: /* cmd ::= SHOW APPS */ + case 208: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 207: /* cmd ::= SHOW CONNECTIONS */ + case 209: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 208: /* cmd ::= SHOW LICENCES */ - case 209: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==209); + case 210: /* cmd ::= SHOW LICENCES */ + case 211: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==211); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 210: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy209); } + case 212: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy617); } break; - case 211: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy272); } + case 213: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy840); } break; - case 212: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy272); } + case 214: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy840); } break; - case 213: /* cmd ::= SHOW QUERIES */ + case 215: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 214: /* cmd ::= SHOW SCORES */ + case 216: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 215: /* cmd ::= SHOW TOPICS */ + case 217: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 216: /* cmd ::= SHOW VARIABLES */ + case 218: /* cmd ::= SHOW VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 217: /* cmd ::= SHOW LOCAL VARIABLES */ + case 219: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 218: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + case 220: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ { pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-1].minor.yy0)); } break; - case 219: /* cmd ::= SHOW BNODES */ + case 221: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 220: /* cmd ::= SHOW SNODES */ + case 222: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 221: /* cmd ::= SHOW CLUSTER */ + case 223: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 222: /* cmd ::= SHOW TRANSACTIONS */ + case 224: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 223: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy272); } + case 225: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy840); } break; - case 224: /* cmd ::= SHOW CONSUMERS */ + case 226: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 225: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 227: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 226: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy272, yymsp[-1].minor.yy272, OP_TYPE_EQUAL); } + case 228: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy840, yymsp[-1].minor.yy840, OP_TYPE_EQUAL); } break; - case 227: /* db_name_cond_opt ::= */ - case 232: /* from_db_opt ::= */ yytestcase(yyruleno==232); -{ yymsp[1].minor.yy272 = createDefaultDatabaseCondValue(pCxt); } + case 229: /* cmd ::= SHOW VNODES NK_INTEGER */ +{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 228: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy209); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 230: /* cmd ::= SHOW VNODES NK_STRING */ +{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 229: /* like_pattern_opt ::= */ - case 404: /* from_clause_opt ::= */ yytestcase(yyruleno==404); - case 433: /* where_clause_opt ::= */ yytestcase(yyruleno==433); - case 437: /* twindow_clause_opt ::= */ yytestcase(yyruleno==437); - case 442: /* sliding_opt ::= */ yytestcase(yyruleno==442); - case 444: /* fill_opt ::= */ yytestcase(yyruleno==444); - case 456: /* having_clause_opt ::= */ yytestcase(yyruleno==456); - case 458: /* range_opt ::= */ yytestcase(yyruleno==458); - case 460: /* every_opt ::= */ yytestcase(yyruleno==460); - case 470: /* slimit_clause_opt ::= */ yytestcase(yyruleno==470); - case 474: /* limit_clause_opt ::= */ yytestcase(yyruleno==474); -{ yymsp[1].minor.yy272 = NULL; } + case 231: /* db_name_cond_opt ::= */ + case 236: /* from_db_opt ::= */ yytestcase(yyruleno==236); +{ yymsp[1].minor.yy840 = createDefaultDatabaseCondValue(pCxt); } break; - case 230: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 232: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy617); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 231: /* table_name_cond ::= table_name */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy209); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 233: /* like_pattern_opt ::= */ + case 408: /* from_clause_opt ::= */ yytestcase(yyruleno==408); + case 437: /* where_clause_opt ::= */ yytestcase(yyruleno==437); + case 441: /* twindow_clause_opt ::= */ yytestcase(yyruleno==441); + case 446: /* sliding_opt ::= */ yytestcase(yyruleno==446); + case 448: /* fill_opt ::= */ yytestcase(yyruleno==448); + case 460: /* having_clause_opt ::= */ yytestcase(yyruleno==460); + case 462: /* range_opt ::= */ yytestcase(yyruleno==462); + case 464: /* every_opt ::= */ yytestcase(yyruleno==464); + case 474: /* slimit_clause_opt ::= */ yytestcase(yyruleno==474); + case 478: /* limit_clause_opt ::= */ yytestcase(yyruleno==478); +{ yymsp[1].minor.yy840 = NULL; } break; - case 233: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy209); } + case 234: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 234: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy293, yymsp[-3].minor.yy272, yymsp[-1].minor.yy272, NULL, yymsp[0].minor.yy272); } + case 235: /* table_name_cond ::= table_name */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy617); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 235: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy293, yymsp[0].minor.yy272); } + case 237: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy617); } break; - case 236: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy272 = createIndexOption(pCxt, yymsp[-7].minor.yy172, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), NULL, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 238: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy313, yymsp[-3].minor.yy840, yymsp[-1].minor.yy840, NULL, yymsp[0].minor.yy840); } break; - case 237: /* 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.yy272 = createIndexOption(pCxt, yymsp[-9].minor.yy172, releaseRawExprNode(pCxt, yymsp[-5].minor.yy272), releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 239: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy313, yymsp[0].minor.yy840); } break; - case 240: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy272 = createFunctionNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy172); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 240: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy840 = createIndexOption(pCxt, yymsp[-7].minor.yy544, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), NULL, yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 241: /* sma_stream_opt ::= */ - case 268: /* stream_options ::= */ yytestcase(yyruleno==268); -{ yymsp[1].minor.yy272 = createStreamOptions(pCxt); } + case 241: /* 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.yy840 = createIndexOption(pCxt, yymsp[-9].minor.yy544, releaseRawExprNode(pCxt, yymsp[-5].minor.yy840), releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 242: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 272: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==272); -{ ((SStreamOptions*)yymsp[-2].minor.yy272)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy272); yylhsminor.yy272 = yymsp[-2].minor.yy272; } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 244: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy840 = createFunctionNode(pCxt, &yymsp[-3].minor.yy617, yymsp[-1].minor.yy544); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 243: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy272)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy272); yylhsminor.yy272 = yymsp[-2].minor.yy272; } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 245: /* sma_stream_opt ::= */ + case 272: /* stream_options ::= */ yytestcase(yyruleno==272); +{ yymsp[1].minor.yy840 = createStreamOptions(pCxt); } break; - case 244: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy293, &yymsp[-2].minor.yy209, yymsp[0].minor.yy272); } + case 246: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ + case 276: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==276); +{ ((SStreamOptions*)yymsp[-2].minor.yy840)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy840); yylhsminor.yy840 = yymsp[-2].minor.yy840; } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 245: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy293, &yymsp[-3].minor.yy209, &yymsp[0].minor.yy209, false); } + case 247: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy840)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy840); yylhsminor.yy840 = yymsp[-2].minor.yy840; } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 246: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy293, &yymsp[-5].minor.yy209, &yymsp[0].minor.yy209, true); } + case 248: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy313, &yymsp[-2].minor.yy617, yymsp[0].minor.yy840); } break; - case 247: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy293, &yymsp[-3].minor.yy209, yymsp[0].minor.yy272, false); } + case 249: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy313, &yymsp[-3].minor.yy617, &yymsp[0].minor.yy617, false); } break; - case 248: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy293, &yymsp[-5].minor.yy209, yymsp[0].minor.yy272, true); } + case 250: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy313, &yymsp[-5].minor.yy617, &yymsp[0].minor.yy617, true); } break; - case 249: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy293, &yymsp[0].minor.yy209); } + case 251: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy313, &yymsp[-3].minor.yy617, yymsp[0].minor.yy840, false); } break; - case 250: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy293, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209); } + case 252: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy313, &yymsp[-5].minor.yy617, yymsp[0].minor.yy840, true); } break; - case 251: /* cmd ::= DESC full_table_name */ - case 252: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==252); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy272); } + case 253: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy313, &yymsp[0].minor.yy617); } break; - case 253: /* cmd ::= RESET QUERY CACHE */ + case 254: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy313, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617); } + break; + case 255: /* cmd ::= DESC full_table_name */ + case 256: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==256); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy840); } + break; + case 257: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 254: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy293, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 258: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy313, yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 256: /* analyze_opt ::= ANALYZE */ - case 263: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==263); - case 424: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==424); -{ yymsp[0].minor.yy293 = true; } + case 260: /* analyze_opt ::= ANALYZE */ + case 267: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==267); + case 428: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==428); +{ yymsp[0].minor.yy313 = true; } break; - case 257: /* explain_options ::= */ -{ yymsp[1].minor.yy272 = createDefaultExplainOptions(pCxt); } + case 261: /* explain_options ::= */ +{ yymsp[1].minor.yy840 = createDefaultExplainOptions(pCxt); } break; - case 258: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy272 = setExplainVerbose(pCxt, yymsp[-2].minor.yy272, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 262: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy840 = setExplainVerbose(pCxt, yymsp[-2].minor.yy840, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 259: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy272 = setExplainRatio(pCxt, yymsp[-2].minor.yy272, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 263: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy840 = setExplainRatio(pCxt, yymsp[-2].minor.yy840, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 260: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy293, yymsp[-8].minor.yy293, &yymsp[-5].minor.yy209, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy616, yymsp[0].minor.yy232); } + case 264: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy313, yymsp[-8].minor.yy313, &yymsp[-5].minor.yy617, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy784, yymsp[0].minor.yy844); } break; - case 261: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy293, &yymsp[0].minor.yy209); } + case 265: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy313, &yymsp[0].minor.yy617); } break; - case 264: /* bufsize_opt ::= */ -{ yymsp[1].minor.yy232 = 0; } + case 268: /* bufsize_opt ::= */ +{ yymsp[1].minor.yy844 = 0; } break; - case 265: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ -{ yymsp[-1].minor.yy232 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 269: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ +{ yymsp[-1].minor.yy844 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 266: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-6].minor.yy293, &yymsp[-5].minor.yy209, yymsp[-2].minor.yy272, yymsp[-4].minor.yy272, yymsp[0].minor.yy272); } + case 270: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name AS query_expression */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-6].minor.yy313, &yymsp[-5].minor.yy617, yymsp[-2].minor.yy840, yymsp[-4].minor.yy840, yymsp[0].minor.yy840); } break; - case 267: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy293, &yymsp[0].minor.yy209); } + case 271: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy313, &yymsp[0].minor.yy617); } break; - case 269: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy272)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy272 = yymsp[-2].minor.yy272; } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 273: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy840)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy840 = yymsp[-2].minor.yy840; } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 270: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy272)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy272 = yymsp[-2].minor.yy272; } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 274: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy840)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy840 = yymsp[-2].minor.yy840; } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 271: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy272)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy272)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy272); yylhsminor.yy272 = yymsp[-3].minor.yy272; } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 275: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy840)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy840)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy840); yylhsminor.yy840 = yymsp[-3].minor.yy840; } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 273: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy272)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy272 = yymsp[-3].minor.yy272; } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 277: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy840)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy840 = yymsp[-3].minor.yy840; } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 274: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 278: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 275: /* cmd ::= KILL QUERY NK_STRING */ + case 279: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 276: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 280: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 277: /* cmd ::= BALANCE VGROUP */ + case 281: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 278: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 282: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 279: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy172); } + case 283: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy544); } break; - case 280: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 284: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 281: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy172 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 285: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy544 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 283: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 287: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 285: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy272, yymsp[-2].minor.yy172, yymsp[0].minor.yy272); } + case 289: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_expression */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy840, yymsp[-2].minor.yy544, yymsp[0].minor.yy840); } break; - case 286: /* cmd ::= INSERT INTO full_table_name query_expression */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy272, NULL, yymsp[0].minor.yy272); } + case 290: /* cmd ::= INSERT INTO full_table_name query_expression */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy840, NULL, yymsp[0].minor.yy840); } break; - case 287: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 291: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 288: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 292: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 289: /* literal ::= NK_STRING */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 293: /* literal ::= NK_STRING */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 290: /* literal ::= NK_BOOL */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 294: /* literal ::= NK_BOOL */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 291: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 295: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 292: /* literal ::= duration_literal */ - case 302: /* signed_literal ::= signed */ yytestcase(yyruleno==302); - case 322: /* expression ::= literal */ yytestcase(yyruleno==322); - case 323: /* expression ::= pseudo_column */ yytestcase(yyruleno==323); - case 324: /* expression ::= column_reference */ yytestcase(yyruleno==324); - case 325: /* expression ::= function_expression */ yytestcase(yyruleno==325); - case 326: /* expression ::= subquery */ yytestcase(yyruleno==326); - case 354: /* function_expression ::= literal_func */ yytestcase(yyruleno==354); - case 396: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==396); - case 400: /* boolean_primary ::= predicate */ yytestcase(yyruleno==400); - case 402: /* common_expression ::= expression */ yytestcase(yyruleno==402); - case 403: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==403); - case 406: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==406); - case 408: /* table_reference ::= table_primary */ yytestcase(yyruleno==408); - case 409: /* table_reference ::= joined_table */ yytestcase(yyruleno==409); - case 413: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==413); - case 463: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==463); - case 466: /* query_primary ::= query_specification */ yytestcase(yyruleno==466); -{ yylhsminor.yy272 = yymsp[0].minor.yy272; } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 296: /* literal ::= duration_literal */ + case 306: /* signed_literal ::= signed */ yytestcase(yyruleno==306); + case 326: /* expression ::= literal */ yytestcase(yyruleno==326); + case 327: /* expression ::= pseudo_column */ yytestcase(yyruleno==327); + case 328: /* expression ::= column_reference */ yytestcase(yyruleno==328); + case 329: /* expression ::= function_expression */ yytestcase(yyruleno==329); + case 330: /* expression ::= subquery */ yytestcase(yyruleno==330); + case 358: /* function_expression ::= literal_func */ yytestcase(yyruleno==358); + case 400: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==400); + case 404: /* boolean_primary ::= predicate */ yytestcase(yyruleno==404); + case 406: /* common_expression ::= expression */ yytestcase(yyruleno==406); + case 407: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==407); + case 410: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==410); + case 412: /* table_reference ::= table_primary */ yytestcase(yyruleno==412); + case 413: /* table_reference ::= joined_table */ yytestcase(yyruleno==413); + case 417: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==417); + case 467: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==467); + case 470: /* query_primary ::= query_specification */ yytestcase(yyruleno==470); +{ yylhsminor.yy840 = yymsp[0].minor.yy840; } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 293: /* literal ::= NULL */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 297: /* literal ::= NULL */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 294: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 298: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 295: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 299: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 296: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 300: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 297: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 301: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 298: /* signed ::= NK_MINUS NK_INTEGER */ + case 302: /* 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.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 299: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 303: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 300: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 304: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 301: /* signed ::= NK_MINUS NK_FLOAT */ + case 305: /* 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.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 303: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 307: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 304: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 308: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 305: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 309: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 306: /* signed_literal ::= duration_literal */ - case 308: /* signed_literal ::= literal_func */ yytestcase(yyruleno==308); - case 374: /* star_func_para ::= expression */ yytestcase(yyruleno==374); - case 429: /* select_item ::= common_expression */ yytestcase(yyruleno==429); - case 479: /* search_condition ::= common_expression */ yytestcase(yyruleno==479); -{ yylhsminor.yy272 = releaseRawExprNode(pCxt, yymsp[0].minor.yy272); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 310: /* signed_literal ::= duration_literal */ + case 312: /* signed_literal ::= literal_func */ yytestcase(yyruleno==312); + case 378: /* star_func_para ::= expression */ yytestcase(yyruleno==378); + case 433: /* select_item ::= common_expression */ yytestcase(yyruleno==433); + case 483: /* search_condition ::= common_expression */ yytestcase(yyruleno==483); +{ yylhsminor.yy840 = releaseRawExprNode(pCxt, yymsp[0].minor.yy840); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 307: /* signed_literal ::= NULL */ -{ yylhsminor.yy272 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 311: /* signed_literal ::= NULL */ +{ yylhsminor.yy840 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 309: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy272 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 313: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy840 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 327: /* expression ::= NK_LP expression NK_RP */ - case 401: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==401); -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 331: /* expression ::= NK_LP expression NK_RP */ + case 405: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==405); +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy840)); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 328: /* expression ::= NK_PLUS expression */ + case 332: /* expression ::= NK_PLUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy272)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy840)); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 329: /* expression ::= NK_MINUS expression */ + case 333: /* expression ::= NK_MINUS expression */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy272), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy840), NULL)); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 330: /* expression ::= expression NK_PLUS expression */ + case 334: /* expression ::= expression NK_PLUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 331: /* expression ::= expression NK_MINUS expression */ + case 335: /* expression ::= expression NK_MINUS expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 332: /* expression ::= expression NK_STAR expression */ + case 336: /* expression ::= expression NK_STAR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 333: /* expression ::= expression NK_SLASH expression */ + case 337: /* expression ::= expression NK_SLASH expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 334: /* expression ::= expression NK_REM expression */ + case 338: /* expression ::= expression NK_REM expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 335: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 339: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 336: /* expression ::= expression NK_BITAND expression */ + case 340: /* expression ::= expression NK_BITAND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 337: /* expression ::= expression NK_BITOR expression */ + case 341: /* expression ::= expression NK_BITOR expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 340: /* column_reference ::= column_name */ -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy209, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy209)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 344: /* column_reference ::= column_name */ +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy617, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy617)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 341: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209, createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 345: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617, createColumnNode(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy617)); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 342: /* pseudo_column ::= ROWTS */ - case 343: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==343); - case 345: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==345); - case 346: /* pseudo_column ::= QEND */ yytestcase(yyruleno==346); - case 347: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==347); - case 348: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==348); - case 349: /* pseudo_column ::= WEND */ yytestcase(yyruleno==349); - case 350: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==350); - case 356: /* literal_func ::= NOW */ yytestcase(yyruleno==356); -{ yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 346: /* pseudo_column ::= ROWTS */ + case 347: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==347); + case 349: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==349); + case 350: /* pseudo_column ::= QEND */ yytestcase(yyruleno==350); + case 351: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==351); + case 352: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==352); + case 353: /* pseudo_column ::= WEND */ yytestcase(yyruleno==353); + case 354: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==354); + case 360: /* literal_func ::= NOW */ yytestcase(yyruleno==360); +{ yylhsminor.yy840 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 344: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy209)))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 348: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy617)))); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 351: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 352: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==352); -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy172)); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 355: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 356: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==356); +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy617, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy617, yymsp[-1].minor.yy544)); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 353: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), yymsp[-1].minor.yy616)); } - yymsp[-5].minor.yy272 = yylhsminor.yy272; + case 357: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), yymsp[-1].minor.yy784)); } + yymsp[-5].minor.yy840 = yylhsminor.yy840; break; - case 355: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy209, NULL)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 359: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy617, NULL)); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 370: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy172 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy172 = yylhsminor.yy172; + case 374: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy544 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy544 = yylhsminor.yy544; break; - case 375: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 432: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==432); -{ yylhsminor.yy272 = createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 379: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 436: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==436); +{ yylhsminor.yy840 = createColumnNode(pCxt, &yymsp[-2].minor.yy617, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 376: /* predicate ::= expression compare_op expression */ - case 381: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==381); + case 380: /* predicate ::= expression compare_op expression */ + case 385: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==385); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy392, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy198, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 377: /* predicate ::= expression BETWEEN expression AND expression */ + case 381: /* predicate ::= expression BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy272), releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy840), releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-4].minor.yy272 = yylhsminor.yy272; + yymsp[-4].minor.yy840 = yylhsminor.yy840; break; - case 378: /* predicate ::= expression NOT BETWEEN expression AND expression */ + case 382: /* predicate ::= expression NOT BETWEEN expression AND expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy272), releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy840), releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-5].minor.yy272 = yylhsminor.yy272; + yymsp[-5].minor.yy840 = yylhsminor.yy840; break; - case 379: /* predicate ::= expression IS NULL */ + case 383: /* predicate ::= expression IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), NULL)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 380: /* predicate ::= expression IS NOT NULL */ + case 384: /* predicate ::= expression IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), NULL)); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 382: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy392 = OP_TYPE_LOWER_THAN; } + case 386: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy198 = OP_TYPE_LOWER_THAN; } break; - case 383: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy392 = OP_TYPE_GREATER_THAN; } + case 387: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy198 = OP_TYPE_GREATER_THAN; } break; - case 384: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy392 = OP_TYPE_LOWER_EQUAL; } + case 388: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy198 = OP_TYPE_LOWER_EQUAL; } break; - case 385: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy392 = OP_TYPE_GREATER_EQUAL; } + case 389: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy198 = OP_TYPE_GREATER_EQUAL; } break; - case 386: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy392 = OP_TYPE_NOT_EQUAL; } + case 390: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy198 = OP_TYPE_NOT_EQUAL; } break; - case 387: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy392 = OP_TYPE_EQUAL; } + case 391: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy198 = OP_TYPE_EQUAL; } break; - case 388: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy392 = OP_TYPE_LIKE; } + case 392: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy198 = OP_TYPE_LIKE; } break; - case 389: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy392 = OP_TYPE_NOT_LIKE; } + case 393: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy198 = OP_TYPE_NOT_LIKE; } break; - case 390: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy392 = OP_TYPE_MATCH; } + case 394: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy198 = OP_TYPE_MATCH; } break; - case 391: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy392 = OP_TYPE_NMATCH; } + case 395: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy198 = OP_TYPE_NMATCH; } break; - case 392: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy392 = OP_TYPE_JSON_CONTAINS; } + case 396: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy198 = OP_TYPE_JSON_CONTAINS; } break; - case 393: /* in_op ::= IN */ -{ yymsp[0].minor.yy392 = OP_TYPE_IN; } + case 397: /* in_op ::= IN */ +{ yymsp[0].minor.yy198 = OP_TYPE_IN; } break; - case 394: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy392 = OP_TYPE_NOT_IN; } + case 398: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy198 = OP_TYPE_NOT_IN; } break; - case 395: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy172)); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 399: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy544)); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 397: /* boolean_value_expression ::= NOT boolean_primary */ + case 401: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy272), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy840), NULL)); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 398: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 402: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 399: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 403: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272); - yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy840); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy840); + yylhsminor.yy840 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 405: /* from_clause_opt ::= FROM table_reference_list */ - case 434: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==434); - case 457: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==457); -{ yymsp[-1].minor.yy272 = yymsp[0].minor.yy272; } + case 409: /* from_clause_opt ::= FROM table_reference_list */ + case 438: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==438); + case 461: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==461); +{ yymsp[-1].minor.yy840 = yymsp[0].minor.yy840; } break; - case 407: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy272 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy272, yymsp[0].minor.yy272, NULL); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 411: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy840 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy840, yymsp[0].minor.yy840, NULL); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 410: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy272 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 414: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy840 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy617, &yymsp[0].minor.yy617); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 411: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy272 = createRealTableNode(pCxt, &yymsp[-3].minor.yy209, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 415: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy840 = createRealTableNode(pCxt, &yymsp[-3].minor.yy617, &yymsp[-1].minor.yy617, &yymsp[0].minor.yy617); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 412: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy272 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272), &yymsp[0].minor.yy209); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 416: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy840 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy840), &yymsp[0].minor.yy617); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 414: /* alias_opt ::= */ -{ yymsp[1].minor.yy209 = nil_token; } + case 418: /* alias_opt ::= */ +{ yymsp[1].minor.yy617 = nil_token; } break; - case 415: /* alias_opt ::= table_alias */ -{ yylhsminor.yy209 = yymsp[0].minor.yy209; } - yymsp[0].minor.yy209 = yylhsminor.yy209; + case 419: /* alias_opt ::= table_alias */ +{ yylhsminor.yy617 = yymsp[0].minor.yy617; } + yymsp[0].minor.yy617 = yylhsminor.yy617; break; - case 416: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy209 = yymsp[0].minor.yy209; } + case 420: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy617 = yymsp[0].minor.yy617; } break; - case 417: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 418: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==418); -{ yymsp[-2].minor.yy272 = yymsp[-1].minor.yy272; } + case 421: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 422: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==422); +{ yymsp[-2].minor.yy840 = yymsp[-1].minor.yy840; } break; - case 419: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy272 = createJoinTableNode(pCxt, yymsp[-4].minor.yy156, yymsp[-5].minor.yy272, yymsp[-2].minor.yy272, yymsp[0].minor.yy272); } - yymsp[-5].minor.yy272 = yylhsminor.yy272; + case 423: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy840 = createJoinTableNode(pCxt, yymsp[-4].minor.yy708, yymsp[-5].minor.yy840, yymsp[-2].minor.yy840, yymsp[0].minor.yy840); } + yymsp[-5].minor.yy840 = yylhsminor.yy840; break; - case 420: /* join_type ::= */ -{ yymsp[1].minor.yy156 = JOIN_TYPE_INNER; } + case 424: /* join_type ::= */ +{ yymsp[1].minor.yy708 = JOIN_TYPE_INNER; } break; - case 421: /* join_type ::= INNER */ -{ yymsp[0].minor.yy156 = JOIN_TYPE_INNER; } + case 425: /* join_type ::= INNER */ +{ yymsp[0].minor.yy708 = JOIN_TYPE_INNER; } break; - case 422: /* query_specification ::= SELECT set_quantifier_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 426: /* query_specification ::= SELECT set_quantifier_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[-11].minor.yy272 = createSelectStmt(pCxt, yymsp[-10].minor.yy293, yymsp[-9].minor.yy172, yymsp[-8].minor.yy272); - yymsp[-11].minor.yy272 = addWhereClause(pCxt, yymsp[-11].minor.yy272, yymsp[-7].minor.yy272); - yymsp[-11].minor.yy272 = addPartitionByClause(pCxt, yymsp[-11].minor.yy272, yymsp[-6].minor.yy172); - yymsp[-11].minor.yy272 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy272, yymsp[-2].minor.yy272); - yymsp[-11].minor.yy272 = addGroupByClause(pCxt, yymsp[-11].minor.yy272, yymsp[-1].minor.yy172); - yymsp[-11].minor.yy272 = addHavingClause(pCxt, yymsp[-11].minor.yy272, yymsp[0].minor.yy272); - yymsp[-11].minor.yy272 = addRangeClause(pCxt, yymsp[-11].minor.yy272, yymsp[-5].minor.yy272); - yymsp[-11].minor.yy272 = addEveryClause(pCxt, yymsp[-11].minor.yy272, yymsp[-4].minor.yy272); - yymsp[-11].minor.yy272 = addFillClause(pCxt, yymsp[-11].minor.yy272, yymsp[-3].minor.yy272); + yymsp[-11].minor.yy840 = createSelectStmt(pCxt, yymsp[-10].minor.yy313, yymsp[-9].minor.yy544, yymsp[-8].minor.yy840); + yymsp[-11].minor.yy840 = addWhereClause(pCxt, yymsp[-11].minor.yy840, yymsp[-7].minor.yy840); + yymsp[-11].minor.yy840 = addPartitionByClause(pCxt, yymsp[-11].minor.yy840, yymsp[-6].minor.yy544); + yymsp[-11].minor.yy840 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy840, yymsp[-2].minor.yy840); + yymsp[-11].minor.yy840 = addGroupByClause(pCxt, yymsp[-11].minor.yy840, yymsp[-1].minor.yy544); + yymsp[-11].minor.yy840 = addHavingClause(pCxt, yymsp[-11].minor.yy840, yymsp[0].minor.yy840); + yymsp[-11].minor.yy840 = addRangeClause(pCxt, yymsp[-11].minor.yy840, yymsp[-5].minor.yy840); + yymsp[-11].minor.yy840 = addEveryClause(pCxt, yymsp[-11].minor.yy840, yymsp[-4].minor.yy840); + yymsp[-11].minor.yy840 = addFillClause(pCxt, yymsp[-11].minor.yy840, yymsp[-3].minor.yy840); } break; - case 425: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy293 = false; } + case 429: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy313 = false; } break; - case 428: /* select_item ::= NK_STAR */ -{ yylhsminor.yy272 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy272 = yylhsminor.yy272; + case 432: /* select_item ::= NK_STAR */ +{ yylhsminor.yy840 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy840 = yylhsminor.yy840; break; - case 430: /* select_item ::= common_expression column_alias */ -{ yylhsminor.yy272 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272), &yymsp[0].minor.yy209); } - yymsp[-1].minor.yy272 = yylhsminor.yy272; + case 434: /* select_item ::= common_expression column_alias */ +{ yylhsminor.yy840 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy840), &yymsp[0].minor.yy617); } + yymsp[-1].minor.yy840 = yylhsminor.yy840; break; - case 431: /* select_item ::= common_expression AS column_alias */ -{ yylhsminor.yy272 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), &yymsp[0].minor.yy209); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 435: /* select_item ::= common_expression AS column_alias */ +{ yylhsminor.yy840 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), &yymsp[0].minor.yy617); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 436: /* partition_by_clause_opt ::= PARTITION BY expression_list */ - case 453: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==453); - case 469: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==469); -{ yymsp[-2].minor.yy172 = yymsp[0].minor.yy172; } + case 440: /* partition_by_clause_opt ::= PARTITION BY expression_list */ + case 457: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==457); + case 473: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==473); +{ yymsp[-2].minor.yy544 = yymsp[0].minor.yy544; } break; - case 438: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy272 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); } + case 442: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy840 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), releaseRawExprNode(pCxt, yymsp[-1].minor.yy840)); } break; - case 439: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ -{ yymsp[-3].minor.yy272 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); } + case 443: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */ +{ yymsp[-3].minor.yy840 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy840)); } break; - case 440: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy272 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), NULL, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 444: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy840 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), NULL, yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 441: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy272 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy272), releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), yymsp[-1].minor.yy272, yymsp[0].minor.yy272); } + case 445: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy840 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy840), releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), yymsp[-1].minor.yy840, yymsp[0].minor.yy840); } break; - case 443: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - case 461: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==461); -{ yymsp[-3].minor.yy272 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy272); } + case 447: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + case 465: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==465); +{ yymsp[-3].minor.yy840 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy840); } break; - case 445: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy272 = createFillNode(pCxt, yymsp[-1].minor.yy186, NULL); } + case 449: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy840 = createFillNode(pCxt, yymsp[-1].minor.yy816, NULL); } break; - case 446: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy272 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy172)); } + case 450: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy840 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy544)); } break; - case 447: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy186 = FILL_MODE_NONE; } + case 451: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy816 = FILL_MODE_NONE; } break; - case 448: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy186 = FILL_MODE_PREV; } + case 452: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy816 = FILL_MODE_PREV; } break; - case 449: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy186 = FILL_MODE_NULL; } + case 453: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy816 = FILL_MODE_NULL; } break; - case 450: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy186 = FILL_MODE_LINEAR; } + case 454: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy816 = FILL_MODE_LINEAR; } break; - case 451: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy186 = FILL_MODE_NEXT; } + case 455: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy816 = FILL_MODE_NEXT; } break; - case 454: /* group_by_list ::= expression */ -{ yylhsminor.yy172 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); } - yymsp[0].minor.yy172 = yylhsminor.yy172; + case 458: /* group_by_list ::= expression */ +{ yylhsminor.yy544 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } + yymsp[0].minor.yy544 = yylhsminor.yy544; break; - case 455: /* group_by_list ::= group_by_list NK_COMMA expression */ -{ yylhsminor.yy172 = addNodeToList(pCxt, yymsp[-2].minor.yy172, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); } - yymsp[-2].minor.yy172 = yylhsminor.yy172; + case 459: /* group_by_list ::= group_by_list NK_COMMA expression */ +{ yylhsminor.yy544 = addNodeToList(pCxt, yymsp[-2].minor.yy544, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy840))); } + yymsp[-2].minor.yy544 = yylhsminor.yy544; break; - case 459: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ -{ yymsp[-5].minor.yy272 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); } + case 463: /* range_opt ::= RANGE NK_LP expression NK_COMMA expression NK_RP */ +{ yymsp[-5].minor.yy840 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy840), releaseRawExprNode(pCxt, yymsp[-1].minor.yy840)); } break; - case 462: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 466: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy272 = addOrderByClause(pCxt, yymsp[-3].minor.yy272, yymsp[-2].minor.yy172); - yylhsminor.yy272 = addSlimitClause(pCxt, yylhsminor.yy272, yymsp[-1].minor.yy272); - yylhsminor.yy272 = addLimitClause(pCxt, yylhsminor.yy272, yymsp[0].minor.yy272); + yylhsminor.yy840 = addOrderByClause(pCxt, yymsp[-3].minor.yy840, yymsp[-2].minor.yy544); + yylhsminor.yy840 = addSlimitClause(pCxt, yylhsminor.yy840, yymsp[-1].minor.yy840); + yylhsminor.yy840 = addLimitClause(pCxt, yylhsminor.yy840, yymsp[0].minor.yy840); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 464: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ -{ yylhsminor.yy272 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy272, yymsp[0].minor.yy272); } - yymsp[-3].minor.yy272 = yylhsminor.yy272; + case 468: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */ +{ yylhsminor.yy840 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy840, yymsp[0].minor.yy840); } + yymsp[-3].minor.yy840 = yylhsminor.yy840; break; - case 465: /* query_expression_body ::= query_expression_body UNION query_expression_body */ -{ yylhsminor.yy272 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy272, yymsp[0].minor.yy272); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 469: /* query_expression_body ::= query_expression_body UNION query_expression_body */ +{ yylhsminor.yy840 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy840, yymsp[0].minor.yy840); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 467: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ + case 471: /* query_primary ::= NK_LP query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt NK_RP */ { - yymsp[-5].minor.yy272 = addOrderByClause(pCxt, yymsp[-4].minor.yy272, yymsp[-3].minor.yy172); - yymsp[-5].minor.yy272 = addSlimitClause(pCxt, yymsp[-5].minor.yy272, yymsp[-2].minor.yy272); - yymsp[-5].minor.yy272 = addLimitClause(pCxt, yymsp[-5].minor.yy272, yymsp[-1].minor.yy272); + yymsp[-5].minor.yy840 = addOrderByClause(pCxt, yymsp[-4].minor.yy840, yymsp[-3].minor.yy544); + yymsp[-5].minor.yy840 = addSlimitClause(pCxt, yymsp[-5].minor.yy840, yymsp[-2].minor.yy840); + yymsp[-5].minor.yy840 = addLimitClause(pCxt, yymsp[-5].minor.yy840, yymsp[-1].minor.yy840); } break; - case 471: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 475: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==475); -{ yymsp[-1].minor.yy272 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 475: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 479: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==479); +{ yymsp[-1].minor.yy840 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 472: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 476: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==476); -{ yymsp[-3].minor.yy272 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 476: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 480: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==480); +{ yymsp[-3].minor.yy840 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 473: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 477: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==477); -{ yymsp[-3].minor.yy272 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 477: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 481: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==481); +{ yymsp[-3].minor.yy840 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 478: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy272); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 482: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy840 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy840); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 482: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy272 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), yymsp[-1].minor.yy818, yymsp[0].minor.yy493); } - yymsp[-2].minor.yy272 = yylhsminor.yy272; + case 486: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy840 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy840), yymsp[-1].minor.yy204, yymsp[0].minor.yy277); } + yymsp[-2].minor.yy840 = yylhsminor.yy840; break; - case 483: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy818 = ORDER_ASC; } + case 487: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy204 = ORDER_ASC; } break; - case 484: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy818 = ORDER_ASC; } + case 488: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy204 = ORDER_ASC; } break; - case 485: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy818 = ORDER_DESC; } + case 489: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy204 = ORDER_DESC; } break; - case 486: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy493 = NULL_ORDER_DEFAULT; } + case 490: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy277 = NULL_ORDER_DEFAULT; } break; - case 487: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy493 = NULL_ORDER_FIRST; } + case 491: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy277 = NULL_ORDER_FIRST; } break; - case 488: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy493 = NULL_ORDER_LAST; } + case 492: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy277 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index cd7a9d549a..f84305193b 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -32,100 +32,59 @@ namespace { void generateInformationSchema(MockCatalogService* mcs) { - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODES, TSDB_SYSTEM_TABLE, 1) - .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MNODES, TSDB_SYSTEM_TABLE, 1) - .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MODULES, TSDB_SYSTEM_TABLE, 1) - .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_QNODES, TSDB_SYSTEM_TABLE, 1) - .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DATABASES, TSDB_SYSTEM_TABLE, 1) - .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_FUNCTIONS, TSDB_SYSTEM_TABLE, 1) - .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_FUNC_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_INDEXES, TSDB_SYSTEM_TABLE, 3) - .addColumn("index_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) - .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) - .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, TSDB_SYSTEM_TABLE, 2) - .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) - .addColumn("stable_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLES, TSDB_SYSTEM_TABLE, 2) - .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) - .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLE_DISTRIBUTED, TSDB_SYSTEM_TABLE, 1) - .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS, TSDB_SYSTEM_TABLE, 1) - .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_USER_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, TSDB_SYSTEM_TABLE, 1) - .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CONFIGS, TSDB_SYSTEM_TABLE, 1) - .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_CONFIG_OPTION_LEN); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODE_VARIABLES, TSDB_SYSTEM_TABLE, 1) - .addColumn("dnode_id", TSDB_DATA_TYPE_INT); - builder.done(); - } - { - ITableBuilder& builder = - mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, TSDB_SYSTEM_TABLE, 1) - .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_CLUSTER_ID_LEN); - builder.done(); - } + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODES, TSDB_SYSTEM_TABLE, 1) + .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MNODES, TSDB_SYSTEM_TABLE, 1) + .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MODULES, TSDB_SYSTEM_TABLE, 1) + .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_QNODES, TSDB_SYSTEM_TABLE, 1) + .addColumn("endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DATABASES, TSDB_SYSTEM_TABLE, 1) + .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_FUNCTIONS, TSDB_SYSTEM_TABLE, 1) + .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_FUNC_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_INDEXES, TSDB_SYSTEM_TABLE, 3) + .addColumn("index_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_STABLES, TSDB_SYSTEM_TABLE, 2) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .addColumn("stable_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLES, TSDB_SYSTEM_TABLE, 2) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_TABLE_DISTRIBUTED, TSDB_SYSTEM_TABLE, 1) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USERS, TSDB_SYSTEM_TABLE, 1) + .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_USER_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, TSDB_SYSTEM_TABLE, 1) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CONFIGS, TSDB_SYSTEM_TABLE, 1) + .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_CONFIG_OPTION_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODE_VARIABLES, TSDB_SYSTEM_TABLE, 1) + .addColumn("dnode_id", TSDB_DATA_TYPE_INT) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, TSDB_SYSTEM_TABLE, 1) + .addColumn("name", TSDB_DATA_TYPE_BINARY, TSDB_CLUSTER_ID_LEN) + .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VNODES, TSDB_SYSTEM_TABLE, 2) + .addColumn("dnode_id", TSDB_DATA_TYPE_INT) + .addColumn("dnode_endpoint", TSDB_DATA_TYPE_BINARY, TSDB_EP_LEN) + .done(); } void generatePerformanceSchema(MockCatalogService* mcs) { diff --git a/source/libs/parser/test/parAlterToBalanceTest.cpp b/source/libs/parser/test/parAlterToBalanceTest.cpp index 1caba6eab0..8eb64719b2 100644 --- a/source/libs/parser/test/parAlterToBalanceTest.cpp +++ b/source/libs/parser/test/parAlterToBalanceTest.cpp @@ -88,6 +88,7 @@ TEST_F(ParserInitialATest, alterDnode) { * | REPLICA int_value -- todo: enum 1, 3, default 1, unit replica * | STRICT {'off' | 'on'} -- todo: default 'off' * | WAL_LEVEL int_value -- enum 1, 2, default 1 + * | SST_TRIGGER int_value -- rang [1, 128], default 8 * } */ TEST_F(ParserInitialATest, alterDatabase) { @@ -112,6 +113,7 @@ TEST_F(ParserInitialATest, alterDatabase) { expect.cacheLast = -1; expect.cacheLastSize = -1; expect.replications = -1; + expect.sstTrigger = -1; }; auto setAlterDbBuffer = [&](int32_t buffer) { expect.buffer = buffer; }; auto setAlterDbPageSize = [&](int32_t pageSize) { expect.pageSize = pageSize; }; @@ -128,6 +130,7 @@ TEST_F(ParserInitialATest, alterDatabase) { auto setAlterDbStrict = [&](int8_t strict) { expect.strict = strict; }; auto setAlterDbCacheModel = [&](int8_t cacheModel) { expect.cacheLast = cacheModel; }; auto setAlterDbReplica = [&](int8_t replications) { expect.replications = replications; }; + auto setAlterDbSstTrigger = [&](int8_t sstTrigger) { expect.sstTrigger = sstTrigger; }; setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_ALTER_DATABASE_STMT); @@ -146,6 +149,7 @@ TEST_F(ParserInitialATest, alterDatabase) { ASSERT_EQ(req.strict, expect.strict); ASSERT_EQ(req.cacheLast, expect.cacheLast); ASSERT_EQ(req.replications, expect.replications); + ASSERT_EQ(req.sstTrigger, expect.sstTrigger); }); const int32_t MINUTE_PER_DAY = MILLISECOND_PER_DAY / MILLISECOND_PER_MINUTE; @@ -157,7 +161,8 @@ TEST_F(ParserInitialATest, alterDatabase) { setAlterDbFsync(200); setAlterDbWal(1); setAlterDbCacheModel(TSDB_CACHE_MODEL_LAST_ROW); - run("ALTER DATABASE test CACHEMODEL 'last_row' CACHESIZE 32 WAL_FSYNC_PERIOD 200 KEEP 10 WAL_LEVEL 1"); + setAlterDbSstTrigger(20); + run("ALTER DATABASE test CACHEMODEL 'last_row' CACHESIZE 32 WAL_FSYNC_PERIOD 200 KEEP 10 WAL_LEVEL 1 SST_TRIGGER 20"); clearAlterDbReq(); initAlterDb("test"); @@ -231,6 +236,8 @@ TEST_F(ParserInitialATest, alterDatabaseSemanticCheck) { run("ALTER DATABASE test KEEP 1w", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 0", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 3", TSDB_CODE_PAR_INVALID_DB_OPTION); + run("ALTER DATABASE test SST_TRIGGER 0", TSDB_CODE_PAR_INVALID_DB_OPTION); + run("ALTER DATABASE test SST_TRIGGER 129", TSDB_CODE_PAR_INVALID_DB_OPTION); // Regardless of the specific sentence run("ALTER DATABASE db WAL_LEVEL 0 # td-14436", TSDB_CODE_PAR_SYNTAX_ERROR, PARSER_STAGE_PARSE); } diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 68c4ac3706..d68adde86d 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -111,10 +111,11 @@ TEST_F(ParserInitialCTest, createDatabase) { expect.numOfVgroups = TSDB_DEFAULT_VN_PER_DB; expect.numOfStables = TSDB_DEFAULT_DB_SINGLE_STABLE; expect.schemaless = TSDB_DEFAULT_DB_SCHEMALESS; - expect.walRetentionPeriod = TSDB_DEFAULT_DB_WAL_RETENTION_PERIOD; - expect.walRetentionSize = TSDB_DEFAULT_DB_WAL_RETENTION_SIZE; - expect.walRollPeriod = TSDB_DEFAULT_DB_WAL_ROLL_PERIOD; + expect.walRetentionPeriod = TSDB_REP_DEF_DB_WAL_RET_PERIOD; + expect.walRetentionSize = TSDB_REP_DEF_DB_WAL_RET_SIZE; + expect.walRollPeriod = TSDB_REP_DEF_DB_WAL_ROLL_PERIOD; expect.walSegmentSize = TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE; + expect.sstTrigger = TSDB_DEFAULT_SST_TRIGGER; }; auto setDbBufferFunc = [&](int32_t buffer) { expect.buffer = buffer; }; @@ -155,6 +156,7 @@ TEST_F(ParserInitialCTest, createDatabase) { auto setDbWalRetentionSize = [&](int32_t walRetentionSize) { expect.walRetentionSize = walRetentionSize; }; auto setDbWalRollPeriod = [&](int32_t walRollPeriod) { expect.walRollPeriod = walRollPeriod; }; auto setDbWalSegmentSize = [&](int32_t walSegmentSize) { expect.walSegmentSize = walSegmentSize; }; + auto setDbSstTrigger = [&](int32_t sstTrigger) { expect.sstTrigger = sstTrigger; }; setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_DATABASE_STMT); @@ -185,7 +187,7 @@ TEST_F(ParserInitialCTest, createDatabase) { ASSERT_EQ(req.walRetentionSize, expect.walRetentionSize); ASSERT_EQ(req.walRollPeriod, expect.walRollPeriod); ASSERT_EQ(req.walSegmentSize, expect.walSegmentSize); - // ASSERT_EQ(req.schemaless, expect.schemaless); + ASSERT_EQ(req.sstTrigger, expect.sstTrigger); ASSERT_EQ(req.ignoreExist, expect.ignoreExist); ASSERT_EQ(req.numOfRetensions, expect.numOfRetensions); if (expect.numOfRetensions > 0) { @@ -233,6 +235,7 @@ TEST_F(ParserInitialCTest, createDatabase) { setDbWalRetentionSize(-1); setDbWalRollPeriod(10); setDbWalSegmentSize(20); + setDbSstTrigger(16); run("CREATE DATABASE IF NOT EXISTS wxy_db " "BUFFER 64 " "CACHEMODEL 'last_value' " @@ -256,7 +259,8 @@ TEST_F(ParserInitialCTest, createDatabase) { "WAL_RETENTION_PERIOD -1 " "WAL_RETENTION_SIZE -1 " "WAL_ROLL_PERIOD 10 " - "WAL_SEGMENT_SIZE 20"); + "WAL_SEGMENT_SIZE 20 " + "SST_TRIGGER 16"); clearCreateDbReq(); setCreateDbReqFunc("wxy_db", 1); @@ -266,6 +270,14 @@ TEST_F(ParserInitialCTest, createDatabase) { "DURATION 100m " "KEEP 1440m,300h,400d "); clearCreateDbReq(); + + setCreateDbReqFunc("wxy_db", 1); + setDbReplicaFunc(3); + setDbWalRetentionPeriod(TSDB_REPS_DEF_DB_WAL_RET_PERIOD); + setDbWalRetentionSize(TSDB_REPS_DEF_DB_WAL_RET_SIZE); + setDbWalRollPeriod(TSDB_REPS_DEF_DB_WAL_ROLL_PERIOD); + run("CREATE DATABASE IF NOT EXISTS wxy_db REPLICA 3"); + clearCreateDbReq(); } TEST_F(ParserInitialCTest, createDatabaseSemanticCheck) { diff --git a/source/libs/parser/test/parShowToUse.cpp b/source/libs/parser/test/parShowToUse.cpp index 6590378565..e33252c072 100644 --- a/source/libs/parser/test/parShowToUse.cpp +++ b/source/libs/parser/test/parShowToUse.cpp @@ -218,7 +218,13 @@ TEST_F(ParserShowToUseTest, showVgroups) { run("SHOW test.vgroups"); } -// todo SHOW vnodes +TEST_F(ParserShowToUseTest, showVnodes) { + useDb("root", "test"); + + run("SHOW VNODES 1"); + + run("SHOW VNODES 'node1:7030'"); +} TEST_F(ParserShowToUseTest, splitVgroup) { useDb("root", "test"); diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index c2f1d71b18..b160f45479 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -16,6 +16,7 @@ #include "filter.h" #include "functionMgt.h" #include "planInt.h" +#include "tglobal.h" #include "ttime.h" #define OPTIMIZE_FLAG_MASK(n) (1 << n) @@ -2410,7 +2411,7 @@ static const SOptimizeRule optimizeRuleSet[] = { static const int32_t optimizeRuleNum = (sizeof(optimizeRuleSet) / sizeof(SOptimizeRule)); static void dumpLogicSubplan(const char* pRuleName, SLogicSubplan* pSubplan) { - if (0 == (qDebugFlag & DEBUG_DEBUG)) { + if (!tsQueryPlannerTrace) { return; } char* pStr = NULL; diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index cafae18dbe..0cbb833a4d 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1324,7 +1324,8 @@ static int32_t createSortPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren static int32_t createPartitionPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SPartitionLogicNode* pPartLogicNode, SPhysiNode** pPhyNode) { SPartitionPhysiNode* pPart = - (SPartitionPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pPartLogicNode, QUERY_NODE_PHYSICAL_PLAN_PARTITION); + (SPartitionPhysiNode*)makePhysiNode(pCxt, (SLogicNode*)pPartLogicNode, + pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION : QUERY_NODE_PHYSICAL_PLAN_PARTITION); if (NULL == pPart) { return TSDB_CODE_OUT_OF_MEMORY; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index c582994b7c..beb938b161 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -1427,7 +1427,7 @@ static const SSplitRule splitRuleSet[] = { static const int32_t splitRuleNum = (sizeof(splitRuleSet) / sizeof(SSplitRule)); static void dumpLogicSubplan(const char* pRuleName, SLogicSubplan* pSubplan) { - if (0 == (qDebugFlag & DEBUG_DEBUG)) { + if (!tsQueryPlannerTrace) { return; } char* pStr = NULL; diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index c1296982e0..baa1d1074c 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -17,9 +17,10 @@ #include "planInt.h" #include "scalar.h" +#include "tglobal.h" static void dumpQueryPlan(SQueryPlan* pPlan) { - if (0 == (qDebugFlag & DEBUG_DEBUG)) { + if (!tsQueryPlannerTrace) { return; } char* pStr = NULL; diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index d053662bd3..332f7ad2fd 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -170,8 +170,17 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { if (ts < maxTs - pInfo->watermark) { // this window has been closed. if (pInfo->pCloseWinSBF) { - return tScalableBfPut(pInfo->pCloseWinSBF, &ts, sizeof(TSKEY)); + res = tScalableBfPut(pInfo->pCloseWinSBF, &ts, sizeof(TSKEY)); + if (res == TSDB_CODE_SUCCESS) { + return false; + } else { + qDebug("===stream===Update close window sbf. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, + maxTs, *pMapMaxTs, ts); + return true; + } } + qDebug("===stream===Update close window. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, + maxTs, *pMapMaxTs, ts); return true; } @@ -193,7 +202,7 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { } if (ts < pInfo->minTS) { - qDebug("===stream===Update. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, + qDebug("===stream===Update min ts. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, maxTs, *pMapMaxTs, ts); return true; } else if (res == TSDB_CODE_SUCCESS) { diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 41688c7330..4b5441f738 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1304,11 +1304,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pTransInst->cfp(pTransInst->parent, pResp, NULL); return 0; } - /* - * no retry - * 1. query conn - * 2. rpc thread already receive quit msg - */ + STransConnCtx* pCtx = pMsg->ctx; int32_t code = pResp->code; diff --git a/source/os/src/osDir.c b/source/os/src/osDir.c index 30aaa01dae..3dfb1458ad 100644 --- a/source/os/src/osDir.c +++ b/source/os/src/osDir.c @@ -160,6 +160,66 @@ int32_t taosMulMkDir(const char *dirname) { return code; } +int32_t taosMulModeMkDir(const char *dirname, int mode) { + if (dirname == NULL) return -1; + char temp[1024]; + char *pos = temp; + int32_t code = 0; +#ifdef WINDOWS + taosRealPath(dirname, temp, sizeof(temp)); + if (temp[1] == ':') pos += 3; +#else + strcpy(temp, dirname); +#endif + + if (taosDirExist(temp)) { + chmod(temp, mode); + return code; + } + + if (strncmp(temp, TD_DIRSEP, 1) == 0) { + pos += 1; + } else if (strncmp(temp, "." TD_DIRSEP, 2) == 0) { + pos += 2; + } + + for (; *pos != '\0'; pos++) { + if (*pos == TD_DIRSEP[0]) { + *pos = '\0'; +#ifdef WINDOWS + code = _mkdir(temp, mode); +#else + code = mkdir(temp, mode); +#endif + if (code < 0 && errno != EEXIST) { + terrno = TAOS_SYSTEM_ERROR(errno); + return code; + } + *pos = TD_DIRSEP[0]; + } + } + + if (*(pos - 1) != TD_DIRSEP[0]) { +#ifdef WINDOWS + code = _mkdir(temp, mode); +#else + code = mkdir(temp, mode); +#endif + if (code < 0 && errno != EEXIST) { + terrno = TAOS_SYSTEM_ERROR(errno); + return code; + } + } + + if (code < 0 && errno == EEXIST) { + chmod(temp, mode); + return 0; + } + + chmod(temp, mode); + return code; +} + void taosRemoveOldFiles(const char *dirname, int32_t keepDays) { TdDirPtr pDir = taosOpenDir(dirname); if (pDir == NULL) return; diff --git a/tests/pytest/tools/taosdumpTest2.py b/tests/pytest/tools/taosdumpTest2.py index 7071adb3a9..8a85ce10ed 100644 --- a/tests/pytest/tools/taosdumpTest2.py +++ b/tests/pytest/tools/taosdumpTest2.py @@ -134,7 +134,6 @@ class TDTestCase: os.system("%s -i ./taosdumptest/tmp -y" % binPath) tdSql.execute("use test") - tdSql.error("show vnodes '' ") tdSql.query("show stables") tdSql.checkRows(1) tdSql.checkData(0, 0, 'stb') diff --git a/tests/script/tsim/db/basic1.sim b/tests/script/tsim/db/basic1.sim index 69eeb9347b..3f6bf05398 100644 --- a/tests/script/tsim/db/basic1.sim +++ b/tests/script/tsim/db/basic1.sim @@ -107,6 +107,37 @@ if $data30 != 12 then return -1 endi +print =============== show vnodes +sql show vnodes 1 +if $rows != 9 then + return -1 +endi + +if $data(4)[1] != 1 then + return -1 +endi + +if $data(4)[2] != leader then + return -1 +endi + +if $data(4)[3] != d2 then + return -1 +endi + +if $data(4)[4] != 1 then + return -1 +endi + +if $data(4)[5] != localhost:7100 then + return -1 +endi + +#sql show vnodes 'localhost:7100' +#if $rows != 9 then +# return -1 +#endi + print =============== drop database sql drop database d2 sql drop database d3 diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim index 5392979c0a..d9777d5133 100644 --- a/tests/script/tsim/stream/basic1.sim +++ b/tests/script/tsim/stream/basic1.sim @@ -462,10 +462,10 @@ if $data25 != 3 then return -1 endi -sql create database test2 vgroups 1 -sql select * from information_schema.ins_databases +sql create database test2 vgroups 1; +sql select * from information_schema.ins_databases; -sql use test2 +sql use test2; sql create stable st(ts timestamp, a int, b int, c int, d double) 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); diff --git a/tests/script/tsim/stream/partitionbyColumn0.sim b/tests/script/tsim/stream/partitionbyColumn0.sim new file mode 100644 index 0000000000..d91d4b7bf0 --- /dev/null +++ b/tests/script/tsim/stream/partitionbyColumn0.sim @@ -0,0 +1,570 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop database if exists test; +sql create database test vgroups 1; +sql use test; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a interval(10s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); + +$loop_count = 0 + +loop0: +sleep 100 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop0 +endi + +if $data02 != NULL then + print =====data02=$data02 + goto loop0 +endi + + +sql insert into t1 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 + +loop1: +sleep 100 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop1 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); + +$loop_count = 0 + +loop2: +sleep 100 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop2 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop2 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791213001,2,2,3,1.0); +sql insert into t1 values(1648791213002,2,2,3,1.0); +sql insert into t1 values(1648791213002,1,2,3,1.0); + +$loop_count = 0 + +loop3: +sleep 100 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop3 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop3 +endi + +if $data11 != 2 then + print =====data11=$data11 + goto loop3 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop3 +endi + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791223002,3,2,3,1.0); +sql insert into t1 values(1648791223003,3,2,3,1.0); +sql insert into t1 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); + +$loop_count = 0 + +loop4: +sleep 100 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop4 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop4 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop4 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop4 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop4 +endi + +if $data22 != 1 then + print =====data22=$data22 + goto loop4 +endi + +if $data31 != 1 then + print =====data31=$data31 + goto loop4 +endi + +if $data32 != 2 then + print =====data32=$data32 + goto loop4 +endi + +if $data41 != 1 then + print =====data41=$data41 + goto loop4 +endi + +if $data42 != 3 then + print =====data42=$data42 + goto loop4 +endi + +sql drop stream if exists streams1; +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b interval(10s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,1,2,1,1.0); +sql insert into t1 values(1648791213001,2,1,2,2.0); +sql insert into t1 values(1648791213001,1,2,3,2.0); + +$loop_count = 0 + +loop5: +sleep 100 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop5 +endi + +sql insert into t1 values(1648791223000,1,2,4,2.0); +sql insert into t1 values(1648791223001,1,2,5,2.0); +sql insert into t1 values(1648791223002,1,2,5,2.0); +sql insert into t1 values(1648791213001,1,1,6,2.0) (1648791223002,1,1,7,2.0); + +$loop_count = 0 + +loop6: +sleep 100 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop6 +endi + +if $data02 != 6 then + print =====data02=$data02 + goto loop6 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop6 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop6 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop6 +endi + +if $data22 != 7 then + print =====data22=$data22 + goto loop6 +endi + +if $data31 != 2 then + print =====data31=$data31 + goto loop6 +endi + +if $data32 != 5 then + print =====data32=$data32 + goto loop6 +endi + +sql drop stream if exists streams2; +sql drop database if exists test2; +sql create database test2 vgroups 4; +sql use test2; +sql create stable st(ts timestamp, a int, b int, c int, d double) 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 streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL); + +$loop_count = 0 + +loop7: +sleep 100 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop7 +endi + +if $data02 != NULL then + print =====data02=$data02 + goto loop7 +endi + +sql insert into t1 values(1648791213000,1,2,3,1.0); +sql insert into t2 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 + +loop8: +sleep 100 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop8 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop8 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); + +$loop_count = 0 + +loop9: +sleep 100 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop9 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop9 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791213001,2,2,3,1.0); +sql insert into t1 values(1648791213002,2,2,3,1.0); +sql insert into t1 values(1648791213002,1,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213001,2,2,3,1.0); +sql insert into t2 values(1648791213002,2,2,3,1.0); +sql insert into t2 values(1648791213002,1,2,3,1.0); + +$loop_count = 0 + +loop10: +sleep 100 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop10 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop10 +endi + +if $data11 != 4 thenloop4 + print =====data11=$data11 + goto loop10 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop10 +endi + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791223002,3,2,3,1.0); +sql insert into t1 values(1648791223003,3,2,3,1.0); +sql insert into t1 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); +sql insert into t2 values(1648791223000,1,2,3,1.0); +sql insert into t2 values(1648791223001,1,2,3,1.0); +sql insert into t2 values(1648791223002,3,2,3,1.0); +sql insert into t2 values(1648791223003,3,2,3,1.0); +sql insert into t2 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); + +$loop_count = 0 + +loop11: +sleep 100 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop11 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop11 +endi + +if $data11 != 4 then + print =====data11=$data11 + goto loop11 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop11 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop11 +endi + +if $data22 != 2 then + print =====data22=$data22 + goto loop11 +endi + +if $data31 != 2 then + print =====data31=$data31 + goto loop11 +endi + +if $data32 != 3 then + print =====data32=$data32 + goto loop11 +endi + +if $data41 != 4 then + print =====data41=$data41 + goto loop11 +endi + +if $data42 != 1 then + print =====data42=$data42 + goto loop11 +endi + +sql drop stream if exists streams4; +sql drop database if exists test4; +sql create database test4 vgroups 4; +sql use test4; +sql create stable st(ts timestamp, a int, b int, c int, d double) 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 table t3 using st tags(2,2,2); +sql create table t4 using st tags(2,2,2); +sql create stream streams4 trigger at_once into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a interval(10s); + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +sql insert into t3 values(1648791213000,2,2,3,1.0); +sql insert into t4 values(1648791213000,2,2,3,1.0); +sql insert into t4 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 + +loop13: +sleep 100 +sql select * from test.streamt4 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows + goto loop13 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop13 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop13 +endi + +if $data11 != 3 then + print =====data11=$data11 + goto loop13 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop13 +endi + +sql insert into t4 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791233000,2,2,3,1.0); + + +sql insert into t1 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 + +loop14: +sleep 100 +sql select * from test.streamt4 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 20 then + return -1 +endi + +if $rows != 3 then + print =====rows=$rows + goto loop14 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop14 +endi + +if $data11 != 3 then + print =====data11=$data11 + goto loop14 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop14 +endi + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +system sh/stop_dnodes.sh + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/partitionbyColumn1.sim b/tests/script/tsim/stream/partitionbyColumn1.sim new file mode 100644 index 0000000000..7f5c53ebe3 --- /dev/null +++ b/tests/script/tsim/stream/partitionbyColumn1.sim @@ -0,0 +1,546 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +sql drop stream if exists streams0; +sql drop stream if exists streams1; +sql drop stream if exists streams2; +sql drop stream if exists streams3; +sql drop stream if exists streams4; +sql drop database if exists test; +sql create database test vgroups 1; +sql use test; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a session(ts, 5s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); + +$loop_count = 0 + +loop0: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop0 +endi + +if $data02 != NULL then + print =====data02=$data02 + goto loop0 +endi + + +sql insert into t1 values(1648791213000,1,2,3,1.0); + +loop1: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop1 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); + +loop2: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop2 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop2 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791213001,2,2,3,1.0); +sql insert into t1 values(1648791213002,2,2,3,1.0); +sql insert into t1 values(1648791213002,1,2,3,1.0); + +loop3: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop3 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop3 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop3 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop3 +endi + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791223002,3,2,3,1.0); +sql insert into t1 values(1648791223003,3,2,3,1.0); +sql insert into t1 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); + +loop4: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop4 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop4 +endi + +if $data11 != 2 then + print =====data11=$data11 + goto loop4 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop4 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop4 +endi + +if $data22 != 1 then + print =====data22=$data22 + goto loop4 +endi + +if $data31 != 1 then + print =====data31=$data31 + goto loop4 +endi + +if $data32 != 2 then + print =====data32=$data32 + goto loop4 +endi + +if $data41 != 1 then + print =====data41=$data41 + goto loop4 +endi + +if $data42 != 3 then + print =====data42=$data42 + goto loop4 +endi + +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(c) c3, _group_key(a+b) c4 from t1 partition by a+b session(ts, 5s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,1,2,1,1.0); +sql insert into t1 values(1648791213001,2,1,2,2.0); +sql insert into t1 values(1648791213001,1,2,3,2.0); + +$loop_count = 0 + +loop5: +sleep 300 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop5 +endi + +sql insert into t1 values(1648791223000,1,2,4,2.0); +sql insert into t1 values(1648791223001,1,2,5,2.0); +sql insert into t1 values(1648791223002,1,2,5,2.0); +sql insert into t1 values(1648791213001,1,1,6,2.0) (1648791223002,1,1,7,2.0); + +loop6: +sleep 300 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop6 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop6 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop6 +endi + +if $data12 != 6 then + print =====data12=$data12 + goto loop6 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop6 +endi + +if $data22 != 5 then + print =====data22=$data22 + goto loop6 +endi + +if $data31 != 1 then + print =====data31=$data31 + goto loop6 +endi + +if $data32 != 7 then + print =====data32=$data32 + goto loop6 +endi + +sql drop database if exists test2; +sql create database test2 vgroups 4; +sql use test2; +sql create stable st(ts timestamp, a int, b int, c int, d double) 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 streams2 trigger at_once into test.streamt2 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t2 values(1648791213000,NULL,NULL,NULL,NULL); + +$loop_count = 0 + +loop7: +sleep 300 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop7 +endi + +if $data02 != NULL then + print =====data02=$data02 + goto loop7 +endi + +sql insert into t1 values(1648791213000,1,2,3,1.0); +sql insert into t2 values(1648791213000,1,2,3,1.0); + +loop8: +sleep 300 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop8 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop8 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +loop9: +sleep 300 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop9 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop9 +endi + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791213001,2,2,3,1.0); +sql insert into t1 values(1648791213002,2,2,3,1.0); +sql insert into t1 values(1648791213002,1,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213001,2,2,3,1.0); +sql insert into t2 values(1648791213002,2,2,3,1.0); +sql insert into t2 values(1648791213002,1,2,3,1.0); + +loop10: +sleep 300 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 4 then + print =====data01=$data01 + goto loop10 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop10 +endi + +if $data11 != 2 thenloop4 + print =====data11=$data11 + goto loop3 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop10 +endi + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791223002,3,2,3,1.0); +sql insert into t1 values(1648791223003,3,2,3,1.0); +sql insert into t1 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); +sql insert into t2 values(1648791223000,1,2,3,1.0); +sql insert into t2 values(1648791223001,1,2,3,1.0); +sql insert into t2 values(1648791223002,3,2,3,1.0); +sql insert into t2 values(1648791223003,3,2,3,1.0); +sql insert into t2 values(1648791213001,1,2,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); + +loop11: +sleep 300 +sql select * from test.streamt2 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop11 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop11 +endi + +if $data11 != 4 then + print =====data11=$data11 + goto loop11 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop11 +endi + +if $data21 != 4 then + print =====data21=$data21 + goto loop11 +endi + +if $data22 != 1 then + print =====data22=$data22 + goto loop11 +endi + +if $data31 != 2 then + print =====data31=$data31 + goto loop11 +endi + +if $data32 != 2 then + print =====data32=$data32 + goto loop11 +endi + +if $data41 != 2 then + print =====data41=$data41 + goto loop11 +endi + +if $data42 != 3 then + print =====data42=$data42 + goto loop11 +endi + +sql drop database if exists test4; +sql create database test4 vgroups 4; +sql use test4; +sql create stable st(ts timestamp, a int, b int, c int, d double) 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 table t3 using st tags(2,2,2); +sql create table t4 using st tags(2,2,2); +sql create stream streams4 trigger at_once into test.streamt4 as select _wstart c1, count(*) c2, max(a) c3 from st partition by a session(ts, 5s); + +sql insert into t1 values(1648791213000,2,2,3,1.0); +sql insert into t2 values(1648791213000,2,2,3,1.0); +sql insert into t3 values(1648791213000,2,2,3,1.0); +sql insert into t4 values(1648791213000,2,2,3,1.0); +sql insert into t4 values(1648791213000,1,2,3,1.0); + +$loop_count = 0 + +loop13: +sleep 300 +sql select * from test.streamt4 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows + goto loop14 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop13 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop13 +endi + +if $data11 != 3 then + print =====data11=$data11 + goto loop11 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop11 +endi + +sql insert into t4 values(1648791213000,2,2,3,1.0); +sql insert into t1 values(1648791233000,2,2,3,1.0); + + +sql insert into t1 values(1648791213000,1,2,3,1.0); + +loop14: +sleep 300 +sql select * from test.streamt4 order by c1, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 3 then + print =====rows=$rows + goto loop14 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop14 +endi + +if $data11 != 3 then + print =====data11=$data11 + goto loop14 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop14 +endi + +system sh/stop_dnodes.sh + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +#goto looptest \ No newline at end of file diff --git a/tests/script/tsim/stream/partitionbyColumn2.sim b/tests/script/tsim/stream/partitionbyColumn2.sim new file mode 100644 index 0000000000..3d9acbcac5 --- /dev/null +++ b/tests/script/tsim/stream/partitionbyColumn2.sim @@ -0,0 +1,269 @@ +$loop_all = 0 +looptest: + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +sql drop database if exists test; +sql create database test vgroups 1; +sql use test; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams0 trigger at_once into streamt as select _wstart c1, count(*) c2, max(a) c3, _group_key(a) c4 from t1 partition by a state_window(b); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); + +$loop_count = 0 + +loop0: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop0 +endi + +if $data02 != NULL then + print =====data02=$data02 + goto loop0 +endi + + +sql insert into t1 values(1648791213000,1,1,3,1.0); + +loop1: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop1 +endi + +sql insert into t1 values(1648791213000,2,1,3,1.0); + +loop2: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop2 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop2 +endi + +sql insert into t1 values(1648791213000,2,1,3,1.0); +sql insert into t1 values(1648791213001,2,1,3,1.0); +sql insert into t1 values(1648791213002,2,1,3,1.0); +sql insert into t1 values(1648791213002,1,1,3,1.0); + +loop3: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop3 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop3 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop3 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop3 +endi + +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791223002,3,2,3,1.0); +sql insert into t1 values(1648791223003,3,2,3,1.0); +sql insert into t1 values(1648791213001,1,1,3,1.0) (1648791223001,2,2,3,1.0) (1648791223003,1,2,3,1.0); + +loop4: +sleep 300 +sql select * from streamt order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop4 +endi + +if $data02 != 2 then + print =====data02=$data02 + goto loop4 +endi + +if $data11 != 2 then + print =====data11=$data11 + goto loop4 +endi + +if $data12 != 1 then + print =====data12=$data12 + goto loop4 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop4 +endi + +if $data22 != 1 then + print =====data22=$data22 + goto loop4 +endi + +if $data31 != 1 then + print =====data31=$data31 + goto loop4 +endi + +if $data32 != 2 then + print =====data32=$data32 + goto loop4 +endi + +if $data41 != 1 then + print =====data41=$data41 + goto loop4 +endi + +if $data42 != 3 then + print =====data42=$data42 + goto loop4 +endi + +sql drop database if exists test1; +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d int); +sql create stream streams1 trigger at_once into streamt1 as select _wstart c1, count(*) c2, max(d) c3, _group_key(a+b) c4 from t1 partition by a+b state_window(c); + +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,NULL,NULL,NULL,NULL); +sql insert into t1 values(1648791213000,1,2,1,1); +sql insert into t1 values(1648791213001,2,1,1,2); +sql insert into t1 values(1648791213001,1,2,1,3); + +$loop_count = 0 + +loop5: +sleep 300 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop5 +endi + +sql insert into t1 values(1648791223000,1,2,2,4); +sql insert into t1 values(1648791223001,1,2,2,5); +sql insert into t1 values(1648791223002,1,2,2,6); +sql insert into t1 values(1648791213001,1,1,1,7) (1648791223002,1,1,2,8); + +loop6: +sleep 300 +sql select * from streamt1 order by c1, c4, c2, c3; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop6 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop6 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop6 +endi + +if $data12 != 7 then + print =====data12=$data12 + goto loop6 +endi + +if $data21 != 2 then + print =====data21=$data21 + goto loop6 +endi + +if $data22 != 5 then + print =====data22=$data22 + goto loop6 +endi + +if $data31 != 1 then + print =====data31=$data31 + goto loop6 +endi + +if $data32 != 8 then + print =====data32=$data32 + goto loop6 +endi + +system sh/stop_dnodes.sh + +$loop_all = $loop_all + 1 +print ============loop_all=$loop_all + +#goto looptest diff --git a/tests/system-test/0-others/user_control.py b/tests/system-test/0-others/user_control.py index 3be59f0adf..a20b7b17bc 100644 --- a/tests/system-test/0-others/user_control.py +++ b/tests/system-test/0-others/user_control.py @@ -282,12 +282,12 @@ class TDTestCase: use.error(f"insert into {DBNAME}.{CTBNAME} (ts) values (now())") elif check_priv == PRIVILEGES_WRITE: use.query(f"use {DBNAME}") - use.query(f"show {DBNAME}.tables") + use.error(f"show {DBNAME}.tables") use.error(f"select * from {DBNAME}.{CTBNAME}") use.query(f"insert into {DBNAME}.{CTBNAME} (ts) values (now())") elif check_priv is None: use.error(f"use {DBNAME}") - # use.error(f"show {DBNAME}.tables") + use.error(f"show {DBNAME}.tables") use.error(f"show tables") use.error(f"select * from {DBNAME}.{CTBNAME}") use.error(f"insert into {DBNAME}.{CTBNAME} (ts) values (now())")