diff --git a/docs/en/14-reference/03-taos-sql/03-table.md b/docs/en/14-reference/03-taos-sql/03-table.md index 47a56d3175..561f479aa3 100644 --- a/docs/en/14-reference/03-taos-sql/03-table.md +++ b/docs/en/14-reference/03-taos-sql/03-table.md @@ -25,7 +25,7 @@ create_definition: col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... diff --git a/docs/en/14-reference/03-taos-sql/04-stable.md b/docs/en/14-reference/03-taos-sql/04-stable.md index e7101eaba6..ea8fb42956 100644 --- a/docs/en/14-reference/03-taos-sql/04-stable.md +++ b/docs/en/14-reference/03-taos-sql/04-stable.md @@ -13,7 +13,7 @@ create_definition: col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... diff --git a/docs/en/14-reference/03-taos-sql/32-view.md b/docs/en/14-reference/03-taos-sql/32-view.md new file mode 100644 index 0000000000..2eb31724a2 --- /dev/null +++ b/docs/en/14-reference/03-taos-sql/32-view.md @@ -0,0 +1,149 @@ +--- +toc_max_heading_level: 4 +title: "View" +sidebar_label: "View" +--- + +## Introduction + +Starting from TDengine 3.2.1.0, TDengine Enterprise Edition provides view function, which is convenient for users to simplify operation and improve sharing ability among users. + +A view is essentially a query statement stored in a database. The view (non-materialized view) itself does not contain data, and only dynamically executes the query statement specified by the view when reading data from the view. We specify a name when creating a view, and then we can query it like using a regular table. The use of views should follow the following rules: +- Views can be defined and used nested, and are bound to the specified or current database when created. +- Within the same database, duplicate view names are not allowed, and it is recommended not to have duplicate view names and table names (not mandatory). When the view and table names have the same name, operations such as writing, querying, authorizing, and revoking permissions will prioritize using the same-named table. + + + +## Grammar + +### Create (update) view + +```sql +CREATE [ OR REPLACE ] VIEW [db_name.]view_name AS query +``` + +Description: +- When creating a view, you can specify the database name ( db_name ) to which the view is bound. If not explicitly specified, it defaults to the database bound to the current connection. +- It is recommended to specify the database name in the query statement, support cross-database views, and default to the database bound to the view when not specified (it may not be the database specified by the current connection); + +### View View + +1. View all views under a database + +```sql +SHOW [db_name.]VIEWS; +``` + +2. View the creation statement of the view + +```sql +SHOW CREATE VIEW [db_name.]view_name; +``` + +3. View view column information + +```sql +DESCRIBE [db_name.]view_name; +``` + +4. View all view information + +```sql +SELECT ... FROM information_schema.ins_views; +``` + +### Delete a view + +```sql +DROP VIEW [IF EXISTS] [db_name.]view_name; +``` + +## Permissions + +### Description +View permissions are divided into three types: READ, WRITE, and ALTER. Query operations require READ permissions, write operations require WRITE permissions, and delete and modify operations on the view itself require ALTER permissions. + +### Rules +- The creator of the view and the root user have all permissions by default. +- Authorization and revocation of permissions for other users can be performed through the GRANT and REVOKE statements, which can only be performed by the root user. +- View permissions need to be authorized and revoked separately. Authorization and revocation through db. * do not include view permissions. +- Views can be defined and used nested, and the verification of view permissions is also performed by recursion. +- In order to facilitate the sharing and use of views, the concept of view effective user (i.e. the user who creates the view) is introduced. Authorized users can use the read and write permissions of the view effective user's library, table, and nested view. Note: After the view is REPLACE, the effective user will also be updated. + +The detailed rules for controlling relevant permissions are summarized as follows: + +| Serial number | Operation | Permission requirements | +| --- | --- | --- | +| 1 | CREATE OR REPLACE VIEW (Create a new view) | The user has WRITE permission on the database to which the view belongs And Users have query permissions for the target library, table, and view of the view. If the object in the query is a view, it must meet rule 8 in the current table. | +| 2 | CREATE OR REPLACE VIEW (Overwrite old view) | The user has WRITE permission on the database to which the view belongs, and ALTER permission on the old view And Users have query permissions for the target library, table, and view of the view. If the object in the query is a view, it must meet rule 8 in the current table. | +| 3 | DROP VIEW | The user has ALTER permission on the view | +| 4 | SHOW VIEWS | No | +| 5 | SHOW CREATE VIEW | No | +| 6 | DESCRIBE VIEW | No | +| 7 | System table query | No | +| 8 | SELECT FROM VIEW | The operating user has READ permissions for the view And Operating users or view effective users have READ permissions on the target library, table, and view of the view | +| 9 | INSERT INTO VIEW | The operation user has WRITE permission on the view And Operating users or view effective users have WRITE permissions on the target library, table, and view of the view | +| 10 | GRANT/REVOKE | Only the root user has permission | + + +### Grammar + +#### Authorization + +```sql +GRANT privileges ON [db_name.]view_name TO user_name +privileges: { + ALL, + | priv_type [, priv_type] ... +} +priv_type: { + READ + | WRITE + | ALTER +} +``` + +#### Recover permissions + +```sql +REVOKE privileges ON [db_name.]view_name FROM user_name +privileges: { + ALL, + | priv_type [, priv_type] ... +} +priv_type: { + READ + | WRITE + | ALTER +} +``` + +## Usage scenarios + +| SQL query | SQL write | STMT query | STMT write | Subscribe | Stream | +| --- | --- | --- | --- | --- | --- | +| Support | Not supported yet | Not supported yet | Not supported yet | Support | Not supported yet | + + + +## Example + +- Create a view + +```sql +CREATE VIEW view1 AS SELECT _wstart, count(*) FROM table1 INTERVAL(1d); +CREATE VIEW view2 AS SELECT ts, col2 FROM table1; +CREATE VIEW view3 AS SELECT * from view1; +``` + +- Query data + +```sql +SELECT * from view1; +``` + +- Delete data + +```sql +DROP VIEW view1; +``` diff --git a/docs/zh/02-concept.md b/docs/zh/02-concept.md index d793d11c36..353775e5a7 100644 --- a/docs/zh/02-concept.md +++ b/docs/zh/02-concept.md @@ -91,7 +91,7 @@ toc_max_heading_level: 4 5. 对于小数据量场景,私有化部署太重:在物联网、车联网场景中,因为涉及到生产经营数据的安全,很多还是采取私有化部署。而每个私有化部署,处理的数据量有很大的区别,从几百台联网设备到数千万台设备不等。对于数据量小的场景,通用的大数据解决方案就显得过于臃肿,投入产出不成正比。因此有的平台提供商往往有两套方案,一套针对大数据场景,使用通用的大数据平台,一套针对小数据规模场景,就使用 MySQL 或其他数据库来搞定一切,但是随着历史数据的累积,或接入设备量的增长,关系型数据库性能不足、运维复杂、扩展性差等缺点都会逐渐暴露出来,终究不是长久之计。 -由于存在这些根本性的缺陷,导致高速增长的时序大数据市场一直没有一个简单好用而又高效的工具。于是,近些年一批专注时序数据处理的企业杀入了这个赛道,比如美国的 InfluxData,其产品 InfluxDB 在 IT 运维监测方面有相当的市场占有率。开源社区也十分活跃,比如基于 HBase 开发的 OpenTSDB,中国国内,阿里、百度、华为都有基于 OpenTSDB 的产品,涛思数据不依赖任何第三方,推出了自主研发而且开源的的 TDengine。 +由于存在这些根本性的缺陷,导致高速增长的时序大数据市场一直没有一个简单好用而又高效的工具。于是,近些年一批专注时序数据处理的企业杀入了这个赛道,比如美国的 InfluxData,其产品 InfluxDB 在 IT 运维监测方面有相当的市场占有率。开源社区也十分活跃,比如基于 HBase 开发的 OpenTSDB,中国国内,阿里、百度、华为都有基于 OpenTSDB 的产品,涛思数据不依赖任何第三方,推出了自主研发而且开源的 TDengine。 由于数据量巨大且应用方式特殊,对时序数据的处理具有相当大的技术挑战,因此要使用专业的大数据平台。对实时时序数据的科学合理地高效处理能够帮助企业实时监控生产与经营过程,对历史时序数据的分析有助于对资源的使用和生产配置做出科学的决策。 diff --git a/docs/zh/03-intro.md b/docs/zh/03-intro.md index 47d00cf01a..0167f9323b 100644 --- a/docs/zh/03-intro.md +++ b/docs/zh/03-intro.md @@ -24,11 +24,11 @@ TDengine 经过特别优化,以适应时间序列数据的独特需求,引 1. 写入数据:TDengine 支持多种数据写入方式。首先,它完全兼容 SQL,允许用户使用标准的 SQL 语法进行数据写入。而且 TDengine 还支持无模式(Schemaless)写入,包括流行的 InfluxDB Line 协议、OpenTSDB 的 Telnet 和 JSON 协议,这些协议的加入使得数据的导入变得更加灵活和高效。更进一步,TDengine 与众多第三方工具实现了无缝集成,例如 Telegraf、Prometheus、EMQX、StatsD、collectd 和 HiveMQ 等。在 TDengine Enterprise 中, 还提供了 MQTT、OPC-UA、OPC-DA、PI、Wonderware、Kafka、InfluxDB、OpenTSDB、MySQL、Oracle 和 SQL Server 等连接器。这些工具通过简单的配置,无需一行代码,就可以将来自各种数据源的数据源源不断的写入数据库,极大地简化了数据收集和存储的过程。 -2. 查询数据:TDengine 提供标准的 SQL 查询语法,并针对时序数据和业务的特点优化和新增了许多语法和功能,例如降采样、插值、累计求和、时间加权平均、状态窗口、时间窗口、会话窗口、滑动窗口等。TDengine 还支持用户自定义函数(UDF) +2. 查询数据:TDengine 提供标准的 SQL 查询语法,并针对时序数据和业务的特点优化和新增了许多语法和功能,例如降采样、插值、累计求和、时间加权平均、状态窗口、时间窗口、会话窗口、滑动窗口等。TDengine 还支持用户自定义函数(UDF)。 3. 缓存:TDengine 使用时间驱动缓存管理策略(First-In-First-Out,FIFO),将最近到达的(当前状态)数据保存在缓存中,这样便于获取任何监测对象的实时状态,而无需使用 Redis 等其他缓存工具,简化系统架构和运营成本。 -4. 流式计算:TDengine 流式计算引擎提供了实时处理写入的数据流的能力,不仅支持连续查询,还支持事件驱动的流式计算。它提供了替代复杂流处理系统的轻量级解决方案,并能够在高吞吐的数据写入的情况下,提供毫秒级的计算结果延迟 +4. 流式计算:TDengine 流式计算引擎提供了实时处理写入的数据流的能力,不仅支持连续查询,还支持事件驱动的流式计算。它提供了替代复杂流处理系统的轻量级解决方案,并能够在高吞吐的数据写入的情况下,提供毫秒级的计算结果延迟。 5. 数据订阅:TDengine 提供了类似 Kafka 的数据订阅功能。但用户可以通过 SQL 来灵活控制订阅的数据内容,并使用 Kafka 相同的 API 来订阅一张表、一组表、全部列或部分列、甚至整个数据库的数据。TDengine 可以替代需要集成消息队列产品的场景, 从而简化系统设计的复杂度,降低运营维护成本。 @@ -38,13 +38,13 @@ TDengine 经过特别优化,以适应时间序列数据的独特需求,引 8. 数据迁移:TDengine 提供了多种便捷的数据导入导出功能,包括脚本文件导入导出、数据文件导入导出、taosdump 工具导入导出等。 -9. 编程连接器:TDengine 提供不同语言的连接器,包括 C/C++、Java、Go、Node.js、Rust、Python、C#、R、PHP 等。这些连接器大多都支持原生连接和 WebSocket 两种连接方式。TDengine 也提供 REST 接口,任何语言的应用程序可以直接通过 HTTP 请求访问数据库。 +9. 编程连接器:TDengine 提供不同语言的连接器,包括 C/C++、Java、Go、Node.js、Rust、Python、C#、R、PHP 等。这些连接器大多都支持原生连接和 WebSocket 两种连接方式。TDengine 也提供 RESTful 接口,任何语言的应用程序可以直接通过 HTTP 请求访问数据库。 10. 数据安全:TDengine 提供了丰富的用户管理和权限管理功能以控制不同用户对数据库和表的访问权限,提供了 IP 白名单功能以控制不同帐号只能从特定的服务器接入集群。TDengine 支持系统管理员对不同数据库按需加密,数据加密后对读写完全透明且对性能的影响很小。还提供了审计日志功能以记录系统中的敏感操作。 11. 常用工具:TDengine 还提供了交互式命令行程序(CLI),便于管理集群、检查系统状态、做即时查询。压力测试工具 taosBenchmark,用于测试 TDengine 的性能。TDengine 还提供了图形化管理界面,简化了操作和管理过程。 -12. 零代码数据接入:TDengine 企业版提供了丰富的数据接入功能,依托强大的数据接入平台,无需一行代码,只需要做简单的配置即可实现多种数据源的数据接入,目前已经支持的数据源包括:OPC UA, OPC DA, Pi, MQTT, Kafka, InfluxDB, OpenTSDB, MySql, SQL Server, Oracle, Wonderware Historian, MongoDB。 +12. 零代码数据接入:TDengine 企业版提供了丰富的数据接入功能,依托强大的数据接入平台,无需一行代码,只需要做简单的配置即可实现多种数据源的数据接入,目前已经支持的数据源包括:OPC-UA、OPC-DA、PI、MQTT、Kafka、InfluxDB、OpenTSDB、MySQL、SQL Server、Oracle、Wonderware Historian、MongoDB。 ## TDengine 与典型时序数据库的区别 @@ -58,16 +58,14 @@ TDengine 经过特别优化,以适应时间序列数据的独特需求,引 4. 强大的分析能力:TDengine 不仅支持标准 SQL 查询,还为时序数据特有的分析提供了 SQL 扩展。通过超级表、存储计算分离、分区分片、预计算、UDF 等先进技术,TDengine 展现出强大的数据分析能力。 -5. 简单易用:TDengine 安装无依赖,集群部署仅需几秒即可完成。它提供了 REST ful接口和多种编程语言的连接器,与众多第三方工具无缝集成。此外,命令行程序和丰富的运维工具也极大地方便了用户的管理和即时查询需求。 +5. 简单易用:TDengine 安装无依赖,集群部署仅需几秒即可完成。它提供了 RESTful 接口和多种编程语言的连接器,与众多第三方工具无缝集成。此外,命令行程序和丰富的运维工具也极大地方便了用户的管理和即时查询需求。 -6. 核心开源:TDengine 的核心代码,包括集群功能,均在开源协议下公开发布。它在GitHub 网站全球趋势排行榜上多次位居榜首,显示出其受欢迎程度。同时,TDengine -拥有一个活跃的开发者社区,为技术的持续发展和创新提供了有力支持。 +6. 核心开源:TDengine 的核心代码,包括集群功能,均在开源协议下公开发布。它在 GitHub 网站全球趋势排行榜上多次位居榜首,显示出其受欢迎程度。同时,TDengine 拥有一个活跃的开发者社区,为技术的持续发展和创新提供了有力支持。 采用 TDengine,企业可以在物联网、车联网、工业互联网等典型场景中显著降低大数据平台的总拥有成本,主要体现在以下几个方面: 1. 高性能带来的成本节约:TDengine 卓越的写入、查询和存储性能意味着系统所需的计算资源和存储资源可以大幅度减少。这不仅降低了硬件成本,还减少了能源消耗和维护费用。 2. 标准化与兼容性带来的成本效益:由于 TDengine 支持标准 SQL,并与众多第三方软件实现了无缝集成,用户可以轻松地将现有系统迁移到 TDengine 上,无须重写大量代码。这种标准化和兼容性大大降低了学习和迁移成本,缩短了项目周期。 -3. 简化系统架构带来的成本降低:作为一个极简的时序数据平台,TDengine 集成了消息队列、缓存、流计算等必要功能,避免了额外集成众多其他组件的需要。这 -种简化的系统架构显著降低了系统的复杂度,从而减少了研发和运营成本,提高了整体运营效率。 +3. 简化系统架构带来的成本降低:作为一个极简的时序数据平台,TDengine 集成了消息队列、缓存、流计算等必要功能,避免了额外集成众多其他组件的需要。这种简化的系统架构显著降低了系统的复杂度,从而减少了研发和运营成本,提高了整体运营效率。 ## 技术生态 diff --git a/docs/zh/04-get-started/03-package.md b/docs/zh/04-get-started/03-package.md index 4906a2fcfa..7df41af831 100644 --- a/docs/zh/04-get-started/03-package.md +++ b/docs/zh/04-get-started/03-package.md @@ -146,7 +146,7 @@ Note: 从 3.0.1.7 开始,只提供 TDengine 客户端的 Windows 客户端的 :::info -下载其他组件、最新 Beta 版及之前版本的安装包,请点击[发布历史页面](../../releases/tdengine)。 +下载其他组件、最新 Beta 版及之前版本的安装包,请点击[发布历史页面](https://docs.taosdata.com/releases/tdengine/)。 ::: :::note diff --git a/docs/zh/07-operation/04-maintenance.md b/docs/zh/07-operation/04-maintenance.md index 3c02e4dd39..88122fed69 100644 --- a/docs/zh/07-operation/04-maintenance.md +++ b/docs/zh/07-operation/04-maintenance.md @@ -4,8 +4,6 @@ title: 集群维护 sidebar_label: 集群维护 --- -## 简介 - 本节介绍 TDengine Enterprise 中提供的高阶集群维护手段,能够使 TDengine 集群长期运行得更健壮和高效。 ## 节点管理 diff --git a/docs/zh/07-operation/18-dual.md b/docs/zh/07-operation/18-dual.md index 9de6a75b18..354e715602 100644 --- a/docs/zh/07-operation/18-dual.md +++ b/docs/zh/07-operation/18-dual.md @@ -4,7 +4,7 @@ sidebar_label: 双活系统 toc_max_heading_level: 4 --- -## 简介 +本节介绍 TDengine 双活系统的配置和使用。 1. 部分用户因为部署环境的特殊性只能部署两台服务器,同时希望实现一定的服务高可用和数据高可靠。本文主要描述基于数据复制和客户端 Failover 两项关键技术的 TDengine 双活系统的产品行为,包括双活系统的架构、配置、运维等。TDengine 双活既可以用于前面所述资源受限的环境,也可用于在两套 TDengine 集群(不限资源)之间的灾备场景。双活是 TDengine Enterprise 特有功能,在 3.3.0.0 版本中第一次发布,建议使用最新版本。 diff --git a/docs/zh/08-develop/01-connect/index.md b/docs/zh/08-develop/01-connect/index.md index 755a9e7f74..160e4cd40c 100644 --- a/docs/zh/08-develop/01-connect/index.md +++ b/docs/zh/08-develop/01-connect/index.md @@ -99,7 +99,7 @@ TDengine 提供了丰富的应用程序开发接口,为了便于用户快速 - **安装前准备** - 安装 Python。新近版本 taospy 包要求 Python 3.6.2+。早期版本 taospy 包要求 Python 3.7+。taos-ws-py 包要求 Python 3.7+。如果系统上还没有 Python 可参考 [Python BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide/Download) 安装。 - 安装 [pip](https://pypi.org/project/pip/)。大部分情况下 Python 的安装包都自带了 pip 工具, 如果没有请参考 [pip documentation](https://pip.pypa.io/en/stable/installation/) 安装。 - - 如果使用原生连接,还需[安装客户端驱动](../#安装客户端驱动)。客户端软件包含了 TDengine 客户端动态链接库(libtaos.so 或 taos.dll) 和 TDengine CLI。 + - 如果使用原生连接,还需[安装客户端驱动](../connect/#安装客户端驱动-taosc)。客户端软件包含了 TDengine 客户端动态链接库(libtaos.so 或 taos.dll) 和 TDengine CLI。 - **使用 pip 安装** - 卸载旧版本 diff --git a/docs/zh/08-develop/07-tmq.md b/docs/zh/08-develop/07-tmq.md index 0711ab9f28..be48c98261 100644 --- a/docs/zh/08-develop/07-tmq.md +++ b/docs/zh/08-develop/07-tmq.md @@ -492,7 +492,7 @@ Rust 连接器创建消费者的参数为 DSN, 可以设置的参数列表请 3. 对于每个分配,使用 `tmq_offset_seek` 函数将消费者的偏移量设置到最早的偏移量。 4. 如果设置偏移量失败,则打印错误信息。 5. 释放分配信息数组以释放资源。 -6. 调用 `basic_consume_loop` 函数开始新的的消费循环,处理消息。 +6. 调用 `basic_consume_loop` 函数开始新的消费循环,处理消息。 diff --git a/docs/zh/14-reference/01-components/01-taosd.md b/docs/zh/14-reference/01-components/01-taosd.md index 994f557a17..3746a16c54 100644 --- a/docs/zh/14-reference/01-components/01-taosd.md +++ b/docs/zh/14-reference/01-components/01-taosd.md @@ -143,7 +143,7 @@ charset 的有效值是 UTF-8。 | 参数名称 | 参数说明 | | :--------------: | :--------------------------------------------------------------------: | -| dataDir | 数据文件目录,所有的数据文件都将写入该目录,缺省值:/var/lib | +| dataDir | 数据文件目录,所有的数据文件都将写入该目录,缺省值:/var/lib/taos | | tempDir | 指定所有系统运行过程中的临时文件生成的目录,缺省值:/tmp | | minimalTmpDirGB | tempDir 所指定的临时文件目录所需要保留的最小空间,单位 GB,缺省值: 1 | | minimalDataDirGB | dataDir 指定的时序数据存储目录所需要保留的最小空间,单位 GB,缺省值: 2 | @@ -168,7 +168,7 @@ charset 的有效值是 UTF-8。 | minimalLogDirGB | 当日志文件夹所在磁盘可用空间大小小于该值时,停止写日志,单位GB,缺省值:1 | | numOfLogLines | 单个日志文件允许的最大行数,缺省值:10,000,000 | | asyncLog | 日志写入模式,0: 同步,1: 异步,缺省值: 1 | -| logKeepDays | 日志文件的最长保存时间 ,单位:天,缺省值:0,意味着无限保存;当设置为大于0 的值时,日志文件会被重命名为 taosdlog.xxx,其中 xxx 为日志文件最后修改的时间戳。 | +| logKeepDays | 日志文件的最长保存时间 ,单位:天,缺省值:0,意味着无限保存,日志文件不会被重命名,也不会有新的日志文件滚动产生,但日志文件的内容有可能会不断滚动,取决于日志文件大小的设置;当设置为大于0 的值时,当日志文件大小达到设置的上限时会被重命名为 taosdlog.xxx,其中 xxx 为日志文件最后修改的时间戳,并滚动产生新的日志文件 | | slowLogThreshold | 慢查询门限值,大于等于门限值认为是慢查询,单位秒,默认值: 3 | | slowLogScope | 定启动记录哪些类型的慢查询,可选值:ALL, QUERY, INSERT, OHTERS, NONE; 默认值:ALL | | debugFlag | 运行日志开关,131(输出错误和警告日志),135(输出错误、警告和调试日志),143(输出错误、警告、调试和跟踪日志); 默认值:131 或 135 (取决于不同模块) | diff --git a/docs/zh/14-reference/01-components/02-taosc.md b/docs/zh/14-reference/01-components/02-taosc.md index 96d108e8c8..d198890bd9 100644 --- a/docs/zh/14-reference/01-components/02-taosc.md +++ b/docs/zh/14-reference/01-components/02-taosc.md @@ -18,7 +18,7 @@ TDengine 客户端驱动提供了应用编程所需要的全部 API,并且在 |queryPolicy | 查询语句的执行策略,1: 只使用 vnode,不使用 qnode; 2: 没有扫描算子的子任务在 qnode 执行,带扫描算子的子任务在 vnode 执行; 3: vnode 只运行扫描算子,其余算子均在 qnode 执行 ;缺省值:1 | |querySmaOptimize | sma index 的优化策略,0: 表示不使用 sma index,永远从原始数据进行查询; 1: 表示使用 sma index,对符合的语句,直接从预计算的结果进行查询;缺省值:0 | |keepColumnName | Last、First、LastRow 函数查询且未指定别名时,自动设置别名为列名(不含函数名),因此 order by 子句如果引用了该列名将自动引用该列对应的函数; 1: 表示自动设置别名为列名(不包含函数名), 0: 表示不自动设置别名; 缺省值: 0 | -|countAlwaysReturnValue | ount/hyperloglog函数在输入数据为空或者NULL的情况下是否返回值; 0:返回空行,1:返回; 缺省值 1; 该参数设置为 1 时,如果查询中含有 INTERVAL 子句或者该查询使用了TSMA时, 且相应的组或窗口内数据为空或者NULL, 对应的组或窗口将不返回查询结果. 注意此参数客户端和服务端值应保持一致. | +|countAlwaysReturnValue | count/hyperloglog函数在输入数据为空或者NULL的情况下是否返回值; 0:返回空行,1:返回; 缺省值 1; 该参数设置为 1 时,如果查询中含有 INTERVAL 子句或者该查询使用了TSMA时, 且相应的组或窗口内数据为空或者NULL, 对应的组或窗口将不返回查询结果. 注意此参数客户端和服务端值应保持一致. | |multiResultFunctionStarReturnTags | 查询超级表时,last(\*)/last_row(\*)/first(\*) 是否返回标签列;查询普通表、子表时,不受该参数影响; 0:不返回标签列,1:返回标签列 ; 缺省值: 0; 该参数设置为 0 时,last(\*)/last_row(\*)/first(\*) 只返回超级表的普通列;为 1 时,返回超级表的普通列和标签列 | |maxTsmaCalcDelay| 查询时客户端可允许的tsma计算延迟, 若tsma的计算延迟大于配置值, 则该TSMA将不会被使用.; 取值范围: 600s - 86400s, 即10分钟-1小时 ; 缺省值:600 秒| |tsmaDataDeleteMark |TSMA计算的历史数据中间结果保存时间, 单位为毫秒; 取值范围:>= 3600000, 即大于等于1h; 缺省值: 86400000, 即1d | diff --git a/docs/zh/14-reference/01-components/06-taoskeeper.md b/docs/zh/14-reference/01-components/06-taoskeeper.md index 2877728077..f40b34ebeb 100644 --- a/docs/zh/14-reference/01-components/06-taoskeeper.md +++ b/docs/zh/14-reference/01-components/06-taoskeeper.md @@ -7,8 +7,6 @@ toc_max_heading_level: 4 import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -## 简介 - taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。 ## 安装 diff --git a/docs/zh/14-reference/01-components/09-taosdump.md b/docs/zh/14-reference/01-components/09-taosdump.md index fd08da56d8..7afe8721ee 100644 --- a/docs/zh/14-reference/01-components/09-taosdump.md +++ b/docs/zh/14-reference/01-components/09-taosdump.md @@ -4,8 +4,6 @@ sidebar_label: taosdump toc_max_heading_level: 4 --- -## 简介 - taosdump 是一个支持从运行中的 TDengine 集群备份数据并将备份的数据恢复到相同或另一个运行中的 TDengine 集群中的工具应用程序。 taosdump 可以用数据库、超级表或普通表作为逻辑数据单元进行备份,也可以对数据库、超级 diff --git a/docs/zh/14-reference/01-components/10-taosbenchmark.md b/docs/zh/14-reference/01-components/10-taosbenchmark.md index 8540fa1cbb..3f15d6b8e3 100644 --- a/docs/zh/14-reference/01-components/10-taosbenchmark.md +++ b/docs/zh/14-reference/01-components/10-taosbenchmark.md @@ -4,8 +4,6 @@ sidebar_label: taosBenchmark toc_max_heading_level: 4 --- -## 简介 - taosBenchmark (曾用名 taosdemo ) 是一个用于测试 TDengine 产品性能的工具。taosBenchmark 可以测试 TDengine 的插入、查询和订阅等功能的性能,它可以模拟由大量设备产生的大量数据,还可以灵活地控制数据库、超级表、标签列的数量和类型、数据列的数量和类型、子表的数量、每张子表的数据量、插入数据的时间间隔、taosBenchmark 的工作线程数量、是否以及如何插入乱序数据等。为了兼容过往用户的使用习惯,安装包提供 了 taosdemo 作为 taosBenchmark 的软链接。 ## 安装 diff --git a/docs/zh/14-reference/03-taos-sql/03-table.md b/docs/zh/14-reference/03-taos-sql/03-table.md index f665aa2277..80aad0718a 100644 --- a/docs/zh/14-reference/03-taos-sql/03-table.md +++ b/docs/zh/14-reference/03-taos-sql/03-table.md @@ -26,7 +26,7 @@ create_definition: col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... diff --git a/docs/zh/14-reference/03-taos-sql/04-stable.md b/docs/zh/14-reference/03-taos-sql/04-stable.md index 5ad2f4a19d..badd08cd57 100644 --- a/docs/zh/14-reference/03-taos-sql/04-stable.md +++ b/docs/zh/14-reference/03-taos-sql/04-stable.md @@ -13,7 +13,7 @@ create_definition: col_name column_definition column_definition: - type_name [comment 'string_value'] [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] + type_name [PRIMARY KEY] [ENCODE 'encode_type'] [COMPRESS 'compress_type'] [LEVEL 'level_type'] table_options: table_option ... diff --git a/docs/zh/14-reference/03-taos-sql/07-tag-index.md b/docs/zh/14-reference/03-taos-sql/07-tag-index.md index c016a5b513..383c5b2a1f 100644 --- a/docs/zh/14-reference/03-taos-sql/07-tag-index.md +++ b/docs/zh/14-reference/03-taos-sql/07-tag-index.md @@ -4,9 +4,7 @@ title: 标签索引 description: 使用标签索引提升查询性能 --- -## 简介 - -在 TDengine 3.0.3.0 版本之前(不含),默认在第一列 TAG 上建立索引,但不支持给其它列动态添加索引。从 3.0.3.0 版本开始,可以动态地为其它 TAG 列添加索引。对于第一个 TAG 列上自动建立的索引,其在查询中默认生效,且用户无法对其进行任何干预。适当地使用索引能够有效地提升查询性能。 +本节说明 TDengine 的索引机制。在 TDengine 3.0.3.0 版本之前(不含),默认在第一列 TAG 上建立索引,但不支持给其它列动态添加索引。从 3.0.3.0 版本开始,可以动态地为其它 TAG 列添加索引。对于第一个 TAG 列上自动建立的索引,其在查询中默认生效,且用户无法对其进行任何干预。适当地使用索引能够有效地提升查询性能。 ## 语法 diff --git a/docs/zh/14-reference/03-taos-sql/32-view.md b/docs/zh/14-reference/03-taos-sql/32-view.md new file mode 100644 index 0000000000..e8b08e05e8 --- /dev/null +++ b/docs/zh/14-reference/03-taos-sql/32-view.md @@ -0,0 +1,137 @@ +--- +toc_max_heading_level: 4 +title: "视图" +sidebar_label: "视图" +--- + +从 TDengine 3.2.1.0 开始,TDengine 企业版提供视图功能,便于用户简化操作,提升用户间的分享能力。 + +视图(View)本质上是一个存储在数据库中的查询语句。视图(非物化视图)本身不包含数据,只有在从视图读取数据时才动态执行视图所指定的查询语句。我们在创建视图时指定一个名称,然后可以像使用普通表一样对其进行查询等操作。视图的使用需遵循以下规则: +- 视图可以嵌套定义和使用,视图与创建时指定的或当前数据库绑定使用。 +- 在同一个数据库内,视图名称不允许重名,视图名跟表名也推荐不重名(不强制)。当出现视图与表名重名时,写入、查询、授权、回收权限等操作优先使用同名表。 + + + +## 语法 + +### 创建(更新)视图 + +```sql +CREATE [ OR REPLACE ] VIEW [db_name.]view_name AS query +``` + +说明: +- 创建视图时可以指定视图绑定的数据库名(db_name),未明确指定时默认为当前连接绑定的数据库; +- 查询语句(query)中推荐指定数据库名,支持跨库视图,未指定时默认为与视图绑定的数据库(有可能非当前连接指定的数据库); + +### 查看视图 +1. 查看某个数据库下的所有视图 + ```sql + SHOW [db_name.]VIEWS; + ``` + +2. 查看视图的创建语句 + ```sql + SHOW CREATE VIEW [db_name.]view_name; + ``` + +3. 查看视图列信息 + ```sql + DESCRIBE [db_name.]view_name; + ``` + +4. 查看所有视图信息 + ```sql + SELECT ... FROM information_schema.ins_views; + ``` + +### 删除视图 +```sql +DROP VIEW [IF EXISTS] [db_name.]view_name; +``` + +## 权限 + +### 说明 +视图的权限分为 READ、WRITE、ALTER 三种,查询操作需要具备 READ 权限,写入操作需要具备 WRITE 权限,对视图本身的删改操作需要具备 ALTER 权限。 + +### 规则 +- 视图的创建者和 root 用户默认具备所有权限。 +- 对其他用户进行授权与回收权限可以通过 GRANT 和 REVOKE 语句进行,该操作只能由 root 用户进行。 +- 视图权限需单独授权与回收,通过db.*进行的授权与回收不含视图权限。 +- 视图可以嵌套定义与使用,同理对视图权限的校验也是递归进行的。 +- 为了方便视图的分享与使用,引入视图有效用户(即视图的创建用户)的概念,被授权用户可以使用视图有效用户的库、表及嵌套视图的读写权限。注:视图被 REPLACE 后有效用户也会被更新。 + +具体相关权限控制细则如下表所示: + +| 序号 | 操作 | 权限要求 | +| ---- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1 | CREATE VIEW
(创建新用户) | 用户对视图所属数据库有 WRITE 权限

用户对视图的目标库、表、视图有查询权限,若查询中的对象是视图需满足当前表中第8条规则 | +| 2 | CREATE OR REPLACE VIEW
(覆盖旧视图) | 用户对视图所属数据库有 WRITE 权限 且 对旧有视图有 ALTER 权限

用户对视图的目标库、表、视图有查询权限,若查询中的对象是视图需满足当前表中第8条规则 | +| 3 | DROP VIEW | 用户对视图有 ALTER 权限 | +| 4 | SHOW VIEWS | 无 | +| 5 | SHOW CREATE VIEW | 无 | +| 6 | DESCRIBE VIEW | 无 | +| 7 | 系统表查询 | 无 | +| 8 | SELECT FROM VIEW | 操作用户对视图有 READ 权限 且 操作用户或视图有效用户对视图的目标库、表、视图有 READ 权限 | +| 9 | INSERT INTO VIEW | 操作用户对视图有 WRITE 权限 且 操作用户或视图有效用户对视图的目标库、表、视图有 WRITE 权限 | +| 10 | GRANT/REVOKE | 只有 root 用户有权限 | + +### 语法 + +#### 授权 + +```sql +GRANT privileges ON [db_name.]view_name TO user_name +privileges: { + ALL, + | priv_type [, priv_type] ... +} +priv_type: { + READ + | WRITE + | ALTER +} +``` + +#### 回收权限 + +```sql +REVOKE privileges ON [db_name.]view_name FROM user_name +privileges: { + ALL, + | priv_type [, priv_type] ... +} +priv_type: { + READ + | WRITE + | ALTER +} +``` + +## 使用场景 + +| SQL 查询 | SQL 写入 | STMT 查询 | STMT 写入 | 订阅 | 流计算 | +| -------- | -------- | --------- | --------- | ---- | -------- | +| 支持 | 暂不支持 | 暂不支持 | 暂不支持 | 支持 | 暂不支持 | + + +## 举例 + +- 创建视图 + + ```sql + CREATE VIEW view1 AS SELECT _wstart, count(*) FROM table1 INTERVAL(1d); + CREATE VIEW view2 AS SELECT ts, col2 FROM table1; + CREATE VIEW view3 AS SELECT * from view1; + ``` +- 查询数据 + + ```sql + SELECT * from view1; + ``` +- 删除视图 + + ```sql + DROP VIEW view1; + ``` diff --git a/docs/zh/14-reference/05-connector/10-cpp.mdx b/docs/zh/14-reference/05-connector/10-cpp.mdx index f9feaac629..be7e44812c 100644 --- a/docs/zh/14-reference/05-connector/10-cpp.mdx +++ b/docs/zh/14-reference/05-connector/10-cpp.mdx @@ -1,6 +1,7 @@ --- sidebar_label: C/C++ title: C/C++ Connector +toc_max_heading_level: 4 --- C/C++ 开发人员可以使用 TDengine 的客户端驱动,即 C/C++连接器 (以下都用 TDengine 客户端驱动表示),开发自己的应用来连接 TDengine 集群完成数据存储、查询以及其他功能。TDengine 客户端驱动的 API 类似于 MySQL 的 C API。应用程序使用时,需要包含 TDengine 头文件 _taos.h_,里面列出了提供的 API 的函数原型;应用程序还要链接到所在平台上对应的动态库。 @@ -783,7 +784,7 @@ TDengine 的异步 API 均采用非阻塞调用模式。应用程序可以用多 - **返回值**:非 `NULL`:成功,返回一个 TAOS * 类型的指针,指向与 TDengine 数据库的连接句柄。`NULL`:失败,非法的输入参数。 - `const char *tmq_get_table_name(TAOS_RES *res)` - - **接口说明**:从 TMQ 消费者获取的消息结果中获取所属的的表名。 + - **接口说明**:从 TMQ 消费者获取的消息结果中获取所属的表名。 - res:[入参] 指向一个有效的 TAOS_RES 结构体指针,该结构体包含了从 TMQ 消费者轮询得到的消息。 - **返回值**:非 `NULL`:成功,返回一个 const char * 类型的指针,指向表名字符串。`NULL`:失败,非法的输入参数。 diff --git a/docs/zh/14-reference/05-connector/30-python.mdx b/docs/zh/14-reference/05-connector/30-python.mdx index 671234fb7f..1a805c692e 100644 --- a/docs/zh/14-reference/05-connector/30-python.mdx +++ b/docs/zh/14-reference/05-connector/30-python.mdx @@ -307,7 +307,7 @@ TaosResult 对象可以通过循环遍历获取查询到的数据。 - **参数说明**: - `topic`: 订阅的主题。 - `vg_id`: vgroupid。 - - `offset`:需要设置的的偏移量。 + - `offset`:需要设置的偏移量。 - **异常**:操作失败抛出 ConsumerException 异常。 - `fn committed(&mut self, topic: &str, vg_id: i32) -> PyResult` - **接口说明**:获取订阅主题的vgroupid分区最后提交的偏移量。 @@ -489,7 +489,7 @@ TaosResult 对象可以通过循环遍历获取查询到的数据。 - `def seek(self, partition)` - **接口说明**:将给定分区的偏移量设置到指定的位置。 - **参数说明**: - - `partition`: 需要设置的的偏移量。 + - `partition`: 需要设置的偏移量。 - `topic`: 订阅的主题 - `partition`: 分区 - `offset`: 偏移量 @@ -497,7 +497,7 @@ TaosResult 对象可以通过循环遍历获取查询到的数据。 - `def committed(self, partitions)` - **接口说明**:获取订阅主题的分区最后提交的偏移量。 - **参数说明**: - - `partition`: 需要设置的的偏移量。 + - `partition`: 需要设置的偏移量。 - `topic`: 订阅的主题 - `partition`: 分区 - **返回值**:`partition`,分区最后提交的偏移量。 @@ -505,7 +505,7 @@ TaosResult 对象可以通过循环遍历获取查询到的数据。 - `def position(self, partitions)` - **接口说明**:获取给定分区当前的偏移量。 - **参数说明**: - - `partition`: 需要设置的的偏移量。 + - `partition`: 需要设置的偏移量。 - `topic`: 订阅的主题 - `partition`: 分区 - **返回值**:`partition`,分区最后提交的偏移量。 diff --git a/docs/zh/14-reference/05-connector/35-node.mdx b/docs/zh/14-reference/05-connector/35-node.mdx index 9236dbc589..a3d5099235 100644 --- a/docs/zh/14-reference/05-connector/35-node.mdx +++ b/docs/zh/14-reference/05-connector/35-node.mdx @@ -8,7 +8,7 @@ import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import RequestId from "./_request_id.mdx"; -`@tdengine/websocket` 是 TDengine 的官方 Node.js 语言连接器。Node.js 开发人员可以通过它开发存取 TDengine 数据库的的应用软件。 +`@tdengine/websocket` 是 TDengine 的官方 Node.js 语言连接器。Node.js 开发人员可以通过它开发存取 TDengine 数据库的应用软件。 Node.js 连接器源码托管在 [GitHub](https://github.com/taosdata/taos-connector-node/tree/main)。 @@ -194,7 +194,7 @@ WSConfig 中的配置如下: ### 数据集 - `getMeta():Array | null` - - **接口说明**:获取查询结果的的列的数量、类型和长度。 + - **接口说明**:获取查询结果的列的数量、类型和长度。 - **返回值**:TDengineMeta 数据对象数组。 ```js export interface TDengineMeta { diff --git a/docs/zh/14-reference/05-connector/45-php.mdx b/docs/zh/14-reference/05-connector/45-php.mdx index 9bc9662a72..0b453218f6 100644 --- a/docs/zh/14-reference/05-connector/45-php.mdx +++ b/docs/zh/14-reference/05-connector/45-php.mdx @@ -1,6 +1,7 @@ --- sidebar_label: PHP title: PHP Connector +toc_max_heading_level: 4 --- `php-tdengine` 是由社区贡献的 PHP 连接器扩展,还特别支持了 Swoole 协程化。 diff --git a/docs/zh/14-reference/05-connector/50-odbc.mdx b/docs/zh/14-reference/05-connector/50-odbc.mdx index 521b08c599..244a3f8d4e 100644 --- a/docs/zh/14-reference/05-connector/50-odbc.mdx +++ b/docs/zh/14-reference/05-connector/50-odbc.mdx @@ -3,9 +3,6 @@ sidebar_label: ODBC title: TDengine ODBC --- - -## 简介 - TDengine ODBC 是为 TDengine 实现的 ODBC 驱动程序,支持 Windows 系统的应用(如 [PowerBI](https://powerbi.microsoft.com/zh-cn/) 等)通过 ODBC 标准接口访问本地、远程和云服务的 TDengine 数据库。 TDengine ODBC 提供基于 WebSocket(推荐)和 原生连接两种方式连接 TDengine 数据库,使用时可以为 TDengine 数据源设置不同的连接方式。访问云服务时必须使用 WebSocket 连接方式。 diff --git a/docs/zh/14-reference/05-connector/60-rest-api.mdx b/docs/zh/14-reference/05-connector/60-rest-api.mdx index 4a3fcbd49e..b6d6ec3b4a 100644 --- a/docs/zh/14-reference/05-connector/60-rest-api.mdx +++ b/docs/zh/14-reference/05-connector/60-rest-api.mdx @@ -1,6 +1,7 @@ --- title: REST API sidebar_label: REST API +toc_max_heading_level: 4 description: 详细介绍 TDengine 提供的 RESTful API. --- diff --git a/docs/zh/14-reference/07-supported.md b/docs/zh/14-reference/07-supported.md index 18aec5f507..47c874c907 100644 --- a/docs/zh/14-reference/07-supported.md +++ b/docs/zh/14-reference/07-supported.md @@ -14,7 +14,7 @@ description: "TDengine 服务端、客户端和连接器支持的平台列表" | M1 | | | | | | | | ● | 注:1) ● 表示经过官方测试验证, ○ 表示非官方测试验证,E 表示仅企业版支持。 - 2) 社区版仅支持主流操作系统的较新版本,包括 Ubuntu 18+/CentOS 7+/RetHat/Debian/CoreOS/FreeBSD/OpenSUSE/SUSE Linux/Fedora/macOS 等。如果有其他操作系统及版本的需求,请联系企业版支持。 + 2) 社区版仅支持主流操作系统的较新版本,包括 Ubuntu 18+/CentOS 7+/RedHat/Debian/CoreOS/FreeBSD/OpenSUSE/SUSE Linux/Fedora/macOS 等。如果有其他操作系统及版本的需求,请联系企业版支持。 ## TDengine 客户端和连接器支持的平台列表 diff --git a/docs/zh/14-reference/09-error-code.md b/docs/zh/14-reference/09-error-code.md index bb66ca7f95..fbd347b6af 100644 --- a/docs/zh/14-reference/09-error-code.md +++ b/docs/zh/14-reference/09-error-code.md @@ -122,7 +122,7 @@ description: TDengine 服务端的错误码列表和详细说明 | 0x80000335 | Cluster cfg inconsistent | 配置不一致 | 检查dnode节点与mnode节点配置是否一致。检查方式:1.节点启动时,在日志中输出 2.使用show variables | | 0x8000033B | Cluster id not match | 节点配置数据不一致 | 检查各节点data/dnode/dnodes.json文件中的clusterid | | 0x80000340 | Account already exists | (仅企业版)内部错误 | 上报issue | -| 0x80000342 | Invalid account options | (仅企业版)操作不zh | 确认操作是否正确 | +| 0x80000342 | Invalid account options | (仅企业版)该操作不支持 | 确认操作是否正确 | | 0x80000344 | Invalid account | 账户不存在 | 确认账户是否正确 | | 0x80000350 | User already exists | Create user, 重复创建 | 确认操作是否正确 | | 0x80000351 | Invalid user | 用户不存在 | 确认操作是否正确 | @@ -311,7 +311,7 @@ description: TDengine 服务端的错误码列表和详细说明 | ---------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | 0x80000903 | Sync timeout | 场景1:发生了切主;旧主节点上已经开始协商但尚未达成一致的请求将超时。 场景2:从节点响应超时,导致协商超时。 | 检查集群状态,例如:show vgroups;查看服务端日志,以及服务端节点之间的网络状况。 | | 0x8000090C | Sync leader is unreachable | 场景1:选主过程中 场景2:客户端请求路由到了从节点,且重定向失败 场景3:客户端或服务端网络配置错误 | 检查集群状态、网络配置、应用程序访问状态等。查看服务端日志,以及服务端节点之间的网络状况。 | -| 0x8000090F | Sync new config error | 成员变更新配置错误 | 预留 | +| 0x8000090F | Sync new config error | 成员变更配置错误 | 内部错误,用户无法干预 | | 0x80000911 | Sync not ready to propose | 场景1:恢复未完成 | 检查集群状态,例如:show vgroups。查看服务端日志,以及服务端节点之间的网络状况。 | | 0x80000914 | Sync leader is restoring | 场景1:发生了切主;选主后,日志重演中 | 检查集群状态,例如:show vgroups。查看服务端日志,观察恢复进度。 | | 0x80000915 | Sync invalid snapshot msg | 快照复制消息错误 | 服务端内部错误 | diff --git a/docs/zh/26-tdinternal/03-storage.md b/docs/zh/26-tdinternal/03-storage.md index f65f06e85b..e402babdd7 100644 --- a/docs/zh/26-tdinternal/03-storage.md +++ b/docs/zh/26-tdinternal/03-storage.md @@ -101,7 +101,7 @@ head 文件是时序数据存储文件(data 文件)的 BRIN(Block Range In head 文件中存储了多个 BRIN 记录块及其索引。BRIN 记录块采用列存压缩的方式,这种方式可以大大减少空间占用,同时保持较高的查询性能。BRIN 索引结构如下图所示: -![BRIN 索引结构](./brin.png) +![BRIN 索引结构](./brin.png) #### data 文件 @@ -121,4 +121,4 @@ data 文件是实际存储时序数据的文件。在 data 文件中,时序数 在少表高频的场景下,系统仅维护一个 stt 文件。该文件专门用于存储每次数据落盘后剩余的碎片数据。这样,在下一次数据落盘时,这些碎片数据可以与内存中的新数据合并,形成较大的数据块,随后一并写入 data 文件中。这种机制有效地避免了数据文件的碎片化,确保了数据存储的连续性和高效性。 -对于多表低频的场景,建议配置多个 stt 文件。这种场景下的核心思想是,尽管单张表每次落盘的数据量可能不大,但同一超级表下的所有子表累积的数据量却相当可观。通过合并这些数据,可以生成较大的数据块,从而减少数据块的碎片化。这不仅提升了数据的写入效率,还能显著提高查询性能,因为连续的数据存储更有利于快速的数据检索和访问。 \ No newline at end of file +对于多表低频的场景,建议配置多个 stt 文件。这种场景下的核心思想是,尽管单张表每次落盘的数据量可能不大,但同一超级表下的所有子表累积的数据量却相当可观。通过合并这些数据,可以生成较大的数据块,从而减少数据块的碎片化。这不仅提升了数据的写入效率,还能显著提高查询性能,因为连续的数据存储更有利于快速的数据检索和访问。 diff --git a/docs/zh/27-train-faq/01-faq.md b/docs/zh/27-train-faq/01-faq.md index 50470e92f1..01cb42213e 100644 --- a/docs/zh/27-train-faq/01-faq.md +++ b/docs/zh/27-train-faq/01-faq.md @@ -265,7 +265,7 @@ TDengine 在写入数据时如果有很严重的乱序写入问题,会严重 ### 26 遇到报错 “DND ERROR Version not compatible,cliver : 3000700swr wer : 3020300” 说明客户端和服务端版本不兼容,这里cliver的版本是3.0.7.0,server版本是 3.2.3.0。目前的兼容策略是前三位一致,client 和 sever才能兼容。 -### 27 修改database的root密码后,启动taos遇到报错 “failed to connect to server, reason: Authen tication failure” +### 27 修改database的root密码后,启动taos遇到报错 “failed to connect to server, reason: Authentication failure” 默认情况,启动taos服务会使用系统默认的用户名(root)和密码尝试连接taosd,在root密码修改后,启用taos连接就需要指明用户名和密码,例如: taos -h xxx.xxx.xxx.xxx -u root -p,然后输入新密码进行连接。 ### 28 修改database的root密码后,Grafana监控插件TDinsight无数据展示 diff --git a/include/common/tglobal.h b/include/common/tglobal.h index bb5271a45f..7ecdd2a1b7 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -86,7 +86,7 @@ extern int32_t tsNumOfQnodeQueryThreads; extern int32_t tsNumOfQnodeFetchThreads; extern int32_t tsNumOfSnodeStreamThreads; extern int32_t tsNumOfSnodeWriteThreads; -extern int64_t tsRpcQueueMemoryAllowed; +extern int64_t tsQueueMemoryAllowed; extern int32_t tsRetentionSpeedLimitMB; // sync raft diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 70cf9c8b58..3dee29f864 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1547,6 +1547,8 @@ typedef struct { SDbCfgRsp* cfgRsp; STableTSMAInfoRsp* pTsmaRsp; int32_t dbTsmaVersion; + char db[TSDB_DB_FNAME_LEN]; + int64_t dbId; } SDbHbRsp; typedef struct { @@ -2837,6 +2839,8 @@ typedef struct { int64_t consumerId; char cgroup[TSDB_CGROUP_LEN]; char clientId[TSDB_CLIENT_ID_LEN]; + char user[TSDB_USER_LEN]; + char fqdn[TSDB_FQDN_LEN]; SArray* topicNames; // SArray int8_t withTbName; @@ -2870,6 +2874,8 @@ static FORCE_INLINE int32_t tSerializeSCMSubscribeReq(void** buf, const SCMSubsc tlen += taosEncodeFixedI8(buf, pReq->enableBatchMeta); tlen += taosEncodeFixedI32(buf, pReq->sessionTimeoutMs); tlen += taosEncodeFixedI32(buf, pReq->maxPollIntervalMs); + tlen += taosEncodeString(buf, pReq->user); + tlen += taosEncodeString(buf, pReq->fqdn); return tlen; } @@ -2904,6 +2910,8 @@ static FORCE_INLINE int32_t tDeserializeSCMSubscribeReq(void* buf, SCMSubscribeR if ((char*)buf - (char*)start < len) { buf = taosDecodeFixedI32(buf, &pReq->sessionTimeoutMs); buf = taosDecodeFixedI32(buf, &pReq->maxPollIntervalMs); + buf = taosDecodeStringTo(buf, pReq->user); + buf = taosDecodeStringTo(buf, pReq->fqdn); } else { pReq->sessionTimeoutMs = DEFAULT_SESSION_TIMEOUT; pReq->maxPollIntervalMs = DEFAULT_MAX_POLL_INTERVAL; diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 41802d5400..c22808e033 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -281,118 +281,125 @@ #define TK_IROWTS 263 #define TK_ISFILLED 264 #define TK_CAST 265 -#define TK_NOW 266 -#define TK_TODAY 267 -#define TK_TIMEZONE 268 -#define TK_CLIENT_VERSION 269 -#define TK_SERVER_VERSION 270 -#define TK_SERVER_STATUS 271 -#define TK_CURRENT_USER 272 -#define TK_CASE 273 -#define TK_WHEN 274 -#define TK_THEN 275 -#define TK_ELSE 276 -#define TK_BETWEEN 277 -#define TK_IS 278 -#define TK_NK_LT 279 -#define TK_NK_GT 280 -#define TK_NK_LE 281 -#define TK_NK_GE 282 -#define TK_NK_NE 283 -#define TK_MATCH 284 -#define TK_NMATCH 285 -#define TK_CONTAINS 286 -#define TK_IN 287 -#define TK_JOIN 288 -#define TK_INNER 289 -#define TK_LEFT 290 -#define TK_RIGHT 291 -#define TK_OUTER 292 -#define TK_SEMI 293 -#define TK_ANTI 294 -#define TK_ASOF 295 -#define TK_WINDOW 296 -#define TK_WINDOW_OFFSET 297 -#define TK_JLIMIT 298 -#define TK_SELECT 299 -#define TK_NK_HINT 300 -#define TK_DISTINCT 301 -#define TK_WHERE 302 -#define TK_PARTITION 303 -#define TK_BY 304 -#define TK_SESSION 305 -#define TK_STATE_WINDOW 306 -#define TK_EVENT_WINDOW 307 -#define TK_COUNT_WINDOW 308 -#define TK_SLIDING 309 -#define TK_FILL 310 -#define TK_VALUE 311 -#define TK_VALUE_F 312 -#define TK_NONE 313 -#define TK_PREV 314 -#define TK_NULL_F 315 -#define TK_LINEAR 316 -#define TK_NEXT 317 -#define TK_HAVING 318 -#define TK_RANGE 319 -#define TK_EVERY 320 -#define TK_ORDER 321 -#define TK_SLIMIT 322 -#define TK_SOFFSET 323 -#define TK_LIMIT 324 -#define TK_OFFSET 325 -#define TK_ASC 326 -#define TK_NULLS 327 -#define TK_ABORT 328 -#define TK_AFTER 329 -#define TK_ATTACH 330 -#define TK_BEFORE 331 -#define TK_BEGIN 332 -#define TK_BITAND 333 -#define TK_BITNOT 334 -#define TK_BITOR 335 -#define TK_BLOCKS 336 -#define TK_CHANGE 337 -#define TK_COMMA 338 -#define TK_CONCAT 339 -#define TK_CONFLICT 340 -#define TK_COPY 341 -#define TK_DEFERRED 342 -#define TK_DELIMITERS 343 -#define TK_DETACH 344 -#define TK_DIVIDE 345 -#define TK_DOT 346 -#define TK_EACH 347 -#define TK_FAIL 348 -#define TK_FOR 349 -#define TK_GLOB 350 -#define TK_ID 351 -#define TK_IMMEDIATE 352 -#define TK_IMPORT 353 -#define TK_INITIALLY 354 -#define TK_INSTEAD 355 -#define TK_ISNULL 356 -#define TK_MODULES 357 -#define TK_NK_BITNOT 358 -#define TK_NK_SEMI 359 -#define TK_NOTNULL 360 -#define TK_OF 361 -#define TK_PLUS 362 -#define TK_PRIVILEGE 363 -#define TK_RAISE 364 -#define TK_RESTRICT 365 -#define TK_ROW 366 -#define TK_STAR 367 -#define TK_STATEMENT 368 -#define TK_STRICT 369 -#define TK_STRING 370 -#define TK_TIMES 371 -#define TK_VALUES 372 -#define TK_VARIABLE 373 -#define TK_WAL 374 -#define TK_ENCODE 375 -#define TK_COMPRESS 376 -#define TK_LEVEL 377 +#define TK_POSITION 266 +#define TK_IN 267 +#define TK_FOR 268 +#define TK_NOW 269 +#define TK_TODAY 270 +#define TK_SUBSTR 271 +#define TK_SUBSTRING 272 +#define TK_BOTH 273 +#define TK_TRAILING 274 +#define TK_LEADING 275 +#define TK_TIMEZONE 276 +#define TK_CLIENT_VERSION 277 +#define TK_SERVER_VERSION 278 +#define TK_SERVER_STATUS 279 +#define TK_CURRENT_USER 280 +#define TK_PI 281 +#define TK_CASE 282 +#define TK_WHEN 283 +#define TK_THEN 284 +#define TK_ELSE 285 +#define TK_BETWEEN 286 +#define TK_IS 287 +#define TK_NK_LT 288 +#define TK_NK_GT 289 +#define TK_NK_LE 290 +#define TK_NK_GE 291 +#define TK_NK_NE 292 +#define TK_MATCH 293 +#define TK_NMATCH 294 +#define TK_CONTAINS 295 +#define TK_JOIN 296 +#define TK_INNER 297 +#define TK_LEFT 298 +#define TK_RIGHT 299 +#define TK_OUTER 300 +#define TK_SEMI 301 +#define TK_ANTI 302 +#define TK_ASOF 303 +#define TK_WINDOW 304 +#define TK_WINDOW_OFFSET 305 +#define TK_JLIMIT 306 +#define TK_SELECT 307 +#define TK_NK_HINT 308 +#define TK_DISTINCT 309 +#define TK_WHERE 310 +#define TK_PARTITION 311 +#define TK_BY 312 +#define TK_SESSION 313 +#define TK_STATE_WINDOW 314 +#define TK_EVENT_WINDOW 315 +#define TK_COUNT_WINDOW 316 +#define TK_SLIDING 317 +#define TK_FILL 318 +#define TK_VALUE 319 +#define TK_VALUE_F 320 +#define TK_NONE 321 +#define TK_PREV 322 +#define TK_NULL_F 323 +#define TK_LINEAR 324 +#define TK_NEXT 325 +#define TK_HAVING 326 +#define TK_RANGE 327 +#define TK_EVERY 328 +#define TK_ORDER 329 +#define TK_SLIMIT 330 +#define TK_SOFFSET 331 +#define TK_LIMIT 332 +#define TK_OFFSET 333 +#define TK_ASC 334 +#define TK_NULLS 335 +#define TK_ABORT 336 +#define TK_AFTER 337 +#define TK_ATTACH 338 +#define TK_BEFORE 339 +#define TK_BEGIN 340 +#define TK_BITAND 341 +#define TK_BITNOT 342 +#define TK_BITOR 343 +#define TK_BLOCKS 344 +#define TK_CHANGE 345 +#define TK_COMMA 346 +#define TK_CONCAT 347 +#define TK_CONFLICT 348 +#define TK_COPY 349 +#define TK_DEFERRED 350 +#define TK_DELIMITERS 351 +#define TK_DETACH 352 +#define TK_DIVIDE 353 +#define TK_DOT 354 +#define TK_EACH 355 +#define TK_FAIL 356 +#define TK_GLOB 357 +#define TK_ID 358 +#define TK_IMMEDIATE 359 +#define TK_IMPORT 360 +#define TK_INITIALLY 361 +#define TK_INSTEAD 362 +#define TK_ISNULL 363 +#define TK_MODULES 364 +#define TK_NK_BITNOT 365 +#define TK_NK_SEMI 366 +#define TK_NOTNULL 367 +#define TK_OF 368 +#define TK_PLUS 369 +#define TK_PRIVILEGE 370 +#define TK_RAISE 371 +#define TK_RESTRICT 372 +#define TK_ROW 373 +#define TK_STAR 374 +#define TK_STATEMENT 375 +#define TK_STRICT 376 +#define TK_STRING 377 +#define TK_TIMES 378 +#define TK_VALUES 379 +#define TK_VARIABLE 380 +#define TK_WAL 381 +#define TK_ENCODE 382 +#define TK_COMPRESS 383 +#define TK_LEVEL 384 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index 3f1cf74cfa..11ed7c7da6 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -415,6 +415,8 @@ int32_t catalogGetTableTsmas(SCatalog* pCtg, SRequestConnInfo* pConn, const SNam int32_t catalogGetTsma(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTsmaName, STableTSMAInfo** pTsma); +int32_t catalogAsyncUpdateDbTsmaVersion(SCatalog* pCtg, int32_t tsmaVersion, const char* dbFName, int64_t dbId); + /** * Destroy catalog and relase all resources */ diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index 1da1cbf716..905f1c2575 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -45,6 +45,7 @@ typedef enum EFunctionType { FUNCTION_TYPE_TWA, FUNCTION_TYPE_HISTOGRAM, FUNCTION_TYPE_HYPERLOGLOG, + FUNCTION_TYPE_STDVAR, // nonstandard SQL function FUNCTION_TYPE_BOTTOM = 500, @@ -77,6 +78,15 @@ typedef enum EFunctionType { FUNCTION_TYPE_ASIN, FUNCTION_TYPE_ACOS, FUNCTION_TYPE_ATAN, + FUNCTION_TYPE_PI, + FUNCTION_TYPE_EXP, + FUNCTION_TYPE_LN, + FUNCTION_TYPE_MOD, + FUNCTION_TYPE_RAND, + FUNCTION_TYPE_SIGN, + FUNCTION_TYPE_DEGREES, + FUNCTION_TYPE_RADIANS, + FUNCTION_TYPE_TRUNCATE, // string function FUNCTION_TYPE_LENGTH = 1500, @@ -89,6 +99,13 @@ typedef enum EFunctionType { FUNCTION_TYPE_RTRIM, FUNCTION_TYPE_SUBSTR, FUNCTION_TYPE_MD5, + FUNCTION_TYPE_CHAR, + FUNCTION_TYPE_ASCII, + FUNCTION_TYPE_POSITION, + FUNCTION_TYPE_TRIM, + FUNCTION_TYPE_REPLACE, + FUNCTION_TYPE_REPEAT, + FUNCTION_TYPE_SUBSTR_IDX, // conversion function FUNCTION_TYPE_CAST = 2000, @@ -104,6 +121,10 @@ typedef enum EFunctionType { FUNCTION_TYPE_TIMETRUNCATE, FUNCTION_TYPE_TIMEZONE, FUNCTION_TYPE_TODAY, + FUNCTION_TYPE_WEEK, + FUNCTION_TYPE_WEEKDAY, + FUNCTION_TYPE_WEEKOFYEAR, + FUNCTION_TYPE_DAYOFWEEK, // system function FUNCTION_TYPE_DATABASE = 3000, @@ -162,8 +183,9 @@ typedef enum EFunctionType { FUNCTION_TYPE_LAST_MERGE, FUNCTION_TYPE_AVG_PARTIAL, FUNCTION_TYPE_AVG_MERGE, - FUNCTION_TYPE_STDDEV_PARTIAL, + FUNCTION_TYPE_STD_PARTIAL, FUNCTION_TYPE_STDDEV_MERGE, + FUNCTION_TYPE_STDVAR_MERGE, FUNCTION_TYPE_IRATE_PARTIAL, FUNCTION_TYPE_IRATE_MERGE, FUNCTION_TYPE_AVG_STATE, @@ -174,8 +196,8 @@ typedef enum EFunctionType { FUNCTION_TYPE_LAST_STATE_MERGE, FUNCTION_TYPE_SPREAD_STATE, FUNCTION_TYPE_SPREAD_STATE_MERGE, - FUNCTION_TYPE_STDDEV_STATE, - FUNCTION_TYPE_STDDEV_STATE_MERGE, + FUNCTION_TYPE_STD_STATE, + FUNCTION_TYPE_STD_STATE_MERGE, FUNCTION_TYPE_HYPERLOGLOG_STATE, FUNCTION_TYPE_HYPERLOGLOG_STATE_MERGE, diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 198163582b..4bf0663def 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -170,6 +170,12 @@ typedef struct SNodeListNode { SNodeList* pNodeList; } SNodeListNode; +typedef enum ETrimType { + TRIM_TYPE_LEADING = 1, + TRIM_TYPE_TRAILING, + TRIM_TYPE_BOTH, +} ETrimType; + typedef struct SFunctionNode { SExprNode node; // QUERY_NODE_FUNCTION char functionName[TSDB_FUNC_NAME_LEN]; @@ -181,6 +187,7 @@ typedef struct SFunctionNode { int32_t pkBytes; bool hasOriginalFunc; int32_t originalFuncId; + ETrimType trimType; } SFunctionNode; typedef struct STableNode { diff --git a/include/libs/scalar/scalar.h b/include/libs/scalar/scalar.h index bee8d2e943..70b44a4b52 100644 --- a/include/libs/scalar/scalar.h +++ b/include/libs/scalar/scalar.h @@ -61,6 +61,15 @@ int32_t atanFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp int32_t ceilFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t floorFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t roundFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t truncFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); + +int32_t piFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t expFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t lnFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t modFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t signFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t degreesFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t radiansFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); /* String functions */ int32_t lengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); @@ -73,6 +82,13 @@ int32_t ltrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOut int32_t rtrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t md5Function(SScalarParam* pInput, int32_t inputNum, SScalarParam* pOutput); +int32_t charFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t asciiFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t positionFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t trimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t replaceFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t repeatFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t substrIdxFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); /* Conversion functions */ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); @@ -89,6 +105,10 @@ int32_t timeDiffFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p int32_t nowFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t todayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t timezoneFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t weekdayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t dayofweekFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t weekFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t weekofyearFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); bool getTimePseudoFuncEnv(struct SFunctionNode *pFunc, SFuncExecEnv *pEnv); @@ -106,7 +126,7 @@ int32_t sumScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam * int32_t minScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t maxScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t avgScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); -int32_t stddevScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); +int32_t stdScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t leastSQRScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t percentileScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); int32_t apercentileScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index b8098cc96e..1911c48d26 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -877,6 +877,7 @@ int32_t taosGetErrSize(); #define TSDB_CODE_FUNC_TIME_UNIT_TOO_SMALL TAOS_DEF_ERROR_CODE(0, 0x280B) #define TSDB_CODE_FUNC_INVALID_VALUE_RANGE TAOS_DEF_ERROR_CODE(0, 0x280C) #define TSDB_CODE_FUNC_SETUP_ERROR TAOS_DEF_ERROR_CODE(0, 0x280D) +#define TSDB_CODE_FUNC_INVALID_RES_LENGTH TAOS_DEF_ERROR_CODE(0, 0x280E) //udf diff --git a/include/util/tchecksum.h b/include/util/tchecksum.h index 28fb784c46..9113861d4c 100644 --- a/include/util/tchecksum.h +++ b/include/util/tchecksum.h @@ -29,7 +29,7 @@ static FORCE_INLINE TSCKSUM taosCalcChecksum(TSCKSUM csi, const uint8_t *stream, } static FORCE_INLINE int32_t taosCalcChecksumAppend(TSCKSUM csi, uint8_t *stream, uint32_t ssize) { - if (ssize < sizeof(TSCKSUM)) return -1; + if (ssize < sizeof(TSCKSUM)) return TSDB_CODE_INVALID_PARA; *((TSCKSUM *)(stream + ssize - sizeof(TSCKSUM))) = (*crc32c)(csi, stream, (size_t)(ssize - sizeof(TSCKSUM))); diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index 415c2d6685..70a519d8ae 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -269,6 +269,8 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog TSC_ERR_JRET(catalogAsyncUpdateTSMA(pCatalog, &pTsma, rsp->dbTsmaVersion)); } taosArrayClear(rsp->pTsmaRsp->pTsmas); + } else { + TSC_ERR_JRET(catalogAsyncUpdateDbTsmaVersion(pCatalog, rsp->dbTsmaVersion, rsp->db, rsp->dbId)); } } } diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 8f35a2fad1..0224a20109 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -82,6 +82,8 @@ struct tmq_t { int64_t refId; char groupId[TSDB_CGROUP_LEN]; char clientId[TSDB_CLIENT_ID_LEN]; + char user[TSDB_USER_LEN]; + char fqdn[TSDB_FQDN_LEN]; int8_t withTbName; int8_t useSnapshot; int8_t autoCommit; @@ -1265,6 +1267,10 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) { pTmq->replayEnable = conf->replayEnable; pTmq->sourceExcluded = conf->sourceExcluded; pTmq->enableBatchMeta = conf->enableBatchMeta; + tstrncpy(pTmq->user, user, TSDB_USER_LEN); + if (taosGetFqdn(pTmq->fqdn) != 0) { + (void)strcpy(pTmq->fqdn, "localhost"); + } if (conf->replayEnable) { pTmq->autoCommit = false; } @@ -1332,6 +1338,8 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) { req.consumerId = tmq->consumerId; tstrncpy(req.clientId, tmq->clientId, TSDB_CLIENT_ID_LEN); tstrncpy(req.cgroup, tmq->groupId, TSDB_CGROUP_LEN); + tstrncpy(req.user, tmq->user, TSDB_USER_LEN); + tstrncpy(req.fqdn, tmq->fqdn, TSDB_FQDN_LEN); req.topicNames = taosArrayInit(sz, sizeof(void*)); if (req.topicNames == NULL) { diff --git a/source/client/test/CMakeLists.txt b/source/client/test/CMakeLists.txt index 3d70c67661..054b5af2b9 100644 --- a/source/client/test/CMakeLists.txt +++ b/source/client/test/CMakeLists.txt @@ -35,6 +35,13 @@ TARGET_INCLUDE_DIRECTORIES( PRIVATE "${TD_SOURCE_DIR}/source/client/inc" ) +IF(${TD_LINUX}) + add_test( + NAME clientTest + COMMAND clientTest + ) +ENDIF () + TARGET_INCLUDE_DIRECTORIES( tmqTest PUBLIC "${TD_SOURCE_DIR}/include/client/" diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp index e318ff1972..3e9f16a2a1 100644 --- a/source/client/test/clientTests.cpp +++ b/source/client/test/clientTests.cpp @@ -16,6 +16,7 @@ #include #include #include "clientInt.h" +#include "osSemaphore.h" #include "taoserror.h" #include "tglobal.h" #include "thash.h" @@ -126,6 +127,9 @@ void queryCallback(void* param, void* res, int32_t code) { } (void)printf("start to fetch data\n"); taos_fetch_raw_block_a(res, fetchCallback, param); + taos_free_result(res); + tsem_t *sem = (tsem_t *)param; + tsem_post(sem); } void createNewTable(TAOS* pConn, int32_t index, int32_t numOfRows, int64_t startTs, const char* pVarchar) { @@ -189,7 +193,7 @@ void* queryThread(void* arg) { int64_t el = 0; - for (int32_t i = 0; i < 5000000; ++i) { + for (int32_t i = 0; i < 5; ++i) { int64_t st = taosGetTimestampUs(); TAOS_RES* pRes = taos_query(pConn, "SELECT _wstart as ts,max(usage_user) FROM benchmarkcpu.host_49 WHERE ts >= " @@ -320,6 +324,13 @@ TEST(clientCase, connect_Test) { if (pConn == NULL) { (void)printf("failed to connect to server, reason:%s\n", taos_errstr(NULL)); } + + TAOS_RES* pRes = taos_query(pConn, "drop database abc1"); + if (taos_errno(pRes) != 0) { + (void)printf("error in drop db, reason:%s\n", taos_errstr(pRes)); + } + taos_free_result(pRes); + taos_close(pConn); } @@ -412,7 +423,7 @@ TEST(clientCase, show_db_Test) { int32_t code = taos_print_row(str, pRow, pFields, numOfFields); (void)printf("%s\n", str); } - + taos_free_result(pRes); taos_close(pConn); } @@ -437,6 +448,7 @@ TEST(clientCase, create_db_Test) { if (taos_errno(pRes) != 0) { (void)printf("error in create db, reason:%s\n", taos_errstr(pRes)); } + taos_free_result(pRes); taos_close(pConn); } @@ -473,6 +485,7 @@ TEST(clientCase, drop_dnode_Test) { int32_t numOfFields = taos_num_fields(pRes); ASSERT_EQ(numOfFields, 0); + taos_free_result(pRes); pRes = taos_query(pConn, "drop dnode 4"); if (taos_errno(pRes) != 0) { @@ -498,31 +511,10 @@ TEST(clientCase, use_db_test) { int32_t numOfFields = taos_num_fields(pRes); ASSERT_EQ(numOfFields, 0); + taos_free_result(pRes); taos_close(pConn); } -// TEST(clientCase, drop_db_test) { -// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); -// assert(pConn != NULL); -// -// showDB(pConn); -// -// TAOS_RES* pRes = taos_query(pConn, "drop database abc1"); -// if (taos_errno(pRes) != 0) { -// (void)printf("failed to drop db, reason:%s\n", taos_errstr(pRes)); -// } -// taos_free_result(pRes); -// -// showDB(pConn); -// -// pRes = taos_query(pConn, "create database abc1"); -// if (taos_errno(pRes) != 0) { -// (void)printf("create to drop db, reason:%s\n", taos_errstr(pRes)); -// } -// taos_free_result(pRes); -// taos_close(pConn); -//} - TEST(clientCase, create_stable_Test) { TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); assert(pConn != NULL); @@ -534,6 +526,7 @@ TEST(clientCase, create_stable_Test) { taos_free_result(pRes); pRes = taos_query(pConn, "use abc1"); + taos_free_result(pRes); pRes = taos_query(pConn, "create table if not exists abc1.st1(ts timestamp, k int) tags(a int)"); if (taos_errno(pRes) != 0) { @@ -547,18 +540,6 @@ TEST(clientCase, create_stable_Test) { ASSERT_EQ(numOfFields, 0); taos_free_result(pRes); - // pRes = taos_query(pConn, "create stable if not exists abc1.`123_$^)` (ts timestamp, `abc` int) tags(a int)"); - // if (taos_errno(pRes) != 0) { - // (void)printf("failed to create super table 123_$^), reason:%s\n", taos_errstr(pRes)); - // } - // - // pRes = taos_query(pConn, "use abc1"); - // taos_free_result(pRes); - // pRes = taos_query(pConn, "drop stable `123_$^)`"); - // if (taos_errno(pRes) != 0) { - // (void)printf("failed to drop super table 123_$^), reason:%s\n", taos_errstr(pRes)); - // } - taos_close(pConn); } @@ -743,7 +724,8 @@ TEST(clientCase, show_table_Test) { } taos_free_result(pRes); - (void)taos_query(pConn, "use abc1"); + pRes = taos_query(pConn, "use abc1"); + taos_free_result(pRes); pRes = taos_query(pConn, "show tables"); if (taos_errno(pRes) != 0) { @@ -760,38 +742,15 @@ TEST(clientCase, show_table_Test) { while ((pRow = taos_fetch_row(pRes)) != NULL) { int32_t code = taos_print_row(str, pRow, pFields, numOfFields); - (void)printf("%d: %s\n", ++count, str); + if(code > 0) { + (void)printf("%d: %s\n", ++count, str); + } } taos_free_result(pRes); taos_close(pConn); } -// TEST(clientCase, drop_stable_Test) { -// TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); -// assert(pConn != nullptr); -// -// TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1"); -// if (taos_errno(pRes) != 0) { -// (void)printf("error in creating db, reason:%s\n", taos_errstr(pRes)); -// } -// taos_free_result(pRes); -// -// pRes = taos_query(pConn, "use abc1"); -// if (taos_errno(pRes) != 0) { -// (void)printf("error in using db, reason:%s\n", taos_errstr(pRes)); -// } -// taos_free_result(pRes); -// -// pRes = taos_query(pConn, "drop stable st1"); -// if (taos_errno(pRes) != 0) { -// (void)printf("failed to drop stable, reason:%s\n", taos_errstr(pRes)); -// } -// -// taos_free_result(pRes); -// taos_close(pConn); -// } - TEST(clientCase, generated_request_id_test) { SHashObj* phash = taosHashInit(10000, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_ENTRY_LOCK); @@ -832,11 +791,6 @@ TEST(clientCase, projection_query_tables) { TAOS_RES* pRes = NULL; - // TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 1"); - // if (taos_errno(pRes) != 0) { - // (void)printf("error in create db, reason:%s\n", taos_errstr(pRes)); - // } - // taos_free_result(pRes); pRes= taos_query(pConn, "use abc1"); taos_free_result(pRes); @@ -846,6 +800,12 @@ TEST(clientCase, projection_query_tables) { } taos_free_result(pRes); + pRes = taos_query(pConn, "create table st2 (ts timestamp, v1 int) tags(t1 int)"); + if (taos_errno(pRes) != 0) { + (void)printf("failed to create table tu, reason:%s\n", taos_errstr(pRes)); + } + taos_free_result(pRes); + int64_t start = 1685959190000; const char* pstr = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh" @@ -861,7 +821,7 @@ TEST(clientCase, projection_query_tables) { TAOS_RES* px = taos_query(pConn, str); if (taos_errno(px) != 0) { - (void)printf("failed to create table tu, reason:%s\n", taos_errstr(pRes)); + (void)printf("failed to create table tu, reason:%s\n", taos_errstr(px)); } taos_free_result(px); } @@ -869,26 +829,26 @@ TEST(clientCase, projection_query_tables) { for(int32_t j = 0; j < 1; ++j) { start += 20; for (int32_t i = 0; i < 1; ++i) { - createNewTable(pConn, i, 100000, 0, pstr); + createNewTable(pConn, i, 10000, 0, pstr); } } - pRes = taos_query(pConn, "select * from abc1.st2"); - if (taos_errno(pRes) != 0) { - (void)printf("failed to select from table, reason:%s\n", taos_errstr(pRes)); - taos_free_result(pRes); - ASSERT_TRUE(false); - } + pRes = taos_query(pConn, "select * from abc1.st2"); + if (taos_errno(pRes) != 0) { + (void)printf("failed to select from table, reason:%s\n", taos_errstr(pRes)); + taos_free_result(pRes); + ASSERT_TRUE(false); + } - TAOS_ROW pRow = NULL; - TAOS_FIELD* pFields = taos_fetch_fields(pRes); - int32_t numOfFields = taos_num_fields(pRes); + TAOS_ROW pRow = NULL; + TAOS_FIELD* pFields = taos_fetch_fields(pRes); + int32_t numOfFields = taos_num_fields(pRes); - char str[512] = {0}; - while ((pRow = taos_fetch_row(pRes)) != NULL) { -// int32_t code = taos_print_row(str, pRow, pFields, numOfFields); -// (void)printf("%s\n", str); - } + char str[512] = {0}; + while ((pRow = taos_fetch_row(pRes)) != NULL) { + // int32_t code = taos_print_row(str, pRow, pFields, numOfFields); + // (void)printf("%s\n", str); + } taos_free_result(pRes); taos_close(pConn); @@ -900,7 +860,9 @@ TEST(clientCase, tsbs_perf_test) { for (int32_t i = 0; i < numOfThreads; ++i) { (void)taosThreadCreate(&qid[i], NULL, queryThread, NULL); } - getchar(); + for (int32_t i = 0; i < numOfThreads; ++i) { + (void)taosThreadJoin(qid[i], NULL); + } } TEST(clientCase, projection_query_stables) { @@ -908,14 +870,6 @@ TEST(clientCase, projection_query_stables) { ASSERT_NE(pConn, nullptr); TAOS_RES* pRes = taos_query(pConn, "explain select * from dbvg.st where tbname='ct1'"); -// taos_free_result(pRes); - -// pRes = taos_query(pConn, "select * from st2"); -// if (taos_errno(pRes) != 0) { -// (void)printf("failed to select from table, reason:%s\n", taos_errstr(pRes)); -// taos_free_result(pRes); -// ASSERT_TRUE(false); -// } TAOS_ROW pRow = NULL; TAOS_FIELD* pFields = taos_fetch_fields(pRes); @@ -939,12 +893,6 @@ TEST(clientCase, projection_query_stables) { } //(void)printf("%d\n", i); } -// while ((pRow = taos_fetch_row(pRes)) != NULL) { -// int32_t code = taos_print_row(str, pRow, pFields, numOfFields); -// if (i++ % 100000 == 0) { -// (void)printf("%d\n", i); -// } -// } taos_free_result(pRes); taos_close(pConn); @@ -971,55 +919,41 @@ TEST(clientCase, agg_query_tables) { pRes = taos_query(pConn, s); int32_t ret = taos_errno(pRes); - taos_free_result(pRes); - if (ret == 0) { - break; + + if (ret != 0) { + (void)printf("failed to insert into table, reason:%s\n", taos_errstr(pRes)); } + taos_free_result(pRes); + break; } - -// while (1) { -// sprintf(s, "insert into t2 values(%ld, %d)", st + i, i); -// pRes = taos_query(pConn, s); -// int32_t ret = taos_errno(pRes); -// -// taos_free_result(pRes); -// if (ret == 0) { -// break; -// } -// } } - -// pRes = taos_query(pConn, "show table distributed tup"); -// if (taos_errno(pRes) != 0) { -// (void)printf("failed to select from table, reason:%s\n", taos_errstr(pRes)); -// taos_free_result(pRes); -// ASSERT_TRUE(false); -// } - - printResult(pRes); - taos_free_result(pRes); taos_close(pConn); } -/* ---- copy the following script in the shell to setup the environment --- +// --- copy the following script in the shell to setup the environment --- +// +// create database test; +// use test; +// create table m1(ts timestamp, k int) tags(a int); +// create table tm0 using m1 tags(1); +// create table tm1 using m1 tags(2); +// insert into tm0 values('2021-1-1 1:1:1.120', 1) ('2021-1-1 1:1:2.9', 2) tm1 values('2021-1-1 1:1:1.120', 11) ('2021-1-1 +// 1:1:2.99', 22); -create database test; -use test; -create table m1(ts timestamp, k int) tags(a int); -create table tm0 using m1 tags(1); -create table tm1 using m1 tags(2); -insert into tm0 values('2021-1-1 1:1:1.120', 1) ('2021-1-1 1:1:2.9', 2) tm1 values('2021-1-1 1:1:1.120', 11) ('2021-1-1 -1:1:2.99', 22); - - */ TEST(clientCase, async_api_test) { TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); ASSERT_NE(pConn, nullptr); - (void)taos_query(pConn, "use abc1"); + TAOS_RES* pRes = taos_query(pConn, "use abc1"); + if (taos_errno(pRes) != 0) { + (void)printf("failed to use db, reason:%s\n", taos_errstr(pRes)); + taos_free_result(pRes); + taos_close(pConn); + return; + } + taos_free_result(pRes); - TAOS_RES* pRes = taos_query(pConn, "insert into tu(ts) values('2022-02-27 12:12:61')"); + pRes = taos_query(pConn, "insert into tu(ts) values('2022-02-27 12:12:61')"); if (taos_errno(pRes) != 0) { (void)printf("failed, reason:%s\n", taos_errstr(pRes)); } @@ -1041,9 +975,12 @@ TEST(clientCase, async_api_test) { (void)printf("%s\n", str); (void)memset(str, 0, sizeof(str)); } - - taos_query_a(pConn, "select count(*) from tu", queryCallback, pConn); - (void)getchar(); + taos_free_result(pRes); + tsem_t sem; + (void)tsem_init(&sem, 0, 0); + taos_query_a(pConn, "select count(*) from tu", queryCallback, &sem); + tsem_wait(&sem); + tsem_destroy(&sem); taos_close(pConn); } @@ -1055,6 +992,7 @@ TEST(clientCase, update_test) { if (taos_errno(pRes) != TSDB_CODE_SUCCESS) { (void)printf("failed to create database, code:%s", taos_errstr(pRes)); taos_free_result(pRes); + taos_close(pConn); return; } @@ -1064,6 +1002,7 @@ TEST(clientCase, update_test) { if (taos_errno(pRes) != TSDB_CODE_SUCCESS) { (void)printf("failed to use db, code:%s", taos_errstr(pRes)); taos_free_result(pRes); + taos_close(pConn); return; } taos_free_result(pRes); @@ -1076,11 +1015,12 @@ TEST(clientCase, update_test) { taos_free_result(pRes); char s[256] = {0}; - for (int32_t i = 0; i < 17000; ++i) { + for (int32_t i = 0; i < 10; ++i) { (void)sprintf(s, "insert into tup values(now+%da, %d)", i, i); pRes = taos_query(pConn, s); taos_free_result(pRes); } + taos_close(pConn); } TEST(clientCase, sub_db_test) { @@ -1158,10 +1098,13 @@ TEST(clientCase, sub_db_test) { (void)printf("precision: %d, row content: %s\n", precision, buf); } taos_free_result(pRes); + } else { + break; } } (void)fprintf(stderr, "%d msg consumed, include %d rows\n", msgCnt, totalRows); + taos_close(pConn); } TEST(clientCase, tmq_commit) { @@ -1550,38 +1493,125 @@ TEST(clientCase, sub_tb_mt_test) { } } -//static void concatStrings(SArray *list, char* buf, int size){ -// int len = 0; -// for(int i = 0; i < taosArrayGetSize(list); i++){ -// char* db = (char*)taosArrayGet(list, i); -// char* dot = strchr(db, '.'); -// if (dot != NULL) { -// db = dot + 1; -// } -// if (i != 0){ -// strcat(buf, ","); -// len += 1; -// } -// int ret = snprintf(buf + len, size - len, "%s", db); -// if (ret < 0) { -// (void)printf("snprintf failed, buf:%s, ret:%d", buf, ret); -// break; -// } -// len += ret; -// if (len >= size){ -// (void)printf("dbList is truncated, buf:%s, len:%d", buf, len); -// break; -// } -// } -//} -// -//TEST(clientCase, concat_string_test) { -// SArray* list = taosArrayInit(10, TSDB_DB_FNAME_LEN); -// taosArrayPush(list, "1.db1"); -// taosArrayPush(list, "2.db2"); -// -// char buf[32] = {0}; -// concatStrings(list, buf, sizeof(buf) - 1); -//} +TEST(clientCase, timezone_Test) { + { + // taos_options( TSDB_OPTION_TIMEZONE, "UTC-8"); + int code = taos_options(TSDB_OPTION_TIMEZONE, "UTC-8"); + ASSERT_TRUE(code == 0); + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + ASSERT_NE(pConn, nullptr); + + TAOS_RES* pRes = taos_query(pConn, "drop database if exists db1"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + taos_free_result(pRes); + + pRes = taos_query(pConn, "create database db1"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + taos_free_result(pRes); + + pRes = taos_query(pConn, "create table db1.t1 (ts timestamp, v int)"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + taos_free_result(pRes); + + char sql[256] = {0}; + (void)sprintf(sql, "insert into db1.t1 values('2023-09-16 17:00:00', 1)"); + pRes = taos_query(pConn, sql); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + taos_free_result(pRes); + + pRes = taos_query(pConn, "select * from db1.t1 where ts == '2023-09-16 17:00:00'"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + + TAOS_ROW pRow = NULL; + TAOS_FIELD* pFields = taos_fetch_fields(pRes); + int32_t numOfFields = taos_num_fields(pRes); + + char str[512] = {0}; + int rows = 0; + while ((pRow = taos_fetch_row(pRes)) != NULL) { + rows++; + } + ASSERT_TRUE(rows == 1); + + taos_free_result(pRes); + + taos_close(pConn); + } + + { + // taos_options( TSDB_OPTION_TIMEZONE, "UTC+8"); + int code = taos_options(TSDB_OPTION_TIMEZONE, "UTC+8"); + ASSERT_TRUE(code == 0); + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + ASSERT_NE(pConn, nullptr); + + TAOS_RES* pRes = taos_query(pConn, "select * from db1.t1 where ts == '2023-09-16 01:00:00'"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + + TAOS_ROW pRow = NULL; + TAOS_FIELD* pFields = taos_fetch_fields(pRes); + int32_t numOfFields = taos_num_fields(pRes); + + int rows = 0; + char str[512] = {0}; + while ((pRow = taos_fetch_row(pRes)) != NULL) { + rows++; + } + ASSERT_TRUE(rows == 1); + + taos_free_result(pRes); + + char sql[256] = {0}; + (void)sprintf(sql, "insert into db1.t1 values('2023-09-16 17:00:01', 1)"); + pRes = taos_query(pConn, sql); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + + taos_free_result(pRes); + + taos_close(pConn); + } + + { + // taos_options( TSDB_OPTION_TIMEZONE, "UTC+0"); + int code = taos_options(TSDB_OPTION_TIMEZONE, "UTC+0"); + ASSERT_TRUE(code == 0); + TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0); + ASSERT_NE(pConn, nullptr); + + TAOS_RES* pRes = taos_query(pConn, "select * from db1.t1 where ts == '2023-09-16 09:00:00'"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + + TAOS_ROW pRow = NULL; + TAOS_FIELD* pFields = taos_fetch_fields(pRes); + int32_t numOfFields = taos_num_fields(pRes); + + int rows = 0; + char str[512] = {0}; + while ((pRow = taos_fetch_row(pRes)) != NULL) { + rows++; + } + ASSERT_TRUE(rows == 1); + taos_free_result(pRes); + + { + TAOS_RES* pRes = taos_query(pConn, "select * from db1.t1 where ts == '2023-09-17 01:00:01'"); + ASSERT_EQ(taos_errno(pRes), TSDB_CODE_SUCCESS); + + TAOS_ROW pRow = NULL; + TAOS_FIELD* pFields = taos_fetch_fields(pRes); + int32_t numOfFields = taos_num_fields(pRes); + + int rows = 0; + char str[512] = {0}; + while ((pRow = taos_fetch_row(pRes)) != NULL) { + rows++; + } + ASSERT_TRUE(rows == 1); + taos_free_result(pRes); + } + + taos_close(pConn); + } +} #pragma GCC diagnostic pop diff --git a/source/common/src/cos.c b/source/common/src/cos.c index db0dadbc46..8392b0564a 100644 --- a/source/common/src/cos.c +++ b/source/common/src/cos.c @@ -9,7 +9,7 @@ extern int8_t tsS3EpNum; extern char tsS3Endpoint[][TSDB_FQDN_LEN]; extern char tsS3AccessKeyId[][TSDB_FQDN_LEN]; extern char tsS3AccessKeySecret[][TSDB_FQDN_LEN]; -extern char tsS3BucketName[][TSDB_FQDN_LEN]; +extern char tsS3BucketName[TSDB_FQDN_LEN]; extern char tsS3AppId[][TSDB_FQDN_LEN]; extern char tsS3Hostname[][TSDB_FQDN_LEN]; extern int8_t tsS3Https; @@ -130,13 +130,13 @@ int32_t s3CheckCfg() { (void)fprintf(stderr, "put object %s: success.\n\n", objectname[0]); // list buckets - (void)fprintf(stderr, "start to list bucket %s by prefix s3.\n", tsS3BucketName[i]); - code = s3ListBucketByEp(tsS3BucketName[i], i); + (void)fprintf(stderr, "start to list bucket %s by prefix s3.\n", tsS3BucketName); + code = s3ListBucketByEp(tsS3BucketName, i); if (code != 0) { - (void)fprintf(stderr, "listing bucket %s : failed.\n", tsS3BucketName[i]); + (void)fprintf(stderr, "listing bucket %s : failed.\n", tsS3BucketName); TAOS_CHECK_GOTO(code, &lino, _exit); } - (void)fprintf(stderr, "listing bucket %s: success.\n\n", tsS3BucketName[i]); + (void)fprintf(stderr, "listing bucket %s: success.\n\n", tsS3BucketName); // test range get uint8_t *pBlock = NULL; @@ -974,8 +974,8 @@ int32_t s3PutObjectFromFile2ByEp(const char *file, const char *object_name, int8 data.totalContentLength = data.totalOriginalContentLength = data.contentLength = data.originalContentLength = contentLength; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1057,8 +1057,8 @@ static int32_t s3PutObjectFromFileOffsetByEp(const char *file, const char *objec data.totalContentLength = data.totalOriginalContentLength = data.contentLength = data.originalContentLength = contentLength; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1153,8 +1153,8 @@ static void s3FreeObjectKey(void *pItem) { } static SArray *getListByPrefixByEp(const char *prefix, int8_t epIndex) { - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1221,8 +1221,8 @@ static SArray *getListByPrefix(const char *prefix) { static int32_t s3DeleteObjectsByEp(const char *object_name[], int nobject, int8_t epIndex) { int32_t code = 0; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1297,8 +1297,8 @@ static int32_t s3GetObjectBlockByEp(const char *object_name, int64_t offset, int int64_t ifModifiedSince = -1, ifNotModifiedSince = -1; const char *ifMatch = 0, *ifNotMatch = 0; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1370,8 +1370,8 @@ static int32_t s3GetObjectToFileByEp(const char *object_name, const char *fileNa int64_t ifModifiedSince = -1, ifNotModifiedSince = -1; const char *ifMatch = 0, *ifNotMatch = 0; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], @@ -1447,8 +1447,8 @@ static long s3SizeByEp(const char *object_name, int8_t epIndex) { long size = 0; int status = 0; - S3BucketContext bucketContext = {0, - tsS3BucketName[epIndex], + S3BucketContext bucketContext = {tsS3Hostname[epIndex], + tsS3BucketName, protocolG, uriStyleG, tsS3AccessKeyId[epIndex], diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 2d69a687a6..3f27ab2b2b 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -344,7 +344,9 @@ static const SSysDbTableSchema subscriptionSchema[] = { {.name = "topic_name", .bytes = TSDB_TOPIC_FNAME_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "consumer_group", .bytes = TSDB_CGROUP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, - {.name = "consumer_id", .bytes = 32, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "consumer_id", .bytes = TSDB_CLIENT_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "user", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "fqdn", .bytes = TSDB_FQDN_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "offset", .bytes = TSDB_OFFSET_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "rows", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = false}, }; @@ -480,11 +482,12 @@ static const SSysDbTableSchema connectionsSchema[] = { {.name = "last_access", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, }; - static const SSysDbTableSchema consumerSchema[] = { {.name = "consumer_id", .bytes = TSDB_CONSUMER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "consumer_group", .bytes = TSDB_CGROUP_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "client_id", .bytes = TSDB_CLIENT_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "user", .bytes = TSDB_USER_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, + {.name = "fqdn", .bytes = TSDB_FQDN_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "status", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, {.name = "topics", .bytes = TSDB_TOPIC_FNAME_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY, .sysInfo = false}, /*{.name = "end_point", .bytes = TSDB_IPv4ADDR_LEN + 6 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false},*/ diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 9ddf070adc..6c59ffa279 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -299,7 +299,7 @@ char tsS3Endpoint[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; char tsS3AccessKey[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; char tsS3AccessKeyId[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; char tsS3AccessKeySecret[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; -char tsS3BucketName[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; +char tsS3BucketName[TSDB_FQDN_LEN] = ""; char tsS3AppId[TSDB_MAX_EP_NUM][TSDB_FQDN_LEN] = {""}; int8_t tsS3Enabled = false; int8_t tsS3EnabledCfg = false; @@ -404,10 +404,14 @@ int32_t taosSetS3Cfg(SConfig *pCfg) { } TAOS_CHECK_RETURN(taosSplitS3Cfg(pCfg, "s3Endpoint", tsS3Endpoint, &num)); - if (num != tsS3EpNum) TAOS_RETURN(TSDB_CODE_INVALID_CFG); + if (num != tsS3EpNum) { + uError("invalid s3 ep num:%d, expected:%d, ", num, tsS3EpNum); + TAOS_RETURN(TSDB_CODE_INVALID_CFG); + } - TAOS_CHECK_RETURN(taosSplitS3Cfg(pCfg, "s3BucketName", tsS3BucketName, &num)); - if (num != tsS3EpNum) TAOS_RETURN(TSDB_CODE_INVALID_CFG); + SConfigItem *pItem = NULL; + TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "s3BucketName"); + tstrncpy(tsS3BucketName, pItem->str, TSDB_FQDN_LEN); for (int i = 0; i < tsS3EpNum; ++i) { char *proto = strstr(tsS3Endpoint[i], "https://"); @@ -419,9 +423,9 @@ int32_t taosSetS3Cfg(SConfig *pCfg) { char *cos = strstr(tsS3Endpoint[i], "cos."); if (cos) { - char *appid = strrchr(tsS3BucketName[i], '-'); + char *appid = strrchr(tsS3BucketName, '-'); if (!appid) { - uError("failed to locate appid in bucket:%s", tsS3BucketName[i]); + uError("failed to locate appid in bucket:%s", tsS3BucketName); TAOS_RETURN(TSDB_CODE_INVALID_CFG); } else { tstrncpy(tsS3AppId[i], appid + 1, TSDB_FQDN_LEN); @@ -432,7 +436,7 @@ int32_t taosSetS3Cfg(SConfig *pCfg) { tsS3Https = (strstr(tsS3Endpoint[0], "https://") != NULL); tsS3Oss = (strstr(tsS3Endpoint[0], "aliyuncs.") != NULL); - if (tsS3BucketName[0][0] != '<') { + if (tsS3BucketName[0] != '<') { #if defined(USE_COS) || defined(USE_S3) #ifdef TD_ENTERPRISE /*if (tsDiskCfgNum > 1) */ tsS3Enabled = true; @@ -691,8 +695,8 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { tsNumOfSnodeWriteThreads = tsNumOfCores / 4; tsNumOfSnodeWriteThreads = TRANGE(tsNumOfSnodeWriteThreads, 2, 4); - tsRpcQueueMemoryAllowed = tsTotalMemoryKB * 1024 * 0.1; - tsRpcQueueMemoryAllowed = TRANGE(tsRpcQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10LL, TSDB_MAX_MSG_SIZE * 10000LL); + tsQueueMemoryAllowed = tsTotalMemoryKB * 1024 * 0.1; + tsQueueMemoryAllowed = TRANGE(tsQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10LL, TSDB_MAX_MSG_SIZE * 10000LL); // clang-format off TAOS_CHECK_RETURN(cfgAddDir(pCfg, "dataDir", tsDataDir, CFG_SCOPE_SERVER, CFG_DYN_NONE)); @@ -722,7 +726,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeSharedThreads", tsNumOfSnodeStreamThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "numOfSnodeUniqueThreads", tsNumOfSnodeWriteThreads, 2, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "rpcQueueMemoryAllowed", tsRpcQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10L, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_NONE)); + TAOS_CHECK_RETURN(cfgAddInt64(pCfg, "rpcQueueMemoryAllowed", tsQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10L, INT64_MAX, CFG_SCOPE_BOTH, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncElectInterval", tsElectInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "syncHeartbeatInterval", tsHeartbeatInterval, 10, 1000 * 60 * 24 * 2, CFG_SCOPE_SERVER, CFG_DYN_NONE)); @@ -819,7 +823,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { TAOS_CHECK_RETURN(cfgAddString(pCfg, "s3Accesskey", tsS3AccessKey[0], CFG_SCOPE_SERVER, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddString(pCfg, "s3Endpoint", tsS3Endpoint[0], CFG_SCOPE_SERVER, CFG_DYN_NONE)); - TAOS_CHECK_RETURN(cfgAddString(pCfg, "s3BucketName", tsS3BucketName[0], CFG_SCOPE_SERVER, CFG_DYN_NONE)); + TAOS_CHECK_RETURN(cfgAddString(pCfg, "s3BucketName", tsS3BucketName, CFG_SCOPE_SERVER, CFG_DYN_NONE)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "s3PageCacheSize", tsS3PageCacheSize, 4, 1024 * 1024 * 1024, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER)); TAOS_CHECK_RETURN(cfgAddInt32(pCfg, "s3UploadDelaySec", tsS3UploadDelaySec, 1, 60 * 60 * 24 * 30, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER)); @@ -958,9 +962,9 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) { pItem = cfgGetItem(pCfg, "rpcQueueMemoryAllowed"); if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) { - tsRpcQueueMemoryAllowed = totalMemoryKB * 1024 * 0.1; - tsRpcQueueMemoryAllowed = TRANGE(tsRpcQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10LL, TSDB_MAX_MSG_SIZE * 10000LL); - pItem->i64 = tsRpcQueueMemoryAllowed; + tsQueueMemoryAllowed = totalMemoryKB * 1024 * 0.1; + tsQueueMemoryAllowed = TRANGE(tsQueueMemoryAllowed, TSDB_MAX_MSG_SIZE * 10LL, TSDB_MAX_MSG_SIZE * 10000LL); + pItem->i64 = tsQueueMemoryAllowed; pItem->stype = stype; } @@ -1357,7 +1361,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsNumOfSnodeWriteThreads = pItem->i32; TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "rpcQueueMemoryAllowed"); - tsRpcQueueMemoryAllowed = pItem->i64; + tsQueueMemoryAllowed = pItem->i64; TAOS_CHECK_GET_CFG_ITEM(pCfg, pItem, "simdEnable"); tsSIMDEnable = (bool)pItem->bval; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 740e517e35..4dc59bf6fe 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3824,7 +3824,8 @@ int32_t tSerializeSDbHbRspImp(SEncoder *pEncoder, const SDbHbRsp *pRsp) { if (tEncodeI8(pEncoder, 0) < 0) return -1; } if (tEncodeI32(pEncoder, pRsp->dbTsmaVersion) < 0) return -1; - + if (tEncodeCStr(pEncoder, pRsp->db) < 0) return -1; + if (tEncodeI64(pEncoder, pRsp->dbId) < 0) return -1; return 0; } @@ -3915,6 +3916,10 @@ int32_t tDeserializeSDbHbRspImp(SDecoder *decoder, SDbHbRsp *pRsp) { if (!tDecodeIsEnd(decoder)) { if (tDecodeI32(decoder, &pRsp->dbTsmaVersion) < 0) return -1; } + if (!tDecodeIsEnd(decoder)) { + if (tDecodeCStrTo(decoder, pRsp->db) < 0) return -1; + if (tDecodeI64(decoder, &pRsp->dbId) < 0) return -1; + } return 0; } diff --git a/source/common/src/tname.c b/source/common/src/tname.c index e495547cc5..491c203a58 100644 --- a/source/common/src/tname.c +++ b/source/common/src/tname.c @@ -169,7 +169,7 @@ void tNameAssign(SName* dst, const SName* src) { memcpy(dst, src, sizeof(SName)) int32_t tNameSetDbName(SName* dst, int32_t acct, const char* dbName, size_t nameLen) { // too long account id or too long db name if (nameLen <= 0 || nameLen >= tListLen(dst->dbname)) { - return -1; + return TSDB_CODE_INVALID_PARA; } dst->type = TSDB_DB_NAME_T; diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index 374bb1a673..70f258a362 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -124,7 +124,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { req.numOfSupportVnodes = tsNumOfSupportVnodes; req.numOfDiskCfg = tsDiskCfgNum; req.memTotal = tsTotalMemoryKB * 1024; - req.memAvail = req.memTotal - tsRpcQueueMemoryAllowed - 16 * 1024 * 1024; + req.memAvail = req.memTotal - tsQueueMemoryAllowed - 16 * 1024 * 1024; tstrncpy(req.dnodeEp, tsLocalEp, TSDB_EP_LEN); tstrncpy(req.machineId, pMgmt->pData->machineId, TSDB_MACHINE_ID_LEN + 1); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 8b289a5a57..986bbc4ac8 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -218,7 +218,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { pRpc->info.wrapper = pWrapper; - EQItype itype = IsReq(pRpc) ? RPC_QITEM : DEF_QITEM; // rsp msg is not restricted by tsRpcQueueMemoryUsed + EQItype itype = IsReq(pRpc) ? RPC_QITEM : DEF_QITEM; // rsp msg is not restricted by tsQueueMemoryUsed code = taosAllocateQitem(sizeof(SRpcMsg), itype, pRpc->contLen, (void **)&pMsg); if (code) goto _OVER; diff --git a/source/dnode/mgmt/test/sut/src/sut.cpp b/source/dnode/mgmt/test/sut/src/sut.cpp index f074a015d2..13c8c73f44 100644 --- a/source/dnode/mgmt/test/sut/src/sut.cpp +++ b/source/dnode/mgmt/test/sut/src/sut.cpp @@ -36,7 +36,7 @@ void Testbase::InitLog(const char* path) { tstrncpy(tsLogDir, path, PATH_MAX); taosGetSystemInfo(); - tsRpcQueueMemoryAllowed = tsTotalMemoryKB * 0.1; + tsQueueMemoryAllowed = tsTotalMemoryKB * 0.1; if (taosInitLog("taosdlog", 1, false) != 0) { printf("failed to init log file\n"); } diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 62e77867f6..99e59662ac 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -597,6 +597,8 @@ typedef struct { int64_t consumerId; char cgroup[TSDB_CGROUP_LEN]; char clientId[TSDB_CLIENT_ID_LEN]; + char user[TSDB_USER_LEN]; + char fqdn[TSDB_FQDN_LEN]; int8_t updateType; // used only for update int32_t epoch; int32_t status; diff --git a/source/dnode/mnode/impl/inc/mndStream.h b/source/dnode/mnode/impl/inc/mndStream.h index a5d91c8aa8..88b8e98afb 100644 --- a/source/dnode/mnode/impl/inc/mndStream.h +++ b/source/dnode/mnode/impl/inc/mndStream.h @@ -152,6 +152,7 @@ bool streamTaskIterNextTask(SStreamTaskIter *pIter); int32_t streamTaskIterGetCurrent(SStreamTaskIter *pIter, SStreamTask **pTask); int32_t mndInitExecInfo(); void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo); +void mndInitStreamExecInfoForLeader(SMnode *pMnode); int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot); void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 8f2523d50e..65617ddf31 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -903,6 +903,22 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock * MND_TMQ_NULL_CHECK(pColInfo); MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, numOfRows, (const char *)clientId, false)); + // user + char user[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(user, pConsumer->user); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + MND_TMQ_NULL_CHECK(pColInfo); + MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, numOfRows, (const char *)user, false)); + + // fqdn + char fqdn[TSDB_FQDN_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(fqdn, pConsumer->fqdn); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + MND_TMQ_NULL_CHECK(pColInfo); + MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, numOfRows, (const char *)fqdn, false)); + // status const char *pStatusName = mndConsumerStatusName(pConsumer->status); status = taosMemoryCalloc(1, pShow->pMeta->pSchemas[cols].bytes); diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index dd3f89c9d0..fe5c12419c 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -1843,6 +1843,8 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs, pDbCacheInfo->tsmaVersion = htonl(pDbCacheInfo->tsmaVersion); SDbHbRsp rsp = {0}; + (void)memcpy(rsp.db, pDbCacheInfo->dbFName, TSDB_DB_FNAME_LEN); + rsp.dbId = pDbCacheInfo->dbId; if ((0 == strcasecmp(pDbCacheInfo->dbFName, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcasecmp(pDbCacheInfo->dbFName, TSDB_PERFORMANCE_SCHEMA_DB)))) { diff --git a/source/dnode/mnode/impl/src/mndDef.c b/source/dnode/mnode/impl/src/mndDef.c index 695bf4d30d..c604e58588 100644 --- a/source/dnode/mnode/impl/src/mndDef.c +++ b/source/dnode/mnode/impl/src/mndDef.c @@ -325,6 +325,8 @@ int32_t tNewSMqConsumerObj(int64_t consumerId, char *cgroup, int8_t updateType, pConsumer->resetOffsetCfg = subscribe->resetOffsetCfg; pConsumer->maxPollIntervalMs = subscribe->maxPollIntervalMs; pConsumer->sessionTimeoutMs = subscribe->sessionTimeoutMs; + tstrncpy(pConsumer->user, subscribe->user, TSDB_USER_LEN); + tstrncpy(pConsumer->fqdn, subscribe->fqdn, TSDB_FQDN_LEN); pConsumer->rebNewTopics = taosArrayDup(subscribe->topicNames, topicNameDup); if (pConsumer->rebNewTopics == NULL){ @@ -429,6 +431,8 @@ int32_t tEncodeSMqConsumerObj(void **buf, const SMqConsumerObj *pConsumer) { tlen += taosEncodeFixedI32(buf, pConsumer->resetOffsetCfg); tlen += taosEncodeFixedI32(buf, pConsumer->maxPollIntervalMs); tlen += taosEncodeFixedI32(buf, pConsumer->sessionTimeoutMs); + tlen += taosEncodeString(buf, pConsumer->user); + tlen += taosEncodeString(buf, pConsumer->fqdn); return tlen; } @@ -503,6 +507,8 @@ void *tDecodeSMqConsumerObj(const void *buf, SMqConsumerObj *pConsumer, int8_t s if (sver > 2){ buf = taosDecodeFixedI32(buf, &pConsumer->maxPollIntervalMs); buf = taosDecodeFixedI32(buf, &pConsumer->sessionTimeoutMs); + buf = taosDecodeStringTo(buf, pConsumer->user); + buf = taosDecodeStringTo(buf, pConsumer->fqdn); } else{ pConsumer->maxPollIntervalMs = DEFAULT_MAX_POLL_INTERVAL; pConsumer->sessionTimeoutMs = DEFAULT_SESSION_TIMEOUT; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 11787a015b..25872801e4 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -96,7 +96,7 @@ static void mndPullupTrans(SMnode *pMnode) { void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { SRpcMsg rpcMsg = {.msgType = TDMT_MND_TRANS_TIMER, .pCont = pReq, .contLen = contLen}; - //TODO check return value + // TODO check return value (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } } @@ -107,7 +107,7 @@ static void mndPullupCompacts(SMnode *pMnode) { void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { SRpcMsg rpcMsg = {.msgType = TDMT_MND_COMPACT_TIMER, .pCont = pReq, .contLen = contLen}; - //TODO check return value + // TODO check return value (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } } @@ -117,7 +117,7 @@ static void mndPullupTtl(SMnode *pMnode) { int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); SRpcMsg rpcMsg = {.msgType = TDMT_MND_TTL_TIMER, .pCont = pReq, .contLen = contLen}; - //TODO check return value + // TODO check return value (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } @@ -125,7 +125,7 @@ static void mndPullupTrimDb(SMnode *pMnode) { mTrace("pullup s3migrate"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); - SRpcMsg rpcMsg = {.msgType = TDMT_MND_S3MIGRATE_DB_TIMER, .pCont = pReq, .contLen = contLen}; + SRpcMsg rpcMsg = {.msgType = TDMT_MND_TRIM_DB_TIMER, .pCont = pReq, .contLen = contLen}; // TODO check return value (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } @@ -134,8 +134,8 @@ static void mndPullupS3MigrateDb(SMnode *pMnode) { mTrace("pullup trim"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); - SRpcMsg rpcMsg = {.msgType = TDMT_MND_TRIM_DB_TIMER, .pCont = pReq, .contLen = contLen}; // TODO check return value + SRpcMsg rpcMsg = {.msgType = TDMT_MND_S3MIGRATE_DB_TIMER, .pCont = pReq, .contLen = contLen}; (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } @@ -477,7 +477,7 @@ static int32_t mndCreateDir(SMnode *pMnode, const char *path) { static int32_t mndInitWal(SMnode *pMnode) { int32_t code = 0; - char path[PATH_MAX + 20] = {0}; + char path[PATH_MAX + 20] = {0}; (void)snprintf(path, sizeof(path), "%s%swal", pMnode->path, TD_DIRSEP); SWalCfg cfg = {.vgId = 1, .fsyncPeriod = 0, @@ -490,13 +490,12 @@ static int32_t mndInitWal(SMnode *pMnode) { .encryptKey = {0}}; #if defined(TD_ENTERPRISE) - if(tsiEncryptAlgorithm == DND_CA_SM4 && (tsiEncryptScope & DND_CS_MNODE_WAL) == DND_CS_MNODE_WAL){ - cfg.encryptAlgorithm = (tsiEncryptScope & DND_CS_MNODE_WAL)? tsiEncryptAlgorithm : 0; - if(tsEncryptKey[0] == '\0'){ + if (tsiEncryptAlgorithm == DND_CA_SM4 && (tsiEncryptScope & DND_CS_MNODE_WAL) == DND_CS_MNODE_WAL) { + cfg.encryptAlgorithm = (tsiEncryptScope & DND_CS_MNODE_WAL) ? tsiEncryptAlgorithm : 0; + if (tsEncryptKey[0] == '\0') { code = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; TAOS_RETURN(code); - } - else{ + } else { (void)strncpy(cfg.encryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } } @@ -911,7 +910,7 @@ int32_t mndProcessRpcMsg(SRpcMsg *pMsg, SQueueInfo *pQueueInfo) { } else if (code == 0) { mGTrace("msg:%p, successfully processed", pMsg); } else { - //TODO removve this wrong set code + // TODO removve this wrong set code if (code == -1) { code = terrno; } diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index d2182f2c2c..d601bbf315 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -2835,6 +2835,12 @@ void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo) { pExecInfo->initTaskList = true; } +void mndInitStreamExecInfoForLeader(SMnode* pMnode) { + execInfo.initTaskList = false; + mInfo("init stream execInfo for leader"); + mndInitStreamExecInfo(pMnode, &execInfo); +} + void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo *pExecInfo) { SSdb *pSdb = pMnode->pSdb; SStreamObj *pStream = NULL; diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index b3f8cf0aea..22ac58c9db 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -1330,8 +1330,8 @@ END: TAOS_RETURN(code); } -static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t consumerId, const char *topic, - const char *cgroup, SArray *vgs, SArray *offsetRows) { +static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t consumerId, const char* user, const char* fqdn, + const char *topic, const char *cgroup, SArray *vgs, SArray *offsetRows) { int32_t code = 0; int32_t sz = taosArrayGetSize(vgs); for (int32_t j = 0; j < sz; j++) { @@ -1355,7 +1355,7 @@ static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t cons MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, *numOfRows, (const char *)&pVgEp->vgId, false)); // consumer id - char consumerIdHex[32] = {0}; + char consumerIdHex[TSDB_CONSUMER_ID_LEN] = {0}; (void)sprintf(varDataVal(consumerIdHex), "0x%" PRIx64, consumerId); varDataSetLen(consumerIdHex, strlen(varDataVal(consumerIdHex))); @@ -1363,6 +1363,18 @@ static int32_t buildResult(SSDataBlock *pBlock, int32_t *numOfRows, int64_t cons MND_TMQ_NULL_CHECK(pColInfo); MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, *numOfRows, (const char *)consumerIdHex, consumerId == -1)); + char userStr[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; + if (user) STR_TO_VARSTR(userStr, user); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + MND_TMQ_NULL_CHECK(pColInfo); + MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, *numOfRows, userStr, user == NULL)); + + char fqdnStr[TSDB_FQDN_LEN + VARSTR_HEADER_SIZE] = {0}; + if (fqdn) STR_TO_VARSTR(fqdnStr, fqdn); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + MND_TMQ_NULL_CHECK(pColInfo); + MND_TMQ_RETURN_CHECK(colDataSetVal(pColInfo, *numOfRows, fqdnStr, fqdn == NULL)); + mInfo("mnd show subscriptions: topic %s, consumer:0x%" PRIx64 " cgroup %s vgid %d", varDataVal(topic), consumerId, varDataVal(cgroup), pVgEp->vgId); @@ -1435,16 +1447,25 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock SMqConsumerEp *pConsumerEp = NULL; void *pIter = NULL; + while (1) { pIter = taosHashIterate(pSub->consumerHash, pIter); if (pIter == NULL) break; pConsumerEp = (SMqConsumerEp *)pIter; - MND_TMQ_RETURN_CHECK(buildResult(pBlock, &numOfRows, pConsumerEp->consumerId, topic, cgroup, pConsumerEp->vgs, + char *user = NULL; + char *fqdn = NULL; + SMqConsumerObj *pConsumer = sdbAcquire(pSdb, SDB_CONSUMER, &pConsumerEp->consumerId); + if (pConsumer != NULL) { + user = pConsumer->user; + fqdn = pConsumer->fqdn; + sdbRelease(pSdb, pConsumer); + } + MND_TMQ_RETURN_CHECK(buildResult(pBlock, &numOfRows, pConsumerEp->consumerId, user, fqdn, topic, cgroup, pConsumerEp->vgs, pConsumerEp->offsetRows)); } - MND_TMQ_RETURN_CHECK(buildResult(pBlock, &numOfRows, -1, topic, cgroup, pSub->unassignedVgs, pSub->offsetRows)); + MND_TMQ_RETURN_CHECK(buildResult(pBlock, &numOfRows, -1, NULL, NULL, topic, cgroup, pSub->unassignedVgs, pSub->offsetRows)); pBlock->info.rows = numOfRows; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 89f3c6e253..d4327eb4db 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -18,6 +18,7 @@ #include "mndCluster.h" #include "mndTrans.h" #include "mndUser.h" +#include "mndStream.h" static int32_t mndSyncEqCtrlMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { if (pMsg == NULL || pMsg->pCont == NULL) { @@ -183,7 +184,7 @@ int32_t mndProcessWriteMsg(SMnode *pMnode, SRpcMsg *pMsg, SFsmCbMeta *pMeta) { code = mndTransValidate(pMnode, pRaw); if (code != 0) { mError("trans:%d, failed to validate requested trans since %s", transId, terrstr()); - code = 0; + // code = 0; pMeta->code = code; goto _OUT; } @@ -191,7 +192,7 @@ int32_t mndProcessWriteMsg(SMnode *pMnode, SRpcMsg *pMsg, SFsmCbMeta *pMeta) { code = sdbWriteWithoutFree(pMnode->pSdb, pRaw); if (code != 0) { mError("trans:%d, failed to write to sdb since %s", transId, terrstr()); - code = 0; + // code = 0; pMeta->code = code; goto _OUT; } @@ -206,7 +207,10 @@ int32_t mndProcessWriteMsg(SMnode *pMnode, SRpcMsg *pMsg, SFsmCbMeta *pMeta) { if (pTrans->stage == TRN_STAGE_PREPARE) { bool continueExec = mndTransPerformPrepareStage(pMnode, pTrans, false); - if (!continueExec) goto _OUT; + if (!continueExec) { + if (terrno != 0) code = terrno; + goto _OUT; + } } mndTransRefresh(pMnode, pTrans); @@ -381,6 +385,7 @@ static void mndBecomeLearner(const SSyncFSM *pFsm) { static void mndBecomeLeader(const SSyncFSM *pFsm) { mInfo("vgId:1, become leader"); SMnode *pMnode = pFsm->data; + mndInitStreamExecInfoForLeader(pMnode); } static bool mndApplyQueueEmpty(const SSyncFSM *pFsm) { diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 7f8d63c8e0..ab236007a1 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -1569,6 +1569,7 @@ static int32_t mndTransExecuteUndoActionsSerial(SMnode *pMnode, STrans *pTrans, bool mndTransPerformPrepareStage(SMnode *pMnode, STrans *pTrans, bool topHalf) { bool continueExec = true; int32_t code = 0; + terrno = 0; int32_t numOfActions = taosArrayGetSize(pTrans->prepareActions); if (numOfActions == 0) goto _OVER; @@ -1579,7 +1580,9 @@ bool mndTransPerformPrepareStage(SMnode *pMnode, STrans *pTrans, bool topHalf) { STransAction *pAction = taosArrayGet(pTrans->prepareActions, action); code = mndTransExecSingleAction(pMnode, pTrans, pAction, topHalf); if (code != 0) { - mError("trans:%d, failed to execute prepare action:%d, numOfActions:%d", pTrans->id, action, numOfActions); + terrno = code; + mError("trans:%d, failed to execute prepare action:%d, numOfActions:%d, since %s", pTrans->id, action, + numOfActions, tstrerror(code)); return false; } } diff --git a/source/dnode/mnode/impl/test/stream/stream.cpp b/source/dnode/mnode/impl/test/stream/stream.cpp index 1ec319381d..4c63c2ba2c 100644 --- a/source/dnode/mnode/impl/test/stream/stream.cpp +++ b/source/dnode/mnode/impl/test/stream/stream.cpp @@ -259,7 +259,7 @@ TEST_F(StreamTest, kill_checkpoint_trans) { TEST_F(StreamTest, plan_Test) { char* ast = "{\"NodeType\":\"101\",\"Name\":\"SelectStmt\",\"SelectStmt\":{\"Distinct\":false,\"Projections\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_1\",\"UserAlias\":\"_wstart\",\"Name\":\"_wstart\",\"Id\":\"89\",\"Type\":\"3505\",\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_2\",\"UserAlias\":\"sum(voltage)\",\"Name\":\"sum\",\"Id\":\"1\",\"Type\":\"14\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"voltage\",\"UserAlias\":\"voltage\",\"TableId\":\"6555383776122680534\",\"TableType\":\"1\",\"ColId\":\"3\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"meters\",\"TableAlias\":\"meters\",\"ColName\":\"voltage\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"#expr_3\",\"UserAlias\":\"groupid\",\"Name\":\"_group_key\",\"Id\":\"96\",\"Type\":\"3754\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"#expr_3\",\"UserAlias\":\"groupid\",\"TableId\":\"6555383776122680534\",\"TableType\":\"1\",\"ColId\":\"5\",\"ProjId\":\"0\",\"ColType\":\"2\",\"DbName\":\"test\",\"TableName\":\"meters\",\"TableAlias\":\"meters\",\"ColName\":\"groupid\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}}],\"From\":{\"NodeType\":\"6\",\"Name\":\"RealTable\",\"RealTable\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"0\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"DbName\":\"test\",\"tableName\":\"meters\",\"tableAlias\":\"meters\",\"MetaSize\":\"475\",\"Meta\":{\"VgId\":\"0\",\"TableType\":\"1\",\"Uid\":\"6555383776122680534\",\"Suid\":\"6555383776122680534\",\"Sversion\":\"1\",\"Tversion\":\"1\",\"ComInfo\":{\"NumOfTags\":\"2\",\"Precision\":\"0\",\"NumOfColumns\":\"4\",\"RowSize\":\"20\"},\"ColSchemas\":[{\"Type\":\"9\",\"ColId\":\"1\",\"bytes\":\"8\",\"Name\":\"ts\"},{\"Type\":\"6\",\"ColId\":\"2\",\"bytes\":\"4\",\"Name\":\"current\"},{\"Type\":\"4\",\"ColId\":\"3\",\"bytes\":\"4\",\"Name\":\"voltage\"},{\"Type\":\"6\",\"ColId\":\"4\",\"bytes\":\"4\",\"Name\":\"phase\"},{\"Type\":\"4\",\"ColId\":\"5\",\"bytes\":\"4\",\"Name\":\"groupid\"},{\"Type\":\"8\",\"ColId\":\"6\",\"bytes\":\"26\",\"Name\":\"location\"}]},\"VgroupsInfoSize\":\"1340\",\"VgroupsInfo\":{\"Num\":\"2\",\"Vgroups\":[{\"VgId\":\"2\",\"HashBegin\":\"0\",\"HashEnd\":\"2147483646\",\"EpSet\":{\"InUse\":\"0\",\"NumOfEps\":\"1\",\"Eps\":[{\"Fqdn\":\"localhost\",\"Port\":\"6030\"}]},\"NumOfTable\":\"0\"},{\"VgId\":\"3\",\"HashBegin\":\"2147483647\",\"HashEnd\":\"4294967295\",\"EpSet\":{\"InUse\":\"0\",\"NumOfEps\":\"1\",\"Eps\":[{\"Fqdn\":\"localhost\",\"Port\":\"6030\"}]},\"NumOfTable\":\"0\"}]}}},\"PartitionBy\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"groupid\",\"UserAlias\":\"groupid\",\"TableId\":\"6555383776122680534\",\"TableType\":\"1\",\"ColId\":\"5\",\"ProjId\":\"0\",\"ColType\":\"2\",\"DbName\":\"test\",\"TableName\":\"meters\",\"TableAlias\":\"meters\",\"ColName\":\"groupid\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"Window\":{\"NodeType\":\"14\",\"Name\":\"IntervalWindow\",\"IntervalWindow\":{\"Interval\":{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"115\",\"Bytes\":\"8\"},\"AliasName\":\"c804c3a15ebe05b5baf40ad5ee12be1f\",\"UserAlias\":\"2s\",\"LiteralSize\":\"2\",\"Literal\":\"2s\",\"Duration\":true,\"Translate\":true,\"NotReserved\":false,\"IsNull\":false,\"Unit\":\"115\",\"Datum\":\"2000\"}},\"TsPk\":{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"6555383776122680534\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"meters\",\"TableAlias\":\"meters\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}}},\"StmtName\":\"0x1580095ba\",\"HasAggFuncs\":true}}"; - // char* ast = "{\"NodeType\":\"101\",\"Name\":\"SelectStmt\",\"SelectStmt\":{\"Distinct\":false,\"Projections\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_1\",\"UserAlias\":\"wstart\",\"Name\":\"_wstart\",\"Id\":\"89\",\"Type\":\"3505\",\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"#expr_2\",\"UserAlias\":\"min(c1)\",\"Name\":\"min\",\"Id\":\"2\",\"Type\":\"8\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"c1\",\"UserAlias\":\"c1\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"2\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c1\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"3\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"#expr_3\",\"UserAlias\":\"max(c2)\",\"Name\":\"max\",\"Id\":\"3\",\"Type\":\"7\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"3\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"c2\",\"UserAlias\":\"c2\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"3\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c2\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_4\",\"UserAlias\":\"sum(c3)\",\"Name\":\"sum\",\"Id\":\"1\",\"Type\":\"14\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"c3\",\"UserAlias\":\"c3\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"4\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c3\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_5\",\"UserAlias\":\"first(c4)\",\"Name\":\"first\",\"Id\":\"33\",\"Type\":\"504\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c4\",\"UserAlias\":\"c4\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"5\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c4\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"11\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"#expr_6\",\"UserAlias\":\"last(c5)\",\"Name\":\"last\",\"Id\":\"36\",\"Type\":\"506\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"11\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"c5\",\"UserAlias\":\"c5\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"6\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c5\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"12\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_7\",\"UserAlias\":\"apercentile(c6, 50)\",\"Name\":\"apercentile\",\"Id\":\"12\",\"Type\":\"1\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"12\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"c6\",\"UserAlias\":\"c6\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"7\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c6\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c0c7c76d30bd3dcaefc96f40275bdc0a\",\"UserAlias\":\"50\",\"LiteralSize\":\"2\",\"Literal\":\"50\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"50\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"13\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_8\",\"UserAlias\":\"avg(c7)\",\"Name\":\"avg\",\"Id\":\"8\",\"Type\":\"2\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"13\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"c7\",\"UserAlias\":\"c7\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"8\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c7\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"14\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_9\",\"UserAlias\":\"count(c8)\",\"Name\":\"count\",\"Id\":\"0\",\"Type\":\"3\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"14\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c8\",\"UserAlias\":\"c8\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"9\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c8\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"6\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_10\",\"UserAlias\":\"spread(c1)\",\"Name\":\"spread\",\"Id\":\"17\",\"Type\":\"11\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"c1\",\"UserAlias\":\"c1\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"2\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c1\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_11\",\"UserAlias\":\"stddev(c2)\",\"Name\":\"stddev\",\"Id\":\"4\",\"Type\":\"12\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"3\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"c2\",\"UserAlias\":\"c2\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"3\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c2\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"8\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_12\",\"UserAlias\":\"hyperloglog(c11)\",\"Name\":\"hyperloglog\",\"Id\":\"43\",\"Type\":\"17\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"8\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c11\",\"UserAlias\":\"c11\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"12\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c11\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"10\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"26\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_13\",\"UserAlias\":\"timediff(1, 0, 1h)\",\"Name\":\"timediff\",\"Id\":\"81\",\"Type\":\"2501\",\"Parameters\":[{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c4ca4238a0b923820dcc509a6f75849b\",\"UserAlias\":\"1\",\"LiteralSize\":\"1\",\"Literal\":\"1\",\"Duration\":false,\"Translate\":true,\"NotReserved\":false,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"1\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"cfcd208495d565ef66e7dff9f98764da\",\"UserAlias\":\"0\",\"LiteralSize\":\"1\",\"Literal\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":false,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"104\",\"Bytes\":\"8\"},\"AliasName\":\"7c68645d71b803bf0ba2f22519f73e08\",\"UserAlias\":\"1h\",\"LiteralSize\":\"2\",\"Literal\":\"1h\",\"Duration\":true,\"Translate\":true,\"NotReserved\":false,\"IsNull\":false,\"Unit\":\"104\",\"Datum\":\"3600000\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"1\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"8\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"96\"},\"AliasName\":\"#expr_14\",\"UserAlias\":\"timezone()\",\"Name\":\"timezone\",\"Id\":\"84\",\"Type\":\"2503\",\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}}],\"From\":{\"NodeType\":\"6\",\"Name\":\"RealTable\",\"RealTable\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"0\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"DbName\":\"test\",\"tableName\":\"at_once_interval_ext_stb\",\"tableAlias\":\"at_once_interval_ext_stb\",\"MetaSize\":\"2008\",\"Meta\":{\"VgId\":\"0\",\"TableType\":\"1\",\"Uid\":\"5129202035162885657\",\"Suid\":\"5129202035162885657\",\"Sversion\":\"1\",\"Tversion\":\"1\",\"ComInfo\":{\"NumOfTags\":\"13\",\"Precision\":\"0\",\"NumOfColumns\":\"14\",\"RowSize\":\"85\"},\"ColSchemas\":[{\"Type\":\"9\",\"ColId\":\"1\",\"bytes\":\"8\",\"Name\":\"ts\"},{\"Type\":\"2\",\"ColId\":\"2\",\"bytes\":\"1\",\"Name\":\"c1\"},{\"Type\":\"3\",\"ColId\":\"3\",\"bytes\":\"2\",\"Name\":\"c2\"},{\"Type\":\"4\",\"ColId\":\"4\",\"bytes\":\"4\",\"Name\":\"c3\"},{\"Type\":\"5\",\"ColId\":\"5\",\"bytes\":\"8\",\"Name\":\"c4\"},{\"Type\":\"11\",\"ColId\":\"6\",\"bytes\":\"1\",\"Name\":\"c5\"},{\"Type\":\"12\",\"ColId\":\"7\",\"bytes\":\"2\",\"Name\":\"c6\"},{\"Type\":\"13\",\"ColId\":\"8\",\"bytes\":\"4\",\"Name\":\"c7\"},{\"Type\":\"14\",\"ColId\":\"9\",\"bytes\":\"8\",\"Name\":\"c8\"},{\"Type\":\"6\",\"ColId\":\"10\",\"bytes\":\"4\",\"Name\":\"c9\"},{\"Type\":\"7\",\"ColId\":\"11\",\"bytes\":\"8\",\"Name\":\"c10\"},{\"Type\":\"8\",\"ColId\":\"12\",\"bytes\":\"8\",\"Name\":\"c11\"},{\"Type\":\"10\",\"ColId\":\"13\",\"bytes\":\"26\",\"Name\":\"c12\"},{\"Type\":\"1\",\"ColId\":\"14\",\"bytes\":\"1\",\"Name\":\"c13\"},{\"Type\":\"2\",\"ColId\":\"15\",\"bytes\":\"1\",\"Name\":\"t1\"},{\"Type\":\"3\",\"ColId\":\"16\",\"bytes\":\"2\",\"Name\":\"t2\"},{\"Type\":\"4\",\"ColId\":\"17\",\"bytes\":\"4\",\"Name\":\"t3\"},{\"Type\":\"5\",\"ColId\":\"18\",\"bytes\":\"8\",\"Name\":\"t4\"},{\"Type\":\"11\",\"ColId\":\"19\",\"bytes\":\"1\",\"Name\":\"t5\"},{\"Type\":\"12\",\"ColId\":\"20\",\"bytes\":\"2\",\"Name\":\"t6\"},{\"Type\":\"13\",\"ColId\":\"21\",\"bytes\":\"4\",\"Name\":\"t7\"},{\"Type\":\"14\",\"ColId\":\"22\",\"bytes\":\"8\",\"Name\":\"t8\"},{\"Type\":\"6\",\"ColId\":\"23\",\"bytes\":\"4\",\"Name\":\"t9\"},{\"Type\":\"7\",\"ColId\":\"24\",\"bytes\":\"8\",\"Name\":\"t10\"},{\"Type\":\"8\",\"ColId\":\"25\",\"bytes\":\"8\",\"Name\":\"t11\"},{\"Type\":\"10\",\"ColId\":\"26\",\"bytes\":\"26\",\"Name\":\"t12\"},{\"Type\":\"1\",\"ColId\":\"27\",\"bytes\":\"1\",\"Name\":\"t13\"}]},\"VgroupsInfoSize\":\"1340\",\"VgroupsInfo\":{\"Num\":\"2\",\"Vgroups\":[{\"VgId\":\"14\",\"HashBegin\":\"0\",\"HashEnd\":\"2147483646\",\"EpSet\":{\"InUse\":\"0\",\"NumOfEps\":\"1\",\"Eps\":[{\"Fqdn\":\"localhost\",\"Port\":\"6030\"}]},\"NumOfTable\":\"0\"},{\"VgId\":\"15\",\"HashBegin\":\"2147483647\",\"HashEnd\":\"4294967295\",\"EpSet\":{\"InUse\":\"0\",\"NumOfEps\":\"1\",\"Eps\":[{\"Fqdn\":\"localhost\",\"Port\":\"6030\"}]},\"NumOfTable\":\"0\"}]}}},\"Tags\":[{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"0\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":false,\"NotReserved\":false,\"IsNull\":true,\"Unit\":\"0\"}}],\"Window\":{\"NodeType\":\"14\",\"Name\":\"IntervalWindow\",\"IntervalWindow\":{\"Interval\":{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"115\",\"Bytes\":\"8\"},\"AliasName\":\"1fd7635317edfeca9054894ac9ef9b5e\",\"UserAlias\":\"14s\",\"LiteralSize\":\"3\",\"Literal\":\"14s\",\"Duration\":true,\"Translate\":true,\"NotReserved\":false,\"IsNull\":false,\"Unit\":\"115\",\"Datum\":\"14000\"}},\"TsPk\":{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}}},\"StmtName\":\"0x150146d14\",\"HasAggFuncs\":true}}"; + // char* ast = "{\"NodeType\":\"101\",\"Name\":\"SelectStmt\",\"SelectStmt\":{\"Distinct\":false,\"Projections\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_1\",\"UserAlias\":\"wstart\",\"Name\":\"_wstart\",\"Id\":\"89\",\"Type\":\"3505\",\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"#expr_2\",\"UserAlias\":\"min(c1)\",\"Name\":\"min\",\"Id\":\"2\",\"Type\":\"8\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"c1\",\"UserAlias\":\"c1\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"2\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c1\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"3\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"#expr_3\",\"UserAlias\":\"max(c2)\",\"Name\":\"max\",\"Id\":\"3\",\"Type\":\"7\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"3\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"c2\",\"UserAlias\":\"c2\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"3\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c2\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_4\",\"UserAlias\":\"sum(c3)\",\"Name\":\"sum\",\"Id\":\"1\",\"Type\":\"14\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"4\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"c3\",\"UserAlias\":\"c3\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"4\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c3\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_5\",\"UserAlias\":\"first(c4)\",\"Name\":\"first\",\"Id\":\"33\",\"Type\":\"504\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c4\",\"UserAlias\":\"c4\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"5\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c4\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"11\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"#expr_6\",\"UserAlias\":\"last(c5)\",\"Name\":\"last\",\"Id\":\"36\",\"Type\":\"506\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"11\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"c5\",\"UserAlias\":\"c5\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"6\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c5\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"9\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"ts\",\"UserAlias\":\"ts\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"1\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"ts\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"12\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_7\",\"UserAlias\":\"apercentile(c6, 50)\",\"Name\":\"apercentile\",\"Id\":\"12\",\"Type\":\"1\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"12\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"2\"},\"AliasName\":\"c6\",\"UserAlias\":\"c6\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"7\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c6\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c0c7c76d30bd3dcaefc96f40275bdc0a\",\"UserAlias\":\"50\",\"LiteralSize\":\"2\",\"Literal\":\"50\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"50\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"13\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"7\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_8\",\"UserAlias\":\"avg(c7)\",\"Name\":\"avg\",\"Id\":\"8\",\"Type\":\"2\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"13\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"c7\",\"UserAlias\":\"c7\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"8\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c7\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"14\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"5\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"#expr_9\",\"UserAlias\":\"count(c8)\",\"Name\":\"count\",\"Id\":\"0\",\"Type\":\"3\",\"Parameters\":[{\"NodeType\":\"1\",\"Name\":\"Column\",\"Column\":{\"DataType\":{\"Type\":\"14\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"8\"},\"AliasName\":\"c8\",\"UserAlias\":\"c8\",\"TableId\":\"5129202035162885657\",\"TableType\":\"1\",\"ColId\":\"9\",\"ProjId\":\"0\",\"ColType\":\"1\",\"DbName\":\"test\",\"TableName\":\"at_once_interval_ext_stb\",\"TableAlias\":\"at_once_interval_ext_stb\",\"ColName\":\"c8\",\"DataBlockId\":\"0\",\"SlotId\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"2\",\"Name\":\"Value\",\"Value\":{\"DataType\":{\"Type\":\"2\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"1\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"LiteralSize\":\"0\",\"Duration\":false,\"Translate\":true,\"NotReserved\":true,\"IsNull\":false,\"Unit\":\"0\",\"Datum\":\"0\"}}],\"UdfBufSize\":\"0\"}},{\"NodeType\":\"5\",\"Name\":\"Function\",\"Function\":{\"DataType\":{\"Type\":\"6\",\"Precision\":\"0\",\"Scale\":\"0\",\"Bytes\":\"4\"},\"AliasName\":\"\",\"UserAlias\":\"\",\"Name\":\"cast\",\"Id\":\"77\",\"Type\":\"2000\",\"Parameters\":[{\"Node SNode * pAst = NULL; SQueryPlan *pPlan = NULL; diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index f6f86850a4..ab5b07581a 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -343,7 +343,6 @@ typedef struct { rocksdb_readoptions_t *readoptions; rocksdb_writebatch_t *writebatch; rocksdb_writebatch_t *rwritebatch; - TdThreadMutex rMutex; STSchema *pTSchema; } SRocksCache; @@ -915,12 +914,20 @@ typedef enum { READER_EXEC_ROWS = 0x2, } EExecMode; -#define LAST_COL_VERSION (0x1) +#define LAST_COL_VERSION_1 (0x1) // add primary key, version +#define LAST_COL_VERSION_2 (0x2) // add cache status +#define LAST_COL_VERSION LAST_COL_VERSION_2 + +typedef enum { + TSDB_LAST_CACHE_VALID = 0, // last_cache has valid data + TSDB_LAST_CACHE_NO_CACHE, // last_cache has no data, but tsdb may have data +} ELastCacheStatus; typedef struct { - SRowKey rowKey; - int8_t dirty; - SColVal colVal; + SRowKey rowKey; + int8_t dirty; + SColVal colVal; + ELastCacheStatus cacheStatus; } SLastCol; typedef struct { diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 3d4067ba99..98f5615f5e 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -271,7 +271,7 @@ int32_t metaCacheUpsert(SMeta* pMeta, SMetaInfo* pInfo) { if (*ppEntry) { // update if (pInfo->suid != (*ppEntry)->info.suid) { metaError("meta/cache: suid should be same as the one in cache."); - return TSDB_CODE_FAILED; + return TSDB_CODE_INVALID_PARA; } if (pInfo->version > (*ppEntry)->info.version) { (*ppEntry)->info.version = pInfo->version; @@ -543,7 +543,7 @@ int32_t metaGetCachedTableUidList(void* pVnode, tb_uid_t suid, const uint8_t* pK STagFilterResEntry** pEntry = taosHashGet(pTableMap, &suid, sizeof(uint64_t)); if (NULL == pEntry) { metaError("meta/cache: pEntry should not be NULL."); - return TSDB_CODE_FAILED; + return TSDB_CODE_NOT_FOUND; } *acquireRes = 1; @@ -750,7 +750,7 @@ int32_t metaGetCachedTbGroup(void* pVnode, tb_uid_t suid, const uint8_t* pKey, i STagFilterResEntry** pEntry = taosHashGet(pTableMap, &suid, sizeof(uint64_t)); if (NULL == pEntry) { metaDebug("suid %" PRIu64 " not in tb group cache", suid); - return TSDB_CODE_FAILED; + return TSDB_CODE_NOT_FOUND; } *pList = taosArrayDup(taosLRUCacheValue(pCache, pHandle), NULL); diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 3abd185f0f..bee4727260 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -275,12 +275,14 @@ void metaPauseTbCursor(SMTbCursor *pTbCur) { int32_t metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first, int8_t move) { int32_t code = 0; int32_t lino; - + int8_t locked = 0; if (pTbCur->paused) { metaReaderDoInit(&pTbCur->mr, pTbCur->pMeta, META_READER_LOCK); - + locked = 1; code = tdbTbcOpen(((SMeta *)pTbCur->pMeta)->pUidIdx, (TBC **)&pTbCur->pDbc, NULL); - TSDB_CHECK_CODE(code, lino, _exit); + if (code != 0) { + TSDB_CHECK_CODE(code, lino, _exit); + } if (first) { code = tdbTbcMoveToFirst((TBC *)pTbCur->pDbc); @@ -304,6 +306,9 @@ int32_t metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first, int8_t move) { } _exit: + if (code != 0 && locked) { + metaReaderReleaseLock(&pTbCur->mr); + } return code; } @@ -791,6 +796,7 @@ void metaCloseSmaCursor(SMSmaCursor *pSmaCur) { if (pSmaCur->pMeta) metaULock(pSmaCur->pMeta); if (pSmaCur->pCur) { (void)tdbTbcClose(pSmaCur->pCur); + pSmaCur->pCur = NULL; tdbFree(pSmaCur->pKey); tdbFree(pSmaCur->pVal); @@ -1307,7 +1313,8 @@ int32_t metaFilterTableIds(void *pVnode, SMetaFltParam *arg, SArray *pUids) { } TAOS_CHECK_GOTO(metaCreateTagIdxKey(pCursor->suid, pCursor->cid, tagData, nTagData, pCursor->type, - param->reverse ? INT64_MAX : INT64_MIN, &pKey, &nKey), NULL, END); + param->reverse ? INT64_MAX : INT64_MIN, &pKey, &nKey), + NULL, END); int cmp = 0; TAOS_CHECK_GOTO(tdbTbcMoveTo(pCursor->pCur, pKey, nKey, &cmp), 0, END); diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 1216f0da81..cf1728f1fe 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -224,9 +224,6 @@ static int32_t tsdbOpenRocksCache(STsdb *pTsdb) { pTsdb->rCache.readoptions = readoptions; pTsdb->rCache.flushoptions = flushoptions; pTsdb->rCache.db = db; - - (void)taosThreadMutexInit(&pTsdb->rCache.rMutex, NULL); - pTsdb->rCache.pTSchema = NULL; TAOS_RETURN(code); @@ -258,22 +255,11 @@ static void tsdbCloseRocksCache(STsdb *pTsdb) { rocksdb_block_based_options_destroy(pTsdb->rCache.tableoptions); rocksdb_cache_destroy(pTsdb->rCache.blockcache); rocksdb_comparator_destroy(pTsdb->rCache.my_comparator); - (void)taosThreadMutexDestroy(&pTsdb->rCache.rMutex); taosMemoryFree(pTsdb->rCache.pTSchema); } -static void rocksMayWrite(STsdb *pTsdb, bool force, bool read, bool lock) { - rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; - if (read) { - if (lock) { - (void)taosThreadMutexLock(&pTsdb->lruMutex); - } - wb = pTsdb->rCache.rwritebatch; - } else { - if (lock) { - (void)taosThreadMutexLock(&pTsdb->rCache.rMutex); - } - } +static void rocksMayWrite(STsdb *pTsdb, bool force, bool read) { + rocksdb_writebatch_t *wb = read ? pTsdb->rCache.rwritebatch : pTsdb->rCache.writebatch; int count = rocksdb_writebatch_count(wb); if ((force && count > 0) || count >= ROCKS_BATCH_SIZE) { @@ -289,14 +275,6 @@ static void rocksMayWrite(STsdb *pTsdb, bool force, bool read, bool lock) { rocksdb_writebatch_clear(wb); } - - if (lock) { - if (read) { - (void)taosThreadMutexUnlock(&pTsdb->lruMutex); - } else { - (void)taosThreadMutexUnlock(&pTsdb->rCache.rMutex); - } - } } typedef struct { @@ -326,6 +304,8 @@ static int32_t tsdbCacheDeserializeV0(char const *value, SLastCol *pLastCol) { pLastCol->colVal.flag = pLastColV0->colVal.flag; pLastCol->colVal.value.type = pLastColV0->colVal.type; + pLastCol->cacheStatus = TSDB_LAST_CACHE_VALID; + if (IS_VAR_DATA_TYPE(pLastCol->colVal.value.type)) { pLastCol->colVal.value.nData = pLastColV0->colVal.value.nData; pLastCol->colVal.value.pData = NULL; @@ -383,6 +363,10 @@ static int32_t tsdbCacheDeserialize(char const *value, size_t size, SLastCol **p } } + if (version >= LAST_COL_VERSION_2) { + pLastCol->cacheStatus = *(uint8_t *)(value + offset); + } + if (offset > size) { taosMemoryFreeClear(pLastCol); @@ -434,7 +418,7 @@ static int32_t tsdbCacheSerialize(SLastCol *pLastCol, char **value, size_t *size if (IS_VAR_DATA_TYPE(pLastCol->colVal.value.type)) { *size += pLastCol->colVal.value.nData; } - *size += sizeof(uint8_t) + sizeof(uint8_t); // version + numOfPKs + *size += sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t); // version + numOfPKs + cacheStatus for (int8_t i = 0; i < pLastCol->rowKey.numOfPKs; i++) { *size += sizeof(SValue); @@ -470,6 +454,8 @@ static int32_t tsdbCacheSerialize(SLastCol *pLastCol, char **value, size_t *size } } + ((uint8_t *)(*value + offset))[0] = pLastCol->cacheStatus; + TAOS_RETURN(TSDB_CODE_SUCCESS); } @@ -487,8 +473,6 @@ static void tsdbCachePutBatch(SLastCol *pLastCol, const void *key, size_t klen, return; } - (void)taosThreadMutexLock(&rCache->rMutex); - rocksdb_writebatch_put(wb, (char *)key, klen, rocks_value, vlen); taosMemoryFree(rocks_value); @@ -507,8 +491,6 @@ static void tsdbCachePutBatch(SLastCol *pLastCol, const void *key, size_t klen, state->flush_count = 0; } - - (void)taosThreadMutexUnlock(&rCache->rMutex); } int tsdbCacheFlushDirty(const void *key, size_t klen, void *value, void *ud) { @@ -534,8 +516,8 @@ int32_t tsdbCacheCommit(STsdb *pTsdb) { taosLRUCacheApply(pCache, tsdbCacheFlushDirty, &pTsdb->flushState); - rocksMayWrite(pTsdb, true, false, false); - rocksMayWrite(pTsdb, true, true, false); + rocksMayWrite(pTsdb, true, false); + rocksMayWrite(pTsdb, true, true); rocksdb_flush(pTsdb->rCache.db, pTsdb->rCache.flushoptions, &err); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -595,11 +577,10 @@ static int32_t tsdbCacheNewTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, i SLRUCache *pCache = pTsdb->lruCache; rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; - SRowKey noneRowKey = {0}; - noneRowKey.ts = TSKEY_MIN; - noneRowKey.numOfPKs = 0; - SLastCol noneCol = {.rowKey = noneRowKey, .colVal = COL_VAL_NONE(cid, col_type), .dirty = 1}; - SLastCol *pLastCol = &noneCol; + SRowKey emptyRowKey = {.ts = TSKEY_MIN, .numOfPKs = 0}; + SLastCol emptyCol = { + .rowKey = emptyRowKey, .colVal = COL_VAL_NONE(cid, col_type), .dirty = 1, .cacheStatus = TSDB_LAST_CACHE_VALID}; + SLastCol *pLastCol = &emptyCol; SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol)); if (!pTmpLastCol) { @@ -642,8 +623,8 @@ int32_t tsdbCacheCommitNoLock(STsdb *pTsdb) { taosLRUCacheApply(pCache, tsdbCacheFlushDirty, &pTsdb->flushState); - rocksMayWrite(pTsdb, true, false, false); - rocksMayWrite(pTsdb, true, true, false); + rocksMayWrite(pTsdb, true, false); + rocksMayWrite(pTsdb, true, true); rocksdb_flush(pTsdb->rCache.db, pTsdb->rCache.flushoptions, &err); if (NULL != err) { @@ -655,6 +636,29 @@ int32_t tsdbCacheCommitNoLock(STsdb *pTsdb) { TAOS_RETURN(code); } +static int32_t tsdbCacheGetValuesFromRocks(STsdb *pTsdb, size_t numKeys, const char *const *ppKeysList, + size_t *pKeysListSizes, char ***pppValuesList, size_t **ppValuesListSizes) { + char **valuesList = taosMemoryCalloc(numKeys, sizeof(char *)); + size_t *valuesListSizes = taosMemoryCalloc(numKeys, sizeof(size_t)); + char **errs = taosMemoryCalloc(numKeys, sizeof(char *)); + if (!valuesList || !valuesListSizes || !errs) { + taosMemoryFreeClear(valuesList); + taosMemoryFreeClear(valuesListSizes); + taosMemoryFreeClear(errs); + TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + } + rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, numKeys, ppKeysList, pKeysListSizes, valuesList, + valuesListSizes, errs); + for (size_t i = 0; i < numKeys; ++i) { + rocksdb_free(errs[i]); + } + taosMemoryFreeClear(errs); + + *pppValuesList = valuesList; + *ppValuesListSizes = valuesListSizes; + TAOS_RETURN(TSDB_CODE_SUCCESS); +} + static int32_t tsdbCacheDropTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, bool hasPrimaryKey) { int32_t code = 0; @@ -684,41 +688,11 @@ static int32_t tsdbCacheDropTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, keys_list_sizes[0] = klen; keys_list_sizes[1] = klen; - char **values_list = taosMemoryCalloc(2, sizeof(char *)); - if (!values_list) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(keys_list[0]); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } - size_t *values_list_sizes = taosMemoryCalloc(2, sizeof(size_t)); - if (!values_list_sizes) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(keys_list[0]); - taosMemoryFree(values_list); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } - char **errs = taosMemoryCalloc(2, sizeof(char *)); - if (!errs) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(keys_list[0]); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } - - // rocksMayWrite(pTsdb, true, false, false); - rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, 2, (const char *const *)keys_list, keys_list_sizes, - values_list, values_list_sizes, errs); - - for (int i = 0; i < 2; ++i) { - if (errs[i]) { - rocksdb_free(errs[i]); - } - } - taosMemoryFree(errs); + char **values_list = NULL; + size_t *values_list_sizes = NULL; + TAOS_CHECK_GOTO(tsdbCacheGetValuesFromRocks(pTsdb, 2, (const char *const *)keys_list, keys_list_sizes, &values_list, + &values_list_sizes), + NULL, _exit); rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; { @@ -760,6 +734,7 @@ static int32_t tsdbCacheDropTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, } } +_exit: taosMemoryFree(keys_list[0]); taosMemoryFree(keys_list); @@ -851,7 +826,7 @@ int32_t tsdbCacheDropTable(STsdb *pTsdb, tb_uid_t uid, tb_uid_t suid, SSchemaWra taosMemoryFree(pTSchema); } - rocksMayWrite(pTsdb, true, false, false); + rocksMayWrite(pTsdb, true, false); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -892,7 +867,7 @@ int32_t tsdbCacheDropSubTables(STsdb *pTsdb, SArray *uids, tb_uid_t suid) { taosMemoryFree(pTSchema); - rocksMayWrite(pTsdb, true, false, false); + rocksMayWrite(pTsdb, true, false); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -923,7 +898,7 @@ int32_t tsdbCacheDropNTableColumn(STsdb *pTsdb, int64_t uid, int16_t cid, bool h (void)tsdbCacheDropTableColumn(pTsdb, uid, cid, hasPrimayKey); - rocksMayWrite(pTsdb, true, false, true); + rocksMayWrite(pTsdb, true, false); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -962,7 +937,7 @@ int32_t tsdbCacheDropSTableColumn(STsdb *pTsdb, SArray *uids, int16_t cid, bool (void)tsdbCacheDropTableColumn(pTsdb, uid, cid, hasPrimayKey); } - rocksMayWrite(pTsdb, true, false, true); + rocksMayWrite(pTsdb, true, false); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -1029,6 +1004,96 @@ static void tsdbCacheUpdateLastCol(SLastCol *pLastCol, SRowKey *pRowKey, SColVal } } +static void tsdbCacheUpdateLastColToNone(SLastCol *pLastCol, ELastCacheStatus cacheStatus) { + // update rowkey + pLastCol->rowKey.ts = TSKEY_MIN; + for (int8_t i = 0; i < pLastCol->rowKey.numOfPKs; i++) { + SValue *pPKValue = &pLastCol->rowKey.pks[i]; + if (IS_VAR_DATA_TYPE(pPKValue->type) && pPKValue->nData > 0) { + taosMemoryFreeClear(pPKValue->pData); + pPKValue->nData = 0; + } else { + pPKValue->val = 0; + } + } + pLastCol->rowKey.numOfPKs = 0; + + // update colval + if (IS_VAR_DATA_TYPE(pLastCol->colVal.value.type) && pLastCol->colVal.value.nData > 0) { + taosMemoryFreeClear(pLastCol->colVal.value.pData); + pLastCol->colVal.value.nData = 0; + } else { + pLastCol->colVal.value.val = 0; + } + + pLastCol->colVal = COL_VAL_NONE(pLastCol->colVal.cid, pLastCol->colVal.value.type); + + if (!pLastCol->dirty) { + pLastCol->dirty = 1; + } + + pLastCol->cacheStatus = cacheStatus; +} + +static int32_t tsdbCachePutToRocksdb(STsdb *pTsdb, SLastKey *pLastKey, SLastCol *pLastCol) { + int32_t code = 0; + char *rocks_value = NULL; + size_t vlen = 0; + + code = tsdbCacheSerialize(pLastCol, &rocks_value, &vlen); + if (code) { + tsdbError("tsdb/cache/putrocks: vgId:%d, serialize failed since %s.", TD_VID(pTsdb->pVnode), tstrerror(code)); + TAOS_RETURN(code); + } + + rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; + rocksdb_writebatch_put(wb, (char *)pLastKey, ROCKS_KEY_LEN, rocks_value, vlen); + + taosMemoryFree(rocks_value); + + TAOS_RETURN(code); +} + +static int32_t tsdbCachePutToLRU(STsdb *pTsdb, SLastKey *pLastKey, SLastCol *pLastCol) { + int32_t code = 0, lino = 0; + + SLastCol *pLRULastCol = taosMemoryCalloc(1, sizeof(SLastCol)); + if (!pLRULastCol) { + TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + } + + *pLRULastCol = *pLastCol; + + size_t charge = sizeof(*pLRULastCol); + for (int8_t i = 0; i < pLRULastCol->rowKey.numOfPKs; i++) { + SValue *pValue = &pLRULastCol->rowKey.pks[i]; + if (IS_VAR_DATA_TYPE(pValue->type)) { + TAOS_CHECK_GOTO(reallocVarDataVal(pValue), &lino, _exit); + charge += pValue->nData; + } + } + + if (IS_VAR_DATA_TYPE(pLRULastCol->colVal.value.type)) { + TAOS_CHECK_GOTO(reallocVarData(&pLRULastCol->colVal), &lino, _exit); + charge += pLRULastCol->colVal.value.nData; + } + + LRUStatus status = taosLRUCacheInsert(pTsdb->lruCache, pLastKey, ROCKS_KEY_LEN, pLRULastCol, charge, tsdbCacheDeleter, + NULL, TAOS_LRU_PRIORITY_LOW, &pTsdb->flushState); + if (TAOS_LRU_STATUS_OK != status) { + tsdbError("tsdb/cache/putlru: vgId:%d, failed to insert status %d.", TD_VID(pTsdb->pVnode), status); + code = TSDB_CODE_INVALID_DATA_FMT; + } + +_exit: + if (TSDB_CODE_SUCCESS != code) { + taosMemoryFree(pLRULastCol); + tsdbError("tsdb/cache/putlru: vgId:%d, failed at line %d since %s.", TD_VID(pTsdb->pVnode), lino, tstrerror(code)); + } + + TAOS_RETURN(code); +} + static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray *updCtxArray) { if (!updCtxArray || TARRAY_SIZE(updCtxArray) == 0) { TAOS_RETURN(TSDB_CODE_SUCCESS); @@ -1057,10 +1122,14 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray LRUHandle *h = taosLRUCacheLookup(pCache, key, klen); if (h) { SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pCache, h); - int32_t cmp_res = tRowKeyCompare(&pLastCol->rowKey, pRowKey); - if (cmp_res < 0 || (cmp_res == 0 && !COL_VAL_IS_NONE(pColVal))) { - tsdbCacheUpdateLastCol(pLastCol, pRowKey, pColVal); + if (pLastCol->cacheStatus != TSDB_LAST_CACHE_NO_CACHE) { + int32_t cmp_res = tRowKeyCompare(&pLastCol->rowKey, pRowKey); + if (cmp_res < 0 || (cmp_res == 0 && !COL_VAL_IS_NONE(pColVal))) { + tsdbCacheUpdateLastCol(pLastCol, pRowKey, pColVal); + pLastCol->cacheStatus = TSDB_LAST_CACHE_VALID; + } } + (void)taosLRUCacheRelease(pCache, h, false); } else { if (!remainCols) { @@ -1092,23 +1161,14 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray keys_list[i] = (char *)&idxKey->key; keys_list_sizes[i] = ROCKS_KEY_LEN; } - values_list = taosMemoryCalloc(num_keys, sizeof(char *)); - values_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t)); - errs = taosMemoryCalloc(num_keys, sizeof(char *)); - if (!values_list || !values_list_sizes || !errs) { + + code = tsdbCacheGetValuesFromRocks(pTsdb, num_keys, (const char *const *)keys_list, keys_list_sizes, &values_list, + &values_list_sizes); + if (code) { taosMemoryFree(keys_list); taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); - (void)taosThreadMutexUnlock(&pTsdb->lruMutex); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + goto _exit; } - rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys, (const char *const *)keys_list, - keys_list_sizes, values_list, values_list_sizes, errs); - for (int i = 0; i < num_keys; ++i) { - rocksdb_free(errs[i]); - } - taosMemoryFree(errs); rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; for (int i = 0; i < num_keys; ++i) { @@ -1126,9 +1186,21 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray */ SLastCol *PToFree = pLastCol; + if (pLastCol && pLastCol->cacheStatus == TSDB_LAST_CACHE_NO_CACHE) { + if ((code = tsdbCachePutToLRU(pTsdb, &idxKey->key, pLastCol)) != TSDB_CODE_SUCCESS) { + tsdbError("tsdb/cache: vgId:%d, put lru failed at line %d since %s.", TD_VID(pTsdb->pVnode), lino, + tstrerror(code)); + taosMemoryFreeClear(PToFree); + break; + } + + // cache invalid => skip update + taosMemoryFreeClear(PToFree); + continue; + } + if (IS_LAST_KEY(idxKey->key) && !COL_VAL_IS_VALUE(pColVal)) { taosMemoryFreeClear(PToFree); - rocksdb_free(values_list[i]); continue; } @@ -1138,74 +1210,40 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray } if (NULL == pLastCol || cmp_res < 0 || (cmp_res == 0 && !COL_VAL_IS_NONE(pColVal))) { - char *value = NULL; - size_t vlen = 0; - SLastCol lastColTmp = {.rowKey = *pRowKey, .colVal = *pColVal}; - code = tsdbCacheSerialize(&lastColTmp, &value, &vlen); - if (code) { - tsdbError("tsdb/cache: vgId:%d, serialize failed since %s.", TD_VID(pTsdb->pVnode), tstrerror(code)); - } else { - (void)taosThreadMutexLock(&pTsdb->rCache.rMutex); - - rocksdb_writebatch_put(wb, (char *)&idxKey->key, ROCKS_KEY_LEN, value, vlen); - - (void)taosThreadMutexUnlock(&pTsdb->rCache.rMutex); + SLastCol lastColTmp = {.rowKey = *pRowKey, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}; + if ((code = tsdbCachePutToRocksdb(pTsdb, &idxKey->key, &lastColTmp)) != TSDB_CODE_SUCCESS) { + tsdbError("tsdb/cache: vgId:%d, put rocks failed at line %d since %s.", TD_VID(pTsdb->pVnode), lino, + tstrerror(code)); + taosMemoryFreeClear(PToFree); + break; } - - pLastCol = &lastColTmp; - SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol)); - if (!pTmpLastCol) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); - - taosArrayDestroy(remainCols); - (void)taosThreadMutexUnlock(&pTsdb->lruMutex); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + if ((code = tsdbCachePutToLRU(pTsdb, &idxKey->key, &lastColTmp)) != TSDB_CODE_SUCCESS) { + tsdbError("tsdb/cache: vgId:%d, put lru failed at line %d since %s.", TD_VID(pTsdb->pVnode), lino, + tstrerror(code)); + taosMemoryFreeClear(PToFree); + break; } - *pTmpLastCol = *pLastCol; - pLastCol = pTmpLastCol; - - size_t charge = sizeof(*pLastCol); - for (int8_t i = 0; i < pLastCol->rowKey.numOfPKs; i++) { - SValue *pValue = &pLastCol->rowKey.pks[i]; - if (IS_VAR_DATA_TYPE(pValue->type)) { - TAOS_CHECK_GOTO(reallocVarDataVal(pValue), &lino, _exit); - charge += pValue->nData; - } - } - - if (IS_VAR_DATA_TYPE(pLastCol->colVal.value.type)) { - TAOS_CHECK_GOTO(reallocVarData(&pLastCol->colVal), &lino, _exit); - charge += pLastCol->colVal.value.nData; - } - - LRUStatus status = taosLRUCacheInsert(pTsdb->lruCache, &idxKey->key, ROCKS_KEY_LEN, pLastCol, charge, - tsdbCacheDeleter, NULL, TAOS_LRU_PRIORITY_LOW, &pTsdb->flushState); - if (status != TAOS_LRU_STATUS_OK) { - code = -1; - } - - taosMemoryFree(value); } taosMemoryFreeClear(PToFree); - rocksdb_free(values_list[i]); } - rocksMayWrite(pTsdb, true, false, true); + rocksMayWrite(pTsdb, true, false); taosMemoryFree(keys_list); taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); + if (values_list) { + for (int i = 0; i < num_keys; ++i) { + rocksdb_free(values_list[i]); + } + taosMemoryFree(values_list); + } taosMemoryFree(values_list_sizes); - - taosArrayDestroy(remainCols); } _exit: (void)taosThreadMutexUnlock(&pTsdb->lruMutex); + taosArrayDestroy(remainCols); if (code) { tsdbError("tsdb/cache: vgId:%d, update failed at line %d since %s.", TD_VID(pTsdb->pVnode), lino, tstrerror(code)); @@ -1374,8 +1412,11 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr SIdxKey *idxKey = taosArrayGet(remainCols, 0); if (idxKey->key.cid != PRIMARYKEY_TIMESTAMP_COL_ID) { - SLastKey *key = &(SLastKey){.lflag = ltype, .uid = uid, .cid = PRIMARYKEY_TIMESTAMP_COL_ID}; + // ignore 'ts' loaded from cache and load it from tsdb + SLastCol* pLastCol = taosArrayGet(pLastArray, 0); + tsdbCacheUpdateLastColToNone(pLastCol, TSDB_LAST_CACHE_NO_CACHE); + SLastKey *key = &(SLastKey){.lflag = ltype, .uid = uid, .cid = PRIMARYKEY_TIMESTAMP_COL_ID}; (void)taosArrayInsert(remainCols, 0, &(SIdxKey){0, *key}); } @@ -1472,7 +1513,8 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr // still null, then make up a none col value SLastCol noneCol = {.rowKey.ts = TSKEY_MIN, - .colVal = COL_VAL_NONE(idxKey->key.cid, pr->pSchema->columns[slotIds[i]].type)}; + .colVal = COL_VAL_NONE(idxKey->key.cid, pr->pSchema->columns[slotIds[i]].type), + .cacheStatus = TSDB_LAST_CACHE_VALID}; if (!pLastCol) { pLastCol = &noneCol; TAOS_CHECK_RETURN(reallocVarData(&pLastCol->colVal)); @@ -1535,7 +1577,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr } if (wb) { - rocksMayWrite(pTsdb, false, true, false); + rocksMayWrite(pTsdb, false, true); } taosArrayDestroy(lastrowTmpIndexArray); @@ -1556,7 +1598,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr } static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SArray *remainCols, - SCacheRowsReader *pr, int8_t ltype) { + SArray *ignoreFromRocks, SCacheRowsReader *pr, int8_t ltype) { int32_t code = 0; int num_keys = TARRAY_SIZE(remainCols); char **keys_list = taosMemoryMalloc(num_keys * sizeof(char *)); @@ -1567,49 +1609,41 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA taosMemoryFree(keys_list_sizes); TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); } + char **values_list = NULL; + size_t *values_list_sizes = NULL; for (int i = 0; i < num_keys; ++i) { - int16_t cid = *(int16_t *)taosArrayGet(remainCols, i); - memcpy(key_list + i * ROCKS_KEY_LEN, &((SIdxKey *)taosArrayGet(remainCols, i))->key, ROCKS_KEY_LEN); keys_list[i] = key_list + i * ROCKS_KEY_LEN; keys_list_sizes[i] = ROCKS_KEY_LEN; } - char **values_list = taosMemoryCalloc(num_keys, sizeof(char *)); - size_t *values_list_sizes = taosMemoryCalloc(num_keys, sizeof(size_t)); - char **errs = taosMemoryMalloc(num_keys * sizeof(char *)); - if (!values_list || !values_list_sizes || !errs) { + code = tsdbCacheGetValuesFromRocks(pTsdb, num_keys, (const char *const *)keys_list, keys_list_sizes, &values_list, + &values_list_sizes); + if (code) { + taosMemoryFree(key_list); taosMemoryFree(keys_list); taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + TAOS_RETURN(code); } - rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys, (const char *const *)keys_list, - keys_list_sizes, values_list, values_list_sizes, errs); - for (int i = 0; i < num_keys; ++i) { - if (errs[i]) { - tsdbError("vgId:%d, %s failed at line %d since %s, index:%d", TD_VID(pTsdb->pVnode), __func__, __LINE__, errs[i], - i); - rocksdb_free(errs[i]); - } - } - taosMemoryFree(errs); SLRUCache *pCache = pTsdb->lruCache; for (int i = 0, j = 0; i < num_keys && j < TARRAY_SIZE(remainCols); ++i) { SLastCol *pLastCol = NULL; + bool ignore = ((bool *)TARRAY_DATA(ignoreFromRocks))[i]; + if (ignore) { + ++j; + continue; + } + (void)tsdbCacheDeserialize(values_list[i], values_list_sizes[i], &pLastCol); SLastCol *PToFree = pLastCol; SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[j]; - if (pLastCol) { + if (pLastCol && pLastCol->cacheStatus != TSDB_LAST_CACHE_NO_CACHE) { SLastCol *pTmpLastCol = taosMemoryCalloc(1, sizeof(SLastCol)); if (!pTmpLastCol) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + taosMemoryFreeClear(PToFree); + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; } *pTmpLastCol = *pLastCol; pLastCol = pTmpLastCol; @@ -1640,36 +1674,44 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA TAOS_CHECK_RETURN(reallocVarData(&lastCol.colVal)); taosArraySet(pLastArray, idxKey->idx, &lastCol); taosArrayRemove(remainCols, j); + taosArrayRemove(ignoreFromRocks, j); - taosMemoryFreeClear(PToFree); - taosMemoryFree(values_list[i]); } else { ++j; } - } - taosMemoryFree(key_list); - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - taosMemoryFree(values_list_sizes); + taosMemoryFreeClear(PToFree); + } if (TARRAY_SIZE(remainCols) > 0) { // tsdbTrace("tsdb/cache: vgId: %d, load %" PRId64 " from raw", TD_VID(pTsdb->pVnode), uid); code = tsdbCacheLoadFromRaw(pTsdb, uid, pLastArray, remainCols, pr, ltype); } +_exit: + taosMemoryFree(key_list); + taosMemoryFree(keys_list); + taosMemoryFree(keys_list_sizes); + if (values_list) { + for (int i = 0; i < num_keys; ++i) { + rocksdb_free(values_list[i]); + } + taosMemoryFree(values_list); + } + taosMemoryFree(values_list_sizes); + TAOS_RETURN(code); } int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCacheRowsReader *pr, int8_t ltype) { int32_t code = 0; SArray *remainCols = NULL; + SArray *ignoreFromRocks = NULL; SLRUCache *pCache = pTsdb->lruCache; SArray *pCidList = pr->pCidList; - int num_keys = TARRAY_SIZE(pCidList); + int numKeys = TARRAY_SIZE(pCidList); - for (int i = 0; i < num_keys; ++i) { + for (int i = 0; i < numKeys; ++i) { int16_t cid = ((int16_t *)TARRAY_DATA(pCidList))[i]; SLastKey key = {.lflag = ltype, .uid = uid, .cid = cid}; @@ -1684,33 +1726,52 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache } LRUHandle *h = taosLRUCacheLookup(pCache, &key, ROCKS_KEY_LEN); - if (h) { - SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pCache, h); - + SLastCol *pLastCol = h ? (SLastCol *)taosLRUCacheValue(pCache, h) : NULL; + if (h && pLastCol->cacheStatus != TSDB_LAST_CACHE_NO_CACHE) { SLastCol lastCol = *pLastCol; for (int8_t j = 0; j < lastCol.rowKey.numOfPKs; j++) { TAOS_CHECK_RETURN(reallocVarDataVal(&lastCol.rowKey.pks[j])); } TAOS_CHECK_RETURN(reallocVarData(&lastCol.colVal)); - (void)taosArrayPush(pLastArray, &lastCol); - - (void)taosLRUCacheRelease(pCache, h, false); + if (taosArrayPush(pLastArray, &lastCol) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } } else { + // no cache or cache is invalid SLastCol noneCol = {.rowKey.ts = TSKEY_MIN, .colVal = COL_VAL_NONE(cid, pr->pSchema->columns[pr->pSlotIds[i]].type)}; - (void)taosArrayPush(pLastArray, &noneCol); + if (taosArrayPush(pLastArray, &noneCol) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } if (!remainCols) { - remainCols = taosArrayInit(num_keys, sizeof(SIdxKey)); - if (!remainCols) { - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); + if ((remainCols = taosArrayInit(numKeys, sizeof(SIdxKey))) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; } } - if (NULL == taosArrayPush(remainCols, &(SIdxKey){i, key})) { - taosArrayDestroy(remainCols); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - }; + if (!ignoreFromRocks) { + if ((ignoreFromRocks = taosArrayInit(numKeys, sizeof(bool))) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + } + if (taosArrayPush(remainCols, &(SIdxKey){i, key}) ==NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + bool ignoreRocks = pLastCol ? (pLastCol->cacheStatus == TSDB_LAST_CACHE_NO_CACHE) : false; + if (taosArrayPush(ignoreFromRocks, &ignoreRocks) ==NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + } + + if (h) { + (void)taosLRUCacheRelease(pCache, h, false); } } @@ -1719,9 +1780,8 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache for (int i = 0; i < TARRAY_SIZE(remainCols);) { SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[i]; LRUHandle *h = taosLRUCacheLookup(pCache, &idxKey->key, ROCKS_KEY_LEN); - if (h) { - SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pCache, h); - + SLastCol *pLastCol = h ? (SLastCol *)taosLRUCacheValue(pCache, h) : NULL; + if (h && pLastCol->cacheStatus != TSDB_LAST_CACHE_NO_CACHE) { SLastCol lastCol = *pLastCol; for (int8_t j = 0; j < lastCol.rowKey.numOfPKs; j++) { code = reallocVarDataVal(&lastCol.rowKey.pks[j]); @@ -1737,23 +1797,31 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache } taosArraySet(pLastArray, idxKey->idx, &lastCol); - (void)taosLRUCacheRelease(pCache, h, false); - taosArrayRemove(remainCols, i); + taosArrayRemove(ignoreFromRocks, i); } else { + // no cache or cache is invalid ++i; } + + if (h) { + (void)taosLRUCacheRelease(pCache, h, false); + } } // tsdbTrace("tsdb/cache: vgId: %d, load %" PRId64 " from rocks", TD_VID(pTsdb->pVnode), uid); - code = tsdbCacheLoadFromRocks(pTsdb, uid, pLastArray, remainCols, pr, ltype); + code = tsdbCacheLoadFromRocks(pTsdb, uid, pLastArray, remainCols, ignoreFromRocks, pr, ltype); (void)taosThreadMutexUnlock(&pTsdb->lruMutex); + } +_exit: if (remainCols) { taosArrayDestroy(remainCols); } - } + if (ignoreFromRocks) { + taosArrayDestroy(ignoreFromRocks); + } TAOS_RETURN(code); } @@ -1767,131 +1835,113 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE TAOS_CHECK_RETURN(metaGetTbTSchemaEx(pTsdb->pVnode->pMeta, suid, uid, sver, &pTSchema)); // build keys & multi get from rocks - int num_keys = pTSchema->numOfCols; - char **keys_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); - size_t *keys_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); - if (!keys_list || !keys_list_sizes) { - taosMemoryFree(keys_list); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } - const size_t klen = ROCKS_KEY_LEN; - - for (int i = 0; i < num_keys; ++i) { - int16_t cid = pTSchema->columns[i].colId; - - char *keys = taosMemoryCalloc(2, sizeof(SLastKey)); - if (!keys) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } - ((SLastKey *)keys)[0] = (SLastKey){.lflag = LFLAG_LAST, .uid = uid, .cid = cid}; - ((SLastKey *)keys)[1] = (SLastKey){.lflag = LFLAG_LAST_ROW, .uid = uid, .cid = cid}; - - keys_list[i] = keys; - keys_list[num_keys + i] = keys + sizeof(SLastKey); - keys_list_sizes[i] = klen; - keys_list_sizes[num_keys + i] = klen; - } - char **values_list = taosMemoryCalloc(num_keys * 2, sizeof(char *)); - size_t *values_list_sizes = taosMemoryCalloc(num_keys * 2, sizeof(size_t)); - char **errs = taosMemoryCalloc(num_keys * 2, sizeof(char *)); - if (!values_list_sizes || !values_list) { - taosMemoryFree(keys_list); - taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); - for (int i = 0; i < num_keys; ++i) { - taosMemoryFree(keys_list[i]); - } - TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY); - } + int numCols = pTSchema->numOfCols; + int numKeys = 0; + SArray *remainCols = NULL; (void)tsdbCacheCommit(pTsdb); (void)taosThreadMutexLock(&pTsdb->lruMutex); - (void)taosThreadMutexLock(&pTsdb->rCache.rMutex); - // rocksMayWrite(pTsdb, true, false, false); - rocksdb_multi_get(pTsdb->rCache.db, pTsdb->rCache.readoptions, num_keys * 2, (const char *const *)keys_list, - keys_list_sizes, values_list, values_list_sizes, errs); - (void)taosThreadMutexUnlock(&pTsdb->rCache.rMutex); - - for (int i = 0; i < num_keys * 2; ++i) { - if (errs[i]) { - rocksdb_free(errs[i]); + for (int i = 0; i < numCols; ++i) { + int16_t cid = pTSchema->columns[i].colId; + for (int8_t lflag = LFLAG_LAST_ROW; lflag <= LFLAG_LAST; ++lflag) { + SLastKey lastKey = {.lflag = lflag, .uid = uid, .cid = cid}; + LRUHandle *h = taosLRUCacheLookup(pTsdb->lruCache, &lastKey, ROCKS_KEY_LEN); + if (h) { + SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h); + if (pLastCol->rowKey.ts <= eKey && pLastCol->rowKey.ts >= sKey) { + tsdbCacheUpdateLastColToNone(pLastCol, TSDB_LAST_CACHE_NO_CACHE); + } + (void)taosLRUCacheRelease(pTsdb->lruCache, h, false); + } else { + if (!remainCols) { + remainCols = taosArrayInit(numCols * 2, sizeof(SLastKey)); + } + (void)taosArrayPush(remainCols, &lastKey); + } } } - taosMemoryFree(errs); + + if (remainCols) { + numKeys = TARRAY_SIZE(remainCols); + } + + char **keys_list = taosMemoryCalloc(numKeys, sizeof(char *)); + size_t *keys_list_sizes = taosMemoryCalloc(numKeys, sizeof(size_t)); + char **values_list = NULL; + size_t *values_list_sizes = NULL; + + if (!keys_list || !keys_list_sizes) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + const size_t klen = ROCKS_KEY_LEN; + + for (int i = 0; i < numKeys; ++i) { + char *key = taosMemoryCalloc(1, sizeof(SLastKey)); + if (!key) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + ((SLastKey *)key)[0] = *(SLastKey *)taosArrayGet(remainCols, i); + + keys_list[i] = key; + keys_list_sizes[i] = klen; + } + + TAOS_CHECK_GOTO(tsdbCacheGetValuesFromRocks(pTsdb, numKeys, (const char *const *)keys_list, keys_list_sizes, + &values_list, &values_list_sizes), + NULL, _exit); rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch; - for (int i = 0; i < num_keys; ++i) { + for (int i = 0; i < numKeys; ++i) { SLastCol *pLastCol = NULL; (void)tsdbCacheDeserialize(values_list[i], values_list_sizes[i], &pLastCol); - (void)taosThreadMutexLock(&pTsdb->rCache.rMutex); + SLastKey *pLastKey = (SLastKey *)keys_list[i]; if (NULL != pLastCol && (pLastCol->rowKey.ts <= eKey && pLastCol->rowKey.ts >= sKey)) { - rocksdb_writebatch_delete(wb, keys_list[i], klen); + SLastCol noCacheCol = {.rowKey.ts = TSKEY_MIN, + .colVal = COL_VAL_NONE(pLastKey->cid, pTSchema->columns[i].type), + .cacheStatus = TSDB_LAST_CACHE_NO_CACHE}; + + if ((code = tsdbCachePutToRocksdb(pTsdb, pLastKey, &noCacheCol)) != TSDB_CODE_SUCCESS) { + taosMemoryFreeClear(pLastCol); + tsdbError("tsdb/cache/del: vgId:%d, put to rocks failed since %s.", TD_VID(pTsdb->pVnode), tstrerror(code)); + goto _exit; + } + if ((code = tsdbCachePutToLRU(pTsdb, pLastKey, &noCacheCol)) != TSDB_CODE_SUCCESS) { + taosMemoryFreeClear(pLastCol); + tsdbError("tsdb/cache/del: vgId:%d, put to lru failed since %s.", TD_VID(pTsdb->pVnode), tstrerror(code)); + goto _exit; + } } + + if (pLastCol == NULL) { + tsdbDebug("tsdb/cache/del: vgId:%d, no cache found for uid:%d ,cid:%" PRId64 ", lflag:%d.", TD_VID(pTsdb->pVnode), + pLastKey->cid, pLastKey->uid, pLastKey->lflag); + } + taosMemoryFreeClear(pLastCol); - - pLastCol = NULL; - (void)tsdbCacheDeserialize(values_list[i + num_keys], values_list_sizes[i + num_keys], &pLastCol); - if (NULL != pLastCol && (pLastCol->rowKey.ts <= eKey && pLastCol->rowKey.ts >= sKey)) { - rocksdb_writebatch_delete(wb, keys_list[num_keys + i], klen); - } - (void)taosThreadMutexUnlock(&pTsdb->rCache.rMutex); - taosMemoryFreeClear(pLastCol); - - rocksdb_free(values_list[i]); - rocksdb_free(values_list[i + num_keys]); - - // taosThreadMutexLock(&pTsdb->lruMutex); - - bool erase = false; - LRUHandle *h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[i], klen); - if (h) { - SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h); - if (pLastCol->dirty) { - pLastCol->dirty = 0; - } - if (pLastCol->rowKey.ts <= eKey && pLastCol->rowKey.ts >= sKey) { - erase = true; - } - (void)taosLRUCacheRelease(pTsdb->lruCache, h, erase); - } - if (erase) { - taosLRUCacheErase(pTsdb->lruCache, keys_list[i], klen); - } - - erase = false; - h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[num_keys + i], klen); - if (h) { - SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h); - if (pLastCol->dirty) { - pLastCol->dirty = 0; - } - if (pLastCol->rowKey.ts <= eKey && pLastCol->rowKey.ts >= sKey) { - erase = true; - } - (void)taosLRUCacheRelease(pTsdb->lruCache, h, erase); - } - if (erase) { - taosLRUCacheErase(pTsdb->lruCache, keys_list[num_keys + i], klen); - } - // taosThreadMutexUnlock(&pTsdb->lruMutex); } - for (int i = 0; i < num_keys; ++i) { + + rocksMayWrite(pTsdb, true, false); + +_exit: + (void)taosThreadMutexUnlock(&pTsdb->lruMutex); + + for (int i = 0; i < numKeys; ++i) { taosMemoryFree(keys_list[i]); } taosMemoryFree(keys_list); taosMemoryFree(keys_list_sizes); - taosMemoryFree(values_list); + if (values_list) { + for (int i = 0; i < numKeys; ++i) { + rocksdb_free(values_list[i]); + } + taosMemoryFree(values_list); + } taosMemoryFree(values_list_sizes); - - rocksMayWrite(pTsdb, true, false, true); - - (void)taosThreadMutexUnlock(&pTsdb->lruMutex); - -_exit: + taosArrayDestroy(remainCols); taosMemoryFree(pTSchema); TAOS_RETURN(code); @@ -3060,12 +3110,13 @@ static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SC STColumn *pTColumn = &pTSchema->columns[0]; *pColVal = COL_VAL_VALUE(pTColumn->colId, ((SValue){.type = pTColumn->type, .val = rowKey.key.ts})); - taosArraySet(pColArray, 0, &(SLastCol){.rowKey = rowKey.key, .colVal = *pColVal}); + taosArraySet(pColArray, 0, + &(SLastCol){.rowKey = rowKey.key, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}); continue; } tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); - *pCol = (SLastCol){.rowKey = rowKey.key, .colVal = *pColVal}; + *pCol = (SLastCol){.rowKey = rowKey.key, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}; if (IS_VAR_DATA_TYPE(pColVal->value.type) /*&& pColVal->value.nData > 0*/) { if (pColVal->value.nData > 0) { pCol->colVal.value.pData = taosMemoryMalloc(pCol->colVal.value.nData); @@ -3114,7 +3165,7 @@ static int32_t mergeLastCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SC tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); if (COL_VAL_IS_VALUE(pColVal)) { - SLastCol lastCol = {.rowKey = rowKey.key, .colVal = *pColVal}; + SLastCol lastCol = {.rowKey = rowKey.key, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}; if (IS_VAR_DATA_TYPE(pColVal->value.type) /* && pColVal->value.nData > 0 */) { SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); taosMemoryFree(pLastCol->colVal.value.pData); @@ -3237,12 +3288,13 @@ static int32_t mergeLastRowCid(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, STColumn *pTColumn = &pTSchema->columns[0]; *pColVal = COL_VAL_VALUE(pTColumn->colId, ((SValue){.type = pTColumn->type, .val = rowKey.key.ts})); - taosArraySet(pColArray, 0, &(SLastCol){.rowKey = rowKey.key, .colVal = *pColVal}); + taosArraySet(pColArray, 0, + &(SLastCol){.rowKey = rowKey.key, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}); continue; } tsdbRowGetColVal(pRow, pTSchema, slotIds[iCol], pColVal); - *pCol = (SLastCol){.rowKey = rowKey.key, .colVal = *pColVal}; + *pCol = (SLastCol){.rowKey = rowKey.key, .colVal = *pColVal, .cacheStatus = TSDB_LAST_CACHE_VALID}; if (IS_VAR_DATA_TYPE(pColVal->value.type) /*&& pColVal->value.nData > 0*/) { if (pColVal->value.nData > 0) { pCol->colVal.value.pData = taosMemoryMalloc(pCol->colVal.value.nData); diff --git a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c index 61862ac828..9f5f72e0aa 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c @@ -139,7 +139,7 @@ int32_t getPosInBlockInfoBuf(SBlockInfoBuf* pBuf, int32_t index, STableBlockScan int32_t bucketIndex = index / pBuf->numPerBucket; char** pBucket = taosArrayGet(pBuf->pData, bucketIndex); if (pBucket == NULL) { - return TSDB_CODE_FAILED; + return TSDB_CODE_NOT_FOUND; } *pInfo = (STableBlockScanInfo*)((*pBucket) + (index % pBuf->numPerBucket) * sizeof(STableBlockScanInfo)); diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index e2db87173d..1f2cf707f3 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -301,8 +301,7 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { #if defined(TD_ENTERPRISE) if (pCfg->tdbEncryptAlgorithm == DND_CA_SM4) { if (tsEncryptKey[0] == 0) { - terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; - return -1; + return terrno = TSDB_CODE_DNODE_INVALID_ENCRYPTKEY; } else { strncpy(pCfg->tdbEncryptKey, tsEncryptKey, ENCRYPT_KEY_LEN); } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index cfaf155276..8fcbe49f9a 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -413,9 +413,9 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { pInfo->info.state.commitID, pInfo->info.state.committed, pInfo->info.state.commitTerm); // persist wal before starting - if (walPersist(pVnode->pWal) < 0) { - vError("vgId:%d, failed to persist wal since %s", TD_VID(pVnode), terrstr()); - return -1; + if ((code = walPersist(pVnode->pWal)) < 0) { + vError("vgId:%d, failed to persist wal since %s", TD_VID(pVnode), tstrerror(code)); + return code; } (void)vnodeGetPrimaryDir(pVnode->path, pVnode->diskPrimary, pVnode->pTfs, dir, TSDB_FILENAME_LEN); @@ -556,7 +556,6 @@ int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo) { pJson = tjsonParse(pData); if (pJson == NULL) { TSDB_CHECK_CODE(code = TSDB_CODE_INVALID_DATA_FMT, lino, _exit); - return -1; } code = tjsonToObject(pJson, "config", vnodeDecodeConfig, (void *)&pInfo->config); diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 4f5d7c24e1..ed008d4f88 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -39,13 +39,14 @@ static int32_t vnodeMkDir(STfs *pTfs, const char *path) { } int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs *pTfs) { + int32_t code = 0; SVnodeInfo info = {0}; char dir[TSDB_FILENAME_LEN] = {0}; // check config - if (vnodeCheckCfg(pCfg) < 0) { - vError("vgId:%d, failed to create vnode since:%s", pCfg->vgId, tstrerror(terrno)); - return -1; + if ((code = vnodeCheckCfg(pCfg)) < 0) { + vError("vgId:%d, failed to create vnode since:%s", pCfg->vgId, tstrerror(code)); + return code; } // create vnode env @@ -72,9 +73,9 @@ int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, int32_t diskPrimary, STfs } vInfo("vgId:%d, save config while create", info.config.vgId); - if (vnodeSaveInfo(dir, &info) < 0 || vnodeCommitInfo(dir) < 0) { - vError("vgId:%d, failed to save vnode config since %s", pCfg ? pCfg->vgId : 0, tstrerror(terrno)); - return -1; + if ((code = vnodeSaveInfo(dir, &info)) < 0 || (code = vnodeCommitInfo(dir)) < 0) { + vError("vgId:%d, failed to save vnode config since %s", pCfg ? pCfg->vgId : 0, tstrerror(code)); + return code; } vInfo("vgId:%d, vnode is created", info.config.vgId); @@ -93,7 +94,7 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t ret = vnodeLoadInfo(dir, &info); if (ret < 0) { vError("vgId:%d, failed to read vnode config from %s since %s", pReq->vgId, path, tstrerror(terrno)); - return -1; + return ret; } SSyncCfg *pCfg = &info.config.syncCfg; @@ -144,13 +145,13 @@ int32_t vnodeAlterReplica(const char *path, SAlterVnodeReplicaReq *pReq, int32_t ret = vnodeSaveInfo(dir, &info); if (ret < 0) { vError("vgId:%d, failed to save vnode config since %s", pReq->vgId, tstrerror(terrno)); - return -1; + return ret; } ret = vnodeCommitInfo(dir); if (ret < 0) { vError("vgId:%d, failed to commit vnode config since %s", pReq->vgId, tstrerror(terrno)); - return -1; + return ret; } vInfo("vgId:%d, vnode config is saved", info.config.vgId); @@ -226,7 +227,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod ret = vnodeLoadInfo(dir, &info); if (ret < 0) { vError("vgId:%d, failed to read vnode config from %s since %s", pReq->srcVgId, srcPath, tstrerror(terrno)); - return -1; + return ret; } vInfo("vgId:%d, alter hashrange from [%u, %u] to [%u, %u]", pReq->srcVgId, info.config.hashBegin, info.config.hashEnd, @@ -256,13 +257,13 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod ret = vnodeSaveInfo(dir, &info); if (ret < 0) { vError("vgId:%d, failed to save vnode config since %s", pReq->dstVgId, tstrerror(terrno)); - return -1; + return ret; } ret = vnodeCommitInfo(dir); if (ret < 0) { vError("vgId:%d, failed to commit vnode config since %s", pReq->dstVgId, tstrerror(terrno)); - return -1; + return ret; } vInfo("vgId:%d, rename %s to %s", pReq->dstVgId, srcPath, dstPath); @@ -270,7 +271,7 @@ int32_t vnodeAlterHashRange(const char *srcPath, const char *dstPath, SAlterVnod if (ret < 0) { vError("vgId:%d, failed to rename vnode from %s to %s since %s", pReq->dstVgId, srcPath, dstPath, tstrerror(terrno)); - return -1; + return ret; } vInfo("vgId:%d, vnode hashrange is altered", info.config.vgId); @@ -293,9 +294,9 @@ int32_t vnodeRestoreVgroupId(const char *srcPath, const char *dstPath, int32_t s } (void)vnodeGetPrimaryDir(srcPath, diskPrimary, pTfs, dir, TSDB_FILENAME_LEN); - if (vnodeLoadInfo(dir, &info) < 0) { + if ((code = vnodeLoadInfo(dir, &info)) < 0) { vError("vgId:%d, failed to read vnode config from %s since %s", srcVgId, srcPath, tstrerror(terrno)); - return -1; + return code; } if (info.config.vgId == srcVgId) { diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index 36d473fe56..904b29bf43 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -545,7 +545,7 @@ int32_t vnodeGetAllTableList(SVnode *pVnode, uint64_t uid, SArray *list) { SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, uid, 1); if (NULL == pCur) { qError("vnode get all table list failed"); - return TSDB_CODE_FAILED; + return terrno; } while (1) { @@ -576,7 +576,7 @@ int32_t vnodeGetCtbIdList(void *pVnode, int64_t suid, SArray *list) { SMCtbCursor *pCur = metaOpenCtbCursor(pVnodeObj, suid, 1); if (NULL == pCur) { qError("vnode get all table list failed"); - return TSDB_CODE_FAILED; + return terrno; } while (1) { @@ -627,7 +627,7 @@ int32_t vnodeGetStbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bo int32_t code = TSDB_CODE_SUCCESS; SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, suid); if (!pCur) { - return TSDB_CODE_FAILED; + return terrno; } while (1) { @@ -655,7 +655,7 @@ _exit: int32_t vnodeGetCtbNum(SVnode *pVnode, int64_t suid, int64_t *num) { SMCtbCursor *pCur = metaOpenCtbCursor(pVnode, suid, 0); if (!pCur) { - return TSDB_CODE_FAILED; + return terrno; } *num = 0; @@ -757,8 +757,7 @@ int32_t vnodeGetTimeSeriesNum(SVnode *pVnode, int64_t *num) { SArray *suidList = NULL; if (!(suidList = taosArrayInit(1, sizeof(tb_uid_t)))) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return TSDB_CODE_FAILED; + return terrno = TSDB_CODE_OUT_OF_MEMORY; } int32_t tbFilterSize = 0; @@ -774,7 +773,7 @@ int32_t vnodeGetTimeSeriesNum(SVnode *pVnode, int64_t *num) { (tbFilterSize && vnodeGetStbIdListByFilter(pVnode, 0, suidList, vnodeTimeSeriesFilter, pVnode) < 0)) { qError("vgId:%d, failed to get stb id list error: %s", TD_VID(pVnode), terrstr()); taosArrayDestroy(suidList); - return TSDB_CODE_FAILED; + return terrno; } *num = 0; @@ -799,7 +798,7 @@ _exit: int32_t vnodeGetAllCtbNum(SVnode *pVnode, int64_t *num) { SMStbCursor *pCur = metaOpenStbCursor(pVnode->pMeta, 0); if (!pCur) { - return TSDB_CODE_FAILED; + return terrno; } *num = 0; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 3f6ca053cd..dc84b73c10 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -1980,7 +1980,7 @@ _err: tDecoderClear(&coder); vError("vgId:%d, failed to create tsma %s:%" PRIi64 " version %" PRIi64 "for table %" PRIi64 " since %s", TD_VID(pVnode), req.indexName, req.indexUid, ver, req.tableUid, terrstr()); - return -1; + return terrno; } /** diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index d9630b56fd..31e44f5912 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -381,7 +381,7 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { static int32_t vnodeSyncEqCtrlMsg(const SMsgCb *msgcb, SRpcMsg *pMsg) { if (pMsg == NULL || pMsg->pCont == NULL) { - return -1; + return TSDB_CODE_INVALID_PARA; } if (msgcb == NULL || msgcb->putToQueueFp == NULL) { diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h index f70cfff71d..f3b1852ce1 100644 --- a/source/libs/catalog/inc/catalogInt.h +++ b/source/libs/catalog/inc/catalogInt.h @@ -108,6 +108,7 @@ enum { CTG_OP_UPDATE_TB_TSMA, CTG_OP_DROP_TB_TSMA, CTG_OP_CLEAR_CACHE, + CTG_OP_UPDATE_DB_TSMA_VERSION, CTG_OP_MAX }; @@ -603,6 +604,7 @@ typedef struct SCtgUpdateTbTSMAMsg { STableTSMAInfo* pTsma; int32_t dbTsmaVersion; uint64_t dbId; + char dbFName[TSDB_DB_FNAME_LEN]; } SCtgUpdateTbTSMAMsg; typedef struct SCtgDropTbTSMAMsg { @@ -1167,6 +1169,8 @@ int32_t ctgGetStreamProgressFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, void* bInput); int32_t ctgAddTSMAFetch(SArray** pFetchs, int32_t dbIdx, int32_t tbIdx, int32_t* fetchIdx, int32_t resIdx, int32_t flag, CTG_TSMA_FETCH_TYPE fetchType, const SName* sourceTbName); +int32_t ctgOpUpdateDbTsmaVersion(SCtgCacheOperation* pOper); +int32_t ctgUpdateDbTsmaVersionEnqueue(SCatalog* pCtg, int32_t tsmaVersion, const char* dbFName, int64_t dbId, bool syncOper); void ctgFreeTask(SCtgTask* pTask, bool freeRes); extern SCatalogMgmt gCtgMgmt; diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 27a7ce1022..d4c79a6c8d 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -1933,6 +1933,18 @@ _return: CTG_API_LEAVE(code); } +int32_t catalogAsyncUpdateDbTsmaVersion(SCatalog* pCtg, int32_t tsmaVersion, const char* dbFName, int64_t dbId) { + CTG_API_ENTER(); + if (!pCtg || !dbFName) { + CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT); + } + int32_t code = 0; + CTG_ERR_JRET(ctgUpdateDbTsmaVersionEnqueue(pCtg, tsmaVersion, dbFName, dbId, false)); + +_return: + CTG_API_LEAVE(code); +} + int32_t catalogClearCache(void) { CTG_API_ENTER_NOLOCK(); diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index 8e5aba26af..689bf900e2 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -34,7 +34,8 @@ SCtgOperation gCtgCacheOperation[CTG_OP_MAX] = {{CTG_OP_UPDATE_VGROUP, "update v {CTG_OP_DROP_VIEW_META, "drop viewMeta", ctgOpDropViewMeta}, {CTG_OP_UPDATE_TB_TSMA, "update tbTSMA", ctgOpUpdateTbTSMA}, {CTG_OP_DROP_TB_TSMA, "drop tbTSMA", ctgOpDropTbTSMA}, - {CTG_OP_CLEAR_CACHE, "clear cache", ctgOpClearCache}}; + {CTG_OP_CLEAR_CACHE, "clear cache", ctgOpClearCache}, + {CTG_OP_UPDATE_DB_TSMA_VERSION, "update dbTsmaVersion", ctgOpUpdateDbTsmaVersion}}; SCtgCacheItemInfo gCtgStatItem[CTG_CI_MAX_VALUE] = { {"Cluster ", CTG_CI_FLAG_LEVEL_GLOBAL}, //CTG_CI_CLUSTER @@ -1628,6 +1629,41 @@ _return: CTG_RET(code); } +int32_t ctgUpdateDbTsmaVersionEnqueue(SCatalog* pCtg, int32_t tsmaVersion, const char* dbFName, int64_t dbId, bool syncOp) { + int32_t code = 0; + SCtgCacheOperation *op = taosMemoryCalloc(1, sizeof(SCtgCacheOperation)); + if (NULL == op) { + ctgError("malloc %d failed", (int32_t)sizeof(SCtgCacheOperation)); + CTG_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + op->opId = CTG_OP_UPDATE_DB_TSMA_VERSION; + op->syncOp = syncOp; + + SCtgUpdateTbTSMAMsg *msg = taosMemoryMalloc(sizeof(SCtgUpdateTbTSMAMsg)); + if (NULL == msg) { + ctgError("malloc %d failed", (int32_t)sizeof(SCtgUpdateTbTSMAMsg)); + taosMemoryFree(op); + CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); + } + + msg->pCtg = pCtg; + msg->pTsma = NULL; + msg->dbTsmaVersion = tsmaVersion; + msg->dbId = dbId; + memcpy(msg->dbFName, dbFName, TSDB_DB_FNAME_LEN); + + op->data = msg; + + CTG_ERR_JRET(ctgEnqueue(pCtg, op)); + + return TSDB_CODE_SUCCESS; + +_return: + + CTG_RET(code); +} + int32_t ctgAddNewDBCache(SCatalog *pCtg, const char *dbFName, uint64_t dbId) { int32_t code = 0; @@ -3010,6 +3046,32 @@ _return: CTG_RET(code); } +static int32_t ctgOpUpdateDbRentForTsmaVersion(SCtgDBCache* pDbCache, SCtgUpdateTbTSMAMsg* pMsg) { + int32_t code = TSDB_CODE_SUCCESS; + if (pDbCache && pMsg->dbTsmaVersion > 0) { + pDbCache->tsmaVersion = pMsg->dbTsmaVersion; + SDbCacheInfo cacheInfo = {0}; + cacheInfo.dbId = pDbCache->dbId; + + if (pDbCache->cfgCache.cfgInfo) { + cacheInfo.cfgVersion = pDbCache->cfgCache.cfgInfo->cfgVersion; + tstrncpy(cacheInfo.dbFName, pDbCache->cfgCache.cfgInfo->db, TSDB_DB_FNAME_LEN); + } + + if (pDbCache->vgCache.vgInfo) { + cacheInfo.vgVersion = pDbCache->vgCache.vgInfo->vgVersion; + cacheInfo.numOfTable = pDbCache->vgCache.vgInfo->numOfTable; + cacheInfo.stateTs = pDbCache->vgCache.vgInfo->stateTs; + } + + cacheInfo.tsmaVersion = pDbCache->tsmaVersion; + CTG_ERR_JRET(ctgMetaRentUpdate(&pMsg->pCtg->dbRent, &cacheInfo, cacheInfo.dbId, sizeof(SDbCacheInfo), + ctgDbCacheInfoSortCompare, ctgDbCacheInfoSearchCompare)); + } +_return: + CTG_RET(code); +} + int32_t ctgOpUpdateTbTSMA(SCtgCacheOperation *operation) { int32_t code = 0; SCtgUpdateTbTSMAMsg *msg = operation->data; @@ -3023,27 +3085,7 @@ int32_t ctgOpUpdateTbTSMA(SCtgCacheOperation *operation) { CTG_ERR_JRET(ctgGetAddDBCache(pCtg, pTsmaInfo->dbFName, pTsmaInfo->dbId, &dbCache)); CTG_ERR_JRET(ctgWriteTbTSMAToCache(pCtg, dbCache, pTsmaInfo->dbFName, pTsmaInfo->tb, &pTsmaInfo)); - - if (dbCache && msg->dbTsmaVersion > 0) { - dbCache->tsmaVersion = msg->dbTsmaVersion; - SDbCacheInfo cacheInfo = {0}; - cacheInfo.dbId = dbCache->dbId; - - if (dbCache->cfgCache.cfgInfo) { - cacheInfo.cfgVersion = dbCache->cfgCache.cfgInfo->cfgVersion; - tstrncpy(cacheInfo.dbFName, dbCache->cfgCache.cfgInfo->db, TSDB_DB_FNAME_LEN); - } - - if (dbCache->vgCache.vgInfo) { - cacheInfo.vgVersion = dbCache->vgCache.vgInfo->vgVersion; - cacheInfo.numOfTable = dbCache->vgCache.vgInfo->numOfTable; - cacheInfo.stateTs = dbCache->vgCache.vgInfo->stateTs; - } - - cacheInfo.tsmaVersion = dbCache->tsmaVersion; - CTG_ERR_JRET(ctgMetaRentUpdate(&msg->pCtg->dbRent, &cacheInfo, cacheInfo.dbId, sizeof(SDbCacheInfo), - ctgDbCacheInfoSortCompare, ctgDbCacheInfoSearchCompare)); - } + CTG_ERR_JRET(ctgOpUpdateDbRentForTsmaVersion(dbCache, msg)); _return: @@ -3057,6 +3099,22 @@ _return: CTG_RET(code); } +int32_t ctgOpUpdateDbTsmaVersion(SCtgCacheOperation *pOper) { + int32_t code = 0; + SCtgUpdateTbTSMAMsg *pMsg = pOper->data; + SCatalog *pCtg = pMsg->pCtg; + SCtgDBCache *pDbCache = NULL; + + if (pCtg->stopUpdate) goto _return; + + CTG_ERR_JRET(ctgGetAddDBCache(pCtg, pMsg->dbFName, pMsg->dbId, &pDbCache)); + CTG_ERR_JRET(ctgOpUpdateDbRentForTsmaVersion(pDbCache, pMsg)); + +_return: + taosMemoryFreeClear(pMsg); + CTG_RET(code); +} + void ctgFreeCacheOperationData(SCtgCacheOperation *op) { if (NULL == op || NULL == op->data) { diff --git a/source/libs/executor/inc/tfill.h b/source/libs/executor/inc/tfill.h index b659c12315..b06aa7d1c8 100644 --- a/source/libs/executor/inc/tfill.h +++ b/source/libs/executor/inc/tfill.h @@ -128,9 +128,9 @@ SFillColInfo* createFillColInfo(SExprInfo* pExpr, int32_t numOfFillExpr, SExprIn int32_t numOfNotFillCols, const struct SNodeListNode* val); bool taosFillHasMoreResults(struct SFillInfo* pFillInfo); -void taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t numOfNotFillCols, int32_t capacity, - SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, int32_t slotId, - int32_t order, const char* id, SExecTaskInfo* pTaskInfo, SFillInfo** ppFillInfo); +int32_t taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t numOfNotFillCols, int32_t capacity, + SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, int32_t slotId, + int32_t order, const char* id, SExecTaskInfo* pTaskInfo, SFillInfo** ppFillInfo); void* taosDestroyFillInfo(struct SFillInfo* pFillInfo); int32_t taosFillResultDataBlock(struct SFillInfo* pFillInfo, SSDataBlock* p, int32_t capacity); diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c index 9316ba960e..3964422411 100644 --- a/source/libs/executor/src/dataDispatcher.c +++ b/source/libs/executor/src/dataDispatcher.c @@ -332,17 +332,12 @@ int32_t createDataDispatcher(SDataSinkManager* pManager, const SDataSinkNode* pD goto _return; } - if (NULL == dispatcher->pDataBlocks) { - taosMemoryFree(dispatcher); - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _return; - } - *pHandle = dispatcher; return TSDB_CODE_SUCCESS; _return: - - taosMemoryFree(pManager); + if (dispatcher) { + dsDestroyDataSinker(dispatcher); + } return terrno; } diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 5afae596a4..bdc1e42b28 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -485,6 +485,9 @@ void freeSourceDataInfo(void* p) { } void doDestroyExchangeOperatorInfo(void* param) { + if (param == NULL) { + return; + } SExchangeInfo* pExInfo = (SExchangeInfo*)param; if (pExInfo->pFetchRpcHandles) { for (int32_t i = 0; i < pExInfo->pFetchRpcHandles->size; ++i) { diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index dc0baebd66..b1c9207ab7 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -316,7 +316,6 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int3 qTaskInfo_t pTaskInfo = NULL; code = qCreateExecTask(pReaderHandle, vgId, 0, pPlan, &pTaskInfo, NULL, 0, NULL, OPTR_EXEC_MODEL_QUEUE); if (code != TSDB_CODE_SUCCESS) { - nodesDestroyNode((SNode*)pPlan); qDestroyTask(pTaskInfo); terrno = code; return NULL; @@ -352,7 +351,6 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers, int32_t v qTaskInfo_t pTaskInfo = NULL; code = qCreateExecTask(readers, vgId, taskId, pPlan, &pTaskInfo, NULL, 0, NULL, OPTR_EXEC_MODEL_STREAM); if (code != TSDB_CODE_SUCCESS) { - nodesDestroyNode((SNode*)pPlan); qDestroyTask(pTaskInfo); terrno = code; return NULL; @@ -360,7 +358,6 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers, int32_t v code = qStreamInfoResetTimewindowFilter(pTaskInfo); if (code != TSDB_CODE_SUCCESS) { - nodesDestroyNode((SNode*)pPlan); qDestroyTask(pTaskInfo); terrno = code; return NULL; diff --git a/source/libs/executor/src/filloperator.c b/source/libs/executor/src/filloperator.c index 34f174377b..0b66834d45 100644 --- a/source/libs/executor/src/filloperator.c +++ b/source/libs/executor/src/filloperator.c @@ -405,8 +405,12 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t // STimeWindow w = {0}; // getInitialStartTimeWindow(pInterval, startKey, &w, order == TSDB_ORDER_ASC); pInfo->pFillInfo = NULL; - taosCreateFillInfo(startKey, numOfCols, numOfNotFillCols, capacity, pInterval, fillType, pColInfo, - pInfo->primaryTsCol, order, id, pTaskInfo, &pInfo->pFillInfo); + int32_t code = taosCreateFillInfo(startKey, numOfCols, numOfNotFillCols, capacity, pInterval, fillType, pColInfo, + pInfo->primaryTsCol, order, id, pTaskInfo, &pInfo->pFillInfo); + if (code != TSDB_CODE_SUCCESS) { + qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code)); + return code; + } if (order == TSDB_ORDER_ASC) { pInfo->win.skey = win.skey; diff --git a/source/libs/executor/src/groupcacheoperator.c b/source/libs/executor/src/groupcacheoperator.c index 00b8c3b9ae..3e9ac2b10a 100644 --- a/source/libs/executor/src/groupcacheoperator.c +++ b/source/libs/executor/src/groupcacheoperator.c @@ -73,6 +73,10 @@ static int32_t initGroupColsInfo(SGroupColsInfo* pCols, bool grpColsMayBeNull, S } static void logGroupCacheExecInfo(SGroupCacheOperatorInfo* pGrpCacheOperator) { + if (pGrpCacheOperator->downstreamNum <= 0 || NULL == pGrpCacheOperator->execInfo.pDownstreamBlkNum) { + return; + } + char* buf = taosMemoryMalloc(pGrpCacheOperator->downstreamNum * 32 + 100); if (NULL == buf) { return; diff --git a/source/libs/executor/src/querytask.c b/source/libs/executor/src/querytask.c index 7100e10276..881b4f9316 100644 --- a/source/libs/executor/src/querytask.c +++ b/source/libs/executor/src/querytask.c @@ -65,6 +65,7 @@ int32_t doCreateTask(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC p->id.taskId = taskId; p->id.str = taosMemoryMalloc(64); if (p->id.str == NULL) { + doDestroyTask(p); return terrno; } @@ -100,6 +101,7 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand int32_t vgId, char* sql, EOPTR_EXEC_MODEL model) { int32_t code = doCreateTask(pPlan->id.queryId, taskId, vgId, model, &pHandle->api, pTaskInfo); if (*pTaskInfo == NULL || code != 0) { + nodesDestroyNode((SNode*)pPlan); taosMemoryFree(sql); return code; } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index afca6bd185..1935f2b0b6 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -255,21 +255,28 @@ static int32_t doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg* pCol return filterRangeExecute(pFilterInfo, pColsAgg, numOfCols, numOfRows, keep); } -static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo) { +static int32_t doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, + bool* pLoad) { SStorageAPI* pAPI = &pTaskInfo->storageAPI; + bool allColumnsHaveAgg = true; + bool hasNullSMA = false; + if (pLoad != NULL) { + *pLoad = false; + } - bool allColumnsHaveAgg = true; - bool hasNullSMA = false; int32_t code = pAPI->tsdReader.tsdReaderRetrieveBlockSMAInfo(pTableScanInfo->dataReader, pBlock, &allColumnsHaveAgg, &hasNullSMA); if (code != TSDB_CODE_SUCCESS) { - T_LONG_JMP(pTaskInfo->env, code); + return code; } if (!allColumnsHaveAgg || hasNullSMA) { - return false; + *pLoad = false; + } else { + *pLoad = true; } - return true; + + return code; } static void doSetTagColumnData(STableScanBase* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, @@ -330,14 +337,14 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca int32_t lino = 0; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SStorageAPI* pAPI = &pTaskInfo->storageAPI; + bool loadSMA = false; SFileBlockLoadRecorder* pCost = &pTableScanInfo->readRecorder; pCost->totalBlocks += 1; pCost->totalRows += pBlock->info.rows; - - bool loadSMA = false; *status = pTableScanInfo->dataBlockLoadFlag; + if (pOperator->exprSupp.pFilterInfo != NULL) { (*status) = FUNC_DATA_REQUIRED_DATA_LOAD; } else { @@ -373,7 +380,14 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca } else if (*status == FUNC_DATA_REQUIRED_SMA_LOAD) { pCost->loadBlockStatis += 1; loadSMA = true; // mark the operation of load sma; - bool success = doLoadBlockSMA(pTableScanInfo, pBlock, pTaskInfo); + bool success = true; + code = doLoadBlockSMA(pTableScanInfo, pBlock, pTaskInfo, &success); + if (code) { + pAPI->tsdReader.tsdReaderReleaseDataBlock(pTableScanInfo->dataReader); + qError("%s failed to retrieve sma info", GET_TASKID(pTaskInfo)); + QUERY_CHECK_CODE(code, lino, _end); + } + if (success) { // failed to load the block sma data, data block statistics does not exist, load data block instead qDebug("%s data block SMA loaded, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64, GET_TASKID(pTaskInfo), pBlockInfo->window.skey, pBlockInfo->window.ekey, pBlockInfo->rows); @@ -387,13 +401,21 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca } if(*status != FUNC_DATA_REQUIRED_DATA_LOAD) { - qError("[loadDataBlock] invalid status:%d", *status); + pAPI->tsdReader.tsdReaderReleaseDataBlock(pTableScanInfo->dataReader); + qError("%s loadDataBlock invalid status:%d", GET_TASKID(pTaskInfo), *status); return TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; } // try to filter data block according to sma info if (pOperator->exprSupp.pFilterInfo != NULL && (!loadSMA)) { - bool success = doLoadBlockSMA(pTableScanInfo, pBlock, pTaskInfo); + bool success = true; + code = doLoadBlockSMA(pTableScanInfo, pBlock, pTaskInfo, &success); + if (code) { + pAPI->tsdReader.tsdReaderReleaseDataBlock(pTableScanInfo->dataReader); + qError("%s failed to retrieve sma info", GET_TASKID(pTaskInfo)); + QUERY_CHECK_CODE(code, lino, _end); + } + if (success) { size_t size = taosArrayGetSize(pBlock->pDataBlock); bool keep = false; @@ -418,7 +440,10 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca // try to filter data block according to current results code = doDynamicPruneDataBlock(pOperator, pBlockInfo, status); - QUERY_CHECK_CODE(code, lino, _end); + if (code) { + pAPI->tsdReader.tsdReaderReleaseDataBlock(pTableScanInfo->dataReader); + QUERY_CHECK_CODE(code, lino, _end); + } if (*status == FUNC_DATA_REQUIRED_NOT_LOAD) { qDebug("%s data block skipped due to dynamic prune, brange:%" PRId64 "-%" PRId64 ", rows:%" PRId64, @@ -514,9 +539,10 @@ static int32_t createTableCacheVal(const SMetaReader* pMetaReader, STableCachedV int32_t lino = 0; STableCachedVal* pVal = taosMemoryMalloc(sizeof(STableCachedVal)); QUERY_CHECK_NULL(pVal, code, lino, _end, terrno); + + pVal->pTags = NULL; pVal->pName = taosStrdup(pMetaReader->me.name); QUERY_CHECK_NULL(pVal->pName, code, lino, _end, terrno); - pVal->pTags = NULL; // only child table has tag value if (pMetaReader->me.type == TSDB_CHILD_TABLE) { @@ -3806,6 +3832,9 @@ _end: } static void destroyStreamScanOperatorInfo(void* param) { + if (param == NULL) { + return; + } SStreamScanInfo* pStreamScan = (SStreamScanInfo*)param; if (pStreamScan->pTableScanOp && pStreamScan->pTableScanOp->info) { diff --git a/source/libs/executor/src/streameventwindowoperator.c b/source/libs/executor/src/streameventwindowoperator.c index bde6198709..93f30ea899 100644 --- a/source/libs/executor/src/streameventwindowoperator.c +++ b/source/libs/executor/src/streameventwindowoperator.c @@ -43,6 +43,9 @@ typedef struct SEventWindowInfo { } SEventWindowInfo; void destroyStreamEventOperatorInfo(void* param) { + if (param == NULL) { + return; + } SStreamEventAggOperatorInfo* pInfo = (SStreamEventAggOperatorInfo*)param; cleanupBasicInfo(&pInfo->binfo); destroyStreamAggSupporter(&pInfo->streamAggSup); diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index 61d4eed156..cf3b53bf02 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -454,6 +454,9 @@ void clearGroupResInfo(SGroupResInfo* pGroupResInfo) { } void destroyStreamFinalIntervalOperatorInfo(void* param) { + if (param == NULL) { + return; + } SStreamIntervalOperatorInfo* pInfo = (SStreamIntervalOperatorInfo*)param; cleanupBasicInfo(&pInfo->binfo); cleanupAggSup(&pInfo->aggSup); @@ -2031,6 +2034,9 @@ void destroyStreamAggSupporter(SStreamAggSupporter* pSup) { } void destroyStreamSessionAggOperatorInfo(void* param) { + if (param == NULL) { + return; + } SStreamSessionAggOperatorInfo* pInfo = (SStreamSessionAggOperatorInfo*)param; cleanupBasicInfo(&pInfo->binfo); destroyStreamAggSupporter(&pInfo->streamAggSup); @@ -4106,6 +4112,9 @@ _error: } void destroyStreamStateOperatorInfo(void* param) { + if (param == NULL) { + return; + } SStreamStateAggOperatorInfo* pInfo = (SStreamStateAggOperatorInfo*)param; cleanupBasicInfo(&pInfo->binfo); destroyStreamAggSupporter(&pInfo->streamAggSup); diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index e11ee6b0dc..a2cfedd16e 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -552,6 +552,8 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { blockDataCleanup(pInfo->pRes); pDataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_COLS); + QUERY_CHECK_NULL(pDataBlock, code, lino, _end, terrno); + code = blockDataEnsureCapacity(pDataBlock, pOperator->resultInfo.capacity); QUERY_CHECK_CODE(code, lino, _end); @@ -568,7 +570,12 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { if (pInfo->pCur == NULL) { pInfo->pCur = pAPI->metaFn.openTableMetaCursor(pInfo->readHandle.vnode); } else { - (void)pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); + code = pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); + if (code != 0) { + pAPI->metaFn.closeTableMetaCursor(pInfo->pCur); + pInfo->pCur = NULL; + QUERY_CHECK_CODE(code, lino, _end); + } } if (pInfo->pSchema == NULL) { @@ -708,6 +715,8 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { int32_t numOfRows = 0; dataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TAGS); + QUERY_CHECK_NULL(dataBlock, code, lino, _end, terrno); + code = blockDataEnsureCapacity(dataBlock, pOperator->resultInfo.capacity); QUERY_CHECK_CODE(code, lino, _end); @@ -782,7 +791,8 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { pInfo->pCur = pAPI->metaFn.openTableMetaCursor(pInfo->readHandle.vnode); QUERY_CHECK_NULL(pInfo->pCur, code, lino, _end, terrno); } else { - (void)pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); + code = pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 0); + QUERY_CHECK_CODE(code, lino, _end); } while ((ret = pAPI->metaFn.cursorNext(pInfo->pCur, TSDB_SUPER_TABLE)) == 0) { @@ -1354,6 +1364,8 @@ static SSDataBlock* sysTableBuildUserTablesByUids(SOperatorInfo* pOperator) { varDataSetLen(dbname, strlen(varDataVal(dbname))); p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_TABLES); + QUERY_CHECK_NULL(p, code, lino, _end, terrno); + code = blockDataEnsureCapacity(p, pOperator->resultInfo.capacity); QUERY_CHECK_CODE(code, lino, _end); @@ -1583,7 +1595,12 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) { firstMetaCursor = 1; } if (!firstMetaCursor) { - (void)pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 1); + code = pAPI->metaFn.resumeTableMetaCursor(pInfo->pCur, 0, 1); + if (code != 0) { + pAPI->metaFn.closeTableMetaCursor(pInfo->pCur); + pInfo->pCur = NULL; + QUERY_CHECK_CODE(code, lino, _end); + } } blockDataCleanup(pInfo->pRes); @@ -2075,6 +2092,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca int32_t tempRes = tSerializeSRetrieveTableReq(buf1, contLen, &pInfo->req); if (tempRes < 0) { code = terrno; + taosMemoryFree(buf1); return NULL; } @@ -2083,6 +2101,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca if (NULL == pMsgSendInfo) { qError("%s prepare message %d failed", GET_TASKID(pTaskInfo), (int32_t)sizeof(SMsgSendInfo)); pTaskInfo->code = TSDB_CODE_OUT_OF_MEMORY; + taosMemoryFree(buf1); return NULL; } diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index c2ccdf62f5..e346946a7a 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -523,14 +523,14 @@ static int32_t taosNumOfRemainRows(SFillInfo* pFillInfo) { return pFillInfo->numOfRows - pFillInfo->index; } -void taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t numOfNotFillCols, int32_t capacity, - SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, int32_t primaryTsSlotId, - int32_t order, const char* id, SExecTaskInfo* pTaskInfo, SFillInfo** ppFillInfo) { +int32_t taosCreateFillInfo(TSKEY skey, int32_t numOfFillCols, int32_t numOfNotFillCols, int32_t capacity, + SInterval* pInterval, int32_t fillType, struct SFillColInfo* pCol, int32_t primaryTsSlotId, + int32_t order, const char* id, SExecTaskInfo* pTaskInfo, SFillInfo** ppFillInfo) { int32_t code = TSDB_CODE_SUCCESS; int32_t lino = 0; if (fillType == TSDB_FILL_NONE) { (*ppFillInfo) = NULL; - return; + return code; } SFillInfo* pFillInfo = taosMemoryCalloc(1, sizeof(SFillInfo)); @@ -572,10 +572,9 @@ _end: if (code != TSDB_CODE_SUCCESS) { taosArrayDestroy(pFillInfo->next.pRowVal); taosArrayDestroy(pFillInfo->prev.pRowVal); - terrno = code; - T_LONG_JMP(pTaskInfo->env, code); } (*ppFillInfo) = pFillInfo; + return code; } void taosResetFillInfo(SFillInfo* pFillInfo, TSKEY startTimestamp) { diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index ca6b89f7c5..fa9dc79cc3 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1208,6 +1208,9 @@ static void freeItem(void* param) { } void destroyIntervalOperatorInfo(void* param) { + if (param == NULL) { + return; + } SIntervalAggOperatorInfo* pInfo = (SIntervalAggOperatorInfo*)param; cleanupBasicInfo(&pInfo->binfo); cleanupAggSup(&pInfo->aggSup); @@ -1227,7 +1230,7 @@ void destroyIntervalOperatorInfo(void* param) { } static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SIntervalAggOperatorInfo* pInfo, - SExecTaskInfo* pTaskInfo) { + bool* pRes) { // the primary timestamp column bool needed = false; int32_t code = TSDB_CODE_SUCCESS; @@ -1295,10 +1298,9 @@ static bool timeWindowinterpNeeded(SqlFunctionCtx* pCtx, int32_t numOfCols, SInt _end: if (code != TSDB_CODE_SUCCESS) { qError("%s failed at line %d since %s", __func__, lino, tstrerror(code)); - pTaskInfo->code = code; - T_LONG_JMP(pTaskInfo->env, code); } - return needed; + *pRes = needed; + return code; } int32_t createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, @@ -1387,7 +1389,10 @@ int32_t createIntervalOperatorInfo(SOperatorInfo* downstream, SIntervalPhysiNode code = initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pInfo->win); QUERY_CHECK_CODE(code, lino, _error); - pInfo->timeWindowInterpo = timeWindowinterpNeeded(pSup->pCtx, num, pInfo, pTaskInfo); + + pInfo->timeWindowInterpo = false; + code = timeWindowinterpNeeded(pSup->pCtx, num, pInfo, &pInfo->timeWindowInterpo); + QUERY_CHECK_CODE(code, lino, _error); if (pInfo->timeWindowInterpo) { pInfo->binfo.resultRowInfo.openWindow = tdListNew(sizeof(SOpenWindowInfo)); if (pInfo->binfo.resultRowInfo.openWindow == NULL) { @@ -2082,7 +2087,9 @@ int32_t createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, SMerge code = initExecTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &iaInfo->win); QUERY_CHECK_CODE(code, lino, _error); - iaInfo->timeWindowInterpo = timeWindowinterpNeeded(pSup->pCtx, num, iaInfo, pTaskInfo); + iaInfo->timeWindowInterpo = false; + code = timeWindowinterpNeeded(pSup->pCtx, num, iaInfo, &iaInfo->timeWindowInterpo); + QUERY_CHECK_CODE(code, lino, _error); if (iaInfo->timeWindowInterpo) { iaInfo->binfo.resultRowInfo.openWindow = tdListNew(sizeof(SOpenWindowInfo)); } @@ -2413,7 +2420,9 @@ int32_t createMergeIntervalOperatorInfo(SOperatorInfo* downstream, SMergeInterva code = initExecTimeWindowInfo(&pIntervalInfo->twAggSup.timeWindowData, &pIntervalInfo->win); QUERY_CHECK_CODE(code, lino, _error); - pIntervalInfo->timeWindowInterpo = timeWindowinterpNeeded(pExprSupp->pCtx, num, pIntervalInfo, pTaskInfo); + pIntervalInfo->timeWindowInterpo = false; + code = timeWindowinterpNeeded(pExprSupp->pCtx, num, pIntervalInfo, &pIntervalInfo->timeWindowInterpo); + QUERY_CHECK_CODE(code, lino, _error); if (pIntervalInfo->timeWindowInterpo) { pIntervalInfo->binfo.resultRowInfo.openWindow = tdListNew(sizeof(SOpenWindowInfo)); if (pIntervalInfo->binfo.resultRowInfo.openWindow == NULL) { diff --git a/source/libs/function/inc/builtinsimpl.h b/source/libs/function/inc/builtinsimpl.h index 274ef61feb..7403a4ce31 100644 --- a/source/libs/function/inc/builtinsimpl.h +++ b/source/libs/function/inc/builtinsimpl.h @@ -96,19 +96,20 @@ int32_t avgInvertFunction(SqlFunctionCtx* pCtx); int32_t avgCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx); int32_t getAvgInfoSize(); -bool getStddevFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); -int32_t stddevFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo); -int32_t stddevFunction(SqlFunctionCtx* pCtx); -int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx); +bool getStdFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); +int32_t stdFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo); +int32_t stdFunction(SqlFunctionCtx* pCtx); +int32_t stdFunctionMerge(SqlFunctionCtx* pCtx); int32_t stddevFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); -int32_t stddevPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); +int32_t stdvarFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); +int32_t stdPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock); #ifdef BUILD_NO_CALL -int32_t stddevInvertFunction(SqlFunctionCtx* pCtx); +int32_t stdInvertFunction(SqlFunctionCtx* pCtx); #endif -int32_t stddevCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx); -int32_t getStddevInfoSize(); +int32_t stdCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx); +int32_t getStdInfoSize(); bool getLeastSQRFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv); int32_t leastSQRFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo); diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 8c809a5052..760a3c4a33 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -247,7 +247,7 @@ static int32_t addTimezoneParam(SNodeList* pList) { return TSDB_CODE_SUCCESS; } -static int32_t addDbPrecisonParam(SNodeList** pList, uint8_t precision) { +static int32_t addUint8Param(SNodeList** pList, uint8_t param) { SValueNode* pVal = NULL; int32_t code = nodesMakeNode(QUERY_NODE_VALUE, (SNode**)&pVal); if (pVal == NULL) { @@ -259,9 +259,9 @@ static int32_t addDbPrecisonParam(SNodeList** pList, uint8_t precision) { pVal->notReserved = true; pVal->node.resType.type = TSDB_DATA_TYPE_TINYINT; pVal->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TINYINT].bytes; - pVal->node.resType.precision = precision; - pVal->datum.i = (int64_t)precision; - pVal->typeData = (int64_t)precision; + pVal->node.resType.precision = param; + pVal->datum.i = (int64_t)param; + pVal->typeData = (int64_t)param; code = nodesListMakeAppend(pList, (SNode*)pVal); if (TSDB_CODE_SUCCESS != code) { @@ -493,7 +493,7 @@ static int32_t translateAvgStateMerge(SFunctionNode* pFunc, char* pErrBuf, int32 return TSDB_CODE_SUCCESS; } -static int32_t translateStddevPartial(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { +static int32_t translateStdPartial(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } @@ -503,11 +503,11 @@ static int32_t translateStddevPartial(SFunctionNode* pFunc, char* pErrBuf, int32 return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } - pFunc->node.resType = (SDataType){.bytes = getStddevInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; + pFunc->node.resType = (SDataType){.bytes = getStdInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; return TSDB_CODE_SUCCESS; } -static int32_t translateStddevMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { +static int32_t translateStdMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } @@ -522,7 +522,7 @@ static int32_t translateStddevMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t return TSDB_CODE_SUCCESS; } -static int32_t translateStddevState(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { +static int32_t translateStdState(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } @@ -532,11 +532,11 @@ static int32_t translateStddevState(SFunctionNode* pFunc, char* pErrBuf, int32_t return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } - pFunc->node.resType = (SDataType){.bytes = getStddevInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; + pFunc->node.resType = (SDataType){.bytes = getStdInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; return TSDB_CODE_SUCCESS; } -static int32_t translateStddevStateMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { +static int32_t translateStdStateMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } @@ -546,7 +546,7 @@ static int32_t translateStddevStateMerge(SFunctionNode* pFunc, char* pErrBuf, in return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } - pFunc->node.resType = (SDataType){.bytes = getStddevInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; + pFunc->node.resType = (SDataType){.bytes = getStdInfoSize() + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_BINARY}; return TSDB_CODE_SUCCESS; } @@ -563,7 +563,7 @@ static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t le // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -573,6 +573,53 @@ static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t le return TSDB_CODE_SUCCESS; } +static int32_t translatePi(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + pFunc->node.resType = + (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes, .type = TSDB_DATA_TYPE_DOUBLE}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateRound(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList) && 1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (!IS_NUMERIC_TYPE(paraType) && !IS_NULL_TYPE(paraType)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } else if (IS_NULL_TYPE(paraType)) { + paraType = TSDB_DATA_TYPE_BIGINT; + } + + if (2 == LIST_LENGTH(pFunc->pParameterList)) { + uint8_t paraType2 = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (!IS_NUMERIC_TYPE(paraType2) && !IS_NULL_TYPE(paraType2)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + } + pFunc->node.resType = (SDataType){.bytes = tDataTypes[paraType].bytes, .type = paraType}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateTrunc(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (!IS_NUMERIC_TYPE(paraType) && !IS_NULL_TYPE(paraType)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t paraType2 = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (!IS_NUMERIC_TYPE(paraType2) && !IS_NULL_TYPE(paraType2)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[paraType].bytes, .type = paraType}; + return TSDB_CODE_SUCCESS; +} + static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // pseudo column do not need to check parameters @@ -1745,7 +1792,7 @@ static int32_t translateIrate(SFunctionNode* pFunc, char* pErrBuf, int32_t len) // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -1776,7 +1823,7 @@ static int32_t translateIrateImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t l // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2032,7 +2079,22 @@ static int32_t translateLength(SFunctionNode* pFunc, char* pErrBuf, int32_t len) return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); } - if (!IS_STR_DATA_TYPE(getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type)) { + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (!IS_STR_DATA_TYPE(paraType) && !IS_NULL_TYPE(paraType)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateCharLength(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (paraType == TSDB_DATA_TYPE_VARBINARY || (!IS_STR_DATA_TYPE(paraType) && !IS_NULL_TYPE(paraType))) { return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } @@ -2124,31 +2186,193 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len) uint8_t para0Type = pPara0->resType.type; uint8_t para1Type = pPara1->resType.type; - if (TSDB_DATA_TYPE_VARBINARY == para0Type || !IS_STR_DATA_TYPE(para0Type) || !IS_INTEGER_TYPE(para1Type)) { + if (TSDB_DATA_TYPE_VARBINARY == para0Type || + (!IS_STR_DATA_TYPE(para0Type) && !IS_NULL_TYPE(para0Type)) || + (!IS_INTEGER_TYPE(para1Type) && !IS_NULL_TYPE(para1Type))) { return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } - if (((SValueNode*)pPara1)->datum.i == 0) { - return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); - } - if (3 == numOfParams) { SExprNode* pPara2 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 2); uint8_t para2Type = pPara2->resType.type; - if (!IS_INTEGER_TYPE(para2Type)) { + if (!IS_INTEGER_TYPE(para2Type) && !IS_NULL_TYPE(para2Type)) { return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); } int64_t v = ((SValueNode*)pPara2)->datum.i; - if (v < 0) { - return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); - } } pFunc->node.resType = (SDataType){.bytes = pPara0->resType.bytes, .type = pPara0->resType.type}; return TSDB_CODE_SUCCESS; } +static int32_t translateSubstrIdx(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (3 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + SExprNode* pPara0 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0); + SExprNode* pPara1 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 1); + SExprNode* pPara2 = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 2); + + uint8_t para0Type = pPara0->resType.type; + uint8_t para1Type = pPara1->resType.type; + uint8_t para2Type = pPara2->resType.type; + if (TSDB_DATA_TYPE_VARBINARY == para0Type || (!IS_STR_DATA_TYPE(para0Type) && !IS_NULL_TYPE(para0Type)) || + TSDB_DATA_TYPE_VARBINARY == para1Type || (!IS_STR_DATA_TYPE(para1Type) && !IS_NULL_TYPE(para1Type)) || + (!IS_INTEGER_TYPE(para2Type) && !IS_NULL_TYPE(para2Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = pPara0->resType.bytes, .type = pPara0->resType.type}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateChar(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + SNode *node; + FOREACH(node, pFunc->pParameterList) { + uint8_t paraType = getSDataTypeFromNode(node)->type; + if (paraType == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(paraType) && !IS_NUMERIC_TYPE(paraType) && !IS_NULL_TYPE(paraType))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + } + + int32_t numOfParams = LIST_LENGTH(pFunc->pParameterList); + pFunc->node.resType = (SDataType){.bytes = 4 * numOfParams + 2, .type = TSDB_DATA_TYPE_VARCHAR}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateAscii(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (paraType == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(paraType) && !IS_NULL_TYPE(paraType))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_UTINYINT].bytes, .type = TSDB_DATA_TYPE_UTINYINT}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translatePosition(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para0Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (para0Type == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(para0Type) && !IS_NULL_TYPE(para0Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (para1Type == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(para1Type) && !IS_NULL_TYPE(para1Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateTrim(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList) && 1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para0Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (para0Type == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(para0Type) && !IS_NULL_TYPE(para0Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + int32_t resLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->bytes; + uint8_t type = para0Type; + + if (2 == LIST_LENGTH(pFunc->pParameterList)) { + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (para1Type == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(para1Type) && !IS_NULL_TYPE(para1Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + resLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->bytes; + type = para1Type; + } + if (type == TSDB_DATA_TYPE_NCHAR) { + resLen *= TSDB_NCHAR_SIZE; + } + uint8_t trimType = pFunc->trimType; + int32_t code = addUint8Param(&pFunc->pParameterList, trimType); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + pFunc->node.resType = (SDataType){.bytes = resLen, .type = type}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateReplace(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (3 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + for (int32_t i = 0; i < 3; ++i) { + uint8_t paraType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, i))->type; + if (paraType == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(paraType) && !IS_NULL_TYPE(paraType))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + } + + uint8_t orgType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + uint8_t fromType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + uint8_t toType = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 2))->type; + int32_t orgLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->bytes; + int32_t fromLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->bytes; + int32_t toLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 2))->bytes; + + int32_t resLen; + // Since we don't know the accurate length of result, estimate the maximum length here. + // To make the resLen bigger, we should make fromLen smaller and toLen bigger. + if (orgType == TSDB_DATA_TYPE_VARBINARY && fromType != orgType) { + fromLen = fromLen / TSDB_NCHAR_SIZE; + } + if (orgType == TSDB_DATA_TYPE_NCHAR && toType != orgType) { + toLen = toLen * TSDB_NCHAR_SIZE; + } + resLen = TMAX(orgLen, orgLen + orgLen / fromLen * (toLen - fromLen)); + pFunc->node.resType = (SDataType){.bytes = resLen, .type = orgType}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateRepeat(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para0Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if (para0Type == TSDB_DATA_TYPE_VARBINARY || + (!IS_STR_DATA_TYPE(para0Type) && !IS_NULL_TYPE(para0Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (!IS_INTEGER_TYPE(para1Type) && !IS_NULL_TYPE(para1Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + int32_t orgLen = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->bytes; + int32_t count = TMAX((int32_t)((SValueNode*)nodesListGetNode(pFunc->pParameterList, 1))->datum.i, 1); + + int32_t resLen = orgLen * count; + pFunc->node.resType = (SDataType){.bytes = resLen, .type = type}; + return TSDB_CODE_SUCCESS; +} + static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // The number of parameters has been limited by the syntax definition @@ -2180,7 +2404,7 @@ static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2251,7 +2475,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int // add database precision as param uint8_t dbPrec = pFunc->node.resType.precision; - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2325,7 +2549,7 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_ // add database precision as param - code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2375,7 +2599,7 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le } } - int32_t code = addDbPrecisonParam(&pFunc->pParameterList, dbPrec); + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -2384,6 +2608,91 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le return TSDB_CODE_SUCCESS; } +static int32_t translateWeekday(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if ((!IS_STR_DATA_TYPE(para1Type) && !IS_INTEGER_TYPE(para1Type) && + !IS_TIMESTAMP_TYPE(para1Type) && !IS_NULL_TYPE(para1Type))) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + // add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + pFunc->node.resType = + (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateWeek(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList) && 2 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if ((!IS_STR_DATA_TYPE(para1Type) && !IS_INTEGER_TYPE(para1Type) && + !IS_TIMESTAMP_TYPE(para1Type)) && !IS_NULL_TYPE(para1Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + if (2 == LIST_LENGTH(pFunc->pParameterList)) { + uint8_t para2Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 1))->type; + if (!IS_INTEGER_TYPE(para2Type) && !IS_NULL_TYPE(para2Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + if (IS_INTEGER_TYPE(para2Type)) { + SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1); + if (pValue->datum.i < 0 || pValue->datum.i > 7) { + return invaildFuncParaValueErrMsg(pErrBuf, len, pFunc->functionName); + } + } + } + + // add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + pFunc->node.resType = + (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateWeekofyear(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + if (1 != LIST_LENGTH(pFunc->pParameterList)) { + return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); + } + + uint8_t para1Type = getSDataTypeFromNode(nodesListGetNode(pFunc->pParameterList, 0))->type; + if ((!IS_STR_DATA_TYPE(para1Type) && !IS_INTEGER_TYPE(para1Type) && + !IS_TIMESTAMP_TYPE(para1Type)) && !IS_NULL_TYPE(para1Type)) { + return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + } + + // add database precision as param + uint8_t dbPrec = pFunc->node.resType.precision; + + int32_t code = addUint8Param(&pFunc->pParameterList, dbPrec); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + pFunc->node.resType = + (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; + return TSDB_CODE_SUCCESS; +} + static int32_t translateToJson(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { if (1 != LIST_LENGTH(pFunc->pParameterList)) { return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName); @@ -2623,47 +2932,47 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .type = FUNCTION_TYPE_STDDEV, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TSMA_FUNC, .translateFunc = translateInNumOutDou, - .getEnvFunc = getStddevFuncEnv, - .initFunc = stddevFunctionSetup, - .processFunc = stddevFunction, - .sprocessFunc = stddevScalarFunction, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunction, + .sprocessFunc = stdScalarFunction, .finalizeFunc = stddevFinalize, #ifdef BUILD_NO_CALL - .invertFunc = stddevInvertFunction, + .invertFunc = stdInvertFunction, #endif - .combineFunc = stddevCombine, - .pPartialFunc = "_stddev_partial", - .pStateFunc = "_stddev_state", + .combineFunc = stdCombine, + .pPartialFunc = "_std_partial", + .pStateFunc = "_std_state", .pMergeFunc = "_stddev_merge" }, { - .name = "_stddev_partial", - .type = FUNCTION_TYPE_STDDEV_PARTIAL, + .name = "_std_partial", + .type = FUNCTION_TYPE_STD_PARTIAL, .classification = FUNC_MGT_AGG_FUNC, - .translateFunc = translateStddevPartial, - .getEnvFunc = getStddevFuncEnv, - .initFunc = stddevFunctionSetup, - .processFunc = stddevFunction, - .finalizeFunc = stddevPartialFinalize, + .translateFunc = translateStdPartial, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunction, + .finalizeFunc = stdPartialFinalize, #ifdef BUILD_NO_CALL - .invertFunc = stddevInvertFunction, + .invertFunc = stdInvertFunction, #endif - .combineFunc = stddevCombine, + .combineFunc = stdCombine, }, { .name = "_stddev_merge", .type = FUNCTION_TYPE_STDDEV_MERGE, .classification = FUNC_MGT_AGG_FUNC, - .translateFunc = translateStddevMerge, - .getEnvFunc = getStddevFuncEnv, - .initFunc = stddevFunctionSetup, - .processFunc = stddevFunctionMerge, + .translateFunc = translateStdMerge, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunctionMerge, .finalizeFunc = stddevFinalize, #ifdef BUILD_NO_CALL - .invertFunc = stddevInvertFunction, + .invertFunc = stdInvertFunction, #endif - .combineFunc = stddevCombine, - .pPartialFunc = "_stddev_state_merge", + .combineFunc = stdCombine, + .pPartialFunc = "_std_state_merge", .pMergeFunc = "_stddev_merge", }, { @@ -3409,7 +3718,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "round", .type = FUNCTION_TYPE_ROUND, .classification = FUNC_MGT_SCALAR_FUNC, - .translateFunc = translateInOutNum, + .translateFunc = translateRound, .getEnvFunc = NULL, .initFunc = NULL, .sprocessFunc = roundFunction, @@ -3489,7 +3798,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .name = "char_length", .type = FUNCTION_TYPE_CHAR_LENGTH, .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, - .translateFunc = translateLength, + .translateFunc = translateCharLength, .getEnvFunc = NULL, .initFunc = NULL, .sprocessFunc = charLengthFunction, @@ -3998,26 +4307,26 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .finalizeFunc = NULL }, { - .name = "_stddev_state", - .type = FUNCTION_TYPE_STDDEV_STATE, + .name = "_std_state", + .type = FUNCTION_TYPE_STD_STATE, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TSMA_FUNC, - .translateFunc = translateStddevState, - .getEnvFunc = getStddevFuncEnv, - .initFunc = stddevFunctionSetup, - .processFunc = stddevFunction, - .finalizeFunc = stddevPartialFinalize, - .pPartialFunc = "_stddev_partial", - .pMergeFunc = "_stddev_state_merge", + .translateFunc = translateStdState, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunction, + .finalizeFunc = stdPartialFinalize, + .pPartialFunc = "_std_partial", + .pMergeFunc = "_std_state_merge", }, { - .name = "_stddev_state_merge", - .type = FUNCTION_TYPE_STDDEV_STATE_MERGE, + .name = "_std_state_merge", + .type = FUNCTION_TYPE_STD_STATE_MERGE, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TSMA_FUNC, - .translateFunc = translateStddevStateMerge, - .getEnvFunc = getStddevFuncEnv, - .initFunc = stddevFunctionSetup, - .processFunc = stddevFunctionMerge, - .finalizeFunc = stddevPartialFinalize, + .translateFunc = translateStdStateMerge, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunctionMerge, + .finalizeFunc = stdPartialFinalize, }, { .name = "_avg_state", @@ -4152,6 +4461,268 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .processFunc = groupConstValueFunction, .finalizeFunc = groupConstValueFinalize, }, + { + .name = "stddev_pop", + .type = FUNCTION_TYPE_STDDEV, + .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TSMA_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunction, + .sprocessFunc = stdScalarFunction, + .finalizeFunc = stddevFinalize, + #ifdef BUILD_NO_CALL + .invertFunc = stdInvertFunction, + #endif + .combineFunc = stdCombine, + .pPartialFunc = "_std_partial", + .pStateFunc = "_std_state", + .pMergeFunc = "_stddev_merge" + }, + { + .name = "var_pop", + .type = FUNCTION_TYPE_STDVAR, + .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TSMA_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunction, + .sprocessFunc = stdScalarFunction, + .finalizeFunc = stdvarFinalize, + #ifdef BUILD_NO_CALL + .invertFunc = stdInvertFunction, + #endif + .combineFunc = stdCombine, + .pPartialFunc = "_std_partial", + .pStateFunc = "_std_state", + .pMergeFunc = "_stdvar_merge" + }, + { + .name = "_stdvar_merge", + .type = FUNCTION_TYPE_STDVAR_MERGE, + .classification = FUNC_MGT_AGG_FUNC, + .translateFunc = translateStdMerge, + .getEnvFunc = getStdFuncEnv, + .initFunc = stdFunctionSetup, + .processFunc = stdFunctionMerge, + .finalizeFunc = stdvarFinalize, + #ifdef BUILD_NO_CALL + .invertFunc = stdInvertFunction, + #endif + .combineFunc = stdCombine, + .pPartialFunc = "_std_state_merge", + .pMergeFunc = "_stdvar_merge", + }, + { + .name = "pi", + .type = FUNCTION_TYPE_PI, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translatePi, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = piFunction, + .finalizeFunc = NULL + }, + { + .name = "exp", + .type = FUNCTION_TYPE_EXP, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = expFunction, + .finalizeFunc = NULL + }, + { + .name = "ln", + .type = FUNCTION_TYPE_LN, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = lnFunction, + .finalizeFunc = NULL + }, + { + .name = "mod", + .type = FUNCTION_TYPE_MOD, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateIn2NumOutDou, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = modFunction, + .finalizeFunc = NULL + }, + { + .name = "sign", + .type = FUNCTION_TYPE_SIGN, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateInOutNum, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = signFunction, + .finalizeFunc = NULL + }, + { + .name = "degrees", + .type = FUNCTION_TYPE_DEGREES, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = degreesFunction, + .finalizeFunc = NULL + }, + { + .name = "radians", + .type = FUNCTION_TYPE_RADIANS, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateInNumOutDou, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = radiansFunction, + .finalizeFunc = NULL + }, + { + .name = "truncate", + .type = FUNCTION_TYPE_TRUNCATE, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateTrunc, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = truncFunction, + .finalizeFunc = NULL + }, + { + .name = "trunc", + .type = FUNCTION_TYPE_TRUNCATE, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateTrunc, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = truncFunction, + .finalizeFunc = NULL + }, + { + .name = "substring", + .type = FUNCTION_TYPE_SUBSTR, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateSubstr, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = substrFunction, + .finalizeFunc = NULL + }, + { + .name = "substring_index", + .type = FUNCTION_TYPE_SUBSTR_IDX, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateSubstrIdx, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = substrIdxFunction, + .finalizeFunc = NULL + }, + { + .name = "char", + .type = FUNCTION_TYPE_CHAR, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateChar, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = charFunction, + .finalizeFunc = NULL + }, + { + .name = "ascii", + .type = FUNCTION_TYPE_ASCII, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateAscii, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = asciiFunction, + .finalizeFunc = NULL + }, + { + .name = "position", + .type = FUNCTION_TYPE_POSITION, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translatePosition, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = positionFunction, + .finalizeFunc = NULL + }, + { + .name = "trim", + .type = FUNCTION_TYPE_TRIM, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateTrim, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = trimFunction, + .finalizeFunc = NULL + }, + { + .name = "replace", + .type = FUNCTION_TYPE_REPLACE, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateReplace, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = replaceFunction, + .finalizeFunc = NULL + }, + { + .name = "repeat", + .type = FUNCTION_TYPE_REPEAT, + .classification = FUNC_MGT_SCALAR_FUNC | FUNC_MGT_STRING_FUNC, + .translateFunc = translateRepeat, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = repeatFunction, + .finalizeFunc = NULL + }, + { + .name = "weekday", + .type = FUNCTION_TYPE_WEEKDAY, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateWeekday, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = weekdayFunction, + .finalizeFunc = NULL + }, + { + .name = "dayofweek", + .type = FUNCTION_TYPE_DAYOFWEEK, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateWeekday, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = dayofweekFunction, + .finalizeFunc = NULL + }, + { + .name = "week", + .type = FUNCTION_TYPE_WEEK, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateWeek, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = weekFunction, + .finalizeFunc = NULL + }, + { + .name = "weekofyear", + .type = FUNCTION_TYPE_WEEKOFYEAR, + .classification = FUNC_MGT_SCALAR_FUNC, + .translateFunc = translateWeekofyear, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = weekofyearFunction, + .finalizeFunc = NULL + }, }; // clang-format on diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 242c68913c..2d664e5d31 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -63,7 +63,7 @@ typedef struct STopBotRes { STopBotResItem* pItems; } STopBotRes; -typedef struct SStddevRes { +typedef struct SStdRes { double result; int64_t count; union { @@ -77,7 +77,7 @@ typedef struct SStddevRes { uint64_t usum; }; int16_t type; -} SStddevRes; +} SStdRes; typedef struct SLeastSQRInfo { double matrix[2][3]; @@ -1300,14 +1300,14 @@ int32_t maxCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { return minMaxCombine(pDestCtx, pSourceCtx, 0); } -int32_t getStddevInfoSize() { return (int32_t)sizeof(SStddevRes); } +int32_t getStdInfoSize() { return (int32_t)sizeof(SStdRes); } -bool getStddevFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { - pEnv->calcMemSize = sizeof(SStddevRes); +bool getStdFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) { + pEnv->calcMemSize = sizeof(SStdRes); return true; } -int32_t stddevFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { +int32_t stdFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { if (pResultInfo->initialized) { return TSDB_CODE_SUCCESS; } @@ -1315,20 +1315,20 @@ int32_t stddevFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultIn return TSDB_CODE_FUNC_SETUP_ERROR; } - SStddevRes* pRes = GET_ROWCELL_INTERBUF(pResultInfo); - (void)memset(pRes, 0, sizeof(SStddevRes)); + SStdRes* pRes = GET_ROWCELL_INTERBUF(pResultInfo); + (void)memset(pRes, 0, sizeof(SStdRes)); return TSDB_CODE_SUCCESS; } -int32_t stddevFunction(SqlFunctionCtx* pCtx) { +int32_t stdFunction(SqlFunctionCtx* pCtx) { int32_t numOfElem = 0; // Only the pre-computing information loaded and actual data does not loaded SInputColumnInfoData* pInput = &pCtx->input; int32_t type = pInput->pData[0]->info.type; - SStddevRes* pStddevRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - pStddevRes->type = type; + SStdRes* pStdRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + pStdRes->type = type; // computing based on the true data block SColumnInfoData* pCol = pInput->pData[0]; @@ -1350,9 +1350,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->isum += plist[i]; - pStddevRes->quadraticISum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->isum += plist[i]; + pStdRes->quadraticISum += plist[i] * plist[i]; } break; @@ -1366,9 +1366,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->isum += plist[i]; - pStddevRes->quadraticISum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->isum += plist[i]; + pStdRes->quadraticISum += plist[i] * plist[i]; } break; } @@ -1381,9 +1381,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->isum += plist[i]; - pStddevRes->quadraticISum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->isum += plist[i]; + pStdRes->quadraticISum += plist[i] * plist[i]; } break; @@ -1397,9 +1397,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->isum += plist[i]; - pStddevRes->quadraticISum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->isum += plist[i]; + pStdRes->quadraticISum += plist[i] * plist[i]; } break; } @@ -1412,9 +1412,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->usum += plist[i]; - pStddevRes->quadraticUSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->usum += plist[i]; + pStdRes->quadraticUSum += plist[i] * plist[i]; } break; @@ -1428,9 +1428,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->usum += plist[i]; - pStddevRes->quadraticUSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->usum += plist[i]; + pStdRes->quadraticUSum += plist[i] * plist[i]; } break; } @@ -1443,9 +1443,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->usum += plist[i]; - pStddevRes->quadraticUSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->usum += plist[i]; + pStdRes->quadraticUSum += plist[i] * plist[i]; } break; @@ -1459,9 +1459,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->usum += plist[i]; - pStddevRes->quadraticUSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->usum += plist[i]; + pStdRes->quadraticUSum += plist[i] * plist[i]; } break; } @@ -1474,9 +1474,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->dsum += plist[i]; - pStddevRes->quadraticDSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->dsum += plist[i]; + pStdRes->quadraticDSum += plist[i] * plist[i]; } break; } @@ -1489,9 +1489,9 @@ int32_t stddevFunction(SqlFunctionCtx* pCtx) { } numOfElem += 1; - pStddevRes->count += 1; - pStddevRes->dsum += plist[i]; - pStddevRes->quadraticDSum += plist[i] * plist[i]; + pStdRes->count += 1; + pStdRes->dsum += plist[i]; + pStdRes->quadraticDSum += plist[i] * plist[i]; } break; } @@ -1506,7 +1506,7 @@ _stddev_over: return TSDB_CODE_SUCCESS; } -static void stddevTransferInfo(SStddevRes* pInput, SStddevRes* pOutput) { +static void stdTransferInfo(SStdRes* pInput, SStdRes* pOutput) { if (IS_NULL_TYPE(pInput->type)) { return; } @@ -1525,7 +1525,7 @@ static void stddevTransferInfo(SStddevRes* pInput, SStddevRes* pOutput) { pOutput->count += pInput->count; } -int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) { +int32_t stdFunctionMerge(SqlFunctionCtx* pCtx) { SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pCol = pInput->pData[0]; @@ -1538,13 +1538,13 @@ int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) { return TSDB_CODE_FUNC_FUNTION_PARA_TYPE; } - SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + SStdRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); for (int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) { if (colDataIsNull_s(pCol, i)) continue; char* data = colDataGetData(pCol, i); - SStddevRes* pInputInfo = (SStddevRes*)varDataVal(data); - stddevTransferInfo(pInputInfo, pInfo); + SStdRes* pInputInfo = (SStdRes*)varDataVal(data); + stdTransferInfo(pInputInfo, pInfo); } SET_VAL(GET_RES_INFO(pCtx), 1, 1); @@ -1552,14 +1552,14 @@ int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) { } #ifdef BUILD_NO_CALL -int32_t stddevInvertFunction(SqlFunctionCtx* pCtx) { +int32_t stdInvertFunction(SqlFunctionCtx* pCtx) { int32_t numOfElem = 0; // Only the pre-computing information loaded and actual data does not loaded SInputColumnInfoData* pInput = &pCtx->input; int32_t type = pInput->pData[0]->info.type; - SStddevRes* pStddevRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + SStdRes* pStdRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); // computing based on the true data block SColumnInfoData* pCol = pInput->pData[0]; @@ -1569,43 +1569,43 @@ int32_t stddevInvertFunction(SqlFunctionCtx* pCtx) { switch (type) { case TSDB_DATA_TYPE_TINYINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, int8_t); + LIST_STDDEV_SUB_N(pStdRes->isum, int8_t); break; } case TSDB_DATA_TYPE_SMALLINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, int16_t); + LIST_STDDEV_SUB_N(pStdRes->isum, int16_t); break; } case TSDB_DATA_TYPE_INT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, int32_t); + LIST_STDDEV_SUB_N(pStdRes->isum, int32_t); break; } case TSDB_DATA_TYPE_BIGINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, int64_t); + LIST_STDDEV_SUB_N(pStdRes->isum, int64_t); break; } case TSDB_DATA_TYPE_UTINYINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, uint8_t); + LIST_STDDEV_SUB_N(pStdRes->isum, uint8_t); break; } case TSDB_DATA_TYPE_USMALLINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, uint16_t); + LIST_STDDEV_SUB_N(pStdRes->isum, uint16_t); break; } case TSDB_DATA_TYPE_UINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, uint32_t); + LIST_STDDEV_SUB_N(pStdRes->isum, uint32_t); break; } case TSDB_DATA_TYPE_UBIGINT: { - LIST_STDDEV_SUB_N(pStddevRes->isum, uint64_t); + LIST_STDDEV_SUB_N(pStdRes->isum, uint64_t); break; } case TSDB_DATA_TYPE_FLOAT: { - LIST_STDDEV_SUB_N(pStddevRes->dsum, float); + LIST_STDDEV_SUB_N(pStdRes->dsum, float); break; } case TSDB_DATA_TYPE_DOUBLE: { - LIST_STDDEV_SUB_N(pStddevRes->dsum, double); + LIST_STDDEV_SUB_N(pStdRes->dsum, double); break; } default: @@ -1620,7 +1620,7 @@ int32_t stddevInvertFunction(SqlFunctionCtx* pCtx) { int32_t stddevFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SInputColumnInfoData* pInput = &pCtx->input; - SStddevRes* pStddevRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + SStdRes* pStddevRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); int32_t type = pStddevRes->type; double avg; @@ -1648,10 +1648,40 @@ int32_t stddevFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return functionFinalize(pCtx, pBlock); } -int32_t stddevPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { +int32_t stdvarFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { + SInputColumnInfoData* pInput = &pCtx->input; + SStdRes* pStdvarRes = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t type = pStdvarRes->type; + double avg; + + if (pStdvarRes->count == 0) { + GET_RES_INFO(pCtx)->numOfRes = 0; + return functionFinalize(pCtx, pBlock); + } + + if (IS_SIGNED_NUMERIC_TYPE(type)) { + avg = pStdvarRes->isum / ((double)pStdvarRes->count); + pStdvarRes->result = fabs(pStdvarRes->quadraticISum / ((double)pStdvarRes->count) - avg * avg); + } else if (IS_UNSIGNED_NUMERIC_TYPE(type)) { + avg = pStdvarRes->usum / ((double)pStdvarRes->count); + pStdvarRes->result = fabs(pStdvarRes->quadraticUSum / ((double)pStdvarRes->count) - avg * avg); + } else { + avg = pStdvarRes->dsum / ((double)pStdvarRes->count); + pStdvarRes->result = fabs(pStdvarRes->quadraticDSum / ((double)pStdvarRes->count) - avg * avg); + } + + // check for overflow + if (isinf(pStdvarRes->result) || isnan(pStdvarRes->result)) { + GET_RES_INFO(pCtx)->numOfRes = 0; + } + + return functionFinalize(pCtx, pBlock); +} + +int32_t stdPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx); - SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t resultBytes = getStddevInfoSize(); + SStdRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); + int32_t resultBytes = getStdInfoSize(); char* res = taosMemoryCalloc(resultBytes + VARSTR_HEADER_SIZE, sizeof(char)); if (NULL == res) { @@ -1673,15 +1703,15 @@ int32_t stddevPartialFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return code; } -int32_t stddevCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { +int32_t stdCombine(SqlFunctionCtx* pDestCtx, SqlFunctionCtx* pSourceCtx) { SResultRowEntryInfo* pDResInfo = GET_RES_INFO(pDestCtx); - SStddevRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); + SStdRes* pDBuf = GET_ROWCELL_INTERBUF(pDResInfo); SResultRowEntryInfo* pSResInfo = GET_RES_INFO(pSourceCtx); - SStddevRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); + SStdRes* pSBuf = GET_ROWCELL_INTERBUF(pSResInfo); int16_t type = pDBuf->type == TSDB_DATA_TYPE_NULL ? pSBuf->type : pDBuf->type; - stddevTransferInfo(pSBuf, pDBuf); + stdTransferInfo(pSBuf, pDBuf); pDResInfo->numOfRes = TMAX(pDResInfo->numOfRes, pSResInfo->numOfRes); pDResInfo->isNullRes &= pSResInfo->isNullRes; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index b34d1b9a70..1425df5c5a 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -4254,6 +4254,7 @@ static const char* jkFunctionHasPk = "HasPk"; static const char* jkFunctionPkBytes = "PkBytes"; static const char* jkFunctionIsMergeFunc = "IsMergeFunc"; static const char* jkFunctionMergeFuncOf = "MergeFuncOf"; +static const char* jkFunctionTrimType = "TrimType"; static int32_t functionNodeToJson(const void* pObj, SJson* pJson) { const SFunctionNode* pNode = (const SFunctionNode*)pObj; @@ -4286,7 +4287,9 @@ static int32_t functionNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkFunctionMergeFuncOf, pNode->originalFuncId); } - + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkFunctionTrimType, pNode->trimType); + } return code; } @@ -4321,6 +4324,9 @@ static int32_t jsonToFunctionNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetIntValue(pJson, jkFunctionMergeFuncOf, &pNode->originalFuncId); } + if (TSDB_CODE_SUCCESS == code) { + tjsonGetNumberValue(pJson, jkFunctionTrimType, pNode->trimType, code); + } return code; } diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index 2d3f2b1f3a..b3568e914e 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -1112,6 +1112,7 @@ enum { FUNCTION_NODE_PK_BYTES, FUNCTION_CODE_IS_MERGE_FUNC, FUNCTION_CODE_MERGE_FUNC_OF, + FUNCTION_CODE_TRIM_TYPE, }; static int32_t functionNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { @@ -1145,6 +1146,9 @@ static int32_t functionNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI32(pEncoder, FUNCTION_CODE_MERGE_FUNC_OF, pNode->originalFuncId); } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeEnum(pEncoder, FUNCTION_CODE_TRIM_TYPE, pNode->trimType); + } return code; } @@ -1186,6 +1190,9 @@ static int32_t msgToFunctionNode(STlvDecoder* pDecoder, void* pObj) { case FUNCTION_CODE_MERGE_FUNC_OF: code = tlvDecodeI32(pTlv, &pNode->originalFuncId); break; + case FUNCTION_CODE_TRIM_TYPE: + code = tlvDecodeEnum(pTlv, &pNode->trimType, sizeof(pNode->trimType)); + break; default: break; } diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 579317a2fc..4686b90d46 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -136,6 +136,11 @@ SNode* createBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* createNotBetweenAnd(SAstCreateContext* pCxt, SNode* pExpr, SNode* pLeft, SNode* pRight); SNode* createFunctionNode(SAstCreateContext* pCxt, const SToken* pFuncName, SNodeList* pParameterList); SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType dt); +SNode* createPositionFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2); +SNode* createTrimFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, ETrimType type); +SNode* createTrimFunctionNodeExt(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2, ETrimType type); +SNode* createSubstrFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2); +SNode* createSubstrFunctionNodeExt(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2, SNode* pExpr3); SNode* createNodeListNode(SAstCreateContext* pCxt, SNodeList* pList); SNode* createNodeListNodeEx(SAstCreateContext* pCxt, SNode* p1, SNode* p2); SNode* createRealTableNode(SAstCreateContext* pCxt, SToken* pDbName, SToken* pTableName, SToken* pTableAlias); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index f2d804df27..9228e16ff9 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -1183,19 +1183,46 @@ pseudo_column(A) ::= IROWTS(B). pseudo_column(A) ::= ISFILLED(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= QTAGS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } -function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } -function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } +function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } +function_expression(A) ::= star_func(B) NK_LP star_func_para_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } function_expression(A) ::= - CAST(B) NK_LP expr_or_subquery(C) AS type_name(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); } + CAST(B) NK_LP expr_or_subquery(C) AS type_name(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); } function_expression(A) ::= - CAST(B) NK_LP expr_or_subquery(C) AS type_name_default_len(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); } - -function_expression(A) ::= literal_func(B). { A = B; } + CAST(B) NK_LP expr_or_subquery(C) AS type_name_default_len(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, C), D)); } +function_expression(A) ::= + POSITION(B) NK_LP expr_or_subquery(C) IN expr_or_subquery(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createPositionFunctionNode(pCxt, releaseRawExprNode(pCxt, C), releaseRawExprNode(pCxt, D))); } +function_expression(A) ::= + TRIM(B) NK_LP expr_or_subquery(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, C), TRIM_TYPE_BOTH)); } +function_expression(A) ::= + TRIM(B) NK_LP trim_specification_type(C) FROM expr_or_subquery(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, D), C)); } +function_expression(A) ::= + TRIM(B) NK_LP expr_or_subquery(C) FROM expr_or_subquery(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, C), releaseRawExprNode(pCxt, D), TRIM_TYPE_BOTH)); } +function_expression(A) ::= + TRIM(B) NK_LP trim_specification_type(C) expr_or_subquery(D) FROM expr_or_subquery(E) NK_RP(F). { A = createRawExprNodeExt(pCxt, &B, &F, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, D), releaseRawExprNode(pCxt, E), C)); } +function_expression(A) ::= + substr_func(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } +function_expression(A) ::= + substr_func(B) NK_LP expr_or_subquery(C) FROM expr_or_subquery(D) NK_RP(E). { A = createRawExprNodeExt(pCxt, &B, &E, createSubstrFunctionNode(pCxt, releaseRawExprNode(pCxt, C), releaseRawExprNode(pCxt, D))); } +function_expression(A) ::= + substr_func(B) NK_LP expr_or_subquery(C) FROM expr_or_subquery(D) FOR expr_or_subquery(E) NK_RP(F). { A = createRawExprNodeExt(pCxt, &B, &F, createSubstrFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, C), releaseRawExprNode(pCxt, D), releaseRawExprNode(pCxt, E))); } +function_expression(A) ::= REPLACE(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } +function_expression(A) ::= literal_func(B). { A = B; } literal_func(A) ::= noarg_func(B) NK_LP NK_RP(C). { A = createRawExprNodeExt(pCxt, &B, &C, createFunctionNode(pCxt, &B, NULL)); } literal_func(A) ::= NOW(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } literal_func(A) ::= TODAY(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } +%type substr_func { SToken } +%destructor substr_func { } +substr_func(A) ::= SUBSTR(B). { A = B; } +substr_func(A) ::= SUBSTRING(B). { A = B; } + +%type trim_specification_type ETrimType +%destructor trim_specification_type { } +trim_specification_type(A) ::= BOTH. { A = TRIM_TYPE_BOTH; } +trim_specification_type(A) ::= TRAILING. { A = TRIM_TYPE_TRAILING; } +trim_specification_type(A) ::= LEADING. { A = TRIM_TYPE_LEADING; } + %type noarg_func { SToken } %destructor noarg_func { } noarg_func(A) ::= NOW(B). { A = B; } @@ -1207,6 +1234,7 @@ noarg_func(A) ::= SERVER_VERSION(B). noarg_func(A) ::= SERVER_STATUS(B). { A = B; } noarg_func(A) ::= CURRENT_USER(B). { A = B; } noarg_func(A) ::= USER(B). { A = B; } +noarg_func(A) ::= PI(B). { A = B; } %type star_func { SToken } %destructor star_func { } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index ee5f215d72..2bf82ba98f 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -997,6 +997,73 @@ SNode* createCastFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SDataType d return (SNode*)func; } +SNode* createPositionFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2) { + CHECK_PARSER_STATUS(pCxt); + SFunctionNode* func = NULL; + pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func); + CHECK_MAKE_NODE(func); + strcpy(func->functionName, "position"); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr); + CHECK_PARSER_STATUS(pCxt); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr2); + CHECK_PARSER_STATUS(pCxt); + return (SNode*)func; +} + +SNode* createTrimFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, ETrimType type) { + CHECK_PARSER_STATUS(pCxt); + SFunctionNode* func = NULL; + pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func); + CHECK_MAKE_NODE(func); + strcpy(func->functionName, "trim"); + func->trimType = type; + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr); + CHECK_PARSER_STATUS(pCxt); + return (SNode*)func; +} + +SNode* createTrimFunctionNodeExt(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2, ETrimType type) { + CHECK_PARSER_STATUS(pCxt); + SFunctionNode* func = NULL; + pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func); + CHECK_MAKE_NODE(func); + strcpy(func->functionName, "trim"); + func->trimType = type; + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr); + CHECK_PARSER_STATUS(pCxt); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr2); + CHECK_PARSER_STATUS(pCxt); + return (SNode*)func; +} + +SNode* createSubstrFunctionNode(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2) { + CHECK_PARSER_STATUS(pCxt); + SFunctionNode* func = NULL; + pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func); + CHECK_MAKE_NODE(func); + strcpy(func->functionName, "substr"); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr); + CHECK_PARSER_STATUS(pCxt); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr2); + CHECK_PARSER_STATUS(pCxt); + return (SNode*)func; +} + +SNode* createSubstrFunctionNodeExt(SAstCreateContext* pCxt, SNode* pExpr, SNode* pExpr2, SNode* pExpr3) { + CHECK_PARSER_STATUS(pCxt); + SFunctionNode* func = NULL; + pCxt->errCode = nodesMakeNode(QUERY_NODE_FUNCTION, (SNode**)&func); + CHECK_MAKE_NODE(func); + strcpy(func->functionName, "substr"); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr); + CHECK_PARSER_STATUS(pCxt); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr2); + CHECK_PARSER_STATUS(pCxt); + pCxt->errCode = nodesListMakeAppend(&func->pParameterList, pExpr3); + CHECK_PARSER_STATUS(pCxt); + return (SNode*)func; +} + SNode* createNodeListNode(SAstCreateContext* pCxt, SNodeList* pList) { CHECK_PARSER_STATUS(pCxt); SNodeListNode* list = NULL; diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 70bd43559c..cb94cd42f7 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -2238,6 +2238,8 @@ static int32_t parseDataFromFileImpl(SInsertParseContext* pCxt, SVnodeModifyOpSt if (pStmt->insertType != TSDB_QUERY_TYPE_FILE_INSERT) { return buildSyntaxErrMsg(&pCxt->msg, "keyword VALUES or FILE is exclusive", NULL); } + } else { + return buildInvalidOperationMsg(&pCxt->msg, tstrerror(code)); } // just record pTableCxt whose data come from file diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index deec310862..9bcc201443 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -52,6 +52,7 @@ static SKeyword keywordTable[] = { {"BNODE", TK_BNODE}, {"BNODES", TK_BNODES}, {"BOOL", TK_BOOL}, + {"BOTH", TK_BOTH}, {"BUFFER", TK_BUFFER}, {"BUFSIZE", TK_BUFSIZE}, {"BY", TK_BY}, @@ -111,6 +112,7 @@ static SKeyword keywordTable[] = { {"FLOAT", TK_FLOAT}, {"FLUSH", TK_FLUSH}, {"FROM", TK_FROM}, + {"FOR", TK_FOR}, {"FORCE", TK_FORCE}, {"FULL", TK_FULL}, {"FUNCTION", TK_FUNCTION}, @@ -148,6 +150,7 @@ static SKeyword keywordTable[] = { {"LAST", TK_LAST}, {"LAST_ROW", TK_LAST_ROW}, {"LEADER", TK_LEADER}, + {"LEADING", TK_LEADING}, {"LEFT", TK_LEFT}, {"LICENCES", TK_LICENCES}, {"LIKE", TK_LIKE}, @@ -191,6 +194,7 @@ static SKeyword keywordTable[] = { {"PARTITION_FIRST", TK_PARTITION_FIRST}, {"PASS", TK_PASS}, {"PORT", TK_PORT}, + {"POSITION", TK_POSITION}, {"PPS", TK_PPS}, {"PRIMARY", TK_PRIMARY}, {"PRECISION", TK_PRECISION}, @@ -201,6 +205,7 @@ static SKeyword keywordTable[] = { {"QTIME", TK_QTIME}, {"QUERIES", TK_QUERIES}, {"QUERY", TK_QUERY}, + {"PI", TK_PI}, {"RANGE", TK_RANGE}, {"RATIO", TK_RATIO}, {"PAUSE", TK_PAUSE}, @@ -250,6 +255,8 @@ static SKeyword keywordTable[] = { {"STT_TRIGGER", TK_STT_TRIGGER}, {"SUBSCRIBE", TK_SUBSCRIBE}, {"SUBSCRIPTIONS", TK_SUBSCRIPTIONS}, + {"SUBSTR", TK_SUBSTR}, + {"SUBSTRING", TK_SUBSTRING}, {"SUBTABLE", TK_SUBTABLE}, {"SYSINFO", TK_SYSINFO}, {"SYSTEM", TK_SYSTEM}, @@ -268,6 +275,7 @@ static SKeyword keywordTable[] = { {"TODAY", TK_TODAY}, {"TOPIC", TK_TOPIC}, {"TOPICS", TK_TOPICS}, + {"TRAILING", TK_TRAILING}, {"TRANSACTION", TK_TRANSACTION}, {"TRANSACTIONS", TK_TRANSACTIONS}, {"TRIGGER", TK_TRIGGER}, diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 26c5465b8c..4ff7510e92 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -1,5 +1,6 @@ /* This file is automatically generated by Lemon from input grammar -** source file "sql.y". */ +** source file "sql.y". +*/ /* ** 2000-05-29 ** @@ -25,8 +26,6 @@ ** input grammar file: */ /************ Begin %include sections from the grammar ************************/ -#line 11 "sql.y" - #include #include #include @@ -42,7 +41,6 @@ #include "parAst.h" #define YYSTACKDEPTH 0 -#line 46 "sql.c" /**************** End of %include directives **********************************/ /* These constants specify the various numeric values for terminal symbols. ***************** Begin token definitions *************************************/ @@ -312,118 +310,125 @@ #define TK_IROWTS 263 #define TK_ISFILLED 264 #define TK_CAST 265 -#define TK_NOW 266 -#define TK_TODAY 267 -#define TK_TIMEZONE 268 -#define TK_CLIENT_VERSION 269 -#define TK_SERVER_VERSION 270 -#define TK_SERVER_STATUS 271 -#define TK_CURRENT_USER 272 -#define TK_CASE 273 -#define TK_WHEN 274 -#define TK_THEN 275 -#define TK_ELSE 276 -#define TK_BETWEEN 277 -#define TK_IS 278 -#define TK_NK_LT 279 -#define TK_NK_GT 280 -#define TK_NK_LE 281 -#define TK_NK_GE 282 -#define TK_NK_NE 283 -#define TK_MATCH 284 -#define TK_NMATCH 285 -#define TK_CONTAINS 286 -#define TK_IN 287 -#define TK_JOIN 288 -#define TK_INNER 289 -#define TK_LEFT 290 -#define TK_RIGHT 291 -#define TK_OUTER 292 -#define TK_SEMI 293 -#define TK_ANTI 294 -#define TK_ASOF 295 -#define TK_WINDOW 296 -#define TK_WINDOW_OFFSET 297 -#define TK_JLIMIT 298 -#define TK_SELECT 299 -#define TK_NK_HINT 300 -#define TK_DISTINCT 301 -#define TK_WHERE 302 -#define TK_PARTITION 303 -#define TK_BY 304 -#define TK_SESSION 305 -#define TK_STATE_WINDOW 306 -#define TK_EVENT_WINDOW 307 -#define TK_COUNT_WINDOW 308 -#define TK_SLIDING 309 -#define TK_FILL 310 -#define TK_VALUE 311 -#define TK_VALUE_F 312 -#define TK_NONE 313 -#define TK_PREV 314 -#define TK_NULL_F 315 -#define TK_LINEAR 316 -#define TK_NEXT 317 -#define TK_HAVING 318 -#define TK_RANGE 319 -#define TK_EVERY 320 -#define TK_ORDER 321 -#define TK_SLIMIT 322 -#define TK_SOFFSET 323 -#define TK_LIMIT 324 -#define TK_OFFSET 325 -#define TK_ASC 326 -#define TK_NULLS 327 -#define TK_ABORT 328 -#define TK_AFTER 329 -#define TK_ATTACH 330 -#define TK_BEFORE 331 -#define TK_BEGIN 332 -#define TK_BITAND 333 -#define TK_BITNOT 334 -#define TK_BITOR 335 -#define TK_BLOCKS 336 -#define TK_CHANGE 337 -#define TK_COMMA 338 -#define TK_CONCAT 339 -#define TK_CONFLICT 340 -#define TK_COPY 341 -#define TK_DEFERRED 342 -#define TK_DELIMITERS 343 -#define TK_DETACH 344 -#define TK_DIVIDE 345 -#define TK_DOT 346 -#define TK_EACH 347 -#define TK_FAIL 348 -#define TK_FOR 349 -#define TK_GLOB 350 -#define TK_ID 351 -#define TK_IMMEDIATE 352 -#define TK_IMPORT 353 -#define TK_INITIALLY 354 -#define TK_INSTEAD 355 -#define TK_ISNULL 356 -#define TK_MODULES 357 -#define TK_NK_BITNOT 358 -#define TK_NK_SEMI 359 -#define TK_NOTNULL 360 -#define TK_OF 361 -#define TK_PLUS 362 -#define TK_PRIVILEGE 363 -#define TK_RAISE 364 -#define TK_RESTRICT 365 -#define TK_ROW 366 -#define TK_STAR 367 -#define TK_STATEMENT 368 -#define TK_STRICT 369 -#define TK_STRING 370 -#define TK_TIMES 371 -#define TK_VALUES 372 -#define TK_VARIABLE 373 -#define TK_WAL 374 -#define TK_ENCODE 375 -#define TK_COMPRESS 376 -#define TK_LEVEL 377 +#define TK_POSITION 266 +#define TK_IN 267 +#define TK_FOR 268 +#define TK_NOW 269 +#define TK_TODAY 270 +#define TK_SUBSTR 271 +#define TK_SUBSTRING 272 +#define TK_BOTH 273 +#define TK_TRAILING 274 +#define TK_LEADING 275 +#define TK_TIMEZONE 276 +#define TK_CLIENT_VERSION 277 +#define TK_SERVER_VERSION 278 +#define TK_SERVER_STATUS 279 +#define TK_CURRENT_USER 280 +#define TK_PI 281 +#define TK_CASE 282 +#define TK_WHEN 283 +#define TK_THEN 284 +#define TK_ELSE 285 +#define TK_BETWEEN 286 +#define TK_IS 287 +#define TK_NK_LT 288 +#define TK_NK_GT 289 +#define TK_NK_LE 290 +#define TK_NK_GE 291 +#define TK_NK_NE 292 +#define TK_MATCH 293 +#define TK_NMATCH 294 +#define TK_CONTAINS 295 +#define TK_JOIN 296 +#define TK_INNER 297 +#define TK_LEFT 298 +#define TK_RIGHT 299 +#define TK_OUTER 300 +#define TK_SEMI 301 +#define TK_ANTI 302 +#define TK_ASOF 303 +#define TK_WINDOW 304 +#define TK_WINDOW_OFFSET 305 +#define TK_JLIMIT 306 +#define TK_SELECT 307 +#define TK_NK_HINT 308 +#define TK_DISTINCT 309 +#define TK_WHERE 310 +#define TK_PARTITION 311 +#define TK_BY 312 +#define TK_SESSION 313 +#define TK_STATE_WINDOW 314 +#define TK_EVENT_WINDOW 315 +#define TK_COUNT_WINDOW 316 +#define TK_SLIDING 317 +#define TK_FILL 318 +#define TK_VALUE 319 +#define TK_VALUE_F 320 +#define TK_NONE 321 +#define TK_PREV 322 +#define TK_NULL_F 323 +#define TK_LINEAR 324 +#define TK_NEXT 325 +#define TK_HAVING 326 +#define TK_RANGE 327 +#define TK_EVERY 328 +#define TK_ORDER 329 +#define TK_SLIMIT 330 +#define TK_SOFFSET 331 +#define TK_LIMIT 332 +#define TK_OFFSET 333 +#define TK_ASC 334 +#define TK_NULLS 335 +#define TK_ABORT 336 +#define TK_AFTER 337 +#define TK_ATTACH 338 +#define TK_BEFORE 339 +#define TK_BEGIN 340 +#define TK_BITAND 341 +#define TK_BITNOT 342 +#define TK_BITOR 343 +#define TK_BLOCKS 344 +#define TK_CHANGE 345 +#define TK_COMMA 346 +#define TK_CONCAT 347 +#define TK_CONFLICT 348 +#define TK_COPY 349 +#define TK_DEFERRED 350 +#define TK_DELIMITERS 351 +#define TK_DETACH 352 +#define TK_DIVIDE 353 +#define TK_DOT 354 +#define TK_EACH 355 +#define TK_FAIL 356 +#define TK_GLOB 357 +#define TK_ID 358 +#define TK_IMMEDIATE 359 +#define TK_IMPORT 360 +#define TK_INITIALLY 361 +#define TK_INSTEAD 362 +#define TK_ISNULL 363 +#define TK_MODULES 364 +#define TK_NK_BITNOT 365 +#define TK_NK_SEMI 366 +#define TK_NOTNULL 367 +#define TK_OF 368 +#define TK_PLUS 369 +#define TK_PRIVILEGE 370 +#define TK_RAISE 371 +#define TK_RESTRICT 372 +#define TK_ROW 373 +#define TK_STAR 374 +#define TK_STATEMENT 375 +#define TK_STRICT 376 +#define TK_STRING 377 +#define TK_TIMES 378 +#define TK_VALUES 379 +#define TK_VARIABLE 380 +#define TK_WAL 381 +#define TK_ENCODE 382 +#define TK_COMPRESS 383 +#define TK_LEVEL 384 #endif /**************** End token definitions ***************************************/ @@ -450,7 +455,7 @@ ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal +** This macros defines the minor type for terminal ** symbols. ** YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of @@ -464,6 +469,9 @@ ** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser ** ParseCTX_* As ParseARG_ except for %extra_context +** YYREALLOC Name of the realloc() function to use +** YYFREE Name of the free() function to use +** YYDYNSTACK True if stack space should be extended on heap ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. ** YYNSTATE the combined number of states. @@ -477,63 +485,71 @@ ** YY_NO_ACTION The yy_action[] code for no-op ** YY_MIN_REDUCE Minimum value for reduce actions ** YY_MAX_REDUCE Maximum value for reduce actions +** YY_MIN_DSTRCTR Minimum symbol value that has a destructor +** YY_MAX_DSTRCTR Maximum symbol value that has a destructor */ #ifndef INTERFACE # define INTERFACE 1 #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 558 +#define YYNOCODE 567 #define YYACTIONTYPE unsigned short int -#define ParseTOKENTYPE SToken +#define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SAlterOption yy101; - bool yy209; - SNodeList* yy316; - SNode* yy416; - EOrder yy506; - EJoinSubType yy630; - EShowKind yy681; - int32_t yy820; - EOperatorType yy848; - STokenPair yy849; - EFillMode yy882; - SShowTablesOption yy925; + EFillMode yy18; + EJoinType yy36; + ENullOrder yy109; + bool yy173; + SNodeList* yy334; + SAlterOption yy389; + STokenPair yy399; + EOperatorType yy506; + SToken yy533; + EShowKind yy537; + SNode* yy560; + int64_t yy585; + EJoinSubType yy648; + ETrimType yy672; + SShowTablesOption yy709; + int8_t yy719; + int32_t yy802; SDataType yy952; - EJoinType yy972; - int8_t yy1043; - ENullOrder yy1045; - int64_t yy1089; - SToken yy1109; + EOrder yy974; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define ParseARG_SDECL SAstCreateContext* pCxt ; -#define ParseARG_PDECL , SAstCreateContext* pCxt -#define ParseARG_PARAM ,pCxt +#define ParseARG_PDECL , SAstCreateContext* pCxt +#define ParseARG_PARAM ,pCxt #define ParseARG_FETCH SAstCreateContext* pCxt =yypParser->pCxt ; #define ParseARG_STORE yypParser->pCxt =pCxt ; +#define YYREALLOC realloc +#define YYFREE free +#define YYDYNSTACK 0 #define ParseCTX_SDECL #define ParseCTX_PDECL #define ParseCTX_PARAM #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 979 -#define YYNRULE 755 -#define YYNRULE_WITH_ACTION 755 -#define YYNTOKEN 378 -#define YY_MAX_SHIFT 978 -#define YY_MIN_SHIFTREDUCE 1448 -#define YY_MAX_SHIFTREDUCE 2202 -#define YY_ERROR_ACTION 2203 -#define YY_ACCEPT_ACTION 2204 -#define YY_NO_ACTION 2205 -#define YY_MIN_REDUCE 2206 -#define YY_MAX_REDUCE 2960 +#define YYNSTATE 1006 +#define YYNRULE 770 +#define YYNRULE_WITH_ACTION 770 +#define YYNTOKEN 385 +#define YY_MAX_SHIFT 1005 +#define YY_MIN_SHIFTREDUCE 1490 +#define YY_MAX_SHIFTREDUCE 2259 +#define YY_ERROR_ACTION 2260 +#define YY_ACCEPT_ACTION 2261 +#define YY_NO_ACTION 2262 +#define YY_MIN_REDUCE 2263 +#define YY_MAX_REDUCE 3032 +#define YY_MIN_DSTRCTR 386 +#define YY_MAX_DSTRCTR 566 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -549,11 +565,27 @@ typedef union { # define yytestcase(X) #endif +/* Macro to determine if stack space has the ability to grow using +** heap memory. +*/ +#if YYSTACKDEPTH<=0 || YYDYNSTACK +# define YYGROWABLESTACK 1 +#else +# define YYGROWABLESTACK 0 +#endif + +/* Guarantee a minimum number of initial stack slots. + */ +#if YYSTACKDEPTH<=0 +# undef YYSTACKDEPTH +# define YYSTACKDEPTH 2 /* Need a minimum stack size */ +#endif + /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an -** action integer. +** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows @@ -600,906 +632,1102 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3018) +#define YY_ACTTAB_COUNT (3956) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2711, 2403, 647, 543, 2569, 648, 2254, 2569, 542, 37, - /* 10 */ 340, 550, 47, 45, 2119, 2401, 2736, 652, 798, 211, - /* 20 */ 476, 471, 1940, 649, 2567, 855, 2926, 2566, 855, 2715, - /* 30 */ 2711, 813, 124, 810, 157, 2461, 1938, 787, 2028, 2405, - /* 40 */ 1965, 495, 2416, 2694, 797, 218, 493, 40, 39, 2927, - /* 50 */ 799, 46, 44, 43, 42, 41, 2736, 764, 748, 2715, - /* 60 */ 2754, 612, 610, 2123, 415, 2926, 2754, 232, 2023, 1965, - /* 70 */ 788, 851, 868, 502, 501, 19, 2701, 527, 850, 2717, - /* 80 */ 2719, 473, 1946, 2932, 218, 810, 157, 2569, 2927, 799, - /* 90 */ 873, 2645, 460, 2616, 1966, 47, 45, 1947, 810, 157, - /* 100 */ 2754, 478, 482, 476, 2695, 1940, 482, 2566, 855, 2717, - /* 110 */ 2720, 670, 975, 873, 435, 15, 2701, 873, 850, 1938, - /* 120 */ 873, 2028, 868, 2735, 810, 157, 2774, 43, 42, 41, - /* 130 */ 121, 2737, 854, 2739, 2740, 849, 1965, 873, 786, 2204, - /* 140 */ 657, 2608, 200, 655, 2828, 515, 648, 2254, 472, 2824, - /* 150 */ 2229, 2023, 2030, 2031, 812, 187, 2836, 2837, 19, 155, - /* 160 */ 2841, 14, 13, 2735, 2057, 1946, 2774, 482, 219, 114, - /* 170 */ 121, 2737, 854, 2739, 2740, 849, 2875, 873, 873, 2736, - /* 180 */ 159, 488, 168, 2799, 2828, 869, 2414, 929, 472, 2824, - /* 190 */ 2373, 2001, 2011, 254, 851, 975, 2264, 650, 15, 2262, - /* 200 */ 256, 2029, 2032, 841, 650, 148, 2262, 194, 2836, 809, - /* 210 */ 2701, 149, 808, 693, 840, 531, 1941, 50, 1939, 2926, - /* 220 */ 127, 2836, 2837, 2754, 155, 2841, 1712, 1713, 508, 2058, - /* 230 */ 2474, 62, 868, 507, 868, 2030, 2031, 797, 218, 2701, - /* 240 */ 2002, 850, 2927, 799, 533, 529, 188, 2836, 2837, 817, - /* 250 */ 155, 2841, 1944, 1945, 1998, 172, 2000, 2003, 2004, 2005, - /* 260 */ 2006, 2007, 2008, 2009, 2010, 846, 871, 870, 2022, 2024, - /* 270 */ 2025, 2026, 2027, 2, 2001, 2011, 2071, 2094, 443, 1950, - /* 280 */ 9, 1968, 764, 207, 2029, 2032, 2735, 331, 332, 2774, - /* 290 */ 2926, 491, 330, 121, 2737, 854, 2739, 2740, 849, 1941, - /* 300 */ 873, 1939, 2301, 1999, 1998, 2946, 747, 2828, 2932, 218, - /* 310 */ 2542, 472, 2824, 2927, 799, 2418, 36, 474, 2052, 2053, - /* 320 */ 2054, 2055, 2056, 2060, 2061, 2062, 2063, 50, 910, 174, - /* 330 */ 173, 907, 906, 905, 171, 1944, 1945, 1998, 54, 2000, - /* 340 */ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 846, 871, - /* 350 */ 870, 2022, 2024, 2025, 2026, 2027, 2, 12, 47, 45, - /* 360 */ 2398, 422, 2736, 1909, 2474, 183, 476, 291, 1940, 388, - /* 370 */ 394, 290, 441, 2451, 869, 2414, 744, 813, 2228, 714, - /* 380 */ 713, 712, 1938, 2472, 2028, 667, 704, 154, 708, 392, - /* 390 */ 76, 2094, 707, 75, 148, 487, 486, 706, 711, 453, - /* 400 */ 452, 324, 698, 705, 421, 2207, 2754, 451, 701, 700, - /* 410 */ 699, 2091, 2092, 2093, 2023, 324, 252, 629, 627, 624, - /* 420 */ 622, 19, 2701, 192, 850, 317, 138, 663, 1946, 137, - /* 430 */ 136, 135, 134, 133, 132, 131, 130, 129, 2701, 2931, - /* 440 */ 2474, 47, 45, 2033, 2556, 103, 668, 2926, 469, 476, - /* 450 */ 430, 1940, 1966, 458, 322, 736, 2474, 1965, 975, 2472, - /* 460 */ 798, 15, 62, 1493, 481, 1938, 2930, 2028, 2926, 2735, - /* 470 */ 2927, 2929, 2774, 1908, 926, 2472, 121, 2737, 854, 2739, - /* 480 */ 2740, 849, 1500, 873, 869, 2414, 797, 218, 200, 381, - /* 490 */ 2828, 2927, 799, 666, 472, 2824, 2388, 2023, 2030, 2031, - /* 500 */ 185, 63, 2218, 2094, 499, 490, 489, 1495, 1498, 1499, - /* 510 */ 138, 1946, 207, 137, 136, 135, 134, 133, 132, 131, - /* 520 */ 130, 129, 2876, 62, 2848, 2091, 2092, 2093, 2848, 2848, - /* 530 */ 2848, 2848, 2848, 734, 2931, 480, 182, 2001, 2011, 2543, - /* 540 */ 207, 975, 2926, 928, 48, 495, 2416, 2029, 2032, 728, - /* 550 */ 2617, 732, 730, 288, 287, 88, 87, 546, 2285, 783, - /* 560 */ 231, 2930, 1941, 1965, 1939, 2927, 2928, 2542, 869, 2414, - /* 570 */ 912, 40, 39, 538, 536, 46, 44, 43, 42, 41, - /* 580 */ 715, 2030, 2031, 1969, 1813, 1814, 418, 497, 223, 525, - /* 590 */ 2467, 2469, 521, 517, 513, 510, 539, 697, 1944, 1945, - /* 600 */ 1998, 696, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, - /* 610 */ 2010, 846, 871, 870, 2022, 2024, 2025, 2026, 2027, 2, - /* 620 */ 2001, 2011, 2096, 2097, 2098, 2099, 2100, 66, 1786, 1787, - /* 630 */ 2029, 2032, 100, 1812, 1815, 1673, 2848, 2091, 2092, 2093, - /* 640 */ 2848, 2848, 2848, 2848, 2848, 1941, 324, 1939, 2206, 62, - /* 650 */ 1664, 902, 901, 900, 1668, 899, 1670, 1671, 898, 895, - /* 660 */ 2410, 1679, 892, 1681, 1682, 889, 886, 883, 789, 784, - /* 670 */ 777, 773, 147, 146, 145, 144, 143, 142, 141, 140, - /* 680 */ 139, 1944, 1945, 1998, 238, 2000, 2003, 2004, 2005, 2006, - /* 690 */ 2007, 2008, 2009, 2010, 846, 871, 870, 2022, 2024, 2025, - /* 700 */ 2026, 2027, 2, 47, 45, 1623, 2736, 324, 869, 2414, - /* 710 */ 912, 476, 1969, 1940, 46, 44, 43, 42, 41, 1622, - /* 720 */ 1520, 851, 1519, 2883, 714, 713, 712, 1938, 55, 2028, - /* 730 */ 94, 704, 154, 708, 2002, 93, 153, 707, 62, 745, - /* 740 */ 869, 2414, 706, 711, 453, 452, 2931, 2736, 705, 541, - /* 750 */ 2754, 540, 451, 701, 700, 699, 214, 12, 1521, 2023, - /* 760 */ 547, 2038, 851, 1968, 2896, 479, 2701, 1965, 850, 2494, - /* 770 */ 879, 40, 39, 1946, 181, 46, 44, 43, 42, 41, - /* 780 */ 644, 498, 664, 539, 606, 2419, 47, 45, 748, 642, - /* 790 */ 181, 2754, 638, 634, 476, 617, 1940, 1999, 869, 2414, - /* 800 */ 2474, 2419, 92, 975, 559, 2538, 48, 2701, 496, 850, - /* 810 */ 1938, 2511, 2028, 2735, 2468, 2469, 2774, 1970, 548, 2472, - /* 820 */ 121, 2737, 854, 2739, 2740, 849, 1611, 873, 869, 2414, - /* 830 */ 565, 2538, 2946, 324, 2828, 869, 2414, 381, 472, 2824, - /* 840 */ 869, 2414, 2023, 2030, 2031, 839, 665, 2562, 567, 869, - /* 850 */ 2414, 2152, 243, 3, 2735, 581, 1946, 2774, 234, 2187, - /* 860 */ 669, 121, 2737, 854, 2739, 2740, 849, 53, 873, 582, - /* 870 */ 750, 2608, 1613, 2946, 1946, 2828, 100, 605, 242, 472, - /* 880 */ 2824, 51, 2001, 2011, 236, 213, 975, 596, 2538, 15, - /* 890 */ 903, 603, 2029, 2032, 446, 40, 39, 459, 2616, 46, - /* 900 */ 44, 43, 42, 41, 2409, 274, 12, 1941, 10, 1939, - /* 910 */ 780, 779, 2150, 2151, 2153, 2154, 2155, 878, 877, 876, - /* 920 */ 29, 193, 324, 2144, 589, 2521, 2030, 2031, 2059, 2227, - /* 930 */ 687, 683, 679, 675, 2390, 273, 322, 2145, 2002, 588, - /* 940 */ 834, 241, 2800, 1944, 1945, 1998, 1970, 2000, 2003, 2004, - /* 950 */ 2005, 2006, 2007, 2008, 2009, 2010, 846, 871, 870, 2022, - /* 960 */ 2024, 2025, 2026, 2027, 2, 2001, 2011, 84, 419, 557, - /* 970 */ 1963, 2194, 2474, 869, 2414, 2029, 2032, 594, 869, 2414, - /* 980 */ 445, 101, 587, 2143, 160, 2116, 271, 586, 614, 2701, - /* 990 */ 1941, 825, 1939, 583, 2406, 585, 869, 2414, 2411, 763, - /* 1000 */ 184, 1999, 292, 2164, 573, 836, 616, 2800, 2347, 869, - /* 1010 */ 2414, 420, 575, 40, 39, 34, 294, 46, 44, 43, - /* 1020 */ 42, 41, 2049, 553, 2843, 2064, 1944, 1945, 1998, 302, - /* 1030 */ 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 846, - /* 1040 */ 871, 870, 2022, 2024, 2025, 2026, 2027, 2, 869, 2414, - /* 1050 */ 2840, 40, 39, 259, 522, 46, 44, 43, 42, 41, - /* 1060 */ 1940, 1969, 270, 1502, 444, 324, 261, 268, 816, 1964, - /* 1070 */ 869, 2414, 266, 661, 1938, 113, 561, 2298, 225, 910, - /* 1080 */ 174, 173, 907, 906, 905, 171, 2736, 1867, 1868, 2193, - /* 1090 */ 335, 258, 40, 39, 1523, 1524, 46, 44, 43, 42, - /* 1100 */ 41, 851, 2407, 775, 689, 688, 2930, 2549, 2528, 1500, - /* 1110 */ 602, 601, 600, 599, 598, 593, 592, 591, 590, 427, - /* 1120 */ 1946, 2163, 580, 579, 578, 577, 576, 570, 569, 568, - /* 1130 */ 2754, 563, 562, 442, 2226, 1498, 1499, 554, 1774, 1775, - /* 1140 */ 60, 691, 690, 182, 1793, 78, 2701, 805, 850, 158, - /* 1150 */ 975, 761, 2799, 2417, 946, 945, 944, 943, 505, 2135, - /* 1160 */ 942, 941, 162, 936, 935, 934, 933, 932, 931, 930, - /* 1170 */ 161, 924, 923, 922, 504, 503, 919, 918, 917, 198, - /* 1180 */ 197, 916, 500, 915, 914, 913, 1969, 502, 501, 869, - /* 1190 */ 2414, 2736, 1965, 2735, 2701, 2225, 2774, 1954, 2224, 91, - /* 1200 */ 121, 2737, 854, 2739, 2740, 849, 851, 873, 2919, 830, - /* 1210 */ 721, 1947, 2946, 2028, 2828, 2223, 33, 2222, 472, 2824, - /* 1220 */ 2221, 2736, 40, 39, 2220, 735, 46, 44, 43, 42, - /* 1230 */ 41, 1627, 869, 2414, 221, 2754, 851, 104, 2860, 869, - /* 1240 */ 2414, 2641, 2217, 2023, 289, 1626, 869, 2414, 1520, 2476, - /* 1250 */ 1519, 2701, 342, 850, 1941, 2701, 1939, 1946, 2701, 862, - /* 1260 */ 724, 374, 2216, 450, 449, 2754, 863, 718, 716, 869, - /* 1270 */ 2414, 1841, 869, 2414, 286, 2701, 303, 2701, 710, 709, - /* 1280 */ 2701, 2701, 2115, 850, 2701, 2215, 1521, 838, 181, 867, - /* 1290 */ 1944, 1945, 370, 940, 938, 1970, 2474, 2214, 2735, 2420, - /* 1300 */ 2843, 2774, 2701, 2234, 968, 121, 2737, 854, 2739, 2740, - /* 1310 */ 849, 802, 873, 2213, 2622, 2473, 164, 2946, 2212, 2828, - /* 1320 */ 72, 619, 2701, 472, 2824, 71, 2839, 105, 2735, 2211, - /* 1330 */ 2210, 2774, 2654, 792, 150, 121, 2737, 854, 2739, 2740, - /* 1340 */ 849, 2736, 873, 448, 447, 2701, 695, 2946, 90, 2828, - /* 1350 */ 425, 424, 35, 472, 2824, 2209, 851, 2701, 40, 39, - /* 1360 */ 483, 380, 46, 44, 43, 42, 41, 697, 2196, 2197, - /* 1370 */ 2843, 696, 2736, 2701, 492, 293, 2028, 904, 2701, 908, - /* 1380 */ 2465, 909, 2465, 1606, 2465, 2754, 764, 851, 2391, 2701, - /* 1390 */ 2701, 1955, 279, 1950, 2926, 277, 2838, 2283, 738, 1857, - /* 1400 */ 737, 2701, 2105, 850, 615, 1949, 2023, 281, 2736, 164, - /* 1410 */ 280, 283, 2932, 218, 282, 2701, 2754, 2927, 799, 717, - /* 1420 */ 1970, 163, 2655, 851, 801, 299, 1999, 1958, 1960, 1607, - /* 1430 */ 285, 702, 2701, 284, 850, 387, 771, 49, 703, 806, - /* 1440 */ 2266, 871, 870, 2022, 2024, 2025, 2026, 2027, 2735, 2274, - /* 1450 */ 2272, 2774, 2754, 2722, 1604, 121, 2737, 854, 2739, 2740, - /* 1460 */ 849, 1602, 873, 49, 201, 172, 2418, 2803, 2701, 2828, - /* 1470 */ 850, 719, 722, 472, 2824, 2387, 764, 14, 13, 2735, - /* 1480 */ 212, 119, 2774, 116, 2926, 209, 121, 2737, 854, 2739, - /* 1490 */ 2740, 849, 1865, 873, 1948, 964, 329, 77, 2801, 64, - /* 1500 */ 2828, 49, 2932, 218, 472, 2824, 2348, 2927, 799, 1584, - /* 1510 */ 49, 77, 169, 349, 348, 2735, 2219, 2724, 2774, 2139, - /* 1520 */ 2149, 920, 121, 2737, 854, 2739, 2740, 849, 2889, 873, - /* 1530 */ 150, 172, 351, 350, 835, 192, 2828, 2736, 353, 352, - /* 1540 */ 472, 2824, 355, 354, 1576, 1673, 2148, 308, 815, 318, - /* 1550 */ 357, 356, 851, 781, 1931, 1585, 1907, 811, 359, 358, - /* 1560 */ 1664, 902, 901, 900, 1668, 899, 1670, 1671, 845, 844, - /* 1570 */ 310, 1679, 843, 1681, 1682, 842, 886, 883, 746, 333, - /* 1580 */ 822, 2754, 2065, 1557, 2012, 361, 360, 1952, 485, 484, - /* 1590 */ 1932, 363, 362, 1810, 1800, 345, 978, 2701, 74, 850, - /* 1600 */ 881, 803, 365, 364, 871, 870, 2022, 2024, 2025, 2026, - /* 1610 */ 2027, 921, 741, 866, 1655, 378, 367, 366, 2736, 170, - /* 1620 */ 910, 174, 173, 907, 906, 905, 171, 369, 368, 1558, - /* 1630 */ 966, 208, 749, 851, 1574, 152, 172, 2755, 2340, 2255, - /* 1640 */ 962, 958, 954, 950, 2735, 373, 151, 2774, 2879, 778, - /* 1650 */ 2339, 122, 2737, 854, 2739, 2740, 849, 169, 873, 465, - /* 1660 */ 785, 819, 2754, 461, 2547, 2828, 764, 506, 814, 2827, - /* 1670 */ 2824, 524, 2261, 2462, 2926, 793, 1951, 757, 2701, 794, - /* 1680 */ 850, 386, 2880, 1686, 2890, 320, 764, 2548, 315, 323, - /* 1690 */ 514, 120, 2932, 218, 2926, 2374, 346, 2927, 799, 2736, - /* 1700 */ 40, 39, 1694, 5, 46, 44, 43, 42, 41, 439, - /* 1710 */ 509, 1963, 2932, 218, 851, 1973, 523, 2927, 799, 1701, - /* 1720 */ 534, 227, 764, 2736, 226, 2735, 535, 826, 2774, 1699, - /* 1730 */ 2926, 537, 122, 2737, 854, 2739, 2740, 849, 848, 873, - /* 1740 */ 175, 229, 2736, 2754, 379, 1834, 2828, 551, 2932, 218, - /* 1750 */ 837, 2824, 1964, 2927, 799, 558, 240, 851, 560, 2701, - /* 1760 */ 564, 850, 566, 571, 608, 584, 2540, 2754, 595, 597, - /* 1770 */ 604, 607, 344, 609, 832, 620, 621, 327, 618, 246, - /* 1780 */ 245, 623, 326, 2701, 625, 850, 2754, 626, 249, 628, - /* 1790 */ 630, 1971, 4, 645, 656, 653, 257, 1966, 646, 658, - /* 1800 */ 654, 296, 2701, 96, 850, 1972, 852, 659, 1974, 2774, - /* 1810 */ 2736, 662, 660, 122, 2737, 854, 2739, 2740, 849, 260, - /* 1820 */ 873, 263, 1975, 265, 97, 851, 1976, 2828, 98, 2557, - /* 1830 */ 2735, 434, 2824, 2774, 2563, 692, 671, 410, 2737, 854, - /* 1840 */ 2739, 2740, 849, 847, 873, 833, 2793, 99, 272, 2735, - /* 1850 */ 2736, 694, 2774, 2404, 2754, 126, 186, 2737, 854, 2739, - /* 1860 */ 2740, 849, 276, 873, 2400, 851, 725, 278, 726, 413, - /* 1870 */ 2701, 177, 850, 123, 740, 2736, 2402, 2397, 178, 179, - /* 1880 */ 102, 742, 295, 1967, 751, 125, 2631, 752, 382, 758, - /* 1890 */ 851, 2609, 165, 300, 2754, 759, 2628, 2627, 753, 782, - /* 1900 */ 756, 820, 298, 765, 2886, 8, 768, 2867, 791, 766, - /* 1910 */ 2701, 769, 850, 767, 2895, 2894, 191, 2735, 2736, 2754, - /* 1920 */ 2774, 309, 305, 307, 189, 2737, 854, 2739, 2740, 849, - /* 1930 */ 796, 873, 311, 851, 313, 2701, 795, 850, 314, 466, - /* 1940 */ 2949, 807, 2925, 2847, 2736, 804, 156, 312, 2113, 316, - /* 1950 */ 1968, 2111, 204, 325, 166, 818, 383, 2735, 2577, 851, - /* 1960 */ 2774, 2844, 2754, 2576, 186, 2737, 854, 2739, 2740, 849, - /* 1970 */ 1, 873, 384, 2575, 470, 823, 824, 167, 2701, 831, - /* 1980 */ 850, 828, 2735, 800, 2947, 2774, 2736, 338, 2754, 122, - /* 1990 */ 2737, 854, 2739, 2740, 849, 61, 873, 2809, 858, 856, - /* 2000 */ 860, 851, 463, 2828, 2701, 385, 850, 861, 2825, 319, - /* 2010 */ 343, 112, 2887, 220, 2415, 115, 389, 2693, 1472, 2692, - /* 2020 */ 971, 2688, 2687, 2736, 2679, 2735, 875, 970, 2774, 2678, - /* 2030 */ 2754, 372, 411, 2737, 854, 2739, 2740, 849, 851, 873, - /* 2040 */ 2670, 2669, 2685, 2684, 176, 972, 2701, 375, 850, 967, - /* 2050 */ 376, 2735, 2676, 52, 2774, 2675, 974, 2664, 404, 2737, - /* 2060 */ 854, 2739, 2740, 849, 393, 873, 2663, 2754, 2682, 2681, - /* 2070 */ 464, 2673, 2672, 423, 2661, 2660, 2658, 414, 391, 2657, - /* 2080 */ 744, 2466, 431, 2701, 432, 850, 426, 401, 412, 402, - /* 2090 */ 2653, 2652, 2651, 2735, 85, 2646, 2774, 511, 512, 1891, - /* 2100 */ 411, 2737, 854, 2739, 2740, 849, 1892, 873, 224, 790, - /* 2110 */ 2736, 516, 2644, 518, 519, 520, 1890, 2643, 2642, 440, - /* 2120 */ 2640, 526, 2639, 528, 2638, 848, 530, 2637, 1878, 532, - /* 2130 */ 2735, 2613, 2736, 2774, 228, 2612, 230, 189, 2737, 854, - /* 2140 */ 2739, 2740, 849, 86, 873, 1837, 2590, 851, 1836, 2589, - /* 2150 */ 2588, 544, 545, 2587, 2754, 2586, 2530, 549, 1773, 2736, - /* 2160 */ 2527, 552, 2526, 2520, 555, 556, 2517, 233, 2516, 2515, - /* 2170 */ 2701, 2514, 850, 89, 851, 2519, 2754, 2518, 2513, 2512, - /* 2180 */ 235, 2510, 2509, 2508, 572, 2507, 237, 574, 2505, 2504, - /* 2190 */ 2503, 2502, 2701, 2501, 850, 2525, 2736, 2948, 2500, 2499, - /* 2200 */ 2498, 2523, 2506, 2754, 2497, 2496, 2495, 2493, 2492, 2491, - /* 2210 */ 2490, 851, 2489, 2488, 2487, 239, 475, 2735, 2486, 2701, - /* 2220 */ 2774, 850, 2485, 2736, 410, 2737, 854, 2739, 2740, 849, - /* 2230 */ 2484, 873, 2483, 2794, 95, 2555, 2524, 2522, 851, 2735, - /* 2240 */ 2754, 2482, 2774, 477, 2481, 2736, 411, 2737, 854, 2739, - /* 2250 */ 2740, 849, 2480, 873, 244, 1779, 2701, 2479, 850, 611, - /* 2260 */ 851, 2478, 2477, 2475, 613, 1624, 2735, 2754, 428, 2774, - /* 2270 */ 1628, 429, 2736, 411, 2737, 854, 2739, 2740, 849, 2305, - /* 2280 */ 873, 2304, 2303, 2701, 2302, 850, 1620, 851, 247, 2754, - /* 2290 */ 2300, 248, 250, 251, 2297, 631, 632, 633, 2296, 636, - /* 2300 */ 635, 2289, 637, 739, 639, 2701, 2774, 850, 640, 2736, - /* 2310 */ 406, 2737, 854, 2739, 2740, 849, 2754, 873, 641, 2276, - /* 2320 */ 2250, 643, 253, 2721, 851, 199, 1501, 81, 210, 651, - /* 2330 */ 2735, 2249, 2701, 2774, 850, 2611, 255, 396, 2737, 854, - /* 2340 */ 2739, 2740, 849, 82, 873, 2607, 2597, 2585, 262, 264, - /* 2350 */ 2736, 267, 2735, 2754, 2584, 2774, 2561, 269, 2554, 395, - /* 2360 */ 2737, 854, 2739, 2740, 849, 851, 873, 2392, 2299, 2701, - /* 2370 */ 2295, 850, 1550, 672, 674, 673, 2293, 676, 677, 2735, - /* 2380 */ 678, 2291, 2774, 681, 680, 2736, 397, 2737, 854, 2739, - /* 2390 */ 2740, 849, 2288, 873, 2754, 684, 682, 685, 2271, 686, - /* 2400 */ 851, 2269, 2270, 2268, 2246, 2394, 1705, 1706, 2393, 1610, - /* 2410 */ 2701, 1609, 850, 73, 1608, 1605, 2735, 2736, 275, 2774, - /* 2420 */ 2286, 1603, 1601, 403, 2737, 854, 2739, 2740, 849, 2754, - /* 2430 */ 873, 1600, 851, 1599, 2284, 1598, 2736, 1592, 454, 455, - /* 2440 */ 937, 2275, 1597, 939, 456, 2701, 720, 850, 1594, 1593, - /* 2450 */ 1591, 851, 2273, 457, 2245, 723, 2244, 2735, 2243, 727, - /* 2460 */ 2774, 2754, 2242, 729, 407, 2737, 854, 2739, 2740, 849, - /* 2470 */ 2241, 873, 731, 2240, 1872, 733, 1874, 2701, 1871, 850, - /* 2480 */ 2754, 128, 2736, 2610, 1862, 1876, 56, 28, 743, 67, - /* 2490 */ 1847, 2606, 2735, 1843, 297, 2774, 2701, 851, 850, 398, - /* 2500 */ 2737, 854, 2739, 2740, 849, 2596, 873, 57, 1845, 754, - /* 2510 */ 755, 2583, 301, 2582, 2736, 1822, 180, 2931, 760, 1821, - /* 2520 */ 770, 762, 20, 6, 2735, 2166, 2754, 2774, 462, 851, - /* 2530 */ 17, 408, 2737, 854, 2739, 2740, 849, 2140, 873, 30, - /* 2540 */ 304, 772, 2701, 2735, 850, 774, 2774, 7, 215, 306, - /* 2550 */ 399, 2737, 854, 2739, 2740, 849, 776, 873, 2754, 21, - /* 2560 */ 22, 203, 2147, 190, 202, 31, 32, 2134, 2722, 23, - /* 2570 */ 83, 216, 2106, 2108, 2701, 2104, 850, 65, 2736, 217, - /* 2580 */ 24, 2186, 2187, 2088, 18, 2181, 2180, 467, 2185, 2735, - /* 2590 */ 2184, 468, 2774, 851, 2087, 321, 409, 2737, 854, 2739, - /* 2600 */ 2740, 849, 2736, 873, 58, 59, 2581, 195, 2560, 106, - /* 2610 */ 107, 2559, 328, 108, 2142, 205, 334, 851, 69, 2553, - /* 2620 */ 827, 2735, 2754, 337, 2774, 821, 829, 2736, 400, 2737, - /* 2630 */ 854, 2739, 2740, 849, 109, 873, 25, 2040, 2701, 336, - /* 2640 */ 850, 11, 851, 2039, 13, 1956, 2754, 2015, 2050, 196, - /* 2650 */ 2014, 888, 206, 1991, 891, 339, 894, 897, 38, 2552, - /* 2660 */ 110, 2013, 2701, 16, 850, 859, 853, 2736, 26, 2389, - /* 2670 */ 864, 2754, 347, 1983, 27, 70, 865, 857, 341, 111, - /* 2680 */ 79, 880, 851, 2779, 116, 2735, 2778, 2701, 2774, 850, - /* 2690 */ 872, 2736, 416, 2737, 854, 2739, 2740, 849, 2017, 873, - /* 2700 */ 68, 2202, 874, 2201, 2199, 2200, 851, 1687, 494, 2735, - /* 2710 */ 882, 2754, 2774, 1684, 884, 885, 417, 2737, 854, 2739, - /* 2720 */ 2740, 849, 887, 873, 890, 1683, 1680, 2701, 1674, 850, - /* 2730 */ 893, 1672, 2736, 896, 2735, 2754, 1678, 2774, 371, 1677, - /* 2740 */ 117, 2748, 2737, 854, 2739, 2740, 849, 851, 873, 118, - /* 2750 */ 1676, 2701, 1700, 850, 1675, 80, 1696, 1588, 1548, 911, - /* 2760 */ 1587, 1586, 1583, 1580, 1579, 1578, 1577, 1575, 1573, 1572, - /* 2770 */ 925, 1618, 2736, 1571, 2735, 1617, 2754, 2774, 222, 927, - /* 2780 */ 1569, 2747, 2737, 854, 2739, 2740, 849, 851, 873, 1568, - /* 2790 */ 1567, 1566, 2701, 1565, 850, 1564, 1563, 1614, 2735, 2736, - /* 2800 */ 1612, 2774, 1560, 1559, 1556, 2746, 2737, 854, 2739, 2740, - /* 2810 */ 849, 1555, 873, 1554, 851, 1553, 2754, 2294, 2736, 947, - /* 2820 */ 949, 2292, 951, 2290, 948, 952, 953, 956, 955, 957, - /* 2830 */ 2287, 959, 2701, 851, 850, 960, 2267, 961, 963, 2735, - /* 2840 */ 2265, 965, 2774, 2754, 1490, 2239, 436, 2737, 854, 2739, - /* 2850 */ 2740, 849, 1478, 873, 1473, 969, 1480, 377, 973, 2701, - /* 2860 */ 1942, 850, 2754, 390, 976, 2205, 977, 2205, 2205, 2205, - /* 2870 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2701, 2735, - /* 2880 */ 850, 2205, 2774, 2736, 2205, 2205, 437, 2737, 854, 2739, - /* 2890 */ 2740, 849, 2205, 873, 2205, 2205, 2736, 2205, 851, 2205, - /* 2900 */ 2205, 2205, 2205, 2205, 2205, 2205, 2735, 2205, 2205, 2774, - /* 2910 */ 2205, 851, 2205, 433, 2737, 854, 2739, 2740, 849, 2205, - /* 2920 */ 873, 2205, 2205, 2205, 2205, 2735, 2205, 2754, 2774, 2205, - /* 2930 */ 2205, 2205, 438, 2737, 854, 2739, 2740, 849, 2205, 873, - /* 2940 */ 2754, 2205, 2205, 2701, 2205, 850, 2205, 2205, 2205, 2205, - /* 2950 */ 2205, 2205, 2205, 2205, 2205, 2205, 2701, 2205, 850, 2205, - /* 2960 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 2970 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 2980 */ 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, 2205, - /* 2990 */ 852, 2205, 2205, 2774, 2205, 2205, 2205, 406, 2737, 854, - /* 3000 */ 2739, 2740, 849, 2735, 873, 2205, 2774, 2205, 2205, 2205, - /* 3010 */ 405, 2737, 854, 2739, 2740, 849, 2205, 873, + /* 0 */ 821, 670, 3003, 678, 671, 2311, 671, 2311, 2998, 2475, + /* 10 */ 2998, 956, 58, 56, 2430, 57, 55, 54, 53, 52, + /* 20 */ 499, 2264, 1982, 2626, 2007, 464, 820, 229, 771, 3002, + /* 30 */ 218, 2999, 822, 2999, 3001, 503, 1980, 492, 2084, 2355, + /* 40 */ 218, 2793, 149, 2623, 882, 148, 147, 146, 145, 144, + /* 50 */ 143, 142, 141, 140, 582, 2595, 836, 2599, 51, 50, + /* 60 */ 833, 168, 57, 55, 54, 53, 52, 2599, 2079, 149, + /* 70 */ 767, 865, 148, 147, 146, 145, 144, 143, 142, 141, + /* 80 */ 140, 895, 1988, 51, 50, 2811, 757, 57, 55, 54, + /* 90 */ 53, 52, 51, 50, 2698, 2011, 57, 55, 54, 53, + /* 100 */ 52, 2758, 751, 877, 755, 753, 299, 298, 245, 690, + /* 110 */ 680, 2665, 1002, 895, 693, 59, 973, 972, 971, 970, + /* 120 */ 528, 249, 969, 968, 173, 963, 962, 961, 960, 959, + /* 130 */ 958, 957, 172, 951, 950, 949, 527, 526, 946, 945, + /* 140 */ 944, 209, 208, 943, 523, 942, 941, 940, 2792, 43, + /* 150 */ 351, 2840, 2087, 2088, 810, 132, 2794, 881, 2796, 2797, + /* 160 */ 876, 2462, 2751, 864, 900, 516, 2220, 105, 2613, 211, + /* 170 */ 691, 2900, 104, 51, 50, 494, 2896, 57, 55, 54, + /* 180 */ 53, 52, 2793, 2811, 205, 2908, 832, 770, 160, 831, + /* 190 */ 3003, 2043, 2053, 342, 343, 230, 2998, 878, 341, 768, + /* 200 */ 2064, 2086, 2089, 2947, 2263, 51, 50, 2010, 61, 57, + /* 210 */ 55, 54, 53, 52, 820, 229, 1983, 2173, 1981, 2999, + /* 220 */ 822, 2180, 9, 863, 505, 505, 2811, 2007, 158, 157, + /* 230 */ 156, 155, 154, 153, 152, 151, 150, 900, 900, 103, + /* 240 */ 456, 895, 2758, 2261, 877, 937, 185, 184, 934, 933, + /* 250 */ 932, 182, 1986, 1987, 2040, 809, 2042, 2045, 2046, 2047, + /* 260 */ 2048, 2049, 2050, 2051, 2052, 873, 866, 2007, 225, 898, + /* 270 */ 897, 2071, 2072, 2073, 2074, 2075, 2078, 2080, 2081, 2082, + /* 280 */ 2083, 2085, 2, 58, 56, 2176, 686, 2793, 675, 2792, + /* 290 */ 2114, 499, 2840, 1982, 672, 689, 132, 2794, 881, 2796, + /* 300 */ 2797, 876, 875, 2244, 864, 900, 744, 1980, 170, 2084, + /* 310 */ 179, 2871, 2900, 2192, 833, 168, 494, 2896, 51, 50, + /* 320 */ 895, 758, 57, 55, 54, 53, 52, 3003, 573, 2012, + /* 330 */ 2626, 2811, 531, 2151, 73, 2998, 61, 530, 220, 2079, + /* 340 */ 300, 2151, 865, 33, 501, 2007, 19, 2758, 667, 877, + /* 350 */ 2623, 882, 44, 1988, 3002, 2115, 747, 665, 2999, 3000, + /* 360 */ 661, 657, 73, 741, 739, 2752, 58, 56, 73, 265, + /* 370 */ 297, 896, 2471, 673, 499, 2319, 1982, 2209, 635, 633, + /* 380 */ 333, 436, 771, 1002, 243, 77, 15, 2568, 787, 1535, + /* 390 */ 1980, 159, 2084, 203, 2792, 328, 2998, 2840, 2044, 716, + /* 400 */ 335, 431, 2794, 881, 2796, 2797, 876, 874, 1542, 864, + /* 410 */ 900, 856, 2865, 2358, 3004, 229, 83, 125, 12, 2999, + /* 420 */ 822, 82, 2079, 2087, 2088, 865, 2221, 520, 505, 19, + /* 430 */ 2524, 2526, 2120, 1537, 1540, 1541, 1988, 835, 198, 2908, + /* 440 */ 2909, 900, 166, 2913, 803, 802, 2207, 2208, 2210, 2211, + /* 450 */ 2212, 42, 496, 2109, 2110, 2111, 2112, 2113, 2117, 2118, + /* 460 */ 2119, 2041, 2043, 2053, 773, 2665, 1002, 2008, 564, 15, + /* 470 */ 563, 62, 2086, 2089, 2920, 2148, 2149, 2150, 2920, 2920, + /* 480 */ 2920, 2920, 2920, 2148, 2149, 2150, 2768, 1983, 1988, 1981, + /* 490 */ 737, 736, 735, 195, 863, 193, 73, 727, 165, 731, + /* 500 */ 811, 2404, 562, 730, 518, 2473, 2087, 2088, 729, 734, + /* 510 */ 474, 473, 906, 1653, 728, 2772, 1828, 1829, 472, 724, + /* 520 */ 723, 722, 2172, 1986, 1987, 2040, 335, 2042, 2045, 2046, + /* 530 */ 2047, 2048, 2049, 2050, 2051, 2052, 873, 866, 2455, 443, + /* 540 */ 898, 897, 2071, 2072, 183, 2043, 2053, 2078, 2080, 2081, + /* 550 */ 2082, 2083, 2085, 2, 335, 2086, 2089, 687, 610, 1655, + /* 560 */ 335, 471, 470, 609, 1715, 2774, 2776, 495, 303, 2151, + /* 570 */ 1983, 608, 1981, 222, 833, 168, 2010, 863, 900, 1706, + /* 580 */ 929, 928, 927, 1710, 926, 1712, 1713, 925, 922, 2518, + /* 590 */ 1721, 919, 1723, 1724, 916, 913, 910, 51, 50, 1754, + /* 600 */ 1755, 57, 55, 54, 53, 52, 1986, 1987, 2040, 930, + /* 610 */ 2042, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 873, + /* 620 */ 866, 688, 2619, 898, 897, 2071, 2072, 65, 2915, 2626, + /* 630 */ 2078, 2080, 2081, 2082, 2083, 2085, 2, 12, 58, 56, + /* 640 */ 511, 469, 468, 392, 718, 2793, 499, 302, 1982, 2624, + /* 650 */ 882, 301, 806, 1909, 1910, 1715, 2912, 833, 168, 196, + /* 660 */ 878, 2275, 1980, 335, 2084, 720, 905, 904, 903, 719, + /* 670 */ 1706, 929, 928, 927, 1710, 926, 1712, 1713, 872, 871, + /* 680 */ 2793, 1721, 870, 1723, 1724, 869, 913, 910, 335, 2811, + /* 690 */ 1562, 2286, 1561, 2008, 2079, 878, 2551, 865, 138, 2908, + /* 700 */ 2909, 19, 166, 2913, 2674, 2758, 164, 877, 1988, 218, + /* 710 */ 2920, 2148, 2149, 2150, 2920, 2920, 2920, 2920, 2920, 896, + /* 720 */ 2471, 58, 56, 2090, 2811, 114, 550, 2768, 1563, 499, + /* 730 */ 451, 1982, 2285, 479, 2040, 759, 2600, 2095, 1002, 522, + /* 740 */ 2758, 15, 877, 2007, 135, 1980, 1562, 2084, 1561, 333, + /* 750 */ 2011, 2758, 2792, 518, 2473, 2840, 2772, 588, 2595, 408, + /* 760 */ 2794, 881, 2796, 2797, 876, 725, 31, 864, 900, 812, + /* 770 */ 807, 800, 796, 896, 2471, 619, 2595, 2079, 2087, 2088, + /* 780 */ 865, 199, 2908, 2909, 1563, 166, 2913, 2792, 1646, 2711, + /* 790 */ 2840, 1988, 2758, 159, 132, 2794, 881, 2796, 2797, 876, + /* 800 */ 502, 721, 864, 900, 481, 2673, 2774, 2777, 2875, 192, + /* 810 */ 2900, 247, 896, 2471, 494, 2896, 95, 2043, 2053, 900, + /* 820 */ 2476, 1002, 1951, 939, 59, 1855, 1856, 2086, 2089, 252, + /* 830 */ 51, 50, 234, 171, 57, 55, 54, 53, 52, 737, + /* 840 */ 736, 735, 1983, 2463, 1981, 787, 727, 165, 731, 863, + /* 850 */ 2445, 612, 730, 2998, 510, 509, 47, 729, 734, 474, + /* 860 */ 473, 2087, 2088, 728, 554, 2712, 611, 472, 724, 723, + /* 870 */ 722, 3004, 229, 2011, 1854, 1857, 2999, 822, 1986, 1987, + /* 880 */ 2040, 111, 2042, 2045, 2046, 2047, 2048, 2049, 2050, 2051, + /* 890 */ 2052, 873, 866, 556, 552, 898, 897, 2071, 2072, 467, + /* 900 */ 2043, 2053, 2078, 2080, 2081, 2082, 2083, 2085, 2, 2466, + /* 910 */ 2086, 2089, 51, 50, 2044, 868, 57, 55, 54, 53, + /* 920 */ 52, 787, 392, 224, 939, 1983, 867, 1981, 629, 2998, + /* 930 */ 896, 2471, 863, 267, 525, 524, 2531, 673, 514, 2319, + /* 940 */ 521, 566, 1665, 1982, 462, 2531, 565, 3004, 229, 192, + /* 950 */ 66, 46, 2999, 822, 2342, 2529, 1664, 1980, 1989, 2284, + /* 960 */ 2476, 1986, 1987, 2040, 840, 2042, 2045, 2046, 2047, 2048, + /* 970 */ 2049, 2050, 2051, 2052, 873, 866, 738, 2041, 898, 897, + /* 980 */ 2071, 2072, 480, 2673, 2012, 2078, 2080, 2081, 2082, 2083, + /* 990 */ 2085, 2, 58, 56, 2201, 2793, 254, 787, 2531, 12, + /* 1000 */ 499, 10, 1982, 1988, 2283, 2998, 490, 2116, 2202, 115, + /* 1010 */ 836, 2153, 2154, 2155, 2156, 2157, 1980, 2529, 2084, 2758, + /* 1020 */ 2059, 628, 253, 3004, 229, 896, 2471, 37, 2999, 822, + /* 1030 */ 2251, 2282, 640, 1002, 821, 626, 896, 2471, 314, 2811, + /* 1040 */ 2525, 2526, 2998, 1883, 2793, 692, 232, 2679, 2079, 896, + /* 1050 */ 2471, 865, 896, 2471, 2200, 2758, 570, 877, 2915, 878, + /* 1060 */ 820, 229, 1988, 2531, 2758, 2999, 822, 896, 2471, 571, + /* 1070 */ 896, 2471, 590, 896, 2471, 58, 56, 896, 2471, 385, + /* 1080 */ 896, 2471, 848, 499, 2121, 1982, 2911, 604, 2811, 116, + /* 1090 */ 605, 2758, 1002, 606, 720, 59, 2915, 2468, 719, 1980, + /* 1100 */ 305, 2084, 2792, 40, 2758, 2840, 877, 2012, 304, 132, + /* 1110 */ 2794, 881, 2796, 2797, 876, 896, 2471, 864, 900, 2531, + /* 1120 */ 1950, 896, 2471, 211, 2910, 2900, 2281, 504, 953, 494, + /* 1130 */ 2896, 2079, 2087, 2088, 865, 313, 39, 1983, 2529, 1981, + /* 1140 */ 1992, 839, 51, 50, 192, 1988, 57, 55, 54, 53, + /* 1150 */ 52, 2792, 513, 512, 2840, 2477, 2250, 2948, 197, 2794, + /* 1160 */ 881, 2796, 2797, 876, 1565, 1566, 864, 900, 54, 53, + /* 1170 */ 52, 2043, 2053, 1986, 1987, 1002, 2460, 2007, 59, 896, + /* 1180 */ 2471, 2086, 2089, 51, 50, 2531, 2758, 57, 55, 54, + /* 1190 */ 53, 52, 124, 519, 712, 711, 1983, 955, 1981, 346, + /* 1200 */ 714, 713, 2458, 863, 2529, 51, 50, 788, 2958, 57, + /* 1210 */ 55, 54, 53, 52, 41, 2087, 2088, 2280, 2279, 2464, + /* 1220 */ 51, 50, 14, 13, 57, 55, 54, 53, 52, 733, + /* 1230 */ 732, 399, 1986, 1987, 2040, 2508, 2042, 2045, 2046, 2047, + /* 1240 */ 2048, 2049, 2050, 2051, 2052, 873, 866, 111, 2278, 898, + /* 1250 */ 897, 2071, 2072, 175, 2043, 2053, 2078, 2080, 2081, 2082, + /* 1260 */ 2083, 2085, 2, 786, 2086, 2089, 51, 50, 896, 2471, + /* 1270 */ 57, 55, 54, 53, 52, 2467, 285, 2758, 2758, 1983, + /* 1280 */ 2447, 1981, 857, 859, 2872, 2872, 863, 825, 853, 51, + /* 1290 */ 50, 2060, 204, 57, 55, 54, 53, 52, 896, 2471, + /* 1300 */ 391, 710, 706, 702, 698, 38, 284, 2444, 2758, 169, + /* 1310 */ 896, 2471, 2871, 2062, 2011, 1986, 1987, 2040, 353, 2042, + /* 1320 */ 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 873, 866, + /* 1330 */ 889, 2007, 898, 897, 2071, 2072, 1899, 2128, 2277, 2078, + /* 1340 */ 2080, 2081, 2082, 2083, 2085, 2, 58, 56, 2044, 2274, + /* 1350 */ 1669, 440, 112, 2005, 499, 769, 1982, 282, 3002, 1542, + /* 1360 */ 617, 51, 50, 466, 1668, 57, 55, 54, 53, 52, + /* 1370 */ 1980, 637, 2084, 1005, 51, 50, 896, 2471, 57, 55, + /* 1380 */ 54, 53, 52, 896, 2471, 1540, 1541, 596, 545, 639, + /* 1390 */ 896, 2471, 389, 1544, 441, 598, 890, 815, 2758, 2006, + /* 1400 */ 2273, 2272, 2079, 894, 71, 865, 576, 993, 219, 2758, + /* 1410 */ 381, 2041, 236, 45, 2271, 784, 1988, 989, 985, 981, + /* 1420 */ 977, 2270, 384, 2269, 270, 937, 185, 184, 934, 933, + /* 1430 */ 932, 182, 193, 281, 967, 965, 931, 272, 279, 2522, + /* 1440 */ 642, 310, 2474, 277, 684, 828, 1002, 465, 2531, 15, + /* 1450 */ 2291, 995, 937, 185, 184, 934, 933, 932, 182, 584, + /* 1460 */ 2758, 2758, 269, 2268, 2267, 2702, 2162, 2530, 131, 2065, + /* 1470 */ 2266, 51, 50, 357, 2758, 57, 55, 54, 53, 52, + /* 1480 */ 2533, 2758, 935, 2758, 89, 2522, 2087, 2088, 2578, 3, + /* 1490 */ 2606, 2585, 175, 625, 624, 623, 622, 621, 616, 615, + /* 1500 */ 614, 613, 448, 64, 849, 603, 602, 601, 600, 599, + /* 1510 */ 593, 592, 591, 2448, 586, 585, 463, 1648, 2340, 538, + /* 1520 */ 577, 1816, 1817, 2758, 2758, 2043, 2053, 1835, 936, 161, + /* 1530 */ 2758, 2522, 580, 2331, 290, 2086, 2089, 288, 102, 292, + /* 1540 */ 740, 294, 291, 101, 293, 726, 174, 2329, 2012, 355, + /* 1550 */ 1983, 855, 1981, 296, 338, 742, 295, 863, 761, 337, + /* 1560 */ 760, 794, 1626, 1649, 398, 2041, 51, 50, 1644, 745, + /* 1570 */ 57, 55, 54, 53, 52, 1907, 2779, 60, 307, 2061, + /* 1580 */ 2253, 2254, 2475, 60, 212, 826, 1986, 1987, 2040, 223, + /* 1590 */ 2042, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 873, + /* 1600 */ 866, 14, 13, 898, 897, 2071, 2072, 183, 1627, 340, + /* 1610 */ 2078, 2080, 2081, 2082, 2083, 2085, 2, 194, 88, 51, + /* 1620 */ 50, 2793, 405, 57, 55, 54, 53, 52, 2405, 764, + /* 1630 */ 60, 360, 359, 2276, 862, 638, 878, 75, 2321, 60, + /* 1640 */ 2781, 403, 87, 60, 2196, 86, 60, 2793, 1991, 88, + /* 1650 */ 180, 161, 362, 361, 2961, 203, 442, 364, 363, 772, + /* 1660 */ 2206, 130, 878, 127, 2955, 2811, 2205, 319, 263, 652, + /* 1670 */ 650, 647, 645, 329, 2058, 183, 947, 366, 365, 368, + /* 1680 */ 367, 2758, 1990, 877, 824, 787, 804, 370, 369, 321, + /* 1690 */ 838, 2811, 344, 2998, 372, 371, 837, 374, 373, 1618, + /* 1700 */ 834, 845, 85, 376, 375, 378, 377, 2758, 163, 877, + /* 1710 */ 2812, 3004, 229, 2063, 73, 787, 2999, 822, 380, 379, + /* 1720 */ 2122, 2312, 2066, 2998, 2397, 2396, 2054, 908, 2792, 1852, + /* 1730 */ 181, 2840, 1842, 356, 893, 132, 2794, 881, 2796, 2797, + /* 1740 */ 876, 3004, 229, 864, 900, 829, 2999, 822, 183, 3018, + /* 1750 */ 948, 2900, 787, 74, 2792, 494, 2896, 2840, 1697, 2793, + /* 1760 */ 2998, 132, 2794, 881, 2796, 2797, 876, 801, 162, 864, + /* 1770 */ 900, 180, 1599, 1616, 878, 3018, 2968, 2900, 3004, 229, + /* 1780 */ 486, 494, 2896, 2999, 822, 397, 2951, 808, 482, 842, + /* 1790 */ 2604, 529, 547, 2318, 2519, 780, 326, 2952, 2962, 816, + /* 1800 */ 817, 331, 2605, 2811, 136, 2793, 2323, 99, 98, 569, + /* 1810 */ 1728, 2106, 242, 1736, 334, 2431, 5, 537, 1600, 2758, + /* 1820 */ 878, 877, 798, 532, 460, 561, 559, 2005, 546, 2015, + /* 1830 */ 1994, 1743, 525, 524, 557, 2793, 558, 237, 439, 1876, + /* 1840 */ 238, 548, 1996, 560, 544, 540, 536, 533, 562, 2811, + /* 1850 */ 878, 1741, 2991, 240, 186, 390, 1989, 574, 2084, 2006, + /* 1860 */ 581, 991, 251, 583, 1993, 2758, 2792, 877, 589, 2840, + /* 1870 */ 587, 631, 594, 132, 2794, 881, 2796, 2797, 876, 2811, + /* 1880 */ 607, 864, 900, 643, 620, 618, 2793, 3018, 2079, 2900, + /* 1890 */ 627, 2597, 630, 494, 2896, 2758, 641, 877, 632, 644, + /* 1900 */ 256, 878, 1988, 2932, 257, 646, 335, 648, 649, 260, + /* 1910 */ 651, 653, 2792, 2013, 668, 2840, 4, 676, 679, 132, + /* 1920 */ 2794, 881, 2796, 2797, 876, 268, 669, 864, 900, 677, + /* 1930 */ 2811, 107, 861, 3018, 2008, 2900, 2014, 681, 682, 494, + /* 1940 */ 2896, 2016, 2792, 685, 683, 2840, 2758, 271, 877, 132, + /* 1950 */ 2794, 881, 2796, 2797, 876, 2017, 274, 864, 900, 276, + /* 1960 */ 2620, 446, 445, 3018, 108, 2900, 2018, 109, 110, 494, + /* 1970 */ 2896, 506, 2614, 694, 283, 715, 763, 748, 749, 137, + /* 1980 */ 765, 717, 113, 434, 2461, 515, 287, 2084, 2688, 2685, + /* 1990 */ 2684, 393, 2457, 2792, 289, 2793, 2840, 188, 134, 2459, + /* 2000 */ 132, 2794, 881, 2796, 2797, 876, 2009, 2454, 864, 900, + /* 2010 */ 878, 189, 176, 190, 3018, 775, 2900, 2079, 306, 774, + /* 2020 */ 494, 2896, 2666, 779, 311, 2793, 776, 805, 782, 2967, + /* 2030 */ 791, 843, 316, 8, 2939, 814, 1997, 309, 1992, 2811, + /* 2040 */ 878, 792, 320, 781, 790, 2966, 318, 202, 819, 322, + /* 2050 */ 818, 789, 2919, 487, 323, 2758, 327, 877, 324, 2793, + /* 2060 */ 830, 827, 167, 3021, 325, 2010, 2170, 2168, 231, 2811, + /* 2070 */ 2916, 330, 2000, 2002, 878, 336, 1, 2997, 215, 177, + /* 2080 */ 841, 2634, 394, 2633, 2632, 2758, 491, 877, 395, 898, + /* 2090 */ 897, 846, 847, 178, 72, 851, 2078, 2080, 2081, 2082, + /* 2100 */ 2083, 2085, 2792, 2811, 854, 2840, 885, 349, 883, 132, + /* 2110 */ 2794, 881, 2796, 2797, 876, 2881, 887, 864, 900, 2758, + /* 2120 */ 354, 877, 888, 2873, 396, 2900, 2472, 2750, 123, 494, + /* 2130 */ 2896, 2749, 2792, 126, 2745, 2840, 2744, 2736, 2735, 132, + /* 2140 */ 2794, 881, 2796, 2797, 876, 1514, 2793, 864, 900, 2727, + /* 2150 */ 2726, 2742, 2741, 858, 400, 2900, 2733, 997, 2732, 494, + /* 2160 */ 2896, 878, 902, 998, 2721, 1973, 2792, 1949, 2720, 2840, + /* 2170 */ 2739, 383, 2738, 133, 2794, 881, 2796, 2797, 876, 187, + /* 2180 */ 2730, 864, 900, 999, 386, 994, 767, 387, 402, 2900, + /* 2190 */ 2811, 2729, 2793, 2899, 2896, 2718, 2717, 2715, 2714, 508, + /* 2200 */ 507, 1974, 2523, 1001, 63, 444, 2758, 878, 877, 422, + /* 2210 */ 452, 447, 433, 453, 435, 404, 2710, 423, 898, 897, + /* 2220 */ 2709, 2708, 2793, 96, 2703, 2078, 2080, 2081, 2082, 2083, + /* 2230 */ 2085, 534, 535, 1933, 1934, 235, 2811, 878, 539, 2701, + /* 2240 */ 541, 542, 543, 1932, 2700, 2699, 461, 2697, 549, 2696, + /* 2250 */ 551, 2695, 2758, 2792, 877, 553, 2840, 1920, 555, 2670, + /* 2260 */ 133, 2794, 881, 2796, 2797, 876, 2811, 2694, 864, 900, + /* 2270 */ 239, 2669, 241, 1879, 97, 1878, 2900, 2647, 2646, 2645, + /* 2280 */ 860, 2896, 2758, 567, 877, 568, 2793, 2644, 2643, 2587, + /* 2290 */ 2584, 572, 1815, 2583, 575, 2577, 578, 579, 2574, 879, + /* 2300 */ 2573, 878, 2840, 244, 2572, 2571, 133, 2794, 881, 2796, + /* 2310 */ 2797, 876, 100, 2793, 864, 900, 2576, 246, 2575, 2570, + /* 2320 */ 2569, 2567, 2900, 2566, 2565, 248, 455, 2896, 878, 2792, + /* 2330 */ 2811, 2564, 2840, 595, 597, 2562, 200, 2794, 881, 2796, + /* 2340 */ 2797, 876, 2561, 2560, 864, 900, 2758, 2559, 877, 2558, + /* 2350 */ 2793, 2582, 2557, 2556, 2555, 2580, 2563, 2811, 2554, 2553, + /* 2360 */ 2552, 2550, 2549, 2548, 2547, 878, 250, 2544, 2543, 106, + /* 2370 */ 2542, 2541, 2540, 2758, 2546, 877, 2545, 2612, 2581, 2579, + /* 2380 */ 2539, 2538, 2537, 255, 2536, 634, 2535, 1821, 636, 2534, + /* 2390 */ 2532, 1666, 449, 2792, 2811, 1670, 2840, 823, 3019, 2793, + /* 2400 */ 133, 2794, 881, 2796, 2797, 876, 2362, 258, 864, 900, + /* 2410 */ 2758, 2361, 877, 259, 878, 2360, 2900, 2359, 261, 1662, + /* 2420 */ 2792, 2897, 2357, 2840, 2354, 262, 2353, 197, 2794, 881, + /* 2430 */ 2796, 2797, 876, 654, 484, 864, 900, 450, 656, 658, + /* 2440 */ 660, 655, 659, 2811, 2346, 662, 663, 2333, 2793, 664, + /* 2450 */ 666, 2307, 92, 210, 264, 2778, 1543, 2792, 2306, 2758, + /* 2460 */ 2840, 877, 93, 878, 432, 2794, 881, 2796, 2797, 876, + /* 2470 */ 221, 2668, 864, 900, 674, 266, 2793, 2959, 273, 275, + /* 2480 */ 2641, 2618, 278, 485, 2664, 2654, 2642, 280, 2611, 2449, + /* 2490 */ 2793, 878, 2811, 2356, 2352, 695, 697, 1592, 2350, 696, + /* 2500 */ 699, 701, 700, 2348, 703, 878, 2792, 704, 2758, 2840, + /* 2510 */ 877, 705, 2793, 432, 2794, 881, 2796, 2797, 876, 2345, + /* 2520 */ 2811, 864, 900, 707, 708, 2328, 709, 875, 2326, 2327, + /* 2530 */ 2325, 2303, 2451, 1748, 2811, 84, 2758, 1747, 877, 286, + /* 2540 */ 2450, 1651, 1652, 1650, 1647, 1645, 1643, 964, 1642, 1641, + /* 2550 */ 2758, 2343, 877, 1640, 1639, 2792, 2811, 966, 2840, 1636, + /* 2560 */ 1634, 475, 425, 2794, 881, 2796, 2797, 876, 2341, 1635, + /* 2570 */ 864, 900, 2758, 1633, 877, 476, 2332, 477, 743, 2330, + /* 2580 */ 478, 2793, 746, 2792, 2302, 2301, 2840, 2300, 750, 2299, + /* 2590 */ 200, 2794, 881, 2796, 2797, 876, 878, 2792, 864, 900, + /* 2600 */ 2840, 752, 2298, 754, 413, 2794, 881, 2796, 2797, 876, + /* 2610 */ 2297, 139, 864, 900, 756, 813, 1914, 2793, 1916, 2792, + /* 2620 */ 1918, 32, 2840, 2667, 1913, 2811, 431, 2794, 881, 2796, + /* 2630 */ 2797, 876, 878, 67, 864, 900, 78, 2866, 2663, 68, + /* 2640 */ 766, 2758, 1904, 877, 308, 2793, 1887, 1885, 1889, 2653, + /* 2650 */ 777, 191, 3020, 778, 312, 2640, 2639, 783, 1864, 1863, + /* 2660 */ 878, 2811, 3003, 21, 785, 497, 2223, 793, 483, 34, + /* 2670 */ 6, 315, 7, 2197, 795, 797, 317, 2758, 22, 877, + /* 2680 */ 799, 23, 2204, 214, 226, 201, 213, 17, 2792, 2811, + /* 2690 */ 2191, 2840, 35, 2779, 36, 432, 2794, 881, 2796, 2797, + /* 2700 */ 876, 493, 2161, 864, 900, 2758, 227, 877, 2163, 94, + /* 2710 */ 24, 228, 2165, 2243, 76, 2244, 25, 2238, 2237, 2145, + /* 2720 */ 488, 2242, 2241, 489, 2792, 2144, 2793, 2840, 332, 498, + /* 2730 */ 70, 417, 2794, 881, 2796, 2797, 876, 69, 2638, 864, + /* 2740 */ 900, 878, 206, 2617, 117, 18, 118, 2616, 119, 347, + /* 2750 */ 339, 2199, 2792, 2610, 2793, 2840, 216, 844, 345, 432, + /* 2760 */ 2794, 881, 2796, 2797, 876, 120, 80, 864, 900, 878, + /* 2770 */ 2811, 2097, 26, 850, 852, 348, 350, 2096, 13, 11, + /* 2780 */ 1998, 2057, 27, 28, 20, 48, 2758, 2107, 877, 915, + /* 2790 */ 2793, 2056, 207, 918, 921, 217, 2033, 880, 2811, 2609, + /* 2800 */ 886, 121, 2446, 924, 49, 878, 2055, 16, 29, 30, + /* 2810 */ 500, 2025, 884, 81, 2758, 352, 877, 891, 122, 892, + /* 2820 */ 358, 90, 127, 2793, 2850, 2849, 2259, 2258, 2068, 899, + /* 2830 */ 79, 2257, 1729, 2792, 2811, 2256, 2840, 907, 878, 901, + /* 2840 */ 432, 2794, 881, 2796, 2797, 876, 517, 909, 864, 900, + /* 2850 */ 2758, 1726, 877, 911, 914, 912, 917, 920, 1725, 923, + /* 2860 */ 1720, 762, 1722, 1719, 2840, 1716, 2793, 2811, 427, 2794, + /* 2870 */ 881, 2796, 2797, 876, 1718, 1714, 864, 900, 128, 382, + /* 2880 */ 129, 878, 1717, 2758, 1742, 877, 91, 1738, 1590, 938, + /* 2890 */ 1630, 1629, 1628, 1625, 1622, 1621, 1620, 2792, 1619, 2793, + /* 2900 */ 2840, 1660, 1617, 952, 409, 2794, 881, 2796, 2797, 876, + /* 2910 */ 2811, 1615, 864, 900, 878, 1614, 1613, 1659, 233, 1611, + /* 2920 */ 954, 1608, 1610, 1609, 1607, 1606, 2758, 1605, 877, 1656, + /* 2930 */ 2792, 1654, 1602, 2840, 1601, 1596, 2351, 406, 2794, 881, + /* 2940 */ 2796, 2797, 876, 2811, 1598, 864, 900, 1597, 1595, 976, + /* 2950 */ 974, 975, 2349, 978, 980, 979, 2347, 982, 983, 2758, + /* 2960 */ 984, 877, 2344, 2793, 986, 2324, 988, 990, 2322, 987, + /* 2970 */ 992, 1532, 2296, 2792, 996, 1515, 2840, 388, 878, 1520, + /* 2980 */ 410, 2794, 881, 2796, 2797, 876, 2793, 1522, 864, 900, + /* 2990 */ 1000, 2262, 1984, 401, 1003, 1004, 2262, 2262, 2262, 2262, + /* 3000 */ 2262, 878, 2262, 2262, 2262, 2262, 2792, 2811, 2262, 2840, + /* 3010 */ 2262, 2262, 2262, 424, 2794, 881, 2796, 2797, 876, 2262, + /* 3020 */ 2262, 864, 900, 2758, 2262, 877, 2262, 2262, 2262, 2262, + /* 3030 */ 2811, 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3040 */ 2262, 2262, 2262, 2262, 2262, 2262, 2758, 878, 877, 2262, + /* 3050 */ 2262, 2262, 2262, 2262, 2793, 2262, 2262, 2262, 2262, 2262, + /* 3060 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2793, 878, + /* 3070 */ 2792, 2262, 2262, 2840, 2262, 2262, 2811, 411, 2794, 881, + /* 3080 */ 2796, 2797, 876, 878, 2262, 864, 900, 2262, 2262, 2262, + /* 3090 */ 2262, 2262, 2758, 2792, 877, 2262, 2840, 2262, 2811, 2262, + /* 3100 */ 412, 2794, 881, 2796, 2797, 876, 2262, 2262, 864, 900, + /* 3110 */ 2262, 2262, 2811, 2262, 2758, 2262, 877, 2262, 2262, 2262, + /* 3120 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, 2262, + /* 3130 */ 877, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2792, + /* 3140 */ 2262, 2262, 2840, 2262, 2793, 2262, 428, 2794, 881, 2796, + /* 3150 */ 2797, 876, 2262, 2262, 864, 900, 2262, 2262, 2262, 878, + /* 3160 */ 2262, 2792, 2262, 2262, 2840, 2262, 2262, 2262, 414, 2794, + /* 3170 */ 881, 2796, 2797, 876, 2262, 2792, 864, 900, 2840, 2793, + /* 3180 */ 2262, 2262, 429, 2794, 881, 2796, 2797, 876, 2811, 2262, + /* 3190 */ 864, 900, 2262, 2262, 878, 2262, 2262, 2262, 2262, 2262, + /* 3200 */ 2262, 2262, 2262, 2262, 2758, 2262, 877, 2262, 2262, 2262, + /* 3210 */ 2262, 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3220 */ 2262, 2262, 2262, 2811, 2262, 2262, 2262, 878, 2262, 2262, + /* 3230 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, + /* 3240 */ 2262, 877, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3250 */ 2262, 2792, 2262, 2262, 2840, 2793, 2811, 2262, 415, 2794, + /* 3260 */ 881, 2796, 2797, 876, 2262, 2262, 864, 900, 2262, 2262, + /* 3270 */ 878, 2262, 2758, 2262, 877, 2262, 2262, 2262, 2262, 2262, + /* 3280 */ 2262, 2262, 2262, 2262, 2262, 2262, 2792, 2262, 2793, 2840, + /* 3290 */ 2262, 2262, 2262, 430, 2794, 881, 2796, 2797, 876, 2811, + /* 3300 */ 2262, 864, 900, 878, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3310 */ 2262, 2262, 2262, 2262, 2262, 2758, 2262, 877, 2262, 2792, + /* 3320 */ 2262, 2262, 2840, 2262, 2262, 2262, 416, 2794, 881, 2796, + /* 3330 */ 2797, 876, 2811, 2262, 864, 900, 2262, 2262, 2262, 2262, + /* 3340 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, 2262, + /* 3350 */ 877, 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3360 */ 2262, 2262, 2792, 2262, 2262, 2840, 2262, 878, 2262, 407, + /* 3370 */ 2794, 881, 2796, 2797, 876, 2793, 2262, 864, 900, 2262, + /* 3380 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3390 */ 878, 2262, 2262, 2262, 2262, 2792, 2811, 2262, 2840, 2262, + /* 3400 */ 2262, 2262, 418, 2794, 881, 2796, 2797, 876, 2262, 2262, + /* 3410 */ 864, 900, 2758, 2262, 877, 2262, 2262, 2262, 2262, 2811, + /* 3420 */ 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3430 */ 2262, 2262, 2262, 2262, 2262, 2758, 878, 877, 2262, 2262, + /* 3440 */ 2262, 2262, 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3450 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2793, 878, 2792, + /* 3460 */ 2262, 2262, 2840, 2262, 2262, 2811, 419, 2794, 881, 2796, + /* 3470 */ 2797, 876, 878, 2262, 864, 900, 2262, 2262, 2262, 2262, + /* 3480 */ 2262, 2758, 2792, 877, 2262, 2840, 2262, 2811, 2262, 420, + /* 3490 */ 2794, 881, 2796, 2797, 876, 2262, 2262, 864, 900, 2262, + /* 3500 */ 2262, 2811, 2262, 2758, 2262, 877, 2262, 2262, 2262, 2262, + /* 3510 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, 2262, 877, + /* 3520 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2792, 2262, + /* 3530 */ 2262, 2840, 2262, 2793, 2262, 421, 2794, 881, 2796, 2797, + /* 3540 */ 876, 2262, 2262, 864, 900, 2262, 2262, 2262, 878, 2262, + /* 3550 */ 2792, 2262, 2262, 2840, 2262, 2262, 2262, 437, 2794, 881, + /* 3560 */ 2796, 2797, 876, 2262, 2792, 864, 900, 2840, 2793, 2262, + /* 3570 */ 2262, 438, 2794, 881, 2796, 2797, 876, 2811, 2262, 864, + /* 3580 */ 900, 2262, 2262, 878, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3590 */ 2262, 2262, 2262, 2758, 2262, 877, 2262, 2262, 2262, 2262, + /* 3600 */ 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3610 */ 2262, 2262, 2811, 2262, 2262, 2262, 878, 2262, 2262, 2262, + /* 3620 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, 2262, + /* 3630 */ 877, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3640 */ 2792, 2262, 2262, 2840, 2793, 2811, 2262, 2805, 2794, 881, + /* 3650 */ 2796, 2797, 876, 2262, 2262, 864, 900, 2262, 2262, 878, + /* 3660 */ 2262, 2758, 2262, 877, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3670 */ 2262, 2262, 2262, 2262, 2262, 2792, 2262, 2793, 2840, 2262, + /* 3680 */ 2262, 2262, 2804, 2794, 881, 2796, 2797, 876, 2811, 2262, + /* 3690 */ 864, 900, 878, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3700 */ 2262, 2262, 2262, 2262, 2758, 2262, 877, 2262, 2792, 2262, + /* 3710 */ 2262, 2840, 2262, 2262, 2262, 2803, 2794, 881, 2796, 2797, + /* 3720 */ 876, 2811, 2262, 864, 900, 2262, 2262, 2262, 2262, 2262, + /* 3730 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2758, 2262, 877, + /* 3740 */ 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3750 */ 2262, 2792, 2262, 2262, 2840, 2262, 878, 2262, 457, 2794, + /* 3760 */ 881, 2796, 2797, 876, 2793, 2262, 864, 900, 2262, 2262, + /* 3770 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 878, + /* 3780 */ 2262, 2262, 2262, 2262, 2792, 2811, 2262, 2840, 2262, 2262, + /* 3790 */ 2262, 458, 2794, 881, 2796, 2797, 876, 2262, 2262, 864, + /* 3800 */ 900, 2758, 2262, 877, 2262, 2262, 2262, 2262, 2811, 2262, + /* 3810 */ 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3820 */ 2262, 2262, 2262, 2262, 2758, 878, 877, 2262, 2262, 2262, + /* 3830 */ 2262, 2262, 2793, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3840 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 878, 2792, 2262, + /* 3850 */ 2262, 2840, 2262, 2262, 2811, 454, 2794, 881, 2796, 2797, + /* 3860 */ 876, 2262, 2262, 864, 900, 2262, 2262, 2262, 2262, 2262, + /* 3870 */ 2758, 2792, 877, 2262, 2840, 2262, 2811, 2262, 459, 2794, + /* 3880 */ 881, 2796, 2797, 876, 2262, 2262, 864, 900, 2262, 2262, + /* 3890 */ 2262, 2262, 2758, 2262, 877, 2262, 2262, 2262, 2262, 2262, + /* 3900 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, 2262, + /* 3910 */ 2262, 2262, 2262, 2262, 2262, 2262, 2262, 879, 2262, 2262, + /* 3920 */ 2840, 2262, 2262, 2262, 427, 2794, 881, 2796, 2797, 876, + /* 3930 */ 2262, 2262, 864, 900, 2262, 2262, 2262, 2262, 2262, 2792, + /* 3940 */ 2262, 2262, 2840, 2262, 2262, 2262, 426, 2794, 881, 2796, + /* 3950 */ 2797, 876, 2262, 2262, 864, 900, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 412, 426, 390, 467, 443, 393, 394, 443, 472, 510, - /* 10 */ 511, 395, 12, 13, 14, 426, 381, 14, 521, 424, - /* 20 */ 20, 457, 22, 20, 463, 464, 529, 463, 464, 441, - /* 30 */ 412, 396, 425, 395, 396, 440, 36, 396, 38, 428, - /* 40 */ 20, 434, 435, 428, 547, 548, 431, 8, 9, 552, - /* 50 */ 553, 12, 13, 14, 15, 16, 381, 521, 395, 441, - /* 60 */ 425, 445, 446, 14, 448, 529, 425, 451, 68, 20, - /* 70 */ 20, 396, 20, 12, 13, 75, 441, 73, 443, 491, - /* 80 */ 492, 493, 82, 547, 548, 395, 396, 443, 552, 553, - /* 90 */ 502, 0, 485, 486, 20, 12, 13, 36, 395, 396, - /* 100 */ 425, 457, 491, 20, 428, 22, 491, 463, 464, 491, - /* 110 */ 492, 74, 112, 502, 75, 115, 441, 502, 443, 36, - /* 120 */ 502, 38, 20, 488, 395, 396, 491, 14, 15, 16, - /* 130 */ 495, 496, 497, 498, 499, 500, 20, 502, 497, 378, - /* 140 */ 477, 478, 507, 390, 509, 54, 393, 394, 513, 514, - /* 150 */ 381, 68, 152, 153, 516, 517, 518, 519, 75, 521, - /* 160 */ 522, 1, 2, 488, 125, 82, 491, 491, 533, 117, - /* 170 */ 495, 496, 497, 498, 499, 500, 541, 502, 502, 381, - /* 180 */ 505, 36, 507, 508, 509, 395, 396, 411, 513, 514, - /* 190 */ 414, 191, 192, 391, 396, 112, 398, 395, 115, 397, - /* 200 */ 391, 201, 202, 426, 395, 415, 397, 517, 518, 519, - /* 210 */ 441, 521, 522, 423, 437, 211, 216, 115, 218, 529, - /* 220 */ 517, 518, 519, 425, 521, 522, 152, 153, 467, 190, - /* 230 */ 425, 115, 20, 472, 20, 152, 153, 547, 548, 441, - /* 240 */ 191, 443, 552, 553, 240, 241, 517, 518, 519, 444, - /* 250 */ 521, 522, 252, 253, 254, 33, 256, 257, 258, 259, - /* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - /* 270 */ 270, 271, 272, 273, 191, 192, 116, 155, 420, 218, - /* 280 */ 44, 20, 521, 425, 201, 202, 488, 146, 147, 491, - /* 290 */ 529, 36, 151, 495, 496, 497, 498, 499, 500, 216, - /* 300 */ 502, 218, 0, 254, 254, 507, 20, 509, 547, 548, - /* 310 */ 452, 513, 514, 552, 553, 426, 277, 278, 279, 280, - /* 320 */ 281, 282, 283, 284, 285, 286, 287, 115, 145, 146, - /* 330 */ 147, 148, 149, 150, 151, 252, 253, 254, 116, 256, - /* 340 */ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - /* 350 */ 267, 268, 269, 270, 271, 272, 273, 274, 12, 13, - /* 360 */ 426, 427, 381, 218, 425, 18, 20, 147, 22, 417, - /* 370 */ 23, 151, 433, 421, 395, 396, 487, 396, 381, 77, - /* 380 */ 78, 79, 36, 444, 38, 395, 84, 85, 86, 42, - /* 390 */ 43, 155, 90, 46, 415, 250, 251, 95, 96, 97, - /* 400 */ 98, 299, 423, 101, 57, 0, 425, 105, 106, 107, - /* 410 */ 108, 289, 290, 291, 68, 299, 69, 70, 71, 72, - /* 420 */ 73, 75, 441, 523, 443, 525, 21, 20, 82, 24, - /* 430 */ 25, 26, 27, 28, 29, 30, 31, 32, 441, 521, - /* 440 */ 425, 12, 13, 14, 454, 225, 456, 529, 433, 20, - /* 450 */ 230, 22, 20, 233, 193, 235, 425, 20, 112, 444, - /* 460 */ 521, 115, 115, 4, 433, 36, 548, 38, 529, 488, - /* 470 */ 552, 553, 491, 218, 13, 444, 495, 496, 497, 498, - /* 480 */ 499, 500, 23, 502, 395, 396, 547, 548, 507, 425, - /* 490 */ 509, 552, 553, 20, 513, 514, 0, 68, 152, 153, - /* 500 */ 380, 154, 382, 155, 415, 250, 251, 48, 49, 50, - /* 510 */ 21, 82, 425, 24, 25, 26, 27, 28, 29, 30, - /* 520 */ 31, 32, 541, 115, 288, 289, 290, 291, 292, 293, - /* 530 */ 294, 295, 296, 21, 521, 420, 425, 191, 192, 452, - /* 540 */ 425, 112, 529, 82, 115, 434, 435, 201, 202, 37, - /* 550 */ 486, 39, 40, 41, 42, 208, 209, 210, 0, 196, - /* 560 */ 213, 548, 216, 20, 218, 552, 553, 452, 395, 396, - /* 570 */ 74, 8, 9, 226, 227, 12, 13, 14, 15, 16, - /* 580 */ 22, 152, 153, 20, 152, 153, 239, 439, 415, 242, - /* 590 */ 442, 443, 245, 246, 247, 248, 249, 145, 252, 253, - /* 600 */ 254, 149, 256, 257, 258, 259, 260, 261, 262, 263, - /* 610 */ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - /* 620 */ 191, 192, 292, 293, 294, 295, 296, 4, 191, 192, - /* 630 */ 201, 202, 404, 201, 202, 112, 288, 289, 290, 291, - /* 640 */ 292, 293, 294, 295, 296, 216, 299, 218, 0, 115, - /* 650 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - /* 660 */ 432, 138, 139, 140, 141, 142, 143, 144, 305, 306, - /* 670 */ 307, 308, 24, 25, 26, 27, 28, 29, 30, 31, - /* 680 */ 32, 252, 253, 254, 68, 256, 257, 258, 259, 260, - /* 690 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - /* 700 */ 271, 272, 273, 12, 13, 22, 381, 299, 395, 396, - /* 710 */ 74, 20, 20, 22, 12, 13, 14, 15, 16, 36, - /* 720 */ 20, 396, 22, 398, 77, 78, 79, 36, 415, 38, - /* 730 */ 114, 84, 85, 86, 191, 119, 36, 90, 115, 126, - /* 740 */ 395, 396, 95, 96, 97, 98, 3, 381, 101, 215, - /* 750 */ 425, 217, 105, 106, 107, 108, 193, 274, 58, 68, - /* 760 */ 415, 14, 396, 20, 398, 416, 441, 20, 443, 0, - /* 770 */ 228, 8, 9, 82, 425, 12, 13, 14, 15, 16, - /* 780 */ 54, 416, 395, 249, 91, 436, 12, 13, 395, 63, - /* 790 */ 425, 425, 66, 67, 20, 112, 22, 254, 395, 396, - /* 800 */ 425, 436, 186, 112, 395, 396, 115, 441, 433, 443, - /* 810 */ 36, 0, 38, 488, 442, 443, 491, 254, 415, 444, - /* 820 */ 495, 496, 497, 498, 499, 500, 36, 502, 395, 396, - /* 830 */ 395, 396, 507, 299, 509, 395, 396, 425, 513, 514, - /* 840 */ 395, 396, 68, 152, 153, 75, 459, 460, 415, 395, - /* 850 */ 396, 252, 159, 33, 488, 415, 82, 491, 449, 116, - /* 860 */ 415, 495, 496, 497, 498, 499, 500, 47, 502, 415, - /* 870 */ 477, 478, 82, 507, 82, 509, 404, 184, 185, 513, - /* 880 */ 514, 115, 191, 192, 449, 193, 112, 395, 396, 115, - /* 890 */ 126, 198, 201, 202, 422, 8, 9, 485, 486, 12, - /* 900 */ 13, 14, 15, 16, 432, 38, 274, 216, 276, 218, - /* 910 */ 311, 312, 313, 314, 315, 316, 317, 375, 376, 377, - /* 920 */ 33, 54, 299, 22, 155, 0, 152, 153, 190, 381, - /* 930 */ 63, 64, 65, 66, 0, 68, 193, 36, 191, 170, - /* 940 */ 506, 449, 508, 252, 253, 254, 254, 256, 257, 258, - /* 950 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - /* 960 */ 269, 270, 271, 272, 273, 191, 192, 402, 18, 44, - /* 970 */ 20, 208, 425, 395, 396, 201, 202, 27, 395, 396, - /* 980 */ 30, 114, 171, 82, 419, 4, 119, 176, 38, 441, - /* 990 */ 216, 444, 218, 415, 429, 184, 395, 396, 415, 52, - /* 1000 */ 405, 254, 146, 116, 54, 506, 56, 508, 413, 395, - /* 1010 */ 396, 61, 62, 8, 9, 277, 415, 12, 13, 14, - /* 1020 */ 15, 16, 252, 73, 494, 287, 252, 253, 254, 415, - /* 1030 */ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - /* 1040 */ 266, 267, 268, 269, 270, 271, 272, 273, 395, 396, - /* 1050 */ 520, 8, 9, 186, 44, 12, 13, 14, 15, 16, - /* 1060 */ 22, 20, 195, 14, 114, 299, 199, 200, 415, 20, - /* 1070 */ 395, 396, 205, 206, 36, 402, 126, 0, 68, 145, - /* 1080 */ 146, 147, 148, 149, 150, 151, 381, 231, 232, 326, - /* 1090 */ 415, 224, 8, 9, 59, 60, 12, 13, 14, 15, - /* 1100 */ 16, 396, 429, 398, 400, 401, 3, 157, 158, 23, - /* 1110 */ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - /* 1120 */ 82, 116, 172, 173, 174, 175, 176, 177, 178, 179, - /* 1130 */ 425, 181, 182, 183, 381, 49, 50, 187, 188, 189, - /* 1140 */ 193, 400, 401, 425, 194, 126, 441, 33, 443, 505, - /* 1150 */ 112, 204, 508, 435, 77, 78, 79, 80, 81, 116, - /* 1160 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 1170 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - /* 1180 */ 103, 104, 105, 106, 107, 108, 20, 12, 13, 395, - /* 1190 */ 396, 381, 20, 488, 441, 381, 491, 22, 381, 180, - /* 1200 */ 495, 496, 497, 498, 499, 500, 396, 502, 398, 415, - /* 1210 */ 4, 36, 507, 38, 509, 381, 2, 381, 513, 514, - /* 1220 */ 381, 381, 8, 9, 381, 19, 12, 13, 14, 15, - /* 1230 */ 16, 22, 395, 396, 193, 425, 396, 186, 398, 395, - /* 1240 */ 396, 0, 381, 68, 38, 36, 395, 396, 20, 0, - /* 1250 */ 22, 441, 415, 443, 216, 441, 218, 82, 441, 415, - /* 1260 */ 54, 34, 381, 41, 42, 425, 415, 61, 62, 395, - /* 1270 */ 396, 220, 395, 396, 68, 441, 68, 441, 409, 410, - /* 1280 */ 441, 441, 301, 443, 441, 381, 58, 112, 425, 415, - /* 1290 */ 252, 253, 415, 409, 410, 254, 425, 381, 488, 436, - /* 1300 */ 494, 491, 441, 384, 385, 495, 496, 497, 498, 499, - /* 1310 */ 500, 33, 502, 381, 421, 444, 33, 507, 381, 509, - /* 1320 */ 114, 112, 441, 513, 514, 119, 520, 119, 488, 381, - /* 1330 */ 381, 491, 467, 13, 33, 495, 496, 497, 498, 499, - /* 1340 */ 500, 381, 502, 121, 122, 441, 124, 507, 47, 509, - /* 1350 */ 12, 13, 2, 513, 514, 381, 396, 441, 8, 9, - /* 1360 */ 22, 426, 12, 13, 14, 15, 16, 145, 152, 153, - /* 1370 */ 494, 149, 381, 441, 36, 482, 38, 438, 441, 438, - /* 1380 */ 441, 438, 441, 36, 441, 425, 521, 396, 0, 441, - /* 1390 */ 441, 216, 120, 218, 529, 123, 520, 0, 234, 116, - /* 1400 */ 236, 441, 82, 443, 155, 36, 68, 120, 381, 33, - /* 1410 */ 123, 120, 547, 548, 123, 441, 425, 552, 553, 22, - /* 1420 */ 254, 33, 467, 396, 321, 426, 254, 252, 253, 82, - /* 1430 */ 120, 13, 441, 123, 443, 426, 33, 33, 13, 325, - /* 1440 */ 0, 266, 267, 268, 269, 270, 271, 272, 488, 0, - /* 1450 */ 0, 491, 425, 51, 36, 495, 496, 497, 498, 499, - /* 1460 */ 500, 36, 502, 33, 33, 33, 426, 507, 441, 509, - /* 1470 */ 443, 22, 22, 513, 514, 0, 521, 1, 2, 488, - /* 1480 */ 473, 115, 491, 117, 529, 244, 495, 496, 497, 498, - /* 1490 */ 499, 500, 116, 502, 36, 55, 33, 33, 507, 33, - /* 1500 */ 509, 33, 547, 548, 513, 514, 413, 552, 553, 36, - /* 1510 */ 33, 33, 33, 12, 13, 488, 382, 115, 491, 116, - /* 1520 */ 116, 13, 495, 496, 497, 498, 499, 500, 453, 502, - /* 1530 */ 33, 33, 12, 13, 507, 523, 509, 381, 12, 13, - /* 1540 */ 513, 514, 12, 13, 36, 112, 116, 116, 116, 556, - /* 1550 */ 12, 13, 396, 545, 216, 82, 218, 524, 12, 13, - /* 1560 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - /* 1570 */ 538, 138, 139, 140, 141, 142, 143, 144, 1, 116, - /* 1580 */ 116, 425, 116, 36, 116, 12, 13, 218, 250, 251, - /* 1590 */ 252, 12, 13, 116, 116, 116, 19, 441, 33, 443, - /* 1600 */ 33, 323, 12, 13, 266, 267, 268, 269, 270, 271, - /* 1610 */ 272, 13, 467, 116, 116, 38, 12, 13, 381, 33, - /* 1620 */ 145, 146, 147, 148, 149, 150, 151, 12, 13, 82, - /* 1630 */ 53, 54, 467, 396, 36, 399, 33, 425, 412, 394, - /* 1640 */ 63, 64, 65, 66, 488, 68, 33, 491, 453, 544, - /* 1650 */ 412, 495, 496, 497, 498, 499, 500, 33, 502, 544, - /* 1660 */ 544, 544, 425, 466, 453, 509, 521, 399, 467, 513, - /* 1670 */ 514, 489, 396, 440, 529, 528, 218, 474, 441, 528, - /* 1680 */ 443, 116, 453, 116, 453, 549, 521, 453, 515, 531, - /* 1690 */ 54, 114, 547, 548, 529, 414, 119, 552, 553, 381, - /* 1700 */ 8, 9, 116, 302, 12, 13, 14, 15, 16, 490, - /* 1710 */ 468, 20, 547, 548, 396, 20, 395, 552, 553, 116, - /* 1720 */ 233, 404, 521, 381, 484, 488, 479, 150, 491, 116, - /* 1730 */ 529, 479, 495, 496, 497, 498, 499, 500, 396, 502, - /* 1740 */ 116, 404, 381, 425, 470, 214, 509, 395, 547, 548, - /* 1750 */ 513, 514, 20, 552, 553, 396, 47, 396, 450, 441, - /* 1760 */ 396, 443, 450, 447, 190, 395, 395, 425, 396, 450, - /* 1770 */ 447, 447, 195, 447, 197, 113, 408, 200, 111, 395, - /* 1780 */ 407, 395, 205, 441, 110, 443, 425, 406, 395, 395, - /* 1790 */ 395, 20, 52, 388, 479, 388, 404, 20, 392, 443, - /* 1800 */ 392, 224, 441, 404, 443, 20, 488, 397, 20, 491, - /* 1810 */ 381, 397, 469, 495, 496, 497, 498, 499, 500, 404, - /* 1820 */ 502, 404, 20, 404, 404, 396, 20, 509, 404, 454, - /* 1830 */ 488, 513, 514, 491, 460, 388, 395, 495, 496, 497, - /* 1840 */ 498, 499, 500, 501, 502, 503, 504, 404, 404, 488, - /* 1850 */ 381, 425, 491, 425, 425, 395, 495, 496, 497, 498, - /* 1860 */ 499, 500, 425, 502, 425, 396, 384, 425, 384, 388, - /* 1870 */ 441, 425, 443, 425, 237, 381, 425, 425, 425, 425, - /* 1880 */ 115, 483, 402, 20, 221, 193, 441, 222, 479, 468, - /* 1890 */ 396, 478, 481, 402, 425, 395, 441, 441, 476, 310, - /* 1900 */ 443, 309, 475, 542, 543, 318, 441, 540, 207, 303, - /* 1910 */ 441, 320, 443, 319, 537, 537, 537, 488, 381, 425, - /* 1920 */ 491, 539, 461, 461, 495, 496, 497, 498, 499, 500, - /* 1930 */ 298, 502, 536, 396, 534, 441, 297, 443, 468, 327, - /* 1940 */ 557, 324, 551, 527, 381, 322, 396, 535, 126, 526, - /* 1950 */ 20, 300, 397, 402, 402, 441, 461, 488, 441, 396, - /* 1960 */ 491, 494, 425, 441, 495, 496, 497, 498, 499, 500, - /* 1970 */ 532, 502, 461, 441, 441, 199, 458, 402, 441, 454, - /* 1980 */ 443, 441, 488, 554, 555, 491, 381, 402, 425, 495, - /* 1990 */ 496, 497, 498, 499, 500, 115, 502, 512, 441, 199, - /* 2000 */ 455, 396, 465, 509, 441, 421, 443, 454, 514, 550, - /* 2010 */ 402, 402, 543, 530, 396, 115, 395, 441, 22, 441, - /* 2020 */ 35, 441, 441, 381, 441, 488, 430, 383, 491, 441, - /* 2030 */ 425, 402, 495, 496, 497, 498, 499, 500, 396, 502, - /* 2040 */ 441, 441, 441, 441, 386, 37, 441, 387, 443, 40, - /* 2050 */ 389, 488, 441, 471, 491, 441, 388, 441, 495, 496, - /* 2060 */ 497, 498, 499, 500, 379, 502, 441, 425, 441, 441, - /* 2070 */ 465, 441, 441, 427, 441, 441, 441, 480, 403, 441, - /* 2080 */ 487, 441, 462, 441, 462, 443, 427, 418, 418, 418, - /* 2090 */ 0, 0, 0, 488, 47, 0, 491, 36, 243, 36, - /* 2100 */ 495, 496, 497, 498, 499, 500, 36, 502, 36, 546, - /* 2110 */ 381, 243, 0, 36, 36, 243, 36, 0, 0, 243, - /* 2120 */ 0, 36, 0, 36, 0, 396, 22, 0, 238, 36, - /* 2130 */ 488, 0, 381, 491, 224, 0, 224, 495, 496, 497, - /* 2140 */ 498, 499, 500, 225, 502, 218, 0, 396, 216, 0, - /* 2150 */ 0, 212, 211, 0, 425, 0, 158, 51, 51, 381, - /* 2160 */ 0, 36, 0, 0, 36, 54, 0, 51, 0, 0, - /* 2170 */ 441, 0, 443, 47, 396, 0, 425, 0, 0, 0, - /* 2180 */ 51, 0, 0, 0, 36, 0, 176, 176, 0, 0, - /* 2190 */ 0, 0, 441, 0, 443, 0, 381, 555, 0, 0, - /* 2200 */ 0, 0, 0, 425, 0, 0, 0, 0, 0, 0, - /* 2210 */ 0, 396, 0, 0, 0, 51, 465, 488, 0, 441, - /* 2220 */ 491, 443, 0, 381, 495, 496, 497, 498, 499, 500, - /* 2230 */ 0, 502, 0, 504, 47, 0, 0, 0, 396, 488, - /* 2240 */ 425, 0, 491, 465, 0, 381, 495, 496, 497, 498, - /* 2250 */ 499, 500, 0, 502, 158, 22, 441, 0, 443, 157, - /* 2260 */ 396, 0, 0, 0, 156, 22, 488, 425, 52, 491, - /* 2270 */ 22, 52, 381, 495, 496, 497, 498, 499, 500, 0, - /* 2280 */ 502, 0, 0, 441, 0, 443, 36, 396, 68, 425, - /* 2290 */ 0, 68, 68, 68, 0, 36, 54, 44, 0, 54, - /* 2300 */ 36, 0, 44, 488, 36, 441, 491, 443, 54, 381, - /* 2310 */ 495, 496, 497, 498, 499, 500, 425, 502, 44, 0, - /* 2320 */ 0, 36, 47, 51, 396, 33, 14, 44, 51, 51, - /* 2330 */ 488, 0, 441, 491, 443, 0, 45, 495, 496, 497, - /* 2340 */ 498, 499, 500, 44, 502, 0, 0, 0, 44, 207, - /* 2350 */ 381, 51, 488, 425, 0, 491, 0, 51, 0, 495, - /* 2360 */ 496, 497, 498, 499, 500, 396, 502, 0, 0, 441, - /* 2370 */ 0, 443, 76, 36, 44, 54, 0, 36, 54, 488, - /* 2380 */ 44, 0, 491, 54, 36, 381, 495, 496, 497, 498, - /* 2390 */ 499, 500, 0, 502, 425, 36, 44, 54, 0, 44, - /* 2400 */ 396, 0, 0, 0, 0, 0, 22, 36, 0, 22, - /* 2410 */ 441, 36, 443, 125, 36, 36, 488, 381, 123, 491, - /* 2420 */ 0, 36, 36, 495, 496, 497, 498, 499, 500, 425, - /* 2430 */ 502, 36, 396, 36, 0, 36, 381, 22, 22, 22, - /* 2440 */ 33, 0, 36, 33, 22, 441, 56, 443, 36, 36, - /* 2450 */ 36, 396, 0, 22, 0, 36, 0, 488, 0, 36, - /* 2460 */ 491, 425, 0, 36, 495, 496, 497, 498, 499, 500, - /* 2470 */ 0, 502, 36, 0, 36, 22, 36, 441, 36, 443, - /* 2480 */ 425, 20, 381, 0, 229, 116, 193, 115, 228, 115, - /* 2490 */ 223, 0, 488, 36, 51, 491, 441, 396, 443, 495, - /* 2500 */ 496, 497, 498, 499, 500, 0, 502, 193, 22, 22, - /* 2510 */ 193, 0, 199, 0, 381, 193, 219, 3, 203, 193, - /* 2520 */ 36, 203, 33, 52, 488, 116, 425, 491, 36, 396, - /* 2530 */ 304, 495, 496, 497, 498, 499, 500, 116, 502, 115, - /* 2540 */ 115, 115, 441, 488, 443, 113, 491, 52, 51, 116, - /* 2550 */ 495, 496, 497, 498, 499, 500, 111, 502, 425, 33, - /* 2560 */ 33, 33, 116, 115, 115, 115, 33, 116, 51, 304, - /* 2570 */ 115, 33, 82, 36, 441, 116, 443, 3, 381, 115, - /* 2580 */ 33, 116, 116, 116, 304, 36, 36, 36, 36, 488, - /* 2590 */ 36, 36, 491, 396, 116, 51, 495, 496, 497, 498, - /* 2600 */ 499, 500, 381, 502, 288, 33, 0, 51, 0, 115, - /* 2610 */ 44, 0, 116, 44, 116, 115, 115, 396, 115, 0, - /* 2620 */ 116, 488, 425, 115, 491, 196, 196, 381, 495, 496, - /* 2630 */ 497, 498, 499, 500, 44, 502, 33, 113, 441, 200, - /* 2640 */ 443, 275, 396, 113, 2, 22, 425, 116, 252, 51, - /* 2650 */ 116, 115, 51, 22, 115, 195, 115, 115, 115, 0, - /* 2660 */ 44, 116, 441, 115, 443, 196, 255, 381, 115, 0, - /* 2670 */ 22, 425, 51, 116, 115, 115, 118, 116, 115, 115, - /* 2680 */ 115, 36, 396, 115, 117, 488, 115, 441, 491, 443, - /* 2690 */ 115, 381, 495, 496, 497, 498, 499, 500, 116, 502, - /* 2700 */ 115, 22, 126, 22, 229, 22, 396, 116, 36, 488, - /* 2710 */ 115, 425, 491, 116, 36, 115, 495, 496, 497, 498, - /* 2720 */ 499, 500, 36, 502, 36, 116, 116, 441, 116, 443, - /* 2730 */ 36, 116, 381, 36, 488, 425, 137, 491, 33, 137, - /* 2740 */ 115, 495, 496, 497, 498, 499, 500, 396, 502, 115, - /* 2750 */ 137, 441, 36, 443, 137, 115, 22, 22, 76, 75, - /* 2760 */ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - /* 2770 */ 109, 82, 381, 36, 488, 82, 425, 491, 33, 109, - /* 2780 */ 36, 495, 496, 497, 498, 499, 500, 396, 502, 36, - /* 2790 */ 36, 22, 441, 36, 443, 36, 36, 82, 488, 381, - /* 2800 */ 36, 491, 36, 36, 36, 495, 496, 497, 498, 499, - /* 2810 */ 500, 36, 502, 22, 396, 36, 425, 0, 381, 36, - /* 2820 */ 44, 0, 36, 0, 54, 54, 44, 54, 36, 44, - /* 2830 */ 0, 36, 441, 396, 443, 54, 0, 44, 36, 488, - /* 2840 */ 0, 22, 491, 425, 36, 0, 495, 496, 497, 498, - /* 2850 */ 499, 500, 36, 502, 22, 33, 36, 22, 21, 441, - /* 2860 */ 22, 443, 425, 22, 21, 558, 20, 558, 558, 558, - /* 2870 */ 558, 558, 558, 558, 558, 558, 558, 558, 441, 488, - /* 2880 */ 443, 558, 491, 381, 558, 558, 495, 496, 497, 498, - /* 2890 */ 499, 500, 558, 502, 558, 558, 381, 558, 396, 558, - /* 2900 */ 558, 558, 558, 558, 558, 558, 488, 558, 558, 491, - /* 2910 */ 558, 396, 558, 495, 496, 497, 498, 499, 500, 558, - /* 2920 */ 502, 558, 558, 558, 558, 488, 558, 425, 491, 558, - /* 2930 */ 558, 558, 495, 496, 497, 498, 499, 500, 558, 502, - /* 2940 */ 425, 558, 558, 441, 558, 443, 558, 558, 558, 558, - /* 2950 */ 558, 558, 558, 558, 558, 558, 441, 558, 443, 558, - /* 2960 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 2970 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 2980 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 2990 */ 488, 558, 558, 491, 558, 558, 558, 495, 496, 497, - /* 3000 */ 498, 499, 500, 488, 502, 558, 491, 558, 558, 558, - /* 3010 */ 495, 496, 497, 498, 499, 500, 558, 502, 558, 558, - /* 3020 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3030 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3040 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3050 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3060 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3070 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3080 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3090 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3100 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3110 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3120 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3130 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3140 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3150 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3160 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3170 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3180 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3190 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3200 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3210 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3220 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3230 */ 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - /* 3240 */ 558, 558, 558, 558, 558, 378, 378, 378, 378, 378, - /* 3250 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3260 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3270 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3280 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3290 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3300 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3310 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3320 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3330 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3340 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3350 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3360 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3370 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3380 */ 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - /* 3390 */ 378, 378, 378, 378, 378, 378, + /* 0 */ 530, 397, 530, 397, 400, 401, 400, 401, 538, 433, + /* 10 */ 538, 418, 12, 13, 421, 12, 13, 14, 15, 16, + /* 20 */ 20, 0, 22, 450, 20, 427, 556, 557, 402, 557, + /* 30 */ 432, 561, 562, 561, 562, 427, 36, 464, 38, 0, + /* 40 */ 432, 388, 21, 470, 471, 24, 25, 26, 27, 28, + /* 50 */ 29, 30, 31, 32, 402, 403, 403, 459, 8, 9, + /* 60 */ 402, 403, 12, 13, 14, 15, 16, 459, 68, 21, + /* 70 */ 494, 71, 24, 25, 26, 27, 28, 29, 30, 31, + /* 80 */ 32, 20, 82, 8, 9, 432, 21, 12, 13, 14, + /* 90 */ 15, 16, 8, 9, 0, 20, 12, 13, 14, 15, + /* 100 */ 16, 448, 37, 450, 39, 40, 41, 42, 456, 402, + /* 110 */ 484, 485, 112, 20, 74, 115, 77, 78, 79, 80, + /* 120 */ 81, 68, 83, 84, 85, 86, 87, 88, 89, 90, + /* 130 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + /* 140 */ 101, 102, 103, 104, 105, 106, 107, 108, 495, 519, + /* 150 */ 520, 498, 152, 153, 403, 502, 503, 504, 505, 506, + /* 160 */ 507, 435, 435, 510, 511, 438, 116, 114, 461, 516, + /* 170 */ 463, 518, 119, 8, 9, 522, 523, 12, 13, 14, + /* 180 */ 15, 16, 388, 432, 526, 527, 528, 20, 530, 531, + /* 190 */ 3, 191, 192, 146, 147, 542, 538, 403, 151, 126, + /* 200 */ 116, 201, 202, 550, 0, 8, 9, 20, 115, 12, + /* 210 */ 13, 14, 15, 16, 556, 557, 216, 4, 218, 561, + /* 220 */ 562, 14, 44, 223, 498, 498, 432, 20, 24, 25, + /* 230 */ 26, 27, 28, 29, 30, 31, 32, 511, 511, 186, + /* 240 */ 75, 20, 448, 385, 450, 145, 146, 147, 148, 149, + /* 250 */ 150, 151, 252, 253, 254, 504, 256, 257, 258, 259, + /* 260 */ 260, 261, 262, 263, 264, 265, 266, 20, 193, 269, + /* 270 */ 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + /* 280 */ 280, 281, 282, 12, 13, 14, 20, 388, 14, 495, + /* 290 */ 125, 20, 498, 22, 20, 20, 502, 503, 504, 505, + /* 300 */ 506, 507, 403, 116, 510, 511, 4, 36, 514, 38, + /* 310 */ 516, 517, 518, 116, 402, 403, 522, 523, 8, 9, + /* 320 */ 20, 19, 12, 13, 14, 15, 16, 530, 402, 254, + /* 330 */ 450, 432, 474, 155, 115, 538, 115, 479, 244, 68, + /* 340 */ 38, 155, 71, 33, 464, 20, 75, 448, 54, 450, + /* 350 */ 470, 471, 268, 82, 557, 190, 54, 63, 561, 562, + /* 360 */ 66, 67, 115, 61, 62, 435, 12, 13, 115, 398, + /* 370 */ 68, 402, 403, 402, 20, 404, 22, 252, 452, 453, + /* 380 */ 193, 455, 402, 112, 458, 4, 115, 0, 530, 4, + /* 390 */ 36, 422, 38, 532, 495, 534, 538, 498, 191, 430, + /* 400 */ 307, 502, 503, 504, 505, 506, 507, 508, 23, 510, + /* 410 */ 511, 512, 513, 0, 556, 557, 114, 117, 283, 561, + /* 420 */ 562, 119, 68, 152, 153, 71, 116, 446, 498, 75, + /* 430 */ 449, 450, 267, 48, 49, 50, 82, 525, 526, 527, + /* 440 */ 528, 511, 530, 531, 319, 320, 321, 322, 323, 324, + /* 450 */ 325, 286, 287, 288, 289, 290, 291, 292, 293, 294, + /* 460 */ 295, 254, 191, 192, 484, 485, 112, 20, 215, 115, + /* 470 */ 217, 115, 201, 202, 296, 297, 298, 299, 300, 301, + /* 480 */ 302, 303, 304, 297, 298, 299, 419, 216, 82, 218, + /* 490 */ 77, 78, 79, 412, 223, 432, 115, 84, 85, 86, + /* 500 */ 20, 420, 249, 90, 441, 442, 152, 153, 95, 96, + /* 510 */ 97, 98, 228, 36, 101, 448, 191, 192, 105, 106, + /* 520 */ 107, 108, 309, 252, 253, 254, 307, 256, 257, 258, + /* 530 */ 259, 260, 261, 262, 263, 264, 265, 266, 433, 434, + /* 540 */ 269, 270, 271, 272, 33, 191, 192, 276, 277, 278, + /* 550 */ 279, 280, 281, 282, 307, 201, 202, 402, 171, 82, + /* 560 */ 307, 41, 42, 176, 112, 498, 499, 500, 146, 155, + /* 570 */ 216, 184, 218, 431, 402, 403, 20, 223, 511, 127, + /* 580 */ 128, 129, 130, 131, 132, 133, 134, 135, 136, 447, + /* 590 */ 138, 139, 140, 141, 142, 143, 144, 8, 9, 152, + /* 600 */ 153, 12, 13, 14, 15, 16, 252, 253, 254, 126, + /* 610 */ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + /* 620 */ 266, 466, 467, 269, 270, 271, 272, 116, 501, 450, + /* 630 */ 276, 277, 278, 279, 280, 281, 282, 283, 12, 13, + /* 640 */ 36, 121, 122, 432, 124, 388, 20, 147, 22, 470, + /* 650 */ 471, 151, 196, 231, 232, 112, 529, 402, 403, 387, + /* 660 */ 403, 389, 36, 307, 38, 145, 382, 383, 384, 149, + /* 670 */ 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + /* 680 */ 388, 138, 139, 140, 141, 142, 143, 144, 307, 432, + /* 690 */ 20, 388, 22, 20, 68, 403, 0, 71, 526, 527, + /* 700 */ 528, 75, 530, 531, 493, 448, 36, 450, 82, 432, + /* 710 */ 296, 297, 298, 299, 300, 301, 302, 303, 304, 402, + /* 720 */ 403, 12, 13, 14, 432, 225, 73, 419, 58, 20, + /* 730 */ 230, 22, 388, 233, 254, 235, 459, 14, 112, 422, + /* 740 */ 448, 115, 450, 20, 432, 36, 20, 38, 22, 193, + /* 750 */ 20, 448, 495, 441, 442, 498, 448, 402, 403, 502, + /* 760 */ 503, 504, 505, 506, 507, 13, 509, 510, 511, 313, + /* 770 */ 314, 315, 316, 402, 403, 402, 403, 68, 152, 153, + /* 780 */ 71, 526, 527, 528, 58, 530, 531, 495, 36, 474, + /* 790 */ 498, 82, 448, 422, 502, 503, 504, 505, 506, 507, + /* 800 */ 423, 430, 510, 511, 492, 493, 498, 499, 516, 432, + /* 810 */ 518, 456, 402, 403, 522, 523, 409, 191, 192, 511, + /* 820 */ 443, 112, 218, 74, 115, 152, 153, 201, 202, 456, + /* 830 */ 8, 9, 422, 426, 12, 13, 14, 15, 16, 77, + /* 840 */ 78, 79, 216, 436, 218, 530, 84, 85, 86, 223, + /* 850 */ 0, 155, 90, 538, 250, 251, 267, 95, 96, 97, + /* 860 */ 98, 152, 153, 101, 211, 474, 170, 105, 106, 107, + /* 870 */ 108, 556, 557, 20, 201, 202, 561, 562, 252, 253, + /* 880 */ 254, 411, 256, 257, 258, 259, 260, 261, 262, 263, + /* 890 */ 264, 265, 266, 240, 241, 269, 270, 271, 272, 429, + /* 900 */ 191, 192, 276, 277, 278, 279, 280, 281, 282, 439, + /* 910 */ 201, 202, 8, 9, 191, 433, 12, 13, 14, 15, + /* 920 */ 16, 530, 432, 193, 74, 216, 444, 218, 91, 538, + /* 930 */ 402, 403, 223, 398, 12, 13, 432, 402, 36, 404, + /* 940 */ 423, 474, 22, 22, 440, 432, 479, 556, 557, 432, + /* 950 */ 422, 47, 561, 562, 0, 451, 36, 36, 36, 388, + /* 960 */ 443, 252, 253, 254, 451, 256, 257, 258, 259, 260, + /* 970 */ 261, 262, 263, 264, 265, 266, 22, 254, 269, 270, + /* 980 */ 271, 272, 492, 493, 254, 276, 277, 278, 279, 280, + /* 990 */ 281, 282, 12, 13, 22, 388, 159, 530, 432, 283, + /* 1000 */ 20, 285, 22, 82, 388, 538, 440, 190, 36, 186, + /* 1010 */ 403, 300, 301, 302, 303, 304, 36, 451, 38, 448, + /* 1020 */ 116, 184, 185, 556, 557, 402, 403, 47, 561, 562, + /* 1030 */ 208, 388, 112, 112, 530, 198, 402, 403, 68, 432, + /* 1040 */ 449, 450, 538, 220, 388, 422, 193, 428, 68, 402, + /* 1050 */ 403, 71, 402, 403, 82, 448, 422, 450, 501, 403, + /* 1060 */ 556, 557, 82, 432, 448, 561, 562, 402, 403, 422, + /* 1070 */ 402, 403, 422, 402, 403, 12, 13, 402, 403, 34, + /* 1080 */ 402, 403, 451, 20, 267, 22, 529, 422, 432, 119, + /* 1090 */ 422, 448, 112, 422, 145, 115, 501, 422, 149, 36, + /* 1100 */ 422, 38, 495, 286, 448, 498, 450, 254, 489, 502, + /* 1110 */ 503, 504, 505, 506, 507, 402, 403, 510, 511, 432, + /* 1120 */ 218, 402, 403, 516, 529, 518, 388, 440, 13, 522, + /* 1130 */ 523, 68, 152, 153, 71, 422, 2, 216, 451, 218, + /* 1140 */ 218, 422, 8, 9, 432, 82, 12, 13, 14, 15, + /* 1150 */ 16, 495, 250, 251, 498, 443, 334, 550, 502, 503, + /* 1160 */ 504, 505, 506, 507, 59, 60, 510, 511, 14, 15, + /* 1170 */ 16, 191, 192, 252, 253, 112, 433, 20, 115, 402, + /* 1180 */ 403, 201, 202, 8, 9, 432, 448, 12, 13, 14, + /* 1190 */ 15, 16, 409, 440, 407, 408, 216, 82, 218, 422, + /* 1200 */ 407, 408, 433, 223, 451, 8, 9, 551, 552, 12, + /* 1210 */ 13, 14, 15, 16, 2, 152, 153, 388, 388, 436, + /* 1220 */ 8, 9, 1, 2, 12, 13, 14, 15, 16, 416, + /* 1230 */ 417, 424, 252, 253, 254, 428, 256, 257, 258, 259, + /* 1240 */ 260, 261, 262, 263, 264, 265, 266, 411, 388, 269, + /* 1250 */ 270, 271, 272, 33, 191, 192, 276, 277, 278, 279, + /* 1260 */ 280, 281, 282, 52, 201, 202, 8, 9, 402, 403, + /* 1270 */ 12, 13, 14, 15, 16, 439, 38, 448, 448, 216, + /* 1280 */ 0, 218, 515, 515, 517, 517, 223, 33, 422, 8, + /* 1290 */ 9, 116, 54, 12, 13, 14, 15, 16, 402, 403, + /* 1300 */ 433, 63, 64, 65, 66, 47, 68, 0, 448, 514, + /* 1310 */ 402, 403, 517, 116, 20, 252, 253, 254, 422, 256, + /* 1320 */ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + /* 1330 */ 422, 20, 269, 270, 271, 272, 116, 116, 388, 276, + /* 1340 */ 277, 278, 279, 280, 281, 282, 12, 13, 191, 388, + /* 1350 */ 22, 18, 114, 20, 20, 1, 22, 119, 3, 23, + /* 1360 */ 27, 8, 9, 30, 36, 12, 13, 14, 15, 16, + /* 1370 */ 36, 38, 38, 19, 8, 9, 402, 403, 12, 13, + /* 1380 */ 14, 15, 16, 402, 403, 49, 50, 54, 44, 56, + /* 1390 */ 402, 403, 38, 14, 61, 62, 422, 13, 448, 20, + /* 1400 */ 388, 388, 68, 422, 193, 71, 73, 53, 54, 448, + /* 1410 */ 422, 254, 68, 47, 388, 204, 82, 63, 64, 65, + /* 1420 */ 66, 388, 68, 388, 186, 145, 146, 147, 148, 149, + /* 1430 */ 150, 151, 432, 195, 416, 417, 445, 199, 200, 448, + /* 1440 */ 112, 433, 442, 205, 206, 33, 112, 114, 432, 115, + /* 1450 */ 391, 392, 145, 146, 147, 148, 149, 150, 151, 126, + /* 1460 */ 448, 448, 224, 388, 388, 0, 82, 451, 114, 116, + /* 1470 */ 388, 8, 9, 119, 448, 12, 13, 14, 15, 16, + /* 1480 */ 0, 448, 445, 448, 126, 448, 152, 153, 0, 33, + /* 1490 */ 157, 158, 33, 160, 161, 162, 163, 164, 165, 166, + /* 1500 */ 167, 168, 169, 47, 150, 172, 173, 174, 175, 176, + /* 1510 */ 177, 178, 179, 0, 181, 182, 183, 36, 0, 54, + /* 1520 */ 187, 188, 189, 448, 448, 191, 192, 194, 445, 33, + /* 1530 */ 448, 448, 44, 0, 120, 201, 202, 123, 180, 120, + /* 1540 */ 22, 120, 123, 47, 123, 13, 33, 0, 254, 195, + /* 1550 */ 216, 197, 218, 120, 200, 22, 123, 223, 234, 205, + /* 1560 */ 236, 33, 36, 82, 433, 254, 8, 9, 36, 22, + /* 1570 */ 12, 13, 14, 15, 16, 116, 51, 33, 224, 116, + /* 1580 */ 152, 153, 433, 33, 33, 331, 252, 253, 254, 480, + /* 1590 */ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + /* 1600 */ 266, 1, 2, 269, 270, 271, 272, 33, 82, 33, + /* 1610 */ 276, 277, 278, 279, 280, 281, 282, 18, 33, 8, + /* 1620 */ 9, 388, 23, 12, 13, 14, 15, 16, 420, 474, + /* 1630 */ 33, 12, 13, 389, 75, 155, 403, 33, 405, 33, + /* 1640 */ 115, 42, 43, 33, 116, 46, 33, 388, 36, 33, + /* 1650 */ 33, 33, 12, 13, 460, 532, 57, 12, 13, 474, + /* 1660 */ 116, 115, 403, 117, 405, 432, 116, 116, 69, 70, + /* 1670 */ 71, 72, 73, 565, 116, 33, 13, 12, 13, 12, + /* 1680 */ 13, 448, 36, 450, 329, 530, 554, 12, 13, 547, + /* 1690 */ 116, 432, 116, 538, 12, 13, 474, 12, 13, 36, + /* 1700 */ 533, 116, 33, 12, 13, 12, 13, 448, 406, 450, + /* 1710 */ 432, 556, 557, 116, 115, 530, 561, 562, 12, 13, + /* 1720 */ 116, 401, 116, 538, 419, 419, 116, 33, 495, 116, + /* 1730 */ 33, 498, 116, 116, 116, 502, 503, 504, 505, 506, + /* 1740 */ 507, 556, 557, 510, 511, 333, 561, 562, 33, 516, + /* 1750 */ 13, 518, 530, 154, 495, 522, 523, 498, 116, 388, + /* 1760 */ 538, 502, 503, 504, 505, 506, 507, 553, 33, 510, + /* 1770 */ 511, 33, 36, 36, 403, 516, 405, 518, 556, 557, + /* 1780 */ 553, 522, 523, 561, 562, 116, 460, 553, 473, 553, + /* 1790 */ 460, 406, 496, 403, 447, 481, 524, 460, 460, 537, + /* 1800 */ 537, 558, 460, 432, 193, 388, 0, 208, 209, 210, + /* 1810 */ 116, 252, 213, 116, 540, 421, 310, 54, 82, 448, + /* 1820 */ 403, 450, 405, 475, 497, 226, 227, 20, 402, 20, + /* 1830 */ 218, 116, 12, 13, 233, 388, 486, 491, 239, 214, + /* 1840 */ 411, 242, 22, 486, 245, 246, 247, 248, 249, 432, + /* 1850 */ 403, 116, 405, 411, 116, 477, 36, 402, 38, 20, + /* 1860 */ 403, 55, 47, 457, 218, 448, 495, 450, 457, 498, + /* 1870 */ 403, 190, 454, 502, 503, 504, 505, 506, 507, 432, + /* 1880 */ 402, 510, 511, 113, 457, 403, 388, 516, 68, 518, + /* 1890 */ 454, 402, 454, 522, 523, 448, 111, 450, 454, 415, + /* 1900 */ 414, 403, 82, 405, 402, 402, 307, 110, 413, 402, + /* 1910 */ 402, 402, 495, 20, 395, 498, 52, 395, 486, 502, + /* 1920 */ 503, 504, 505, 506, 507, 411, 399, 510, 511, 399, + /* 1930 */ 432, 411, 112, 516, 20, 518, 20, 450, 404, 522, + /* 1940 */ 523, 20, 495, 404, 476, 498, 448, 411, 450, 502, + /* 1950 */ 503, 504, 505, 506, 507, 20, 411, 510, 511, 411, + /* 1960 */ 467, 12, 13, 516, 411, 518, 20, 411, 411, 522, + /* 1970 */ 523, 22, 461, 402, 411, 395, 237, 391, 391, 402, + /* 1980 */ 490, 432, 115, 395, 432, 36, 432, 38, 448, 448, + /* 1990 */ 448, 486, 432, 495, 432, 388, 498, 432, 432, 432, + /* 2000 */ 502, 503, 504, 505, 506, 507, 20, 432, 510, 511, + /* 2010 */ 403, 432, 488, 432, 516, 222, 518, 68, 409, 221, + /* 2020 */ 522, 523, 485, 450, 409, 388, 483, 318, 402, 546, + /* 2030 */ 448, 317, 468, 326, 549, 207, 216, 482, 218, 432, + /* 2040 */ 403, 328, 548, 475, 327, 546, 468, 546, 306, 545, + /* 2050 */ 305, 311, 536, 335, 544, 448, 535, 450, 543, 388, + /* 2060 */ 332, 330, 403, 566, 475, 20, 126, 308, 539, 432, + /* 2070 */ 501, 559, 252, 253, 403, 409, 541, 560, 404, 409, + /* 2080 */ 448, 448, 468, 448, 448, 448, 448, 450, 468, 269, + /* 2090 */ 270, 199, 465, 409, 115, 448, 276, 277, 278, 279, + /* 2100 */ 280, 281, 495, 432, 461, 498, 448, 409, 199, 502, + /* 2110 */ 503, 504, 505, 506, 507, 521, 462, 510, 511, 448, + /* 2120 */ 409, 450, 461, 516, 428, 518, 403, 448, 409, 522, + /* 2130 */ 523, 448, 495, 115, 448, 498, 448, 448, 448, 502, + /* 2140 */ 503, 504, 505, 506, 507, 22, 388, 510, 511, 448, + /* 2150 */ 448, 448, 448, 516, 402, 518, 448, 390, 448, 522, + /* 2160 */ 523, 403, 437, 35, 448, 216, 495, 218, 448, 498, + /* 2170 */ 448, 409, 448, 502, 503, 504, 505, 506, 507, 393, + /* 2180 */ 448, 510, 511, 37, 394, 40, 494, 396, 410, 518, + /* 2190 */ 432, 448, 388, 522, 523, 448, 448, 448, 448, 250, + /* 2200 */ 251, 252, 448, 395, 478, 434, 448, 403, 450, 425, + /* 2210 */ 469, 434, 425, 469, 487, 386, 0, 425, 269, 270, + /* 2220 */ 0, 0, 388, 47, 0, 276, 277, 278, 279, 280, + /* 2230 */ 281, 36, 243, 36, 36, 36, 432, 403, 243, 0, + /* 2240 */ 36, 36, 243, 36, 0, 0, 243, 0, 36, 0, + /* 2250 */ 36, 0, 448, 495, 450, 22, 498, 238, 36, 0, + /* 2260 */ 502, 503, 504, 505, 506, 507, 432, 0, 510, 511, + /* 2270 */ 224, 0, 224, 218, 225, 216, 518, 0, 0, 0, + /* 2280 */ 522, 523, 448, 212, 450, 211, 388, 0, 0, 158, + /* 2290 */ 0, 51, 51, 0, 36, 0, 36, 54, 0, 495, + /* 2300 */ 0, 403, 498, 51, 0, 0, 502, 503, 504, 505, + /* 2310 */ 506, 507, 47, 388, 510, 511, 0, 51, 0, 0, + /* 2320 */ 0, 0, 518, 0, 0, 176, 522, 523, 403, 495, + /* 2330 */ 432, 0, 498, 36, 176, 0, 502, 503, 504, 505, + /* 2340 */ 506, 507, 0, 0, 510, 511, 448, 0, 450, 0, + /* 2350 */ 388, 0, 0, 0, 0, 0, 0, 432, 0, 0, + /* 2360 */ 0, 0, 0, 0, 0, 403, 51, 0, 0, 47, + /* 2370 */ 0, 0, 0, 448, 0, 450, 0, 0, 0, 0, + /* 2380 */ 0, 0, 0, 158, 0, 157, 0, 22, 156, 0, + /* 2390 */ 0, 22, 52, 495, 432, 22, 498, 563, 564, 388, + /* 2400 */ 502, 503, 504, 505, 506, 507, 0, 68, 510, 511, + /* 2410 */ 448, 0, 450, 68, 403, 0, 518, 0, 68, 36, + /* 2420 */ 495, 523, 0, 498, 0, 68, 0, 502, 503, 504, + /* 2430 */ 505, 506, 507, 36, 472, 510, 511, 52, 44, 36, + /* 2440 */ 44, 54, 54, 432, 0, 36, 54, 0, 388, 44, + /* 2450 */ 36, 0, 44, 33, 47, 51, 14, 495, 0, 448, + /* 2460 */ 498, 450, 44, 403, 502, 503, 504, 505, 506, 507, + /* 2470 */ 51, 0, 510, 511, 51, 45, 388, 552, 44, 207, + /* 2480 */ 0, 0, 51, 472, 0, 0, 0, 51, 0, 0, + /* 2490 */ 388, 403, 432, 0, 0, 36, 44, 76, 0, 54, + /* 2500 */ 36, 44, 54, 0, 36, 403, 495, 54, 448, 498, + /* 2510 */ 450, 44, 388, 502, 503, 504, 505, 506, 507, 0, + /* 2520 */ 432, 510, 511, 36, 54, 0, 44, 403, 0, 0, + /* 2530 */ 0, 0, 0, 36, 432, 125, 448, 22, 450, 123, + /* 2540 */ 0, 36, 22, 36, 36, 36, 36, 33, 36, 36, + /* 2550 */ 448, 0, 450, 36, 36, 495, 432, 33, 498, 36, + /* 2560 */ 22, 22, 502, 503, 504, 505, 506, 507, 0, 36, + /* 2570 */ 510, 511, 448, 36, 450, 22, 0, 22, 56, 0, + /* 2580 */ 22, 388, 36, 495, 0, 0, 498, 0, 36, 0, + /* 2590 */ 502, 503, 504, 505, 506, 507, 403, 495, 510, 511, + /* 2600 */ 498, 36, 0, 36, 502, 503, 504, 505, 506, 507, + /* 2610 */ 0, 20, 510, 511, 22, 555, 36, 388, 36, 495, + /* 2620 */ 116, 115, 498, 0, 36, 432, 502, 503, 504, 505, + /* 2630 */ 506, 507, 403, 193, 510, 511, 115, 513, 0, 193, + /* 2640 */ 228, 448, 229, 450, 51, 388, 22, 36, 223, 0, + /* 2650 */ 22, 219, 564, 193, 199, 0, 0, 203, 193, 193, + /* 2660 */ 403, 432, 3, 33, 203, 472, 116, 36, 36, 115, + /* 2670 */ 52, 115, 52, 116, 115, 113, 116, 448, 33, 450, + /* 2680 */ 111, 33, 116, 33, 51, 115, 115, 312, 495, 432, + /* 2690 */ 116, 498, 115, 51, 33, 502, 503, 504, 505, 506, + /* 2700 */ 507, 472, 116, 510, 511, 448, 33, 450, 82, 115, + /* 2710 */ 312, 115, 36, 116, 3, 116, 33, 36, 36, 116, + /* 2720 */ 36, 36, 36, 36, 495, 116, 388, 498, 51, 472, + /* 2730 */ 33, 502, 503, 504, 505, 506, 507, 296, 0, 510, + /* 2740 */ 511, 403, 51, 0, 115, 312, 44, 0, 44, 200, + /* 2750 */ 116, 116, 495, 0, 388, 498, 115, 196, 115, 502, + /* 2760 */ 503, 504, 505, 506, 507, 44, 115, 510, 511, 403, + /* 2770 */ 432, 113, 33, 116, 196, 115, 195, 113, 2, 284, + /* 2780 */ 22, 116, 115, 115, 115, 115, 448, 252, 450, 115, + /* 2790 */ 388, 116, 51, 115, 115, 51, 22, 255, 432, 0, + /* 2800 */ 196, 44, 0, 115, 115, 403, 116, 115, 115, 115, + /* 2810 */ 472, 116, 116, 115, 448, 115, 450, 22, 115, 118, + /* 2820 */ 51, 115, 117, 388, 115, 115, 22, 22, 116, 115, + /* 2830 */ 115, 22, 116, 495, 432, 229, 498, 36, 403, 126, + /* 2840 */ 502, 503, 504, 505, 506, 507, 36, 115, 510, 511, + /* 2850 */ 448, 116, 450, 36, 36, 115, 36, 36, 116, 36, + /* 2860 */ 137, 495, 116, 137, 498, 116, 388, 432, 502, 503, + /* 2870 */ 504, 505, 506, 507, 137, 116, 510, 511, 115, 33, + /* 2880 */ 115, 403, 137, 448, 36, 450, 115, 22, 76, 75, + /* 2890 */ 22, 36, 36, 36, 36, 36, 36, 495, 36, 388, + /* 2900 */ 498, 82, 36, 109, 502, 503, 504, 505, 506, 507, + /* 2910 */ 432, 36, 510, 511, 403, 36, 36, 82, 33, 36, + /* 2920 */ 109, 22, 36, 36, 36, 36, 448, 36, 450, 82, + /* 2930 */ 495, 36, 36, 498, 36, 22, 0, 502, 503, 504, + /* 2940 */ 505, 506, 507, 432, 36, 510, 511, 36, 36, 44, + /* 2950 */ 36, 54, 0, 36, 44, 54, 0, 36, 54, 448, + /* 2960 */ 44, 450, 0, 388, 36, 0, 44, 36, 0, 54, + /* 2970 */ 22, 36, 0, 495, 33, 22, 498, 22, 403, 36, + /* 2980 */ 502, 503, 504, 505, 506, 507, 388, 36, 510, 511, + /* 2990 */ 21, 567, 22, 22, 21, 20, 567, 567, 567, 567, + /* 3000 */ 567, 403, 567, 567, 567, 567, 495, 432, 567, 498, + /* 3010 */ 567, 567, 567, 502, 503, 504, 505, 506, 507, 567, + /* 3020 */ 567, 510, 511, 448, 567, 450, 567, 567, 567, 567, + /* 3030 */ 432, 567, 388, 567, 567, 567, 567, 567, 567, 567, + /* 3040 */ 567, 567, 567, 567, 567, 567, 448, 403, 450, 567, + /* 3050 */ 567, 567, 567, 567, 388, 567, 567, 567, 567, 567, + /* 3060 */ 567, 567, 567, 567, 567, 567, 567, 567, 388, 403, + /* 3070 */ 495, 567, 567, 498, 567, 567, 432, 502, 503, 504, + /* 3080 */ 505, 506, 507, 403, 567, 510, 511, 567, 567, 567, + /* 3090 */ 567, 567, 448, 495, 450, 567, 498, 567, 432, 567, + /* 3100 */ 502, 503, 504, 505, 506, 507, 567, 567, 510, 511, + /* 3110 */ 567, 567, 432, 567, 448, 567, 450, 567, 567, 567, + /* 3120 */ 567, 567, 567, 567, 567, 567, 567, 567, 448, 567, + /* 3130 */ 450, 567, 567, 567, 567, 567, 567, 567, 567, 495, + /* 3140 */ 567, 567, 498, 567, 388, 567, 502, 503, 504, 505, + /* 3150 */ 506, 507, 567, 567, 510, 511, 567, 567, 567, 403, + /* 3160 */ 567, 495, 567, 567, 498, 567, 567, 567, 502, 503, + /* 3170 */ 504, 505, 506, 507, 567, 495, 510, 511, 498, 388, + /* 3180 */ 567, 567, 502, 503, 504, 505, 506, 507, 432, 567, + /* 3190 */ 510, 511, 567, 567, 403, 567, 567, 567, 567, 567, + /* 3200 */ 567, 567, 567, 567, 448, 567, 450, 567, 567, 567, + /* 3210 */ 567, 567, 388, 567, 567, 567, 567, 567, 567, 567, + /* 3220 */ 567, 567, 567, 432, 567, 567, 567, 403, 567, 567, + /* 3230 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 448, + /* 3240 */ 567, 450, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3250 */ 567, 495, 567, 567, 498, 388, 432, 567, 502, 503, + /* 3260 */ 504, 505, 506, 507, 567, 567, 510, 511, 567, 567, + /* 3270 */ 403, 567, 448, 567, 450, 567, 567, 567, 567, 567, + /* 3280 */ 567, 567, 567, 567, 567, 567, 495, 567, 388, 498, + /* 3290 */ 567, 567, 567, 502, 503, 504, 505, 506, 507, 432, + /* 3300 */ 567, 510, 511, 403, 567, 567, 567, 567, 567, 567, + /* 3310 */ 567, 567, 567, 567, 567, 448, 567, 450, 567, 495, + /* 3320 */ 567, 567, 498, 567, 567, 567, 502, 503, 504, 505, + /* 3330 */ 506, 507, 432, 567, 510, 511, 567, 567, 567, 567, + /* 3340 */ 567, 567, 567, 567, 567, 567, 567, 567, 448, 567, + /* 3350 */ 450, 567, 388, 567, 567, 567, 567, 567, 567, 567, + /* 3360 */ 567, 567, 495, 567, 567, 498, 567, 403, 567, 502, + /* 3370 */ 503, 504, 505, 506, 507, 388, 567, 510, 511, 567, + /* 3380 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3390 */ 403, 567, 567, 567, 567, 495, 432, 567, 498, 567, + /* 3400 */ 567, 567, 502, 503, 504, 505, 506, 507, 567, 567, + /* 3410 */ 510, 511, 448, 567, 450, 567, 567, 567, 567, 432, + /* 3420 */ 567, 388, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3430 */ 567, 567, 567, 567, 567, 448, 403, 450, 567, 567, + /* 3440 */ 567, 567, 567, 388, 567, 567, 567, 567, 567, 567, + /* 3450 */ 567, 567, 567, 567, 567, 567, 567, 388, 403, 495, + /* 3460 */ 567, 567, 498, 567, 567, 432, 502, 503, 504, 505, + /* 3470 */ 506, 507, 403, 567, 510, 511, 567, 567, 567, 567, + /* 3480 */ 567, 448, 495, 450, 567, 498, 567, 432, 567, 502, + /* 3490 */ 503, 504, 505, 506, 507, 567, 567, 510, 511, 567, + /* 3500 */ 567, 432, 567, 448, 567, 450, 567, 567, 567, 567, + /* 3510 */ 567, 567, 567, 567, 567, 567, 567, 448, 567, 450, + /* 3520 */ 567, 567, 567, 567, 567, 567, 567, 567, 495, 567, + /* 3530 */ 567, 498, 567, 388, 567, 502, 503, 504, 505, 506, + /* 3540 */ 507, 567, 567, 510, 511, 567, 567, 567, 403, 567, + /* 3550 */ 495, 567, 567, 498, 567, 567, 567, 502, 503, 504, + /* 3560 */ 505, 506, 507, 567, 495, 510, 511, 498, 388, 567, + /* 3570 */ 567, 502, 503, 504, 505, 506, 507, 432, 567, 510, + /* 3580 */ 511, 567, 567, 403, 567, 567, 567, 567, 567, 567, + /* 3590 */ 567, 567, 567, 448, 567, 450, 567, 567, 567, 567, + /* 3600 */ 567, 388, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3610 */ 567, 567, 432, 567, 567, 567, 403, 567, 567, 567, + /* 3620 */ 567, 567, 567, 567, 567, 567, 567, 567, 448, 567, + /* 3630 */ 450, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3640 */ 495, 567, 567, 498, 388, 432, 567, 502, 503, 504, + /* 3650 */ 505, 506, 507, 567, 567, 510, 511, 567, 567, 403, + /* 3660 */ 567, 448, 567, 450, 567, 567, 567, 567, 567, 567, + /* 3670 */ 567, 567, 567, 567, 567, 495, 567, 388, 498, 567, + /* 3680 */ 567, 567, 502, 503, 504, 505, 506, 507, 432, 567, + /* 3690 */ 510, 511, 403, 567, 567, 567, 567, 567, 567, 567, + /* 3700 */ 567, 567, 567, 567, 448, 567, 450, 567, 495, 567, + /* 3710 */ 567, 498, 567, 567, 567, 502, 503, 504, 505, 506, + /* 3720 */ 507, 432, 567, 510, 511, 567, 567, 567, 567, 567, + /* 3730 */ 567, 567, 567, 567, 567, 567, 567, 448, 567, 450, + /* 3740 */ 567, 388, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3750 */ 567, 495, 567, 567, 498, 567, 403, 567, 502, 503, + /* 3760 */ 504, 505, 506, 507, 388, 567, 510, 511, 567, 567, + /* 3770 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 403, + /* 3780 */ 567, 567, 567, 567, 495, 432, 567, 498, 567, 567, + /* 3790 */ 567, 502, 503, 504, 505, 506, 507, 567, 567, 510, + /* 3800 */ 511, 448, 567, 450, 567, 567, 567, 567, 432, 567, + /* 3810 */ 388, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3820 */ 567, 567, 567, 567, 448, 403, 450, 567, 567, 567, + /* 3830 */ 567, 567, 388, 567, 567, 567, 567, 567, 567, 567, + /* 3840 */ 567, 567, 567, 567, 567, 567, 567, 403, 495, 567, + /* 3850 */ 567, 498, 567, 567, 432, 502, 503, 504, 505, 506, + /* 3860 */ 507, 567, 567, 510, 511, 567, 567, 567, 567, 567, + /* 3870 */ 448, 495, 450, 567, 498, 567, 432, 567, 502, 503, + /* 3880 */ 504, 505, 506, 507, 567, 567, 510, 511, 567, 567, + /* 3890 */ 567, 567, 448, 567, 450, 567, 567, 567, 567, 567, + /* 3900 */ 567, 567, 567, 567, 567, 567, 567, 567, 567, 567, + /* 3910 */ 567, 567, 567, 567, 567, 567, 567, 495, 567, 567, + /* 3920 */ 498, 567, 567, 567, 502, 503, 504, 505, 506, 507, + /* 3930 */ 567, 567, 510, 511, 567, 567, 567, 567, 567, 495, + /* 3940 */ 567, 567, 498, 567, 567, 567, 502, 503, 504, 505, + /* 3950 */ 506, 507, 567, 567, 510, 511, 385, 385, 385, 385, + /* 3960 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 3970 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 3980 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 3990 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4000 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4010 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4020 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4030 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4040 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4050 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4060 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4070 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4080 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4090 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4100 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4110 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4120 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4130 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4140 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4150 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4160 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4170 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4180 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4190 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4200 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4210 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4220 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4230 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4240 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4250 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4260 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4270 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4280 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4290 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4300 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4310 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4320 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4330 */ 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, + /* 4340 */ 385, }; -#define YY_SHIFT_COUNT (978) +#define YY_SHIFT_COUNT (1005) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2846) +#define YY_SHIFT_MAX (2975) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 347, 0, 83, 0, 346, 346, 346, 346, 346, 346, - /* 10 */ 346, 346, 346, 346, 346, 346, 429, 691, 691, 774, - /* 20 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, - /* 30 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, - /* 40 */ 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, - /* 50 */ 102, 116, 534, 212, 408, 766, 408, 408, 212, 212, - /* 60 */ 408, 1175, 408, 950, 1175, 623, 408, 20, 1338, 432, - /* 70 */ 432, 214, 214, 1338, 1338, 459, 459, 432, 437, 437, - /* 80 */ 74, 3, 3, 50, 52, 214, 214, 214, 214, 214, - /* 90 */ 214, 214, 214, 214, 214, 214, 286, 407, 473, 214, - /* 100 */ 214, 37, 20, 214, 286, 214, 20, 214, 214, 214, - /* 110 */ 214, 20, 214, 214, 214, 20, 214, 20, 20, 20, - /* 120 */ 636, 39, 39, 523, 523, 1433, 647, 236, 489, 1038, - /* 130 */ 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, - /* 140 */ 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1222, 743, - /* 150 */ 437, 74, 1035, 1035, 790, 261, 261, 261, 632, 632, - /* 160 */ 496, 461, 790, 37, 20, 613, 20, 20, 483, 20, - /* 170 */ 20, 792, 20, 792, 792, 764, 1227, 523, 523, 523, - /* 180 */ 523, 523, 523, 1577, 302, 405, 563, 348, 348, 763, - /* 190 */ 599, 363, 330, 700, 122, 49, 747, 61, 61, 1086, - /* 200 */ 692, 901, 901, 901, 947, 901, 543, 1041, 1228, 1010, - /* 210 */ 1049, 452, 1051, 1166, 1166, 1172, 1320, 1320, 1103, 820, - /* 220 */ 981, 1166, 461, 1401, 1636, 1691, 1695, 1487, 37, 1695, - /* 230 */ 37, 1531, 1691, 1732, 1709, 1732, 1709, 1574, 1691, 1732, - /* 240 */ 1691, 1709, 1574, 1574, 1574, 1662, 1667, 1691, 1691, 1674, - /* 250 */ 1691, 1691, 1691, 1771, 1740, 1771, 1740, 1695, 37, 37, - /* 260 */ 1777, 37, 1785, 1788, 37, 1785, 37, 1802, 37, 1806, - /* 270 */ 37, 37, 1691, 37, 1771, 20, 20, 20, 20, 20, - /* 280 */ 20, 20, 20, 20, 20, 20, 1691, 1227, 1227, 1771, - /* 290 */ 792, 792, 792, 1637, 1765, 1695, 636, 1863, 1665, 1663, - /* 300 */ 1777, 636, 1401, 1691, 792, 1589, 1592, 1589, 1592, 1587, - /* 310 */ 1701, 1589, 1591, 1594, 1606, 1401, 1632, 1639, 1612, 1617, - /* 320 */ 1623, 1732, 1930, 1822, 1651, 1785, 636, 636, 1592, 792, - /* 330 */ 792, 792, 792, 1592, 792, 1776, 636, 792, 1806, 636, - /* 340 */ 1880, 792, 1800, 1806, 636, 764, 636, 1732, 792, 792, - /* 350 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - /* 360 */ 792, 792, 792, 792, 792, 792, 792, 792, 792, 792, - /* 370 */ 1900, 792, 1691, 636, 1996, 1985, 2008, 2009, 1771, 3018, - /* 380 */ 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, 3018, - /* 390 */ 3018, 1077, 867, 648, 1206, 887, 1005, 1043, 1214, 1350, - /* 400 */ 1692, 934, 1475, 1084, 1084, 1084, 1084, 1084, 1084, 1084, - /* 410 */ 1084, 1084, 183, 512, 220, 693, 702, 702, 4, 616, - /* 420 */ 811, 726, 542, 542, 145, 255, 542, 769, 683, 1209, - /* 430 */ 856, 141, 141, 113, 160, 738, 113, 113, 113, 91, - /* 440 */ 1241, 222, 925, 1301, 1019, 1249, 1388, 1272, 1287, 1291, - /* 450 */ 1310, 1347, 1418, 1425, 558, 1397, 1449, 1450, 1164, 1283, - /* 460 */ 1376, 1208, 1403, 1404, 1430, 1431, 1216, 1278, 1114, 1432, - /* 470 */ 1463, 1464, 1476, 1466, 770, 1468, 1402, 1477, 1478, 1479, - /* 480 */ 1497, 1498, 1501, 1520, 1526, 1530, 1538, 1546, 1573, 1579, - /* 490 */ 1590, 1604, 1615, 1565, 1567, 1586, 1603, 1613, 1624, 1366, - /* 500 */ 1473, 1369, 1458, 1508, 1598, 1547, 1440, 2090, 2091, 2092, - /* 510 */ 2047, 2095, 2061, 1855, 2063, 2070, 2072, 1868, 2112, 2077, - /* 520 */ 2078, 1872, 2080, 2117, 2118, 1876, 2120, 2085, 2122, 2087, - /* 530 */ 2124, 2104, 2127, 2093, 1890, 2131, 1910, 2135, 1912, 1918, - /* 540 */ 1927, 1932, 2146, 2149, 2150, 1939, 1941, 2153, 2155, 1998, - /* 550 */ 2106, 2107, 2160, 2125, 2162, 2163, 2128, 2111, 2166, 2116, - /* 560 */ 2168, 2126, 2169, 2171, 2175, 2129, 2177, 2178, 2179, 2181, - /* 570 */ 2182, 2183, 2010, 2148, 2185, 2011, 2188, 2189, 2190, 2191, - /* 580 */ 2193, 2195, 2198, 2199, 2200, 2201, 2202, 2204, 2205, 2206, - /* 590 */ 2207, 2208, 2209, 2210, 2212, 2213, 2164, 2214, 2187, 2218, - /* 600 */ 2222, 2230, 2232, 2235, 2236, 2237, 2241, 2244, 2233, 2252, - /* 610 */ 2096, 2257, 2102, 2261, 2108, 2262, 2263, 2243, 2216, 2248, - /* 620 */ 2219, 2279, 2220, 2281, 2223, 2250, 2282, 2224, 2284, 2225, - /* 630 */ 2290, 2294, 2259, 2242, 2253, 2298, 2264, 2245, 2258, 2301, - /* 640 */ 2268, 2254, 2274, 2319, 2285, 2320, 2275, 2283, 2292, 2272, - /* 650 */ 2277, 2312, 2278, 2331, 2291, 2299, 2335, 2345, 2346, 2347, - /* 660 */ 2304, 2142, 2354, 2272, 2300, 2356, 2272, 2306, 2358, 2367, - /* 670 */ 2296, 2368, 2370, 2337, 2321, 2330, 2376, 2341, 2324, 2336, - /* 680 */ 2381, 2348, 2329, 2352, 2392, 2359, 2343, 2355, 2398, 2401, - /* 690 */ 2402, 2403, 2404, 2405, 2288, 2295, 2371, 2384, 2408, 2387, - /* 700 */ 2375, 2378, 2379, 2385, 2386, 2395, 2397, 2399, 2406, 2407, - /* 710 */ 2410, 2412, 2413, 2415, 2414, 2420, 2416, 2434, 2417, 2441, - /* 720 */ 2422, 2390, 2452, 2431, 2419, 2454, 2456, 2458, 2423, 2462, - /* 730 */ 2427, 2470, 2436, 2473, 2453, 2461, 2438, 2440, 2442, 2369, - /* 740 */ 2372, 2483, 2293, 2255, 2260, 2374, 2267, 2272, 2443, 2491, - /* 750 */ 2314, 2457, 2486, 2505, 2297, 2487, 2317, 2313, 2511, 2513, - /* 760 */ 2322, 2315, 2326, 2318, 2514, 2489, 2226, 2424, 2409, 2425, - /* 770 */ 2421, 2484, 2492, 2426, 2471, 2432, 2495, 2445, 2433, 2526, - /* 780 */ 2527, 2446, 2448, 2449, 2450, 2451, 2528, 2497, 2517, 2455, - /* 790 */ 2533, 2265, 2490, 2459, 2538, 2464, 2537, 2465, 2466, 2574, - /* 800 */ 2547, 2280, 2549, 2550, 2551, 2552, 2554, 2555, 2467, 2478, - /* 810 */ 2544, 2316, 2572, 2556, 2606, 2608, 2494, 2566, 2496, 2498, - /* 820 */ 2500, 2501, 2429, 2503, 2611, 2569, 2439, 2619, 2504, 2508, - /* 830 */ 2430, 2590, 2460, 2603, 2524, 2366, 2530, 2642, 2623, 2396, - /* 840 */ 2531, 2534, 2536, 2539, 2541, 2542, 2543, 2545, 2598, 2548, - /* 850 */ 2553, 2601, 2557, 2631, 2411, 2559, 2560, 2659, 2561, 2563, - /* 860 */ 2469, 2616, 2564, 2567, 2669, 2648, 2558, 2565, 2272, 2621, - /* 870 */ 2568, 2571, 2582, 2575, 2585, 2576, 2679, 2681, 2683, 2475, - /* 880 */ 2591, 2645, 2672, 2595, 2597, 2678, 2600, 2609, 2686, 2536, - /* 890 */ 2610, 2688, 2539, 2612, 2694, 2541, 2615, 2697, 2542, 2599, - /* 900 */ 2602, 2613, 2617, 2625, 2705, 2634, 2716, 2640, 2705, 2705, - /* 910 */ 2734, 2682, 2684, 2735, 2724, 2725, 2726, 2727, 2728, 2729, - /* 920 */ 2730, 2731, 2732, 2733, 2737, 2689, 2661, 2693, 2670, 2745, - /* 930 */ 2744, 2753, 2754, 2769, 2757, 2759, 2760, 2715, 2407, 2764, - /* 940 */ 2410, 2766, 2767, 2768, 2775, 2791, 2779, 2817, 2783, 2770, - /* 950 */ 2776, 2821, 2786, 2771, 2782, 2823, 2792, 2773, 2785, 2830, - /* 960 */ 2795, 2781, 2793, 2836, 2802, 2840, 2819, 2808, 2845, 2832, - /* 970 */ 2822, 2816, 2820, 2835, 2837, 2838, 2841, 2843, 2846, + /* 0 */ 1599, 271, 354, 271, 626, 626, 626, 626, 626, 626, + /* 10 */ 626, 626, 626, 626, 626, 626, 709, 1063, 1063, 1334, + /* 20 */ 0, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + /* 30 */ 1063, 980, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + /* 40 */ 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + /* 50 */ 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + /* 60 */ 1063, 93, 247, 253, 221, 219, 356, 219, 219, 221, + /* 70 */ 221, 219, 1820, 219, 1333, 1820, 381, 219, 4, 1949, + /* 80 */ 673, 673, 61, 61, 1949, 1949, 385, 385, 673, 325, + /* 90 */ 325, 447, 274, 274, 480, 300, 61, 61, 61, 61, + /* 100 */ 61, 61, 61, 61, 61, 61, 61, 167, 266, 275, + /* 110 */ 61, 61, 40, 4, 61, 167, 61, 4, 61, 61, + /* 120 */ 61, 61, 4, 61, 61, 61, 4, 61, 4, 4, + /* 130 */ 4, 749, 165, 165, 452, 452, 543, 762, 178, 48, + /* 140 */ 921, 921, 921, 921, 921, 921, 921, 921, 921, 921, + /* 150 */ 921, 921, 921, 921, 921, 921, 921, 921, 921, 520, + /* 160 */ 187, 325, 447, 1105, 1105, 477, 556, 556, 556, 716, + /* 170 */ 716, 850, 1115, 477, 40, 4, 73, 4, 4, 135, + /* 180 */ 4, 4, 406, 4, 406, 406, 483, 1045, 452, 452, + /* 190 */ 452, 452, 452, 452, 1354, 413, 21, 75, 414, 414, + /* 200 */ 822, 125, 456, 711, 670, 186, 207, 723, 922, 922, + /* 210 */ 1336, 730, 972, 972, 972, 1211, 972, 1157, 853, 726, + /* 220 */ 1344, 1379, 949, 823, 1294, 1294, 1311, 1384, 1384, 1355, + /* 230 */ 1456, 213, 1294, 1115, 1506, 1763, 1807, 1809, 1601, 40, + /* 240 */ 1809, 40, 1625, 1807, 1839, 1815, 1839, 1815, 1681, 1807, + /* 250 */ 1839, 1807, 1815, 1681, 1681, 1681, 1770, 1785, 1807, 1807, + /* 260 */ 1797, 1807, 1807, 1807, 1893, 1864, 1893, 1864, 1809, 40, + /* 270 */ 40, 1914, 40, 1916, 1921, 40, 1916, 40, 1935, 40, + /* 280 */ 1946, 40, 40, 1807, 40, 1893, 4, 4, 4, 4, + /* 290 */ 4, 4, 4, 4, 4, 4, 4, 1807, 1045, 1045, + /* 300 */ 1893, 406, 406, 406, 1739, 1867, 1809, 749, 1986, 1793, + /* 310 */ 1798, 1914, 749, 1506, 1807, 406, 1709, 1714, 1709, 1714, + /* 320 */ 1707, 1828, 1709, 1713, 1717, 1740, 1506, 1742, 1745, 1718, + /* 330 */ 1728, 1731, 1839, 2045, 1940, 1759, 1916, 749, 749, 1714, + /* 340 */ 406, 406, 406, 406, 1714, 406, 1892, 749, 406, 1946, + /* 350 */ 749, 1979, 406, 1909, 1946, 749, 483, 749, 1839, 406, + /* 360 */ 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + /* 370 */ 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + /* 380 */ 406, 2018, 406, 1807, 749, 2123, 2128, 2146, 2145, 1893, + /* 390 */ 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, 3956, + /* 400 */ 3956, 3956, 39, 1238, 204, 302, 310, 84, 904, 50, + /* 410 */ 197, 1175, 1197, 1258, 1134, 1212, 1353, 1366, 1463, 1558, + /* 420 */ 589, 1611, 1280, 1307, 1281, 1281, 1281, 1281, 1281, 1281, + /* 430 */ 1281, 1281, 1281, 100, 65, 500, 837, 3, 3, 653, + /* 440 */ 53, 387, 294, 284, 284, 604, 902, 284, 696, 920, + /* 450 */ 1328, 422, 47, 47, 1154, 1221, 817, 1154, 1154, 1154, + /* 460 */ 1465, 94, 511, 1488, 1496, 1358, 1480, 1513, 1414, 1419, + /* 470 */ 1421, 1433, 1481, 752, 1532, 954, 1518, 1533, 1547, 1324, + /* 480 */ 1220, 1459, 970, 1528, 1544, 1550, 1551, 1428, 1254, 1412, + /* 490 */ 1574, 1576, 1585, 1597, 1600, 1604, 1559, 1606, 1610, 1525, + /* 500 */ 1613, 1616, 1617, 1618, 1642, 1619, 1640, 1645, 1665, 1667, + /* 510 */ 1675, 1682, 1685, 1691, 1693, 1706, 1669, 1694, 1697, 1715, + /* 520 */ 1735, 1738, 1546, 1526, 1612, 1646, 1663, 1737, 1736, 1806, + /* 530 */ 2216, 2220, 2221, 2176, 2224, 2195, 1989, 2197, 2198, 2199, + /* 540 */ 1995, 2239, 2204, 2205, 1999, 2207, 2244, 2245, 2003, 2247, + /* 550 */ 2212, 2249, 2214, 2251, 2233, 2267, 2222, 2019, 2259, 2046, + /* 560 */ 2271, 2048, 2049, 2055, 2059, 2277, 2278, 2279, 2071, 2074, + /* 570 */ 2287, 2288, 2131, 2240, 2241, 2290, 2258, 2293, 2295, 2260, + /* 580 */ 2243, 2298, 2252, 2300, 2265, 2304, 2305, 2316, 2266, 2318, + /* 590 */ 2319, 2320, 2321, 2323, 2324, 2149, 2297, 2331, 2158, 2335, + /* 600 */ 2342, 2343, 2347, 2349, 2351, 2352, 2353, 2354, 2355, 2356, + /* 610 */ 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2374, 2376, 2315, + /* 620 */ 2367, 2322, 2368, 2370, 2371, 2372, 2377, 2378, 2379, 2380, + /* 630 */ 2381, 2365, 2382, 2225, 2384, 2228, 2386, 2232, 2389, 2390, + /* 640 */ 2369, 2340, 2373, 2385, 2406, 2339, 2411, 2345, 2383, 2415, + /* 650 */ 2350, 2417, 2357, 2422, 2424, 2397, 2387, 2394, 2426, 2403, + /* 660 */ 2388, 2396, 2444, 2409, 2392, 2405, 2447, 2414, 2451, 2407, + /* 670 */ 2408, 2420, 2404, 2419, 2442, 2423, 2458, 2430, 2418, 2471, + /* 680 */ 2484, 2485, 2486, 2434, 2272, 2480, 2404, 2431, 2481, 2404, + /* 690 */ 2436, 2488, 2489, 2421, 2493, 2494, 2459, 2445, 2452, 2498, + /* 700 */ 2464, 2448, 2457, 2503, 2468, 2453, 2467, 2519, 2487, 2470, + /* 710 */ 2482, 2525, 2528, 2529, 2530, 2531, 2532, 2410, 2416, 2497, + /* 720 */ 2515, 2540, 2520, 2505, 2507, 2508, 2509, 2510, 2512, 2513, + /* 730 */ 2517, 2518, 2514, 2524, 2523, 2533, 2538, 2537, 2551, 2539, + /* 740 */ 2568, 2553, 2576, 2555, 2522, 2579, 2558, 2546, 2584, 2585, + /* 750 */ 2587, 2552, 2589, 2565, 2602, 2567, 2610, 2592, 2591, 2580, + /* 760 */ 2582, 2588, 2504, 2506, 2623, 2440, 2413, 2412, 2521, 2425, + /* 770 */ 2404, 2593, 2638, 2446, 2611, 2624, 2649, 2432, 2628, 2460, + /* 780 */ 2455, 2655, 2656, 2465, 2454, 2466, 2461, 2659, 2630, 2375, + /* 790 */ 2554, 2550, 2556, 2557, 2631, 2632, 2559, 2618, 2562, 2620, + /* 800 */ 2569, 2560, 2645, 2648, 2566, 2570, 2571, 2577, 2574, 2650, + /* 810 */ 2633, 2642, 2594, 2661, 2398, 2626, 2586, 2673, 2596, 2676, + /* 820 */ 2597, 2599, 2711, 2683, 2433, 2681, 2682, 2684, 2685, 2686, + /* 830 */ 2687, 2603, 2609, 2677, 2441, 2697, 2691, 2738, 2743, 2629, + /* 840 */ 2702, 2634, 2635, 2641, 2643, 2561, 2651, 2747, 2704, 2549, + /* 850 */ 2753, 2657, 2660, 2578, 2721, 2581, 2739, 2658, 2495, 2664, + /* 860 */ 2776, 2758, 2535, 2667, 2668, 2669, 2670, 2665, 2675, 2674, + /* 870 */ 2678, 2679, 2688, 2689, 2690, 2741, 2692, 2693, 2744, 2695, + /* 880 */ 2774, 2542, 2694, 2698, 2799, 2696, 2700, 2604, 2757, 2703, + /* 890 */ 2705, 2802, 2795, 2701, 2706, 2404, 2769, 2709, 2710, 2712, + /* 900 */ 2714, 2715, 2713, 2804, 2805, 2809, 2606, 2716, 2801, 2810, + /* 910 */ 2732, 2735, 2817, 2740, 2742, 2818, 2674, 2746, 2820, 2678, + /* 920 */ 2749, 2821, 2679, 2759, 2823, 2688, 2723, 2726, 2737, 2745, + /* 930 */ 2763, 2846, 2765, 2848, 2771, 2846, 2846, 2865, 2812, 2814, + /* 940 */ 2868, 2855, 2856, 2857, 2858, 2859, 2860, 2862, 2866, 2875, + /* 950 */ 2879, 2880, 2819, 2794, 2835, 2811, 2885, 2883, 2886, 2887, + /* 960 */ 2899, 2888, 2889, 2891, 2847, 2514, 2895, 2524, 2896, 2898, + /* 970 */ 2908, 2911, 2913, 2912, 2936, 2914, 2897, 2905, 2952, 2917, + /* 980 */ 2901, 2910, 2956, 2921, 2904, 2916, 2962, 2928, 2915, 2922, + /* 990 */ 2965, 2931, 2968, 2948, 2935, 2972, 2953, 2941, 2943, 2951, + /* 1000 */ 2955, 2969, 2970, 2971, 2973, 2975, }; -#define YY_REDUCE_COUNT (390) -#define YY_REDUCE_MIN (-503) -#define YY_REDUCE_MAX (2515) +#define YY_REDUCE_COUNT (401) +#define YY_REDUCE_MIN (-530) +#define YY_REDUCE_MAX (3444) static const short yy_reduce_ofst[] = { - /* 0 */ -239, -365, -325, -19, -202, 325, 366, 705, 810, 840, - /* 10 */ 960, 991, 1027, 1156, 1237, 1318, 1342, 1361, 1429, 1494, - /* 20 */ 1469, 1537, 1605, 1563, 1642, 1729, 1751, 1778, 1815, 1842, - /* 30 */ 1864, 1891, 1928, 1969, 2004, 2036, 2055, 2101, 2133, 2197, - /* 40 */ 2221, 2246, 2286, 2310, 2351, 2391, 2418, 2437, 2502, 2515, - /* 50 */ -310, -61, -464, -362, 865, 955, 1145, 1165, -297, -271, - /* 60 */ 1201, -412, -503, -384, -382, -82, 13, -393, -385, -436, - /* 70 */ -356, -210, -21, -389, -324, -388, -247, -439, -142, 115, - /* 80 */ 148, -198, -191, -359, 89, 173, 313, 345, 403, 409, - /* 90 */ 435, 433, 440, 454, 578, 492, -337, 387, -10, 445, - /* 100 */ 583, 472, 412, 601, 393, 614, 15, 653, 675, 794, - /* 110 */ 837, 349, 844, 851, 874, 31, 877, 111, 375, 365, - /* 120 */ 565, -501, -501, -66, -111, -223, 595, -100, 120, -231, - /* 130 */ -3, 548, 753, 814, 817, 834, 836, 839, 843, 861, - /* 140 */ 881, 904, 916, 932, 937, 948, 949, 974, -405, 530, - /* 150 */ 87, 372, 704, 741, 869, 530, 806, 876, 434, 499, - /* 160 */ 673, -224, 884, 228, 64, 893, -195, 547, 644, 863, - /* 170 */ 718, 939, 871, 941, 943, -48, 919, -425, -411, 935, - /* 180 */ 999, 1009, 1040, 1007, 1093, 1134, 1075, 1012, 1012, 993, - /* 190 */ 1008, 1032, 1033, 1236, 1012, 1212, 1212, 1226, 1238, 1245, - /* 200 */ 1195, 1105, 1115, 1116, 1197, 1117, 1212, 1211, 1268, 1182, - /* 210 */ 1276, 1233, 1203, 1229, 1231, 1212, 1147, 1151, 1136, 1173, - /* 220 */ 1158, 1234, 1281, 1242, 1219, 1321, 1247, 1240, 1317, 1252, - /* 230 */ 1337, 1274, 1352, 1359, 1308, 1364, 1312, 1316, 1370, 1372, - /* 240 */ 1371, 1319, 1323, 1324, 1326, 1368, 1373, 1384, 1386, 1381, - /* 250 */ 1393, 1394, 1395, 1405, 1406, 1407, 1408, 1315, 1392, 1399, - /* 260 */ 1356, 1415, 1410, 1343, 1417, 1414, 1419, 1374, 1420, 1375, - /* 270 */ 1424, 1443, 1441, 1444, 1447, 1426, 1428, 1437, 1439, 1442, - /* 280 */ 1446, 1448, 1451, 1452, 1453, 1454, 1460, 1482, 1484, 1481, - /* 290 */ 1445, 1455, 1456, 1398, 1411, 1409, 1480, 1413, 1422, 1427, - /* 300 */ 1457, 1491, 1421, 1500, 1465, 1377, 1461, 1378, 1462, 1367, - /* 310 */ 1382, 1379, 1396, 1412, 1400, 1470, 1416, 1423, 1383, 1391, - /* 320 */ 1459, 1550, 1467, 1438, 1483, 1555, 1551, 1552, 1495, 1514, - /* 330 */ 1517, 1522, 1532, 1511, 1533, 1518, 1575, 1540, 1525, 1585, - /* 340 */ 1485, 1557, 1545, 1553, 1608, 1584, 1609, 1618, 1576, 1578, - /* 350 */ 1580, 1581, 1583, 1588, 1599, 1600, 1601, 1602, 1611, 1614, - /* 360 */ 1616, 1625, 1627, 1628, 1630, 1631, 1633, 1634, 1635, 1638, - /* 370 */ 1596, 1640, 1621, 1629, 1644, 1658, 1660, 1661, 1668, 1582, - /* 380 */ 1646, 1593, 1597, 1620, 1622, 1669, 1670, 1659, 1671, 1675, - /* 390 */ 1685, + /* 0 */ -142, -347, -206, 607, 1233, 1259, 1371, 1417, 1447, 1498, + /* 10 */ 292, 1607, 1637, 1671, 1758, 1804, -101, 656, 1834, 1898, + /* 20 */ 257, 1925, 1962, 2011, 2060, 2088, 2124, 2193, 2229, 2257, + /* 30 */ 2338, 2102, 2366, 2402, 2435, 2478, 2511, 2575, 2598, 2644, + /* 40 */ 2666, 2680, 2756, 2791, 2824, 2867, 2900, 2964, 2987, 3033, + /* 50 */ 3055, 3069, 3145, 3180, 3213, 3256, 3289, 3353, 3376, 3422, + /* 60 */ 3444, -342, 504, 467, -88, 315, 391, 1155, 1185, 172, + /* 70 */ 255, 1222, 67, -530, -74, 308, -528, -203, 312, -273, + /* 80 */ -427, -120, -31, 371, -274, -70, -396, -394, 179, -402, + /* 90 */ -392, -19, -29, 535, -249, 317, 410, 528, 634, 647, + /* 100 */ -348, 355, 650, 665, 668, 671, 373, -374, 155, -293, + /* 110 */ 623, 675, 470, 490, 678, -20, 713, 566, 719, 777, + /* 120 */ 866, 896, 377, 908, 974, 981, 687, 988, 63, 753, + /* 130 */ 517, 407, -370, -370, 105, -424, 482, 81, -139, 272, + /* 140 */ 303, 344, 571, 616, 643, 738, 829, 830, 860, 950, + /* 150 */ 961, 1012, 1013, 1026, 1033, 1035, 1075, 1076, 1082, 142, + /* 160 */ 127, 277, 591, 787, 793, 813, 127, 557, 595, 767, + /* 170 */ 768, 783, -407, 1018, 836, 211, 619, 513, 631, 795, + /* 180 */ 712, 1000, 991, 1016, 1037, 1083, 807, 1059, 743, 769, + /* 190 */ 867, 1008, 1131, 1149, 1109, 1208, 1244, 1194, 1123, 1123, + /* 200 */ 1108, 1132, 1142, 1167, 1302, 1123, 1278, 1278, 1305, 1306, + /* 210 */ 1320, 1326, 1214, 1227, 1234, 1315, 1236, 1278, 1330, 1385, + /* 220 */ 1296, 1390, 1347, 1314, 1337, 1338, 1278, 1262, 1263, 1243, + /* 230 */ 1272, 1274, 1342, 1394, 1348, 1327, 1426, 1350, 1346, 1429, + /* 240 */ 1357, 1442, 1378, 1455, 1457, 1406, 1467, 1411, 1418, 1478, + /* 250 */ 1482, 1489, 1427, 1436, 1438, 1444, 1484, 1486, 1502, 1503, + /* 260 */ 1495, 1507, 1508, 1509, 1519, 1527, 1522, 1530, 1432, 1514, + /* 270 */ 1520, 1487, 1536, 1534, 1468, 1545, 1539, 1548, 1493, 1553, + /* 280 */ 1511, 1556, 1557, 1571, 1563, 1580, 1549, 1552, 1554, 1560, + /* 290 */ 1562, 1565, 1566, 1567, 1575, 1579, 1581, 1577, 1586, 1587, + /* 300 */ 1588, 1540, 1541, 1542, 1490, 1524, 1505, 1609, 1537, 1543, + /* 310 */ 1555, 1573, 1615, 1568, 1626, 1582, 1483, 1564, 1499, 1578, + /* 320 */ 1485, 1494, 1501, 1504, 1510, 1515, 1589, 1516, 1521, 1497, + /* 330 */ 1517, 1512, 1659, 1569, 1535, 1529, 1674, 1666, 1670, 1614, + /* 340 */ 1632, 1633, 1635, 1636, 1620, 1638, 1627, 1684, 1647, 1643, + /* 350 */ 1698, 1594, 1658, 1654, 1661, 1711, 1696, 1719, 1723, 1679, + /* 360 */ 1683, 1686, 1688, 1689, 1690, 1701, 1702, 1703, 1704, 1708, + /* 370 */ 1710, 1716, 1720, 1722, 1724, 1732, 1743, 1747, 1748, 1749, + /* 380 */ 1750, 1725, 1754, 1752, 1762, 1767, 1786, 1790, 1791, 1808, + /* 390 */ 1726, 1771, 1692, 1727, 1741, 1744, 1784, 1787, 1777, 1792, + /* 400 */ 1778, 1829, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 10 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 20 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 30 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 40 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 50 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 60 */ 2578, 2203, 2203, 2534, 2203, 2203, 2203, 2203, 2203, 2203, - /* 70 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2541, 2541, - /* 80 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 90 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 100 */ 2203, 2309, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 110 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 120 */ 2307, 2830, 2203, 2956, 2619, 2203, 2203, 2859, 2203, 2203, - /* 130 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 140 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2842, - /* 150 */ 2203, 2203, 2280, 2280, 2203, 2842, 2842, 2842, 2802, 2802, - /* 160 */ 2307, 2203, 2203, 2309, 2203, 2621, 2203, 2203, 2203, 2203, - /* 170 */ 2203, 2203, 2203, 2203, 2203, 2450, 2233, 2203, 2203, 2203, - /* 180 */ 2203, 2203, 2203, 2604, 2203, 2203, 2888, 2834, 2835, 2950, - /* 190 */ 2203, 2891, 2853, 2203, 2848, 2203, 2203, 2203, 2203, 2203, - /* 200 */ 2878, 2203, 2203, 2203, 2203, 2203, 2203, 2546, 2203, 2647, - /* 210 */ 2203, 2395, 2598, 2203, 2203, 2203, 2203, 2203, 2934, 2832, - /* 220 */ 2872, 2203, 2203, 2882, 2203, 2203, 2203, 2635, 2309, 2203, - /* 230 */ 2309, 2591, 2529, 2203, 2539, 2203, 2539, 2536, 2203, 2203, - /* 240 */ 2203, 2539, 2536, 2536, 2536, 2383, 2379, 2203, 2203, 2377, - /* 250 */ 2203, 2203, 2203, 2203, 2263, 2203, 2263, 2203, 2309, 2309, - /* 260 */ 2203, 2309, 2203, 2203, 2309, 2203, 2309, 2203, 2309, 2203, - /* 270 */ 2309, 2309, 2203, 2309, 2203, 2203, 2203, 2203, 2203, 2203, - /* 280 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 290 */ 2203, 2203, 2203, 2633, 2614, 2203, 2307, 2203, 2602, 2600, - /* 300 */ 2203, 2307, 2882, 2203, 2203, 2904, 2899, 2904, 2899, 2918, - /* 310 */ 2914, 2904, 2923, 2920, 2884, 2882, 2865, 2861, 2953, 2940, - /* 320 */ 2936, 2203, 2203, 2870, 2868, 2203, 2307, 2307, 2899, 2203, - /* 330 */ 2203, 2203, 2203, 2899, 2203, 2203, 2307, 2203, 2203, 2307, - /* 340 */ 2203, 2203, 2203, 2203, 2307, 2203, 2307, 2203, 2203, 2203, - /* 350 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 360 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 370 */ 2412, 2203, 2203, 2307, 2203, 2235, 2237, 2247, 2203, 2593, - /* 380 */ 2956, 2619, 2624, 2574, 2574, 2453, 2453, 2956, 2453, 2310, - /* 390 */ 2208, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 400 */ 2203, 2203, 2203, 2917, 2916, 2753, 2203, 2806, 2805, 2804, - /* 410 */ 2795, 2752, 2408, 2203, 2203, 2203, 2751, 2750, 2203, 2203, - /* 420 */ 2203, 2203, 2399, 2396, 2203, 2203, 2421, 2203, 2203, 2203, - /* 430 */ 2203, 2565, 2564, 2744, 2203, 2203, 2745, 2743, 2742, 2203, - /* 440 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 450 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 460 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2937, 2941, 2203, - /* 470 */ 2203, 2203, 2831, 2203, 2203, 2203, 2723, 2203, 2203, 2203, - /* 480 */ 2203, 2203, 2691, 2686, 2677, 2668, 2683, 2674, 2662, 2680, - /* 490 */ 2671, 2659, 2656, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 500 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 510 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 520 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 530 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 540 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2535, - /* 550 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 560 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 570 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 580 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 590 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 600 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 610 */ 2203, 2203, 2203, 2203, 2550, 2203, 2203, 2203, 2203, 2203, - /* 620 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 630 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 640 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2252, 2730, - /* 650 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 660 */ 2203, 2203, 2203, 2733, 2203, 2203, 2734, 2203, 2203, 2203, - /* 670 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 680 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 690 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 700 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2354, - /* 710 */ 2353, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 720 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 730 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2735, - /* 740 */ 2203, 2203, 2203, 2203, 2618, 2203, 2203, 2725, 2203, 2203, - /* 750 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 760 */ 2203, 2203, 2203, 2203, 2933, 2885, 2203, 2203, 2203, 2203, - /* 770 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 780 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2723, 2203, - /* 790 */ 2915, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2931, 2203, - /* 800 */ 2935, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2841, 2837, - /* 810 */ 2203, 2203, 2833, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 820 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 830 */ 2203, 2203, 2203, 2792, 2203, 2203, 2203, 2826, 2203, 2203, - /* 840 */ 2203, 2203, 2449, 2448, 2447, 2446, 2203, 2203, 2203, 2203, - /* 850 */ 2203, 2203, 2735, 2203, 2738, 2203, 2203, 2203, 2203, 2203, - /* 860 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2722, 2203, - /* 870 */ 2777, 2776, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 880 */ 2203, 2203, 2203, 2443, 2203, 2203, 2203, 2203, 2203, 2203, - /* 890 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2427, - /* 900 */ 2425, 2424, 2423, 2203, 2460, 2203, 2203, 2203, 2456, 2455, - /* 910 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 920 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2328, - /* 930 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2320, 2203, - /* 940 */ 2319, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 950 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 960 */ 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, - /* 970 */ 2232, 2203, 2203, 2203, 2203, 2203, 2203, 2203, 2203, + /* 0 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 10 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 20 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 30 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 40 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 50 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 60 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 70 */ 2260, 2635, 2260, 2260, 2591, 2260, 2260, 2260, 2260, 2260, + /* 80 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2598, + /* 90 */ 2598, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 100 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 110 */ 2260, 2260, 2366, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 120 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 130 */ 2260, 2364, 2902, 2260, 3028, 2676, 2260, 2260, 2931, 2260, + /* 140 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 150 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 160 */ 2914, 2260, 2260, 2337, 2337, 2260, 2914, 2914, 2914, 2874, + /* 170 */ 2874, 2364, 2260, 2260, 2366, 2260, 2678, 2260, 2260, 2260, + /* 180 */ 2260, 2260, 2260, 2260, 2260, 2260, 2507, 2290, 2260, 2260, + /* 190 */ 2260, 2260, 2260, 2260, 2661, 2260, 2260, 2960, 2906, 2907, + /* 200 */ 3022, 2260, 2963, 2925, 2260, 2920, 2260, 2260, 2260, 2260, + /* 210 */ 2260, 2950, 2260, 2260, 2260, 2260, 2260, 2260, 2603, 2260, + /* 220 */ 2704, 2260, 2452, 2655, 2260, 2260, 2260, 2260, 2260, 3006, + /* 230 */ 2904, 2944, 2260, 2260, 2954, 2260, 2260, 2260, 2692, 2366, + /* 240 */ 2260, 2366, 2648, 2586, 2260, 2596, 2260, 2596, 2593, 2260, + /* 250 */ 2260, 2260, 2596, 2593, 2593, 2593, 2440, 2436, 2260, 2260, + /* 260 */ 2434, 2260, 2260, 2260, 2260, 2320, 2260, 2320, 2260, 2366, + /* 270 */ 2366, 2260, 2366, 2260, 2260, 2366, 2260, 2366, 2260, 2366, + /* 280 */ 2260, 2366, 2366, 2260, 2366, 2260, 2260, 2260, 2260, 2260, + /* 290 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 300 */ 2260, 2260, 2260, 2260, 2690, 2671, 2260, 2364, 2260, 2659, + /* 310 */ 2657, 2260, 2364, 2954, 2260, 2260, 2976, 2971, 2976, 2971, + /* 320 */ 2990, 2986, 2976, 2995, 2992, 2956, 2954, 2937, 2933, 3025, + /* 330 */ 3012, 3008, 2260, 2260, 2942, 2940, 2260, 2364, 2364, 2971, + /* 340 */ 2260, 2260, 2260, 2260, 2971, 2260, 2260, 2364, 2260, 2260, + /* 350 */ 2364, 2260, 2260, 2260, 2260, 2364, 2260, 2364, 2260, 2260, + /* 360 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 370 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 380 */ 2260, 2469, 2260, 2260, 2364, 2260, 2292, 2294, 2304, 2260, + /* 390 */ 2650, 3028, 2676, 2681, 2631, 2631, 2510, 2510, 3028, 2510, + /* 400 */ 2367, 2265, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 410 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2809, 2260, 2260, + /* 420 */ 2260, 2260, 2260, 2260, 2989, 2988, 2810, 2260, 2878, 2877, + /* 430 */ 2876, 2867, 2809, 2465, 2260, 2260, 2260, 2808, 2807, 2260, + /* 440 */ 2260, 2260, 2260, 2456, 2453, 2260, 2260, 2478, 2260, 2260, + /* 450 */ 2260, 2260, 2622, 2621, 2801, 2260, 2260, 2802, 2800, 2799, + /* 460 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 470 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 480 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 3009, 3013, + /* 490 */ 2260, 2260, 2260, 2260, 2903, 2260, 2260, 2260, 2260, 2780, + /* 500 */ 2260, 2260, 2260, 2260, 2260, 2748, 2743, 2734, 2725, 2740, + /* 510 */ 2731, 2719, 2737, 2728, 2716, 2713, 2260, 2260, 2260, 2260, + /* 520 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 530 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 540 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 550 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 560 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 570 */ 2260, 2260, 2592, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 580 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 590 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 600 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 610 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 620 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 630 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2607, 2260, 2260, + /* 640 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 650 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 660 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 670 */ 2260, 2309, 2787, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 680 */ 2260, 2260, 2260, 2260, 2260, 2260, 2790, 2260, 2260, 2791, + /* 690 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 700 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 710 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 720 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 730 */ 2260, 2260, 2411, 2410, 2260, 2260, 2260, 2260, 2260, 2260, + /* 740 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 750 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 760 */ 2260, 2260, 2792, 2260, 2260, 2260, 2260, 2675, 2260, 2260, + /* 770 */ 2782, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 780 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 3005, 2957, 2260, + /* 790 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 800 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 810 */ 2260, 2780, 2260, 2987, 2260, 2260, 2260, 2260, 2260, 2260, + /* 820 */ 2260, 3003, 2260, 3007, 2260, 2260, 2260, 2260, 2260, 2260, + /* 830 */ 2260, 2913, 2909, 2260, 2260, 2905, 2260, 2260, 2260, 2260, + /* 840 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 850 */ 2260, 2260, 2260, 2260, 2260, 2260, 2864, 2260, 2260, 2260, + /* 860 */ 2898, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2506, + /* 870 */ 2505, 2504, 2503, 2260, 2260, 2260, 2260, 2260, 2260, 2792, + /* 880 */ 2260, 2795, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 890 */ 2260, 2260, 2260, 2260, 2260, 2779, 2260, 2843, 2842, 2260, + /* 900 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 910 */ 2500, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 920 */ 2260, 2260, 2260, 2260, 2260, 2260, 2484, 2482, 2481, 2480, + /* 930 */ 2260, 2517, 2260, 2260, 2260, 2513, 2512, 2260, 2260, 2260, + /* 940 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 950 */ 2260, 2260, 2260, 2260, 2260, 2260, 2385, 2260, 2260, 2260, + /* 960 */ 2260, 2260, 2260, 2260, 2260, 2377, 2260, 2376, 2260, 2260, + /* 970 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 980 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2260, + /* 990 */ 2260, 2260, 2260, 2260, 2260, 2260, 2260, 2289, 2260, 2260, + /* 1000 */ 2260, 2260, 2260, 2260, 2260, 2260, }; /********** End of lemon-generated parsing tables *****************************/ -/* The next table maps tokens (terminal symbols) into fallback tokens. +/* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: -** +** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, @@ -1626,12 +1854,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 328, /* END => ABORT */ + 336, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ 0, /* USING => nothing */ - 328, /* FILE => ABORT */ + 336, /* FILE => ABORT */ 0, /* STABLE => nothing */ 0, /* COLUMN => nothing */ 0, /* MODIFY => nothing */ @@ -1699,7 +1927,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 328, /* VIEW => ABORT */ + 336, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1742,7 +1970,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* PAUSE => nothing */ 0, /* RESUME => nothing */ 0, /* PRIMARY => nothing */ - 328, /* KEY => ABORT */ + 336, /* KEY => ABORT */ 0, /* TRIGGER => nothing */ 0, /* AT_ONCE => nothing */ 0, /* WINDOW_CLOSE => nothing */ @@ -1779,13 +2007,22 @@ static const YYCODETYPE yyFallback[] = { 0, /* IROWTS => nothing */ 0, /* ISFILLED => nothing */ 0, /* CAST => nothing */ + 0, /* POSITION => nothing */ + 0, /* IN => nothing */ + 336, /* FOR => ABORT */ 0, /* NOW => nothing */ 0, /* TODAY => nothing */ + 0, /* SUBSTR => nothing */ + 0, /* SUBSTRING => nothing */ + 0, /* BOTH => nothing */ + 0, /* TRAILING => nothing */ + 0, /* LEADING => nothing */ 0, /* TIMEZONE => nothing */ 0, /* CLIENT_VERSION => nothing */ 0, /* SERVER_VERSION => nothing */ 0, /* SERVER_STATUS => nothing */ 0, /* CURRENT_USER => nothing */ + 0, /* PI => nothing */ 0, /* CASE => nothing */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ @@ -1800,13 +2037,12 @@ static const YYCODETYPE yyFallback[] = { 0, /* MATCH => nothing */ 0, /* NMATCH => nothing */ 0, /* CONTAINS => nothing */ - 0, /* IN => nothing */ 0, /* JOIN => nothing */ 0, /* INNER => nothing */ 0, /* LEFT => nothing */ 0, /* RIGHT => nothing */ 0, /* OUTER => nothing */ - 328, /* SEMI => ABORT */ + 336, /* SEMI => ABORT */ 0, /* ANTI => nothing */ 0, /* ASOF => nothing */ 0, /* WINDOW => nothing */ @@ -1842,52 +2078,51 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 328, /* AFTER => ABORT */ - 328, /* ATTACH => ABORT */ - 328, /* BEFORE => ABORT */ - 328, /* BEGIN => ABORT */ - 328, /* BITAND => ABORT */ - 328, /* BITNOT => ABORT */ - 328, /* BITOR => ABORT */ - 328, /* BLOCKS => ABORT */ - 328, /* CHANGE => ABORT */ - 328, /* COMMA => ABORT */ - 328, /* CONCAT => ABORT */ - 328, /* CONFLICT => ABORT */ - 328, /* COPY => ABORT */ - 328, /* DEFERRED => ABORT */ - 328, /* DELIMITERS => ABORT */ - 328, /* DETACH => ABORT */ - 328, /* DIVIDE => ABORT */ - 328, /* DOT => ABORT */ - 328, /* EACH => ABORT */ - 328, /* FAIL => ABORT */ - 328, /* FOR => ABORT */ - 328, /* GLOB => ABORT */ - 328, /* ID => ABORT */ - 328, /* IMMEDIATE => ABORT */ - 328, /* IMPORT => ABORT */ - 328, /* INITIALLY => ABORT */ - 328, /* INSTEAD => ABORT */ - 328, /* ISNULL => ABORT */ - 328, /* MODULES => ABORT */ - 328, /* NK_BITNOT => ABORT */ - 328, /* NK_SEMI => ABORT */ - 328, /* NOTNULL => ABORT */ - 328, /* OF => ABORT */ - 328, /* PLUS => ABORT */ - 328, /* PRIVILEGE => ABORT */ - 328, /* RAISE => ABORT */ - 328, /* RESTRICT => ABORT */ - 328, /* ROW => ABORT */ - 328, /* STAR => ABORT */ - 328, /* STATEMENT => ABORT */ - 328, /* STRICT => ABORT */ - 328, /* STRING => ABORT */ - 328, /* TIMES => ABORT */ - 328, /* VALUES => ABORT */ - 328, /* VARIABLE => ABORT */ - 328, /* WAL => ABORT */ + 336, /* AFTER => ABORT */ + 336, /* ATTACH => ABORT */ + 336, /* BEFORE => ABORT */ + 336, /* BEGIN => ABORT */ + 336, /* BITAND => ABORT */ + 336, /* BITNOT => ABORT */ + 336, /* BITOR => ABORT */ + 336, /* BLOCKS => ABORT */ + 336, /* CHANGE => ABORT */ + 336, /* COMMA => ABORT */ + 336, /* CONCAT => ABORT */ + 336, /* CONFLICT => ABORT */ + 336, /* COPY => ABORT */ + 336, /* DEFERRED => ABORT */ + 336, /* DELIMITERS => ABORT */ + 336, /* DETACH => ABORT */ + 336, /* DIVIDE => ABORT */ + 336, /* DOT => ABORT */ + 336, /* EACH => ABORT */ + 336, /* FAIL => ABORT */ + 336, /* GLOB => ABORT */ + 336, /* ID => ABORT */ + 336, /* IMMEDIATE => ABORT */ + 336, /* IMPORT => ABORT */ + 336, /* INITIALLY => ABORT */ + 336, /* INSTEAD => ABORT */ + 336, /* ISNULL => ABORT */ + 336, /* MODULES => ABORT */ + 336, /* NK_BITNOT => ABORT */ + 336, /* NK_SEMI => ABORT */ + 336, /* NOTNULL => ABORT */ + 336, /* OF => ABORT */ + 336, /* PLUS => ABORT */ + 336, /* PRIVILEGE => ABORT */ + 336, /* RAISE => ABORT */ + 336, /* RESTRICT => ABORT */ + 336, /* ROW => ABORT */ + 336, /* STAR => ABORT */ + 336, /* STATEMENT => ABORT */ + 336, /* STRICT => ABORT */ + 336, /* STRING => ABORT */ + 336, /* TIMES => ABORT */ + 336, /* VALUES => ABORT */ + 336, /* VARIABLE => ABORT */ + 336, /* WAL => ABORT */ 0, /* ENCODE => nothing */ 0, /* COMPRESS => nothing */ 0, /* LEVEL => nothing */ @@ -1930,15 +2165,10 @@ struct yyParser { int yyerrcnt; /* Shifts left before out of the error */ #endif ParseARG_SDECL /* A place to hold %extra_argument */ - ParseCTX_SDECL /* A place to hold %extra_context */ -#if YYSTACKDEPTH<=0 - int yystksz; /* Current side of the stack */ - yyStackEntry *yystack; /* The parser's stack */ - yyStackEntry yystk0; /* First stack entry */ -#else - yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ - yyStackEntry *yystackEnd; /* Last entry in the stack */ -#endif + ParseCTX_SDECL /* A place to hold %extra_context */ + yyStackEntry *yystackEnd; /* Last entry in the stack */ + yyStackEntry *yystack; /* The parser stack */ + yyStackEntry yystk0[YYSTACKDEPTH]; /* Initial stack space */ }; typedef struct yyParser yyParser; @@ -1950,10 +2180,10 @@ static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: **
    @@ -1978,1362 +2208,1394 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ #if defined(YYCOVERAGE) || !defined(NDEBUG) /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { - /* 0 */ "$", - /* 1 */ "OR", - /* 2 */ "AND", - /* 3 */ "UNION", - /* 4 */ "ALL", - /* 5 */ "MINUS", - /* 6 */ "EXCEPT", - /* 7 */ "INTERSECT", - /* 8 */ "NK_BITAND", - /* 9 */ "NK_BITOR", - /* 10 */ "NK_LSHIFT", - /* 11 */ "NK_RSHIFT", - /* 12 */ "NK_PLUS", - /* 13 */ "NK_MINUS", - /* 14 */ "NK_STAR", - /* 15 */ "NK_SLASH", - /* 16 */ "NK_REM", - /* 17 */ "NK_CONCAT", - /* 18 */ "CREATE", - /* 19 */ "ACCOUNT", - /* 20 */ "NK_ID", - /* 21 */ "PASS", - /* 22 */ "NK_STRING", - /* 23 */ "ALTER", - /* 24 */ "PPS", - /* 25 */ "TSERIES", - /* 26 */ "STORAGE", - /* 27 */ "STREAMS", - /* 28 */ "QTIME", - /* 29 */ "DBS", - /* 30 */ "USERS", - /* 31 */ "CONNS", - /* 32 */ "STATE", - /* 33 */ "NK_COMMA", - /* 34 */ "HOST", - /* 35 */ "IS_IMPORT", - /* 36 */ "NK_INTEGER", - /* 37 */ "CREATEDB", - /* 38 */ "USER", - /* 39 */ "ENABLE", - /* 40 */ "SYSINFO", - /* 41 */ "ADD", - /* 42 */ "DROP", - /* 43 */ "GRANT", - /* 44 */ "ON", - /* 45 */ "TO", - /* 46 */ "REVOKE", - /* 47 */ "FROM", - /* 48 */ "SUBSCRIBE", - /* 49 */ "READ", - /* 50 */ "WRITE", - /* 51 */ "NK_DOT", - /* 52 */ "WITH", - /* 53 */ "ENCRYPT_KEY", - /* 54 */ "DNODE", - /* 55 */ "PORT", - /* 56 */ "DNODES", - /* 57 */ "RESTORE", - /* 58 */ "NK_IPTOKEN", - /* 59 */ "FORCE", - /* 60 */ "UNSAFE", - /* 61 */ "CLUSTER", - /* 62 */ "LOCAL", - /* 63 */ "QNODE", - /* 64 */ "BNODE", - /* 65 */ "SNODE", - /* 66 */ "MNODE", - /* 67 */ "VNODE", - /* 68 */ "DATABASE", - /* 69 */ "USE", - /* 70 */ "FLUSH", - /* 71 */ "TRIM", - /* 72 */ "S3MIGRATE", - /* 73 */ "COMPACT", - /* 74 */ "IF", - /* 75 */ "NOT", - /* 76 */ "EXISTS", - /* 77 */ "BUFFER", - /* 78 */ "CACHEMODEL", - /* 79 */ "CACHESIZE", - /* 80 */ "COMP", - /* 81 */ "DURATION", - /* 82 */ "NK_VARIABLE", - /* 83 */ "MAXROWS", - /* 84 */ "MINROWS", - /* 85 */ "KEEP", - /* 86 */ "PAGES", - /* 87 */ "PAGESIZE", - /* 88 */ "TSDB_PAGESIZE", - /* 89 */ "PRECISION", - /* 90 */ "REPLICA", - /* 91 */ "VGROUPS", - /* 92 */ "SINGLE_STABLE", - /* 93 */ "RETENTIONS", - /* 94 */ "SCHEMALESS", - /* 95 */ "WAL_LEVEL", - /* 96 */ "WAL_FSYNC_PERIOD", - /* 97 */ "WAL_RETENTION_PERIOD", - /* 98 */ "WAL_RETENTION_SIZE", - /* 99 */ "WAL_ROLL_PERIOD", - /* 100 */ "WAL_SEGMENT_SIZE", - /* 101 */ "STT_TRIGGER", - /* 102 */ "TABLE_PREFIX", - /* 103 */ "TABLE_SUFFIX", - /* 104 */ "S3_CHUNKSIZE", - /* 105 */ "S3_KEEPLOCAL", - /* 106 */ "S3_COMPACT", - /* 107 */ "KEEP_TIME_OFFSET", - /* 108 */ "ENCRYPT_ALGORITHM", - /* 109 */ "NK_COLON", - /* 110 */ "BWLIMIT", - /* 111 */ "START", - /* 112 */ "TIMESTAMP", - /* 113 */ "END", - /* 114 */ "TABLE", - /* 115 */ "NK_LP", - /* 116 */ "NK_RP", - /* 117 */ "USING", - /* 118 */ "FILE", - /* 119 */ "STABLE", - /* 120 */ "COLUMN", - /* 121 */ "MODIFY", - /* 122 */ "RENAME", - /* 123 */ "TAG", - /* 124 */ "SET", - /* 125 */ "NK_EQ", - /* 126 */ "TAGS", - /* 127 */ "BOOL", - /* 128 */ "TINYINT", - /* 129 */ "SMALLINT", - /* 130 */ "INT", - /* 131 */ "INTEGER", - /* 132 */ "BIGINT", - /* 133 */ "FLOAT", - /* 134 */ "DOUBLE", - /* 135 */ "BINARY", - /* 136 */ "NCHAR", - /* 137 */ "UNSIGNED", - /* 138 */ "JSON", - /* 139 */ "VARCHAR", - /* 140 */ "MEDIUMBLOB", - /* 141 */ "BLOB", - /* 142 */ "VARBINARY", - /* 143 */ "GEOMETRY", - /* 144 */ "DECIMAL", - /* 145 */ "COMMENT", - /* 146 */ "MAX_DELAY", - /* 147 */ "WATERMARK", - /* 148 */ "ROLLUP", - /* 149 */ "TTL", - /* 150 */ "SMA", - /* 151 */ "DELETE_MARK", - /* 152 */ "FIRST", - /* 153 */ "LAST", - /* 154 */ "SHOW", - /* 155 */ "FULL", - /* 156 */ "PRIVILEGES", - /* 157 */ "DATABASES", - /* 158 */ "TABLES", - /* 159 */ "STABLES", - /* 160 */ "MNODES", - /* 161 */ "QNODES", - /* 162 */ "ARBGROUPS", - /* 163 */ "FUNCTIONS", - /* 164 */ "INDEXES", - /* 165 */ "ACCOUNTS", - /* 166 */ "APPS", - /* 167 */ "CONNECTIONS", - /* 168 */ "LICENCES", - /* 169 */ "GRANTS", - /* 170 */ "LOGS", - /* 171 */ "MACHINES", - /* 172 */ "ENCRYPTIONS", - /* 173 */ "QUERIES", - /* 174 */ "SCORES", - /* 175 */ "TOPICS", - /* 176 */ "VARIABLES", - /* 177 */ "BNODES", - /* 178 */ "SNODES", - /* 179 */ "TRANSACTIONS", - /* 180 */ "DISTRIBUTED", - /* 181 */ "CONSUMERS", - /* 182 */ "SUBSCRIPTIONS", - /* 183 */ "VNODES", - /* 184 */ "ALIVE", - /* 185 */ "VIEWS", - /* 186 */ "VIEW", - /* 187 */ "COMPACTS", - /* 188 */ "NORMAL", - /* 189 */ "CHILD", - /* 190 */ "LIKE", - /* 191 */ "TBNAME", - /* 192 */ "QTAGS", - /* 193 */ "AS", - /* 194 */ "SYSTEM", - /* 195 */ "TSMA", - /* 196 */ "INTERVAL", - /* 197 */ "RECURSIVE", - /* 198 */ "TSMAS", - /* 199 */ "FUNCTION", - /* 200 */ "INDEX", - /* 201 */ "COUNT", - /* 202 */ "LAST_ROW", - /* 203 */ "META", - /* 204 */ "ONLY", - /* 205 */ "TOPIC", - /* 206 */ "CONSUMER", - /* 207 */ "GROUP", - /* 208 */ "DESC", - /* 209 */ "DESCRIBE", - /* 210 */ "RESET", - /* 211 */ "QUERY", - /* 212 */ "CACHE", - /* 213 */ "EXPLAIN", - /* 214 */ "ANALYZE", - /* 215 */ "VERBOSE", - /* 216 */ "NK_BOOL", - /* 217 */ "RATIO", - /* 218 */ "NK_FLOAT", - /* 219 */ "OUTPUTTYPE", - /* 220 */ "AGGREGATE", - /* 221 */ "BUFSIZE", - /* 222 */ "LANGUAGE", - /* 223 */ "REPLACE", - /* 224 */ "STREAM", - /* 225 */ "INTO", - /* 226 */ "PAUSE", - /* 227 */ "RESUME", - /* 228 */ "PRIMARY", - /* 229 */ "KEY", - /* 230 */ "TRIGGER", - /* 231 */ "AT_ONCE", - /* 232 */ "WINDOW_CLOSE", - /* 233 */ "IGNORE", - /* 234 */ "EXPIRED", - /* 235 */ "FILL_HISTORY", - /* 236 */ "UPDATE", - /* 237 */ "SUBTABLE", - /* 238 */ "UNTREATED", - /* 239 */ "KILL", - /* 240 */ "CONNECTION", - /* 241 */ "TRANSACTION", - /* 242 */ "BALANCE", - /* 243 */ "VGROUP", - /* 244 */ "LEADER", - /* 245 */ "MERGE", - /* 246 */ "REDISTRIBUTE", - /* 247 */ "SPLIT", - /* 248 */ "DELETE", - /* 249 */ "INSERT", - /* 250 */ "NK_BIN", - /* 251 */ "NK_HEX", - /* 252 */ "NULL", - /* 253 */ "NK_QUESTION", - /* 254 */ "NK_ALIAS", - /* 255 */ "NK_ARROW", - /* 256 */ "ROWTS", - /* 257 */ "QSTART", - /* 258 */ "QEND", - /* 259 */ "QDURATION", - /* 260 */ "WSTART", - /* 261 */ "WEND", - /* 262 */ "WDURATION", - /* 263 */ "IROWTS", - /* 264 */ "ISFILLED", - /* 265 */ "CAST", - /* 266 */ "NOW", - /* 267 */ "TODAY", - /* 268 */ "TIMEZONE", - /* 269 */ "CLIENT_VERSION", - /* 270 */ "SERVER_VERSION", - /* 271 */ "SERVER_STATUS", - /* 272 */ "CURRENT_USER", - /* 273 */ "CASE", - /* 274 */ "WHEN", - /* 275 */ "THEN", - /* 276 */ "ELSE", - /* 277 */ "BETWEEN", - /* 278 */ "IS", - /* 279 */ "NK_LT", - /* 280 */ "NK_GT", - /* 281 */ "NK_LE", - /* 282 */ "NK_GE", - /* 283 */ "NK_NE", - /* 284 */ "MATCH", - /* 285 */ "NMATCH", - /* 286 */ "CONTAINS", - /* 287 */ "IN", - /* 288 */ "JOIN", - /* 289 */ "INNER", - /* 290 */ "LEFT", - /* 291 */ "RIGHT", - /* 292 */ "OUTER", - /* 293 */ "SEMI", - /* 294 */ "ANTI", - /* 295 */ "ASOF", - /* 296 */ "WINDOW", - /* 297 */ "WINDOW_OFFSET", - /* 298 */ "JLIMIT", - /* 299 */ "SELECT", - /* 300 */ "NK_HINT", - /* 301 */ "DISTINCT", - /* 302 */ "WHERE", - /* 303 */ "PARTITION", - /* 304 */ "BY", - /* 305 */ "SESSION", - /* 306 */ "STATE_WINDOW", - /* 307 */ "EVENT_WINDOW", - /* 308 */ "COUNT_WINDOW", - /* 309 */ "SLIDING", - /* 310 */ "FILL", - /* 311 */ "VALUE", - /* 312 */ "VALUE_F", - /* 313 */ "NONE", - /* 314 */ "PREV", - /* 315 */ "NULL_F", - /* 316 */ "LINEAR", - /* 317 */ "NEXT", - /* 318 */ "HAVING", - /* 319 */ "RANGE", - /* 320 */ "EVERY", - /* 321 */ "ORDER", - /* 322 */ "SLIMIT", - /* 323 */ "SOFFSET", - /* 324 */ "LIMIT", - /* 325 */ "OFFSET", - /* 326 */ "ASC", - /* 327 */ "NULLS", - /* 328 */ "ABORT", - /* 329 */ "AFTER", - /* 330 */ "ATTACH", - /* 331 */ "BEFORE", - /* 332 */ "BEGIN", - /* 333 */ "BITAND", - /* 334 */ "BITNOT", - /* 335 */ "BITOR", - /* 336 */ "BLOCKS", - /* 337 */ "CHANGE", - /* 338 */ "COMMA", - /* 339 */ "CONCAT", - /* 340 */ "CONFLICT", - /* 341 */ "COPY", - /* 342 */ "DEFERRED", - /* 343 */ "DELIMITERS", - /* 344 */ "DETACH", - /* 345 */ "DIVIDE", - /* 346 */ "DOT", - /* 347 */ "EACH", - /* 348 */ "FAIL", - /* 349 */ "FOR", - /* 350 */ "GLOB", - /* 351 */ "ID", - /* 352 */ "IMMEDIATE", - /* 353 */ "IMPORT", - /* 354 */ "INITIALLY", - /* 355 */ "INSTEAD", - /* 356 */ "ISNULL", - /* 357 */ "MODULES", - /* 358 */ "NK_BITNOT", - /* 359 */ "NK_SEMI", - /* 360 */ "NOTNULL", - /* 361 */ "OF", - /* 362 */ "PLUS", - /* 363 */ "PRIVILEGE", - /* 364 */ "RAISE", - /* 365 */ "RESTRICT", - /* 366 */ "ROW", - /* 367 */ "STAR", - /* 368 */ "STATEMENT", - /* 369 */ "STRICT", - /* 370 */ "STRING", - /* 371 */ "TIMES", - /* 372 */ "VALUES", - /* 373 */ "VARIABLE", - /* 374 */ "WAL", - /* 375 */ "ENCODE", - /* 376 */ "COMPRESS", - /* 377 */ "LEVEL", - /* 378 */ "cmd", - /* 379 */ "account_options", - /* 380 */ "alter_account_options", - /* 381 */ "literal", - /* 382 */ "alter_account_option", - /* 383 */ "ip_range_list", - /* 384 */ "white_list", - /* 385 */ "white_list_opt", - /* 386 */ "is_import_opt", - /* 387 */ "is_createdb_opt", - /* 388 */ "user_name", - /* 389 */ "sysinfo_opt", - /* 390 */ "privileges", - /* 391 */ "priv_level", - /* 392 */ "with_opt", - /* 393 */ "priv_type_list", - /* 394 */ "priv_type", - /* 395 */ "db_name", - /* 396 */ "table_name", - /* 397 */ "topic_name", - /* 398 */ "search_condition", - /* 399 */ "dnode_endpoint", - /* 400 */ "force_opt", - /* 401 */ "unsafe_opt", - /* 402 */ "not_exists_opt", - /* 403 */ "db_options", - /* 404 */ "exists_opt", - /* 405 */ "alter_db_options", - /* 406 */ "speed_opt", - /* 407 */ "start_opt", - /* 408 */ "end_opt", - /* 409 */ "integer_list", - /* 410 */ "variable_list", - /* 411 */ "retention_list", - /* 412 */ "signed", - /* 413 */ "alter_db_option", - /* 414 */ "retention", - /* 415 */ "full_table_name", - /* 416 */ "column_def_list", - /* 417 */ "tags_def_opt", - /* 418 */ "table_options", - /* 419 */ "multi_create_clause", - /* 420 */ "tag_list_opt", - /* 421 */ "tags_def", - /* 422 */ "multi_drop_clause", - /* 423 */ "alter_table_clause", - /* 424 */ "alter_table_options", - /* 425 */ "column_name", - /* 426 */ "type_name", - /* 427 */ "column_options", - /* 428 */ "tags_literal", - /* 429 */ "create_subtable_clause", - /* 430 */ "specific_cols_opt", - /* 431 */ "tags_literal_list", - /* 432 */ "drop_table_clause", - /* 433 */ "col_name_list", - /* 434 */ "tag_def_list", - /* 435 */ "tag_def", - /* 436 */ "column_def", - /* 437 */ "type_name_default_len", - /* 438 */ "duration_list", - /* 439 */ "rollup_func_list", - /* 440 */ "alter_table_option", - /* 441 */ "duration_literal", - /* 442 */ "rollup_func_name", - /* 443 */ "function_name", - /* 444 */ "col_name", - /* 445 */ "db_kind_opt", - /* 446 */ "table_kind_db_name_cond_opt", - /* 447 */ "like_pattern_opt", - /* 448 */ "db_name_cond_opt", - /* 449 */ "table_name_cond", - /* 450 */ "from_db_opt", - /* 451 */ "table_kind", - /* 452 */ "tag_item", - /* 453 */ "column_alias", - /* 454 */ "tsma_name", - /* 455 */ "tsma_func_list", - /* 456 */ "full_tsma_name", - /* 457 */ "func_list", - /* 458 */ "index_options", - /* 459 */ "full_index_name", - /* 460 */ "index_name", - /* 461 */ "sliding_opt", - /* 462 */ "sma_stream_opt", - /* 463 */ "func", - /* 464 */ "sma_func_name", - /* 465 */ "expression_list", - /* 466 */ "with_meta", - /* 467 */ "query_or_subquery", - /* 468 */ "where_clause_opt", - /* 469 */ "cgroup_name", - /* 470 */ "analyze_opt", - /* 471 */ "explain_options", - /* 472 */ "insert_query", - /* 473 */ "or_replace_opt", - /* 474 */ "agg_func_opt", - /* 475 */ "bufsize_opt", - /* 476 */ "language_opt", - /* 477 */ "full_view_name", - /* 478 */ "view_name", - /* 479 */ "stream_name", - /* 480 */ "stream_options", - /* 481 */ "col_list_opt", - /* 482 */ "tag_def_or_ref_opt", - /* 483 */ "subtable_opt", - /* 484 */ "ignore_opt", - /* 485 */ "column_stream_def_list", - /* 486 */ "column_stream_def", - /* 487 */ "stream_col_options", - /* 488 */ "expression", - /* 489 */ "on_vgroup_id", - /* 490 */ "dnode_list", - /* 491 */ "literal_func", - /* 492 */ "signed_literal", - /* 493 */ "literal_list", - /* 494 */ "table_alias", - /* 495 */ "expr_or_subquery", - /* 496 */ "pseudo_column", - /* 497 */ "column_reference", - /* 498 */ "function_expression", - /* 499 */ "case_when_expression", - /* 500 */ "star_func", - /* 501 */ "star_func_para_list", - /* 502 */ "noarg_func", - /* 503 */ "other_para_list", - /* 504 */ "star_func_para", - /* 505 */ "when_then_list", - /* 506 */ "case_when_else_opt", - /* 507 */ "common_expression", - /* 508 */ "when_then_expr", - /* 509 */ "predicate", - /* 510 */ "compare_op", - /* 511 */ "in_op", - /* 512 */ "in_predicate_value", - /* 513 */ "boolean_value_expression", - /* 514 */ "boolean_primary", - /* 515 */ "from_clause_opt", - /* 516 */ "table_reference_list", - /* 517 */ "table_reference", - /* 518 */ "table_primary", - /* 519 */ "joined_table", - /* 520 */ "alias_opt", - /* 521 */ "subquery", - /* 522 */ "parenthesized_joined_table", - /* 523 */ "join_type", - /* 524 */ "join_subtype", - /* 525 */ "join_on_clause_opt", - /* 526 */ "window_offset_clause_opt", - /* 527 */ "jlimit_clause_opt", - /* 528 */ "window_offset_literal", - /* 529 */ "query_specification", - /* 530 */ "hint_list", - /* 531 */ "set_quantifier_opt", - /* 532 */ "tag_mode_opt", - /* 533 */ "select_list", - /* 534 */ "partition_by_clause_opt", - /* 535 */ "range_opt", - /* 536 */ "every_opt", - /* 537 */ "fill_opt", - /* 538 */ "twindow_clause_opt", - /* 539 */ "group_by_clause_opt", - /* 540 */ "having_clause_opt", - /* 541 */ "select_item", - /* 542 */ "partition_list", - /* 543 */ "partition_item", - /* 544 */ "interval_sliding_duration_literal", - /* 545 */ "fill_mode", - /* 546 */ "group_by_list", - /* 547 */ "query_expression", - /* 548 */ "query_simple", - /* 549 */ "order_by_clause_opt", - /* 550 */ "slimit_clause_opt", - /* 551 */ "limit_clause_opt", - /* 552 */ "union_query_expression", - /* 553 */ "query_simple_or_subquery", - /* 554 */ "sort_specification_list", - /* 555 */ "sort_specification", - /* 556 */ "ordering_specification_opt", - /* 557 */ "null_ordering_opt", +static const char *const yyTokenName[] = { + /* 0 */ "$", + /* 1 */ "OR", + /* 2 */ "AND", + /* 3 */ "UNION", + /* 4 */ "ALL", + /* 5 */ "MINUS", + /* 6 */ "EXCEPT", + /* 7 */ "INTERSECT", + /* 8 */ "NK_BITAND", + /* 9 */ "NK_BITOR", + /* 10 */ "NK_LSHIFT", + /* 11 */ "NK_RSHIFT", + /* 12 */ "NK_PLUS", + /* 13 */ "NK_MINUS", + /* 14 */ "NK_STAR", + /* 15 */ "NK_SLASH", + /* 16 */ "NK_REM", + /* 17 */ "NK_CONCAT", + /* 18 */ "CREATE", + /* 19 */ "ACCOUNT", + /* 20 */ "NK_ID", + /* 21 */ "PASS", + /* 22 */ "NK_STRING", + /* 23 */ "ALTER", + /* 24 */ "PPS", + /* 25 */ "TSERIES", + /* 26 */ "STORAGE", + /* 27 */ "STREAMS", + /* 28 */ "QTIME", + /* 29 */ "DBS", + /* 30 */ "USERS", + /* 31 */ "CONNS", + /* 32 */ "STATE", + /* 33 */ "NK_COMMA", + /* 34 */ "HOST", + /* 35 */ "IS_IMPORT", + /* 36 */ "NK_INTEGER", + /* 37 */ "CREATEDB", + /* 38 */ "USER", + /* 39 */ "ENABLE", + /* 40 */ "SYSINFO", + /* 41 */ "ADD", + /* 42 */ "DROP", + /* 43 */ "GRANT", + /* 44 */ "ON", + /* 45 */ "TO", + /* 46 */ "REVOKE", + /* 47 */ "FROM", + /* 48 */ "SUBSCRIBE", + /* 49 */ "READ", + /* 50 */ "WRITE", + /* 51 */ "NK_DOT", + /* 52 */ "WITH", + /* 53 */ "ENCRYPT_KEY", + /* 54 */ "DNODE", + /* 55 */ "PORT", + /* 56 */ "DNODES", + /* 57 */ "RESTORE", + /* 58 */ "NK_IPTOKEN", + /* 59 */ "FORCE", + /* 60 */ "UNSAFE", + /* 61 */ "CLUSTER", + /* 62 */ "LOCAL", + /* 63 */ "QNODE", + /* 64 */ "BNODE", + /* 65 */ "SNODE", + /* 66 */ "MNODE", + /* 67 */ "VNODE", + /* 68 */ "DATABASE", + /* 69 */ "USE", + /* 70 */ "FLUSH", + /* 71 */ "TRIM", + /* 72 */ "S3MIGRATE", + /* 73 */ "COMPACT", + /* 74 */ "IF", + /* 75 */ "NOT", + /* 76 */ "EXISTS", + /* 77 */ "BUFFER", + /* 78 */ "CACHEMODEL", + /* 79 */ "CACHESIZE", + /* 80 */ "COMP", + /* 81 */ "DURATION", + /* 82 */ "NK_VARIABLE", + /* 83 */ "MAXROWS", + /* 84 */ "MINROWS", + /* 85 */ "KEEP", + /* 86 */ "PAGES", + /* 87 */ "PAGESIZE", + /* 88 */ "TSDB_PAGESIZE", + /* 89 */ "PRECISION", + /* 90 */ "REPLICA", + /* 91 */ "VGROUPS", + /* 92 */ "SINGLE_STABLE", + /* 93 */ "RETENTIONS", + /* 94 */ "SCHEMALESS", + /* 95 */ "WAL_LEVEL", + /* 96 */ "WAL_FSYNC_PERIOD", + /* 97 */ "WAL_RETENTION_PERIOD", + /* 98 */ "WAL_RETENTION_SIZE", + /* 99 */ "WAL_ROLL_PERIOD", + /* 100 */ "WAL_SEGMENT_SIZE", + /* 101 */ "STT_TRIGGER", + /* 102 */ "TABLE_PREFIX", + /* 103 */ "TABLE_SUFFIX", + /* 104 */ "S3_CHUNKSIZE", + /* 105 */ "S3_KEEPLOCAL", + /* 106 */ "S3_COMPACT", + /* 107 */ "KEEP_TIME_OFFSET", + /* 108 */ "ENCRYPT_ALGORITHM", + /* 109 */ "NK_COLON", + /* 110 */ "BWLIMIT", + /* 111 */ "START", + /* 112 */ "TIMESTAMP", + /* 113 */ "END", + /* 114 */ "TABLE", + /* 115 */ "NK_LP", + /* 116 */ "NK_RP", + /* 117 */ "USING", + /* 118 */ "FILE", + /* 119 */ "STABLE", + /* 120 */ "COLUMN", + /* 121 */ "MODIFY", + /* 122 */ "RENAME", + /* 123 */ "TAG", + /* 124 */ "SET", + /* 125 */ "NK_EQ", + /* 126 */ "TAGS", + /* 127 */ "BOOL", + /* 128 */ "TINYINT", + /* 129 */ "SMALLINT", + /* 130 */ "INT", + /* 131 */ "INTEGER", + /* 132 */ "BIGINT", + /* 133 */ "FLOAT", + /* 134 */ "DOUBLE", + /* 135 */ "BINARY", + /* 136 */ "NCHAR", + /* 137 */ "UNSIGNED", + /* 138 */ "JSON", + /* 139 */ "VARCHAR", + /* 140 */ "MEDIUMBLOB", + /* 141 */ "BLOB", + /* 142 */ "VARBINARY", + /* 143 */ "GEOMETRY", + /* 144 */ "DECIMAL", + /* 145 */ "COMMENT", + /* 146 */ "MAX_DELAY", + /* 147 */ "WATERMARK", + /* 148 */ "ROLLUP", + /* 149 */ "TTL", + /* 150 */ "SMA", + /* 151 */ "DELETE_MARK", + /* 152 */ "FIRST", + /* 153 */ "LAST", + /* 154 */ "SHOW", + /* 155 */ "FULL", + /* 156 */ "PRIVILEGES", + /* 157 */ "DATABASES", + /* 158 */ "TABLES", + /* 159 */ "STABLES", + /* 160 */ "MNODES", + /* 161 */ "QNODES", + /* 162 */ "ARBGROUPS", + /* 163 */ "FUNCTIONS", + /* 164 */ "INDEXES", + /* 165 */ "ACCOUNTS", + /* 166 */ "APPS", + /* 167 */ "CONNECTIONS", + /* 168 */ "LICENCES", + /* 169 */ "GRANTS", + /* 170 */ "LOGS", + /* 171 */ "MACHINES", + /* 172 */ "ENCRYPTIONS", + /* 173 */ "QUERIES", + /* 174 */ "SCORES", + /* 175 */ "TOPICS", + /* 176 */ "VARIABLES", + /* 177 */ "BNODES", + /* 178 */ "SNODES", + /* 179 */ "TRANSACTIONS", + /* 180 */ "DISTRIBUTED", + /* 181 */ "CONSUMERS", + /* 182 */ "SUBSCRIPTIONS", + /* 183 */ "VNODES", + /* 184 */ "ALIVE", + /* 185 */ "VIEWS", + /* 186 */ "VIEW", + /* 187 */ "COMPACTS", + /* 188 */ "NORMAL", + /* 189 */ "CHILD", + /* 190 */ "LIKE", + /* 191 */ "TBNAME", + /* 192 */ "QTAGS", + /* 193 */ "AS", + /* 194 */ "SYSTEM", + /* 195 */ "TSMA", + /* 196 */ "INTERVAL", + /* 197 */ "RECURSIVE", + /* 198 */ "TSMAS", + /* 199 */ "FUNCTION", + /* 200 */ "INDEX", + /* 201 */ "COUNT", + /* 202 */ "LAST_ROW", + /* 203 */ "META", + /* 204 */ "ONLY", + /* 205 */ "TOPIC", + /* 206 */ "CONSUMER", + /* 207 */ "GROUP", + /* 208 */ "DESC", + /* 209 */ "DESCRIBE", + /* 210 */ "RESET", + /* 211 */ "QUERY", + /* 212 */ "CACHE", + /* 213 */ "EXPLAIN", + /* 214 */ "ANALYZE", + /* 215 */ "VERBOSE", + /* 216 */ "NK_BOOL", + /* 217 */ "RATIO", + /* 218 */ "NK_FLOAT", + /* 219 */ "OUTPUTTYPE", + /* 220 */ "AGGREGATE", + /* 221 */ "BUFSIZE", + /* 222 */ "LANGUAGE", + /* 223 */ "REPLACE", + /* 224 */ "STREAM", + /* 225 */ "INTO", + /* 226 */ "PAUSE", + /* 227 */ "RESUME", + /* 228 */ "PRIMARY", + /* 229 */ "KEY", + /* 230 */ "TRIGGER", + /* 231 */ "AT_ONCE", + /* 232 */ "WINDOW_CLOSE", + /* 233 */ "IGNORE", + /* 234 */ "EXPIRED", + /* 235 */ "FILL_HISTORY", + /* 236 */ "UPDATE", + /* 237 */ "SUBTABLE", + /* 238 */ "UNTREATED", + /* 239 */ "KILL", + /* 240 */ "CONNECTION", + /* 241 */ "TRANSACTION", + /* 242 */ "BALANCE", + /* 243 */ "VGROUP", + /* 244 */ "LEADER", + /* 245 */ "MERGE", + /* 246 */ "REDISTRIBUTE", + /* 247 */ "SPLIT", + /* 248 */ "DELETE", + /* 249 */ "INSERT", + /* 250 */ "NK_BIN", + /* 251 */ "NK_HEX", + /* 252 */ "NULL", + /* 253 */ "NK_QUESTION", + /* 254 */ "NK_ALIAS", + /* 255 */ "NK_ARROW", + /* 256 */ "ROWTS", + /* 257 */ "QSTART", + /* 258 */ "QEND", + /* 259 */ "QDURATION", + /* 260 */ "WSTART", + /* 261 */ "WEND", + /* 262 */ "WDURATION", + /* 263 */ "IROWTS", + /* 264 */ "ISFILLED", + /* 265 */ "CAST", + /* 266 */ "POSITION", + /* 267 */ "IN", + /* 268 */ "FOR", + /* 269 */ "NOW", + /* 270 */ "TODAY", + /* 271 */ "SUBSTR", + /* 272 */ "SUBSTRING", + /* 273 */ "BOTH", + /* 274 */ "TRAILING", + /* 275 */ "LEADING", + /* 276 */ "TIMEZONE", + /* 277 */ "CLIENT_VERSION", + /* 278 */ "SERVER_VERSION", + /* 279 */ "SERVER_STATUS", + /* 280 */ "CURRENT_USER", + /* 281 */ "PI", + /* 282 */ "CASE", + /* 283 */ "WHEN", + /* 284 */ "THEN", + /* 285 */ "ELSE", + /* 286 */ "BETWEEN", + /* 287 */ "IS", + /* 288 */ "NK_LT", + /* 289 */ "NK_GT", + /* 290 */ "NK_LE", + /* 291 */ "NK_GE", + /* 292 */ "NK_NE", + /* 293 */ "MATCH", + /* 294 */ "NMATCH", + /* 295 */ "CONTAINS", + /* 296 */ "JOIN", + /* 297 */ "INNER", + /* 298 */ "LEFT", + /* 299 */ "RIGHT", + /* 300 */ "OUTER", + /* 301 */ "SEMI", + /* 302 */ "ANTI", + /* 303 */ "ASOF", + /* 304 */ "WINDOW", + /* 305 */ "WINDOW_OFFSET", + /* 306 */ "JLIMIT", + /* 307 */ "SELECT", + /* 308 */ "NK_HINT", + /* 309 */ "DISTINCT", + /* 310 */ "WHERE", + /* 311 */ "PARTITION", + /* 312 */ "BY", + /* 313 */ "SESSION", + /* 314 */ "STATE_WINDOW", + /* 315 */ "EVENT_WINDOW", + /* 316 */ "COUNT_WINDOW", + /* 317 */ "SLIDING", + /* 318 */ "FILL", + /* 319 */ "VALUE", + /* 320 */ "VALUE_F", + /* 321 */ "NONE", + /* 322 */ "PREV", + /* 323 */ "NULL_F", + /* 324 */ "LINEAR", + /* 325 */ "NEXT", + /* 326 */ "HAVING", + /* 327 */ "RANGE", + /* 328 */ "EVERY", + /* 329 */ "ORDER", + /* 330 */ "SLIMIT", + /* 331 */ "SOFFSET", + /* 332 */ "LIMIT", + /* 333 */ "OFFSET", + /* 334 */ "ASC", + /* 335 */ "NULLS", + /* 336 */ "ABORT", + /* 337 */ "AFTER", + /* 338 */ "ATTACH", + /* 339 */ "BEFORE", + /* 340 */ "BEGIN", + /* 341 */ "BITAND", + /* 342 */ "BITNOT", + /* 343 */ "BITOR", + /* 344 */ "BLOCKS", + /* 345 */ "CHANGE", + /* 346 */ "COMMA", + /* 347 */ "CONCAT", + /* 348 */ "CONFLICT", + /* 349 */ "COPY", + /* 350 */ "DEFERRED", + /* 351 */ "DELIMITERS", + /* 352 */ "DETACH", + /* 353 */ "DIVIDE", + /* 354 */ "DOT", + /* 355 */ "EACH", + /* 356 */ "FAIL", + /* 357 */ "GLOB", + /* 358 */ "ID", + /* 359 */ "IMMEDIATE", + /* 360 */ "IMPORT", + /* 361 */ "INITIALLY", + /* 362 */ "INSTEAD", + /* 363 */ "ISNULL", + /* 364 */ "MODULES", + /* 365 */ "NK_BITNOT", + /* 366 */ "NK_SEMI", + /* 367 */ "NOTNULL", + /* 368 */ "OF", + /* 369 */ "PLUS", + /* 370 */ "PRIVILEGE", + /* 371 */ "RAISE", + /* 372 */ "RESTRICT", + /* 373 */ "ROW", + /* 374 */ "STAR", + /* 375 */ "STATEMENT", + /* 376 */ "STRICT", + /* 377 */ "STRING", + /* 378 */ "TIMES", + /* 379 */ "VALUES", + /* 380 */ "VARIABLE", + /* 381 */ "WAL", + /* 382 */ "ENCODE", + /* 383 */ "COMPRESS", + /* 384 */ "LEVEL", + /* 385 */ "cmd", + /* 386 */ "account_options", + /* 387 */ "alter_account_options", + /* 388 */ "literal", + /* 389 */ "alter_account_option", + /* 390 */ "ip_range_list", + /* 391 */ "white_list", + /* 392 */ "white_list_opt", + /* 393 */ "is_import_opt", + /* 394 */ "is_createdb_opt", + /* 395 */ "user_name", + /* 396 */ "sysinfo_opt", + /* 397 */ "privileges", + /* 398 */ "priv_level", + /* 399 */ "with_opt", + /* 400 */ "priv_type_list", + /* 401 */ "priv_type", + /* 402 */ "db_name", + /* 403 */ "table_name", + /* 404 */ "topic_name", + /* 405 */ "search_condition", + /* 406 */ "dnode_endpoint", + /* 407 */ "force_opt", + /* 408 */ "unsafe_opt", + /* 409 */ "not_exists_opt", + /* 410 */ "db_options", + /* 411 */ "exists_opt", + /* 412 */ "alter_db_options", + /* 413 */ "speed_opt", + /* 414 */ "start_opt", + /* 415 */ "end_opt", + /* 416 */ "integer_list", + /* 417 */ "variable_list", + /* 418 */ "retention_list", + /* 419 */ "signed", + /* 420 */ "alter_db_option", + /* 421 */ "retention", + /* 422 */ "full_table_name", + /* 423 */ "column_def_list", + /* 424 */ "tags_def_opt", + /* 425 */ "table_options", + /* 426 */ "multi_create_clause", + /* 427 */ "tag_list_opt", + /* 428 */ "tags_def", + /* 429 */ "multi_drop_clause", + /* 430 */ "alter_table_clause", + /* 431 */ "alter_table_options", + /* 432 */ "column_name", + /* 433 */ "type_name", + /* 434 */ "column_options", + /* 435 */ "tags_literal", + /* 436 */ "create_subtable_clause", + /* 437 */ "specific_cols_opt", + /* 438 */ "tags_literal_list", + /* 439 */ "drop_table_clause", + /* 440 */ "col_name_list", + /* 441 */ "tag_def_list", + /* 442 */ "tag_def", + /* 443 */ "column_def", + /* 444 */ "type_name_default_len", + /* 445 */ "duration_list", + /* 446 */ "rollup_func_list", + /* 447 */ "alter_table_option", + /* 448 */ "duration_literal", + /* 449 */ "rollup_func_name", + /* 450 */ "function_name", + /* 451 */ "col_name", + /* 452 */ "db_kind_opt", + /* 453 */ "table_kind_db_name_cond_opt", + /* 454 */ "like_pattern_opt", + /* 455 */ "db_name_cond_opt", + /* 456 */ "table_name_cond", + /* 457 */ "from_db_opt", + /* 458 */ "table_kind", + /* 459 */ "tag_item", + /* 460 */ "column_alias", + /* 461 */ "tsma_name", + /* 462 */ "tsma_func_list", + /* 463 */ "full_tsma_name", + /* 464 */ "func_list", + /* 465 */ "index_options", + /* 466 */ "full_index_name", + /* 467 */ "index_name", + /* 468 */ "sliding_opt", + /* 469 */ "sma_stream_opt", + /* 470 */ "func", + /* 471 */ "sma_func_name", + /* 472 */ "expression_list", + /* 473 */ "with_meta", + /* 474 */ "query_or_subquery", + /* 475 */ "where_clause_opt", + /* 476 */ "cgroup_name", + /* 477 */ "analyze_opt", + /* 478 */ "explain_options", + /* 479 */ "insert_query", + /* 480 */ "or_replace_opt", + /* 481 */ "agg_func_opt", + /* 482 */ "bufsize_opt", + /* 483 */ "language_opt", + /* 484 */ "full_view_name", + /* 485 */ "view_name", + /* 486 */ "stream_name", + /* 487 */ "stream_options", + /* 488 */ "col_list_opt", + /* 489 */ "tag_def_or_ref_opt", + /* 490 */ "subtable_opt", + /* 491 */ "ignore_opt", + /* 492 */ "column_stream_def_list", + /* 493 */ "column_stream_def", + /* 494 */ "stream_col_options", + /* 495 */ "expression", + /* 496 */ "on_vgroup_id", + /* 497 */ "dnode_list", + /* 498 */ "literal_func", + /* 499 */ "signed_literal", + /* 500 */ "literal_list", + /* 501 */ "table_alias", + /* 502 */ "expr_or_subquery", + /* 503 */ "pseudo_column", + /* 504 */ "column_reference", + /* 505 */ "function_expression", + /* 506 */ "case_when_expression", + /* 507 */ "star_func", + /* 508 */ "star_func_para_list", + /* 509 */ "trim_specification_type", + /* 510 */ "substr_func", + /* 511 */ "noarg_func", + /* 512 */ "other_para_list", + /* 513 */ "star_func_para", + /* 514 */ "when_then_list", + /* 515 */ "case_when_else_opt", + /* 516 */ "common_expression", + /* 517 */ "when_then_expr", + /* 518 */ "predicate", + /* 519 */ "compare_op", + /* 520 */ "in_op", + /* 521 */ "in_predicate_value", + /* 522 */ "boolean_value_expression", + /* 523 */ "boolean_primary", + /* 524 */ "from_clause_opt", + /* 525 */ "table_reference_list", + /* 526 */ "table_reference", + /* 527 */ "table_primary", + /* 528 */ "joined_table", + /* 529 */ "alias_opt", + /* 530 */ "subquery", + /* 531 */ "parenthesized_joined_table", + /* 532 */ "join_type", + /* 533 */ "join_subtype", + /* 534 */ "join_on_clause_opt", + /* 535 */ "window_offset_clause_opt", + /* 536 */ "jlimit_clause_opt", + /* 537 */ "window_offset_literal", + /* 538 */ "query_specification", + /* 539 */ "hint_list", + /* 540 */ "set_quantifier_opt", + /* 541 */ "tag_mode_opt", + /* 542 */ "select_list", + /* 543 */ "partition_by_clause_opt", + /* 544 */ "range_opt", + /* 545 */ "every_opt", + /* 546 */ "fill_opt", + /* 547 */ "twindow_clause_opt", + /* 548 */ "group_by_clause_opt", + /* 549 */ "having_clause_opt", + /* 550 */ "select_item", + /* 551 */ "partition_list", + /* 552 */ "partition_item", + /* 553 */ "interval_sliding_duration_literal", + /* 554 */ "fill_mode", + /* 555 */ "group_by_list", + /* 556 */ "query_expression", + /* 557 */ "query_simple", + /* 558 */ "order_by_clause_opt", + /* 559 */ "slimit_clause_opt", + /* 560 */ "limit_clause_opt", + /* 561 */ "union_query_expression", + /* 562 */ "query_simple_or_subquery", + /* 563 */ "sort_specification_list", + /* 564 */ "sort_specification", + /* 565 */ "ordering_specification_opt", + /* 566 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. -*/ + */ static const char *const yyRuleName[] = { - /* 0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options", - /* 1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options", - /* 2 */ "account_options ::=", - /* 3 */ "account_options ::= account_options PPS literal", - /* 4 */ "account_options ::= account_options TSERIES literal", - /* 5 */ "account_options ::= account_options STORAGE literal", - /* 6 */ "account_options ::= account_options STREAMS literal", - /* 7 */ "account_options ::= account_options QTIME literal", - /* 8 */ "account_options ::= account_options DBS literal", - /* 9 */ "account_options ::= account_options USERS literal", - /* 10 */ "account_options ::= account_options CONNS literal", - /* 11 */ "account_options ::= account_options STATE literal", - /* 12 */ "alter_account_options ::= alter_account_option", - /* 13 */ "alter_account_options ::= alter_account_options alter_account_option", - /* 14 */ "alter_account_option ::= PASS literal", - /* 15 */ "alter_account_option ::= PPS literal", - /* 16 */ "alter_account_option ::= TSERIES literal", - /* 17 */ "alter_account_option ::= STORAGE literal", - /* 18 */ "alter_account_option ::= STREAMS literal", - /* 19 */ "alter_account_option ::= QTIME literal", - /* 20 */ "alter_account_option ::= DBS literal", - /* 21 */ "alter_account_option ::= USERS literal", - /* 22 */ "alter_account_option ::= CONNS literal", - /* 23 */ "alter_account_option ::= STATE literal", - /* 24 */ "ip_range_list ::= NK_STRING", - /* 25 */ "ip_range_list ::= ip_range_list NK_COMMA NK_STRING", - /* 26 */ "white_list ::= HOST ip_range_list", - /* 27 */ "white_list_opt ::=", - /* 28 */ "white_list_opt ::= white_list", - /* 29 */ "is_import_opt ::=", - /* 30 */ "is_import_opt ::= IS_IMPORT NK_INTEGER", - /* 31 */ "is_createdb_opt ::=", - /* 32 */ "is_createdb_opt ::= CREATEDB NK_INTEGER", - /* 33 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt", - /* 34 */ "cmd ::= ALTER USER user_name PASS NK_STRING", - /* 35 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER", - /* 36 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER", - /* 37 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER", - /* 38 */ "cmd ::= ALTER USER user_name ADD white_list", - /* 39 */ "cmd ::= ALTER USER user_name DROP white_list", - /* 40 */ "cmd ::= DROP USER user_name", - /* 41 */ "sysinfo_opt ::=", - /* 42 */ "sysinfo_opt ::= SYSINFO NK_INTEGER", - /* 43 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name", - /* 44 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name", - /* 45 */ "privileges ::= ALL", - /* 46 */ "privileges ::= priv_type_list", - /* 47 */ "privileges ::= SUBSCRIBE", - /* 48 */ "priv_type_list ::= priv_type", - /* 49 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type", - /* 50 */ "priv_type ::= READ", - /* 51 */ "priv_type ::= WRITE", - /* 52 */ "priv_type ::= ALTER", - /* 53 */ "priv_level ::= NK_STAR NK_DOT NK_STAR", - /* 54 */ "priv_level ::= db_name NK_DOT NK_STAR", - /* 55 */ "priv_level ::= db_name NK_DOT table_name", - /* 56 */ "priv_level ::= topic_name", - /* 57 */ "with_opt ::=", - /* 58 */ "with_opt ::= WITH search_condition", - /* 59 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", - /* 60 */ "cmd ::= CREATE DNODE dnode_endpoint", - /* 61 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", - /* 62 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", - /* 63 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", - /* 64 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", - /* 65 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", - /* 66 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", - /* 67 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", - /* 68 */ "cmd ::= ALTER ALL DNODES NK_STRING", - /* 69 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", - /* 70 */ "cmd ::= RESTORE DNODE NK_INTEGER", - /* 71 */ "dnode_endpoint ::= NK_STRING", - /* 72 */ "dnode_endpoint ::= NK_ID", - /* 73 */ "dnode_endpoint ::= NK_IPTOKEN", - /* 74 */ "force_opt ::=", - /* 75 */ "force_opt ::= FORCE", - /* 76 */ "unsafe_opt ::= UNSAFE", - /* 77 */ "cmd ::= ALTER CLUSTER NK_STRING", - /* 78 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", - /* 79 */ "cmd ::= ALTER LOCAL NK_STRING", - /* 80 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", - /* 81 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", - /* 82 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", - /* 83 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", - /* 84 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", - /* 85 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", - /* 86 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", - /* 87 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", - /* 88 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", - /* 89 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", - /* 90 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", - /* 91 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", - /* 92 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", - /* 93 */ "cmd ::= DROP DATABASE exists_opt db_name", - /* 94 */ "cmd ::= USE db_name", - /* 95 */ "cmd ::= ALTER DATABASE db_name alter_db_options", - /* 96 */ "cmd ::= FLUSH DATABASE db_name", - /* 97 */ "cmd ::= TRIM DATABASE db_name speed_opt", - /* 98 */ "cmd ::= S3MIGRATE DATABASE db_name", - /* 99 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", - /* 100 */ "not_exists_opt ::= IF NOT EXISTS", - /* 101 */ "not_exists_opt ::=", - /* 102 */ "exists_opt ::= IF EXISTS", - /* 103 */ "exists_opt ::=", - /* 104 */ "db_options ::=", - /* 105 */ "db_options ::= db_options BUFFER NK_INTEGER", - /* 106 */ "db_options ::= db_options CACHEMODEL NK_STRING", - /* 107 */ "db_options ::= db_options CACHESIZE NK_INTEGER", - /* 108 */ "db_options ::= db_options COMP NK_INTEGER", - /* 109 */ "db_options ::= db_options DURATION NK_INTEGER", - /* 110 */ "db_options ::= db_options DURATION NK_VARIABLE", - /* 111 */ "db_options ::= db_options MAXROWS NK_INTEGER", - /* 112 */ "db_options ::= db_options MINROWS NK_INTEGER", - /* 113 */ "db_options ::= db_options KEEP integer_list", - /* 114 */ "db_options ::= db_options KEEP variable_list", - /* 115 */ "db_options ::= db_options PAGES NK_INTEGER", - /* 116 */ "db_options ::= db_options PAGESIZE NK_INTEGER", - /* 117 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", - /* 118 */ "db_options ::= db_options PRECISION NK_STRING", - /* 119 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 120 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 121 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 122 */ "db_options ::= db_options RETENTIONS retention_list", - /* 123 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 124 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 125 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 126 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 127 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 128 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 129 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 130 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 131 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 132 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 133 */ "db_options ::= db_options TABLE_PREFIX signed", - /* 134 */ "db_options ::= db_options TABLE_SUFFIX signed", - /* 135 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", - /* 136 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", - /* 137 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", - /* 138 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", - /* 139 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", - /* 140 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", - /* 141 */ "alter_db_options ::= alter_db_option", - /* 142 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 143 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 144 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 145 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 146 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 147 */ "alter_db_option ::= KEEP integer_list", - /* 148 */ "alter_db_option ::= KEEP variable_list", - /* 149 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 150 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 151 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 152 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 153 */ "alter_db_option ::= MINROWS NK_INTEGER", - /* 154 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", - /* 155 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 156 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", - /* 157 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 158 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", - /* 159 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", - /* 160 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", - /* 161 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", - /* 162 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", - /* 163 */ "integer_list ::= NK_INTEGER", - /* 164 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 165 */ "variable_list ::= NK_VARIABLE", - /* 166 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 167 */ "retention_list ::= retention", - /* 168 */ "retention_list ::= retention_list NK_COMMA retention", - /* 169 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 170 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", - /* 171 */ "speed_opt ::=", - /* 172 */ "speed_opt ::= BWLIMIT NK_INTEGER", - /* 173 */ "start_opt ::=", - /* 174 */ "start_opt ::= START WITH NK_INTEGER", - /* 175 */ "start_opt ::= START WITH NK_STRING", - /* 176 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", - /* 177 */ "end_opt ::=", - /* 178 */ "end_opt ::= END WITH NK_INTEGER", - /* 179 */ "end_opt ::= END WITH NK_STRING", - /* 180 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", - /* 181 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 182 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 183 */ "cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", - /* 184 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 185 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 186 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 187 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 188 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 189 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 190 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", - /* 191 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 192 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 193 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", - /* 194 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 195 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 196 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 197 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 198 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 199 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", - /* 200 */ "multi_create_clause ::= create_subtable_clause", - /* 201 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 202 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", - /* 203 */ "multi_drop_clause ::= drop_table_clause", - /* 204 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", - /* 205 */ "drop_table_clause ::= exists_opt full_table_name", - /* 206 */ "specific_cols_opt ::=", - /* 207 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 208 */ "full_table_name ::= table_name", - /* 209 */ "full_table_name ::= db_name NK_DOT table_name", - /* 210 */ "tag_def_list ::= tag_def", - /* 211 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", - /* 212 */ "tag_def ::= column_name type_name", - /* 213 */ "column_def_list ::= column_def", - /* 214 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 215 */ "column_def ::= column_name type_name column_options", - /* 216 */ "type_name ::= BOOL", - /* 217 */ "type_name ::= TINYINT", - /* 218 */ "type_name ::= SMALLINT", - /* 219 */ "type_name ::= INT", - /* 220 */ "type_name ::= INTEGER", - /* 221 */ "type_name ::= BIGINT", - /* 222 */ "type_name ::= FLOAT", - /* 223 */ "type_name ::= DOUBLE", - /* 224 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 225 */ "type_name ::= TIMESTAMP", - /* 226 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 227 */ "type_name ::= TINYINT UNSIGNED", - /* 228 */ "type_name ::= SMALLINT UNSIGNED", - /* 229 */ "type_name ::= INT UNSIGNED", - /* 230 */ "type_name ::= BIGINT UNSIGNED", - /* 231 */ "type_name ::= JSON", - /* 232 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 233 */ "type_name ::= MEDIUMBLOB", - /* 234 */ "type_name ::= BLOB", - /* 235 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 236 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", - /* 237 */ "type_name ::= DECIMAL", - /* 238 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 239 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 240 */ "type_name_default_len ::= BINARY", - /* 241 */ "type_name_default_len ::= NCHAR", - /* 242 */ "type_name_default_len ::= VARCHAR", - /* 243 */ "type_name_default_len ::= VARBINARY", - /* 244 */ "tags_def_opt ::=", - /* 245 */ "tags_def_opt ::= tags_def", - /* 246 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", - /* 247 */ "table_options ::=", - /* 248 */ "table_options ::= table_options COMMENT NK_STRING", - /* 249 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 250 */ "table_options ::= table_options WATERMARK duration_list", - /* 251 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 252 */ "table_options ::= table_options TTL NK_INTEGER", - /* 253 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 254 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 255 */ "alter_table_options ::= alter_table_option", - /* 256 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 257 */ "alter_table_option ::= COMMENT NK_STRING", - /* 258 */ "alter_table_option ::= TTL NK_INTEGER", - /* 259 */ "duration_list ::= duration_literal", - /* 260 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 261 */ "rollup_func_list ::= rollup_func_name", - /* 262 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 263 */ "rollup_func_name ::= function_name", - /* 264 */ "rollup_func_name ::= FIRST", - /* 265 */ "rollup_func_name ::= LAST", - /* 266 */ "col_name_list ::= col_name", - /* 267 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 268 */ "col_name ::= column_name", - /* 269 */ "cmd ::= SHOW DNODES", - /* 270 */ "cmd ::= SHOW USERS", - /* 271 */ "cmd ::= SHOW USERS FULL", - /* 272 */ "cmd ::= SHOW USER PRIVILEGES", - /* 273 */ "cmd ::= SHOW db_kind_opt DATABASES", - /* 274 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", - /* 275 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 276 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 277 */ "cmd ::= SHOW MNODES", - /* 278 */ "cmd ::= SHOW QNODES", - /* 279 */ "cmd ::= SHOW ARBGROUPS", - /* 280 */ "cmd ::= SHOW FUNCTIONS", - /* 281 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 282 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 283 */ "cmd ::= SHOW STREAMS", - /* 284 */ "cmd ::= SHOW ACCOUNTS", - /* 285 */ "cmd ::= SHOW APPS", - /* 286 */ "cmd ::= SHOW CONNECTIONS", - /* 287 */ "cmd ::= SHOW LICENCES", - /* 288 */ "cmd ::= SHOW GRANTS", - /* 289 */ "cmd ::= SHOW GRANTS FULL", - /* 290 */ "cmd ::= SHOW GRANTS LOGS", - /* 291 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 292 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 293 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 294 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 295 */ "cmd ::= SHOW ENCRYPTIONS", - /* 296 */ "cmd ::= SHOW QUERIES", - /* 297 */ "cmd ::= SHOW SCORES", - /* 298 */ "cmd ::= SHOW TOPICS", - /* 299 */ "cmd ::= SHOW VARIABLES", - /* 300 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 301 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 302 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 303 */ "cmd ::= SHOW BNODES", - /* 304 */ "cmd ::= SHOW SNODES", - /* 305 */ "cmd ::= SHOW CLUSTER", - /* 306 */ "cmd ::= SHOW TRANSACTIONS", - /* 307 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 308 */ "cmd ::= SHOW CONSUMERS", - /* 309 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 310 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 311 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 312 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 313 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 314 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 315 */ "cmd ::= SHOW VNODES", - /* 316 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 317 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 318 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 319 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 320 */ "cmd ::= SHOW COMPACTS", - /* 321 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 322 */ "table_kind_db_name_cond_opt ::=", - /* 323 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 324 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 325 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 326 */ "table_kind ::= NORMAL", - /* 327 */ "table_kind ::= CHILD", - /* 328 */ "db_name_cond_opt ::=", - /* 329 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 330 */ "like_pattern_opt ::=", - /* 331 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 332 */ "table_name_cond ::= table_name", - /* 333 */ "from_db_opt ::=", - /* 334 */ "from_db_opt ::= FROM db_name", - /* 335 */ "tag_list_opt ::=", - /* 336 */ "tag_list_opt ::= tag_item", - /* 337 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 338 */ "tag_item ::= TBNAME", - /* 339 */ "tag_item ::= QTAGS", - /* 340 */ "tag_item ::= column_name", - /* 341 */ "tag_item ::= column_name column_alias", - /* 342 */ "tag_item ::= column_name AS column_alias", - /* 343 */ "db_kind_opt ::=", - /* 344 */ "db_kind_opt ::= USER", - /* 345 */ "db_kind_opt ::= SYSTEM", - /* 346 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", - /* 347 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", - /* 348 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", - /* 349 */ "cmd ::= SHOW db_name_cond_opt TSMAS", - /* 350 */ "full_tsma_name ::= tsma_name", - /* 351 */ "full_tsma_name ::= db_name NK_DOT tsma_name", - /* 352 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", - /* 353 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 354 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 355 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 356 */ "full_index_name ::= index_name", - /* 357 */ "full_index_name ::= db_name NK_DOT index_name", - /* 358 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 359 */ "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", - /* 360 */ "func_list ::= func", - /* 361 */ "func_list ::= func_list NK_COMMA func", - /* 362 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 363 */ "sma_func_name ::= function_name", - /* 364 */ "sma_func_name ::= COUNT", - /* 365 */ "sma_func_name ::= FIRST", - /* 366 */ "sma_func_name ::= LAST", - /* 367 */ "sma_func_name ::= LAST_ROW", - /* 368 */ "sma_stream_opt ::=", - /* 369 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 370 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 371 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 372 */ "with_meta ::= AS", - /* 373 */ "with_meta ::= WITH META AS", - /* 374 */ "with_meta ::= ONLY META AS", - /* 375 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 376 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 377 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 378 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 379 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 380 */ "cmd ::= DESC full_table_name", - /* 381 */ "cmd ::= DESCRIBE full_table_name", - /* 382 */ "cmd ::= RESET QUERY CACHE", - /* 383 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 384 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 385 */ "analyze_opt ::=", - /* 386 */ "analyze_opt ::= ANALYZE", - /* 387 */ "explain_options ::=", - /* 388 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 389 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 390 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 391 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 392 */ "agg_func_opt ::=", - /* 393 */ "agg_func_opt ::= AGGREGATE", - /* 394 */ "bufsize_opt ::=", - /* 395 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 396 */ "language_opt ::=", - /* 397 */ "language_opt ::= LANGUAGE NK_STRING", - /* 398 */ "or_replace_opt ::=", - /* 399 */ "or_replace_opt ::= OR REPLACE", - /* 400 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 401 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 402 */ "full_view_name ::= view_name", - /* 403 */ "full_view_name ::= db_name NK_DOT view_name", - /* 404 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 405 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 406 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 407 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 408 */ "col_list_opt ::=", - /* 409 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", - /* 410 */ "column_stream_def_list ::= column_stream_def", - /* 411 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", - /* 412 */ "column_stream_def ::= column_name stream_col_options", - /* 413 */ "stream_col_options ::=", - /* 414 */ "stream_col_options ::= stream_col_options PRIMARY KEY", - /* 415 */ "tag_def_or_ref_opt ::=", - /* 416 */ "tag_def_or_ref_opt ::= tags_def", - /* 417 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", - /* 418 */ "stream_options ::=", - /* 419 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 420 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 421 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 422 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 423 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 424 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 425 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 426 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 427 */ "subtable_opt ::=", - /* 428 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 429 */ "ignore_opt ::=", - /* 430 */ "ignore_opt ::= IGNORE UNTREATED", - /* 431 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 432 */ "cmd ::= KILL QUERY NK_STRING", - /* 433 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 434 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 435 */ "cmd ::= BALANCE VGROUP", - /* 436 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 437 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", - /* 438 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 439 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 440 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 441 */ "on_vgroup_id ::=", - /* 442 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 443 */ "dnode_list ::= DNODE NK_INTEGER", - /* 444 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 445 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 446 */ "cmd ::= query_or_subquery", - /* 447 */ "cmd ::= insert_query", - /* 448 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 449 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 450 */ "tags_literal ::= NK_INTEGER", - /* 451 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", - /* 452 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", - /* 453 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 454 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", - /* 455 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", - /* 456 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 457 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", - /* 458 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", - /* 459 */ "tags_literal ::= NK_FLOAT", - /* 460 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 461 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 462 */ "tags_literal ::= NK_BIN", - /* 463 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", - /* 464 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", - /* 465 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 466 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", - /* 467 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", - /* 468 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 469 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", - /* 470 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", - /* 471 */ "tags_literal ::= NK_HEX", - /* 472 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", - /* 473 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", - /* 474 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 475 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", - /* 476 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", - /* 477 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 478 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", - /* 479 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", - /* 480 */ "tags_literal ::= NK_STRING", - /* 481 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", - /* 482 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", - /* 483 */ "tags_literal ::= NK_BOOL", - /* 484 */ "tags_literal ::= NULL", - /* 485 */ "tags_literal ::= literal_func", - /* 486 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 487 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 488 */ "tags_literal_list ::= tags_literal", - /* 489 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 490 */ "literal ::= NK_INTEGER", - /* 491 */ "literal ::= NK_FLOAT", - /* 492 */ "literal ::= NK_STRING", - /* 493 */ "literal ::= NK_BOOL", - /* 494 */ "literal ::= TIMESTAMP NK_STRING", - /* 495 */ "literal ::= duration_literal", - /* 496 */ "literal ::= NULL", - /* 497 */ "literal ::= NK_QUESTION", - /* 498 */ "duration_literal ::= NK_VARIABLE", - /* 499 */ "signed ::= NK_INTEGER", - /* 500 */ "signed ::= NK_PLUS NK_INTEGER", - /* 501 */ "signed ::= NK_MINUS NK_INTEGER", - /* 502 */ "signed ::= NK_FLOAT", - /* 503 */ "signed ::= NK_PLUS NK_FLOAT", - /* 504 */ "signed ::= NK_MINUS NK_FLOAT", - /* 505 */ "signed_literal ::= signed", - /* 506 */ "signed_literal ::= NK_STRING", - /* 507 */ "signed_literal ::= NK_BOOL", - /* 508 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 509 */ "signed_literal ::= duration_literal", - /* 510 */ "signed_literal ::= NULL", - /* 511 */ "signed_literal ::= literal_func", - /* 512 */ "signed_literal ::= NK_QUESTION", - /* 513 */ "literal_list ::= signed_literal", - /* 514 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 515 */ "db_name ::= NK_ID", - /* 516 */ "table_name ::= NK_ID", - /* 517 */ "column_name ::= NK_ID", - /* 518 */ "function_name ::= NK_ID", - /* 519 */ "view_name ::= NK_ID", - /* 520 */ "table_alias ::= NK_ID", - /* 521 */ "column_alias ::= NK_ID", - /* 522 */ "column_alias ::= NK_ALIAS", - /* 523 */ "user_name ::= NK_ID", - /* 524 */ "topic_name ::= NK_ID", - /* 525 */ "stream_name ::= NK_ID", - /* 526 */ "cgroup_name ::= NK_ID", - /* 527 */ "index_name ::= NK_ID", - /* 528 */ "tsma_name ::= NK_ID", - /* 529 */ "expr_or_subquery ::= expression", - /* 530 */ "expression ::= literal", - /* 531 */ "expression ::= pseudo_column", - /* 532 */ "expression ::= column_reference", - /* 533 */ "expression ::= function_expression", - /* 534 */ "expression ::= case_when_expression", - /* 535 */ "expression ::= NK_LP expression NK_RP", - /* 536 */ "expression ::= NK_PLUS expr_or_subquery", - /* 537 */ "expression ::= NK_MINUS expr_or_subquery", - /* 538 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 539 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 540 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 541 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 542 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 543 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 544 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 545 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 546 */ "expression_list ::= expr_or_subquery", - /* 547 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 548 */ "column_reference ::= column_name", - /* 549 */ "column_reference ::= table_name NK_DOT column_name", - /* 550 */ "column_reference ::= NK_ALIAS", - /* 551 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 552 */ "pseudo_column ::= ROWTS", - /* 553 */ "pseudo_column ::= TBNAME", - /* 554 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 555 */ "pseudo_column ::= QSTART", - /* 556 */ "pseudo_column ::= QEND", - /* 557 */ "pseudo_column ::= QDURATION", - /* 558 */ "pseudo_column ::= WSTART", - /* 559 */ "pseudo_column ::= WEND", - /* 560 */ "pseudo_column ::= WDURATION", - /* 561 */ "pseudo_column ::= IROWTS", - /* 562 */ "pseudo_column ::= ISFILLED", - /* 563 */ "pseudo_column ::= QTAGS", - /* 564 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 565 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 566 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 567 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", - /* 568 */ "function_expression ::= literal_func", - /* 569 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 570 */ "literal_func ::= NOW", - /* 571 */ "literal_func ::= TODAY", - /* 572 */ "noarg_func ::= NOW", - /* 573 */ "noarg_func ::= TODAY", - /* 574 */ "noarg_func ::= TIMEZONE", - /* 575 */ "noarg_func ::= DATABASE", - /* 576 */ "noarg_func ::= CLIENT_VERSION", - /* 577 */ "noarg_func ::= SERVER_VERSION", - /* 578 */ "noarg_func ::= SERVER_STATUS", - /* 579 */ "noarg_func ::= CURRENT_USER", - /* 580 */ "noarg_func ::= USER", - /* 581 */ "star_func ::= COUNT", - /* 582 */ "star_func ::= FIRST", - /* 583 */ "star_func ::= LAST", - /* 584 */ "star_func ::= LAST_ROW", - /* 585 */ "star_func_para_list ::= NK_STAR", - /* 586 */ "star_func_para_list ::= other_para_list", - /* 587 */ "other_para_list ::= star_func_para", - /* 588 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 589 */ "star_func_para ::= expr_or_subquery", - /* 590 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 591 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 592 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 593 */ "when_then_list ::= when_then_expr", - /* 594 */ "when_then_list ::= when_then_list when_then_expr", - /* 595 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 596 */ "case_when_else_opt ::=", - /* 597 */ "case_when_else_opt ::= ELSE common_expression", - /* 598 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 599 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 600 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 601 */ "predicate ::= expr_or_subquery IS NULL", - /* 602 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 603 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 604 */ "compare_op ::= NK_LT", - /* 605 */ "compare_op ::= NK_GT", - /* 606 */ "compare_op ::= NK_LE", - /* 607 */ "compare_op ::= NK_GE", - /* 608 */ "compare_op ::= NK_NE", - /* 609 */ "compare_op ::= NK_EQ", - /* 610 */ "compare_op ::= LIKE", - /* 611 */ "compare_op ::= NOT LIKE", - /* 612 */ "compare_op ::= MATCH", - /* 613 */ "compare_op ::= NMATCH", - /* 614 */ "compare_op ::= CONTAINS", - /* 615 */ "in_op ::= IN", - /* 616 */ "in_op ::= NOT IN", - /* 617 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 618 */ "boolean_value_expression ::= boolean_primary", - /* 619 */ "boolean_value_expression ::= NOT boolean_primary", - /* 620 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 621 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 622 */ "boolean_primary ::= predicate", - /* 623 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 624 */ "common_expression ::= expr_or_subquery", - /* 625 */ "common_expression ::= boolean_value_expression", - /* 626 */ "from_clause_opt ::=", - /* 627 */ "from_clause_opt ::= FROM table_reference_list", - /* 628 */ "table_reference_list ::= table_reference", - /* 629 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 630 */ "table_reference ::= table_primary", - /* 631 */ "table_reference ::= joined_table", - /* 632 */ "table_primary ::= table_name alias_opt", - /* 633 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 634 */ "table_primary ::= subquery alias_opt", - /* 635 */ "table_primary ::= parenthesized_joined_table", - /* 636 */ "alias_opt ::=", - /* 637 */ "alias_opt ::= table_alias", - /* 638 */ "alias_opt ::= AS table_alias", - /* 639 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 640 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 641 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 642 */ "join_type ::=", - /* 643 */ "join_type ::= INNER", - /* 644 */ "join_type ::= LEFT", - /* 645 */ "join_type ::= RIGHT", - /* 646 */ "join_type ::= FULL", - /* 647 */ "join_subtype ::=", - /* 648 */ "join_subtype ::= OUTER", - /* 649 */ "join_subtype ::= SEMI", - /* 650 */ "join_subtype ::= ANTI", - /* 651 */ "join_subtype ::= ASOF", - /* 652 */ "join_subtype ::= WINDOW", - /* 653 */ "join_on_clause_opt ::=", - /* 654 */ "join_on_clause_opt ::= ON search_condition", - /* 655 */ "window_offset_clause_opt ::=", - /* 656 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 657 */ "window_offset_literal ::= NK_VARIABLE", - /* 658 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 659 */ "jlimit_clause_opt ::=", - /* 660 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 661 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 662 */ "hint_list ::=", - /* 663 */ "hint_list ::= NK_HINT", - /* 664 */ "tag_mode_opt ::=", - /* 665 */ "tag_mode_opt ::= TAGS", - /* 666 */ "set_quantifier_opt ::=", - /* 667 */ "set_quantifier_opt ::= DISTINCT", - /* 668 */ "set_quantifier_opt ::= ALL", - /* 669 */ "select_list ::= select_item", - /* 670 */ "select_list ::= select_list NK_COMMA select_item", - /* 671 */ "select_item ::= NK_STAR", - /* 672 */ "select_item ::= common_expression", - /* 673 */ "select_item ::= common_expression column_alias", - /* 674 */ "select_item ::= common_expression AS column_alias", - /* 675 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 676 */ "where_clause_opt ::=", - /* 677 */ "where_clause_opt ::= WHERE search_condition", - /* 678 */ "partition_by_clause_opt ::=", - /* 679 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 680 */ "partition_list ::= partition_item", - /* 681 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 682 */ "partition_item ::= expr_or_subquery", - /* 683 */ "partition_item ::= expr_or_subquery column_alias", - /* 684 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 685 */ "twindow_clause_opt ::=", - /* 686 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 687 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 688 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 689 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 690 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 691 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 692 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 693 */ "sliding_opt ::=", - /* 694 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 695 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 696 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 697 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 698 */ "fill_opt ::=", - /* 699 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 700 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 701 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 702 */ "fill_mode ::= NONE", - /* 703 */ "fill_mode ::= PREV", - /* 704 */ "fill_mode ::= NULL", - /* 705 */ "fill_mode ::= NULL_F", - /* 706 */ "fill_mode ::= LINEAR", - /* 707 */ "fill_mode ::= NEXT", - /* 708 */ "group_by_clause_opt ::=", - /* 709 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 710 */ "group_by_list ::= expr_or_subquery", - /* 711 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 712 */ "having_clause_opt ::=", - /* 713 */ "having_clause_opt ::= HAVING search_condition", - /* 714 */ "range_opt ::=", - /* 715 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 716 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 717 */ "every_opt ::=", - /* 718 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 719 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 720 */ "query_simple ::= query_specification", - /* 721 */ "query_simple ::= union_query_expression", - /* 722 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 723 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 724 */ "query_simple_or_subquery ::= query_simple", - /* 725 */ "query_simple_or_subquery ::= subquery", - /* 726 */ "query_or_subquery ::= query_expression", - /* 727 */ "query_or_subquery ::= subquery", - /* 728 */ "order_by_clause_opt ::=", - /* 729 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 730 */ "slimit_clause_opt ::=", - /* 731 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 732 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 733 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 734 */ "limit_clause_opt ::=", - /* 735 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 736 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 737 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 738 */ "subquery ::= NK_LP query_expression NK_RP", - /* 739 */ "subquery ::= NK_LP subquery NK_RP", - /* 740 */ "search_condition ::= common_expression", - /* 741 */ "sort_specification_list ::= sort_specification", - /* 742 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 743 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 744 */ "ordering_specification_opt ::=", - /* 745 */ "ordering_specification_opt ::= ASC", - /* 746 */ "ordering_specification_opt ::= DESC", - /* 747 */ "null_ordering_opt ::=", - /* 748 */ "null_ordering_opt ::= NULLS FIRST", - /* 749 */ "null_ordering_opt ::= NULLS LAST", - /* 750 */ "column_options ::=", - /* 751 */ "column_options ::= column_options PRIMARY KEY", - /* 752 */ "column_options ::= column_options ENCODE NK_STRING", - /* 753 */ "column_options ::= column_options COMPRESS NK_STRING", - /* 754 */ "column_options ::= column_options LEVEL NK_STRING", + /* 0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options", + /* 1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options", + /* 2 */ "account_options ::=", + /* 3 */ "account_options ::= account_options PPS literal", + /* 4 */ "account_options ::= account_options TSERIES literal", + /* 5 */ "account_options ::= account_options STORAGE literal", + /* 6 */ "account_options ::= account_options STREAMS literal", + /* 7 */ "account_options ::= account_options QTIME literal", + /* 8 */ "account_options ::= account_options DBS literal", + /* 9 */ "account_options ::= account_options USERS literal", + /* 10 */ "account_options ::= account_options CONNS literal", + /* 11 */ "account_options ::= account_options STATE literal", + /* 12 */ "alter_account_options ::= alter_account_option", + /* 13 */ "alter_account_options ::= alter_account_options alter_account_option", + /* 14 */ "alter_account_option ::= PASS literal", + /* 15 */ "alter_account_option ::= PPS literal", + /* 16 */ "alter_account_option ::= TSERIES literal", + /* 17 */ "alter_account_option ::= STORAGE literal", + /* 18 */ "alter_account_option ::= STREAMS literal", + /* 19 */ "alter_account_option ::= QTIME literal", + /* 20 */ "alter_account_option ::= DBS literal", + /* 21 */ "alter_account_option ::= USERS literal", + /* 22 */ "alter_account_option ::= CONNS literal", + /* 23 */ "alter_account_option ::= STATE literal", + /* 24 */ "ip_range_list ::= NK_STRING", + /* 25 */ "ip_range_list ::= ip_range_list NK_COMMA NK_STRING", + /* 26 */ "white_list ::= HOST ip_range_list", + /* 27 */ "white_list_opt ::=", + /* 28 */ "white_list_opt ::= white_list", + /* 29 */ "is_import_opt ::=", + /* 30 */ "is_import_opt ::= IS_IMPORT NK_INTEGER", + /* 31 */ "is_createdb_opt ::=", + /* 32 */ "is_createdb_opt ::= CREATEDB NK_INTEGER", + /* 33 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt", + /* 34 */ "cmd ::= ALTER USER user_name PASS NK_STRING", + /* 35 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER", + /* 36 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER", + /* 37 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER", + /* 38 */ "cmd ::= ALTER USER user_name ADD white_list", + /* 39 */ "cmd ::= ALTER USER user_name DROP white_list", + /* 40 */ "cmd ::= DROP USER user_name", + /* 41 */ "sysinfo_opt ::=", + /* 42 */ "sysinfo_opt ::= SYSINFO NK_INTEGER", + /* 43 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name", + /* 44 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name", + /* 45 */ "privileges ::= ALL", + /* 46 */ "privileges ::= priv_type_list", + /* 47 */ "privileges ::= SUBSCRIBE", + /* 48 */ "priv_type_list ::= priv_type", + /* 49 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type", + /* 50 */ "priv_type ::= READ", + /* 51 */ "priv_type ::= WRITE", + /* 52 */ "priv_type ::= ALTER", + /* 53 */ "priv_level ::= NK_STAR NK_DOT NK_STAR", + /* 54 */ "priv_level ::= db_name NK_DOT NK_STAR", + /* 55 */ "priv_level ::= db_name NK_DOT table_name", + /* 56 */ "priv_level ::= topic_name", + /* 57 */ "with_opt ::=", + /* 58 */ "with_opt ::= WITH search_condition", + /* 59 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING", + /* 60 */ "cmd ::= CREATE DNODE dnode_endpoint", + /* 61 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER", + /* 62 */ "cmd ::= DROP DNODE NK_INTEGER force_opt", + /* 63 */ "cmd ::= DROP DNODE dnode_endpoint force_opt", + /* 64 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt", + /* 65 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt", + /* 66 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING", + /* 67 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING", + /* 68 */ "cmd ::= ALTER ALL DNODES NK_STRING", + /* 69 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING", + /* 70 */ "cmd ::= RESTORE DNODE NK_INTEGER", + /* 71 */ "dnode_endpoint ::= NK_STRING", + /* 72 */ "dnode_endpoint ::= NK_ID", + /* 73 */ "dnode_endpoint ::= NK_IPTOKEN", + /* 74 */ "force_opt ::=", + /* 75 */ "force_opt ::= FORCE", + /* 76 */ "unsafe_opt ::= UNSAFE", + /* 77 */ "cmd ::= ALTER CLUSTER NK_STRING", + /* 78 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING", + /* 79 */ "cmd ::= ALTER LOCAL NK_STRING", + /* 80 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING", + /* 81 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER", + /* 82 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER", + /* 83 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER", + /* 84 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER", + /* 85 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER", + /* 86 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER", + /* 87 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER", + /* 88 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER", + /* 89 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER", + /* 90 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER", + /* 91 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER", + /* 92 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options", + /* 93 */ "cmd ::= DROP DATABASE exists_opt db_name", + /* 94 */ "cmd ::= USE db_name", + /* 95 */ "cmd ::= ALTER DATABASE db_name alter_db_options", + /* 96 */ "cmd ::= FLUSH DATABASE db_name", + /* 97 */ "cmd ::= TRIM DATABASE db_name speed_opt", + /* 98 */ "cmd ::= S3MIGRATE DATABASE db_name", + /* 99 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt", + /* 100 */ "not_exists_opt ::= IF NOT EXISTS", + /* 101 */ "not_exists_opt ::=", + /* 102 */ "exists_opt ::= IF EXISTS", + /* 103 */ "exists_opt ::=", + /* 104 */ "db_options ::=", + /* 105 */ "db_options ::= db_options BUFFER NK_INTEGER", + /* 106 */ "db_options ::= db_options CACHEMODEL NK_STRING", + /* 107 */ "db_options ::= db_options CACHESIZE NK_INTEGER", + /* 108 */ "db_options ::= db_options COMP NK_INTEGER", + /* 109 */ "db_options ::= db_options DURATION NK_INTEGER", + /* 110 */ "db_options ::= db_options DURATION NK_VARIABLE", + /* 111 */ "db_options ::= db_options MAXROWS NK_INTEGER", + /* 112 */ "db_options ::= db_options MINROWS NK_INTEGER", + /* 113 */ "db_options ::= db_options KEEP integer_list", + /* 114 */ "db_options ::= db_options KEEP variable_list", + /* 115 */ "db_options ::= db_options PAGES NK_INTEGER", + /* 116 */ "db_options ::= db_options PAGESIZE NK_INTEGER", + /* 117 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", + /* 118 */ "db_options ::= db_options PRECISION NK_STRING", + /* 119 */ "db_options ::= db_options REPLICA NK_INTEGER", + /* 120 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 121 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 122 */ "db_options ::= db_options RETENTIONS retention_list", + /* 123 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 124 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 125 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 126 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 127 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 128 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 129 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 130 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 131 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 132 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 133 */ "db_options ::= db_options TABLE_PREFIX signed", + /* 134 */ "db_options ::= db_options TABLE_SUFFIX signed", + /* 135 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER", + /* 136 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER", + /* 137 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE", + /* 138 */ "db_options ::= db_options S3_COMPACT NK_INTEGER", + /* 139 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER", + /* 140 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING", + /* 141 */ "alter_db_options ::= alter_db_option", + /* 142 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 143 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 144 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 145 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 146 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 147 */ "alter_db_option ::= KEEP integer_list", + /* 148 */ "alter_db_option ::= KEEP variable_list", + /* 149 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 150 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 151 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 152 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 153 */ "alter_db_option ::= MINROWS NK_INTEGER", + /* 154 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER", + /* 155 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 156 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER", + /* 157 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 158 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER", + /* 159 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE", + /* 160 */ "alter_db_option ::= S3_COMPACT NK_INTEGER", + /* 161 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER", + /* 162 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING", + /* 163 */ "integer_list ::= NK_INTEGER", + /* 164 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 165 */ "variable_list ::= NK_VARIABLE", + /* 166 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 167 */ "retention_list ::= retention", + /* 168 */ "retention_list ::= retention_list NK_COMMA retention", + /* 169 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 170 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE", + /* 171 */ "speed_opt ::=", + /* 172 */ "speed_opt ::= BWLIMIT NK_INTEGER", + /* 173 */ "start_opt ::=", + /* 174 */ "start_opt ::= START WITH NK_INTEGER", + /* 175 */ "start_opt ::= START WITH NK_STRING", + /* 176 */ "start_opt ::= START WITH TIMESTAMP NK_STRING", + /* 177 */ "end_opt ::=", + /* 178 */ "end_opt ::= END WITH NK_INTEGER", + /* 179 */ "end_opt ::= END WITH NK_STRING", + /* 180 */ "end_opt ::= END WITH TIMESTAMP NK_STRING", + /* 181 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 182 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 183 */ "cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING", + /* 184 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 185 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 186 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 187 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 188 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 189 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 190 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options", + /* 191 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 192 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 193 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options", + /* 194 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 195 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 196 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 197 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 198 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 199 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal", + /* 200 */ "multi_create_clause ::= create_subtable_clause", + /* 201 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 202 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options", + /* 203 */ "multi_drop_clause ::= drop_table_clause", + /* 204 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause", + /* 205 */ "drop_table_clause ::= exists_opt full_table_name", + /* 206 */ "specific_cols_opt ::=", + /* 207 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 208 */ "full_table_name ::= table_name", + /* 209 */ "full_table_name ::= db_name NK_DOT table_name", + /* 210 */ "tag_def_list ::= tag_def", + /* 211 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def", + /* 212 */ "tag_def ::= column_name type_name", + /* 213 */ "column_def_list ::= column_def", + /* 214 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 215 */ "column_def ::= column_name type_name column_options", + /* 216 */ "type_name ::= BOOL", + /* 217 */ "type_name ::= TINYINT", + /* 218 */ "type_name ::= SMALLINT", + /* 219 */ "type_name ::= INT", + /* 220 */ "type_name ::= INTEGER", + /* 221 */ "type_name ::= BIGINT", + /* 222 */ "type_name ::= FLOAT", + /* 223 */ "type_name ::= DOUBLE", + /* 224 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 225 */ "type_name ::= TIMESTAMP", + /* 226 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 227 */ "type_name ::= TINYINT UNSIGNED", + /* 228 */ "type_name ::= SMALLINT UNSIGNED", + /* 229 */ "type_name ::= INT UNSIGNED", + /* 230 */ "type_name ::= BIGINT UNSIGNED", + /* 231 */ "type_name ::= JSON", + /* 232 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 233 */ "type_name ::= MEDIUMBLOB", + /* 234 */ "type_name ::= BLOB", + /* 235 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 236 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP", + /* 237 */ "type_name ::= DECIMAL", + /* 238 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 239 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 240 */ "type_name_default_len ::= BINARY", + /* 241 */ "type_name_default_len ::= NCHAR", + /* 242 */ "type_name_default_len ::= VARCHAR", + /* 243 */ "type_name_default_len ::= VARBINARY", + /* 244 */ "tags_def_opt ::=", + /* 245 */ "tags_def_opt ::= tags_def", + /* 246 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP", + /* 247 */ "table_options ::=", + /* 248 */ "table_options ::= table_options COMMENT NK_STRING", + /* 249 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 250 */ "table_options ::= table_options WATERMARK duration_list", + /* 251 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 252 */ "table_options ::= table_options TTL NK_INTEGER", + /* 253 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 254 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 255 */ "alter_table_options ::= alter_table_option", + /* 256 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 257 */ "alter_table_option ::= COMMENT NK_STRING", + /* 258 */ "alter_table_option ::= TTL NK_INTEGER", + /* 259 */ "duration_list ::= duration_literal", + /* 260 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 261 */ "rollup_func_list ::= rollup_func_name", + /* 262 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 263 */ "rollup_func_name ::= function_name", + /* 264 */ "rollup_func_name ::= FIRST", + /* 265 */ "rollup_func_name ::= LAST", + /* 266 */ "col_name_list ::= col_name", + /* 267 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 268 */ "col_name ::= column_name", + /* 269 */ "cmd ::= SHOW DNODES", + /* 270 */ "cmd ::= SHOW USERS", + /* 271 */ "cmd ::= SHOW USERS FULL", + /* 272 */ "cmd ::= SHOW USER PRIVILEGES", + /* 273 */ "cmd ::= SHOW db_kind_opt DATABASES", + /* 274 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt", + /* 275 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 276 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 277 */ "cmd ::= SHOW MNODES", + /* 278 */ "cmd ::= SHOW QNODES", + /* 279 */ "cmd ::= SHOW ARBGROUPS", + /* 280 */ "cmd ::= SHOW FUNCTIONS", + /* 281 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 282 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 283 */ "cmd ::= SHOW STREAMS", + /* 284 */ "cmd ::= SHOW ACCOUNTS", + /* 285 */ "cmd ::= SHOW APPS", + /* 286 */ "cmd ::= SHOW CONNECTIONS", + /* 287 */ "cmd ::= SHOW LICENCES", + /* 288 */ "cmd ::= SHOW GRANTS", + /* 289 */ "cmd ::= SHOW GRANTS FULL", + /* 290 */ "cmd ::= SHOW GRANTS LOGS", + /* 291 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 292 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 293 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 294 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 295 */ "cmd ::= SHOW ENCRYPTIONS", + /* 296 */ "cmd ::= SHOW QUERIES", + /* 297 */ "cmd ::= SHOW SCORES", + /* 298 */ "cmd ::= SHOW TOPICS", + /* 299 */ "cmd ::= SHOW VARIABLES", + /* 300 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 301 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 302 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 303 */ "cmd ::= SHOW BNODES", + /* 304 */ "cmd ::= SHOW SNODES", + /* 305 */ "cmd ::= SHOW CLUSTER", + /* 306 */ "cmd ::= SHOW TRANSACTIONS", + /* 307 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 308 */ "cmd ::= SHOW CONSUMERS", + /* 309 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 310 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 311 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 312 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 313 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 314 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 315 */ "cmd ::= SHOW VNODES", + /* 316 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 317 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 318 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 319 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 320 */ "cmd ::= SHOW COMPACTS", + /* 321 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 322 */ "table_kind_db_name_cond_opt ::=", + /* 323 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 324 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 325 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 326 */ "table_kind ::= NORMAL", + /* 327 */ "table_kind ::= CHILD", + /* 328 */ "db_name_cond_opt ::=", + /* 329 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 330 */ "like_pattern_opt ::=", + /* 331 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 332 */ "table_name_cond ::= table_name", + /* 333 */ "from_db_opt ::=", + /* 334 */ "from_db_opt ::= FROM db_name", + /* 335 */ "tag_list_opt ::=", + /* 336 */ "tag_list_opt ::= tag_item", + /* 337 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 338 */ "tag_item ::= TBNAME", + /* 339 */ "tag_item ::= QTAGS", + /* 340 */ "tag_item ::= column_name", + /* 341 */ "tag_item ::= column_name column_alias", + /* 342 */ "tag_item ::= column_name AS column_alias", + /* 343 */ "db_kind_opt ::=", + /* 344 */ "db_kind_opt ::= USER", + /* 345 */ "db_kind_opt ::= SYSTEM", + /* 346 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP", + /* 347 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP", + /* 348 */ "cmd ::= DROP TSMA exists_opt full_tsma_name", + /* 349 */ "cmd ::= SHOW db_name_cond_opt TSMAS", + /* 350 */ "full_tsma_name ::= tsma_name", + /* 351 */ "full_tsma_name ::= db_name NK_DOT tsma_name", + /* 352 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP", + /* 353 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 354 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 355 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 356 */ "full_index_name ::= index_name", + /* 357 */ "full_index_name ::= db_name NK_DOT index_name", + /* 358 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 359 */ "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", + /* 360 */ "func_list ::= func", + /* 361 */ "func_list ::= func_list NK_COMMA func", + /* 362 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 363 */ "sma_func_name ::= function_name", + /* 364 */ "sma_func_name ::= COUNT", + /* 365 */ "sma_func_name ::= FIRST", + /* 366 */ "sma_func_name ::= LAST", + /* 367 */ "sma_func_name ::= LAST_ROW", + /* 368 */ "sma_stream_opt ::=", + /* 369 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 370 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 371 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 372 */ "with_meta ::= AS", + /* 373 */ "with_meta ::= WITH META AS", + /* 374 */ "with_meta ::= ONLY META AS", + /* 375 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 376 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 377 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 378 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 379 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 380 */ "cmd ::= DESC full_table_name", + /* 381 */ "cmd ::= DESCRIBE full_table_name", + /* 382 */ "cmd ::= RESET QUERY CACHE", + /* 383 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 384 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 385 */ "analyze_opt ::=", + /* 386 */ "analyze_opt ::= ANALYZE", + /* 387 */ "explain_options ::=", + /* 388 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 389 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 390 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 391 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 392 */ "agg_func_opt ::=", + /* 393 */ "agg_func_opt ::= AGGREGATE", + /* 394 */ "bufsize_opt ::=", + /* 395 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 396 */ "language_opt ::=", + /* 397 */ "language_opt ::= LANGUAGE NK_STRING", + /* 398 */ "or_replace_opt ::=", + /* 399 */ "or_replace_opt ::= OR REPLACE", + /* 400 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 401 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 402 */ "full_view_name ::= view_name", + /* 403 */ "full_view_name ::= db_name NK_DOT view_name", + /* 404 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", + /* 405 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 406 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 407 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 408 */ "col_list_opt ::=", + /* 409 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP", + /* 410 */ "column_stream_def_list ::= column_stream_def", + /* 411 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def", + /* 412 */ "column_stream_def ::= column_name stream_col_options", + /* 413 */ "stream_col_options ::=", + /* 414 */ "stream_col_options ::= stream_col_options PRIMARY KEY", + /* 415 */ "tag_def_or_ref_opt ::=", + /* 416 */ "tag_def_or_ref_opt ::= tags_def", + /* 417 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP", + /* 418 */ "stream_options ::=", + /* 419 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 420 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 421 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 422 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 423 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 424 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 425 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 426 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 427 */ "subtable_opt ::=", + /* 428 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 429 */ "ignore_opt ::=", + /* 430 */ "ignore_opt ::= IGNORE UNTREATED", + /* 431 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 432 */ "cmd ::= KILL QUERY NK_STRING", + /* 433 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 434 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 435 */ "cmd ::= BALANCE VGROUP", + /* 436 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 437 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name", + /* 438 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 439 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 440 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 441 */ "on_vgroup_id ::=", + /* 442 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 443 */ "dnode_list ::= DNODE NK_INTEGER", + /* 444 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 445 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 446 */ "cmd ::= query_or_subquery", + /* 447 */ "cmd ::= insert_query", + /* 448 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 449 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 450 */ "tags_literal ::= NK_INTEGER", + /* 451 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal", + /* 452 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal", + /* 453 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 454 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal", + /* 455 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal", + /* 456 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 457 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal", + /* 458 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal", + /* 459 */ "tags_literal ::= NK_FLOAT", + /* 460 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 461 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 462 */ "tags_literal ::= NK_BIN", + /* 463 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal", + /* 464 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal", + /* 465 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 466 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal", + /* 467 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal", + /* 468 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 469 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal", + /* 470 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal", + /* 471 */ "tags_literal ::= NK_HEX", + /* 472 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal", + /* 473 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal", + /* 474 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 475 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal", + /* 476 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal", + /* 477 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 478 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal", + /* 479 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal", + /* 480 */ "tags_literal ::= NK_STRING", + /* 481 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal", + /* 482 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal", + /* 483 */ "tags_literal ::= NK_BOOL", + /* 484 */ "tags_literal ::= NULL", + /* 485 */ "tags_literal ::= literal_func", + /* 486 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 487 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 488 */ "tags_literal_list ::= tags_literal", + /* 489 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 490 */ "literal ::= NK_INTEGER", + /* 491 */ "literal ::= NK_FLOAT", + /* 492 */ "literal ::= NK_STRING", + /* 493 */ "literal ::= NK_BOOL", + /* 494 */ "literal ::= TIMESTAMP NK_STRING", + /* 495 */ "literal ::= duration_literal", + /* 496 */ "literal ::= NULL", + /* 497 */ "literal ::= NK_QUESTION", + /* 498 */ "duration_literal ::= NK_VARIABLE", + /* 499 */ "signed ::= NK_INTEGER", + /* 500 */ "signed ::= NK_PLUS NK_INTEGER", + /* 501 */ "signed ::= NK_MINUS NK_INTEGER", + /* 502 */ "signed ::= NK_FLOAT", + /* 503 */ "signed ::= NK_PLUS NK_FLOAT", + /* 504 */ "signed ::= NK_MINUS NK_FLOAT", + /* 505 */ "signed_literal ::= signed", + /* 506 */ "signed_literal ::= NK_STRING", + /* 507 */ "signed_literal ::= NK_BOOL", + /* 508 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 509 */ "signed_literal ::= duration_literal", + /* 510 */ "signed_literal ::= NULL", + /* 511 */ "signed_literal ::= literal_func", + /* 512 */ "signed_literal ::= NK_QUESTION", + /* 513 */ "literal_list ::= signed_literal", + /* 514 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 515 */ "db_name ::= NK_ID", + /* 516 */ "table_name ::= NK_ID", + /* 517 */ "column_name ::= NK_ID", + /* 518 */ "function_name ::= NK_ID", + /* 519 */ "view_name ::= NK_ID", + /* 520 */ "table_alias ::= NK_ID", + /* 521 */ "column_alias ::= NK_ID", + /* 522 */ "column_alias ::= NK_ALIAS", + /* 523 */ "user_name ::= NK_ID", + /* 524 */ "topic_name ::= NK_ID", + /* 525 */ "stream_name ::= NK_ID", + /* 526 */ "cgroup_name ::= NK_ID", + /* 527 */ "index_name ::= NK_ID", + /* 528 */ "tsma_name ::= NK_ID", + /* 529 */ "expr_or_subquery ::= expression", + /* 530 */ "expression ::= literal", + /* 531 */ "expression ::= pseudo_column", + /* 532 */ "expression ::= column_reference", + /* 533 */ "expression ::= function_expression", + /* 534 */ "expression ::= case_when_expression", + /* 535 */ "expression ::= NK_LP expression NK_RP", + /* 536 */ "expression ::= NK_PLUS expr_or_subquery", + /* 537 */ "expression ::= NK_MINUS expr_or_subquery", + /* 538 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 539 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 540 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 541 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 542 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 543 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 544 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 545 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 546 */ "expression_list ::= expr_or_subquery", + /* 547 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 548 */ "column_reference ::= column_name", + /* 549 */ "column_reference ::= table_name NK_DOT column_name", + /* 550 */ "column_reference ::= NK_ALIAS", + /* 551 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 552 */ "pseudo_column ::= ROWTS", + /* 553 */ "pseudo_column ::= TBNAME", + /* 554 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 555 */ "pseudo_column ::= QSTART", + /* 556 */ "pseudo_column ::= QEND", + /* 557 */ "pseudo_column ::= QDURATION", + /* 558 */ "pseudo_column ::= WSTART", + /* 559 */ "pseudo_column ::= WEND", + /* 560 */ "pseudo_column ::= WDURATION", + /* 561 */ "pseudo_column ::= IROWTS", + /* 562 */ "pseudo_column ::= ISFILLED", + /* 563 */ "pseudo_column ::= QTAGS", + /* 564 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 565 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 566 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 567 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP", + /* 568 */ "function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP", + /* 569 */ "function_expression ::= TRIM NK_LP expr_or_subquery NK_RP", + /* 570 */ "function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP", + /* 571 */ "function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", + /* 572 */ "function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP", + /* 573 */ "function_expression ::= substr_func NK_LP expression_list NK_RP", + /* 574 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP", + /* 575 */ "function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP", + /* 576 */ "function_expression ::= REPLACE NK_LP expression_list NK_RP", + /* 577 */ "function_expression ::= literal_func", + /* 578 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 579 */ "literal_func ::= NOW", + /* 580 */ "literal_func ::= TODAY", + /* 581 */ "substr_func ::= SUBSTR", + /* 582 */ "substr_func ::= SUBSTRING", + /* 583 */ "trim_specification_type ::= BOTH", + /* 584 */ "trim_specification_type ::= TRAILING", + /* 585 */ "trim_specification_type ::= LEADING", + /* 586 */ "noarg_func ::= NOW", + /* 587 */ "noarg_func ::= TODAY", + /* 588 */ "noarg_func ::= TIMEZONE", + /* 589 */ "noarg_func ::= DATABASE", + /* 590 */ "noarg_func ::= CLIENT_VERSION", + /* 591 */ "noarg_func ::= SERVER_VERSION", + /* 592 */ "noarg_func ::= SERVER_STATUS", + /* 593 */ "noarg_func ::= CURRENT_USER", + /* 594 */ "noarg_func ::= USER", + /* 595 */ "noarg_func ::= PI", + /* 596 */ "star_func ::= COUNT", + /* 597 */ "star_func ::= FIRST", + /* 598 */ "star_func ::= LAST", + /* 599 */ "star_func ::= LAST_ROW", + /* 600 */ "star_func_para_list ::= NK_STAR", + /* 601 */ "star_func_para_list ::= other_para_list", + /* 602 */ "other_para_list ::= star_func_para", + /* 603 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 604 */ "star_func_para ::= expr_or_subquery", + /* 605 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 606 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 607 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 608 */ "when_then_list ::= when_then_expr", + /* 609 */ "when_then_list ::= when_then_list when_then_expr", + /* 610 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 611 */ "case_when_else_opt ::=", + /* 612 */ "case_when_else_opt ::= ELSE common_expression", + /* 613 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 614 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 615 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 616 */ "predicate ::= expr_or_subquery IS NULL", + /* 617 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 618 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 619 */ "compare_op ::= NK_LT", + /* 620 */ "compare_op ::= NK_GT", + /* 621 */ "compare_op ::= NK_LE", + /* 622 */ "compare_op ::= NK_GE", + /* 623 */ "compare_op ::= NK_NE", + /* 624 */ "compare_op ::= NK_EQ", + /* 625 */ "compare_op ::= LIKE", + /* 626 */ "compare_op ::= NOT LIKE", + /* 627 */ "compare_op ::= MATCH", + /* 628 */ "compare_op ::= NMATCH", + /* 629 */ "compare_op ::= CONTAINS", + /* 630 */ "in_op ::= IN", + /* 631 */ "in_op ::= NOT IN", + /* 632 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 633 */ "boolean_value_expression ::= boolean_primary", + /* 634 */ "boolean_value_expression ::= NOT boolean_primary", + /* 635 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 636 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 637 */ "boolean_primary ::= predicate", + /* 638 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 639 */ "common_expression ::= expr_or_subquery", + /* 640 */ "common_expression ::= boolean_value_expression", + /* 641 */ "from_clause_opt ::=", + /* 642 */ "from_clause_opt ::= FROM table_reference_list", + /* 643 */ "table_reference_list ::= table_reference", + /* 644 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 645 */ "table_reference ::= table_primary", + /* 646 */ "table_reference ::= joined_table", + /* 647 */ "table_primary ::= table_name alias_opt", + /* 648 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 649 */ "table_primary ::= subquery alias_opt", + /* 650 */ "table_primary ::= parenthesized_joined_table", + /* 651 */ "alias_opt ::=", + /* 652 */ "alias_opt ::= table_alias", + /* 653 */ "alias_opt ::= AS table_alias", + /* 654 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 655 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 656 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 657 */ "join_type ::=", + /* 658 */ "join_type ::= INNER", + /* 659 */ "join_type ::= LEFT", + /* 660 */ "join_type ::= RIGHT", + /* 661 */ "join_type ::= FULL", + /* 662 */ "join_subtype ::=", + /* 663 */ "join_subtype ::= OUTER", + /* 664 */ "join_subtype ::= SEMI", + /* 665 */ "join_subtype ::= ANTI", + /* 666 */ "join_subtype ::= ASOF", + /* 667 */ "join_subtype ::= WINDOW", + /* 668 */ "join_on_clause_opt ::=", + /* 669 */ "join_on_clause_opt ::= ON search_condition", + /* 670 */ "window_offset_clause_opt ::=", + /* 671 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 672 */ "window_offset_literal ::= NK_VARIABLE", + /* 673 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 674 */ "jlimit_clause_opt ::=", + /* 675 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 676 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 677 */ "hint_list ::=", + /* 678 */ "hint_list ::= NK_HINT", + /* 679 */ "tag_mode_opt ::=", + /* 680 */ "tag_mode_opt ::= TAGS", + /* 681 */ "set_quantifier_opt ::=", + /* 682 */ "set_quantifier_opt ::= DISTINCT", + /* 683 */ "set_quantifier_opt ::= ALL", + /* 684 */ "select_list ::= select_item", + /* 685 */ "select_list ::= select_list NK_COMMA select_item", + /* 686 */ "select_item ::= NK_STAR", + /* 687 */ "select_item ::= common_expression", + /* 688 */ "select_item ::= common_expression column_alias", + /* 689 */ "select_item ::= common_expression AS column_alias", + /* 690 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 691 */ "where_clause_opt ::=", + /* 692 */ "where_clause_opt ::= WHERE search_condition", + /* 693 */ "partition_by_clause_opt ::=", + /* 694 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 695 */ "partition_list ::= partition_item", + /* 696 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 697 */ "partition_item ::= expr_or_subquery", + /* 698 */ "partition_item ::= expr_or_subquery column_alias", + /* 699 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 700 */ "twindow_clause_opt ::=", + /* 701 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 702 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 703 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 704 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 705 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 706 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 707 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 708 */ "sliding_opt ::=", + /* 709 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 710 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 711 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 712 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 713 */ "fill_opt ::=", + /* 714 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 715 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 716 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 717 */ "fill_mode ::= NONE", + /* 718 */ "fill_mode ::= PREV", + /* 719 */ "fill_mode ::= NULL", + /* 720 */ "fill_mode ::= NULL_F", + /* 721 */ "fill_mode ::= LINEAR", + /* 722 */ "fill_mode ::= NEXT", + /* 723 */ "group_by_clause_opt ::=", + /* 724 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 725 */ "group_by_list ::= expr_or_subquery", + /* 726 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 727 */ "having_clause_opt ::=", + /* 728 */ "having_clause_opt ::= HAVING search_condition", + /* 729 */ "range_opt ::=", + /* 730 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 731 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 732 */ "every_opt ::=", + /* 733 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 734 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 735 */ "query_simple ::= query_specification", + /* 736 */ "query_simple ::= union_query_expression", + /* 737 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 738 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 739 */ "query_simple_or_subquery ::= query_simple", + /* 740 */ "query_simple_or_subquery ::= subquery", + /* 741 */ "query_or_subquery ::= query_expression", + /* 742 */ "query_or_subquery ::= subquery", + /* 743 */ "order_by_clause_opt ::=", + /* 744 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 745 */ "slimit_clause_opt ::=", + /* 746 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 747 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 748 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 749 */ "limit_clause_opt ::=", + /* 750 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 751 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 752 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 753 */ "subquery ::= NK_LP query_expression NK_RP", + /* 754 */ "subquery ::= NK_LP subquery NK_RP", + /* 755 */ "search_condition ::= common_expression", + /* 756 */ "sort_specification_list ::= sort_specification", + /* 757 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 758 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 759 */ "ordering_specification_opt ::=", + /* 760 */ "ordering_specification_opt ::= ASC", + /* 761 */ "ordering_specification_opt ::= DESC", + /* 762 */ "null_ordering_opt ::=", + /* 763 */ "null_ordering_opt ::= NULLS FIRST", + /* 764 */ "null_ordering_opt ::= NULLS LAST", + /* 765 */ "column_options ::=", + /* 766 */ "column_options ::= column_options PRIMARY KEY", + /* 767 */ "column_options ::= column_options ENCODE NK_STRING", + /* 768 */ "column_options ::= column_options COMPRESS NK_STRING", + /* 769 */ "column_options ::= column_options LEVEL NK_STRING", }; #endif /* NDEBUG */ -#if YYSTACKDEPTH<=0 +#if YYGROWABLESTACK /* ** Try to increase the size of the parser stack. Return the number ** of errors. Return 0 on success. */ static int yyGrowStack(yyParser *p){ + int oldSize = 1 + (int)(p->yystackEnd - p->yystack); int newSize; int idx; yyStackEntry *pNew; - newSize = p->yystksz*2 + 100; - idx = p->yytos ? (int)(p->yytos - p->yystack) : 0; - if( p->yystack==&p->yystk0 ){ - pNew = malloc(newSize*sizeof(pNew[0])); - if( pNew ) pNew[0] = p->yystk0; + newSize = oldSize*2 + 100; + idx = (int)(p->yytos - p->yystack); + if( p->yystack==p->yystk0 ){ + pNew = YYREALLOC(0, newSize*sizeof(pNew[0])); + if( pNew==0 ) return 1; + memcpy(pNew, p->yystack, oldSize*sizeof(pNew[0])); }else{ - pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); + pNew = YYREALLOC(p->yystack, newSize*sizeof(pNew[0])); + if( pNew==0 ) return 1; } - if( pNew ){ - p->yystack = pNew; - p->yytos = &p->yystack[idx]; + p->yystack = pNew; + p->yytos = &p->yystack[idx]; #ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", - yyTracePrompt, p->yystksz, newSize); - } -#endif - p->yystksz = newSize; + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", + yyTracePrompt, oldSize, newSize); } - return pNew==0; +#endif + p->yystackEnd = &p->yystack[newSize-1]; + return 0; } +#endif /* YYGROWABLESTACK */ + +#if !YYGROWABLESTACK +/* For builds that do no have a growable stack, yyGrowStack always +** returns an error. +*/ +# define yyGrowStack(X) 1 #endif /* Datatype of the argument to the memory allocated passed as the @@ -3346,35 +3608,25 @@ static int yyGrowStack(yyParser *p){ #endif /* Initialize a new parser that has already been allocated. -*/ + */ void ParseInit(void *yypRawParser ParseCTX_PDECL){ yyParser *yypParser = (yyParser*)yypRawParser; ParseCTX_STORE #ifdef YYTRACKMAXSTACKDEPTH - yypParser->yyhwm = 0; -#endif -#if YYSTACKDEPTH<=0 - yypParser->yytos = NULL; - yypParser->yystack = NULL; - yypParser->yystksz = 0; - if( yyGrowStack(yypParser) ){ - yypParser->yystack = &yypParser->yystk0; - yypParser->yystksz = 1; - } + yypParser->yyhwm = 0; #endif + yypParser->yystack = yypParser->yystk0; + yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif yypParser->yytos = yypParser->yystack; yypParser->yystack[0].stateno = 0; yypParser->yystack[0].major = 0; -#if YYSTACKDEPTH>0 - yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; -#endif } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -3401,325 +3653,293 @@ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the +** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ static void yy_destructor( - yyParser *yypParser, /* The parser */ - YYCODETYPE yymajor, /* Type code for object to destroy */ - YYMINORTYPE *yypminor /* The object to be destroyed */ + yyParser *yypParser, /* The parser */ + YYCODETYPE yymajor, /* Type code for object to destroy */ + YYMINORTYPE *yypminor /* The object to be destroyed */ ){ ParseARG_FETCH - ParseCTX_FETCH - switch( yymajor ){ - /* Here is inserted the actions which take place when a + ParseCTX_FETCH + switch( yymajor ){ + /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those ** which appear on the RHS of the rule, but which are *not* used ** inside the C code. - */ -/********* Begin destructor definitions ***************************************/ + */ + /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 378: /* cmd */ - case 381: /* literal */ - case 392: /* with_opt */ - case 398: /* search_condition */ - case 403: /* db_options */ - case 405: /* alter_db_options */ - case 407: /* start_opt */ - case 408: /* end_opt */ - case 412: /* signed */ - case 414: /* retention */ - case 415: /* full_table_name */ - case 418: /* table_options */ - case 423: /* alter_table_clause */ - case 424: /* alter_table_options */ - case 427: /* column_options */ - case 428: /* tags_literal */ - case 429: /* create_subtable_clause */ - case 432: /* drop_table_clause */ - case 435: /* tag_def */ - case 436: /* column_def */ - case 441: /* duration_literal */ - case 442: /* rollup_func_name */ - case 444: /* col_name */ - case 447: /* like_pattern_opt */ - case 448: /* db_name_cond_opt */ - case 449: /* table_name_cond */ - case 450: /* from_db_opt */ - case 452: /* tag_item */ - case 456: /* full_tsma_name */ - case 458: /* index_options */ - case 459: /* full_index_name */ - case 461: /* sliding_opt */ - case 462: /* sma_stream_opt */ - case 463: /* func */ - case 467: /* query_or_subquery */ - case 468: /* where_clause_opt */ - case 471: /* explain_options */ - case 472: /* insert_query */ - case 477: /* full_view_name */ - case 480: /* stream_options */ - case 483: /* subtable_opt */ - case 486: /* column_stream_def */ - case 487: /* stream_col_options */ - case 488: /* expression */ - case 491: /* literal_func */ - case 492: /* signed_literal */ - case 495: /* expr_or_subquery */ - case 496: /* pseudo_column */ - case 497: /* column_reference */ - case 498: /* function_expression */ - case 499: /* case_when_expression */ - case 504: /* star_func_para */ - case 506: /* case_when_else_opt */ - case 507: /* common_expression */ - case 508: /* when_then_expr */ - case 509: /* predicate */ - case 512: /* in_predicate_value */ - case 513: /* boolean_value_expression */ - case 514: /* boolean_primary */ - case 515: /* from_clause_opt */ - case 516: /* table_reference_list */ - case 517: /* table_reference */ - case 518: /* table_primary */ - case 519: /* joined_table */ - case 521: /* subquery */ - case 522: /* parenthesized_joined_table */ - case 525: /* join_on_clause_opt */ - case 526: /* window_offset_clause_opt */ - case 527: /* jlimit_clause_opt */ - case 528: /* window_offset_literal */ - case 529: /* query_specification */ - case 535: /* range_opt */ - case 536: /* every_opt */ - case 537: /* fill_opt */ - case 538: /* twindow_clause_opt */ - case 540: /* having_clause_opt */ - case 541: /* select_item */ - case 543: /* partition_item */ - case 544: /* interval_sliding_duration_literal */ - case 547: /* query_expression */ - case 548: /* query_simple */ - case 550: /* slimit_clause_opt */ - case 551: /* limit_clause_opt */ - case 552: /* union_query_expression */ - case 553: /* query_simple_or_subquery */ - case 555: /* sort_specification */ -{ -#line 7 "sql.y" - nodesDestroyNode((yypminor->yy416)); -#line 3517 "sql.c" -} - break; - case 379: /* account_options */ - case 380: /* alter_account_options */ - case 382: /* alter_account_option */ - case 406: /* speed_opt */ - case 466: /* with_meta */ - case 475: /* bufsize_opt */ -{ -#line 54 "sql.y" - -#line 3529 "sql.c" -} - break; - case 383: /* ip_range_list */ - case 384: /* white_list */ - case 385: /* white_list_opt */ - case 409: /* integer_list */ - case 410: /* variable_list */ - case 411: /* retention_list */ - case 416: /* column_def_list */ - case 417: /* tags_def_opt */ - case 419: /* multi_create_clause */ - case 420: /* tag_list_opt */ - case 421: /* tags_def */ - case 422: /* multi_drop_clause */ - case 430: /* specific_cols_opt */ - case 431: /* tags_literal_list */ - case 433: /* col_name_list */ - case 434: /* tag_def_list */ - case 438: /* duration_list */ - case 439: /* rollup_func_list */ - case 457: /* func_list */ - case 465: /* expression_list */ - case 481: /* col_list_opt */ - case 482: /* tag_def_or_ref_opt */ - case 485: /* column_stream_def_list */ - case 490: /* dnode_list */ - case 493: /* literal_list */ - case 501: /* star_func_para_list */ - case 503: /* other_para_list */ - case 505: /* when_then_list */ - case 530: /* hint_list */ - case 533: /* select_list */ - case 534: /* partition_by_clause_opt */ - case 539: /* group_by_clause_opt */ - case 542: /* partition_list */ - case 546: /* group_by_list */ - case 549: /* order_by_clause_opt */ - case 554: /* sort_specification_list */ -{ -#line 85 "sql.y" - nodesDestroyList((yypminor->yy316)); -#line 3571 "sql.c" -} - break; - case 386: /* is_import_opt */ - case 387: /* is_createdb_opt */ - case 389: /* sysinfo_opt */ -{ -#line 99 "sql.y" - -#line 3580 "sql.c" -} - break; - case 388: /* user_name */ - case 395: /* db_name */ - case 396: /* table_name */ - case 397: /* topic_name */ - case 399: /* dnode_endpoint */ - case 425: /* column_name */ - case 443: /* function_name */ - case 453: /* column_alias */ - case 454: /* tsma_name */ - case 460: /* index_name */ - case 464: /* sma_func_name */ - case 469: /* cgroup_name */ - case 476: /* language_opt */ - case 478: /* view_name */ - case 479: /* stream_name */ - case 489: /* on_vgroup_id */ - case 494: /* table_alias */ - case 500: /* star_func */ - case 502: /* noarg_func */ - case 520: /* alias_opt */ -{ -#line 1082 "sql.y" - -#line 3606 "sql.c" -} - break; - case 390: /* privileges */ - case 393: /* priv_type_list */ - case 394: /* priv_type */ -{ -#line 131 "sql.y" - -#line 3615 "sql.c" -} - break; - case 391: /* priv_level */ -{ -#line 148 "sql.y" - -#line 3622 "sql.c" -} - break; - case 400: /* force_opt */ - case 401: /* unsafe_opt */ - case 402: /* not_exists_opt */ - case 404: /* exists_opt */ - case 470: /* analyze_opt */ - case 473: /* or_replace_opt */ - case 474: /* agg_func_opt */ - case 484: /* ignore_opt */ - case 531: /* set_quantifier_opt */ - case 532: /* tag_mode_opt */ -{ -#line 180 "sql.y" - -#line 3638 "sql.c" -} - break; - case 413: /* alter_db_option */ - case 440: /* alter_table_option */ -{ -#line 288 "sql.y" - -#line 3646 "sql.c" -} - break; - case 426: /* type_name */ - case 437: /* type_name_default_len */ -{ -#line 425 "sql.y" - -#line 3654 "sql.c" -} - break; - case 445: /* db_kind_opt */ - case 451: /* table_kind */ -{ -#line 604 "sql.y" - -#line 3662 "sql.c" -} - break; - case 446: /* table_kind_db_name_cond_opt */ -{ -#line 569 "sql.y" - -#line 3669 "sql.c" -} - break; - case 455: /* tsma_func_list */ -{ -#line 623 "sql.y" - nodesDestroyNode((yypminor->yy416)); -#line 3676 "sql.c" -} - break; - case 510: /* compare_op */ - case 511: /* in_op */ -{ -#line 1280 "sql.y" - -#line 3684 "sql.c" -} - break; - case 523: /* join_type */ -{ -#line 1361 "sql.y" - -#line 3691 "sql.c" -} - break; - case 524: /* join_subtype */ -{ -#line 1369 "sql.y" - -#line 3698 "sql.c" -} - break; - case 545: /* fill_mode */ -{ -#line 1485 "sql.y" - -#line 3705 "sql.c" -} - break; - case 556: /* ordering_specification_opt */ -{ -#line 1570 "sql.y" - -#line 3712 "sql.c" -} - break; - case 557: /* null_ordering_opt */ -{ -#line 1576 "sql.y" - -#line 3719 "sql.c" -} - break; -/********* End destructor definitions *****************************************/ + case 385: /* cmd */ + case 388: /* literal */ + case 399: /* with_opt */ + case 405: /* search_condition */ + case 410: /* db_options */ + case 412: /* alter_db_options */ + case 414: /* start_opt */ + case 415: /* end_opt */ + case 419: /* signed */ + case 421: /* retention */ + case 422: /* full_table_name */ + case 425: /* table_options */ + case 430: /* alter_table_clause */ + case 431: /* alter_table_options */ + case 434: /* column_options */ + case 435: /* tags_literal */ + case 436: /* create_subtable_clause */ + case 439: /* drop_table_clause */ + case 442: /* tag_def */ + case 443: /* column_def */ + case 448: /* duration_literal */ + case 449: /* rollup_func_name */ + case 451: /* col_name */ + case 454: /* like_pattern_opt */ + case 455: /* db_name_cond_opt */ + case 456: /* table_name_cond */ + case 457: /* from_db_opt */ + case 459: /* tag_item */ + case 463: /* full_tsma_name */ + case 465: /* index_options */ + case 466: /* full_index_name */ + case 468: /* sliding_opt */ + case 469: /* sma_stream_opt */ + case 470: /* func */ + case 474: /* query_or_subquery */ + case 475: /* where_clause_opt */ + case 478: /* explain_options */ + case 479: /* insert_query */ + case 484: /* full_view_name */ + case 487: /* stream_options */ + case 490: /* subtable_opt */ + case 493: /* column_stream_def */ + case 494: /* stream_col_options */ + case 495: /* expression */ + case 498: /* literal_func */ + case 499: /* signed_literal */ + case 502: /* expr_or_subquery */ + case 503: /* pseudo_column */ + case 504: /* column_reference */ + case 505: /* function_expression */ + case 506: /* case_when_expression */ + case 513: /* star_func_para */ + case 515: /* case_when_else_opt */ + case 516: /* common_expression */ + case 517: /* when_then_expr */ + case 518: /* predicate */ + case 521: /* in_predicate_value */ + case 522: /* boolean_value_expression */ + case 523: /* boolean_primary */ + case 524: /* from_clause_opt */ + case 525: /* table_reference_list */ + case 526: /* table_reference */ + case 527: /* table_primary */ + case 528: /* joined_table */ + case 530: /* subquery */ + case 531: /* parenthesized_joined_table */ + case 534: /* join_on_clause_opt */ + case 535: /* window_offset_clause_opt */ + case 536: /* jlimit_clause_opt */ + case 537: /* window_offset_literal */ + case 538: /* query_specification */ + case 544: /* range_opt */ + case 545: /* every_opt */ + case 546: /* fill_opt */ + case 547: /* twindow_clause_opt */ + case 549: /* having_clause_opt */ + case 550: /* select_item */ + case 552: /* partition_item */ + case 553: /* interval_sliding_duration_literal */ + case 556: /* query_expression */ + case 557: /* query_simple */ + case 559: /* slimit_clause_opt */ + case 560: /* limit_clause_opt */ + case 561: /* union_query_expression */ + case 562: /* query_simple_or_subquery */ + case 564: /* sort_specification */ + { + nodesDestroyNode((yypminor->yy560)); + } + break; + case 386: /* account_options */ + case 387: /* alter_account_options */ + case 389: /* alter_account_option */ + case 413: /* speed_opt */ + case 473: /* with_meta */ + case 482: /* bufsize_opt */ + { + + } + break; + case 390: /* ip_range_list */ + case 391: /* white_list */ + case 392: /* white_list_opt */ + case 416: /* integer_list */ + case 417: /* variable_list */ + case 418: /* retention_list */ + case 423: /* column_def_list */ + case 424: /* tags_def_opt */ + case 426: /* multi_create_clause */ + case 427: /* tag_list_opt */ + case 428: /* tags_def */ + case 429: /* multi_drop_clause */ + case 437: /* specific_cols_opt */ + case 438: /* tags_literal_list */ + case 440: /* col_name_list */ + case 441: /* tag_def_list */ + case 445: /* duration_list */ + case 446: /* rollup_func_list */ + case 464: /* func_list */ + case 472: /* expression_list */ + case 488: /* col_list_opt */ + case 489: /* tag_def_or_ref_opt */ + case 492: /* column_stream_def_list */ + case 497: /* dnode_list */ + case 500: /* literal_list */ + case 508: /* star_func_para_list */ + case 512: /* other_para_list */ + case 514: /* when_then_list */ + case 539: /* hint_list */ + case 542: /* select_list */ + case 543: /* partition_by_clause_opt */ + case 548: /* group_by_clause_opt */ + case 551: /* partition_list */ + case 555: /* group_by_list */ + case 558: /* order_by_clause_opt */ + case 563: /* sort_specification_list */ + { + nodesDestroyList((yypminor->yy334)); + } + break; + case 393: /* is_import_opt */ + case 394: /* is_createdb_opt */ + case 396: /* sysinfo_opt */ + { + + } + break; + case 395: /* user_name */ + case 402: /* db_name */ + case 403: /* table_name */ + case 404: /* topic_name */ + case 406: /* dnode_endpoint */ + case 432: /* column_name */ + case 450: /* function_name */ + case 460: /* column_alias */ + case 461: /* tsma_name */ + case 467: /* index_name */ + case 471: /* sma_func_name */ + case 476: /* cgroup_name */ + case 483: /* language_opt */ + case 485: /* view_name */ + case 486: /* stream_name */ + case 496: /* on_vgroup_id */ + case 501: /* table_alias */ + case 507: /* star_func */ + case 510: /* substr_func */ + case 511: /* noarg_func */ + case 529: /* alias_opt */ + { + + } + break; + case 397: /* privileges */ + case 400: /* priv_type_list */ + case 401: /* priv_type */ + { + + } + break; + case 398: /* priv_level */ + { + + } + break; + case 407: /* force_opt */ + case 408: /* unsafe_opt */ + case 409: /* not_exists_opt */ + case 411: /* exists_opt */ + case 477: /* analyze_opt */ + case 480: /* or_replace_opt */ + case 481: /* agg_func_opt */ + case 491: /* ignore_opt */ + case 540: /* set_quantifier_opt */ + case 541: /* tag_mode_opt */ + { + + } + break; + case 420: /* alter_db_option */ + case 447: /* alter_table_option */ + { + + } + break; + case 433: /* type_name */ + case 444: /* type_name_default_len */ + { + + } + break; + case 452: /* db_kind_opt */ + case 458: /* table_kind */ + { + + } + break; + case 453: /* table_kind_db_name_cond_opt */ + { + + } + break; + case 462: /* tsma_func_list */ + { + nodesDestroyNode((yypminor->yy560)); + } + break; + case 509: /* trim_specification_type */ + { + + } + break; + case 519: /* compare_op */ + case 520: /* in_op */ + { + + } + break; + case 532: /* join_type */ + { + + } + break; + case 533: /* join_subtype */ + { + + } + break; + case 554: /* fill_mode */ + { + + } + break; + case 565: /* ordering_specification_opt */ + { + + } + break; + case 566: /* null_ordering_opt */ + { + + } + break; + /********* End destructor definitions *****************************************/ default: break; /* If no destructor action specified: do nothing */ } } @@ -3738,8 +3958,8 @@ static void yy_pop_parser_stack(yyParser *pParser){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sPopping %s\n", - yyTracePrompt, - yyTokenName[yytos->major]); + yyTracePrompt, + yyTokenName[yytos->major]); } #endif yy_destructor(pParser, yytos->major, &yytos->minor); @@ -3750,14 +3970,31 @@ static void yy_pop_parser_stack(yyParser *pParser){ */ void ParseFinalize(void *p){ yyParser *pParser = (yyParser*)p; - while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); -#if YYSTACKDEPTH<=0 - if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack); + + /* In-lined version of calling yy_pop_parser_stack() for each + ** element left in the stack */ + yyStackEntry *yytos = pParser->yytos; + while( yytos>pParser->yystack ){ +#ifndef NDEBUG + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sPopping %s\n", + yyTracePrompt, + yyTokenName[yytos->major]); + } +#endif + if( yytos->major>=YY_MIN_DSTRCTR ){ + yy_destructor(pParser, yytos->major, &yytos->minor); + } + yytos--; + } + +#if YYGROWABLESTACK + if( pParser->yystack!=pParser->yystk0 ) YYFREE(pParser->yystack); #endif } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** @@ -3766,8 +4003,8 @@ void ParseFinalize(void *p){ ** assumed that the input pointer is never NULL. */ void ParseFree( - void *p, /* The parser to be deleted */ - void (*freeProc)(void*) /* Function used to reclaim memory */ + void *p, /* The parser to be deleted */ + void (*freeProc)(void*) /* Function used to reclaim memory */ ){ #ifndef YYPARSEFREENEVERNULL if( p==0 ) return; @@ -3829,8 +4066,8 @@ int ParseCoverage(FILE *out){ ** look-ahead token iLookAhead. */ static YYACTIONTYPE yy_find_shift_action( - YYCODETYPE iLookAhead, /* The look-ahead token */ - YYACTIONTYPE stateno /* Current state number */ + YYCODETYPE iLookAhead, /* The look-ahead token */ + YYACTIONTYPE stateno /* Current state number */ ){ int i; @@ -3857,7 +4094,7 @@ static YYACTIONTYPE yy_find_shift_action( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); + yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); } #endif assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ @@ -3873,8 +4110,8 @@ static YYACTIONTYPE yy_find_shift_action( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", - yyTracePrompt, yyTokenName[iLookAhead], - yyTokenName[YYWILDCARD]); + yyTracePrompt, yyTokenName[iLookAhead], + yyTokenName[YYWILDCARD]); } #endif /* NDEBUG */ return yy_action[j]; @@ -3894,8 +4131,8 @@ static YYACTIONTYPE yy_find_shift_action( ** look-ahead token iLookAhead. */ static YYACTIONTYPE yy_find_reduce_action( - YYACTIONTYPE stateno, /* Current state number */ - YYCODETYPE iLookAhead /* The look-ahead token */ + YYACTIONTYPE stateno, /* Current state number */ + YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; #ifdef YYERRORSYMBOL @@ -3923,20 +4160,20 @@ static YYACTIONTYPE yy_find_reduce_action( ** The following routine is called if the stack overflows. */ static void yyStackOverflow(yyParser *yypParser){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH + ParseCTX_FETCH #ifndef NDEBUG - if( yyTraceFILE ){ - fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); - } + if( yyTraceFILE ){ + fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); + } #endif - while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); - /* Here code is inserted which will execute if the parser + while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); + /* Here code is inserted which will execute if the parser ** stack every overflows */ -/******** Begin %stack_overflow code ******************************************/ -/******** End %stack_overflow code ********************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument var */ - ParseCTX_STORE + /******** Begin %stack_overflow code ******************************************/ + /******** End %stack_overflow code ********************************************/ + ParseARG_STORE /* Suppress warning about unused %extra_argument var */ + ParseCTX_STORE } /* @@ -3947,12 +4184,12 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ if( yyTraceFILE ){ if( yyNewStateyytos->major], - yyNewState); + yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], + yyNewState); }else{ fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n", - yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], - yyNewState - YY_MIN_REDUCE); + yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major], + yyNewState - YY_MIN_REDUCE); } } } @@ -3964,10 +4201,10 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ ** Perform a shift action. */ static void yy_shift( - yyParser *yypParser, /* The parser to be shifted */ - YYACTIONTYPE yyNewState, /* The new state to shift in */ - YYCODETYPE yyMajor, /* The major token to shift in */ - ParseTOKENTYPE yyMinor /* The minor token to shift in */ + yyParser *yypParser, /* The parser to be shifted */ + YYACTIONTYPE yyNewState, /* The new state to shift in */ + YYCODETYPE yyMajor, /* The major token to shift in */ + ParseTOKENTYPE yyMinor /* The minor token to shift in */ ){ yyStackEntry *yytos; yypParser->yytos++; @@ -3977,25 +4214,19 @@ static void yy_shift( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); } #endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>yypParser->yystackEnd ){ - yypParser->yytos--; - yyStackOverflow(yypParser); - return; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ + yytos = yypParser->yytos; + if( yytos>yypParser->yystackEnd ){ if( yyGrowStack(yypParser) ){ yypParser->yytos--; yyStackOverflow(yypParser); return; } + yytos = yypParser->yytos; + assert( yytos <= yypParser->yystackEnd ); } -#endif if( yyNewState > YY_MAX_SHIFT ){ yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; } - yytos = yypParser->yytos; yytos->stateno = yyNewState; yytos->major = yyMajor; yytos->minor.yy0 = yyMinor; @@ -4005,1521 +4236,1551 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 378, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 378, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 379, /* (2) account_options ::= */ - 379, /* (3) account_options ::= account_options PPS literal */ - 379, /* (4) account_options ::= account_options TSERIES literal */ - 379, /* (5) account_options ::= account_options STORAGE literal */ - 379, /* (6) account_options ::= account_options STREAMS literal */ - 379, /* (7) account_options ::= account_options QTIME literal */ - 379, /* (8) account_options ::= account_options DBS literal */ - 379, /* (9) account_options ::= account_options USERS literal */ - 379, /* (10) account_options ::= account_options CONNS literal */ - 379, /* (11) account_options ::= account_options STATE literal */ - 380, /* (12) alter_account_options ::= alter_account_option */ - 380, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 382, /* (14) alter_account_option ::= PASS literal */ - 382, /* (15) alter_account_option ::= PPS literal */ - 382, /* (16) alter_account_option ::= TSERIES literal */ - 382, /* (17) alter_account_option ::= STORAGE literal */ - 382, /* (18) alter_account_option ::= STREAMS literal */ - 382, /* (19) alter_account_option ::= QTIME literal */ - 382, /* (20) alter_account_option ::= DBS literal */ - 382, /* (21) alter_account_option ::= USERS literal */ - 382, /* (22) alter_account_option ::= CONNS literal */ - 382, /* (23) alter_account_option ::= STATE literal */ - 383, /* (24) ip_range_list ::= NK_STRING */ - 383, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 384, /* (26) white_list ::= HOST ip_range_list */ - 385, /* (27) white_list_opt ::= */ - 385, /* (28) white_list_opt ::= white_list */ - 386, /* (29) is_import_opt ::= */ - 386, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ - 387, /* (31) is_createdb_opt ::= */ - 387, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ - 378, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ - 378, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ - 378, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 378, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 378, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - 378, /* (38) cmd ::= ALTER USER user_name ADD white_list */ - 378, /* (39) cmd ::= ALTER USER user_name DROP white_list */ - 378, /* (40) cmd ::= DROP USER user_name */ - 389, /* (41) sysinfo_opt ::= */ - 389, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 378, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 378, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 390, /* (45) privileges ::= ALL */ - 390, /* (46) privileges ::= priv_type_list */ - 390, /* (47) privileges ::= SUBSCRIBE */ - 393, /* (48) priv_type_list ::= priv_type */ - 393, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 394, /* (50) priv_type ::= READ */ - 394, /* (51) priv_type ::= WRITE */ - 394, /* (52) priv_type ::= ALTER */ - 391, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 391, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ - 391, /* (55) priv_level ::= db_name NK_DOT table_name */ - 391, /* (56) priv_level ::= topic_name */ - 392, /* (57) with_opt ::= */ - 392, /* (58) with_opt ::= WITH search_condition */ - 378, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - 378, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ - 378, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 378, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 378, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 378, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 378, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 378, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 378, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 378, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ - 378, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 378, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ - 399, /* (71) dnode_endpoint ::= NK_STRING */ - 399, /* (72) dnode_endpoint ::= NK_ID */ - 399, /* (73) dnode_endpoint ::= NK_IPTOKEN */ - 400, /* (74) force_opt ::= */ - 400, /* (75) force_opt ::= FORCE */ - 401, /* (76) unsafe_opt ::= UNSAFE */ - 378, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ - 378, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 378, /* (79) cmd ::= ALTER LOCAL NK_STRING */ - 378, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 378, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 378, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 378, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 378, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 378, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 378, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 378, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 378, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 378, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 378, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 378, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 378, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 378, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ - 378, /* (94) cmd ::= USE db_name */ - 378, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ - 378, /* (96) cmd ::= FLUSH DATABASE db_name */ - 378, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ - 378, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ - 378, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 402, /* (100) not_exists_opt ::= IF NOT EXISTS */ - 402, /* (101) not_exists_opt ::= */ - 404, /* (102) exists_opt ::= IF EXISTS */ - 404, /* (103) exists_opt ::= */ - 403, /* (104) db_options ::= */ - 403, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ - 403, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ - 403, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ - 403, /* (108) db_options ::= db_options COMP NK_INTEGER */ - 403, /* (109) db_options ::= db_options DURATION NK_INTEGER */ - 403, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ - 403, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ - 403, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ - 403, /* (113) db_options ::= db_options KEEP integer_list */ - 403, /* (114) db_options ::= db_options KEEP variable_list */ - 403, /* (115) db_options ::= db_options PAGES NK_INTEGER */ - 403, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ - 403, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 403, /* (118) db_options ::= db_options PRECISION NK_STRING */ - 403, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ - 403, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ - 403, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 403, /* (122) db_options ::= db_options RETENTIONS retention_list */ - 403, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 403, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 403, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 403, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 403, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 403, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 403, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 403, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 403, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 403, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 403, /* (133) db_options ::= db_options TABLE_PREFIX signed */ - 403, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ - 403, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - 403, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - 403, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - 403, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ - 403, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 403, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - 405, /* (141) alter_db_options ::= alter_db_option */ - 405, /* (142) alter_db_options ::= alter_db_options alter_db_option */ - 413, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ - 413, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ - 413, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ - 413, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 413, /* (147) alter_db_option ::= KEEP integer_list */ - 413, /* (148) alter_db_option ::= KEEP variable_list */ - 413, /* (149) alter_db_option ::= PAGES NK_INTEGER */ - 413, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ - 413, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 413, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 413, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ - 413, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 413, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 413, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 413, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 413, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - 413, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - 413, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ - 413, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 413, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - 409, /* (163) integer_list ::= NK_INTEGER */ - 409, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 410, /* (165) variable_list ::= NK_VARIABLE */ - 410, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 411, /* (167) retention_list ::= retention */ - 411, /* (168) retention_list ::= retention_list NK_COMMA retention */ - 414, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 414, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 406, /* (171) speed_opt ::= */ - 406, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ - 407, /* (173) start_opt ::= */ - 407, /* (174) start_opt ::= START WITH NK_INTEGER */ - 407, /* (175) start_opt ::= START WITH NK_STRING */ - 407, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 408, /* (177) end_opt ::= */ - 408, /* (178) end_opt ::= END WITH NK_INTEGER */ - 408, /* (179) end_opt ::= END WITH NK_STRING */ - 408, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 378, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 378, /* (182) cmd ::= CREATE TABLE multi_create_clause */ - 378, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - 378, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 378, /* (185) cmd ::= DROP TABLE multi_drop_clause */ - 378, /* (186) cmd ::= DROP STABLE exists_opt full_table_name */ - 378, /* (187) cmd ::= ALTER TABLE alter_table_clause */ - 378, /* (188) cmd ::= ALTER STABLE alter_table_clause */ - 423, /* (189) alter_table_clause ::= full_table_name alter_table_options */ - 423, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - 423, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 423, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 423, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - 423, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 423, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 423, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ - 423, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 423, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 423, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 419, /* (200) multi_create_clause ::= create_subtable_clause */ - 419, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 429, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 422, /* (203) multi_drop_clause ::= drop_table_clause */ - 422, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 432, /* (205) drop_table_clause ::= exists_opt full_table_name */ - 430, /* (206) specific_cols_opt ::= */ - 430, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 415, /* (208) full_table_name ::= table_name */ - 415, /* (209) full_table_name ::= db_name NK_DOT table_name */ - 434, /* (210) tag_def_list ::= tag_def */ - 434, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - 435, /* (212) tag_def ::= column_name type_name */ - 416, /* (213) column_def_list ::= column_def */ - 416, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ - 436, /* (215) column_def ::= column_name type_name column_options */ - 426, /* (216) type_name ::= BOOL */ - 426, /* (217) type_name ::= TINYINT */ - 426, /* (218) type_name ::= SMALLINT */ - 426, /* (219) type_name ::= INT */ - 426, /* (220) type_name ::= INTEGER */ - 426, /* (221) type_name ::= BIGINT */ - 426, /* (222) type_name ::= FLOAT */ - 426, /* (223) type_name ::= DOUBLE */ - 426, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 426, /* (225) type_name ::= TIMESTAMP */ - 426, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 426, /* (227) type_name ::= TINYINT UNSIGNED */ - 426, /* (228) type_name ::= SMALLINT UNSIGNED */ - 426, /* (229) type_name ::= INT UNSIGNED */ - 426, /* (230) type_name ::= BIGINT UNSIGNED */ - 426, /* (231) type_name ::= JSON */ - 426, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 426, /* (233) type_name ::= MEDIUMBLOB */ - 426, /* (234) type_name ::= BLOB */ - 426, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 426, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 426, /* (237) type_name ::= DECIMAL */ - 426, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 426, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 437, /* (240) type_name_default_len ::= BINARY */ - 437, /* (241) type_name_default_len ::= NCHAR */ - 437, /* (242) type_name_default_len ::= VARCHAR */ - 437, /* (243) type_name_default_len ::= VARBINARY */ - 417, /* (244) tags_def_opt ::= */ - 417, /* (245) tags_def_opt ::= tags_def */ - 421, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - 418, /* (247) table_options ::= */ - 418, /* (248) table_options ::= table_options COMMENT NK_STRING */ - 418, /* (249) table_options ::= table_options MAX_DELAY duration_list */ - 418, /* (250) table_options ::= table_options WATERMARK duration_list */ - 418, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 418, /* (252) table_options ::= table_options TTL NK_INTEGER */ - 418, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 418, /* (254) table_options ::= table_options DELETE_MARK duration_list */ - 424, /* (255) alter_table_options ::= alter_table_option */ - 424, /* (256) alter_table_options ::= alter_table_options alter_table_option */ - 440, /* (257) alter_table_option ::= COMMENT NK_STRING */ - 440, /* (258) alter_table_option ::= TTL NK_INTEGER */ - 438, /* (259) duration_list ::= duration_literal */ - 438, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ - 439, /* (261) rollup_func_list ::= rollup_func_name */ - 439, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 442, /* (263) rollup_func_name ::= function_name */ - 442, /* (264) rollup_func_name ::= FIRST */ - 442, /* (265) rollup_func_name ::= LAST */ - 433, /* (266) col_name_list ::= col_name */ - 433, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ - 444, /* (268) col_name ::= column_name */ - 378, /* (269) cmd ::= SHOW DNODES */ - 378, /* (270) cmd ::= SHOW USERS */ - 378, /* (271) cmd ::= SHOW USERS FULL */ - 378, /* (272) cmd ::= SHOW USER PRIVILEGES */ - 378, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ - 378, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 378, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 378, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 378, /* (277) cmd ::= SHOW MNODES */ - 378, /* (278) cmd ::= SHOW QNODES */ - 378, /* (279) cmd ::= SHOW ARBGROUPS */ - 378, /* (280) cmd ::= SHOW FUNCTIONS */ - 378, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 378, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 378, /* (283) cmd ::= SHOW STREAMS */ - 378, /* (284) cmd ::= SHOW ACCOUNTS */ - 378, /* (285) cmd ::= SHOW APPS */ - 378, /* (286) cmd ::= SHOW CONNECTIONS */ - 378, /* (287) cmd ::= SHOW LICENCES */ - 378, /* (288) cmd ::= SHOW GRANTS */ - 378, /* (289) cmd ::= SHOW GRANTS FULL */ - 378, /* (290) cmd ::= SHOW GRANTS LOGS */ - 378, /* (291) cmd ::= SHOW CLUSTER MACHINES */ - 378, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ - 378, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ - 378, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ - 378, /* (295) cmd ::= SHOW ENCRYPTIONS */ - 378, /* (296) cmd ::= SHOW QUERIES */ - 378, /* (297) cmd ::= SHOW SCORES */ - 378, /* (298) cmd ::= SHOW TOPICS */ - 378, /* (299) cmd ::= SHOW VARIABLES */ - 378, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ - 378, /* (301) cmd ::= SHOW LOCAL VARIABLES */ - 378, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 378, /* (303) cmd ::= SHOW BNODES */ - 378, /* (304) cmd ::= SHOW SNODES */ - 378, /* (305) cmd ::= SHOW CLUSTER */ - 378, /* (306) cmd ::= SHOW TRANSACTIONS */ - 378, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 378, /* (308) cmd ::= SHOW CONSUMERS */ - 378, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ - 378, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 378, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 378, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 378, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 378, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 378, /* (315) cmd ::= SHOW VNODES */ - 378, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ - 378, /* (317) cmd ::= SHOW CLUSTER ALIVE */ - 378, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 378, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ - 378, /* (320) cmd ::= SHOW COMPACTS */ - 378, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ - 446, /* (322) table_kind_db_name_cond_opt ::= */ - 446, /* (323) table_kind_db_name_cond_opt ::= table_kind */ - 446, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 446, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 451, /* (326) table_kind ::= NORMAL */ - 451, /* (327) table_kind ::= CHILD */ - 448, /* (328) db_name_cond_opt ::= */ - 448, /* (329) db_name_cond_opt ::= db_name NK_DOT */ - 447, /* (330) like_pattern_opt ::= */ - 447, /* (331) like_pattern_opt ::= LIKE NK_STRING */ - 449, /* (332) table_name_cond ::= table_name */ - 450, /* (333) from_db_opt ::= */ - 450, /* (334) from_db_opt ::= FROM db_name */ - 420, /* (335) tag_list_opt ::= */ - 420, /* (336) tag_list_opt ::= tag_item */ - 420, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 452, /* (338) tag_item ::= TBNAME */ - 452, /* (339) tag_item ::= QTAGS */ - 452, /* (340) tag_item ::= column_name */ - 452, /* (341) tag_item ::= column_name column_alias */ - 452, /* (342) tag_item ::= column_name AS column_alias */ - 445, /* (343) db_kind_opt ::= */ - 445, /* (344) db_kind_opt ::= USER */ - 445, /* (345) db_kind_opt ::= SYSTEM */ - 378, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - 378, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - 378, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ - 378, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ - 456, /* (350) full_tsma_name ::= tsma_name */ - 456, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ - 455, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - 378, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 378, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 378, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ - 459, /* (356) full_index_name ::= index_name */ - 459, /* (357) full_index_name ::= db_name NK_DOT index_name */ - 458, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 458, /* (359) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - 457, /* (360) func_list ::= func */ - 457, /* (361) func_list ::= func_list NK_COMMA func */ - 463, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ - 464, /* (363) sma_func_name ::= function_name */ - 464, /* (364) sma_func_name ::= COUNT */ - 464, /* (365) sma_func_name ::= FIRST */ - 464, /* (366) sma_func_name ::= LAST */ - 464, /* (367) sma_func_name ::= LAST_ROW */ - 462, /* (368) sma_stream_opt ::= */ - 462, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 462, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 462, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 466, /* (372) with_meta ::= AS */ - 466, /* (373) with_meta ::= WITH META AS */ - 466, /* (374) with_meta ::= ONLY META AS */ - 378, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 378, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 378, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 378, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ - 378, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 378, /* (380) cmd ::= DESC full_table_name */ - 378, /* (381) cmd ::= DESCRIBE full_table_name */ - 378, /* (382) cmd ::= RESET QUERY CACHE */ - 378, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 378, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 470, /* (385) analyze_opt ::= */ - 470, /* (386) analyze_opt ::= ANALYZE */ - 471, /* (387) explain_options ::= */ - 471, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ - 471, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ - 378, /* (390) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 378, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ - 474, /* (392) agg_func_opt ::= */ - 474, /* (393) agg_func_opt ::= AGGREGATE */ - 475, /* (394) bufsize_opt ::= */ - 475, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 476, /* (396) language_opt ::= */ - 476, /* (397) language_opt ::= LANGUAGE NK_STRING */ - 473, /* (398) or_replace_opt ::= */ - 473, /* (399) or_replace_opt ::= OR REPLACE */ - 378, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 378, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ - 477, /* (402) full_view_name ::= view_name */ - 477, /* (403) full_view_name ::= db_name NK_DOT view_name */ - 378, /* (404) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 378, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ - 378, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ - 378, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 481, /* (408) col_list_opt ::= */ - 481, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - 485, /* (410) column_stream_def_list ::= column_stream_def */ - 485, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - 486, /* (412) column_stream_def ::= column_name stream_col_options */ - 487, /* (413) stream_col_options ::= */ - 487, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ - 482, /* (415) tag_def_or_ref_opt ::= */ - 482, /* (416) tag_def_or_ref_opt ::= tags_def */ - 482, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ - 480, /* (418) stream_options ::= */ - 480, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ - 480, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 480, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 480, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ - 480, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 480, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 480, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ - 480, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 483, /* (427) subtable_opt ::= */ - 483, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 484, /* (429) ignore_opt ::= */ - 484, /* (430) ignore_opt ::= IGNORE UNTREATED */ - 378, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ - 378, /* (432) cmd ::= KILL QUERY NK_STRING */ - 378, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ - 378, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ - 378, /* (435) cmd ::= BALANCE VGROUP */ - 378, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 378, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - 378, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 378, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 378, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ - 489, /* (441) on_vgroup_id ::= */ - 489, /* (442) on_vgroup_id ::= ON NK_INTEGER */ - 490, /* (443) dnode_list ::= DNODE NK_INTEGER */ - 490, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 378, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 378, /* (446) cmd ::= query_or_subquery */ - 378, /* (447) cmd ::= insert_query */ - 472, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 472, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 428, /* (450) tags_literal ::= NK_INTEGER */ - 428, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - 428, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - 428, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ - 428, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - 428, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - 428, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ - 428, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - 428, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - 428, /* (459) tags_literal ::= NK_FLOAT */ - 428, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ - 428, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ - 428, /* (462) tags_literal ::= NK_BIN */ - 428, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - 428, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - 428, /* (465) tags_literal ::= NK_PLUS NK_BIN */ - 428, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - 428, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - 428, /* (468) tags_literal ::= NK_MINUS NK_BIN */ - 428, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - 428, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - 428, /* (471) tags_literal ::= NK_HEX */ - 428, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - 428, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - 428, /* (474) tags_literal ::= NK_PLUS NK_HEX */ - 428, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - 428, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - 428, /* (477) tags_literal ::= NK_MINUS NK_HEX */ - 428, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - 428, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - 428, /* (480) tags_literal ::= NK_STRING */ - 428, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - 428, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - 428, /* (483) tags_literal ::= NK_BOOL */ - 428, /* (484) tags_literal ::= NULL */ - 428, /* (485) tags_literal ::= literal_func */ - 428, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ - 428, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ - 431, /* (488) tags_literal_list ::= tags_literal */ - 431, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 381, /* (490) literal ::= NK_INTEGER */ - 381, /* (491) literal ::= NK_FLOAT */ - 381, /* (492) literal ::= NK_STRING */ - 381, /* (493) literal ::= NK_BOOL */ - 381, /* (494) literal ::= TIMESTAMP NK_STRING */ - 381, /* (495) literal ::= duration_literal */ - 381, /* (496) literal ::= NULL */ - 381, /* (497) literal ::= NK_QUESTION */ - 441, /* (498) duration_literal ::= NK_VARIABLE */ - 412, /* (499) signed ::= NK_INTEGER */ - 412, /* (500) signed ::= NK_PLUS NK_INTEGER */ - 412, /* (501) signed ::= NK_MINUS NK_INTEGER */ - 412, /* (502) signed ::= NK_FLOAT */ - 412, /* (503) signed ::= NK_PLUS NK_FLOAT */ - 412, /* (504) signed ::= NK_MINUS NK_FLOAT */ - 492, /* (505) signed_literal ::= signed */ - 492, /* (506) signed_literal ::= NK_STRING */ - 492, /* (507) signed_literal ::= NK_BOOL */ - 492, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ - 492, /* (509) signed_literal ::= duration_literal */ - 492, /* (510) signed_literal ::= NULL */ - 492, /* (511) signed_literal ::= literal_func */ - 492, /* (512) signed_literal ::= NK_QUESTION */ - 493, /* (513) literal_list ::= signed_literal */ - 493, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ - 395, /* (515) db_name ::= NK_ID */ - 396, /* (516) table_name ::= NK_ID */ - 425, /* (517) column_name ::= NK_ID */ - 443, /* (518) function_name ::= NK_ID */ - 478, /* (519) view_name ::= NK_ID */ - 494, /* (520) table_alias ::= NK_ID */ - 453, /* (521) column_alias ::= NK_ID */ - 453, /* (522) column_alias ::= NK_ALIAS */ - 388, /* (523) user_name ::= NK_ID */ - 397, /* (524) topic_name ::= NK_ID */ - 479, /* (525) stream_name ::= NK_ID */ - 469, /* (526) cgroup_name ::= NK_ID */ - 460, /* (527) index_name ::= NK_ID */ - 454, /* (528) tsma_name ::= NK_ID */ - 495, /* (529) expr_or_subquery ::= expression */ - 488, /* (530) expression ::= literal */ - 488, /* (531) expression ::= pseudo_column */ - 488, /* (532) expression ::= column_reference */ - 488, /* (533) expression ::= function_expression */ - 488, /* (534) expression ::= case_when_expression */ - 488, /* (535) expression ::= NK_LP expression NK_RP */ - 488, /* (536) expression ::= NK_PLUS expr_or_subquery */ - 488, /* (537) expression ::= NK_MINUS expr_or_subquery */ - 488, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 488, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 488, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 488, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 488, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 488, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ - 488, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 488, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 465, /* (546) expression_list ::= expr_or_subquery */ - 465, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 497, /* (548) column_reference ::= column_name */ - 497, /* (549) column_reference ::= table_name NK_DOT column_name */ - 497, /* (550) column_reference ::= NK_ALIAS */ - 497, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ - 496, /* (552) pseudo_column ::= ROWTS */ - 496, /* (553) pseudo_column ::= TBNAME */ - 496, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ - 496, /* (555) pseudo_column ::= QSTART */ - 496, /* (556) pseudo_column ::= QEND */ - 496, /* (557) pseudo_column ::= QDURATION */ - 496, /* (558) pseudo_column ::= WSTART */ - 496, /* (559) pseudo_column ::= WEND */ - 496, /* (560) pseudo_column ::= WDURATION */ - 496, /* (561) pseudo_column ::= IROWTS */ - 496, /* (562) pseudo_column ::= ISFILLED */ - 496, /* (563) pseudo_column ::= QTAGS */ - 498, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ - 498, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 498, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 498, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - 498, /* (568) function_expression ::= literal_func */ - 491, /* (569) literal_func ::= noarg_func NK_LP NK_RP */ - 491, /* (570) literal_func ::= NOW */ - 491, /* (571) literal_func ::= TODAY */ - 502, /* (572) noarg_func ::= NOW */ - 502, /* (573) noarg_func ::= TODAY */ - 502, /* (574) noarg_func ::= TIMEZONE */ - 502, /* (575) noarg_func ::= DATABASE */ - 502, /* (576) noarg_func ::= CLIENT_VERSION */ - 502, /* (577) noarg_func ::= SERVER_VERSION */ - 502, /* (578) noarg_func ::= SERVER_STATUS */ - 502, /* (579) noarg_func ::= CURRENT_USER */ - 502, /* (580) noarg_func ::= USER */ - 500, /* (581) star_func ::= COUNT */ - 500, /* (582) star_func ::= FIRST */ - 500, /* (583) star_func ::= LAST */ - 500, /* (584) star_func ::= LAST_ROW */ - 501, /* (585) star_func_para_list ::= NK_STAR */ - 501, /* (586) star_func_para_list ::= other_para_list */ - 503, /* (587) other_para_list ::= star_func_para */ - 503, /* (588) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 504, /* (589) star_func_para ::= expr_or_subquery */ - 504, /* (590) star_func_para ::= table_name NK_DOT NK_STAR */ - 499, /* (591) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 499, /* (592) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 505, /* (593) when_then_list ::= when_then_expr */ - 505, /* (594) when_then_list ::= when_then_list when_then_expr */ - 508, /* (595) when_then_expr ::= WHEN common_expression THEN common_expression */ - 506, /* (596) case_when_else_opt ::= */ - 506, /* (597) case_when_else_opt ::= ELSE common_expression */ - 509, /* (598) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 509, /* (599) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 509, /* (600) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 509, /* (601) predicate ::= expr_or_subquery IS NULL */ - 509, /* (602) predicate ::= expr_or_subquery IS NOT NULL */ - 509, /* (603) predicate ::= expr_or_subquery in_op in_predicate_value */ - 510, /* (604) compare_op ::= NK_LT */ - 510, /* (605) compare_op ::= NK_GT */ - 510, /* (606) compare_op ::= NK_LE */ - 510, /* (607) compare_op ::= NK_GE */ - 510, /* (608) compare_op ::= NK_NE */ - 510, /* (609) compare_op ::= NK_EQ */ - 510, /* (610) compare_op ::= LIKE */ - 510, /* (611) compare_op ::= NOT LIKE */ - 510, /* (612) compare_op ::= MATCH */ - 510, /* (613) compare_op ::= NMATCH */ - 510, /* (614) compare_op ::= CONTAINS */ - 511, /* (615) in_op ::= IN */ - 511, /* (616) in_op ::= NOT IN */ - 512, /* (617) in_predicate_value ::= NK_LP literal_list NK_RP */ - 513, /* (618) boolean_value_expression ::= boolean_primary */ - 513, /* (619) boolean_value_expression ::= NOT boolean_primary */ - 513, /* (620) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 513, /* (621) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 514, /* (622) boolean_primary ::= predicate */ - 514, /* (623) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 507, /* (624) common_expression ::= expr_or_subquery */ - 507, /* (625) common_expression ::= boolean_value_expression */ - 515, /* (626) from_clause_opt ::= */ - 515, /* (627) from_clause_opt ::= FROM table_reference_list */ - 516, /* (628) table_reference_list ::= table_reference */ - 516, /* (629) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 517, /* (630) table_reference ::= table_primary */ - 517, /* (631) table_reference ::= joined_table */ - 518, /* (632) table_primary ::= table_name alias_opt */ - 518, /* (633) table_primary ::= db_name NK_DOT table_name alias_opt */ - 518, /* (634) table_primary ::= subquery alias_opt */ - 518, /* (635) table_primary ::= parenthesized_joined_table */ - 520, /* (636) alias_opt ::= */ - 520, /* (637) alias_opt ::= table_alias */ - 520, /* (638) alias_opt ::= AS table_alias */ - 522, /* (639) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 522, /* (640) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 519, /* (641) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 523, /* (642) join_type ::= */ - 523, /* (643) join_type ::= INNER */ - 523, /* (644) join_type ::= LEFT */ - 523, /* (645) join_type ::= RIGHT */ - 523, /* (646) join_type ::= FULL */ - 524, /* (647) join_subtype ::= */ - 524, /* (648) join_subtype ::= OUTER */ - 524, /* (649) join_subtype ::= SEMI */ - 524, /* (650) join_subtype ::= ANTI */ - 524, /* (651) join_subtype ::= ASOF */ - 524, /* (652) join_subtype ::= WINDOW */ - 525, /* (653) join_on_clause_opt ::= */ - 525, /* (654) join_on_clause_opt ::= ON search_condition */ - 526, /* (655) window_offset_clause_opt ::= */ - 526, /* (656) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 528, /* (657) window_offset_literal ::= NK_VARIABLE */ - 528, /* (658) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 527, /* (659) jlimit_clause_opt ::= */ - 527, /* (660) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 529, /* (661) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 530, /* (662) hint_list ::= */ - 530, /* (663) hint_list ::= NK_HINT */ - 532, /* (664) tag_mode_opt ::= */ - 532, /* (665) tag_mode_opt ::= TAGS */ - 531, /* (666) set_quantifier_opt ::= */ - 531, /* (667) set_quantifier_opt ::= DISTINCT */ - 531, /* (668) set_quantifier_opt ::= ALL */ - 533, /* (669) select_list ::= select_item */ - 533, /* (670) select_list ::= select_list NK_COMMA select_item */ - 541, /* (671) select_item ::= NK_STAR */ - 541, /* (672) select_item ::= common_expression */ - 541, /* (673) select_item ::= common_expression column_alias */ - 541, /* (674) select_item ::= common_expression AS column_alias */ - 541, /* (675) select_item ::= table_name NK_DOT NK_STAR */ - 468, /* (676) where_clause_opt ::= */ - 468, /* (677) where_clause_opt ::= WHERE search_condition */ - 534, /* (678) partition_by_clause_opt ::= */ - 534, /* (679) partition_by_clause_opt ::= PARTITION BY partition_list */ - 542, /* (680) partition_list ::= partition_item */ - 542, /* (681) partition_list ::= partition_list NK_COMMA partition_item */ - 543, /* (682) partition_item ::= expr_or_subquery */ - 543, /* (683) partition_item ::= expr_or_subquery column_alias */ - 543, /* (684) partition_item ::= expr_or_subquery AS column_alias */ - 538, /* (685) twindow_clause_opt ::= */ - 538, /* (686) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 538, /* (687) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 538, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 538, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 538, /* (690) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 538, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 538, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 461, /* (693) sliding_opt ::= */ - 461, /* (694) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 544, /* (695) interval_sliding_duration_literal ::= NK_VARIABLE */ - 544, /* (696) interval_sliding_duration_literal ::= NK_STRING */ - 544, /* (697) interval_sliding_duration_literal ::= NK_INTEGER */ - 537, /* (698) fill_opt ::= */ - 537, /* (699) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 537, /* (700) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 537, /* (701) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 545, /* (702) fill_mode ::= NONE */ - 545, /* (703) fill_mode ::= PREV */ - 545, /* (704) fill_mode ::= NULL */ - 545, /* (705) fill_mode ::= NULL_F */ - 545, /* (706) fill_mode ::= LINEAR */ - 545, /* (707) fill_mode ::= NEXT */ - 539, /* (708) group_by_clause_opt ::= */ - 539, /* (709) group_by_clause_opt ::= GROUP BY group_by_list */ - 546, /* (710) group_by_list ::= expr_or_subquery */ - 546, /* (711) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 540, /* (712) having_clause_opt ::= */ - 540, /* (713) having_clause_opt ::= HAVING search_condition */ - 535, /* (714) range_opt ::= */ - 535, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 535, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 536, /* (717) every_opt ::= */ - 536, /* (718) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 547, /* (719) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 548, /* (720) query_simple ::= query_specification */ - 548, /* (721) query_simple ::= union_query_expression */ - 552, /* (722) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 552, /* (723) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 553, /* (724) query_simple_or_subquery ::= query_simple */ - 553, /* (725) query_simple_or_subquery ::= subquery */ - 467, /* (726) query_or_subquery ::= query_expression */ - 467, /* (727) query_or_subquery ::= subquery */ - 549, /* (728) order_by_clause_opt ::= */ - 549, /* (729) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 550, /* (730) slimit_clause_opt ::= */ - 550, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 550, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 550, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 551, /* (734) limit_clause_opt ::= */ - 551, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER */ - 551, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 551, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 521, /* (738) subquery ::= NK_LP query_expression NK_RP */ - 521, /* (739) subquery ::= NK_LP subquery NK_RP */ - 398, /* (740) search_condition ::= common_expression */ - 554, /* (741) sort_specification_list ::= sort_specification */ - 554, /* (742) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 555, /* (743) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 556, /* (744) ordering_specification_opt ::= */ - 556, /* (745) ordering_specification_opt ::= ASC */ - 556, /* (746) ordering_specification_opt ::= DESC */ - 557, /* (747) null_ordering_opt ::= */ - 557, /* (748) null_ordering_opt ::= NULLS FIRST */ - 557, /* (749) null_ordering_opt ::= NULLS LAST */ - 427, /* (750) column_options ::= */ - 427, /* (751) column_options ::= column_options PRIMARY KEY */ - 427, /* (752) column_options ::= column_options ENCODE NK_STRING */ - 427, /* (753) column_options ::= column_options COMPRESS NK_STRING */ - 427, /* (754) column_options ::= column_options LEVEL NK_STRING */ + 385, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 385, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 386, /* (2) account_options ::= */ + 386, /* (3) account_options ::= account_options PPS literal */ + 386, /* (4) account_options ::= account_options TSERIES literal */ + 386, /* (5) account_options ::= account_options STORAGE literal */ + 386, /* (6) account_options ::= account_options STREAMS literal */ + 386, /* (7) account_options ::= account_options QTIME literal */ + 386, /* (8) account_options ::= account_options DBS literal */ + 386, /* (9) account_options ::= account_options USERS literal */ + 386, /* (10) account_options ::= account_options CONNS literal */ + 386, /* (11) account_options ::= account_options STATE literal */ + 387, /* (12) alter_account_options ::= alter_account_option */ + 387, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 389, /* (14) alter_account_option ::= PASS literal */ + 389, /* (15) alter_account_option ::= PPS literal */ + 389, /* (16) alter_account_option ::= TSERIES literal */ + 389, /* (17) alter_account_option ::= STORAGE literal */ + 389, /* (18) alter_account_option ::= STREAMS literal */ + 389, /* (19) alter_account_option ::= QTIME literal */ + 389, /* (20) alter_account_option ::= DBS literal */ + 389, /* (21) alter_account_option ::= USERS literal */ + 389, /* (22) alter_account_option ::= CONNS literal */ + 389, /* (23) alter_account_option ::= STATE literal */ + 390, /* (24) ip_range_list ::= NK_STRING */ + 390, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 391, /* (26) white_list ::= HOST ip_range_list */ + 392, /* (27) white_list_opt ::= */ + 392, /* (28) white_list_opt ::= white_list */ + 393, /* (29) is_import_opt ::= */ + 393, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ + 394, /* (31) is_createdb_opt ::= */ + 394, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ + 385, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + 385, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ + 385, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 385, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 385, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + 385, /* (38) cmd ::= ALTER USER user_name ADD white_list */ + 385, /* (39) cmd ::= ALTER USER user_name DROP white_list */ + 385, /* (40) cmd ::= DROP USER user_name */ + 396, /* (41) sysinfo_opt ::= */ + 396, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 385, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 385, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 397, /* (45) privileges ::= ALL */ + 397, /* (46) privileges ::= priv_type_list */ + 397, /* (47) privileges ::= SUBSCRIBE */ + 400, /* (48) priv_type_list ::= priv_type */ + 400, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 401, /* (50) priv_type ::= READ */ + 401, /* (51) priv_type ::= WRITE */ + 401, /* (52) priv_type ::= ALTER */ + 398, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 398, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ + 398, /* (55) priv_level ::= db_name NK_DOT table_name */ + 398, /* (56) priv_level ::= topic_name */ + 399, /* (57) with_opt ::= */ + 399, /* (58) with_opt ::= WITH search_condition */ + 385, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + 385, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + 385, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 385, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 385, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 385, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 385, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 385, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 385, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 385, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + 385, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 385, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + 406, /* (71) dnode_endpoint ::= NK_STRING */ + 406, /* (72) dnode_endpoint ::= NK_ID */ + 406, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + 407, /* (74) force_opt ::= */ + 407, /* (75) force_opt ::= FORCE */ + 408, /* (76) unsafe_opt ::= UNSAFE */ + 385, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + 385, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 385, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + 385, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 385, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 385, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 385, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 385, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 385, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 385, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 385, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 385, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 385, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 385, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 385, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 385, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 385, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + 385, /* (94) cmd ::= USE db_name */ + 385, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + 385, /* (96) cmd ::= FLUSH DATABASE db_name */ + 385, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + 385, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + 385, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 409, /* (100) not_exists_opt ::= IF NOT EXISTS */ + 409, /* (101) not_exists_opt ::= */ + 411, /* (102) exists_opt ::= IF EXISTS */ + 411, /* (103) exists_opt ::= */ + 410, /* (104) db_options ::= */ + 410, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + 410, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + 410, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + 410, /* (108) db_options ::= db_options COMP NK_INTEGER */ + 410, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + 410, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + 410, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + 410, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + 410, /* (113) db_options ::= db_options KEEP integer_list */ + 410, /* (114) db_options ::= db_options KEEP variable_list */ + 410, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + 410, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + 410, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 410, /* (118) db_options ::= db_options PRECISION NK_STRING */ + 410, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + 410, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + 410, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 410, /* (122) db_options ::= db_options RETENTIONS retention_list */ + 410, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 410, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 410, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 410, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 410, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 410, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 410, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 410, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 410, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 410, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 410, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + 410, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + 410, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + 410, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + 410, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + 410, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + 410, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 410, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + 412, /* (141) alter_db_options ::= alter_db_option */ + 412, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + 420, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + 420, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + 420, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + 420, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 420, /* (147) alter_db_option ::= KEEP integer_list */ + 420, /* (148) alter_db_option ::= KEEP variable_list */ + 420, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + 420, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + 420, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 420, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 420, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + 420, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 420, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 420, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 420, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 420, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + 420, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + 420, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + 420, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 420, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + 416, /* (163) integer_list ::= NK_INTEGER */ + 416, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 417, /* (165) variable_list ::= NK_VARIABLE */ + 417, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 418, /* (167) retention_list ::= retention */ + 418, /* (168) retention_list ::= retention_list NK_COMMA retention */ + 421, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 421, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 413, /* (171) speed_opt ::= */ + 413, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + 414, /* (173) start_opt ::= */ + 414, /* (174) start_opt ::= START WITH NK_INTEGER */ + 414, /* (175) start_opt ::= START WITH NK_STRING */ + 414, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 415, /* (177) end_opt ::= */ + 415, /* (178) end_opt ::= END WITH NK_INTEGER */ + 415, /* (179) end_opt ::= END WITH NK_STRING */ + 415, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 385, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 385, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + 385, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + 385, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 385, /* (185) cmd ::= DROP TABLE multi_drop_clause */ + 385, /* (186) cmd ::= DROP STABLE exists_opt full_table_name */ + 385, /* (187) cmd ::= ALTER TABLE alter_table_clause */ + 385, /* (188) cmd ::= ALTER STABLE alter_table_clause */ + 430, /* (189) alter_table_clause ::= full_table_name alter_table_options */ + 430, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + 430, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 430, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 430, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + 430, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 430, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 430, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ + 430, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 430, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 430, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 426, /* (200) multi_create_clause ::= create_subtable_clause */ + 426, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 436, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 429, /* (203) multi_drop_clause ::= drop_table_clause */ + 429, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 439, /* (205) drop_table_clause ::= exists_opt full_table_name */ + 437, /* (206) specific_cols_opt ::= */ + 437, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 422, /* (208) full_table_name ::= table_name */ + 422, /* (209) full_table_name ::= db_name NK_DOT table_name */ + 441, /* (210) tag_def_list ::= tag_def */ + 441, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + 442, /* (212) tag_def ::= column_name type_name */ + 423, /* (213) column_def_list ::= column_def */ + 423, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ + 443, /* (215) column_def ::= column_name type_name column_options */ + 433, /* (216) type_name ::= BOOL */ + 433, /* (217) type_name ::= TINYINT */ + 433, /* (218) type_name ::= SMALLINT */ + 433, /* (219) type_name ::= INT */ + 433, /* (220) type_name ::= INTEGER */ + 433, /* (221) type_name ::= BIGINT */ + 433, /* (222) type_name ::= FLOAT */ + 433, /* (223) type_name ::= DOUBLE */ + 433, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 433, /* (225) type_name ::= TIMESTAMP */ + 433, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 433, /* (227) type_name ::= TINYINT UNSIGNED */ + 433, /* (228) type_name ::= SMALLINT UNSIGNED */ + 433, /* (229) type_name ::= INT UNSIGNED */ + 433, /* (230) type_name ::= BIGINT UNSIGNED */ + 433, /* (231) type_name ::= JSON */ + 433, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 433, /* (233) type_name ::= MEDIUMBLOB */ + 433, /* (234) type_name ::= BLOB */ + 433, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 433, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 433, /* (237) type_name ::= DECIMAL */ + 433, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 433, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 444, /* (240) type_name_default_len ::= BINARY */ + 444, /* (241) type_name_default_len ::= NCHAR */ + 444, /* (242) type_name_default_len ::= VARCHAR */ + 444, /* (243) type_name_default_len ::= VARBINARY */ + 424, /* (244) tags_def_opt ::= */ + 424, /* (245) tags_def_opt ::= tags_def */ + 428, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + 425, /* (247) table_options ::= */ + 425, /* (248) table_options ::= table_options COMMENT NK_STRING */ + 425, /* (249) table_options ::= table_options MAX_DELAY duration_list */ + 425, /* (250) table_options ::= table_options WATERMARK duration_list */ + 425, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 425, /* (252) table_options ::= table_options TTL NK_INTEGER */ + 425, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 425, /* (254) table_options ::= table_options DELETE_MARK duration_list */ + 431, /* (255) alter_table_options ::= alter_table_option */ + 431, /* (256) alter_table_options ::= alter_table_options alter_table_option */ + 447, /* (257) alter_table_option ::= COMMENT NK_STRING */ + 447, /* (258) alter_table_option ::= TTL NK_INTEGER */ + 445, /* (259) duration_list ::= duration_literal */ + 445, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ + 446, /* (261) rollup_func_list ::= rollup_func_name */ + 446, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 449, /* (263) rollup_func_name ::= function_name */ + 449, /* (264) rollup_func_name ::= FIRST */ + 449, /* (265) rollup_func_name ::= LAST */ + 440, /* (266) col_name_list ::= col_name */ + 440, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ + 451, /* (268) col_name ::= column_name */ + 385, /* (269) cmd ::= SHOW DNODES */ + 385, /* (270) cmd ::= SHOW USERS */ + 385, /* (271) cmd ::= SHOW USERS FULL */ + 385, /* (272) cmd ::= SHOW USER PRIVILEGES */ + 385, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ + 385, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 385, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 385, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 385, /* (277) cmd ::= SHOW MNODES */ + 385, /* (278) cmd ::= SHOW QNODES */ + 385, /* (279) cmd ::= SHOW ARBGROUPS */ + 385, /* (280) cmd ::= SHOW FUNCTIONS */ + 385, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 385, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 385, /* (283) cmd ::= SHOW STREAMS */ + 385, /* (284) cmd ::= SHOW ACCOUNTS */ + 385, /* (285) cmd ::= SHOW APPS */ + 385, /* (286) cmd ::= SHOW CONNECTIONS */ + 385, /* (287) cmd ::= SHOW LICENCES */ + 385, /* (288) cmd ::= SHOW GRANTS */ + 385, /* (289) cmd ::= SHOW GRANTS FULL */ + 385, /* (290) cmd ::= SHOW GRANTS LOGS */ + 385, /* (291) cmd ::= SHOW CLUSTER MACHINES */ + 385, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ + 385, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ + 385, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ + 385, /* (295) cmd ::= SHOW ENCRYPTIONS */ + 385, /* (296) cmd ::= SHOW QUERIES */ + 385, /* (297) cmd ::= SHOW SCORES */ + 385, /* (298) cmd ::= SHOW TOPICS */ + 385, /* (299) cmd ::= SHOW VARIABLES */ + 385, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ + 385, /* (301) cmd ::= SHOW LOCAL VARIABLES */ + 385, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 385, /* (303) cmd ::= SHOW BNODES */ + 385, /* (304) cmd ::= SHOW SNODES */ + 385, /* (305) cmd ::= SHOW CLUSTER */ + 385, /* (306) cmd ::= SHOW TRANSACTIONS */ + 385, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 385, /* (308) cmd ::= SHOW CONSUMERS */ + 385, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ + 385, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 385, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 385, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 385, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 385, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 385, /* (315) cmd ::= SHOW VNODES */ + 385, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ + 385, /* (317) cmd ::= SHOW CLUSTER ALIVE */ + 385, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 385, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ + 385, /* (320) cmd ::= SHOW COMPACTS */ + 385, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ + 453, /* (322) table_kind_db_name_cond_opt ::= */ + 453, /* (323) table_kind_db_name_cond_opt ::= table_kind */ + 453, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 453, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 458, /* (326) table_kind ::= NORMAL */ + 458, /* (327) table_kind ::= CHILD */ + 455, /* (328) db_name_cond_opt ::= */ + 455, /* (329) db_name_cond_opt ::= db_name NK_DOT */ + 454, /* (330) like_pattern_opt ::= */ + 454, /* (331) like_pattern_opt ::= LIKE NK_STRING */ + 456, /* (332) table_name_cond ::= table_name */ + 457, /* (333) from_db_opt ::= */ + 457, /* (334) from_db_opt ::= FROM db_name */ + 427, /* (335) tag_list_opt ::= */ + 427, /* (336) tag_list_opt ::= tag_item */ + 427, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 459, /* (338) tag_item ::= TBNAME */ + 459, /* (339) tag_item ::= QTAGS */ + 459, /* (340) tag_item ::= column_name */ + 459, /* (341) tag_item ::= column_name column_alias */ + 459, /* (342) tag_item ::= column_name AS column_alias */ + 452, /* (343) db_kind_opt ::= */ + 452, /* (344) db_kind_opt ::= USER */ + 452, /* (345) db_kind_opt ::= SYSTEM */ + 385, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + 385, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + 385, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ + 385, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ + 463, /* (350) full_tsma_name ::= tsma_name */ + 463, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ + 462, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + 385, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 385, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 385, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ + 466, /* (356) full_index_name ::= index_name */ + 466, /* (357) full_index_name ::= db_name NK_DOT index_name */ + 465, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 465, /* (359) 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 */ + 464, /* (360) func_list ::= func */ + 464, /* (361) func_list ::= func_list NK_COMMA func */ + 470, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ + 471, /* (363) sma_func_name ::= function_name */ + 471, /* (364) sma_func_name ::= COUNT */ + 471, /* (365) sma_func_name ::= FIRST */ + 471, /* (366) sma_func_name ::= LAST */ + 471, /* (367) sma_func_name ::= LAST_ROW */ + 469, /* (368) sma_stream_opt ::= */ + 469, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 469, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 469, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 473, /* (372) with_meta ::= AS */ + 473, /* (373) with_meta ::= WITH META AS */ + 473, /* (374) with_meta ::= ONLY META AS */ + 385, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 385, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 385, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 385, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ + 385, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 385, /* (380) cmd ::= DESC full_table_name */ + 385, /* (381) cmd ::= DESCRIBE full_table_name */ + 385, /* (382) cmd ::= RESET QUERY CACHE */ + 385, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 385, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 477, /* (385) analyze_opt ::= */ + 477, /* (386) analyze_opt ::= ANALYZE */ + 478, /* (387) explain_options ::= */ + 478, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ + 478, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ + 385, /* (390) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 385, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ + 481, /* (392) agg_func_opt ::= */ + 481, /* (393) agg_func_opt ::= AGGREGATE */ + 482, /* (394) bufsize_opt ::= */ + 482, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 483, /* (396) language_opt ::= */ + 483, /* (397) language_opt ::= LANGUAGE NK_STRING */ + 480, /* (398) or_replace_opt ::= */ + 480, /* (399) or_replace_opt ::= OR REPLACE */ + 385, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 385, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ + 484, /* (402) full_view_name ::= view_name */ + 484, /* (403) full_view_name ::= db_name NK_DOT view_name */ + 385, /* (404) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 385, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ + 385, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ + 385, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 488, /* (408) col_list_opt ::= */ + 488, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + 492, /* (410) column_stream_def_list ::= column_stream_def */ + 492, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + 493, /* (412) column_stream_def ::= column_name stream_col_options */ + 494, /* (413) stream_col_options ::= */ + 494, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ + 489, /* (415) tag_def_or_ref_opt ::= */ + 489, /* (416) tag_def_or_ref_opt ::= tags_def */ + 489, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + 487, /* (418) stream_options ::= */ + 487, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ + 487, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 487, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 487, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ + 487, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 487, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 487, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ + 487, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 490, /* (427) subtable_opt ::= */ + 490, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 491, /* (429) ignore_opt ::= */ + 491, /* (430) ignore_opt ::= IGNORE UNTREATED */ + 385, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ + 385, /* (432) cmd ::= KILL QUERY NK_STRING */ + 385, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ + 385, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ + 385, /* (435) cmd ::= BALANCE VGROUP */ + 385, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 385, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + 385, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 385, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 385, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ + 496, /* (441) on_vgroup_id ::= */ + 496, /* (442) on_vgroup_id ::= ON NK_INTEGER */ + 497, /* (443) dnode_list ::= DNODE NK_INTEGER */ + 497, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 385, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 385, /* (446) cmd ::= query_or_subquery */ + 385, /* (447) cmd ::= insert_query */ + 479, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 479, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 435, /* (450) tags_literal ::= NK_INTEGER */ + 435, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + 435, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + 435, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ + 435, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + 435, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + 435, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ + 435, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + 435, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + 435, /* (459) tags_literal ::= NK_FLOAT */ + 435, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ + 435, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ + 435, /* (462) tags_literal ::= NK_BIN */ + 435, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + 435, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + 435, /* (465) tags_literal ::= NK_PLUS NK_BIN */ + 435, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + 435, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + 435, /* (468) tags_literal ::= NK_MINUS NK_BIN */ + 435, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + 435, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + 435, /* (471) tags_literal ::= NK_HEX */ + 435, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + 435, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + 435, /* (474) tags_literal ::= NK_PLUS NK_HEX */ + 435, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + 435, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + 435, /* (477) tags_literal ::= NK_MINUS NK_HEX */ + 435, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + 435, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + 435, /* (480) tags_literal ::= NK_STRING */ + 435, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + 435, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + 435, /* (483) tags_literal ::= NK_BOOL */ + 435, /* (484) tags_literal ::= NULL */ + 435, /* (485) tags_literal ::= literal_func */ + 435, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ + 435, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ + 438, /* (488) tags_literal_list ::= tags_literal */ + 438, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 388, /* (490) literal ::= NK_INTEGER */ + 388, /* (491) literal ::= NK_FLOAT */ + 388, /* (492) literal ::= NK_STRING */ + 388, /* (493) literal ::= NK_BOOL */ + 388, /* (494) literal ::= TIMESTAMP NK_STRING */ + 388, /* (495) literal ::= duration_literal */ + 388, /* (496) literal ::= NULL */ + 388, /* (497) literal ::= NK_QUESTION */ + 448, /* (498) duration_literal ::= NK_VARIABLE */ + 419, /* (499) signed ::= NK_INTEGER */ + 419, /* (500) signed ::= NK_PLUS NK_INTEGER */ + 419, /* (501) signed ::= NK_MINUS NK_INTEGER */ + 419, /* (502) signed ::= NK_FLOAT */ + 419, /* (503) signed ::= NK_PLUS NK_FLOAT */ + 419, /* (504) signed ::= NK_MINUS NK_FLOAT */ + 499, /* (505) signed_literal ::= signed */ + 499, /* (506) signed_literal ::= NK_STRING */ + 499, /* (507) signed_literal ::= NK_BOOL */ + 499, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ + 499, /* (509) signed_literal ::= duration_literal */ + 499, /* (510) signed_literal ::= NULL */ + 499, /* (511) signed_literal ::= literal_func */ + 499, /* (512) signed_literal ::= NK_QUESTION */ + 500, /* (513) literal_list ::= signed_literal */ + 500, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ + 402, /* (515) db_name ::= NK_ID */ + 403, /* (516) table_name ::= NK_ID */ + 432, /* (517) column_name ::= NK_ID */ + 450, /* (518) function_name ::= NK_ID */ + 485, /* (519) view_name ::= NK_ID */ + 501, /* (520) table_alias ::= NK_ID */ + 460, /* (521) column_alias ::= NK_ID */ + 460, /* (522) column_alias ::= NK_ALIAS */ + 395, /* (523) user_name ::= NK_ID */ + 404, /* (524) topic_name ::= NK_ID */ + 486, /* (525) stream_name ::= NK_ID */ + 476, /* (526) cgroup_name ::= NK_ID */ + 467, /* (527) index_name ::= NK_ID */ + 461, /* (528) tsma_name ::= NK_ID */ + 502, /* (529) expr_or_subquery ::= expression */ + 495, /* (530) expression ::= literal */ + 495, /* (531) expression ::= pseudo_column */ + 495, /* (532) expression ::= column_reference */ + 495, /* (533) expression ::= function_expression */ + 495, /* (534) expression ::= case_when_expression */ + 495, /* (535) expression ::= NK_LP expression NK_RP */ + 495, /* (536) expression ::= NK_PLUS expr_or_subquery */ + 495, /* (537) expression ::= NK_MINUS expr_or_subquery */ + 495, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 495, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 495, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 495, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 495, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 495, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ + 495, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 495, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 472, /* (546) expression_list ::= expr_or_subquery */ + 472, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 504, /* (548) column_reference ::= column_name */ + 504, /* (549) column_reference ::= table_name NK_DOT column_name */ + 504, /* (550) column_reference ::= NK_ALIAS */ + 504, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ + 503, /* (552) pseudo_column ::= ROWTS */ + 503, /* (553) pseudo_column ::= TBNAME */ + 503, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ + 503, /* (555) pseudo_column ::= QSTART */ + 503, /* (556) pseudo_column ::= QEND */ + 503, /* (557) pseudo_column ::= QDURATION */ + 503, /* (558) pseudo_column ::= WSTART */ + 503, /* (559) pseudo_column ::= WEND */ + 503, /* (560) pseudo_column ::= WDURATION */ + 503, /* (561) pseudo_column ::= IROWTS */ + 503, /* (562) pseudo_column ::= ISFILLED */ + 503, /* (563) pseudo_column ::= QTAGS */ + 505, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ + 505, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 505, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 505, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + 505, /* (568) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ + 505, /* (569) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ + 505, /* (570) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ + 505, /* (571) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + 505, /* (572) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ + 505, /* (573) function_expression ::= substr_func NK_LP expression_list NK_RP */ + 505, /* (574) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + 505, /* (575) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ + 505, /* (576) function_expression ::= REPLACE NK_LP expression_list NK_RP */ + 505, /* (577) function_expression ::= literal_func */ + 498, /* (578) literal_func ::= noarg_func NK_LP NK_RP */ + 498, /* (579) literal_func ::= NOW */ + 498, /* (580) literal_func ::= TODAY */ + 510, /* (581) substr_func ::= SUBSTR */ + 510, /* (582) substr_func ::= SUBSTRING */ + 509, /* (583) trim_specification_type ::= BOTH */ + 509, /* (584) trim_specification_type ::= TRAILING */ + 509, /* (585) trim_specification_type ::= LEADING */ + 511, /* (586) noarg_func ::= NOW */ + 511, /* (587) noarg_func ::= TODAY */ + 511, /* (588) noarg_func ::= TIMEZONE */ + 511, /* (589) noarg_func ::= DATABASE */ + 511, /* (590) noarg_func ::= CLIENT_VERSION */ + 511, /* (591) noarg_func ::= SERVER_VERSION */ + 511, /* (592) noarg_func ::= SERVER_STATUS */ + 511, /* (593) noarg_func ::= CURRENT_USER */ + 511, /* (594) noarg_func ::= USER */ + 511, /* (595) noarg_func ::= PI */ + 507, /* (596) star_func ::= COUNT */ + 507, /* (597) star_func ::= FIRST */ + 507, /* (598) star_func ::= LAST */ + 507, /* (599) star_func ::= LAST_ROW */ + 508, /* (600) star_func_para_list ::= NK_STAR */ + 508, /* (601) star_func_para_list ::= other_para_list */ + 512, /* (602) other_para_list ::= star_func_para */ + 512, /* (603) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 513, /* (604) star_func_para ::= expr_or_subquery */ + 513, /* (605) star_func_para ::= table_name NK_DOT NK_STAR */ + 506, /* (606) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 506, /* (607) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 514, /* (608) when_then_list ::= when_then_expr */ + 514, /* (609) when_then_list ::= when_then_list when_then_expr */ + 517, /* (610) when_then_expr ::= WHEN common_expression THEN common_expression */ + 515, /* (611) case_when_else_opt ::= */ + 515, /* (612) case_when_else_opt ::= ELSE common_expression */ + 518, /* (613) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 518, /* (614) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 518, /* (615) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 518, /* (616) predicate ::= expr_or_subquery IS NULL */ + 518, /* (617) predicate ::= expr_or_subquery IS NOT NULL */ + 518, /* (618) predicate ::= expr_or_subquery in_op in_predicate_value */ + 519, /* (619) compare_op ::= NK_LT */ + 519, /* (620) compare_op ::= NK_GT */ + 519, /* (621) compare_op ::= NK_LE */ + 519, /* (622) compare_op ::= NK_GE */ + 519, /* (623) compare_op ::= NK_NE */ + 519, /* (624) compare_op ::= NK_EQ */ + 519, /* (625) compare_op ::= LIKE */ + 519, /* (626) compare_op ::= NOT LIKE */ + 519, /* (627) compare_op ::= MATCH */ + 519, /* (628) compare_op ::= NMATCH */ + 519, /* (629) compare_op ::= CONTAINS */ + 520, /* (630) in_op ::= IN */ + 520, /* (631) in_op ::= NOT IN */ + 521, /* (632) in_predicate_value ::= NK_LP literal_list NK_RP */ + 522, /* (633) boolean_value_expression ::= boolean_primary */ + 522, /* (634) boolean_value_expression ::= NOT boolean_primary */ + 522, /* (635) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 522, /* (636) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 523, /* (637) boolean_primary ::= predicate */ + 523, /* (638) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 516, /* (639) common_expression ::= expr_or_subquery */ + 516, /* (640) common_expression ::= boolean_value_expression */ + 524, /* (641) from_clause_opt ::= */ + 524, /* (642) from_clause_opt ::= FROM table_reference_list */ + 525, /* (643) table_reference_list ::= table_reference */ + 525, /* (644) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 526, /* (645) table_reference ::= table_primary */ + 526, /* (646) table_reference ::= joined_table */ + 527, /* (647) table_primary ::= table_name alias_opt */ + 527, /* (648) table_primary ::= db_name NK_DOT table_name alias_opt */ + 527, /* (649) table_primary ::= subquery alias_opt */ + 527, /* (650) table_primary ::= parenthesized_joined_table */ + 529, /* (651) alias_opt ::= */ + 529, /* (652) alias_opt ::= table_alias */ + 529, /* (653) alias_opt ::= AS table_alias */ + 531, /* (654) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 531, /* (655) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 528, /* (656) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 532, /* (657) join_type ::= */ + 532, /* (658) join_type ::= INNER */ + 532, /* (659) join_type ::= LEFT */ + 532, /* (660) join_type ::= RIGHT */ + 532, /* (661) join_type ::= FULL */ + 533, /* (662) join_subtype ::= */ + 533, /* (663) join_subtype ::= OUTER */ + 533, /* (664) join_subtype ::= SEMI */ + 533, /* (665) join_subtype ::= ANTI */ + 533, /* (666) join_subtype ::= ASOF */ + 533, /* (667) join_subtype ::= WINDOW */ + 534, /* (668) join_on_clause_opt ::= */ + 534, /* (669) join_on_clause_opt ::= ON search_condition */ + 535, /* (670) window_offset_clause_opt ::= */ + 535, /* (671) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 537, /* (672) window_offset_literal ::= NK_VARIABLE */ + 537, /* (673) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 536, /* (674) jlimit_clause_opt ::= */ + 536, /* (675) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 538, /* (676) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 539, /* (677) hint_list ::= */ + 539, /* (678) hint_list ::= NK_HINT */ + 541, /* (679) tag_mode_opt ::= */ + 541, /* (680) tag_mode_opt ::= TAGS */ + 540, /* (681) set_quantifier_opt ::= */ + 540, /* (682) set_quantifier_opt ::= DISTINCT */ + 540, /* (683) set_quantifier_opt ::= ALL */ + 542, /* (684) select_list ::= select_item */ + 542, /* (685) select_list ::= select_list NK_COMMA select_item */ + 550, /* (686) select_item ::= NK_STAR */ + 550, /* (687) select_item ::= common_expression */ + 550, /* (688) select_item ::= common_expression column_alias */ + 550, /* (689) select_item ::= common_expression AS column_alias */ + 550, /* (690) select_item ::= table_name NK_DOT NK_STAR */ + 475, /* (691) where_clause_opt ::= */ + 475, /* (692) where_clause_opt ::= WHERE search_condition */ + 543, /* (693) partition_by_clause_opt ::= */ + 543, /* (694) partition_by_clause_opt ::= PARTITION BY partition_list */ + 551, /* (695) partition_list ::= partition_item */ + 551, /* (696) partition_list ::= partition_list NK_COMMA partition_item */ + 552, /* (697) partition_item ::= expr_or_subquery */ + 552, /* (698) partition_item ::= expr_or_subquery column_alias */ + 552, /* (699) partition_item ::= expr_or_subquery AS column_alias */ + 547, /* (700) twindow_clause_opt ::= */ + 547, /* (701) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 547, /* (702) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 547, /* (703) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 547, /* (704) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 547, /* (705) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 547, /* (706) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 547, /* (707) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 468, /* (708) sliding_opt ::= */ + 468, /* (709) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 553, /* (710) interval_sliding_duration_literal ::= NK_VARIABLE */ + 553, /* (711) interval_sliding_duration_literal ::= NK_STRING */ + 553, /* (712) interval_sliding_duration_literal ::= NK_INTEGER */ + 546, /* (713) fill_opt ::= */ + 546, /* (714) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 546, /* (715) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 546, /* (716) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 554, /* (717) fill_mode ::= NONE */ + 554, /* (718) fill_mode ::= PREV */ + 554, /* (719) fill_mode ::= NULL */ + 554, /* (720) fill_mode ::= NULL_F */ + 554, /* (721) fill_mode ::= LINEAR */ + 554, /* (722) fill_mode ::= NEXT */ + 548, /* (723) group_by_clause_opt ::= */ + 548, /* (724) group_by_clause_opt ::= GROUP BY group_by_list */ + 555, /* (725) group_by_list ::= expr_or_subquery */ + 555, /* (726) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 549, /* (727) having_clause_opt ::= */ + 549, /* (728) having_clause_opt ::= HAVING search_condition */ + 544, /* (729) range_opt ::= */ + 544, /* (730) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 544, /* (731) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 545, /* (732) every_opt ::= */ + 545, /* (733) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 556, /* (734) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 557, /* (735) query_simple ::= query_specification */ + 557, /* (736) query_simple ::= union_query_expression */ + 561, /* (737) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 561, /* (738) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 562, /* (739) query_simple_or_subquery ::= query_simple */ + 562, /* (740) query_simple_or_subquery ::= subquery */ + 474, /* (741) query_or_subquery ::= query_expression */ + 474, /* (742) query_or_subquery ::= subquery */ + 558, /* (743) order_by_clause_opt ::= */ + 558, /* (744) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 559, /* (745) slimit_clause_opt ::= */ + 559, /* (746) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 559, /* (747) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 559, /* (748) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 560, /* (749) limit_clause_opt ::= */ + 560, /* (750) limit_clause_opt ::= LIMIT NK_INTEGER */ + 560, /* (751) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 560, /* (752) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 530, /* (753) subquery ::= NK_LP query_expression NK_RP */ + 530, /* (754) subquery ::= NK_LP subquery NK_RP */ + 405, /* (755) search_condition ::= common_expression */ + 563, /* (756) sort_specification_list ::= sort_specification */ + 563, /* (757) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 564, /* (758) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 565, /* (759) ordering_specification_opt ::= */ + 565, /* (760) ordering_specification_opt ::= ASC */ + 565, /* (761) ordering_specification_opt ::= DESC */ + 566, /* (762) null_ordering_opt ::= */ + 566, /* (763) null_ordering_opt ::= NULLS FIRST */ + 566, /* (764) null_ordering_opt ::= NULLS LAST */ + 434, /* (765) column_options ::= */ + 434, /* (766) column_options ::= column_options PRIMARY KEY */ + 434, /* (767) column_options ::= column_options ENCODE NK_STRING */ + 434, /* (768) column_options ::= column_options COMPRESS NK_STRING */ + 434, /* (769) column_options ::= column_options LEVEL NK_STRING */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number ** of symbols on the right-hand side of that rule. */ static const signed char yyRuleInfoNRhs[] = { - -6, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - -4, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + -6, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + -4, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ 0, /* (2) account_options ::= */ - -3, /* (3) account_options ::= account_options PPS literal */ - -3, /* (4) account_options ::= account_options TSERIES literal */ - -3, /* (5) account_options ::= account_options STORAGE literal */ - -3, /* (6) account_options ::= account_options STREAMS literal */ - -3, /* (7) account_options ::= account_options QTIME literal */ - -3, /* (8) account_options ::= account_options DBS literal */ - -3, /* (9) account_options ::= account_options USERS literal */ - -3, /* (10) account_options ::= account_options CONNS literal */ - -3, /* (11) account_options ::= account_options STATE literal */ - -1, /* (12) alter_account_options ::= alter_account_option */ - -2, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - -2, /* (14) alter_account_option ::= PASS literal */ - -2, /* (15) alter_account_option ::= PPS literal */ - -2, /* (16) alter_account_option ::= TSERIES literal */ - -2, /* (17) alter_account_option ::= STORAGE literal */ - -2, /* (18) alter_account_option ::= STREAMS literal */ - -2, /* (19) alter_account_option ::= QTIME literal */ - -2, /* (20) alter_account_option ::= DBS literal */ - -2, /* (21) alter_account_option ::= USERS literal */ - -2, /* (22) alter_account_option ::= CONNS literal */ - -2, /* (23) alter_account_option ::= STATE literal */ - -1, /* (24) ip_range_list ::= NK_STRING */ - -3, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - -2, /* (26) white_list ::= HOST ip_range_list */ + -3, /* (3) account_options ::= account_options PPS literal */ + -3, /* (4) account_options ::= account_options TSERIES literal */ + -3, /* (5) account_options ::= account_options STORAGE literal */ + -3, /* (6) account_options ::= account_options STREAMS literal */ + -3, /* (7) account_options ::= account_options QTIME literal */ + -3, /* (8) account_options ::= account_options DBS literal */ + -3, /* (9) account_options ::= account_options USERS literal */ + -3, /* (10) account_options ::= account_options CONNS literal */ + -3, /* (11) account_options ::= account_options STATE literal */ + -1, /* (12) alter_account_options ::= alter_account_option */ + -2, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + -2, /* (14) alter_account_option ::= PASS literal */ + -2, /* (15) alter_account_option ::= PPS literal */ + -2, /* (16) alter_account_option ::= TSERIES literal */ + -2, /* (17) alter_account_option ::= STORAGE literal */ + -2, /* (18) alter_account_option ::= STREAMS literal */ + -2, /* (19) alter_account_option ::= QTIME literal */ + -2, /* (20) alter_account_option ::= DBS literal */ + -2, /* (21) alter_account_option ::= USERS literal */ + -2, /* (22) alter_account_option ::= CONNS literal */ + -2, /* (23) alter_account_option ::= STATE literal */ + -1, /* (24) ip_range_list ::= NK_STRING */ + -3, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + -2, /* (26) white_list ::= HOST ip_range_list */ 0, /* (27) white_list_opt ::= */ - -1, /* (28) white_list_opt ::= white_list */ + -1, /* (28) white_list_opt ::= white_list */ 0, /* (29) is_import_opt ::= */ - -2, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ + -2, /* (30) is_import_opt ::= IS_IMPORT NK_INTEGER */ 0, /* (31) is_createdb_opt ::= */ - -2, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ - -9, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ - -5, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ - -5, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - -5, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - -5, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ - -5, /* (38) cmd ::= ALTER USER user_name ADD white_list */ - -5, /* (39) cmd ::= ALTER USER user_name DROP white_list */ - -3, /* (40) cmd ::= DROP USER user_name */ + -2, /* (32) is_createdb_opt ::= CREATEDB NK_INTEGER */ + -9, /* (33) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + -5, /* (34) cmd ::= ALTER USER user_name PASS NK_STRING */ + -5, /* (35) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + -5, /* (36) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + -5, /* (37) cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + -5, /* (38) cmd ::= ALTER USER user_name ADD white_list */ + -5, /* (39) cmd ::= ALTER USER user_name DROP white_list */ + -3, /* (40) cmd ::= DROP USER user_name */ 0, /* (41) sysinfo_opt ::= */ - -2, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ - -7, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - -7, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - -1, /* (45) privileges ::= ALL */ - -1, /* (46) privileges ::= priv_type_list */ - -1, /* (47) privileges ::= SUBSCRIBE */ - -1, /* (48) priv_type_list ::= priv_type */ - -3, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - -1, /* (50) priv_type ::= READ */ - -1, /* (51) priv_type ::= WRITE */ - -1, /* (52) priv_type ::= ALTER */ - -3, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ - -3, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ - -3, /* (55) priv_level ::= db_name NK_DOT table_name */ - -1, /* (56) priv_level ::= topic_name */ + -2, /* (42) sysinfo_opt ::= SYSINFO NK_INTEGER */ + -7, /* (43) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + -7, /* (44) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + -1, /* (45) privileges ::= ALL */ + -1, /* (46) privileges ::= priv_type_list */ + -1, /* (47) privileges ::= SUBSCRIBE */ + -1, /* (48) priv_type_list ::= priv_type */ + -3, /* (49) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + -1, /* (50) priv_type ::= READ */ + -1, /* (51) priv_type ::= WRITE */ + -1, /* (52) priv_type ::= ALTER */ + -3, /* (53) priv_level ::= NK_STAR NK_DOT NK_STAR */ + -3, /* (54) priv_level ::= db_name NK_DOT NK_STAR */ + -3, /* (55) priv_level ::= db_name NK_DOT table_name */ + -1, /* (56) priv_level ::= topic_name */ 0, /* (57) with_opt ::= */ - -2, /* (58) with_opt ::= WITH search_condition */ - -3, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ - -3, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ - -5, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - -4, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ - -4, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ - -4, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - -4, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - -4, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - -5, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - -4, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ - -5, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - -3, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ - -1, /* (71) dnode_endpoint ::= NK_STRING */ - -1, /* (72) dnode_endpoint ::= NK_ID */ - -1, /* (73) dnode_endpoint ::= NK_IPTOKEN */ + -2, /* (58) with_opt ::= WITH search_condition */ + -3, /* (59) cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + -3, /* (60) cmd ::= CREATE DNODE dnode_endpoint */ + -5, /* (61) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + -4, /* (62) cmd ::= DROP DNODE NK_INTEGER force_opt */ + -4, /* (63) cmd ::= DROP DNODE dnode_endpoint force_opt */ + -4, /* (64) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + -4, /* (65) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + -4, /* (66) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + -5, /* (67) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + -4, /* (68) cmd ::= ALTER ALL DNODES NK_STRING */ + -5, /* (69) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + -3, /* (70) cmd ::= RESTORE DNODE NK_INTEGER */ + -1, /* (71) dnode_endpoint ::= NK_STRING */ + -1, /* (72) dnode_endpoint ::= NK_ID */ + -1, /* (73) dnode_endpoint ::= NK_IPTOKEN */ 0, /* (74) force_opt ::= */ - -1, /* (75) force_opt ::= FORCE */ - -1, /* (76) unsafe_opt ::= UNSAFE */ - -3, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ - -4, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - -3, /* (79) cmd ::= ALTER LOCAL NK_STRING */ - -4, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - -5, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - -5, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - -5, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - -5, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - -5, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - -5, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - -5, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - -5, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - -5, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - -5, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - -5, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - -5, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - -4, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ - -2, /* (94) cmd ::= USE db_name */ - -4, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ - -3, /* (96) cmd ::= FLUSH DATABASE db_name */ - -4, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ - -3, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ - -5, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - -3, /* (100) not_exists_opt ::= IF NOT EXISTS */ + -1, /* (75) force_opt ::= FORCE */ + -1, /* (76) unsafe_opt ::= UNSAFE */ + -3, /* (77) cmd ::= ALTER CLUSTER NK_STRING */ + -4, /* (78) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + -3, /* (79) cmd ::= ALTER LOCAL NK_STRING */ + -4, /* (80) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + -5, /* (81) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + -5, /* (82) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + -5, /* (83) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + -5, /* (84) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + -5, /* (85) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + -5, /* (86) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + -5, /* (87) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + -5, /* (88) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + -5, /* (89) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + -5, /* (90) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + -5, /* (91) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + -5, /* (92) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + -4, /* (93) cmd ::= DROP DATABASE exists_opt db_name */ + -2, /* (94) cmd ::= USE db_name */ + -4, /* (95) cmd ::= ALTER DATABASE db_name alter_db_options */ + -3, /* (96) cmd ::= FLUSH DATABASE db_name */ + -4, /* (97) cmd ::= TRIM DATABASE db_name speed_opt */ + -3, /* (98) cmd ::= S3MIGRATE DATABASE db_name */ + -5, /* (99) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + -3, /* (100) not_exists_opt ::= IF NOT EXISTS */ 0, /* (101) not_exists_opt ::= */ - -2, /* (102) exists_opt ::= IF EXISTS */ + -2, /* (102) exists_opt ::= IF EXISTS */ 0, /* (103) exists_opt ::= */ 0, /* (104) db_options ::= */ - -3, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ - -3, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ - -3, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ - -3, /* (108) db_options ::= db_options COMP NK_INTEGER */ - -3, /* (109) db_options ::= db_options DURATION NK_INTEGER */ - -3, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ - -3, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ - -3, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ - -3, /* (113) db_options ::= db_options KEEP integer_list */ - -3, /* (114) db_options ::= db_options KEEP variable_list */ - -3, /* (115) db_options ::= db_options PAGES NK_INTEGER */ - -3, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ - -3, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - -3, /* (118) db_options ::= db_options PRECISION NK_STRING */ - -3, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ - -3, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ - -3, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - -3, /* (122) db_options ::= db_options RETENTIONS retention_list */ - -3, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ - -3, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - -3, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - -3, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - -4, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -3, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - -4, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -3, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - -3, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - -3, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - -3, /* (133) db_options ::= db_options TABLE_PREFIX signed */ - -3, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ - -3, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ - -3, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - -3, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ - -3, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ - -3, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - -3, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (141) alter_db_options ::= alter_db_option */ - -2, /* (142) alter_db_options ::= alter_db_options alter_db_option */ - -2, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ - -2, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ - -2, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ - -2, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - -2, /* (147) alter_db_option ::= KEEP integer_list */ - -2, /* (148) alter_db_option ::= KEEP variable_list */ - -2, /* (149) alter_db_option ::= PAGES NK_INTEGER */ - -2, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ - -2, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - -2, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - -2, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ - -2, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - -3, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - -2, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - -3, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - -2, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - -2, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ - -2, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ - -2, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - -2, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ - -1, /* (163) integer_list ::= NK_INTEGER */ - -3, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - -1, /* (165) variable_list ::= NK_VARIABLE */ - -3, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - -1, /* (167) retention_list ::= retention */ - -3, /* (168) retention_list ::= retention_list NK_COMMA retention */ - -3, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - -3, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + -3, /* (105) db_options ::= db_options BUFFER NK_INTEGER */ + -3, /* (106) db_options ::= db_options CACHEMODEL NK_STRING */ + -3, /* (107) db_options ::= db_options CACHESIZE NK_INTEGER */ + -3, /* (108) db_options ::= db_options COMP NK_INTEGER */ + -3, /* (109) db_options ::= db_options DURATION NK_INTEGER */ + -3, /* (110) db_options ::= db_options DURATION NK_VARIABLE */ + -3, /* (111) db_options ::= db_options MAXROWS NK_INTEGER */ + -3, /* (112) db_options ::= db_options MINROWS NK_INTEGER */ + -3, /* (113) db_options ::= db_options KEEP integer_list */ + -3, /* (114) db_options ::= db_options KEEP variable_list */ + -3, /* (115) db_options ::= db_options PAGES NK_INTEGER */ + -3, /* (116) db_options ::= db_options PAGESIZE NK_INTEGER */ + -3, /* (117) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + -3, /* (118) db_options ::= db_options PRECISION NK_STRING */ + -3, /* (119) db_options ::= db_options REPLICA NK_INTEGER */ + -3, /* (120) db_options ::= db_options VGROUPS NK_INTEGER */ + -3, /* (121) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + -3, /* (122) db_options ::= db_options RETENTIONS retention_list */ + -3, /* (123) db_options ::= db_options SCHEMALESS NK_INTEGER */ + -3, /* (124) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + -3, /* (125) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + -3, /* (126) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + -4, /* (127) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -3, /* (128) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + -4, /* (129) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -3, /* (130) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + -3, /* (131) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + -3, /* (132) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + -3, /* (133) db_options ::= db_options TABLE_PREFIX signed */ + -3, /* (134) db_options ::= db_options TABLE_SUFFIX signed */ + -3, /* (135) db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + -3, /* (136) db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + -3, /* (137) db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ + -3, /* (138) db_options ::= db_options S3_COMPACT NK_INTEGER */ + -3, /* (139) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + -3, /* (140) db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (141) alter_db_options ::= alter_db_option */ + -2, /* (142) alter_db_options ::= alter_db_options alter_db_option */ + -2, /* (143) alter_db_option ::= BUFFER NK_INTEGER */ + -2, /* (144) alter_db_option ::= CACHEMODEL NK_STRING */ + -2, /* (145) alter_db_option ::= CACHESIZE NK_INTEGER */ + -2, /* (146) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + -2, /* (147) alter_db_option ::= KEEP integer_list */ + -2, /* (148) alter_db_option ::= KEEP variable_list */ + -2, /* (149) alter_db_option ::= PAGES NK_INTEGER */ + -2, /* (150) alter_db_option ::= REPLICA NK_INTEGER */ + -2, /* (151) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + -2, /* (152) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + -2, /* (153) alter_db_option ::= MINROWS NK_INTEGER */ + -2, /* (154) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + -3, /* (155) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + -2, /* (156) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + -3, /* (157) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + -2, /* (158) alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + -2, /* (159) alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ + -2, /* (160) alter_db_option ::= S3_COMPACT NK_INTEGER */ + -2, /* (161) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + -2, /* (162) alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + -1, /* (163) integer_list ::= NK_INTEGER */ + -3, /* (164) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + -1, /* (165) variable_list ::= NK_VARIABLE */ + -3, /* (166) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + -1, /* (167) retention_list ::= retention */ + -3, /* (168) retention_list ::= retention_list NK_COMMA retention */ + -3, /* (169) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + -3, /* (170) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ 0, /* (171) speed_opt ::= */ - -2, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ + -2, /* (172) speed_opt ::= BWLIMIT NK_INTEGER */ 0, /* (173) start_opt ::= */ - -3, /* (174) start_opt ::= START WITH NK_INTEGER */ - -3, /* (175) start_opt ::= START WITH NK_STRING */ - -4, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ + -3, /* (174) start_opt ::= START WITH NK_INTEGER */ + -3, /* (175) start_opt ::= START WITH NK_STRING */ + -4, /* (176) start_opt ::= START WITH TIMESTAMP NK_STRING */ 0, /* (177) end_opt ::= */ - -3, /* (178) end_opt ::= END WITH NK_INTEGER */ - -3, /* (179) end_opt ::= END WITH NK_STRING */ - -4, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ - -9, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - -3, /* (182) cmd ::= CREATE TABLE multi_create_clause */ - -10, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ - -9, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - -3, /* (185) cmd ::= DROP TABLE multi_drop_clause */ - -4, /* (186) cmd ::= DROP STABLE exists_opt full_table_name */ - -3, /* (187) cmd ::= ALTER TABLE alter_table_clause */ - -3, /* (188) cmd ::= ALTER STABLE alter_table_clause */ - -2, /* (189) alter_table_clause ::= full_table_name alter_table_options */ - -6, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ - -4, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - -5, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - -5, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ - -5, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - -5, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - -4, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ - -5, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - -5, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - -6, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - -1, /* (200) multi_create_clause ::= create_subtable_clause */ - -2, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ - -10, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - -1, /* (203) multi_drop_clause ::= drop_table_clause */ - -3, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - -2, /* (205) drop_table_clause ::= exists_opt full_table_name */ + -3, /* (178) end_opt ::= END WITH NK_INTEGER */ + -3, /* (179) end_opt ::= END WITH NK_STRING */ + -4, /* (180) end_opt ::= END WITH TIMESTAMP NK_STRING */ + -9, /* (181) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + -3, /* (182) cmd ::= CREATE TABLE multi_create_clause */ + -10, /* (183) cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + -9, /* (184) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + -3, /* (185) cmd ::= DROP TABLE multi_drop_clause */ + -4, /* (186) cmd ::= DROP STABLE exists_opt full_table_name */ + -3, /* (187) cmd ::= ALTER TABLE alter_table_clause */ + -3, /* (188) cmd ::= ALTER STABLE alter_table_clause */ + -2, /* (189) alter_table_clause ::= full_table_name alter_table_options */ + -6, /* (190) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + -4, /* (191) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + -5, /* (192) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + -5, /* (193) alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + -5, /* (194) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + -5, /* (195) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + -4, /* (196) alter_table_clause ::= full_table_name DROP TAG column_name */ + -5, /* (197) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + -5, /* (198) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + -6, /* (199) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + -1, /* (200) multi_create_clause ::= create_subtable_clause */ + -2, /* (201) multi_create_clause ::= multi_create_clause create_subtable_clause */ + -10, /* (202) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + -1, /* (203) multi_drop_clause ::= drop_table_clause */ + -3, /* (204) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + -2, /* (205) drop_table_clause ::= exists_opt full_table_name */ 0, /* (206) specific_cols_opt ::= */ - -3, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - -1, /* (208) full_table_name ::= table_name */ - -3, /* (209) full_table_name ::= db_name NK_DOT table_name */ - -1, /* (210) tag_def_list ::= tag_def */ - -3, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ - -2, /* (212) tag_def ::= column_name type_name */ - -1, /* (213) column_def_list ::= column_def */ - -3, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ - -3, /* (215) column_def ::= column_name type_name column_options */ - -1, /* (216) type_name ::= BOOL */ - -1, /* (217) type_name ::= TINYINT */ - -1, /* (218) type_name ::= SMALLINT */ - -1, /* (219) type_name ::= INT */ - -1, /* (220) type_name ::= INTEGER */ - -1, /* (221) type_name ::= BIGINT */ - -1, /* (222) type_name ::= FLOAT */ - -1, /* (223) type_name ::= DOUBLE */ - -4, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - -1, /* (225) type_name ::= TIMESTAMP */ - -4, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - -2, /* (227) type_name ::= TINYINT UNSIGNED */ - -2, /* (228) type_name ::= SMALLINT UNSIGNED */ - -2, /* (229) type_name ::= INT UNSIGNED */ - -2, /* (230) type_name ::= BIGINT UNSIGNED */ - -1, /* (231) type_name ::= JSON */ - -4, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - -1, /* (233) type_name ::= MEDIUMBLOB */ - -1, /* (234) type_name ::= BLOB */ - -4, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - -4, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - -1, /* (237) type_name ::= DECIMAL */ - -4, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - -6, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - -1, /* (240) type_name_default_len ::= BINARY */ - -1, /* (241) type_name_default_len ::= NCHAR */ - -1, /* (242) type_name_default_len ::= VARCHAR */ - -1, /* (243) type_name_default_len ::= VARBINARY */ + -3, /* (207) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + -1, /* (208) full_table_name ::= table_name */ + -3, /* (209) full_table_name ::= db_name NK_DOT table_name */ + -1, /* (210) tag_def_list ::= tag_def */ + -3, /* (211) tag_def_list ::= tag_def_list NK_COMMA tag_def */ + -2, /* (212) tag_def ::= column_name type_name */ + -1, /* (213) column_def_list ::= column_def */ + -3, /* (214) column_def_list ::= column_def_list NK_COMMA column_def */ + -3, /* (215) column_def ::= column_name type_name column_options */ + -1, /* (216) type_name ::= BOOL */ + -1, /* (217) type_name ::= TINYINT */ + -1, /* (218) type_name ::= SMALLINT */ + -1, /* (219) type_name ::= INT */ + -1, /* (220) type_name ::= INTEGER */ + -1, /* (221) type_name ::= BIGINT */ + -1, /* (222) type_name ::= FLOAT */ + -1, /* (223) type_name ::= DOUBLE */ + -4, /* (224) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + -1, /* (225) type_name ::= TIMESTAMP */ + -4, /* (226) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + -2, /* (227) type_name ::= TINYINT UNSIGNED */ + -2, /* (228) type_name ::= SMALLINT UNSIGNED */ + -2, /* (229) type_name ::= INT UNSIGNED */ + -2, /* (230) type_name ::= BIGINT UNSIGNED */ + -1, /* (231) type_name ::= JSON */ + -4, /* (232) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + -1, /* (233) type_name ::= MEDIUMBLOB */ + -1, /* (234) type_name ::= BLOB */ + -4, /* (235) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + -4, /* (236) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + -1, /* (237) type_name ::= DECIMAL */ + -4, /* (238) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + -6, /* (239) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + -1, /* (240) type_name_default_len ::= BINARY */ + -1, /* (241) type_name_default_len ::= NCHAR */ + -1, /* (242) type_name_default_len ::= VARCHAR */ + -1, /* (243) type_name_default_len ::= VARBINARY */ 0, /* (244) tags_def_opt ::= */ - -1, /* (245) tags_def_opt ::= tags_def */ - -4, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + -1, /* (245) tags_def_opt ::= tags_def */ + -4, /* (246) tags_def ::= TAGS NK_LP tag_def_list NK_RP */ 0, /* (247) table_options ::= */ - -3, /* (248) table_options ::= table_options COMMENT NK_STRING */ - -3, /* (249) table_options ::= table_options MAX_DELAY duration_list */ - -3, /* (250) table_options ::= table_options WATERMARK duration_list */ - -5, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - -3, /* (252) table_options ::= table_options TTL NK_INTEGER */ - -5, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - -3, /* (254) table_options ::= table_options DELETE_MARK duration_list */ - -1, /* (255) alter_table_options ::= alter_table_option */ - -2, /* (256) alter_table_options ::= alter_table_options alter_table_option */ - -2, /* (257) alter_table_option ::= COMMENT NK_STRING */ - -2, /* (258) alter_table_option ::= TTL NK_INTEGER */ - -1, /* (259) duration_list ::= duration_literal */ - -3, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ - -1, /* (261) rollup_func_list ::= rollup_func_name */ - -3, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - -1, /* (263) rollup_func_name ::= function_name */ - -1, /* (264) rollup_func_name ::= FIRST */ - -1, /* (265) rollup_func_name ::= LAST */ - -1, /* (266) col_name_list ::= col_name */ - -3, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ - -1, /* (268) col_name ::= column_name */ - -2, /* (269) cmd ::= SHOW DNODES */ - -2, /* (270) cmd ::= SHOW USERS */ - -3, /* (271) cmd ::= SHOW USERS FULL */ - -3, /* (272) cmd ::= SHOW USER PRIVILEGES */ - -3, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ - -4, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - -4, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - -3, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ - -2, /* (277) cmd ::= SHOW MNODES */ - -2, /* (278) cmd ::= SHOW QNODES */ - -2, /* (279) cmd ::= SHOW ARBGROUPS */ - -2, /* (280) cmd ::= SHOW FUNCTIONS */ - -5, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (283) cmd ::= SHOW STREAMS */ - -2, /* (284) cmd ::= SHOW ACCOUNTS */ - -2, /* (285) cmd ::= SHOW APPS */ - -2, /* (286) cmd ::= SHOW CONNECTIONS */ - -2, /* (287) cmd ::= SHOW LICENCES */ - -2, /* (288) cmd ::= SHOW GRANTS */ - -3, /* (289) cmd ::= SHOW GRANTS FULL */ - -3, /* (290) cmd ::= SHOW GRANTS LOGS */ - -3, /* (291) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (295) cmd ::= SHOW ENCRYPTIONS */ - -2, /* (296) cmd ::= SHOW QUERIES */ - -2, /* (297) cmd ::= SHOW SCORES */ - -2, /* (298) cmd ::= SHOW TOPICS */ - -2, /* (299) cmd ::= SHOW VARIABLES */ - -3, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (301) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (303) cmd ::= SHOW BNODES */ - -2, /* (304) cmd ::= SHOW SNODES */ - -2, /* (305) cmd ::= SHOW CLUSTER */ - -2, /* (306) cmd ::= SHOW TRANSACTIONS */ - -4, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (308) cmd ::= SHOW CONSUMERS */ - -2, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (315) cmd ::= SHOW VNODES */ - -3, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (317) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (320) cmd ::= SHOW COMPACTS */ - -3, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ + -3, /* (248) table_options ::= table_options COMMENT NK_STRING */ + -3, /* (249) table_options ::= table_options MAX_DELAY duration_list */ + -3, /* (250) table_options ::= table_options WATERMARK duration_list */ + -5, /* (251) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + -3, /* (252) table_options ::= table_options TTL NK_INTEGER */ + -5, /* (253) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + -3, /* (254) table_options ::= table_options DELETE_MARK duration_list */ + -1, /* (255) alter_table_options ::= alter_table_option */ + -2, /* (256) alter_table_options ::= alter_table_options alter_table_option */ + -2, /* (257) alter_table_option ::= COMMENT NK_STRING */ + -2, /* (258) alter_table_option ::= TTL NK_INTEGER */ + -1, /* (259) duration_list ::= duration_literal */ + -3, /* (260) duration_list ::= duration_list NK_COMMA duration_literal */ + -1, /* (261) rollup_func_list ::= rollup_func_name */ + -3, /* (262) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + -1, /* (263) rollup_func_name ::= function_name */ + -1, /* (264) rollup_func_name ::= FIRST */ + -1, /* (265) rollup_func_name ::= LAST */ + -1, /* (266) col_name_list ::= col_name */ + -3, /* (267) col_name_list ::= col_name_list NK_COMMA col_name */ + -1, /* (268) col_name ::= column_name */ + -2, /* (269) cmd ::= SHOW DNODES */ + -2, /* (270) cmd ::= SHOW USERS */ + -3, /* (271) cmd ::= SHOW USERS FULL */ + -3, /* (272) cmd ::= SHOW USER PRIVILEGES */ + -3, /* (273) cmd ::= SHOW db_kind_opt DATABASES */ + -4, /* (274) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + -4, /* (275) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + -3, /* (276) cmd ::= SHOW db_name_cond_opt VGROUPS */ + -2, /* (277) cmd ::= SHOW MNODES */ + -2, /* (278) cmd ::= SHOW QNODES */ + -2, /* (279) cmd ::= SHOW ARBGROUPS */ + -2, /* (280) cmd ::= SHOW FUNCTIONS */ + -5, /* (281) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (282) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (283) cmd ::= SHOW STREAMS */ + -2, /* (284) cmd ::= SHOW ACCOUNTS */ + -2, /* (285) cmd ::= SHOW APPS */ + -2, /* (286) cmd ::= SHOW CONNECTIONS */ + -2, /* (287) cmd ::= SHOW LICENCES */ + -2, /* (288) cmd ::= SHOW GRANTS */ + -3, /* (289) cmd ::= SHOW GRANTS FULL */ + -3, /* (290) cmd ::= SHOW GRANTS LOGS */ + -3, /* (291) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (292) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (293) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (294) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (295) cmd ::= SHOW ENCRYPTIONS */ + -2, /* (296) cmd ::= SHOW QUERIES */ + -2, /* (297) cmd ::= SHOW SCORES */ + -2, /* (298) cmd ::= SHOW TOPICS */ + -2, /* (299) cmd ::= SHOW VARIABLES */ + -3, /* (300) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (301) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (302) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (303) cmd ::= SHOW BNODES */ + -2, /* (304) cmd ::= SHOW SNODES */ + -2, /* (305) cmd ::= SHOW CLUSTER */ + -2, /* (306) cmd ::= SHOW TRANSACTIONS */ + -4, /* (307) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (308) cmd ::= SHOW CONSUMERS */ + -2, /* (309) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (310) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (311) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (312) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (313) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (314) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (315) cmd ::= SHOW VNODES */ + -3, /* (316) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (317) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (318) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (319) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (320) cmd ::= SHOW COMPACTS */ + -3, /* (321) cmd ::= SHOW COMPACT NK_INTEGER */ 0, /* (322) table_kind_db_name_cond_opt ::= */ - -1, /* (323) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (326) table_kind ::= NORMAL */ - -1, /* (327) table_kind ::= CHILD */ + -1, /* (323) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (324) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (325) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (326) table_kind ::= NORMAL */ + -1, /* (327) table_kind ::= CHILD */ 0, /* (328) db_name_cond_opt ::= */ - -2, /* (329) db_name_cond_opt ::= db_name NK_DOT */ + -2, /* (329) db_name_cond_opt ::= db_name NK_DOT */ 0, /* (330) like_pattern_opt ::= */ - -2, /* (331) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (332) table_name_cond ::= table_name */ + -2, /* (331) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (332) table_name_cond ::= table_name */ 0, /* (333) from_db_opt ::= */ - -2, /* (334) from_db_opt ::= FROM db_name */ + -2, /* (334) from_db_opt ::= FROM db_name */ 0, /* (335) tag_list_opt ::= */ - -1, /* (336) tag_list_opt ::= tag_item */ - -3, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (338) tag_item ::= TBNAME */ - -1, /* (339) tag_item ::= QTAGS */ - -1, /* (340) tag_item ::= column_name */ - -2, /* (341) tag_item ::= column_name column_alias */ - -3, /* (342) tag_item ::= column_name AS column_alias */ + -1, /* (336) tag_list_opt ::= tag_item */ + -3, /* (337) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (338) tag_item ::= TBNAME */ + -1, /* (339) tag_item ::= QTAGS */ + -1, /* (340) tag_item ::= column_name */ + -2, /* (341) tag_item ::= column_name column_alias */ + -3, /* (342) tag_item ::= column_name AS column_alias */ 0, /* (343) db_kind_opt ::= */ - -1, /* (344) db_kind_opt ::= USER */ - -1, /* (345) db_kind_opt ::= SYSTEM */ - -11, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ - -11, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ - -4, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ - -3, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ - -1, /* (350) full_tsma_name ::= tsma_name */ - -3, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ - -4, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ - -8, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (356) full_index_name ::= index_name */ - -3, /* (357) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (359) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - -1, /* (360) func_list ::= func */ - -3, /* (361) func_list ::= func_list NK_COMMA func */ - -4, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (363) sma_func_name ::= function_name */ - -1, /* (364) sma_func_name ::= COUNT */ - -1, /* (365) sma_func_name ::= FIRST */ - -1, /* (366) sma_func_name ::= LAST */ - -1, /* (367) sma_func_name ::= LAST_ROW */ + -1, /* (344) db_kind_opt ::= USER */ + -1, /* (345) db_kind_opt ::= SYSTEM */ + -11, /* (346) cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + -11, /* (347) cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + -4, /* (348) cmd ::= DROP TSMA exists_opt full_tsma_name */ + -3, /* (349) cmd ::= SHOW db_name_cond_opt TSMAS */ + -1, /* (350) full_tsma_name ::= tsma_name */ + -3, /* (351) full_tsma_name ::= db_name NK_DOT tsma_name */ + -4, /* (352) tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + -8, /* (353) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (354) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (355) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (356) full_index_name ::= index_name */ + -3, /* (357) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (358) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (359) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + -1, /* (360) func_list ::= func */ + -3, /* (361) func_list ::= func_list NK_COMMA func */ + -4, /* (362) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (363) sma_func_name ::= function_name */ + -1, /* (364) sma_func_name ::= COUNT */ + -1, /* (365) sma_func_name ::= FIRST */ + -1, /* (366) sma_func_name ::= LAST */ + -1, /* (367) sma_func_name ::= LAST_ROW */ 0, /* (368) sma_stream_opt ::= */ - -3, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (372) with_meta ::= AS */ - -3, /* (373) with_meta ::= WITH META AS */ - -3, /* (374) with_meta ::= ONLY META AS */ - -6, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (380) cmd ::= DESC full_table_name */ - -2, /* (381) cmd ::= DESCRIBE full_table_name */ - -3, /* (382) cmd ::= RESET QUERY CACHE */ - -4, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + -3, /* (369) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (370) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (371) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (372) with_meta ::= AS */ + -3, /* (373) with_meta ::= WITH META AS */ + -3, /* (374) with_meta ::= ONLY META AS */ + -6, /* (375) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (376) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (377) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (378) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (379) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (380) cmd ::= DESC full_table_name */ + -2, /* (381) cmd ::= DESCRIBE full_table_name */ + -3, /* (382) cmd ::= RESET QUERY CACHE */ + -4, /* (383) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (384) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ 0, /* (385) analyze_opt ::= */ - -1, /* (386) analyze_opt ::= ANALYZE */ + -1, /* (386) analyze_opt ::= ANALYZE */ 0, /* (387) explain_options ::= */ - -3, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (390) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ + -3, /* (388) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (389) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (390) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (391) cmd ::= DROP FUNCTION exists_opt function_name */ 0, /* (392) agg_func_opt ::= */ - -1, /* (393) agg_func_opt ::= AGGREGATE */ + -1, /* (393) agg_func_opt ::= AGGREGATE */ 0, /* (394) bufsize_opt ::= */ - -2, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ + -2, /* (395) bufsize_opt ::= BUFSIZE NK_INTEGER */ 0, /* (396) language_opt ::= */ - -2, /* (397) language_opt ::= LANGUAGE NK_STRING */ + -2, /* (397) language_opt ::= LANGUAGE NK_STRING */ 0, /* (398) or_replace_opt ::= */ - -2, /* (399) or_replace_opt ::= OR REPLACE */ - -6, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (402) full_view_name ::= view_name */ - -3, /* (403) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (404) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + -2, /* (399) or_replace_opt ::= OR REPLACE */ + -6, /* (400) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (401) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (402) full_view_name ::= view_name */ + -3, /* (403) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (404) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (405) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (406) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (407) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ 0, /* (408) col_list_opt ::= */ - -3, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ - -1, /* (410) column_stream_def_list ::= column_stream_def */ - -3, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ - -2, /* (412) column_stream_def ::= column_name stream_col_options */ + -3, /* (409) col_list_opt ::= NK_LP column_stream_def_list NK_RP */ + -1, /* (410) column_stream_def_list ::= column_stream_def */ + -3, /* (411) column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ + -2, /* (412) column_stream_def ::= column_name stream_col_options */ 0, /* (413) stream_col_options ::= */ - -3, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ + -3, /* (414) stream_col_options ::= stream_col_options PRIMARY KEY */ 0, /* (415) tag_def_or_ref_opt ::= */ - -1, /* (416) tag_def_or_ref_opt ::= tags_def */ - -4, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ + -1, /* (416) tag_def_or_ref_opt ::= tags_def */ + -4, /* (417) tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ 0, /* (418) stream_options ::= */ - -3, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + -3, /* (419) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (420) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (421) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (422) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (423) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (424) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (425) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (426) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ 0, /* (427) subtable_opt ::= */ - -4, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + -4, /* (428) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ 0, /* (429) ignore_opt ::= */ - -2, /* (430) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (432) cmd ::= KILL QUERY NK_STRING */ - -3, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (435) cmd ::= BALANCE VGROUP */ - -4, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -5, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ - -4, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ + -2, /* (430) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (431) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (432) cmd ::= KILL QUERY NK_STRING */ + -3, /* (433) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (434) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (435) cmd ::= BALANCE VGROUP */ + -4, /* (436) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -5, /* (437) cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + -4, /* (438) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (439) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (440) cmd ::= SPLIT VGROUP NK_INTEGER */ 0, /* (441) on_vgroup_id ::= */ - -2, /* (442) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (443) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (446) cmd ::= query_or_subquery */ - -1, /* (447) cmd ::= insert_query */ - -7, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (450) tags_literal ::= NK_INTEGER */ - -3, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - -3, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ - -2, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ - -4, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ - -2, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ - -4, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ - -4, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ - -1, /* (459) tags_literal ::= NK_FLOAT */ - -2, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (462) tags_literal ::= NK_BIN */ - -3, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ - -3, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ - -2, /* (465) tags_literal ::= NK_PLUS NK_BIN */ - -4, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ - -4, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ - -2, /* (468) tags_literal ::= NK_MINUS NK_BIN */ - -4, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ - -4, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ - -1, /* (471) tags_literal ::= NK_HEX */ - -3, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ - -3, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ - -2, /* (474) tags_literal ::= NK_PLUS NK_HEX */ - -4, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ - -4, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ - -2, /* (477) tags_literal ::= NK_MINUS NK_HEX */ - -4, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ - -4, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ - -1, /* (480) tags_literal ::= NK_STRING */ - -3, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ - -3, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ - -1, /* (483) tags_literal ::= NK_BOOL */ - -1, /* (484) tags_literal ::= NULL */ - -1, /* (485) tags_literal ::= literal_func */ - -3, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (488) tags_literal_list ::= tags_literal */ - -3, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (490) literal ::= NK_INTEGER */ - -1, /* (491) literal ::= NK_FLOAT */ - -1, /* (492) literal ::= NK_STRING */ - -1, /* (493) literal ::= NK_BOOL */ - -2, /* (494) literal ::= TIMESTAMP NK_STRING */ - -1, /* (495) literal ::= duration_literal */ - -1, /* (496) literal ::= NULL */ - -1, /* (497) literal ::= NK_QUESTION */ - -1, /* (498) duration_literal ::= NK_VARIABLE */ - -1, /* (499) signed ::= NK_INTEGER */ - -2, /* (500) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (501) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (502) signed ::= NK_FLOAT */ - -2, /* (503) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (504) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (505) signed_literal ::= signed */ - -1, /* (506) signed_literal ::= NK_STRING */ - -1, /* (507) signed_literal ::= NK_BOOL */ - -2, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (509) signed_literal ::= duration_literal */ - -1, /* (510) signed_literal ::= NULL */ - -1, /* (511) signed_literal ::= literal_func */ - -1, /* (512) signed_literal ::= NK_QUESTION */ - -1, /* (513) literal_list ::= signed_literal */ - -3, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (515) db_name ::= NK_ID */ - -1, /* (516) table_name ::= NK_ID */ - -1, /* (517) column_name ::= NK_ID */ - -1, /* (518) function_name ::= NK_ID */ - -1, /* (519) view_name ::= NK_ID */ - -1, /* (520) table_alias ::= NK_ID */ - -1, /* (521) column_alias ::= NK_ID */ - -1, /* (522) column_alias ::= NK_ALIAS */ - -1, /* (523) user_name ::= NK_ID */ - -1, /* (524) topic_name ::= NK_ID */ - -1, /* (525) stream_name ::= NK_ID */ - -1, /* (526) cgroup_name ::= NK_ID */ - -1, /* (527) index_name ::= NK_ID */ - -1, /* (528) tsma_name ::= NK_ID */ - -1, /* (529) expr_or_subquery ::= expression */ - -1, /* (530) expression ::= literal */ - -1, /* (531) expression ::= pseudo_column */ - -1, /* (532) expression ::= column_reference */ - -1, /* (533) expression ::= function_expression */ - -1, /* (534) expression ::= case_when_expression */ - -3, /* (535) expression ::= NK_LP expression NK_RP */ - -2, /* (536) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (537) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (546) expression_list ::= expr_or_subquery */ - -3, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (548) column_reference ::= column_name */ - -3, /* (549) column_reference ::= table_name NK_DOT column_name */ - -1, /* (550) column_reference ::= NK_ALIAS */ - -3, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (552) pseudo_column ::= ROWTS */ - -1, /* (553) pseudo_column ::= TBNAME */ - -3, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (555) pseudo_column ::= QSTART */ - -1, /* (556) pseudo_column ::= QEND */ - -1, /* (557) pseudo_column ::= QDURATION */ - -1, /* (558) pseudo_column ::= WSTART */ - -1, /* (559) pseudo_column ::= WEND */ - -1, /* (560) pseudo_column ::= WDURATION */ - -1, /* (561) pseudo_column ::= IROWTS */ - -1, /* (562) pseudo_column ::= ISFILLED */ - -1, /* (563) pseudo_column ::= QTAGS */ - -4, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -6, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ - -1, /* (568) function_expression ::= literal_func */ - -3, /* (569) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (570) literal_func ::= NOW */ - -1, /* (571) literal_func ::= TODAY */ - -1, /* (572) noarg_func ::= NOW */ - -1, /* (573) noarg_func ::= TODAY */ - -1, /* (574) noarg_func ::= TIMEZONE */ - -1, /* (575) noarg_func ::= DATABASE */ - -1, /* (576) noarg_func ::= CLIENT_VERSION */ - -1, /* (577) noarg_func ::= SERVER_VERSION */ - -1, /* (578) noarg_func ::= SERVER_STATUS */ - -1, /* (579) noarg_func ::= CURRENT_USER */ - -1, /* (580) noarg_func ::= USER */ - -1, /* (581) star_func ::= COUNT */ - -1, /* (582) star_func ::= FIRST */ - -1, /* (583) star_func ::= LAST */ - -1, /* (584) star_func ::= LAST_ROW */ - -1, /* (585) star_func_para_list ::= NK_STAR */ - -1, /* (586) star_func_para_list ::= other_para_list */ - -1, /* (587) other_para_list ::= star_func_para */ - -3, /* (588) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (589) star_func_para ::= expr_or_subquery */ - -3, /* (590) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (591) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (592) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (593) when_then_list ::= when_then_expr */ - -2, /* (594) when_then_list ::= when_then_list when_then_expr */ - -4, /* (595) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (596) case_when_else_opt ::= */ - -2, /* (597) case_when_else_opt ::= ELSE common_expression */ - -3, /* (598) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (599) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (600) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (601) predicate ::= expr_or_subquery IS NULL */ - -4, /* (602) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (603) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (604) compare_op ::= NK_LT */ - -1, /* (605) compare_op ::= NK_GT */ - -1, /* (606) compare_op ::= NK_LE */ - -1, /* (607) compare_op ::= NK_GE */ - -1, /* (608) compare_op ::= NK_NE */ - -1, /* (609) compare_op ::= NK_EQ */ - -1, /* (610) compare_op ::= LIKE */ - -2, /* (611) compare_op ::= NOT LIKE */ - -1, /* (612) compare_op ::= MATCH */ - -1, /* (613) compare_op ::= NMATCH */ - -1, /* (614) compare_op ::= CONTAINS */ - -1, /* (615) in_op ::= IN */ - -2, /* (616) in_op ::= NOT IN */ - -3, /* (617) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (618) boolean_value_expression ::= boolean_primary */ - -2, /* (619) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (620) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (621) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (622) boolean_primary ::= predicate */ - -3, /* (623) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (624) common_expression ::= expr_or_subquery */ - -1, /* (625) common_expression ::= boolean_value_expression */ - 0, /* (626) from_clause_opt ::= */ - -2, /* (627) from_clause_opt ::= FROM table_reference_list */ - -1, /* (628) table_reference_list ::= table_reference */ - -3, /* (629) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (630) table_reference ::= table_primary */ - -1, /* (631) table_reference ::= joined_table */ - -2, /* (632) table_primary ::= table_name alias_opt */ - -4, /* (633) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (634) table_primary ::= subquery alias_opt */ - -1, /* (635) table_primary ::= parenthesized_joined_table */ - 0, /* (636) alias_opt ::= */ - -1, /* (637) alias_opt ::= table_alias */ - -2, /* (638) alias_opt ::= AS table_alias */ - -3, /* (639) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (640) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (641) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (642) join_type ::= */ - -1, /* (643) join_type ::= INNER */ - -1, /* (644) join_type ::= LEFT */ - -1, /* (645) join_type ::= RIGHT */ - -1, /* (646) join_type ::= FULL */ - 0, /* (647) join_subtype ::= */ - -1, /* (648) join_subtype ::= OUTER */ - -1, /* (649) join_subtype ::= SEMI */ - -1, /* (650) join_subtype ::= ANTI */ - -1, /* (651) join_subtype ::= ASOF */ - -1, /* (652) join_subtype ::= WINDOW */ - 0, /* (653) join_on_clause_opt ::= */ - -2, /* (654) join_on_clause_opt ::= ON search_condition */ - 0, /* (655) window_offset_clause_opt ::= */ - -6, /* (656) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (657) window_offset_literal ::= NK_VARIABLE */ - -2, /* (658) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (659) jlimit_clause_opt ::= */ - -2, /* (660) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (661) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (662) hint_list ::= */ - -1, /* (663) hint_list ::= NK_HINT */ - 0, /* (664) tag_mode_opt ::= */ - -1, /* (665) tag_mode_opt ::= TAGS */ - 0, /* (666) set_quantifier_opt ::= */ - -1, /* (667) set_quantifier_opt ::= DISTINCT */ - -1, /* (668) set_quantifier_opt ::= ALL */ - -1, /* (669) select_list ::= select_item */ - -3, /* (670) select_list ::= select_list NK_COMMA select_item */ - -1, /* (671) select_item ::= NK_STAR */ - -1, /* (672) select_item ::= common_expression */ - -2, /* (673) select_item ::= common_expression column_alias */ - -3, /* (674) select_item ::= common_expression AS column_alias */ - -3, /* (675) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (676) where_clause_opt ::= */ - -2, /* (677) where_clause_opt ::= WHERE search_condition */ - 0, /* (678) partition_by_clause_opt ::= */ - -3, /* (679) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (680) partition_list ::= partition_item */ - -3, /* (681) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (682) partition_item ::= expr_or_subquery */ - -2, /* (683) partition_item ::= expr_or_subquery column_alias */ - -3, /* (684) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (685) twindow_clause_opt ::= */ - -6, /* (686) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (687) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (688) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (689) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (690) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (691) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (692) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (693) sliding_opt ::= */ - -4, /* (694) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (695) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (696) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (697) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (698) fill_opt ::= */ - -4, /* (699) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (700) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (701) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (702) fill_mode ::= NONE */ - -1, /* (703) fill_mode ::= PREV */ - -1, /* (704) fill_mode ::= NULL */ - -1, /* (705) fill_mode ::= NULL_F */ - -1, /* (706) fill_mode ::= LINEAR */ - -1, /* (707) fill_mode ::= NEXT */ - 0, /* (708) group_by_clause_opt ::= */ - -3, /* (709) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (710) group_by_list ::= expr_or_subquery */ - -3, /* (711) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (712) having_clause_opt ::= */ - -2, /* (713) having_clause_opt ::= HAVING search_condition */ - 0, /* (714) range_opt ::= */ - -6, /* (715) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (716) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (717) every_opt ::= */ - -4, /* (718) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (719) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (720) query_simple ::= query_specification */ - -1, /* (721) query_simple ::= union_query_expression */ - -4, /* (722) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (723) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (724) query_simple_or_subquery ::= query_simple */ - -1, /* (725) query_simple_or_subquery ::= subquery */ - -1, /* (726) query_or_subquery ::= query_expression */ - -1, /* (727) query_or_subquery ::= subquery */ - 0, /* (728) order_by_clause_opt ::= */ - -3, /* (729) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (730) slimit_clause_opt ::= */ - -2, /* (731) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (732) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (733) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (734) limit_clause_opt ::= */ - -2, /* (735) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (736) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (737) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (738) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (739) subquery ::= NK_LP subquery NK_RP */ - -1, /* (740) search_condition ::= common_expression */ - -1, /* (741) sort_specification_list ::= sort_specification */ - -3, /* (742) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (743) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (744) ordering_specification_opt ::= */ - -1, /* (745) ordering_specification_opt ::= ASC */ - -1, /* (746) ordering_specification_opt ::= DESC */ - 0, /* (747) null_ordering_opt ::= */ - -2, /* (748) null_ordering_opt ::= NULLS FIRST */ - -2, /* (749) null_ordering_opt ::= NULLS LAST */ - 0, /* (750) column_options ::= */ - -3, /* (751) column_options ::= column_options PRIMARY KEY */ - -3, /* (752) column_options ::= column_options ENCODE NK_STRING */ - -3, /* (753) column_options ::= column_options COMPRESS NK_STRING */ - -3, /* (754) column_options ::= column_options LEVEL NK_STRING */ + -2, /* (442) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (443) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (444) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (445) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (446) cmd ::= query_or_subquery */ + -1, /* (447) cmd ::= insert_query */ + -7, /* (448) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (449) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (450) tags_literal ::= NK_INTEGER */ + -3, /* (451) tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + -3, /* (452) tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ + -2, /* (453) tags_literal ::= NK_PLUS NK_INTEGER */ + -4, /* (454) tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (455) tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ + -2, /* (456) tags_literal ::= NK_MINUS NK_INTEGER */ + -4, /* (457) tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ + -4, /* (458) tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ + -1, /* (459) tags_literal ::= NK_FLOAT */ + -2, /* (460) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (461) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (462) tags_literal ::= NK_BIN */ + -3, /* (463) tags_literal ::= NK_BIN NK_PLUS duration_literal */ + -3, /* (464) tags_literal ::= NK_BIN NK_MINUS duration_literal */ + -2, /* (465) tags_literal ::= NK_PLUS NK_BIN */ + -4, /* (466) tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ + -4, /* (467) tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ + -2, /* (468) tags_literal ::= NK_MINUS NK_BIN */ + -4, /* (469) tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ + -4, /* (470) tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ + -1, /* (471) tags_literal ::= NK_HEX */ + -3, /* (472) tags_literal ::= NK_HEX NK_PLUS duration_literal */ + -3, /* (473) tags_literal ::= NK_HEX NK_MINUS duration_literal */ + -2, /* (474) tags_literal ::= NK_PLUS NK_HEX */ + -4, /* (475) tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ + -4, /* (476) tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ + -2, /* (477) tags_literal ::= NK_MINUS NK_HEX */ + -4, /* (478) tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ + -4, /* (479) tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ + -1, /* (480) tags_literal ::= NK_STRING */ + -3, /* (481) tags_literal ::= NK_STRING NK_PLUS duration_literal */ + -3, /* (482) tags_literal ::= NK_STRING NK_MINUS duration_literal */ + -1, /* (483) tags_literal ::= NK_BOOL */ + -1, /* (484) tags_literal ::= NULL */ + -1, /* (485) tags_literal ::= literal_func */ + -3, /* (486) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (487) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (488) tags_literal_list ::= tags_literal */ + -3, /* (489) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (490) literal ::= NK_INTEGER */ + -1, /* (491) literal ::= NK_FLOAT */ + -1, /* (492) literal ::= NK_STRING */ + -1, /* (493) literal ::= NK_BOOL */ + -2, /* (494) literal ::= TIMESTAMP NK_STRING */ + -1, /* (495) literal ::= duration_literal */ + -1, /* (496) literal ::= NULL */ + -1, /* (497) literal ::= NK_QUESTION */ + -1, /* (498) duration_literal ::= NK_VARIABLE */ + -1, /* (499) signed ::= NK_INTEGER */ + -2, /* (500) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (501) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (502) signed ::= NK_FLOAT */ + -2, /* (503) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (504) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (505) signed_literal ::= signed */ + -1, /* (506) signed_literal ::= NK_STRING */ + -1, /* (507) signed_literal ::= NK_BOOL */ + -2, /* (508) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (509) signed_literal ::= duration_literal */ + -1, /* (510) signed_literal ::= NULL */ + -1, /* (511) signed_literal ::= literal_func */ + -1, /* (512) signed_literal ::= NK_QUESTION */ + -1, /* (513) literal_list ::= signed_literal */ + -3, /* (514) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (515) db_name ::= NK_ID */ + -1, /* (516) table_name ::= NK_ID */ + -1, /* (517) column_name ::= NK_ID */ + -1, /* (518) function_name ::= NK_ID */ + -1, /* (519) view_name ::= NK_ID */ + -1, /* (520) table_alias ::= NK_ID */ + -1, /* (521) column_alias ::= NK_ID */ + -1, /* (522) column_alias ::= NK_ALIAS */ + -1, /* (523) user_name ::= NK_ID */ + -1, /* (524) topic_name ::= NK_ID */ + -1, /* (525) stream_name ::= NK_ID */ + -1, /* (526) cgroup_name ::= NK_ID */ + -1, /* (527) index_name ::= NK_ID */ + -1, /* (528) tsma_name ::= NK_ID */ + -1, /* (529) expr_or_subquery ::= expression */ + -1, /* (530) expression ::= literal */ + -1, /* (531) expression ::= pseudo_column */ + -1, /* (532) expression ::= column_reference */ + -1, /* (533) expression ::= function_expression */ + -1, /* (534) expression ::= case_when_expression */ + -3, /* (535) expression ::= NK_LP expression NK_RP */ + -2, /* (536) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (537) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (538) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (539) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (540) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (541) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (542) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (543) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (544) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (545) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (546) expression_list ::= expr_or_subquery */ + -3, /* (547) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (548) column_reference ::= column_name */ + -3, /* (549) column_reference ::= table_name NK_DOT column_name */ + -1, /* (550) column_reference ::= NK_ALIAS */ + -3, /* (551) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (552) pseudo_column ::= ROWTS */ + -1, /* (553) pseudo_column ::= TBNAME */ + -3, /* (554) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (555) pseudo_column ::= QSTART */ + -1, /* (556) pseudo_column ::= QEND */ + -1, /* (557) pseudo_column ::= QDURATION */ + -1, /* (558) pseudo_column ::= WSTART */ + -1, /* (559) pseudo_column ::= WEND */ + -1, /* (560) pseudo_column ::= WDURATION */ + -1, /* (561) pseudo_column ::= IROWTS */ + -1, /* (562) pseudo_column ::= ISFILLED */ + -1, /* (563) pseudo_column ::= QTAGS */ + -4, /* (564) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (565) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (566) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -6, /* (567) function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ + -6, /* (568) function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ + -4, /* (569) function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ + -6, /* (570) function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ + -6, /* (571) function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + -7, /* (572) function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ + -4, /* (573) function_expression ::= substr_func NK_LP expression_list NK_RP */ + -6, /* (574) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + -8, /* (575) function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ + -4, /* (576) function_expression ::= REPLACE NK_LP expression_list NK_RP */ + -1, /* (577) function_expression ::= literal_func */ + -3, /* (578) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (579) literal_func ::= NOW */ + -1, /* (580) literal_func ::= TODAY */ + -1, /* (581) substr_func ::= SUBSTR */ + -1, /* (582) substr_func ::= SUBSTRING */ + -1, /* (583) trim_specification_type ::= BOTH */ + -1, /* (584) trim_specification_type ::= TRAILING */ + -1, /* (585) trim_specification_type ::= LEADING */ + -1, /* (586) noarg_func ::= NOW */ + -1, /* (587) noarg_func ::= TODAY */ + -1, /* (588) noarg_func ::= TIMEZONE */ + -1, /* (589) noarg_func ::= DATABASE */ + -1, /* (590) noarg_func ::= CLIENT_VERSION */ + -1, /* (591) noarg_func ::= SERVER_VERSION */ + -1, /* (592) noarg_func ::= SERVER_STATUS */ + -1, /* (593) noarg_func ::= CURRENT_USER */ + -1, /* (594) noarg_func ::= USER */ + -1, /* (595) noarg_func ::= PI */ + -1, /* (596) star_func ::= COUNT */ + -1, /* (597) star_func ::= FIRST */ + -1, /* (598) star_func ::= LAST */ + -1, /* (599) star_func ::= LAST_ROW */ + -1, /* (600) star_func_para_list ::= NK_STAR */ + -1, /* (601) star_func_para_list ::= other_para_list */ + -1, /* (602) other_para_list ::= star_func_para */ + -3, /* (603) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (604) star_func_para ::= expr_or_subquery */ + -3, /* (605) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (606) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (607) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (608) when_then_list ::= when_then_expr */ + -2, /* (609) when_then_list ::= when_then_list when_then_expr */ + -4, /* (610) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (611) case_when_else_opt ::= */ + -2, /* (612) case_when_else_opt ::= ELSE common_expression */ + -3, /* (613) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (614) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (615) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (616) predicate ::= expr_or_subquery IS NULL */ + -4, /* (617) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (618) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (619) compare_op ::= NK_LT */ + -1, /* (620) compare_op ::= NK_GT */ + -1, /* (621) compare_op ::= NK_LE */ + -1, /* (622) compare_op ::= NK_GE */ + -1, /* (623) compare_op ::= NK_NE */ + -1, /* (624) compare_op ::= NK_EQ */ + -1, /* (625) compare_op ::= LIKE */ + -2, /* (626) compare_op ::= NOT LIKE */ + -1, /* (627) compare_op ::= MATCH */ + -1, /* (628) compare_op ::= NMATCH */ + -1, /* (629) compare_op ::= CONTAINS */ + -1, /* (630) in_op ::= IN */ + -2, /* (631) in_op ::= NOT IN */ + -3, /* (632) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (633) boolean_value_expression ::= boolean_primary */ + -2, /* (634) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (635) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (636) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (637) boolean_primary ::= predicate */ + -3, /* (638) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (639) common_expression ::= expr_or_subquery */ + -1, /* (640) common_expression ::= boolean_value_expression */ + 0, /* (641) from_clause_opt ::= */ + -2, /* (642) from_clause_opt ::= FROM table_reference_list */ + -1, /* (643) table_reference_list ::= table_reference */ + -3, /* (644) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (645) table_reference ::= table_primary */ + -1, /* (646) table_reference ::= joined_table */ + -2, /* (647) table_primary ::= table_name alias_opt */ + -4, /* (648) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (649) table_primary ::= subquery alias_opt */ + -1, /* (650) table_primary ::= parenthesized_joined_table */ + 0, /* (651) alias_opt ::= */ + -1, /* (652) alias_opt ::= table_alias */ + -2, /* (653) alias_opt ::= AS table_alias */ + -3, /* (654) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (655) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (656) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (657) join_type ::= */ + -1, /* (658) join_type ::= INNER */ + -1, /* (659) join_type ::= LEFT */ + -1, /* (660) join_type ::= RIGHT */ + -1, /* (661) join_type ::= FULL */ + 0, /* (662) join_subtype ::= */ + -1, /* (663) join_subtype ::= OUTER */ + -1, /* (664) join_subtype ::= SEMI */ + -1, /* (665) join_subtype ::= ANTI */ + -1, /* (666) join_subtype ::= ASOF */ + -1, /* (667) join_subtype ::= WINDOW */ + 0, /* (668) join_on_clause_opt ::= */ + -2, /* (669) join_on_clause_opt ::= ON search_condition */ + 0, /* (670) window_offset_clause_opt ::= */ + -6, /* (671) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (672) window_offset_literal ::= NK_VARIABLE */ + -2, /* (673) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (674) jlimit_clause_opt ::= */ + -2, /* (675) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (676) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (677) hint_list ::= */ + -1, /* (678) hint_list ::= NK_HINT */ + 0, /* (679) tag_mode_opt ::= */ + -1, /* (680) tag_mode_opt ::= TAGS */ + 0, /* (681) set_quantifier_opt ::= */ + -1, /* (682) set_quantifier_opt ::= DISTINCT */ + -1, /* (683) set_quantifier_opt ::= ALL */ + -1, /* (684) select_list ::= select_item */ + -3, /* (685) select_list ::= select_list NK_COMMA select_item */ + -1, /* (686) select_item ::= NK_STAR */ + -1, /* (687) select_item ::= common_expression */ + -2, /* (688) select_item ::= common_expression column_alias */ + -3, /* (689) select_item ::= common_expression AS column_alias */ + -3, /* (690) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (691) where_clause_opt ::= */ + -2, /* (692) where_clause_opt ::= WHERE search_condition */ + 0, /* (693) partition_by_clause_opt ::= */ + -3, /* (694) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (695) partition_list ::= partition_item */ + -3, /* (696) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (697) partition_item ::= expr_or_subquery */ + -2, /* (698) partition_item ::= expr_or_subquery column_alias */ + -3, /* (699) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (700) twindow_clause_opt ::= */ + -6, /* (701) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (702) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (703) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (704) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (705) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (706) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (707) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (708) sliding_opt ::= */ + -4, /* (709) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (710) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (711) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (712) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (713) fill_opt ::= */ + -4, /* (714) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (715) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (716) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (717) fill_mode ::= NONE */ + -1, /* (718) fill_mode ::= PREV */ + -1, /* (719) fill_mode ::= NULL */ + -1, /* (720) fill_mode ::= NULL_F */ + -1, /* (721) fill_mode ::= LINEAR */ + -1, /* (722) fill_mode ::= NEXT */ + 0, /* (723) group_by_clause_opt ::= */ + -3, /* (724) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (725) group_by_list ::= expr_or_subquery */ + -3, /* (726) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (727) having_clause_opt ::= */ + -2, /* (728) having_clause_opt ::= HAVING search_condition */ + 0, /* (729) range_opt ::= */ + -6, /* (730) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (731) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (732) every_opt ::= */ + -4, /* (733) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (734) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (735) query_simple ::= query_specification */ + -1, /* (736) query_simple ::= union_query_expression */ + -4, /* (737) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (738) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (739) query_simple_or_subquery ::= query_simple */ + -1, /* (740) query_simple_or_subquery ::= subquery */ + -1, /* (741) query_or_subquery ::= query_expression */ + -1, /* (742) query_or_subquery ::= subquery */ + 0, /* (743) order_by_clause_opt ::= */ + -3, /* (744) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (745) slimit_clause_opt ::= */ + -2, /* (746) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (747) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (748) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (749) limit_clause_opt ::= */ + -2, /* (750) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (751) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (752) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (753) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (754) subquery ::= NK_LP subquery NK_RP */ + -1, /* (755) search_condition ::= common_expression */ + -1, /* (756) sort_specification_list ::= sort_specification */ + -3, /* (757) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (758) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (759) ordering_specification_opt ::= */ + -1, /* (760) ordering_specification_opt ::= ASC */ + -1, /* (761) ordering_specification_opt ::= DESC */ + 0, /* (762) null_ordering_opt ::= */ + -2, /* (763) null_ordering_opt ::= NULLS FIRST */ + -2, /* (764) null_ordering_opt ::= NULLS LAST */ + 0, /* (765) column_options ::= */ + -3, /* (766) column_options ::= column_options PRIMARY KEY */ + -3, /* (767) column_options ::= column_options ENCODE NK_STRING */ + -3, /* (768) column_options ::= column_options COMPRESS NK_STRING */ + -3, /* (769) column_options ::= column_options LEVEL NK_STRING */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -5535,3142 +5796,2187 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ** means that the extra parameters have no performance impact. */ static YYACTIONTYPE yy_reduce( - yyParser *yypParser, /* The parser */ - unsigned int yyruleno, /* Number of the rule by which to reduce */ - int yyLookahead, /* Lookahead token, or YYNOCODE if none */ - ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ - ParseCTX_PDECL /* %extra_context */ + yyParser *yypParser, /* The parser */ + unsigned int yyruleno, /* Number of the rule by which to reduce */ + int yyLookahead, /* Lookahead token, or YYNOCODE if none */ + ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ + ParseCTX_PDECL /* %extra_context */ ){ int yygoto; /* The next state */ YYACTIONTYPE yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ ParseARG_FETCH - (void)yyLookahead; + (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; switch( yyruleno ){ - /* Beginning here are the reduction cases. A typical example + /* Beginning here are the reduction cases. A typical example ** follows: ** case 0: ** #line ** { ... } // User supplied code ** #line ** break; - */ -/********** Begin reduce actions **********************************************/ - YYMINORTYPE yylhsminor; - case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ -#line 50 "sql.y" -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5567 "sql.c" - yy_destructor(yypParser,379,&yymsp[0].minor); - break; - case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ -#line 51 "sql.y" -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 5573 "sql.c" - yy_destructor(yypParser,380,&yymsp[0].minor); - break; - case 2: /* account_options ::= */ -#line 55 "sql.y" -{ } -#line 5579 "sql.c" - break; - case 3: /* account_options ::= account_options PPS literal */ - case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); - case 5: /* account_options ::= account_options STORAGE literal */ yytestcase(yyruleno==5); - case 6: /* account_options ::= account_options STREAMS literal */ yytestcase(yyruleno==6); - case 7: /* account_options ::= account_options QTIME literal */ yytestcase(yyruleno==7); - case 8: /* account_options ::= account_options DBS literal */ yytestcase(yyruleno==8); - 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,379,&yymsp[-2].minor); -#line 56 "sql.y" -{ } -#line 5593 "sql.c" - yy_destructor(yypParser,381,&yymsp[0].minor); -} - break; - case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,382,&yymsp[0].minor); -#line 68 "sql.y" -{ } -#line 5601 "sql.c" -} - break; - case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,380,&yymsp[-1].minor); -#line 69 "sql.y" -{ } -#line 5608 "sql.c" - yy_destructor(yypParser,382,&yymsp[0].minor); -} - break; - case 14: /* alter_account_option ::= PASS literal */ - case 15: /* alter_account_option ::= PPS literal */ yytestcase(yyruleno==15); - case 16: /* alter_account_option ::= TSERIES literal */ yytestcase(yyruleno==16); - case 17: /* alter_account_option ::= STORAGE literal */ yytestcase(yyruleno==17); - case 18: /* alter_account_option ::= STREAMS literal */ yytestcase(yyruleno==18); - case 19: /* alter_account_option ::= QTIME literal */ yytestcase(yyruleno==19); - case 20: /* alter_account_option ::= DBS literal */ yytestcase(yyruleno==20); - case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21); - case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); - case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); -#line 73 "sql.y" -{ } -#line 5624 "sql.c" - yy_destructor(yypParser,381,&yymsp[0].minor); - break; - case 24: /* ip_range_list ::= NK_STRING */ -#line 86 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5630 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -#line 87 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5636 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 26: /* white_list ::= HOST ip_range_list */ -#line 91 "sql.y" -{ yymsp[-1].minor.yy316 = yymsp[0].minor.yy316; } -#line 5642 "sql.c" - break; - case 27: /* white_list_opt ::= */ - case 206: /* specific_cols_opt ::= */ yytestcase(yyruleno==206); - case 244: /* tags_def_opt ::= */ yytestcase(yyruleno==244); - case 335: /* tag_list_opt ::= */ yytestcase(yyruleno==335); - case 408: /* col_list_opt ::= */ yytestcase(yyruleno==408); - case 415: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==415); - case 678: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==678); - case 708: /* group_by_clause_opt ::= */ yytestcase(yyruleno==708); - case 728: /* order_by_clause_opt ::= */ yytestcase(yyruleno==728); -#line 95 "sql.y" -{ yymsp[1].minor.yy316 = NULL; } -#line 5655 "sql.c" - break; - case 28: /* white_list_opt ::= white_list */ - case 245: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==245); - case 416: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==416); - case 586: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==586); -#line 96 "sql.y" -{ yylhsminor.yy316 = yymsp[0].minor.yy316; } -#line 5663 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 29: /* is_import_opt ::= */ - case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); -#line 100 "sql.y" -{ yymsp[1].minor.yy1043 = 0; } -#line 5670 "sql.c" - break; - case 30: /* is_import_opt ::= IS_IMPORT NK_INTEGER */ - case 32: /* is_createdb_opt ::= CREATEDB NK_INTEGER */ yytestcase(yyruleno==32); - case 42: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ yytestcase(yyruleno==42); -#line 101 "sql.y" -{ yymsp[-1].minor.yy1043 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5677 "sql.c" - break; - case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ -#line 109 "sql.y" -{ - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy1043, yymsp[-1].minor.yy1043, yymsp[-2].minor.yy1043); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy316); - } -#line 5685 "sql.c" - break; - case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -#line 113 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } -#line 5690 "sql.c" - break; - case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -#line 114 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } -#line 5695 "sql.c" - break; - case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -#line 115 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } -#line 5700 "sql.c" - break; - case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ -#line 116 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } -#line 5705 "sql.c" - break; - case 38: /* cmd ::= ALTER USER user_name ADD white_list */ -#line 117 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy316); } -#line 5710 "sql.c" - break; - case 39: /* cmd ::= ALTER USER user_name DROP white_list */ -#line 118 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy1109, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy316); } -#line 5715 "sql.c" - break; - case 40: /* cmd ::= DROP USER user_name */ -#line 119 "sql.y" -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 5720 "sql.c" - break; - case 41: /* sysinfo_opt ::= */ -#line 123 "sql.y" -{ yymsp[1].minor.yy1043 = 1; } -#line 5725 "sql.c" - break; - case 43: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -#line 127 "sql.y" -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } -#line 5730 "sql.c" - break; - case 44: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -#line 128 "sql.y" -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy1089, &yymsp[-3].minor.yy849, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy416); } -#line 5735 "sql.c" - break; - case 45: /* privileges ::= ALL */ -#line 132 "sql.y" -{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALL; } -#line 5740 "sql.c" - break; - case 46: /* privileges ::= priv_type_list */ - case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); -#line 133 "sql.y" -{ yylhsminor.yy1089 = yymsp[0].minor.yy1089; } -#line 5746 "sql.c" - yymsp[0].minor.yy1089 = yylhsminor.yy1089; - break; - case 47: /* privileges ::= SUBSCRIBE */ -#line 134 "sql.y" -{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_SUBSCRIBE; } -#line 5752 "sql.c" - break; - case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -#line 139 "sql.y" -{ yylhsminor.yy1089 = yymsp[-2].minor.yy1089 | yymsp[0].minor.yy1089; } -#line 5757 "sql.c" - yymsp[-2].minor.yy1089 = yylhsminor.yy1089; - break; - case 50: /* priv_type ::= READ */ -#line 143 "sql.y" -{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_READ; } -#line 5763 "sql.c" - break; - case 51: /* priv_type ::= WRITE */ -#line 144 "sql.y" -{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_WRITE; } -#line 5768 "sql.c" - break; - case 52: /* priv_type ::= ALTER */ -#line 145 "sql.y" -{ yymsp[0].minor.yy1089 = PRIVILEGE_TYPE_ALTER; } -#line 5773 "sql.c" - break; - case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -#line 149 "sql.y" -{ yylhsminor.yy849.first = yymsp[-2].minor.yy0; yylhsminor.yy849.second = yymsp[0].minor.yy0; } -#line 5778 "sql.c" - yymsp[-2].minor.yy849 = yylhsminor.yy849; - break; - case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ -#line 150 "sql.y" -{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy0; } -#line 5784 "sql.c" - yymsp[-2].minor.yy849 = yylhsminor.yy849; - break; - case 55: /* priv_level ::= db_name NK_DOT table_name */ -#line 151 "sql.y" -{ yylhsminor.yy849.first = yymsp[-2].minor.yy1109; yylhsminor.yy849.second = yymsp[0].minor.yy1109; } -#line 5790 "sql.c" - yymsp[-2].minor.yy849 = yylhsminor.yy849; - break; - case 56: /* priv_level ::= topic_name */ -#line 152 "sql.y" -{ yylhsminor.yy849.first = yymsp[0].minor.yy1109; yylhsminor.yy849.second = nil_token; } -#line 5796 "sql.c" - yymsp[0].minor.yy849 = yylhsminor.yy849; - break; - case 57: /* with_opt ::= */ - case 173: /* start_opt ::= */ yytestcase(yyruleno==173); - case 177: /* end_opt ::= */ yytestcase(yyruleno==177); - case 330: /* like_pattern_opt ::= */ yytestcase(yyruleno==330); - case 427: /* subtable_opt ::= */ yytestcase(yyruleno==427); - case 596: /* case_when_else_opt ::= */ yytestcase(yyruleno==596); - case 626: /* from_clause_opt ::= */ yytestcase(yyruleno==626); - case 653: /* join_on_clause_opt ::= */ yytestcase(yyruleno==653); - case 655: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==655); - case 659: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==659); - case 676: /* where_clause_opt ::= */ yytestcase(yyruleno==676); - case 685: /* twindow_clause_opt ::= */ yytestcase(yyruleno==685); - case 693: /* sliding_opt ::= */ yytestcase(yyruleno==693); - case 698: /* fill_opt ::= */ yytestcase(yyruleno==698); - case 712: /* having_clause_opt ::= */ yytestcase(yyruleno==712); - case 714: /* range_opt ::= */ yytestcase(yyruleno==714); - case 717: /* every_opt ::= */ yytestcase(yyruleno==717); - case 730: /* slimit_clause_opt ::= */ yytestcase(yyruleno==730); - case 734: /* limit_clause_opt ::= */ yytestcase(yyruleno==734); -#line 154 "sql.y" -{ yymsp[1].minor.yy416 = NULL; } -#line 5820 "sql.c" - break; - case 58: /* with_opt ::= WITH search_condition */ - case 627: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==627); - case 654: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==654); - case 677: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==677); - case 713: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==713); -#line 155 "sql.y" -{ yymsp[-1].minor.yy416 = yymsp[0].minor.yy416; } -#line 5829 "sql.c" - break; - case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ -#line 158 "sql.y" -{ pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } -#line 5834 "sql.c" - break; - case 60: /* cmd ::= CREATE DNODE dnode_endpoint */ -#line 161 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy1109, NULL); } -#line 5839 "sql.c" - break; - case 61: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -#line 162 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } -#line 5844 "sql.c" - break; - case 62: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -#line 163 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy209, false); } -#line 5849 "sql.c" - break; - case 63: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -#line 164 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy209, false); } -#line 5854 "sql.c" - break; - case 64: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -#line 165 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy209); } -#line 5859 "sql.c" - break; - case 65: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -#line 166 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy1109, false, yymsp[0].minor.yy209); } -#line 5864 "sql.c" - break; - case 66: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ -#line 167 "sql.y" -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } -#line 5869 "sql.c" - break; - case 67: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ -#line 168 "sql.y" -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5874 "sql.c" - break; - case 68: /* cmd ::= ALTER ALL DNODES NK_STRING */ -#line 169 "sql.y" -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } -#line 5879 "sql.c" - break; - case 69: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ -#line 170 "sql.y" -{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5884 "sql.c" - break; - case 70: /* cmd ::= RESTORE DNODE NK_INTEGER */ -#line 171 "sql.y" -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } -#line 5889 "sql.c" - break; - case 71: /* dnode_endpoint ::= NK_STRING */ - case 72: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==72); - case 73: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==73); - case 364: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==364); - case 365: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==365); - case 366: /* sma_func_name ::= LAST */ yytestcase(yyruleno==366); - case 367: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==367); - case 515: /* db_name ::= NK_ID */ yytestcase(yyruleno==515); - case 516: /* table_name ::= NK_ID */ yytestcase(yyruleno==516); - case 517: /* column_name ::= NK_ID */ yytestcase(yyruleno==517); - case 518: /* function_name ::= NK_ID */ yytestcase(yyruleno==518); - case 519: /* view_name ::= NK_ID */ yytestcase(yyruleno==519); - case 520: /* table_alias ::= NK_ID */ yytestcase(yyruleno==520); - case 521: /* column_alias ::= NK_ID */ yytestcase(yyruleno==521); - case 522: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==522); - case 523: /* user_name ::= NK_ID */ yytestcase(yyruleno==523); - case 524: /* topic_name ::= NK_ID */ yytestcase(yyruleno==524); - case 525: /* stream_name ::= NK_ID */ yytestcase(yyruleno==525); - case 526: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==526); - case 527: /* index_name ::= NK_ID */ yytestcase(yyruleno==527); - case 528: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==528); - case 572: /* noarg_func ::= NOW */ yytestcase(yyruleno==572); - case 573: /* noarg_func ::= TODAY */ yytestcase(yyruleno==573); - case 574: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==574); - case 575: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==575); - case 576: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==576); - case 577: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==577); - case 578: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==578); - case 579: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==579); - case 580: /* noarg_func ::= USER */ yytestcase(yyruleno==580); - case 581: /* star_func ::= COUNT */ yytestcase(yyruleno==581); - case 582: /* star_func ::= FIRST */ yytestcase(yyruleno==582); - case 583: /* star_func ::= LAST */ yytestcase(yyruleno==583); - case 584: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==584); -#line 175 "sql.y" -{ yylhsminor.yy1109 = yymsp[0].minor.yy0; } -#line 5927 "sql.c" - yymsp[0].minor.yy1109 = yylhsminor.yy1109; - break; - case 74: /* force_opt ::= */ - case 101: /* not_exists_opt ::= */ yytestcase(yyruleno==101); - case 103: /* exists_opt ::= */ yytestcase(yyruleno==103); - case 385: /* analyze_opt ::= */ yytestcase(yyruleno==385); - case 392: /* agg_func_opt ::= */ yytestcase(yyruleno==392); - case 398: /* or_replace_opt ::= */ yytestcase(yyruleno==398); - case 429: /* ignore_opt ::= */ yytestcase(yyruleno==429); - case 664: /* tag_mode_opt ::= */ yytestcase(yyruleno==664); - case 666: /* set_quantifier_opt ::= */ yytestcase(yyruleno==666); -#line 181 "sql.y" -{ yymsp[1].minor.yy209 = false; } -#line 5941 "sql.c" - break; - case 75: /* force_opt ::= FORCE */ - case 76: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==76); - case 386: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==386); - case 393: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==393); - case 665: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==665); - case 667: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==667); -#line 182 "sql.y" -{ yymsp[0].minor.yy209 = true; } -#line 5951 "sql.c" - break; - case 77: /* cmd ::= ALTER CLUSTER NK_STRING */ -#line 189 "sql.y" -{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5956 "sql.c" - break; - case 78: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ -#line 190 "sql.y" -{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5961 "sql.c" - break; - case 79: /* cmd ::= ALTER LOCAL NK_STRING */ -#line 193 "sql.y" -{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5966 "sql.c" - break; - case 80: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ -#line 194 "sql.y" -{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5971 "sql.c" - break; - case 81: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ -#line 197 "sql.y" -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5976 "sql.c" - break; - case 82: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ -#line 198 "sql.y" -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5981 "sql.c" - break; - case 83: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ -#line 199 "sql.y" -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5986 "sql.c" - break; - case 84: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ -#line 202 "sql.y" -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5991 "sql.c" - break; - case 85: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ -#line 203 "sql.y" -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5996 "sql.c" - break; - case 86: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ -#line 206 "sql.y" -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 6001 "sql.c" - break; - case 87: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ -#line 207 "sql.y" -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 6006 "sql.c" - break; - case 88: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ -#line 210 "sql.y" -{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6011 "sql.c" - break; - case 89: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ -#line 211 "sql.y" -{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6016 "sql.c" - break; - case 90: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ -#line 212 "sql.y" -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 6021 "sql.c" - break; - case 91: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ -#line 215 "sql.y" -{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } -#line 6026 "sql.c" - break; - case 92: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -#line 218 "sql.y" -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy209, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } -#line 6031 "sql.c" - break; - case 93: /* cmd ::= DROP DATABASE exists_opt db_name */ -#line 219 "sql.y" -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 6036 "sql.c" - break; - case 94: /* cmd ::= USE db_name */ -#line 220 "sql.y" -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 6041 "sql.c" - break; - case 95: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -#line 221 "sql.y" -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } -#line 6046 "sql.c" - break; - case 96: /* cmd ::= FLUSH DATABASE db_name */ -#line 222 "sql.y" -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 6051 "sql.c" - break; - case 97: /* cmd ::= TRIM DATABASE db_name speed_opt */ -#line 223 "sql.y" -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy820); } -#line 6056 "sql.c" - break; - case 98: /* cmd ::= S3MIGRATE DATABASE db_name */ -#line 224 "sql.y" -{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 6061 "sql.c" - break; - case 99: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -#line 225 "sql.y" -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 6066 "sql.c" - break; - case 100: /* not_exists_opt ::= IF NOT EXISTS */ -#line 229 "sql.y" -{ yymsp[-2].minor.yy209 = true; } -#line 6071 "sql.c" - break; - case 102: /* exists_opt ::= IF EXISTS */ - case 399: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==399); - case 430: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==430); -#line 234 "sql.y" -{ yymsp[-1].minor.yy209 = true; } -#line 6078 "sql.c" - break; - case 104: /* db_options ::= */ -#line 237 "sql.y" -{ yymsp[1].minor.yy416 = createDefaultDatabaseOptions(pCxt); } -#line 6083 "sql.c" - break; - case 105: /* db_options ::= db_options BUFFER NK_INTEGER */ -#line 238 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } -#line 6088 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 106: /* db_options ::= db_options CACHEMODEL NK_STRING */ -#line 239 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } -#line 6094 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 107: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -#line 240 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } -#line 6100 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 108: /* db_options ::= db_options COMP NK_INTEGER */ -#line 241 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_COMP, &yymsp[0].minor.yy0); } -#line 6106 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 109: /* db_options ::= db_options DURATION NK_INTEGER */ - case 110: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==110); -#line 242 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } -#line 6113 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 111: /* db_options ::= db_options MAXROWS NK_INTEGER */ -#line 244 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } -#line 6119 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 112: /* db_options ::= db_options MINROWS NK_INTEGER */ -#line 245 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } -#line 6125 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 113: /* db_options ::= db_options KEEP integer_list */ - case 114: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==114); -#line 246 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP, yymsp[0].minor.yy316); } -#line 6132 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 115: /* db_options ::= db_options PAGES NK_INTEGER */ -#line 248 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } -#line 6138 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 116: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -#line 249 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } -#line 6144 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 117: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -#line 250 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } -#line 6150 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 118: /* db_options ::= db_options PRECISION NK_STRING */ -#line 251 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } -#line 6156 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 119: /* db_options ::= db_options REPLICA NK_INTEGER */ -#line 252 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } -#line 6162 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 120: /* db_options ::= db_options VGROUPS NK_INTEGER */ -#line 254 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } -#line 6168 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 121: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -#line 255 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } -#line 6174 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 122: /* db_options ::= db_options RETENTIONS retention_list */ -#line 256 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_RETENTIONS, yymsp[0].minor.yy316); } -#line 6180 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 123: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -#line 257 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } -#line 6186 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 124: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -#line 258 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL, &yymsp[0].minor.yy0); } -#line 6192 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 125: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -#line 259 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } -#line 6198 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 126: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -#line 260 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } -#line 6204 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 127: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -#line 261 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_PERIOD, &t); - } -#line 6214 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 128: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -#line 266 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } -#line 6220 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 129: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -#line 267 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-3].minor.yy416, DB_OPTION_WAL_RETENTION_SIZE, &t); - } -#line 6230 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 130: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -#line 272 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } -#line 6236 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 131: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -#line 273 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } -#line 6242 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 132: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -#line 274 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } -#line 6248 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 133: /* db_options ::= db_options TABLE_PREFIX signed */ -#line 275 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy416); } -#line 6254 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 134: /* db_options ::= db_options TABLE_SUFFIX signed */ -#line 276 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy416); } -#line 6260 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 135: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ -#line 277 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } -#line 6266 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 136: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ - case 137: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==137); -#line 278 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } -#line 6273 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 138: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ -#line 280 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } -#line 6279 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 139: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -#line 281 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } -#line 6285 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 140: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ -#line 282 "sql.y" -{ yylhsminor.yy416 = setDatabaseOption(pCxt, yymsp[-2].minor.yy416, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } -#line 6291 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 141: /* alter_db_options ::= alter_db_option */ -#line 284 "sql.y" -{ yylhsminor.yy416 = createAlterDatabaseOptions(pCxt); yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yylhsminor.yy416, &yymsp[0].minor.yy101); } -#line 6297 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 142: /* alter_db_options ::= alter_db_options alter_db_option */ -#line 285 "sql.y" -{ yylhsminor.yy416 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy416, &yymsp[0].minor.yy101); } -#line 6303 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 143: /* alter_db_option ::= BUFFER NK_INTEGER */ -#line 289 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6309 "sql.c" - break; - case 144: /* alter_db_option ::= CACHEMODEL NK_STRING */ -#line 290 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6314 "sql.c" - break; - case 145: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -#line 291 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6319 "sql.c" - break; - case 146: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -#line 292 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6324 "sql.c" - break; - case 147: /* alter_db_option ::= KEEP integer_list */ - case 148: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==148); -#line 293 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP; yymsp[-1].minor.yy101.pList = yymsp[0].minor.yy316; } -#line 6330 "sql.c" - break; - case 149: /* alter_db_option ::= PAGES NK_INTEGER */ -#line 295 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_PAGES; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6335 "sql.c" - break; - case 150: /* alter_db_option ::= REPLICA NK_INTEGER */ -#line 296 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6340 "sql.c" - break; - case 151: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -#line 298 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6345 "sql.c" - break; - case 152: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -#line 299 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6350 "sql.c" - break; - case 153: /* alter_db_option ::= MINROWS NK_INTEGER */ -#line 300 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6355 "sql.c" - break; - case 154: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -#line 301 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6360 "sql.c" - break; - case 155: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ -#line 302 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy101.val = t; - } -#line 6369 "sql.c" - break; - case 156: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -#line 307 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6374 "sql.c" - break; - case 157: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ -#line 308 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy101.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy101.val = t; - } -#line 6383 "sql.c" - break; - case 158: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ - case 159: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==159); -#line 313 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6389 "sql.c" - break; - case 160: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ -#line 315 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6394 "sql.c" - break; - case 161: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -#line 316 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6399 "sql.c" - break; - case 162: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ -#line 317 "sql.y" -{ yymsp[-1].minor.yy101.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6404 "sql.c" - break; - case 163: /* integer_list ::= NK_INTEGER */ -#line 321 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6409 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 164: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 444: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==444); -#line 322 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6416 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 165: /* variable_list ::= NK_VARIABLE */ -#line 326 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6422 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 166: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -#line 327 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6428 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 167: /* retention_list ::= retention */ - case 200: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==200); - case 203: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==203); - case 210: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==210); - case 213: /* column_def_list ::= column_def */ yytestcase(yyruleno==213); - case 261: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==261); - case 266: /* col_name_list ::= col_name */ yytestcase(yyruleno==266); - case 336: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==336); - case 360: /* func_list ::= func */ yytestcase(yyruleno==360); - case 410: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==410); - case 488: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==488); - case 513: /* literal_list ::= signed_literal */ yytestcase(yyruleno==513); - case 587: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==587); - case 593: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==593); - case 669: /* select_list ::= select_item */ yytestcase(yyruleno==669); - case 680: /* partition_list ::= partition_item */ yytestcase(yyruleno==680); - case 741: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==741); -#line 331 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, yymsp[0].minor.yy416); } -#line 6450 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 168: /* retention_list ::= retention_list NK_COMMA retention */ - case 204: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==204); - case 211: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==211); - case 214: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==214); - case 262: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==262); - case 267: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==267); - case 337: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==337); - case 361: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==361); - case 411: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==411); - case 489: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==489); - case 514: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==514); - case 588: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==588); - case 670: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==670); - case 681: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==681); - case 742: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==742); -#line 332 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } -#line 6470 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 169: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - case 170: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==170); -#line 334 "sql.y" -{ yylhsminor.yy416 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6477 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 171: /* speed_opt ::= */ - case 394: /* bufsize_opt ::= */ yytestcase(yyruleno==394); -#line 339 "sql.y" -{ yymsp[1].minor.yy820 = 0; } -#line 6484 "sql.c" - break; - case 172: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 395: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==395); -#line 340 "sql.y" -{ yymsp[-1].minor.yy820 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } -#line 6490 "sql.c" - break; - case 174: /* start_opt ::= START WITH NK_INTEGER */ - case 178: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==178); -#line 343 "sql.y" -{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } -#line 6496 "sql.c" - break; - case 175: /* start_opt ::= START WITH NK_STRING */ - case 179: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==179); -#line 344 "sql.y" -{ yymsp[-2].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 6502 "sql.c" - break; - case 176: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ - case 180: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==180); -#line 345 "sql.y" -{ yymsp[-3].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 6508 "sql.c" - break; - case 181: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 184: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==184); -#line 354 "sql.y" -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy316, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } -#line 6514 "sql.c" - break; - case 182: /* cmd ::= CREATE TABLE multi_create_clause */ -#line 355 "sql.y" -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy316); } -#line 6519 "sql.c" - break; - case 183: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ -#line 357 "sql.y" -{ pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy316, &yymsp[0].minor.yy0); } -#line 6524 "sql.c" - break; - case 185: /* cmd ::= DROP TABLE multi_drop_clause */ -#line 360 "sql.y" -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy316); } -#line 6529 "sql.c" - break; - case 186: /* cmd ::= DROP STABLE exists_opt full_table_name */ -#line 361 "sql.y" -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } -#line 6534 "sql.c" - break; - case 187: /* cmd ::= ALTER TABLE alter_table_clause */ - case 446: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==446); - case 447: /* cmd ::= insert_query */ yytestcase(yyruleno==447); -#line 363 "sql.y" -{ pCxt->pRootNode = yymsp[0].minor.yy416; } -#line 6541 "sql.c" - break; - case 188: /* cmd ::= ALTER STABLE alter_table_clause */ -#line 364 "sql.y" -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy416); } -#line 6546 "sql.c" - break; - case 189: /* alter_table_clause ::= full_table_name alter_table_options */ -#line 366 "sql.y" -{ yylhsminor.yy416 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 6551 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 190: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ -#line 368 "sql.y" -{ yylhsminor.yy416 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy416, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } -#line 6557 "sql.c" - yymsp[-5].minor.yy416 = yylhsminor.yy416; - break; - case 191: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -#line 369 "sql.y" -{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy1109); } -#line 6563 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -#line 371 "sql.y" -{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } -#line 6569 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 193: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ -#line 373 "sql.y" -{ yylhsminor.yy416 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy416); } -#line 6575 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 194: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -#line 375 "sql.y" -{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 6581 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 195: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -#line 377 "sql.y" -{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } -#line 6587 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 196: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -#line 378 "sql.y" -{ yylhsminor.yy416 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy416, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy1109); } -#line 6593 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 197: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -#line 380 "sql.y" -{ yylhsminor.yy416 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952); } -#line 6599 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 198: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -#line 382 "sql.y" -{ yylhsminor.yy416 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy416, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 6605 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 199: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -#line 384 "sql.y" -{ yylhsminor.yy416 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy416, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } -#line 6611 "sql.c" - yymsp[-5].minor.yy416 = yylhsminor.yy416; - break; - case 201: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 594: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==594); -#line 389 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-1].minor.yy316, yymsp[0].minor.yy416); } -#line 6618 "sql.c" - yymsp[-1].minor.yy316 = yylhsminor.yy316; - break; - case 202: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -#line 393 "sql.y" -{ yylhsminor.yy416 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy209, yymsp[-8].minor.yy416, yymsp[-6].minor.yy416, yymsp[-5].minor.yy316, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } -#line 6624 "sql.c" - yymsp[-9].minor.yy416 = yylhsminor.yy416; - break; - case 205: /* drop_table_clause ::= exists_opt full_table_name */ -#line 400 "sql.y" -{ yylhsminor.yy416 = createDropTableClause(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } -#line 6630 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 207: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 409: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==409); -#line 405 "sql.y" -{ yymsp[-2].minor.yy316 = yymsp[-1].minor.yy316; } -#line 6637 "sql.c" - break; - case 208: /* full_table_name ::= table_name */ - case 350: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==350); -#line 407 "sql.y" -{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy1109, NULL); } -#line 6643 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 209: /* full_table_name ::= db_name NK_DOT table_name */ - case 351: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==351); -#line 408 "sql.y" -{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, NULL); } -#line 6650 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 212: /* tag_def ::= column_name type_name */ -#line 414 "sql.y" -{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, yymsp[0].minor.yy952, NULL); } -#line 6656 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 215: /* column_def ::= column_name type_name column_options */ -#line 422 "sql.y" -{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy1109, yymsp[-1].minor.yy952, yymsp[0].minor.yy416); } -#line 6662 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 216: /* type_name ::= BOOL */ -#line 426 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BOOL); } -#line 6668 "sql.c" - break; - case 217: /* type_name ::= TINYINT */ -#line 427 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TINYINT); } -#line 6673 "sql.c" - break; - case 218: /* type_name ::= SMALLINT */ -#line 428 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_SMALLINT); } -#line 6678 "sql.c" - break; - case 219: /* type_name ::= INT */ - case 220: /* type_name ::= INTEGER */ yytestcase(yyruleno==220); -#line 429 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_INT); } -#line 6684 "sql.c" - break; - case 221: /* type_name ::= BIGINT */ -#line 431 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BIGINT); } -#line 6689 "sql.c" - break; - case 222: /* type_name ::= FLOAT */ -#line 432 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_FLOAT); } -#line 6694 "sql.c" - break; - case 223: /* type_name ::= DOUBLE */ -#line 433 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DOUBLE); } -#line 6699 "sql.c" - break; - case 224: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -#line 434 "sql.y" -{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } -#line 6704 "sql.c" - break; - case 225: /* type_name ::= TIMESTAMP */ -#line 435 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } -#line 6709 "sql.c" - break; - case 226: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -#line 436 "sql.y" -{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } -#line 6714 "sql.c" - break; - case 227: /* type_name ::= TINYINT UNSIGNED */ -#line 437 "sql.y" -{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UTINYINT); } -#line 6719 "sql.c" - break; - case 228: /* type_name ::= SMALLINT UNSIGNED */ -#line 438 "sql.y" -{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_USMALLINT); } -#line 6724 "sql.c" - break; - case 229: /* type_name ::= INT UNSIGNED */ -#line 439 "sql.y" -{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UINT); } -#line 6729 "sql.c" - break; - case 230: /* type_name ::= BIGINT UNSIGNED */ -#line 440 "sql.y" -{ yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UBIGINT); } -#line 6734 "sql.c" - break; - case 231: /* type_name ::= JSON */ -#line 441 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_JSON); } -#line 6739 "sql.c" - break; - case 232: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -#line 442 "sql.y" -{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } -#line 6744 "sql.c" - break; - case 233: /* type_name ::= MEDIUMBLOB */ -#line 443 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } -#line 6749 "sql.c" - break; - case 234: /* type_name ::= BLOB */ -#line 444 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BLOB); } -#line 6754 "sql.c" - break; - case 235: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -#line 445 "sql.y" -{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } -#line 6759 "sql.c" - break; - case 236: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ -#line 446 "sql.y" -{ yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } -#line 6764 "sql.c" - break; - case 237: /* type_name ::= DECIMAL */ -#line 447 "sql.y" -{ yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6769 "sql.c" - break; - case 238: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -#line 448 "sql.y" -{ yymsp[-3].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6774 "sql.c" - break; - case 239: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -#line 449 "sql.y" -{ yymsp[-5].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6779 "sql.c" - break; - case 240: /* type_name_default_len ::= BINARY */ -#line 453 "sql.y" -{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } -#line 6784 "sql.c" - break; - case 241: /* type_name_default_len ::= NCHAR */ -#line 454 "sql.y" -{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } -#line 6789 "sql.c" - break; - case 242: /* type_name_default_len ::= VARCHAR */ -#line 455 "sql.y" -{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } -#line 6794 "sql.c" - break; - case 243: /* type_name_default_len ::= VARBINARY */ -#line 456 "sql.y" -{ yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } -#line 6799 "sql.c" - break; - case 246: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ - case 417: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==417); -#line 465 "sql.y" -{ yymsp[-3].minor.yy316 = yymsp[-1].minor.yy316; } -#line 6805 "sql.c" - break; - case 247: /* table_options ::= */ -#line 467 "sql.y" -{ yymsp[1].minor.yy416 = createDefaultTableOptions(pCxt); } -#line 6810 "sql.c" - break; - case 248: /* table_options ::= table_options COMMENT NK_STRING */ -#line 468 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } -#line 6815 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 249: /* table_options ::= table_options MAX_DELAY duration_list */ -#line 469 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy316); } -#line 6821 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 250: /* table_options ::= table_options WATERMARK duration_list */ -#line 470 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy316); } -#line 6827 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 251: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -#line 471 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy316); } -#line 6833 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 252: /* table_options ::= table_options TTL NK_INTEGER */ -#line 472 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } -#line 6839 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 253: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -#line 473 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-4].minor.yy416, TABLE_OPTION_SMA, yymsp[-1].minor.yy316); } -#line 6845 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 254: /* table_options ::= table_options DELETE_MARK duration_list */ -#line 474 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-2].minor.yy416, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy316); } -#line 6851 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 255: /* alter_table_options ::= alter_table_option */ -#line 476 "sql.y" -{ yylhsminor.yy416 = createAlterTableOptions(pCxt); yylhsminor.yy416 = setTableOption(pCxt, yylhsminor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } -#line 6857 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 256: /* alter_table_options ::= alter_table_options alter_table_option */ -#line 477 "sql.y" -{ yylhsminor.yy416 = setTableOption(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy101.type, &yymsp[0].minor.yy101.val); } -#line 6863 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 257: /* alter_table_option ::= COMMENT NK_STRING */ -#line 481 "sql.y" -{ yymsp[-1].minor.yy101.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6869 "sql.c" - break; - case 258: /* alter_table_option ::= TTL NK_INTEGER */ -#line 482 "sql.y" -{ yymsp[-1].minor.yy101.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy101.val = yymsp[0].minor.yy0; } -#line 6874 "sql.c" - break; - case 259: /* duration_list ::= duration_literal */ - case 546: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==546); -#line 486 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 6880 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 260: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 547: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==547); -#line 487 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 6887 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 263: /* rollup_func_name ::= function_name */ -#line 494 "sql.y" -{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy1109, NULL); } -#line 6893 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 264: /* rollup_func_name ::= FIRST */ - case 265: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==265); - case 339: /* tag_item ::= QTAGS */ yytestcase(yyruleno==339); -#line 495 "sql.y" -{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 6901 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 268: /* col_name ::= column_name */ - case 340: /* tag_item ::= column_name */ yytestcase(yyruleno==340); -#line 503 "sql.y" -{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109); } -#line 6908 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 269: /* cmd ::= SHOW DNODES */ -#line 506 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } -#line 6914 "sql.c" - break; - case 270: /* cmd ::= SHOW USERS */ -#line 507 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } -#line 6919 "sql.c" - break; - case 271: /* cmd ::= SHOW USERS FULL */ -#line 508 "sql.y" -{ pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } -#line 6924 "sql.c" - break; - case 272: /* cmd ::= SHOW USER PRIVILEGES */ -#line 509 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } -#line 6929 "sql.c" - break; - case 273: /* cmd ::= SHOW db_kind_opt DATABASES */ -#line 510 "sql.y" -{ - pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy681); - } -#line 6937 "sql.c" - break; - case 274: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ -#line 514 "sql.y" -{ - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy925, yymsp[0].minor.yy416, OP_TYPE_LIKE); - } -#line 6944 "sql.c" - break; - case 275: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -#line 517 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } -#line 6949 "sql.c" - break; - case 276: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -#line 518 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy416, NULL, OP_TYPE_LIKE); } -#line 6954 "sql.c" - break; - case 277: /* cmd ::= SHOW MNODES */ -#line 519 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } -#line 6959 "sql.c" - break; - case 278: /* cmd ::= SHOW QNODES */ -#line 521 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } -#line 6964 "sql.c" - break; - case 279: /* cmd ::= SHOW ARBGROUPS */ -#line 522 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } -#line 6969 "sql.c" - break; - case 280: /* cmd ::= SHOW FUNCTIONS */ -#line 523 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } -#line 6974 "sql.c" - break; - case 281: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -#line 524 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } -#line 6979 "sql.c" - break; - case 282: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -#line 525 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } -#line 6984 "sql.c" - break; - case 283: /* cmd ::= SHOW STREAMS */ -#line 526 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } -#line 6989 "sql.c" - break; - case 284: /* cmd ::= SHOW ACCOUNTS */ -#line 527 "sql.y" -{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 6994 "sql.c" - break; - case 285: /* cmd ::= SHOW APPS */ -#line 528 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } -#line 6999 "sql.c" - break; - case 286: /* cmd ::= SHOW CONNECTIONS */ -#line 529 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } -#line 7004 "sql.c" - break; - case 287: /* cmd ::= SHOW LICENCES */ - case 288: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==288); -#line 530 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } -#line 7010 "sql.c" - break; - case 289: /* cmd ::= SHOW GRANTS FULL */ -#line 532 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } -#line 7015 "sql.c" - break; - case 290: /* cmd ::= SHOW GRANTS LOGS */ -#line 533 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } -#line 7020 "sql.c" - break; - case 291: /* cmd ::= SHOW CLUSTER MACHINES */ -#line 534 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } -#line 7025 "sql.c" - break; - case 292: /* cmd ::= SHOW CREATE DATABASE db_name */ -#line 535 "sql.y" -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 7030 "sql.c" - break; - case 293: /* cmd ::= SHOW CREATE TABLE full_table_name */ -#line 536 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy416); } -#line 7035 "sql.c" - break; - case 294: /* cmd ::= SHOW CREATE STABLE full_table_name */ -#line 537 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, -yymsp[0].minor.yy416); } -#line 7041 "sql.c" - break; - case 295: /* cmd ::= SHOW ENCRYPTIONS */ -#line 539 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } -#line 7046 "sql.c" - break; - case 296: /* cmd ::= SHOW QUERIES */ -#line 540 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } -#line 7051 "sql.c" - break; - case 297: /* cmd ::= SHOW SCORES */ -#line 541 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } -#line 7056 "sql.c" - break; - case 298: /* cmd ::= SHOW TOPICS */ -#line 542 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } -#line 7061 "sql.c" - break; - case 299: /* cmd ::= SHOW VARIABLES */ - case 300: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==300); -#line 543 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } -#line 7067 "sql.c" - break; - case 301: /* cmd ::= SHOW LOCAL VARIABLES */ -#line 545 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } -#line 7072 "sql.c" - break; - case 302: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -#line 546 "sql.y" -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy416); } -#line 7077 "sql.c" - break; - case 303: /* cmd ::= SHOW BNODES */ -#line 547 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } -#line 7082 "sql.c" - break; - case 304: /* cmd ::= SHOW SNODES */ -#line 548 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } -#line 7087 "sql.c" - break; - case 305: /* cmd ::= SHOW CLUSTER */ -#line 549 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } -#line 7092 "sql.c" - break; - case 306: /* cmd ::= SHOW TRANSACTIONS */ -#line 550 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } -#line 7097 "sql.c" - break; - case 307: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -#line 551 "sql.y" -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy416); } -#line 7102 "sql.c" - break; - case 308: /* cmd ::= SHOW CONSUMERS */ -#line 552 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } -#line 7107 "sql.c" - break; - case 309: /* cmd ::= SHOW SUBSCRIPTIONS */ -#line 553 "sql.y" -{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } -#line 7112 "sql.c" - break; - case 310: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -#line 554 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy416, yymsp[-1].minor.yy416, OP_TYPE_EQUAL); } -#line 7117 "sql.c" - break; - case 311: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -#line 555 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), OP_TYPE_EQUAL); } -#line 7122 "sql.c" - break; - case 312: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -#line 556 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416, yymsp[-3].minor.yy316); } -#line 7127 "sql.c" - break; - case 313: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -#line 557 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy1109), yymsp[-4].minor.yy316); } -#line 7132 "sql.c" - break; - case 314: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ -#line 558 "sql.y" -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } -#line 7137 "sql.c" - break; - case 315: /* cmd ::= SHOW VNODES */ -#line 559 "sql.y" -{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } -#line 7142 "sql.c" - break; - case 316: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -#line 561 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy416, QUERY_NODE_SHOW_DB_ALIVE_STMT); } -#line 7147 "sql.c" - break; - case 317: /* cmd ::= SHOW CLUSTER ALIVE */ -#line 562 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } -#line 7152 "sql.c" - break; - case 318: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -#line 563 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, OP_TYPE_LIKE); } -#line 7157 "sql.c" - break; - case 319: /* cmd ::= SHOW CREATE VIEW full_table_name */ -#line 564 "sql.y" -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy416); } -#line 7162 "sql.c" - break; - case 320: /* cmd ::= SHOW COMPACTS */ -#line 565 "sql.y" -{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } -#line 7167 "sql.c" - break; - case 321: /* cmd ::= SHOW COMPACT NK_INTEGER */ -#line 566 "sql.y" -{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 7172 "sql.c" - break; - case 322: /* table_kind_db_name_cond_opt ::= */ -#line 570 "sql.y" -{ yymsp[1].minor.yy925.kind = SHOW_KIND_ALL; yymsp[1].minor.yy925.dbName = nil_token; } -#line 7177 "sql.c" - break; - case 323: /* table_kind_db_name_cond_opt ::= table_kind */ -#line 571 "sql.y" -{ yylhsminor.yy925.kind = yymsp[0].minor.yy681; yylhsminor.yy925.dbName = nil_token; } -#line 7182 "sql.c" - yymsp[0].minor.yy925 = yylhsminor.yy925; - break; - case 324: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -#line 572 "sql.y" -{ yylhsminor.yy925.kind = SHOW_KIND_ALL; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } -#line 7188 "sql.c" - yymsp[-1].minor.yy925 = yylhsminor.yy925; - break; - case 325: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -#line 573 "sql.y" -{ yylhsminor.yy925.kind = yymsp[-2].minor.yy681; yylhsminor.yy925.dbName = yymsp[-1].minor.yy1109; } -#line 7194 "sql.c" - yymsp[-2].minor.yy925 = yylhsminor.yy925; - break; - case 326: /* table_kind ::= NORMAL */ -#line 577 "sql.y" -{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_NORMAL; } -#line 7200 "sql.c" - break; - case 327: /* table_kind ::= CHILD */ -#line 578 "sql.y" -{ yymsp[0].minor.yy681 = SHOW_KIND_TABLES_CHILD; } -#line 7205 "sql.c" - break; - case 328: /* db_name_cond_opt ::= */ - case 333: /* from_db_opt ::= */ yytestcase(yyruleno==333); -#line 580 "sql.y" -{ yymsp[1].minor.yy416 = createDefaultDatabaseCondValue(pCxt); } -#line 7211 "sql.c" - break; - case 329: /* db_name_cond_opt ::= db_name NK_DOT */ -#line 581 "sql.y" -{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy1109); } -#line 7216 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 331: /* like_pattern_opt ::= LIKE NK_STRING */ -#line 584 "sql.y" -{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 7222 "sql.c" - break; - case 332: /* table_name_cond ::= table_name */ -#line 586 "sql.y" -{ yylhsminor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } -#line 7227 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 334: /* from_db_opt ::= FROM db_name */ -#line 589 "sql.y" -{ yymsp[-1].minor.yy416 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy1109); } -#line 7233 "sql.c" - break; - case 338: /* tag_item ::= TBNAME */ -#line 597 "sql.y" -{ yylhsminor.yy416 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } -#line 7238 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 341: /* tag_item ::= column_name column_alias */ -#line 600 "sql.y" -{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy1109), &yymsp[0].minor.yy1109); } -#line 7244 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 342: /* tag_item ::= column_name AS column_alias */ -#line 601 "sql.y" -{ yylhsminor.yy416 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy1109), &yymsp[0].minor.yy1109); } -#line 7250 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 343: /* db_kind_opt ::= */ -#line 605 "sql.y" -{ yymsp[1].minor.yy681 = SHOW_KIND_ALL; } -#line 7256 "sql.c" - break; - case 344: /* db_kind_opt ::= USER */ -#line 606 "sql.y" -{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_USER; } -#line 7261 "sql.c" - break; - case 345: /* db_kind_opt ::= SYSTEM */ -#line 607 "sql.y" -{ yymsp[0].minor.yy681 = SHOW_KIND_DATABASES_SYSTEM; } -#line 7266 "sql.c" - break; - case 346: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ -#line 613 "sql.y" -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy209, &yymsp[-7].minor.yy1109, yymsp[-4].minor.yy416, yymsp[-5].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 7271 "sql.c" - break; - case 347: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ -#line 615 "sql.y" -{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy209, &yymsp[-6].minor.yy1109, NULL, yymsp[-4].minor.yy416, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 7276 "sql.c" - break; - case 348: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ -#line 616 "sql.y" -{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } -#line 7281 "sql.c" - break; - case 349: /* cmd ::= SHOW db_name_cond_opt TSMAS */ -#line 617 "sql.y" -{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy416); } -#line 7286 "sql.c" - break; - case 352: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ -#line 624 "sql.y" -{ yymsp[-3].minor.yy416 = createTSMAOptions(pCxt, yymsp[-1].minor.yy316); } -#line 7291 "sql.c" - break; - case 353: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -#line 628 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy209, yymsp[-3].minor.yy416, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } -#line 7296 "sql.c" - break; - case 354: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -#line 630 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy209, yymsp[-5].minor.yy416, yymsp[-3].minor.yy416, yymsp[-1].minor.yy316, NULL); } -#line 7301 "sql.c" - break; - case 355: /* cmd ::= DROP INDEX exists_opt full_index_name */ -#line 631 "sql.y" -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } -#line 7306 "sql.c" - break; - case 356: /* full_index_name ::= index_name */ -#line 633 "sql.y" -{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy1109); } -#line 7311 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 357: /* full_index_name ::= db_name NK_DOT index_name */ -#line 634 "sql.y" -{ yylhsminor.yy416 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 7317 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 358: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -#line 637 "sql.y" -{ yymsp[-9].minor.yy416 = createIndexOption(pCxt, yymsp[-7].minor.yy316, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 7323 "sql.c" - break; - case 359: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -#line 640 "sql.y" -{ yymsp[-11].minor.yy416 = createIndexOption(pCxt, yymsp[-9].minor.yy316, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 7328 "sql.c" - break; - case 362: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -#line 647 "sql.y" -{ yylhsminor.yy416 = createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316); } -#line 7333 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 363: /* sma_func_name ::= function_name */ - case 637: /* alias_opt ::= table_alias */ yytestcase(yyruleno==637); -#line 651 "sql.y" -{ yylhsminor.yy1109 = yymsp[0].minor.yy1109; } -#line 7340 "sql.c" - yymsp[0].minor.yy1109 = yylhsminor.yy1109; - break; - case 368: /* sma_stream_opt ::= */ - case 418: /* stream_options ::= */ yytestcase(yyruleno==418); -#line 657 "sql.y" -{ yymsp[1].minor.yy416 = createStreamOptions(pCxt); } -#line 7347 "sql.c" - break; - case 369: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -#line 658 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } -#line 7352 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 370: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -#line 659 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } -#line 7358 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 371: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -#line 660 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy416)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); yylhsminor.yy416 = yymsp[-2].minor.yy416; } -#line 7364 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 372: /* with_meta ::= AS */ -#line 665 "sql.y" -{ yymsp[0].minor.yy820 = 0; } -#line 7370 "sql.c" - break; - case 373: /* with_meta ::= WITH META AS */ -#line 666 "sql.y" -{ yymsp[-2].minor.yy820 = 1; } -#line 7375 "sql.c" - break; - case 374: /* with_meta ::= ONLY META AS */ -#line 667 "sql.y" -{ yymsp[-2].minor.yy820 = 2; } -#line 7380 "sql.c" - break; - case 375: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -#line 669 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, yymsp[0].minor.yy416); } -#line 7385 "sql.c" - break; - case 376: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -#line 671 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy209, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy1109, yymsp[-2].minor.yy820); } -#line 7390 "sql.c" - break; - case 377: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -#line 673 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy209, &yymsp[-4].minor.yy1109, yymsp[-1].minor.yy416, yymsp[-3].minor.yy820, yymsp[0].minor.yy416); } -#line 7395 "sql.c" - break; - case 378: /* cmd ::= DROP TOPIC exists_opt topic_name */ -#line 675 "sql.y" -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 7400 "sql.c" - break; - case 379: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -#line 676 "sql.y" -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy209, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 7405 "sql.c" - break; - case 380: /* cmd ::= DESC full_table_name */ - case 381: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==381); -#line 679 "sql.y" -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy416); } -#line 7411 "sql.c" - break; - case 382: /* cmd ::= RESET QUERY CACHE */ -#line 683 "sql.y" -{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } -#line 7416 "sql.c" - break; - case 383: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 384: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==384); -#line 686 "sql.y" -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 7422 "sql.c" - break; - case 387: /* explain_options ::= */ -#line 694 "sql.y" -{ yymsp[1].minor.yy416 = createDefaultExplainOptions(pCxt); } -#line 7427 "sql.c" - break; - case 388: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -#line 695 "sql.y" -{ yylhsminor.yy416 = setExplainVerbose(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } -#line 7432 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 389: /* explain_options ::= explain_options RATIO NK_FLOAT */ -#line 696 "sql.y" -{ yylhsminor.yy416 = setExplainRatio(pCxt, yymsp[-2].minor.yy416, &yymsp[0].minor.yy0); } -#line 7438 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 390: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -#line 701 "sql.y" -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy209, yymsp[-9].minor.yy209, &yymsp[-6].minor.yy1109, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy952, yymsp[-1].minor.yy820, &yymsp[0].minor.yy1109, yymsp[-10].minor.yy209); } -#line 7444 "sql.c" - break; - case 391: /* cmd ::= DROP FUNCTION exists_opt function_name */ -#line 702 "sql.y" -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 7449 "sql.c" - break; - case 396: /* language_opt ::= */ - case 441: /* on_vgroup_id ::= */ yytestcase(yyruleno==441); -#line 716 "sql.y" -{ yymsp[1].minor.yy1109 = nil_token; } -#line 7455 "sql.c" - break; - case 397: /* language_opt ::= LANGUAGE NK_STRING */ - case 442: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==442); -#line 717 "sql.y" -{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy0; } -#line 7461 "sql.c" - break; - case 400: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -#line 726 "sql.y" -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy209, yymsp[-2].minor.yy416, &yymsp[-1].minor.yy0, yymsp[0].minor.yy416); } -#line 7466 "sql.c" - break; - case 401: /* cmd ::= DROP VIEW exists_opt full_view_name */ -#line 727 "sql.y" -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy209, yymsp[0].minor.yy416); } -#line 7471 "sql.c" - break; - case 402: /* full_view_name ::= view_name */ -#line 729 "sql.y" -{ yylhsminor.yy416 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy1109); } -#line 7476 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 403: /* full_view_name ::= db_name NK_DOT view_name */ -#line 730 "sql.y" -{ yylhsminor.yy416 = createViewNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 7482 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 404: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -#line 735 "sql.y" -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy209, &yymsp[-8].minor.yy1109, yymsp[-5].minor.yy416, yymsp[-7].minor.yy416, yymsp[-3].minor.yy316, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, yymsp[-4].minor.yy316); } -#line 7488 "sql.c" - break; - case 405: /* cmd ::= DROP STREAM exists_opt stream_name */ -#line 736 "sql.y" -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 7493 "sql.c" - break; - case 406: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -#line 737 "sql.y" -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 7498 "sql.c" - break; - case 407: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -#line 738 "sql.y" -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy209, yymsp[-1].minor.yy209, &yymsp[0].minor.yy1109); } -#line 7503 "sql.c" - break; - case 412: /* column_stream_def ::= column_name stream_col_options */ -#line 751 "sql.y" -{ yylhsminor.yy416 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy1109, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy416); } -#line 7508 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 413: /* stream_col_options ::= */ - case 750: /* column_options ::= */ yytestcase(yyruleno==750); -#line 752 "sql.y" -{ yymsp[1].minor.yy416 = createDefaultColumnOptions(pCxt); } -#line 7515 "sql.c" - break; - case 414: /* stream_col_options ::= stream_col_options PRIMARY KEY */ - case 751: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==751); -#line 753 "sql.y" -{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_PRIMARYKEY, NULL); } -#line 7521 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 419: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 420: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==420); -#line 763 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } -#line 7528 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 421: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -#line 765 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 7534 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 422: /* stream_options ::= stream_options WATERMARK duration_literal */ -#line 766 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 7540 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 423: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -#line 767 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } -#line 7546 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 424: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -#line 768 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } -#line 7552 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 425: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -#line 769 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-2].minor.yy416, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 7558 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 426: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -#line 770 "sql.y" -{ yylhsminor.yy416 = setStreamOptions(pCxt, yymsp[-3].minor.yy416, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } -#line 7564 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 428: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 694: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==694); - case 718: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==718); -#line 773 "sql.y" -{ yymsp[-3].minor.yy416 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy416); } -#line 7572 "sql.c" - break; - case 431: /* cmd ::= KILL CONNECTION NK_INTEGER */ -#line 781 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } -#line 7577 "sql.c" - break; - case 432: /* cmd ::= KILL QUERY NK_STRING */ -#line 782 "sql.y" -{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } -#line 7582 "sql.c" - break; - case 433: /* cmd ::= KILL TRANSACTION NK_INTEGER */ -#line 783 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } -#line 7587 "sql.c" - break; - case 434: /* cmd ::= KILL COMPACT NK_INTEGER */ -#line 784 "sql.y" -{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } -#line 7592 "sql.c" - break; - case 435: /* cmd ::= BALANCE VGROUP */ -#line 787 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } -#line 7597 "sql.c" - break; - case 436: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -#line 788 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 7602 "sql.c" - break; - case 437: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ -#line 789 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy1109); } -#line 7607 "sql.c" - break; - case 438: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ -#line 790 "sql.y" -{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 7612 "sql.c" - break; - case 439: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -#line 791 "sql.y" -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy316); } -#line 7617 "sql.c" - break; - case 440: /* cmd ::= SPLIT VGROUP NK_INTEGER */ -#line 792 "sql.y" -{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } -#line 7622 "sql.c" - break; - case 443: /* dnode_list ::= DNODE NK_INTEGER */ -#line 801 "sql.y" -{ yymsp[-1].minor.yy316 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 7627 "sql.c" - break; - case 445: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -#line 808 "sql.y" -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 7632 "sql.c" - break; - case 448: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -#line 817 "sql.y" -{ yymsp[-6].minor.yy416 = createInsertStmt(pCxt, yymsp[-4].minor.yy416, yymsp[-2].minor.yy316, yymsp[0].minor.yy416); } -#line 7637 "sql.c" - break; - case 449: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -#line 818 "sql.y" -{ yymsp[-3].minor.yy416 = createInsertStmt(pCxt, yymsp[-1].minor.yy416, NULL, yymsp[0].minor.yy416); } -#line 7642 "sql.c" - break; - case 450: /* tags_literal ::= NK_INTEGER */ - case 462: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==462); - case 471: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==471); -#line 821 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } -#line 7649 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 451: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ - case 452: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==452); - case 463: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==463); - case 464: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==464); - case 472: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==472); - case 473: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==473); - case 481: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==481); - case 482: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==482); -#line 822 "sql.y" -{ - SToken l = yymsp[-2].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); - } -#line 7667 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 453: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 456: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==456); - case 465: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==465); - case 468: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==468); - case 474: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==474); - case 477: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==477); -#line 834 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); - } -#line 7682 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 454: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ - case 455: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==455); - case 457: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==457); - case 458: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==458); - case 466: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==466); - case 467: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==467); - case 469: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==469); - case 470: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==470); - case 475: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==475); - case 476: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==476); - case 478: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==478); - case 479: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==479); -#line 839 "sql.y" -{ - SToken l = yymsp[-3].minor.yy0; - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy416); - } -#line 7704 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 459: /* tags_literal ::= NK_FLOAT */ -#line 868 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } -#line 7710 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 460: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 461: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==461); -#line 869 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); - } -#line 7721 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 480: /* tags_literal ::= NK_STRING */ -#line 975 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } -#line 7727 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 483: /* tags_literal ::= NK_BOOL */ -#line 988 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } -#line 7733 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 484: /* tags_literal ::= NULL */ -#line 989 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } -#line 7739 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 485: /* tags_literal ::= literal_func */ -#line 991 "sql.y" -{ yylhsminor.yy416 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy416); } -#line 7745 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 486: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 487: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==487); -#line 992 "sql.y" -{ - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - l.n = (r.z + r.n) - l.z; - yylhsminor.yy416 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); - } -#line 7757 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 490: /* literal ::= NK_INTEGER */ -#line 1011 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } -#line 7763 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 491: /* literal ::= NK_FLOAT */ -#line 1012 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } -#line 7769 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 492: /* literal ::= NK_STRING */ -#line 1013 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 7775 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 493: /* literal ::= NK_BOOL */ -#line 1014 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } -#line 7781 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 494: /* literal ::= TIMESTAMP NK_STRING */ -#line 1015 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } -#line 7787 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 495: /* literal ::= duration_literal */ - case 505: /* signed_literal ::= signed */ yytestcase(yyruleno==505); - case 529: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==529); - case 530: /* expression ::= literal */ yytestcase(yyruleno==530); - case 532: /* expression ::= column_reference */ yytestcase(yyruleno==532); - case 533: /* expression ::= function_expression */ yytestcase(yyruleno==533); - case 534: /* expression ::= case_when_expression */ yytestcase(yyruleno==534); - case 568: /* function_expression ::= literal_func */ yytestcase(yyruleno==568); - case 618: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==618); - case 622: /* boolean_primary ::= predicate */ yytestcase(yyruleno==622); - case 624: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==624); - case 625: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==625); - case 628: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==628); - case 630: /* table_reference ::= table_primary */ yytestcase(yyruleno==630); - case 631: /* table_reference ::= joined_table */ yytestcase(yyruleno==631); - case 635: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==635); - case 720: /* query_simple ::= query_specification */ yytestcase(yyruleno==720); - case 721: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==721); - case 724: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==724); - case 726: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==726); -#line 1016 "sql.y" -{ yylhsminor.yy416 = yymsp[0].minor.yy416; } -#line 7812 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 496: /* literal ::= NULL */ -#line 1017 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } -#line 7818 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 497: /* literal ::= NK_QUESTION */ -#line 1018 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7824 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 498: /* duration_literal ::= NK_VARIABLE */ - case 695: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==695); - case 696: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==696); - case 697: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==697); -#line 1020 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 7833 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 499: /* signed ::= NK_INTEGER */ -#line 1022 "sql.y" -{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7839 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 500: /* signed ::= NK_PLUS NK_INTEGER */ -#line 1023 "sql.y" -{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 7845 "sql.c" - break; - case 501: /* signed ::= NK_MINUS NK_INTEGER */ -#line 1024 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); - } -#line 7854 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 502: /* signed ::= NK_FLOAT */ -#line 1029 "sql.y" -{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7860 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 503: /* signed ::= NK_PLUS NK_FLOAT */ -#line 1030 "sql.y" -{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 7866 "sql.c" - break; - case 504: /* signed ::= NK_MINUS NK_FLOAT */ -#line 1031 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); - } -#line 7875 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 506: /* signed_literal ::= NK_STRING */ -#line 1038 "sql.y" -{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 7881 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 507: /* signed_literal ::= NK_BOOL */ -#line 1039 "sql.y" -{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } -#line 7887 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 508: /* signed_literal ::= TIMESTAMP NK_STRING */ -#line 1040 "sql.y" -{ yymsp[-1].minor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 7893 "sql.c" - break; - case 509: /* signed_literal ::= duration_literal */ - case 511: /* signed_literal ::= literal_func */ yytestcase(yyruleno==511); - case 589: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==589); - case 672: /* select_item ::= common_expression */ yytestcase(yyruleno==672); - case 682: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==682); - case 725: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==725); - case 727: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==727); - case 740: /* search_condition ::= common_expression */ yytestcase(yyruleno==740); -#line 1041 "sql.y" -{ yylhsminor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } -#line 7905 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 510: /* signed_literal ::= NULL */ -#line 1042 "sql.y" -{ yylhsminor.yy416 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } -#line 7911 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 512: /* signed_literal ::= NK_QUESTION */ -#line 1044 "sql.y" -{ yylhsminor.yy416 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } -#line 7917 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 531: /* expression ::= pseudo_column */ -#line 1110 "sql.y" -{ yylhsminor.yy416 = yymsp[0].minor.yy416; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy416, true); } -#line 7923 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 535: /* expression ::= NK_LP expression NK_RP */ - case 623: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==623); - case 739: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==739); -#line 1114 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 7931 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 536: /* expression ::= NK_PLUS expr_or_subquery */ -#line 1115 "sql.y" -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); - } -#line 7940 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 537: /* expression ::= NK_MINUS expr_or_subquery */ -#line 1119 "sql.y" -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); - } -#line 7949 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 538: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ -#line 1123 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 7959 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 539: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ -#line 1128 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 7969 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 540: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ -#line 1133 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 7979 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 541: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ -#line 1138 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 7989 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 542: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ -#line 1143 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 7999 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 543: /* expression ::= column_reference NK_ARROW NK_STRING */ -#line 1148 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); - } -#line 8008 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 544: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ -#line 1152 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8018 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 545: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ -#line 1157 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8028 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 548: /* column_reference ::= column_name */ -#line 1168 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy1109, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy1109)); } -#line 8034 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 549: /* column_reference ::= table_name NK_DOT column_name */ -#line 1169 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy1109)); } -#line 8040 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 550: /* column_reference ::= NK_ALIAS */ -#line 1170 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 8046 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 551: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -#line 1171 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0)); } -#line 8052 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 552: /* pseudo_column ::= ROWTS */ - case 553: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==553); - case 555: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==555); - case 556: /* pseudo_column ::= QEND */ yytestcase(yyruleno==556); - case 557: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==557); - case 558: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==558); - case 559: /* pseudo_column ::= WEND */ yytestcase(yyruleno==559); - case 560: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==560); - case 561: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==561); - case 562: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==562); - case 563: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==563); - case 570: /* literal_func ::= NOW */ yytestcase(yyruleno==570); - case 571: /* literal_func ::= TODAY */ yytestcase(yyruleno==571); -#line 1173 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } -#line 8070 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 554: /* pseudo_column ::= table_name NK_DOT TBNAME */ -#line 1175 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy1109)))); } -#line 8076 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 564: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 565: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==565); -#line 1186 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy1109, yymsp[-1].minor.yy316)); } -#line 8083 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 566: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - case 567: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==567); -#line 1189 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy952)); } -#line 8090 "sql.c" - yymsp[-5].minor.yy416 = yylhsminor.yy416; - break; - case 569: /* literal_func ::= noarg_func NK_LP NK_RP */ -#line 1195 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy1109, NULL)); } -#line 8096 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 585: /* star_func_para_list ::= NK_STAR */ -#line 1220 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 8102 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 590: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 675: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==675); -#line 1229 "sql.y" -{ yylhsminor.yy416 = createColumnNode(pCxt, &yymsp[-2].minor.yy1109, &yymsp[0].minor.yy0); } -#line 8109 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 591: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -#line 1232 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } -#line 8115 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 592: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -#line 1234 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-2].minor.yy316, yymsp[-1].minor.yy416)); } -#line 8121 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 595: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -#line 1241 "sql.y" -{ yymsp[-3].minor.yy416 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416)); } -#line 8127 "sql.c" - break; - case 597: /* case_when_else_opt ::= ELSE common_expression */ -#line 1244 "sql.y" -{ yymsp[-1].minor.yy416 = releaseRawExprNode(pCxt, yymsp[0].minor.yy416); } -#line 8132 "sql.c" - break; - case 598: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 603: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==603); -#line 1247 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy848, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8142 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 599: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 1254 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8152 "sql.c" - yymsp[-4].minor.yy416 = yylhsminor.yy416; - break; - case 600: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 1260 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8162 "sql.c" - yymsp[-5].minor.yy416 = yylhsminor.yy416; - break; - case 601: /* predicate ::= expr_or_subquery IS NULL */ -#line 1265 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), NULL)); - } -#line 8171 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 602: /* predicate ::= expr_or_subquery IS NOT NULL */ -#line 1269 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL)); - } -#line 8180 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 604: /* compare_op ::= NK_LT */ -#line 1281 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_THAN; } -#line 8186 "sql.c" - break; - case 605: /* compare_op ::= NK_GT */ -#line 1282 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_THAN; } -#line 8191 "sql.c" - break; - case 606: /* compare_op ::= NK_LE */ -#line 1283 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_LOWER_EQUAL; } -#line 8196 "sql.c" - break; - case 607: /* compare_op ::= NK_GE */ -#line 1284 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_GREATER_EQUAL; } -#line 8201 "sql.c" - break; - case 608: /* compare_op ::= NK_NE */ -#line 1285 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_NOT_EQUAL; } -#line 8206 "sql.c" - break; - case 609: /* compare_op ::= NK_EQ */ -#line 1286 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_EQUAL; } -#line 8211 "sql.c" - break; - case 610: /* compare_op ::= LIKE */ -#line 1287 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_LIKE; } -#line 8216 "sql.c" - break; - case 611: /* compare_op ::= NOT LIKE */ -#line 1288 "sql.y" -{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_LIKE; } -#line 8221 "sql.c" - break; - case 612: /* compare_op ::= MATCH */ -#line 1289 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_MATCH; } -#line 8226 "sql.c" - break; - case 613: /* compare_op ::= NMATCH */ -#line 1290 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_NMATCH; } -#line 8231 "sql.c" - break; - case 614: /* compare_op ::= CONTAINS */ -#line 1291 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_JSON_CONTAINS; } -#line 8236 "sql.c" - break; - case 615: /* in_op ::= IN */ -#line 1295 "sql.y" -{ yymsp[0].minor.yy848 = OP_TYPE_IN; } -#line 8241 "sql.c" - break; - case 616: /* in_op ::= NOT IN */ -#line 1296 "sql.y" -{ yymsp[-1].minor.yy848 = OP_TYPE_NOT_IN; } -#line 8246 "sql.c" - break; - case 617: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -#line 1298 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } -#line 8251 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 619: /* boolean_value_expression ::= NOT boolean_primary */ -#line 1302 "sql.y" -{ - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy416), NULL)); - } -#line 8260 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 620: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ -#line 1307 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8270 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 621: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -#line 1313 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy416); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy416); - yylhsminor.yy416 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); - } -#line 8280 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 629: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -#line 1331 "sql.y" -{ yylhsminor.yy416 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy416, yymsp[0].minor.yy416, NULL); } -#line 8286 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 632: /* table_primary ::= table_name alias_opt */ -#line 1337 "sql.y" -{ yylhsminor.yy416 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 8292 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 633: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -#line 1338 "sql.y" -{ yylhsminor.yy416 = createRealTableNode(pCxt, &yymsp[-3].minor.yy1109, &yymsp[-1].minor.yy1109, &yymsp[0].minor.yy1109); } -#line 8298 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 634: /* table_primary ::= subquery alias_opt */ -#line 1339 "sql.y" -{ yylhsminor.yy416 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } -#line 8304 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 636: /* alias_opt ::= */ -#line 1344 "sql.y" -{ yymsp[1].minor.yy1109 = nil_token; } -#line 8310 "sql.c" - break; - case 638: /* alias_opt ::= AS table_alias */ -#line 1346 "sql.y" -{ yymsp[-1].minor.yy1109 = yymsp[0].minor.yy1109; } -#line 8315 "sql.c" - break; - case 639: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 640: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==640); -#line 1348 "sql.y" -{ yymsp[-2].minor.yy416 = yymsp[-1].minor.yy416; } -#line 8321 "sql.c" - break; - case 641: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ -#line 1354 "sql.y" -{ - yylhsminor.yy416 = createJoinTableNode(pCxt, yymsp[-6].minor.yy972, yymsp[-5].minor.yy630, yymsp[-7].minor.yy416, yymsp[-3].minor.yy416, yymsp[-2].minor.yy416); - yylhsminor.yy416 = addWindowOffsetClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); - yylhsminor.yy416 = addJLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); - } -#line 8330 "sql.c" - yymsp[-7].minor.yy416 = yylhsminor.yy416; - break; - case 642: /* join_type ::= */ -#line 1362 "sql.y" -{ yymsp[1].minor.yy972 = JOIN_TYPE_INNER; } -#line 8336 "sql.c" - break; - case 643: /* join_type ::= INNER */ -#line 1363 "sql.y" -{ yymsp[0].minor.yy972 = JOIN_TYPE_INNER; } -#line 8341 "sql.c" - break; - case 644: /* join_type ::= LEFT */ -#line 1364 "sql.y" -{ yymsp[0].minor.yy972 = JOIN_TYPE_LEFT; } -#line 8346 "sql.c" - break; - case 645: /* join_type ::= RIGHT */ -#line 1365 "sql.y" -{ yymsp[0].minor.yy972 = JOIN_TYPE_RIGHT; } -#line 8351 "sql.c" - break; - case 646: /* join_type ::= FULL */ -#line 1366 "sql.y" -{ yymsp[0].minor.yy972 = JOIN_TYPE_FULL; } -#line 8356 "sql.c" - break; - case 647: /* join_subtype ::= */ -#line 1370 "sql.y" -{ yymsp[1].minor.yy630 = JOIN_STYPE_NONE; } -#line 8361 "sql.c" - break; - case 648: /* join_subtype ::= OUTER */ -#line 1371 "sql.y" -{ yymsp[0].minor.yy630 = JOIN_STYPE_OUTER; } -#line 8366 "sql.c" - break; - case 649: /* join_subtype ::= SEMI */ -#line 1372 "sql.y" -{ yymsp[0].minor.yy630 = JOIN_STYPE_SEMI; } -#line 8371 "sql.c" - break; - case 650: /* join_subtype ::= ANTI */ -#line 1373 "sql.y" -{ yymsp[0].minor.yy630 = JOIN_STYPE_ANTI; } -#line 8376 "sql.c" - break; - case 651: /* join_subtype ::= ASOF */ -#line 1374 "sql.y" -{ yymsp[0].minor.yy630 = JOIN_STYPE_ASOF; } -#line 8381 "sql.c" - break; - case 652: /* join_subtype ::= WINDOW */ -#line 1375 "sql.y" -{ yymsp[0].minor.yy630 = JOIN_STYPE_WIN; } -#line 8386 "sql.c" - break; - case 656: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -#line 1382 "sql.y" -{ yymsp[-5].minor.yy416 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 8391 "sql.c" - break; - case 657: /* window_offset_literal ::= NK_VARIABLE */ -#line 1384 "sql.y" -{ yylhsminor.yy416 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 8396 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 658: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ -#line 1385 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy416 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); - } -#line 8406 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 660: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 731: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==731); - case 735: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==735); -#line 1392 "sql.y" -{ yymsp[-1].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 8414 "sql.c" - break; - case 661: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ -#line 1398 "sql.y" -{ - yymsp[-13].minor.yy416 = createSelectStmt(pCxt, yymsp[-11].minor.yy209, yymsp[-9].minor.yy316, yymsp[-8].minor.yy416, yymsp[-12].minor.yy316); - yymsp[-13].minor.yy416 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy416, yymsp[-10].minor.yy209); - yymsp[-13].minor.yy416 = addWhereClause(pCxt, yymsp[-13].minor.yy416, yymsp[-7].minor.yy416); - yymsp[-13].minor.yy416 = addPartitionByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-6].minor.yy316); - yymsp[-13].minor.yy416 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy416, yymsp[-2].minor.yy416); - yymsp[-13].minor.yy416 = addGroupByClause(pCxt, yymsp[-13].minor.yy416, yymsp[-1].minor.yy316); - yymsp[-13].minor.yy416 = addHavingClause(pCxt, yymsp[-13].minor.yy416, yymsp[0].minor.yy416); - yymsp[-13].minor.yy416 = addRangeClause(pCxt, yymsp[-13].minor.yy416, yymsp[-5].minor.yy416); - yymsp[-13].minor.yy416 = addEveryClause(pCxt, yymsp[-13].minor.yy416, yymsp[-4].minor.yy416); - yymsp[-13].minor.yy416 = addFillClause(pCxt, yymsp[-13].minor.yy416, yymsp[-3].minor.yy416); - } -#line 8430 "sql.c" - break; - case 662: /* hint_list ::= */ -#line 1413 "sql.y" -{ yymsp[1].minor.yy316 = createHintNodeList(pCxt, NULL); } -#line 8435 "sql.c" - break; - case 663: /* hint_list ::= NK_HINT */ -#line 1414 "sql.y" -{ yylhsminor.yy316 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } -#line 8440 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 668: /* set_quantifier_opt ::= ALL */ -#line 1425 "sql.y" -{ yymsp[0].minor.yy209 = false; } -#line 8446 "sql.c" - break; - case 671: /* select_item ::= NK_STAR */ -#line 1432 "sql.y" -{ yylhsminor.yy416 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } -#line 8451 "sql.c" - yymsp[0].minor.yy416 = yylhsminor.yy416; - break; - case 673: /* select_item ::= common_expression column_alias */ - case 683: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==683); -#line 1434 "sql.y" -{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416), &yymsp[0].minor.yy1109); } -#line 8458 "sql.c" - yymsp[-1].minor.yy416 = yylhsminor.yy416; - break; - case 674: /* select_item ::= common_expression AS column_alias */ - case 684: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==684); -#line 1435 "sql.y" -{ yylhsminor.yy416 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), &yymsp[0].minor.yy1109); } -#line 8465 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 679: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 709: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==709); - case 729: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==729); -#line 1444 "sql.y" -{ yymsp[-2].minor.yy316 = yymsp[0].minor.yy316; } -#line 8473 "sql.c" - break; - case 686: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -#line 1457 "sql.y" -{ yymsp[-5].minor.yy416 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 8478 "sql.c" - break; - case 687: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -#line 1458 "sql.y" -{ yymsp[-3].minor.yy416 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 8483 "sql.c" - break; - case 688: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1460 "sql.y" -{ yymsp[-5].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), NULL, yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 8488 "sql.c" - break; - case 689: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -#line 1464 "sql.y" -{ yymsp[-7].minor.yy416 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy416), releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), yymsp[-1].minor.yy416, yymsp[0].minor.yy416); } -#line 8493 "sql.c" - break; - case 690: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -#line 1466 "sql.y" -{ yymsp[-6].minor.yy416 = createEventWindowNode(pCxt, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } -#line 8498 "sql.c" - break; - case 691: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -#line 1468 "sql.y" -{ yymsp[-3].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } -#line 8503 "sql.c" - break; - case 692: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -#line 1470 "sql.y" -{ yymsp[-5].minor.yy416 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } -#line 8508 "sql.c" - break; - case 699: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -#line 1480 "sql.y" -{ yymsp[-3].minor.yy416 = createFillNode(pCxt, yymsp[-1].minor.yy882, NULL); } -#line 8513 "sql.c" - break; - case 700: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -#line 1481 "sql.y" -{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } -#line 8518 "sql.c" - break; - case 701: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -#line 1482 "sql.y" -{ yymsp[-5].minor.yy416 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy316)); } -#line 8523 "sql.c" - break; - case 702: /* fill_mode ::= NONE */ -#line 1486 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_NONE; } -#line 8528 "sql.c" - break; - case 703: /* fill_mode ::= PREV */ -#line 1487 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_PREV; } -#line 8533 "sql.c" - break; - case 704: /* fill_mode ::= NULL */ -#line 1488 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_NULL; } -#line 8538 "sql.c" - break; - case 705: /* fill_mode ::= NULL_F */ -#line 1489 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_NULL_F; } -#line 8543 "sql.c" - break; - case 706: /* fill_mode ::= LINEAR */ -#line 1490 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_LINEAR; } -#line 8548 "sql.c" - break; - case 707: /* fill_mode ::= NEXT */ -#line 1491 "sql.y" -{ yymsp[0].minor.yy882 = FILL_MODE_NEXT; } -#line 8553 "sql.c" - break; - case 710: /* group_by_list ::= expr_or_subquery */ -#line 1500 "sql.y" -{ yylhsminor.yy316 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8558 "sql.c" - yymsp[0].minor.yy316 = yylhsminor.yy316; - break; - case 711: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -#line 1501 "sql.y" -{ yylhsminor.yy316 = addNodeToList(pCxt, yymsp[-2].minor.yy316, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy416))); } -#line 8564 "sql.c" - yymsp[-2].minor.yy316 = yylhsminor.yy316; - break; - case 715: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -#line 1508 "sql.y" -{ yymsp[-5].minor.yy416 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy416), releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 8570 "sql.c" - break; - case 716: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -#line 1510 "sql.y" -{ yymsp[-3].minor.yy416 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy416)); } -#line 8575 "sql.c" - break; - case 719: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ -#line 1517 "sql.y" -{ - yylhsminor.yy416 = addOrderByClause(pCxt, yymsp[-3].minor.yy416, yymsp[-2].minor.yy316); - yylhsminor.yy416 = addSlimitClause(pCxt, yylhsminor.yy416, yymsp[-1].minor.yy416); - yylhsminor.yy416 = addLimitClause(pCxt, yylhsminor.yy416, yymsp[0].minor.yy416); - } -#line 8584 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 722: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -#line 1527 "sql.y" -{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy416, yymsp[0].minor.yy416); } -#line 8590 "sql.c" - yymsp[-3].minor.yy416 = yylhsminor.yy416; - break; - case 723: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -#line 1529 "sql.y" -{ yylhsminor.yy416 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy416, yymsp[0].minor.yy416); } -#line 8596 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 732: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 736: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==736); -#line 1544 "sql.y" -{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 8603 "sql.c" - break; - case 733: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 737: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==737); -#line 1545 "sql.y" -{ yymsp[-3].minor.yy416 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } -#line 8609 "sql.c" - break; - case 738: /* subquery ::= NK_LP query_expression NK_RP */ -#line 1553 "sql.y" -{ yylhsminor.yy416 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy416); } -#line 8614 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 743: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -#line 1567 "sql.y" -{ yylhsminor.yy416 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy416), yymsp[-1].minor.yy506, yymsp[0].minor.yy1045); } -#line 8620 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 744: /* ordering_specification_opt ::= */ -#line 1571 "sql.y" -{ yymsp[1].minor.yy506 = ORDER_ASC; } -#line 8626 "sql.c" - break; - case 745: /* ordering_specification_opt ::= ASC */ -#line 1572 "sql.y" -{ yymsp[0].minor.yy506 = ORDER_ASC; } -#line 8631 "sql.c" - break; - case 746: /* ordering_specification_opt ::= DESC */ -#line 1573 "sql.y" -{ yymsp[0].minor.yy506 = ORDER_DESC; } -#line 8636 "sql.c" - break; - case 747: /* null_ordering_opt ::= */ -#line 1577 "sql.y" -{ yymsp[1].minor.yy1045 = NULL_ORDER_DEFAULT; } -#line 8641 "sql.c" - break; - case 748: /* null_ordering_opt ::= NULLS FIRST */ -#line 1578 "sql.y" -{ yymsp[-1].minor.yy1045 = NULL_ORDER_FIRST; } -#line 8646 "sql.c" - break; - case 749: /* null_ordering_opt ::= NULLS LAST */ -#line 1579 "sql.y" -{ yymsp[-1].minor.yy1045 = NULL_ORDER_LAST; } -#line 8651 "sql.c" - break; - case 752: /* column_options ::= column_options ENCODE NK_STRING */ -#line 1587 "sql.y" -{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } -#line 8656 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 753: /* column_options ::= column_options COMPRESS NK_STRING */ -#line 1588 "sql.y" -{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } -#line 8662 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - case 754: /* column_options ::= column_options LEVEL NK_STRING */ -#line 1589 "sql.y" -{ yylhsminor.yy416 = setColumnOptions(pCxt, yymsp[-2].minor.yy416, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } -#line 8668 "sql.c" - yymsp[-2].minor.yy416 = yylhsminor.yy416; - break; - default: - break; -/********** End reduce actions ************************************************/ + */ + /********** Begin reduce actions **********************************************/ + 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,386,&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,387,&yymsp[0].minor); + break; + case 2: /* account_options ::= */ + { } + break; + case 3: /* account_options ::= account_options PPS literal */ + case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); + case 5: /* account_options ::= account_options STORAGE literal */ yytestcase(yyruleno==5); + case 6: /* account_options ::= account_options STREAMS literal */ yytestcase(yyruleno==6); + case 7: /* account_options ::= account_options QTIME literal */ yytestcase(yyruleno==7); + case 8: /* account_options ::= account_options DBS literal */ yytestcase(yyruleno==8); + 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,386,&yymsp[-2].minor); + { } + yy_destructor(yypParser,388,&yymsp[0].minor); + } + break; + case 12: /* alter_account_options ::= alter_account_option */ + { yy_destructor(yypParser,389,&yymsp[0].minor); + { } + } + break; + case 13: /* alter_account_options ::= alter_account_options alter_account_option */ + { yy_destructor(yypParser,387,&yymsp[-1].minor); + { } + yy_destructor(yypParser,389,&yymsp[0].minor); + } + break; + case 14: /* alter_account_option ::= PASS literal */ + case 15: /* alter_account_option ::= PPS literal */ yytestcase(yyruleno==15); + case 16: /* alter_account_option ::= TSERIES literal */ yytestcase(yyruleno==16); + case 17: /* alter_account_option ::= STORAGE literal */ yytestcase(yyruleno==17); + case 18: /* alter_account_option ::= STREAMS literal */ yytestcase(yyruleno==18); + case 19: /* alter_account_option ::= QTIME literal */ yytestcase(yyruleno==19); + case 20: /* alter_account_option ::= DBS literal */ yytestcase(yyruleno==20); + case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21); + case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); + case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); + { } + yy_destructor(yypParser,388,&yymsp[0].minor); + break; + case 24: /* ip_range_list ::= NK_STRING */ + { yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 26: /* white_list ::= HOST ip_range_list */ + { yymsp[-1].minor.yy334 = yymsp[0].minor.yy334; } + break; + case 27: /* white_list_opt ::= */ + case 206: /* specific_cols_opt ::= */ yytestcase(yyruleno==206); + case 244: /* tags_def_opt ::= */ yytestcase(yyruleno==244); + case 335: /* tag_list_opt ::= */ yytestcase(yyruleno==335); + case 408: /* col_list_opt ::= */ yytestcase(yyruleno==408); + case 415: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==415); + case 693: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==693); + case 723: /* group_by_clause_opt ::= */ yytestcase(yyruleno==723); + case 743: /* order_by_clause_opt ::= */ yytestcase(yyruleno==743); + { yymsp[1].minor.yy334 = NULL; } + break; + case 28: /* white_list_opt ::= white_list */ + case 245: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==245); + case 416: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==416); + case 601: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==601); + { yylhsminor.yy334 = yymsp[0].minor.yy334; } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 29: /* is_import_opt ::= */ + case 31: /* is_createdb_opt ::= */ yytestcase(yyruleno==31); + { yymsp[1].minor.yy719 = 0; } + break; + case 30: /* is_import_opt ::= IS_IMPORT NK_INTEGER */ + case 32: /* is_createdb_opt ::= CREATEDB NK_INTEGER */ yytestcase(yyruleno==32); + case 42: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ yytestcase(yyruleno==42); + { yymsp[-1].minor.yy719 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 33: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt is_createdb_opt is_import_opt white_list_opt */ + { + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-6].minor.yy533, &yymsp[-4].minor.yy0, yymsp[-3].minor.yy719, yymsp[-1].minor.yy719, yymsp[-2].minor.yy719); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy334); + } + break; + case 34: /* cmd ::= ALTER USER user_name PASS NK_STRING */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } + break; + case 35: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } + break; + case 36: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } + break; + case 37: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); } + break; + case 38: /* cmd ::= ALTER USER user_name ADD white_list */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy334); } + break; + case 39: /* cmd ::= ALTER USER user_name DROP white_list */ + { pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy533, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy334); } + break; + case 40: /* cmd ::= DROP USER user_name */ + { pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 41: /* sysinfo_opt ::= */ + { yymsp[1].minor.yy719 = 1; } + break; + case 43: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + { pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy585, &yymsp[-3].minor.yy399, &yymsp[0].minor.yy533, yymsp[-2].minor.yy560); } + break; + case 44: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + { pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy585, &yymsp[-3].minor.yy399, &yymsp[0].minor.yy533, yymsp[-2].minor.yy560); } + break; + case 45: /* privileges ::= ALL */ + { yymsp[0].minor.yy585 = PRIVILEGE_TYPE_ALL; } + break; + case 46: /* privileges ::= priv_type_list */ + case 48: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==48); + { yylhsminor.yy585 = yymsp[0].minor.yy585; } + yymsp[0].minor.yy585 = yylhsminor.yy585; + break; + case 47: /* privileges ::= SUBSCRIBE */ + { yymsp[0].minor.yy585 = PRIVILEGE_TYPE_SUBSCRIBE; } + break; + case 49: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { yylhsminor.yy585 = yymsp[-2].minor.yy585 | yymsp[0].minor.yy585; } + yymsp[-2].minor.yy585 = yylhsminor.yy585; + break; + case 50: /* priv_type ::= READ */ + { yymsp[0].minor.yy585 = PRIVILEGE_TYPE_READ; } + break; + case 51: /* priv_type ::= WRITE */ + { yymsp[0].minor.yy585 = PRIVILEGE_TYPE_WRITE; } + break; + case 52: /* priv_type ::= ALTER */ + { yymsp[0].minor.yy585 = PRIVILEGE_TYPE_ALTER; } + break; + case 53: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ + { yylhsminor.yy399.first = yymsp[-2].minor.yy0; yylhsminor.yy399.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; + break; + case 54: /* priv_level ::= db_name NK_DOT NK_STAR */ + { yylhsminor.yy399.first = yymsp[-2].minor.yy533; yylhsminor.yy399.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; + break; + case 55: /* priv_level ::= db_name NK_DOT table_name */ + { yylhsminor.yy399.first = yymsp[-2].minor.yy533; yylhsminor.yy399.second = yymsp[0].minor.yy533; } + yymsp[-2].minor.yy399 = yylhsminor.yy399; + break; + case 56: /* priv_level ::= topic_name */ + { yylhsminor.yy399.first = yymsp[0].minor.yy533; yylhsminor.yy399.second = nil_token; } + yymsp[0].minor.yy399 = yylhsminor.yy399; + break; + case 57: /* with_opt ::= */ + case 173: /* start_opt ::= */ yytestcase(yyruleno==173); + case 177: /* end_opt ::= */ yytestcase(yyruleno==177); + case 330: /* like_pattern_opt ::= */ yytestcase(yyruleno==330); + case 427: /* subtable_opt ::= */ yytestcase(yyruleno==427); + case 611: /* case_when_else_opt ::= */ yytestcase(yyruleno==611); + case 641: /* from_clause_opt ::= */ yytestcase(yyruleno==641); + case 668: /* join_on_clause_opt ::= */ yytestcase(yyruleno==668); + case 670: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==670); + case 674: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==674); + case 691: /* where_clause_opt ::= */ yytestcase(yyruleno==691); + case 700: /* twindow_clause_opt ::= */ yytestcase(yyruleno==700); + case 708: /* sliding_opt ::= */ yytestcase(yyruleno==708); + case 713: /* fill_opt ::= */ yytestcase(yyruleno==713); + case 727: /* having_clause_opt ::= */ yytestcase(yyruleno==727); + case 729: /* range_opt ::= */ yytestcase(yyruleno==729); + case 732: /* every_opt ::= */ yytestcase(yyruleno==732); + case 745: /* slimit_clause_opt ::= */ yytestcase(yyruleno==745); + case 749: /* limit_clause_opt ::= */ yytestcase(yyruleno==749); + { yymsp[1].minor.yy560 = NULL; } + break; + case 58: /* with_opt ::= WITH search_condition */ + case 642: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==642); + case 669: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==669); + case 692: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==692); + case 728: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==728); + { yymsp[-1].minor.yy560 = yymsp[0].minor.yy560; } + break; + case 59: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */ + { pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); } + break; + case 60: /* cmd ::= CREATE DNODE dnode_endpoint */ + { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy533, NULL); } + break; + case 61: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); } + break; + case 62: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ + { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy173, false); } + break; + case 63: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ + { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy173, false); } + break; + case 64: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy173); } + break; + case 65: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + { pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy533, false, yymsp[0].minor.yy173); } + break; + case 66: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } + break; + case 67: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 68: /* cmd ::= ALTER ALL DNODES NK_STRING */ + { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } + break; + case 69: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 70: /* cmd ::= RESTORE DNODE NK_INTEGER */ + { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 71: /* dnode_endpoint ::= NK_STRING */ + case 72: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==72); + case 73: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==73); + case 364: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==364); + case 365: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==365); + case 366: /* sma_func_name ::= LAST */ yytestcase(yyruleno==366); + case 367: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==367); + case 515: /* db_name ::= NK_ID */ yytestcase(yyruleno==515); + case 516: /* table_name ::= NK_ID */ yytestcase(yyruleno==516); + case 517: /* column_name ::= NK_ID */ yytestcase(yyruleno==517); + case 518: /* function_name ::= NK_ID */ yytestcase(yyruleno==518); + case 519: /* view_name ::= NK_ID */ yytestcase(yyruleno==519); + case 520: /* table_alias ::= NK_ID */ yytestcase(yyruleno==520); + case 521: /* column_alias ::= NK_ID */ yytestcase(yyruleno==521); + case 522: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==522); + case 523: /* user_name ::= NK_ID */ yytestcase(yyruleno==523); + case 524: /* topic_name ::= NK_ID */ yytestcase(yyruleno==524); + case 525: /* stream_name ::= NK_ID */ yytestcase(yyruleno==525); + case 526: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==526); + case 527: /* index_name ::= NK_ID */ yytestcase(yyruleno==527); + case 528: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==528); + case 581: /* substr_func ::= SUBSTR */ yytestcase(yyruleno==581); + case 582: /* substr_func ::= SUBSTRING */ yytestcase(yyruleno==582); + case 586: /* noarg_func ::= NOW */ yytestcase(yyruleno==586); + case 587: /* noarg_func ::= TODAY */ yytestcase(yyruleno==587); + case 588: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==588); + case 589: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==589); + case 590: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==590); + case 591: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==591); + case 592: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==592); + case 593: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==593); + case 594: /* noarg_func ::= USER */ yytestcase(yyruleno==594); + case 595: /* noarg_func ::= PI */ yytestcase(yyruleno==595); + case 596: /* star_func ::= COUNT */ yytestcase(yyruleno==596); + case 597: /* star_func ::= FIRST */ yytestcase(yyruleno==597); + case 598: /* star_func ::= LAST */ yytestcase(yyruleno==598); + case 599: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==599); + { yylhsminor.yy533 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy533 = yylhsminor.yy533; + break; + case 74: /* force_opt ::= */ + case 101: /* not_exists_opt ::= */ yytestcase(yyruleno==101); + case 103: /* exists_opt ::= */ yytestcase(yyruleno==103); + case 385: /* analyze_opt ::= */ yytestcase(yyruleno==385); + case 392: /* agg_func_opt ::= */ yytestcase(yyruleno==392); + case 398: /* or_replace_opt ::= */ yytestcase(yyruleno==398); + case 429: /* ignore_opt ::= */ yytestcase(yyruleno==429); + case 679: /* tag_mode_opt ::= */ yytestcase(yyruleno==679); + case 681: /* set_quantifier_opt ::= */ yytestcase(yyruleno==681); + { yymsp[1].minor.yy173 = false; } + break; + case 75: /* force_opt ::= FORCE */ + case 76: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==76); + case 386: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==386); + case 393: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==393); + case 680: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==680); + case 682: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==682); + { yymsp[0].minor.yy173 = true; } + break; + case 77: /* cmd ::= ALTER CLUSTER NK_STRING */ + { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } + break; + case 78: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 79: /* cmd ::= ALTER LOCAL NK_STRING */ + { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } + break; + case 80: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 81: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 82: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 83: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 84: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 85: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 86: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 87: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 88: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 89: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 90: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 91: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } + break; + case 92: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy173, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } + break; + case 93: /* cmd ::= DROP DATABASE exists_opt db_name */ + { pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 94: /* cmd ::= USE db_name */ + { pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 95: /* cmd ::= ALTER DATABASE db_name alter_db_options */ + { pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } + break; + case 96: /* cmd ::= FLUSH DATABASE db_name */ + { pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 97: /* cmd ::= TRIM DATABASE db_name speed_opt */ + { pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy802); } + break; + case 98: /* cmd ::= S3MIGRATE DATABASE db_name */ + { pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 99: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + { pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 100: /* not_exists_opt ::= IF NOT EXISTS */ + { yymsp[-2].minor.yy173 = true; } + break; + case 102: /* exists_opt ::= IF EXISTS */ + case 399: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==399); + case 430: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==430); + { yymsp[-1].minor.yy173 = true; } + break; + case 104: /* db_options ::= */ + { yymsp[1].minor.yy560 = createDefaultDatabaseOptions(pCxt); } + break; + case 105: /* db_options ::= db_options BUFFER NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 106: /* db_options ::= db_options CACHEMODEL NK_STRING */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 107: /* db_options ::= db_options CACHESIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 108: /* db_options ::= db_options COMP NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 109: /* db_options ::= db_options DURATION NK_INTEGER */ + case 110: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==110); + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 111: /* db_options ::= db_options MAXROWS NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 112: /* db_options ::= db_options MINROWS NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 113: /* db_options ::= db_options KEEP integer_list */ + case 114: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==114); + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_KEEP, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 115: /* db_options ::= db_options PAGES NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 116: /* db_options ::= db_options PAGESIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 117: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 118: /* db_options ::= db_options PRECISION NK_STRING */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 119: /* db_options ::= db_options REPLICA NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 120: /* db_options ::= db_options VGROUPS NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 121: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 122: /* db_options ::= db_options RETENTIONS retention_list */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_RETENTIONS, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 123: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 124: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 125: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 126: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 127: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-3].minor.yy560, DB_OPTION_WAL_RETENTION_PERIOD, &t); + } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 128: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 129: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-3].minor.yy560, DB_OPTION_WAL_RETENTION_SIZE, &t); + } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 130: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 131: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 132: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 133: /* db_options ::= db_options TABLE_PREFIX signed */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 134: /* db_options ::= db_options TABLE_SUFFIX signed */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 135: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 136: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */ + case 137: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==137); + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 138: /* db_options ::= db_options S3_COMPACT NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 139: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 140: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */ + { yylhsminor.yy560 = setDatabaseOption(pCxt, yymsp[-2].minor.yy560, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 141: /* alter_db_options ::= alter_db_option */ + { yylhsminor.yy560 = createAlterDatabaseOptions(pCxt); yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yylhsminor.yy560, &yymsp[0].minor.yy389); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 142: /* alter_db_options ::= alter_db_options alter_db_option */ + { yylhsminor.yy560 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy560, &yymsp[0].minor.yy389); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 143: /* alter_db_option ::= BUFFER NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 144: /* alter_db_option ::= CACHEMODEL NK_STRING */ + { yymsp[-1].minor.yy389.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 145: /* alter_db_option ::= CACHESIZE NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 146: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 147: /* alter_db_option ::= KEEP integer_list */ + case 148: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==148); + { yymsp[-1].minor.yy389.type = DB_OPTION_KEEP; yymsp[-1].minor.yy389.pList = yymsp[0].minor.yy334; } + break; + case 149: /* alter_db_option ::= PAGES NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_PAGES; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 150: /* alter_db_option ::= REPLICA NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 151: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_WAL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 152: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 153: /* alter_db_option ::= MINROWS NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 154: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 155: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yymsp[-2].minor.yy389.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy389.val = t; + } + break; + case 156: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 157: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yymsp[-2].minor.yy389.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy389.val = t; + } + break; + case 158: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */ + case 159: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==159); + { yymsp[-1].minor.yy389.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 160: /* alter_db_option ::= S3_COMPACT NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 161: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + { yymsp[-1].minor.yy389.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 162: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */ + { yymsp[-1].minor.yy389.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 163: /* integer_list ::= NK_INTEGER */ + { yylhsminor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 164: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 444: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==444); + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 165: /* variable_list ::= NK_VARIABLE */ + { yylhsminor.yy334 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 166: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 167: /* retention_list ::= retention */ + case 200: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==200); + case 203: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==203); + case 210: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==210); + case 213: /* column_def_list ::= column_def */ yytestcase(yyruleno==213); + case 261: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==261); + case 266: /* col_name_list ::= col_name */ yytestcase(yyruleno==266); + case 336: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==336); + case 360: /* func_list ::= func */ yytestcase(yyruleno==360); + case 410: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==410); + case 488: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==488); + case 513: /* literal_list ::= signed_literal */ yytestcase(yyruleno==513); + case 602: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==602); + case 608: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==608); + case 684: /* select_list ::= select_item */ yytestcase(yyruleno==684); + case 695: /* partition_list ::= partition_item */ yytestcase(yyruleno==695); + case 756: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==756); + { yylhsminor.yy334 = createNodeList(pCxt, yymsp[0].minor.yy560); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 168: /* retention_list ::= retention_list NK_COMMA retention */ + case 204: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==204); + case 211: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==211); + case 214: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==214); + case 262: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==262); + case 267: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==267); + case 337: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==337); + case 361: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==361); + case 411: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==411); + case 489: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==489); + case 514: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==514); + case 603: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==603); + case 685: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==685); + case 696: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==696); + case 757: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==757); + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 169: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 170: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==170); + { yylhsminor.yy560 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 171: /* speed_opt ::= */ + case 394: /* bufsize_opt ::= */ yytestcase(yyruleno==394); + { yymsp[1].minor.yy802 = 0; } + break; + case 172: /* speed_opt ::= BWLIMIT NK_INTEGER */ + case 395: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==395); + { yymsp[-1].minor.yy802 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 174: /* start_opt ::= START WITH NK_INTEGER */ + case 178: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==178); + { yymsp[-2].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } + break; + case 175: /* start_opt ::= START WITH NK_STRING */ + case 179: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==179); + { yymsp[-2].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 176: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ + case 180: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==180); + { yymsp[-3].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 181: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 184: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==184); + { pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy334, yymsp[-1].minor.yy334, yymsp[0].minor.yy560); } + break; + case 182: /* cmd ::= CREATE TABLE multi_create_clause */ + { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy334); } + break; + case 183: /* cmd ::= CREATE TABLE not_exists_opt USING full_table_name NK_LP tag_list_opt NK_RP FILE NK_STRING */ + { pCxt->pRootNode = createCreateSubTableFromFileClause(pCxt, yymsp[-7].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy334, &yymsp[0].minor.yy0); } + break; + case 185: /* cmd ::= DROP TABLE multi_drop_clause */ + { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy334); } + break; + case 186: /* cmd ::= DROP STABLE exists_opt full_table_name */ + { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + break; + case 187: /* cmd ::= ALTER TABLE alter_table_clause */ + case 446: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==446); + case 447: /* cmd ::= insert_query */ yytestcase(yyruleno==447); + { pCxt->pRootNode = yymsp[0].minor.yy560; } + break; + case 188: /* cmd ::= ALTER STABLE alter_table_clause */ + { pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy560); } + break; + case 189: /* alter_table_clause ::= full_table_name alter_table_options */ + { yylhsminor.yy560 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 190: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */ + { yylhsminor.yy560 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy560, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy952, yymsp[0].minor.yy560); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 191: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 192: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 193: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */ + { yylhsminor.yy560 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy533, yymsp[0].minor.yy560); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 194: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 195: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 196: /* alter_table_clause ::= full_table_name DROP TAG column_name */ + { yylhsminor.yy560 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy560, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 197: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { yylhsminor.yy560 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 198: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { yylhsminor.yy560 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy560, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 199: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + { yylhsminor.yy560 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy560, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 201: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 609: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==609); + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-1].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy334 = yylhsminor.yy334; + break; + case 202: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + { yylhsminor.yy560 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy173, yymsp[-8].minor.yy560, yymsp[-6].minor.yy560, yymsp[-5].minor.yy334, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } + yymsp[-9].minor.yy560 = yylhsminor.yy560; + break; + case 205: /* drop_table_clause ::= exists_opt full_table_name */ + { yylhsminor.yy560 = createDropTableClause(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 207: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 409: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==409); + { yymsp[-2].minor.yy334 = yymsp[-1].minor.yy334; } + break; + case 208: /* full_table_name ::= table_name */ + case 350: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==350); + { yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy533, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 209: /* full_table_name ::= db_name NK_DOT table_name */ + case 351: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==351); + { yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 212: /* tag_def ::= column_name type_name */ + { yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy533, yymsp[0].minor.yy952, NULL); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 215: /* column_def ::= column_name type_name column_options */ + { yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy533, yymsp[-1].minor.yy952, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 216: /* type_name ::= BOOL */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BOOL); } + break; + case 217: /* type_name ::= TINYINT */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TINYINT); } + break; + case 218: /* type_name ::= SMALLINT */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + break; + case 219: /* type_name ::= INT */ + case 220: /* type_name ::= INTEGER */ yytestcase(yyruleno==220); + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_INT); } + break; + case 221: /* type_name ::= BIGINT */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BIGINT); } + break; + case 222: /* type_name ::= FLOAT */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_FLOAT); } + break; + case 223: /* type_name ::= DOUBLE */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + break; + case 224: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + break; + case 225: /* type_name ::= TIMESTAMP */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + break; + case 226: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + break; + case 227: /* type_name ::= TINYINT UNSIGNED */ + { yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + break; + case 228: /* type_name ::= SMALLINT UNSIGNED */ + { yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + break; + case 229: /* type_name ::= INT UNSIGNED */ + { yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UINT); } + break; + case 230: /* type_name ::= BIGINT UNSIGNED */ + { yymsp[-1].minor.yy952 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + break; + case 231: /* type_name ::= JSON */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_JSON); } + break; + case 232: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + break; + case 233: /* type_name ::= MEDIUMBLOB */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + break; + case 234: /* type_name ::= BLOB */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_BLOB); } + break; + case 235: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + break; + case 236: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } + break; + case 237: /* type_name ::= DECIMAL */ + { yymsp[0].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + break; + case 238: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + break; + case 239: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { yymsp[-5].minor.yy952 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + break; + case 240: /* type_name_default_len ::= BINARY */ + { yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); } + break; + case 241: /* type_name_default_len ::= NCHAR */ + { yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); } + break; + case 242: /* type_name_default_len ::= VARCHAR */ + { yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); } + break; + case 243: /* type_name_default_len ::= VARBINARY */ + { yymsp[0].minor.yy952 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); } + break; + case 246: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */ + case 417: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==417); + { yymsp[-3].minor.yy334 = yymsp[-1].minor.yy334; } + break; + case 247: /* table_options ::= */ + { yymsp[1].minor.yy560 = createDefaultTableOptions(pCxt); } + break; + case 248: /* table_options ::= table_options COMMENT NK_STRING */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 249: /* table_options ::= table_options MAX_DELAY duration_list */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 250: /* table_options ::= table_options WATERMARK duration_list */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 251: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy334); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 252: /* table_options ::= table_options TTL NK_INTEGER */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 253: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-4].minor.yy560, TABLE_OPTION_SMA, yymsp[-1].minor.yy334); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 254: /* table_options ::= table_options DELETE_MARK duration_list */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-2].minor.yy560, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy334); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 255: /* alter_table_options ::= alter_table_option */ + { yylhsminor.yy560 = createAlterTableOptions(pCxt); yylhsminor.yy560 = setTableOption(pCxt, yylhsminor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 256: /* alter_table_options ::= alter_table_options alter_table_option */ + { yylhsminor.yy560 = setTableOption(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy389.type, &yymsp[0].minor.yy389.val); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 257: /* alter_table_option ::= COMMENT NK_STRING */ + { yymsp[-1].minor.yy389.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 258: /* alter_table_option ::= TTL NK_INTEGER */ + { yymsp[-1].minor.yy389.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy389.val = yymsp[0].minor.yy0; } + break; + case 259: /* duration_list ::= duration_literal */ + case 546: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==546); + { yylhsminor.yy334 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 260: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 547: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==547); + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 263: /* rollup_func_name ::= function_name */ + { yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy533, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 264: /* rollup_func_name ::= FIRST */ + case 265: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==265); + case 339: /* tag_item ::= QTAGS */ yytestcase(yyruleno==339); + { yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 268: /* col_name ::= column_name */ + case 340: /* tag_item ::= column_name */ yytestcase(yyruleno==340); + { yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 269: /* cmd ::= SHOW DNODES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } + break; + case 270: /* cmd ::= SHOW USERS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } + break; + case 271: /* cmd ::= SHOW USERS FULL */ + { pCxt->pRootNode = createShowStmtWithFull(pCxt, QUERY_NODE_SHOW_USERS_FULL_STMT); } + break; + case 272: /* cmd ::= SHOW USER PRIVILEGES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } + break; + case 273: /* cmd ::= SHOW db_kind_opt DATABASES */ + { + pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); + (void)setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy537); + } + break; + case 274: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + { + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy709, yymsp[0].minor.yy560, OP_TYPE_LIKE); + } + break; + case 275: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); } + break; + case 276: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy560, NULL, OP_TYPE_LIKE); } + break; + case 277: /* cmd ::= SHOW MNODES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } + break; + case 278: /* cmd ::= SHOW QNODES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } + break; + case 279: /* cmd ::= SHOW ARBGROUPS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } + break; + case 280: /* cmd ::= SHOW FUNCTIONS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } + break; + case 281: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy560, yymsp[-1].minor.yy560, OP_TYPE_EQUAL); } + break; + case 282: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), OP_TYPE_EQUAL); } + break; + case 283: /* cmd ::= SHOW STREAMS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } + break; + case 284: /* cmd ::= SHOW ACCOUNTS */ + { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } + break; + case 285: /* cmd ::= SHOW APPS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } + break; + case 286: /* cmd ::= SHOW CONNECTIONS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } + break; + case 287: /* cmd ::= SHOW LICENCES */ + case 288: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==288); + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } + break; + case 289: /* cmd ::= SHOW GRANTS FULL */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } + break; + case 290: /* cmd ::= SHOW GRANTS LOGS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } + break; + case 291: /* cmd ::= SHOW CLUSTER MACHINES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } + break; + case 292: /* cmd ::= SHOW CREATE DATABASE db_name */ + { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 293: /* cmd ::= SHOW CREATE TABLE full_table_name */ + { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy560); } + break; + case 294: /* cmd ::= SHOW CREATE STABLE full_table_name */ + { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, + yymsp[0].minor.yy560); } + break; + case 295: /* cmd ::= SHOW ENCRYPTIONS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); } + break; + case 296: /* cmd ::= SHOW QUERIES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } + break; + case 297: /* cmd ::= SHOW SCORES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } + break; + case 298: /* cmd ::= SHOW TOPICS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } + break; + case 299: /* cmd ::= SHOW VARIABLES */ + case 300: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==300); + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } + break; + case 301: /* cmd ::= SHOW LOCAL VARIABLES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } + break; + case 302: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy560); } + break; + case 303: /* cmd ::= SHOW BNODES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } + break; + case 304: /* cmd ::= SHOW SNODES */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } + break; + case 305: /* cmd ::= SHOW CLUSTER */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } + break; + case 306: /* cmd ::= SHOW TRANSACTIONS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } + break; + case 307: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy560); } + break; + case 308: /* cmd ::= SHOW CONSUMERS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } + break; + case 309: /* cmd ::= SHOW SUBSCRIPTIONS */ + { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } + break; + case 310: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy560, yymsp[-1].minor.yy560, OP_TYPE_EQUAL); } + break; + case 311: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), OP_TYPE_EQUAL); } + break; + case 312: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560, yymsp[-3].minor.yy334); } + break; + case 313: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + { pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy533), yymsp[-4].minor.yy334); } + break; + case 314: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } + break; + case 315: /* cmd ::= SHOW VNODES */ + { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } + break; + case 316: /* cmd ::= SHOW db_name_cond_opt ALIVE */ + { pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy560, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + break; + case 317: /* cmd ::= SHOW CLUSTER ALIVE */ + { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } + break; + case 318: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, OP_TYPE_LIKE); } + break; + case 319: /* cmd ::= SHOW CREATE VIEW full_table_name */ + { pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy560); } + break; + case 320: /* cmd ::= SHOW COMPACTS */ + { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } + break; + case 321: /* cmd ::= SHOW COMPACT NK_INTEGER */ + { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + break; + case 322: /* table_kind_db_name_cond_opt ::= */ + { yymsp[1].minor.yy709.kind = SHOW_KIND_ALL; yymsp[1].minor.yy709.dbName = nil_token; } + break; + case 323: /* table_kind_db_name_cond_opt ::= table_kind */ + { yylhsminor.yy709.kind = yymsp[0].minor.yy537; yylhsminor.yy709.dbName = nil_token; } + yymsp[0].minor.yy709 = yylhsminor.yy709; + break; + case 324: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ + { yylhsminor.yy709.kind = SHOW_KIND_ALL; yylhsminor.yy709.dbName = yymsp[-1].minor.yy533; } + yymsp[-1].minor.yy709 = yylhsminor.yy709; + break; + case 325: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + { yylhsminor.yy709.kind = yymsp[-2].minor.yy537; yylhsminor.yy709.dbName = yymsp[-1].minor.yy533; } + yymsp[-2].minor.yy709 = yylhsminor.yy709; + break; + case 326: /* table_kind ::= NORMAL */ + { yymsp[0].minor.yy537 = SHOW_KIND_TABLES_NORMAL; } + break; + case 327: /* table_kind ::= CHILD */ + { yymsp[0].minor.yy537 = SHOW_KIND_TABLES_CHILD; } + break; + case 328: /* db_name_cond_opt ::= */ + case 333: /* from_db_opt ::= */ yytestcase(yyruleno==333); + { yymsp[1].minor.yy560 = createDefaultDatabaseCondValue(pCxt); } + break; + case 329: /* db_name_cond_opt ::= db_name NK_DOT */ + { yylhsminor.yy560 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 331: /* like_pattern_opt ::= LIKE NK_STRING */ + { yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + break; + case 332: /* table_name_cond ::= table_name */ + { yylhsminor.yy560 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 334: /* from_db_opt ::= FROM db_name */ + { yymsp[-1].minor.yy560 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy533); } + break; + case 338: /* tag_item ::= TBNAME */ + { yylhsminor.yy560 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 341: /* tag_item ::= column_name column_alias */ + { yylhsminor.yy560 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy533), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 342: /* tag_item ::= column_name AS column_alias */ + { yylhsminor.yy560 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy533), &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 343: /* db_kind_opt ::= */ + { yymsp[1].minor.yy537 = SHOW_KIND_ALL; } + break; + case 344: /* db_kind_opt ::= USER */ + { yymsp[0].minor.yy537 = SHOW_KIND_DATABASES_USER; } + break; + case 345: /* db_kind_opt ::= SYSTEM */ + { yymsp[0].minor.yy537 = SHOW_KIND_DATABASES_SYSTEM; } + break; + case 346: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */ + { pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy173, &yymsp[-7].minor.yy533, yymsp[-4].minor.yy560, yymsp[-5].minor.yy560, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 347: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */ + { pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy173, &yymsp[-6].minor.yy533, NULL, yymsp[-4].minor.yy560, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 348: /* cmd ::= DROP TSMA exists_opt full_tsma_name */ + { pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + break; + case 349: /* cmd ::= SHOW db_name_cond_opt TSMAS */ + { pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy560); } + break; + case 352: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */ + { yymsp[-3].minor.yy560 = createTSMAOptions(pCxt, yymsp[-1].minor.yy334); } + break; + case 353: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy173, yymsp[-3].minor.yy560, yymsp[-1].minor.yy560, NULL, yymsp[0].minor.yy560); } + break; + case 354: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy173, yymsp[-5].minor.yy560, yymsp[-3].minor.yy560, yymsp[-1].minor.yy334, NULL); } + break; + case 355: /* cmd ::= DROP INDEX exists_opt full_index_name */ + { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + break; + case 356: /* full_index_name ::= index_name */ + { yylhsminor.yy560 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 357: /* full_index_name ::= db_name NK_DOT index_name */ + { yylhsminor.yy560 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 358: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { yymsp[-9].minor.yy560 = createIndexOption(pCxt, yymsp[-7].minor.yy334, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 359: /* 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.yy560 = createIndexOption(pCxt, yymsp[-9].minor.yy334, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 362: /* func ::= sma_func_name NK_LP expression_list NK_RP */ + { yylhsminor.yy560 = createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy334); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 363: /* sma_func_name ::= function_name */ + case 652: /* alias_opt ::= table_alias */ yytestcase(yyruleno==652); + { yylhsminor.yy533 = yymsp[0].minor.yy533; } + yymsp[0].minor.yy533 = yylhsminor.yy533; + break; + case 368: /* sma_stream_opt ::= */ + case 418: /* stream_options ::= */ yytestcase(yyruleno==418); + { yymsp[1].minor.yy560 = createStreamOptions(pCxt); } + break; + case 369: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { ((SStreamOptions*)yymsp[-2].minor.yy560)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 370: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { ((SStreamOptions*)yymsp[-2].minor.yy560)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 371: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { ((SStreamOptions*)yymsp[-2].minor.yy560)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); yylhsminor.yy560 = yymsp[-2].minor.yy560; } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 372: /* with_meta ::= AS */ + { yymsp[0].minor.yy802 = 0; } + break; + case 373: /* with_meta ::= WITH META AS */ + { yymsp[-2].minor.yy802 = 1; } + break; + case 374: /* with_meta ::= ONLY META AS */ + { yymsp[-2].minor.yy802 = 2; } + break; + case 375: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, yymsp[0].minor.yy560); } + break; + case 376: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy173, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy533, yymsp[-2].minor.yy802); } + break; + case 377: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy173, &yymsp[-4].minor.yy533, yymsp[-1].minor.yy560, yymsp[-3].minor.yy802, yymsp[0].minor.yy560); } + break; + case 378: /* cmd ::= DROP TOPIC exists_opt topic_name */ + { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 379: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy173, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } + break; + case 380: /* cmd ::= DESC full_table_name */ + case 381: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==381); + { pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy560); } + break; + case 382: /* cmd ::= RESET QUERY CACHE */ + { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } + break; + case 383: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 384: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==384); + { pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 387: /* explain_options ::= */ + { yymsp[1].minor.yy560 = createDefaultExplainOptions(pCxt); } + break; + case 388: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + { yylhsminor.yy560 = setExplainVerbose(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 389: /* explain_options ::= explain_options RATIO NK_FLOAT */ + { yylhsminor.yy560 = setExplainRatio(pCxt, yymsp[-2].minor.yy560, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 390: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + { pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy173, yymsp[-9].minor.yy173, &yymsp[-6].minor.yy533, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy952, yymsp[-1].minor.yy802, &yymsp[0].minor.yy533, yymsp[-10].minor.yy173); } + break; + case 391: /* cmd ::= DROP FUNCTION exists_opt function_name */ + { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 396: /* language_opt ::= */ + case 441: /* on_vgroup_id ::= */ yytestcase(yyruleno==441); + { yymsp[1].minor.yy533 = nil_token; } + break; + case 397: /* language_opt ::= LANGUAGE NK_STRING */ + case 442: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==442); + { yymsp[-1].minor.yy533 = yymsp[0].minor.yy0; } + break; + case 400: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + { pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy173, yymsp[-2].minor.yy560, &yymsp[-1].minor.yy0, yymsp[0].minor.yy560); } + break; + case 401: /* cmd ::= DROP VIEW exists_opt full_view_name */ + { pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy173, yymsp[0].minor.yy560); } + break; + case 402: /* full_view_name ::= view_name */ + { yylhsminor.yy560 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy533); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 403: /* full_view_name ::= db_name NK_DOT view_name */ + { yylhsminor.yy560 = createViewNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 404: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + { pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy173, &yymsp[-8].minor.yy533, yymsp[-5].minor.yy560, yymsp[-7].minor.yy560, yymsp[-3].minor.yy334, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, yymsp[-4].minor.yy334); } + break; + case 405: /* cmd ::= DROP STREAM exists_opt stream_name */ + { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 406: /* cmd ::= PAUSE STREAM exists_opt stream_name */ + { pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 407: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + { pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy173, yymsp[-1].minor.yy173, &yymsp[0].minor.yy533); } + break; + case 412: /* column_stream_def ::= column_name stream_col_options */ + { yylhsminor.yy560 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy533, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy560); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 413: /* stream_col_options ::= */ + case 765: /* column_options ::= */ yytestcase(yyruleno==765); + { yymsp[1].minor.yy560 = createDefaultColumnOptions(pCxt); } + break; + case 414: /* stream_col_options ::= stream_col_options PRIMARY KEY */ + case 766: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==766); + { yylhsminor.yy560 = setColumnOptions(pCxt, yymsp[-2].minor.yy560, COLUMN_OPTION_PRIMARYKEY, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 419: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 420: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==420); + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 421: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 422: /* stream_options ::= stream_options WATERMARK duration_literal */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 423: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 424: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 425: /* stream_options ::= stream_options DELETE_MARK duration_literal */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-2].minor.yy560, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 426: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + { yylhsminor.yy560 = setStreamOptions(pCxt, yymsp[-3].minor.yy560, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 428: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 709: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==709); + case 733: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==733); + { yymsp[-3].minor.yy560 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy560); } + break; + case 431: /* cmd ::= KILL CONNECTION NK_INTEGER */ + { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } + break; + case 432: /* cmd ::= KILL QUERY NK_STRING */ + { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } + break; + case 433: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } + break; + case 434: /* cmd ::= KILL COMPACT NK_INTEGER */ + { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } + break; + case 435: /* cmd ::= BALANCE VGROUP */ + { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } + break; + case 436: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 437: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */ + { pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy533); } + break; + case 438: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 439: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy334); } + break; + case 440: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } + break; + case 443: /* dnode_list ::= DNODE NK_INTEGER */ + { yymsp[-1].minor.yy334 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + break; + case 445: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + { pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 448: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { yymsp[-6].minor.yy560 = createInsertStmt(pCxt, yymsp[-4].minor.yy560, yymsp[-2].minor.yy334, yymsp[0].minor.yy560); } + break; + case 449: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ + { yymsp[-3].minor.yy560 = createInsertStmt(pCxt, yymsp[-1].minor.yy560, NULL, yymsp[0].minor.yy560); } + break; + case 450: /* tags_literal ::= NK_INTEGER */ + case 462: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==462); + case 471: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==471); + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 451: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */ + case 452: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==452); + case 463: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==463); + case 464: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==464); + case 472: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==472); + case 473: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==473); + case 481: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==481); + case 482: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==482); + { + SToken l = yymsp[-2].minor.yy0; + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + l.n = (r.z + r.n) - l.z; + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy560); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 453: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 456: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==456); + case 465: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==465); + case 468: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==468); + case 474: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==474); + case 477: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==477); + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 454: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */ + case 455: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==455); + case 457: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==457); + case 458: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==458); + case 466: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==466); + case 467: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==467); + case 469: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==469); + case 470: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==470); + case 475: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==475); + case 476: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==476); + case 478: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==478); + case 479: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==479); + { + SToken l = yymsp[-3].minor.yy0; + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + l.n = (r.z + r.n) - l.z; + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy560); + } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 459: /* tags_literal ::= NK_FLOAT */ + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 460: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 461: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==461); + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 480: /* tags_literal ::= NK_STRING */ + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 483: /* tags_literal ::= NK_BOOL */ + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 484: /* tags_literal ::= NULL */ + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 485: /* tags_literal ::= literal_func */ + { yylhsminor.yy560 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy560); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 486: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 487: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==487); + { + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + l.n = (r.z + r.n) - l.z; + yylhsminor.yy560 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 490: /* literal ::= NK_INTEGER */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 491: /* literal ::= NK_FLOAT */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 492: /* literal ::= NK_STRING */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 493: /* literal ::= NK_BOOL */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 494: /* literal ::= TIMESTAMP NK_STRING */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 495: /* literal ::= duration_literal */ + case 505: /* signed_literal ::= signed */ yytestcase(yyruleno==505); + case 529: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==529); + case 530: /* expression ::= literal */ yytestcase(yyruleno==530); + case 532: /* expression ::= column_reference */ yytestcase(yyruleno==532); + case 533: /* expression ::= function_expression */ yytestcase(yyruleno==533); + case 534: /* expression ::= case_when_expression */ yytestcase(yyruleno==534); + case 577: /* function_expression ::= literal_func */ yytestcase(yyruleno==577); + case 633: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==633); + case 637: /* boolean_primary ::= predicate */ yytestcase(yyruleno==637); + case 639: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==639); + case 640: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==640); + case 643: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==643); + case 645: /* table_reference ::= table_primary */ yytestcase(yyruleno==645); + case 646: /* table_reference ::= joined_table */ yytestcase(yyruleno==646); + case 650: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==650); + case 735: /* query_simple ::= query_specification */ yytestcase(yyruleno==735); + case 736: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==736); + case 739: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==739); + case 741: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==741); + { yylhsminor.yy560 = yymsp[0].minor.yy560; } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 496: /* literal ::= NULL */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 497: /* literal ::= NK_QUESTION */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 498: /* duration_literal ::= NK_VARIABLE */ + case 710: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==710); + case 711: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==711); + case 712: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==712); + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 499: /* signed ::= NK_INTEGER */ + { yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 500: /* signed ::= NK_PLUS NK_INTEGER */ + { yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + break; + case 501: /* 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.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 502: /* signed ::= NK_FLOAT */ + { yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 503: /* signed ::= NK_PLUS NK_FLOAT */ + { yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + break; + case 504: /* 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.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 506: /* signed_literal ::= NK_STRING */ + { yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 507: /* signed_literal ::= NK_BOOL */ + { yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 508: /* signed_literal ::= TIMESTAMP NK_STRING */ + { yymsp[-1].minor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + break; + case 509: /* signed_literal ::= duration_literal */ + case 511: /* signed_literal ::= literal_func */ yytestcase(yyruleno==511); + case 604: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==604); + case 687: /* select_item ::= common_expression */ yytestcase(yyruleno==687); + case 697: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==697); + case 740: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==740); + case 742: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==742); + case 755: /* search_condition ::= common_expression */ yytestcase(yyruleno==755); + { yylhsminor.yy560 = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 510: /* signed_literal ::= NULL */ + { yylhsminor.yy560 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 512: /* signed_literal ::= NK_QUESTION */ + { yylhsminor.yy560 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 531: /* expression ::= pseudo_column */ + { yylhsminor.yy560 = yymsp[0].minor.yy560; (void)setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy560, true); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 535: /* expression ::= NK_LP expression NK_RP */ + case 638: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==638); + case 754: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==754); + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 536: /* expression ::= NK_PLUS expr_or_subquery */ + { + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 537: /* expression ::= NK_MINUS expr_or_subquery */ + { + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL)); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 538: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 539: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 540: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 541: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 542: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 543: /* expression ::= column_reference NK_ARROW NK_STRING */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 544: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 545: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 548: /* column_reference ::= column_name */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy533, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy533)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 549: /* column_reference ::= table_name NK_DOT column_name */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533, createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy533)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 550: /* column_reference ::= NK_ALIAS */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 551: /* column_reference ::= table_name NK_DOT NK_ALIAS */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 552: /* pseudo_column ::= ROWTS */ + case 553: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==553); + case 555: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==555); + case 556: /* pseudo_column ::= QEND */ yytestcase(yyruleno==556); + case 557: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==557); + case 558: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==558); + case 559: /* pseudo_column ::= WEND */ yytestcase(yyruleno==559); + case 560: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==560); + case 561: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==561); + case 562: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==562); + case 563: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==563); + case 579: /* literal_func ::= NOW */ yytestcase(yyruleno==579); + case 580: /* literal_func ::= TODAY */ yytestcase(yyruleno==580); + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 554: /* pseudo_column ::= table_name NK_DOT TBNAME */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy533)))); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 564: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 565: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==565); + case 573: /* function_expression ::= substr_func NK_LP expression_list NK_RP */ yytestcase(yyruleno==573); + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy533, yymsp[-1].minor.yy334)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 566: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 567: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==567); + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy952)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 568: /* function_expression ::= POSITION NK_LP expr_or_subquery IN expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createPositionFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 569: /* function_expression ::= TRIM NK_LP expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), TRIM_TYPE_BOTH)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 570: /* function_expression ::= TRIM NK_LP trim_specification_type FROM expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), yymsp[-3].minor.yy672)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 571: /* function_expression ::= TRIM NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), TRIM_TYPE_BOTH)); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 572: /* function_expression ::= TRIM NK_LP trim_specification_type expr_or_subquery FROM expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-6].minor.yy0, &yymsp[0].minor.yy0, createTrimFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), yymsp[-4].minor.yy672)); } + yymsp[-6].minor.yy560 = yylhsminor.yy560; + break; + case 574: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy533, &yymsp[0].minor.yy0, createSubstrFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 575: /* function_expression ::= substr_func NK_LP expr_or_subquery FROM expr_or_subquery FOR expr_or_subquery NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-7].minor.yy533, &yymsp[0].minor.yy0, createSubstrFunctionNodeExt(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560))); } + yymsp[-7].minor.yy560 = yylhsminor.yy560; + break; + case 576: /* function_expression ::= REPLACE NK_LP expression_list NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy334)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 578: /* literal_func ::= noarg_func NK_LP NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy533, NULL)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 583: /* trim_specification_type ::= BOTH */ + { yymsp[0].minor.yy672 = TRIM_TYPE_BOTH; } + break; + case 584: /* trim_specification_type ::= TRAILING */ + { yymsp[0].minor.yy672 = TRIM_TYPE_TRAILING; } + break; + case 585: /* trim_specification_type ::= LEADING */ + { yymsp[0].minor.yy672 = TRIM_TYPE_LEADING; } + break; + case 600: /* star_func_para_list ::= NK_STAR */ + { yylhsminor.yy334 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 605: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 690: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==690); + { yylhsminor.yy560 = createColumnNode(pCxt, &yymsp[-2].minor.yy533, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 606: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy334, yymsp[-1].minor.yy560)); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 607: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-2].minor.yy334, yymsp[-1].minor.yy560)); } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 610: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + { yymsp[-3].minor.yy560 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560)); } + break; + case 612: /* case_when_else_opt ::= ELSE common_expression */ + { yymsp[-1].minor.yy560 = releaseRawExprNode(pCxt, yymsp[0].minor.yy560); } + break; + case 613: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 618: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==618); + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy506, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 614: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-4].minor.yy560 = yylhsminor.yy560; + break; + case 615: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-5].minor.yy560 = yylhsminor.yy560; + break; + case 616: /* predicate ::= expr_or_subquery IS NULL */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), NULL)); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 617: /* predicate ::= expr_or_subquery IS NOT NULL */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL)); + } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 619: /* compare_op ::= NK_LT */ + { yymsp[0].minor.yy506 = OP_TYPE_LOWER_THAN; } + break; + case 620: /* compare_op ::= NK_GT */ + { yymsp[0].minor.yy506 = OP_TYPE_GREATER_THAN; } + break; + case 621: /* compare_op ::= NK_LE */ + { yymsp[0].minor.yy506 = OP_TYPE_LOWER_EQUAL; } + break; + case 622: /* compare_op ::= NK_GE */ + { yymsp[0].minor.yy506 = OP_TYPE_GREATER_EQUAL; } + break; + case 623: /* compare_op ::= NK_NE */ + { yymsp[0].minor.yy506 = OP_TYPE_NOT_EQUAL; } + break; + case 624: /* compare_op ::= NK_EQ */ + { yymsp[0].minor.yy506 = OP_TYPE_EQUAL; } + break; + case 625: /* compare_op ::= LIKE */ + { yymsp[0].minor.yy506 = OP_TYPE_LIKE; } + break; + case 626: /* compare_op ::= NOT LIKE */ + { yymsp[-1].minor.yy506 = OP_TYPE_NOT_LIKE; } + break; + case 627: /* compare_op ::= MATCH */ + { yymsp[0].minor.yy506 = OP_TYPE_MATCH; } + break; + case 628: /* compare_op ::= NMATCH */ + { yymsp[0].minor.yy506 = OP_TYPE_NMATCH; } + break; + case 629: /* compare_op ::= CONTAINS */ + { yymsp[0].minor.yy506 = OP_TYPE_JSON_CONTAINS; } + break; + case 630: /* in_op ::= IN */ + { yymsp[0].minor.yy506 = OP_TYPE_IN; } + break; + case 631: /* in_op ::= NOT IN */ + { yymsp[-1].minor.yy506 = OP_TYPE_NOT_IN; } + break; + case 632: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 634: /* boolean_value_expression ::= NOT boolean_primary */ + { + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy560), NULL)); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 635: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 636: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy560); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy560); + yylhsminor.yy560 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); + } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 644: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { yylhsminor.yy560 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy560, yymsp[0].minor.yy560, NULL); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 647: /* table_primary ::= table_name alias_opt */ + { yylhsminor.yy560 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 648: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + { yylhsminor.yy560 = createRealTableNode(pCxt, &yymsp[-3].minor.yy533, &yymsp[-1].minor.yy533, &yymsp[0].minor.yy533); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 649: /* table_primary ::= subquery alias_opt */ + { yylhsminor.yy560 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 651: /* alias_opt ::= */ + { yymsp[1].minor.yy533 = nil_token; } + break; + case 653: /* alias_opt ::= AS table_alias */ + { yymsp[-1].minor.yy533 = yymsp[0].minor.yy533; } + break; + case 654: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 655: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==655); + { yymsp[-2].minor.yy560 = yymsp[-1].minor.yy560; } + break; + case 656: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + { + yylhsminor.yy560 = createJoinTableNode(pCxt, yymsp[-6].minor.yy36, yymsp[-5].minor.yy648, yymsp[-7].minor.yy560, yymsp[-3].minor.yy560, yymsp[-2].minor.yy560); + yylhsminor.yy560 = addWindowOffsetClause(pCxt, yylhsminor.yy560, yymsp[-1].minor.yy560); + yylhsminor.yy560 = addJLimitClause(pCxt, yylhsminor.yy560, yymsp[0].minor.yy560); + } + yymsp[-7].minor.yy560 = yylhsminor.yy560; + break; + case 657: /* join_type ::= */ + { yymsp[1].minor.yy36 = JOIN_TYPE_INNER; } + break; + case 658: /* join_type ::= INNER */ + { yymsp[0].minor.yy36 = JOIN_TYPE_INNER; } + break; + case 659: /* join_type ::= LEFT */ + { yymsp[0].minor.yy36 = JOIN_TYPE_LEFT; } + break; + case 660: /* join_type ::= RIGHT */ + { yymsp[0].minor.yy36 = JOIN_TYPE_RIGHT; } + break; + case 661: /* join_type ::= FULL */ + { yymsp[0].minor.yy36 = JOIN_TYPE_FULL; } + break; + case 662: /* join_subtype ::= */ + { yymsp[1].minor.yy648 = JOIN_STYPE_NONE; } + break; + case 663: /* join_subtype ::= OUTER */ + { yymsp[0].minor.yy648 = JOIN_STYPE_OUTER; } + break; + case 664: /* join_subtype ::= SEMI */ + { yymsp[0].minor.yy648 = JOIN_STYPE_SEMI; } + break; + case 665: /* join_subtype ::= ANTI */ + { yymsp[0].minor.yy648 = JOIN_STYPE_ANTI; } + break; + case 666: /* join_subtype ::= ASOF */ + { yymsp[0].minor.yy648 = JOIN_STYPE_ASOF; } + break; + case 667: /* join_subtype ::= WINDOW */ + { yymsp[0].minor.yy648 = JOIN_STYPE_WIN; } + break; + case 671: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + { yymsp[-5].minor.yy560 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 672: /* window_offset_literal ::= NK_VARIABLE */ + { yylhsminor.yy560 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 673: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ + { + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy560 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 675: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 746: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==746); + case 750: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==750); + { yymsp[-1].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + break; + case 676: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { + yymsp[-13].minor.yy560 = createSelectStmt(pCxt, yymsp[-11].minor.yy173, yymsp[-9].minor.yy334, yymsp[-8].minor.yy560, yymsp[-12].minor.yy334); + yymsp[-13].minor.yy560 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy560, yymsp[-10].minor.yy173); + yymsp[-13].minor.yy560 = addWhereClause(pCxt, yymsp[-13].minor.yy560, yymsp[-7].minor.yy560); + yymsp[-13].minor.yy560 = addPartitionByClause(pCxt, yymsp[-13].minor.yy560, yymsp[-6].minor.yy334); + yymsp[-13].minor.yy560 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy560, yymsp[-2].minor.yy560); + yymsp[-13].minor.yy560 = addGroupByClause(pCxt, yymsp[-13].minor.yy560, yymsp[-1].minor.yy334); + yymsp[-13].minor.yy560 = addHavingClause(pCxt, yymsp[-13].minor.yy560, yymsp[0].minor.yy560); + yymsp[-13].minor.yy560 = addRangeClause(pCxt, yymsp[-13].minor.yy560, yymsp[-5].minor.yy560); + yymsp[-13].minor.yy560 = addEveryClause(pCxt, yymsp[-13].minor.yy560, yymsp[-4].minor.yy560); + yymsp[-13].minor.yy560 = addFillClause(pCxt, yymsp[-13].minor.yy560, yymsp[-3].minor.yy560); + } + break; + case 677: /* hint_list ::= */ + { yymsp[1].minor.yy334 = createHintNodeList(pCxt, NULL); } + break; + case 678: /* hint_list ::= NK_HINT */ + { yylhsminor.yy334 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 683: /* set_quantifier_opt ::= ALL */ + { yymsp[0].minor.yy173 = false; } + break; + case 686: /* select_item ::= NK_STAR */ + { yylhsminor.yy560 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy560 = yylhsminor.yy560; + break; + case 688: /* select_item ::= common_expression column_alias */ + case 698: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==698); + { yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-1].minor.yy560 = yylhsminor.yy560; + break; + case 689: /* select_item ::= common_expression AS column_alias */ + case 699: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==699); + { yylhsminor.yy560 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), &yymsp[0].minor.yy533); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 694: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 724: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==724); + case 744: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==744); + { yymsp[-2].minor.yy334 = yymsp[0].minor.yy334; } + break; + case 701: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + { yymsp[-5].minor.yy560 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 702: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { yymsp[-3].minor.yy560 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 703: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + { yymsp[-5].minor.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), NULL, yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 704: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + { yymsp[-7].minor.yy560 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy560), releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), yymsp[-1].minor.yy560, yymsp[0].minor.yy560); } + break; + case 705: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + { yymsp[-6].minor.yy560 = createEventWindowNode(pCxt, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); } + break; + case 706: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + { yymsp[-3].minor.yy560 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + break; + case 707: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { yymsp[-5].minor.yy560 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + break; + case 714: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { yymsp[-3].minor.yy560 = createFillNode(pCxt, yymsp[-1].minor.yy18, NULL); } + break; + case 715: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + { yymsp[-5].minor.yy560 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } + break; + case 716: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + { yymsp[-5].minor.yy560 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy334)); } + break; + case 717: /* fill_mode ::= NONE */ + { yymsp[0].minor.yy18 = FILL_MODE_NONE; } + break; + case 718: /* fill_mode ::= PREV */ + { yymsp[0].minor.yy18 = FILL_MODE_PREV; } + break; + case 719: /* fill_mode ::= NULL */ + { yymsp[0].minor.yy18 = FILL_MODE_NULL; } + break; + case 720: /* fill_mode ::= NULL_F */ + { yymsp[0].minor.yy18 = FILL_MODE_NULL_F; } + break; + case 721: /* fill_mode ::= LINEAR */ + { yymsp[0].minor.yy18 = FILL_MODE_LINEAR; } + break; + case 722: /* fill_mode ::= NEXT */ + { yymsp[0].minor.yy18 = FILL_MODE_NEXT; } + break; + case 725: /* group_by_list ::= expr_or_subquery */ + { yylhsminor.yy334 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } + yymsp[0].minor.yy334 = yylhsminor.yy334; + break; + case 726: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { yylhsminor.yy334 = addNodeToList(pCxt, yymsp[-2].minor.yy334, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy560))); } + yymsp[-2].minor.yy334 = yylhsminor.yy334; + break; + case 730: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { yymsp[-5].minor.yy560 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy560), releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 731: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + { yymsp[-3].minor.yy560 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy560)); } + break; + case 734: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { + yylhsminor.yy560 = addOrderByClause(pCxt, yymsp[-3].minor.yy560, yymsp[-2].minor.yy334); + yylhsminor.yy560 = addSlimitClause(pCxt, yylhsminor.yy560, yymsp[-1].minor.yy560); + yylhsminor.yy560 = addLimitClause(pCxt, yylhsminor.yy560, yymsp[0].minor.yy560); + } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 737: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-3].minor.yy560 = yylhsminor.yy560; + break; + case 738: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { yylhsminor.yy560 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy560, yymsp[0].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 747: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 751: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==751); + { yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + break; + case 748: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 752: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==752); + { yymsp[-3].minor.yy560 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + break; + case 753: /* subquery ::= NK_LP query_expression NK_RP */ + { yylhsminor.yy560 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy560); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 758: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { yylhsminor.yy560 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy560), yymsp[-1].minor.yy974, yymsp[0].minor.yy109); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 759: /* ordering_specification_opt ::= */ + { yymsp[1].minor.yy974 = ORDER_ASC; } + break; + case 760: /* ordering_specification_opt ::= ASC */ + { yymsp[0].minor.yy974 = ORDER_ASC; } + break; + case 761: /* ordering_specification_opt ::= DESC */ + { yymsp[0].minor.yy974 = ORDER_DESC; } + break; + case 762: /* null_ordering_opt ::= */ + { yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } + break; + case 763: /* null_ordering_opt ::= NULLS FIRST */ + { yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } + break; + case 764: /* null_ordering_opt ::= NULLS LAST */ + { yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } + break; + case 767: /* column_options ::= column_options ENCODE NK_STRING */ + { yylhsminor.yy560 = setColumnOptions(pCxt, yymsp[-2].minor.yy560, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 768: /* column_options ::= column_options COMPRESS NK_STRING */ + { yylhsminor.yy560 = setColumnOptions(pCxt, yymsp[-2].minor.yy560, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + case 769: /* column_options ::= column_options LEVEL NK_STRING */ + { yylhsminor.yy560 = setColumnOptions(pCxt, yymsp[-2].minor.yy560, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy560 = yylhsminor.yy560; + break; + default: + break; + /********** End reduce actions ************************************************/ }; assert( yyrulenoyytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); /* Here code is inserted which will be executed whenever the ** parser fails */ -/************ Begin %parse_failure code ***************************************/ -/************ End %parse_failure code *****************************************/ + /************ Begin %parse_failure code ***************************************/ + /************ End %parse_failure code *****************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } #endif /* YYNOERRORRECOVERY */ @@ -8720,17 +8026,16 @@ static void yy_parse_failed( ** The following code executes when a syntax error first occurs. */ static void yy_syntax_error( - yyParser *yypParser, /* The parser */ - int yymajor, /* The major type of the error token */ - ParseTOKENTYPE yyminor /* The minor type of the error token */ + yyParser *yypParser, /* The parser */ + int yymajor, /* The major type of the error token */ + ParseTOKENTYPE yyminor /* The minor type of the error token */ ){ ParseARG_FETCH - ParseCTX_FETCH + ParseCTX_FETCH #define TOKEN yyminor -/************ Begin %syntax_error code ****************************************/ -#line 29 "sql.y" + /************ Begin %syntax_error code ****************************************/ - if (TSDB_CODE_SUCCESS == pCxt->errCode) { + if (TSDB_CODE_SUCCESS == pCxt->errCode) { if(TOKEN.z) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } else { @@ -8739,22 +8044,21 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } -#line 8742 "sql.c" -/************ End %syntax_error code ******************************************/ + /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } /* ** The following is executed when the parser accepts */ static void yy_accept( - yyParser *yypParser /* The parser */ + yyParser *yypParser /* The parser */ ){ ParseARG_FETCH - ParseCTX_FETCH + ParseCTX_FETCH #ifndef NDEBUG - if( yyTraceFILE ){ + if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); } #endif @@ -8764,10 +8068,10 @@ static void yy_accept( assert( yypParser->yytos==yypParser->yystack ); /* Here code is inserted which will be executed whenever the ** parser accepts */ -/*********** Begin %parse_accept code *****************************************/ -/*********** End %parse_accept code *******************************************/ + /*********** Begin %parse_accept code *****************************************/ + /*********** End %parse_accept code *******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseCTX_STORE } /* The main parser program. @@ -8790,10 +8094,10 @@ static void yy_accept( ** None. */ void Parse( - void *yyp, /* The parser */ - int yymajor, /* The major token code number */ - ParseTOKENTYPE yyminor /* The value for the token */ - ParseARG_PDECL /* Optional %extra_argument parameter */ + void *yyp, /* The parser */ + int yymajor, /* The major token code number */ + ParseTOKENTYPE yyminor /* The value for the token */ + ParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; YYACTIONTYPE yyact; /* The parser action. */ @@ -8805,9 +8109,9 @@ void Parse( #endif yyParser *yypParser = (yyParser*)yyp; /* The parser */ ParseCTX_FETCH - ParseARG_STORE + ParseARG_STORE - assert( yypParser->yytos!=0 ); + assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif @@ -8837,14 +8141,14 @@ void Parse( int yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos[yysize].stateno); + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos[yysize].stateno); }else{ fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", - yyTracePrompt, yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; assert( yypParser->yyhwm == - (int)(yypParser->yytos - yypParser->yystack)); + (int)(yypParser->yytos - yypParser->yystack)); } #endif -#if YYSTACKDEPTH>0 if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - break; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yyGrowStack(yypParser) ){ yyStackOverflow(yypParser); break; } } -#endif } yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ @@ -8899,7 +8196,7 @@ void Parse( #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** @@ -8924,7 +8221,7 @@ void Parse( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", - yyTracePrompt,yyTokenName[yymajor]); + yyTracePrompt,yyTokenName[yymajor]); } #endif yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index 1311179e92..2526ac73bc 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -778,11 +778,13 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) { sql = NULL; if (code) { QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code)); + qDestroyTask(pTaskInfo); QW_ERR_JRET(code); } if (NULL == sinkHandle || NULL == pTaskInfo) { QW_TASK_ELOG("create task result error, taskHandle:%p, sinkHandle:%p", pTaskInfo, sinkHandle); + qDestroyTask(pTaskInfo); QW_ERR_JRET(TSDB_CODE_APP_ERROR); } @@ -1277,11 +1279,13 @@ int32_t qwProcessDelete(QW_FPARAMS_DEF, SQWMsg *qwMsg, SDeleteRes *pRes) { if (code) { QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code)); + qDestroyTask(pTaskInfo); QW_ERR_JRET(code); } if (NULL == sinkHandle || NULL == pTaskInfo) { QW_TASK_ELOG("create task result error, taskHandle:%p, sinkHandle:%p", pTaskInfo, sinkHandle); + qDestroyTask(pTaskInfo); QW_ERR_JRET(TSDB_CODE_APP_ERROR); } diff --git a/source/libs/scalar/inc/sclInt.h b/source/libs/scalar/inc/sclInt.h index 836cf7d69a..d6d77ffd7b 100644 --- a/source/libs/scalar/inc/sclInt.h +++ b/source/libs/scalar/inc/sclInt.h @@ -54,6 +54,52 @@ typedef struct SScalarCtx { #define SCL_DOWNGRADE_DATETYPE(_type) \ ((_type) == TSDB_DATA_TYPE_BIGINT || TSDB_DATA_TYPE_DOUBLE == (_type) || (_type) == TSDB_DATA_TYPE_UBIGINT) + +/** Flags for calculateWeekNum() function. */ +#define WEEK_FLAG_MONDAY_FIRST 1 /* If set this, monday is first day of week, else, sunday is first day.*/ +#define WEEK_FLAG_FROM_ONE 2 /* If set this, week start from 1, else, week start from 0. */ +#define WEEK_FLAG_INCLUDE_FIRST_DAY 4 /* If set this, week contains 'first day of week' is week one, + * else, weeks are numbered according to ISO 8601:1988. */ + +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#endif + +#ifndef M_1_PI +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#endif + +#define INT1TOCHAR(T, A) \ + { \ + const unsigned long def_temp = (unsigned long)(A); \ + ((unsigned char *)(T))[0] = (unsigned char)(def_temp); \ + T += 1; \ + } +#define INT2TOCHAR(T, A) \ + { \ + const unsigned long def_temp = (unsigned long)(A); \ + ((unsigned char *)(T))[1] = (unsigned char)(def_temp); \ + ((unsigned char *)(T))[0] = (unsigned char)(def_temp >> 8); \ + T += 2; \ + } +#define INT3TOCHAR(T, A) \ + { \ + const unsigned long def_temp = (unsigned long)(A); \ + ((unsigned char *)(T))[2] = (unsigned char)(def_temp); \ + ((unsigned char *)(T))[1] = (unsigned char)(def_temp >> 8); \ + ((unsigned char *)(T))[0] = (unsigned char)(def_temp >> 16); \ + T += 3; \ + } +#define INT4TOCHAR(T, A) \ + { \ + const unsigned long def_temp = (unsigned long)(A); \ + ((unsigned char *)(T))[3] = (unsigned char)(def_temp); \ + ((unsigned char *)(T))[2] = (unsigned char)(def_temp >> 8); \ + ((unsigned char *)(T))[1] = (unsigned char)(def_temp >> 16); \ + ((unsigned char *)(T))[0] = (unsigned char)(def_temp >> 24); \ + T += 4; \ + } + #define sclFatal(...) qFatal(__VA_ARGS__) #define sclError(...) qError(__VA_ARGS__) #define sclWarn(...) qWarn(__VA_ARGS__) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index e9efbc638d..00487b140d 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -1066,7 +1066,9 @@ int32_t filterAddField(SFilterInfo *info, void *desc, void **data, int32_t type, info->fields[type].fields = taosMemoryRealloc(info->fields[type].fields, info->fields[type].size * sizeof(SFilterField)); if (info->fields[type].fields == NULL) { - return TSDB_CODE_OUT_OF_MEMORY; + *num = 0; + fltError("taosMemoryRealloc failed, size:%d", (int32_t)(info->fields[type].size * sizeof(SFilterField))); + FLT_ERR_RET(terrno); } } @@ -1086,14 +1088,20 @@ int32_t filterAddField(SFilterInfo *info, void *desc, void **data, int32_t type, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, false); if (NULL == info->pctx.valHash) { fltError("taosHashInit failed, size:%d", FILTER_DEFAULT_GROUP_SIZE * FILTER_DEFAULT_VALUE_SIZE); - FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + if (srcFlag) { + FILTER_SET_FLAG(*srcFlag, FLD_DATA_NO_FREE); + } + FLT_ERR_RET(terrno); } } SFilterDataInfo dInfo = {idx, *data}; if (taosHashPut(info->pctx.valHash, *data, dataLen, &dInfo, sizeof(dInfo))) { fltError("taosHashPut to set failed"); - FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + if (srcFlag) { + FILTER_SET_FLAG(*srcFlag, FLD_DATA_NO_FREE); + } + FLT_ERR_RET(terrno); } if (srcFlag) { FILTER_SET_FLAG(*srcFlag, FLD_DATA_NO_FREE); @@ -1102,7 +1110,7 @@ int32_t filterAddField(SFilterInfo *info, void *desc, void **data, int32_t type, } else if (type != FLD_TYPE_COLUMN && data) { if (freeIfExists) { taosMemoryFreeClear(*data); - } else if (sameBuf) { + } else if (sameBuf && srcFlag) { FILTER_SET_FLAG(*srcFlag, FLD_DATA_NO_FREE); } } @@ -1114,11 +1122,11 @@ int32_t filterAddField(SFilterInfo *info, void *desc, void **data, int32_t type, } static FORCE_INLINE int32_t filterAddColFieldFromField(SFilterInfo *info, SFilterField *field, SFilterFieldId *fid) { - FLT_ERR_RET(filterAddField(info, field->desc, &field->data, FILTER_GET_TYPE(field->flag), fid, 0, false, NULL)); + int32_t code = filterAddField(info, field->desc, &field->data, FILTER_GET_TYPE(field->flag), fid, 0, false, NULL); FILTER_SET_FLAG(field->flag, FLD_DATA_NO_FREE); - return TSDB_CODE_SUCCESS; + return code; } int32_t filterAddFieldFromNode(SFilterInfo *info, SNode *node, SFilterFieldId *fid) { @@ -2769,6 +2777,7 @@ int32_t filterConvertGroupFromArray(SFilterInfo *info, SArray *group) { if (info->groupNum > 0) { info->groups = taosMemoryCalloc(info->groupNum, sizeof(*info->groups)); if (info->groups == NULL) { + info->groupNum = 0; FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } } @@ -2780,6 +2789,7 @@ int32_t filterConvertGroupFromArray(SFilterInfo *info, SArray *group) { } pg->unitFlags = taosMemoryCalloc(pg->unitNum, sizeof(*pg->unitFlags)); if (pg->unitFlags == NULL) { + pg->unitNum = 0; FLT_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } info->groups[i] = *pg; @@ -2855,10 +2865,9 @@ int32_t filterRewrite(SFilterInfo *info, SFilterGroupCtx **gRes, int32_t gResNum } } } + FLT_ERR_JRET(filterConvertGroupFromArray(info, group)); _return: - FLT_ERR_RET(filterConvertGroupFromArray(info, group)); - taosArrayDestroy(group); filterFreeInfo(&oinfo); diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 5db7aebeee..846837fd99 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -8,11 +8,13 @@ #include "ttime.h" typedef float (*_float_fn)(float); +typedef float (*_float_fn_2)(float, float); typedef double (*_double_fn)(double); typedef double (*_double_fn_2)(double, double); typedef int (*_conv_fn)(int); -typedef void (*_trim_fn)(char *, char *, int32_t, int32_t); -typedef uint16_t (*_len_fn)(char *, int32_t); +typedef void (*_trim_space_fn)(char *, char *, int32_t, int32_t); +typedef int32_t (*_trim_fn)(char *, char *, char *, int32_t, int32_t); +typedef int32_t (*_len_fn)(char *, int32_t, VarDataLenT *); /** Math functions **/ static double tlog(double v) { return log(v); } @@ -31,6 +33,14 @@ static double tlog2(double v, double base) { } } +static double degrees(double v) { + return v * M_1_PI * 180.0; +} + +static double radians(double v) { + return v / 180.0 * M_PI ; +} + int32_t absFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { SColumnInfoData *pInputData = pInput->columnData; SColumnInfoData *pOutputData = pOutput->columnData; @@ -132,6 +142,155 @@ int32_t absFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutpu return TSDB_CODE_SUCCESS; } +int32_t signFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + SColumnInfoData *pInputData = pInput->columnData; + SColumnInfoData *pOutputData = pOutput->columnData; + + int32_t type = GET_PARAM_TYPE(pInput); + + switch (type) { + case TSDB_DATA_TYPE_FLOAT: { + float *in = (float *)pInputData->pData; + float *out = (float *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (float)(in[i] < 0.0 ? -1 : (in[i] > 0.0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_DOUBLE: { + double *in = (double *)pInputData->pData; + double *out = (double *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (double)(in[i] < 0.0 ? -1 : (in[i] > 0.0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_TINYINT: { + int8_t *in = (int8_t *)pInputData->pData; + int8_t *out = (int8_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (int8_t)(in[i] < 0 ? -1 : (in[i] > 0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_SMALLINT: { + int16_t *in = (int16_t *)pInputData->pData; + int16_t *out = (int16_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (int16_t)(in[i] < 0 ? -1 : (in[i] > 0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_INT: { + int32_t *in = (int32_t *)pInputData->pData; + int32_t *out = (int32_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (int32_t)(in[i] < 0 ? -1 : (in[i] > 0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_BIGINT: { + int64_t *in = (int64_t *)pInputData->pData; + int64_t *out = (int64_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (int64_t)(in[i] < 0 ? -1 : (in[i] > 0 ? 1 : 0)); + } + break; + } + + case TSDB_DATA_TYPE_UTINYINT: { + uint8_t *in = (uint8_t *)pInputData->pData; + uint8_t *out = (uint8_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (uint8_t)(in[i] > 0 ? 1 : 0); + } + break; + } + case TSDB_DATA_TYPE_USMALLINT: { + uint16_t *in = (uint16_t *)pInputData->pData; + uint16_t *out = (uint16_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (uint16_t)(in[i] > 0 ? 1 : 0); + } + break; + } + case TSDB_DATA_TYPE_UINT: { + uint32_t *in = (uint32_t *)pInputData->pData; + uint32_t *out = (uint32_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (uint32_t)(in[i] > 0 ? 1 : 0); + } + break; + } + case TSDB_DATA_TYPE_UBIGINT: { + uint64_t *in = (uint64_t *)pInputData->pData; + uint64_t *out = (uint64_t *)pOutputData->pData; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + out[i] = (uint64_t)(in[i] > 0 ? 1 : 0); + } + break; + } + case TSDB_DATA_TYPE_NULL: { + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + colDataSetNULL(pOutputData, i); + } + break; + } + + default: { + SCL_ERR_RET(TSDB_CODE_FUNC_FUNTION_PARA_TYPE); + } + } + + pOutput->numOfRows = pInput->numOfRows; + return TSDB_CODE_SUCCESS; +} + static int32_t doScalarFunctionUnique(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, _double_fn valFn) { int32_t type = GET_PARAM_TYPE(pInput); @@ -298,17 +457,49 @@ static int32_t doScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarP } /** String functions **/ -static VarDataLenT tlength(char *input, int32_t type) { return varDataLen(input); } +static int32_t tlength(char *input, int32_t type, VarDataLenT *len) { + *len = varDataLen(input); + return TSDB_CODE_SUCCESS; +} -static VarDataLenT tcharlength(char *input, int32_t type) { - if (type == TSDB_DATA_TYPE_VARCHAR || type == TSDB_DATA_TYPE_GEOMETRY) { - return varDataLen(input); - } else { // NCHAR - return varDataLen(input) / TSDB_NCHAR_SIZE; +uint8_t getCharLen(const unsigned char *str) { + if (strcasecmp(tsCharset, "UTF-8") != 0) { + return 1; + } + if ((str[0] & 0x80) == 0) { + return 1; + } else if ((str[0] & 0xE0) == 0xC0) { + return 2; + } else if ((str[0] & 0xF0) == 0xE0) { + return 3; + } else if ((str[0] & 0xF8) == 0xF0) { + return 4; + } else { + return 1; } } -static void tltrim(char *input, char *output, int32_t type, int32_t charLen) { +static int32_t tcharlength(char *input, int32_t type, VarDataLenT *len) { + if (type == TSDB_DATA_TYPE_VARCHAR) { + // calculate the number of characters in the string considering the multi-byte character + char *str = varDataVal(input); + VarDataLenT strLen = 0; + VarDataLenT pos = 0; + while(pos < varDataLen(input)) { + strLen++; + pos += getCharLen((unsigned char *)(str + pos)); + } + *len = strLen; + return TSDB_CODE_SUCCESS; + } else if (type == TSDB_DATA_TYPE_GEOMETRY) { + *len = varDataLen(input); + } else { // NCHAR + *len = varDataLen(input) / TSDB_NCHAR_SIZE; + } + return TSDB_CODE_SUCCESS; +} + +static void tltrimspace(char *input, char *output, int32_t type, int32_t charLen) { int32_t numOfSpaces = 0; if (type == TSDB_DATA_TYPE_VARCHAR) { for (int32_t i = 0; i < charLen; ++i) { @@ -338,7 +529,160 @@ static void tltrim(char *input, char *output, int32_t type, int32_t charLen) { varDataSetLen(output, resLen); } -static void trtrim(char *input, char *output, int32_t type, int32_t charLen) { +static void tlrtrimspace(char *input, char *output, int32_t type, int32_t charLen) { + int32_t numOfLeftSpaces = 0; + int32_t numOfRightSpaces = 0; + if (type == TSDB_DATA_TYPE_VARCHAR) { + for (int32_t i = 0; i < charLen; ++i) { + if (!isspace(*(varDataVal(input) + i))) { + break; + } + numOfLeftSpaces++; + } + } else { // NCHAR + for (int32_t i = 0; i < charLen; ++i) { + if (!iswspace(*((uint32_t *)varDataVal(input) + i))) { + break; + } + numOfLeftSpaces++; + } + } + + if (type == TSDB_DATA_TYPE_VARCHAR) { + for (int32_t i = charLen - 1; i >= 0; --i) { + if (!isspace(*(varDataVal(input) + i))) { + break; + } + numOfRightSpaces++; + } + } else { // NCHAR + for (int32_t i = charLen - 1; i >= 0; --i) { + if (!iswspace(*((uint32_t *)varDataVal(input) + i))) { + break; + } + numOfRightSpaces++; + } + } + + int32_t resLen; + if (type == TSDB_DATA_TYPE_VARCHAR) { + resLen = charLen - (numOfLeftSpaces + numOfRightSpaces); + (void)memcpy(varDataVal(output), varDataVal(input) + numOfLeftSpaces, resLen); + } else { + resLen = (charLen - (numOfLeftSpaces + numOfRightSpaces)) * TSDB_NCHAR_SIZE; + (void)memcpy(varDataVal(output), varDataVal(input) + numOfLeftSpaces * TSDB_NCHAR_SIZE, resLen); + } + + varDataSetLen(output, resLen); +} + +static bool isCharStart(char c) { + return strcasecmp(tsCharset, "UTF-8") == 0 ? ((c & 0xC0) != 0x80) : true; +} + +static int32_t trimHelper(char *orgStr, char* remStr, int32_t orgLen, int32_t remLen, bool trimLeft) { + if (trimLeft) { + int32_t pos = 0; + for (int32_t i = 0; i < orgLen; i += remLen) { + if (memcmp(orgStr + i, remStr, remLen) == 0) { + if (isCharStart(orgStr[i + remLen])) { + pos = i + remLen; + continue; + } else { + return pos; + } + } else { + return pos; + } + } + return pos; + } else { + int32_t pos = orgLen; + for (int32_t i = orgLen - remLen; i >= 0; i -= remLen) { + if (memcmp(orgStr + i, remStr, remLen) == 0) { + if (isCharStart(orgStr[i])) { + pos = i; + continue; + } else { + return pos; + } + } else { + return pos; + } + } + return pos; + } +} + +static int32_t convVarcharToNchar(char *input, char **output, int32_t inputLen, int32_t *outputLen) { + *output = taosMemoryCalloc(inputLen * TSDB_NCHAR_SIZE, 1); + if (NULL == *output) { + return TSDB_CODE_OUT_OF_MEMORY; + } + bool ret = taosMbsToUcs4(input, inputLen, (TdUcs4 *)*output, inputLen * TSDB_NCHAR_SIZE, outputLen); + if (!ret) { + taosMemoryFreeClear(*output); + return TSDB_CODE_SCALAR_CONVERT_ERROR; + } + return TSDB_CODE_SUCCESS; +} + +static int32_t convNcharToVarchar(char *input, char **output, int32_t inputLen, int32_t *outputLen) { + *output = taosMemoryCalloc(inputLen, 1); + if (NULL == *output) { + return TSDB_CODE_OUT_OF_MEMORY; + } + *outputLen = taosUcs4ToMbs((TdUcs4 *)input, inputLen, *output); + if (*outputLen < 0) { + taosMemoryFree(*output); + return TSDB_CODE_SCALAR_CONVERT_ERROR; + } + return TSDB_CODE_SUCCESS; +} + +static int32_t convBetweenNcharAndVarchar(char *input, char **output, int32_t inputLen, int32_t *outputLen, int32_t wantType) { + if (wantType == TSDB_DATA_TYPE_NCHAR) { + return convVarcharToNchar(input, output, inputLen, outputLen); + } else { + return convNcharToVarchar(input, output, inputLen, outputLen); + } +} +static int32_t tltrim(char *input, char *remInput, char *output, int32_t inputType, int32_t remType) { + int32_t orgLen = varDataLen(input); + char *orgStr = varDataVal(input); + int32_t remLen = varDataLen(remInput); + char *remStr = varDataVal(remInput); + if (orgLen == 0) { + varDataSetLen(output, 0); + return TSDB_CODE_SUCCESS; + } + int32_t pos = 0; + + bool needFree = false; + if (inputType != remType) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(remInput), &remStr, varDataLen(remInput), &remLen, inputType)); + needFree = true; + } + + if (remLen == 0 || remLen > orgLen) { + (void)memcpy(varDataVal(output), orgStr, orgLen); + varDataSetLen(output, orgLen); + return TSDB_CODE_SUCCESS; + } + + pos = trimHelper(orgStr, remStr, orgLen, remLen, true); + + if (needFree) { + taosMemoryFree(remStr); + } + + int32_t resLen = orgLen - pos; + (void)memcpy(varDataVal(output), orgStr + pos, resLen); + varDataSetLen(output, resLen); + return TSDB_CODE_SUCCESS; +} + +static void trtrimspace(char *input, char *output, int32_t type, int32_t charLen) { int32_t numOfSpaces = 0; if (type == TSDB_DATA_TYPE_VARCHAR) { for (int32_t i = charLen - 1; i >= 0; --i) { @@ -367,6 +711,79 @@ static void trtrim(char *input, char *output, int32_t type, int32_t charLen) { varDataSetLen(output, resLen); } +static int32_t trtrim(char *input, char *remInput, char *output, int32_t inputType, int32_t remType) { + int32_t orgLen = varDataLen(input); + char *orgStr = varDataVal(input); + int32_t remLen = varDataLen(remInput); + char *remStr = varDataVal(remInput); + if (orgLen == 0) { + varDataSetLen(output, 0); + return TSDB_CODE_SUCCESS; + } + int32_t pos = 0; + bool needFree = false; + + if (inputType != remType) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(remInput), &remStr, varDataLen(remInput), &remLen, inputType)); + needFree = true; + } + + if (remLen == 0 || remLen > orgLen) { + (void)memcpy(varDataVal(output), orgStr, orgLen); + varDataSetLen(output, orgLen); + return TSDB_CODE_SUCCESS; + } + + pos = trimHelper(orgStr, remStr, orgLen, remLen, false); + + if (needFree) { + taosMemoryFree(remStr); + } + + (void)memcpy(varDataVal(output), orgStr, pos); + varDataSetLen(output, pos); + return TSDB_CODE_SUCCESS; +} + +static int32_t tlrtrim(char *input, char *remInput, char *output, int32_t inputType, int32_t remType) { + int32_t orgLen = varDataLen(input); + char *orgStr = varDataVal(input); + int32_t remLen = varDataLen(remInput); + char *remStr = varDataVal(remInput); + if (orgLen == 0) { + varDataSetLen(output, 0); + return TSDB_CODE_SUCCESS; + } + + bool needFree = false; + + if (inputType != remType) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(remInput), &remStr, varDataLen(remInput), &remLen, inputType)); + needFree = true; + } + + if (remLen == 0 || remLen > orgLen) { + (void)memcpy(varDataVal(output), orgStr, orgLen); + varDataSetLen(output, orgLen); + return TSDB_CODE_SUCCESS; + } + + int32_t leftPos = trimHelper(orgStr, remStr, orgLen, remLen, true); + int32_t rightPos = trimHelper(orgStr, remStr, orgLen, remLen, false); + + if (needFree) { + taosMemoryFree(remStr); + } + + if (leftPos >= rightPos) { + varDataSetLen(output, 0); + return TSDB_CODE_SUCCESS; + } + (void)memcpy(varDataVal(output), orgStr + leftPos, rightPos - leftPos); + varDataSetLen(output, rightPos - leftPos); + return TSDB_CODE_SUCCESS; +} + static int32_t doLengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, _len_fn lenFn) { int32_t type = GET_PARAM_TYPE(pInput); @@ -382,7 +799,7 @@ static int32_t doLengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarP } char *in = colDataGetData(pInputData, i); - out[i] = lenFn(in, type); + SCL_ERR_RET(lenFn(in, type, (VarDataLenT *)&(out[i]))); } pOutput->numOfRows = pInput->numOfRows; @@ -645,53 +1062,123 @@ static int32_t doCaseConvFunction(SScalarParam *pInput, int32_t inputNum, SScala return TSDB_CODE_SUCCESS; } -static int32_t doTrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, _trim_fn trimFn) { - int32_t type = GET_PARAM_TYPE(pInput); - - SColumnInfoData *pInputData = pInput->columnData; - SColumnInfoData *pOutputData = pOutput->columnData; - - int32_t outputLen = pInputData->varmeta.length; - char *outputBuf = taosMemoryCalloc(outputLen, 1); +static int32_t doTrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, _trim_space_fn trimSpaceFn, _trim_fn trimFn) { + int32_t code = TSDB_CODE_SUCCESS; + SColumnInfoData *pInputData[2]; + SColumnInfoData *pOutputData = pOutput[0].columnData; + int32_t outputLen; + int32_t numOfRows; + pInputData[0] = pInput[0].columnData; + if (inputNum == 3) { + pInputData[1] = pInput[1].columnData; + outputLen = pInputData[1]->info.bytes; + numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + } else { + outputLen = pInputData[0]->info.bytes; + numOfRows = pInput[0].numOfRows; + } + char *outputBuf = taosMemoryCalloc(outputLen, 1); if (outputBuf == NULL) { SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } char *output = outputBuf; - for (int32_t i = 0; i < pInput->numOfRows; ++i) { - if (colDataIsNull_s(pInputData, i)) { - colDataSetNULL(pOutputData, i); - continue; + if (inputNum == 3) { + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + + if (hasNullType || + (pInput[0].numOfRows == 1 && colDataIsNull_s(pInputData[0], 0)) || + (pInput[1].numOfRows == 1 && colDataIsNull_s(pInputData[1], 0))) { + colDataSetNNULL(pOutputData, 0, numOfRows); } - char *input = colDataGetData(pInputData, i); - int32_t len = varDataLen(input); - int32_t charLen = (type == TSDB_DATA_TYPE_VARCHAR) ? len : len / TSDB_NCHAR_SIZE; - trimFn(input, output, type, charLen); - - int32_t code = colDataSetVal(pOutputData, i, output, false); - if (TSDB_CODE_SUCCESS != code) { - taosMemoryFree(outputBuf); - SCL_ERR_RET(code); + for (int32_t i = 0; i < numOfRows; ++i) { + int32_t colIdx1 = (pInput[0].numOfRows == 1) ? 0 : i; + int32_t colIdx2 = (pInput[1].numOfRows == 1) ? 0 : i; + if (colDataIsNull_s(pInputData[0], colIdx1) || colDataIsNull_s(pInputData[1], colIdx2)) { + colDataSetNULL(pOutputData, i); + continue; + } + SCL_ERR_JRET(trimFn(colDataGetData(pInputData[1], colIdx2), colDataGetData(pInputData[0], colIdx1), + output, GET_PARAM_TYPE(&pInput[1]), GET_PARAM_TYPE(&pInput[0]))); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, output, false)); + } + } else { + for (int32_t i = 0; i < numOfRows; ++i) { + if (colDataIsNull_s(pInputData[0], i)) { + colDataSetNULL(pOutputData, i); + continue; + } + int32_t type = GET_PARAM_TYPE(pInput); + char *input = colDataGetData(pInputData[0], i); + int32_t len = varDataLen(input); + int32_t charLen = (type == TSDB_DATA_TYPE_VARCHAR) ? len : len / TSDB_NCHAR_SIZE; + trimSpaceFn(input, output, type, charLen); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, output, false)); } - output += varDataTLen(output); } - - pOutput->numOfRows = pInput->numOfRows; + pOutput->numOfRows = numOfRows; +_return: taosMemoryFree(outputBuf); + return code; +} - return TSDB_CODE_SUCCESS; +static int32_t findPosBytes(char *orgStr, char *delimStr, int32_t orgLen, int32_t delimLen, int32_t charNums) { + int32_t charCount = 0; + if (charNums > 0) { + for (int32_t pos = 0; pos < orgLen; pos++) { + if (delimStr) { + if (isCharStart(orgStr[pos]) && memcmp(orgStr + pos, delimStr, delimLen) == 0) { + charCount++; + if (charCount == charNums) { + return pos; + } + pos = pos + delimLen - 1; + } + } else { + if (isCharStart(orgStr[pos])) { + charCount++; + if (charCount == charNums) { + return pos; + } + } + } + } + return orgLen; + } else { + if (delimStr) { + for (int32_t pos = orgLen - 1; pos >= 0; pos--) { + if (isCharStart(orgStr[pos]) && memcmp(orgStr + pos, delimStr, delimLen) == 0) { + charCount++; + if (charCount == -charNums) { + return pos + delimLen; + } + pos = pos - delimLen + 1; + } + } + } else { + for (int32_t pos = orgLen - 1; pos >= 0; pos--) { + if (isCharStart(orgStr[pos])) { + charCount++; + if (charCount == -charNums) { + return pos; + } + } + } + } + return 0; + } } int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; int32_t subPos = 0; GET_TYPED_DATA(subPos, int32_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); int32_t subLen = INT16_MAX; if (inputNum == 3) { GET_TYPED_DATA(subLen, int32_t, GET_PARAM_TYPE(&pInput[2]), pInput[2].columnData->pData); - subLen = (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) ? subLen : subLen * TSDB_NCHAR_SIZE; } SColumnInfoData *pInputData = pInput->columnData; @@ -709,21 +1196,33 @@ int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu colDataSetNULL(pOutputData, i); continue; } + if (subPos == 0 || subLen < 1) { + varDataSetLen(outputBuf, 0); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + continue; + } char *input = colDataGetData(pInput[0].columnData, i); int32_t len = varDataLen(input); int32_t startPosBytes; - + int32_t endPosBytes = len; if (subPos > 0) { - startPosBytes = (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) ? subPos - 1 : (subPos - 1) * TSDB_NCHAR_SIZE; + startPosBytes = (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) ? findPosBytes(varDataVal(input), NULL, varDataLen(input), -1, subPos) : (subPos - 1) * TSDB_NCHAR_SIZE; startPosBytes = TMIN(startPosBytes, len); } else { startPosBytes = - (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) ? len + subPos : len + subPos * TSDB_NCHAR_SIZE; + (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) ? findPosBytes(varDataVal(input), NULL, varDataLen(input), -1, subPos) : len + subPos * TSDB_NCHAR_SIZE; startPosBytes = TMAX(startPosBytes, 0); } + if (inputNum == 3) { + endPosBytes = + (GET_PARAM_TYPE(pInput) == TSDB_DATA_TYPE_VARCHAR) + ? startPosBytes + findPosBytes(varDataVal(input) + startPosBytes, NULL, varDataLen(input) - startPosBytes, -1, subLen + 1) + : startPosBytes + subLen * TSDB_NCHAR_SIZE; + endPosBytes = TMIN(endPosBytes, len); + } char *output = outputBuf; - int32_t resLen = TMIN(subLen, len - startPosBytes); + int32_t resLen = endPosBytes - startPosBytes; if (resLen > 0) { (void)memcpy(varDataVal(output), varDataVal(input) + startPosBytes, resLen); varDataSetLen(output, resLen); @@ -731,17 +1230,14 @@ int32_t substrFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOu varDataSetLen(output, 0); } - int32_t code = colDataSetVal(pOutputData, i, output, false); - if (TSDB_CODE_SUCCESS != code) { - taosMemoryFree(outputBuf); - SCL_ERR_RET(code); - } + SCL_ERR_JRET(colDataSetVal(pOutputData, i, output, false)); } pOutput->numOfRows = pInput->numOfRows; +_return: taosMemoryFree(outputBuf); - return TSDB_CODE_SUCCESS; + return code; } int32_t md5Function(SScalarParam* pInput, int32_t inputNum, SScalarParam* pOutput) { @@ -783,6 +1279,472 @@ int32_t md5Function(SScalarParam* pInput, int32_t inputNum, SScalarParam* pOutpu return TSDB_CODE_SUCCESS; } +static void getAsciiChar(int32_t num, char **output) { + if (num & 0xFF000000L) { + INT4TOCHAR(*output, num); + } else if (num & 0xFF0000L) { + INT3TOCHAR(*output, num); + } else if (num & 0xFF00L) { + INT2TOCHAR(*output, num); + } else { + INT1TOCHAR(*output, num); + } +} +int32_t charFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; + int32_t outputLen = inputNum * 4 + 2; + char *outputBuf = taosMemoryCalloc(outputLen, 1); + if (outputBuf == NULL) { + SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + for (int32_t i = 0; i < pInput[0].numOfRows; ++i) { + char *output = varDataVal(outputBuf); + for (int32_t j = 0; j < inputNum; ++j) { + int32_t num; + if (colDataIsNull_s(pInput[j].columnData, i)) { + continue; + } else if (IS_NUMERIC_TYPE(GET_PARAM_TYPE(&pInput[j]))) { + GET_TYPED_DATA(num, int32_t, GET_PARAM_TYPE(&pInput[j]), pInput[j].columnData->pData); + getAsciiChar(num, &output); + } else if (TSDB_DATA_TYPE_BINARY == GET_PARAM_TYPE(&pInput[j])) { + num = taosStr2Int32(varDataVal(pInput[j].columnData->pData), NULL, 10); + getAsciiChar(num, &output); + } else if (TSDB_DATA_TYPE_NCHAR == GET_PARAM_TYPE(&pInput[j])) { + char *convBuf = taosMemoryMalloc(GET_PARAM_BYTES(&pInput[j])); + int32_t len = taosUcs4ToMbs((TdUcs4 *)varDataVal(pInput[j].columnData->pData), varDataLen(pInput[j].columnData->pData), convBuf); + if (len < 0) { + code = TSDB_CODE_SCALAR_CONVERT_ERROR; + goto _return; + } + convBuf[len] = 0; + num = taosStr2Int32(convBuf, NULL, 10); + getAsciiChar(num, &output); + } else { + code = TSDB_CODE_FUNC_FUNTION_PARA_TYPE; + goto _return; + } + } + varDataSetLen(outputBuf, output - varDataVal(outputBuf)); + SCL_ERR_JRET(colDataSetVal(pOutput->columnData, i, outputBuf, false)); + } + pOutput->numOfRows = pInput->numOfRows; + +_return: + taosMemoryFree(outputBuf); + return code; +} + +int32_t asciiFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t type = GET_PARAM_TYPE(pInput); + + SColumnInfoData *pInputData = pInput->columnData; + SColumnInfoData *pOutputData = pOutput->columnData; + + uint8_t *out = (uint8_t *)pOutputData->pData; + + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + if (colDataIsNull_s(pInputData, i)) { + colDataSetNULL(pOutputData, i); + continue; + } + char *in = colDataGetData(pInputData, i); + out[i] = (uint8_t)(varDataVal(in))[0]; + } + + pOutput->numOfRows = pInput->numOfRows; + return TSDB_CODE_SUCCESS; +} + +static int32_t findPosChars(char *orgStr, char *delimStr, int32_t orgLen, int32_t delimLen, bool isUcs4) { + int32_t charCount = 0; + for (int32_t pos = 0; pos < orgLen; pos += isUcs4 ? TSDB_NCHAR_SIZE : 1) { + if (isUcs4 || isCharStart(orgStr[pos])) { + if (memcmp(orgStr + pos, delimStr, delimLen) == 0) { + return charCount + 1; + } else { + charCount++; + } + } + } + return 0; +} + +int32_t positionFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; + int32_t numOfRows = 0; + SColumnInfoData *pInputData[2]; + SColumnInfoData *pOutputData = pOutput[0].columnData; + + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + + if (hasNullType || + (pInput[0].numOfRows == 1 && colDataIsNull_s(pInputData[0], 0)) || + (pInput[1].numOfRows == 1 && colDataIsNull_s(pInputData[1], 0))) { + colDataSetNNULL(pOutputData, 0, numOfRows); + } + + for (int32_t i = 0; i < numOfRows; ++i) { + int32_t colIdx1 = (pInput[0].numOfRows == 1) ? 0 : i; + int32_t colIdx2 = (pInput[1].numOfRows == 1) ? 0 : i; + if (colDataIsNull_s(pInputData[0], colIdx1) || colDataIsNull_s(pInputData[1], colIdx2)) { + colDataSetNULL(pOutputData, i); + continue; + } + int64_t offset = 0; + if (varDataLen(colDataGetData(pInputData[0], colIdx1)) == 0) { + offset = 1; + colDataSetInt64(pOutputData, i, &offset); + continue; + } + + char *substr = varDataVal(colDataGetData(pInputData[0], colIdx1)); + char *orgstr = varDataVal(colDataGetData(pInputData[1], colIdx2)); + int32_t subLen = varDataLen(colDataGetData(pInputData[0], colIdx1)); + int32_t orgLen = varDataLen(colDataGetData(pInputData[1], colIdx2)); + bool needFreeSub = false; + if (GET_PARAM_TYPE(&pInput[1]) != GET_PARAM_TYPE(&pInput[0])) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[0], colIdx1)), &substr, varDataLen(colDataGetData(pInputData[0], colIdx1)), &subLen, GET_PARAM_TYPE(&pInput[1]))); + needFreeSub = true; + } + + offset = findPosChars(orgstr, substr, orgLen, subLen, GET_PARAM_TYPE(&pInput[1]) == TSDB_DATA_TYPE_NCHAR); + if (needFreeSub) { + taosMemoryFree(substr); + } + colDataSetInt64(pOutput->columnData, i, &offset); + } + + pOutput->numOfRows = numOfRows; + return code; +} + +int32_t trimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + // trim space + uint8_t trimType = 0; + GET_TYPED_DATA(trimType, int32_t, GET_PARAM_TYPE(&pInput[inputNum - 1]), pInput[inputNum - 1].columnData->pData); + switch (trimType) { + case TRIM_TYPE_LEADING: { + SCL_ERR_RET(doTrimFunction(pInput, inputNum, pOutput, tltrimspace, tltrim)); + break; + } + case TRIM_TYPE_TRAILING: { + SCL_ERR_RET(doTrimFunction(pInput, inputNum, pOutput, trtrimspace, trtrim)); + break; + } + case TRIM_TYPE_BOTH: { + SCL_ERR_RET(doTrimFunction(pInput, inputNum, pOutput, tlrtrimspace, tlrtrim)); + break; + } + } + return TSDB_CODE_SUCCESS; +} + +int32_t replaceFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; + SColumnInfoData *pInputData[3]; + SColumnInfoData *pOutputData = pOutput[0].columnData; + int32_t outputLen; + int32_t numOfRows = 0; + + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + pInputData[2] = pInput[2].columnData; + + for (int i = 0; i < 3; i++) { + numOfRows = TMAX(numOfRows, pInput[i].numOfRows); + } + + int8_t orgType = pInputData[0]->info.type; + int8_t fromType = pInputData[1]->info.type; + int8_t toType = pInputData[2]->info.type; + int32_t orgLength = pInputData[0]->info.bytes; + int32_t fromLength = pInputData[1]->info.bytes; + int32_t toLength = pInputData[2]->info.bytes; + + if (orgType == TSDB_DATA_TYPE_VARBINARY && fromType != orgType) { + fromLength = fromLength / TSDB_NCHAR_SIZE; + } + if (orgType == TSDB_DATA_TYPE_NCHAR && toType != orgType) { + toLength = toLength * TSDB_NCHAR_SIZE; + } + outputLen = TMAX(orgLength, orgLength + orgLength / fromLength * (toLength - fromLength)); + + if (GET_PARAM_TYPE(&pInput[0]) == TSDB_DATA_TYPE_NULL || + GET_PARAM_TYPE(&pInput[1]) == TSDB_DATA_TYPE_NULL || + GET_PARAM_TYPE(&pInput[2]) == TSDB_DATA_TYPE_NULL || + (pInput[0].numOfRows == 1 && colDataIsNull_s(pInputData[0], 0)) || + (pInput[1].numOfRows == 1 && colDataIsNull_s(pInputData[1], 0)) || + (pInput[2].numOfRows == 1 && colDataIsNull_s(pInputData[2], 0))) { + colDataSetNNULL(pOutputData, 0, numOfRows); + pOutput->numOfRows = numOfRows; + return TSDB_CODE_SUCCESS; + } + + char *outputBuf = taosMemoryCalloc(outputLen + VARSTR_HEADER_SIZE, 1); + if (NULL == outputBuf) { + SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + for (int32_t i = 0; i < numOfRows; ++i) { + int32_t colIdx1 = (pInput[0].numOfRows == 1) ? 0 : i; + int32_t colIdx2 = (pInput[1].numOfRows == 1) ? 0 : i; + int32_t colIdx3 = (pInput[2].numOfRows == 1) ? 0 : i; + if (colDataIsNull_s(pInputData[0], colIdx1) || colDataIsNull_s(pInputData[1], colIdx2) || colDataIsNull_s(pInputData[2], colIdx3)) { + colDataSetNULL(pOutputData, i); + continue; + } + char *output = outputBuf + VARSTR_HEADER_SIZE; + int32_t totalLen = 0; + + char *orgStr = varDataVal(colDataGetData(pInputData[0], i)); + int32_t orgLen = varDataLen(colDataGetData(pInputData[0], i)); + char *fromStr = varDataVal(colDataGetData(pInputData[1], colIdx2)); + int32_t fromLen = varDataLen(colDataGetData(pInputData[1], colIdx2)); + char *toStr = varDataVal(colDataGetData(pInputData[2], colIdx3)); + int32_t toLen = varDataLen(colDataGetData(pInputData[2], colIdx3)); + bool needFreeFrom = false; + bool needFreeTo = false; + + if (GET_PARAM_TYPE(&pInput[1]) != GET_PARAM_TYPE(&pInput[0])) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[1], colIdx2)), &fromStr, + varDataLen(colDataGetData(pInputData[1], colIdx2)), &fromLen, + GET_PARAM_TYPE(&pInput[0]))); + needFreeFrom = true; + } + if (GET_PARAM_TYPE(&pInput[2]) != GET_PARAM_TYPE(&pInput[0])) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[2], colIdx3)), &toStr, + varDataLen(colDataGetData(pInputData[2], colIdx3)), &toLen, + GET_PARAM_TYPE(&pInput[0]))); + needFreeTo = true; + } + + int32_t pos = 0; + while (pos < orgLen) { + if (memcmp(orgStr + pos, fromStr, fromLen) == 0) { + (void)memcpy(output, toStr, toLen); + output += toLen; + pos += fromLen; + totalLen += toLen; + } else { + int32_t charLen = GET_PARAM_TYPE(&pInput[0]) == TSDB_DATA_TYPE_NCHAR ? TSDB_NCHAR_SIZE : getCharLen(orgStr + pos); + (void)memcpy(output, orgStr + pos, charLen); + output += charLen; + totalLen += charLen; + pos += charLen; + } + } + if (needFreeTo) { + taosMemoryFree(toStr); + } + if (needFreeFrom) { + taosMemoryFree(fromStr); + } + varDataSetLen(outputBuf, totalLen); + SCL_ERR_RET(colDataSetVal(pOutputData, i, outputBuf, false)); + } + pOutput->numOfRows = numOfRows; + return code; +} + +int32_t substrIdxFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; + SColumnInfoData *pInputData[3]; + SColumnInfoData *pOutputData = pOutput[0].columnData; + int32_t outputLen; + int32_t numOfRows; + + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + pInputData[2] = pInput[2].columnData; + + outputLen = pInputData[0]->info.bytes; + if (GET_PARAM_TYPE(&pInput[0]) == TSDB_DATA_TYPE_NULL || GET_PARAM_TYPE(&pInput[1]) == TSDB_DATA_TYPE_NULL || GET_PARAM_TYPE(&pInput[2]) == TSDB_DATA_TYPE_NULL) { + colDataSetNNULL(pOutputData, 0, pInput[0].numOfRows); + pOutput->numOfRows = pInput[0].numOfRows; + return TSDB_CODE_SUCCESS; + } + char *outputBuf = taosMemoryCalloc(outputLen + VARSTR_HEADER_SIZE, 1); + if (NULL == outputBuf) { + SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + for (int32_t i = 0; i < inputNum; ++i) { + if (pInput[i].numOfRows > numOfRows) { + numOfRows = pInput[i].numOfRows; + } + } + + for (int32_t k = 0; k < numOfRows; ++k) { + bool hasNull = false; + for (int32_t i = 0; i < inputNum; ++i) { + if (colDataIsNull_s(pInputData[i], k) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[i]))) { + colDataSetNULL(pOutputData, k); + continue; + } + } + + int32_t colIdx1 = (pInput[0].numOfRows == 1) ? 0 : k; + int32_t colIdx2 = (pInput[1].numOfRows == 1) ? 0 : k; + int32_t count = 0; + char *orgStr = varDataVal(colDataGetData(pInputData[0], colIdx1)); + int32_t orgLen = varDataLen(colDataGetData(pInputData[0], colIdx1)); + char *delimStr = varDataVal(colDataGetData(pInputData[1], colIdx2)); + int32_t delimLen = varDataLen(colDataGetData(pInputData[1], colIdx2)); + bool needFreeDelim = false; + GET_TYPED_DATA(count, int32_t, GET_PARAM_TYPE(&pInput[2]), colDataGetData(pInputData[2], (pInput[2].numOfRows == 1) ? 0 : k)); + + int32_t startPosBytes; + int32_t endPosBytes; + if (GET_PARAM_TYPE(&pInput[0]) != GET_PARAM_TYPE(&pInput[1])) { + SCL_ERR_RET(convBetweenNcharAndVarchar(varDataVal(colDataGetData(pInputData[1], colIdx2)), &delimStr, + varDataLen(colDataGetData(pInputData[1], colIdx2)), &delimLen, + GET_PARAM_TYPE(&pInput[0]))); + needFreeDelim = true; + } + + if (count > 0) { + startPosBytes = 0; + endPosBytes = findPosBytes(orgStr, delimStr, orgLen, delimLen, count); + } else if (count < 0) { + startPosBytes = findPosBytes(orgStr, delimStr, orgLen, delimLen, count); + endPosBytes = orgLen; + } else { + startPosBytes = endPosBytes = 0; + } + + char *output = outputBuf; + int32_t resLen = endPosBytes - startPosBytes; + if (resLen > 0) { + (void)memcpy(varDataVal(output), orgStr + startPosBytes, resLen); + varDataSetLen(output, resLen); + } else { + varDataSetLen(output, 0); + } + if (needFreeDelim) { + taosMemoryFree(delimStr); + } + + SCL_ERR_JRET(colDataSetVal(pOutputData, k, output, false)); + } + +_return: + pOutput->numOfRows = numOfRows; + return code; +} + +static int32_t repeatStringHelper(char *input, int32_t inputLen, int32_t count, char *output) { + for (int32_t i = 0; i < count; ++i) { + (void)memcpy(output, input, inputLen); + output += inputLen; + } + return TSDB_CODE_SUCCESS; +} + +int32_t repeatFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int32_t code = TSDB_CODE_SUCCESS; + SColumnInfoData *pInputData[2]; + SColumnInfoData *pOutputData = pOutput[0].columnData; + int32_t outputLen; + int32_t numOfRows; + int32_t maxCount = 0; + + for (int32_t i = 0; i < pInput[1].numOfRows; i++) { + int32_t tmpCount = 0; + GET_TYPED_DATA(tmpCount, int32_t, GET_PARAM_TYPE(&pInput[1]), colDataGetData(pInput[1].columnData, i)); + maxCount = TMAX(maxCount, tmpCount); + } + pInputData[0] = pInput[0].columnData; + pInputData[1] = pInput[1].columnData; + outputLen = (int32_t)(pInputData[0]->info.bytes * maxCount + VARSTR_HEADER_SIZE); + if (outputLen > TSDB_MAX_FIELD_LEN) { + return TSDB_CODE_FUNC_INVALID_RES_LENGTH; + } + numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + char *outputBuf = taosMemoryCalloc(outputLen, 1); + if (outputBuf == NULL) { + SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); + } + + char *output = outputBuf; + + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + if (pInput[0].numOfRows == pInput[1].numOfRows) { + for (int32_t i = 0; i < numOfRows; ++i) { + output = outputBuf; + if (colDataIsNull_s(pInputData[0], i) || colDataIsNull_s(pInputData[1], i) || hasNullType) { + colDataSetNULL(pOutputData, i); + continue; + } + int32_t count = 0; + GET_TYPED_DATA(count, int32_t, GET_PARAM_TYPE(&pInput[1]), colDataGetData(pInput[1].columnData, i)); + if (count <= 0) { + varDataSetLen(output, 0); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } else { + char *orgStr = colDataGetData(pInputData[0], i); + varDataSetLen(output, varDataLen(orgStr) * count); + SCL_ERR_JRET(repeatStringHelper(varDataVal(orgStr), varDataLen(orgStr), count, varDataVal(output))); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } + } + } else if (pInput[0].numOfRows == 1) { + if (colDataIsNull_s(pInputData[0], 0) || hasNullType) { + colDataSetNNULL(pOutputData, 0, pInput[1].numOfRows); + } else { + for (int32_t i = 0; i < numOfRows; ++i) { + output = outputBuf; + if (colDataIsNull_s(pInputData[1], i)) { + colDataSetNULL(pOutputData, i); + continue; + } + int32_t count = 0; + GET_TYPED_DATA(count, int32_t, GET_PARAM_TYPE(&pInput[1]), colDataGetData(pInput[1].columnData, i)); + if (count <= 0) { + varDataSetLen(output, 0); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } else { + char *orgStr = colDataGetData(pInputData[0], 0); + varDataSetLen(output, varDataLen(orgStr) * count); + SCL_ERR_JRET(repeatStringHelper(varDataVal(orgStr), varDataLen(orgStr), count, varDataVal(output))); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } + } + } + } else if (pInput[1].numOfRows == 1) { + if (colDataIsNull_s(pInputData[1], 0) || hasNullType) { + colDataSetNNULL(pOutputData, 0, pInput[0].numOfRows); + } else { + for (int32_t i = 0; i < numOfRows; ++i) { + output = outputBuf; + if (colDataIsNull_s(pInputData[0], i)) { + colDataSetNULL(pOutputData, i); + continue; + } + int32_t count = 0; + GET_TYPED_DATA(count, int32_t, GET_PARAM_TYPE(&pInput[1]), colDataGetData(pInput[1].columnData, i)); + if (count <= 0) { + varDataSetLen(output, 0); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } else { + char *orgStr = colDataGetData(pInputData[0], i); + varDataSetLen(output, varDataLen(orgStr) * count); + SCL_ERR_JRET(repeatStringHelper(varDataVal(orgStr), varDataLen(orgStr), count, varDataVal(output))); + SCL_ERR_JRET(colDataSetVal(pOutputData, i, outputBuf, false)); + } + } + } + } + + pOutput->numOfRows = numOfRows; +_return: + taosMemoryFree(outputBuf); + return code; +} + /** Conversion functions **/ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int16_t inputType = GET_PARAM_TYPE(&pInput[0]); @@ -1535,7 +2497,7 @@ int32_t timeDiffFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p continue; } - int64_t result = (timeVal[0] >= timeVal[1]) ? (timeVal[0] - timeVal[1]) : (timeVal[1] - timeVal[0]); + int64_t result = timeVal[0] - timeVal[1]; if (timeUnit < 0) { // if no time unit given use db precision switch (timePrec) { @@ -1636,6 +2598,172 @@ int32_t timezoneFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p return TSDB_CODE_SUCCESS; } +int32_t weekdayFunctionImpl(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, bool startFromZero) { + int32_t type = GET_PARAM_TYPE(&pInput[0]); + + int64_t timePrec, timeVal = 0; + + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + + for (int32_t i = 0; i < pInput[0].numOfRows; ++i) { + if (colDataIsNull_s(pInput[0].columnData, i)) { + colDataSetNULL(pOutput->columnData, i); + continue; + } + + char *input = colDataGetData(pInput[0].columnData, i); + + if (IS_VAR_DATA_TYPE(type)) { /* datetime format strings */ + int32_t ret = convertStringToTimestamp(type, input, timePrec, &timeVal); + if (ret != TSDB_CODE_SUCCESS) { + colDataSetNULL(pOutput->columnData, i); + continue; + } + } else if (type == TSDB_DATA_TYPE_BIGINT) { /* unix timestamp */ + GET_TYPED_DATA(timeVal, int64_t, type, input); + } else if (type == TSDB_DATA_TYPE_TIMESTAMP) { /* timestamp column*/ + GET_TYPED_DATA(timeVal, int64_t, type, input); + } + struct STm tm; + TAOS_CHECK_RETURN(taosTs2Tm(timeVal, timePrec, &tm)); + int32_t ret = startFromZero ? (tm.tm.tm_wday + 6) % 7 : tm.tm.tm_wday + 1; + SCL_ERR_RET(colDataSetVal(pOutput->columnData, i, (const char*)&ret, false)); + } + + pOutput->numOfRows = pInput->numOfRows; + + return TSDB_CODE_SUCCESS; +} + +int32_t weekdayFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return weekdayFunctionImpl(pInput, inputNum, pOutput, true); +} + +int32_t dayofweekFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return weekdayFunctionImpl(pInput, inputNum, pOutput, false); +} + +// calculate day number from 0000-00-00 +static int32_t getDayNum(int32_t year, int32_t month, int32_t day) { + int32_t delsum; + int32_t temp; + int32_t y = year; + + if (y == 0 && month == 0) { + return 0; + } + + delsum = 365 * y + 31 * (month - 1) + day; + if (month <= 2) + y--; + else + delsum -= (month * 4 + 23) / 10; + temp = ((y / 100 + 1) * 3) / 4; + return (delsum + y / 4 - temp); +} + +static int32_t getDaysInYear(int32_t year) { + return (((year % 100) == 0) ? ((year % 400) == 0) : ((year % 4) == 0)) ? 366 : 365; +} + +static int32_t getWeekday(int32_t daynr, bool sundayFirstDay) { + return (daynr + 5 + (sundayFirstDay ? 1 : 0)) % 7; +} + +static int32_t calculateWeekNum(struct tm date, int32_t weekFlag) { + int32_t days; + int32_t year = date.tm_year + 1900; + int32_t month = date.tm_mon + 1; + int32_t day = date.tm_mday; + int32_t dayNum = getDayNum(year, month, day); + int32_t firstDayNum = getDayNum(year, 1, 1); + bool mondayFirst = (weekFlag & WEEK_FLAG_MONDAY_FIRST); + bool weekStartFromOne = (weekFlag & WEEK_FLAG_FROM_ONE); + bool firstWeekday = (weekFlag & WEEK_FLAG_INCLUDE_FIRST_DAY); + + int32_t weekday = getWeekday(firstDayNum, !mondayFirst); + if (month == 1 && day <= 7 - weekday) { + if (!weekStartFromOne && ((firstWeekday && weekday != 0) || (!firstWeekday && weekday >= 4))) { + return 0; + } + weekStartFromOne = true; + days = getDaysInYear(--year); + firstDayNum -= days; + weekday = (weekday + 53 * 7 - days) % 7; + } + + if ((firstWeekday && weekday != 0) || (!firstWeekday && weekday >= 4)) + days = dayNum - (firstDayNum + (7 - weekday)); + else + days = dayNum - (firstDayNum - weekday); + + if (weekStartFromOne && days >= 52 * 7) { + weekday = (weekday + getDaysInYear(year)) % 7; + if ((!firstWeekday && weekday < 4) || (firstWeekday && weekday == 0)) { + return 1; + } + } + return days / 7 + 1; +} + +static int32_t weekMode(int32_t mode) { + return mode & WEEK_FLAG_MONDAY_FIRST ? mode : mode ^ WEEK_FLAG_INCLUDE_FIRST_DAY; +} + +int32_t weekFunctionImpl(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, int64_t prec, int32_t mode) { + int32_t type = GET_PARAM_TYPE(&pInput[0]); + + int64_t timeVal = 0; + + for (int32_t i = 0; i < pInput[0].numOfRows; ++i) { + if (colDataIsNull_s(pInput[0].columnData, i)) { + colDataSetNULL(pOutput->columnData, i); + continue; + } + + char *input = colDataGetData(pInput[0].columnData, i); + + if (IS_VAR_DATA_TYPE(type)) { /* datetime format strings */ + int32_t ret = convertStringToTimestamp(type, input, prec, &timeVal); + if (ret != TSDB_CODE_SUCCESS) { + colDataSetNULL(pOutput->columnData, i); + continue; + } + } else if (type == TSDB_DATA_TYPE_BIGINT) { /* unix timestamp */ + GET_TYPED_DATA(timeVal, int64_t, type, input); + } else if (type == TSDB_DATA_TYPE_TIMESTAMP) { /* timestamp column*/ + GET_TYPED_DATA(timeVal, int64_t, type, input); + } + struct STm tm; + SCL_ERR_RET(taosTs2Tm(timeVal, prec, &tm)); + int32_t ret = calculateWeekNum(tm.tm, weekMode(mode)); + SCL_ERR_RET(colDataSetVal(pOutput->columnData, i, (const char*)&ret, false)); + } + + pOutput->numOfRows = pInput->numOfRows; + + return TSDB_CODE_SUCCESS; +} + +int32_t weekFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int64_t timePrec; + int32_t mode = 0; + if (inputNum == 2) { + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + return weekFunctionImpl(pInput, inputNum, pOutput, timePrec, mode); + } else { + GET_TYPED_DATA(mode, int32_t , GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[2]), pInput[2].columnData->pData); + return weekFunctionImpl(pInput, inputNum, pOutput, timePrec, mode); + } +} + +int32_t weekofyearFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + int64_t timePrec; + GET_TYPED_DATA(timePrec, int64_t, GET_PARAM_TYPE(&pInput[1]), pInput[1].columnData->pData); + return weekFunctionImpl(pInput, inputNum, pOutput, timePrec, 3); +} + int32_t atanFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { return doScalarFunctionUnique(pInput, inputNum, pOutput, atan); } @@ -1684,8 +2812,294 @@ int32_t floorFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOut return doScalarFunction(pInput, inputNum, pOutput, floorf, floor); } +static double decimalFn(double val1, double val2, _double_fn fn) { + if (val1 > DBL_MAX || val1 < -DBL_MAX) { + return val1; + } + + double scale = pow(10, val2); + + if (val2 < 0) { + return fn(val1 * scale) / scale; + } else { + double scaled_number = val1 * scale; + + if (scaled_number > DBL_MAX || scaled_number < -DBL_MAX) { + return val1; + } + + return fn(scaled_number) / scale; + } +} + +static float decimalfFn(float val1, float val2, _float_fn fn) { + if (val1 > FLT_MAX || val1 < -FLT_MAX) { + return val1; + } + + float scale = powf(10, val2); + + if (val2 < 0) { + return fn(val1 * scale) / scale; + } else { + float scaled_number = val1 * scale; + + if (scaled_number > FLT_MAX || scaled_number < -FLT_MAX) { + return val1; + } + + return fn(scaled_number) / scale; + } +} + +static double roundFn(double val1, double val2) { + return decimalFn(val1, val2, round); +} + +static float roundfFn(float val1, float val2) { + return decimalfFn(val1, val2, roundf); +} + +static double truncFn(double val1, double val2) { + return decimalFn(val1, val2, trunc); +} + +static float truncfFn(float val1, float val2) { + return decimalfFn(val1, val2, truncf); +} + +static int32_t doScalarFunction2(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput, _float_fn_2 f1, + _double_fn_2 d1) { + SColumnInfoData *pInputData[2]; + SColumnInfoData *pOutputData = pOutput->columnData; + _getDoubleValue_fn_t getValueFn[2]; + + for (int32_t i = 0; i < inputNum; ++i) { + pInputData[i] = pInput[i].columnData; + getValueFn[i] = getVectorDoubleValueFn(GET_PARAM_TYPE(&pInput[i])); + } + + bool hasNullType = (IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[0])) || IS_NULL_TYPE(GET_PARAM_TYPE(&pInput[1]))); + + int32_t numOfRows = TMAX(pInput[0].numOfRows, pInput[1].numOfRows); + if (pInput[0].numOfRows == pInput[1].numOfRows) { + for (int32_t i = 0; i < numOfRows; ++i) { + if (colDataIsNull_s(pInputData[0], i) || colDataIsNull_s(pInputData[1], i) || hasNullType) { + colDataSetNULL(pOutputData, i); + continue; + } + switch (GET_PARAM_TYPE(&pInput[0])) { + case TSDB_DATA_TYPE_DOUBLE: { + double *in = (double *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + double *out = (double *)pOutputData->pData; + double result = d1(in[i], (double)in2[i]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_FLOAT: { + float *in = (float *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + float *out = (float *)pOutputData->pData; + float result = f1(in[i], (float)in2[i]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_TINYINT: + case TSDB_DATA_TYPE_SMALLINT: + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_BIGINT:{ + int64_t *in = (int64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + int64_t *out = (int64_t *)pOutputData->pData; + int64_t result = (int64_t)d1((double)in[i], (double)in2[i]); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UTINYINT: + case TSDB_DATA_TYPE_USMALLINT: + case TSDB_DATA_TYPE_UINT: + case TSDB_DATA_TYPE_UBIGINT:{ + uint64_t *in = (uint64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + uint64_t *out = (uint64_t *)pOutputData->pData; + uint64_t result = (uint64_t)d1((double)in[i], (double)in2[i]); + out[i] = result; + break; + } + } + } + } else if (pInput[0].numOfRows == 1) { // left operand is constant + if (colDataIsNull_s(pInputData[0], 0) || hasNullType) { + colDataSetNNULL(pOutputData, 0, pInput[1].numOfRows); + } else { + for (int32_t i = 0; i < numOfRows; ++i) { + if (colDataIsNull_s(pInputData[1], i)) { + colDataSetNULL(pOutputData, i); + continue; + } + switch (GET_PARAM_TYPE(&pInput[0])) { + case TSDB_DATA_TYPE_DOUBLE: { + double *in = (double *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + double *out = (double *)pOutputData->pData; + double result = d1(in[0], (double)in2[i]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_FLOAT: { + float *in = (float *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + float *out = (float *)pOutputData->pData; + float result = f1(in[0], (float)in2[i]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_TINYINT: + case TSDB_DATA_TYPE_SMALLINT: + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_BIGINT:{ + int64_t *in = (int64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + int64_t *out = (int64_t *)pOutputData->pData; + int64_t result = (int64_t)d1((double)in[0], (double)in2[i]); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UTINYINT: + case TSDB_DATA_TYPE_USMALLINT: + case TSDB_DATA_TYPE_UINT: + case TSDB_DATA_TYPE_UBIGINT:{ + uint64_t *in = (uint64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + uint64_t *out = (uint64_t *)pOutputData->pData; + uint64_t result = (uint64_t)d1((double)in[0], (double)in2[i]); + out[i] = result; + break; + } + } + } + } + } else if (pInput[1].numOfRows == 1) { + if (colDataIsNull_s(pInputData[1], 0) || hasNullType) { + colDataSetNNULL(pOutputData, 0, pInput[0].numOfRows); + } else { + for (int32_t i = 0; i < numOfRows; ++i) { + if (colDataIsNull_s(pInputData[0], i)) { + colDataSetNULL(pOutputData, i); + continue; + } + switch (GET_PARAM_TYPE(&pInput[0])) { + case TSDB_DATA_TYPE_DOUBLE: { + double *in = (double *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + double *out = (double *)pOutputData->pData; + double result = d1(in[i], (double)in2[0]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_FLOAT: { + float *in = (float *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + float *out = (float *)pOutputData->pData; + float result = f1(in[i], (float)in2[0]); + if (isinf(result) || isnan(result)) { + colDataSetNULL(pOutputData, i); + } else { + out[i] = result; + } + break; + } + case TSDB_DATA_TYPE_TINYINT: + case TSDB_DATA_TYPE_SMALLINT: + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_BIGINT:{ + int64_t *in = (int64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + int64_t *out = (int64_t *)pOutputData->pData; + int64_t result = (int64_t)d1((double)in[i], (double)in2[0]); + out[i] = result; + break; + } + case TSDB_DATA_TYPE_UTINYINT: + case TSDB_DATA_TYPE_USMALLINT: + case TSDB_DATA_TYPE_UINT: + case TSDB_DATA_TYPE_UBIGINT:{ + uint64_t *in = (uint64_t *)pInputData[0]->pData; + int64_t *in2 = (int64_t *)pInputData[1]->pData; + uint64_t *out = (uint64_t *)pOutputData->pData; + uint64_t result = (uint64_t)d1((double)in[i], (double)in2[0]); + out[i] = result; + break; + } + } + } + } + } + + pOutput->numOfRows = numOfRows; + return TSDB_CODE_SUCCESS; +} + int32_t roundFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - return doScalarFunction(pInput, inputNum, pOutput, roundf, round); + if (inputNum == 1) { + return doScalarFunction(pInput, inputNum, pOutput, roundf, round); + } else { + return doScalarFunction2(pInput, inputNum, pOutput, roundfFn, roundFn); + } +} + +int32_t truncFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunction2(pInput, inputNum, pOutput, truncfFn, truncFn); +} + +int32_t piFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + double_t value = M_PI; + for (int32_t i = 0; i < pInput->numOfRows; ++i) { + colDataSetDouble(pOutput->columnData, i, &value); + } + pOutput->numOfRows = pInput->numOfRows; + return TSDB_CODE_SUCCESS; +} + +int32_t expFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunctionUnique(pInput, inputNum, pOutput, exp); +} + +int32_t lnFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunctionUnique(pInput, inputNum, pOutput, tlog); +} + +int32_t modFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunctionUnique2(pInput, inputNum, pOutput, fmod); +} + +int32_t degreesFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunctionUnique(pInput, inputNum, pOutput, degrees); +} + +int32_t radiansFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { + return doScalarFunctionUnique(pInput, inputNum, pOutput, radians); } int32_t lowerFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { @@ -1705,11 +3119,11 @@ int32_t upperFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOut } int32_t ltrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - return doTrimFunction(pInput, inputNum, pOutput, tltrim); + return doTrimFunction(pInput, inputNum, pOutput, tltrimspace, tltrim); } int32_t rtrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { - return doTrimFunction(pInput, inputNum, pOutput, trtrim); + return doTrimFunction(pInput, inputNum, pOutput, trtrimspace, tltrim); } int32_t lengthFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { @@ -2070,7 +3484,7 @@ int32_t avgScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam * return TSDB_CODE_SUCCESS; } -int32_t stddevScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { +int32_t stdScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { SColumnInfoData *pInputData = pInput->columnData; SColumnInfoData *pOutputData = pOutput->columnData; diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index f953f50aa7..db1d61a023 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -818,7 +818,10 @@ int32_t walMetaDeserialize(SWal* pWal, const char* bytes) { int sz = cJSON_GetArraySize(pFiles); // deserialize SArray* pArray = pWal->fileInfoSet; - (void)taosArrayEnsureCap(pArray, sz); + if (taosArrayEnsureCap(pArray, sz)) { + cJSON_Delete(pRoot); + return terrno; + } for (int i = 0; i < sz; i++) { pInfoJson = cJSON_GetArrayItem(pFiles, i); @@ -841,7 +844,10 @@ int32_t walMetaDeserialize(SWal* pWal, const char* bytes) { pField = cJSON_GetObjectItem(pInfoJson, "fileSize"); if (!pField) goto _err; info.fileSize = atoll(cJSON_GetStringValue(pField)); - (void)taosArrayPush(pArray, &info); + if (!taosArrayPush(pArray, &info)) { + cJSON_Delete(pRoot); + return terrno; + } } pWal->fileInfoSet = pArray; pWal->writeCur = sz - 1; @@ -860,8 +866,8 @@ static int walFindCurMetaVer(SWal* pWal) { TdDirPtr pDir = taosOpenDir(pWal->path); if (pDir == NULL) { - wError("vgId:%d, path:%s, failed to open since %s", pWal->cfg.vgId, pWal->path, strerror(errno)); - return -1; + wError("vgId:%d, path:%s, failed to open since %s", pWal->cfg.vgId, pWal->path, tstrerror(terrno)); + return terrno; } TdDirEntryPtr pDirEntry; diff --git a/source/os/src/osTimezone.c b/source/os/src/osTimezone.c index b3f7c9a368..8fdd296655 100644 --- a/source/os/src/osTimezone.c +++ b/source/os/src/osTimezone.c @@ -798,7 +798,7 @@ int32_t taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, i memcpy(&winStr[3], pp, ppp - pp); indexStr = ppp - pp + 3; } - sprintf(&winStr[indexStr], "%c%c%c:%c%c:00", (p[0] == '+' ? '-' : '+'), p[1], p[2], p[3], p[4]); + sprintf(&winStr[indexStr], "%c%c%c:%c%c:00", (p[0] == '+' ? '+' : '-'), p[1], p[2], p[3], p[4]); *tsTimezone = -taosStr2Int32(p, NULL, 10); } else { *tsTimezone = 0; diff --git a/source/util/src/tbloomfilter.c b/source/util/src/tbloomfilter.c index cf9d5cd79c..b20fb4bf39 100644 --- a/source/util/src/tbloomfilter.c +++ b/source/util/src/tbloomfilter.c @@ -131,16 +131,16 @@ void tBloomFilterDestroy(SBloomFilter* pBF) { } int32_t tBloomFilterEncode(const SBloomFilter* pBF, SEncoder* pEncoder) { - if (tEncodeU32(pEncoder, pBF->hashFunctions) < 0) return -1; - if (tEncodeU64(pEncoder, pBF->expectedEntries) < 0) return -1; - if (tEncodeU64(pEncoder, pBF->numUnits) < 0) return -1; - if (tEncodeU64(pEncoder, pBF->numBits) < 0) return -1; - if (tEncodeU64(pEncoder, pBF->size) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeU32(pEncoder, pBF->hashFunctions)); + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pBF->expectedEntries)); + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pBF->numUnits)); + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pBF->numBits)); + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pBF->size)); for (uint64_t i = 0; i < pBF->numUnits; i++) { uint64_t* pUnits = (uint64_t*)pBF->buffer; - if (tEncodeU64(pEncoder, pUnits[i]) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pUnits[i])); } - if (tEncodeDouble(pEncoder, pBF->errorRate) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeDouble(pEncoder, pBF->errorRate)); return 0; } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 2f4414cd03..396abf21a7 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -92,7 +92,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_CFG_NOT_FOUND, "Config not found") TAOS_DEFINE_ERROR(TSDB_CODE_REPEAT_INIT, "Repeat initialization") TAOS_DEFINE_ERROR(TSDB_CODE_DUP_KEY, "Cannot add duplicate keys to hash") TAOS_DEFINE_ERROR(TSDB_CODE_NEED_RETRY, "Retry needed") -TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE, "Out of memory in rpc queue") +TAOS_DEFINE_ERROR(TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE, "Out of memory in queue") TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_TIMESTAMP, "Invalid timestamp format") TAOS_DEFINE_ERROR(TSDB_CODE_MSG_DECODE_ERROR, "Msg decode error") TAOS_DEFINE_ERROR(TSDB_CODE_MSG_ENCODE_ERROR, "Msg encode error") @@ -723,6 +723,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_TIME_UNIT_INVALID, "Invalid function tim TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_TIME_UNIT_TOO_SMALL, "Function time unit cannot be smaller than db precision") TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_INVALID_VALUE_RANGE, "Function got invalid value range") TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_SETUP_ERROR, "Function set up failed") +TAOS_DEFINE_ERROR(TSDB_CODE_FUNC_INVALID_RES_LENGTH, "Function result exceed max length") //udf TAOS_DEFINE_ERROR(TSDB_CODE_UDF_STOPPING, "udf is stopping") diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c index 87d5680aa0..780a6c94f1 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -19,8 +19,8 @@ #include "tlog.h" #include "tutil.h" -int64_t tsRpcQueueMemoryAllowed = 0; -int64_t tsRpcQueueMemoryUsed = 0; +int64_t tsQueueMemoryAllowed = 0; +int64_t tsQueueMemoryUsed = 0; struct STaosQueue { STaosQnode *head; @@ -148,10 +148,20 @@ int64_t taosQueueMemorySize(STaosQueue *queue) { } int32_t taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize, void **item) { - *item = NULL; + int64_t alloced = atomic_add_fetch_64(&tsQueueMemoryUsed, size + dataSize); + if (alloced > tsQueueMemoryAllowed) { + if (itype == RPC_QITEM) { + uError("failed to alloc qitem, size:%" PRId64 " alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, + tsQueueMemoryAllowed); + (void)atomic_sub_fetch_64(&tsQueueMemoryUsed, size + dataSize); + return (terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE); + } + } + *item = NULL; STaosQnode *pNode = taosMemoryCalloc(1, sizeof(STaosQnode) + size); if (pNode == NULL) { + (void)atomic_sub_fetch_64(&tsQueueMemoryUsed, size + dataSize); return terrno = TSDB_CODE_OUT_OF_MEMORY; } @@ -159,21 +169,7 @@ int32_t taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize, void ** pNode->size = size; pNode->itype = itype; pNode->timestamp = taosGetTimestampUs(); - - if (itype == RPC_QITEM) { - int64_t alloced = atomic_add_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); - if (alloced > tsRpcQueueMemoryAllowed) { - uError("failed to alloc qitem, size:%" PRId64 " alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, - tsRpcQueueMemoryAllowed); - (void)atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, size + dataSize); - taosMemoryFree(pNode); - return (terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE); - } - uTrace("item:%p, node:%p is allocated, alloc:%" PRId64, pNode->item, pNode, alloced); - } else { - uTrace("item:%p, node:%p is allocated", pNode->item, pNode); - } - + uTrace("item:%p, node:%p is allocated, alloc:%" PRId64, pNode->item, pNode, alloced); *item = pNode->item; return 0; } @@ -182,12 +178,8 @@ void taosFreeQitem(void *pItem) { if (pItem == NULL) return; STaosQnode *pNode = (STaosQnode *)((char *)pItem - sizeof(STaosQnode)); - if (pNode->itype == RPC_QITEM) { - int64_t alloced = atomic_sub_fetch_64(&tsRpcQueueMemoryUsed, pNode->size + pNode->dataSize); - uTrace("item:%p, node:%p is freed, alloc:%" PRId64, pItem, pNode, alloced); - } else { - uTrace("item:%p, node:%p is freed", pItem, pNode); - } + int64_t alloced = atomic_sub_fetch_64(&tsQueueMemoryUsed, pNode->size + pNode->dataSize); + uTrace("item:%p, node:%p is freed, alloc:%" PRId64, pItem, pNode, alloced); taosMemoryFree(pNode); } @@ -380,7 +372,7 @@ void taosQsetThreadResume(STaosQset *qset) { } int32_t taosAddIntoQset(STaosQset *qset, STaosQueue *queue, void *ahandle) { - if (queue->qset) return -1; + if (queue->qset) return TSDB_CODE_INVALID_PARA; (void)taosThreadMutexLock(&qset->mutex); diff --git a/source/util/src/tscalablebf.c b/source/util/src/tscalablebf.c index 80b633f5e8..c48cd38886 100644 --- a/source/util/src/tscalablebf.c +++ b/source/util/src/tscalablebf.c @@ -188,19 +188,19 @@ void tScalableBfDestroy(SScalableBf* pSBf) { int32_t tScalableBfEncode(const SScalableBf* pSBf, SEncoder* pEncoder) { if (!pSBf) { - if (tEncodeI32(pEncoder, 0) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeI32(pEncoder, 0)); return 0; } int32_t size = taosArrayGetSize(pSBf->bfArray); - if (tEncodeI32(pEncoder, size) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeI32(pEncoder, size)); for (int32_t i = 0; i < size; i++) { SBloomFilter* pBF = taosArrayGetP(pSBf->bfArray, i); - if (tBloomFilterEncode(pBF, pEncoder) < 0) return -1; + TAOS_CHECK_RETURN(tBloomFilterEncode(pBF, pEncoder)); } - if (tEncodeU32(pEncoder, pSBf->growth) < 0) return -1; - if (tEncodeU64(pEncoder, pSBf->numBits) < 0) return -1; - if (tEncodeU32(pEncoder, pSBf->maxBloomFilters) < 0) return -1; - if (tEncodeI8(pEncoder, pSBf->status) < 0) return -1; + TAOS_CHECK_RETURN(tEncodeU32(pEncoder, pSBf->growth)); + TAOS_CHECK_RETURN(tEncodeU64(pEncoder, pSBf->numBits)); + TAOS_CHECK_RETURN(tEncodeU32(pEncoder, pSBf->maxBloomFilters)); + TAOS_CHECK_RETURN(tEncodeI8(pEncoder, pSBf->status)); return 0; } diff --git a/source/util/src/tsched.c b/source/util/src/tsched.c index 04d903491b..6779e8dee5 100644 --- a/source/util/src/tsched.c +++ b/source/util/src/tsched.c @@ -189,12 +189,12 @@ int taosScheduleTask(void *queueScheduler, SSchedMsg *pMsg) { if (pSched == NULL) { uError("sched is not ready, msg:%p is dropped", pMsg); - return -1; + return TSDB_CODE_INVALID_PARA; } if (atomic_load_8(&pSched->stop)) { uError("sched is already stopped, msg:%p is dropped", pMsg); - return -1; + return TSDB_CODE_INVALID_PARA; } if ((ret = tsem_wait(&pSched->emptySem)) != 0) { diff --git a/source/util/src/tsimplehash.c b/source/util/src/tsimplehash.c index fddb3f354d..e39c7364b7 100644 --- a/source/util/src/tsimplehash.c +++ b/source/util/src/tsimplehash.c @@ -209,7 +209,7 @@ static int32_t tSimpleHashTableResize(SSHashObj *pHashObj) { int32_t tSimpleHashPut(SSHashObj *pHashObj, const void *key, size_t keyLen, const void *data, size_t dataLen) { if (!pHashObj || !key) { - return TSDB_CODE_FAILED; + return TSDB_CODE_INVALID_PARA; } uint32_t hashVal = (*pHashObj->hashFp)(key, (uint32_t)keyLen); diff --git a/tests/army/frame/common.py b/tests/army/frame/common.py index d11a0dbb4d..913e88a7ad 100644 --- a/tests/army/frame/common.py +++ b/tests/army/frame/common.py @@ -536,7 +536,7 @@ class TDCom: cur = self.newcur(host=host,port=port,user=user,password=password) newTdSql.init(cur, False) return newTdSql - + ################################################################################################################ # port from the common.py of new test frame ################################################################################################################ diff --git a/tests/army/query/fill/fill_compare_asc_desc.py b/tests/army/query/fill/fill_compare_asc_desc.py new file mode 100644 index 0000000000..0a80bb1a3a --- /dev/null +++ b/tests/army/query/fill/fill_compare_asc_desc.py @@ -0,0 +1,101 @@ +from frame.log import * +from frame.cases import * +from frame.sql import * +from frame.caseBase import * +from frame import * + + +class TDTestCase(TBase): + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), logSql) + + def prepare_data(self): + tdSql.execute("create database db;") + tdSql.execute("use db;") + # data for fill(prev) + tdSql.execute("create stable st_pre (ts timestamp, c1 int) tags(t1 int);") + tdSql.execute("create table ct1 using st_pre tags(1);") + start_ts = 1705783972000 + sql = "insert into ct1 values " + for i in range(100): + sql += f"({start_ts + i * 1000}, {str(i+1)})" + sql += ";" + tdSql.execute(sql) + + # data for fill(next) + tdSql.execute("create stable st_next (ts timestamp, c1 int) tags(t1 int);") + tdSql.execute("create table ct2 using st_next tags(1);") + start_ts = 1705783972000 + sql = "insert into ct1 values " + for i in range(100): + sql += f"({start_ts + i * 1000}, NULL)" + sql += ";" + tdSql.execute(sql) + + # data for fill(linear) + tdSql.execute("create stable st_linear (ts timestamp, c1 int) tags(t1 int);") + tdSql.execute("create table ct3 using st_linear tags(1);") + start_ts = 1705783972000 + sql = "insert into ct1 values " + for i in range(100): + if i % 2 == 0: + sql += f"({start_ts + i * 1000}, {str(i+1)})" + else: + sql += f"({start_ts + i * 1000}, NULL)" + sql += ";" + tdSql.execute(sql) + tdLog.info("prepare data done") + + def test_fill_pre_compare_asc_desc(self): + tdSql.execute("use db;") + for func in ["avg(c1)", "count(c1)", "first(c1)", "last(c1)", "max(c1)", "min(c1)", "sum(c1)"]: + tdSql.query(f"select _wstart, {func} from st_pre where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(prev) order by _wstart asc;") + res1 = tdSql.res + tdSql.query(f"select _wstart, {func} from st_pre where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(prev) order by _wstart desc;") + res2 = tdSql.res + assert len(res1) == len(res2) + for i in range(len(res1)): + assert res1[i] in res2 + tdLog.info(f"fill(prev) {func} compare asc and desc done") + tdLog.info("Finish the test case 'test_fill_pre_compare_asc_desc'") + + def test_fill_next_compare_asc_desc(self): + tdSql.execute("use db;") + for func in ["avg(c1)", "count(c1)", "first(c1)", "last(c1)", "max(c1)", "min(c1)", "sum(c1)"]: + tdSql.query(f"select _wstart, {func} from st_next where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(next) order by _wstart asc;") + res1 = tdSql.res + tdSql.query(f"select _wstart, {func} from st_next where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(next) order by _wstart desc;") + res2 = tdSql.res + assert len(res1) == len(res2) + for i in range(len(res1)): + assert res1[i] in res2 + tdLog.info(f"fill(next) {func} compare asc and desc done") + tdLog.info("Finish the test case 'test_fill_next_compare_asc_desc'") + + def test_fill_linear_compare_asc_desc(self): + tdSql.execute("use db;") + for func in ["avg(c1)", "count(c1)", "first(c1)", "last(c1)", "max(c1)", "min(c1)", "sum(c1)"]: + tdSql.query(f"select _wstart, {func} from st_linear where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(linear) order by _wstart asc;") + res1 = tdSql.res + tdSql.query(f"select _wstart, {func} from st_linear where ts between '2024-01-21 04:52:52.000' and '2024-01-21 04:54:31.000' interval(5s) fill(linear) order by _wstart desc;") + res2 = tdSql.res + assert len(res1) == len(res2) + for i in range(len(res1)): + assert res1[i] in res2 + tdLog.info(f"fill(linear) {func} compare asc and desc done") + tdLog.info("Finish the test case 'test_fill_linear_compare_asc_desc'") + + def run(self): + self.prepare_data() + self.test_fill_pre_compare_asc_desc() + self.test_fill_next_compare_asc_desc() + self.test_fill_linear_compare_asc_desc() + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/army/query/query_basic.py b/tests/army/query/query_basic.py index d2e0201860..f700ee3153 100644 --- a/tests/army/query/query_basic.py +++ b/tests/army/query/query_basic.py @@ -262,9 +262,9 @@ class TDTestCase(TBase): sql1 = f"select substr(bin,1) from {self.db}.d0 order by ts desc limit 100" sql2 = f"select bin from {self.db}.d0 order by ts desc limit 100" self.checkSameResult(sql1, sql2) - #substr error input pos is zero sql = f"select substr(bin,0,3) from {self.db}.d0 order by ts desc limit 100" - tdSql.error(sql) + tdSql.query(sql) + tdSql.checkData(0, 0, "") # cast nch = 99 diff --git a/tests/ci/Dockerfile b/tests/ci/Dockerfile index 213570dfb2..8381f1bb57 100644 --- a/tests/ci/Dockerfile +++ b/tests/ci/Dockerfile @@ -1,9 +1,14 @@ FROM python:3.8 -RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple -RUN pip3 install pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro -RUN apt-get update -RUN apt-get install -y psmisc sudo tree libgeos-dev libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind \ - vim libjemalloc-dev openssh-server screen sshpass net-tools dirmngr gnupg apt-transport-https ca-certificates software-properties-common r-base iputils-ping +COPY sources.list /etc/apt/ +COPY id_ecdsa /root/.ssh/id_ecdsa +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C +RUN apt-get update +RUN apt-get install -y locales psmisc sudo tree libgeos-dev libgflags2.2 libgflags-dev libgoogle-glog-dev libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config build-essential valgrind rsync vim libjemalloc-dev openssh-server screen sshpass net-tools dirmngr gnupg apt-transport-https ca-certificates software-properties-common r-base iputils-ping clang-tools-16 +RUN sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && locale-gen +RUN pip3 config set global.index-url http://admin:123456@192.168.0.212:3141/admin/dev/+simple/ +RUN pip3 config set global.trusted-host 192.168.0.212 +RUN pip3 install taospy==2.7.15 taos-ws-py==0.3.1 pandas psutil fabric2 requests faker simplejson toml pexpect tzlocal distro decorator loguru hyperloglog +ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' RUN apt install -y r-base @@ -17,17 +22,16 @@ RUN apt-get install wget -y \ && apt-get update && apt-get install -y dotnet-sdk-5.0 && apt-get install -y dotnet-sdk-6.0 ADD node-v12.20.0-linux-x64.tar.gz /usr/local/ RUN sh -c "rm -f /etc/localtime;ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime;echo \"Asia/Shanghai\" >/etc/timezone" -COPY id_rsa /root/.ssh/id_rsa COPY .m2 /root/.m2 COPY .nuget /root/.nuget COPY .dotnet /root/.dotnet -COPY .cargo /root/.cargo COPY go /root/go ADD cmake-3.21.5-linux-x86_64.tar.gz /usr/local/ RUN echo " export RUSTUP_DIST_SERVER=\"https://rsproxy.cn\" " >> /root/.bashrc RUN echo " export RUSTUP_UPDATE_ROOT=\"https://rsproxy.cn/rustup\" " >> /root/.bashrc RUN curl https://sh.rustup.rs -o /tmp/rustup-init.sh RUN sh /tmp/rustup-init.sh -y +COPY .cargo/config /root/.cargo/config ENV PATH /usr/local/go/bin:/usr/local/node-v12.20.0-linux-x64/bin:/usr/local/apache-maven-3.8.4/bin:/usr/local/jdk1.8.0_144/bin:/usr/local/cmake-3.21.5-linux-x86_64/bin:/root/.cargo/bin:$PATH ENV JAVA_HOME /usr/local/jdk1.8.0_144 RUN go env -w GOPROXY=https://goproxy.cn @@ -39,10 +43,8 @@ RUN R CMD javareconf JAVA_HOME=${JAVA_HOME} JAVA=${JAVA_HOME}/bin/java JAVAC=${J RUN echo "install.packages(\"RJDBC\", repos=\"http://cran.us.r-project.org\")"|R --no-save COPY .gitconfig /root/.gitconfig RUN mkdir -p /run/sshd -COPY id_rsa.pub /root/.ssh/id_rsa.pub -COPY id_rsa.pub /root/.ssh/authorized_keys +COPY id_ecdsa.pub /root/.ssh/id_ecdsa.pub +COPY id_ecdsa.pub /root/.ssh/authorized_keys RUN pip3 uninstall -y taostest COPY repository/TDinternal /home/TDinternal -COPY repository/taos-connector-python /home/taos-connector-python -RUN sh -c "cd /home/taos-connector-python; pip3 install ." COPY setup.sh /home/setup.sh diff --git a/tests/ci/scan_file_path.py b/tests/ci/scan_file_path.py index aff94158b8..2d4e701012 100644 --- a/tests/ci/scan_file_path.py +++ b/tests/ci/scan_file_path.py @@ -122,7 +122,7 @@ def scan_files_path(source_file_path): for file in files: if any(item in root for item in scan_dir_list): file_path = os.path.join(root, file) - if (file_path.endswith(".c") or file_name.endswith(".h") or file_path.endswith(".cpp")) and all(item not in file_path for item in scan_skip_file_list): + if (file_path.endswith(".c") or file_path.endswith(".h") or file_path.endswith(".cpp")) and all(item not in file_path for item in scan_skip_file_list): all_file_path.append(file_path) logger.info("Found %s files" % len(all_file_path)) @@ -134,7 +134,7 @@ def input_files(change_files): for line in file: file_name = line.strip() if any(dir_name in file_name for dir_name in scan_dir_list): - if (file_name.endswith(".c") or line.endswith(".cpp")) and all(dir_name not in file_name for dir_name in scan_skip_file_list): + if (file_name.endswith(".c") or file_name.endswith(".cpp")) and all(dir_name not in file_name for dir_name in scan_skip_file_list): if "enterprise" in file_name: file_name = os.path.join(TD_project_path, file_name) else: @@ -184,12 +184,12 @@ if __name__ == "__main__": # os.makedirs(scan_result_path) for file in all_file_path: - cmd = f"clang-query-10 -p {compile_commands_path} {file} -f {clang_scan_rules_path}" + cmd = f"clang-query-16 -p {compile_commands_path} {file} -f {clang_scan_rules_path}" logger.debug(f"cmd:{cmd}") try: stdout, stderr = command_executor.execute(cmd) #if "error" in stderr: - # print(stderr) + print(stderr) lines = stdout.split("\n") if lines[-2].endswith("matches.") or lines[-2].endswith("match."): match_num = int(lines[-2].split(" ")[0]) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c86676b196..3553f0d913 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -37,6 +37,7 @@ ,,y,army,./pytest.sh python3 ./test.py -f grant/grantBugs.py -N 3 ,,y,army,./pytest.sh python3 ./test.py -f query/queryBugs.py -N 3 ,,y,army,./pytest.sh python3 ./test.py -f tmq/tmqBugs.py -N 3 +,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_compare_asc_desc.py # # system test diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 26cabad107..a386269f85 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -83,7 +83,7 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j 10|| exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ;make -j|| exit 1" # -v ${REP_REAL_PATH}/community/contrib/jemalloc/:${REP_DIR}/community/contrib/jemalloc \ if [[ -d ${WORKDIR}/debugNoSan ]] ;then @@ -94,13 +94,17 @@ if [[ -d ${WORKDIR}/debugSan ]] ;then echo "delete ${WORKDIR}/debugSan" rm -rf ${WORKDIR}/debugSan fi - -if [ "$(uname -m)" = "aarch64" ] ;then - CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" -else - CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" +if [[ -d ${WORKDIR}/debugRelease ]] ;then + echo "delete ${WORKDIR}/debugRelease" + rm -rf ${WORKDIR}/debugRelease fi +# if [ "$(uname -m)" = "aarch64" ] ;then +# CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Debug" +# else +# CMAKE_BUILD_TYPE="-DCMAKE_BUILD_TYPE=Release" +# fi + mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan date docker run \ @@ -133,10 +137,47 @@ docker run \ -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true $CMAKE_BUILD_TYPE -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j 10|| exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DCMAKE_BUILD_TYPE=Debug -DTOOLS_BUILD_TYPE=Debug -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j|| exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan +date +# docker run \ +# -v $REP_MOUNT_PARAM \ +# -v /root/.cargo/registry:/root/.cargo/registry \ +# -v /root/.cargo/git:/root/.cargo/git \ +# -v /root/go/pkg/mod:/root/go/pkg/mod \ +# -v /root/.cache/go-build:/root/.cache/go-build \ +# -v /root/.cos-local.1:/root/.cos-local.2 \ +# -v ${REP_REAL_PATH}/enterprise/contrib/grant-lib:${REP_DIR}/enterprise/contrib/grant-lib \ +# -v ${REP_REAL_PATH}/community/tools/taosadapter:${REP_DIR}/community/tools/taosadapter \ +# -v ${REP_REAL_PATH}/community/tools/taos-tools:${REP_DIR}/community/tools/taos-tools \ +# -v ${REP_REAL_PATH}/community/tools/taosws-rs:${REP_DIR}/community/tools/taosws-rs \ +# -v ${REP_REAL_PATH}/community/tools/taosws-rs/target:${REP_DIR}/community/tools/taosws-rs/target \ +# -v ${REP_REAL_PATH}/community/contrib/apr/:${REP_DIR}/community/contrib/apr \ +# -v ${REP_REAL_PATH}/community/contrib/apr-util/:${REP_DIR}/community/contrib/apr-util \ +# -v ${REP_REAL_PATH}/community/contrib/cJson/:${REP_DIR}/community/contrib/cJson \ +# -v ${REP_REAL_PATH}/community/contrib/cpp-stub/:${REP_DIR}/community/contrib/cpp-stub \ +# -v ${REP_REAL_PATH}/community/contrib/curl/:${REP_DIR}/community/contrib/curl \ +# -v ${REP_REAL_PATH}/community/contrib/curl2/:${REP_DIR}/community/contrib/curl2 \ +# -v ${REP_REAL_PATH}/community/contrib/geos/:${REP_DIR}/community/contrib/geos \ +# -v ${REP_REAL_PATH}/community/contrib/googletest/:${REP_DIR}/community/contrib/googletest \ +# -v ${REP_REAL_PATH}/community/contrib/libs3/:${REP_DIR}/community/contrib/libs3 \ +# -v ${REP_REAL_PATH}/community/contrib/libuv/:${REP_DIR}/community/contrib/libuv \ +# -v ${REP_REAL_PATH}/community/contrib/lz4/:${REP_DIR}/community/contrib/lz4 \ +# -v ${REP_REAL_PATH}/community/contrib/lzma2/:${REP_DIR}/community/contrib/lzma2 \ +# -v ${REP_REAL_PATH}/community/contrib/mxml/:${REP_DIR}/community/contrib/mxml \ +# -v ${REP_REAL_PATH}/community/contrib/openssl/:${REP_DIR}/community/contrib/openssl \ +# -v ${REP_REAL_PATH}/community/contrib/pcre2/:${REP_DIR}/community/contrib/pcre2 \ +# -v ${REP_REAL_PATH}/community/contrib/xml2/:${REP_DIR}/community/contrib/xml2 \ +# -v ${REP_REAL_PATH}/community/contrib/zlib/:${REP_DIR}/community/contrib/zlib \ +# -v ${REP_REAL_PATH}/community/contrib/zstd/:${REP_DIR}/community/contrib/zstd \ +# --rm --ulimit core=-1 taos_test:v1.0 sh -c "pip uninstall taospy -y;pip3 install taospy==2.7.2;cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=false -DWEBSOCKET=true -DCMAKE_BUILD_TYPE=Release -DBUILD_TAOSX=false -DJEMALLOC_ENABLED=0;make -j || exit 1 " + +# mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugRelease + + + ret=$? exit $ret diff --git a/tests/parallel_test/run_scan_container.sh b/tests/parallel_test/run_scan_container.sh index d16d1c3017..9f190f5f13 100755 --- a/tests/parallel_test/run_scan_container.sh +++ b/tests/parallel_test/run_scan_container.sh @@ -79,6 +79,7 @@ scan_scripts="$CONTAINER_TESTDIR/tests/ci/scan_file_path.py" ulimit -c unlimited cat << EOF docker run \ + -v /root/.cos-local.1:/root/.cos-local.2 \ -v $REP_MOUNT_PARAM \ -v $REP_MOUNT_DEBUG \ -v $scan_changefile_temp_path:$docker_can_changefile_temp_path \ @@ -86,6 +87,7 @@ docker run \ --rm --ulimit core=-1 taos_test:v1.0 python3 $scan_scripts -b "${branch_name_id}" -f "${scan_file_name}" -w ${web_server} EOF docker run \ + -v /root/.cos-local.1:/root/.cos-local.2 \ -v $REP_MOUNT_PARAM \ -v $REP_MOUNT_DEBUG \ -v $scan_changefile_temp_path:$docker_can_changefile_temp_path \ diff --git a/tests/pytest/util/common.py b/tests/pytest/util/common.py index 8c0e9b17ad..dee3f505c9 100644 --- a/tests/pytest/util/common.py +++ b/tests/pytest/util/common.py @@ -555,6 +555,19 @@ class TDCom: cur = self.newcur(host=host,port=port,user=user,password=password, database=database) newTdSql.init(cur, False) return newTdSql + + def newcurWithTimezone(self, timezone, host='localhost', port=6030, user='root', password='taosdata'): + cfgPath = self.getClientCfgPath() + con=taos.connect(host=host, user=user, password=password, config=cfgPath, port=port, timezone=timezone) + cur=con.cursor() + # print(cur) + return cur + + def newTdSqlWithTimezone(self, timezone, host='localhost',port=6030,user='root',password='taosdata'): + newTdSql = TDSql() + cur = self.newcurWithTimezone(host=host,port=port,user=user,password=password, timezone=timezone) + newTdSql.init(cur, False) + return newTdSql ################################################################################################################ # port from the common.py of new test frame diff --git a/tests/script/tsim/scalar/tsConvert.sim b/tests/script/tsim/scalar/tsConvert.sim index ad8d3b3b93..689a36f13d 100644 --- a/tests/script/tsim/scalar/tsConvert.sim +++ b/tests/script/tsim/scalar/tsConvert.sim @@ -13,7 +13,7 @@ sql insert into tb1 values ('2022-07-10 16:31:00', 1, '1'); sql insert into tb1 values ('2022-07-10 16:32:00', 2, '2'); sql insert into tb1 values ('2022-07-10 16:33:00', 3, '3'); sql insert into tb1 values ('2022-07-10 16:34:00', 4, '4'); -sql select * from (select ts,TIMETRUNCATE(ts,1d),TIMETRUNCATE(ts,1h),timediff(TIMETRUNCATE(ts,1d),TIMETRUNCATE(ts,1h),1h) as td from tb1 where ts >='2022-06-01 00:00:00' and ts <='2022-11-3 23:59:59' ) t where td >12; +sql select * from (select ts,TIMETRUNCATE(ts,1d),TIMETRUNCATE(ts,1h), abs(timediff(TIMETRUNCATE(ts,1d),TIMETRUNCATE(ts,1h),1h)) as td from tb1 where ts >='2022-06-01 00:00:00' and ts <='2022-11-3 23:59:59' ) t where td >12; if $rows != 4 then return -1 endi diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index d7a5540544..616cd034ab 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -222,10 +222,10 @@ class TDTestCase: tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'") tdLog.info(len(tdSql.queryResult)) - tdSql.checkEqual(True, len(tdSql.queryResult) in range(261, 269)) + tdSql.checkEqual(True, len(tdSql.queryResult) in range(261, 271)) tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'") - tdSql.checkEqual(54, len(tdSql.queryResult)) + tdSql.checkEqual(56, len(tdSql.queryResult)) def ins_dnodes_check(self): tdSql.execute('drop database if exists db2') diff --git a/tests/system-test/1-insert/precisionNS.py b/tests/system-test/1-insert/precisionNS.py index 84e1218d0d..3de60b718a 100644 --- a/tests/system-test/1-insert/precisionNS.py +++ b/tests/system-test/1-insert/precisionNS.py @@ -176,52 +176,52 @@ class TDTestCase: def checkTimeMacro(self): # 2 week val = 2 - nsval = val*7*24*60*60*1000*1000*1000 + nsval = -val*7*24*60*60*1000*1000*1000 expectVal = self.childCnt * self.childRow sql = f"select count(ts) from st where timediff(ts - {val}w, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 20 day val = 20 - nsval = val*24*60*60*1000*1000*1000 + nsval = -val*24*60*60*1000*1000*1000 uint = "d" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 30 hour val = 30 - nsval = val*60*60*1000*1000*1000 + nsval = -val*60*60*1000*1000*1000 uint = "h" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 90 minutes val = 90 - nsval = val*60*1000*1000*1000 + nsval = -val*60*1000*1000*1000 uint = "m" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 2s val = 2 - nsval = val*1000*1000*1000 + nsval = -val*1000*1000*1000 uint = "s" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 20a val = 5 - nsval = val*1000*1000 + nsval = -val*1000*1000 uint = "a" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 300u val = 300 - nsval = val*1000 + nsval = -val*1000 uint = "u" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {nsval} " self.checkExpect(sql, expectVal) # 8b val = 8 - sql = f"select timediff(ts - {val}b, ts1) from st " + sql = f"select timediff(ts1, ts - {val}b) from st " self.checkExpect(sql, val) # timetruncate check @@ -249,14 +249,14 @@ class TDTestCase: timediff(ts,ts+1w,1w) from t0 order by ts desc limit 1;''' tdSql.query(sql) - tdSql.checkData(0,1, 1) - tdSql.checkData(0,2, 1) - tdSql.checkData(0,3, 1) - tdSql.checkData(0,4, 1) - tdSql.checkData(0,5, 1) - tdSql.checkData(0,6, 1) - tdSql.checkData(0,7, 1) - tdSql.checkData(0,8, 1) + tdSql.checkData(0,1, -1) + tdSql.checkData(0,2, -1) + tdSql.checkData(0,3, -1) + tdSql.checkData(0,4, -1) + tdSql.checkData(0,5, -1) + tdSql.checkData(0,6, -1) + tdSql.checkData(0,7, -1) + tdSql.checkData(0,8, -1) # init def init(self, conn, logSql, replicaVar=1): diff --git a/tests/system-test/1-insert/precisionUS.py b/tests/system-test/1-insert/precisionUS.py index 7eab452811..25171ddd88 100644 --- a/tests/system-test/1-insert/precisionUS.py +++ b/tests/system-test/1-insert/precisionUS.py @@ -174,46 +174,46 @@ class TDTestCase: def checkTimeMacro(self): # 2 week val = 2 - usval = val*7*24*60*60*1000*1000 + usval = -val*7*24*60*60*1000*1000 expectVal = self.childCnt * self.childRow sql = f"select count(ts) from st where timediff(ts - {val}w, ts1) = {usval} " self.checkExpect(sql, expectVal) # 20 day val = 20 - usval = val*24*60*60*1000*1000 + usval = -val*24*60*60*1000*1000 uint = "d" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) # 30 hour val = 30 - usval = val*60*60*1000*1000 + usval = -val*60*60*1000*1000 uint = "h" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) # 90 minutes val = 90 - usval = val*60*1000*1000 + usval = -val*60*1000*1000 uint = "m" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) # 2s val = 2 - usval = val*1000*1000 + usval = -val*1000*1000 uint = "s" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) # 20a val = 20 - usval = val*1000 + usval = -val*1000 uint = "a" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) # 300u val = 300 - usval = val*1 + usval = -val*1 uint = "u" sql = f"select count(ts) from st where timediff(ts - {val}{uint}, ts1) = {usval} " self.checkExpect(sql, expectVal) diff --git a/tests/system-test/1-insert/test_stmt_set_tbname_tag.py b/tests/system-test/1-insert/test_stmt_set_tbname_tag.py index 1f70daff4a..3251c01aa4 100644 --- a/tests/system-test/1-insert/test_stmt_set_tbname_tag.py +++ b/tests/system-test/1-insert/test_stmt_set_tbname_tag.py @@ -178,8 +178,8 @@ class TDTestCase: queryparam[0].binary('中文字符') rows=self.stmtExe(conn,"select CHAR_LENGTH(?) from log ",queryparam) tdLog.debug("assert 4th case %s"%rows) - assert rows[0][0] == 12, '4th case is failed' - assert rows[1][0] == 12, '4th case is failed' + assert rows[0][0] == 4, '4th case is failed' + assert rows[1][0] == 4, '4th case is failed' queryparam=new_bind_params(1) queryparam[0].binary('123') @@ -209,8 +209,8 @@ class TDTestCase: queryparam[0].timestamp(1626861392591112) rows=self.stmtExe(conn,"select timediff('2021-07-21 17:56:32.590111',?,1a) from log",queryparam) tdLog.debug("assert 7th case %s"%rows) - assert rows[0][0] == 1, '7th case is failed' - assert rows[1][0] == 1, '7th case is failed' + assert rows[0][0] == -1, '7th case is failed' + assert rows[1][0] == -1, '7th case is failed' #query: aggregate Functions queryparam=new_bind_params(1) diff --git a/tests/system-test/2-query/normal.py b/tests/system-test/2-query/normal.py index db210f02e3..f4b40f408b 100644 --- a/tests/system-test/2-query/normal.py +++ b/tests/system-test/2-query/normal.py @@ -2,6 +2,7 @@ from wsgiref.headers import tspecials from util.log import * from util.cases import * from util.sql import * +from util.common import tdCom import numpy as np @@ -127,11 +128,38 @@ class TDTestCase: tdSql.query(f"select * from {dbname}.stb where loc not in ('shanghai', 'shanghai', null)") tdSql.checkRows(0) + def timeZoneTest(self): + dbname = self.dbname + tdsql1 = tdCom.newTdSqlWithTimezone(timezone="Asia/Shanghai") + tdsql1.execute(f'create table {dbname}.tzt(ts timestamp, c1 int)') + tdsql1.execute(f'insert into {dbname}.tzt values({self.ts}, 1)') + tdsql1.query(f"select * from {dbname}.tzt") + tdsql1.checkRows(1) + tdsql1.checkData(0, 0, "2018-09-17 09:00:00") + + tdsql2 = tdCom.newTdSqlWithTimezone(timezone="UTC") + tdsql2.query(f"select * from {dbname}.tzt") + tdsql2.checkRows(1) + tdsql2.checkData(0, 0, "2018-09-17 01:00:00") + + + tdsql2.execute(f'insert into {dbname}.tzt values({self.ts + 1000}, 2)') + tdsql2.query(f"select * from {dbname}.tzt order by ts") + tdsql2.checkRows(2) + tdsql2.checkData(0, 0, "2018-09-17 01:00:00") + tdsql2.checkData(1, 0, "2018-09-17 01:00:01") + + tdsql2 = tdCom.newTdSqlWithTimezone(timezone="Asia/Shanghai") + tdsql2.query(f"select * from {dbname}.tzt order by ts") + tdsql2.checkRows(2) + tdsql2.checkData(0, 0, "2018-09-17 09:00:00") + tdsql2.checkData(1, 0, "2018-09-17 09:00:01") def run(self): dbname = "db" tdSql.prepare() + self.timeZoneTest() self.inAndNotinTest() diff --git a/tests/system-test/2-query/round.py b/tests/system-test/2-query/round.py index f87f234fa3..0a3dfcd518 100644 --- a/tests/system-test/2-query/round.py +++ b/tests/system-test/2-query/round.py @@ -99,8 +99,8 @@ class TDTestCase: # f"select round(tbname+1) from {dbname}.t1 ", f"select round(123--123)==1 from {dbname}.t1", f"select round(c1) as 'd1' from {dbname}.t1", - f"select round(c1 ,c2 ) from {dbname}.t1", - f"select round(c1 ,NULL) from {dbname}.t1", + # f"select round(c1 ,c2 ) from {dbname}.t1", + # f"select round(c1 ,NULL) from {dbname}.t1", f"select round(,) from {dbname}.t1;", f"select round(round(c1) ab from {dbname}.t1)", f"select round(c1) as int from {dbname}.t1", @@ -113,8 +113,8 @@ class TDTestCase: # f"select round(tbname+1) from {dbname}.stb1 ", f"select round(123--123)==1 from {dbname}.stb1", f"select round(c1) as 'd1' from {dbname}.stb1", - f"select round(c1 ,c2 ) from {dbname}.stb1", - f"select round(c1 ,NULL) from {dbname}.stb1", + # f"select round(c1 ,c2 ) from {dbname}.stb1", + # f"select round(c1 ,NULL) from {dbname}.stb1", f"select round(,) from {dbname}.stb1;", f"select round(round(c1) ab from {dbname}.stb1)", f"select round(c1) as int from {dbname}.stb1" diff --git a/tests/system-test/2-query/substr.py b/tests/system-test/2-query/substr.py index ad5a2bba55..ee9e2e5b4d 100644 --- a/tests/system-test/2-query/substr.py +++ b/tests/system-test/2-query/substr.py @@ -79,7 +79,7 @@ class TDTestCase: groups = ["", substr_group_having, substr_group_no_having] if pos < 1: - tdSql.error(f"select substr( {condition}, {pos}, {lens}) , {condition} from {tbname} ") + tdSql.query(f"select substr( {condition}, {pos}, {lens}) , {condition} from {tbname} ") break tdSql.query(f"select substr( {condition}, {pos}, {lens}) , {condition} from {tbname} ") diff --git a/tests/system-test/7-tmq/tmq_primary_key.py b/tests/system-test/7-tmq/tmq_primary_key.py index 80888ddbe6..13d6bd565d 100644 --- a/tests/system-test/7-tmq/tmq_primary_key.py +++ b/tests/system-test/7-tmq/tmq_primary_key.py @@ -85,7 +85,7 @@ class TDTestCase: time.sleep(4) # wait for heart beat tdSql.query(f'show subscriptions;') - sub = tdSql.getData(0, 4); + sub = tdSql.getData(0, 6); print(sub) if not sub.startswith("tsdb"): tdLog.exit(f"show subscriptions error") @@ -196,7 +196,7 @@ class TDTestCase: time.sleep(4) # wait for heart beat tdSql.query(f'show subscriptions;') - sub = tdSql.getData(0, 4); + sub = tdSql.getData(0, 6); print(sub) if not sub.startswith("tsdb"): tdLog.exit(f"show subscriptions error") @@ -306,7 +306,7 @@ class TDTestCase: time.sleep(4) # wait for heart beat tdSql.query(f'show subscriptions;') - sub = tdSql.getData(0, 4); + sub = tdSql.getData(0, 6); print(sub) if not sub.startswith("tsdb"): tdLog.exit(f"show subscriptions error") @@ -416,7 +416,7 @@ class TDTestCase: time.sleep(4) # wait for heart beat tdSql.query(f'show subscriptions;') - sub = tdSql.getData(0, 4); + sub = tdSql.getData(0, 6); print(sub) if not sub.startswith("tsdb"): tdLog.exit(f"show subscriptions error") @@ -517,7 +517,7 @@ class TDTestCase: consumer.close() tdSql.query(f'show subscriptions;') - sub = tdSql.getData(0, 4); + sub = tdSql.getData(0, 6); print(sub) if not sub.startswith("tsdb"): tdLog.exit(f"show subscriptions error") diff --git a/tests/system-test/7-tmq/tmq_taosx.py b/tests/system-test/7-tmq/tmq_taosx.py index d0e682cffb..4e90aefe7c 100644 --- a/tests/system-test/7-tmq/tmq_taosx.py +++ b/tests/system-test/7-tmq/tmq_taosx.py @@ -598,12 +598,12 @@ class TDTestCase: tdSql.query(f'show consumers') tdSql.checkRows(1) tdSql.checkData(0, 1, 'g1') - tdSql.checkData(0, 4, 't2') + tdSql.checkData(0, 6, 't2') tdSql.execute(f'drop consumer group g1 on t1') tdSql.query(f'show consumers') tdSql.checkRows(1) tdSql.checkData(0, 1, 'g1') - tdSql.checkData(0, 4, 't2') + tdSql.checkData(0, 6, 't2') tdSql.query(f'show subscriptions') tdSql.checkRows(1) @@ -641,7 +641,7 @@ class TDTestCase: tdSql.query(f'show consumers') tdSql.checkRows(1) tdSql.checkData(0, 1, 'g1') - tdSql.checkData(0, 4, 't2') + tdSql.checkData(0, 6, 't2') tdSql.execute(f'insert into t4 using st tags(3) values(now, 1)') try: diff --git a/tests/unit-test/test.sh b/tests/unit-test/test.sh index 71f5189551..21461bc6a5 100755 --- a/tests/unit-test/test.sh +++ b/tests/unit-test/test.sh @@ -40,7 +40,7 @@ pgrep taosd || taosd >> /dev/null 2>&1 & sleep 10 -ctest -j8 +ctest -E "cunit_test" -j8 ret=$? exit $ret