diff --git a/cmake/cmake.define b/cmake/cmake.define index e34785cba6..7410c92525 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -123,21 +123,37 @@ ELSE () SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-literal-suffix -Werror=return-type -fPIC -gdwarf-2 -g3 -Wformat=2 -Wno-format-nonliteral -Wno-format-truncation -Wno-format-y2k") ENDIF () - IF (TD_INTEL_64 OR TD_INTEL_32) - ADD_DEFINITIONS("-msse4.2") - IF("${FMA_SUPPORT}" MATCHES "true") - MESSAGE(STATUS "fma function supported") - ADD_DEFINITIONS("-mfma") - ELSE () - MESSAGE(STATUS "fma function NOT supported") - ENDIF() + INCLUDE(CheckCCompilerFlag) + IF (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")) + SET(COMPILER_SUPPORT_SSE42 true) + MESSAGE(STATUS "Always enable sse4.2 for Clang/AppleClang") + ELSE() + CHECK_C_COMPILER_FLAG("-msse4.2" COMPILER_SUPPORT_SSE42) + ENDIF() - IF("${SIMD_SUPPORT}" MATCHES "true") - ADD_DEFINITIONS("-mavx -mavx2") - MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") - ELSE() - MESSAGE(STATUS "SIMD instruction (AVX/AVX2)is NOT ACTIVATED") + CHECK_C_COMPILER_FLAG("-mfma" COMPILER_SUPPORT_FMA) + CHECK_C_COMPILER_FLAG("-mavx" COMPILER_SUPPORT_AVX) + CHECK_C_COMPILER_FLAG("-mavx2" COMPILER_SUPPORT_AVX2) + + IF (COMPILER_SUPPORT_SSE42) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2") + ENDIF() + IF (COMPILER_SUPPORT_FMA) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") + ENDIF() + + IF ("${SIMD_SUPPORT}" MATCHES "true") + IF (COMPILER_SUPPORT_AVX) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") ENDIF() - ENDIF () + IF (COMPILER_SUPPORT_AVX2) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2") + ENDIF() + MESSAGE(STATUS "SIMD instructions (AVX/AVX2) is ACTIVATED") + ENDIF() ENDIF () diff --git a/cmake/cmake.platform b/cmake/cmake.platform index 711d74fa4c..a4bfcaf609 100644 --- a/cmake/cmake.platform +++ b/cmake/cmake.platform @@ -147,7 +147,7 @@ ELSE () ENDIF () ENDIF () -MESSAGE(STATUS "platform arch:" ${PLATFORM_ARCH_STR}) +MESSAGE(STATUS "Platform arch:" ${PLATFORM_ARCH_STR}) MESSAGE("C Compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_C_COMPILER_VERSION})") MESSAGE("CXX Compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_CXX_COMPILER_VERSION})") diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index d468e0acd3..c5fe95da58 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 121c8a3 + GIT_TAG b20c9d1 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/07-develop/03-insert-data/50-opentsdb-json.mdx b/docs/en/07-develop/03-insert-data/50-opentsdb-json.mdx index 7a3ac6bad3..214580c179 100644 --- a/docs/en/07-develop/03-insert-data/50-opentsdb-json.mdx +++ b/docs/en/07-develop/03-insert-data/50-opentsdb-json.mdx @@ -47,7 +47,6 @@ Please refer to [OpenTSDB HTTP API](http://opentsdb.net/docs/build/html/api_http :::note - In JSON protocol, strings will be converted to NCHAR type and numeric values will be converted to double type. -- Only data in array format is accepted and so an array must be used even if there is only one row. - The child table name is created automatically in a rule to guarantee its uniqueness. But you can configure `smlChildTableName` in taos.cfg to specify a tag value as the table names if the tag value is unique globally. For example, if a tag is called `tname` and you set `smlChildTableName=tname` in taos.cfg, when you insert `st,tname=cpu1,t1=4 c1=3 1626006833639000000`, the child table `cpu1` will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. ::: diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md index 17e4e4d1b0..c47d2da0eb 100644 --- a/docs/en/12-taos-sql/14-stream.md +++ b/docs/en/12-taos-sql/14-stream.md @@ -10,7 +10,7 @@ Because stream processing is built in to TDengine, you are no longer reliant on ## Create a Stream ```sql -CREATE STREAM [IF NOT EXISTS] stream_name [stream_options] INTO stb_name AS subquery +CREATE STREAM [IF NOT EXISTS] stream_name [stream_options] INTO stb_name SUBTABLE(expression) AS subquery stream_options: { TRIGGER [AT_ONCE | WINDOW_CLOSE | MAX_DELAY time] WATERMARK time @@ -30,6 +30,8 @@ subquery: SELECT [DISTINCT] select_list Session windows, state windows, and sliding windows are supported. When you configure a session or state window for a supertable, you must use PARTITION BY TBNAME. +Subtable Clause defines the naming rules of auto-created subtable, you can see more details in below part: Partitions of Stream. + ```sql window_clause: { SESSION(ts_col, tol_val) @@ -47,6 +49,47 @@ CREATE STREAM avg_vol_s INTO avg_vol AS SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL(1m) SLIDING(30s); ``` +## Partitions of Stream + +A Stream can process data in multiple partitions. Partition rules can be defined by PARTITION BY clause in stream processing. Each partition will have different timelines and windows, and will be processed separately and be written into different subtables of target supertable. + +If a stream is created without PARTITION BY clause, all data will be written into one subtable. + +If a stream is created with PARTITION BY clause without SUBTABLE clause, each partition will be given a random name. + +If a stream is created with PARTITION BY clause and SUBTABLE clause, the name of each partition will be calculated according to SUBTABLE clause. For example: + +```sql +CREATE STREAM avg_vol_s INTO avg_vol SUBTABLE(CONCAT('new-', tname)) AS SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname tname INTERVAL(1m); +``` + +IN PARTITION clause, 'tbname', representing each subtable name of source supertable, is given alias 'tname'. And 'tname' is used in SUBTABLE clause. In SUBTABLE clause, each auto created subtable will concat 'new-' and source subtable name as their name. Other expressions are also allowed in SUBTABLE clause, but the output type must be varchar. + +If the output length exceeds the limitation of TDengine(192), the name will be truncated. If the generated name is occupied by some other table, the creation and writing of the new subtable will be failed. + +## Filling history data + +Normally a stream does not process data already or being written into source table when it's being creating. But adding FILL_HISTORY 1 as a stream option when creating the stream will allow it to process data written before and while creating the stream. For example: + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 interval(10s) +``` + +Combining fill_history option and where clause, stream can processing data of specific time range. For example, only process data after a past time. (In this case, 2020-01-30) + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 where ts > '2020-01-30' interval(10s) +``` + +As another example, only processing data starting from some past time, and ending at some future time. + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 where ts > '2020-01-30' and ts < '2023-01-01' interval(10s) +``` + +If some streams are totally outdated, and you do not want it to monitor or process anymore, those streams can be manually dropped and output data will be still kept. + + ## Delete a Stream ```sql diff --git a/docs/en/14-reference/05-taosbenchmark.md b/docs/en/14-reference/05-taosbenchmark.md index 6e08671e34..19feeb6740 100644 --- a/docs/en/14-reference/05-taosbenchmark.md +++ b/docs/en/14-reference/05-taosbenchmark.md @@ -204,6 +204,12 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) - **-a/--replica ** : Specify the number of replicas when creating the database. The default value is 1. +- **-k/--keep-trying ** : + Keep trying if failed to insert, default is no. Available with v3.0.9+. + +- **-z/--trying-interval ** : + Specify interval between keep trying insert. Valid value is a postive number. Only valid when keep trying be enabled. Available with v3.0.9+. + - **-V/--version** : Show version information only. Users should not use it with other parameters. @@ -231,6 +237,10 @@ The parameters listed in this section apply to all function modes. `filetype` must be set to `insert` in the insertion scenario. See [General Configuration Parameters](#General Configuration Parameters) +- ** keep_trying ** : Keep trying if failed to insert, default is no. Available with v3.0.9+. + +- ** trying_interval ** : Specify interval between keep trying insert. Valid value is a postive number. Only valid when keep trying be enabled. Available with v3.0.9+. + #### Database related configuration parameters The parameters related to database creation are configured in `dbinfo` in the json configuration file, as follows. The other parameters correspond to the database parameters specified when `create database` in [../../taos-sql/database]. diff --git a/docs/en/14-reference/06-taosdump.md b/docs/en/14-reference/06-taosdump.md index e73441a96b..9c63b4dc03 100644 --- a/docs/en/14-reference/06-taosdump.md +++ b/docs/en/14-reference/06-taosdump.md @@ -19,7 +19,7 @@ Users should not use taosdump to back up raw data, environment settings, hardwar There are two ways to install taosdump: -- Install the taosTools official installer. Please find taosTools from [All download links](https://www.tdengine.com/all-downloads) page and download and install it. +- Install the taosTools official installer. Please find taosTools from [Release History](https://docs.taosdata.com/releases/tools/) page and download and install it. - Compile taos-tools separately and install it. Please refer to the [taos-tools](https://github.com/taosdata/taos-tools) repository for details. diff --git a/docs/en/20-third-party/11-kafka.md b/docs/en/20-third-party/11-kafka.md index 6720af8bf8..3e8f7c295d 100644 --- a/docs/en/20-third-party/11-kafka.md +++ b/docs/en/20-third-party/11-kafka.md @@ -76,7 +76,7 @@ Development: false ### Install from source code ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone https://github.com/taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip diff --git a/docs/examples/python/connection_usage_native_reference.py b/docs/examples/python/connection_usage_native_reference.py index 4803511e42..a7179b4cf8 100644 --- a/docs/examples/python/connection_usage_native_reference.py +++ b/docs/examples/python/connection_usage_native_reference.py @@ -8,7 +8,7 @@ conn.execute("CREATE DATABASE test") # change database. same as execute "USE db" conn.select_db("test") conn.execute("CREATE STABLE weather(ts TIMESTAMP, temperature FLOAT) TAGS (location INT)") -affected_row: int = conn.execute("INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+1m, 23.5) (now+2m 24.4)") +affected_row: int = conn.execute("INSERT INTO t1 USING weather TAGS(1) VALUES (now, 23.5) (now+1m, 23.5) (now+2m, 24.4)") print("affected_row", affected_row) # output: # affected_row 3 diff --git a/docs/zh/07-develop/03-insert-data/50-opentsdb-json.mdx b/docs/zh/07-develop/03-insert-data/50-opentsdb-json.mdx index 89818409c5..e1fd3dacc8 100644 --- a/docs/zh/07-develop/03-insert-data/50-opentsdb-json.mdx +++ b/docs/zh/07-develop/03-insert-data/50-opentsdb-json.mdx @@ -47,7 +47,6 @@ OpenTSDB JSON 格式协议采用一个 JSON 字符串表示一行或多行数据 :::note - 对于 JSON 格式协议,TDengine 并不会自动把所有标签转成 NCHAR 类型, 字符串将将转为 NCHAR 类型, 数值将同样转换为 DOUBLE 类型。 -- TDengine 只接收 JSON **数组格式**的字符串,即使一行数据也需要转换成数组形式。 - 默认生成的子表名是根据规则生成的唯一 ID 值。用户也可以通过在 taos.cfg 里配置 smlChildTableName 参数来指定某个标签值作为子表名。该标签值应该具有全局唯一性。举例如下:假设有个标签名为tname, 配置 smlChildTableName=tname, 插入数据为 `"tags": { "host": "web02","dc": "lga","tname":"cpu1"}` 则创建的子表名为 cpu1。注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。 ::: diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md index 932ad30b1a..a70d559a86 100644 --- a/docs/zh/12-taos-sql/14-stream.md +++ b/docs/zh/12-taos-sql/14-stream.md @@ -8,7 +8,7 @@ description: 流式计算的相关 SQL 的详细语法 ## 创建流式计算 ```sql -CREATE STREAM [IF NOT EXISTS] stream_name [stream_options] INTO stb_name AS subquery +CREATE STREAM [IF NOT EXISTS] stream_name [stream_options] INTO stb_name SUBTABLE(expression) AS subquery stream_options: { TRIGGER [AT_ONCE | WINDOW_CLOSE | MAX_DELAY time] WATERMARK time @@ -28,6 +28,9 @@ subquery: SELECT select_list 支持会话窗口、状态窗口与滑动窗口,其中,会话窗口与状态窗口搭配超级表时必须与partition by tbname一起使用 + +subtable 子句定义了流式计算中创建的子表的命名规则,详见 流式计算的 partition 部分。 + ```sql window_clause: { SESSION(ts_col, tol_val) @@ -49,11 +52,43 @@ SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname INTERVAL( ## 流式计算的 partition -可以使用 PARTITION BY TBNAME 或 PARTITION BY tag,对一个流进行多分区的计算,每个分区的时间线与时间窗口是独立的,会各自聚合,并写入到目的表中的不同子表。 +可以使用 PARTITION BY TBNAME,tag,普通列或者表达式,对一个流进行多分区的计算,每个分区的时间线与时间窗口是独立的,会各自聚合,并写入到目的表中的不同子表。 -不带 PARTITION BY 选项时,所有的数据将写入到一张子表。 +不带 PARTITION BY 子句时,所有的数据将写入到一张子表。 -流式计算创建的超级表有唯一的 tag 列 groupId,每个 partition 会被分配唯一 groupId。与 schemaless 写入一致,我们通过 MD5 计算子表名,并自动创建它。 +在创建流时不使用 SUBTABLE 子句时,流式计算创建的超级表有唯一的 tag 列 groupId,每个 partition 会被分配唯一 groupId。与 schemaless 写入一致,我们通过 MD5 计算子表名,并自动创建它。 + +若创建流的语句中包含 SUBTABLE 子句,用户可以为每个 partition 对应的子表生成自定义的表名,例如: + +```sql +CREATE STREAM avg_vol_s INTO avg_vol SUBTABLE(CONCAT('new-', tname)) AS SELECT _wstart, count(*), avg(voltage) FROM meters PARTITION BY tbname tname INTERVAL(1m); +``` + +PARTITION 子句中,为 tbname 定义了一个别名 tname, 在PARTITION 子句中的别名可以用于 SUBTABLE 子句中的表达式计算,在上述示例中,流新创建的子表将以前缀 'new-' 连接原表名作为表名。 + +注意,子表名的长度若超过 TDengine 的限制,将被截断。若要生成的子表名已经存在于另一超级表,由于 TDengine 的子表名是唯一的,因此对应新子表的创建以及数据的写入将会失败。 + +## 流式计算读取历史数据 + +正常情况下,流式计算不会处理创建前已经写入源表中的数据,若要处理已经写入的数据,可以在创建流时设置 fill_history 1 选项,这样创建的流式计算会自动处理创建前、创建中、创建后写入的数据。例如: + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 interval(10s) +``` + +结合 fill_history 1 选项,可以实现只处理特定历史时间范围的数据,例如:只处理某历史时刻(2020年1月30日)之后的数据 + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 where ts > '2020-01-30' interval(10s) +``` + +再如,仅处理某时间段内的数据,结束时间可以是未来时间 + +```sql +create stream if not exists s1 fill_history 1 into st1 as select count(*) from t1 where ts > '2020-01-30' and ts < '2023-01-01' interval(10s) +``` + +如果该流任务已经彻底过期,并且您不再想让它检测或处理数据,您可以手动删除它,被计算出的数据仍会被保留。 ## 删除流式计算 diff --git a/docs/zh/14-reference/05-taosbenchmark.md b/docs/zh/14-reference/05-taosbenchmark.md index 76dd5f12d8..9091e71d1f 100644 --- a/docs/zh/14-reference/05-taosbenchmark.md +++ b/docs/zh/14-reference/05-taosbenchmark.md @@ -204,6 +204,10 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) - **-a/--replica ** : 创建数据库时指定其副本数,默认值为 1 。 +- ** -k/--keep-trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 + +- ** -z/--trying-interval ** : 失败重试间隔时间,单位为毫秒,仅在 -k 指定重试后有效。需使用 v3.0.9 以上版本。 + - **-V/--version** : 显示版本信息并退出。不能与其它参数混用。 @@ -231,6 +235,10 @@ taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\) 插入场景下 `filetype` 必须设置为 `insert`,该参数及其它通用参数详见[通用配置参数](#通用配置参数) +- ** keep_trying ** : 失败后进行重试的次数,默认不重试。需使用 v3.0.9 以上版本。 + +- ** trying_interval ** : 失败重试间隔时间,单位为毫秒,仅在 keep_trying 指定重试后有效。需使用 v3.0.9 以上版本。 + #### 数据库相关配置参数 创建数据库时的相关参数在 json 配置文件中的 `dbinfo` 中配置,个别具体参数如下。其余参数均与 TDengine 中 `create database` 时所指定的数据库参数相对应,详见[../../taos-sql/database] diff --git a/docs/zh/14-reference/06-taosdump.md b/docs/zh/14-reference/06-taosdump.md index 625499a949..8a031d1473 100644 --- a/docs/zh/14-reference/06-taosdump.md +++ b/docs/zh/14-reference/06-taosdump.md @@ -22,7 +22,7 @@ taosdump 是一个逻辑备份工具,它不应被用于备份任何原始数 taosdump 有两种安装方式: -- 安装 taosTools 官方安装包, 请从[所有下载链接](https://www.taosdata.com/all-downloads)页面找到 taosTools 并下载安装。 +- 安装 taosTools 官方安装包, 请从[发布历史页面](https://docs.taosdata.com/releases/tools/)页面找到 taosTools 并下载安装。 - 单独编译 taos-tools 并安装, 详情请参考 [taos-tools](https://github.com/taosdata/taos-tools) 仓库。 diff --git a/docs/zh/20-third-party/11-kafka.md b/docs/zh/20-third-party/11-kafka.md index 1172f4fbc5..cc2247f25e 100644 --- a/docs/zh/20-third-party/11-kafka.md +++ b/docs/zh/20-third-party/11-kafka.md @@ -79,7 +79,7 @@ Development: false ### 从源码安装 ``` -git clone https://github.com:taosdata/kafka-connect-tdengine.git +git clone https://github.com/taosdata/kafka-connect-tdengine.git cd kafka-connect-tdengine mvn clean package unzip -d $CONFLUENT_HOME/share/java/ target/components/packages/taosdata-kafka-connect-tdengine-*.zip diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 37edc739e4..e14c4e60d9 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -3,19 +3,13 @@ PROJECT(TDengine) IF (TD_LINUX) INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) AUX_SOURCE_DIRECTORY(. SRC) - # ADD_EXECUTABLE(demo apitest.c) - #TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(sml schemaless.c) - #TARGET_LINK_LIBRARIES(sml taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(subscribe subscribe.c) - #TARGET_LINK_LIBRARIES(subscribe taos_static trpc tutil pthread ) - #ADD_EXECUTABLE(epoll epoll.c) - #TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) add_executable(tmq "") add_executable(stream_demo "") - add_executable(demoapi "") - add_executable(api_reqid "") + add_executable(schemaless "") + add_executable(prepare "") + add_executable(demo "") + add_executable(asyncdemo "") target_sources(tmq PRIVATE @@ -27,16 +21,25 @@ IF (TD_LINUX) "stream_demo.c" ) - target_sources(demoapi + target_sources(schemaless PRIVATE - "demoapi.c" + "schemaless.c" ) - target_sources(api_reqid + target_sources(prepare PRIVATE - "api_with_reqid_test.c" + "prepare.c" ) + target_sources(demo + PRIVATE + "demo.c" + ) + + target_sources(asyncdemo + PRIVATE + "asyncdemo.c" + ) target_link_libraries(tmq taos_static @@ -46,46 +49,30 @@ IF (TD_LINUX) taos_static ) - target_link_libraries(demoapi + target_link_libraries(schemaless taos_static ) - target_link_libraries(api_reqid + target_link_libraries(prepare taos_static ) - - target_include_directories(tmq - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + target_link_libraries(demo + taos_static ) - target_include_directories(stream_demo - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(demoapi - PUBLIC "${TD_SOURCE_DIR}/include/client" - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - ) - - target_include_directories(api_reqid - PUBLIC "${TD_SOURCE_DIR}/include/client" - PUBLIC "${TD_SOURCE_DIR}/include/os" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + target_link_libraries(asyncdemo + taos_static ) SET_TARGET_PROPERTIES(tmq PROPERTIES OUTPUT_NAME tmq) SET_TARGET_PROPERTIES(stream_demo PROPERTIES OUTPUT_NAME stream_demo) - SET_TARGET_PROPERTIES(demoapi PROPERTIES OUTPUT_NAME demoapi) - SET_TARGET_PROPERTIES(api_reqid PROPERTIES OUTPUT_NAME api_reqid) + SET_TARGET_PROPERTIES(schemaless PROPERTIES OUTPUT_NAME schemaless) + SET_TARGET_PROPERTIES(prepare PROPERTIES OUTPUT_NAME prepare) + SET_TARGET_PROPERTIES(demo PROPERTIES OUTPUT_NAME demo) + SET_TARGET_PROPERTIES(asyncdemo PROPERTIES OUTPUT_NAME asyncdemo) ENDIF () IF (TD_DARWIN) INCLUDE_DIRECTORIES(. ${TD_SOURCE_DIR}/src/inc ${TD_SOURCE_DIR}/src/client/inc ${TD_SOURCE_DIR}/inc) AUX_SOURCE_DIRECTORY(. SRC) - #ADD_EXECUTABLE(demo demo.c) - #TARGET_LINK_LIBRARIES(demo taos_static trpc tutil pthread lua) - #ADD_EXECUTABLE(epoll epoll.c) - #TARGET_LINK_LIBRARIES(epoll taos_static trpc tutil pthread lua) ENDIF () diff --git a/examples/c/apitest.c b/examples/c/apitest.c deleted file mode 100644 index c179acaf4e..0000000000 --- a/examples/c/apitest.c +++ /dev/null @@ -1,1948 +0,0 @@ -// sample code to verify all TDengine API -// to compile: gcc -o apitest apitest.c -ltaos - -#include "cJSON.h" -#include "taoserror.h" - -#include -#include -#include -#include -#include "../../../include/client/taos.h" - -static void prepare_data(TAOS* taos) { - TAOS_RES* result; - result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test precision 'us';"); - taos_free_result(result); - usleep(100000); - taos_select_db(taos, "test"); - - result = taos_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); - taos_free_result(result); - - result = taos_query(taos, "create table t0 using meters tags(0);"); - taos_free_result(result); - result = taos_query(taos, "create table t1 using meters tags(1);"); - taos_free_result(result); - result = taos_query(taos, "create table t2 using meters tags(2);"); - taos_free_result(result); - result = taos_query(taos, "create table t3 using meters tags(3);"); - taos_free_result(result); - result = taos_query(taos, "create table t4 using meters tags(4);"); - taos_free_result(result); - result = taos_query(taos, "create table t5 using meters tags(5);"); - taos_free_result(result); - result = taos_query(taos, "create table t6 using meters tags(6);"); - taos_free_result(result); - result = taos_query(taos, "create table t7 using meters tags(7);"); - taos_free_result(result); - result = taos_query(taos, "create table t8 using meters tags(8);"); - taos_free_result(result); - result = taos_query(taos, "create table t9 using meters tags(9);"); - taos_free_result(result); - - result = taos_query(taos, - "insert into t0 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:02:00.000', 0)" - " t1 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:02:00.000', 0)" - " ('2020-01-01 00:03:00.000', 0)" - " t2 values('2020-01-01 00:00:00.000', 0)" - " ('2020-01-01 00:01:00.000', 0)" - " ('2020-01-01 00:01:01.000', 0)" - " ('2020-01-01 00:01:02.000', 0)" - " t3 values('2020-01-01 00:01:02.000', 0)" - " t4 values('2020-01-01 00:01:02.000', 0)" - " t5 values('2020-01-01 00:01:02.000', 0)" - " t6 values('2020-01-01 00:01:02.000', 0)" - " t7 values('2020-01-01 00:01:02.000', 0)" - " t8 values('2020-01-01 00:01:02.000', 0)" - " t9 values('2020-01-01 00:01:02.000', 0)"); - int affected = taos_affected_rows(result); - if (affected != 18) { - printf("\033[31m%d rows affected by last insert statement, but it should be 18\033[0m\n", affected); - } - taos_free_result(result); - // super tables subscription - usleep(1000000); -} - -static int print_result(TAOS_RES* res, int blockFetch) { - TAOS_ROW row = NULL; - int num_fields = taos_num_fields(res); - TAOS_FIELD* fields = taos_fetch_fields(res); - int nRows = 0; - - if (blockFetch) { - int rows = 0; - while ((rows = taos_fetch_block(res, &row))) { - // for (int i = 0; i < rows; i++) { - // char temp[256]; - // taos_print_row(temp, row + i, fields, num_fields); - // puts(temp); - // } - nRows += rows; - } - } else { - while ((row = taos_fetch_row(res))) { - char temp[256] = {0}; - taos_print_row(temp, row, fields, num_fields); - puts(temp); - nRows++; - } - } - - printf("%d rows consumed.\n", nRows); - return nRows; -} - -static void check_row_count(int line, TAOS_RES* res, int expected) { - int actual = print_result(res, expected % 2); - if (actual != expected) { - printf("\033[31mline %d: row count mismatch, expected: %d, actual: %d\033[0m\n", line, expected, actual); - } else { - printf("line %d: %d rows consumed as expected\n", line, actual); - } -} - -static void verify_query(TAOS* taos) { - prepare_data(taos); - - int code = taos_load_table_info(taos, "t0,t1,t2,t3,t4,t5,t6,t7,t8,t9"); - if (code != 0) { - printf("\033[31mfailed to load table info: 0x%08x\033[0m\n", code); - } - - code = taos_validate_sql(taos, "select * from nonexisttable"); - if (code == 0) { - printf("\033[31mimpossible, the table does not exists\033[0m\n"); - } - - code = taos_validate_sql(taos, "select * from meters"); - if (code != 0) { - printf("\033[31mimpossible, the table does exists: 0x%08x\033[0m\n", code); - } - - TAOS_RES* res = taos_query_with_reqid(taos, "select * from meters", genReqid()); - check_row_count(__LINE__, res, 18); - printf("result precision is: %d\n", taos_result_precision(res)); - int c = taos_field_count(res); - printf("field count is: %d\n", c); - int* lengths = taos_fetch_lengths(res); - for (int i = 0; i < c; i++) { - printf("length of column %d is %d\n", i, lengths[i]); - } - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from t0", genReqid()); - check_row_count(__LINE__, res, 3); - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from nonexisttable", genReqid()); - code = taos_errno(res); - printf("code=%d, error msg=%s\n", code, taos_errstr(res)); - taos_free_result(res); - - res = taos_query_with_reqid(taos, "select * from meters", genReqid()); - taos_stop_query(res); - taos_free_result(res); -} - -void subscribe_callback(TAOS_SUB* tsub, TAOS_RES* res, void* param, int code) { - int rows = print_result(res, *(int*)param); - printf("%d rows consumed in subscribe_callback\n", rows); -} - -static void verify_subscribe(TAOS* taos) { - prepare_data(taos); - - TAOS_SUB* tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - TAOS_RES* res = taos_consume(tsub); - check_row_count(__LINE__, res, 18); - - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - TAOS_RES* result; - result = taos_query(taos, "insert into t0 values('2020-01-01 00:02:00.001', 0);"); - taos_free_result(result); - result = taos_query(taos, "insert into t8 values('2020-01-01 00:01:03.000', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 2); - - result = taos_query(taos, "insert into t2 values('2020-01-01 00:01:02.001', 0);"); - taos_free_result(result); - result = taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.001', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 2); - - result = taos_query(taos, "insert into t1 values('2020-01-01 00:03:00.002', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 1); - - // keep progress information and restart subscription - taos_unsubscribe(tsub, 1); - result = taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.000', 0);"); - taos_free_result(result); - tsub = taos_subscribe(taos, 1, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 24); - - // keep progress information and continue previous subscription - taos_unsubscribe(tsub, 1); - tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - // don't keep progress information and continue previous subscription - taos_unsubscribe(tsub, 0); - tsub = taos_subscribe(taos, 0, "test", "select * from meters;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 24); - - // single meter subscription - - taos_unsubscribe(tsub, 0); - tsub = taos_subscribe(taos, 0, "test", "select * from t0;", NULL, NULL, 0); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 5); - - res = taos_consume(tsub); - check_row_count(__LINE__, res, 0); - - result = taos_query(taos, "insert into t0 values('2020-01-01 00:04:00.001', 0);"); - taos_free_result(result); - res = taos_consume(tsub); - check_row_count(__LINE__, res, 1); - - taos_unsubscribe(tsub, 0); - - int blockFetch = 0; - tsub = taos_subscribe(taos, 1, "test", "select * from meters;", subscribe_callback, &blockFetch, 1000); - usleep(2000000); - result = taos_query(taos, "insert into t0 values('2020-01-01 00:05:00.001', 0);"); - taos_free_result(result); - usleep(2000000); - taos_unsubscribe(tsub, 0); -} - -void verify_prepare(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10))"; - result = taos_query_with_reqid(taos, sql, genReqid()); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - // insert 10 records - struct { - int64_t ts; - int8_t b; - int8_t v1; - int16_t v2; - int32_t v4; - int64_t v8; - float f4; - double f8; - char bin[40]; - char blob[80]; - } v = {0}; - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_BIND params[10]; - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts); - params[0].buffer = &v.ts; - params[0].length = ¶ms[0].buffer_length; - params[0].is_null = NULL; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b); - params[1].buffer = &v.b; - params[1].length = ¶ms[1].buffer_length; - params[1].is_null = NULL; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1); - params[2].buffer = &v.v1; - params[2].length = ¶ms[2].buffer_length; - params[2].is_null = NULL; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2); - params[3].buffer = &v.v2; - params[3].length = ¶ms[3].buffer_length; - params[3].is_null = NULL; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4); - params[4].buffer = &v.v4; - params[4].length = ¶ms[4].buffer_length; - params[4].is_null = NULL; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8); - params[5].buffer = &v.v8; - params[5].length = ¶ms[5].buffer_length; - params[5].is_null = NULL; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4); - params[6].buffer = &v.f4; - params[6].length = ¶ms[6].buffer_length; - params[6].is_null = NULL; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8); - params[7].buffer = &v.f8; - params[7].length = ¶ms[7].buffer_length; - params[7].is_null = NULL; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin); - params[8].buffer = v.bin; - params[8].length = ¶ms[8].buffer_length; - params[8].is_null = NULL; - - strcpy(v.blob, "一二三四五六七八九十"); - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = strlen(v.blob); - params[9].buffer = v.blob; - params[9].length = ¶ms[9].buffer_length; - params[9].is_null = NULL; - - int is_null = 1; - - sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - v.ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts += 1; - for (int j = 1; j < 10; ++j) { - params[j].is_null = ((i == j) ? &is_null : 0); - } - v.b = (int8_t)i % 2; - v.v1 = (int8_t)i; - v.v2 = (int16_t)(i * 2); - v.v4 = (int32_t)(i * 4); - v.v8 = (int64_t)(i * 8); - v.f4 = (float)(i * 40); - v.f8 = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin); ++j) { - v.bin[j] = (char)(i + '0'); - } - - taos_stmt_bind_param(stmt, params); - taos_stmt_add_batch(stmt); - } - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - v.v1 = 5; - v.v2 = 15; - taos_stmt_bind_param(stmt, params + 2); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); -} - -void verify_prepare2(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10))"; - result = taos_query(taos, sql); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - // insert 10 records - struct { - int64_t ts[10]; - int8_t b[10]; - int8_t v1[10]; - int16_t v2[10]; - int32_t v4[10]; - int64_t v8[10]; - float f4[10]; - double f8[10]; - char bin[10][40]; - char blob[10][80]; - } v; - - int32_t* t8_len = malloc(sizeof(int32_t) * 10); - int32_t* t16_len = malloc(sizeof(int32_t) * 10); - int32_t* t32_len = malloc(sizeof(int32_t) * 10); - int32_t* t64_len = malloc(sizeof(int32_t) * 10); - int32_t* float_len = malloc(sizeof(int32_t) * 10); - int32_t* double_len = malloc(sizeof(int32_t) * 10); - int32_t* bin_len = malloc(sizeof(int32_t) * 10); - int32_t* blob_len = malloc(sizeof(int32_t) * 10); - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_MULTI_BIND params[10]; - char is_null[10] = {0}; - - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts[0]); - params[0].buffer = v.ts; - params[0].length = t64_len; - params[0].is_null = is_null; - params[0].num = 10; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b[0]); - params[1].buffer = v.b; - params[1].length = t8_len; - params[1].is_null = is_null; - params[1].num = 10; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1[0]); - params[2].buffer = v.v1; - params[2].length = t8_len; - params[2].is_null = is_null; - params[2].num = 10; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2[0]); - params[3].buffer = v.v2; - params[3].length = t16_len; - params[3].is_null = is_null; - params[3].num = 10; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4[0]); - params[4].buffer = v.v4; - params[4].length = t32_len; - params[4].is_null = is_null; - params[4].num = 10; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8[0]); - params[5].buffer = v.v8; - params[5].length = t64_len; - params[5].is_null = is_null; - params[5].num = 10; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4[0]); - params[6].buffer = v.f4; - params[6].length = float_len; - params[6].is_null = is_null; - params[6].num = 10; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8[0]); - params[7].buffer = v.f8; - params[7].length = double_len; - params[7].is_null = is_null; - params[7].num = 10; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin[0]); - params[8].buffer = v.bin; - params[8].length = bin_len; - params[8].is_null = is_null; - params[8].num = 10; - - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = sizeof(v.blob[0]); - params[9].buffer = v.blob; - params[9].length = blob_len; - params[9].is_null = is_null; - params[9].num = 10; - - sql = "insert into ? (ts, b, v1, v2, v4, v8, f4, f8, bin, blob) values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - code = taos_stmt_set_tbname(stmt, "m1"); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - int64_t ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts[i] = ts++; - is_null[i] = 0; - - v.b[i] = (int8_t)i % 2; - v.v1[i] = (int8_t)i; - v.v2[i] = (int16_t)(i * 2); - v.v4[i] = (int32_t)(i * 4); - v.v8[i] = (int64_t)(i * 8); - v.f4[i] = (float)(i * 40); - v.f8[i] = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin[0]); ++j) { - v.bin[i][j] = (char)(i + '0'); - } - strcpy(v.blob[i], "一二三四五六七八九十"); - - t8_len[i] = sizeof(int8_t); - t16_len[i] = sizeof(int16_t); - t32_len[i] = sizeof(int32_t); - t64_len[i] = sizeof(int64_t); - float_len[i] = sizeof(float); - double_len[i] = sizeof(double); - bin_len[i] = sizeof(v.bin[0]); - blob_len[i] = (int32_t)strlen(v.blob[i]); - } - - taos_stmt_bind_param_batch(stmt, params); - taos_stmt_add_batch(stmt); - - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - TAOS_BIND qparams[2]; - - int8_t v1 = 5; - int16_t v2 = 15; - qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; - qparams[0].buffer_length = sizeof(v1); - qparams[0].buffer = &v1; - qparams[0].length = &qparams[0].buffer_length; - qparams[0].is_null = NULL; - - qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; - qparams[1].buffer_length = sizeof(v2); - qparams[1].buffer = &v2; - qparams[1].length = &qparams[1].buffer_length; - qparams[1].is_null = NULL; - - taos_stmt_bind_param(stmt, qparams); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); - - free(t8_len); - free(t16_len); - free(t32_len); - free(t64_len); - free(float_len); - free(double_len); - free(bin_len); - free(blob_len); -} - -void verify_prepare3(TAOS* taos) { - TAOS_RES* result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test;"); - - int code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - usleep(100000); - taos_select_db(taos, "test"); - - // create table - const char* sql = - "create stable st1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " - "binary(40), blob nchar(10)) tags (id1 int, id2 binary(40))"; - result = taos_query(taos, sql); - code = taos_errno(result); - if (code != 0) { - printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); - taos_free_result(result); - return; - } - taos_free_result(result); - - TAOS_BIND tags[2]; - - int32_t id1 = 1; - char id2[40] = "abcdefghijklmnopqrstuvwxyz0123456789"; - uintptr_t id2_len = strlen(id2); - - tags[0].buffer_type = TSDB_DATA_TYPE_INT; - tags[0].buffer_length = sizeof(int); - tags[0].buffer = &id1; - tags[0].length = NULL; - tags[0].is_null = NULL; - - tags[1].buffer_type = TSDB_DATA_TYPE_BINARY; - tags[1].buffer_length = sizeof(id2); - tags[1].buffer = id2; - tags[1].length = &id2_len; - tags[1].is_null = NULL; - - // insert 10 records - struct { - int64_t ts[10]; - int8_t b[10]; - int8_t v1[10]; - int16_t v2[10]; - int32_t v4[10]; - int64_t v8[10]; - float f4[10]; - double f8[10]; - char bin[10][40]; - char blob[10][80]; - } v; - - int32_t* t8_len = malloc(sizeof(int32_t) * 10); - int32_t* t16_len = malloc(sizeof(int32_t) * 10); - int32_t* t32_len = malloc(sizeof(int32_t) * 10); - int32_t* t64_len = malloc(sizeof(int32_t) * 10); - int32_t* float_len = malloc(sizeof(int32_t) * 10); - int32_t* double_len = malloc(sizeof(int32_t) * 10); - int32_t* bin_len = malloc(sizeof(int32_t) * 10); - int32_t* blob_len = malloc(sizeof(int32_t) * 10); - - TAOS_STMT* stmt = taos_stmt_init(taos); - TAOS_MULTI_BIND params[10]; - char is_null[10] = {0}; - - params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; - params[0].buffer_length = sizeof(v.ts[0]); - params[0].buffer = v.ts; - params[0].length = t64_len; - params[0].is_null = is_null; - params[0].num = 10; - - params[1].buffer_type = TSDB_DATA_TYPE_BOOL; - params[1].buffer_length = sizeof(v.b[0]); - params[1].buffer = v.b; - params[1].length = t8_len; - params[1].is_null = is_null; - params[1].num = 10; - - params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; - params[2].buffer_length = sizeof(v.v1[0]); - params[2].buffer = v.v1; - params[2].length = t8_len; - params[2].is_null = is_null; - params[2].num = 10; - - params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; - params[3].buffer_length = sizeof(v.v2[0]); - params[3].buffer = v.v2; - params[3].length = t16_len; - params[3].is_null = is_null; - params[3].num = 10; - - params[4].buffer_type = TSDB_DATA_TYPE_INT; - params[4].buffer_length = sizeof(v.v4[0]); - params[4].buffer = v.v4; - params[4].length = t32_len; - params[4].is_null = is_null; - params[4].num = 10; - - params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; - params[5].buffer_length = sizeof(v.v8[0]); - params[5].buffer = v.v8; - params[5].length = t64_len; - params[5].is_null = is_null; - params[5].num = 10; - - params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; - params[6].buffer_length = sizeof(v.f4[0]); - params[6].buffer = v.f4; - params[6].length = float_len; - params[6].is_null = is_null; - params[6].num = 10; - - params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; - params[7].buffer_length = sizeof(v.f8[0]); - params[7].buffer = v.f8; - params[7].length = double_len; - params[7].is_null = is_null; - params[7].num = 10; - - params[8].buffer_type = TSDB_DATA_TYPE_BINARY; - params[8].buffer_length = sizeof(v.bin[0]); - params[8].buffer = v.bin; - params[8].length = bin_len; - params[8].is_null = is_null; - params[8].num = 10; - - params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = sizeof(v.blob[0]); - params[9].buffer = v.blob; - params[9].length = blob_len; - params[9].is_null = is_null; - params[9].num = 10; - - sql = "insert into ? using st1 tags(?,?) values(?,?,?,?,?,?,?,?,?,?)"; - code = taos_stmt_prepare(stmt, sql, 0); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - code = taos_stmt_set_tbname_tags(stmt, "m1", tags); - if (code != 0) { - printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - int64_t ts = 1591060628000; - for (int i = 0; i < 10; ++i) { - v.ts[i] = ts++; - is_null[i] = 0; - - v.b[i] = (int8_t)i % 2; - v.v1[i] = (int8_t)i; - v.v2[i] = (int16_t)(i * 2); - v.v4[i] = (int32_t)(i * 4); - v.v8[i] = (int64_t)(i * 8); - v.f4[i] = (float)(i * 40); - v.f8[i] = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin[0]); ++j) { - v.bin[i][j] = (char)(i + '0'); - } - strcpy(v.blob[i], "一二三四五六七八九十"); - - t8_len[i] = sizeof(int8_t); - t16_len[i] = sizeof(int16_t); - t32_len[i] = sizeof(int32_t); - t64_len[i] = sizeof(int64_t); - float_len[i] = sizeof(float); - double_len[i] = sizeof(double); - bin_len[i] = sizeof(v.bin[0]); - blob_len[i] = (int32_t)strlen(v.blob[i]); - } - - taos_stmt_bind_param_batch(stmt, params); - taos_stmt_add_batch(stmt); - - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - taos_stmt_close(stmt); - - // query the records - stmt = taos_stmt_init(taos); - taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); - - TAOS_BIND qparams[2]; - - int8_t v1 = 5; - int16_t v2 = 15; - qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; - qparams[0].buffer_length = sizeof(v1); - qparams[0].buffer = &v1; - qparams[0].length = &qparams[0].buffer_length; - qparams[0].is_null = NULL; - - qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; - qparams[1].buffer_length = sizeof(v2); - qparams[1].buffer = &v2; - qparams[1].length = &qparams[1].buffer_length; - qparams[1].is_null = NULL; - - taos_stmt_bind_param(stmt, qparams); - if (taos_stmt_execute(stmt) != 0) { - printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); - taos_stmt_close(stmt); - return; - } - - result = taos_stmt_use_result(stmt); - - TAOS_ROW row; - int rows = 0; - int num_fields = taos_num_fields(result); - TAOS_FIELD* fields = taos_fetch_fields(result); - - // fetch the records row by row - while ((row = taos_fetch_row(result))) { - char temp[256] = {0}; - rows++; - taos_print_row(temp, row, fields, num_fields); - printf("%s\n", temp); - } - - taos_free_result(result); - taos_stmt_close(stmt); - - free(t8_len); - free(t16_len); - free(t32_len); - free(t64_len); - free(float_len); - free(double_len); - free(bin_len); - free(blob_len); -} - -void retrieve_callback(void* param, TAOS_RES* tres, int numOfRows) { - if (numOfRows > 0) { - printf("%d rows async retrieved\n", numOfRows); - taos_fetch_rows_a(tres, retrieve_callback, param); - } else { - if (numOfRows < 0) { - printf("\033[31masync retrieve failed, code: %d\033[0m\n", numOfRows); - } else { - printf("async retrieve completed\n"); - } - taos_free_result(tres); - } -} - -void select_callback(void* param, TAOS_RES* tres, int code) { - if (code == 0 && tres) { - taos_fetch_rows_a(tres, retrieve_callback, param); - } else { - printf("\033[31masync select failed, code: %d\033[0m\n", code); - } -} - -void verify_async(TAOS* taos) { - prepare_data(taos); - taos_query_a(taos, "select * from meters", select_callback, NULL); - usleep(1000000); -} - -void stream_callback(void* param, TAOS_RES* res, TAOS_ROW row) { - if (res == NULL || row == NULL) { - return; - } - - int num_fields = taos_num_fields(res); - TAOS_FIELD* fields = taos_fetch_fields(res); - - printf("got one row from stream_callback\n"); - char temp[256] = {0}; - taos_print_row(temp, row, fields, num_fields); - puts(temp); -} - -void verify_stream(TAOS* taos) { - prepare_data(taos); - TAOS_STREAM* strm = - taos_open_stream(taos, "select count(*) from meters interval(1m)", stream_callback, 0, NULL, NULL); - printf("waiting for stream data\n"); - usleep(100000); - TAOS_RES* result = taos_query(taos, "insert into t0 values(now, 0)(now+5s,1)(now+10s, 2);"); - taos_free_result(result); - usleep(200000000); - taos_close_stream(strm); -} - -int32_t verify_schema_less(TAOS* taos) { - TAOS_RES* result; - result = taos_query(taos, "drop database if exists test;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database test precision 'us' update 1;"); - taos_free_result(result); - usleep(100000); - - taos_select_db(taos, "test"); - result = taos_query(taos, "create stable ste(ts timestamp, f int) tags(t1 bigint)"); - taos_free_result(result); - usleep(100000); - - int code = 0; - - char* lines[] = { - "st,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "st,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833640000000ns", - "ste,t2=5f64,t3=L\"ste\" c1=true,c2=4i64,c3=\"iam\" 1626056811823316532ns", - "st,t1=4i64,t2=5f64,t3=\"t4\" c1=3i64,c3=L\"passitagain\",c2=true,c4=5f64 1626006833642000000ns", - "ste,t2=5f64,t3=L\"ste2\" c3=\"iamszhou\",c4=false 1626056811843316532ns", - "ste,t2=5f64,t3=L\"ste2\" c3=\"iamszhou\",c4=false,c5=32i8,c6=64i16,c7=32i32,c8=88.88f32 1626056812843316532ns", - "st,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64,c6=7u64 " - "1626006933640000000ns", - "stf,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64,c6=7u64 " - "1626006933640000000ns", - "stf,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 " - "1626006933641000000ns"}; - - code = taos_insert_lines(taos, lines, sizeof(lines) / sizeof(char*)); - - char* lines2[] = { - "stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833640000000ns"}; - code = taos_insert_lines(taos, &lines2[0], 1); - code = taos_insert_lines(taos, &lines2[1], 1); - - char* lines3[] = { - "sth,t1=4i64,t2=5f64,t4=5f64,ID=\"childtable\" c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 " - "1626006933641ms", - "sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 1626006933654ms"}; - code = taos_insert_lines(taos, lines3, 2); - - char* lines4[] = {"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532ns"}; - code = taos_insert_lines(taos, lines4, 2); - - char* lines5[] = { - "zqlbgs,id=\"zqlbgs_39302_21680\",t0=f,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11." - "12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" " - "c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=" - "\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000ns", - "zqlbgs,t9=f,id=\"zqlbgs_39302_21680\",t0=f,t1=127i8,t11=127i8,t2=32767i16,t3=2147483647i32,t4=" - "9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\",t10=" - "L\"ncharTagValue\" " - "c10=f,c0=f,c1=127i8,c12=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22." - "123456789f64,c7=\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64,c11=L\"ncharColValue\" 1626006833639000000ns"}; - code = taos_insert_lines(taos, &lines5[0], 1); - code = taos_insert_lines(taos, &lines5[1], 1); - - char* lines6[] = {"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000ns", - "dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532ns"}; - code = taos_insert_lines(taos, lines6, 2); - return (code); -} - -void verify_telnet_insert(TAOS* taos) { - TAOS_RES* result; - - result = taos_query(taos, "drop database if exists db;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database db precision 'ms';"); - taos_free_result(result); - usleep(100000); - - (void)taos_select_db(taos, "db"); - int32_t code = 0; - - /* metric */ - char* lines0[] = { - "stb0_0 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - "stb0_1 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - "stb0_2 1626006833639000000ns 4i8 host=\"host0\",interface=\"eth0\"", - }; - code = taos_insert_telnet_lines(taos, lines0, 3); - if (code) { - printf("lines0 code: %d, %s.\n", code, tstrerror(code)); - } - - /* timestamp */ - char* lines1[] = { - "stb1 1626006833s 1i8 host=\"host0\"", "stb1 1626006833639000000ns 2i8 host=\"host0\"", - "stb1 1626006833640000us 3i8 host=\"host0\"", "stb1 1626006833641123 4i8 host=\"host0\"", - "stb1 1626006833651ms 5i8 host=\"host0\"", "stb1 0 6i8 host=\"host0\"", - }; - code = taos_insert_telnet_lines(taos, lines1, 6); - if (code) { - printf("lines1 code: %d, %s.\n", code, tstrerror(code)); - } - - /* metric value */ - // tinyin - char* lines2_0[] = {"stb2_0 1626006833651ms -127i8 host=\"host0\"", "stb2_0 1626006833652ms 127i8 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_0, 2); - if (code) { - printf("lines2_0 code: %d, %s.\n", code, tstrerror(code)); - } - - // smallint - char* lines2_1[] = {"stb2_1 1626006833651ms -32767i16 host=\"host0\"", - "stb2_1 1626006833652ms 32767i16 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_1, 2); - if (code) { - printf("lines2_1 code: %d, %s.\n", code, tstrerror(code)); - } - - // int - char* lines2_2[] = {"stb2_2 1626006833651ms -2147483647i32 host=\"host0\"", - "stb2_2 1626006833652ms 2147483647i32 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_2, 2); - if (code) { - printf("lines2_2 code: %d, %s.\n", code, tstrerror(code)); - } - - // bigint - char* lines2_3[] = {"stb2_3 1626006833651ms -9223372036854775807i64 host=\"host0\"", - "stb2_3 1626006833652ms 9223372036854775807i64 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_3, 2); - if (code) { - printf("lines2_3 code: %d, %s.\n", code, tstrerror(code)); - } - - // float - char* lines2_4[] = { - "stb2_4 1626006833610ms 3f32 host=\"host0\"", "stb2_4 1626006833620ms -3f32 host=\"host0\"", - "stb2_4 1626006833630ms 3.4f32 host=\"host0\"", "stb2_4 1626006833640ms -3.4f32 host=\"host0\"", - "stb2_4 1626006833650ms 3.4E10f32 host=\"host0\"", "stb2_4 1626006833660ms -3.4e10f32 host=\"host0\"", - "stb2_4 1626006833670ms 3.4E+2f32 host=\"host0\"", "stb2_4 1626006833680ms -3.4e-2f32 host=\"host0\"", - "stb2_4 1626006833690ms 3.15 host=\"host0\"", "stb2_4 1626006833700ms 3.4E38f32 host=\"host0\"", - "stb2_4 1626006833710ms -3.4E38f32 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_4, 11); - if (code) { - printf("lines2_4 code: %d, %s.\n", code, tstrerror(code)); - } - - // double - char* lines2_5[] = { - "stb2_5 1626006833610ms 3f64 host=\"host0\"", "stb2_5 1626006833620ms -3f64 host=\"host0\"", - "stb2_5 1626006833630ms 3.4f64 host=\"host0\"", "stb2_5 1626006833640ms -3.4f64 host=\"host0\"", - "stb2_5 1626006833650ms 3.4E10f64 host=\"host0\"", "stb2_5 1626006833660ms -3.4e10f64 host=\"host0\"", - "stb2_5 1626006833670ms 3.4E+2f64 host=\"host0\"", "stb2_5 1626006833680ms -3.4e-2f64 host=\"host0\"", - "stb2_5 1626006833690ms 1.7E308f64 host=\"host0\"", "stb2_5 1626006833700ms -1.7E308f64 host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_5, 10); - if (code) { - printf("lines2_5 code: %d, %s.\n", code, tstrerror(code)); - } - - // bool - char* lines2_6[] = {"stb2_6 1626006833610ms t host=\"host0\"", "stb2_6 1626006833620ms T host=\"host0\"", - "stb2_6 1626006833630ms true host=\"host0\"", "stb2_6 1626006833640ms True host=\"host0\"", - "stb2_6 1626006833650ms TRUE host=\"host0\"", "stb2_6 1626006833660ms f host=\"host0\"", - "stb2_6 1626006833670ms F host=\"host0\"", "stb2_6 1626006833680ms false host=\"host0\"", - "stb2_6 1626006833690ms False host=\"host0\"", "stb2_6 1626006833700ms FALSE host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_6, 10); - if (code) { - printf("lines2_6 code: %d, %s.\n", code, tstrerror(code)); - } - - // binary - char* lines2_7[] = {"stb2_7 1626006833610ms \"binary_val.!@#$%^&*\" host=\"host0\"", - "stb2_7 1626006833620ms \"binary_val.:;,./?|+-=\" host=\"host0\"", - "stb2_7 1626006833630ms \"binary_val.()[]{}<>\" host=\"host0\""}; - code = taos_insert_telnet_lines(taos, lines2_7, 3); - if (code) { - printf("lines2_7 code: %d, %s.\n", code, tstrerror(code)); - } - - // nchar - char* lines2_8[] = { - "stb2_8 1626006833610ms L\"nchar_val数值一\" host=\"host0\"", - "stb2_8 1626006833620ms L\"nchar_val数值二\" host=\"host0\"", - }; - code = taos_insert_telnet_lines(taos, lines2_8, 2); - if (code) { - printf("lines2_8 code: %d, %s.\n", code, tstrerror(code)); - } - - /* tags */ - // tag value types - char* lines3_0[] = { - "stb3_0 1626006833610ms 1 " - "t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=3.4E38f32,t6=1.7E308f64,t7=true,t8=\"binary_" - "val_1\",t9=L\"标签值1\"", - "stb3_0 1626006833610ms 2 " - "t1=-127i8,t2=-32767i16,t3=-2147483647i32,t4=-9223372036854775807i64,t5=-3.4E38f32,t6=-1.7E308f64,t7=false,t8=" - "\"binary_val_2\",t9=L\"标签值2\""}; - code = taos_insert_telnet_lines(taos, lines3_0, 2); - if (code) { - printf("lines3_0 code: %d, %s.\n", code, tstrerror(code)); - } - - // tag ID as child table name - char* lines3_1[] = {"stb3_1 1626006833610ms 1 id=\"child_table1\",host=\"host1\"", - "stb3_1 1626006833610ms 2 host=\"host2\",iD=\"child_table2\"", - "stb3_1 1626006833610ms 3 ID=\"child_table3\",host=\"host3\""}; - code = taos_insert_telnet_lines(taos, lines3_1, 3); - if (code) { - printf("lines3_1 code: %d, %s.\n", code, tstrerror(code)); - } - - return; -} - -void verify_json_insert(TAOS* taos) { - TAOS_RES* result; - - result = taos_query(taos, "drop database if exists db;"); - taos_free_result(result); - usleep(100000); - result = taos_query(taos, "create database db precision 'ms';"); - taos_free_result(result); - usleep(100000); - - (void)taos_select_db(taos, "db"); - int32_t code = 0; - - char* message = - "{ \ - \"metric\":\"cpu_load_0\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface1\": \"eth0\", \ - \"Id\": \"tb0\" \ - } \ - }"; - - code = taos_insert_json_payload(taos, message); - if (code) { - printf("payload_0 code: %d, %s.\n", code, tstrerror(code)); - } - - char* message1 = - "[ \ - { \ - \"metric\":\"cpu_load_1\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth1\", \ - \"Id\": \"tb1\" \ - } \ - }, \ - { \ - \"metric\":\"cpu_load_2\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 55.5, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth2\", \ - \"Id\": \"tb2\" \ - } \ - } \ - ]"; - - code = taos_insert_json_payload(taos, message1); - if (code) { - printf("payload_1 code: %d, %s.\n", code, tstrerror(code)); - } - - char* message2 = - "[ \ - { \ - \"metric\":\"cpu_load_3\", \ - \"timestamp\": \ - { \ - \"value\": 1626006833610123, \ - \"type\": \"us\" \ - }, \ - \"value\": \ - { \ - \"value\": 55, \ - \"type\": \"int\" \ - }, \ - \"tags\": \ - { \ - \"host\": \ - { \ - \"value\": \"ubuntu\", \ - \"type\": \"binary\" \ - }, \ - \"interface\": \ - { \ - \"value\": \"eth3\", \ - \"type\": \"nchar\" \ - }, \ - \"ID\": \"tb3\", \ - \"port\": \ - { \ - \"value\": 4040, \ - \"type\": \"int\" \ - } \ - } \ - }, \ - { \ - \"metric\":\"cpu_load_4\", \ - \"timestamp\": 1626006833610123, \ - \"value\": 66.6, \ - \"tags\": \ - { \ - \"host\": \"ubuntu\", \ - \"interface\": \"eth4\", \ - \"Id\": \"tb4\" \ - } \ - } \ - ]"; - code = taos_insert_json_payload(taos, message2); - if (code) { - printf("payload_2 code: %d, %s.\n", code, tstrerror(code)); - } - - cJSON *payload, *tags; - char* payload_str; - - /* Default format */ - // number - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_0"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // true - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_1"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddTrueToObject(payload, "value"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // false - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_2"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddFalseToObject(payload, "value"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // string - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_3"); - cJSON_AddNumberToObject(payload, "timestamp", 1626006833610123); - cJSON_AddStringToObject(payload, "value", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // timestamp 0 -> current time - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_4"); - cJSON_AddNumberToObject(payload, "timestamp", 0); - cJSON_AddNumberToObject(payload, "value", 123); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // ID - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb0_5"); - cJSON_AddNumberToObject(payload, "timestamp", 0); - cJSON_AddNumberToObject(payload, "value", 123); - tags = cJSON_CreateObject(); - cJSON_AddStringToObject(tags, "ID", "tb0_5"); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddStringToObject(tags, "iD", "tb000"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddStringToObject(tags, "id", "tb555"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload0_5 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - /* Nested format */ - // timestamp - cJSON* timestamp; - // seconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // milleseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_1"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610); - cJSON_AddStringToObject(timestamp, "type", "ms"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // microseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_2"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610123); - cJSON_AddStringToObject(timestamp, "type", "us"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // nanoseconds - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_3"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833610123321); - cJSON_AddStringToObject(timestamp, "type", "ns"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // now - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb1_4"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 0); - cJSON_AddStringToObject(timestamp, "type", "ns"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - cJSON_AddNumberToObject(payload, "value", 10); - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload1_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // metric value - cJSON* metric_val; - // bool - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddTrueToObject(metric_val, "value"); - cJSON_AddStringToObject(metric_val, "type", "bool"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // tinyint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_1"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 127); - cJSON_AddStringToObject(metric_val, "type", "tinyint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_1 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // smallint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_2"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 32767); - cJSON_AddStringToObject(metric_val, "type", "smallint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_2 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // int - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_3"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 2147483647); - cJSON_AddStringToObject(metric_val, "type", "int"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_3 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // bigint - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_4"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 9223372036854775807); - cJSON_AddStringToObject(metric_val, "type", "bigint"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_4 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // float - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_5"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 11.12345); - cJSON_AddStringToObject(metric_val, "type", "float"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_5 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // double - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_6"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddNumberToObject(metric_val, "value", 22.123456789); - cJSON_AddStringToObject(metric_val, "type", "double"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_6 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // binary - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_7"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddStringToObject(metric_val, "type", "binary"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_7 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // nchar - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb2_8"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "你好"); - cJSON_AddStringToObject(metric_val, "type", "nchar"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - cJSON_AddTrueToObject(tags, "t1"); - cJSON_AddFalseToObject(tags, "t2"); - cJSON_AddNumberToObject(tags, "t3", 10); - cJSON_AddStringToObject(tags, "t4", "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"); - cJSON_AddItemToObject(payload, "tags", tags); - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload2_8 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); - - // tag value - cJSON* tag; - - payload = cJSON_CreateObject(); - cJSON_AddStringToObject(payload, "metric", "stb3_0"); - - timestamp = cJSON_CreateObject(); - cJSON_AddNumberToObject(timestamp, "value", 1626006833); - cJSON_AddStringToObject(timestamp, "type", "s"); - cJSON_AddItemToObject(payload, "timestamp", timestamp); - - metric_val = cJSON_CreateObject(); - cJSON_AddStringToObject(metric_val, "value", "hello"); - cJSON_AddStringToObject(metric_val, "type", "nchar"); - cJSON_AddItemToObject(payload, "value", metric_val); - - tags = cJSON_CreateObject(); - - tag = cJSON_CreateObject(); - cJSON_AddTrueToObject(tag, "value"); - cJSON_AddStringToObject(tag, "type", "bool"); - cJSON_AddItemToObject(tags, "t1", tag); - - tag = cJSON_CreateObject(); - cJSON_AddFalseToObject(tag, "value"); - cJSON_AddStringToObject(tag, "type", "bool"); - cJSON_AddItemToObject(tags, "t2", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 127); - cJSON_AddStringToObject(tag, "type", "tinyint"); - cJSON_AddItemToObject(tags, "t3", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 32767); - cJSON_AddStringToObject(tag, "type", "smallint"); - cJSON_AddItemToObject(tags, "t4", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 2147483647); - cJSON_AddStringToObject(tag, "type", "int"); - cJSON_AddItemToObject(tags, "t5", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 9223372036854775807); - cJSON_AddStringToObject(tag, "type", "bigint"); - cJSON_AddItemToObject(tags, "t6", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 11.12345); - cJSON_AddStringToObject(tag, "type", "float"); - cJSON_AddItemToObject(tags, "t7", tag); - - tag = cJSON_CreateObject(); - cJSON_AddNumberToObject(tag, "value", 22.1234567890); - cJSON_AddStringToObject(tag, "type", "double"); - cJSON_AddItemToObject(tags, "t8", tag); - - tag = cJSON_CreateObject(); - cJSON_AddStringToObject(tag, "value", "binary_val"); - cJSON_AddStringToObject(tag, "type", "binary"); - cJSON_AddItemToObject(tags, "t9", tag); - - tag = cJSON_CreateObject(); - cJSON_AddStringToObject(tag, "value", "你好"); - cJSON_AddStringToObject(tag, "type", "nchar"); - cJSON_AddItemToObject(tags, "t10", tag); - - cJSON_AddItemToObject(payload, "tags", tags); - - payload_str = cJSON_Print(payload); - // printf("%s\n", payload_str); - - code = taos_insert_json_payload(taos, payload_str); - if (code) { - printf("payload3_0 code: %d, %s.\n", code, tstrerror(code)); - } - free(payload_str); - cJSON_Delete(payload); -} - -int main(int argc, char* argv[]) { - const char* host = "127.0.0.1"; - const char* user = "root"; - const char* passwd = "taosdata"; - - taos_options(TSDB_OPTION_TIMEZONE, "GMT-8"); - TAOS* taos = taos_connect(host, user, passwd, "", 0); - if (taos == NULL) { - printf("\033[31mfailed to connect to db, reason:%s\033[0m\n", taos_errstr(taos)); - exit(1); - } - - char* info = taos_get_server_info(taos); - printf("server info: %s\n", info); - info = taos_get_client_info(taos); - printf("client info: %s\n", info); - - printf("************ verify schema-less *************\n"); - verify_schema_less(taos); - - printf("************ verify telnet-insert *************\n"); - verify_telnet_insert(taos); - - printf("************ verify json-insert *************\n"); - verify_json_insert(taos); - - printf("************ verify query *************\n"); - verify_query(taos); - - printf("********* verify async query **********\n"); - verify_async(taos); - - printf("*********** verify subscribe ************\n"); - verify_subscribe(taos); - - printf("************ verify prepare *************\n"); - verify_prepare(taos); - - printf("************ verify prepare2 *************\n"); - verify_prepare2(taos); - printf("************ verify prepare3 *************\n"); - verify_prepare3(taos); - - printf("************ verify stream *************\n"); - verify_stream(taos); - printf("done\n"); - taos_close(taos); - taos_cleanup(); -} diff --git a/examples/c/asyncdemo.c b/examples/c/asyncdemo.c index 07e61b871e..83d217769b 100644 --- a/examples/c/asyncdemo.c +++ b/examples/c/asyncdemo.c @@ -23,8 +23,8 @@ #include #include #include - -#include "../../../include/client/taos.h" +#include +#include "taos.h" int points = 5; int numOfTables = 3; @@ -230,7 +230,7 @@ void taos_insert_call_back(void *param, TAOS_RES *tres, int code) if (tablesInsertProcessed >= numOfTables) { gettimeofday(&systemTime, NULL); et = systemTime.tv_sec * 1000000 + systemTime.tv_usec; - printf("%lld mseconds to insert %d data points\n", (et - st) / 1000, points*numOfTables); + printf("%" PRId64 " mseconds to insert %d data points\n", (et - st) / 1000, points*numOfTables); } } @@ -267,7 +267,7 @@ void taos_retrieve_call_back(void *param, TAOS_RES *tres, int numOfRows) if (tablesSelectProcessed >= numOfTables) { gettimeofday(&systemTime, NULL); et = systemTime.tv_sec * 1000000 + systemTime.tv_usec; - printf("%lld mseconds to query %d data rows\n", (et - st) / 1000, points * numOfTables); + printf("%" PRId64 " mseconds to query %d data rows\n", (et - st) / 1000, points * numOfTables); } taos_free_result(tres); diff --git a/examples/c/demo.c b/examples/c/demo.c index c3d9a5e96a..2eda8cd811 100644 --- a/examples/c/demo.c +++ b/examples/c/demo.c @@ -20,7 +20,7 @@ #include #include #include -#include "../../../include/client/taos.h" // TAOS header file +#include "taos.h" // TAOS header file static void queryDB(TAOS *taos, char *command) { int i; diff --git a/examples/c/epoll.c b/examples/c/epoll.c deleted file mode 100644 index 284268ac43..0000000000 --- a/examples/c/epoll.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify - * it under the terms of the GNU Affero General Public License, version 3 - * or later ("AGPL"), as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -// how to use to do a pressure-test upon eok -// tester: cat /dev/urandom | nc -c -// testee: ./debug/build/bin/epoll -l > /dev/null -// compare against: nc -l > /dev/null -// monitor and compare : glances - -#ifdef __APPLE__ -#include "osEok.h" -#else // __APPLE__ -#include -#endif // __APPLE__ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define D(fmt, ...) fprintf(stderr, "%s[%d]%s(): " fmt "\n", basename(__FILE__), __LINE__, __func__, ##__VA_ARGS__) -#define A(statement, fmt, ...) do { \ - if (statement) break; \ - fprintf(stderr, "%s[%d]%s(): assert [%s] failed: %d[%s]: " fmt "\n", \ - basename(__FILE__), __LINE__, __func__, \ - #statement, errno, strerror(errno), \ - ##__VA_ARGS__); \ - abort(); \ -} while (0) - -#define E(fmt, ...) do { \ - fprintf(stderr, "%s[%d]%s(): %d[%s]: " fmt "\n", \ - basename(__FILE__), __LINE__, __func__, \ - errno, strerror(errno), \ - ##__VA_ARGS__); \ -} while (0) - -#include "os.h" - -typedef struct ep_s ep_t; -struct ep_s { - int ep; - - pthread_mutex_t lock; - int sv[2]; // 0 for read, 1 for write; - pthread_t thread; - - volatile unsigned int stopping:1; - volatile unsigned int waiting:1; - volatile unsigned int wakenup:1; -}; - -static int ep_dummy = 0; - -static ep_t* ep_create(void); -static void ep_destroy(ep_t *ep); -static void* routine(void* arg); -static int open_listen(unsigned short port); - -typedef struct fde_s fde_t; -struct fde_s { - int skt; - void (*on_event)(ep_t *ep, struct epoll_event *events, fde_t *client); -}; - -static void listen_event(ep_t *ep, struct epoll_event *ev, fde_t *client); -static void null_event(ep_t *ep, struct epoll_event *ev, fde_t *client); - -#define usage(arg0, fmt, ...) do { \ - if (fmt[0]) { \ - fprintf(stderr, "" fmt "\n", ##__VA_ARGS__); \ - } \ - fprintf(stderr, "usage:\n"); \ - fprintf(stderr, " %s -l : specify listenning port\n", arg0); \ -} while (0) - -int main(int argc, char *argv[]) { - char *prg = basename(argv[0]); - if (argc==1) { - usage(prg, ""); - return 0; - } - ep_t* ep = ep_create(); - A(ep, "failed"); - for (int i=1; i=argc) { - usage(prg, "expecting after -l, but got nothing"); - return 1; // confirmed potential leakage - } - arg = argv[i]; - int port = atoi(arg); - int skt = open_listen(port); - if (skt==-1) continue; - fde_t *client = (fde_t*)calloc(1, sizeof(*client)); - if (!client) { - E("out of memory"); - close(skt); - continue; - } - client->skt = skt; - client->on_event = listen_event; - struct epoll_event ev = {0}; - ev.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLRDHUP; - ev.data.ptr = client; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, skt, &ev), ""); - continue; - } - usage(prg, "unknown argument: [%s]", arg); - return 1; - } - char *line = NULL; - size_t linecap = 0; - ssize_t linelen; - while ((linelen = getline(&line, &linecap, stdin)) > 0) { - line[strlen(line)-1] = '\0'; - if (0==strcmp(line, "exit")) break; - if (0==strcmp(line, "quit")) break; - if (line==strstr(line, "close")) { - int fd = 0; - sscanf(line, "close %d", &fd); - if (fd<=2) { - fprintf(stderr, "fd [%d] invalid\n", fd); - continue; - } - A(0==epoll_ctl(ep->ep, EPOLL_CTL_DEL, fd, NULL), ""); - continue; - } - if (strlen(line)==0) continue; - fprintf(stderr, "unknown cmd:[%s]\n", line); - } - ep_destroy(ep); - D(""); - return 0; -} - -ep_t* ep_create(void) { - ep_t *ep = (ep_t*)calloc(1, sizeof(*ep)); - A(ep, "out of memory"); - A(-1!=(ep->ep = epoll_create(1)), ""); - ep->sv[0] = -1; - ep->sv[1] = -1; - A(0==socketpair(AF_LOCAL, SOCK_STREAM, 0, ep->sv), ""); - A(0==pthread_mutex_init(&ep->lock, NULL), ""); - A(0==pthread_mutex_lock(&ep->lock), ""); - struct epoll_event ev = {0}; - ev.events = EPOLLIN; - ev.data.ptr = &ep_dummy; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, ep->sv[0], &ev), ""); - A(0==pthread_create(&ep->thread, NULL, routine, ep), ""); - A(0==pthread_mutex_unlock(&ep->lock), ""); - return ep; -} - -static void ep_destroy(ep_t *ep) { - A(ep, "invalid argument"); - ep->stopping = 1; - A(1==send(ep->sv[1], "1", 1, 0), ""); - A(0==pthread_join(ep->thread, NULL), ""); - A(0==pthread_mutex_destroy(&ep->lock), ""); - A(0==close(ep->sv[0]), ""); - A(0==close(ep->sv[1]), ""); - A(0==close(ep->ep), ""); - free(ep); -} - -static void* routine(void* arg) { - A(arg, "invalid argument"); - ep_t *ep = (ep_t*)arg; - - while (!ep->stopping) { - struct epoll_event evs[10]; - memset(evs, 0, sizeof(evs)); - - A(0==pthread_mutex_lock(&ep->lock), ""); - A(ep->waiting==0, "internal logic error"); - ep->waiting = 1; - A(0==pthread_mutex_unlock(&ep->lock), ""); - - int r = epoll_wait(ep->ep, evs, sizeof(evs)/sizeof(evs[0]), -1); - A(r>0, "indefinite epoll_wait shall not timeout:[%d]", r); - - A(0==pthread_mutex_lock(&ep->lock), ""); - A(ep->waiting==1, "internal logic error"); - ep->waiting = 0; - A(0==pthread_mutex_unlock(&ep->lock), ""); - - for (int i=0; idata.ptr == &ep_dummy) { - char c = '\0'; - A(1==recv(ep->sv[0], &c, 1, 0), "internal logic error"); - A(0==pthread_mutex_lock(&ep->lock), ""); - ep->wakenup = 0; - A(0==pthread_mutex_unlock(&ep->lock), ""); - continue; - } - A(ev->data.ptr, "internal logic error"); - fde_t *client = (fde_t*)ev->data.ptr; - client->on_event(ep, ev, client); - continue; - } - } - return NULL; -} - -static int open_listen(unsigned short port) { - int r = 0; - int skt = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (skt==-1) { - E("socket() failed"); - return -1; - } - do { - struct sockaddr_in si = {0}; - si.sin_family = AF_INET; - si.sin_addr.s_addr = inet_addr("0.0.0.0"); - si.sin_port = htons(port); - r = bind(skt, (struct sockaddr*)&si, sizeof(si)); - if (r) { - E("bind(%u) failed", port); - break; - } - r = listen(skt, 100); - if (r) { - E("listen() failed"); - break; - } - memset(&si, 0, sizeof(si)); - socklen_t len = sizeof(si); - r = getsockname(skt, (struct sockaddr *)&si, &len); - if (r) { - E("getsockname() failed"); - } - A(len==sizeof(si), "internal logic error"); - D("listenning at: %d", ntohs(si.sin_port)); - return skt; - } while (0); - close(skt); - return -1; -} - -static void listen_event(ep_t *ep, struct epoll_event *ev, fde_t *client) { - A(ev->events & EPOLLIN, "internal logic error"); - struct sockaddr_in si = {0}; - socklen_t silen = sizeof(si); - int skt = accept(client->skt, (struct sockaddr*)&si, &silen); - A(skt!=-1, "internal logic error"); - fde_t *server = (fde_t*)calloc(1, sizeof(*server)); - if (!server) { - close(skt); - return; - } - server->skt = skt; - server->on_event = null_event; - struct epoll_event ee = {0}; - ee.events = EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLRDHUP; - ee.data.ptr = server; - A(0==epoll_ctl(ep->ep, EPOLL_CTL_ADD, skt, &ee), ""); -} - -static void null_event(ep_t *ep, struct epoll_event *ev, fde_t *client) { - if (ev->events & EPOLLIN) { - char buf[8192]; - int n = recv(client->skt, buf, sizeof(buf), 0); - A(n>=0 && n<=sizeof(buf), "internal logic error:[%d]", n); - A(n==fwrite(buf, 1, n, stdout), "internal logic error"); - } - if (ev->events & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) { - A(0==pthread_mutex_lock(&ep->lock), ""); - A(0==epoll_ctl(ep->ep, EPOLL_CTL_DEL, client->skt, NULL), ""); - A(0==pthread_mutex_unlock(&ep->lock), ""); - close(client->skt); - client->skt = -1; - client->on_event = NULL; - free(client); - } -} - diff --git a/examples/c/makefile b/examples/c/makefile index c85eb4adc5..244d13fad7 100644 --- a/examples/c/makefile +++ b/examples/c/makefile @@ -7,22 +7,21 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \ -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \ -Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99 \ - -I../../../deps/cJson/inc + -I/usr/local/include/cjson all: $(TARGET) exe: gcc $(CFLAGS) ./asyncdemo.c -o $(ROOT)asyncdemo $(LFLAGS) gcc $(CFLAGS) ./demo.c -o $(ROOT)demo $(LFLAGS) gcc $(CFLAGS) ./prepare.c -o $(ROOT)prepare $(LFLAGS) - gcc $(CFLAGS) ./stream.c -o $(ROOT)stream $(LFLAGS) - gcc $(CFLAGS) ./subscribe.c -o $(ROOT)subscribe $(LFLAGS) - gcc $(CFLAGS) ./apitest.c -o $(ROOT)apitest $(LFLAGS) + gcc $(CFLAGS) ./stream_demo.c -o $(ROOT)stream_demo $(LFLAGS) + gcc $(CFLAGS) ./tmq.c -o $(ROOT)tmq $(LFLAGS) + gcc $(CFLAGS) ./schemaless.c -o $(ROOT)schemaless $(LFLAGS) clean: rm $(ROOT)asyncdemo rm $(ROOT)demo rm $(ROOT)prepare - rm $(ROOT)batchprepare - rm $(ROOT)stream - rm $(ROOT)subscribe - rm $(ROOT)apitest + rm $(ROOT)stream_demo + rm $(ROOT)tmq + rm $(ROOT)schemaless diff --git a/examples/c/prepare.c b/examples/c/prepare.c index f0341cfe12..4f05b6fb4c 100644 --- a/examples/c/prepare.c +++ b/examples/c/prepare.c @@ -4,7 +4,7 @@ #include #include #include -#include "../../../include/client/taos.h" +#include "taos.h" void taosMsleep(int mseconds); @@ -70,70 +70,89 @@ int main(int argc, char *argv[]) char blob[80]; } v = {0}; + int32_t boolLen = sizeof(int8_t); + int32_t sintLen = sizeof(int16_t); + int32_t intLen = sizeof(int32_t); + int32_t bintLen = sizeof(int64_t); + int32_t floatLen = sizeof(float); + int32_t doubleLen = sizeof(double); + int32_t binLen = sizeof(v.bin); + int32_t ncharLen = 30; + stmt = taos_stmt_init(taos); - TAOS_BIND params[10]; + TAOS_MULTI_BIND params[10]; params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; params[0].buffer_length = sizeof(v.ts); params[0].buffer = &v.ts; - params[0].length = ¶ms[0].buffer_length; + params[0].length = &bintLen; params[0].is_null = NULL; + params[0].num = 1; params[1].buffer_type = TSDB_DATA_TYPE_BOOL; params[1].buffer_length = sizeof(v.b); params[1].buffer = &v.b; - params[1].length = ¶ms[1].buffer_length; + params[1].length = &boolLen; params[1].is_null = NULL; + params[1].num = 1; params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; params[2].buffer_length = sizeof(v.v1); params[2].buffer = &v.v1; - params[2].length = ¶ms[2].buffer_length; + params[2].length = &boolLen; params[2].is_null = NULL; + params[2].num = 1; params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; params[3].buffer_length = sizeof(v.v2); params[3].buffer = &v.v2; - params[3].length = ¶ms[3].buffer_length; + params[3].length = &sintLen; params[3].is_null = NULL; + params[3].num = 1; params[4].buffer_type = TSDB_DATA_TYPE_INT; params[4].buffer_length = sizeof(v.v4); params[4].buffer = &v.v4; - params[4].length = ¶ms[4].buffer_length; + params[4].length = &intLen; params[4].is_null = NULL; + params[4].num = 1; params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; params[5].buffer_length = sizeof(v.v8); params[5].buffer = &v.v8; - params[5].length = ¶ms[5].buffer_length; + params[5].length = &bintLen; params[5].is_null = NULL; + params[5].num = 1; params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; params[6].buffer_length = sizeof(v.f4); params[6].buffer = &v.f4; - params[6].length = ¶ms[6].buffer_length; + params[6].length = &floatLen; params[6].is_null = NULL; + params[6].num = 1; params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; params[7].buffer_length = sizeof(v.f8); params[7].buffer = &v.f8; - params[7].length = ¶ms[7].buffer_length; + params[7].length = &doubleLen; params[7].is_null = NULL; + params[7].num = 1; params[8].buffer_type = TSDB_DATA_TYPE_BINARY; params[8].buffer_length = sizeof(v.bin); params[8].buffer = v.bin; - params[8].length = ¶ms[8].buffer_length; + params[8].length = &binLen; params[8].is_null = NULL; + params[8].num = 1; strcpy(v.blob, "一二三四五六七八九十"); params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; - params[9].buffer_length = strlen(v.blob); + params[9].buffer_length = sizeof(v.blob); params[9].buffer = v.blob; - params[9].length = ¶ms[9].buffer_length; + params[9].length = &ncharLen; params[9].is_null = NULL; + params[9].num = 1; - int is_null = 1; + char is_null = 1; sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; code = taos_stmt_prepare(stmt, sql, 0); @@ -153,7 +172,7 @@ int main(int argc, char *argv[]) v.v8 = (int64_t)(i * 8); v.f4 = (float)(i * 40); v.f8 = (double)(i * 80); - for (int j = 0; j < sizeof(v.bin) - 1; ++j) { + for (int j = 0; j < sizeof(v.bin); ++j) { v.bin[j] = (char)(i + '0'); } diff --git a/examples/c/schemaless.c b/examples/c/schemaless.c index 99aa361b0a..328a663ae7 100644 --- a/examples/c/schemaless.c +++ b/examples/c/schemaless.c @@ -1,32 +1,17 @@ -#include "../../../include/client/taos.h" -#include "os.h" -#include "taoserror.h" - +#include "taos.h" #include #include #include #include #include +#include +#include + int numSuperTables = 8; int numChildTables = 4; int numRowsPerChildTable = 2048; -void shuffle(char**lines, size_t n) -{ - if (n > 1) - { - size_t i; - for (i = 0; i < n - 1; i++) - { - size_t j = i + taosRand() / (RAND_MAX / (n - i) + 1); - char* t = lines[j]; - lines[j] = lines[i]; - lines[i] = t; - } - } -} - static int64_t getTimeInUs() { struct timeval systemTime; gettimeofday(&systemTime, NULL); @@ -46,7 +31,7 @@ int main(int argc, char* argv[]) { exit(1); } - char* info = taos_get_server_info(taos); + const char* info = taos_get_server_info(taos); printf("server info: %s\n", info); info = taos_get_client_info(taos); printf("client info: %s\n", info); @@ -61,9 +46,10 @@ int main(int argc, char* argv[]) { time_t ct = time(0); int64_t ts = ct * 1000; - char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %lldms"; + char* lineFormat = "sta%d,t0=true,t1=127i8,t2=32767i16,t3=%di32,t4=9223372036854775807i64,t9=11.12345f32,t10=22.123456789f64,t11=\"binaryTagValue\",t12=L\"ncharTagValue\" c0=true,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=254u8,c6=32770u16,c7=2147483699u32,c8=9223372036854775899u64,c9=11.12345f32,c10=22.123456789f64,c11=\"binaryValue\",c12=L\"ncharValue\" %" PRId64; - char** lines = calloc(numSuperTables * numChildTables * numRowsPerChildTable, sizeof(char*)); + int lineNum = numSuperTables * numChildTables * numRowsPerChildTable; + char** lines = calloc((size_t)lineNum, sizeof(char*)); int l = 0; for (int i = 0; i < numSuperTables; ++i) { for (int j = 0; j < numChildTables; ++j) { @@ -75,13 +61,13 @@ int main(int argc, char* argv[]) { } } } - //shuffle(lines, numSuperTables * numChildTables * numRowsPerChildTable); printf("%s\n", "begin taos_insert_lines"); int64_t begin = getTimeInUs(); - int32_t code = taos_insert_lines(taos, lines, numSuperTables * numChildTables * numRowsPerChildTable); + TAOS_RES *res = taos_schemaless_insert(taos, lines, lineNum, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_MILLI_SECONDS); int64_t end = getTimeInUs(); - printf("code: %d, %s. time used: %"PRId64"\n", code, tstrerror(code), end-begin); + printf("code: %s. time used: %" PRId64 "\n", taos_errstr(res), end-begin); + taos_free_result(res); return 0; } diff --git a/examples/c/stream_demo.c b/examples/c/stream_demo.c index 46c8297fba..46107c7e13 100644 --- a/examples/c/stream_demo.c +++ b/examples/c/stream_demo.c @@ -108,10 +108,13 @@ int32_t create_stream() { } int main(int argc, char* argv[]) { - int code; if (argc > 1) { printf("env init\n"); - code = init_env(); + int code = init_env(); + if (code) { + return code; + } + } create_stream(); } diff --git a/examples/c/tmq.c b/examples/c/tmq.c index 1147671ea1..71e571d4dd 100644 --- a/examples/c/tmq.c +++ b/examples/c/tmq.c @@ -21,9 +21,6 @@ #include "taos.h" static int running = 1; -static char dbName[64] = "tmqdb"; -static char stbName[64] = "stb"; -static char topicName[64] = "topicname"; static int32_t msg_process(TAOS_RES* msg) { char buf[1024]; @@ -43,7 +40,7 @@ static int32_t msg_process(TAOS_RES* msg) { TAOS_FIELD* fields = taos_fetch_fields(msg); int32_t numOfFields = taos_field_count(msg); - int32_t* length = taos_fetch_lengths(msg); + //int32_t* length = taos_fetch_lengths(msg); int32_t precision = taos_result_precision(msg); rows++; taos_print_row(buf, row, fields, numOfFields); @@ -62,6 +59,13 @@ static int32_t init_env() { TAOS_RES* pRes; // drop database if exists printf("create database\n"); + pRes = taos_query(pConn, "drop topic topicname"); + if (taos_errno(pRes) != 0) { + printf("error in drop tmqdb, reason:%s\n", taos_errstr(pRes)); + return -1; + } + taos_free_result(pRes); + pRes = taos_query(pConn, "drop database if exists tmqdb"); if (taos_errno(pRes) != 0) { printf("error in drop tmqdb, reason:%s\n", taos_errstr(pRes)); @@ -249,7 +253,7 @@ int main(int argc, char* argv[]) { tmq_t* tmq = build_consumer(); if (NULL == tmq) { - fprintf(stderr, "%% build_consumer() fail!\n"); + fprintf(stderr, "build_consumer() fail!\n"); return -1; } @@ -259,7 +263,7 @@ int main(int argc, char* argv[]) { } if ((code = tmq_subscribe(tmq, topic_list))) { - fprintf(stderr, "%% Failed to tmq_subscribe(): %s\n", tmq_err2str(code)); + fprintf(stderr, "Failed to tmq_subscribe(): %s\n", tmq_err2str(code)); } tmq_list_destroy(topic_list); @@ -267,9 +271,9 @@ int main(int argc, char* argv[]) { code = tmq_consumer_close(tmq); if (code) { - fprintf(stderr, "%% Failed to close consumer: %s\n", tmq_err2str(code)); + fprintf(stderr, "Failed to close consumer: %s\n", tmq_err2str(code)); } else { - fprintf(stderr, "%% Consumer closed\n"); + fprintf(stderr, "Consumer closed\n"); } return 0; diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 90e2276661..19bd511c1f 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -195,6 +195,7 @@ typedef struct SDataBlockInfo { uint32_t capacity; SBlockID id; int16_t hasVarCol; + int16_t dataLoad; // denote if the data is loaded or not // TODO: optimize and remove following int64_t version; // used for stream, and need serialization diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 3537ba687d..603d6cfd67 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -68,7 +68,7 @@ typedef uint16_t tmsg_t; static inline bool vnodeIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || - (type == TDMT_VND_UPDATE_TAG_VAL); + (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_CONFIRM); } static inline bool syncUtilUserCommit(tmsg_t msgType) { diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index fc630cfdc0..7533cfbb02 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -94,249 +94,251 @@ #define TK_TSDB_PAGESIZE 76 #define TK_PRECISION 77 #define TK_REPLICA 78 -#define TK_STRICT 79 -#define TK_VGROUPS 80 -#define TK_SINGLE_STABLE 81 -#define TK_RETENTIONS 82 -#define TK_SCHEMALESS 83 -#define TK_WAL_LEVEL 84 -#define TK_WAL_FSYNC_PERIOD 85 -#define TK_WAL_RETENTION_PERIOD 86 -#define TK_WAL_RETENTION_SIZE 87 -#define TK_WAL_ROLL_PERIOD 88 -#define TK_WAL_SEGMENT_SIZE 89 -#define TK_STT_TRIGGER 90 -#define TK_TABLE_PREFIX 91 -#define TK_TABLE_SUFFIX 92 -#define TK_NK_COLON 93 -#define TK_MAX_SPEED 94 -#define TK_TABLE 95 -#define TK_NK_LP 96 -#define TK_NK_RP 97 -#define TK_STABLE 98 -#define TK_ADD 99 -#define TK_COLUMN 100 -#define TK_MODIFY 101 -#define TK_RENAME 102 -#define TK_TAG 103 -#define TK_SET 104 -#define TK_NK_EQ 105 -#define TK_USING 106 -#define TK_TAGS 107 -#define TK_COMMENT 108 -#define TK_BOOL 109 -#define TK_TINYINT 110 -#define TK_SMALLINT 111 -#define TK_INT 112 -#define TK_INTEGER 113 -#define TK_BIGINT 114 -#define TK_FLOAT 115 -#define TK_DOUBLE 116 -#define TK_BINARY 117 -#define TK_TIMESTAMP 118 -#define TK_NCHAR 119 -#define TK_UNSIGNED 120 -#define TK_JSON 121 -#define TK_VARCHAR 122 -#define TK_MEDIUMBLOB 123 -#define TK_BLOB 124 -#define TK_VARBINARY 125 -#define TK_DECIMAL 126 -#define TK_MAX_DELAY 127 -#define TK_WATERMARK 128 -#define TK_ROLLUP 129 -#define TK_TTL 130 -#define TK_SMA 131 -#define TK_DELETE_MARK 132 -#define TK_FIRST 133 -#define TK_LAST 134 -#define TK_SHOW 135 -#define TK_PRIVILEGES 136 -#define TK_DATABASES 137 -#define TK_TABLES 138 -#define TK_STABLES 139 -#define TK_MNODES 140 -#define TK_QNODES 141 -#define TK_FUNCTIONS 142 -#define TK_INDEXES 143 -#define TK_ACCOUNTS 144 -#define TK_APPS 145 -#define TK_CONNECTIONS 146 -#define TK_LICENCES 147 -#define TK_GRANTS 148 -#define TK_QUERIES 149 -#define TK_SCORES 150 -#define TK_TOPICS 151 -#define TK_VARIABLES 152 -#define TK_CLUSTER 153 -#define TK_BNODES 154 -#define TK_SNODES 155 -#define TK_TRANSACTIONS 156 -#define TK_DISTRIBUTED 157 -#define TK_CONSUMERS 158 -#define TK_SUBSCRIPTIONS 159 -#define TK_VNODES 160 -#define TK_LIKE 161 -#define TK_TBNAME 162 -#define TK_QTAGS 163 -#define TK_AS 164 -#define TK_INDEX 165 -#define TK_FUNCTION 166 -#define TK_INTERVAL 167 -#define TK_TOPIC 168 -#define TK_WITH 169 -#define TK_META 170 -#define TK_CONSUMER 171 -#define TK_GROUP 172 -#define TK_DESC 173 -#define TK_DESCRIBE 174 -#define TK_RESET 175 -#define TK_QUERY 176 -#define TK_CACHE 177 -#define TK_EXPLAIN 178 -#define TK_ANALYZE 179 -#define TK_VERBOSE 180 -#define TK_NK_BOOL 181 -#define TK_RATIO 182 -#define TK_NK_FLOAT 183 -#define TK_OUTPUTTYPE 184 -#define TK_AGGREGATE 185 -#define TK_BUFSIZE 186 -#define TK_STREAM 187 -#define TK_INTO 188 -#define TK_TRIGGER 189 -#define TK_AT_ONCE 190 -#define TK_WINDOW_CLOSE 191 -#define TK_IGNORE 192 -#define TK_EXPIRED 193 -#define TK_FILL_HISTORY 194 -#define TK_SUBTABLE 195 -#define TK_KILL 196 -#define TK_CONNECTION 197 -#define TK_TRANSACTION 198 -#define TK_BALANCE 199 -#define TK_VGROUP 200 -#define TK_MERGE 201 -#define TK_REDISTRIBUTE 202 -#define TK_SPLIT 203 -#define TK_DELETE 204 -#define TK_INSERT 205 -#define TK_NULL 206 -#define TK_NK_QUESTION 207 -#define TK_NK_ARROW 208 -#define TK_ROWTS 209 -#define TK_QSTART 210 -#define TK_QEND 211 -#define TK_QDURATION 212 -#define TK_WSTART 213 -#define TK_WEND 214 -#define TK_WDURATION 215 -#define TK_IROWTS 216 -#define TK_CAST 217 -#define TK_NOW 218 -#define TK_TODAY 219 -#define TK_TIMEZONE 220 -#define TK_CLIENT_VERSION 221 -#define TK_SERVER_VERSION 222 -#define TK_SERVER_STATUS 223 -#define TK_CURRENT_USER 224 -#define TK_COUNT 225 -#define TK_LAST_ROW 226 -#define TK_CASE 227 -#define TK_END 228 -#define TK_WHEN 229 -#define TK_THEN 230 -#define TK_ELSE 231 -#define TK_BETWEEN 232 -#define TK_IS 233 -#define TK_NK_LT 234 -#define TK_NK_GT 235 -#define TK_NK_LE 236 -#define TK_NK_GE 237 -#define TK_NK_NE 238 -#define TK_MATCH 239 -#define TK_NMATCH 240 -#define TK_CONTAINS 241 -#define TK_IN 242 -#define TK_JOIN 243 -#define TK_INNER 244 -#define TK_SELECT 245 -#define TK_DISTINCT 246 -#define TK_WHERE 247 -#define TK_PARTITION 248 -#define TK_BY 249 -#define TK_SESSION 250 -#define TK_STATE_WINDOW 251 -#define TK_SLIDING 252 -#define TK_FILL 253 -#define TK_VALUE 254 -#define TK_NONE 255 -#define TK_PREV 256 -#define TK_LINEAR 257 -#define TK_NEXT 258 -#define TK_HAVING 259 -#define TK_RANGE 260 -#define TK_EVERY 261 -#define TK_ORDER 262 -#define TK_SLIMIT 263 -#define TK_SOFFSET 264 -#define TK_LIMIT 265 -#define TK_OFFSET 266 -#define TK_ASC 267 -#define TK_NULLS 268 -#define TK_ABORT 269 -#define TK_AFTER 270 -#define TK_ATTACH 271 -#define TK_BEFORE 272 -#define TK_BEGIN 273 -#define TK_BITAND 274 -#define TK_BITNOT 275 -#define TK_BITOR 276 -#define TK_BLOCKS 277 -#define TK_CHANGE 278 -#define TK_COMMA 279 -#define TK_COMPACT 280 -#define TK_CONCAT 281 -#define TK_CONFLICT 282 -#define TK_COPY 283 -#define TK_DEFERRED 284 -#define TK_DELIMITERS 285 -#define TK_DETACH 286 -#define TK_DIVIDE 287 -#define TK_DOT 288 -#define TK_EACH 289 -#define TK_FAIL 290 -#define TK_FILE 291 -#define TK_FOR 292 -#define TK_GLOB 293 -#define TK_ID 294 -#define TK_IMMEDIATE 295 -#define TK_IMPORT 296 -#define TK_INITIALLY 297 -#define TK_INSTEAD 298 -#define TK_ISNULL 299 -#define TK_KEY 300 -#define TK_MODULES 301 -#define TK_NK_BITNOT 302 -#define TK_NK_SEMI 303 -#define TK_NOTNULL 304 -#define TK_OF 305 -#define TK_PLUS 306 -#define TK_PRIVILEGE 307 -#define TK_RAISE 308 -#define TK_REPLACE 309 -#define TK_RESTRICT 310 -#define TK_ROW 311 -#define TK_SEMI 312 -#define TK_STAR 313 -#define TK_STATEMENT 314 -#define TK_STRING 315 -#define TK_TIMES 316 -#define TK_UPDATE 317 -#define TK_VALUES 318 -#define TK_VARIABLE 319 -#define TK_VIEW 320 -#define TK_WAL 321 +#define TK_VGROUPS 79 +#define TK_SINGLE_STABLE 80 +#define TK_RETENTIONS 81 +#define TK_SCHEMALESS 82 +#define TK_WAL_LEVEL 83 +#define TK_WAL_FSYNC_PERIOD 84 +#define TK_WAL_RETENTION_PERIOD 85 +#define TK_WAL_RETENTION_SIZE 86 +#define TK_WAL_ROLL_PERIOD 87 +#define TK_WAL_SEGMENT_SIZE 88 +#define TK_STT_TRIGGER 89 +#define TK_TABLE_PREFIX 90 +#define TK_TABLE_SUFFIX 91 +#define TK_NK_COLON 92 +#define TK_MAX_SPEED 93 +#define TK_TABLE 94 +#define TK_NK_LP 95 +#define TK_NK_RP 96 +#define TK_STABLE 97 +#define TK_ADD 98 +#define TK_COLUMN 99 +#define TK_MODIFY 100 +#define TK_RENAME 101 +#define TK_TAG 102 +#define TK_SET 103 +#define TK_NK_EQ 104 +#define TK_USING 105 +#define TK_TAGS 106 +#define TK_COMMENT 107 +#define TK_BOOL 108 +#define TK_TINYINT 109 +#define TK_SMALLINT 110 +#define TK_INT 111 +#define TK_INTEGER 112 +#define TK_BIGINT 113 +#define TK_FLOAT 114 +#define TK_DOUBLE 115 +#define TK_BINARY 116 +#define TK_TIMESTAMP 117 +#define TK_NCHAR 118 +#define TK_UNSIGNED 119 +#define TK_JSON 120 +#define TK_VARCHAR 121 +#define TK_MEDIUMBLOB 122 +#define TK_BLOB 123 +#define TK_VARBINARY 124 +#define TK_DECIMAL 125 +#define TK_MAX_DELAY 126 +#define TK_WATERMARK 127 +#define TK_ROLLUP 128 +#define TK_TTL 129 +#define TK_SMA 130 +#define TK_DELETE_MARK 131 +#define TK_FIRST 132 +#define TK_LAST 133 +#define TK_SHOW 134 +#define TK_PRIVILEGES 135 +#define TK_DATABASES 136 +#define TK_TABLES 137 +#define TK_STABLES 138 +#define TK_MNODES 139 +#define TK_QNODES 140 +#define TK_FUNCTIONS 141 +#define TK_INDEXES 142 +#define TK_ACCOUNTS 143 +#define TK_APPS 144 +#define TK_CONNECTIONS 145 +#define TK_LICENCES 146 +#define TK_GRANTS 147 +#define TK_QUERIES 148 +#define TK_SCORES 149 +#define TK_TOPICS 150 +#define TK_VARIABLES 151 +#define TK_CLUSTER 152 +#define TK_BNODES 153 +#define TK_SNODES 154 +#define TK_TRANSACTIONS 155 +#define TK_DISTRIBUTED 156 +#define TK_CONSUMERS 157 +#define TK_SUBSCRIPTIONS 158 +#define TK_VNODES 159 +#define TK_LIKE 160 +#define TK_TBNAME 161 +#define TK_QTAGS 162 +#define TK_AS 163 +#define TK_INDEX 164 +#define TK_FUNCTION 165 +#define TK_INTERVAL 166 +#define TK_TOPIC 167 +#define TK_WITH 168 +#define TK_META 169 +#define TK_CONSUMER 170 +#define TK_GROUP 171 +#define TK_DESC 172 +#define TK_DESCRIBE 173 +#define TK_RESET 174 +#define TK_QUERY 175 +#define TK_CACHE 176 +#define TK_EXPLAIN 177 +#define TK_ANALYZE 178 +#define TK_VERBOSE 179 +#define TK_NK_BOOL 180 +#define TK_RATIO 181 +#define TK_NK_FLOAT 182 +#define TK_OUTPUTTYPE 183 +#define TK_AGGREGATE 184 +#define TK_BUFSIZE 185 +#define TK_STREAM 186 +#define TK_INTO 187 +#define TK_TRIGGER 188 +#define TK_AT_ONCE 189 +#define TK_WINDOW_CLOSE 190 +#define TK_IGNORE 191 +#define TK_EXPIRED 192 +#define TK_FILL_HISTORY 193 +#define TK_SUBTABLE 194 +#define TK_KILL 195 +#define TK_CONNECTION 196 +#define TK_TRANSACTION 197 +#define TK_BALANCE 198 +#define TK_VGROUP 199 +#define TK_MERGE 200 +#define TK_REDISTRIBUTE 201 +#define TK_SPLIT 202 +#define TK_DELETE 203 +#define TK_INSERT 204 +#define TK_NULL 205 +#define TK_NK_QUESTION 206 +#define TK_NK_ARROW 207 +#define TK_ROWTS 208 +#define TK_QSTART 209 +#define TK_QEND 210 +#define TK_QDURATION 211 +#define TK_WSTART 212 +#define TK_WEND 213 +#define TK_WDURATION 214 +#define TK_IROWTS 215 +#define TK_CAST 216 +#define TK_NOW 217 +#define TK_TODAY 218 +#define TK_TIMEZONE 219 +#define TK_CLIENT_VERSION 220 +#define TK_SERVER_VERSION 221 +#define TK_SERVER_STATUS 222 +#define TK_CURRENT_USER 223 +#define TK_COUNT 224 +#define TK_LAST_ROW 225 +#define TK_CASE 226 +#define TK_END 227 +#define TK_WHEN 228 +#define TK_THEN 229 +#define TK_ELSE 230 +#define TK_BETWEEN 231 +#define TK_IS 232 +#define TK_NK_LT 233 +#define TK_NK_GT 234 +#define TK_NK_LE 235 +#define TK_NK_GE 236 +#define TK_NK_NE 237 +#define TK_MATCH 238 +#define TK_NMATCH 239 +#define TK_CONTAINS 240 +#define TK_IN 241 +#define TK_JOIN 242 +#define TK_INNER 243 +#define TK_SELECT 244 +#define TK_DISTINCT 245 +#define TK_WHERE 246 +#define TK_PARTITION 247 +#define TK_BY 248 +#define TK_SESSION 249 +#define TK_STATE_WINDOW 250 +#define TK_EVENT_WINDOW 251 +#define TK_START 252 +#define TK_SLIDING 253 +#define TK_FILL 254 +#define TK_VALUE 255 +#define TK_NONE 256 +#define TK_PREV 257 +#define TK_LINEAR 258 +#define TK_NEXT 259 +#define TK_HAVING 260 +#define TK_RANGE 261 +#define TK_EVERY 262 +#define TK_ORDER 263 +#define TK_SLIMIT 264 +#define TK_SOFFSET 265 +#define TK_LIMIT 266 +#define TK_OFFSET 267 +#define TK_ASC 268 +#define TK_NULLS 269 +#define TK_ABORT 270 +#define TK_AFTER 271 +#define TK_ATTACH 272 +#define TK_BEFORE 273 +#define TK_BEGIN 274 +#define TK_BITAND 275 +#define TK_BITNOT 276 +#define TK_BITOR 277 +#define TK_BLOCKS 278 +#define TK_CHANGE 279 +#define TK_COMMA 280 +#define TK_COMPACT 281 +#define TK_CONCAT 282 +#define TK_CONFLICT 283 +#define TK_COPY 284 +#define TK_DEFERRED 285 +#define TK_DELIMITERS 286 +#define TK_DETACH 287 +#define TK_DIVIDE 288 +#define TK_DOT 289 +#define TK_EACH 290 +#define TK_FAIL 291 +#define TK_FILE 292 +#define TK_FOR 293 +#define TK_GLOB 294 +#define TK_ID 295 +#define TK_IMMEDIATE 296 +#define TK_IMPORT 297 +#define TK_INITIALLY 298 +#define TK_INSTEAD 299 +#define TK_ISNULL 300 +#define TK_KEY 301 +#define TK_MODULES 302 +#define TK_NK_BITNOT 303 +#define TK_NK_SEMI 304 +#define TK_NOTNULL 305 +#define TK_OF 306 +#define TK_PLUS 307 +#define TK_PRIVILEGE 308 +#define TK_RAISE 309 +#define TK_REPLACE 310 +#define TK_RESTRICT 311 +#define TK_ROW 312 +#define TK_SEMI 313 +#define TK_STAR 314 +#define TK_STATEMENT 315 +#define TK_STRICT 316 +#define TK_STRING 317 +#define TK_TIMES 318 +#define TK_UPDATE 319 +#define TK_VALUES 320 +#define TK_VARIABLE 321 +#define TK_VIEW 322 +#define TK_WAL 323 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 412054b13e..1f266cd0ef 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -112,6 +112,7 @@ typedef enum ENodeType { QUERY_NODE_COLUMN_REF, QUERY_NODE_WHEN_THEN, QUERY_NODE_CASE_WHEN, + QUERY_NODE_EVENT_WINDOW, // Statement nodes are used in parser and planner module. QUERY_NODE_SET_OPERATOR = 100, @@ -265,7 +266,9 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_DELETE, QUERY_NODE_PHYSICAL_SUBPLAN, QUERY_NODE_PHYSICAL_PLAN, - QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN + QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN, + QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT, + QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT } ENodeType; /** diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index d62bdb93cf..6f700c75ed 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -185,7 +185,12 @@ typedef struct SMergeLogicNode { bool groupSort; } SMergeLogicNode; -typedef enum EWindowType { WINDOW_TYPE_INTERVAL = 1, WINDOW_TYPE_SESSION, WINDOW_TYPE_STATE } EWindowType; +typedef enum EWindowType { + WINDOW_TYPE_INTERVAL = 1, + WINDOW_TYPE_SESSION, + WINDOW_TYPE_STATE, + WINDOW_TYPE_EVENT +} EWindowType; typedef enum EWindowAlgorithm { INTERVAL_ALGO_HASH = 1, @@ -212,6 +217,8 @@ typedef struct SWindowLogicNode { SNode* pTspk; SNode* pTsEnd; SNode* pStateExpr; + SNode* pStartCond; + SNode* pEndCond; int8_t triggerType; int64_t watermark; int64_t deleteMark; @@ -498,6 +505,14 @@ typedef struct SStateWinodwPhysiNode { typedef SStateWinodwPhysiNode SStreamStateWinodwPhysiNode; +typedef struct SEventWinodwPhysiNode { + SWinodwPhysiNode window; + SNode* pStartCond; + SNode* pEndCond; +} SEventWinodwPhysiNode; + +typedef SEventWinodwPhysiNode SStreamEventWinodwPhysiNode; + typedef struct SSortPhysiNode { SPhysiNode node; SNodeList* pExprs; // these are expression list of order_by_clause and parameter expression of aggregate function diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 6f7fd4db53..ec13dda5a4 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -223,6 +223,13 @@ typedef struct SIntervalWindowNode { SNode* pFill; } SIntervalWindowNode; +typedef struct SEventWindowNode { + ENodeType type; // QUERY_NODE_EVENT_WINDOW + SNode* pCol; // timestamp primary key + SNode* pStartCond; + SNode* pEndCond; +} SEventWindowNode; + typedef enum EFillMode { FILL_MODE_NONE = 1, FILL_MODE_VALUE, diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 4cf4800472..a13d203889 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -230,7 +230,7 @@ int64_t syncOpen(SSyncInfo* pSyncInfo); int32_t syncStart(int64_t rid); void syncStop(int64_t rid); void syncPreStop(int64_t rid); -int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak); +int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq); int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg); int32_t syncReconfig(int64_t rid, SSyncCfg* pCfg); int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex); @@ -240,6 +240,7 @@ int32_t syncStepDown(int64_t rid, SyncTerm newTerm); bool syncIsReadyForRead(int64_t rid); bool syncSnapshotSending(int64_t rid); bool syncSnapshotRecving(int64_t rid); +int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq); SSyncState syncGetState(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index 87f753e6aa..de3c2a9f52 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -77,14 +77,12 @@ typedef void (*RpcDfp)(void *ahandle); typedef struct SRpcInit { char localFqdn[TSDB_FQDN_LEN]; - uint16_t localPort; // local port - char *label; // for debug purpose - int32_t numOfThreads; // number of threads to handle connections - int32_t sessions; // number of sessions allowed - int8_t connType; // TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS - int32_t idleTime; // milliseconds, 0 means idle timer is disabled - int32_t retryLimit; // retry limit - int32_t retryInterval; // retry interval ms + uint16_t localPort; // local port + char *label; // for debug purpose + int32_t numOfThreads; // number of threads to handle connections + int32_t sessions; // number of sessions allowed + int8_t connType; // TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS + int32_t idleTime; // milliseconds, 0 means idle timer is disabled int32_t retryMinInterval; // retry init interval int32_t retryStepFactor; // retry interval factor diff --git a/include/os/osEnv.h b/include/os/osEnv.h index a3bd209693..533d989ffc 100644 --- a/include/os/osEnv.h +++ b/include/os/osEnv.h @@ -36,7 +36,7 @@ extern int64_t tsStreamMax; extern float tsNumOfCores; extern int64_t tsTotalMemoryKB; extern char *tsProcPath; -extern char tsSIMDEnable; +extern char tsSIMDBuiltins; extern char tsSSE42Enable; extern char tsAVXEnable; extern char tsAVX2Enable; diff --git a/include/util/taoserror.h b/include/util/taoserror.h index b53dfd98d4..7ac9b6e1fd 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -343,6 +343,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_INVALID_STREAM_OPTION TAOS_DEF_ERROR_CODE(0, 0x03F2) #define TSDB_CODE_MND_STREAM_MUST_BE_DELETED TAOS_DEF_ERROR_CODE(0, 0x03F3) #define TSDB_CODE_MND_STREAM_TASK_DROPPED TAOS_DEF_ERROR_CODE(0, 0x03F4) +#define TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB TAOS_DEF_ERROR_CODE(0, 0x03F5) // mnode-sma #define TSDB_CODE_MND_SMA_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0480) diff --git a/include/util/tdef.h b/include/util/tdef.h index 2bc8ef2788..7cd4f57771 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -338,7 +338,7 @@ typedef enum ELogicConditionType { #define TSDB_DB_STRICT_ON_STR "on" #define TSDB_DB_STRICT_OFF 0 #define TSDB_DB_STRICT_ON 1 -#define TSDB_DEFAULT_DB_STRICT TSDB_DB_STRICT_OFF +#define TSDB_DEFAULT_DB_STRICT TSDB_DB_STRICT_ON #define TSDB_CACHE_MODEL_STR_LEN sizeof(TSDB_CACHE_MODEL_LAST_VALUE_STR) #define TSDB_CACHE_MODEL_NONE_STR "none" #define TSDB_CACHE_MODEL_LAST_ROW_STR "last_row" @@ -498,6 +498,9 @@ enum { // sort page size by default #define DEFAULT_PAGESIZE 4096 +#define VNODE_TIMEOUT_SEC 60 +#define MNODE_TIMEOUT_SEC 10 + #ifdef __cplusplus } #endif diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index d3d713c643..98c96dcfb1 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -153,8 +153,7 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) { rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.compressSize = tsCompressMsgSize; rpcInit.dfp = destroyAhandle; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; + rpcInit.retryMinInterval = tsRedirectPeriod; rpcInit.retryStepFactor = tsRedirectFactor; rpcInit.retryMaxInterval = tsRedirectMaxPeriod; @@ -239,7 +238,7 @@ void destroyTscObj(void *pObj) { pTscObj->pAppInfo->numOfConns); // In any cases, we should not free app inst here. Or an race condition rises. - /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + /*int64_t connNum = */ atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 3b0a4fd97a..97ac315b77 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -190,8 +190,8 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->body.param = param; STscObj* pTscObj = (*pRequest)->pTscObj; - int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, - sizeof((*pRequest)->self)); + int32_t err = taosHashPut(pTscObj->pRequests, &(*pRequest)->self, sizeof((*pRequest)->self), &(*pRequest)->self, + sizeof((*pRequest)->self)); if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); @@ -1620,7 +1620,8 @@ int32_t getVersion1BlockMetaSize(const char* p, int32_t numOfCols) { static int32_t estimateJsonLen(SReqResultInfo* pResultInfo, int32_t numOfCols, int32_t numOfRows) { char* p = (char*)pResultInfo->pData; - // | version | total length | total rows | total columns | flag seg| block group id | column schema | each column length | + // | version | total length | total rows | total columns | flag seg| block group id | column schema | each column + // length | int32_t len = getVersion1BlockMetaSize(p, numOfCols); int32_t* colLength = (int32_t*)(p + len); len += sizeof(int32_t) * numOfCols; @@ -1946,8 +1947,6 @@ TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* de rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.compressSize = tsCompressMsgSize; rpcInit.user = "_dnd"; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; clientRpc = rpcOpen(&rpcInit); if (clientRpc == NULL) { @@ -2269,14 +2268,14 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) { taosAsyncQueryImpl(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly); tsem_wait(¶m->sem); - SRequestObj *pRequest = NULL; + SRequestObj* pRequest = NULL; if (param->pRequest != NULL) { param->pRequest->syncQuery = true; pRequest = param->pRequest; } else { taosMemoryFree(param); } - + return pRequest; } @@ -2292,13 +2291,13 @@ TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly, taosAsyncQueryImplWithReqid(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly, reqid); tsem_wait(¶m->sem); - SRequestObj *pRequest = NULL; + SRequestObj* pRequest = NULL; if (param->pRequest != NULL) { param->pRequest->syncQuery = true; pRequest = param->pRequest; } else { taosMemoryFree(param); } - + return pRequest; } diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 939acd2b6e..350ecdd373 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -1035,7 +1035,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) { SCMSubscribeReq req = {0}; int32_t code = -1; - tscDebug("call tmq subscribe, consumer: %" PRId64 ", topic num %d", tmq->consumerId, sz); + tscDebug("tmq subscribe, consumer: %" PRId64 ", topic num %d", tmq->consumerId, sz); req.consumerId = tmq->consumerId; tstrncpy(req.clientId, tmq->clientId, 256); @@ -1043,7 +1043,7 @@ int32_t tmq_subscribe(tmq_t* tmq, const tmq_list_t* topic_list) { req.topicNames = taosArrayInit(sz, sizeof(void*)); if (req.topicNames == NULL) goto FAIL; - tscDebug("call tmq subscribe, consumer: %" PRId64 ", topic num %d", tmq->consumerId, sz); + tscDebug("tmq subscribe, consumer: %" PRId64 ", topic num %d", tmq->consumerId, sz); for (int32_t i = 0; i < sz; i++) { char* topic = taosArrayGetP(container, i); @@ -1570,7 +1570,6 @@ SMqTaosxRspObj* tmqBuildTaosxRspFromWrapper(SMqPollRspWrapper* pWrapper) { } int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) { - /*tscDebug("call poll");*/ for (int i = 0; i < taosArrayGetSize(tmq->clientTopics); i++) { SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i); for (int j = 0; j < taosArrayGetSize(pTopic->vgs); j++) { @@ -1794,7 +1793,6 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { } TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) { - /*tscDebug("call poll1");*/ void* rspObj; int64_t startTime = taosGetTimestampMs(); diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 9af0ca770a..652e694816 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -359,7 +359,11 @@ size_t blockDataGetNumOfCols(const SSDataBlock* pBlock) { return taosArrayGetSiz size_t blockDataGetNumOfRows(const SSDataBlock* pBlock) { return pBlock->info.rows; } int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex) { - if (pDataBlock == NULL || pDataBlock->info.rows <= 0) { + if (pDataBlock->info.rows > 0) { +// ASSERT(pDataBlock->info.dataLoad == 1); + } + + if (pDataBlock == NULL || pDataBlock->info.rows <= 0 || pDataBlock->info.dataLoad == 0) { return 0; } @@ -1158,14 +1162,16 @@ void blockDataEmpty(SSDataBlock* pDataBlock) { } pInfo->rows = 0; + pInfo->dataLoad = 0; pInfo->window.ekey = 0; pInfo->window.skey = 0; } // todo temporarily disable it -static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockInfo, uint32_t numOfRows, - bool clearPayload) { - ASSERT(numOfRows > 0 /*&& pBlockInfo->capacity >= pBlockInfo->rows*/); + +static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockInfo, uint32_t numOfRows, bool clearPayload) { + ASSERT(numOfRows > 0); + if (numOfRows <= pBlockInfo->capacity) { return TSDB_CODE_SUCCESS; } @@ -1222,7 +1228,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* return TSDB_CODE_SUCCESS; } -void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows) { +void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows) { pColumn->hasNull = false; if (IS_VAR_DATA_TYPE(pColumn->info.type)) { @@ -2578,6 +2584,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) { pStart += colLen[i]; } + pBlock->info.dataLoad = 1; pBlock->info.rows = numOfRows; ASSERT(pStart - pData == dataLen); return pStart; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 7e9b28939b..f57d59fb41 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -180,8 +180,6 @@ int32_t tsUptimeInterval = 300; // seconds char tsUdfdResFuncs[512] = ""; // udfd resident funcs that teardown when udfd exits char tsUdfdLdLibPath[512] = ""; -int32_t tsRpcRetryLimit = 100; -int32_t tsRpcRetryInterval = 15; #ifndef _STORAGE int32_t taosSetTfsCfg(SConfig *pCfg) { SConfigItem *pItem = cfgGetItem(pCfg, "dataDir"); @@ -203,7 +201,9 @@ int32_t taosSetTfsCfg(SConfig *pCfg) { int32_t taosSetTfsCfg(SConfig *pCfg); #endif -struct SConfig *taosGetCfg() { return tsCfg; } +struct SConfig *taosGetCfg() { + return tsCfg; +} static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *inputCfgDir, const char *envFile, char *apolloUrl) { @@ -313,8 +313,6 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; if (cfgAddInt32(pCfg, "smlBatchSize", tsSmlBatchSize, 1, INT32_MAX, true) != 0) return -1; if (cfgAddInt32(pCfg, "maxMemUsedByInsert", tsMaxMemUsedByInsert, 1, INT32_MAX, true) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryLimit", tsRpcRetryLimit, 1, 100000, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryInterval", tsRpcRetryInterval, 1, 100000, 0) != 0) return -1; if (cfgAddInt32(pCfg, "maxRetryWaitTime", tsMaxRetryWaitTime, 0, 86400000, 0) != 0) return -1; tsNumOfTaskQueueThreads = tsNumOfCores / 2; @@ -341,7 +339,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "AVX", tsAVXEnable, 0) != 0) return -1; if (cfgAddBool(pCfg, "AVX2", tsAVX2Enable, 0) != 0) return -1; if (cfgAddBool(pCfg, "FMA", tsFMAEnable, 0) != 0) return -1; - if (cfgAddBool(pCfg, "SIMD-Supported", tsSIMDEnable, 0) != 0) return -1; + if (cfgAddBool(pCfg, "SIMD-builtins", tsSIMDBuiltins, 0) != 0) return -1; if (cfgAddInt64(pCfg, "openMax", tsOpenMax, 0, INT64_MAX, 1) != 0) return -1; if (cfgAddInt64(pCfg, "streamMax", tsStreamMax, 0, INT64_MAX, 1) != 0) return -1; @@ -457,9 +455,6 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { if (cfgAddString(pCfg, "udfdResFuncs", tsUdfdResFuncs, 0) != 0) return -1; if (cfgAddString(pCfg, "udfdLdLibPath", tsUdfdLdLibPath, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryLimit", tsRpcRetryLimit, 1, 100000, 0) != 0) return -1; - if (cfgAddInt32(pCfg, "rpcRetryInterval", tsRpcRetryInterval, 1, 100000, 0) != 0) return -1; - GRANT_CFG_ADD; return 0; } @@ -674,8 +669,6 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval; tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval; - tsRpcRetryLimit = cfgGetItem(pCfg, "rpcRetryLimit")->i32; - tsRpcRetryInterval = cfgGetItem(pCfg, "rpcRetryInterval")->i32; tsMaxRetryWaitTime = cfgGetItem(pCfg, "maxRetryWaitTime")->i32; return 0; } @@ -738,10 +731,6 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tstrncpy(tsTelemServer, cfgGetItem(pCfg, "telemetryServer")->str, TSDB_FQDN_LEN); tsTelemPort = (uint16_t)cfgGetItem(pCfg, "telemetryPort")->i32; - tsElectInterval = cfgGetItem(pCfg, "syncElectInterval")->i32; - tsHeartbeatInterval = cfgGetItem(pCfg, "syncHeartbeatInterval")->i32; - tsHeartbeatTimeout = cfgGetItem(pCfg, "syncHeartbeatTimeout")->i32; - tsTransPullupInterval = cfgGetItem(pCfg, "transPullupInterval")->i32; tsMqRebalanceInterval = cfgGetItem(pCfg, "mqRebalanceInterval")->i32; tsTtlUnit = cfgGetItem(pCfg, "ttlUnit")->i32; @@ -761,9 +750,6 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { if (tsQueryBufferSize >= 0) { tsQueryBufferSizeBytes = tsQueryBufferSize * 1048576UL; } - - tsRpcRetryLimit = cfgGetItem(pCfg, "rpcRetryLimit")->i32; - tsRpcRetryInterval = cfgGetItem(pCfg, "rpcRetryInterval")->i32; GRANT_CFG_GET; return 0; } diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index b38dc19361..b5c554e0ca 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -38,6 +38,8 @@ typedef struct SVnodeMgmt { TdThreadRwlock lock; SVnodesStat state; STfs *pTfs; + TdThread thread; + bool stop; } SVnodeMgmt; typedef struct { diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 07ebd72379..313a88fc5c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -334,6 +334,62 @@ static void vmCleanup(SVnodeMgmt *pMgmt) { taosMemoryFree(pMgmt); } +static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) { + int32_t numOfVnodes = 0; + SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes); + + for (int32_t i = 0; i < numOfVnodes; ++i) { + SVnodeObj *pVnode = ppVnodes[i]; + vnodeSyncCheckTimeout(pVnode->pImpl); + vmReleaseVnode(pMgmt, pVnode); + } + + if (ppVnodes != NULL) { + taosMemoryFree(ppVnodes); + } +} + +static void *vmThreadFp(void *param) { + SVnodeMgmt *pMgmt = param; + int64_t lastTime = 0; + setThreadName("vnode-timer"); + + while (1) { + lastTime++; + taosMsleep(100); + if (pMgmt->stop) break; + if (lastTime % 10 != 0) continue; + + int64_t sec = lastTime / 10; + if (sec % (VNODE_TIMEOUT_SEC / 2) == 0) { + vmCheckSyncTimeout(pMgmt); + } + } + + return NULL; +} + +static int32_t vmInitTimer(SVnodeMgmt *pMgmt) { + TdThreadAttr thAttr; + taosThreadAttrInit(&thAttr); + taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE); + if (taosThreadCreate(&pMgmt->thread, &thAttr, vmThreadFp, pMgmt) != 0) { + dError("failed to create vnode timer thread since %s", strerror(errno)); + return -1; + } + + taosThreadAttrDestroy(&thAttr); + return 0; +} + +static void vmCleanupTimer(SVnodeMgmt *pMgmt) { + pMgmt->stop = true; + if (taosCheckPthreadValid(pMgmt->thread)) { + taosThreadJoin(pMgmt->thread, NULL); + taosThreadClear(&pMgmt->thread); + } +} + static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) { int32_t code = -1; @@ -510,12 +566,10 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) { taosMemoryFree(ppVnodes); } - return 0; + return vmInitTimer(pMgmt); } -static void vmStop(SVnodeMgmt *pMgmt) { - // process inside the vnode -} +static void vmStop(SVnodeMgmt *pMgmt) { vmCleanupTimer(pMgmt); } SMgmtFunc vmGetMgmtFunc() { SMgmtFunc mgmtFunc = {0}; diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 02a268afda..b6cce249ea 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -214,6 +214,9 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper) { case SNODE: terrno = TSDB_CODE_SNODE_NOT_FOUND; break; + case VNODE: + terrno = TSDB_CODE_VND_STOPPED; + break; default: terrno = TSDB_CODE_APP_IS_STOPPING; break; diff --git a/source/dnode/mgmt/node_mgmt/src/dmNodes.c b/source/dnode/mgmt/node_mgmt/src/dmNodes.c index 6893e486bb..981797834a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmNodes.c +++ b/source/dnode/mgmt/node_mgmt/src/dmNodes.c @@ -149,10 +149,13 @@ int32_t dmRunDnode(SDnode *pDnode) { return 0; } - if (count == 0) osUpdate(); - - count %= 10; - count++; + if (count == 10) { + osUpdate(); + count = 0; + } else { + count++; + } + taosMsleep(100); } } diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 4fa09a46b7..5e1dcc6353 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -145,7 +145,8 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { if (pMsg == NULL) goto _OVER; memcpy(pMsg, pRpc, sizeof(SRpcMsg)); - dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, pRpc->contLen); + dGTrace("msg:%p, is created, type:%s handle:%p len:%d", pMsg, TMSG_INFO(pRpc->msgType), pMsg->info.handle, + pRpc->contLen); code = dmProcessNodeMsg(pWrapper, pMsg); @@ -258,8 +259,6 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.rfp = rpcRfp; rpcInit.compressSize = tsCompressMsgSize; - rpcInit.retryLimit = tsRpcRetryLimit; - rpcInit.retryInterval = tsRpcRetryInterval; rpcInit.retryMinInterval = tsRedirectPeriod; rpcInit.retryStepFactor = tsRedirectFactor; rpcInit.retryMaxInterval = tsRedirectMaxPeriod; diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h index a0f3c98f83..785ecc2bf5 100644 --- a/source/dnode/mnode/impl/inc/mndInt.h +++ b/source/dnode/mnode/impl/inc/mndInt.h @@ -84,14 +84,16 @@ typedef struct { } STelemMgmt; typedef struct { - tsem_t syncSem; - int64_t sync; - int32_t errCode; - int32_t transId; - SRWLatch lock; - int8_t selfIndex; - int8_t numOfReplicas; - SReplica replicas[TSDB_MAX_REPLICA]; + tsem_t syncSem; + int64_t sync; + int32_t errCode; + int32_t transId; + int32_t transSec; + int64_t transSeq; + TdThreadMutex lock; + int8_t selfIndex; + int8_t numOfReplicas; + SReplica replicas[TSDB_MAX_REPLICA]; } SSyncMgmt; typedef struct { diff --git a/source/dnode/mnode/impl/inc/mndSync.h b/source/dnode/mnode/impl/inc/mndSync.h index 993efbcd08..1f9a698a8a 100644 --- a/source/dnode/mnode/impl/inc/mndSync.h +++ b/source/dnode/mnode/impl/inc/mndSync.h @@ -26,6 +26,7 @@ int32_t mndInitSync(SMnode *pMnode); void mndCleanupSync(SMnode *pMnode); bool mndIsLeader(SMnode *pMnode); int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId); +void mndSyncCheckTimeout(SMnode *pMnode); void mndSyncStart(SMnode *pMnode); void mndSyncStop(SMnode *pMnode); diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h index 2372fa30e5..07066d2251 100644 --- a/source/dnode/mnode/impl/inc/mndTrans.h +++ b/source/dnode/mnode/impl/inc/mndTrans.h @@ -75,6 +75,7 @@ void mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, voi void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname); void mndTransSetSerial(STrans *pTrans); void mndTransSetOper(STrans *pTrans, EOperType oper); +int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans); int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans); int32_t mndTransProcessRsp(SRpcMsg *pRsp); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 881ce4b724..0a00980c14 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -554,14 +554,6 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { goto SUBSCRIBE_OVER; } - // check topic only -#if 0 - if (mndCheckDbPrivilegeByName(pMnode, pMsg->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { - mndReleaseTopic(pMnode, pTopic); - goto SUBSCRIBE_OVER; - } -#endif - if (mndCheckTopicPrivilege(pMnode, pMsg->info.conn.user, MND_OPER_SUBSCRIBE, pTopic) != 0) { mndReleaseTopic(pMnode, pTopic); goto SUBSCRIBE_OVER; diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 43155124c1..0715556da2 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -776,6 +776,8 @@ static int32_t mndAlterDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pOld, SDbObj *p int32_t code = -1; mndTransSetDbName(pTrans, pOld->name, NULL); + if (mndTrancCheckConflict(pMnode, pTrans) != 0) return -1; + if (mndSetAlterDbRedoLogs(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; if (mndSetAlterDbCommitLogs(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; if (mndSetAlterDbRedoActions(pMnode, pTrans, pOld, pNew) != 0) goto _OVER; @@ -835,12 +837,14 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { + if (terrno != 0) code = terrno; mError("db:%s, failed to alter since %s", alterReq.db, terrstr()); } mndReleaseDb(pMnode, pDb); taosArrayDestroy(dbObj.cfg.pRetensions); + terrno = code; return code; } @@ -1183,7 +1187,8 @@ int32_t mndExtractDbInfo(SMnode *pMnode, SDbObj *pDb, SUseDbRsp *pRsp, const SUs int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pReq == NULL || pReq->vgVersion < pDb->vgVersion || pReq->dbId != pDb->uid || numOfTable != pReq->numOfTable || pReq->stateTs < pDb->stateTs) { + if (pReq == NULL || pReq->vgVersion < pDb->vgVersion || pReq->dbId != pDb->uid || numOfTable != pReq->numOfTable || + pReq->stateTs < pDb->stateTs) { mndBuildDBVgroupInfo(pDb, pMnode, pRsp->pVgroupInfos); } @@ -1298,21 +1303,22 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs, SUseDbRsp usedbRsp = {0}; - if ((0 == strcasecmp(pDbVgVersion->dbFName, TSDB_INFORMATION_SCHEMA_DB) || (0 == strcasecmp(pDbVgVersion->dbFName, TSDB_PERFORMANCE_SCHEMA_DB)))) { + if ((0 == strcasecmp(pDbVgVersion->dbFName, TSDB_INFORMATION_SCHEMA_DB) || + (0 == strcasecmp(pDbVgVersion->dbFName, TSDB_PERFORMANCE_SCHEMA_DB)))) { memcpy(usedbRsp.db, pDbVgVersion->dbFName, TSDB_DB_FNAME_LEN); int32_t vgVersion = mndGetGlobalVgroupVersion(pMnode); if (pDbVgVersion->vgVersion < vgVersion) { usedbRsp.pVgroupInfos = taosArrayInit(10, sizeof(SVgroupInfo)); - + mndBuildDBVgroupInfo(NULL, pMnode, usedbRsp.pVgroupInfos); usedbRsp.vgVersion = vgVersion++; } else { usedbRsp.vgVersion = pDbVgVersion->vgVersion; } usedbRsp.vgNum = taosArrayGetSize(usedbRsp.pVgroupInfos); - + taosArrayPush(batchUseRsp.pArray, &usedbRsp); - + continue; } @@ -1328,7 +1334,7 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbVgVersion *pDbs, int32_t numOfDbs, int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pDbVgVersion->vgVersion >= pDb->vgVersion && numOfTable == pDbVgVersion->numOfTable && + if (pDbVgVersion->vgVersion >= pDb->vgVersion && numOfTable == pDbVgVersion->numOfTable && pDbVgVersion->stateTs == pDb->stateTs) { mTrace("db:%s, valid dbinfo, vgVersion:%d stateTs:%" PRId64 " numOfTables:%d, not changed vgVersion:%d stateTs:%" PRId64 " numOfTables:%d", diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 0538d70101..5772864ba8 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -672,6 +672,7 @@ static int32_t mndProcessCreateDnodeReq(SRpcMsg *pReq) { snprintf(ep, TSDB_EP_LEN, "%s:%d", createReq.fqdn, createReq.port); pDnode = mndAcquireDnodeByEp(pMnode, ep); if (pDnode != NULL) { + terrno = TSDB_CODE_MND_DNODE_ALREADY_EXIST; goto _OVER; } diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index eb6742a564..854535c82f 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -101,6 +101,7 @@ static void *mndBuildCheckpointTickMsg(int32_t *pContLen, int64_t sec) { } static void mndPullupTrans(SMnode *pMnode) { + mTrace("pullup trans msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -110,6 +111,7 @@ static void mndPullupTrans(SMnode *pMnode) { } static void mndPullupTtl(SMnode *pMnode) { + mTrace("pullup ttl"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); SRpcMsg rpcMsg = {.msgType = TDMT_MND_TTL_TIMER, .pCont = pReq, .contLen = contLen}; @@ -117,6 +119,7 @@ static void mndPullupTtl(SMnode *pMnode) { } static void mndCalMqRebalance(SMnode *pMnode) { + mTrace("calc mq rebalance"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -143,6 +146,7 @@ static void mndStreamCheckpointTick(SMnode *pMnode, int64_t sec) { } static void mndPullupTelem(SMnode *pMnode) { + mTrace("pullup telem msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -152,6 +156,7 @@ static void mndPullupTelem(SMnode *pMnode) { } static void mndPullupGrant(SMnode *pMnode) { + mTrace("pullup grant msg"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -162,6 +167,7 @@ static void mndPullupGrant(SMnode *pMnode) { } static void mndIncreaseUpTime(SMnode *pMnode) { + mTrace("increate uptime"); int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); if (pReq != NULL) { @@ -213,6 +219,9 @@ static void mndSetVgroupOffline(SMnode *pMnode, int32_t dnodeId, int64_t curMs) } static void mndCheckDnodeOffline(SMnode *pMnode) { + mTrace("check dnode offline"); + if (mndAcquireRpc(pMnode) != 0) return; + SSdb *pSdb = pMnode->pSdb; int64_t curMs = taosGetTimestampMs(); @@ -230,6 +239,8 @@ static void mndCheckDnodeOffline(SMnode *pMnode) { sdbRelease(pSdb, pDnode); } + + mndReleaseRpc(pMnode); } static void *mndThreadFp(void *param) { @@ -277,6 +288,10 @@ static void *mndThreadFp(void *param) { if (sec % (tsStatusInterval * 5) == 0) { mndCheckDnodeOffline(pMnode); } + + if (sec % (MNODE_TIMEOUT_SEC / 2) == 0) { + mndSyncCheckTimeout(pMnode); + } } return NULL; @@ -648,7 +663,9 @@ _OVER: const STraceId *trace = &pMsg->info.traceId; SEpSet epSet = {0}; + int32_t tmpCode = terrno; mndGetMnodeEpSet(pMnode, &epSet); + terrno = tmpCode; mGDebug( "msg:%p, type:%s failed to process since %s, mnode restored:%d stopped:%d, sync restored:%d " diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 7ee688d220..05c0594339 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -164,7 +164,8 @@ SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw) { STREAM_DECODE_OVER: taosMemoryFreeClear(buf); if (terrno != TSDB_CODE_SUCCESS) { - mError("stream:%s, failed to decode from raw:%p since %s", pStream == NULL ? "null" : pStream->name, pRaw, terrstr()); + mError("stream:%s, failed to decode from raw:%p since %s", pStream == NULL ? "null" : pStream->name, pRaw, + terrstr()); taosMemoryFreeClear(pRow); return NULL; } @@ -624,6 +625,16 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { goto _OVER; } + pDb = mndAcquireDb(pMnode, streamObj.sourceDb); + if (pDb->cfg.replications != 1) { + mError("stream source db must have only 1 replica, but %s has %d", pDb->name, pDb->cfg.replications); + terrno = TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB; + mndReleaseDb(pMnode, pDb); + pDb = NULL; + goto _OVER; + } + mndReleaseDb(pMnode, pDb); + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pReq, "create-stream"); if (pTrans == NULL) { mError("stream:%s, failed to create since %s", createStreamReq.name, terrstr()); @@ -680,7 +691,6 @@ _OVER: } mndReleaseStream(pMnode, pStream); - mndReleaseDb(pMnode, pDb); tFreeSCMCreateStreamReq(&createStreamReq); tFreeStreamObj(&streamObj); diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 10b1e36496..c96faddc4c 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -78,35 +78,38 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta SSdbRaw *pRaw = pMsg->pCont; int32_t transId = sdbGetIdFromRaw(pMnode->pSdb, pRaw); - pMgmt->errCode = pMeta->code; mInfo("trans:%d, is proposed, saved:%d code:0x%x, apply index:%" PRId64 " term:%" PRIu64 " config:%" PRId64 - " role:%s raw:%p", + " role:%s raw:%p sec:%d seq:%" PRId64, transId, pMgmt->transId, pMeta->code, pMeta->index, pMeta->term, pMeta->lastConfigIndex, syncStr(pMeta->state), - pRaw); + pRaw, pMgmt->transSec, pMgmt->transSeq); - if (pMgmt->errCode == 0) { + if (pMeta->code == 0) { sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, pMeta->index, pMeta->term, pMeta->lastConfigIndex); } - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); + pMgmt->errCode = pMeta->code; + if (transId <= 0) { - taosWUnLockLatch(&pMgmt->lock); - mError("trans:%d, invalid commit msg", transId); + taosThreadMutexUnlock(&pMgmt->lock); + mError("trans:%d, invalid commit msg, cache transId:%d seq:%" PRId64, transId, pMgmt->transId, pMgmt->transSeq); } else if (transId == pMgmt->transId) { if (pMgmt->errCode != 0) { mError("trans:%d, failed to propose since %s, post sem", transId, tstrerror(pMgmt->errCode)); } else { - mInfo("trans:%d, is proposed and post sem", transId); + mInfo("trans:%d, is proposed and post sem, seq:%" PRId64, transId, pMgmt->transSeq); } pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->transSeq = 0; tsem_post(&pMgmt->syncSem); - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); } else { - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); STrans *pTrans = mndAcquireTrans(pMnode, transId); if (pTrans != NULL) { - mInfo("trans:%d, execute in mnode which not leader", transId); + mInfo("trans:%d, execute in mnode which not leader or sync timeout", transId); mndTransExecute(pMnode, pTrans); mndReleaseTrans(pMnode, pTrans); // sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA); @@ -198,18 +201,20 @@ int32_t mndSnapshotDoWrite(const SSyncFSM *pFsm, void *pWriter, void *pBuf, int3 } static void mndBecomeFollower(const SSyncFSM *pFsm) { - SMnode *pMnode = pFsm->data; + SMnode *pMnode = pFsm->data; + SSyncMgmt *pMgmt = &pMnode->syncMgmt; mInfo("vgId:1, become follower"); - taosWLockLatch(&pMnode->syncMgmt.lock); - if (pMnode->syncMgmt.transId != 0) { - mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", - pMnode->syncMgmt.transId); - pMnode->syncMgmt.transId = 0; - pMnode->syncMgmt.errCode = TSDB_CODE_SYN_NOT_LEADER; - tsem_post(&pMnode->syncMgmt.syncSem); + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + mInfo("vgId:1, become follower and post sem, trans:%d, failed to propose since not leader", pMgmt->transId); + pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->transSeq = 0; + pMgmt->errCode = TSDB_CODE_SYN_NOT_LEADER; + tsem_post(&pMgmt->syncSem); } - taosWUnLockLatch(&pMnode->syncMgmt.lock); + taosThreadMutexUnlock(&pMgmt->lock); } static void mndBecomeLeader(const SSyncFSM *pFsm) { @@ -265,8 +270,10 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { int32_t mndInitSync(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; - taosInitRWLatch(&pMgmt->lock); + taosThreadMutexInit(&pMgmt->lock, NULL); pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->transSeq = 0; SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, @@ -313,12 +320,38 @@ void mndCleanupSync(SMnode *pMnode) { mInfo("mnode-sync is stopped, id:%" PRId64, pMgmt->sync); tsem_destroy(&pMgmt->syncSem); + taosThreadMutexDestroy(&pMgmt->lock); memset(pMgmt, 0, sizeof(SSyncMgmt)); } +void mndSyncCheckTimeout(SMnode *pMnode) { + mTrace("check sync timeout"); + SSyncMgmt *pMgmt = &pMnode->syncMgmt; + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + int32_t curSec = taosGetTimestampSec(); + int32_t delta = curSec - pMgmt->transSec; + if (delta > MNODE_TIMEOUT_SEC) { + mError("trans:%d, failed to propose since timeout, start:%d cur:%d delta:%d seq:%" PRId64, pMgmt->transId, + pMgmt->transSec, curSec, delta, pMgmt->transSeq); + pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->transSeq = 0; + terrno = TSDB_CODE_SYN_TIMEOUT; + pMgmt->errCode = TSDB_CODE_SYN_TIMEOUT; + tsem_post(&pMgmt->syncSem); + } else { + mDebug("trans:%d, waiting for sync confirm, start:%d cur:%d delta:%d seq:%" PRId64, pMgmt->transId, + pMgmt->transSec, curSec, curSec - pMgmt->transSec, pMgmt->transSeq); + } + } else { + // mTrace("check sync timeout msg, no trans waiting for confirm"); + } + taosThreadMutexUnlock(&pMgmt->lock); +} + int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; - pMgmt->errCode = 0; SRpcMsg req = {.msgType = TDMT_MND_APPLY_MSG, .contLen = sdbGetRawTotalSize(pRaw)}; if (req.contLen <= 0) return -1; @@ -327,35 +360,42 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { if (req.pCont == NULL) return -1; memcpy(req.pCont, pRaw, req.contLen); - taosWLockLatch(&pMgmt->lock); + taosThreadMutexLock(&pMgmt->lock); + pMgmt->errCode = 0; + if (pMgmt->transId != 0) { mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId); - taosWUnLockLatch(&pMgmt->lock); + taosThreadMutexUnlock(&pMgmt->lock); terrno = TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED; - return -1; + return terrno; } mInfo("trans:%d, will be proposed", transId); pMgmt->transId = transId; - taosWUnLockLatch(&pMgmt->lock); + pMgmt->transSec = taosGetTimestampSec(); - int32_t code = syncPropose(pMgmt->sync, &req, false); + int64_t seq = 0; + int32_t code = syncPropose(pMgmt->sync, &req, false, &seq); if (code == 0) { - mInfo("trans:%d, is proposing and wait sem", pMgmt->transId); + mInfo("trans:%d, is proposing and wait sem, seq:%" PRId64, transId, seq); + pMgmt->transSeq = seq; + taosThreadMutexUnlock(&pMgmt->lock); tsem_wait(&pMgmt->syncSem); } else if (code > 0) { mInfo("trans:%d, confirm at once since replica is 1, continue execute", transId); - taosWLockLatch(&pMgmt->lock); pMgmt->transId = 0; - taosWUnLockLatch(&pMgmt->lock); + pMgmt->transSec = 0; + pMgmt->transSeq = 0; + taosThreadMutexUnlock(&pMgmt->lock); sdbWriteWithoutFree(pMnode->pSdb, pRaw); sdbSetApplyInfo(pMnode->pSdb, req.info.conn.applyIndex, req.info.conn.applyTerm, SYNC_INDEX_INVALID); code = 0; } else { mError("trans:%d, failed to proposed since %s", transId, terrstr()); - taosWLockLatch(&pMgmt->lock); pMgmt->transId = 0; - taosWUnLockLatch(&pMgmt->lock); + pMgmt->transSec = 0; + pMgmt->transSeq = 0; + taosThreadMutexUnlock(&pMgmt->lock); if (terrno == 0) { terrno = TSDB_CODE_APP_ERROR; } @@ -369,7 +409,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { } terrno = pMgmt->errCode; - return pMgmt->errCode; + return terrno; } void mndSyncStart(SMnode *pMnode) { @@ -382,13 +422,17 @@ void mndSyncStart(SMnode *pMnode) { } void mndSyncStop(SMnode *pMnode) { - taosWLockLatch(&pMnode->syncMgmt.lock); - if (pMnode->syncMgmt.transId != 0) { - mInfo("vgId:1, is stopped and post sem, trans:%d", pMnode->syncMgmt.transId); - pMnode->syncMgmt.transId = 0; - tsem_post(&pMnode->syncMgmt.syncSem); + SSyncMgmt *pMgmt = &pMnode->syncMgmt; + + taosThreadMutexLock(&pMgmt->lock); + if (pMgmt->transId != 0) { + mInfo("vgId:1, is stopped and post sem, trans:%d", pMgmt->transId); + pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->errCode = TSDB_CODE_APP_IS_STOPPING; + tsem_post(&pMgmt->syncSem); } - taosWUnLockLatch(&pMnode->syncMgmt.lock); + taosThreadMutexUnlock(&pMgmt->lock); } bool mndIsLeader(SMnode *pMnode) { diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 4b11884050..d2fc2dc9b1 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -838,7 +838,7 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { return conflict; } -int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { +int32_t mndTrancCheckConflict(SMnode *pMnode, STrans *pTrans) { if (pTrans->conflict == TRN_CONFLICT_DB || pTrans->conflict == TRN_CONFLICT_DB_INSIDE) { if (strlen(pTrans->dbname) == 0 && strlen(pTrans->stbname) == 0) { terrno = TSDB_CODE_MND_TRANS_CONFLICT; @@ -853,6 +853,14 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { return -1; } + return 0; +} + +int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) { + if (mndTrancCheckConflict(pMnode, pTrans) != 0) { + return -1; + } + if (taosArrayGetSize(pTrans->commitActions) <= 0) { terrno = TSDB_CODE_MND_TRANS_CLOG_IS_NULL; mError("trans:%d, failed to prepare since %s", pTrans->id, terrstr()); @@ -919,7 +927,8 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) { } } else { if (pTrans->stage == TRN_STAGE_REDO_ACTION) { - if (code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_APP_IS_STARTING) { + if (code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_APP_IS_STARTING || + code == TSDB_CODE_SYN_PROPOSE_NOT_READY) { if (pTrans->failedTimes > 60) sendRsp = true; } else { if (pTrans->failedTimes > 6) sendRsp = true; @@ -1027,6 +1036,7 @@ int32_t mndTransProcessRsp(SRpcMsg *pRsp) { if (pAction != NULL) { pAction->msgReceived = 1; pAction->errCode = pRsp->code; + pTrans->lastErrorNo = pRsp->code; } mInfo("trans:%d, %s:%d response is received, code:0x%x, accept:0x%x retry:0x%x", transId, mndTransStr(pAction->stage), @@ -1238,7 +1248,7 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) if (numOfActions == 0) return code; if (pTrans->redoActionPos >= numOfActions) return code; - mInfo("trans:%d, execute %d actions serial", pTrans->id, numOfActions); + mInfo("trans:%d, execute %d actions serial, current redoAction:%d", pTrans->id, numOfActions, pTrans->redoActionPos); for (int32_t action = pTrans->redoActionPos; action < numOfActions; ++action) { STransAction *pAction = taosArrayGet(pTrans->redoActions, pTrans->redoActionPos); @@ -1289,13 +1299,16 @@ static int32_t mndTransExecuteRedoActionsSerial(SMnode *pMnode, STrans *pTrans) } else if (code == TSDB_CODE_ACTION_IN_PROGRESS) { mInfo("trans:%d, %s:%d is in progress and wait it finish", pTrans->id, mndTransStr(pAction->stage), pAction->id); break; - } else if (code == pAction->retryCode) { + } else if (code == pAction->retryCode || code == TSDB_CODE_SYN_PROPOSE_NOT_READY || + code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_SYN_NOT_LEADER) { mInfo("trans:%d, %s:%d receive code:0x%x and retry", pTrans->id, mndTransStr(pAction->stage), pAction->id, code); + pTrans->lastErrorNo = code; taosMsleep(300); action--; continue; } else { terrno = code; + pTrans->lastErrorNo = code; pTrans->code = code; mInfo("trans:%d, %s:%d receive code:0x%x and wait another schedule, failedTimes:%d", pTrans->id, mndTransStr(pAction->stage), pAction->id, code, pTrans->failedTimes); @@ -1324,6 +1337,7 @@ static bool mndTransPerformRedoActionStage(SMnode *pMnode, STrans *pTrans) { } if (mndCannotExecuteTransAction(pMnode)) return false; + terrno = code; if (code == 0) { pTrans->code = 0; diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 4a6f0d14da..31ab1f3259 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1126,8 +1126,12 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, } if (!force) { +#if 1 + { +#else if (newVg.replica == 1) { - mInfo("vgId:%d, will add 1 vnode, replca:1", pVgroup->vgId); +#endif + mInfo("vgId:%d, will add 1 vnode, replca:%d", pVgroup->vgId, newVg.replica); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; for (int32_t i = 0; i < newVg.replica - 1; ++i) { if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; @@ -1155,6 +1159,9 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; +#if 1 + } +#else } else { // new replica == 3 mInfo("vgId:%d, will add 1 vnode, replca:3", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; @@ -1181,6 +1188,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } +#endif } else { mInfo("vgId:%d, will add 1 vnode and force remove 1 vnode", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 03069d5404..aa4d2fea4f 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -54,6 +54,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs); void vnodeDestroy(const char *path, STfs *pTfs); SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb); void vnodePreClose(SVnode *pVnode); +void vnodeSyncCheckTimeout(SVnode* pVnode); void vnodeClose(SVnode *pVnode); int32_t vnodeStart(SVnode *pVnode); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 5ccf011dfb..603a68ac6c 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -87,17 +87,24 @@ typedef struct SCommitInfo SCommitInfo; #define VNODE_RSMA1_DIR "rsma1" #define VNODE_RSMA2_DIR "rsma2" +#define VND_INFO_FNAME "vnode.json" + // vnd.h void* vnodeBufPoolMalloc(SVBufPool* pPool, int32_t size); void vnodeBufPoolFree(SVBufPool* pPool, void* p); void vnodeBufPoolRef(SVBufPool* pPool); void vnodeBufPoolUnRef(SVBufPool* pPool); +int vnodeDecodeInfo(uint8_t* pData, SVnodeInfo* pInfo); // meta typedef struct SMCtbCursor SMCtbCursor; typedef struct SMStbCursor SMStbCursor; typedef struct STbUidStore STbUidStore; +#define META_BEGIN_HEAP_BUFFERPOOL 0 +#define META_BEGIN_HEAP_OS 1 +#define META_BEGIN_HEAP_NIL 2 + int metaOpen(SVnode* pVnode, SMeta** ppMeta, int8_t rollback); int metaClose(SMeta* pMeta); int metaBegin(SMeta* pMeta, int8_t fromSys); @@ -105,6 +112,7 @@ TXN* metaGetTxn(SMeta* pMeta); int metaCommit(SMeta* pMeta, TXN* txn); int metaFinishCommit(SMeta* pMeta, TXN* txn); int metaPrepareAsyncCommit(SMeta* pMeta); +int metaAbort(SMeta* pMeta); int metaCreateSTable(SMeta* pMeta, int64_t version, SVCreateStbReq* pReq); int metaAlterSTable(SMeta* pMeta, int64_t version, SVCreateStbReq* pReq); int metaDropSTable(SMeta* pMeta, int64_t verison, SVDropStbReq* pReq, SArray* tbUidList); @@ -237,6 +245,7 @@ int32_t tsdbSnapRead(STsdbSnapReader* pReader, uint8_t** ppData); // STsdbSnapWriter ======================================== int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWriter** ppWriter); int32_t tsdbSnapWrite(STsdbSnapWriter* pWriter, uint8_t* pData, uint32_t nData); +int32_t tsdbSnapWriterPrepareClose(STsdbSnapWriter* pWriter); int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback); // STqSnapshotReader == int32_t tqSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapReader** ppReader); @@ -343,7 +352,12 @@ struct SVnode { bool blocked; bool restored; tsem_t syncSem; + int32_t blockSec; + int64_t blockSeq; SQHandle* pQuery; +#if 0 + SRpcHandleInfo blockInfo; +#endif }; #define TD_VID(PVNODE) ((PVNODE)->config.vgId) diff --git a/source/dnode/vnode/src/meta/metaCommit.c b/source/dnode/vnode/src/meta/metaCommit.c index 5eb27679bb..ac8d99ccf0 100644 --- a/source/dnode/vnode/src/meta/metaCommit.c +++ b/source/dnode/vnode/src/meta/metaCommit.c @@ -19,19 +19,21 @@ static FORCE_INLINE void *metaMalloc(void *pPool, size_t size) { return vnodeBuf static FORCE_INLINE void metaFree(void *pPool, void *p) { vnodeBufPoolFree((SVBufPool *)pPool, p); } // begin a meta txn -int metaBegin(SMeta *pMeta, int8_t fromSys) { - void *(*xMalloc)(void *, size_t); - void (*xFree)(void *, void *); +int metaBegin(SMeta *pMeta, int8_t heap) { + void *(*xMalloc)(void *, size_t) = NULL; + void (*xFree)(void *, void *) = NULL; void *xArg = NULL; - if (fromSys) { + // default heap to META_BEGIN_HEAP_NIL + if (heap == META_BEGIN_HEAP_OS) { xMalloc = tdbDefaultMalloc; xFree = tdbDefaultFree; - } else { + } else if (heap == META_BEGIN_HEAP_BUFFERPOOL) { xMalloc = metaMalloc; xFree = metaFree; xArg = pMeta->pVnode->inUse; } + if (tdbBegin(pMeta->pEnv, &pMeta->txn, xMalloc, xFree, xArg, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) < 0) { return -1; } diff --git a/source/dnode/vnode/src/meta/metaSnapshot.c b/source/dnode/vnode/src/meta/metaSnapshot.c index 6a4dcf6ead..974f8a9218 100644 --- a/source/dnode/vnode/src/meta/metaSnapshot.c +++ b/source/dnode/vnode/src/meta/metaSnapshot.c @@ -145,7 +145,7 @@ int32_t metaSnapWriterOpen(SMeta* pMeta, int64_t sver, int64_t ever, SMetaSnapWr pWriter->sver = sver; pWriter->ever = ever; - metaBegin(pMeta, 1); + metaBegin(pMeta, META_BEGIN_HEAP_NIL); *ppWriter = pWriter; return code; @@ -161,7 +161,8 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) { SMetaSnapWriter* pWriter = *ppWriter; if (rollback) { - ASSERT(0); + code = metaAbort(pWriter->pMeta); + if (code) goto _err; } else { code = metaCommit(pWriter->pMeta, pWriter->pMeta->txn); if (code) goto _err; diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index 06153d6553..fdaedd795b 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -742,7 +742,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL code = tqOffsetDelete(pTq->pOffsetStore, pReq->subKey); if (code != 0) { - tqError("cannot process tq delete req %s, since no such offset", pReq->subKey); + tqError("cannot process tq delete req %s, since no such offset in cache", pReq->subKey); } if (tqMetaDeleteHandle(pTq, pReq->subKey) < 0) { diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index ea60d0ccc6..e662a7daad 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -864,6 +864,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { pBlock->info.id.uid = pReader->msgIter.uid; pBlock->info.rows = pReader->msgIter.numOfRows; pBlock->info.version = pReader->pMsg->version; + pBlock->info.dataLoad = 1; while ((row = tGetSubmitBlkNext(&pReader->blkIter)) != NULL) { tdSTSRowIterReset(&iter, row); diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 013adafe08..cddc8a213d 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -1143,6 +1143,7 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn i += 1; } + pResBlock->info.dataLoad = 1; pResBlock->info.rows = dumpedRows; pDumpInfo->rowIndex += step * dumpedRows; @@ -2543,6 +2544,7 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { _end: pResBlock->info.id.uid = (pBlockScanInfo != NULL) ? pBlockScanInfo->uid : 0; + pResBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pResBlock, pReader->suppInfo.slotId[0]); setComposedBlockFlag(pReader, true); @@ -3656,6 +3658,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pT i += 1; } + pBlock->info.dataLoad = 1; pBlock->info.rows += 1; pScanInfo->lastKey = pTSRow->ts; return TSDB_CODE_SUCCESS; @@ -3703,6 +3706,7 @@ int32_t doAppendRowFromFileBlock(SSDataBlock* pResBlock, STsdbReader* pReader, S i += 1; } + pResBlock->info.dataLoad = 1; pResBlock->info.rows += 1; return TSDB_CODE_SUCCESS; } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index bd17a2593b..a7a06ee946 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -1376,27 +1376,34 @@ _exit: return code; } +int32_t tsdbSnapWriterPrepareClose(STsdbSnapWriter* pWriter) { + int32_t code = 0; + if (pWriter->dWriter.pWriter) { + code = tsdbSnapWriteCloseFile(pWriter); + if (code) goto _exit; + } + + code = tsdbSnapWriteDelEnd(pWriter); + if (code) goto _exit; + + code = tsdbFSPrepareCommit(pWriter->pTsdb, &pWriter->fs); + if (code) goto _exit; + +_exit: + if (code) { + tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); + } + return code; +} + int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) { int32_t code = 0; STsdbSnapWriter* pWriter = *ppWriter; STsdb* pTsdb = pWriter->pTsdb; if (rollback) { - ASSERT(0); - // code = tsdbFSRollback(pWriter->pTsdb->pFS); - // if (code) goto _err; + tsdbRollbackCommit(pWriter->pTsdb); } else { - if (pWriter->dWriter.pWriter) { - code = tsdbSnapWriteCloseFile(pWriter); - if (code) goto _err; - } - - code = tsdbSnapWriteDelEnd(pWriter); - if (code) goto _err; - - code = tsdbFSPrepareCommit(pWriter->pTsdb, &pWriter->fs); - if (code) goto _err; - // lock taosThreadRwlockWrlock(&pTsdb->rwLock); diff --git a/source/dnode/vnode/src/vnd/vnodeCfg.c b/source/dnode/vnode/src/vnd/vnodeCfg.c index 5adb2eb359..782cc69d30 100644 --- a/source/dnode/vnode/src/vnd/vnodeCfg.c +++ b/source/dnode/vnode/src/vnd/vnodeCfg.c @@ -115,7 +115,6 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { if (tjsonAddIntegerToObject(pJson, "hashMethod", pCfg->hashMethod) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashPrefix", pCfg->hashPrefix) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "hashSuffix", pCfg->hashSuffix) < 0) return -1; - if (tjsonAddIntegerToObject(pJson, "tsdbPageSize", pCfg->tsdbPageSize) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "syncCfg.replicaNum", pCfg->syncCfg.replicaNum) < 0) return -1; if (tjsonAddIntegerToObject(pJson, "syncCfg.myIndex", pCfg->syncCfg.myIndex) < 0) return -1; @@ -135,9 +134,6 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) { tjsonAddItemToArray(pNodeInfoArr, pNodeInfo); } - // add tsdb page size config - if (tjsonAddIntegerToObject(pJson, "tsdbPageSize", pCfg->tsdbPageSize) < 0) return -1; - return 0; } @@ -256,7 +252,9 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) { } tjsonGetNumberValue(pJson, "tsdbPageSize", pCfg->tsdbPageSize, code); - if (code < 0) pCfg->tsdbPageSize = TSDB_DEFAULT_TSDB_PAGESIZE * 1024; + if (code < 0 || pCfg->tsdbPageSize < TSDB_MIN_PAGESIZE_PER_VNODE * 1024) { + pCfg->tsdbPageSize = TSDB_DEFAULT_TSDB_PAGESIZE * 1024; + } return 0; } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index cd56468371..4daab074b5 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -16,11 +16,9 @@ #include "vnd.h" #include "vnodeInt.h" -#define VND_INFO_FNAME "vnode.json" #define VND_INFO_FNAME_TMP "vnode_tmp.json" static int vnodeEncodeInfo(const SVnodeInfo *pInfo, char **ppData); -static int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo); static int vnodeCommitImpl(SCommitInfo *pInfo); int vnodeBegin(SVnode *pVnode) { @@ -40,7 +38,7 @@ int vnodeBegin(SVnode *pVnode) { pVnode->state.commitID++; // begin meta - if (metaBegin(pVnode->pMeta, 0) < 0) { + if (metaBegin(pVnode->pMeta, META_BEGIN_HEAP_BUFFERPOOL) < 0) { vError("vgId:%d, failed to begin meta since %s", TD_VID(pVnode), tstrerror(terrno)); return -1; } @@ -407,7 +405,7 @@ _err: return -1; } -static int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo) { +int vnodeDecodeInfo(uint8_t *pData, SVnodeInfo *pInfo) { SJson *pJson = NULL; pJson = tjsonParse(pData); diff --git a/source/dnode/vnode/src/vnd/vnodeSnapshot.c b/source/dnode/vnode/src/vnd/vnodeSnapshot.c index a34744a1da..40705e553b 100644 --- a/source/dnode/vnode/src/vnd/vnodeSnapshot.c +++ b/source/dnode/vnode/src/vnd/vnodeSnapshot.c @@ -21,6 +21,8 @@ struct SVSnapReader { int64_t sver; int64_t ever; int64_t index; + // config + int8_t cfgDone; // meta int8_t metaDone; SMetaSnapReader *pMetaReader; @@ -88,6 +90,53 @@ int32_t vnodeSnapReaderClose(SVSnapReader *pReader) { int32_t vnodeSnapRead(SVSnapReader *pReader, uint8_t **ppData, uint32_t *nData) { int32_t code = 0; + // CONFIG ============== + // FIXME: if commit multiple times and the config changed? + if (!pReader->cfgDone) { + char fName[TSDB_FILENAME_LEN]; + if (pReader->pVnode->pTfs) { + snprintf(fName, TSDB_FILENAME_LEN, "%s%s%s%s%s", tfsGetPrimaryPath(pReader->pVnode->pTfs), TD_DIRSEP, + pReader->pVnode->path, TD_DIRSEP, VND_INFO_FNAME); + } else { + snprintf(fName, TSDB_FILENAME_LEN, "%s%s%s", pReader->pVnode->path, TD_DIRSEP, VND_INFO_FNAME); + } + + TdFilePtr pFile = taosOpenFile(fName, TD_FILE_READ); + if (NULL == pFile) { + code = TAOS_SYSTEM_ERROR(errno); + goto _err; + } + + int64_t size; + if (taosFStatFile(pFile, &size, NULL) < 0) { + code = TAOS_SYSTEM_ERROR(errno); + taosCloseFile(&pFile); + goto _err; + } + + *ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + size + 1); + if (*ppData == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + taosCloseFile(&pFile); + goto _err; + } + ((SSnapDataHdr *)(*ppData))->type = SNAP_DATA_CFG; + ((SSnapDataHdr *)(*ppData))->size = size + 1; + ((SSnapDataHdr *)(*ppData))->data[size] = '\0'; + + if (taosReadFile(pFile, ((SSnapDataHdr *)(*ppData))->data, size) < 0) { + code = TAOS_SYSTEM_ERROR(errno); + taosMemoryFree(*ppData); + taosCloseFile(&pFile); + goto _err; + } + + taosCloseFile(&pFile); + + pReader->cfgDone = 1; + goto _exit; + } + // META ============== if (!pReader->metaDone) { // open reader if not @@ -230,6 +279,8 @@ struct SVSnapWriter { int64_t ever; int64_t commitID; int64_t index; + // config + SVnodeInfo info; // meta SMetaSnapWriter *pMetaSnapWriter; // tsdb @@ -248,6 +299,10 @@ int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWr int32_t code = 0; SVSnapWriter *pWriter = NULL; + // commit memory data + vnodeAsyncCommit(pVnode); + tsem_wait(&pVnode->canCommit); + // alloc pWriter = (SVSnapWriter *)taosMemoryCalloc(1, sizeof(*pWriter)); if (pWriter == NULL) { @@ -258,16 +313,8 @@ int32_t vnodeSnapWriterOpen(SVnode *pVnode, int64_t sver, int64_t ever, SVSnapWr pWriter->sver = sver; pWriter->ever = ever; - // commit it - code = vnodeSyncCommit(pVnode); - if (code) { - taosMemoryFree(pWriter); - goto _err; - } - // inc commit ID - pVnode->state.commitID++; - pWriter->commitID = pVnode->state.commitID; + pWriter->commitID = ++pVnode->state.commitID; vInfo("vgId:%d, vnode snapshot writer opened, sver:%" PRId64 " ever:%" PRId64 " commit id:%" PRId64, TD_VID(pVnode), sver, ever, pWriter->commitID); @@ -284,53 +331,89 @@ int32_t vnodeSnapWriterClose(SVSnapWriter *pWriter, int8_t rollback, SSnapshot * int32_t code = 0; SVnode *pVnode = pWriter->pVnode; + // prepare + if (pWriter->pTsdbSnapWriter) { + tsdbSnapWriterPrepareClose(pWriter->pTsdbSnapWriter); + } + + // commit json + if (!rollback) { + pVnode->config = pWriter->info.config; + pVnode->state = (SVState){.committed = pWriter->info.state.committed, + .applied = pWriter->info.state.committed, + .commitID = pWriter->commitID, + .commitTerm = pWriter->info.state.commitTerm, + .applyTerm = pWriter->info.state.commitTerm}; + pVnode->statis = pWriter->info.statis; + char dir[TSDB_FILENAME_LEN] = {0}; + if (pWriter->pVnode->pTfs) { + snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path); + } else { + snprintf(dir, TSDB_FILENAME_LEN, "%s", pWriter->pVnode->path); + } + + vnodeCommitInfo(dir, &pWriter->info); + } else { + vnodeRollback(pWriter->pVnode); + } + + // commit/rollback sub-system if (pWriter->pMetaSnapWriter) { code = metaSnapWriterClose(&pWriter->pMetaSnapWriter, rollback); - if (code) goto _err; + if (code) goto _exit; } if (pWriter->pTsdbSnapWriter) { code = tsdbSnapWriterClose(&pWriter->pTsdbSnapWriter, rollback); - if (code) goto _err; + if (code) goto _exit; } if (pWriter->pRsmaSnapWriter) { code = rsmaSnapWriterClose(&pWriter->pRsmaSnapWriter, rollback); - if (code) goto _err; + if (code) goto _exit; } - if (!rollback) { - SVnodeInfo info = {0}; - char dir[TSDB_FILENAME_LEN]; + vnodeBegin(pVnode); - pVnode->state.committed = pWriter->ever; - pVnode->state.applied = pWriter->ever; - pVnode->state.applyTerm = pSnapshot->lastApplyTerm; - pVnode->state.commitTerm = pSnapshot->lastApplyTerm; - - info.config = pVnode->config; - info.state.committed = pVnode->state.applied; - info.state.commitTerm = pVnode->state.applyTerm; - info.state.commitID = pVnode->state.commitID; - snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pVnode->pTfs), TD_DIRSEP, pVnode->path); - code = vnodeSaveInfo(dir, &info); - if (code) goto _err; - - code = vnodeCommitInfo(dir, &info); - if (code) goto _err; - - vnodeBegin(pVnode); +_exit: + if (code) { + vError("vgId:%d, vnode snapshot writer close failed since %s", TD_VID(pWriter->pVnode), tstrerror(code)); } else { - ASSERT(0); + vInfo("vgId:%d, vnode snapshot writer closed, rollback:%d", TD_VID(pVnode), rollback); + taosMemoryFree(pWriter); + } + tsem_post(&pVnode->canCommit); + return code; +} + +static int32_t vnodeSnapWriteInfo(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) { + int32_t code = 0; + + SSnapDataHdr *pHdr = (SSnapDataHdr *)pData; + + // decode info + if (vnodeDecodeInfo(pHdr->data, &pWriter->info) < 0) { + code = TSDB_CODE_INVALID_MSG; + goto _exit; + } + + // change some value + pWriter->info.state.commitID = pWriter->commitID; + + // modify info as needed + char dir[TSDB_FILENAME_LEN] = {0}; + if (pWriter->pVnode->pTfs) { + snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pWriter->pVnode->pTfs), TD_DIRSEP, + pWriter->pVnode->path); + } else { + snprintf(dir, TSDB_FILENAME_LEN, "%s", pWriter->pVnode->path); + } + if (vnodeSaveInfo(dir, &pWriter->info) < 0) { + code = terrno; + goto _exit; } _exit: - vInfo("vgId:%d, vnode snapshot writer closed, rollback:%d", TD_VID(pVnode), rollback); - taosMemoryFree(pWriter); - return code; - -_err: - vError("vgId:%d, vnode snapshot writer close failed since %s", TD_VID(pWriter->pVnode), tstrerror(code)); return code; } @@ -347,6 +430,10 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData) { pHdr->type, nData); switch (pHdr->type) { + case SNAP_DATA_CFG: { + code = vnodeSnapWriteInfo(pWriter, pData, nData); + if (code) goto _err; + } break; case SNAP_DATA_META: { // meta if (pWriter->pMetaSnapWriter == NULL) { diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index bb5063cfea..9dc1783fc7 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -337,11 +337,7 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp // commit if need if (vnodeShouldCommit(pVnode)) { vInfo("vgId:%d, commit at version %" PRId64, TD_VID(pVnode), version); -#if 0 - vnodeSyncCommit(pVnode); -#else vnodeAsyncCommit(pVnode); -#endif // start a new one if (vnodeBegin(pVnode) < 0) { diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index aa215a852f..2c23646db1 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -22,32 +22,21 @@ static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; } static inline void vnodeWaitBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, msg:%p wait block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p wait block, type:%s sec:%d seq:%" PRId64, pVnode->config.vgId, pMsg, + TMSG_INFO(pMsg->msgType), pVnode->blockSec, pVnode->blockSeq); tsem_wait(&pVnode->syncSem); } -static inline void vnodeWaitBlockMsgOld(SVnode *pVnode, const SRpcMsg *pMsg) { - if (vnodeIsMsgBlock(pMsg->msgType)) { - const STraceId *trace = &pMsg->info.traceId; - taosThreadMutexLock(&pVnode->lock); - if (!pVnode->blocked) { - vGTrace("vgId:%d, msg:%p wait block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); - pVnode->blocked = true; - taosThreadMutexUnlock(&pVnode->lock); - tsem_wait(&pVnode->syncSem); - } else { - taosThreadMutexUnlock(&pVnode->lock); - } - } -} - static inline void vnodePostBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { if (vnodeIsMsgBlock(pMsg->msgType)) { const STraceId *trace = &pMsg->info.traceId; taosThreadMutexLock(&pVnode->lock); if (pVnode->blocked) { - vGTrace("vgId:%d, msg:%p post block, type:%s", pVnode->config.vgId, pMsg, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p post block, type:%s sec:%d seq:%" PRId64, pVnode->config.vgId, pMsg, + TMSG_INFO(pMsg->msgType), pVnode->blockSec, pVnode->blockSeq); pVnode->blocked = false; + pVnode->blockSec = 0; + pVnode->blockSeq = 0; tsem_post(&pVnode->syncSem); } taosThreadMutexUnlock(&pVnode->lock); @@ -217,12 +206,19 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) #else static int32_t inline vnodeProposeMsg(SVnode *pVnode, SRpcMsg *pMsg, bool isWeak) { + int64_t seq = 0; + taosThreadMutexLock(&pVnode->lock); - int32_t code = syncPropose(pVnode->sync, pMsg, isWeak); + int32_t code = syncPropose(pVnode->sync, pMsg, isWeak, &seq); bool wait = (code == 0 && vnodeIsMsgBlock(pMsg->msgType)); if (wait) { ASSERT(!pVnode->blocked); pVnode->blocked = true; + pVnode->blockSec = taosGetTimestampSec(); + pVnode->blockSeq = seq; +#if 0 + pVnode->blockInfo = pMsg->info; +#endif } taosThreadMutexUnlock(&pVnode->lock); @@ -289,12 +285,15 @@ void vnodeApplyWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) { for (int32_t i = 0; i < numOfMsgs; ++i) { if (taosGetQitem(qall, (void **)&pMsg) == 0) continue; const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64, vgId, pMsg, - TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex); if (vnodeIsMsgBlock(pMsg->msgType)) { - vTrace("vgId:%d, blocking msg obtained from apply-queue. index:%" PRId64 ", term: %" PRId64 ", type: %s", vgId, - pMsg->info.conn.applyIndex, pMsg->info.conn.applyTerm, TMSG_INFO(pMsg->msgType)); + vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64 + ", blocking msg obtained sec:%d seq:%" PRId64, + vgId, pMsg, TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex, pVnode->blockSec, + pVnode->blockSeq); + } else { + vGTrace("vgId:%d, msg:%p get from vnode-apply queue, type:%s handle:%p index:%" PRId64, vgId, pMsg, + TMSG_INFO(pMsg->msgType), pMsg->info.handle, pMsg->info.conn.applyIndex); } SRpcMsg rsp = {.code = pMsg->code, .info = pMsg->info}; @@ -621,6 +620,32 @@ void vnodeSyncClose(SVnode *pVnode) { syncStop(pVnode->sync); } +void vnodeSyncCheckTimeout(SVnode *pVnode) { + vTrace("vgId:%d, check sync timeout msg", pVnode->config.vgId); + taosThreadMutexLock(&pVnode->lock); + if (pVnode->blocked) { + int32_t curSec = taosGetTimestampSec(); + int32_t delta = curSec - pVnode->blockSec; + if (delta > VNODE_TIMEOUT_SEC) { + vError("vgId:%d, failed to propose since timeout and post block, start:%d cur:%d delta:%d seq:%" PRId64, + pVnode->config.vgId, pVnode->blockSec, curSec, delta, pVnode->blockSeq); + if (syncSendTimeoutRsp(pVnode->sync, pVnode->blockSeq) != 0) { +#if 0 + SRpcMsg rpcMsg = {.code = TSDB_CODE_SYN_TIMEOUT, .info = pVnode->blockInfo}; + vError("send timeout response since its applyed, seq:%" PRId64 " handle:%p ahandle:%p", pVnode->blockSeq, + rpcMsg.info.handle, rpcMsg.info.ahandle); + rpcSendResponse(&rpcMsg); +#endif + } + pVnode->blocked = false; + pVnode->blockSec = 0; + pVnode->blockSeq = 0; + tsem_post(&pVnode->syncSem); + } + } + taosThreadMutexUnlock(&pVnode->lock); +} + bool vnodeIsRoleLeader(SVnode *pVnode) { SSyncState state = syncGetState(pVnode->sync); return state.state == TAOS_SYNC_STATE_LEADER; diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index 47cb0ef559..94ee295fe4 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -1728,7 +1728,7 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) { } if (dbInfo->vgVersion < 0 || taosHashGetSize(dbInfo->vgHash) <= 0) { - ctgError("invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash, + ctgDebug("invalid db vgInfo, dbFName:%s, vgHash:%p, vgVersion:%d, vgHashSize:%d", dbFName, dbInfo->vgHash, dbInfo->vgVersion, taosHashGetSize(dbInfo->vgHash)); CTG_ERR_JRET(TSDB_CODE_APP_ERROR); } diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 8423b77906..4103ca82dc 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -510,6 +510,7 @@ int32_t extractDataBlockFromFetchRsp(SSDataBlock* pRes, char* pData, SArray* pCo blockDataEnsureCapacity(pRes, pBlock->info.rows); // data from mnode + pRes->info.dataLoad = 1; pRes->info.rows = pBlock->info.rows; relocateColumnData(pRes, pColList, pBlock->pDataBlock, false); blockDataDestroy(pBlock); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 043cc396b5..1c80eff685 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1080,7 +1080,7 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS qDebug("%s result generated, rows:%d, groupId:%" PRIu64, GET_TASKID(pTaskInfo), pBlock->info.rows, pBlock->info.id.groupId); - + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return 0; } @@ -2546,6 +2546,7 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, SStreamState* pStat pBlock->info.rows += pRow->numOfRows; releaseOutputBuf(pState, &key, pRow); } + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return TSDB_CODE_SUCCESS; } @@ -2635,6 +2636,7 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, SStreamState* pSta } } + pBlock->info.dataLoad = 1; pBlock->info.rows += pRow->numOfRows; // saveSessionDiscBuf(pState, pKey, pVal, size); releaseOutputBuf(pState, NULL, pRow); diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 1a43ddecdd..59266dad7e 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -698,6 +698,7 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) { pInfo->pageIndex += 1; releaseBufPage(pInfo->pBuf, page); + pInfo->binfo.pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->binfo.pRes, 0); pInfo->binfo.pRes->info.id.groupId = pGroupInfo->groupId; @@ -960,6 +961,8 @@ static SSDataBlock* buildStreamPartitionResult(SOperatorInfo* pOperator) { } taosArrayDestroy(pParInfo->rowIds); pParInfo->rowIds = NULL; + pDest->info.dataLoad = 1; + blockDataUpdateTsWindow(pDest, pInfo->tsColIndex); pDest->info.id.groupId = pParInfo->groupId; pOperator->resultInfo.totalRows += pDest->info.rows; diff --git a/source/libs/executor/src/joinoperator.c b/source/libs/executor/src/joinoperator.c index d460af971c..8a097a23ce 100644 --- a/source/libs/executor/src/joinoperator.c +++ b/source/libs/executor/src/joinoperator.c @@ -87,11 +87,11 @@ SOperatorInfo* createMergeJoinOperatorInfo(SOperatorInfo** pDownstream, int32_t } int32_t numOfCols = 0; - SSDataBlock* pResBlock = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); + pInfo->pRes = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); + SExprInfo* pExprInfo = createExprInfo(pJoinNode->pTargets, NULL, &numOfCols); initResultSizeInfo(&pOperator->resultInfo, 4096); - - pInfo->pRes = pResBlock; + blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); setOperatorInfo(pOperator, "MergeJoinOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN, false, OP_NOT_OPENED, pInfo, pTaskInfo); pOperator->exprSupp.pExprInfo = pExprInfo; @@ -401,6 +401,7 @@ static void doMergeJoinImpl(struct SOperatorInfo* pOperator, SSDataBlock* pRes) // the pDataBlock are always the same one, no need to call this again pRes->info.rows = nrows; + pRes->info.dataLoad = 1; if (pRes->info.rows >= pOperator->resultInfo.threshold) { break; } @@ -412,7 +413,7 @@ SSDataBlock* doMergeJoin(struct SOperatorInfo* pOperator) { SSDataBlock* pRes = pJoinInfo->pRes; blockDataCleanup(pRes); - blockDataEnsureCapacity(pRes, 4096); + while (true) { int32_t numOfRowsBefore = pRes->info.rows; doMergeJoinImpl(pOperator, pRes); diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 2be6508272..221ba0e8d6 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -657,6 +657,7 @@ static void setPseudoOutputColInfo(SSDataBlock* pResult, SqlFunctionCtx* pCtx, S int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, int32_t numOfOutput, SArray* pPseudoList) { setPseudoOutputColInfo(pResult, pCtx, pPseudoList); + pResult->info.dataLoad = 1; if (pSrcBlock == NULL) { for (int32_t k = 0; k < numOfOutput; ++k) { diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 1fcee1992e..76c07a9611 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -110,9 +110,9 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn if (order == TSDB_ORDER_ASC) { w = getAlignQueryTimeWindow(pInterval, pInterval->precision, pBlockInfo->window.skey); - assert(w.ekey >= pBlockInfo->window.skey); + ASSERT(w.ekey >= pBlockInfo->window.skey); - if (TMAX(w.skey, pBlockInfo->window.skey) <= TMIN(w.ekey, pBlockInfo->window.ekey)) { + if (w.ekey < pBlockInfo->window.ekey) { return true; } @@ -122,16 +122,16 @@ static bool overlapWithTimeWindow(SInterval* pInterval, SDataBlockInfo* pBlockIn break; } - assert(w.ekey > pBlockInfo->window.ekey); + ASSERT(w.ekey > pBlockInfo->window.ekey); if (TMAX(w.skey, pBlockInfo->window.skey) <= pBlockInfo->window.ekey) { return true; } } } else { w = getAlignQueryTimeWindow(pInterval, pInterval->precision, pBlockInfo->window.ekey); - assert(w.skey <= pBlockInfo->window.ekey); + ASSERT(w.skey <= pBlockInfo->window.ekey); - if (TMAX(w.skey, pBlockInfo->window.skey) <= TMIN(w.ekey, pBlockInfo->window.ekey)) { + if (w.skey > pBlockInfo->window.skey) { return true; } @@ -1342,6 +1342,7 @@ static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, } pDestBlock->info.type = STREAM_CLEAR; pDestBlock->info.version = pSrcBlock->info.version; + pDestBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pDestBlock, 0); return code; } @@ -1450,6 +1451,7 @@ static void checkUpdateData(SStreamScanInfo* pInfo, bool invertible, SSDataBlock } if (out && pInfo->pUpdateDataRes->info.rows > 0) { pInfo->pUpdateDataRes->info.version = pBlock->info.version; + pInfo->pUpdateDataRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pUpdateDataRes, 0); pInfo->pUpdateDataRes->info.type = pInfo->partitionSup.needCalc ? STREAM_DELETE_DATA : STREAM_CLEAR; } @@ -1512,6 +1514,7 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock doFilter(pInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); } + pInfo->pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex); blockDataFreeRes((SSDataBlock*)pBlock); @@ -1799,6 +1802,7 @@ FETCH_NEXT_BLOCK: // TODO move into scan pBlock->info.calWin.skey = INT64_MIN; pBlock->info.calWin.ekey = INT64_MAX; + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); switch (pBlock->info.type) { case STREAM_NORMAL: @@ -1976,6 +1980,7 @@ FETCH_NEXT_BLOCK: } doFilter(pInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); + pInfo->pRes->info.dataLoad = 1; blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex); if (pBlockInfo->rows > 0 || pInfo->pUpdateDataRes->info.rows > 0) { diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index 005b794f0b..7ac007b7cb 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -105,6 +105,7 @@ void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle) { } } + pBlock->info.dataLoad = 1; pBlock->info.rows += 1; } @@ -698,6 +699,7 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData pInfo->limitInfo.numOfOutputRows += p->info.rows; pDataBlock->info.rows = p->info.rows; pDataBlock->info.id.groupId = pInfo->groupId; + pDataBlock->info.dataLoad = 1; } qDebug("%s get sorted block, groupId:0x%" PRIx64 " rows:%d", GET_TASKID(pTaskInfo), pDataBlock->info.id.groupId, diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index f7bee7d351..a82dc13318 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -91,11 +91,15 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo SColumnInfoData* pTsCol = taosArrayGet(pBlock->pDataBlock, pSliceInfo->tsCol.slotId); SFillLinearInfo* pLinearInfo = taosArrayGet(pSliceInfo->pLinearInfo, i); + + if (!IS_MATHABLE_TYPE(pColInfoData->info.type)) { + continue; + } + // null value is represented by using key = INT64_MIN for now. // TODO: optimize to ignore null values for linear interpolation. if (!pLinearInfo->isStartSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { - ASSERT(IS_MATHABLE_TYPE(pColInfoData->info.type)); pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); char* p = colDataGetData(pColInfoData, rowIndex); diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 2af551b832..ca64fd135e 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1037,9 +1037,10 @@ SResultRowPosition addToOpenWindowList(SResultRowInfo* pResultRowInfo, const SRe int64_t* extractTsCol(SSDataBlock* pBlock, const SIntervalAggOperatorInfo* pInfo) { TSKEY* tsCols = NULL; - if (pBlock->pDataBlock != NULL) { + if (pBlock->pDataBlock != NULL && pBlock->info.dataLoad == 1) { SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, pInfo->primaryTsIndex); tsCols = (int64_t*)pColDataInfo->pData; + ASSERT(tsCols[0] != 0); // no data in primary ts if (tsCols[0] == 0 && tsCols[pBlock->info.rows - 1] == 0) { @@ -1083,8 +1084,6 @@ static int32_t doOpenIntervalAgg(SOperatorInfo* pOperator) { // the pDataBlock are always the same one, no need to call this again setInputDataBlock(pSup, pBlock, pInfo->inputOrder, scanFlag, true); - blockDataUpdateTsWindow(pBlock, pInfo->primaryTsIndex); - hashIntervalAgg(pOperator, &pInfo->binfo.resultRowInfo, pBlock, scanFlag); } diff --git a/source/libs/executor/test/executorTests.cpp b/source/libs/executor/test/executorTests.cpp index 1c42163349..2efd06f440 100644 --- a/source/libs/executor/test/executorTests.cpp +++ b/source/libs/executor/test/executorTests.cpp @@ -166,6 +166,7 @@ SSDataBlock* get2ColsDummyBlock(SOperatorInfo* pOperator) { pInfo->current += 1; + pBlock->info.dataLoad = 1; blockDataUpdateTsWindow(pBlock, 0); return pBlock; } diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 1c74d22a82..60bf30d8ed 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -514,7 +514,7 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { numOfElem = pInput->numOfRows; pAvgRes->count += pInput->numOfRows; - bool simdAvailable = tsAVXEnable && tsSIMDEnable && (numOfRows > THRESHOLD_SIZE); + bool simdAvailable = tsAVXEnable && tsSIMDBuiltins && (numOfRows > THRESHOLD_SIZE); switch(type) { case TSDB_DATA_TYPE_UTINYINT: diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c index b2cb36cba0..cb5cea3cc8 100644 --- a/source/libs/function/src/detail/tminmax.c +++ b/source/libs/function/src/detail/tminmax.c @@ -369,7 +369,7 @@ static int32_t findFirstValPosition(const SColumnInfoData* pCol, int32_t start, static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i8VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -403,7 +403,7 @@ static void handleInt8Col(const void* data, int32_t start, int32_t numOfRows, SM static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i16VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -437,7 +437,7 @@ static void handleInt16Col(const void* data, int32_t start, int32_t numOfRows, S static void handleInt32Col(const void* data, int32_t start, int32_t numOfRows, SMinmaxResInfo* pBuf, bool isMinFunc, bool signVal) { // AVX2 version to speedup the loop - if (tsAVX2Enable && tsSIMDEnable) { + if (tsAVX2Enable && tsSIMDBuiltins) { pBuf->v = i32VectorCmpAVX2(data, numOfRows, isMinFunc, signVal); } else { if (!pBuf->assign) { @@ -500,7 +500,7 @@ static void handleFloatCol(SColumnInfoData* pCol, int32_t start, int32_t numOfRo float* val = (float*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXEnable && tsSIMDBuiltins) { *val = floatVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { @@ -530,7 +530,7 @@ static void handleDoubleCol(SColumnInfoData* pCol, int32_t start, int32_t numOfR double* val = (double*)&pBuf->v; // AVX version to speedup the loop - if (tsAVXEnable && tsSIMDEnable) { + if (tsAVXEnable && tsSIMDBuiltins) { *val = (double)doubleVectorCmpAVX(pData, numOfRows, isMinFunc); } else { if (!pBuf->assign) { diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 9c3e1f5604..157ee08f15 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -364,6 +364,7 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) { assert(pSlot->info.data->num >= pBucket->elemPerPage && pSlot->info.size > 0); // keep the pointer in memory + setBufPageDirty(pSlot->info.data, true); releaseBufPage(pBucket->pBuffer, pSlot->info.data); pSlot->info.data = NULL; } @@ -497,15 +498,16 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction) resetSlotInfo(pMemBucket); int32_t groupId = getGroupId(pMemBucket->numOfSlots, i, pMemBucket->times - 1); - SArray* list = taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); + SArray* list = *(SArray **)taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); ASSERT(list != NULL && list->size > 0); for (int32_t f = 0; f < list->size; ++f) { - SPageInfo *pgInfo = *(SPageInfo **)taosArrayGet(list, f); - SFilePage *pg = getBufPage(pMemBucket->pBuffer, getPageId(pgInfo)); + int32_t *pageId = taosArrayGet(list, f); + SFilePage *pg = getBufPage(pMemBucket->pBuffer, *pageId); tMemBucketPut(pMemBucket, pg->data, (int32_t)pg->num); - releaseBufPageInfo(pMemBucket->pBuffer, pgInfo); + setBufPageDirty(pg, true); + releaseBufPage(pMemBucket->pBuffer, pg); } return getPercentileImpl(pMemBucket, count - num, fraction); diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 32e57565d4..0b309bc8f5 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -837,9 +837,34 @@ int32_t convertUdfColumnToDataBlock(SUdfColumn *udfCol, SSDataBlock *block) { } int32_t convertScalarParamToDataBlock(SScalarParam *input, int32_t numOfCols, SSDataBlock *output) { - output->info.rows = input->numOfRows; + int32_t numOfRows = 0; + for (int32_t i = 0; i < numOfCols; ++i) { + numOfRows = (input[i].numOfRows > numOfRows) ? input[i].numOfRows : numOfRows; + } + output->info.rows = numOfRows; output->pDataBlock = taosArrayInit(numOfCols, sizeof(SColumnInfoData)); for (int32_t i = 0; i < numOfCols; ++i) { + if ((input+i)->numOfRows < numOfRows) { + SColumnInfoData* pColInfoData = (input+i)->columnData; + int32_t startRow = (input+i)->numOfRows; + int32_t expandRows = numOfRows - startRow; + colInfoDataEnsureCapacity(pColInfoData, numOfRows, false); + bool isNull = colDataIsNull_s(pColInfoData, (input+i)->numOfRows - 1); + if (isNull) { + colDataAppendNNULL(pColInfoData, startRow, expandRows); + } else { + char* src = colDataGetData(pColInfoData, (input + i)->numOfRows - 1); + int32_t bytes = pColInfoData->info.bytes; + char* data = taosMemoryMalloc(bytes); + memcpy(data, src, bytes); + for (int j = 0; j < expandRows; ++j) { + colDataAppend(pColInfoData, startRow+j, data, false); + } + //colDataAppendNItems(pColInfoData, startRow, data, expandRows); + taosMemoryFree(data); + } + } + taosArrayPush(output->pDataBlock, (input + i)->columnData); if (IS_VAR_DATA_TYPE((input + i)->columnData->info.type)) { diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 2f3db636c8..40c75ce6ba 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -28,39 +28,46 @@ #include "tmsg.h" #include "trpc.h" #include "tmisce.h" -// clang-foramt on +// clang-format on typedef struct SUdfdContext { - uv_loop_t * loop; + uv_loop_t *loop; uv_pipe_t ctrlPipe; uv_signal_t intrSignal; char listenPipeName[PATH_MAX + UDF_LISTEN_PIPE_NAME_LEN + 2]; uv_pipe_t listeningPipe; - void * clientRpc; + void *clientRpc; SCorEpSet mgmtEp; uv_mutex_t udfsMutex; - SHashObj * udfsHash; + SHashObj *udfsHash; - SArray* residentFuncs; + SArray *residentFuncs; bool printVersion; } SUdfdContext; SUdfdContext global; +struct SUdfdUvConn; +struct SUvUdfWork; + typedef struct SUdfdUvConn { uv_stream_t *client; - char * inputBuf; + char *inputBuf; int32_t inputLen; int32_t inputCap; int32_t inputTotal; + + struct SUvUdfWork *pWorkList; // head of work list } SUdfdUvConn; typedef struct SUvUdfWork { - uv_stream_t *client; + SUdfdUvConn *conn; uv_buf_t input; uv_buf_t output; + + struct SUvUdfWork *pWorkNext; } SUvUdfWork; typedef enum { UDF_STATE_INIT = 0, UDF_STATE_LOADING, UDF_STATE_READY, UDF_STATE_UNLOADING } EUdfState; @@ -70,7 +77,7 @@ typedef struct SUdf { EUdfState state; uv_mutex_t lock; uv_cond_t condReady; - bool resident; + bool resident; char name[TSDB_FUNC_NAME_LEN + 1]; int8_t funcType; @@ -107,7 +114,7 @@ typedef enum EUdfdRpcReqRspType { typedef struct SUdfdRpcSendRecvInfo { EUdfdRpcReqRspType rpcType; int32_t code; - void * param; + void *param; uv_sem_t resultSem; } SUdfdRpcSendRecvInfo; @@ -178,7 +185,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { fnInfo("setup request. seq num: %" PRId64 ", udf name: %s", request->seqNum, request->setup.udfName); SUdfSetupRequest *setup = &request->setup; int32_t code = TSDB_CODE_SUCCESS; - SUdf * udf = NULL; + SUdf *udf = NULL; uv_mutex_lock(&global.udfsMutex); SUdf **udfInHash = taosHashGet(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName)); if (udfInHash) { @@ -193,7 +200,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { uv_cond_init(&udfNew->condReady); udf = udfNew; - SUdf** pUdf = &udf; + SUdf **pUdf = &udf; taosHashPut(global.udfsHash, request->setup.udfName, strlen(request->setup.udfName), pUdf, POINTER_BYTES); uv_mutex_unlock(&global.udfsMutex); } @@ -207,7 +214,7 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { } udf->resident = false; for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) { - char* funcName = taosArrayGet(global.residentFuncs, i); + char *funcName = taosArrayGet(global.residentFuncs, i); if (strcmp(setup->udfName, funcName) == 0) { udf->resident = true; break; @@ -248,11 +255,12 @@ void udfdProcessSetupRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { SUdfCallRequest *call = &request->call; - fnDebug("call request. call type %d, handle: %" PRIx64 ", seq num %" PRId64 , call->callType, call->udfHandle, request->seqNum); - SUdfcFuncHandle * handle = (SUdfcFuncHandle *)(call->udfHandle); - SUdf * udf = handle->udf; + fnDebug("call request. call type %d, handle: %" PRIx64 ", seq num %" PRId64, call->callType, call->udfHandle, + request->seqNum); + SUdfcFuncHandle *handle = (SUdfcFuncHandle *)(call->udfHandle); + SUdf *udf = handle->udf; SUdfResponse response = {0}; - SUdfResponse * rsp = &response; + SUdfResponse *rsp = &response; SUdfCallResponse *subRsp = &rsp->callRsp; int32_t code = TSDB_CODE_SUCCESS; @@ -352,7 +360,7 @@ void udfdProcessTeardownRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { SUdfTeardownRequest *teardown = &request->teardown; fnInfo("teardown. seq number: %" PRId64 ", handle:%" PRIx64, request->seqNum, teardown->udfHandle); SUdfcFuncHandle *handle = (SUdfcFuncHandle *)(teardown->udfHandle); - SUdf * udf = handle->udf; + SUdf *udf = handle->udf; bool unloadUdf = false; int32_t code = TSDB_CODE_SUCCESS; @@ -409,15 +417,14 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) { if (msgInfo->rpcType == UDFD_RPC_MNODE_CONNECT) { SConnectRsp connectRsp = {0}; tDeserializeSConnectRsp(pMsg->pCont, pMsg->contLen, &connectRsp); - + int32_t now = taosGetTimestampSec(); int32_t delta = abs(now - connectRsp.svrTimestamp); if (delta > 900) { msgInfo->code = TSDB_CODE_TIME_UNSYNCED; goto _return; } - - + if (connectRsp.epSet.numOfEps == 0) { msgInfo->code = TSDB_CODE_APP_ERROR; goto _return; @@ -434,7 +441,7 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) { goto _return; } SFuncInfo *pFuncInfo = (SFuncInfo *)taosArrayGet(retrieveRsp.pFuncInfos, 0); - SUdf * udf = msgInfo->param; + SUdf *udf = msgInfo->param; udf->funcType = pFuncInfo->funcType; udf->scriptType = pFuncInfo->scriptType; udf->outputType = pFuncInfo->outputType; @@ -487,7 +494,7 @@ int32_t udfdFillUdfInfoFromMNode(void *clientRpc, char *udfName, SUdf *udf) { taosArrayPush(retrieveReq.pFuncNames, udfName); int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq); - void * pReq = rpcMallocCont(contLen); + void *pReq = rpcMallocCont(contLen); tSerializeSRetrieveFuncReq(pReq, contLen, &retrieveReq); taosArrayDestroy(retrieveReq.pFuncNames); @@ -522,7 +529,7 @@ int32_t udfdConnectToMnode() { connReq.startTime = taosGetTimestampMs(); int32_t contLen = tSerializeSConnectReq(NULL, 0, &connReq); - void * pReq = rpcMallocCont(contLen); + void *pReq = rpcMallocCont(contLen); tSerializeSConnectReq(pReq, contLen, &connReq); SUdfdRpcSendRecvInfo *msgInfo = taosMemoryCalloc(1, sizeof(SUdfdRpcSendRecvInfo)); @@ -589,7 +596,7 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) { strncpy(finishFuncName, processFuncName, sizeof(finishFuncName)); strncat(finishFuncName, finishSuffix, strlen(finishSuffix)); uv_dlsym(&udf->lib, finishFuncName, (void **)(&udf->aggFinishFunc)); - char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0}; + char mergeFuncName[TSDB_FUNC_NAME_LEN + 6] = {0}; char *mergeSuffix = "_merge"; strncpy(mergeFuncName, processFuncName, sizeof(mergeFuncName)); strncat(mergeFuncName, mergeSuffix, strlen(mergeSuffix)); @@ -601,9 +608,10 @@ static bool udfdRpcRfp(int32_t code, tmsg_t msgType) { if (code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING || code == TSDB_CODE_APP_IS_STOPPING) { - if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH || msgType == TDMT_SCH_MERGE_FETCH) { + if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH || + msgType == TDMT_SCH_MERGE_FETCH) { return false; - } + } return true; } else { return false; @@ -663,7 +671,7 @@ int32_t udfdOpenClientRpc() { rpcInit.parent = &global; rpcInit.rfp = udfdRpcRfp; rpcInit.compressSize = tsCompressMsgSize; - + global.clientRpc = rpcOpen(&rpcInit); if (global.clientRpc == NULL) { fnError("failed to init dnode rpc client"); @@ -684,6 +692,17 @@ void udfdOnWrite(uv_write_t *req, int status) { if (status < 0) { fnError("udfd send response error, length: %zu code: %s", work->output.len, uv_err_name(status)); } + // remove work from the connection work list + if (work->conn != NULL) { + SUvUdfWork **ppWork; + for (ppWork = &work->conn->pWorkList; *ppWork && (*ppWork != work); ppWork = &((*ppWork)->pWorkNext)) { + } + if (*ppWork == work) { + *ppWork = work->pWorkNext; + } else { + fnError("work not in conn any more"); + } + } taosMemoryFree(work->output.base); taosMemoryFree(work); taosMemoryFree(req); @@ -692,10 +711,11 @@ void udfdOnWrite(uv_write_t *req, int status) { void udfdSendResponse(uv_work_t *work, int status) { SUvUdfWork *udfWork = (SUvUdfWork *)(work->data); - uv_write_t *write_req = taosMemoryMalloc(sizeof(uv_write_t)); - write_req->data = udfWork; - uv_write(write_req, udfWork->client, &udfWork->output, 1, udfdOnWrite); - + if (udfWork->conn != NULL) { + uv_write_t *write_req = taosMemoryMalloc(sizeof(uv_write_t)); + write_req->data = udfWork; + uv_write(write_req, udfWork->conn->client, &udfWork->output, 1, udfdOnWrite); + } taosMemoryFree(work); } @@ -716,8 +736,8 @@ void udfdAllocBuffer(uv_handle_t *handle, size_t suggestedSize, uv_buf_t *buf) { buf->len = 0; } } else if (ctx->inputTotal == -1 && ctx->inputLen < msgHeadSize) { - buf->base = ctx->inputBuf + ctx->inputLen; - buf->len = msgHeadSize - ctx->inputLen; + buf->base = ctx->inputBuf + ctx->inputLen; + buf->len = msgHeadSize - ctx->inputLen; } else { ctx->inputCap = ctx->inputTotal > ctx->inputCap ? ctx->inputTotal : ctx->inputCap; void *inputBuf = taosMemoryRealloc(ctx->inputBuf, ctx->inputCap); @@ -744,10 +764,15 @@ bool isUdfdUvMsgComplete(SUdfdUvConn *pipe) { } void udfdHandleRequest(SUdfdUvConn *conn) { - uv_work_t * work = taosMemoryMalloc(sizeof(uv_work_t)); + char *inputBuf = conn->inputBuf; + int32_t inputLen = conn->inputLen; + + uv_work_t *work = taosMemoryMalloc(sizeof(uv_work_t)); SUvUdfWork *udfWork = taosMemoryMalloc(sizeof(SUvUdfWork)); - udfWork->client = conn->client; - udfWork->input = uv_buf_init(conn->inputBuf, conn->inputLen); + udfWork->conn = conn; + udfWork->pWorkNext = conn->pWorkList; + conn->pWorkList = udfWork; + udfWork->input = uv_buf_init(inputBuf, inputLen); conn->inputBuf = NULL; conn->inputLen = 0; conn->inputCap = 0; @@ -758,13 +783,19 @@ void udfdHandleRequest(SUdfdUvConn *conn) { void udfdPipeCloseCb(uv_handle_t *pipe) { SUdfdUvConn *conn = pipe->data; + SUvUdfWork* pWork = conn->pWorkList; + while (pWork != NULL) { + pWork->conn = NULL; + pWork = pWork->pWorkNext; + } + taosMemoryFree(conn->client); taosMemoryFree(conn->inputBuf); taosMemoryFree(conn); } void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { - fnDebug("udf read %zd bytes from client", nread); + fnDebug("udfd read %zd bytes from client", nread); if (nread == 0) return; SUdfdUvConn *conn = client->data; @@ -780,10 +811,10 @@ void udfdPipeRead(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) { } if (nread < 0) { - fnError("Receive error %s", uv_err_name(nread)); if (nread == UV_EOF) { - // TODO check more when close + fnInfo("udfd pipe read EOF"); } else { + fnError("Receive error %s", uv_err_name(nread)); } udfdUvHandleError(conn); } @@ -799,6 +830,7 @@ void udfdOnNewConnection(uv_stream_t *server, int status) { uv_pipe_init(global.loop, client, 0); if (uv_accept(server, (uv_stream_t *)client) == 0) { SUdfdUvConn *ctx = taosMemoryMalloc(sizeof(SUdfdUvConn)); + ctx->pWorkList = NULL; ctx->client = (uv_stream_t *)client; ctx->inputBuf = 0; ctx->inputLen = 0; @@ -891,7 +923,7 @@ static int32_t udfdUvInit() { } global.loop = loop; - if (tsStartUdfd) { // udfd is started by taosd, which shall exit when taosd exit + if (tsStartUdfd) { // udfd is started by taosd, which shall exit when taosd exit uv_pipe_init(global.loop, &global.ctrlPipe, 1); uv_pipe_open(&global.ctrlPipe, 0); uv_read_start((uv_stream_t *)&global.ctrlPipe, udfdCtrlAllocBufCb, udfdCtrlReadCb); @@ -966,10 +998,10 @@ int32_t udfdInitResidentFuncs() { } global.residentFuncs = taosArrayInit(2, TSDB_FUNC_NAME_LEN); - char* pSave = tsUdfdResFuncs; - char* token; + char *pSave = tsUdfdResFuncs; + char *token; while ((token = strtok_r(pSave, ",", &pSave)) != NULL) { - char func[TSDB_FUNC_NAME_LEN+1] = {0}; + char func[TSDB_FUNC_NAME_LEN + 1] = {0}; strncpy(func, token, TSDB_FUNC_NAME_LEN); fnInfo("udfd add resident function %s", func); taosArrayPush(global.residentFuncs, func); @@ -980,10 +1012,10 @@ int32_t udfdInitResidentFuncs() { int32_t udfdDeinitResidentFuncs() { for (int32_t i = 0; i < taosArrayGetSize(global.residentFuncs); ++i) { - char* funcName = taosArrayGet(global.residentFuncs, i); - SUdf** udfInHash = taosHashGet(global.udfsHash, funcName, strlen(funcName)); + char *funcName = taosArrayGet(global.residentFuncs, i); + SUdf **udfInHash = taosHashGet(global.udfsHash, funcName, strlen(funcName)); if (udfInHash) { - SUdf* udf = *udfInHash; + SUdf *udf = *udfInHash; if (udf->destroyFunc) { (udf->destroyFunc)(); } diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 5d20dbd764..aab018c879 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -295,6 +295,13 @@ static int32_t stateWindowNodeCopy(const SStateWindowNode* pSrc, SStateWindowNod return TSDB_CODE_SUCCESS; } +static int32_t eventWindowNodeCopy(const SEventWindowNode* pSrc, SEventWindowNode* pDst) { + CLONE_NODE_FIELD(pCol); + CLONE_NODE_FIELD(pStartCond); + CLONE_NODE_FIELD(pEndCond); + return TSDB_CODE_SUCCESS; +} + static int32_t sessionWindowNodeCopy(const SSessionWindowNode* pSrc, SSessionWindowNode* pDst) { CLONE_NODE_FIELD_EX(pCol, SColumnNode*); CLONE_NODE_FIELD_EX(pGap, SValueNode*); @@ -462,6 +469,8 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p CLONE_NODE_FIELD(pTspk); CLONE_NODE_FIELD(pTsEnd); CLONE_NODE_FIELD(pStateExpr); + CLONE_NODE_FIELD(pStartCond); + CLONE_NODE_FIELD(pEndCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); COPY_SCALAR_FIELD(deleteMark); @@ -709,6 +718,9 @@ SNode* nodesCloneNode(const SNode* pNode) { case QUERY_NODE_STATE_WINDOW: code = stateWindowNodeCopy((const SStateWindowNode*)pNode, (SStateWindowNode*)pDst); break; + case QUERY_NODE_EVENT_WINDOW: + code = eventWindowNodeCopy((const SEventWindowNode*)pNode, (SEventWindowNode*)pDst); + break; case QUERY_NODE_SESSION_WINDOW: code = sessionWindowNodeCopy((const SSessionWindowNode*)pNode, (SSessionWindowNode*)pDst); break; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index d062ed34c4..38884a37e0 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -85,6 +85,8 @@ const char* nodesNodeName(ENodeType type) { return "WhenThen"; case QUERY_NODE_CASE_WHEN: return "CaseWhen"; + case QUERY_NODE_EVENT_WINDOW: + return "EventWindow"; case QUERY_NODE_SET_OPERATOR: return "SetOperator"; case QUERY_NODE_SELECT_STMT: @@ -233,6 +235,10 @@ const char* nodesNodeName(ENodeType type) { return "PhysiLastRowScan"; case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: return "PhysiTableCountScan"; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + return "PhysiMergeEventWindow"; + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return "PhysiStreamEventWindow"; case QUERY_NODE_PHYSICAL_PLAN_PROJECT: return "PhysiProject"; case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: @@ -2272,6 +2278,37 @@ static int32_t jsonToPhysiStateWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkEventWindowPhysiPlanStartCond = "StartCond"; +static const char* jkEventWindowPhysiPlanEndCond = "EndCond"; + +static int32_t physiEventWindowNodeToJson(const void* pObj, SJson* pJson) { + const SEventWinodwPhysiNode* pNode = (const SEventWinodwPhysiNode*)pObj; + + int32_t code = physiWindowNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowPhysiPlanStartCond, nodeToJson, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowPhysiPlanEndCond, nodeToJson, pNode->pEndCond); + } + + return code; +} + +static int32_t jsonToPhysiEventWindowNode(const SJson* pJson, void* pObj) { + SEventWinodwPhysiNode* pNode = (SEventWinodwPhysiNode*)pObj; + + int32_t code = jsonToPhysiWindowNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowPhysiPlanStartCond, &pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowPhysiPlanEndCond, &pNode->pEndCond); + } + + return code; +} + static const char* jkPartitionPhysiPlanExprs = "Exprs"; static const char* jkPartitionPhysiPlanPartitionKeys = "PartitionKeys"; static const char* jkPartitionPhysiPlanTargets = "Targets"; @@ -3660,6 +3697,36 @@ static int32_t jsonToSessionWindowNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkEventWindowTsPrimaryKey = "TsPrimaryKey"; +static const char* jkEventWindowStartCond = "StartCond"; +static const char* jkEventWindowEndCond = "EndCond"; + +static int32_t eventWindowNodeToJson(const void* pObj, SJson* pJson) { + const SEventWindowNode* pNode = (const SEventWindowNode*)pObj; + + int32_t code = tjsonAddObject(pJson, jkEventWindowTsPrimaryKey, nodeToJson, pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowStartCond, nodeToJson, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkEventWindowEndCond, nodeToJson, pNode->pEndCond); + } + return code; +} + +static int32_t jsonToEventWindowNode(const SJson* pJson, void* pObj) { + SEventWindowNode* pNode = (SEventWindowNode*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkEventWindowTsPrimaryKey, &pNode->pCol); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowStartCond, &pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkEventWindowEndCond, &pNode->pEndCond); + } + return code; +} + static const char* jkIntervalWindowInterval = "Interval"; static const char* jkIntervalWindowOffset = "Offset"; static const char* jkIntervalWindowSliding = "Sliding"; @@ -4615,6 +4682,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return whenThenNodeToJson(pObj, pJson); case QUERY_NODE_CASE_WHEN: return caseWhenNodeToJson(pObj, pJson); + case QUERY_NODE_EVENT_WINDOW: + return eventWindowNodeToJson(pObj, pJson); case QUERY_NODE_SET_OPERATOR: return setOperatorToJson(pObj, pJson); case QUERY_NODE_SELECT_STMT: @@ -4712,6 +4781,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return physiStateWindowNodeToJson(pObj, pJson); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return physiEventWindowNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return physiPartitionNodeToJson(pObj, pJson); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -4787,6 +4859,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToWhenThenNode(pJson, pObj); case QUERY_NODE_CASE_WHEN: return jsonToCaseWhenNode(pJson, pObj); + case QUERY_NODE_EVENT_WINDOW: + return jsonToEventWindowNode(pJson, pObj); case QUERY_NODE_SET_OPERATOR: return jsonToSetOperator(pJson, pObj); case QUERY_NODE_SELECT_STMT: @@ -4871,6 +4945,9 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return jsonToPhysiStateWindowNode(pJson, pObj); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return jsonToPhysiEventWindowNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return jsonToPhysiPartitionNode(pJson, pObj); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index cc9cb31d18..cb441053ce 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -2927,6 +2927,46 @@ static int32_t msgToPhysiStateWindowNode(STlvDecoder* pDecoder, void* pObj) { return code; } +enum { PHY_EVENT_CODE_WINDOW = 1, PHY_EVENT_CODE_START_COND, PHY_EVENT_CODE_END_COND }; + +static int32_t physiEventWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { + const SEventWinodwPhysiNode* pNode = (const SEventWinodwPhysiNode*)pObj; + + int32_t code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_WINDOW, physiWindowNodeToMsg, &pNode->window); + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_START_COND, nodeToMsg, pNode->pStartCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeObj(pEncoder, PHY_EVENT_CODE_END_COND, nodeToMsg, pNode->pEndCond); + } + + return code; +} + +static int32_t msgToPhysiEventWindowNode(STlvDecoder* pDecoder, void* pObj) { + SEventWinodwPhysiNode* pNode = (SEventWinodwPhysiNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + STlv* pTlv = NULL; + tlvForEach(pDecoder, pTlv, code) { + switch (pTlv->type) { + case PHY_EVENT_CODE_WINDOW: + code = tlvDecodeObjFromTlv(pTlv, msgToPhysiWindowNode, &pNode->window); + break; + case PHY_EVENT_CODE_START_COND: + code = msgToNodeFromTlv(pTlv, (void**)&pNode->pStartCond); + break; + case PHY_EVENT_CODE_END_COND: + code = msgToNodeFromTlv(pTlv, (void**)&pNode->pEndCond); + break; + default: + break; + } + } + + return code; +} + enum { PHY_PARTITION_CODE_BASE_NODE = 1, PHY_PARTITION_CODE_EXPR, PHY_PARTITION_CODE_KEYS, PHY_PARTITION_CODE_TARGETS }; static int32_t physiPartitionNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { @@ -3698,6 +3738,10 @@ static int32_t specificNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: code = physiStateWindowNodeToMsg(pObj, pEncoder); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + code = physiEventWindowNodeToMsg(pObj, pEncoder); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = physiPartitionNodeToMsg(pObj, pEncoder); break; @@ -3837,6 +3881,10 @@ static int32_t msgToSpecificNode(STlvDecoder* pDecoder, void* pObj) { case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: code = msgToPhysiStateWindowNode(pDecoder, pObj); break; + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + code = msgToPhysiEventWindowNode(pDecoder, pObj); + break; case QUERY_NODE_PHYSICAL_PLAN_PARTITION: code = msgToPhysiPartitionNode(pDecoder, pObj); break; diff --git a/source/libs/nodes/src/nodesTraverseFuncs.c b/source/libs/nodes/src/nodesTraverseFuncs.c index 106812d55f..ce575ede8a 100644 --- a/source/libs/nodes/src/nodesTraverseFuncs.c +++ b/source/libs/nodes/src/nodesTraverseFuncs.c @@ -165,6 +165,17 @@ static EDealRes dispatchExpr(SNode* pNode, ETraversalOrder order, FNodeWalker wa } break; } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + res = walkExpr(pEvent->pCol, order, walker, pContext); + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = walkExpr(pEvent->pStartCond, order, walker, pContext); + } + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = walkExpr(pEvent->pEndCond, order, walker, pContext); + } + break; + } default: break; } @@ -329,6 +340,17 @@ static EDealRes rewriteExpr(SNode** pRawNode, ETraversalOrder order, FNodeRewrit } break; } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + res = rewriteExpr(&pEvent->pCol, order, rewriter, pContext); + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = rewriteExpr(&pEvent->pStartCond, order, rewriter, pContext); + } + if (DEAL_RES_ERROR != res && DEAL_RES_END != res) { + res = rewriteExpr(&pEvent->pEndCond, order, rewriter, pContext); + } + break; + } default: break; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 0254ceddd0..e3210966a0 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -299,6 +299,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SWhenThenNode)); case QUERY_NODE_CASE_WHEN: return makeNode(type, sizeof(SCaseWhenNode)); + case QUERY_NODE_EVENT_WINDOW: + return makeNode(type, sizeof(SEventWindowNode)); case QUERY_NODE_SET_OPERATOR: return makeNode(type, sizeof(SSetOperator)); case QUERY_NODE_SELECT_STMT: @@ -535,6 +537,10 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SStateWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE: return makeNode(type, sizeof(SStreamStateWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + return makeNode(type, sizeof(SEventWinodwPhysiNode)); + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: + return makeNode(type, sizeof(SStreamEventWinodwPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_PARTITION: return makeNode(type, sizeof(SPartitionPhysiNode)); case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: @@ -765,16 +771,23 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_COLUMN_REF: // no pointer field break; case QUERY_NODE_WHEN_THEN: { - SWhenThenNode* pStmt = (SWhenThenNode*)pNode; - nodesDestroyNode(pStmt->pWhen); - nodesDestroyNode(pStmt->pThen); + SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode; + nodesDestroyNode(pWhenThen->pWhen); + nodesDestroyNode(pWhenThen->pThen); break; } case QUERY_NODE_CASE_WHEN: { - SCaseWhenNode* pStmt = (SCaseWhenNode*)pNode; - nodesDestroyNode(pStmt->pCase); - nodesDestroyNode(pStmt->pElse); - nodesDestroyList(pStmt->pWhenThenList); + SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)pNode; + nodesDestroyNode(pCaseWhen->pCase); + nodesDestroyNode(pCaseWhen->pElse); + nodesDestroyList(pCaseWhen->pWhenThenList); + break; + } + case QUERY_NODE_EVENT_WINDOW: { + SEventWindowNode* pEvent = (SEventWindowNode*)pNode; + nodesDestroyNode(pEvent->pCol); + nodesDestroyNode(pEvent->pStartCond); + nodesDestroyNode(pEvent->pEndCond); break; } case QUERY_NODE_SET_OPERATOR: { @@ -1233,6 +1246,14 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pStateKey); break; } + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: + case QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT: { + SEventWinodwPhysiNode* pPhyNode = (SEventWinodwPhysiNode*)pNode; + destroyWinodwPhysiNode((SWinodwPhysiNode*)pPhyNode); + nodesDestroyNode(pPhyNode->pStartCond); + nodesDestroyNode(pPhyNode->pEndCond); + break; + } case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); break; diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index ef67c7536f..c74ec9c147 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -116,6 +116,7 @@ SNode* createLimitNode(SAstCreateContext* pCxt, const SToken* pLimit, const STok SNode* createOrderByExprNode(SAstCreateContext* pCxt, SNode* pExpr, EOrder order, ENullOrder nullOrder); SNode* createSessionWindowNode(SAstCreateContext* pCxt, SNode* pCol, SNode* pGap); SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr); +SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond); SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill); SNode* createFillNode(SAstCreateContext* pCxt, EFillMode mode, SNode* pValues); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index b060f7fc83..e01d0243a9 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -194,7 +194,7 @@ db_options(A) ::= db_options(B) PAGESIZE NK_INTEGER(C). db_options(A) ::= db_options(B) TSDB_PAGESIZE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_TSDB_PAGESIZE, &C); } db_options(A) ::= db_options(B) PRECISION NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_PRECISION, &C); } db_options(A) ::= db_options(B) REPLICA NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_REPLICA, &C); } -db_options(A) ::= db_options(B) STRICT NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); } +//db_options(A) ::= db_options(B) STRICT NK_STRING(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_STRICT, &C); } db_options(A) ::= db_options(B) VGROUPS NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_VGROUPS, &C); } db_options(A) ::= db_options(B) SINGLE_STABLE NK_INTEGER(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_SINGLE_STABLE, &C); } db_options(A) ::= db_options(B) RETENTIONS retention_list(C). { A = setDatabaseOption(pCxt, B, DB_OPTION_RETENTIONS, C); } @@ -232,7 +232,7 @@ alter_db_option(A) ::= KEEP integer_list(B). alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; } alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; } alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } -alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } +//alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; } @@ -964,6 +964,8 @@ twindow_clause_opt(A) ::= twindow_clause_opt(A) ::= INTERVAL NK_LP duration_literal(B) NK_COMMA duration_literal(C) NK_RP sliding_opt(D) fill_opt(E). { A = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, B), releaseRawExprNode(pCxt, C), D, E); } +twindow_clause_opt(A) ::= + EVENT_WINDOW START WITH search_condition(B) END WITH search_condition(C). { A = createEventWindowNode(pCxt, B, C); } sliding_opt(A) ::= . { A = NULL; } sliding_opt(A) ::= SLIDING NK_LP duration_literal(B) NK_RP. { A = releaseRawExprNode(pCxt, B); } @@ -1067,5 +1069,5 @@ null_ordering_opt(A) ::= NULLS FIRST. null_ordering_opt(A) ::= NULLS LAST. { A = NULL_ORDER_LAST; } %fallback ABORT AFTER ATTACH BEFORE BEGIN BITAND BITNOT BITOR BLOCKS CHANGE COMMA COMPACT CONCAT CONFLICT COPY DEFERRED DELIMITERS DETACH DIVIDE DOT EACH END FAIL - FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT STRING - TIMES UPDATE VALUES VARIABLE VIEW WAL. + FILE FOR GLOB ID IMMEDIATE IMPORT INITIALLY INSTEAD ISNULL KEY MODULES NK_BITNOT NK_SEMI NOTNULL OF PLUS PRIVILEGE RAISE REPLACE RESTRICT ROW SEMI STAR STATEMENT + STRICT STRING TIMES UPDATE VALUES VARIABLE VIEW WAL. diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index b23adaabb5..446f758ed7 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -605,6 +605,20 @@ SNode* createStateWindowNode(SAstCreateContext* pCxt, SNode* pExpr) { return (SNode*)state; } +SNode* createEventWindowNode(SAstCreateContext* pCxt, SNode* pStartCond, SNode* pEndCond) { + CHECK_PARSER_STATUS(pCxt); + SEventWindowNode* pEvent = (SEventWindowNode*)nodesMakeNode(QUERY_NODE_EVENT_WINDOW); + CHECK_OUT_OF_MEM(pEvent); + pEvent->pCol = createPrimaryKeyCol(pCxt, NULL); + if (NULL == pEvent->pCol) { + nodesDestroyNode((SNode*)pEvent); + CHECK_OUT_OF_MEM(NULL); + } + pEvent->pStartCond = pStartCond; + pEvent->pEndCond = pEndCond; + return (SNode*)pEvent; +} + SNode* createIntervalWindowNode(SAstCreateContext* pCxt, SNode* pInterval, SNode* pOffset, SNode* pSliding, SNode* pFill) { CHECK_PARSER_STATUS(pCxt); diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index e141dbd7ae..5e881f047f 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -1355,6 +1355,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, (*pNumOfRows) = 0; char* pLine = NULL; int64_t readLen = 0; + bool firstLine = (pStmt->fileProcessing == false); pStmt->fileProcessing = false; while (TSDB_CODE_SUCCESS == code && (readLen = taosGetLineFile(pStmt->fp, &pLine)) != -1) { if (('\r' == pLine[readLen - 1]) || ('\n' == pLine[readLen - 1])) { @@ -1362,6 +1363,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, } if (readLen == 0) { + firstLine = false; continue; } @@ -1370,7 +1372,13 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken token; strtolower(pLine, pLine); const char* pRow = pLine; - code = parseOneRow(pCxt, (const char**)&pRow, pTableCxt, &gotRow, &token); + + code = parseOneRow(pCxt, (const char**)&pRow, pDataBuf, &gotRow, &token); + if (code && firstLine) { + firstLine = false; + code = 0; + continue; + } } if (TSDB_CODE_SUCCESS == code && gotRow) { @@ -1381,6 +1389,8 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, pStmt->fileProcessing = true; break; } + + firstLine = false; } taosMemoryFree(pLine); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index e62b2f0f5a..1f9e4e9ab1 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -90,6 +90,7 @@ static SKeyword keywordTable[] = { {"EXISTS", TK_EXISTS}, {"EXPIRED", TK_EXPIRED}, {"EXPLAIN", TK_EXPLAIN}, + {"EVENT_WINDOW", TK_EVENT_WINDOW}, {"EVERY", TK_EVERY}, {"FILE", TK_FILE}, {"FILL", TK_FILL}, @@ -195,15 +196,16 @@ static SKeyword keywordTable[] = { {"SNODES", TK_SNODES}, {"SOFFSET", TK_SOFFSET}, {"SPLIT", TK_SPLIT}, - {"STT_TRIGGER", TK_STT_TRIGGER}, {"STABLE", TK_STABLE}, {"STABLES", TK_STABLES}, + {"START", TK_START}, {"STATE", TK_STATE}, {"STATE_WINDOW", TK_STATE_WINDOW}, {"STORAGE", TK_STORAGE}, {"STREAM", TK_STREAM}, {"STREAMS", TK_STREAMS}, {"STRICT", TK_STRICT}, + {"STT_TRIGGER", TK_STT_TRIGGER}, {"SUBSCRIBE", TK_SUBSCRIBE}, {"SUBSCRIPTIONS", TK_SUBSCRIPTIONS}, {"SUBTABLE", TK_SUBTABLE}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 10e45901e5..3f66a4f8de 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2837,7 +2837,7 @@ static int32_t rewriteProjectAlias(SNodeList* pProjectionList) { return TSDB_CODE_SUCCESS; } -static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjectionList) { +static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjectionList, SHashObj** pOutput) { SHashObj* pUserAliasSet = taosHashInit(LIST_LENGTH(pProjectionList), taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); SNode* pProject = NULL; @@ -2849,13 +2849,17 @@ static int32_t checkProjectAlias(STranslateContext* pCxt, SNodeList* pProjection } taosHashPut(pUserAliasSet, pExpr->userAlias, strlen(pExpr->userAlias), &pExpr, POINTER_BYTES); } - taosHashCleanup(pUserAliasSet); + if (NULL == pOutput) { + taosHashCleanup(pUserAliasSet); + } else { + *pOutput = pUserAliasSet; + } return TSDB_CODE_SUCCESS; } static int32_t translateProjectionList(STranslateContext* pCxt, SSelectStmt* pSelect) { if (pSelect->isSubquery) { - return checkProjectAlias(pCxt, pSelect->pProjectionList); + return checkProjectAlias(pCxt, pSelect->pProjectionList, NULL); } return rewriteProjectAlias(pSelect->pProjectionList); } @@ -3143,6 +3147,15 @@ static int32_t translateSessionWindow(STranslateContext* pCxt, SSelectStmt* pSel return TSDB_CODE_SUCCESS; } +static int32_t translateEventWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { + if (QUERY_NODE_TEMP_TABLE == nodeType(pSelect->pFromTable) && + !isGlobalTimeLineQuery(((STempTableNode*)pSelect->pFromTable)->pSubquery)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TIMELINE_QUERY, + "EVENT_WINDOW requires valid time series input"); + } + return TSDB_CODE_SUCCESS; +} + static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSelect) { switch (nodeType(pSelect->pWindow)) { case QUERY_NODE_STATE_WINDOW: @@ -3151,6 +3164,8 @@ static int32_t translateSpecificWindow(STranslateContext* pCxt, SSelectStmt* pSe return translateSessionWindow(pCxt, pSelect); case QUERY_NODE_INTERVAL_WINDOW: return translateIntervalWindow(pCxt, pSelect); + case QUERY_NODE_EVENT_WINDOW: + return translateEventWindow(pCxt, pSelect); default: break; } @@ -3888,8 +3903,7 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt pOptions->keep[0] > tsdbMaxKeep || pOptions->keep[1] > tsdbMaxKeep || pOptions->keep[2] > tsdbMaxKeep) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option keep: %" PRId64 ", %" PRId64 ", %" PRId64 " valid range: [%dm, %dm]", - pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, - tsdbMaxKeep); + pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, tsdbMaxKeep); } if (!((pOptions->keep[0] <= pOptions->keep[1]) && (pOptions->keep[1] <= pOptions->keep[2]))) { @@ -4044,7 +4058,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName code = checkDbPrecisionOption(pCxt, pOptions); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbKeepOption(pCxt, pOptions); // use precision + code = checkDbKeepOption(pCxt, pOptions); // use precision } if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "pages", pOptions->pages, TSDB_MIN_PAGES_PER_VNODE, TSDB_MAX_PAGES_PER_VNODE); @@ -5504,9 +5518,24 @@ static void getSourceDatabase(SNode* pStmt, int32_t acctId, char* pDbFName) { tNameGetFullDbName(&name, pDbFName); } -static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { - SSelectStmt* pSelect = (SSelectStmt*)pStmt; - SNode* pProj = nodesListGetNode(pSelect->pProjectionList, 0); +static void getStreamQueryFirstProjectAliasName(SHashObj* pUserAliasSet, char* aliasName, int32_t len) { + if (NULL == taosHashGet(pUserAliasSet, "_wstart", strlen("_wstart"))) { + snprintf(aliasName, len, "%s", "_wstart"); + return; + } + if (NULL == taosHashGet(pUserAliasSet, "ts", strlen("ts"))) { + snprintf(aliasName, len, "%s", "ts"); + return; + } + do { + taosRandStr(aliasName, len - 1); + aliasName[len - 1] = '\0'; + } while (NULL != taosHashGet(pUserAliasSet, aliasName, strlen(aliasName))); + return; +} + +static int32_t addWstartTsToCreateStreamQueryImpl(SSelectStmt* pSelect, SHashObj* pUserAliasSet) { + SNode* pProj = nodesListGetNode(pSelect->pProjectionList, 0); if (NULL == pSelect->pWindow || (QUERY_NODE_FUNCTION == nodeType(pProj) && 0 == strcmp("_wstart", ((SFunctionNode*)pProj)->functionName))) { return TSDB_CODE_SUCCESS; @@ -5516,7 +5545,7 @@ static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { return TSDB_CODE_OUT_OF_MEMORY; } strcpy(pFunc->functionName, "_wstart"); - strcpy(pFunc->node.aliasName, pFunc->functionName); + getStreamQueryFirstProjectAliasName(pUserAliasSet, pFunc->node.aliasName, sizeof(pFunc->node.aliasName)); int32_t code = nodesListPushFront(pSelect->pProjectionList, (SNode*)pFunc); if (TSDB_CODE_SUCCESS != code) { nodesDestroyNode((SNode*)pFunc); @@ -5524,6 +5553,17 @@ static int32_t addWstartTsToCreateStreamQuery(SNode* pStmt) { return code; } +static int32_t addWstartTsToCreateStreamQuery(STranslateContext* pCxt, SNode* pStmt) { + SSelectStmt* pSelect = (SSelectStmt*)pStmt; + SHashObj* pUserAliasSet = NULL; + int32_t code = checkProjectAlias(pCxt, pSelect->pProjectionList, &pUserAliasSet); + if (TSDB_CODE_SUCCESS == code) { + code = addWstartTsToCreateStreamQueryImpl(pSelect, pUserAliasSet); + } + taosHashCleanup(pUserAliasSet); + return code; +} + static int32_t addTagsToCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SSelectStmt* pSelect) { if (NULL == pStmt->pTags) { return TSDB_CODE_SUCCESS; @@ -5626,7 +5666,7 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SSelectStmt* pSelect) { static int32_t buildCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SCMCreateStreamReq* pReq) { pCxt->createStream = true; - int32_t code = addWstartTsToCreateStreamQuery(pStmt->pQuery); + int32_t code = addWstartTsToCreateStreamQuery(pCxt, pStmt->pQuery); if (TSDB_CODE_SUCCESS == code) { code = addSubtableInfoToCreateStreamQuery(pCxt, pStmt); } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index b4d4a3457e..b383d02006 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 457 +#define YYNOCODE 459 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; EOperatorType yy20; - int8_t yy33; - SAlterOption yy123; - SNode* yy148; - SToken yy199; - EFillMode yy334; - bool yy397; - SNodeList* yy404; - EJoinType yy470; - ENullOrder yy499; - int64_t yy525; - SDataType yy530; - int32_t yy706; - EOrder yy898; + SNode* yy74; + ENullOrder yy109; + SToken yy317; + EOrder yy326; + bool yy335; + int8_t yy449; + int64_t yy531; + EJoinType yy630; + SAlterOption yy767; + EFillMode yy828; + int32_t yy856; + SNodeList* yy874; + SDataType yy898; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 710 -#define YYNRULE 540 -#define YYNTOKEN 322 -#define YY_MAX_SHIFT 709 -#define YY_MIN_SHIFTREDUCE 1052 -#define YY_MAX_SHIFTREDUCE 1591 -#define YY_ERROR_ACTION 1592 -#define YY_ACCEPT_ACTION 1593 -#define YY_NO_ACTION 1594 -#define YY_MIN_REDUCE 1595 -#define YY_MAX_REDUCE 2134 +#define YYNSTATE 714 +#define YYNRULE 539 +#define YYNTOKEN 324 +#define YY_MAX_SHIFT 713 +#define YY_MIN_SHIFTREDUCE 1055 +#define YY_MAX_SHIFTREDUCE 1593 +#define YY_ERROR_ACTION 1594 +#define YY_ACCEPT_ACTION 1595 +#define YY_NO_ACTION 1596 +#define YY_MIN_REDUCE 1597 +#define YY_MAX_REDUCE 2135 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,694 +216,790 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2410) +#define YY_ACTTAB_COUNT (2968) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1950, 458, 157, 459, 1631, 566, 167, 1703, 467, 2105, - /* 10 */ 459, 1631, 43, 41, 1522, 365, 1651, 2110, 1796, 1798, - /* 20 */ 360, 2105, 1373, 1595, 565, 173, 598, 332, 1850, 2106, - /* 30 */ 567, 1968, 1741, 1452, 405, 1371, 1664, 2109, 514, 581, - /* 40 */ 52, 2106, 2108, 1933, 1919, 399, 614, 122, 121, 120, - /* 50 */ 119, 118, 117, 116, 115, 114, 464, 1750, 1447, 597, - /* 60 */ 36, 35, 460, 16, 42, 40, 39, 38, 37, 1949, - /* 70 */ 1379, 1929, 1935, 1984, 318, 597, 100, 1951, 618, 1953, - /* 80 */ 1954, 613, 608, 608, 258, 597, 1526, 546, 170, 1938, - /* 90 */ 2037, 2105, 1398, 476, 354, 2033, 12, 2052, 1462, 1950, - /* 100 */ 1933, 513, 512, 511, 1398, 1968, 2111, 173, 175, 128, - /* 110 */ 507, 2106, 567, 560, 506, 505, 2063, 158, 706, 1607, - /* 120 */ 504, 510, 58, 2049, 85, 561, 503, 598, 1929, 1935, - /* 130 */ 1968, 1398, 1085, 1454, 1455, 1104, 1593, 1103, 615, 608, - /* 140 */ 2110, 123, 1846, 1919, 2105, 614, 43, 41, 497, 1558, - /* 150 */ 210, 46, 559, 181, 360, 1727, 1373, 1399, 1750, 1950, - /* 160 */ 2109, 46, 1428, 1437, 2106, 2107, 1105, 1452, 1949, 1371, - /* 170 */ 598, 1087, 1984, 1090, 1091, 100, 1951, 618, 1953, 1954, - /* 180 */ 613, 1374, 608, 1372, 123, 134, 62, 141, 2008, 2037, - /* 190 */ 1968, 502, 1447, 354, 2033, 33, 274, 16, 581, 375, - /* 200 */ 1398, 1750, 652, 1919, 1379, 614, 1377, 1378, 1398, 1427, - /* 210 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, - /* 220 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1949, 97, - /* 230 */ 12, 2110, 1984, 1950, 1429, 100, 1951, 618, 1953, 1954, - /* 240 */ 613, 546, 608, 132, 1397, 2105, 1429, 170, 1400, 2037, - /* 250 */ 556, 1742, 706, 354, 2033, 42, 40, 39, 38, 37, - /* 260 */ 2111, 173, 9, 650, 1968, 2106, 567, 1454, 1455, 1797, - /* 270 */ 1798, 176, 615, 1309, 1310, 2064, 58, 1919, 58, 614, - /* 280 */ 43, 41, 146, 145, 647, 646, 645, 143, 360, 1400, - /* 290 */ 1373, 58, 1399, 1950, 509, 508, 1428, 1437, 1618, 578, - /* 300 */ 176, 1452, 1949, 1371, 457, 598, 1984, 462, 1637, 100, - /* 310 */ 1951, 618, 1953, 1954, 613, 1374, 608, 1372, 225, 178, - /* 320 */ 643, 2012, 169, 2037, 1968, 1581, 1447, 354, 2033, 1483, - /* 330 */ 131, 16, 615, 562, 557, 1790, 1750, 1919, 1379, 614, - /* 340 */ 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, 1434, 1435, - /* 350 */ 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, - /* 360 */ 1456, 2, 1949, 9, 12, 1950, 1984, 677, 675, 100, - /* 370 */ 1951, 618, 1953, 1954, 613, 398, 608, 397, 82, 320, - /* 380 */ 58, 2125, 531, 2037, 529, 80, 706, 354, 2033, 255, - /* 390 */ 2045, 577, 257, 124, 576, 441, 1968, 2105, 2071, 127, - /* 400 */ 30, 1454, 1455, 541, 612, 1256, 1257, 406, 1745, 1919, - /* 410 */ 1488, 614, 565, 173, 43, 41, 1457, 2106, 567, 585, - /* 420 */ 407, 1379, 360, 1725, 1373, 176, 47, 176, 1846, 351, - /* 430 */ 1428, 1437, 1861, 257, 1949, 1452, 185, 1371, 1984, 183, - /* 440 */ 176, 310, 1951, 618, 1953, 1954, 613, 650, 608, 1374, - /* 450 */ 2003, 1372, 466, 189, 188, 462, 1637, 36, 35, 664, - /* 460 */ 1447, 42, 40, 39, 38, 37, 146, 145, 647, 646, - /* 470 */ 645, 143, 1379, 77, 1377, 1378, 76, 1427, 1430, 1431, - /* 480 */ 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, - /* 490 */ 1449, 1450, 1451, 1453, 1456, 2, 598, 1617, 44, 598, - /* 500 */ 1739, 1950, 1803, 513, 512, 511, 1398, 598, 1803, 353, - /* 510 */ 403, 128, 507, 404, 1735, 364, 506, 505, 1801, 1616, - /* 520 */ 706, 413, 504, 510, 1801, 352, 363, 1750, 503, 176, - /* 530 */ 1750, 650, 1968, 155, 155, 1454, 1455, 1104, 1750, 1103, - /* 540 */ 615, 1919, 1752, 1752, 527, 1919, 1538, 614, 43, 41, - /* 550 */ 146, 145, 647, 646, 645, 143, 360, 525, 1373, 523, - /* 560 */ 1737, 1950, 598, 1919, 1428, 1437, 394, 1173, 1105, 1452, - /* 570 */ 1949, 1371, 598, 578, 1984, 176, 427, 100, 1951, 618, - /* 580 */ 1953, 1954, 613, 1374, 608, 1372, 428, 396, 392, 2010, - /* 590 */ 1733, 2037, 1968, 1750, 1447, 354, 2033, 226, 230, 9, - /* 600 */ 615, 7, 1175, 1750, 131, 1919, 1379, 614, 1377, 1378, - /* 610 */ 80, 1427, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, - /* 620 */ 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, - /* 630 */ 1949, 167, 44, 1746, 1984, 366, 605, 100, 1951, 618, - /* 640 */ 1953, 1954, 613, 155, 608, 265, 266, 1615, 1429, 2125, - /* 650 */ 264, 2037, 1752, 1851, 706, 354, 2033, 1614, 1950, 1728, - /* 660 */ 1350, 1351, 580, 171, 2045, 2046, 2099, 129, 2050, 1454, - /* 670 */ 1455, 36, 35, 6, 29, 42, 40, 39, 38, 37, - /* 680 */ 36, 35, 43, 41, 42, 40, 39, 38, 37, 1968, - /* 690 */ 360, 1919, 1373, 91, 598, 598, 2077, 615, 1428, 1437, - /* 700 */ 1613, 1919, 1919, 1452, 614, 1371, 1803, 25, 474, 475, - /* 710 */ 39, 38, 37, 329, 600, 1743, 2009, 1374, 602, 1372, - /* 720 */ 2009, 476, 1801, 609, 155, 1750, 1750, 1949, 1447, 227, - /* 730 */ 1612, 1984, 1780, 1753, 159, 1951, 618, 1953, 1954, 613, - /* 740 */ 1379, 608, 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, - /* 750 */ 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, - /* 760 */ 1451, 1453, 1456, 2, 36, 35, 12, 1950, 42, 40, - /* 770 */ 39, 38, 37, 1846, 1919, 547, 2074, 566, 1548, 1473, - /* 780 */ 317, 2105, 1396, 2052, 187, 598, 642, 1611, 706, 435, - /* 790 */ 1610, 1609, 448, 1596, 1606, 447, 565, 173, 1968, 1747, - /* 800 */ 1726, 2106, 567, 1454, 1455, 1605, 615, 1608, 1604, 2048, - /* 810 */ 419, 1919, 449, 614, 113, 421, 1750, 112, 111, 110, - /* 820 */ 109, 108, 107, 106, 105, 104, 553, 1546, 1547, 1549, - /* 830 */ 1550, 1919, 1428, 1437, 1919, 1919, 532, 665, 1919, 1720, - /* 840 */ 1984, 598, 598, 306, 1951, 618, 1953, 1954, 613, 1919, - /* 850 */ 608, 1374, 1919, 1372, 1603, 139, 367, 333, 1661, 36, - /* 860 */ 35, 1519, 652, 42, 40, 39, 38, 37, 2109, 409, - /* 870 */ 1401, 1401, 1750, 1750, 2052, 1602, 1377, 1378, 1515, 1427, - /* 880 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, - /* 890 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1919, 445, - /* 900 */ 2047, 1704, 440, 439, 438, 437, 434, 433, 432, 431, - /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1919, - /* 920 */ 411, 410, 331, 683, 682, 681, 680, 370, 144, 679, - /* 930 */ 678, 135, 673, 672, 671, 670, 669, 668, 667, 666, - /* 940 */ 148, 662, 661, 660, 369, 368, 657, 656, 655, 654, - /* 950 */ 653, 156, 1601, 1600, 598, 1599, 294, 36, 35, 357, - /* 960 */ 356, 42, 40, 39, 38, 37, 1598, 1950, 542, 1387, - /* 970 */ 292, 66, 598, 133, 65, 644, 2008, 252, 1794, 1401, - /* 980 */ 1452, 51, 1380, 36, 35, 1750, 582, 42, 40, 39, - /* 990 */ 38, 37, 193, 454, 452, 585, 1919, 1919, 1968, 1919, - /* 1000 */ 11, 10, 337, 1750, 648, 1447, 615, 1794, 1862, 554, - /* 1010 */ 1919, 1919, 325, 614, 182, 235, 573, 1379, 1213, 640, - /* 1020 */ 639, 638, 1217, 637, 1219, 1220, 636, 1222, 633, 58, - /* 1030 */ 1228, 630, 1230, 1231, 627, 624, 1949, 209, 288, 598, - /* 1040 */ 1984, 1780, 1803, 100, 1951, 618, 1953, 1954, 613, 649, - /* 1050 */ 608, 584, 1794, 269, 1481, 2125, 216, 2037, 1802, 214, - /* 1060 */ 211, 354, 2033, 709, 338, 604, 336, 335, 99, 499, - /* 1070 */ 1750, 246, 2056, 501, 598, 162, 1906, 281, 1373, 1090, - /* 1080 */ 1091, 493, 489, 485, 481, 208, 2057, 1515, 593, 1833, - /* 1090 */ 598, 1371, 166, 546, 501, 500, 1495, 2105, 699, 695, - /* 1100 */ 691, 687, 279, 1518, 595, 1750, 74, 73, 402, 578, - /* 1110 */ 1482, 180, 2111, 173, 67, 570, 500, 2106, 567, 598, - /* 1120 */ 1382, 1750, 81, 234, 382, 206, 1379, 569, 1388, 316, - /* 1130 */ 1383, 1969, 390, 596, 388, 384, 380, 377, 374, 98, - /* 1140 */ 131, 48, 272, 3, 137, 1381, 125, 371, 1588, 60, - /* 1150 */ 1750, 1855, 113, 1391, 1393, 112, 111, 110, 109, 108, - /* 1160 */ 107, 106, 105, 104, 75, 606, 1445, 1446, 1448, 1449, - /* 1170 */ 1450, 1451, 239, 218, 706, 594, 217, 1950, 176, 45, - /* 1180 */ 598, 32, 358, 1476, 1477, 1478, 1479, 1480, 1484, 1485, - /* 1190 */ 1486, 1487, 205, 199, 275, 204, 1644, 1642, 472, 172, - /* 1200 */ 2045, 2046, 1545, 129, 2050, 1950, 220, 222, 1968, 219, - /* 1210 */ 221, 1750, 260, 262, 197, 50, 615, 140, 516, 519, - /* 1220 */ 545, 1919, 142, 614, 233, 241, 1590, 1591, 1940, 1344, - /* 1230 */ 96, 229, 1320, 11, 10, 1632, 1968, 1374, 574, 1372, - /* 1240 */ 93, 422, 1587, 144, 615, 1133, 1949, 658, 1950, 1919, - /* 1250 */ 1984, 614, 2067, 100, 1951, 618, 1953, 1954, 613, 60, - /* 1260 */ 608, 45, 1377, 1378, 83, 601, 267, 2037, 1385, 1153, - /* 1270 */ 590, 354, 2033, 1791, 1949, 271, 1950, 1942, 1984, 1968, - /* 1280 */ 1134, 101, 1951, 618, 1953, 1954, 613, 615, 608, 579, - /* 1290 */ 254, 31, 1919, 1384, 614, 2037, 1206, 36, 35, 2036, - /* 1300 */ 2033, 42, 40, 39, 38, 37, 251, 1968, 45, 622, - /* 1310 */ 1, 142, 1489, 4, 1438, 615, 144, 1949, 659, 1950, - /* 1320 */ 1919, 1984, 614, 1638, 101, 1951, 618, 1953, 1954, 613, - /* 1330 */ 376, 608, 126, 381, 330, 571, 142, 1950, 2037, 1337, - /* 1340 */ 1151, 282, 603, 2033, 186, 616, 408, 1401, 1856, 1984, - /* 1350 */ 1968, 443, 101, 1951, 618, 1953, 1954, 613, 612, 608, - /* 1360 */ 412, 287, 1234, 1919, 1238, 614, 2037, 417, 1968, 1245, - /* 1370 */ 324, 2033, 701, 1396, 429, 1848, 615, 436, 442, 444, - /* 1380 */ 1950, 1919, 190, 614, 450, 1243, 451, 453, 1949, 147, - /* 1390 */ 455, 1402, 1984, 518, 456, 310, 1951, 618, 1953, 1954, - /* 1400 */ 613, 611, 608, 599, 2002, 465, 1949, 1404, 528, 468, - /* 1410 */ 1984, 1968, 1403, 160, 1951, 618, 1953, 1954, 613, 615, - /* 1420 */ 608, 196, 224, 469, 1919, 198, 614, 1405, 1937, 470, - /* 1430 */ 201, 473, 471, 1950, 1107, 203, 477, 521, 1896, 1933, - /* 1440 */ 78, 1937, 515, 79, 496, 533, 498, 223, 494, 1949, - /* 1450 */ 207, 495, 1933, 1984, 1950, 102, 101, 1951, 618, 1953, - /* 1460 */ 1954, 613, 228, 608, 1968, 568, 2126, 1929, 1935, 343, - /* 1470 */ 2037, 319, 615, 535, 1740, 2034, 213, 1919, 608, 614, - /* 1480 */ 1929, 1935, 355, 373, 64, 1968, 1736, 63, 215, 149, - /* 1490 */ 1895, 608, 150, 615, 372, 1738, 1734, 151, 1919, 152, - /* 1500 */ 614, 536, 1949, 543, 283, 231, 1984, 550, 1950, 159, - /* 1510 */ 1951, 618, 1953, 1954, 613, 555, 608, 537, 540, 237, - /* 1520 */ 588, 2068, 578, 1949, 2078, 546, 552, 1984, 344, 2105, - /* 1530 */ 304, 1951, 618, 1953, 1954, 613, 546, 608, 240, 1968, - /* 1540 */ 2105, 558, 5, 551, 2111, 173, 564, 615, 548, 2106, - /* 1550 */ 567, 2075, 1919, 131, 614, 2111, 173, 549, 248, 2059, - /* 1560 */ 2106, 567, 1950, 36, 35, 245, 345, 42, 40, 39, - /* 1570 */ 38, 37, 250, 1515, 563, 575, 572, 1949, 130, 1950, - /* 1580 */ 2128, 1984, 249, 2083, 160, 1951, 618, 1953, 1954, 613, - /* 1590 */ 2082, 608, 163, 1968, 247, 1400, 583, 259, 349, 2104, - /* 1600 */ 253, 615, 2053, 348, 284, 1950, 1919, 586, 614, 587, - /* 1610 */ 1968, 1867, 174, 2045, 2046, 359, 129, 2050, 615, 591, - /* 1620 */ 1866, 1865, 350, 1919, 88, 614, 285, 592, 286, 57, - /* 1630 */ 90, 1949, 92, 1950, 1751, 1984, 1968, 2127, 311, 1951, - /* 1640 */ 618, 1953, 1954, 613, 615, 608, 2018, 1795, 1949, 1919, - /* 1650 */ 1721, 614, 1984, 289, 620, 311, 1951, 618, 1953, 1954, - /* 1660 */ 613, 278, 608, 702, 1968, 703, 705, 49, 298, 361, - /* 1670 */ 291, 312, 615, 313, 1949, 302, 1950, 1919, 1984, 614, - /* 1680 */ 293, 295, 1951, 618, 1953, 1954, 613, 1913, 608, 321, - /* 1690 */ 322, 1912, 1950, 71, 1911, 1910, 72, 1907, 378, 379, - /* 1700 */ 1365, 1366, 1949, 179, 383, 1905, 1984, 1968, 385, 311, - /* 1710 */ 1951, 618, 1953, 1954, 613, 615, 608, 386, 387, 154, - /* 1720 */ 1919, 1904, 614, 1968, 389, 1903, 1902, 391, 393, 1901, - /* 1730 */ 1340, 615, 1339, 395, 1878, 534, 1919, 1877, 614, 400, - /* 1740 */ 401, 1876, 1875, 1950, 1841, 1949, 1300, 1840, 1838, 1984, - /* 1750 */ 136, 1837, 296, 1951, 618, 1953, 1954, 613, 1836, 608, - /* 1760 */ 1839, 1949, 1835, 1834, 1832, 1984, 1831, 1830, 297, 1951, - /* 1770 */ 618, 1953, 1954, 613, 1968, 608, 184, 546, 418, 1829, - /* 1780 */ 420, 2105, 615, 1828, 1827, 1826, 1950, 1919, 1825, 614, - /* 1790 */ 1824, 1823, 1822, 1821, 1820, 1819, 2111, 173, 1818, 1817, - /* 1800 */ 1816, 2106, 567, 1950, 1815, 1814, 1813, 138, 1812, 1811, - /* 1810 */ 1810, 1809, 1949, 1808, 1807, 1806, 1984, 1968, 1302, 303, - /* 1820 */ 1951, 618, 1953, 1954, 613, 615, 608, 1805, 1804, 446, - /* 1830 */ 1919, 1666, 614, 191, 1968, 1665, 1181, 1663, 192, 1627, - /* 1840 */ 1093, 168, 615, 1092, 194, 1626, 69, 1919, 1891, 614, - /* 1850 */ 1939, 1885, 195, 1874, 1873, 1949, 1950, 70, 200, 1984, - /* 1860 */ 202, 1858, 307, 1951, 618, 1953, 1954, 613, 461, 608, - /* 1870 */ 463, 1729, 1949, 1950, 1662, 1660, 1984, 478, 479, 299, - /* 1880 */ 1951, 618, 1953, 1954, 613, 480, 608, 1968, 1126, 1658, - /* 1890 */ 482, 483, 1656, 486, 1654, 615, 484, 487, 488, 490, - /* 1900 */ 1919, 492, 614, 1641, 1968, 1640, 1623, 1731, 491, 1249, - /* 1910 */ 1730, 1250, 615, 1172, 1171, 1170, 1169, 1919, 1168, 614, - /* 1920 */ 212, 59, 1163, 1165, 1950, 1949, 674, 1652, 676, 1984, - /* 1930 */ 1164, 1162, 308, 1951, 618, 1953, 1954, 613, 339, 608, - /* 1940 */ 1645, 1950, 1949, 340, 1643, 341, 1984, 517, 520, 300, - /* 1950 */ 1951, 618, 1953, 1954, 613, 1968, 608, 1622, 1621, 522, - /* 1960 */ 524, 1620, 1357, 615, 526, 103, 1355, 1950, 1919, 1354, - /* 1970 */ 614, 530, 1968, 24, 1890, 1884, 1346, 538, 1872, 1870, - /* 1980 */ 615, 17, 14, 2110, 1950, 1919, 53, 614, 1560, 18, - /* 1990 */ 56, 243, 28, 1949, 26, 236, 539, 1984, 1968, 232, - /* 2000 */ 309, 1951, 618, 1953, 1954, 613, 615, 608, 342, 153, - /* 2010 */ 1949, 1919, 238, 614, 1984, 1968, 1544, 301, 1951, 618, - /* 2020 */ 1953, 1954, 613, 615, 608, 161, 544, 1537, 1919, 244, - /* 2030 */ 614, 242, 27, 1940, 84, 1950, 1949, 61, 19, 1575, - /* 2040 */ 1984, 1574, 346, 314, 1951, 618, 1953, 1954, 613, 1580, - /* 2050 */ 608, 1581, 1579, 1949, 1578, 347, 1512, 1984, 256, 1511, - /* 2060 */ 315, 1951, 618, 1953, 1954, 613, 1968, 608, 55, 164, - /* 2070 */ 1871, 1869, 1868, 20, 615, 589, 1857, 263, 1950, 1919, - /* 2080 */ 261, 614, 1542, 15, 54, 268, 86, 87, 89, 273, - /* 2090 */ 93, 270, 10, 21, 1950, 1464, 8, 1463, 1987, 1389, - /* 2100 */ 1442, 607, 165, 177, 1949, 1440, 34, 1474, 1984, 1968, - /* 2110 */ 1439, 1962, 1951, 618, 1953, 1954, 613, 615, 608, 13, - /* 2120 */ 1420, 22, 1919, 1412, 614, 1968, 617, 23, 619, 1235, - /* 2130 */ 621, 362, 623, 615, 1232, 625, 626, 628, 1919, 629, - /* 2140 */ 614, 1229, 1223, 631, 1221, 1950, 632, 1949, 634, 635, - /* 2150 */ 1227, 1984, 1212, 1226, 1961, 1951, 618, 1953, 1954, 613, - /* 2160 */ 641, 608, 94, 1949, 276, 95, 1225, 1984, 1244, 68, - /* 2170 */ 1960, 1951, 618, 1953, 1954, 613, 1968, 608, 1224, 1240, - /* 2180 */ 1124, 651, 1159, 1158, 615, 1157, 1156, 1155, 1950, 1919, - /* 2190 */ 1154, 614, 1179, 1152, 1150, 1149, 1148, 663, 277, 1146, - /* 2200 */ 1145, 1144, 1143, 1142, 1141, 1950, 1140, 1139, 1176, 1174, - /* 2210 */ 1136, 1135, 1132, 1131, 1949, 1130, 1659, 1129, 1984, 1968, - /* 2220 */ 684, 326, 1951, 618, 1953, 1954, 613, 615, 608, 686, - /* 2230 */ 1657, 685, 1919, 688, 614, 689, 1968, 1655, 690, 692, - /* 2240 */ 693, 694, 1653, 696, 615, 697, 698, 1639, 700, 1919, - /* 2250 */ 1082, 614, 1619, 280, 704, 708, 1375, 1949, 1950, 1594, - /* 2260 */ 290, 1984, 707, 1594, 327, 1951, 618, 1953, 1954, 613, - /* 2270 */ 1594, 608, 1594, 1594, 1949, 1950, 1594, 1594, 1984, 1594, - /* 2280 */ 1594, 323, 1951, 618, 1953, 1954, 613, 1594, 608, 1968, - /* 2290 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, - /* 2300 */ 1594, 1594, 1919, 1594, 614, 1594, 1968, 1594, 1594, 1594, - /* 2310 */ 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, 1919, - /* 2320 */ 1594, 614, 1594, 1594, 1594, 1594, 1950, 1949, 1594, 1594, - /* 2330 */ 1594, 1984, 1594, 1594, 328, 1951, 618, 1953, 1954, 613, - /* 2340 */ 1594, 608, 1594, 1594, 616, 1594, 1594, 1594, 1984, 1594, - /* 2350 */ 1594, 306, 1951, 618, 1953, 1954, 613, 1968, 608, 1594, - /* 2360 */ 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, - /* 2370 */ 1919, 1594, 614, 1594, 1594, 1594, 1594, 1594, 1594, 1594, - /* 2380 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, - /* 2390 */ 1594, 1594, 1594, 1594, 1594, 1949, 1594, 1594, 1594, 1984, - /* 2400 */ 1594, 1594, 305, 1951, 618, 1953, 1954, 613, 1594, 608, + /* 0 */ 460, 354, 461, 1633, 1739, 469, 1595, 461, 1633, 157, + /* 10 */ 542, 82, 45, 43, 1523, 1937, 169, 159, 1752, 1609, + /* 20 */ 362, 1401, 1374, 38, 37, 129, 1933, 44, 42, 41, + /* 30 */ 40, 39, 602, 1453, 1745, 1372, 1666, 334, 1850, 602, + /* 40 */ 1937, 367, 38, 37, 1796, 1798, 44, 42, 41, 40, + /* 50 */ 39, 1933, 407, 1846, 1929, 1935, 345, 583, 1448, 27, + /* 60 */ 1527, 31, 1728, 18, 183, 613, 1399, 38, 37, 377, + /* 70 */ 1380, 44, 42, 41, 40, 39, 171, 1950, 1803, 1929, + /* 80 */ 1935, 357, 64, 45, 43, 355, 1399, 1741, 133, 1790, + /* 90 */ 613, 362, 320, 1374, 1801, 14, 459, 327, 1933, 464, + /* 100 */ 1639, 514, 513, 512, 1453, 365, 1372, 48, 1968, 130, + /* 110 */ 508, 547, 466, 157, 507, 2106, 586, 710, 462, 506, + /* 120 */ 511, 1919, 1752, 619, 478, 505, 1929, 1935, 566, 1448, + /* 130 */ 2112, 175, 1455, 1456, 18, 2107, 572, 613, 1482, 468, + /* 140 */ 160, 1380, 464, 1639, 583, 1704, 1949, 174, 2045, 2046, + /* 150 */ 1984, 131, 2050, 102, 1951, 623, 1953, 1954, 618, 571, + /* 160 */ 613, 1429, 1438, 2106, 259, 172, 14, 2037, 514, 513, + /* 170 */ 512, 356, 2033, 60, 478, 133, 130, 508, 570, 175, + /* 180 */ 1375, 507, 1373, 2107, 572, 177, 506, 511, 710, 605, + /* 190 */ 1938, 2009, 505, 2063, 1483, 227, 44, 42, 41, 40, + /* 200 */ 39, 1933, 1088, 1455, 1456, 1378, 1379, 1430, 1428, 1431, + /* 210 */ 1432, 1433, 1434, 1435, 1436, 1437, 615, 611, 1446, 1447, + /* 220 */ 1449, 1450, 1451, 1452, 1454, 1457, 2, 1310, 1311, 1929, + /* 230 */ 1935, 1400, 1429, 1438, 257, 2045, 582, 368, 126, 581, + /* 240 */ 613, 1090, 2106, 1093, 1094, 157, 60, 1107, 1803, 1106, + /* 250 */ 339, 1375, 1550, 1373, 1752, 84, 322, 570, 175, 532, + /* 260 */ 443, 530, 2107, 572, 1802, 34, 360, 1477, 1478, 1479, + /* 270 */ 1480, 1481, 1485, 1486, 1487, 1488, 1378, 1379, 1108, 1428, + /* 280 */ 1431, 1432, 1433, 1434, 1435, 1436, 1437, 615, 611, 1446, + /* 290 */ 1447, 1449, 1450, 1451, 1452, 1454, 1457, 2, 2111, 11, + /* 300 */ 45, 43, 558, 1548, 1549, 1551, 1552, 11, 362, 9, + /* 310 */ 1374, 340, 602, 338, 337, 1401, 501, 583, 191, 190, + /* 320 */ 503, 1453, 178, 1372, 1214, 645, 644, 643, 1218, 642, + /* 330 */ 1220, 1221, 641, 1223, 638, 1598, 1229, 635, 1231, 1232, + /* 340 */ 632, 629, 502, 1257, 1258, 260, 1448, 235, 133, 187, + /* 350 */ 2111, 18, 228, 610, 2106, 99, 115, 11, 1380, 114, + /* 360 */ 113, 112, 111, 110, 109, 108, 107, 106, 169, 134, + /* 370 */ 2110, 45, 43, 1458, 2107, 2109, 607, 1742, 2009, 362, + /* 380 */ 401, 1374, 60, 14, 87, 79, 85, 48, 78, 60, + /* 390 */ 1851, 1583, 1453, 115, 1372, 178, 114, 113, 112, 111, + /* 400 */ 110, 109, 108, 107, 106, 710, 585, 173, 2045, 2046, + /* 410 */ 49, 131, 2050, 213, 590, 1351, 1352, 1448, 590, 2111, + /* 420 */ 1455, 1456, 547, 2106, 353, 82, 2106, 1861, 164, 1380, + /* 430 */ 1107, 1862, 1106, 561, 495, 491, 487, 483, 210, 2110, + /* 440 */ 1374, 2112, 175, 2107, 2108, 212, 2107, 572, 1746, 1429, + /* 450 */ 1438, 267, 268, 1372, 46, 1597, 266, 1399, 259, 38, + /* 460 */ 37, 1108, 1803, 44, 42, 41, 40, 39, 1375, 331, + /* 470 */ 1373, 1402, 1402, 400, 83, 399, 710, 208, 1801, 124, + /* 480 */ 123, 122, 121, 120, 119, 118, 117, 116, 1380, 2052, + /* 490 */ 1620, 1455, 1456, 1378, 1379, 1474, 1428, 1431, 1432, 1433, + /* 500 */ 1434, 1435, 1436, 1437, 615, 611, 1446, 1447, 1449, 1450, + /* 510 */ 1451, 1452, 1454, 1457, 2, 2049, 567, 562, 556, 1463, + /* 520 */ 1429, 1438, 38, 37, 1484, 1399, 44, 42, 41, 40, + /* 530 */ 39, 178, 60, 571, 1919, 710, 178, 2106, 178, 1375, + /* 540 */ 396, 1373, 1400, 1968, 207, 201, 1726, 206, 35, 276, + /* 550 */ 474, 565, 570, 175, 157, 589, 1399, 2107, 572, 178, + /* 560 */ 1950, 398, 394, 1753, 1378, 1379, 199, 1428, 1431, 1432, + /* 570 */ 1433, 1434, 1435, 1436, 1437, 615, 611, 1446, 1447, 1449, + /* 580 */ 1450, 1451, 1452, 1454, 1457, 2, 45, 43, 603, 603, + /* 590 */ 564, 1968, 1797, 1798, 362, 32, 1374, 547, 1375, 620, + /* 600 */ 1373, 2106, 54, 180, 1919, 1489, 619, 1453, 657, 1372, + /* 610 */ 1560, 41, 40, 39, 237, 184, 2112, 175, 1803, 1750, + /* 620 */ 1750, 2107, 572, 1378, 1379, 366, 375, 510, 509, 1949, + /* 630 */ 2110, 603, 1448, 1984, 1801, 8, 102, 1951, 623, 1953, + /* 640 */ 1954, 618, 1727, 613, 1380, 125, 136, 2052, 143, 2008, + /* 650 */ 2037, 1950, 499, 2052, 356, 2033, 374, 45, 43, 1402, + /* 660 */ 519, 528, 1750, 603, 1619, 362, 1430, 1374, 547, 46, + /* 670 */ 13, 12, 2106, 2048, 526, 529, 524, 125, 1453, 2047, + /* 680 */ 1372, 178, 1968, 93, 504, 1846, 1174, 2112, 175, 226, + /* 690 */ 586, 710, 2107, 572, 1750, 1919, 185, 619, 547, 681, + /* 700 */ 679, 1398, 2106, 1448, 522, 1743, 1455, 1456, 1919, 516, + /* 710 */ 135, 603, 648, 2008, 225, 1380, 1618, 2112, 175, 1617, + /* 720 */ 1949, 1176, 2107, 572, 1984, 405, 1846, 102, 1951, 623, + /* 730 */ 1953, 1954, 618, 603, 613, 1429, 1438, 189, 657, 172, + /* 740 */ 14, 2037, 1750, 603, 603, 356, 2033, 406, 229, 655, + /* 750 */ 66, 1780, 649, 65, 1375, 1794, 1373, 415, 429, 503, + /* 760 */ 1919, 1616, 710, 1919, 1750, 1496, 1640, 2064, 148, 147, + /* 770 */ 652, 651, 650, 145, 1750, 1750, 1380, 1455, 1456, 1378, + /* 780 */ 1379, 502, 1428, 1431, 1432, 1433, 1434, 1435, 1436, 1437, + /* 790 */ 615, 611, 1446, 1447, 1449, 1450, 1451, 1452, 1454, 1457, + /* 800 */ 2, 319, 236, 1397, 603, 1919, 1429, 1438, 1615, 653, + /* 810 */ 437, 654, 1794, 450, 1794, 705, 449, 290, 430, 669, + /* 820 */ 1780, 670, 50, 1720, 3, 1375, 1663, 1373, 1614, 1613, + /* 830 */ 1612, 421, 146, 451, 33, 1750, 423, 1093, 1094, 1516, + /* 840 */ 38, 37, 1725, 1833, 44, 42, 41, 40, 39, 1399, + /* 850 */ 1378, 1379, 1919, 1428, 1431, 1432, 1433, 1434, 1435, 1436, + /* 860 */ 1437, 615, 611, 1446, 1447, 1449, 1450, 1451, 1452, 1454, + /* 870 */ 1457, 2, 1919, 1919, 1919, 38, 37, 335, 1735, 44, + /* 880 */ 42, 41, 40, 39, 53, 218, 2057, 1516, 216, 411, + /* 890 */ 574, 687, 686, 685, 684, 372, 1520, 683, 682, 137, + /* 900 */ 677, 676, 675, 674, 673, 672, 671, 150, 667, 666, + /* 910 */ 665, 371, 370, 662, 661, 660, 659, 658, 139, 447, + /* 920 */ 127, 1383, 442, 441, 440, 439, 436, 435, 434, 433, + /* 930 */ 432, 428, 427, 426, 425, 336, 418, 417, 416, 69, + /* 940 */ 413, 412, 333, 158, 578, 535, 38, 37, 296, 655, + /* 950 */ 44, 42, 41, 40, 39, 220, 222, 1950, 219, 221, + /* 960 */ 1611, 1608, 294, 68, 224, 1610, 67, 223, 148, 147, + /* 970 */ 652, 651, 650, 145, 1737, 38, 37, 1950, 603, 44, + /* 980 */ 42, 41, 40, 39, 195, 456, 454, 547, 1968, 77, + /* 990 */ 1430, 2106, 476, 583, 424, 575, 620, 1607, 1606, 1605, + /* 1000 */ 98, 1919, 408, 619, 1919, 1919, 2112, 175, 1968, 1750, + /* 1010 */ 95, 2107, 572, 603, 52, 409, 620, 603, 603, 546, + /* 1020 */ 60, 1919, 1604, 619, 133, 1906, 1949, 477, 62, 241, + /* 1030 */ 1984, 1747, 141, 102, 1951, 623, 1953, 1954, 618, 1590, + /* 1040 */ 613, 1919, 1919, 1919, 1750, 2126, 1949, 2037, 1750, 1750, + /* 1050 */ 1984, 356, 2033, 102, 1951, 623, 1953, 1954, 618, 101, + /* 1060 */ 613, 1382, 2071, 1539, 603, 2126, 1919, 2037, 1386, 1950, + /* 1070 */ 655, 356, 2033, 384, 1603, 1592, 1593, 1602, 543, 1733, + /* 1080 */ 1547, 243, 2084, 176, 2045, 2046, 232, 131, 2050, 148, + /* 1090 */ 147, 652, 651, 650, 145, 1750, 614, 76, 75, 404, + /* 1100 */ 1968, 156, 182, 603, 647, 603, 1705, 2077, 620, 559, + /* 1110 */ 603, 1653, 1950, 1919, 47, 619, 1601, 587, 1919, 271, + /* 1120 */ 318, 1919, 254, 392, 598, 390, 386, 382, 379, 376, + /* 1130 */ 603, 13, 12, 515, 1750, 1589, 1750, 1519, 1949, 603, + /* 1140 */ 603, 1750, 1984, 1968, 600, 102, 1951, 623, 1953, 1954, + /* 1150 */ 618, 620, 613, 601, 277, 1950, 1919, 2126, 619, 2037, + /* 1160 */ 1919, 1750, 1646, 356, 2033, 1644, 1321, 579, 1600, 178, + /* 1170 */ 1750, 1750, 38, 37, 554, 264, 44, 42, 41, 40, + /* 1180 */ 39, 1949, 603, 211, 517, 1984, 1968, 520, 102, 1951, + /* 1190 */ 623, 1953, 1954, 618, 620, 613, 369, 248, 1940, 1919, + /* 1200 */ 2126, 619, 2037, 142, 144, 146, 356, 2033, 1385, 373, + /* 1210 */ 62, 47, 1919, 1750, 1634, 47, 576, 2100, 627, 359, + /* 1220 */ 358, 144, 1950, 146, 1949, 663, 128, 269, 1984, 1388, + /* 1230 */ 144, 102, 1951, 623, 1953, 1954, 618, 664, 613, 1136, + /* 1240 */ 1453, 1969, 1381, 2126, 1855, 2037, 1942, 1155, 1791, 356, + /* 1250 */ 2033, 2067, 584, 1968, 253, 595, 273, 1207, 256, 1153, + /* 1260 */ 2056, 620, 1490, 1439, 1, 1448, 1919, 289, 619, 4, + /* 1270 */ 1235, 378, 332, 1239, 1137, 1246, 1950, 1380, 1244, 383, + /* 1280 */ 1338, 188, 149, 284, 410, 1402, 414, 445, 1856, 419, + /* 1290 */ 1397, 1949, 431, 1848, 438, 1984, 444, 446, 102, 1951, + /* 1300 */ 623, 1953, 1954, 618, 452, 613, 192, 1968, 453, 455, + /* 1310 */ 2012, 457, 2037, 1403, 1405, 620, 356, 2033, 458, 467, + /* 1320 */ 1919, 470, 619, 198, 609, 471, 1404, 200, 472, 1406, + /* 1330 */ 473, 475, 203, 479, 205, 80, 1110, 81, 209, 496, + /* 1340 */ 497, 498, 321, 105, 1896, 1949, 500, 534, 1895, 1984, + /* 1350 */ 536, 538, 102, 1951, 623, 1953, 1954, 618, 1740, 613, + /* 1360 */ 230, 215, 1950, 1736, 2010, 217, 2037, 151, 152, 1738, + /* 1370 */ 356, 2033, 1734, 153, 154, 537, 285, 541, 233, 544, + /* 1380 */ 2068, 7, 560, 2083, 2082, 593, 569, 1389, 2059, 1384, + /* 1390 */ 551, 557, 249, 1968, 247, 346, 552, 550, 2078, 563, + /* 1400 */ 165, 620, 239, 250, 549, 251, 1919, 347, 619, 580, + /* 1410 */ 577, 242, 1392, 1394, 2129, 1516, 2105, 132, 1401, 255, + /* 1420 */ 252, 588, 261, 350, 611, 1446, 1447, 1449, 1450, 1451, + /* 1430 */ 1452, 1949, 2053, 286, 591, 1984, 1950, 592, 102, 1951, + /* 1440 */ 623, 1953, 1954, 618, 1867, 613, 1866, 1865, 287, 352, + /* 1450 */ 606, 596, 2037, 597, 90, 288, 356, 2033, 92, 1751, + /* 1460 */ 59, 2018, 94, 1795, 1721, 625, 706, 1968, 291, 707, + /* 1470 */ 709, 51, 300, 315, 280, 620, 323, 314, 304, 1950, + /* 1480 */ 1919, 324, 619, 295, 293, 1913, 1912, 73, 1911, 1910, + /* 1490 */ 74, 1907, 380, 1366, 381, 1367, 181, 385, 1905, 387, + /* 1500 */ 388, 389, 1904, 391, 1903, 1949, 393, 1902, 1901, 1984, + /* 1510 */ 1968, 397, 103, 1951, 623, 1953, 1954, 618, 620, 613, + /* 1520 */ 1341, 395, 1950, 1919, 1340, 619, 2037, 402, 403, 1876, + /* 1530 */ 2036, 2033, 1878, 1877, 1875, 1841, 1840, 1301, 1838, 138, + /* 1540 */ 1837, 1836, 1839, 1835, 1834, 1832, 1831, 1830, 1949, 420, + /* 1550 */ 1950, 186, 1984, 1968, 1829, 103, 1951, 623, 1953, 1954, + /* 1560 */ 618, 620, 613, 422, 1828, 1827, 1919, 1826, 619, 2037, + /* 1570 */ 140, 1813, 1812, 608, 2033, 1825, 1824, 1823, 1822, 1821, + /* 1580 */ 1820, 1968, 1819, 1818, 1817, 1816, 1815, 1814, 1811, 617, + /* 1590 */ 1810, 621, 1809, 1808, 1919, 1984, 619, 1807, 103, 1951, + /* 1600 */ 623, 1953, 1954, 618, 1806, 613, 1805, 448, 1804, 1182, + /* 1610 */ 1668, 1303, 2037, 193, 1667, 194, 326, 2033, 1665, 1949, + /* 1620 */ 1629, 1096, 713, 1984, 1628, 170, 312, 1951, 623, 1953, + /* 1630 */ 1954, 618, 616, 613, 604, 2002, 283, 196, 1950, 71, + /* 1640 */ 1095, 1939, 197, 463, 72, 465, 1891, 1885, 1874, 204, + /* 1650 */ 202, 168, 1873, 1858, 1729, 1129, 1664, 703, 699, 695, + /* 1660 */ 691, 281, 1662, 480, 481, 1660, 484, 485, 482, 1968, + /* 1670 */ 1658, 486, 488, 489, 490, 1656, 492, 620, 493, 494, + /* 1680 */ 1643, 1950, 1919, 1642, 619, 1625, 1731, 1730, 1250, 678, + /* 1690 */ 1251, 1165, 1173, 1172, 1171, 1170, 1654, 100, 1950, 1167, + /* 1700 */ 274, 341, 1166, 61, 1647, 680, 1164, 1949, 1645, 521, + /* 1710 */ 342, 1984, 1968, 518, 161, 1951, 623, 1953, 1954, 618, + /* 1720 */ 620, 613, 343, 214, 1624, 1919, 523, 619, 1623, 1968, + /* 1730 */ 525, 1622, 527, 599, 104, 1358, 1356, 620, 1355, 26, + /* 1740 */ 531, 1890, 1919, 1884, 619, 155, 1347, 539, 1872, 1870, + /* 1750 */ 1949, 19, 1950, 2111, 1984, 548, 2074, 162, 1951, 623, + /* 1760 */ 1953, 1954, 618, 16, 613, 555, 234, 1949, 1950, 1562, + /* 1770 */ 262, 1984, 55, 240, 103, 1951, 623, 1953, 1954, 618, + /* 1780 */ 540, 613, 545, 1968, 28, 344, 553, 1345, 2037, 231, + /* 1790 */ 58, 620, 238, 2034, 1546, 245, 1919, 163, 619, 1968, + /* 1800 */ 244, 5, 6, 246, 29, 1940, 30, 620, 1538, 573, + /* 1810 */ 2127, 86, 1919, 1582, 619, 1583, 20, 63, 21, 1513, + /* 1820 */ 1577, 1949, 1576, 348, 1581, 1984, 1580, 349, 161, 1951, + /* 1830 */ 623, 1953, 1954, 618, 1512, 613, 1871, 1949, 1950, 57, + /* 1840 */ 258, 1984, 1869, 166, 306, 1951, 623, 1953, 1954, 618, + /* 1850 */ 1868, 613, 22, 1857, 1950, 263, 1544, 56, 265, 270, + /* 1860 */ 17, 88, 89, 91, 275, 23, 95, 10, 12, 1968, + /* 1870 */ 2075, 1390, 594, 1475, 1987, 612, 1465, 620, 1464, 272, + /* 1880 */ 167, 36, 1919, 1421, 619, 1968, 1443, 179, 568, 15, + /* 1890 */ 351, 622, 24, 620, 1441, 1440, 1413, 1950, 1919, 25, + /* 1900 */ 619, 1236, 626, 364, 628, 1213, 1233, 1949, 624, 630, + /* 1910 */ 631, 1984, 1230, 633, 162, 1951, 623, 1953, 1954, 618, + /* 1920 */ 634, 613, 1224, 1949, 636, 637, 639, 1984, 1968, 640, + /* 1930 */ 313, 1951, 623, 1953, 1954, 618, 617, 613, 1228, 1222, + /* 1940 */ 96, 1919, 646, 619, 278, 1245, 1227, 1226, 1225, 97, + /* 1950 */ 70, 1241, 1127, 656, 1950, 1161, 1160, 1159, 1158, 1157, + /* 1960 */ 1156, 1154, 1152, 1151, 668, 1150, 1949, 2128, 1180, 1148, + /* 1970 */ 1984, 1147, 1145, 312, 1951, 623, 1953, 1954, 618, 279, + /* 1980 */ 613, 1146, 2003, 1144, 1143, 1968, 1142, 1177, 1175, 1139, + /* 1990 */ 361, 1138, 1135, 620, 1134, 1133, 1132, 1661, 1919, 688, + /* 2000 */ 619, 690, 1659, 692, 694, 1950, 689, 1657, 693, 696, + /* 2010 */ 698, 697, 1655, 700, 701, 702, 1641, 704, 1085, 1621, + /* 2020 */ 282, 708, 711, 1949, 712, 1376, 1950, 1984, 292, 1596, + /* 2030 */ 313, 1951, 623, 1953, 1954, 618, 1968, 613, 1596, 1596, + /* 2040 */ 1596, 363, 1596, 1596, 620, 1596, 1596, 1596, 1950, 1919, + /* 2050 */ 1596, 619, 1596, 1596, 1596, 1596, 1596, 1968, 1596, 1596, + /* 2060 */ 1596, 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, 1596, + /* 2070 */ 1919, 1596, 619, 1596, 1949, 1596, 1596, 1596, 1984, 1968, + /* 2080 */ 1596, 313, 1951, 623, 1953, 1954, 618, 620, 613, 1596, + /* 2090 */ 1596, 1596, 1919, 1596, 619, 533, 1596, 1596, 1596, 1984, + /* 2100 */ 1596, 1596, 308, 1951, 623, 1953, 1954, 618, 1596, 613, + /* 2110 */ 1596, 1950, 1596, 1596, 1596, 1596, 1596, 1949, 1596, 1596, + /* 2120 */ 1596, 1984, 1596, 1596, 297, 1951, 623, 1953, 1954, 618, + /* 2130 */ 1596, 613, 1596, 1596, 1596, 1950, 1596, 1596, 1596, 1596, + /* 2140 */ 1596, 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2150 */ 620, 1596, 1596, 1596, 1596, 1919, 1596, 619, 1596, 1596, + /* 2160 */ 1596, 1596, 1596, 1596, 1596, 1596, 1968, 1596, 1596, 1596, + /* 2170 */ 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, 1596, 1919, + /* 2180 */ 1949, 619, 1596, 1596, 1984, 1596, 1596, 298, 1951, 623, + /* 2190 */ 1953, 1954, 618, 1596, 613, 1596, 1596, 1950, 1596, 1596, + /* 2200 */ 1596, 1596, 1596, 1596, 1949, 1596, 1596, 1596, 1984, 1596, + /* 2210 */ 1596, 299, 1951, 623, 1953, 1954, 618, 1596, 613, 1596, + /* 2220 */ 1596, 1950, 1596, 1596, 1596, 1596, 1596, 1596, 1968, 1596, + /* 2230 */ 1596, 1596, 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, + /* 2240 */ 1596, 1919, 1596, 619, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2250 */ 1596, 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2260 */ 620, 1596, 1596, 1596, 1950, 1919, 1949, 619, 1596, 1596, + /* 2270 */ 1984, 1596, 1596, 305, 1951, 623, 1953, 1954, 618, 1596, + /* 2280 */ 613, 1596, 1950, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2290 */ 1949, 1596, 1596, 1596, 1984, 1968, 1596, 309, 1951, 623, + /* 2300 */ 1953, 1954, 618, 620, 613, 1596, 1596, 1596, 1919, 1596, + /* 2310 */ 619, 1596, 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2320 */ 1596, 620, 1596, 1596, 1596, 1596, 1919, 1596, 619, 1596, + /* 2330 */ 1596, 1596, 1596, 1949, 1596, 1596, 1596, 1984, 1596, 1596, + /* 2340 */ 301, 1951, 623, 1953, 1954, 618, 1596, 613, 1596, 1596, + /* 2350 */ 1596, 1949, 1596, 1596, 1950, 1984, 1596, 1596, 310, 1951, + /* 2360 */ 623, 1953, 1954, 618, 1596, 613, 1596, 1596, 1596, 1596, + /* 2370 */ 1596, 1596, 1950, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2380 */ 1596, 1596, 1596, 1596, 1596, 1968, 1596, 1596, 1596, 1596, + /* 2390 */ 1596, 1596, 1596, 620, 1596, 1596, 1596, 1596, 1919, 1596, + /* 2400 */ 619, 1596, 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2410 */ 1596, 620, 1596, 1596, 1596, 1950, 1919, 1596, 619, 1596, + /* 2420 */ 1596, 1596, 1596, 1949, 1596, 1596, 1596, 1984, 1596, 1596, + /* 2430 */ 302, 1951, 623, 1953, 1954, 618, 1596, 613, 1596, 1950, + /* 2440 */ 1596, 1949, 1596, 1596, 1596, 1984, 1968, 1596, 311, 1951, + /* 2450 */ 623, 1953, 1954, 618, 620, 613, 1596, 1596, 1596, 1919, + /* 2460 */ 1596, 619, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2470 */ 1968, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 620, 1596, + /* 2480 */ 1596, 1596, 1596, 1919, 1949, 619, 1596, 1596, 1984, 1596, + /* 2490 */ 1596, 303, 1951, 623, 1953, 1954, 618, 1596, 613, 1596, + /* 2500 */ 1596, 1596, 1950, 1596, 1596, 1596, 1596, 1596, 1949, 1596, + /* 2510 */ 1596, 1596, 1984, 1596, 1596, 316, 1951, 623, 1953, 1954, + /* 2520 */ 618, 1596, 613, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2530 */ 1596, 1596, 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2540 */ 1596, 620, 1596, 1596, 1596, 1596, 1919, 1596, 619, 1596, + /* 2550 */ 1596, 1596, 1596, 1596, 1596, 1596, 1950, 1596, 1596, 1596, + /* 2560 */ 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2570 */ 1596, 1949, 1596, 1596, 1596, 1984, 1596, 1596, 317, 1951, + /* 2580 */ 623, 1953, 1954, 618, 1596, 613, 1596, 1968, 1596, 1596, + /* 2590 */ 1596, 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, 1596, + /* 2600 */ 1919, 1596, 619, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2610 */ 1950, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2620 */ 1596, 1596, 1596, 1596, 1596, 1949, 1950, 1596, 1596, 1984, + /* 2630 */ 1596, 1596, 1962, 1951, 623, 1953, 1954, 618, 1596, 613, + /* 2640 */ 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 620, + /* 2650 */ 1596, 1596, 1596, 1596, 1919, 1596, 619, 1968, 1596, 1596, + /* 2660 */ 1596, 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, 1950, + /* 2670 */ 1919, 1596, 619, 1596, 1596, 1596, 1596, 1596, 1596, 1949, + /* 2680 */ 1596, 1596, 1596, 1984, 1596, 1596, 1961, 1951, 623, 1953, + /* 2690 */ 1954, 618, 1596, 613, 1596, 1949, 1596, 1596, 1596, 1984, + /* 2700 */ 1968, 1596, 1960, 1951, 623, 1953, 1954, 618, 620, 613, + /* 2710 */ 1596, 1596, 1596, 1919, 1596, 619, 1596, 1596, 1596, 1596, + /* 2720 */ 1596, 1596, 1596, 1596, 1596, 1596, 1950, 1596, 1596, 1596, + /* 2730 */ 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1949, 1596, + /* 2740 */ 1596, 1596, 1984, 1950, 1596, 328, 1951, 623, 1953, 1954, + /* 2750 */ 618, 1596, 613, 1596, 1596, 1596, 1596, 1968, 1596, 1596, + /* 2760 */ 1596, 1596, 1596, 1596, 1596, 620, 1596, 1596, 1596, 1950, + /* 2770 */ 1919, 1596, 619, 1596, 1968, 1596, 1596, 1596, 1596, 1596, + /* 2780 */ 1596, 1596, 620, 1596, 1596, 1596, 1596, 1919, 1596, 619, + /* 2790 */ 1596, 1596, 1596, 1596, 1596, 1949, 1596, 1596, 1596, 1984, + /* 2800 */ 1968, 1596, 329, 1951, 623, 1953, 1954, 618, 620, 613, + /* 2810 */ 1596, 1596, 1949, 1919, 1596, 619, 1984, 1596, 1596, 325, + /* 2820 */ 1951, 623, 1953, 1954, 618, 1596, 613, 1596, 1596, 1596, + /* 2830 */ 1950, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1949, 1596, + /* 2840 */ 1596, 1596, 1984, 1596, 1596, 330, 1951, 623, 1953, 1954, + /* 2850 */ 618, 1596, 613, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2860 */ 1596, 1968, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 620, + /* 2870 */ 1596, 1596, 1596, 1596, 1919, 1596, 619, 1596, 1596, 1596, + /* 2880 */ 1596, 1596, 1596, 1596, 1950, 1596, 1596, 1596, 1596, 1596, + /* 2890 */ 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 621, + /* 2900 */ 1596, 1596, 1596, 1984, 1596, 1596, 308, 1951, 623, 1953, + /* 2910 */ 1954, 618, 1596, 613, 1596, 1968, 1596, 1596, 1596, 1596, + /* 2920 */ 1596, 1596, 1596, 620, 1596, 1596, 1596, 1596, 1919, 1596, + /* 2930 */ 619, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2940 */ 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, + /* 2950 */ 1596, 1596, 1596, 1949, 1596, 1596, 1596, 1984, 1596, 1596, + /* 2960 */ 307, 1951, 623, 1953, 1954, 618, 1596, 613, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 325, 329, 340, 331, 332, 427, 356, 345, 329, 431, - /* 10 */ 331, 332, 12, 13, 14, 367, 0, 427, 370, 371, - /* 20 */ 20, 431, 22, 0, 446, 447, 333, 377, 378, 451, - /* 30 */ 452, 356, 358, 33, 333, 35, 0, 447, 22, 364, - /* 40 */ 347, 451, 452, 369, 369, 385, 371, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 14, 364, 58, 20, - /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 394, - /* 70 */ 70, 397, 398, 398, 373, 20, 401, 402, 403, 404, - /* 80 */ 405, 406, 408, 408, 58, 20, 14, 427, 413, 358, - /* 90 */ 415, 431, 20, 62, 419, 420, 96, 400, 14, 325, - /* 100 */ 369, 65, 66, 67, 20, 356, 446, 447, 433, 73, - /* 110 */ 74, 451, 452, 364, 78, 79, 441, 324, 118, 326, - /* 120 */ 84, 85, 96, 426, 98, 20, 90, 333, 397, 398, - /* 130 */ 356, 20, 4, 133, 134, 20, 322, 22, 364, 408, - /* 140 */ 427, 347, 364, 369, 431, 371, 12, 13, 354, 97, - /* 150 */ 35, 96, 403, 375, 20, 0, 22, 20, 364, 325, - /* 160 */ 447, 96, 162, 163, 451, 452, 51, 33, 394, 35, - /* 170 */ 333, 43, 398, 45, 46, 401, 402, 403, 404, 405, - /* 180 */ 406, 181, 408, 183, 347, 411, 4, 413, 414, 415, - /* 190 */ 356, 354, 58, 419, 420, 416, 417, 63, 364, 385, - /* 200 */ 20, 364, 62, 369, 70, 371, 206, 207, 20, 209, + /* 0 */ 331, 350, 333, 334, 359, 331, 324, 333, 334, 358, + /* 10 */ 391, 341, 12, 13, 14, 360, 358, 326, 367, 328, + /* 20 */ 20, 20, 22, 8, 9, 355, 371, 12, 13, 14, + /* 30 */ 15, 16, 20, 33, 364, 35, 0, 379, 380, 20, + /* 40 */ 360, 369, 8, 9, 372, 373, 12, 13, 14, 15, + /* 50 */ 16, 371, 335, 366, 399, 400, 401, 335, 58, 44, + /* 60 */ 14, 2, 0, 63, 377, 410, 20, 8, 9, 387, + /* 70 */ 70, 12, 13, 14, 15, 16, 357, 327, 358, 399, + /* 80 */ 400, 401, 4, 12, 13, 365, 20, 360, 366, 370, + /* 90 */ 410, 20, 375, 22, 374, 95, 332, 63, 371, 335, + /* 100 */ 336, 65, 66, 67, 33, 350, 35, 95, 358, 73, + /* 110 */ 74, 429, 14, 358, 78, 433, 366, 117, 20, 83, + /* 120 */ 84, 371, 367, 373, 62, 89, 399, 400, 20, 58, + /* 130 */ 448, 449, 132, 133, 63, 453, 454, 410, 104, 332, + /* 140 */ 342, 70, 335, 336, 335, 347, 396, 425, 426, 427, + /* 150 */ 400, 429, 430, 403, 404, 405, 406, 407, 408, 429, + /* 160 */ 410, 161, 162, 433, 163, 415, 95, 417, 65, 66, + /* 170 */ 67, 421, 422, 95, 62, 366, 73, 74, 448, 449, + /* 180 */ 180, 78, 182, 453, 454, 435, 83, 84, 117, 414, + /* 190 */ 360, 416, 89, 443, 160, 127, 12, 13, 14, 15, + /* 200 */ 16, 371, 4, 132, 133, 205, 206, 161, 208, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 337, - /* 230 */ 96, 3, 398, 325, 162, 401, 402, 403, 404, 405, - /* 240 */ 406, 427, 408, 351, 20, 431, 162, 413, 20, 415, - /* 250 */ 167, 359, 118, 419, 420, 12, 13, 14, 15, 16, - /* 260 */ 446, 447, 229, 108, 356, 451, 452, 133, 134, 370, - /* 270 */ 371, 245, 364, 162, 163, 441, 96, 369, 96, 371, - /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 20, - /* 290 */ 22, 96, 20, 325, 342, 343, 162, 163, 325, 333, - /* 300 */ 245, 33, 394, 35, 330, 333, 398, 333, 334, 401, - /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 128, 347, - /* 320 */ 107, 413, 355, 415, 356, 97, 58, 419, 420, 161, - /* 330 */ 364, 63, 364, 250, 251, 368, 364, 369, 70, 371, - /* 340 */ 206, 207, 369, 209, 210, 211, 212, 213, 214, 215, - /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 360 */ 226, 227, 394, 229, 96, 325, 398, 342, 343, 401, - /* 370 */ 402, 403, 404, 405, 406, 180, 408, 182, 188, 189, - /* 380 */ 96, 413, 192, 415, 194, 339, 118, 419, 420, 423, - /* 390 */ 424, 425, 164, 427, 428, 80, 356, 431, 430, 353, - /* 400 */ 232, 133, 134, 389, 364, 133, 134, 22, 362, 369, - /* 410 */ 242, 371, 446, 447, 12, 13, 14, 451, 452, 371, - /* 420 */ 35, 70, 20, 0, 22, 245, 96, 245, 364, 381, - /* 430 */ 162, 163, 384, 164, 394, 33, 58, 35, 398, 375, - /* 440 */ 245, 401, 402, 403, 404, 405, 406, 108, 408, 181, - /* 450 */ 410, 183, 330, 138, 139, 333, 334, 8, 9, 70, - /* 460 */ 58, 12, 13, 14, 15, 16, 127, 128, 129, 130, - /* 470 */ 131, 132, 70, 95, 206, 207, 98, 209, 210, 211, - /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 490 */ 222, 223, 224, 225, 226, 227, 333, 325, 96, 333, - /* 500 */ 357, 325, 356, 65, 66, 67, 20, 333, 356, 363, - /* 510 */ 347, 73, 74, 347, 357, 363, 78, 79, 372, 325, - /* 520 */ 118, 347, 84, 85, 372, 348, 348, 364, 90, 245, - /* 530 */ 364, 108, 356, 356, 356, 133, 134, 20, 364, 22, - /* 540 */ 364, 369, 365, 365, 21, 369, 97, 371, 12, 13, - /* 550 */ 127, 128, 129, 130, 131, 132, 20, 34, 22, 36, - /* 560 */ 357, 325, 333, 369, 162, 163, 176, 35, 51, 33, - /* 570 */ 394, 35, 333, 333, 398, 245, 347, 401, 402, 403, - /* 580 */ 404, 405, 406, 181, 408, 183, 347, 197, 198, 413, - /* 590 */ 357, 415, 356, 364, 58, 419, 420, 127, 357, 229, - /* 600 */ 364, 231, 70, 364, 364, 369, 70, 371, 206, 207, - /* 610 */ 339, 209, 210, 211, 212, 213, 214, 215, 216, 217, - /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - /* 630 */ 394, 356, 96, 362, 398, 348, 63, 401, 402, 403, - /* 640 */ 404, 405, 406, 356, 408, 127, 128, 325, 162, 413, - /* 650 */ 132, 415, 365, 378, 118, 419, 420, 325, 325, 0, - /* 660 */ 190, 191, 422, 423, 424, 425, 430, 427, 428, 133, - /* 670 */ 134, 8, 9, 39, 2, 12, 13, 14, 15, 16, - /* 680 */ 8, 9, 12, 13, 12, 13, 14, 15, 16, 356, - /* 690 */ 20, 369, 22, 337, 333, 333, 379, 364, 162, 163, - /* 700 */ 325, 369, 369, 33, 371, 35, 356, 44, 347, 347, - /* 710 */ 14, 15, 16, 363, 412, 359, 414, 181, 412, 183, - /* 720 */ 414, 62, 372, 357, 356, 364, 364, 394, 58, 349, - /* 730 */ 325, 398, 352, 365, 401, 402, 403, 404, 405, 406, - /* 740 */ 70, 408, 206, 207, 369, 209, 210, 211, 212, 213, - /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - /* 760 */ 224, 225, 226, 227, 8, 9, 96, 325, 12, 13, - /* 770 */ 14, 15, 16, 364, 369, 442, 443, 427, 206, 206, - /* 780 */ 18, 431, 20, 400, 375, 333, 357, 325, 118, 27, - /* 790 */ 325, 325, 30, 0, 325, 33, 446, 447, 356, 347, - /* 800 */ 0, 451, 452, 133, 134, 325, 364, 326, 325, 426, - /* 810 */ 48, 369, 50, 371, 21, 53, 364, 24, 25, 26, - /* 820 */ 27, 28, 29, 30, 31, 32, 254, 255, 256, 257, - /* 830 */ 258, 369, 162, 163, 369, 369, 394, 344, 369, 346, - /* 840 */ 398, 333, 333, 401, 402, 403, 404, 405, 406, 369, - /* 850 */ 408, 181, 369, 183, 325, 347, 347, 95, 0, 8, - /* 860 */ 9, 4, 62, 12, 13, 14, 15, 16, 3, 107, - /* 870 */ 20, 20, 364, 364, 400, 325, 206, 207, 244, 209, - /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 369, 137, - /* 900 */ 426, 345, 140, 141, 142, 143, 144, 145, 146, 147, - /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 369, - /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 44, 71, - /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - /* 950 */ 92, 18, 325, 325, 333, 325, 23, 8, 9, 12, - /* 960 */ 13, 12, 13, 14, 15, 16, 325, 325, 347, 22, - /* 970 */ 37, 38, 333, 411, 41, 366, 414, 455, 369, 20, - /* 980 */ 33, 97, 35, 8, 9, 364, 347, 12, 13, 14, - /* 990 */ 15, 16, 59, 60, 61, 371, 369, 369, 356, 369, - /* 1000 */ 1, 2, 37, 364, 366, 58, 364, 369, 384, 444, - /* 1010 */ 369, 369, 63, 371, 164, 164, 44, 70, 109, 110, - /* 1020 */ 111, 112, 113, 114, 115, 116, 117, 118, 119, 96, - /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 335, 349, 333, - /* 1040 */ 398, 352, 356, 401, 402, 403, 404, 405, 406, 366, - /* 1050 */ 408, 385, 369, 347, 105, 413, 100, 415, 372, 103, - /* 1060 */ 33, 419, 420, 19, 99, 118, 101, 102, 135, 104, - /* 1070 */ 364, 438, 430, 108, 333, 48, 0, 33, 22, 45, - /* 1080 */ 46, 54, 55, 56, 57, 58, 243, 244, 347, 0, - /* 1090 */ 333, 35, 48, 427, 108, 130, 97, 431, 54, 55, - /* 1100 */ 56, 57, 58, 246, 347, 364, 173, 174, 175, 333, - /* 1110 */ 161, 178, 446, 447, 107, 44, 130, 451, 452, 333, - /* 1120 */ 35, 364, 95, 164, 48, 98, 70, 262, 181, 196, - /* 1130 */ 183, 356, 199, 347, 201, 202, 203, 204, 205, 95, - /* 1140 */ 364, 42, 98, 44, 42, 35, 44, 335, 173, 44, - /* 1150 */ 364, 379, 21, 206, 207, 24, 25, 26, 27, 28, - /* 1160 */ 29, 30, 31, 32, 157, 218, 219, 220, 221, 222, - /* 1170 */ 223, 224, 44, 100, 118, 131, 103, 325, 245, 44, - /* 1180 */ 333, 232, 233, 234, 235, 236, 237, 238, 239, 240, - /* 1190 */ 241, 242, 165, 166, 347, 168, 0, 0, 171, 423, - /* 1200 */ 424, 425, 97, 427, 428, 325, 100, 100, 356, 103, - /* 1210 */ 103, 364, 168, 44, 187, 164, 364, 44, 22, 22, - /* 1220 */ 169, 369, 44, 371, 58, 97, 133, 134, 47, 185, - /* 1230 */ 96, 187, 97, 1, 2, 332, 356, 181, 266, 183, - /* 1240 */ 106, 152, 267, 44, 364, 35, 394, 13, 325, 369, - /* 1250 */ 398, 371, 379, 401, 402, 403, 404, 405, 406, 44, - /* 1260 */ 408, 44, 206, 207, 98, 413, 97, 415, 183, 35, - /* 1270 */ 97, 419, 420, 368, 394, 97, 325, 96, 398, 356, - /* 1280 */ 70, 401, 402, 403, 404, 405, 406, 364, 408, 429, - /* 1290 */ 448, 2, 369, 183, 371, 415, 97, 8, 9, 419, - /* 1300 */ 420, 12, 13, 14, 15, 16, 421, 356, 44, 44, - /* 1310 */ 432, 44, 97, 247, 97, 364, 44, 394, 13, 325, - /* 1320 */ 369, 398, 371, 0, 401, 402, 403, 404, 405, 406, - /* 1330 */ 396, 408, 44, 48, 395, 264, 44, 325, 415, 179, - /* 1340 */ 35, 387, 419, 420, 42, 394, 376, 20, 379, 398, - /* 1350 */ 356, 161, 401, 402, 403, 404, 405, 406, 364, 408, - /* 1360 */ 376, 97, 97, 369, 97, 371, 415, 374, 356, 97, - /* 1370 */ 419, 420, 49, 20, 333, 333, 364, 376, 374, 374, - /* 1380 */ 325, 369, 333, 371, 94, 97, 341, 333, 394, 97, - /* 1390 */ 333, 20, 398, 4, 327, 401, 402, 403, 404, 405, - /* 1400 */ 406, 407, 408, 409, 410, 327, 394, 20, 19, 391, - /* 1410 */ 398, 356, 20, 401, 402, 403, 404, 405, 406, 364, - /* 1420 */ 408, 339, 33, 371, 369, 339, 371, 20, 358, 334, - /* 1430 */ 339, 334, 386, 325, 52, 339, 333, 48, 369, 369, - /* 1440 */ 339, 358, 53, 339, 327, 195, 356, 58, 336, 394, - /* 1450 */ 339, 336, 369, 398, 325, 333, 401, 402, 403, 404, - /* 1460 */ 405, 406, 337, 408, 356, 453, 454, 397, 398, 399, - /* 1470 */ 415, 327, 364, 393, 356, 420, 356, 369, 408, 371, - /* 1480 */ 397, 398, 399, 385, 95, 356, 356, 98, 356, 356, - /* 1490 */ 369, 408, 356, 364, 385, 356, 356, 356, 369, 356, - /* 1500 */ 371, 186, 394, 333, 391, 337, 398, 369, 325, 401, - /* 1510 */ 402, 403, 404, 405, 406, 253, 408, 390, 371, 382, - /* 1520 */ 252, 379, 333, 394, 379, 427, 369, 398, 369, 431, - /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 382, 356, - /* 1540 */ 431, 369, 259, 261, 446, 447, 172, 364, 248, 451, - /* 1550 */ 452, 443, 369, 364, 371, 446, 447, 260, 435, 440, - /* 1560 */ 451, 452, 325, 8, 9, 439, 268, 12, 13, 14, - /* 1570 */ 15, 16, 396, 244, 445, 265, 263, 394, 364, 325, - /* 1580 */ 456, 398, 434, 437, 401, 402, 403, 404, 405, 406, - /* 1590 */ 437, 408, 437, 356, 436, 20, 333, 337, 361, 450, - /* 1600 */ 449, 364, 400, 334, 382, 325, 369, 369, 371, 369, - /* 1610 */ 356, 369, 423, 424, 425, 361, 427, 428, 364, 166, - /* 1620 */ 369, 369, 369, 369, 337, 371, 382, 380, 352, 96, - /* 1630 */ 337, 394, 96, 325, 364, 398, 356, 454, 401, 402, - /* 1640 */ 403, 404, 405, 406, 364, 408, 418, 369, 394, 369, - /* 1650 */ 346, 371, 398, 333, 360, 401, 402, 403, 404, 405, - /* 1660 */ 406, 337, 408, 36, 356, 328, 327, 388, 350, 361, - /* 1670 */ 338, 350, 364, 392, 394, 350, 325, 369, 398, 371, - /* 1680 */ 323, 401, 402, 403, 404, 405, 406, 0, 408, 383, - /* 1690 */ 383, 0, 325, 188, 0, 0, 42, 0, 35, 200, - /* 1700 */ 35, 35, 394, 35, 200, 0, 398, 356, 35, 401, - /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 35, 200, 164, - /* 1720 */ 369, 0, 371, 356, 200, 0, 0, 35, 22, 0, - /* 1730 */ 183, 364, 181, 35, 0, 385, 369, 0, 371, 177, - /* 1740 */ 176, 0, 0, 325, 0, 394, 47, 0, 0, 398, - /* 1750 */ 42, 0, 401, 402, 403, 404, 405, 406, 0, 408, - /* 1760 */ 0, 394, 0, 0, 0, 398, 0, 0, 401, 402, - /* 1770 */ 403, 404, 405, 406, 356, 408, 152, 427, 35, 0, - /* 1780 */ 152, 431, 364, 0, 0, 0, 325, 369, 0, 371, - /* 1790 */ 0, 0, 0, 0, 0, 0, 446, 447, 0, 0, - /* 1800 */ 0, 451, 452, 325, 0, 0, 0, 42, 0, 0, - /* 1810 */ 0, 0, 394, 0, 0, 0, 398, 356, 22, 401, - /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 136, - /* 1830 */ 369, 0, 371, 58, 356, 0, 35, 0, 58, 0, - /* 1840 */ 14, 44, 364, 14, 42, 0, 39, 369, 0, 371, - /* 1850 */ 47, 0, 40, 0, 0, 394, 325, 39, 39, 398, - /* 1860 */ 172, 0, 401, 402, 403, 404, 405, 406, 47, 408, - /* 1870 */ 47, 0, 394, 325, 0, 0, 398, 35, 48, 401, - /* 1880 */ 402, 403, 404, 405, 406, 39, 408, 356, 64, 0, - /* 1890 */ 35, 48, 0, 35, 0, 364, 39, 48, 39, 35, - /* 1900 */ 369, 39, 371, 0, 356, 0, 0, 0, 48, 22, - /* 1910 */ 0, 35, 364, 35, 35, 22, 35, 369, 35, 371, - /* 1920 */ 103, 105, 22, 35, 325, 394, 44, 0, 44, 398, - /* 1930 */ 35, 35, 401, 402, 403, 404, 405, 406, 22, 408, - /* 1940 */ 0, 325, 394, 22, 0, 22, 398, 50, 35, 401, - /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 0, 0, 35, - /* 1960 */ 35, 0, 97, 364, 22, 20, 35, 325, 369, 35, - /* 1970 */ 371, 193, 356, 96, 0, 0, 35, 22, 0, 0, - /* 1980 */ 364, 44, 249, 3, 325, 369, 164, 371, 97, 249, - /* 1990 */ 44, 44, 44, 394, 96, 96, 164, 398, 356, 166, - /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 164, 184, - /* 2010 */ 394, 369, 97, 371, 398, 356, 97, 401, 402, 403, - /* 2020 */ 404, 405, 406, 364, 408, 96, 170, 97, 369, 47, - /* 2030 */ 371, 96, 96, 47, 96, 325, 394, 3, 44, 35, - /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 97, - /* 2050 */ 408, 97, 35, 394, 35, 35, 97, 398, 47, 97, - /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 44, 47, - /* 2070 */ 0, 0, 0, 96, 364, 167, 0, 96, 325, 369, - /* 2080 */ 97, 371, 97, 249, 243, 96, 96, 39, 96, 47, - /* 2090 */ 106, 165, 2, 44, 325, 228, 230, 228, 96, 22, - /* 2100 */ 97, 96, 47, 47, 394, 97, 96, 206, 398, 356, - /* 2110 */ 97, 401, 402, 403, 404, 405, 406, 364, 408, 96, - /* 2120 */ 22, 96, 369, 97, 371, 356, 208, 96, 107, 97, - /* 2130 */ 35, 35, 96, 364, 97, 35, 96, 35, 369, 96, - /* 2140 */ 371, 97, 97, 35, 97, 325, 96, 394, 35, 96, - /* 2150 */ 120, 398, 22, 120, 401, 402, 403, 404, 405, 406, - /* 2160 */ 108, 408, 96, 394, 44, 96, 120, 398, 35, 96, - /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 120, 22, - /* 2180 */ 64, 63, 35, 35, 364, 35, 35, 35, 325, 369, - /* 2190 */ 35, 371, 70, 35, 35, 35, 35, 93, 44, 35, - /* 2200 */ 35, 22, 35, 22, 35, 325, 35, 35, 70, 35, - /* 2210 */ 35, 35, 35, 35, 394, 22, 0, 35, 398, 356, - /* 2220 */ 35, 401, 402, 403, 404, 405, 406, 364, 408, 39, - /* 2230 */ 0, 48, 369, 35, 371, 48, 356, 0, 39, 35, - /* 2240 */ 48, 39, 0, 35, 364, 48, 39, 0, 35, 369, - /* 2250 */ 35, 371, 0, 22, 21, 20, 22, 394, 325, 457, - /* 2260 */ 22, 398, 21, 457, 401, 402, 403, 404, 405, 406, - /* 2270 */ 457, 408, 457, 457, 394, 325, 457, 457, 398, 457, - /* 2280 */ 457, 401, 402, 403, 404, 405, 406, 457, 408, 356, - /* 2290 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, - /* 2300 */ 457, 457, 369, 457, 371, 457, 356, 457, 457, 457, - /* 2310 */ 457, 457, 457, 457, 364, 457, 457, 457, 457, 369, - /* 2320 */ 457, 371, 457, 457, 457, 457, 325, 394, 457, 457, - /* 2330 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, - /* 2340 */ 457, 408, 457, 457, 394, 457, 457, 457, 398, 457, - /* 2350 */ 457, 401, 402, 403, 404, 405, 406, 356, 408, 457, - /* 2360 */ 457, 457, 457, 457, 457, 364, 457, 457, 457, 457, - /* 2370 */ 369, 457, 371, 457, 457, 457, 457, 457, 457, 457, - /* 2380 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2390 */ 457, 457, 457, 457, 457, 394, 457, 457, 457, 398, - /* 2400 */ 457, 457, 401, 402, 403, 404, 405, 406, 457, 408, - /* 2410 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2420 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2430 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2440 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2450 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2460 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2470 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2480 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2490 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2500 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2510 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2520 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2530 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2540 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2560 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - /* 2580 */ 457, 457, 457, 457, 457, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 161, 162, 399, + /* 230 */ 400, 20, 161, 162, 425, 426, 427, 350, 429, 430, + /* 240 */ 410, 43, 433, 45, 46, 358, 95, 20, 358, 22, + /* 250 */ 37, 180, 205, 182, 367, 187, 188, 448, 449, 191, + /* 260 */ 79, 193, 453, 454, 374, 231, 232, 233, 234, 235, + /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 51, 208, + /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 3, 228, + /* 300 */ 12, 13, 255, 256, 257, 258, 259, 228, 20, 230, + /* 310 */ 22, 98, 20, 100, 101, 20, 103, 335, 137, 138, + /* 320 */ 107, 33, 244, 35, 108, 109, 110, 111, 112, 113, + /* 330 */ 114, 115, 116, 117, 118, 0, 120, 121, 122, 123, + /* 340 */ 124, 125, 129, 132, 133, 58, 58, 58, 366, 58, + /* 350 */ 429, 63, 126, 63, 433, 339, 21, 228, 70, 24, + /* 360 */ 25, 26, 27, 28, 29, 30, 31, 32, 358, 353, + /* 370 */ 449, 12, 13, 14, 453, 454, 414, 361, 416, 20, + /* 380 */ 387, 22, 95, 95, 97, 94, 97, 95, 97, 95, + /* 390 */ 380, 96, 33, 21, 35, 244, 24, 25, 26, 27, + /* 400 */ 28, 29, 30, 31, 32, 117, 424, 425, 426, 427, + /* 410 */ 95, 429, 430, 33, 373, 189, 190, 58, 373, 429, + /* 420 */ 132, 133, 429, 433, 383, 341, 433, 386, 48, 70, + /* 430 */ 20, 386, 22, 166, 54, 55, 56, 57, 58, 449, + /* 440 */ 22, 448, 449, 453, 454, 35, 453, 454, 364, 161, + /* 450 */ 162, 126, 127, 35, 95, 0, 131, 20, 163, 8, + /* 460 */ 9, 51, 358, 12, 13, 14, 15, 16, 180, 365, + /* 470 */ 182, 20, 20, 179, 94, 181, 117, 97, 374, 24, + /* 480 */ 25, 26, 27, 28, 29, 30, 31, 32, 70, 402, + /* 490 */ 327, 132, 133, 205, 206, 205, 208, 209, 210, 211, + /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 510 */ 222, 223, 224, 225, 226, 428, 249, 250, 251, 14, + /* 520 */ 161, 162, 8, 9, 160, 20, 12, 13, 14, 15, + /* 530 */ 16, 244, 95, 429, 371, 117, 244, 433, 244, 180, + /* 540 */ 175, 182, 20, 358, 164, 165, 0, 167, 418, 419, + /* 550 */ 170, 366, 448, 449, 358, 387, 20, 453, 454, 244, + /* 560 */ 327, 196, 197, 367, 205, 206, 186, 208, 209, 210, + /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 335, 335, + /* 590 */ 405, 358, 372, 373, 20, 231, 22, 429, 180, 366, + /* 600 */ 182, 433, 349, 349, 371, 241, 373, 33, 62, 35, + /* 610 */ 96, 14, 15, 16, 163, 163, 448, 449, 358, 366, + /* 620 */ 366, 453, 454, 205, 206, 365, 387, 344, 345, 396, + /* 630 */ 3, 335, 58, 400, 374, 39, 403, 404, 405, 406, + /* 640 */ 407, 408, 0, 410, 70, 349, 413, 402, 415, 416, + /* 650 */ 417, 327, 356, 402, 421, 422, 387, 12, 13, 20, + /* 660 */ 4, 21, 366, 335, 327, 20, 161, 22, 429, 95, + /* 670 */ 1, 2, 433, 428, 34, 19, 36, 349, 33, 428, + /* 680 */ 35, 244, 358, 339, 356, 366, 35, 448, 449, 33, + /* 690 */ 366, 117, 453, 454, 366, 371, 377, 373, 429, 344, + /* 700 */ 345, 20, 433, 58, 48, 361, 132, 133, 371, 53, + /* 710 */ 413, 335, 106, 416, 58, 70, 327, 448, 449, 327, + /* 720 */ 396, 70, 453, 454, 400, 349, 366, 403, 404, 405, + /* 730 */ 406, 407, 408, 335, 410, 161, 162, 377, 62, 415, + /* 740 */ 95, 417, 366, 335, 335, 421, 422, 349, 351, 107, + /* 750 */ 94, 354, 368, 97, 180, 371, 182, 349, 349, 107, + /* 760 */ 371, 327, 117, 371, 366, 96, 0, 443, 126, 127, + /* 770 */ 128, 129, 130, 131, 366, 366, 70, 132, 133, 205, + /* 780 */ 206, 129, 208, 209, 210, 211, 212, 213, 214, 215, + /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 800 */ 226, 18, 163, 20, 335, 371, 161, 162, 327, 368, + /* 810 */ 27, 368, 371, 30, 371, 49, 33, 351, 349, 70, + /* 820 */ 354, 346, 42, 348, 44, 180, 0, 182, 327, 327, + /* 830 */ 327, 48, 44, 50, 2, 366, 53, 45, 46, 243, + /* 840 */ 8, 9, 0, 0, 12, 13, 14, 15, 16, 20, + /* 850 */ 205, 206, 371, 208, 209, 210, 211, 212, 213, 214, + /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + /* 870 */ 225, 226, 371, 371, 371, 8, 9, 94, 359, 12, + /* 880 */ 13, 14, 15, 16, 96, 99, 242, 243, 102, 106, + /* 890 */ 263, 65, 66, 67, 68, 69, 4, 71, 72, 73, + /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 42, 136, + /* 920 */ 44, 35, 139, 140, 141, 142, 143, 144, 145, 146, + /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 106, + /* 940 */ 157, 158, 159, 18, 44, 387, 8, 9, 23, 107, + /* 950 */ 12, 13, 14, 15, 16, 99, 99, 327, 102, 102, + /* 960 */ 327, 327, 37, 38, 99, 328, 41, 102, 126, 127, + /* 970 */ 128, 129, 130, 131, 359, 8, 9, 327, 335, 12, + /* 980 */ 13, 14, 15, 16, 59, 60, 61, 429, 358, 156, + /* 990 */ 161, 433, 349, 335, 151, 44, 366, 327, 327, 327, + /* 1000 */ 95, 371, 22, 373, 371, 371, 448, 449, 358, 366, + /* 1010 */ 105, 453, 454, 335, 163, 35, 366, 335, 335, 168, + /* 1020 */ 95, 371, 327, 373, 366, 0, 396, 349, 44, 44, + /* 1030 */ 400, 349, 349, 403, 404, 405, 406, 407, 408, 172, + /* 1040 */ 410, 371, 371, 371, 366, 415, 396, 417, 366, 366, + /* 1050 */ 400, 421, 422, 403, 404, 405, 406, 407, 408, 134, + /* 1060 */ 410, 35, 432, 96, 335, 415, 371, 417, 182, 327, + /* 1070 */ 107, 421, 422, 48, 327, 132, 133, 327, 349, 359, + /* 1080 */ 96, 96, 432, 425, 426, 427, 359, 429, 430, 126, + /* 1090 */ 127, 128, 129, 130, 131, 366, 359, 172, 173, 174, + /* 1100 */ 358, 163, 177, 335, 359, 335, 347, 381, 366, 446, + /* 1110 */ 335, 0, 327, 371, 44, 373, 327, 349, 371, 349, + /* 1120 */ 195, 371, 457, 198, 349, 200, 201, 202, 203, 204, + /* 1130 */ 335, 1, 2, 22, 366, 268, 366, 245, 396, 335, + /* 1140 */ 335, 366, 400, 358, 349, 403, 404, 405, 406, 407, + /* 1150 */ 408, 366, 410, 349, 349, 327, 371, 415, 373, 417, + /* 1160 */ 371, 366, 0, 421, 422, 0, 96, 267, 327, 244, + /* 1170 */ 366, 366, 8, 9, 432, 44, 12, 13, 14, 15, + /* 1180 */ 16, 396, 335, 337, 22, 400, 358, 22, 403, 404, + /* 1190 */ 405, 406, 407, 408, 366, 410, 349, 440, 47, 371, + /* 1200 */ 415, 373, 417, 44, 44, 44, 421, 422, 182, 337, + /* 1210 */ 44, 44, 371, 366, 334, 44, 265, 432, 44, 12, + /* 1220 */ 13, 44, 327, 44, 396, 13, 44, 96, 400, 22, + /* 1230 */ 44, 403, 404, 405, 406, 407, 408, 13, 410, 35, + /* 1240 */ 33, 358, 35, 415, 381, 417, 95, 35, 370, 421, + /* 1250 */ 422, 381, 431, 358, 423, 96, 96, 96, 450, 35, + /* 1260 */ 432, 366, 96, 96, 434, 58, 371, 96, 373, 246, + /* 1270 */ 96, 398, 397, 96, 70, 96, 327, 70, 96, 48, + /* 1280 */ 178, 42, 96, 389, 378, 20, 378, 160, 381, 376, + /* 1290 */ 20, 396, 335, 335, 378, 400, 376, 376, 403, 404, + /* 1300 */ 405, 406, 407, 408, 93, 410, 335, 358, 343, 335, + /* 1310 */ 415, 335, 417, 20, 20, 366, 421, 422, 329, 329, + /* 1320 */ 371, 393, 373, 341, 117, 373, 20, 341, 336, 20, + /* 1330 */ 388, 336, 341, 335, 341, 341, 52, 341, 341, 338, + /* 1340 */ 338, 329, 329, 335, 371, 396, 358, 194, 371, 400, + /* 1350 */ 395, 392, 403, 404, 405, 406, 407, 408, 358, 410, + /* 1360 */ 339, 358, 327, 358, 415, 358, 417, 358, 358, 358, + /* 1370 */ 421, 422, 358, 358, 358, 185, 393, 373, 339, 335, + /* 1380 */ 381, 260, 254, 439, 439, 253, 171, 180, 442, 182, + /* 1390 */ 371, 371, 438, 358, 441, 371, 262, 261, 381, 371, + /* 1400 */ 439, 366, 384, 437, 247, 436, 371, 269, 373, 266, + /* 1410 */ 264, 384, 205, 206, 458, 243, 452, 366, 20, 451, + /* 1420 */ 398, 335, 339, 336, 217, 218, 219, 220, 221, 222, + /* 1430 */ 223, 396, 402, 384, 371, 400, 327, 371, 403, 404, + /* 1440 */ 405, 406, 407, 408, 371, 410, 371, 371, 384, 371, + /* 1450 */ 415, 165, 417, 382, 339, 354, 421, 422, 339, 366, + /* 1460 */ 95, 420, 95, 371, 348, 362, 36, 358, 335, 330, + /* 1470 */ 329, 390, 352, 394, 339, 366, 385, 352, 352, 327, + /* 1480 */ 371, 385, 373, 325, 340, 0, 0, 187, 0, 0, + /* 1490 */ 42, 0, 35, 35, 199, 35, 35, 199, 0, 35, + /* 1500 */ 35, 199, 0, 199, 0, 396, 35, 0, 0, 400, + /* 1510 */ 358, 35, 403, 404, 405, 406, 407, 408, 366, 410, + /* 1520 */ 182, 22, 327, 371, 180, 373, 417, 176, 175, 0, + /* 1530 */ 421, 422, 0, 0, 0, 0, 0, 47, 0, 42, + /* 1540 */ 0, 0, 0, 0, 0, 0, 0, 0, 396, 35, + /* 1550 */ 327, 151, 400, 358, 0, 403, 404, 405, 406, 407, + /* 1560 */ 408, 366, 410, 151, 0, 0, 371, 0, 373, 417, + /* 1570 */ 42, 0, 0, 421, 422, 0, 0, 0, 0, 0, + /* 1580 */ 0, 358, 0, 0, 0, 0, 0, 0, 0, 366, + /* 1590 */ 0, 396, 0, 0, 371, 400, 373, 0, 403, 404, + /* 1600 */ 405, 406, 407, 408, 0, 410, 0, 135, 0, 35, + /* 1610 */ 0, 22, 417, 58, 0, 58, 421, 422, 0, 396, + /* 1620 */ 0, 14, 19, 400, 0, 44, 403, 404, 405, 406, + /* 1630 */ 407, 408, 409, 410, 411, 412, 33, 42, 327, 39, + /* 1640 */ 14, 47, 40, 47, 39, 47, 0, 0, 0, 171, + /* 1650 */ 39, 48, 0, 0, 0, 64, 0, 54, 55, 56, + /* 1660 */ 57, 58, 0, 35, 48, 0, 35, 48, 39, 358, + /* 1670 */ 0, 39, 35, 48, 39, 0, 35, 366, 48, 39, + /* 1680 */ 0, 327, 371, 0, 373, 0, 0, 0, 22, 44, + /* 1690 */ 35, 22, 35, 35, 35, 35, 0, 94, 327, 35, + /* 1700 */ 97, 22, 35, 104, 0, 44, 35, 396, 0, 35, + /* 1710 */ 22, 400, 358, 50, 403, 404, 405, 406, 407, 408, + /* 1720 */ 366, 410, 22, 102, 0, 371, 35, 373, 0, 358, + /* 1730 */ 35, 0, 22, 130, 20, 96, 35, 366, 35, 95, + /* 1740 */ 192, 0, 371, 0, 373, 183, 35, 22, 0, 0, + /* 1750 */ 396, 44, 327, 3, 400, 444, 445, 403, 404, 405, + /* 1760 */ 406, 407, 408, 248, 410, 252, 165, 396, 327, 96, + /* 1770 */ 167, 400, 163, 96, 403, 404, 405, 406, 407, 408, + /* 1780 */ 163, 410, 169, 358, 95, 163, 227, 184, 417, 186, + /* 1790 */ 44, 366, 95, 422, 96, 44, 371, 95, 373, 358, + /* 1800 */ 95, 168, 168, 47, 95, 47, 44, 366, 96, 455, + /* 1810 */ 456, 95, 371, 96, 373, 96, 248, 3, 44, 96, + /* 1820 */ 35, 396, 35, 35, 35, 400, 35, 35, 403, 404, + /* 1830 */ 405, 406, 407, 408, 96, 410, 0, 396, 327, 44, + /* 1840 */ 47, 400, 0, 47, 403, 404, 405, 406, 407, 408, + /* 1850 */ 0, 410, 95, 0, 327, 96, 96, 242, 95, 95, + /* 1860 */ 248, 95, 39, 95, 47, 44, 105, 229, 2, 358, + /* 1870 */ 445, 22, 166, 205, 95, 95, 227, 366, 227, 164, + /* 1880 */ 47, 95, 371, 22, 373, 358, 96, 47, 447, 95, + /* 1890 */ 363, 207, 95, 366, 96, 96, 96, 327, 371, 95, + /* 1900 */ 373, 96, 35, 35, 95, 22, 96, 396, 106, 35, + /* 1910 */ 95, 400, 96, 35, 403, 404, 405, 406, 407, 408, + /* 1920 */ 95, 410, 96, 396, 35, 95, 35, 400, 358, 95, + /* 1930 */ 403, 404, 405, 406, 407, 408, 366, 410, 119, 96, + /* 1940 */ 95, 371, 107, 373, 44, 35, 119, 119, 119, 95, + /* 1950 */ 95, 22, 64, 63, 327, 35, 35, 35, 35, 35, + /* 1960 */ 35, 35, 35, 35, 92, 35, 396, 456, 70, 35, + /* 1970 */ 400, 35, 22, 403, 404, 405, 406, 407, 408, 44, + /* 1980 */ 410, 35, 412, 35, 35, 358, 35, 70, 35, 35, + /* 1990 */ 363, 35, 35, 366, 35, 22, 35, 0, 371, 35, + /* 2000 */ 373, 39, 0, 35, 39, 327, 48, 0, 48, 35, + /* 2010 */ 39, 48, 0, 35, 48, 39, 0, 35, 35, 0, + /* 2020 */ 22, 21, 21, 396, 20, 22, 327, 400, 22, 459, + /* 2030 */ 403, 404, 405, 406, 407, 408, 358, 410, 459, 459, + /* 2040 */ 459, 363, 459, 459, 366, 459, 459, 459, 327, 371, + /* 2050 */ 459, 373, 459, 459, 459, 459, 459, 358, 459, 459, + /* 2060 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, + /* 2070 */ 371, 459, 373, 459, 396, 459, 459, 459, 400, 358, + /* 2080 */ 459, 403, 404, 405, 406, 407, 408, 366, 410, 459, + /* 2090 */ 459, 459, 371, 459, 373, 396, 459, 459, 459, 400, + /* 2100 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, + /* 2110 */ 459, 327, 459, 459, 459, 459, 459, 396, 459, 459, + /* 2120 */ 459, 400, 459, 459, 403, 404, 405, 406, 407, 408, + /* 2130 */ 459, 410, 459, 459, 459, 327, 459, 459, 459, 459, + /* 2140 */ 459, 459, 358, 459, 459, 459, 459, 459, 459, 459, + /* 2150 */ 366, 459, 459, 459, 459, 371, 459, 373, 459, 459, + /* 2160 */ 459, 459, 459, 459, 459, 459, 358, 459, 459, 459, + /* 2170 */ 459, 459, 459, 459, 366, 459, 459, 459, 459, 371, + /* 2180 */ 396, 373, 459, 459, 400, 459, 459, 403, 404, 405, + /* 2190 */ 406, 407, 408, 459, 410, 459, 459, 327, 459, 459, + /* 2200 */ 459, 459, 459, 459, 396, 459, 459, 459, 400, 459, + /* 2210 */ 459, 403, 404, 405, 406, 407, 408, 459, 410, 459, + /* 2220 */ 459, 327, 459, 459, 459, 459, 459, 459, 358, 459, + /* 2230 */ 459, 459, 459, 459, 459, 459, 366, 459, 459, 459, + /* 2240 */ 459, 371, 459, 373, 459, 459, 459, 459, 459, 459, + /* 2250 */ 459, 459, 358, 459, 459, 459, 459, 459, 459, 459, + /* 2260 */ 366, 459, 459, 459, 327, 371, 396, 373, 459, 459, + /* 2270 */ 400, 459, 459, 403, 404, 405, 406, 407, 408, 459, + /* 2280 */ 410, 459, 327, 459, 459, 459, 459, 459, 459, 459, + /* 2290 */ 396, 459, 459, 459, 400, 358, 459, 403, 404, 405, + /* 2300 */ 406, 407, 408, 366, 410, 459, 459, 459, 371, 459, + /* 2310 */ 373, 459, 459, 358, 459, 459, 459, 459, 459, 459, + /* 2320 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, + /* 2330 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, + /* 2340 */ 403, 404, 405, 406, 407, 408, 459, 410, 459, 459, + /* 2350 */ 459, 396, 459, 459, 327, 400, 459, 459, 403, 404, + /* 2360 */ 405, 406, 407, 408, 459, 410, 459, 459, 459, 459, + /* 2370 */ 459, 459, 327, 459, 459, 459, 459, 459, 459, 459, + /* 2380 */ 459, 459, 459, 459, 459, 358, 459, 459, 459, 459, + /* 2390 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, + /* 2400 */ 373, 459, 459, 358, 459, 459, 459, 459, 459, 459, + /* 2410 */ 459, 366, 459, 459, 459, 327, 371, 459, 373, 459, + /* 2420 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, + /* 2430 */ 403, 404, 405, 406, 407, 408, 459, 410, 459, 327, + /* 2440 */ 459, 396, 459, 459, 459, 400, 358, 459, 403, 404, + /* 2450 */ 405, 406, 407, 408, 366, 410, 459, 459, 459, 371, + /* 2460 */ 459, 373, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2470 */ 358, 459, 459, 459, 459, 459, 459, 459, 366, 459, + /* 2480 */ 459, 459, 459, 371, 396, 373, 459, 459, 400, 459, + /* 2490 */ 459, 403, 404, 405, 406, 407, 408, 459, 410, 459, + /* 2500 */ 459, 459, 327, 459, 459, 459, 459, 459, 396, 459, + /* 2510 */ 459, 459, 400, 459, 459, 403, 404, 405, 406, 407, + /* 2520 */ 408, 459, 410, 459, 459, 459, 459, 459, 459, 459, + /* 2530 */ 459, 459, 459, 358, 459, 459, 459, 459, 459, 459, + /* 2540 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, + /* 2550 */ 459, 459, 459, 459, 459, 459, 327, 459, 459, 459, + /* 2560 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2570 */ 459, 396, 459, 459, 459, 400, 459, 459, 403, 404, + /* 2580 */ 405, 406, 407, 408, 459, 410, 459, 358, 459, 459, + /* 2590 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, + /* 2600 */ 371, 459, 373, 459, 459, 459, 459, 459, 459, 459, + /* 2610 */ 327, 459, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2620 */ 459, 459, 459, 459, 459, 396, 327, 459, 459, 400, + /* 2630 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, + /* 2640 */ 459, 358, 459, 459, 459, 459, 459, 459, 459, 366, + /* 2650 */ 459, 459, 459, 459, 371, 459, 373, 358, 459, 459, + /* 2660 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 327, + /* 2670 */ 371, 459, 373, 459, 459, 459, 459, 459, 459, 396, + /* 2680 */ 459, 459, 459, 400, 459, 459, 403, 404, 405, 406, + /* 2690 */ 407, 408, 459, 410, 459, 396, 459, 459, 459, 400, + /* 2700 */ 358, 459, 403, 404, 405, 406, 407, 408, 366, 410, + /* 2710 */ 459, 459, 459, 371, 459, 373, 459, 459, 459, 459, + /* 2720 */ 459, 459, 459, 459, 459, 459, 327, 459, 459, 459, + /* 2730 */ 459, 459, 459, 459, 459, 459, 459, 459, 396, 459, + /* 2740 */ 459, 459, 400, 327, 459, 403, 404, 405, 406, 407, + /* 2750 */ 408, 459, 410, 459, 459, 459, 459, 358, 459, 459, + /* 2760 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 327, + /* 2770 */ 371, 459, 373, 459, 358, 459, 459, 459, 459, 459, + /* 2780 */ 459, 459, 366, 459, 459, 459, 459, 371, 459, 373, + /* 2790 */ 459, 459, 459, 459, 459, 396, 459, 459, 459, 400, + /* 2800 */ 358, 459, 403, 404, 405, 406, 407, 408, 366, 410, + /* 2810 */ 459, 459, 396, 371, 459, 373, 400, 459, 459, 403, + /* 2820 */ 404, 405, 406, 407, 408, 459, 410, 459, 459, 459, + /* 2830 */ 327, 459, 459, 459, 459, 459, 459, 459, 396, 459, + /* 2840 */ 459, 459, 400, 459, 459, 403, 404, 405, 406, 407, + /* 2850 */ 408, 459, 410, 459, 459, 459, 459, 459, 459, 459, + /* 2860 */ 459, 358, 459, 459, 459, 459, 459, 459, 459, 366, + /* 2870 */ 459, 459, 459, 459, 371, 459, 373, 459, 459, 459, + /* 2880 */ 459, 459, 459, 459, 327, 459, 459, 459, 459, 459, + /* 2890 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 396, + /* 2900 */ 459, 459, 459, 400, 459, 459, 403, 404, 405, 406, + /* 2910 */ 407, 408, 459, 410, 459, 358, 459, 459, 459, 459, + /* 2920 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, + /* 2930 */ 373, 459, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2940 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + /* 2950 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, + /* 2960 */ 403, 404, 405, 406, 407, 408, 459, 410, }; -#define YY_SHIFT_COUNT (709) +#define YY_SHIFT_COUNT (713) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2252) +#define YY_SHIFT_MAX (2019) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, - /* 10 */ 268, 268, 268, 402, 536, 536, 670, 536, 536, 536, - /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - /* 40 */ 536, 536, 536, 536, 536, 536, 55, 180, 65, 195, - /* 50 */ 26, 284, 330, 284, 65, 65, 947, 947, 284, 947, - /* 60 */ 947, 182, 284, 39, 39, 128, 128, 111, 272, 42, - /* 70 */ 42, 39, 39, 39, 39, 39, 39, 39, 39, 39, - /* 80 */ 39, 31, 39, 39, 105, 39, 137, 39, 39, 188, - /* 90 */ 39, 39, 188, 39, 188, 188, 188, 39, 140, 762, - /* 100 */ 949, 949, 438, 1131, 1056, 1056, 1056, 1056, 1056, 1056, - /* 110 */ 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, - /* 120 */ 1056, 1056, 1056, 965, 228, 111, 272, 659, 532, 269, - /* 130 */ 269, 269, 800, 370, 370, 532, 224, 224, 224, 213, - /* 140 */ 137, 33, 188, 351, 188, 351, 351, 213, 389, 909, - /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 36, 793, 851, - /* 160 */ 975, 572, 115, 83, 72, 84, 517, 850, 1034, 986, - /* 170 */ 959, 843, 634, 865, 843, 1099, 857, 486, 1066, 1285, - /* 180 */ 1160, 1302, 1327, 1302, 1190, 1353, 1353, 1302, 1190, 1190, - /* 190 */ 1290, 1353, 1353, 1353, 1371, 1371, 1387, 31, 137, 31, - /* 200 */ 1392, 1407, 31, 1392, 31, 31, 31, 1353, 31, 1382, - /* 210 */ 1382, 1371, 188, 188, 188, 188, 188, 188, 188, 188, - /* 220 */ 188, 188, 188, 1353, 1371, 351, 351, 1250, 1387, 140, - /* 230 */ 1315, 137, 140, 1353, 1327, 1327, 351, 1262, 1268, 351, - /* 240 */ 1262, 1268, 351, 351, 188, 1283, 1374, 1262, 1282, 1297, - /* 250 */ 1300, 1066, 1298, 1310, 1313, 1329, 224, 1575, 1353, 1392, - /* 260 */ 140, 1268, 351, 351, 351, 351, 351, 1268, 351, 1453, - /* 270 */ 140, 213, 140, 224, 1533, 1536, 351, 389, 1353, 140, - /* 280 */ 1627, 1371, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, - /* 290 */ 2410, 858, 1027, 23, 1389, 52, 663, 449, 155, 672, - /* 300 */ 1289, 1555, 423, 756, 756, 756, 756, 756, 756, 756, - /* 310 */ 756, 756, 339, 190, 243, 243, 390, 378, 315, 523, - /* 320 */ 470, 518, 518, 696, 999, 168, 696, 696, 696, 884, - /* 330 */ 1076, 385, 1102, 1007, 1089, 956, 1073, 1106, 1107, 16, - /* 340 */ 1196, 1197, 1166, 1105, 1128, 1093, 1071, 972, 1051, 1135, - /* 350 */ 1169, 1173, 1178, 1199, 1232, 1215, 1085, 1110, 573, 1217, - /* 360 */ 1181, 1264, 1265, 1267, 1272, 1288, 1292, 1134, 1234, 1305, - /* 370 */ 1210, 1323, 1687, 1691, 1505, 1694, 1695, 1654, 1697, 1663, - /* 380 */ 1499, 1665, 1666, 1668, 1504, 1705, 1673, 1682, 1518, 1721, - /* 390 */ 1524, 1725, 1692, 1726, 1706, 1729, 1698, 1547, 1551, 1734, - /* 400 */ 1737, 1562, 1564, 1741, 1742, 1699, 1744, 1747, 1748, 1708, - /* 410 */ 1751, 1758, 1760, 1762, 1763, 1764, 1766, 1767, 1624, 1743, - /* 420 */ 1779, 1628, 1783, 1784, 1785, 1788, 1790, 1791, 1792, 1793, - /* 430 */ 1794, 1795, 1798, 1799, 1800, 1804, 1805, 1765, 1806, 1808, - /* 440 */ 1809, 1810, 1811, 1796, 1813, 1814, 1815, 1693, 1827, 1828, - /* 450 */ 1801, 1831, 1775, 1835, 1780, 1837, 1839, 1802, 1807, 1797, - /* 460 */ 1803, 1826, 1821, 1829, 1823, 1845, 1812, 1818, 1848, 1851, - /* 470 */ 1853, 1819, 1688, 1854, 1861, 1871, 1824, 1874, 1875, 1842, - /* 480 */ 1830, 1846, 1889, 1855, 1843, 1857, 1892, 1858, 1849, 1859, - /* 490 */ 1894, 1864, 1860, 1862, 1903, 1905, 1906, 1907, 1816, 1817, - /* 500 */ 1876, 1887, 1910, 1878, 1879, 1893, 1881, 1883, 1882, 1884, - /* 510 */ 1888, 1895, 1900, 1896, 1927, 1916, 1940, 1921, 1897, 1944, - /* 520 */ 1923, 1913, 1957, 1924, 1958, 1925, 1961, 1942, 1945, 1931, - /* 530 */ 1934, 1778, 1865, 1877, 1974, 1822, 1941, 1975, 1825, 1955, - /* 540 */ 1832, 1833, 1978, 1979, 1844, 1856, 1980, 1937, 1733, 1898, - /* 550 */ 1891, 1899, 1915, 1946, 1919, 1929, 1935, 1936, 1930, 1947, - /* 560 */ 1982, 1986, 1938, 1948, 1740, 1952, 1954, 2034, 1994, 1834, - /* 570 */ 2004, 2006, 2007, 2017, 2019, 2020, 1959, 1962, 2011, 1841, - /* 580 */ 2024, 2022, 2070, 2071, 2072, 1977, 1983, 1985, 1981, 1989, - /* 590 */ 1908, 1990, 2076, 2048, 1926, 1992, 1984, 1803, 2042, 2049, - /* 600 */ 1867, 1866, 1869, 2090, 2077, 1901, 2002, 2003, 2005, 2008, - /* 610 */ 2010, 2013, 2055, 2023, 2025, 2056, 2026, 2098, 1918, 2031, - /* 620 */ 2021, 2032, 2095, 2096, 2036, 2037, 2100, 2040, 2044, 2102, - /* 630 */ 2043, 2045, 2108, 2050, 2047, 2113, 2053, 2030, 2033, 2046, - /* 640 */ 2058, 2130, 2052, 2066, 2120, 2069, 2133, 2073, 2120, 2120, - /* 650 */ 2157, 2116, 2118, 2147, 2148, 2150, 2151, 2152, 2155, 2158, - /* 660 */ 2159, 2160, 2161, 2122, 2104, 2154, 2164, 2165, 2179, 2167, - /* 670 */ 2181, 2169, 2171, 2172, 2138, 1882, 2174, 1884, 2175, 2176, - /* 680 */ 2177, 2178, 2193, 2182, 2216, 2185, 2183, 2190, 2230, 2198, - /* 690 */ 2187, 2199, 2237, 2204, 2192, 2202, 2242, 2208, 2197, 2207, - /* 700 */ 2247, 2213, 2215, 2252, 2231, 2233, 2234, 2238, 2241, 2235, + /* 0 */ 925, 0, 71, 0, 288, 288, 288, 288, 288, 288, + /* 10 */ 288, 288, 288, 288, 288, 359, 574, 574, 645, 574, + /* 20 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, + /* 30 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, + /* 40 */ 574, 574, 574, 574, 574, 574, 574, 574, 292, 437, + /* 50 */ 12, 294, 287, 151, 315, 151, 12, 12, 1207, 1207, + /* 60 */ 151, 1207, 1207, 78, 151, 19, 19, 198, 198, 66, + /* 70 */ 211, 98, 98, 19, 19, 19, 19, 19, 19, 19, + /* 80 */ 19, 19, 19, 112, 19, 19, 108, 19, 522, 19, + /* 90 */ 19, 536, 19, 19, 536, 19, 536, 536, 536, 19, + /* 100 */ 676, 783, 34, 34, 372, 103, 418, 418, 418, 418, + /* 110 */ 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, + /* 120 */ 418, 418, 418, 418, 418, 213, 295, 66, 211, 62, + /* 130 */ 651, 1, 1, 1, 546, 79, 79, 651, 681, 681, + /* 140 */ 681, 606, 522, 129, 536, 706, 536, 706, 706, 606, + /* 150 */ 749, 216, 216, 216, 216, 216, 216, 216, 1603, 335, + /* 160 */ 36, 451, 867, 47, 410, 267, 46, 505, 227, 452, + /* 170 */ 792, 652, 639, 644, 596, 627, 644, 780, 892, 829, + /* 180 */ 1023, 1231, 1102, 1239, 1265, 1239, 1127, 1270, 1270, 1239, + /* 190 */ 1127, 1127, 1211, 1270, 1270, 1270, 1293, 1293, 1294, 112, + /* 200 */ 522, 112, 1306, 1309, 112, 1306, 112, 112, 112, 1270, + /* 210 */ 112, 1284, 1284, 1293, 536, 536, 536, 536, 536, 536, + /* 220 */ 536, 536, 536, 536, 536, 1270, 1293, 706, 706, 1153, + /* 230 */ 1294, 676, 1190, 522, 676, 1270, 1265, 1265, 706, 1128, + /* 240 */ 1132, 706, 1128, 1132, 706, 706, 536, 1121, 1215, 1128, + /* 250 */ 1134, 1136, 1157, 1023, 1138, 1143, 1146, 1172, 681, 1398, + /* 260 */ 1270, 1306, 676, 1132, 706, 706, 706, 706, 706, 1132, + /* 270 */ 706, 1286, 676, 606, 676, 681, 1365, 1367, 706, 749, + /* 280 */ 1270, 676, 1430, 1293, 2968, 2968, 2968, 2968, 2968, 2968, + /* 290 */ 2968, 2968, 2968, 826, 380, 455, 656, 514, 15, 967, + /* 300 */ 642, 59, 832, 938, 842, 1164, 1164, 1164, 1164, 1164, + /* 310 */ 1164, 1164, 1164, 1164, 963, 68, 184, 184, 365, 291, + /* 320 */ 181, 640, 226, 325, 325, 597, 669, 364, 597, 597, + /* 330 */ 597, 788, 1025, 980, 876, 833, 843, 786, 856, 857, + /* 340 */ 865, 1111, 1162, 1165, 289, 984, 985, 943, 951, 900, + /* 350 */ 851, 1070, 1131, 1159, 1160, 1161, 1130, 1166, 886, 1026, + /* 360 */ 290, 1167, 1151, 1171, 1174, 1177, 1179, 1182, 1186, 905, + /* 370 */ 1212, 1224, 1204, 766, 1485, 1486, 1300, 1488, 1489, 1448, + /* 380 */ 1491, 1457, 1295, 1458, 1460, 1461, 1298, 1498, 1464, 1465, + /* 390 */ 1302, 1502, 1304, 1504, 1471, 1507, 1499, 1508, 1476, 1338, + /* 400 */ 1344, 1532, 1533, 1351, 1353, 1529, 1534, 1490, 1535, 1536, + /* 410 */ 1538, 1497, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, + /* 420 */ 1400, 1514, 1554, 1412, 1564, 1565, 1567, 1575, 1576, 1577, + /* 430 */ 1578, 1579, 1580, 1582, 1583, 1584, 1585, 1586, 1587, 1528, + /* 440 */ 1571, 1572, 1588, 1590, 1592, 1589, 1593, 1597, 1604, 1472, + /* 450 */ 1606, 1608, 1574, 1610, 1555, 1614, 1557, 1618, 1620, 1595, + /* 460 */ 1600, 1581, 1594, 1607, 1596, 1626, 1598, 1624, 1602, 1605, + /* 470 */ 1646, 1647, 1648, 1611, 1478, 1652, 1653, 1654, 1591, 1656, + /* 480 */ 1662, 1628, 1616, 1629, 1665, 1631, 1619, 1632, 1670, 1637, + /* 490 */ 1625, 1635, 1675, 1641, 1630, 1640, 1680, 1683, 1685, 1686, + /* 500 */ 1599, 1621, 1655, 1666, 1687, 1657, 1658, 1659, 1660, 1645, + /* 510 */ 1661, 1664, 1667, 1669, 1671, 1696, 1679, 1704, 1688, 1663, + /* 520 */ 1708, 1700, 1674, 1724, 1691, 1728, 1695, 1731, 1710, 1714, + /* 530 */ 1701, 1703, 1548, 1639, 1644, 1741, 1609, 1711, 1743, 1562, + /* 540 */ 1725, 1617, 1601, 1748, 1749, 1622, 1613, 1750, 1707, 1515, + /* 550 */ 1689, 1673, 1697, 1633, 1559, 1634, 1513, 1677, 1746, 1698, + /* 560 */ 1702, 1705, 1709, 1712, 1751, 1756, 1758, 1716, 1762, 1568, + /* 570 */ 1717, 1719, 1814, 1774, 1612, 1785, 1787, 1788, 1789, 1791, + /* 580 */ 1792, 1723, 1738, 1793, 1615, 1795, 1796, 1836, 1842, 1850, + /* 590 */ 1757, 1759, 1760, 1763, 1764, 1706, 1766, 1853, 1823, 1715, + /* 600 */ 1768, 1761, 1594, 1817, 1821, 1649, 1638, 1651, 1866, 1849, + /* 610 */ 1668, 1779, 1790, 1780, 1798, 1786, 1799, 1833, 1794, 1797, + /* 620 */ 1840, 1800, 1861, 1684, 1804, 1802, 1805, 1867, 1868, 1809, + /* 630 */ 1810, 1874, 1815, 1816, 1878, 1825, 1826, 1889, 1830, 1843, + /* 640 */ 1891, 1834, 1819, 1827, 1828, 1829, 1883, 1835, 1845, 1900, + /* 650 */ 1854, 1910, 1855, 1900, 1900, 1929, 1888, 1890, 1920, 1921, + /* 660 */ 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1930, 1898, 1872, + /* 670 */ 1935, 1934, 1936, 1946, 1950, 1948, 1949, 1951, 1917, 1645, + /* 680 */ 1953, 1661, 1954, 1956, 1957, 1959, 1973, 1961, 1997, 1964, + /* 690 */ 1958, 1962, 2002, 1968, 1960, 1965, 2007, 1974, 1963, 1971, + /* 700 */ 2012, 1978, 1966, 1976, 2016, 1982, 1983, 2019, 1998, 2000, + /* 710 */ 2003, 2006, 2001, 2004, }; -#define YY_REDUCE_COUNT (290) -#define YY_REDUCE_MIN (-422) -#define YY_REDUCE_MAX (2001) +#define YY_REDUCE_COUNT (292) +#define YY_REDUCE_MIN (-381) +#define YY_REDUCE_MAX (2557) static const short yy_reduce_ofst[] = { - /* 0 */ -186, -325, -226, -166, -32, 236, 642, -92, 176, 852, - /* 10 */ 880, 923, 951, 994, 333, 1012, 1055, 1108, 1129, 1183, - /* 20 */ 1237, 40, 1254, 1308, 442, 1280, 1351, 1367, 1418, 1461, - /* 30 */ 1478, 1531, 1548, 1599, 1616, 1642, 1659, 1710, 1753, 1769, - /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, 350, 240, -340, - /* 50 */ 666, 1098, 1109, 1350, 776, 1189, 1070, 1083, -422, -326, - /* 60 */ -269, -410, -287, -206, -163, -328, -321, -350, -352, -26, - /* 70 */ 122, -307, -28, 163, 166, 174, 229, 239, 361, 362, - /* 80 */ 452, 46, 508, 621, -251, 639, 48, 706, 741, 177, - /* 90 */ 757, 786, 146, 847, 178, 152, 287, 509, -108, -299, - /* 100 */ -221, -221, -338, -207, -27, 172, 194, 322, 332, 375, - /* 110 */ 405, 462, 465, 466, 469, 480, 483, 529, 550, 627, - /* 120 */ 628, 630, 641, -33, -303, 275, -101, 271, -48, -303, - /* 130 */ 383, 474, 356, 302, 306, 25, -222, 64, 409, 380, - /* 140 */ 624, 562, 368, 609, 686, 638, 683, 689, 493, 143, - /* 150 */ 157, 203, 233, 241, 366, 429, 14, 556, 481, 317, - /* 160 */ 522, 565, 702, 633, 775, 775, 812, 772, 903, 905, - /* 170 */ 873, 860, 860, 842, 860, 885, 878, 775, 934, 939, - /* 180 */ 954, 970, 969, 984, 993, 1041, 1042, 1001, 1004, 1005, - /* 190 */ 1045, 1049, 1054, 1057, 1067, 1078, 1018, 1082, 1052, 1086, - /* 200 */ 1095, 1046, 1091, 1097, 1096, 1101, 1104, 1103, 1111, 1112, - /* 210 */ 1115, 1117, 1090, 1118, 1120, 1130, 1132, 1133, 1136, 1139, - /* 220 */ 1140, 1141, 1143, 1122, 1144, 1069, 1121, 1080, 1113, 1125, - /* 230 */ 1127, 1147, 1168, 1170, 1142, 1145, 1138, 1146, 1137, 1157, - /* 240 */ 1153, 1156, 1159, 1172, 775, 1119, 1126, 1155, 1158, 1123, - /* 250 */ 1148, 1176, 1124, 1149, 1151, 860, 1214, 1202, 1263, 1269, - /* 260 */ 1260, 1222, 1238, 1240, 1242, 1251, 1252, 1244, 1253, 1247, - /* 270 */ 1287, 1276, 1293, 1270, 1228, 1294, 1278, 1304, 1320, 1324, - /* 280 */ 1337, 1339, 1279, 1281, 1306, 1307, 1318, 1321, 1325, 1332, - /* 290 */ 1357, + /* 0 */ -318, -250, 233, 324, 630, 650, 742, 785, 828, 895, + /* 10 */ 949, 1035, 1109, 1152, 1195, 1223, 1311, 1354, 1371, 1425, + /* 20 */ 1441, 1511, 1527, 1570, 1627, 1678, 1699, 1721, 1784, 1808, + /* 30 */ 1870, 1894, 1937, 1955, 2027, 2045, 2088, 2112, 2175, 2229, + /* 40 */ 2283, 2299, 2342, 2399, 2416, 2442, 2503, 2557, -191, 104, + /* 50 */ -18, -7, 168, 239, 269, 558, -278, 658, -345, -320, + /* 60 */ -270, -273, -170, -79, -10, 296, 328, -331, -326, -342, + /* 70 */ -328, -236, -193, 253, 254, 376, 398, 408, 409, 469, + /* 80 */ 643, 678, 682, -330, 683, 729, 185, 768, 41, 770, + /* 90 */ 775, -349, 795, 804, -280, 805, -245, 260, -113, 847, + /* 100 */ 16, -283, 130, 130, -309, -202, 163, 337, 389, 392, + /* 110 */ 434, 481, 501, 502, 503, 633, 634, 670, 671, 672, + /* 120 */ 695, 747, 750, 789, 841, -281, 87, 10, 220, 84, + /* 130 */ 283, 87, 245, 251, 344, -225, -38, 355, -313, 319, + /* 140 */ 360, 397, 45, 297, 196, 384, -110, 441, 443, 466, + /* 150 */ 475, -355, 519, 615, 720, 727, 737, 745, -381, 637, + /* 160 */ 759, 726, 665, 663, 846, 757, 883, 883, 872, 863, + /* 170 */ 880, 878, 870, 821, 821, 808, 821, 831, 830, 883, + /* 180 */ 873, 875, 894, 906, 907, 908, 913, 957, 958, 916, + /* 190 */ 920, 921, 965, 971, 974, 976, 989, 990, 928, 982, + /* 200 */ 952, 986, 992, 942, 991, 995, 993, 994, 996, 998, + /* 210 */ 997, 1001, 1002, 1012, 988, 1000, 1003, 1005, 1007, 1009, + /* 220 */ 1010, 1011, 1014, 1015, 1016, 1008, 1013, 973, 977, 955, + /* 230 */ 983, 1021, 959, 1004, 1039, 1044, 999, 1017, 1019, 944, + /* 240 */ 1018, 1020, 945, 1027, 1024, 1028, 883, 946, 953, 961, + /* 250 */ 954, 966, 969, 1022, 956, 964, 968, 821, 1051, 1030, + /* 260 */ 1086, 1087, 1083, 1049, 1063, 1066, 1073, 1075, 1076, 1064, + /* 270 */ 1078, 1071, 1115, 1101, 1119, 1093, 1041, 1103, 1092, 1116, + /* 280 */ 1133, 1135, 1139, 1141, 1081, 1079, 1091, 1096, 1120, 1125, + /* 290 */ 1126, 1144, 1158, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 10 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 20 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 30 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 40 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 50 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 60 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1849, 1592, 1592, - /* 70 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 80 */ 1592, 1670, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 90 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1668, 1842, - /* 100 */ 2039, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 110 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 120 */ 1592, 1592, 1592, 1592, 2051, 1592, 1592, 1670, 1592, 2051, - /* 130 */ 2051, 2051, 1668, 2011, 2011, 1592, 1592, 1592, 1592, 1779, - /* 140 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1779, 1592, 1592, - /* 150 */ 1592, 1592, 1592, 1592, 1592, 1592, 1886, 1592, 1592, 2076, - /* 160 */ 2129, 1592, 1592, 2079, 1592, 1592, 1592, 1854, 1592, 1732, - /* 170 */ 2066, 2043, 2057, 2113, 2044, 2041, 2060, 1592, 2070, 1592, - /* 180 */ 1879, 1847, 1592, 1847, 1844, 1592, 1592, 1847, 1844, 1844, - /* 190 */ 1723, 1592, 1592, 1592, 1592, 1592, 1592, 1670, 1592, 1670, - /* 200 */ 1592, 1592, 1670, 1592, 1670, 1670, 1670, 1592, 1670, 1649, - /* 210 */ 1649, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 220 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1899, 1592, 1668, - /* 230 */ 1888, 1592, 1668, 1592, 1592, 1592, 1592, 2086, 2084, 1592, - /* 240 */ 2086, 2084, 1592, 1592, 1592, 2098, 2094, 2086, 2102, 2100, - /* 250 */ 2072, 2070, 2132, 2119, 2115, 2057, 1592, 1592, 1592, 1592, - /* 260 */ 1668, 2084, 1592, 1592, 1592, 1592, 1592, 2084, 1592, 1592, - /* 270 */ 1668, 1592, 1668, 1592, 1592, 1748, 1592, 1592, 1592, 1668, - /* 280 */ 1624, 1592, 1881, 1892, 1864, 1864, 1782, 1782, 1782, 1671, - /* 290 */ 1597, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 300 */ 1592, 1592, 1592, 2097, 2096, 1967, 1592, 2015, 2014, 2013, - /* 310 */ 2004, 1966, 1744, 1592, 1965, 1964, 1592, 1592, 1592, 1592, - /* 320 */ 1592, 1860, 1859, 1958, 1592, 1592, 1959, 1957, 1956, 1592, - /* 330 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 340 */ 1592, 1592, 1592, 1592, 1592, 1592, 2116, 2120, 1592, 1592, - /* 350 */ 1592, 1592, 1592, 1592, 2040, 1592, 1592, 1592, 1592, 1592, - /* 360 */ 1941, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 370 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 380 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 390 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 400 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 410 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 420 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 430 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 440 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 450 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1629, - /* 460 */ 1946, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 470 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 480 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 490 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 500 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1710, 1709, - /* 510 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 520 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 530 */ 1592, 1592, 1949, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 540 */ 1592, 1592, 1592, 1592, 1592, 1592, 2112, 2073, 1592, 1592, - /* 550 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 560 */ 1592, 1941, 1592, 2095, 1592, 1592, 2110, 1592, 2114, 1592, - /* 570 */ 1592, 1592, 1592, 1592, 1592, 1592, 2050, 2046, 1592, 1592, - /* 580 */ 2042, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 590 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1940, 1592, 2001, - /* 600 */ 1592, 1592, 1592, 2035, 1592, 1592, 1986, 1592, 1592, 1592, - /* 610 */ 1592, 1592, 1592, 1592, 1592, 1592, 1949, 1592, 1952, 1592, - /* 620 */ 1592, 1592, 1592, 1592, 1776, 1592, 1592, 1592, 1592, 1592, - /* 630 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1761, 1759, 1758, - /* 640 */ 1757, 1592, 1754, 1592, 1789, 1592, 1592, 1592, 1785, 1784, - /* 650 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 660 */ 1592, 1592, 1592, 1592, 1592, 1690, 1592, 1592, 1592, 1592, - /* 670 */ 1592, 1592, 1592, 1592, 1592, 1681, 1592, 1680, 1592, 1592, - /* 680 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 690 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, - /* 700 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 0 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 10 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 20 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 30 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 40 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 50 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 60 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1849, + /* 70 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 80 */ 1594, 1594, 1594, 1672, 1594, 1594, 1594, 1594, 1594, 1594, + /* 90 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 100 */ 1670, 1842, 2039, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 110 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 120 */ 1594, 1594, 1594, 1594, 1594, 1594, 2051, 1594, 1594, 1672, + /* 130 */ 1594, 2051, 2051, 2051, 1670, 2011, 2011, 1594, 1594, 1594, + /* 140 */ 1594, 1779, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1779, + /* 150 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1886, 1594, + /* 160 */ 1594, 2076, 2130, 1594, 1594, 2079, 1594, 1594, 1594, 1854, + /* 170 */ 1594, 1732, 2066, 2043, 2057, 2114, 2044, 2041, 2060, 1594, + /* 180 */ 2070, 1594, 1879, 1847, 1594, 1847, 1844, 1594, 1594, 1847, + /* 190 */ 1844, 1844, 1723, 1594, 1594, 1594, 1594, 1594, 1594, 1672, + /* 200 */ 1594, 1672, 1594, 1594, 1672, 1594, 1672, 1672, 1672, 1594, + /* 210 */ 1672, 1651, 1651, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 220 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1899, + /* 230 */ 1594, 1670, 1888, 1594, 1670, 1594, 1594, 1594, 1594, 2087, + /* 240 */ 2085, 1594, 2087, 2085, 1594, 1594, 1594, 2099, 2095, 2087, + /* 250 */ 2103, 2101, 2072, 2070, 2133, 2120, 2116, 2057, 1594, 1594, + /* 260 */ 1594, 1594, 1670, 2085, 1594, 1594, 1594, 1594, 1594, 2085, + /* 270 */ 1594, 1594, 1670, 1594, 1670, 1594, 1594, 1748, 1594, 1594, + /* 280 */ 1594, 1670, 1626, 1594, 1881, 1892, 1864, 1864, 1782, 1782, + /* 290 */ 1782, 1673, 1599, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 300 */ 1594, 1594, 1594, 1594, 1594, 2098, 2097, 1967, 1594, 2015, + /* 310 */ 2014, 2013, 2004, 1966, 1744, 1594, 1965, 1964, 1594, 1594, + /* 320 */ 1594, 1594, 1594, 1860, 1859, 1958, 1594, 1594, 1959, 1957, + /* 330 */ 1956, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 340 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 2117, 2121, + /* 350 */ 1594, 1594, 1594, 1594, 1594, 1594, 2040, 1594, 1594, 1594, + /* 360 */ 1594, 1594, 1941, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 370 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 380 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 390 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 400 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 410 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 420 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 430 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 440 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 450 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 460 */ 1594, 1631, 1946, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 470 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 480 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 490 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 500 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1711, + /* 510 */ 1710, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 520 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 530 */ 1594, 1594, 1594, 1949, 1594, 1594, 1594, 1594, 1594, 1594, + /* 540 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 2113, 2073, 1594, + /* 550 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 560 */ 1594, 1594, 1594, 1594, 1594, 1594, 1941, 1594, 2096, 1594, + /* 570 */ 1594, 2111, 1594, 2115, 1594, 1594, 1594, 1594, 1594, 1594, + /* 580 */ 1594, 2050, 2046, 1594, 1594, 2042, 1594, 1594, 1594, 1594, + /* 590 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 600 */ 1594, 1594, 1940, 1594, 2001, 1594, 1594, 1594, 2035, 1594, + /* 610 */ 1594, 1986, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 620 */ 1594, 1949, 1594, 1952, 1594, 1594, 1594, 1594, 1594, 1776, + /* 630 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 640 */ 1594, 1594, 1761, 1759, 1758, 1757, 1594, 1754, 1594, 1789, + /* 650 */ 1594, 1594, 1594, 1785, 1784, 1594, 1594, 1594, 1594, 1594, + /* 660 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 670 */ 1691, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1683, + /* 680 */ 1594, 1682, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 690 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 700 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 710 */ 1594, 1594, 1594, 1594, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1002,7 +1098,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* TSDB_PAGESIZE => nothing */ 0, /* PRECISION => nothing */ 0, /* REPLICA => nothing */ - 0, /* STRICT => nothing */ 0, /* VGROUPS => nothing */ 0, /* SINGLE_STABLE => nothing */ 0, /* RETENTIONS => nothing */ @@ -1151,7 +1246,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 269, /* END => ABORT */ + 270, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1175,6 +1270,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* BY => nothing */ 0, /* SESSION => nothing */ 0, /* STATE_WINDOW => nothing */ + 0, /* EVENT_WINDOW => nothing */ + 0, /* START => nothing */ 0, /* SLIDING => nothing */ 0, /* FILL => nothing */ 0, /* VALUE => nothing */ @@ -1193,58 +1290,59 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 269, /* AFTER => ABORT */ - 269, /* ATTACH => ABORT */ - 269, /* BEFORE => ABORT */ - 269, /* BEGIN => ABORT */ - 269, /* BITAND => ABORT */ - 269, /* BITNOT => ABORT */ - 269, /* BITOR => ABORT */ - 269, /* BLOCKS => ABORT */ - 269, /* CHANGE => ABORT */ - 269, /* COMMA => ABORT */ - 269, /* COMPACT => ABORT */ - 269, /* CONCAT => ABORT */ - 269, /* CONFLICT => ABORT */ - 269, /* COPY => ABORT */ - 269, /* DEFERRED => ABORT */ - 269, /* DELIMITERS => ABORT */ - 269, /* DETACH => ABORT */ - 269, /* DIVIDE => ABORT */ - 269, /* DOT => ABORT */ - 269, /* EACH => ABORT */ - 269, /* FAIL => ABORT */ - 269, /* FILE => ABORT */ - 269, /* FOR => ABORT */ - 269, /* GLOB => ABORT */ - 269, /* ID => ABORT */ - 269, /* IMMEDIATE => ABORT */ - 269, /* IMPORT => ABORT */ - 269, /* INITIALLY => ABORT */ - 269, /* INSTEAD => ABORT */ - 269, /* ISNULL => ABORT */ - 269, /* KEY => ABORT */ - 269, /* MODULES => ABORT */ - 269, /* NK_BITNOT => ABORT */ - 269, /* NK_SEMI => ABORT */ - 269, /* NOTNULL => ABORT */ - 269, /* OF => ABORT */ - 269, /* PLUS => ABORT */ - 269, /* PRIVILEGE => ABORT */ - 269, /* RAISE => ABORT */ - 269, /* REPLACE => ABORT */ - 269, /* RESTRICT => ABORT */ - 269, /* ROW => ABORT */ - 269, /* SEMI => ABORT */ - 269, /* STAR => ABORT */ - 269, /* STATEMENT => ABORT */ - 269, /* STRING => ABORT */ - 269, /* TIMES => ABORT */ - 269, /* UPDATE => ABORT */ - 269, /* VALUES => ABORT */ - 269, /* VARIABLE => ABORT */ - 269, /* VIEW => ABORT */ - 269, /* WAL => ABORT */ + 270, /* AFTER => ABORT */ + 270, /* ATTACH => ABORT */ + 270, /* BEFORE => ABORT */ + 270, /* BEGIN => ABORT */ + 270, /* BITAND => ABORT */ + 270, /* BITNOT => ABORT */ + 270, /* BITOR => ABORT */ + 270, /* BLOCKS => ABORT */ + 270, /* CHANGE => ABORT */ + 270, /* COMMA => ABORT */ + 270, /* COMPACT => ABORT */ + 270, /* CONCAT => ABORT */ + 270, /* CONFLICT => ABORT */ + 270, /* COPY => ABORT */ + 270, /* DEFERRED => ABORT */ + 270, /* DELIMITERS => ABORT */ + 270, /* DETACH => ABORT */ + 270, /* DIVIDE => ABORT */ + 270, /* DOT => ABORT */ + 270, /* EACH => ABORT */ + 270, /* FAIL => ABORT */ + 270, /* FILE => ABORT */ + 270, /* FOR => ABORT */ + 270, /* GLOB => ABORT */ + 270, /* ID => ABORT */ + 270, /* IMMEDIATE => ABORT */ + 270, /* IMPORT => ABORT */ + 270, /* INITIALLY => ABORT */ + 270, /* INSTEAD => ABORT */ + 270, /* ISNULL => ABORT */ + 270, /* KEY => ABORT */ + 270, /* MODULES => ABORT */ + 270, /* NK_BITNOT => ABORT */ + 270, /* NK_SEMI => ABORT */ + 270, /* NOTNULL => ABORT */ + 270, /* OF => ABORT */ + 270, /* PLUS => ABORT */ + 270, /* PRIVILEGE => ABORT */ + 270, /* RAISE => ABORT */ + 270, /* REPLACE => ABORT */ + 270, /* RESTRICT => ABORT */ + 270, /* ROW => ABORT */ + 270, /* SEMI => ABORT */ + 270, /* STAR => ABORT */ + 270, /* STATEMENT => ABORT */ + 270, /* STRICT => ABORT */ + 270, /* STRING => ABORT */ + 270, /* TIMES => ABORT */ + 270, /* UPDATE => ABORT */ + 270, /* VALUES => ABORT */ + 270, /* VARIABLE => ABORT */ + 270, /* VIEW => ABORT */ + 270, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1411,384 +1509,386 @@ static const char *const yyTokenName[] = { /* 76 */ "TSDB_PAGESIZE", /* 77 */ "PRECISION", /* 78 */ "REPLICA", - /* 79 */ "STRICT", - /* 80 */ "VGROUPS", - /* 81 */ "SINGLE_STABLE", - /* 82 */ "RETENTIONS", - /* 83 */ "SCHEMALESS", - /* 84 */ "WAL_LEVEL", - /* 85 */ "WAL_FSYNC_PERIOD", - /* 86 */ "WAL_RETENTION_PERIOD", - /* 87 */ "WAL_RETENTION_SIZE", - /* 88 */ "WAL_ROLL_PERIOD", - /* 89 */ "WAL_SEGMENT_SIZE", - /* 90 */ "STT_TRIGGER", - /* 91 */ "TABLE_PREFIX", - /* 92 */ "TABLE_SUFFIX", - /* 93 */ "NK_COLON", - /* 94 */ "MAX_SPEED", - /* 95 */ "TABLE", - /* 96 */ "NK_LP", - /* 97 */ "NK_RP", - /* 98 */ "STABLE", - /* 99 */ "ADD", - /* 100 */ "COLUMN", - /* 101 */ "MODIFY", - /* 102 */ "RENAME", - /* 103 */ "TAG", - /* 104 */ "SET", - /* 105 */ "NK_EQ", - /* 106 */ "USING", - /* 107 */ "TAGS", - /* 108 */ "COMMENT", - /* 109 */ "BOOL", - /* 110 */ "TINYINT", - /* 111 */ "SMALLINT", - /* 112 */ "INT", - /* 113 */ "INTEGER", - /* 114 */ "BIGINT", - /* 115 */ "FLOAT", - /* 116 */ "DOUBLE", - /* 117 */ "BINARY", - /* 118 */ "TIMESTAMP", - /* 119 */ "NCHAR", - /* 120 */ "UNSIGNED", - /* 121 */ "JSON", - /* 122 */ "VARCHAR", - /* 123 */ "MEDIUMBLOB", - /* 124 */ "BLOB", - /* 125 */ "VARBINARY", - /* 126 */ "DECIMAL", - /* 127 */ "MAX_DELAY", - /* 128 */ "WATERMARK", - /* 129 */ "ROLLUP", - /* 130 */ "TTL", - /* 131 */ "SMA", - /* 132 */ "DELETE_MARK", - /* 133 */ "FIRST", - /* 134 */ "LAST", - /* 135 */ "SHOW", - /* 136 */ "PRIVILEGES", - /* 137 */ "DATABASES", - /* 138 */ "TABLES", - /* 139 */ "STABLES", - /* 140 */ "MNODES", - /* 141 */ "QNODES", - /* 142 */ "FUNCTIONS", - /* 143 */ "INDEXES", - /* 144 */ "ACCOUNTS", - /* 145 */ "APPS", - /* 146 */ "CONNECTIONS", - /* 147 */ "LICENCES", - /* 148 */ "GRANTS", - /* 149 */ "QUERIES", - /* 150 */ "SCORES", - /* 151 */ "TOPICS", - /* 152 */ "VARIABLES", - /* 153 */ "CLUSTER", - /* 154 */ "BNODES", - /* 155 */ "SNODES", - /* 156 */ "TRANSACTIONS", - /* 157 */ "DISTRIBUTED", - /* 158 */ "CONSUMERS", - /* 159 */ "SUBSCRIPTIONS", - /* 160 */ "VNODES", - /* 161 */ "LIKE", - /* 162 */ "TBNAME", - /* 163 */ "QTAGS", - /* 164 */ "AS", - /* 165 */ "INDEX", - /* 166 */ "FUNCTION", - /* 167 */ "INTERVAL", - /* 168 */ "TOPIC", - /* 169 */ "WITH", - /* 170 */ "META", - /* 171 */ "CONSUMER", - /* 172 */ "GROUP", - /* 173 */ "DESC", - /* 174 */ "DESCRIBE", - /* 175 */ "RESET", - /* 176 */ "QUERY", - /* 177 */ "CACHE", - /* 178 */ "EXPLAIN", - /* 179 */ "ANALYZE", - /* 180 */ "VERBOSE", - /* 181 */ "NK_BOOL", - /* 182 */ "RATIO", - /* 183 */ "NK_FLOAT", - /* 184 */ "OUTPUTTYPE", - /* 185 */ "AGGREGATE", - /* 186 */ "BUFSIZE", - /* 187 */ "STREAM", - /* 188 */ "INTO", - /* 189 */ "TRIGGER", - /* 190 */ "AT_ONCE", - /* 191 */ "WINDOW_CLOSE", - /* 192 */ "IGNORE", - /* 193 */ "EXPIRED", - /* 194 */ "FILL_HISTORY", - /* 195 */ "SUBTABLE", - /* 196 */ "KILL", - /* 197 */ "CONNECTION", - /* 198 */ "TRANSACTION", - /* 199 */ "BALANCE", - /* 200 */ "VGROUP", - /* 201 */ "MERGE", - /* 202 */ "REDISTRIBUTE", - /* 203 */ "SPLIT", - /* 204 */ "DELETE", - /* 205 */ "INSERT", - /* 206 */ "NULL", - /* 207 */ "NK_QUESTION", - /* 208 */ "NK_ARROW", - /* 209 */ "ROWTS", - /* 210 */ "QSTART", - /* 211 */ "QEND", - /* 212 */ "QDURATION", - /* 213 */ "WSTART", - /* 214 */ "WEND", - /* 215 */ "WDURATION", - /* 216 */ "IROWTS", - /* 217 */ "CAST", - /* 218 */ "NOW", - /* 219 */ "TODAY", - /* 220 */ "TIMEZONE", - /* 221 */ "CLIENT_VERSION", - /* 222 */ "SERVER_VERSION", - /* 223 */ "SERVER_STATUS", - /* 224 */ "CURRENT_USER", - /* 225 */ "COUNT", - /* 226 */ "LAST_ROW", - /* 227 */ "CASE", - /* 228 */ "END", - /* 229 */ "WHEN", - /* 230 */ "THEN", - /* 231 */ "ELSE", - /* 232 */ "BETWEEN", - /* 233 */ "IS", - /* 234 */ "NK_LT", - /* 235 */ "NK_GT", - /* 236 */ "NK_LE", - /* 237 */ "NK_GE", - /* 238 */ "NK_NE", - /* 239 */ "MATCH", - /* 240 */ "NMATCH", - /* 241 */ "CONTAINS", - /* 242 */ "IN", - /* 243 */ "JOIN", - /* 244 */ "INNER", - /* 245 */ "SELECT", - /* 246 */ "DISTINCT", - /* 247 */ "WHERE", - /* 248 */ "PARTITION", - /* 249 */ "BY", - /* 250 */ "SESSION", - /* 251 */ "STATE_WINDOW", - /* 252 */ "SLIDING", - /* 253 */ "FILL", - /* 254 */ "VALUE", - /* 255 */ "NONE", - /* 256 */ "PREV", - /* 257 */ "LINEAR", - /* 258 */ "NEXT", - /* 259 */ "HAVING", - /* 260 */ "RANGE", - /* 261 */ "EVERY", - /* 262 */ "ORDER", - /* 263 */ "SLIMIT", - /* 264 */ "SOFFSET", - /* 265 */ "LIMIT", - /* 266 */ "OFFSET", - /* 267 */ "ASC", - /* 268 */ "NULLS", - /* 269 */ "ABORT", - /* 270 */ "AFTER", - /* 271 */ "ATTACH", - /* 272 */ "BEFORE", - /* 273 */ "BEGIN", - /* 274 */ "BITAND", - /* 275 */ "BITNOT", - /* 276 */ "BITOR", - /* 277 */ "BLOCKS", - /* 278 */ "CHANGE", - /* 279 */ "COMMA", - /* 280 */ "COMPACT", - /* 281 */ "CONCAT", - /* 282 */ "CONFLICT", - /* 283 */ "COPY", - /* 284 */ "DEFERRED", - /* 285 */ "DELIMITERS", - /* 286 */ "DETACH", - /* 287 */ "DIVIDE", - /* 288 */ "DOT", - /* 289 */ "EACH", - /* 290 */ "FAIL", - /* 291 */ "FILE", - /* 292 */ "FOR", - /* 293 */ "GLOB", - /* 294 */ "ID", - /* 295 */ "IMMEDIATE", - /* 296 */ "IMPORT", - /* 297 */ "INITIALLY", - /* 298 */ "INSTEAD", - /* 299 */ "ISNULL", - /* 300 */ "KEY", - /* 301 */ "MODULES", - /* 302 */ "NK_BITNOT", - /* 303 */ "NK_SEMI", - /* 304 */ "NOTNULL", - /* 305 */ "OF", - /* 306 */ "PLUS", - /* 307 */ "PRIVILEGE", - /* 308 */ "RAISE", - /* 309 */ "REPLACE", - /* 310 */ "RESTRICT", - /* 311 */ "ROW", - /* 312 */ "SEMI", - /* 313 */ "STAR", - /* 314 */ "STATEMENT", - /* 315 */ "STRING", - /* 316 */ "TIMES", - /* 317 */ "UPDATE", - /* 318 */ "VALUES", - /* 319 */ "VARIABLE", - /* 320 */ "VIEW", - /* 321 */ "WAL", - /* 322 */ "cmd", - /* 323 */ "account_options", - /* 324 */ "alter_account_options", - /* 325 */ "literal", - /* 326 */ "alter_account_option", - /* 327 */ "user_name", - /* 328 */ "sysinfo_opt", - /* 329 */ "privileges", - /* 330 */ "priv_level", - /* 331 */ "priv_type_list", - /* 332 */ "priv_type", - /* 333 */ "db_name", - /* 334 */ "topic_name", - /* 335 */ "dnode_endpoint", - /* 336 */ "force_opt", - /* 337 */ "not_exists_opt", - /* 338 */ "db_options", - /* 339 */ "exists_opt", - /* 340 */ "alter_db_options", - /* 341 */ "speed_opt", - /* 342 */ "integer_list", - /* 343 */ "variable_list", - /* 344 */ "retention_list", - /* 345 */ "alter_db_option", - /* 346 */ "retention", - /* 347 */ "full_table_name", - /* 348 */ "column_def_list", - /* 349 */ "tags_def_opt", - /* 350 */ "table_options", - /* 351 */ "multi_create_clause", - /* 352 */ "tags_def", - /* 353 */ "multi_drop_clause", - /* 354 */ "alter_table_clause", - /* 355 */ "alter_table_options", - /* 356 */ "column_name", - /* 357 */ "type_name", - /* 358 */ "signed_literal", - /* 359 */ "create_subtable_clause", - /* 360 */ "specific_cols_opt", - /* 361 */ "expression_list", - /* 362 */ "drop_table_clause", - /* 363 */ "col_name_list", - /* 364 */ "table_name", - /* 365 */ "column_def", - /* 366 */ "duration_list", - /* 367 */ "rollup_func_list", - /* 368 */ "alter_table_option", - /* 369 */ "duration_literal", - /* 370 */ "rollup_func_name", - /* 371 */ "function_name", - /* 372 */ "col_name", - /* 373 */ "db_name_cond_opt", - /* 374 */ "like_pattern_opt", - /* 375 */ "table_name_cond", - /* 376 */ "from_db_opt", - /* 377 */ "tag_list_opt", - /* 378 */ "tag_item", - /* 379 */ "column_alias", - /* 380 */ "index_options", - /* 381 */ "func_list", - /* 382 */ "sliding_opt", - /* 383 */ "sma_stream_opt", - /* 384 */ "func", - /* 385 */ "query_or_subquery", - /* 386 */ "cgroup_name", - /* 387 */ "analyze_opt", - /* 388 */ "explain_options", - /* 389 */ "agg_func_opt", - /* 390 */ "bufsize_opt", - /* 391 */ "stream_name", - /* 392 */ "stream_options", - /* 393 */ "subtable_opt", - /* 394 */ "expression", - /* 395 */ "dnode_list", - /* 396 */ "where_clause_opt", - /* 397 */ "signed", - /* 398 */ "literal_func", - /* 399 */ "literal_list", - /* 400 */ "table_alias", - /* 401 */ "expr_or_subquery", - /* 402 */ "pseudo_column", - /* 403 */ "column_reference", - /* 404 */ "function_expression", - /* 405 */ "case_when_expression", - /* 406 */ "star_func", - /* 407 */ "star_func_para_list", - /* 408 */ "noarg_func", - /* 409 */ "other_para_list", - /* 410 */ "star_func_para", - /* 411 */ "when_then_list", - /* 412 */ "case_when_else_opt", - /* 413 */ "common_expression", - /* 414 */ "when_then_expr", - /* 415 */ "predicate", - /* 416 */ "compare_op", - /* 417 */ "in_op", - /* 418 */ "in_predicate_value", - /* 419 */ "boolean_value_expression", - /* 420 */ "boolean_primary", - /* 421 */ "from_clause_opt", - /* 422 */ "table_reference_list", - /* 423 */ "table_reference", - /* 424 */ "table_primary", - /* 425 */ "joined_table", - /* 426 */ "alias_opt", - /* 427 */ "subquery", - /* 428 */ "parenthesized_joined_table", - /* 429 */ "join_type", - /* 430 */ "search_condition", - /* 431 */ "query_specification", - /* 432 */ "set_quantifier_opt", - /* 433 */ "select_list", - /* 434 */ "partition_by_clause_opt", - /* 435 */ "range_opt", - /* 436 */ "every_opt", - /* 437 */ "fill_opt", - /* 438 */ "twindow_clause_opt", - /* 439 */ "group_by_clause_opt", - /* 440 */ "having_clause_opt", - /* 441 */ "select_item", - /* 442 */ "partition_list", - /* 443 */ "partition_item", - /* 444 */ "fill_mode", - /* 445 */ "group_by_list", - /* 446 */ "query_expression", - /* 447 */ "query_simple", - /* 448 */ "order_by_clause_opt", - /* 449 */ "slimit_clause_opt", - /* 450 */ "limit_clause_opt", - /* 451 */ "union_query_expression", - /* 452 */ "query_simple_or_subquery", - /* 453 */ "sort_specification_list", - /* 454 */ "sort_specification", - /* 455 */ "ordering_specification_opt", - /* 456 */ "null_ordering_opt", + /* 79 */ "VGROUPS", + /* 80 */ "SINGLE_STABLE", + /* 81 */ "RETENTIONS", + /* 82 */ "SCHEMALESS", + /* 83 */ "WAL_LEVEL", + /* 84 */ "WAL_FSYNC_PERIOD", + /* 85 */ "WAL_RETENTION_PERIOD", + /* 86 */ "WAL_RETENTION_SIZE", + /* 87 */ "WAL_ROLL_PERIOD", + /* 88 */ "WAL_SEGMENT_SIZE", + /* 89 */ "STT_TRIGGER", + /* 90 */ "TABLE_PREFIX", + /* 91 */ "TABLE_SUFFIX", + /* 92 */ "NK_COLON", + /* 93 */ "MAX_SPEED", + /* 94 */ "TABLE", + /* 95 */ "NK_LP", + /* 96 */ "NK_RP", + /* 97 */ "STABLE", + /* 98 */ "ADD", + /* 99 */ "COLUMN", + /* 100 */ "MODIFY", + /* 101 */ "RENAME", + /* 102 */ "TAG", + /* 103 */ "SET", + /* 104 */ "NK_EQ", + /* 105 */ "USING", + /* 106 */ "TAGS", + /* 107 */ "COMMENT", + /* 108 */ "BOOL", + /* 109 */ "TINYINT", + /* 110 */ "SMALLINT", + /* 111 */ "INT", + /* 112 */ "INTEGER", + /* 113 */ "BIGINT", + /* 114 */ "FLOAT", + /* 115 */ "DOUBLE", + /* 116 */ "BINARY", + /* 117 */ "TIMESTAMP", + /* 118 */ "NCHAR", + /* 119 */ "UNSIGNED", + /* 120 */ "JSON", + /* 121 */ "VARCHAR", + /* 122 */ "MEDIUMBLOB", + /* 123 */ "BLOB", + /* 124 */ "VARBINARY", + /* 125 */ "DECIMAL", + /* 126 */ "MAX_DELAY", + /* 127 */ "WATERMARK", + /* 128 */ "ROLLUP", + /* 129 */ "TTL", + /* 130 */ "SMA", + /* 131 */ "DELETE_MARK", + /* 132 */ "FIRST", + /* 133 */ "LAST", + /* 134 */ "SHOW", + /* 135 */ "PRIVILEGES", + /* 136 */ "DATABASES", + /* 137 */ "TABLES", + /* 138 */ "STABLES", + /* 139 */ "MNODES", + /* 140 */ "QNODES", + /* 141 */ "FUNCTIONS", + /* 142 */ "INDEXES", + /* 143 */ "ACCOUNTS", + /* 144 */ "APPS", + /* 145 */ "CONNECTIONS", + /* 146 */ "LICENCES", + /* 147 */ "GRANTS", + /* 148 */ "QUERIES", + /* 149 */ "SCORES", + /* 150 */ "TOPICS", + /* 151 */ "VARIABLES", + /* 152 */ "CLUSTER", + /* 153 */ "BNODES", + /* 154 */ "SNODES", + /* 155 */ "TRANSACTIONS", + /* 156 */ "DISTRIBUTED", + /* 157 */ "CONSUMERS", + /* 158 */ "SUBSCRIPTIONS", + /* 159 */ "VNODES", + /* 160 */ "LIKE", + /* 161 */ "TBNAME", + /* 162 */ "QTAGS", + /* 163 */ "AS", + /* 164 */ "INDEX", + /* 165 */ "FUNCTION", + /* 166 */ "INTERVAL", + /* 167 */ "TOPIC", + /* 168 */ "WITH", + /* 169 */ "META", + /* 170 */ "CONSUMER", + /* 171 */ "GROUP", + /* 172 */ "DESC", + /* 173 */ "DESCRIBE", + /* 174 */ "RESET", + /* 175 */ "QUERY", + /* 176 */ "CACHE", + /* 177 */ "EXPLAIN", + /* 178 */ "ANALYZE", + /* 179 */ "VERBOSE", + /* 180 */ "NK_BOOL", + /* 181 */ "RATIO", + /* 182 */ "NK_FLOAT", + /* 183 */ "OUTPUTTYPE", + /* 184 */ "AGGREGATE", + /* 185 */ "BUFSIZE", + /* 186 */ "STREAM", + /* 187 */ "INTO", + /* 188 */ "TRIGGER", + /* 189 */ "AT_ONCE", + /* 190 */ "WINDOW_CLOSE", + /* 191 */ "IGNORE", + /* 192 */ "EXPIRED", + /* 193 */ "FILL_HISTORY", + /* 194 */ "SUBTABLE", + /* 195 */ "KILL", + /* 196 */ "CONNECTION", + /* 197 */ "TRANSACTION", + /* 198 */ "BALANCE", + /* 199 */ "VGROUP", + /* 200 */ "MERGE", + /* 201 */ "REDISTRIBUTE", + /* 202 */ "SPLIT", + /* 203 */ "DELETE", + /* 204 */ "INSERT", + /* 205 */ "NULL", + /* 206 */ "NK_QUESTION", + /* 207 */ "NK_ARROW", + /* 208 */ "ROWTS", + /* 209 */ "QSTART", + /* 210 */ "QEND", + /* 211 */ "QDURATION", + /* 212 */ "WSTART", + /* 213 */ "WEND", + /* 214 */ "WDURATION", + /* 215 */ "IROWTS", + /* 216 */ "CAST", + /* 217 */ "NOW", + /* 218 */ "TODAY", + /* 219 */ "TIMEZONE", + /* 220 */ "CLIENT_VERSION", + /* 221 */ "SERVER_VERSION", + /* 222 */ "SERVER_STATUS", + /* 223 */ "CURRENT_USER", + /* 224 */ "COUNT", + /* 225 */ "LAST_ROW", + /* 226 */ "CASE", + /* 227 */ "END", + /* 228 */ "WHEN", + /* 229 */ "THEN", + /* 230 */ "ELSE", + /* 231 */ "BETWEEN", + /* 232 */ "IS", + /* 233 */ "NK_LT", + /* 234 */ "NK_GT", + /* 235 */ "NK_LE", + /* 236 */ "NK_GE", + /* 237 */ "NK_NE", + /* 238 */ "MATCH", + /* 239 */ "NMATCH", + /* 240 */ "CONTAINS", + /* 241 */ "IN", + /* 242 */ "JOIN", + /* 243 */ "INNER", + /* 244 */ "SELECT", + /* 245 */ "DISTINCT", + /* 246 */ "WHERE", + /* 247 */ "PARTITION", + /* 248 */ "BY", + /* 249 */ "SESSION", + /* 250 */ "STATE_WINDOW", + /* 251 */ "EVENT_WINDOW", + /* 252 */ "START", + /* 253 */ "SLIDING", + /* 254 */ "FILL", + /* 255 */ "VALUE", + /* 256 */ "NONE", + /* 257 */ "PREV", + /* 258 */ "LINEAR", + /* 259 */ "NEXT", + /* 260 */ "HAVING", + /* 261 */ "RANGE", + /* 262 */ "EVERY", + /* 263 */ "ORDER", + /* 264 */ "SLIMIT", + /* 265 */ "SOFFSET", + /* 266 */ "LIMIT", + /* 267 */ "OFFSET", + /* 268 */ "ASC", + /* 269 */ "NULLS", + /* 270 */ "ABORT", + /* 271 */ "AFTER", + /* 272 */ "ATTACH", + /* 273 */ "BEFORE", + /* 274 */ "BEGIN", + /* 275 */ "BITAND", + /* 276 */ "BITNOT", + /* 277 */ "BITOR", + /* 278 */ "BLOCKS", + /* 279 */ "CHANGE", + /* 280 */ "COMMA", + /* 281 */ "COMPACT", + /* 282 */ "CONCAT", + /* 283 */ "CONFLICT", + /* 284 */ "COPY", + /* 285 */ "DEFERRED", + /* 286 */ "DELIMITERS", + /* 287 */ "DETACH", + /* 288 */ "DIVIDE", + /* 289 */ "DOT", + /* 290 */ "EACH", + /* 291 */ "FAIL", + /* 292 */ "FILE", + /* 293 */ "FOR", + /* 294 */ "GLOB", + /* 295 */ "ID", + /* 296 */ "IMMEDIATE", + /* 297 */ "IMPORT", + /* 298 */ "INITIALLY", + /* 299 */ "INSTEAD", + /* 300 */ "ISNULL", + /* 301 */ "KEY", + /* 302 */ "MODULES", + /* 303 */ "NK_BITNOT", + /* 304 */ "NK_SEMI", + /* 305 */ "NOTNULL", + /* 306 */ "OF", + /* 307 */ "PLUS", + /* 308 */ "PRIVILEGE", + /* 309 */ "RAISE", + /* 310 */ "REPLACE", + /* 311 */ "RESTRICT", + /* 312 */ "ROW", + /* 313 */ "SEMI", + /* 314 */ "STAR", + /* 315 */ "STATEMENT", + /* 316 */ "STRICT", + /* 317 */ "STRING", + /* 318 */ "TIMES", + /* 319 */ "UPDATE", + /* 320 */ "VALUES", + /* 321 */ "VARIABLE", + /* 322 */ "VIEW", + /* 323 */ "WAL", + /* 324 */ "cmd", + /* 325 */ "account_options", + /* 326 */ "alter_account_options", + /* 327 */ "literal", + /* 328 */ "alter_account_option", + /* 329 */ "user_name", + /* 330 */ "sysinfo_opt", + /* 331 */ "privileges", + /* 332 */ "priv_level", + /* 333 */ "priv_type_list", + /* 334 */ "priv_type", + /* 335 */ "db_name", + /* 336 */ "topic_name", + /* 337 */ "dnode_endpoint", + /* 338 */ "force_opt", + /* 339 */ "not_exists_opt", + /* 340 */ "db_options", + /* 341 */ "exists_opt", + /* 342 */ "alter_db_options", + /* 343 */ "speed_opt", + /* 344 */ "integer_list", + /* 345 */ "variable_list", + /* 346 */ "retention_list", + /* 347 */ "alter_db_option", + /* 348 */ "retention", + /* 349 */ "full_table_name", + /* 350 */ "column_def_list", + /* 351 */ "tags_def_opt", + /* 352 */ "table_options", + /* 353 */ "multi_create_clause", + /* 354 */ "tags_def", + /* 355 */ "multi_drop_clause", + /* 356 */ "alter_table_clause", + /* 357 */ "alter_table_options", + /* 358 */ "column_name", + /* 359 */ "type_name", + /* 360 */ "signed_literal", + /* 361 */ "create_subtable_clause", + /* 362 */ "specific_cols_opt", + /* 363 */ "expression_list", + /* 364 */ "drop_table_clause", + /* 365 */ "col_name_list", + /* 366 */ "table_name", + /* 367 */ "column_def", + /* 368 */ "duration_list", + /* 369 */ "rollup_func_list", + /* 370 */ "alter_table_option", + /* 371 */ "duration_literal", + /* 372 */ "rollup_func_name", + /* 373 */ "function_name", + /* 374 */ "col_name", + /* 375 */ "db_name_cond_opt", + /* 376 */ "like_pattern_opt", + /* 377 */ "table_name_cond", + /* 378 */ "from_db_opt", + /* 379 */ "tag_list_opt", + /* 380 */ "tag_item", + /* 381 */ "column_alias", + /* 382 */ "index_options", + /* 383 */ "func_list", + /* 384 */ "sliding_opt", + /* 385 */ "sma_stream_opt", + /* 386 */ "func", + /* 387 */ "query_or_subquery", + /* 388 */ "cgroup_name", + /* 389 */ "analyze_opt", + /* 390 */ "explain_options", + /* 391 */ "agg_func_opt", + /* 392 */ "bufsize_opt", + /* 393 */ "stream_name", + /* 394 */ "stream_options", + /* 395 */ "subtable_opt", + /* 396 */ "expression", + /* 397 */ "dnode_list", + /* 398 */ "where_clause_opt", + /* 399 */ "signed", + /* 400 */ "literal_func", + /* 401 */ "literal_list", + /* 402 */ "table_alias", + /* 403 */ "expr_or_subquery", + /* 404 */ "pseudo_column", + /* 405 */ "column_reference", + /* 406 */ "function_expression", + /* 407 */ "case_when_expression", + /* 408 */ "star_func", + /* 409 */ "star_func_para_list", + /* 410 */ "noarg_func", + /* 411 */ "other_para_list", + /* 412 */ "star_func_para", + /* 413 */ "when_then_list", + /* 414 */ "case_when_else_opt", + /* 415 */ "common_expression", + /* 416 */ "when_then_expr", + /* 417 */ "predicate", + /* 418 */ "compare_op", + /* 419 */ "in_op", + /* 420 */ "in_predicate_value", + /* 421 */ "boolean_value_expression", + /* 422 */ "boolean_primary", + /* 423 */ "from_clause_opt", + /* 424 */ "table_reference_list", + /* 425 */ "table_reference", + /* 426 */ "table_primary", + /* 427 */ "joined_table", + /* 428 */ "alias_opt", + /* 429 */ "subquery", + /* 430 */ "parenthesized_joined_table", + /* 431 */ "join_type", + /* 432 */ "search_condition", + /* 433 */ "query_specification", + /* 434 */ "set_quantifier_opt", + /* 435 */ "select_list", + /* 436 */ "partition_by_clause_opt", + /* 437 */ "range_opt", + /* 438 */ "every_opt", + /* 439 */ "fill_opt", + /* 440 */ "twindow_clause_opt", + /* 441 */ "group_by_clause_opt", + /* 442 */ "having_clause_opt", + /* 443 */ "select_item", + /* 444 */ "partition_list", + /* 445 */ "partition_item", + /* 446 */ "fill_mode", + /* 447 */ "group_by_list", + /* 448 */ "query_expression", + /* 449 */ "query_simple", + /* 450 */ "order_by_clause_opt", + /* 451 */ "slimit_clause_opt", + /* 452 */ "limit_clause_opt", + /* 453 */ "union_query_expression", + /* 454 */ "query_simple_or_subquery", + /* 455 */ "sort_specification_list", + /* 456 */ "sort_specification", + /* 457 */ "ordering_specification_opt", + /* 458 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1888,454 +1988,453 @@ static const char *const yyRuleName[] = { /* 89 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER", /* 90 */ "db_options ::= db_options PRECISION NK_STRING", /* 91 */ "db_options ::= db_options REPLICA NK_INTEGER", - /* 92 */ "db_options ::= db_options STRICT NK_STRING", - /* 93 */ "db_options ::= db_options VGROUPS NK_INTEGER", - /* 94 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", - /* 95 */ "db_options ::= db_options RETENTIONS retention_list", - /* 96 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", - /* 97 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", - /* 98 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", - /* 99 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", - /* 100 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", - /* 101 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", - /* 102 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", - /* 103 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", - /* 104 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", - /* 105 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", - /* 106 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", - /* 107 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", - /* 108 */ "alter_db_options ::= alter_db_option", - /* 109 */ "alter_db_options ::= alter_db_options alter_db_option", - /* 110 */ "alter_db_option ::= BUFFER NK_INTEGER", - /* 111 */ "alter_db_option ::= CACHEMODEL NK_STRING", - /* 112 */ "alter_db_option ::= CACHESIZE NK_INTEGER", - /* 113 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", - /* 114 */ "alter_db_option ::= KEEP integer_list", - /* 115 */ "alter_db_option ::= KEEP variable_list", - /* 116 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 117 */ "alter_db_option ::= REPLICA NK_INTEGER", - /* 118 */ "alter_db_option ::= STRICT NK_STRING", - /* 119 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 120 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 121 */ "integer_list ::= NK_INTEGER", - /* 122 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 123 */ "variable_list ::= NK_VARIABLE", - /* 124 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 125 */ "retention_list ::= retention", - /* 126 */ "retention_list ::= retention_list NK_COMMA retention", - /* 127 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 128 */ "speed_opt ::=", - /* 129 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 130 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 131 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 132 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 133 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 134 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 135 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 136 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 137 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 138 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 139 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 140 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 141 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 142 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 143 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 144 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 145 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 146 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 147 */ "multi_create_clause ::= create_subtable_clause", - /* 148 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 149 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 150 */ "multi_drop_clause ::= drop_table_clause", - /* 151 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 152 */ "drop_table_clause ::= exists_opt full_table_name", - /* 153 */ "specific_cols_opt ::=", - /* 154 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 155 */ "full_table_name ::= table_name", - /* 156 */ "full_table_name ::= db_name NK_DOT table_name", - /* 157 */ "column_def_list ::= column_def", - /* 158 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 159 */ "column_def ::= column_name type_name", - /* 160 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 161 */ "type_name ::= BOOL", - /* 162 */ "type_name ::= TINYINT", - /* 163 */ "type_name ::= SMALLINT", - /* 164 */ "type_name ::= INT", - /* 165 */ "type_name ::= INTEGER", - /* 166 */ "type_name ::= BIGINT", - /* 167 */ "type_name ::= FLOAT", - /* 168 */ "type_name ::= DOUBLE", - /* 169 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 170 */ "type_name ::= TIMESTAMP", - /* 171 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 172 */ "type_name ::= TINYINT UNSIGNED", - /* 173 */ "type_name ::= SMALLINT UNSIGNED", - /* 174 */ "type_name ::= INT UNSIGNED", - /* 175 */ "type_name ::= BIGINT UNSIGNED", - /* 176 */ "type_name ::= JSON", - /* 177 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 178 */ "type_name ::= MEDIUMBLOB", - /* 179 */ "type_name ::= BLOB", - /* 180 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 181 */ "type_name ::= DECIMAL", - /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 183 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 184 */ "tags_def_opt ::=", - /* 185 */ "tags_def_opt ::= tags_def", - /* 186 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 187 */ "table_options ::=", - /* 188 */ "table_options ::= table_options COMMENT NK_STRING", - /* 189 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 190 */ "table_options ::= table_options WATERMARK duration_list", - /* 191 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 192 */ "table_options ::= table_options TTL NK_INTEGER", - /* 193 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 194 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 195 */ "alter_table_options ::= alter_table_option", - /* 196 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 197 */ "alter_table_option ::= COMMENT NK_STRING", - /* 198 */ "alter_table_option ::= TTL NK_INTEGER", - /* 199 */ "duration_list ::= duration_literal", - /* 200 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 201 */ "rollup_func_list ::= rollup_func_name", - /* 202 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 203 */ "rollup_func_name ::= function_name", - /* 204 */ "rollup_func_name ::= FIRST", - /* 205 */ "rollup_func_name ::= LAST", - /* 206 */ "col_name_list ::= col_name", - /* 207 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 208 */ "col_name ::= column_name", - /* 209 */ "cmd ::= SHOW DNODES", - /* 210 */ "cmd ::= SHOW USERS", - /* 211 */ "cmd ::= SHOW USER PRIVILEGES", - /* 212 */ "cmd ::= SHOW DATABASES", - /* 213 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 215 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 216 */ "cmd ::= SHOW MNODES", - /* 217 */ "cmd ::= SHOW QNODES", - /* 218 */ "cmd ::= SHOW FUNCTIONS", - /* 219 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 220 */ "cmd ::= SHOW STREAMS", - /* 221 */ "cmd ::= SHOW ACCOUNTS", - /* 222 */ "cmd ::= SHOW APPS", - /* 223 */ "cmd ::= SHOW CONNECTIONS", - /* 224 */ "cmd ::= SHOW LICENCES", - /* 225 */ "cmd ::= SHOW GRANTS", - /* 226 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 227 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 228 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 229 */ "cmd ::= SHOW QUERIES", - /* 230 */ "cmd ::= SHOW SCORES", - /* 231 */ "cmd ::= SHOW TOPICS", - /* 232 */ "cmd ::= SHOW VARIABLES", - /* 233 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 234 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 235 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 236 */ "cmd ::= SHOW BNODES", - /* 237 */ "cmd ::= SHOW SNODES", - /* 238 */ "cmd ::= SHOW CLUSTER", - /* 239 */ "cmd ::= SHOW TRANSACTIONS", - /* 240 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 241 */ "cmd ::= SHOW CONSUMERS", - /* 242 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 243 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 245 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 246 */ "cmd ::= SHOW VNODES NK_STRING", - /* 247 */ "db_name_cond_opt ::=", - /* 248 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 249 */ "like_pattern_opt ::=", - /* 250 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 251 */ "table_name_cond ::= table_name", - /* 252 */ "from_db_opt ::=", - /* 253 */ "from_db_opt ::= FROM db_name", - /* 254 */ "tag_list_opt ::=", - /* 255 */ "tag_list_opt ::= tag_item", - /* 256 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 257 */ "tag_item ::= TBNAME", - /* 258 */ "tag_item ::= QTAGS", - /* 259 */ "tag_item ::= column_name", - /* 260 */ "tag_item ::= column_name column_alias", - /* 261 */ "tag_item ::= column_name AS column_alias", - /* 262 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 263 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 265 */ "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", - /* 266 */ "func_list ::= func", - /* 267 */ "func_list ::= func_list NK_COMMA func", - /* 268 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 269 */ "sma_stream_opt ::=", - /* 270 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 271 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 272 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 278 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 279 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 280 */ "cmd ::= DESC full_table_name", - /* 281 */ "cmd ::= DESCRIBE full_table_name", - /* 282 */ "cmd ::= RESET QUERY CACHE", - /* 283 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 284 */ "analyze_opt ::=", - /* 285 */ "analyze_opt ::= ANALYZE", - /* 286 */ "explain_options ::=", - /* 287 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 288 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 289 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 290 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 291 */ "agg_func_opt ::=", - /* 292 */ "agg_func_opt ::= AGGREGATE", - /* 293 */ "bufsize_opt ::=", - /* 294 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 295 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 296 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 297 */ "stream_options ::=", - /* 298 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 299 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 300 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 301 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 302 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 303 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 304 */ "subtable_opt ::=", - /* 305 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 306 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 307 */ "cmd ::= KILL QUERY NK_STRING", - /* 308 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 309 */ "cmd ::= BALANCE VGROUP", - /* 310 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 311 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 312 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 313 */ "dnode_list ::= DNODE NK_INTEGER", - /* 314 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 315 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 316 */ "cmd ::= query_or_subquery", - /* 317 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 318 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 319 */ "literal ::= NK_INTEGER", - /* 320 */ "literal ::= NK_FLOAT", - /* 321 */ "literal ::= NK_STRING", - /* 322 */ "literal ::= NK_BOOL", - /* 323 */ "literal ::= TIMESTAMP NK_STRING", - /* 324 */ "literal ::= duration_literal", - /* 325 */ "literal ::= NULL", - /* 326 */ "literal ::= NK_QUESTION", - /* 327 */ "duration_literal ::= NK_VARIABLE", - /* 328 */ "signed ::= NK_INTEGER", - /* 329 */ "signed ::= NK_PLUS NK_INTEGER", - /* 330 */ "signed ::= NK_MINUS NK_INTEGER", - /* 331 */ "signed ::= NK_FLOAT", - /* 332 */ "signed ::= NK_PLUS NK_FLOAT", - /* 333 */ "signed ::= NK_MINUS NK_FLOAT", - /* 334 */ "signed_literal ::= signed", - /* 335 */ "signed_literal ::= NK_STRING", - /* 336 */ "signed_literal ::= NK_BOOL", - /* 337 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 338 */ "signed_literal ::= duration_literal", - /* 339 */ "signed_literal ::= NULL", - /* 340 */ "signed_literal ::= literal_func", - /* 341 */ "signed_literal ::= NK_QUESTION", - /* 342 */ "literal_list ::= signed_literal", - /* 343 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 344 */ "db_name ::= NK_ID", - /* 345 */ "table_name ::= NK_ID", - /* 346 */ "column_name ::= NK_ID", - /* 347 */ "function_name ::= NK_ID", - /* 348 */ "table_alias ::= NK_ID", - /* 349 */ "column_alias ::= NK_ID", - /* 350 */ "user_name ::= NK_ID", - /* 351 */ "topic_name ::= NK_ID", - /* 352 */ "stream_name ::= NK_ID", - /* 353 */ "cgroup_name ::= NK_ID", - /* 354 */ "expr_or_subquery ::= expression", - /* 355 */ "expression ::= literal", - /* 356 */ "expression ::= pseudo_column", - /* 357 */ "expression ::= column_reference", - /* 358 */ "expression ::= function_expression", - /* 359 */ "expression ::= case_when_expression", - /* 360 */ "expression ::= NK_LP expression NK_RP", - /* 361 */ "expression ::= NK_PLUS expr_or_subquery", - /* 362 */ "expression ::= NK_MINUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 366 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 367 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 368 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 369 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 370 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 371 */ "expression_list ::= expr_or_subquery", - /* 372 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 373 */ "column_reference ::= column_name", - /* 374 */ "column_reference ::= table_name NK_DOT column_name", - /* 375 */ "pseudo_column ::= ROWTS", - /* 376 */ "pseudo_column ::= TBNAME", - /* 377 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 378 */ "pseudo_column ::= QSTART", - /* 379 */ "pseudo_column ::= QEND", - /* 380 */ "pseudo_column ::= QDURATION", - /* 381 */ "pseudo_column ::= WSTART", - /* 382 */ "pseudo_column ::= WEND", - /* 383 */ "pseudo_column ::= WDURATION", - /* 384 */ "pseudo_column ::= IROWTS", - /* 385 */ "pseudo_column ::= QTAGS", - /* 386 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 387 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 388 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 389 */ "function_expression ::= literal_func", - /* 390 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 391 */ "literal_func ::= NOW", - /* 392 */ "noarg_func ::= NOW", - /* 393 */ "noarg_func ::= TODAY", - /* 394 */ "noarg_func ::= TIMEZONE", - /* 395 */ "noarg_func ::= DATABASE", - /* 396 */ "noarg_func ::= CLIENT_VERSION", - /* 397 */ "noarg_func ::= SERVER_VERSION", - /* 398 */ "noarg_func ::= SERVER_STATUS", - /* 399 */ "noarg_func ::= CURRENT_USER", - /* 400 */ "noarg_func ::= USER", - /* 401 */ "star_func ::= COUNT", - /* 402 */ "star_func ::= FIRST", - /* 403 */ "star_func ::= LAST", - /* 404 */ "star_func ::= LAST_ROW", - /* 405 */ "star_func_para_list ::= NK_STAR", - /* 406 */ "star_func_para_list ::= other_para_list", - /* 407 */ "other_para_list ::= star_func_para", - /* 408 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 409 */ "star_func_para ::= expr_or_subquery", - /* 410 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 411 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 412 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 413 */ "when_then_list ::= when_then_expr", - /* 414 */ "when_then_list ::= when_then_list when_then_expr", - /* 415 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 416 */ "case_when_else_opt ::=", - /* 417 */ "case_when_else_opt ::= ELSE common_expression", - /* 418 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 420 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 421 */ "predicate ::= expr_or_subquery IS NULL", - /* 422 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 423 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 424 */ "compare_op ::= NK_LT", - /* 425 */ "compare_op ::= NK_GT", - /* 426 */ "compare_op ::= NK_LE", - /* 427 */ "compare_op ::= NK_GE", - /* 428 */ "compare_op ::= NK_NE", - /* 429 */ "compare_op ::= NK_EQ", - /* 430 */ "compare_op ::= LIKE", - /* 431 */ "compare_op ::= NOT LIKE", - /* 432 */ "compare_op ::= MATCH", - /* 433 */ "compare_op ::= NMATCH", - /* 434 */ "compare_op ::= CONTAINS", - /* 435 */ "in_op ::= IN", - /* 436 */ "in_op ::= NOT IN", - /* 437 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 438 */ "boolean_value_expression ::= boolean_primary", - /* 439 */ "boolean_value_expression ::= NOT boolean_primary", - /* 440 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 441 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 442 */ "boolean_primary ::= predicate", - /* 443 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 444 */ "common_expression ::= expr_or_subquery", - /* 445 */ "common_expression ::= boolean_value_expression", - /* 446 */ "from_clause_opt ::=", - /* 447 */ "from_clause_opt ::= FROM table_reference_list", - /* 448 */ "table_reference_list ::= table_reference", - /* 449 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 450 */ "table_reference ::= table_primary", - /* 451 */ "table_reference ::= joined_table", - /* 452 */ "table_primary ::= table_name alias_opt", - /* 453 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 454 */ "table_primary ::= subquery alias_opt", - /* 455 */ "table_primary ::= parenthesized_joined_table", - /* 456 */ "alias_opt ::=", - /* 457 */ "alias_opt ::= table_alias", - /* 458 */ "alias_opt ::= AS table_alias", - /* 459 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 460 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 461 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 462 */ "join_type ::=", - /* 463 */ "join_type ::= INNER", - /* 464 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 465 */ "set_quantifier_opt ::=", - /* 466 */ "set_quantifier_opt ::= DISTINCT", - /* 467 */ "set_quantifier_opt ::= ALL", - /* 468 */ "select_list ::= select_item", - /* 469 */ "select_list ::= select_list NK_COMMA select_item", - /* 470 */ "select_item ::= NK_STAR", - /* 471 */ "select_item ::= common_expression", - /* 472 */ "select_item ::= common_expression column_alias", - /* 473 */ "select_item ::= common_expression AS column_alias", - /* 474 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 475 */ "where_clause_opt ::=", - /* 476 */ "where_clause_opt ::= WHERE search_condition", - /* 477 */ "partition_by_clause_opt ::=", - /* 478 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 479 */ "partition_list ::= partition_item", - /* 480 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 481 */ "partition_item ::= expr_or_subquery", - /* 482 */ "partition_item ::= expr_or_subquery column_alias", - /* 483 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 484 */ "twindow_clause_opt ::=", - /* 485 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 486 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 488 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 489 */ "sliding_opt ::=", - /* 490 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 491 */ "fill_opt ::=", - /* 492 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 493 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 494 */ "fill_mode ::= NONE", - /* 495 */ "fill_mode ::= PREV", - /* 496 */ "fill_mode ::= NULL", - /* 497 */ "fill_mode ::= LINEAR", - /* 498 */ "fill_mode ::= NEXT", - /* 499 */ "group_by_clause_opt ::=", - /* 500 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 501 */ "group_by_list ::= expr_or_subquery", - /* 502 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 503 */ "having_clause_opt ::=", - /* 504 */ "having_clause_opt ::= HAVING search_condition", - /* 505 */ "range_opt ::=", - /* 506 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 507 */ "every_opt ::=", - /* 508 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 509 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 510 */ "query_simple ::= query_specification", - /* 511 */ "query_simple ::= union_query_expression", - /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 513 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 514 */ "query_simple_or_subquery ::= query_simple", - /* 515 */ "query_simple_or_subquery ::= subquery", - /* 516 */ "query_or_subquery ::= query_expression", - /* 517 */ "query_or_subquery ::= subquery", - /* 518 */ "order_by_clause_opt ::=", - /* 519 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 520 */ "slimit_clause_opt ::=", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 524 */ "limit_clause_opt ::=", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 528 */ "subquery ::= NK_LP query_expression NK_RP", - /* 529 */ "subquery ::= NK_LP subquery NK_RP", - /* 530 */ "search_condition ::= common_expression", - /* 531 */ "sort_specification_list ::= sort_specification", - /* 532 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 533 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 534 */ "ordering_specification_opt ::=", - /* 535 */ "ordering_specification_opt ::= ASC", - /* 536 */ "ordering_specification_opt ::= DESC", - /* 537 */ "null_ordering_opt ::=", - /* 538 */ "null_ordering_opt ::= NULLS FIRST", - /* 539 */ "null_ordering_opt ::= NULLS LAST", + /* 92 */ "db_options ::= db_options VGROUPS NK_INTEGER", + /* 93 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER", + /* 94 */ "db_options ::= db_options RETENTIONS retention_list", + /* 95 */ "db_options ::= db_options SCHEMALESS NK_INTEGER", + /* 96 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER", + /* 97 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER", + /* 98 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER", + /* 99 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER", + /* 100 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER", + /* 101 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER", + /* 102 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER", + /* 103 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER", + /* 104 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER", + /* 105 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER", + /* 106 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER", + /* 107 */ "alter_db_options ::= alter_db_option", + /* 108 */ "alter_db_options ::= alter_db_options alter_db_option", + /* 109 */ "alter_db_option ::= BUFFER NK_INTEGER", + /* 110 */ "alter_db_option ::= CACHEMODEL NK_STRING", + /* 111 */ "alter_db_option ::= CACHESIZE NK_INTEGER", + /* 112 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER", + /* 113 */ "alter_db_option ::= KEEP integer_list", + /* 114 */ "alter_db_option ::= KEEP variable_list", + /* 115 */ "alter_db_option ::= PAGES NK_INTEGER", + /* 116 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 117 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 118 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 119 */ "integer_list ::= NK_INTEGER", + /* 120 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 121 */ "variable_list ::= NK_VARIABLE", + /* 122 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 123 */ "retention_list ::= retention", + /* 124 */ "retention_list ::= retention_list NK_COMMA retention", + /* 125 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 126 */ "speed_opt ::=", + /* 127 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 128 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 129 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 130 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 131 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 132 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 133 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 134 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 135 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 136 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 137 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 138 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 139 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 140 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 141 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 142 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 143 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 144 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 145 */ "multi_create_clause ::= create_subtable_clause", + /* 146 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 147 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 148 */ "multi_drop_clause ::= drop_table_clause", + /* 149 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 150 */ "drop_table_clause ::= exists_opt full_table_name", + /* 151 */ "specific_cols_opt ::=", + /* 152 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 153 */ "full_table_name ::= table_name", + /* 154 */ "full_table_name ::= db_name NK_DOT table_name", + /* 155 */ "column_def_list ::= column_def", + /* 156 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 157 */ "column_def ::= column_name type_name", + /* 158 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 159 */ "type_name ::= BOOL", + /* 160 */ "type_name ::= TINYINT", + /* 161 */ "type_name ::= SMALLINT", + /* 162 */ "type_name ::= INT", + /* 163 */ "type_name ::= INTEGER", + /* 164 */ "type_name ::= BIGINT", + /* 165 */ "type_name ::= FLOAT", + /* 166 */ "type_name ::= DOUBLE", + /* 167 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 168 */ "type_name ::= TIMESTAMP", + /* 169 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 170 */ "type_name ::= TINYINT UNSIGNED", + /* 171 */ "type_name ::= SMALLINT UNSIGNED", + /* 172 */ "type_name ::= INT UNSIGNED", + /* 173 */ "type_name ::= BIGINT UNSIGNED", + /* 174 */ "type_name ::= JSON", + /* 175 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 176 */ "type_name ::= MEDIUMBLOB", + /* 177 */ "type_name ::= BLOB", + /* 178 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 179 */ "type_name ::= DECIMAL", + /* 180 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 182 */ "tags_def_opt ::=", + /* 183 */ "tags_def_opt ::= tags_def", + /* 184 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 185 */ "table_options ::=", + /* 186 */ "table_options ::= table_options COMMENT NK_STRING", + /* 187 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 188 */ "table_options ::= table_options WATERMARK duration_list", + /* 189 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 190 */ "table_options ::= table_options TTL NK_INTEGER", + /* 191 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 192 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 193 */ "alter_table_options ::= alter_table_option", + /* 194 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 195 */ "alter_table_option ::= COMMENT NK_STRING", + /* 196 */ "alter_table_option ::= TTL NK_INTEGER", + /* 197 */ "duration_list ::= duration_literal", + /* 198 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 199 */ "rollup_func_list ::= rollup_func_name", + /* 200 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 201 */ "rollup_func_name ::= function_name", + /* 202 */ "rollup_func_name ::= FIRST", + /* 203 */ "rollup_func_name ::= LAST", + /* 204 */ "col_name_list ::= col_name", + /* 205 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 206 */ "col_name ::= column_name", + /* 207 */ "cmd ::= SHOW DNODES", + /* 208 */ "cmd ::= SHOW USERS", + /* 209 */ "cmd ::= SHOW USER PRIVILEGES", + /* 210 */ "cmd ::= SHOW DATABASES", + /* 211 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 212 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 213 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 214 */ "cmd ::= SHOW MNODES", + /* 215 */ "cmd ::= SHOW QNODES", + /* 216 */ "cmd ::= SHOW FUNCTIONS", + /* 217 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 218 */ "cmd ::= SHOW STREAMS", + /* 219 */ "cmd ::= SHOW ACCOUNTS", + /* 220 */ "cmd ::= SHOW APPS", + /* 221 */ "cmd ::= SHOW CONNECTIONS", + /* 222 */ "cmd ::= SHOW LICENCES", + /* 223 */ "cmd ::= SHOW GRANTS", + /* 224 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 225 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 226 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 227 */ "cmd ::= SHOW QUERIES", + /* 228 */ "cmd ::= SHOW SCORES", + /* 229 */ "cmd ::= SHOW TOPICS", + /* 230 */ "cmd ::= SHOW VARIABLES", + /* 231 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 232 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 233 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 234 */ "cmd ::= SHOW BNODES", + /* 235 */ "cmd ::= SHOW SNODES", + /* 236 */ "cmd ::= SHOW CLUSTER", + /* 237 */ "cmd ::= SHOW TRANSACTIONS", + /* 238 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 239 */ "cmd ::= SHOW CONSUMERS", + /* 240 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 241 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 242 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 243 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 244 */ "cmd ::= SHOW VNODES NK_STRING", + /* 245 */ "db_name_cond_opt ::=", + /* 246 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 247 */ "like_pattern_opt ::=", + /* 248 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 249 */ "table_name_cond ::= table_name", + /* 250 */ "from_db_opt ::=", + /* 251 */ "from_db_opt ::= FROM db_name", + /* 252 */ "tag_list_opt ::=", + /* 253 */ "tag_list_opt ::= tag_item", + /* 254 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 255 */ "tag_item ::= TBNAME", + /* 256 */ "tag_item ::= QTAGS", + /* 257 */ "tag_item ::= column_name", + /* 258 */ "tag_item ::= column_name column_alias", + /* 259 */ "tag_item ::= column_name AS column_alias", + /* 260 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 261 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 262 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 263 */ "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", + /* 264 */ "func_list ::= func", + /* 265 */ "func_list ::= func_list NK_COMMA func", + /* 266 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 267 */ "sma_stream_opt ::=", + /* 268 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 269 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 270 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 271 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 276 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 277 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 278 */ "cmd ::= DESC full_table_name", + /* 279 */ "cmd ::= DESCRIBE full_table_name", + /* 280 */ "cmd ::= RESET QUERY CACHE", + /* 281 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 282 */ "analyze_opt ::=", + /* 283 */ "analyze_opt ::= ANALYZE", + /* 284 */ "explain_options ::=", + /* 285 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 286 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 287 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 288 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 289 */ "agg_func_opt ::=", + /* 290 */ "agg_func_opt ::= AGGREGATE", + /* 291 */ "bufsize_opt ::=", + /* 292 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 293 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 294 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 295 */ "stream_options ::=", + /* 296 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 297 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 298 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 299 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 300 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 301 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 302 */ "subtable_opt ::=", + /* 303 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 304 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 305 */ "cmd ::= KILL QUERY NK_STRING", + /* 306 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 307 */ "cmd ::= BALANCE VGROUP", + /* 308 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 309 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 310 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 311 */ "dnode_list ::= DNODE NK_INTEGER", + /* 312 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 313 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 314 */ "cmd ::= query_or_subquery", + /* 315 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 316 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 317 */ "literal ::= NK_INTEGER", + /* 318 */ "literal ::= NK_FLOAT", + /* 319 */ "literal ::= NK_STRING", + /* 320 */ "literal ::= NK_BOOL", + /* 321 */ "literal ::= TIMESTAMP NK_STRING", + /* 322 */ "literal ::= duration_literal", + /* 323 */ "literal ::= NULL", + /* 324 */ "literal ::= NK_QUESTION", + /* 325 */ "duration_literal ::= NK_VARIABLE", + /* 326 */ "signed ::= NK_INTEGER", + /* 327 */ "signed ::= NK_PLUS NK_INTEGER", + /* 328 */ "signed ::= NK_MINUS NK_INTEGER", + /* 329 */ "signed ::= NK_FLOAT", + /* 330 */ "signed ::= NK_PLUS NK_FLOAT", + /* 331 */ "signed ::= NK_MINUS NK_FLOAT", + /* 332 */ "signed_literal ::= signed", + /* 333 */ "signed_literal ::= NK_STRING", + /* 334 */ "signed_literal ::= NK_BOOL", + /* 335 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 336 */ "signed_literal ::= duration_literal", + /* 337 */ "signed_literal ::= NULL", + /* 338 */ "signed_literal ::= literal_func", + /* 339 */ "signed_literal ::= NK_QUESTION", + /* 340 */ "literal_list ::= signed_literal", + /* 341 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 342 */ "db_name ::= NK_ID", + /* 343 */ "table_name ::= NK_ID", + /* 344 */ "column_name ::= NK_ID", + /* 345 */ "function_name ::= NK_ID", + /* 346 */ "table_alias ::= NK_ID", + /* 347 */ "column_alias ::= NK_ID", + /* 348 */ "user_name ::= NK_ID", + /* 349 */ "topic_name ::= NK_ID", + /* 350 */ "stream_name ::= NK_ID", + /* 351 */ "cgroup_name ::= NK_ID", + /* 352 */ "expr_or_subquery ::= expression", + /* 353 */ "expression ::= literal", + /* 354 */ "expression ::= pseudo_column", + /* 355 */ "expression ::= column_reference", + /* 356 */ "expression ::= function_expression", + /* 357 */ "expression ::= case_when_expression", + /* 358 */ "expression ::= NK_LP expression NK_RP", + /* 359 */ "expression ::= NK_PLUS expr_or_subquery", + /* 360 */ "expression ::= NK_MINUS expr_or_subquery", + /* 361 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 362 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 366 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 367 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 368 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 369 */ "expression_list ::= expr_or_subquery", + /* 370 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 371 */ "column_reference ::= column_name", + /* 372 */ "column_reference ::= table_name NK_DOT column_name", + /* 373 */ "pseudo_column ::= ROWTS", + /* 374 */ "pseudo_column ::= TBNAME", + /* 375 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 376 */ "pseudo_column ::= QSTART", + /* 377 */ "pseudo_column ::= QEND", + /* 378 */ "pseudo_column ::= QDURATION", + /* 379 */ "pseudo_column ::= WSTART", + /* 380 */ "pseudo_column ::= WEND", + /* 381 */ "pseudo_column ::= WDURATION", + /* 382 */ "pseudo_column ::= IROWTS", + /* 383 */ "pseudo_column ::= QTAGS", + /* 384 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 385 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 386 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 387 */ "function_expression ::= literal_func", + /* 388 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 389 */ "literal_func ::= NOW", + /* 390 */ "noarg_func ::= NOW", + /* 391 */ "noarg_func ::= TODAY", + /* 392 */ "noarg_func ::= TIMEZONE", + /* 393 */ "noarg_func ::= DATABASE", + /* 394 */ "noarg_func ::= CLIENT_VERSION", + /* 395 */ "noarg_func ::= SERVER_VERSION", + /* 396 */ "noarg_func ::= SERVER_STATUS", + /* 397 */ "noarg_func ::= CURRENT_USER", + /* 398 */ "noarg_func ::= USER", + /* 399 */ "star_func ::= COUNT", + /* 400 */ "star_func ::= FIRST", + /* 401 */ "star_func ::= LAST", + /* 402 */ "star_func ::= LAST_ROW", + /* 403 */ "star_func_para_list ::= NK_STAR", + /* 404 */ "star_func_para_list ::= other_para_list", + /* 405 */ "other_para_list ::= star_func_para", + /* 406 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 407 */ "star_func_para ::= expr_or_subquery", + /* 408 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 409 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 410 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 411 */ "when_then_list ::= when_then_expr", + /* 412 */ "when_then_list ::= when_then_list when_then_expr", + /* 413 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 414 */ "case_when_else_opt ::=", + /* 415 */ "case_when_else_opt ::= ELSE common_expression", + /* 416 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 417 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 418 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery IS NULL", + /* 420 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 421 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 422 */ "compare_op ::= NK_LT", + /* 423 */ "compare_op ::= NK_GT", + /* 424 */ "compare_op ::= NK_LE", + /* 425 */ "compare_op ::= NK_GE", + /* 426 */ "compare_op ::= NK_NE", + /* 427 */ "compare_op ::= NK_EQ", + /* 428 */ "compare_op ::= LIKE", + /* 429 */ "compare_op ::= NOT LIKE", + /* 430 */ "compare_op ::= MATCH", + /* 431 */ "compare_op ::= NMATCH", + /* 432 */ "compare_op ::= CONTAINS", + /* 433 */ "in_op ::= IN", + /* 434 */ "in_op ::= NOT IN", + /* 435 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 436 */ "boolean_value_expression ::= boolean_primary", + /* 437 */ "boolean_value_expression ::= NOT boolean_primary", + /* 438 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 439 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 440 */ "boolean_primary ::= predicate", + /* 441 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 442 */ "common_expression ::= expr_or_subquery", + /* 443 */ "common_expression ::= boolean_value_expression", + /* 444 */ "from_clause_opt ::=", + /* 445 */ "from_clause_opt ::= FROM table_reference_list", + /* 446 */ "table_reference_list ::= table_reference", + /* 447 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 448 */ "table_reference ::= table_primary", + /* 449 */ "table_reference ::= joined_table", + /* 450 */ "table_primary ::= table_name alias_opt", + /* 451 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 452 */ "table_primary ::= subquery alias_opt", + /* 453 */ "table_primary ::= parenthesized_joined_table", + /* 454 */ "alias_opt ::=", + /* 455 */ "alias_opt ::= table_alias", + /* 456 */ "alias_opt ::= AS table_alias", + /* 457 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 458 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 459 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 460 */ "join_type ::=", + /* 461 */ "join_type ::= INNER", + /* 462 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 463 */ "set_quantifier_opt ::=", + /* 464 */ "set_quantifier_opt ::= DISTINCT", + /* 465 */ "set_quantifier_opt ::= ALL", + /* 466 */ "select_list ::= select_item", + /* 467 */ "select_list ::= select_list NK_COMMA select_item", + /* 468 */ "select_item ::= NK_STAR", + /* 469 */ "select_item ::= common_expression", + /* 470 */ "select_item ::= common_expression column_alias", + /* 471 */ "select_item ::= common_expression AS column_alias", + /* 472 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 473 */ "where_clause_opt ::=", + /* 474 */ "where_clause_opt ::= WHERE search_condition", + /* 475 */ "partition_by_clause_opt ::=", + /* 476 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 477 */ "partition_list ::= partition_item", + /* 478 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 479 */ "partition_item ::= expr_or_subquery", + /* 480 */ "partition_item ::= expr_or_subquery column_alias", + /* 481 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 482 */ "twindow_clause_opt ::=", + /* 483 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 484 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 485 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 487 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 488 */ "sliding_opt ::=", + /* 489 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 490 */ "fill_opt ::=", + /* 491 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 492 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 493 */ "fill_mode ::= NONE", + /* 494 */ "fill_mode ::= PREV", + /* 495 */ "fill_mode ::= NULL", + /* 496 */ "fill_mode ::= LINEAR", + /* 497 */ "fill_mode ::= NEXT", + /* 498 */ "group_by_clause_opt ::=", + /* 499 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 500 */ "group_by_list ::= expr_or_subquery", + /* 501 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 502 */ "having_clause_opt ::=", + /* 503 */ "having_clause_opt ::= HAVING search_condition", + /* 504 */ "range_opt ::=", + /* 505 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 506 */ "every_opt ::=", + /* 507 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 508 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 509 */ "query_simple ::= query_specification", + /* 510 */ "query_simple ::= union_query_expression", + /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 513 */ "query_simple_or_subquery ::= query_simple", + /* 514 */ "query_simple_or_subquery ::= subquery", + /* 515 */ "query_or_subquery ::= query_expression", + /* 516 */ "query_or_subquery ::= subquery", + /* 517 */ "order_by_clause_opt ::=", + /* 518 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 519 */ "slimit_clause_opt ::=", + /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 523 */ "limit_clause_opt ::=", + /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 527 */ "subquery ::= NK_LP query_expression NK_RP", + /* 528 */ "subquery ::= NK_LP subquery NK_RP", + /* 529 */ "search_condition ::= common_expression", + /* 530 */ "sort_specification_list ::= sort_specification", + /* 531 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 532 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 533 */ "ordering_specification_opt ::=", + /* 534 */ "ordering_specification_opt ::= ASC", + /* 535 */ "ordering_specification_opt ::= DESC", + /* 536 */ "null_ordering_opt ::=", + /* 537 */ "null_ordering_opt ::= NULLS FIRST", + /* 538 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2462,193 +2561,193 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 322: /* cmd */ - case 325: /* literal */ - case 338: /* db_options */ - case 340: /* alter_db_options */ - case 346: /* retention */ - case 347: /* full_table_name */ - case 350: /* table_options */ - case 354: /* alter_table_clause */ - case 355: /* alter_table_options */ - case 358: /* signed_literal */ - case 359: /* create_subtable_clause */ - case 362: /* drop_table_clause */ - case 365: /* column_def */ - case 369: /* duration_literal */ - case 370: /* rollup_func_name */ - case 372: /* col_name */ - case 373: /* db_name_cond_opt */ - case 374: /* like_pattern_opt */ - case 375: /* table_name_cond */ - case 376: /* from_db_opt */ - case 378: /* tag_item */ - case 380: /* index_options */ - case 382: /* sliding_opt */ - case 383: /* sma_stream_opt */ - case 384: /* func */ - case 385: /* query_or_subquery */ - case 388: /* explain_options */ - case 392: /* stream_options */ - case 393: /* subtable_opt */ - case 394: /* expression */ - case 396: /* where_clause_opt */ - case 397: /* signed */ - case 398: /* literal_func */ - case 401: /* expr_or_subquery */ - case 402: /* pseudo_column */ - case 403: /* column_reference */ - case 404: /* function_expression */ - case 405: /* case_when_expression */ - case 410: /* star_func_para */ - case 412: /* case_when_else_opt */ - case 413: /* common_expression */ - case 414: /* when_then_expr */ - case 415: /* predicate */ - case 418: /* in_predicate_value */ - case 419: /* boolean_value_expression */ - case 420: /* boolean_primary */ - case 421: /* from_clause_opt */ - case 422: /* table_reference_list */ - case 423: /* table_reference */ - case 424: /* table_primary */ - case 425: /* joined_table */ - case 427: /* subquery */ - case 428: /* parenthesized_joined_table */ - case 430: /* search_condition */ - case 431: /* query_specification */ - case 435: /* range_opt */ - case 436: /* every_opt */ - case 437: /* fill_opt */ - case 438: /* twindow_clause_opt */ - case 440: /* having_clause_opt */ - case 441: /* select_item */ - case 443: /* partition_item */ - case 446: /* query_expression */ - case 447: /* query_simple */ - case 449: /* slimit_clause_opt */ - case 450: /* limit_clause_opt */ - case 451: /* union_query_expression */ - case 452: /* query_simple_or_subquery */ - case 454: /* sort_specification */ + case 324: /* cmd */ + case 327: /* literal */ + case 340: /* db_options */ + case 342: /* alter_db_options */ + case 348: /* retention */ + case 349: /* full_table_name */ + case 352: /* table_options */ + case 356: /* alter_table_clause */ + case 357: /* alter_table_options */ + case 360: /* signed_literal */ + case 361: /* create_subtable_clause */ + case 364: /* drop_table_clause */ + case 367: /* column_def */ + case 371: /* duration_literal */ + case 372: /* rollup_func_name */ + case 374: /* col_name */ + case 375: /* db_name_cond_opt */ + case 376: /* like_pattern_opt */ + case 377: /* table_name_cond */ + case 378: /* from_db_opt */ + case 380: /* tag_item */ + case 382: /* index_options */ + case 384: /* sliding_opt */ + case 385: /* sma_stream_opt */ + case 386: /* func */ + case 387: /* query_or_subquery */ + case 390: /* explain_options */ + case 394: /* stream_options */ + case 395: /* subtable_opt */ + case 396: /* expression */ + case 398: /* where_clause_opt */ + case 399: /* signed */ + case 400: /* literal_func */ + case 403: /* expr_or_subquery */ + case 404: /* pseudo_column */ + case 405: /* column_reference */ + case 406: /* function_expression */ + case 407: /* case_when_expression */ + case 412: /* star_func_para */ + case 414: /* case_when_else_opt */ + case 415: /* common_expression */ + case 416: /* when_then_expr */ + case 417: /* predicate */ + case 420: /* in_predicate_value */ + case 421: /* boolean_value_expression */ + case 422: /* boolean_primary */ + case 423: /* from_clause_opt */ + case 424: /* table_reference_list */ + case 425: /* table_reference */ + case 426: /* table_primary */ + case 427: /* joined_table */ + case 429: /* subquery */ + case 430: /* parenthesized_joined_table */ + case 432: /* search_condition */ + case 433: /* query_specification */ + case 437: /* range_opt */ + case 438: /* every_opt */ + case 439: /* fill_opt */ + case 440: /* twindow_clause_opt */ + case 442: /* having_clause_opt */ + case 443: /* select_item */ + case 445: /* partition_item */ + case 448: /* query_expression */ + case 449: /* query_simple */ + case 451: /* slimit_clause_opt */ + case 452: /* limit_clause_opt */ + case 453: /* union_query_expression */ + case 454: /* query_simple_or_subquery */ + case 456: /* sort_specification */ { - nodesDestroyNode((yypminor->yy148)); + nodesDestroyNode((yypminor->yy74)); } break; - case 323: /* account_options */ - case 324: /* alter_account_options */ - case 326: /* alter_account_option */ - case 341: /* speed_opt */ - case 390: /* bufsize_opt */ + case 325: /* account_options */ + case 326: /* alter_account_options */ + case 328: /* alter_account_option */ + case 343: /* speed_opt */ + case 392: /* bufsize_opt */ { } break; - case 327: /* user_name */ - case 330: /* priv_level */ - case 333: /* db_name */ - case 334: /* topic_name */ - case 335: /* dnode_endpoint */ - case 356: /* column_name */ - case 364: /* table_name */ - case 371: /* function_name */ - case 379: /* column_alias */ - case 386: /* cgroup_name */ - case 391: /* stream_name */ - case 400: /* table_alias */ - case 406: /* star_func */ - case 408: /* noarg_func */ - case 426: /* alias_opt */ + case 329: /* user_name */ + case 332: /* priv_level */ + case 335: /* db_name */ + case 336: /* topic_name */ + case 337: /* dnode_endpoint */ + case 358: /* column_name */ + case 366: /* table_name */ + case 373: /* function_name */ + case 381: /* column_alias */ + case 388: /* cgroup_name */ + case 393: /* stream_name */ + case 402: /* table_alias */ + case 408: /* star_func */ + case 410: /* noarg_func */ + case 428: /* alias_opt */ { } break; - case 328: /* sysinfo_opt */ + case 330: /* sysinfo_opt */ { } break; - case 329: /* privileges */ - case 331: /* priv_type_list */ - case 332: /* priv_type */ + case 331: /* privileges */ + case 333: /* priv_type_list */ + case 334: /* priv_type */ { } break; - case 336: /* force_opt */ - case 337: /* not_exists_opt */ - case 339: /* exists_opt */ - case 387: /* analyze_opt */ - case 389: /* agg_func_opt */ - case 432: /* set_quantifier_opt */ + case 338: /* force_opt */ + case 339: /* not_exists_opt */ + case 341: /* exists_opt */ + case 389: /* analyze_opt */ + case 391: /* agg_func_opt */ + case 434: /* set_quantifier_opt */ { } break; - case 342: /* integer_list */ - case 343: /* variable_list */ - case 344: /* retention_list */ - case 348: /* column_def_list */ - case 349: /* tags_def_opt */ - case 351: /* multi_create_clause */ - case 352: /* tags_def */ - case 353: /* multi_drop_clause */ - case 360: /* specific_cols_opt */ - case 361: /* expression_list */ - case 363: /* col_name_list */ - case 366: /* duration_list */ - case 367: /* rollup_func_list */ - case 377: /* tag_list_opt */ - case 381: /* func_list */ - case 395: /* dnode_list */ - case 399: /* literal_list */ - case 407: /* star_func_para_list */ - case 409: /* other_para_list */ - case 411: /* when_then_list */ - case 433: /* select_list */ - case 434: /* partition_by_clause_opt */ - case 439: /* group_by_clause_opt */ - case 442: /* partition_list */ - case 445: /* group_by_list */ - case 448: /* order_by_clause_opt */ - case 453: /* sort_specification_list */ + case 344: /* integer_list */ + case 345: /* variable_list */ + case 346: /* retention_list */ + case 350: /* column_def_list */ + case 351: /* tags_def_opt */ + case 353: /* multi_create_clause */ + case 354: /* tags_def */ + case 355: /* multi_drop_clause */ + case 362: /* specific_cols_opt */ + case 363: /* expression_list */ + case 365: /* col_name_list */ + case 368: /* duration_list */ + case 369: /* rollup_func_list */ + case 379: /* tag_list_opt */ + case 383: /* func_list */ + case 397: /* dnode_list */ + case 401: /* literal_list */ + case 409: /* star_func_para_list */ + case 411: /* other_para_list */ + case 413: /* when_then_list */ + case 435: /* select_list */ + case 436: /* partition_by_clause_opt */ + case 441: /* group_by_clause_opt */ + case 444: /* partition_list */ + case 447: /* group_by_list */ + case 450: /* order_by_clause_opt */ + case 455: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy404)); + nodesDestroyList((yypminor->yy874)); } break; - case 345: /* alter_db_option */ - case 368: /* alter_table_option */ + case 347: /* alter_db_option */ + case 370: /* alter_table_option */ { } break; - case 357: /* type_name */ + case 359: /* type_name */ { } break; - case 416: /* compare_op */ - case 417: /* in_op */ + case 418: /* compare_op */ + case 419: /* in_op */ { } break; - case 429: /* join_type */ + case 431: /* join_type */ { } break; - case 444: /* fill_mode */ + case 446: /* fill_mode */ { } break; - case 455: /* ordering_specification_opt */ + case 457: /* ordering_specification_opt */ { } break; - case 456: /* null_ordering_opt */ + case 458: /* null_ordering_opt */ { } @@ -2947,546 +3046,545 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 322, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 322, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 323, 0 }, /* (2) account_options ::= */ - { 323, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 323, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 323, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 323, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 323, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 323, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 323, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 323, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 323, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 324, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 324, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 326, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 326, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 326, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 326, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 326, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 326, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 326, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 326, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 326, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 326, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 322, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 322, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 322, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 322, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 322, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 328, 0 }, /* (29) sysinfo_opt ::= */ - { 328, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 322, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 322, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 329, -1 }, /* (33) privileges ::= ALL */ - { 329, -1 }, /* (34) privileges ::= priv_type_list */ - { 329, -1 }, /* (35) privileges ::= SUBSCRIBE */ - { 331, -1 }, /* (36) priv_type_list ::= priv_type */ - { 331, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 332, -1 }, /* (38) priv_type ::= READ */ - { 332, -1 }, /* (39) priv_type ::= WRITE */ - { 330, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 330, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ - { 330, -1 }, /* (42) priv_level ::= topic_name */ - { 322, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ - { 322, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 322, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ - { 322, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ - { 322, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 322, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 322, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ - { 322, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 335, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ - { 335, -1 }, /* (52) dnode_endpoint ::= NK_ID */ - { 335, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ - { 336, 0 }, /* (54) force_opt ::= */ - { 336, -1 }, /* (55) force_opt ::= FORCE */ - { 322, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ - { 322, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 322, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 322, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 322, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ - { 322, -2 }, /* (68) cmd ::= USE db_name */ - { 322, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 322, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ - { 322, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ - { 337, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ - { 337, 0 }, /* (73) not_exists_opt ::= */ - { 339, -2 }, /* (74) exists_opt ::= IF EXISTS */ - { 339, 0 }, /* (75) exists_opt ::= */ - { 338, 0 }, /* (76) db_options ::= */ - { 338, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ - { 338, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ - { 338, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 338, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ - { 338, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ - { 338, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ - { 338, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ - { 338, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ - { 338, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ - { 338, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ - { 338, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ - { 338, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 338, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - { 338, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ - { 338, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ - { 338, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ - { 338, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 338, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 338, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 338, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 338, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 338, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 338, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 338, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 338, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 338, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 338, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 338, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 338, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 338, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 338, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 340, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 340, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 345, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 345, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 345, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 345, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 345, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 345, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 345, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 345, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 345, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ - { 345, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 345, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 342, -1 }, /* (121) integer_list ::= NK_INTEGER */ - { 342, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 343, -1 }, /* (123) variable_list ::= NK_VARIABLE */ - { 343, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 344, -1 }, /* (125) retention_list ::= retention */ - { 344, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ - { 346, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 341, 0 }, /* (128) speed_opt ::= */ - { 341, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 322, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 322, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ - { 322, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 322, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ - { 322, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ - { 322, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ - { 322, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ - { 354, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ - { 354, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 354, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 354, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 354, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 354, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 354, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 354, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 354, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 354, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 351, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ - { 351, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 359, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 353, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ - { 353, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 362, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ - { 360, 0 }, /* (153) specific_cols_opt ::= */ - { 360, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 347, -1 }, /* (155) full_table_name ::= table_name */ - { 347, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ - { 348, -1 }, /* (157) column_def_list ::= column_def */ - { 348, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ - { 365, -2 }, /* (159) column_def ::= column_name type_name */ - { 365, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ - { 357, -1 }, /* (161) type_name ::= BOOL */ - { 357, -1 }, /* (162) type_name ::= TINYINT */ - { 357, -1 }, /* (163) type_name ::= SMALLINT */ - { 357, -1 }, /* (164) type_name ::= INT */ - { 357, -1 }, /* (165) type_name ::= INTEGER */ - { 357, -1 }, /* (166) type_name ::= BIGINT */ - { 357, -1 }, /* (167) type_name ::= FLOAT */ - { 357, -1 }, /* (168) type_name ::= DOUBLE */ - { 357, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (170) type_name ::= TIMESTAMP */ - { 357, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ - { 357, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ - { 357, -2 }, /* (174) type_name ::= INT UNSIGNED */ - { 357, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ - { 357, -1 }, /* (176) type_name ::= JSON */ - { 357, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (178) type_name ::= MEDIUMBLOB */ - { 357, -1 }, /* (179) type_name ::= BLOB */ - { 357, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 357, -1 }, /* (181) type_name ::= DECIMAL */ - { 357, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 357, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 349, 0 }, /* (184) tags_def_opt ::= */ - { 349, -1 }, /* (185) tags_def_opt ::= tags_def */ - { 352, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 350, 0 }, /* (187) table_options ::= */ - { 350, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ - { 350, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ - { 350, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ - { 350, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 350, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ - { 350, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 350, -3 }, /* (194) table_options ::= table_options DELETE_MARK duration_list */ - { 355, -1 }, /* (195) alter_table_options ::= alter_table_option */ - { 355, -2 }, /* (196) alter_table_options ::= alter_table_options alter_table_option */ - { 368, -2 }, /* (197) alter_table_option ::= COMMENT NK_STRING */ - { 368, -2 }, /* (198) alter_table_option ::= TTL NK_INTEGER */ - { 366, -1 }, /* (199) duration_list ::= duration_literal */ - { 366, -3 }, /* (200) duration_list ::= duration_list NK_COMMA duration_literal */ - { 367, -1 }, /* (201) rollup_func_list ::= rollup_func_name */ - { 367, -3 }, /* (202) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 370, -1 }, /* (203) rollup_func_name ::= function_name */ - { 370, -1 }, /* (204) rollup_func_name ::= FIRST */ - { 370, -1 }, /* (205) rollup_func_name ::= LAST */ - { 363, -1 }, /* (206) col_name_list ::= col_name */ - { 363, -3 }, /* (207) col_name_list ::= col_name_list NK_COMMA col_name */ - { 372, -1 }, /* (208) col_name ::= column_name */ - { 322, -2 }, /* (209) cmd ::= SHOW DNODES */ - { 322, -2 }, /* (210) cmd ::= SHOW USERS */ - { 322, -3 }, /* (211) cmd ::= SHOW USER PRIVILEGES */ - { 322, -2 }, /* (212) cmd ::= SHOW DATABASES */ - { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 322, -4 }, /* (214) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 322, -3 }, /* (215) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 322, -2 }, /* (216) cmd ::= SHOW MNODES */ - { 322, -2 }, /* (217) cmd ::= SHOW QNODES */ - { 322, -2 }, /* (218) cmd ::= SHOW FUNCTIONS */ - { 322, -5 }, /* (219) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 322, -2 }, /* (220) cmd ::= SHOW STREAMS */ - { 322, -2 }, /* (221) cmd ::= SHOW ACCOUNTS */ - { 322, -2 }, /* (222) cmd ::= SHOW APPS */ - { 322, -2 }, /* (223) cmd ::= SHOW CONNECTIONS */ - { 322, -2 }, /* (224) cmd ::= SHOW LICENCES */ - { 322, -2 }, /* (225) cmd ::= SHOW GRANTS */ - { 322, -4 }, /* (226) cmd ::= SHOW CREATE DATABASE db_name */ - { 322, -4 }, /* (227) cmd ::= SHOW CREATE TABLE full_table_name */ - { 322, -4 }, /* (228) cmd ::= SHOW CREATE STABLE full_table_name */ - { 322, -2 }, /* (229) cmd ::= SHOW QUERIES */ - { 322, -2 }, /* (230) cmd ::= SHOW SCORES */ - { 322, -2 }, /* (231) cmd ::= SHOW TOPICS */ - { 322, -2 }, /* (232) cmd ::= SHOW VARIABLES */ - { 322, -3 }, /* (233) cmd ::= SHOW CLUSTER VARIABLES */ - { 322, -3 }, /* (234) cmd ::= SHOW LOCAL VARIABLES */ - { 322, -5 }, /* (235) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 322, -2 }, /* (236) cmd ::= SHOW BNODES */ - { 322, -2 }, /* (237) cmd ::= SHOW SNODES */ - { 322, -2 }, /* (238) cmd ::= SHOW CLUSTER */ - { 322, -2 }, /* (239) cmd ::= SHOW TRANSACTIONS */ - { 322, -4 }, /* (240) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 322, -2 }, /* (241) cmd ::= SHOW CONSUMERS */ - { 322, -2 }, /* (242) cmd ::= SHOW SUBSCRIPTIONS */ - { 322, -5 }, /* (243) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 322, -7 }, /* (244) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_INTEGER */ - { 322, -3 }, /* (246) cmd ::= SHOW VNODES NK_STRING */ - { 373, 0 }, /* (247) db_name_cond_opt ::= */ - { 373, -2 }, /* (248) db_name_cond_opt ::= db_name NK_DOT */ - { 374, 0 }, /* (249) like_pattern_opt ::= */ - { 374, -2 }, /* (250) like_pattern_opt ::= LIKE NK_STRING */ - { 375, -1 }, /* (251) table_name_cond ::= table_name */ - { 376, 0 }, /* (252) from_db_opt ::= */ - { 376, -2 }, /* (253) from_db_opt ::= FROM db_name */ - { 377, 0 }, /* (254) tag_list_opt ::= */ - { 377, -1 }, /* (255) tag_list_opt ::= tag_item */ - { 377, -3 }, /* (256) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 378, -1 }, /* (257) tag_item ::= TBNAME */ - { 378, -1 }, /* (258) tag_item ::= QTAGS */ - { 378, -1 }, /* (259) tag_item ::= column_name */ - { 378, -2 }, /* (260) tag_item ::= column_name column_alias */ - { 378, -3 }, /* (261) tag_item ::= column_name AS column_alias */ - { 322, -8 }, /* (262) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 322, -4 }, /* (263) cmd ::= DROP INDEX exists_opt full_table_name */ - { 380, -10 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 380, -12 }, /* (265) 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 */ - { 381, -1 }, /* (266) func_list ::= func */ - { 381, -3 }, /* (267) func_list ::= func_list NK_COMMA func */ - { 384, -4 }, /* (268) func ::= function_name NK_LP expression_list NK_RP */ - { 383, 0 }, /* (269) sma_stream_opt ::= */ - { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - { 383, -3 }, /* (272) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - { 322, -6 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 322, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 322, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 322, -7 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 322, -9 }, /* (277) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 322, -4 }, /* (278) cmd ::= DROP TOPIC exists_opt topic_name */ - { 322, -7 }, /* (279) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 322, -2 }, /* (280) cmd ::= DESC full_table_name */ - { 322, -2 }, /* (281) cmd ::= DESCRIBE full_table_name */ - { 322, -3 }, /* (282) cmd ::= RESET QUERY CACHE */ - { 322, -4 }, /* (283) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (284) analyze_opt ::= */ - { 387, -1 }, /* (285) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (286) explain_options ::= */ - { 388, -3 }, /* (287) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (288) explain_options ::= explain_options RATIO NK_FLOAT */ - { 322, -10 }, /* (289) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 322, -4 }, /* (290) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (291) agg_func_opt ::= */ - { 389, -1 }, /* (292) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (293) bufsize_opt ::= */ - { 390, -2 }, /* (294) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 322, -11 }, /* (295) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 322, -4 }, /* (296) cmd ::= DROP STREAM exists_opt stream_name */ - { 392, 0 }, /* (297) stream_options ::= */ - { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 392, -3 }, /* (299) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 392, -4 }, /* (300) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 392, -3 }, /* (301) stream_options ::= stream_options WATERMARK duration_literal */ - { 392, -4 }, /* (302) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 392, -3 }, /* (303) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 393, 0 }, /* (304) subtable_opt ::= */ - { 393, -4 }, /* (305) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 322, -3 }, /* (306) cmd ::= KILL CONNECTION NK_INTEGER */ - { 322, -3 }, /* (307) cmd ::= KILL QUERY NK_STRING */ - { 322, -3 }, /* (308) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 322, -2 }, /* (309) cmd ::= BALANCE VGROUP */ - { 322, -4 }, /* (310) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 322, -4 }, /* (311) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 322, -3 }, /* (312) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 395, -2 }, /* (313) dnode_list ::= DNODE NK_INTEGER */ - { 395, -3 }, /* (314) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 322, -4 }, /* (315) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 322, -1 }, /* (316) cmd ::= query_or_subquery */ - { 322, -7 }, /* (317) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 322, -4 }, /* (318) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 325, -1 }, /* (319) literal ::= NK_INTEGER */ - { 325, -1 }, /* (320) literal ::= NK_FLOAT */ - { 325, -1 }, /* (321) literal ::= NK_STRING */ - { 325, -1 }, /* (322) literal ::= NK_BOOL */ - { 325, -2 }, /* (323) literal ::= TIMESTAMP NK_STRING */ - { 325, -1 }, /* (324) literal ::= duration_literal */ - { 325, -1 }, /* (325) literal ::= NULL */ - { 325, -1 }, /* (326) literal ::= NK_QUESTION */ - { 369, -1 }, /* (327) duration_literal ::= NK_VARIABLE */ - { 397, -1 }, /* (328) signed ::= NK_INTEGER */ - { 397, -2 }, /* (329) signed ::= NK_PLUS NK_INTEGER */ - { 397, -2 }, /* (330) signed ::= NK_MINUS NK_INTEGER */ - { 397, -1 }, /* (331) signed ::= NK_FLOAT */ - { 397, -2 }, /* (332) signed ::= NK_PLUS NK_FLOAT */ - { 397, -2 }, /* (333) signed ::= NK_MINUS NK_FLOAT */ - { 358, -1 }, /* (334) signed_literal ::= signed */ - { 358, -1 }, /* (335) signed_literal ::= NK_STRING */ - { 358, -1 }, /* (336) signed_literal ::= NK_BOOL */ - { 358, -2 }, /* (337) signed_literal ::= TIMESTAMP NK_STRING */ - { 358, -1 }, /* (338) signed_literal ::= duration_literal */ - { 358, -1 }, /* (339) signed_literal ::= NULL */ - { 358, -1 }, /* (340) signed_literal ::= literal_func */ - { 358, -1 }, /* (341) signed_literal ::= NK_QUESTION */ - { 399, -1 }, /* (342) literal_list ::= signed_literal */ - { 399, -3 }, /* (343) literal_list ::= literal_list NK_COMMA signed_literal */ - { 333, -1 }, /* (344) db_name ::= NK_ID */ - { 364, -1 }, /* (345) table_name ::= NK_ID */ - { 356, -1 }, /* (346) column_name ::= NK_ID */ - { 371, -1 }, /* (347) function_name ::= NK_ID */ - { 400, -1 }, /* (348) table_alias ::= NK_ID */ - { 379, -1 }, /* (349) column_alias ::= NK_ID */ - { 327, -1 }, /* (350) user_name ::= NK_ID */ - { 334, -1 }, /* (351) topic_name ::= NK_ID */ - { 391, -1 }, /* (352) stream_name ::= NK_ID */ - { 386, -1 }, /* (353) cgroup_name ::= NK_ID */ - { 401, -1 }, /* (354) expr_or_subquery ::= expression */ - { 394, -1 }, /* (355) expression ::= literal */ - { 394, -1 }, /* (356) expression ::= pseudo_column */ - { 394, -1 }, /* (357) expression ::= column_reference */ - { 394, -1 }, /* (358) expression ::= function_expression */ - { 394, -1 }, /* (359) expression ::= case_when_expression */ - { 394, -3 }, /* (360) expression ::= NK_LP expression NK_RP */ - { 394, -2 }, /* (361) expression ::= NK_PLUS expr_or_subquery */ - { 394, -2 }, /* (362) expression ::= NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 394, -3 }, /* (367) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 394, -3 }, /* (368) expression ::= column_reference NK_ARROW NK_STRING */ - { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 394, -3 }, /* (370) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 361, -1 }, /* (371) expression_list ::= expr_or_subquery */ - { 361, -3 }, /* (372) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 403, -1 }, /* (373) column_reference ::= column_name */ - { 403, -3 }, /* (374) column_reference ::= table_name NK_DOT column_name */ - { 402, -1 }, /* (375) pseudo_column ::= ROWTS */ - { 402, -1 }, /* (376) pseudo_column ::= TBNAME */ - { 402, -3 }, /* (377) pseudo_column ::= table_name NK_DOT TBNAME */ - { 402, -1 }, /* (378) pseudo_column ::= QSTART */ - { 402, -1 }, /* (379) pseudo_column ::= QEND */ - { 402, -1 }, /* (380) pseudo_column ::= QDURATION */ - { 402, -1 }, /* (381) pseudo_column ::= WSTART */ - { 402, -1 }, /* (382) pseudo_column ::= WEND */ - { 402, -1 }, /* (383) pseudo_column ::= WDURATION */ - { 402, -1 }, /* (384) pseudo_column ::= IROWTS */ - { 402, -1 }, /* (385) pseudo_column ::= QTAGS */ - { 404, -4 }, /* (386) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 404, -4 }, /* (387) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 404, -6 }, /* (388) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 404, -1 }, /* (389) function_expression ::= literal_func */ - { 398, -3 }, /* (390) literal_func ::= noarg_func NK_LP NK_RP */ - { 398, -1 }, /* (391) literal_func ::= NOW */ - { 408, -1 }, /* (392) noarg_func ::= NOW */ - { 408, -1 }, /* (393) noarg_func ::= TODAY */ - { 408, -1 }, /* (394) noarg_func ::= TIMEZONE */ - { 408, -1 }, /* (395) noarg_func ::= DATABASE */ - { 408, -1 }, /* (396) noarg_func ::= CLIENT_VERSION */ - { 408, -1 }, /* (397) noarg_func ::= SERVER_VERSION */ - { 408, -1 }, /* (398) noarg_func ::= SERVER_STATUS */ - { 408, -1 }, /* (399) noarg_func ::= CURRENT_USER */ - { 408, -1 }, /* (400) noarg_func ::= USER */ - { 406, -1 }, /* (401) star_func ::= COUNT */ - { 406, -1 }, /* (402) star_func ::= FIRST */ - { 406, -1 }, /* (403) star_func ::= LAST */ - { 406, -1 }, /* (404) star_func ::= LAST_ROW */ - { 407, -1 }, /* (405) star_func_para_list ::= NK_STAR */ - { 407, -1 }, /* (406) star_func_para_list ::= other_para_list */ - { 409, -1 }, /* (407) other_para_list ::= star_func_para */ - { 409, -3 }, /* (408) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 410, -1 }, /* (409) star_func_para ::= expr_or_subquery */ - { 410, -3 }, /* (410) star_func_para ::= table_name NK_DOT NK_STAR */ - { 405, -4 }, /* (411) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 405, -5 }, /* (412) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 411, -1 }, /* (413) when_then_list ::= when_then_expr */ - { 411, -2 }, /* (414) when_then_list ::= when_then_list when_then_expr */ - { 414, -4 }, /* (415) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 412, 0 }, /* (416) case_when_else_opt ::= */ - { 412, -2 }, /* (417) case_when_else_opt ::= ELSE common_expression */ - { 415, -3 }, /* (418) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 415, -5 }, /* (419) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -6 }, /* (420) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 415, -3 }, /* (421) predicate ::= expr_or_subquery IS NULL */ - { 415, -4 }, /* (422) predicate ::= expr_or_subquery IS NOT NULL */ - { 415, -3 }, /* (423) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 416, -1 }, /* (424) compare_op ::= NK_LT */ - { 416, -1 }, /* (425) compare_op ::= NK_GT */ - { 416, -1 }, /* (426) compare_op ::= NK_LE */ - { 416, -1 }, /* (427) compare_op ::= NK_GE */ - { 416, -1 }, /* (428) compare_op ::= NK_NE */ - { 416, -1 }, /* (429) compare_op ::= NK_EQ */ - { 416, -1 }, /* (430) compare_op ::= LIKE */ - { 416, -2 }, /* (431) compare_op ::= NOT LIKE */ - { 416, -1 }, /* (432) compare_op ::= MATCH */ - { 416, -1 }, /* (433) compare_op ::= NMATCH */ - { 416, -1 }, /* (434) compare_op ::= CONTAINS */ - { 417, -1 }, /* (435) in_op ::= IN */ - { 417, -2 }, /* (436) in_op ::= NOT IN */ - { 418, -3 }, /* (437) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 419, -1 }, /* (438) boolean_value_expression ::= boolean_primary */ - { 419, -2 }, /* (439) boolean_value_expression ::= NOT boolean_primary */ - { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 419, -3 }, /* (441) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 420, -1 }, /* (442) boolean_primary ::= predicate */ - { 420, -3 }, /* (443) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 413, -1 }, /* (444) common_expression ::= expr_or_subquery */ - { 413, -1 }, /* (445) common_expression ::= boolean_value_expression */ - { 421, 0 }, /* (446) from_clause_opt ::= */ - { 421, -2 }, /* (447) from_clause_opt ::= FROM table_reference_list */ - { 422, -1 }, /* (448) table_reference_list ::= table_reference */ - { 422, -3 }, /* (449) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 423, -1 }, /* (450) table_reference ::= table_primary */ - { 423, -1 }, /* (451) table_reference ::= joined_table */ - { 424, -2 }, /* (452) table_primary ::= table_name alias_opt */ - { 424, -4 }, /* (453) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 424, -2 }, /* (454) table_primary ::= subquery alias_opt */ - { 424, -1 }, /* (455) table_primary ::= parenthesized_joined_table */ - { 426, 0 }, /* (456) alias_opt ::= */ - { 426, -1 }, /* (457) alias_opt ::= table_alias */ - { 426, -2 }, /* (458) alias_opt ::= AS table_alias */ - { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 428, -3 }, /* (460) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 425, -6 }, /* (461) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 429, 0 }, /* (462) join_type ::= */ - { 429, -1 }, /* (463) join_type ::= INNER */ - { 431, -12 }, /* (464) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 432, 0 }, /* (465) set_quantifier_opt ::= */ - { 432, -1 }, /* (466) set_quantifier_opt ::= DISTINCT */ - { 432, -1 }, /* (467) set_quantifier_opt ::= ALL */ - { 433, -1 }, /* (468) select_list ::= select_item */ - { 433, -3 }, /* (469) select_list ::= select_list NK_COMMA select_item */ - { 441, -1 }, /* (470) select_item ::= NK_STAR */ - { 441, -1 }, /* (471) select_item ::= common_expression */ - { 441, -2 }, /* (472) select_item ::= common_expression column_alias */ - { 441, -3 }, /* (473) select_item ::= common_expression AS column_alias */ - { 441, -3 }, /* (474) select_item ::= table_name NK_DOT NK_STAR */ - { 396, 0 }, /* (475) where_clause_opt ::= */ - { 396, -2 }, /* (476) where_clause_opt ::= WHERE search_condition */ - { 434, 0 }, /* (477) partition_by_clause_opt ::= */ - { 434, -3 }, /* (478) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 442, -1 }, /* (479) partition_list ::= partition_item */ - { 442, -3 }, /* (480) partition_list ::= partition_list NK_COMMA partition_item */ - { 443, -1 }, /* (481) partition_item ::= expr_or_subquery */ - { 443, -2 }, /* (482) partition_item ::= expr_or_subquery column_alias */ - { 443, -3 }, /* (483) partition_item ::= expr_or_subquery AS column_alias */ - { 438, 0 }, /* (484) twindow_clause_opt ::= */ - { 438, -6 }, /* (485) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 438, -4 }, /* (486) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 438, -6 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 438, -8 }, /* (488) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 382, 0 }, /* (489) sliding_opt ::= */ - { 382, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 437, 0 }, /* (491) fill_opt ::= */ - { 437, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 437, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 444, -1 }, /* (494) fill_mode ::= NONE */ - { 444, -1 }, /* (495) fill_mode ::= PREV */ - { 444, -1 }, /* (496) fill_mode ::= NULL */ - { 444, -1 }, /* (497) fill_mode ::= LINEAR */ - { 444, -1 }, /* (498) fill_mode ::= NEXT */ - { 439, 0 }, /* (499) group_by_clause_opt ::= */ - { 439, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ - { 445, -1 }, /* (501) group_by_list ::= expr_or_subquery */ - { 445, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 440, 0 }, /* (503) having_clause_opt ::= */ - { 440, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ - { 435, 0 }, /* (505) range_opt ::= */ - { 435, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 436, 0 }, /* (507) every_opt ::= */ - { 436, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 446, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 447, -1 }, /* (510) query_simple ::= query_specification */ - { 447, -1 }, /* (511) query_simple ::= union_query_expression */ - { 451, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 451, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 452, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ - { 452, -1 }, /* (515) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (516) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (517) query_or_subquery ::= subquery */ - { 448, 0 }, /* (518) order_by_clause_opt ::= */ - { 448, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 449, 0 }, /* (520) slimit_clause_opt ::= */ - { 449, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 449, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 450, 0 }, /* (524) limit_clause_opt ::= */ - { 450, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 450, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 427, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ - { 427, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ - { 430, -1 }, /* (530) search_condition ::= common_expression */ - { 453, -1 }, /* (531) sort_specification_list ::= sort_specification */ - { 453, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 454, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 455, 0 }, /* (534) ordering_specification_opt ::= */ - { 455, -1 }, /* (535) ordering_specification_opt ::= ASC */ - { 455, -1 }, /* (536) ordering_specification_opt ::= DESC */ - { 456, 0 }, /* (537) null_ordering_opt ::= */ - { 456, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ - { 456, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ + { 324, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 324, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 325, 0 }, /* (2) account_options ::= */ + { 325, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 325, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 325, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 325, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 325, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 325, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 325, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 325, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 325, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 326, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 326, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 328, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 328, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 328, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 328, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 328, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 328, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 328, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 328, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 328, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 328, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 324, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 324, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 324, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 324, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 324, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 330, 0 }, /* (29) sysinfo_opt ::= */ + { 330, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 324, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 324, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 331, -1 }, /* (33) privileges ::= ALL */ + { 331, -1 }, /* (34) privileges ::= priv_type_list */ + { 331, -1 }, /* (35) privileges ::= SUBSCRIBE */ + { 333, -1 }, /* (36) priv_type_list ::= priv_type */ + { 333, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 334, -1 }, /* (38) priv_type ::= READ */ + { 334, -1 }, /* (39) priv_type ::= WRITE */ + { 332, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 332, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ + { 332, -1 }, /* (42) priv_level ::= topic_name */ + { 324, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ + { 324, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 324, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ + { 324, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ + { 324, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 324, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 324, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ + { 324, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 337, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ + { 337, -1 }, /* (52) dnode_endpoint ::= NK_ID */ + { 337, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ + { 338, 0 }, /* (54) force_opt ::= */ + { 338, -1 }, /* (55) force_opt ::= FORCE */ + { 324, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ + { 324, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 324, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 324, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 324, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ + { 324, -2 }, /* (68) cmd ::= USE db_name */ + { 324, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 324, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ + { 324, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ + { 339, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ + { 339, 0 }, /* (73) not_exists_opt ::= */ + { 341, -2 }, /* (74) exists_opt ::= IF EXISTS */ + { 341, 0 }, /* (75) exists_opt ::= */ + { 340, 0 }, /* (76) db_options ::= */ + { 340, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ + { 340, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ + { 340, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 340, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ + { 340, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ + { 340, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ + { 340, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ + { 340, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ + { 340, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ + { 340, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ + { 340, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ + { 340, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 340, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { 340, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ + { 340, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ + { 340, -3 }, /* (92) db_options ::= db_options VGROUPS NK_INTEGER */ + { 340, -3 }, /* (93) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 340, -3 }, /* (94) db_options ::= db_options RETENTIONS retention_list */ + { 340, -3 }, /* (95) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 340, -3 }, /* (96) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 340, -3 }, /* (97) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 340, -3 }, /* (98) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 340, -4 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 340, -3 }, /* (100) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 340, -4 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 340, -3 }, /* (102) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 340, -3 }, /* (103) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 340, -3 }, /* (104) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 340, -3 }, /* (105) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 340, -3 }, /* (106) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 342, -1 }, /* (107) alter_db_options ::= alter_db_option */ + { 342, -2 }, /* (108) alter_db_options ::= alter_db_options alter_db_option */ + { 347, -2 }, /* (109) alter_db_option ::= BUFFER NK_INTEGER */ + { 347, -2 }, /* (110) alter_db_option ::= CACHEMODEL NK_STRING */ + { 347, -2 }, /* (111) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 347, -2 }, /* (112) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 347, -2 }, /* (113) alter_db_option ::= KEEP integer_list */ + { 347, -2 }, /* (114) alter_db_option ::= KEEP variable_list */ + { 347, -2 }, /* (115) alter_db_option ::= PAGES NK_INTEGER */ + { 347, -2 }, /* (116) alter_db_option ::= REPLICA NK_INTEGER */ + { 347, -2 }, /* (117) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 347, -2 }, /* (118) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 344, -1 }, /* (119) integer_list ::= NK_INTEGER */ + { 344, -3 }, /* (120) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 345, -1 }, /* (121) variable_list ::= NK_VARIABLE */ + { 345, -3 }, /* (122) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 346, -1 }, /* (123) retention_list ::= retention */ + { 346, -3 }, /* (124) retention_list ::= retention_list NK_COMMA retention */ + { 348, -3 }, /* (125) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 343, 0 }, /* (126) speed_opt ::= */ + { 343, -2 }, /* (127) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 324, -9 }, /* (128) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 324, -3 }, /* (129) cmd ::= CREATE TABLE multi_create_clause */ + { 324, -9 }, /* (130) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 324, -3 }, /* (131) cmd ::= DROP TABLE multi_drop_clause */ + { 324, -4 }, /* (132) cmd ::= DROP STABLE exists_opt full_table_name */ + { 324, -3 }, /* (133) cmd ::= ALTER TABLE alter_table_clause */ + { 324, -3 }, /* (134) cmd ::= ALTER STABLE alter_table_clause */ + { 356, -2 }, /* (135) alter_table_clause ::= full_table_name alter_table_options */ + { 356, -5 }, /* (136) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 356, -4 }, /* (137) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 356, -5 }, /* (138) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 356, -5 }, /* (139) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 356, -5 }, /* (140) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 356, -4 }, /* (141) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 356, -5 }, /* (142) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 356, -5 }, /* (143) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 356, -6 }, /* (144) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 353, -1 }, /* (145) multi_create_clause ::= create_subtable_clause */ + { 353, -2 }, /* (146) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 361, -10 }, /* (147) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 355, -1 }, /* (148) multi_drop_clause ::= drop_table_clause */ + { 355, -2 }, /* (149) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 364, -2 }, /* (150) drop_table_clause ::= exists_opt full_table_name */ + { 362, 0 }, /* (151) specific_cols_opt ::= */ + { 362, -3 }, /* (152) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 349, -1 }, /* (153) full_table_name ::= table_name */ + { 349, -3 }, /* (154) full_table_name ::= db_name NK_DOT table_name */ + { 350, -1 }, /* (155) column_def_list ::= column_def */ + { 350, -3 }, /* (156) column_def_list ::= column_def_list NK_COMMA column_def */ + { 367, -2 }, /* (157) column_def ::= column_name type_name */ + { 367, -4 }, /* (158) column_def ::= column_name type_name COMMENT NK_STRING */ + { 359, -1 }, /* (159) type_name ::= BOOL */ + { 359, -1 }, /* (160) type_name ::= TINYINT */ + { 359, -1 }, /* (161) type_name ::= SMALLINT */ + { 359, -1 }, /* (162) type_name ::= INT */ + { 359, -1 }, /* (163) type_name ::= INTEGER */ + { 359, -1 }, /* (164) type_name ::= BIGINT */ + { 359, -1 }, /* (165) type_name ::= FLOAT */ + { 359, -1 }, /* (166) type_name ::= DOUBLE */ + { 359, -4 }, /* (167) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (168) type_name ::= TIMESTAMP */ + { 359, -4 }, /* (169) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 359, -2 }, /* (170) type_name ::= TINYINT UNSIGNED */ + { 359, -2 }, /* (171) type_name ::= SMALLINT UNSIGNED */ + { 359, -2 }, /* (172) type_name ::= INT UNSIGNED */ + { 359, -2 }, /* (173) type_name ::= BIGINT UNSIGNED */ + { 359, -1 }, /* (174) type_name ::= JSON */ + { 359, -4 }, /* (175) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (176) type_name ::= MEDIUMBLOB */ + { 359, -1 }, /* (177) type_name ::= BLOB */ + { 359, -4 }, /* (178) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 359, -1 }, /* (179) type_name ::= DECIMAL */ + { 359, -4 }, /* (180) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 359, -6 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 351, 0 }, /* (182) tags_def_opt ::= */ + { 351, -1 }, /* (183) tags_def_opt ::= tags_def */ + { 354, -4 }, /* (184) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 352, 0 }, /* (185) table_options ::= */ + { 352, -3 }, /* (186) table_options ::= table_options COMMENT NK_STRING */ + { 352, -3 }, /* (187) table_options ::= table_options MAX_DELAY duration_list */ + { 352, -3 }, /* (188) table_options ::= table_options WATERMARK duration_list */ + { 352, -5 }, /* (189) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 352, -3 }, /* (190) table_options ::= table_options TTL NK_INTEGER */ + { 352, -5 }, /* (191) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 352, -3 }, /* (192) table_options ::= table_options DELETE_MARK duration_list */ + { 357, -1 }, /* (193) alter_table_options ::= alter_table_option */ + { 357, -2 }, /* (194) alter_table_options ::= alter_table_options alter_table_option */ + { 370, -2 }, /* (195) alter_table_option ::= COMMENT NK_STRING */ + { 370, -2 }, /* (196) alter_table_option ::= TTL NK_INTEGER */ + { 368, -1 }, /* (197) duration_list ::= duration_literal */ + { 368, -3 }, /* (198) duration_list ::= duration_list NK_COMMA duration_literal */ + { 369, -1 }, /* (199) rollup_func_list ::= rollup_func_name */ + { 369, -3 }, /* (200) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 372, -1 }, /* (201) rollup_func_name ::= function_name */ + { 372, -1 }, /* (202) rollup_func_name ::= FIRST */ + { 372, -1 }, /* (203) rollup_func_name ::= LAST */ + { 365, -1 }, /* (204) col_name_list ::= col_name */ + { 365, -3 }, /* (205) col_name_list ::= col_name_list NK_COMMA col_name */ + { 374, -1 }, /* (206) col_name ::= column_name */ + { 324, -2 }, /* (207) cmd ::= SHOW DNODES */ + { 324, -2 }, /* (208) cmd ::= SHOW USERS */ + { 324, -3 }, /* (209) cmd ::= SHOW USER PRIVILEGES */ + { 324, -2 }, /* (210) cmd ::= SHOW DATABASES */ + { 324, -4 }, /* (211) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 324, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 324, -3 }, /* (213) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 324, -2 }, /* (214) cmd ::= SHOW MNODES */ + { 324, -2 }, /* (215) cmd ::= SHOW QNODES */ + { 324, -2 }, /* (216) cmd ::= SHOW FUNCTIONS */ + { 324, -5 }, /* (217) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 324, -2 }, /* (218) cmd ::= SHOW STREAMS */ + { 324, -2 }, /* (219) cmd ::= SHOW ACCOUNTS */ + { 324, -2 }, /* (220) cmd ::= SHOW APPS */ + { 324, -2 }, /* (221) cmd ::= SHOW CONNECTIONS */ + { 324, -2 }, /* (222) cmd ::= SHOW LICENCES */ + { 324, -2 }, /* (223) cmd ::= SHOW GRANTS */ + { 324, -4 }, /* (224) cmd ::= SHOW CREATE DATABASE db_name */ + { 324, -4 }, /* (225) cmd ::= SHOW CREATE TABLE full_table_name */ + { 324, -4 }, /* (226) cmd ::= SHOW CREATE STABLE full_table_name */ + { 324, -2 }, /* (227) cmd ::= SHOW QUERIES */ + { 324, -2 }, /* (228) cmd ::= SHOW SCORES */ + { 324, -2 }, /* (229) cmd ::= SHOW TOPICS */ + { 324, -2 }, /* (230) cmd ::= SHOW VARIABLES */ + { 324, -3 }, /* (231) cmd ::= SHOW CLUSTER VARIABLES */ + { 324, -3 }, /* (232) cmd ::= SHOW LOCAL VARIABLES */ + { 324, -5 }, /* (233) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 324, -2 }, /* (234) cmd ::= SHOW BNODES */ + { 324, -2 }, /* (235) cmd ::= SHOW SNODES */ + { 324, -2 }, /* (236) cmd ::= SHOW CLUSTER */ + { 324, -2 }, /* (237) cmd ::= SHOW TRANSACTIONS */ + { 324, -4 }, /* (238) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 324, -2 }, /* (239) cmd ::= SHOW CONSUMERS */ + { 324, -2 }, /* (240) cmd ::= SHOW SUBSCRIPTIONS */ + { 324, -5 }, /* (241) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 324, -7 }, /* (242) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 324, -3 }, /* (243) cmd ::= SHOW VNODES NK_INTEGER */ + { 324, -3 }, /* (244) cmd ::= SHOW VNODES NK_STRING */ + { 375, 0 }, /* (245) db_name_cond_opt ::= */ + { 375, -2 }, /* (246) db_name_cond_opt ::= db_name NK_DOT */ + { 376, 0 }, /* (247) like_pattern_opt ::= */ + { 376, -2 }, /* (248) like_pattern_opt ::= LIKE NK_STRING */ + { 377, -1 }, /* (249) table_name_cond ::= table_name */ + { 378, 0 }, /* (250) from_db_opt ::= */ + { 378, -2 }, /* (251) from_db_opt ::= FROM db_name */ + { 379, 0 }, /* (252) tag_list_opt ::= */ + { 379, -1 }, /* (253) tag_list_opt ::= tag_item */ + { 379, -3 }, /* (254) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 380, -1 }, /* (255) tag_item ::= TBNAME */ + { 380, -1 }, /* (256) tag_item ::= QTAGS */ + { 380, -1 }, /* (257) tag_item ::= column_name */ + { 380, -2 }, /* (258) tag_item ::= column_name column_alias */ + { 380, -3 }, /* (259) tag_item ::= column_name AS column_alias */ + { 324, -8 }, /* (260) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 324, -4 }, /* (261) cmd ::= DROP INDEX exists_opt full_table_name */ + { 382, -10 }, /* (262) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 382, -12 }, /* (263) 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 */ + { 383, -1 }, /* (264) func_list ::= func */ + { 383, -3 }, /* (265) func_list ::= func_list NK_COMMA func */ + { 386, -4 }, /* (266) func ::= function_name NK_LP expression_list NK_RP */ + { 385, 0 }, /* (267) sma_stream_opt ::= */ + { 385, -3 }, /* (268) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 385, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 385, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 324, -6 }, /* (271) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 324, -7 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 324, -9 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 324, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 324, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 324, -4 }, /* (276) cmd ::= DROP TOPIC exists_opt topic_name */ + { 324, -7 }, /* (277) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 324, -2 }, /* (278) cmd ::= DESC full_table_name */ + { 324, -2 }, /* (279) cmd ::= DESCRIBE full_table_name */ + { 324, -3 }, /* (280) cmd ::= RESET QUERY CACHE */ + { 324, -4 }, /* (281) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 389, 0 }, /* (282) analyze_opt ::= */ + { 389, -1 }, /* (283) analyze_opt ::= ANALYZE */ + { 390, 0 }, /* (284) explain_options ::= */ + { 390, -3 }, /* (285) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 390, -3 }, /* (286) explain_options ::= explain_options RATIO NK_FLOAT */ + { 324, -10 }, /* (287) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 324, -4 }, /* (288) cmd ::= DROP FUNCTION exists_opt function_name */ + { 391, 0 }, /* (289) agg_func_opt ::= */ + { 391, -1 }, /* (290) agg_func_opt ::= AGGREGATE */ + { 392, 0 }, /* (291) bufsize_opt ::= */ + { 392, -2 }, /* (292) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 324, -11 }, /* (293) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 324, -4 }, /* (294) cmd ::= DROP STREAM exists_opt stream_name */ + { 394, 0 }, /* (295) stream_options ::= */ + { 394, -3 }, /* (296) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 394, -3 }, /* (297) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 394, -4 }, /* (298) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 394, -3 }, /* (299) stream_options ::= stream_options WATERMARK duration_literal */ + { 394, -4 }, /* (300) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 394, -3 }, /* (301) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 395, 0 }, /* (302) subtable_opt ::= */ + { 395, -4 }, /* (303) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 324, -3 }, /* (304) cmd ::= KILL CONNECTION NK_INTEGER */ + { 324, -3 }, /* (305) cmd ::= KILL QUERY NK_STRING */ + { 324, -3 }, /* (306) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 324, -2 }, /* (307) cmd ::= BALANCE VGROUP */ + { 324, -4 }, /* (308) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 324, -4 }, /* (309) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 324, -3 }, /* (310) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 397, -2 }, /* (311) dnode_list ::= DNODE NK_INTEGER */ + { 397, -3 }, /* (312) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 324, -4 }, /* (313) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 324, -1 }, /* (314) cmd ::= query_or_subquery */ + { 324, -7 }, /* (315) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 324, -4 }, /* (316) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 327, -1 }, /* (317) literal ::= NK_INTEGER */ + { 327, -1 }, /* (318) literal ::= NK_FLOAT */ + { 327, -1 }, /* (319) literal ::= NK_STRING */ + { 327, -1 }, /* (320) literal ::= NK_BOOL */ + { 327, -2 }, /* (321) literal ::= TIMESTAMP NK_STRING */ + { 327, -1 }, /* (322) literal ::= duration_literal */ + { 327, -1 }, /* (323) literal ::= NULL */ + { 327, -1 }, /* (324) literal ::= NK_QUESTION */ + { 371, -1 }, /* (325) duration_literal ::= NK_VARIABLE */ + { 399, -1 }, /* (326) signed ::= NK_INTEGER */ + { 399, -2 }, /* (327) signed ::= NK_PLUS NK_INTEGER */ + { 399, -2 }, /* (328) signed ::= NK_MINUS NK_INTEGER */ + { 399, -1 }, /* (329) signed ::= NK_FLOAT */ + { 399, -2 }, /* (330) signed ::= NK_PLUS NK_FLOAT */ + { 399, -2 }, /* (331) signed ::= NK_MINUS NK_FLOAT */ + { 360, -1 }, /* (332) signed_literal ::= signed */ + { 360, -1 }, /* (333) signed_literal ::= NK_STRING */ + { 360, -1 }, /* (334) signed_literal ::= NK_BOOL */ + { 360, -2 }, /* (335) signed_literal ::= TIMESTAMP NK_STRING */ + { 360, -1 }, /* (336) signed_literal ::= duration_literal */ + { 360, -1 }, /* (337) signed_literal ::= NULL */ + { 360, -1 }, /* (338) signed_literal ::= literal_func */ + { 360, -1 }, /* (339) signed_literal ::= NK_QUESTION */ + { 401, -1 }, /* (340) literal_list ::= signed_literal */ + { 401, -3 }, /* (341) literal_list ::= literal_list NK_COMMA signed_literal */ + { 335, -1 }, /* (342) db_name ::= NK_ID */ + { 366, -1 }, /* (343) table_name ::= NK_ID */ + { 358, -1 }, /* (344) column_name ::= NK_ID */ + { 373, -1 }, /* (345) function_name ::= NK_ID */ + { 402, -1 }, /* (346) table_alias ::= NK_ID */ + { 381, -1 }, /* (347) column_alias ::= NK_ID */ + { 329, -1 }, /* (348) user_name ::= NK_ID */ + { 336, -1 }, /* (349) topic_name ::= NK_ID */ + { 393, -1 }, /* (350) stream_name ::= NK_ID */ + { 388, -1 }, /* (351) cgroup_name ::= NK_ID */ + { 403, -1 }, /* (352) expr_or_subquery ::= expression */ + { 396, -1 }, /* (353) expression ::= literal */ + { 396, -1 }, /* (354) expression ::= pseudo_column */ + { 396, -1 }, /* (355) expression ::= column_reference */ + { 396, -1 }, /* (356) expression ::= function_expression */ + { 396, -1 }, /* (357) expression ::= case_when_expression */ + { 396, -3 }, /* (358) expression ::= NK_LP expression NK_RP */ + { 396, -2 }, /* (359) expression ::= NK_PLUS expr_or_subquery */ + { 396, -2 }, /* (360) expression ::= NK_MINUS expr_or_subquery */ + { 396, -3 }, /* (361) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 396, -3 }, /* (362) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 396, -3 }, /* (363) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 396, -3 }, /* (364) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 396, -3 }, /* (365) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 396, -3 }, /* (366) expression ::= column_reference NK_ARROW NK_STRING */ + { 396, -3 }, /* (367) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 396, -3 }, /* (368) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 363, -1 }, /* (369) expression_list ::= expr_or_subquery */ + { 363, -3 }, /* (370) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 405, -1 }, /* (371) column_reference ::= column_name */ + { 405, -3 }, /* (372) column_reference ::= table_name NK_DOT column_name */ + { 404, -1 }, /* (373) pseudo_column ::= ROWTS */ + { 404, -1 }, /* (374) pseudo_column ::= TBNAME */ + { 404, -3 }, /* (375) pseudo_column ::= table_name NK_DOT TBNAME */ + { 404, -1 }, /* (376) pseudo_column ::= QSTART */ + { 404, -1 }, /* (377) pseudo_column ::= QEND */ + { 404, -1 }, /* (378) pseudo_column ::= QDURATION */ + { 404, -1 }, /* (379) pseudo_column ::= WSTART */ + { 404, -1 }, /* (380) pseudo_column ::= WEND */ + { 404, -1 }, /* (381) pseudo_column ::= WDURATION */ + { 404, -1 }, /* (382) pseudo_column ::= IROWTS */ + { 404, -1 }, /* (383) pseudo_column ::= QTAGS */ + { 406, -4 }, /* (384) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 406, -4 }, /* (385) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 406, -6 }, /* (386) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 406, -1 }, /* (387) function_expression ::= literal_func */ + { 400, -3 }, /* (388) literal_func ::= noarg_func NK_LP NK_RP */ + { 400, -1 }, /* (389) literal_func ::= NOW */ + { 410, -1 }, /* (390) noarg_func ::= NOW */ + { 410, -1 }, /* (391) noarg_func ::= TODAY */ + { 410, -1 }, /* (392) noarg_func ::= TIMEZONE */ + { 410, -1 }, /* (393) noarg_func ::= DATABASE */ + { 410, -1 }, /* (394) noarg_func ::= CLIENT_VERSION */ + { 410, -1 }, /* (395) noarg_func ::= SERVER_VERSION */ + { 410, -1 }, /* (396) noarg_func ::= SERVER_STATUS */ + { 410, -1 }, /* (397) noarg_func ::= CURRENT_USER */ + { 410, -1 }, /* (398) noarg_func ::= USER */ + { 408, -1 }, /* (399) star_func ::= COUNT */ + { 408, -1 }, /* (400) star_func ::= FIRST */ + { 408, -1 }, /* (401) star_func ::= LAST */ + { 408, -1 }, /* (402) star_func ::= LAST_ROW */ + { 409, -1 }, /* (403) star_func_para_list ::= NK_STAR */ + { 409, -1 }, /* (404) star_func_para_list ::= other_para_list */ + { 411, -1 }, /* (405) other_para_list ::= star_func_para */ + { 411, -3 }, /* (406) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 412, -1 }, /* (407) star_func_para ::= expr_or_subquery */ + { 412, -3 }, /* (408) star_func_para ::= table_name NK_DOT NK_STAR */ + { 407, -4 }, /* (409) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 407, -5 }, /* (410) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 413, -1 }, /* (411) when_then_list ::= when_then_expr */ + { 413, -2 }, /* (412) when_then_list ::= when_then_list when_then_expr */ + { 416, -4 }, /* (413) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 414, 0 }, /* (414) case_when_else_opt ::= */ + { 414, -2 }, /* (415) case_when_else_opt ::= ELSE common_expression */ + { 417, -3 }, /* (416) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 417, -5 }, /* (417) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 417, -6 }, /* (418) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 417, -3 }, /* (419) predicate ::= expr_or_subquery IS NULL */ + { 417, -4 }, /* (420) predicate ::= expr_or_subquery IS NOT NULL */ + { 417, -3 }, /* (421) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 418, -1 }, /* (422) compare_op ::= NK_LT */ + { 418, -1 }, /* (423) compare_op ::= NK_GT */ + { 418, -1 }, /* (424) compare_op ::= NK_LE */ + { 418, -1 }, /* (425) compare_op ::= NK_GE */ + { 418, -1 }, /* (426) compare_op ::= NK_NE */ + { 418, -1 }, /* (427) compare_op ::= NK_EQ */ + { 418, -1 }, /* (428) compare_op ::= LIKE */ + { 418, -2 }, /* (429) compare_op ::= NOT LIKE */ + { 418, -1 }, /* (430) compare_op ::= MATCH */ + { 418, -1 }, /* (431) compare_op ::= NMATCH */ + { 418, -1 }, /* (432) compare_op ::= CONTAINS */ + { 419, -1 }, /* (433) in_op ::= IN */ + { 419, -2 }, /* (434) in_op ::= NOT IN */ + { 420, -3 }, /* (435) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 421, -1 }, /* (436) boolean_value_expression ::= boolean_primary */ + { 421, -2 }, /* (437) boolean_value_expression ::= NOT boolean_primary */ + { 421, -3 }, /* (438) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 421, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 422, -1 }, /* (440) boolean_primary ::= predicate */ + { 422, -3 }, /* (441) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 415, -1 }, /* (442) common_expression ::= expr_or_subquery */ + { 415, -1 }, /* (443) common_expression ::= boolean_value_expression */ + { 423, 0 }, /* (444) from_clause_opt ::= */ + { 423, -2 }, /* (445) from_clause_opt ::= FROM table_reference_list */ + { 424, -1 }, /* (446) table_reference_list ::= table_reference */ + { 424, -3 }, /* (447) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 425, -1 }, /* (448) table_reference ::= table_primary */ + { 425, -1 }, /* (449) table_reference ::= joined_table */ + { 426, -2 }, /* (450) table_primary ::= table_name alias_opt */ + { 426, -4 }, /* (451) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 426, -2 }, /* (452) table_primary ::= subquery alias_opt */ + { 426, -1 }, /* (453) table_primary ::= parenthesized_joined_table */ + { 428, 0 }, /* (454) alias_opt ::= */ + { 428, -1 }, /* (455) alias_opt ::= table_alias */ + { 428, -2 }, /* (456) alias_opt ::= AS table_alias */ + { 430, -3 }, /* (457) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 430, -3 }, /* (458) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 427, -6 }, /* (459) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 431, 0 }, /* (460) join_type ::= */ + { 431, -1 }, /* (461) join_type ::= INNER */ + { 433, -12 }, /* (462) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 434, 0 }, /* (463) set_quantifier_opt ::= */ + { 434, -1 }, /* (464) set_quantifier_opt ::= DISTINCT */ + { 434, -1 }, /* (465) set_quantifier_opt ::= ALL */ + { 435, -1 }, /* (466) select_list ::= select_item */ + { 435, -3 }, /* (467) select_list ::= select_list NK_COMMA select_item */ + { 443, -1 }, /* (468) select_item ::= NK_STAR */ + { 443, -1 }, /* (469) select_item ::= common_expression */ + { 443, -2 }, /* (470) select_item ::= common_expression column_alias */ + { 443, -3 }, /* (471) select_item ::= common_expression AS column_alias */ + { 443, -3 }, /* (472) select_item ::= table_name NK_DOT NK_STAR */ + { 398, 0 }, /* (473) where_clause_opt ::= */ + { 398, -2 }, /* (474) where_clause_opt ::= WHERE search_condition */ + { 436, 0 }, /* (475) partition_by_clause_opt ::= */ + { 436, -3 }, /* (476) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 444, -1 }, /* (477) partition_list ::= partition_item */ + { 444, -3 }, /* (478) partition_list ::= partition_list NK_COMMA partition_item */ + { 445, -1 }, /* (479) partition_item ::= expr_or_subquery */ + { 445, -2 }, /* (480) partition_item ::= expr_or_subquery column_alias */ + { 445, -3 }, /* (481) partition_item ::= expr_or_subquery AS column_alias */ + { 440, 0 }, /* (482) twindow_clause_opt ::= */ + { 440, -6 }, /* (483) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 440, -4 }, /* (484) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 440, -6 }, /* (485) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 440, -8 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 440, -7 }, /* (487) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + { 384, 0 }, /* (488) sliding_opt ::= */ + { 384, -4 }, /* (489) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 439, 0 }, /* (490) fill_opt ::= */ + { 439, -4 }, /* (491) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 439, -6 }, /* (492) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 446, -1 }, /* (493) fill_mode ::= NONE */ + { 446, -1 }, /* (494) fill_mode ::= PREV */ + { 446, -1 }, /* (495) fill_mode ::= NULL */ + { 446, -1 }, /* (496) fill_mode ::= LINEAR */ + { 446, -1 }, /* (497) fill_mode ::= NEXT */ + { 441, 0 }, /* (498) group_by_clause_opt ::= */ + { 441, -3 }, /* (499) group_by_clause_opt ::= GROUP BY group_by_list */ + { 447, -1 }, /* (500) group_by_list ::= expr_or_subquery */ + { 447, -3 }, /* (501) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 442, 0 }, /* (502) having_clause_opt ::= */ + { 442, -2 }, /* (503) having_clause_opt ::= HAVING search_condition */ + { 437, 0 }, /* (504) range_opt ::= */ + { 437, -6 }, /* (505) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 438, 0 }, /* (506) every_opt ::= */ + { 438, -4 }, /* (507) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 448, -4 }, /* (508) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 449, -1 }, /* (509) query_simple ::= query_specification */ + { 449, -1 }, /* (510) query_simple ::= union_query_expression */ + { 453, -4 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 453, -3 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 454, -1 }, /* (513) query_simple_or_subquery ::= query_simple */ + { 454, -1 }, /* (514) query_simple_or_subquery ::= subquery */ + { 387, -1 }, /* (515) query_or_subquery ::= query_expression */ + { 387, -1 }, /* (516) query_or_subquery ::= subquery */ + { 450, 0 }, /* (517) order_by_clause_opt ::= */ + { 450, -3 }, /* (518) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 451, 0 }, /* (519) slimit_clause_opt ::= */ + { 451, -2 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 451, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 451, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 452, 0 }, /* (523) limit_clause_opt ::= */ + { 452, -2 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 452, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 452, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 429, -3 }, /* (527) subquery ::= NK_LP query_expression NK_RP */ + { 429, -3 }, /* (528) subquery ::= NK_LP subquery NK_RP */ + { 432, -1 }, /* (529) search_condition ::= common_expression */ + { 455, -1 }, /* (530) sort_specification_list ::= sort_specification */ + { 455, -3 }, /* (531) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 456, -3 }, /* (532) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 457, 0 }, /* (533) ordering_specification_opt ::= */ + { 457, -1 }, /* (534) ordering_specification_opt ::= ASC */ + { 457, -1 }, /* (535) ordering_specification_opt ::= DESC */ + { 458, 0 }, /* (536) null_ordering_opt ::= */ + { 458, -2 }, /* (537) null_ordering_opt ::= NULLS FIRST */ + { 458, -2 }, /* (538) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3575,11 +3673,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,323,&yymsp[0].minor); + yy_destructor(yypParser,325,&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,324,&yymsp[0].minor); + yy_destructor(yypParser,326,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3593,20 +3691,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,323,&yymsp[-2].minor); +{ yy_destructor(yypParser,325,&yymsp[-2].minor); { } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,327,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,326,&yymsp[0].minor); +{ yy_destructor(yypParser,328,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,324,&yymsp[-1].minor); +{ yy_destructor(yypParser,326,&yymsp[-1].minor); { } - yy_destructor(yypParser,326,&yymsp[0].minor); + yy_destructor(yypParser,328,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3620,80 +3718,80 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,327,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy0, yymsp[0].minor.yy33); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy0, yymsp[0].minor.yy449); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy317); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy33 = 1; } +{ yymsp[1].minor.yy449 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy33 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy449 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy525 = yymsp[0].minor.yy525; } - yymsp[0].minor.yy525 = yylhsminor.yy525; +{ yylhsminor.yy531 = yymsp[0].minor.yy531; } + yymsp[0].minor.yy531 = yylhsminor.yy531; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy525 = yymsp[-2].minor.yy525 | yymsp[0].minor.yy525; } - yymsp[-2].minor.yy525 = yylhsminor.yy525; +{ yylhsminor.yy531 = yymsp[-2].minor.yy531 | yymsp[0].minor.yy531; } + yymsp[-2].minor.yy531 = yylhsminor.yy531; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy199 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy199 = yylhsminor.yy199; +{ yylhsminor.yy317 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy317 = yylhsminor.yy317; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy199 = yymsp[-2].minor.yy199; } - yymsp[-2].minor.yy199 = yylhsminor.yy199; +{ yylhsminor.yy317 = yymsp[-2].minor.yy317; } + yymsp[-2].minor.yy317 = yylhsminor.yy317; break; case 42: /* priv_level ::= topic_name */ - case 457: /* alias_opt ::= table_alias */ yytestcase(yyruleno==457); -{ yylhsminor.yy199 = yymsp[0].minor.yy199; } - yymsp[0].minor.yy199 = yylhsminor.yy199; + case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); +{ yylhsminor.yy317 = yymsp[0].minor.yy317; } + yymsp[0].minor.yy317 = yylhsminor.yy317; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy199, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy317, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy397); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy335); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy397); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy335); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3710,45 +3808,45 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 344: /* db_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* table_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* column_name ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* function_name ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* table_alias ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* column_alias ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* user_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* topic_name ::= NK_ID */ yytestcase(yyruleno==351); - case 352: /* stream_name ::= NK_ID */ yytestcase(yyruleno==352); - case 353: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==353); - case 392: /* noarg_func ::= NOW */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= TODAY */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==398); - case 399: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==399); - case 400: /* noarg_func ::= USER */ yytestcase(yyruleno==400); - case 401: /* star_func ::= COUNT */ yytestcase(yyruleno==401); - case 402: /* star_func ::= FIRST */ yytestcase(yyruleno==402); - case 403: /* star_func ::= LAST */ yytestcase(yyruleno==403); - case 404: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==404); -{ yylhsminor.yy199 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy199 = yylhsminor.yy199; + case 342: /* db_name ::= NK_ID */ yytestcase(yyruleno==342); + case 343: /* table_name ::= NK_ID */ yytestcase(yyruleno==343); + case 344: /* column_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* function_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* table_alias ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* column_alias ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* user_name ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* topic_name ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* stream_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==351); + case 390: /* noarg_func ::= NOW */ yytestcase(yyruleno==390); + case 391: /* noarg_func ::= TODAY */ yytestcase(yyruleno==391); + case 392: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= USER */ yytestcase(yyruleno==398); + case 399: /* star_func ::= COUNT */ yytestcase(yyruleno==399); + case 400: /* star_func ::= FIRST */ yytestcase(yyruleno==400); + case 401: /* star_func ::= LAST */ yytestcase(yyruleno==401); + case 402: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==402); +{ yylhsminor.yy317 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy317 = yylhsminor.yy317; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 284: /* analyze_opt ::= */ yytestcase(yyruleno==284); - case 291: /* agg_func_opt ::= */ yytestcase(yyruleno==291); - case 465: /* set_quantifier_opt ::= */ yytestcase(yyruleno==465); -{ yymsp[1].minor.yy397 = false; } + case 282: /* analyze_opt ::= */ yytestcase(yyruleno==282); + case 289: /* agg_func_opt ::= */ yytestcase(yyruleno==289); + case 463: /* set_quantifier_opt ::= */ yytestcase(yyruleno==463); +{ yymsp[1].minor.yy335 = false; } break; case 55: /* force_opt ::= FORCE */ - case 285: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==285); - case 292: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==292); - case 466: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==466); -{ yymsp[0].minor.yy397 = true; } + case 283: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==283); + case 290: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==290); + case 464: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==464); +{ yymsp[0].minor.yy335 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3781,1342 +3879,1338 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy397, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy335, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy706); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy856); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy397 = true; } +{ yymsp[-2].minor.yy335 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy397 = true; } +{ yymsp[-1].minor.yy335 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy148 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy74 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_KEEP, yymsp[0].minor.yy404); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_KEEP, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 92: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 92: /* db_options ::= db_options VGROUPS NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 93: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 94: /* db_options ::= db_options RETENTIONS retention_list */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_RETENTIONS, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 95: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_RETENTIONS, yymsp[0].minor.yy404); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 95: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 96: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 97: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 98: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 100: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + case 99: /* 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.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 100: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 102: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + case 101: /* 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.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; - break; - case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 108: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy148 = createAlterDatabaseOptions(pCxt); yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yylhsminor.yy148, &yymsp[0].minor.yy123); } - yymsp[0].minor.yy148 = yylhsminor.yy148; - break; - case 109: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy148, &yymsp[0].minor.yy123); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; - break; - case 110: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 114: /* alter_db_option ::= KEEP integer_list */ - case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); -{ yymsp[-1].minor.yy123.type = DB_OPTION_KEEP; yymsp[-1].minor.yy123.pList = yymsp[0].minor.yy404; } - break; - case 116: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_PAGES; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 118: /* alter_db_option ::= STRICT NK_STRING */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_STRICT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 119: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_WAL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 120: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } - break; - case 121: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy404 = yylhsminor.yy404; - break; - case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 314: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==314); -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy404 = yylhsminor.yy404; - break; - case 123: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy404 = yylhsminor.yy404; - break; - case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy404 = yylhsminor.yy404; - break; - case 125: /* retention_list ::= retention */ - case 147: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==147); - case 150: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==150); - case 157: /* column_def_list ::= column_def */ yytestcase(yyruleno==157); - case 201: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func */ yytestcase(yyruleno==266); - case 342: /* literal_list ::= signed_literal */ yytestcase(yyruleno==342); - case 407: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==407); - case 413: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==413); - case 468: /* select_list ::= select_item */ yytestcase(yyruleno==468); - case 479: /* partition_list ::= partition_item */ yytestcase(yyruleno==479); - case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); -{ yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy148); } - yymsp[0].minor.yy404 = yylhsminor.yy404; - break; - case 126: /* retention_list ::= retention_list NK_COMMA retention */ - case 158: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==158); - case 202: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==202); - case 207: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==207); - case 256: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==256); - case 267: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==267); - case 343: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==343); - case 408: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==408); - case 469: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==469); - case 480: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==480); - case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy404 = yylhsminor.yy404; - break; - case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy148 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; - break; - case 128: /* speed_opt ::= */ - case 293: /* bufsize_opt ::= */ yytestcase(yyruleno==293); -{ yymsp[1].minor.yy706 = 0; } - break; - case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 294: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==294); -{ yymsp[-1].minor.yy706 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } - break; - case 130: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 132: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==132); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy148, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } - break; - case 131: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } - break; - case 133: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } - break; - case 134: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } - break; - case 135: /* cmd ::= ALTER TABLE alter_table_clause */ - case 316: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==316); -{ pCxt->pRootNode = yymsp[0].minor.yy148; } - break; - case 136: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy148); } - break; - case 137: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy148 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; - break; - case 138: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 139: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy199); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; - break; - case 140: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 141: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 142: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 143: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy199); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; - break; - case 144: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 145: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; - break; - case 146: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy148 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy148, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } - yymsp[-5].minor.yy148 = yylhsminor.yy148; - break; - case 148: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 151: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==151); - case 414: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==414); -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } - yymsp[-1].minor.yy404 = yylhsminor.yy404; + yymsp[-3].minor.yy74 = yylhsminor.yy74; + break; + case 102: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 103: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 104: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 105: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 106: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ +{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 107: /* alter_db_options ::= alter_db_option */ +{ yylhsminor.yy74 = createAlterDatabaseOptions(pCxt); yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yylhsminor.yy74, &yymsp[0].minor.yy767); } + yymsp[0].minor.yy74 = yylhsminor.yy74; + break; + case 108: /* alter_db_options ::= alter_db_options alter_db_option */ +{ yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy74, &yymsp[0].minor.yy767); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; + break; + case 109: /* alter_db_option ::= BUFFER NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 110: /* alter_db_option ::= CACHEMODEL NK_STRING */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 111: /* alter_db_option ::= CACHESIZE NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 112: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 113: /* alter_db_option ::= KEEP integer_list */ + case 114: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==114); +{ yymsp[-1].minor.yy767.type = DB_OPTION_KEEP; yymsp[-1].minor.yy767.pList = yymsp[0].minor.yy874; } + break; + case 115: /* alter_db_option ::= PAGES NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_PAGES; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 116: /* alter_db_option ::= REPLICA NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 117: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_WAL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 118: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } + break; + case 119: /* integer_list ::= NK_INTEGER */ +{ yylhsminor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; + break; + case 120: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; + break; + case 121: /* variable_list ::= NK_VARIABLE */ +{ yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; + break; + case 122: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; + break; + case 123: /* retention_list ::= retention */ + case 145: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==145); + case 148: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==148); + case 155: /* column_def_list ::= column_def */ yytestcase(yyruleno==155); + case 199: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==199); + case 204: /* col_name_list ::= col_name */ yytestcase(yyruleno==204); + case 253: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==253); + case 264: /* func_list ::= func */ yytestcase(yyruleno==264); + case 340: /* literal_list ::= signed_literal */ yytestcase(yyruleno==340); + case 405: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==405); + case 411: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==411); + case 466: /* select_list ::= select_item */ yytestcase(yyruleno==466); + case 477: /* partition_list ::= partition_item */ yytestcase(yyruleno==477); + case 530: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==530); +{ yylhsminor.yy874 = createNodeList(pCxt, yymsp[0].minor.yy74); } + yymsp[0].minor.yy874 = yylhsminor.yy874; + break; + case 124: /* retention_list ::= retention_list NK_COMMA retention */ + case 156: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==156); + case 200: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==200); + case 205: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==205); + case 254: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==254); + case 265: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==265); + case 341: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==341); + case 406: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==406); + case 467: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==467); + case 478: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==478); + case 531: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==531); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; + break; + case 125: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ +{ yylhsminor.yy74 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; + break; + case 126: /* speed_opt ::= */ + case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); +{ yymsp[1].minor.yy856 = 0; } + break; + case 127: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); +{ yymsp[-1].minor.yy856 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + break; + case 128: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 130: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==130); +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-5].minor.yy74, yymsp[-3].minor.yy874, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } + break; + case 129: /* cmd ::= CREATE TABLE multi_create_clause */ +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); } + break; + case 131: /* cmd ::= DROP TABLE multi_drop_clause */ +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); } + break; + case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */ +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } + break; + case 133: /* cmd ::= ALTER TABLE alter_table_clause */ + case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); +{ pCxt->pRootNode = yymsp[0].minor.yy74; } + break; + case 134: /* cmd ::= ALTER STABLE alter_table_clause */ +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy74); } + break; + case 135: /* alter_table_clause ::= full_table_name alter_table_options */ +{ yylhsminor.yy74 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; + break; + case 136: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 137: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ +{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; + break; + case 138: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 139: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ +{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 140: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 141: /* alter_table_clause ::= full_table_name DROP TAG column_name */ +{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; + break; + case 142: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ +{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 143: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ +{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; + break; + case 144: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ +{ yylhsminor.yy74 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy74, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; + break; + case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149); + case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy874 = yylhsminor.yy874; break; - case 149: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy148 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy148, yymsp[-6].minor.yy148, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } - yymsp[-9].minor.yy148 = yylhsminor.yy148; + case 147: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ +{ yylhsminor.yy74 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy335, yymsp[-8].minor.yy74, yymsp[-6].minor.yy74, yymsp[-5].minor.yy874, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } + yymsp[-9].minor.yy74 = yylhsminor.yy74; break; - case 152: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy148 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 150: /* drop_table_clause ::= exists_opt full_table_name */ +{ yylhsminor.yy74 = createDropTableClause(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 153: /* specific_cols_opt ::= */ - case 184: /* tags_def_opt ::= */ yytestcase(yyruleno==184); - case 254: /* tag_list_opt ::= */ yytestcase(yyruleno==254); - case 477: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==477); - case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); - case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); -{ yymsp[1].minor.yy404 = NULL; } + case 151: /* specific_cols_opt ::= */ + case 182: /* tags_def_opt ::= */ yytestcase(yyruleno==182); + case 252: /* tag_list_opt ::= */ yytestcase(yyruleno==252); + case 475: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==475); + case 498: /* group_by_clause_opt ::= */ yytestcase(yyruleno==498); + case 517: /* order_by_clause_opt ::= */ yytestcase(yyruleno==517); +{ yymsp[1].minor.yy874 = NULL; } break; - case 154: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } + case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ +{ yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 155: /* full_table_name ::= table_name */ -{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy199, NULL); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 153: /* full_table_name ::= table_name */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy317, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 156: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, NULL); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 154: /* full_table_name ::= db_name NK_DOT table_name */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, NULL); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 159: /* column_def ::= column_name type_name */ -{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530, NULL); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 157: /* column_def ::= column_name type_name */ +{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898, NULL); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 160: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-2].minor.yy530, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 158: /* column_def ::= column_name type_name COMMENT NK_STRING */ +{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-2].minor.yy898, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 161: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BOOL); } + case 159: /* type_name ::= BOOL */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 162: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TINYINT); } + case 160: /* type_name ::= TINYINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 163: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_SMALLINT); } + case 161: /* type_name ::= SMALLINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 164: /* type_name ::= INT */ - case 165: /* type_name ::= INTEGER */ yytestcase(yyruleno==165); -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_INT); } + case 162: /* type_name ::= INT */ + case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163); +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 166: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BIGINT); } + case 164: /* type_name ::= BIGINT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 167: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_FLOAT); } + case 165: /* type_name ::= FLOAT */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 168: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DOUBLE); } + case 166: /* type_name ::= DOUBLE */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 169: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } + case 167: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 170: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } + case 168: /* type_name ::= TIMESTAMP */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 171: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } + case 169: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 172: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UTINYINT); } + case 170: /* type_name ::= TINYINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 173: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_USMALLINT); } + case 171: /* type_name ::= SMALLINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 174: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UINT); } + case 172: /* type_name ::= INT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 175: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UBIGINT); } + case 173: /* type_name ::= BIGINT UNSIGNED */ +{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 176: /* type_name ::= JSON */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_JSON); } + case 174: /* type_name ::= JSON */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 177: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } + case 175: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 178: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } + case 176: /* type_name ::= MEDIUMBLOB */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 179: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BLOB); } + case 177: /* type_name ::= BLOB */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 180: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } + case 178: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 181: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 179: /* type_name ::= DECIMAL */ +{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 183: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } + case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 185: /* tags_def_opt ::= tags_def */ - case 406: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==406); -{ yylhsminor.yy404 = yymsp[0].minor.yy404; } - yymsp[0].minor.yy404 = yylhsminor.yy404; + case 183: /* tags_def_opt ::= tags_def */ + case 404: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==404); +{ yylhsminor.yy874 = yymsp[0].minor.yy874; } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 186: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } + case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ +{ yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 187: /* table_options ::= */ -{ yymsp[1].minor.yy148 = createDefaultTableOptions(pCxt); } + case 185: /* table_options ::= */ +{ yymsp[1].minor.yy74 = createDefaultTableOptions(pCxt); } break; - case 188: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 186: /* table_options ::= table_options COMMENT NK_STRING */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 189: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 187: /* table_options ::= table_options MAX_DELAY duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 190: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 188: /* table_options ::= table_options WATERMARK duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 191: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; + case 189: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy874); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 192: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 190: /* table_options ::= table_options TTL NK_INTEGER */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 193: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; + case 191: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_SMA, yymsp[-1].minor.yy874); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 194: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 192: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy874); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 195: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy148 = createAlterTableOptions(pCxt); yylhsminor.yy148 = setTableOption(pCxt, yylhsminor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 193: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy74 = createAlterTableOptions(pCxt); yylhsminor.yy74 = setTableOption(pCxt, yylhsminor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 196: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 194: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 197: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy123.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } + case 195: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy767.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; - case 198: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy123.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } + case 196: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy767.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } break; - case 199: /* duration_list ::= duration_literal */ - case 371: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==371); -{ yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } - yymsp[0].minor.yy404 = yylhsminor.yy404; + case 197: /* duration_list ::= duration_literal */ + case 369: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==369); +{ yylhsminor.yy874 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 200: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 372: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==372); -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } - yymsp[-2].minor.yy404 = yylhsminor.yy404; + case 198: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 370: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==370); +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 203: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy199, NULL); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 201: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy317, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 204: /* rollup_func_name ::= FIRST */ - case 205: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==205); - case 258: /* tag_item ::= QTAGS */ yytestcase(yyruleno==258); -{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 202: /* rollup_func_name ::= FIRST */ + case 203: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==203); + case 256: /* tag_item ::= QTAGS */ yytestcase(yyruleno==256); +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 208: /* col_name ::= column_name */ - case 259: /* tag_item ::= column_name */ yytestcase(yyruleno==259); -{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 206: /* col_name ::= column_name */ + case 257: /* tag_item ::= column_name */ yytestcase(yyruleno==257); +{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 209: /* cmd ::= SHOW DNODES */ + case 207: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 210: /* cmd ::= SHOW USERS */ + case 208: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 211: /* cmd ::= SHOW USER PRIVILEGES */ + case 209: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 212: /* cmd ::= SHOW DATABASES */ + case 210: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 213: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } + case 211: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); } break; - case 214: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } + case 212: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); } break; - case 215: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy148, NULL, OP_TYPE_LIKE); } + case 213: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy74, NULL, OP_TYPE_LIKE); } break; - case 216: /* cmd ::= SHOW MNODES */ + case 214: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 217: /* cmd ::= SHOW QNODES */ + case 215: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 218: /* cmd ::= SHOW FUNCTIONS */ + case 216: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 219: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } + case 217: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); } break; - case 220: /* cmd ::= SHOW STREAMS */ + case 218: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 221: /* cmd ::= SHOW ACCOUNTS */ + case 219: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 222: /* cmd ::= SHOW APPS */ + case 220: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 223: /* cmd ::= SHOW CONNECTIONS */ + case 221: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 224: /* cmd ::= SHOW LICENCES */ - case 225: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==225); + case 222: /* cmd ::= SHOW LICENCES */ + case 223: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==223); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 226: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } + case 224: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; - case 227: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy148); } + case 225: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy74); } break; - case 228: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy148); } + case 226: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy74); } break; - case 229: /* cmd ::= SHOW QUERIES */ + case 227: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 230: /* cmd ::= SHOW SCORES */ + case 228: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 231: /* cmd ::= SHOW TOPICS */ + case 229: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 232: /* cmd ::= SHOW VARIABLES */ - case 233: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==233); + case 230: /* cmd ::= SHOW VARIABLES */ + case 231: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==231); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW LOCAL VARIABLES */ + case 232: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 235: /* 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.yy148); } + case 233: /* 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.yy74); } break; - case 236: /* cmd ::= SHOW BNODES */ + case 234: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 237: /* cmd ::= SHOW SNODES */ + case 235: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 238: /* cmd ::= SHOW CLUSTER */ + case 236: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 239: /* cmd ::= SHOW TRANSACTIONS */ + case 237: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 240: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy148); } + case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy74); } break; - case 241: /* cmd ::= SHOW CONSUMERS */ + case 239: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 242: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 240: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 243: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } + case 241: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); } break; - case 244: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148, yymsp[-3].minor.yy404); } + case 242: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74, yymsp[-3].minor.yy874); } break; - case 245: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 243: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 246: /* cmd ::= SHOW VNODES NK_STRING */ + case 244: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 247: /* db_name_cond_opt ::= */ - case 252: /* from_db_opt ::= */ yytestcase(yyruleno==252); -{ yymsp[1].minor.yy148 = createDefaultDatabaseCondValue(pCxt); } + case 245: /* db_name_cond_opt ::= */ + case 250: /* from_db_opt ::= */ yytestcase(yyruleno==250); +{ yymsp[1].minor.yy74 = createDefaultDatabaseCondValue(pCxt); } break; - case 248: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy199); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 246: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 249: /* like_pattern_opt ::= */ - case 304: /* subtable_opt ::= */ yytestcase(yyruleno==304); - case 416: /* case_when_else_opt ::= */ yytestcase(yyruleno==416); - case 446: /* from_clause_opt ::= */ yytestcase(yyruleno==446); - case 475: /* where_clause_opt ::= */ yytestcase(yyruleno==475); - case 484: /* twindow_clause_opt ::= */ yytestcase(yyruleno==484); - case 489: /* sliding_opt ::= */ yytestcase(yyruleno==489); - case 491: /* fill_opt ::= */ yytestcase(yyruleno==491); - case 503: /* having_clause_opt ::= */ yytestcase(yyruleno==503); - case 505: /* range_opt ::= */ yytestcase(yyruleno==505); - case 507: /* every_opt ::= */ yytestcase(yyruleno==507); - case 520: /* slimit_clause_opt ::= */ yytestcase(yyruleno==520); - case 524: /* limit_clause_opt ::= */ yytestcase(yyruleno==524); -{ yymsp[1].minor.yy148 = NULL; } + case 247: /* like_pattern_opt ::= */ + case 302: /* subtable_opt ::= */ yytestcase(yyruleno==302); + case 414: /* case_when_else_opt ::= */ yytestcase(yyruleno==414); + case 444: /* from_clause_opt ::= */ yytestcase(yyruleno==444); + case 473: /* where_clause_opt ::= */ yytestcase(yyruleno==473); + case 482: /* twindow_clause_opt ::= */ yytestcase(yyruleno==482); + case 488: /* sliding_opt ::= */ yytestcase(yyruleno==488); + case 490: /* fill_opt ::= */ yytestcase(yyruleno==490); + case 502: /* having_clause_opt ::= */ yytestcase(yyruleno==502); + case 504: /* range_opt ::= */ yytestcase(yyruleno==504); + case 506: /* every_opt ::= */ yytestcase(yyruleno==506); + case 519: /* slimit_clause_opt ::= */ yytestcase(yyruleno==519); + case 523: /* limit_clause_opt ::= */ yytestcase(yyruleno==523); +{ yymsp[1].minor.yy74 = NULL; } break; - case 250: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 248: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 251: /* table_name_cond ::= table_name */ -{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 249: /* table_name_cond ::= table_name */ +{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 253: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } + case 251: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } break; - case 257: /* tag_item ::= TBNAME */ -{ yylhsminor.yy148 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 255: /* tag_item ::= TBNAME */ +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 260: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy199), &yymsp[0].minor.yy199); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 258: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy317), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 261: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy199), &yymsp[0].minor.yy199); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 259: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy317), &yymsp[0].minor.yy317); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 262: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } + case 260: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy335, yymsp[-3].minor.yy74, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); } break; - case 263: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } + case 261: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } break; - case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy148 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 262: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy74 = createIndexOption(pCxt, yymsp[-7].minor.yy874, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 265: /* 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.yy148 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 263: /* 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.yy74 = createIndexOption(pCxt, yymsp[-9].minor.yy874, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 268: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 266: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 269: /* sma_stream_opt ::= */ - case 297: /* stream_options ::= */ yytestcase(yyruleno==297); -{ yymsp[1].minor.yy148 = createStreamOptions(pCxt); } + case 267: /* sma_stream_opt ::= */ + case 295: /* stream_options ::= */ yytestcase(yyruleno==295); +{ yymsp[1].minor.yy74 = createStreamOptions(pCxt); } break; - case 270: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - case 301: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==301); -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 268: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 299: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==299); +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 271: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 269: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 272: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 270: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } + case 271: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy199, false); } + case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy317, false); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[0].minor.yy199, true); } + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[0].minor.yy317, true); } break; - case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, yymsp[0].minor.yy148, false); } + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, yymsp[0].minor.yy74, false); } break; - case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, yymsp[0].minor.yy148, true); } + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, yymsp[0].minor.yy74, true); } break; - case 278: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } + case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 279: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } + case 277: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } break; - case 280: /* cmd ::= DESC full_table_name */ - case 281: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==281); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy148); } + case 278: /* cmd ::= DESC full_table_name */ + case 279: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==279); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy74); } break; - case 282: /* cmd ::= RESET QUERY CACHE */ + case 280: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 283: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 281: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy335, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 286: /* explain_options ::= */ -{ yymsp[1].minor.yy148 = createDefaultExplainOptions(pCxt); } + case 284: /* explain_options ::= */ +{ yymsp[1].minor.yy74 = createDefaultExplainOptions(pCxt); } break; - case 287: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy148 = setExplainVerbose(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 285: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy74 = setExplainVerbose(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 288: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy148 = setExplainRatio(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 286: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy74 = setExplainRatio(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 289: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy530, yymsp[0].minor.yy706); } + case 287: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-8].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy898, yymsp[0].minor.yy856); } break; - case 290: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } + case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 295: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy397, &yymsp[-7].minor.yy199, yymsp[-4].minor.yy148, yymsp[-6].minor.yy148, yymsp[-3].minor.yy404, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } + case 293: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy335, &yymsp[-7].minor.yy317, yymsp[-4].minor.yy74, yymsp[-6].minor.yy74, yymsp[-3].minor.yy874, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } break; - case 296: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } + case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 298: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 296: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 299: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 297: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 300: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy148)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-3].minor.yy148; } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 298: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy74)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-3].minor.yy74; } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 302: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy148)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-3].minor.yy148; } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 300: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy74)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-3].minor.yy74; } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 303: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-2].minor.yy148)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-2].minor.yy148; } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 301: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy74)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-2].minor.yy74; } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 305: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 490: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); - case 508: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==508); -{ yymsp[-3].minor.yy148 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy148); } + case 303: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 489: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==489); + case 507: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==507); +{ yymsp[-3].minor.yy74 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy74); } break; - case 306: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= KILL QUERY NK_STRING */ + case 305: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 308: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= BALANCE VGROUP */ + case 307: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 310: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 311: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } + case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); } break; - case 312: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 313: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 311: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 315: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 317: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy148, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } + case 315: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy74, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); } break; - case 318: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } + case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); } break; - case 319: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 317: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 320: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 318: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 321: /* literal ::= NK_STRING */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 319: /* literal ::= NK_STRING */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 322: /* literal ::= NK_BOOL */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 320: /* literal ::= NK_BOOL */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 323: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 321: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 324: /* literal ::= duration_literal */ - case 334: /* signed_literal ::= signed */ yytestcase(yyruleno==334); - case 354: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==354); - case 355: /* expression ::= literal */ yytestcase(yyruleno==355); - case 356: /* expression ::= pseudo_column */ yytestcase(yyruleno==356); - case 357: /* expression ::= column_reference */ yytestcase(yyruleno==357); - case 358: /* expression ::= function_expression */ yytestcase(yyruleno==358); - case 359: /* expression ::= case_when_expression */ yytestcase(yyruleno==359); - case 389: /* function_expression ::= literal_func */ yytestcase(yyruleno==389); - case 438: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==438); - case 442: /* boolean_primary ::= predicate */ yytestcase(yyruleno==442); - case 444: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==444); - case 445: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==445); - case 448: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==448); - case 450: /* table_reference ::= table_primary */ yytestcase(yyruleno==450); - case 451: /* table_reference ::= joined_table */ yytestcase(yyruleno==451); - case 455: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==455); - case 510: /* query_simple ::= query_specification */ yytestcase(yyruleno==510); - case 511: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==511); - case 514: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==514); - case 516: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==516); -{ yylhsminor.yy148 = yymsp[0].minor.yy148; } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 322: /* literal ::= duration_literal */ + case 332: /* signed_literal ::= signed */ yytestcase(yyruleno==332); + case 352: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==352); + case 353: /* expression ::= literal */ yytestcase(yyruleno==353); + case 354: /* expression ::= pseudo_column */ yytestcase(yyruleno==354); + case 355: /* expression ::= column_reference */ yytestcase(yyruleno==355); + case 356: /* expression ::= function_expression */ yytestcase(yyruleno==356); + case 357: /* expression ::= case_when_expression */ yytestcase(yyruleno==357); + case 387: /* function_expression ::= literal_func */ yytestcase(yyruleno==387); + case 436: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==436); + case 440: /* boolean_primary ::= predicate */ yytestcase(yyruleno==440); + case 442: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==442); + case 443: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==443); + case 446: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==446); + case 448: /* table_reference ::= table_primary */ yytestcase(yyruleno==448); + case 449: /* table_reference ::= joined_table */ yytestcase(yyruleno==449); + case 453: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==453); + case 509: /* query_simple ::= query_specification */ yytestcase(yyruleno==509); + case 510: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==510); + case 513: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==513); + case 515: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==515); +{ yylhsminor.yy74 = yymsp[0].minor.yy74; } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 325: /* literal ::= NULL */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 323: /* literal ::= NULL */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 326: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 324: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 327: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 325: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 328: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 326: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 329: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 327: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 330: /* signed ::= NK_MINUS NK_INTEGER */ + case 328: /* 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.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 331: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 329: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 332: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 330: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 333: /* signed ::= NK_MINUS NK_FLOAT */ + case 331: /* 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.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 335: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 333: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 336: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 334: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 337: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 338: /* signed_literal ::= duration_literal */ - case 340: /* signed_literal ::= literal_func */ yytestcase(yyruleno==340); - case 409: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==409); - case 471: /* select_item ::= common_expression */ yytestcase(yyruleno==471); - case 481: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==481); - case 515: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==515); - case 517: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==517); - case 530: /* search_condition ::= common_expression */ yytestcase(yyruleno==530); -{ yylhsminor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 336: /* signed_literal ::= duration_literal */ + case 338: /* signed_literal ::= literal_func */ yytestcase(yyruleno==338); + case 407: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==407); + case 469: /* select_item ::= common_expression */ yytestcase(yyruleno==469); + case 479: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==479); + case 514: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==514); + case 516: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==516); + case 529: /* search_condition ::= common_expression */ yytestcase(yyruleno==529); +{ yylhsminor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 339: /* signed_literal ::= NULL */ -{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 337: /* signed_literal ::= NULL */ +{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 341: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy148 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 339: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy74 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 360: /* expression ::= NK_LP expression NK_RP */ - case 443: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==443); - case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 358: /* expression ::= NK_LP expression NK_RP */ + case 441: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==441); + case 528: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==528); +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 361: /* expression ::= NK_PLUS expr_or_subquery */ + case 359: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 362: /* expression ::= NK_MINUS expr_or_subquery */ + case 360: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL)); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 363: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 364: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 365: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 366: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 367: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 368: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 369: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 370: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 373: /* column_reference ::= column_name */ -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy199, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 371: /* column_reference ::= column_name */ +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy317, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 374: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 372: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 375: /* pseudo_column ::= ROWTS */ - case 376: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==376); - case 378: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= QEND */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= WEND */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==383); - case 384: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==384); - case 385: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==385); - case 391: /* literal_func ::= NOW */ yytestcase(yyruleno==391); -{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 373: /* pseudo_column ::= ROWTS */ + case 374: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==374); + case 376: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==376); + case 377: /* pseudo_column ::= QEND */ yytestcase(yyruleno==377); + case 378: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= WEND */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==383); + case 389: /* literal_func ::= NOW */ yytestcase(yyruleno==389); +{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 377: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy199)))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 375: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy317)))); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 386: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 387: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==387); -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404)); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 384: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 385: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==385); +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874)); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 388: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy530)); } - yymsp[-5].minor.yy148 = yylhsminor.yy148; + case 386: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy898)); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 390: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy199, NULL)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 388: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy317, NULL)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 405: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy404 = yylhsminor.yy404; + case 403: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy874 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 410: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 474: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==474); -{ yylhsminor.yy148 = createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 408: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 472: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==472); +{ yylhsminor.yy74 = createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 411: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 409: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 412: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; + case 410: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); } + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 415: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy148 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } + case 413: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy74 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); } break; - case 417: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } + case 415: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } break; - case 418: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 423: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==423); + case 416: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 421: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==421); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 419: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-4].minor.yy148 = yylhsminor.yy148; + yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 420: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-5].minor.yy148 = yylhsminor.yy148; + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 421: /* predicate ::= expr_or_subquery IS NULL */ + case 419: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), NULL)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 422: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL)); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 424: /* compare_op ::= NK_LT */ + case 422: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 425: /* compare_op ::= NK_GT */ + case 423: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 426: /* compare_op ::= NK_LE */ + case 424: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 427: /* compare_op ::= NK_GE */ + case 425: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 428: /* compare_op ::= NK_NE */ + case 426: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 429: /* compare_op ::= NK_EQ */ + case 427: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 430: /* compare_op ::= LIKE */ + case 428: /* compare_op ::= LIKE */ { yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 431: /* compare_op ::= NOT LIKE */ + case 429: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 432: /* compare_op ::= MATCH */ + case 430: /* compare_op ::= MATCH */ { yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 433: /* compare_op ::= NMATCH */ + case 431: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 434: /* compare_op ::= CONTAINS */ + case 432: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 435: /* in_op ::= IN */ + case 433: /* in_op ::= IN */ { yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 436: /* in_op ::= NOT IN */ + case 434: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 437: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 435: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 439: /* boolean_value_expression ::= NOT boolean_primary */ + case 437: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL)); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 440: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 441: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); - yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); + yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 447: /* from_clause_opt ::= FROM table_reference_list */ - case 476: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==476); - case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); -{ yymsp[-1].minor.yy148 = yymsp[0].minor.yy148; } + case 445: /* from_clause_opt ::= FROM table_reference_list */ + case 474: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==474); + case 503: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==503); +{ yymsp[-1].minor.yy74 = yymsp[0].minor.yy74; } break; - case 449: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy148 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, NULL); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 447: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy74 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, NULL); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 452: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 450: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 453: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 451: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 454: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy148 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 452: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy74 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 456: /* alias_opt ::= */ -{ yymsp[1].minor.yy199 = nil_token; } + case 454: /* alias_opt ::= */ +{ yymsp[1].minor.yy317 = nil_token; } break; - case 458: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy199 = yymsp[0].minor.yy199; } + case 456: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy317 = yymsp[0].minor.yy317; } break; - case 459: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 460: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==460); -{ yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } + case 457: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 458: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==458); +{ yymsp[-2].minor.yy74 = yymsp[-1].minor.yy74; } break; - case 461: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy148 = createJoinTableNode(pCxt, yymsp[-4].minor.yy470, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } - yymsp[-5].minor.yy148 = yylhsminor.yy148; + case 459: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy74 = createJoinTableNode(pCxt, yymsp[-4].minor.yy630, yymsp[-5].minor.yy74, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 462: /* join_type ::= */ -{ yymsp[1].minor.yy470 = JOIN_TYPE_INNER; } + case 460: /* join_type ::= */ +{ yymsp[1].minor.yy630 = JOIN_TYPE_INNER; } break; - case 463: /* join_type ::= INNER */ -{ yymsp[0].minor.yy470 = JOIN_TYPE_INNER; } + case 461: /* join_type ::= INNER */ +{ yymsp[0].minor.yy630 = JOIN_TYPE_INNER; } break; - case 464: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 462: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy148 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy404, yymsp[-8].minor.yy148); - yymsp[-11].minor.yy148 = addWhereClause(pCxt, yymsp[-11].minor.yy148, yymsp[-7].minor.yy148); - yymsp[-11].minor.yy148 = addPartitionByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-6].minor.yy404); - yymsp[-11].minor.yy148 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy148, yymsp[-2].minor.yy148); - yymsp[-11].minor.yy148 = addGroupByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-1].minor.yy404); - yymsp[-11].minor.yy148 = addHavingClause(pCxt, yymsp[-11].minor.yy148, yymsp[0].minor.yy148); - yymsp[-11].minor.yy148 = addRangeClause(pCxt, yymsp[-11].minor.yy148, yymsp[-5].minor.yy148); - yymsp[-11].minor.yy148 = addEveryClause(pCxt, yymsp[-11].minor.yy148, yymsp[-4].minor.yy148); - yymsp[-11].minor.yy148 = addFillClause(pCxt, yymsp[-11].minor.yy148, yymsp[-3].minor.yy148); + yymsp[-11].minor.yy74 = createSelectStmt(pCxt, yymsp[-10].minor.yy335, yymsp[-9].minor.yy874, yymsp[-8].minor.yy74); + yymsp[-11].minor.yy74 = addWhereClause(pCxt, yymsp[-11].minor.yy74, yymsp[-7].minor.yy74); + yymsp[-11].minor.yy74 = addPartitionByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-6].minor.yy874); + yymsp[-11].minor.yy74 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy74, yymsp[-2].minor.yy74); + yymsp[-11].minor.yy74 = addGroupByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-1].minor.yy874); + yymsp[-11].minor.yy74 = addHavingClause(pCxt, yymsp[-11].minor.yy74, yymsp[0].minor.yy74); + yymsp[-11].minor.yy74 = addRangeClause(pCxt, yymsp[-11].minor.yy74, yymsp[-5].minor.yy74); + yymsp[-11].minor.yy74 = addEveryClause(pCxt, yymsp[-11].minor.yy74, yymsp[-4].minor.yy74); + yymsp[-11].minor.yy74 = addFillClause(pCxt, yymsp[-11].minor.yy74, yymsp[-3].minor.yy74); } break; - case 467: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy397 = false; } + case 465: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy335 = false; } break; - case 470: /* select_item ::= NK_STAR */ -{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy148 = yylhsminor.yy148; + case 468: /* select_item ::= NK_STAR */ +{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 472: /* select_item ::= common_expression column_alias */ - case 482: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==482); -{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } - yymsp[-1].minor.yy148 = yylhsminor.yy148; + case 470: /* select_item ::= common_expression column_alias */ + case 480: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==480); +{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 473: /* select_item ::= common_expression AS column_alias */ - case 483: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==483); -{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), &yymsp[0].minor.yy199); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 471: /* select_item ::= common_expression AS column_alias */ + case 481: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==481); +{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), &yymsp[0].minor.yy317); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 478: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 500: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==500); - case 519: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==519); -{ yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } + case 476: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 499: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==499); + case 518: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==518); +{ yymsp[-2].minor.yy874 = yymsp[0].minor.yy874; } break; - case 485: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy148 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } + case 483: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy74 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } break; - case 486: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy148 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } + case 484: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy74 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } break; - case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 485: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 488: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } break; - case 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy148 = createFillNode(pCxt, yymsp[-1].minor.yy334, NULL); } + case 487: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy74 = createEventWindowNode(pCxt, yymsp[-3].minor.yy74, yymsp[0].minor.yy74); } break; - case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy148 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } + case 491: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy74 = createFillNode(pCxt, yymsp[-1].minor.yy828, NULL); } break; - case 494: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy334 = FILL_MODE_NONE; } + case 492: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy74 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } break; - case 495: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy334 = FILL_MODE_PREV; } + case 493: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy828 = FILL_MODE_NONE; } break; - case 496: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy334 = FILL_MODE_NULL; } + case 494: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy828 = FILL_MODE_PREV; } break; - case 497: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy334 = FILL_MODE_LINEAR; } + case 495: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy828 = FILL_MODE_NULL; } break; - case 498: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy334 = FILL_MODE_NEXT; } + case 496: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy828 = FILL_MODE_LINEAR; } break; - case 501: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[0].minor.yy404 = yylhsminor.yy404; + case 497: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy828 = FILL_MODE_NEXT; } break; - case 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy404 = yylhsminor.yy404; + case 500: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy874 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } + yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy148 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } + case 501: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); } + yymsp[-2].minor.yy874 = yylhsminor.yy874; break; - case 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 505: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy74 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); } + break; + case 508: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy148 = addOrderByClause(pCxt, yymsp[-3].minor.yy148, yymsp[-2].minor.yy404); - yylhsminor.yy148 = addSlimitClause(pCxt, yylhsminor.yy148, yymsp[-1].minor.yy148); - yylhsminor.yy148 = addLimitClause(pCxt, yylhsminor.yy148, yymsp[0].minor.yy148); + yylhsminor.yy74 = addOrderByClause(pCxt, yymsp[-3].minor.yy74, yymsp[-2].minor.yy874); + yylhsminor.yy74 = addSlimitClause(pCxt, yylhsminor.yy74, yymsp[-1].minor.yy74); + yylhsminor.yy74 = addLimitClause(pCxt, yylhsminor.yy74, yymsp[0].minor.yy74); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy148, yymsp[0].minor.yy148); } - yymsp[-3].minor.yy148 = yylhsminor.yy148; + case 511: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 513: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 512: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==525); -{ yymsp[-1].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==524); +{ yymsp[-1].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==526); -{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==525); +{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==527); -{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==526); +{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 528: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy148); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 527: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy74); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 533: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy148 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), yymsp[-1].minor.yy898, yymsp[0].minor.yy499); } - yymsp[-2].minor.yy148 = yylhsminor.yy148; + case 532: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy74 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), yymsp[-1].minor.yy326, yymsp[0].minor.yy109); } + yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 534: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy898 = ORDER_ASC; } + case 533: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy326 = ORDER_ASC; } break; - case 535: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy898 = ORDER_ASC; } + case 534: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy326 = ORDER_ASC; } break; - case 536: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy898 = ORDER_DESC; } + case 535: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy326 = ORDER_DESC; } break; - case 537: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy499 = NULL_ORDER_DEFAULT; } + case 536: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } break; - case 538: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy499 = NULL_ORDER_FIRST; } + case 537: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } break; - case 539: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy499 = NULL_ORDER_LAST; } + case 538: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 334d12b95f..17d02c1cce 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -48,7 +48,7 @@ TEST_F(ParserInitialCTest, createAccount) { * | PRECISION {'ms' | 'us' | 'ns'} * | REPLICA value * | RETENTIONS ingestion_duration:keep_duration ... - * | STRICT {'off' | 'on'} + * | STRICT {'off' | 'on'} // not support * | WAL_LEVEL value * | VGROUPS value * | SINGLE_STABLE {0 | 1} @@ -216,7 +216,7 @@ TEST_F(ParserInitialCTest, createDatabase) { addDbRetentionFunc(15 * MILLISECOND_PER_SECOND, 7 * MILLISECOND_PER_DAY, TIME_UNIT_SECOND, TIME_UNIT_DAY); addDbRetentionFunc(1 * MILLISECOND_PER_MINUTE, 21 * MILLISECOND_PER_DAY, TIME_UNIT_MINUTE, TIME_UNIT_DAY); addDbRetentionFunc(15 * MILLISECOND_PER_MINUTE, 500 * MILLISECOND_PER_DAY, TIME_UNIT_MINUTE, TIME_UNIT_DAY); - setDbStrictaFunc(1); + // setDbStrictaFunc(1); setDbWalLevelFunc(2); setDbVgroupsFunc(100); setDbSingleStableFunc(1); @@ -244,7 +244,7 @@ TEST_F(ParserInitialCTest, createDatabase) { "PRECISION 'ns' " "REPLICA 3 " "RETENTIONS 15s:7d,1m:21d,15m:500d " - "STRICT 'on' " + // "STRICT 'on' " "WAL_LEVEL 2 " "VGROUPS 100 " "SINGLE_STABLE 1 " diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index b05c35452b..205c70e0df 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -814,6 +814,29 @@ static int32_t createWindowLogicNodeByInterval(SLogicPlanContext* pCxt, SInterva return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); } +static int32_t createWindowLogicNodeByEvent(SLogicPlanContext* pCxt, SEventWindowNode* pEvent, SSelectStmt* pSelect, + SLogicNode** pLogicNode) { + SWindowLogicNode* pWindow = (SWindowLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_WINDOW); + if (NULL == pWindow) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + pWindow->winType = WINDOW_TYPE_EVENT; + pWindow->node.groupAction = getGroupAction(pCxt, pSelect); + pWindow->node.requireDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_IN_BLOCK : getRequireDataOrder(true, pSelect); + pWindow->node.resultDataOrder = + pCxt->pPlanCxt->streamQuery ? DATA_ORDER_LEVEL_GLOBAL : pWindow->node.requireDataOrder; + pWindow->pStartCond = nodesCloneNode(pEvent->pStartCond); + pWindow->pEndCond = nodesCloneNode(pEvent->pEndCond); + pWindow->pTspk = nodesCloneNode(pEvent->pCol); + if (NULL == pWindow->pStartCond || NULL == pWindow->pEndCond || NULL == pWindow->pTspk) { + nodesDestroyNode((SNode*)pWindow); + return TSDB_CODE_OUT_OF_MEMORY; + } + return createWindowLogicNodeFinalize(pCxt, pSelect, pWindow, pLogicNode); +} + static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (NULL == pSelect->pWindow) { return TSDB_CODE_SUCCESS; @@ -826,6 +849,8 @@ static int32_t createWindowLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSele return createWindowLogicNodeBySession(pCxt, (SSessionWindowNode*)pSelect->pWindow, pSelect, pLogicNode); case QUERY_NODE_INTERVAL_WINDOW: return createWindowLogicNodeByInterval(pCxt, (SIntervalWindowNode*)pSelect->pWindow, pSelect, pLogicNode); + case QUERY_NODE_EVENT_WINDOW: + return createWindowLogicNodeByEvent(pCxt, (SEventWindowNode*)pSelect->pWindow, pSelect, pLogicNode); default: break; } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index e5675310b5..78ae3c1c3b 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1297,6 +1297,33 @@ static int32_t createStateWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC return code; } +static int32_t createEventWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, + SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { + SEventWinodwPhysiNode* pEvent = (SEventWinodwPhysiNode*)makePhysiNode( + pCxt, (SLogicNode*)pWindowLogicNode, + (pCxt->pPlanCxt->streamQuery ? QUERY_NODE_PHYSICAL_PLAN_STREAM_EVENT : QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT)); + if (NULL == pEvent) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + SDataBlockDescNode* pChildTupe = (((SPhysiNode*)nodesListGetNode(pChildren, 0))->pOutputDataBlockDesc); + int32_t code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pStartCond, &pEvent->pStartCond); + if (TSDB_CODE_SUCCESS == code) { + code = setNodeSlotId(pCxt, pChildTupe->dataBlockId, -1, pWindowLogicNode->pEndCond, &pEvent->pEndCond); + } + if (TSDB_CODE_SUCCESS == code) { + code = createWindowPhysiNodeFinalize(pCxt, pChildren, &pEvent->window, pWindowLogicNode); + } + + if (TSDB_CODE_SUCCESS == code) { + *pPhyNode = (SPhysiNode*)pEvent; + } else { + nodesDestroyNode((SNode*)pEvent); + } + + return code; +} + static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildren, SWindowLogicNode* pWindowLogicNode, SPhysiNode** pPhyNode) { switch (pWindowLogicNode->winType) { @@ -1306,6 +1333,8 @@ static int32_t createWindowPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChildr return createSessionWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); case WINDOW_TYPE_STATE: return createStateWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); + case WINDOW_TYPE_EVENT: + return createEventWindowPhysiNode(pCxt, pChildren, pWindowLogicNode, pPhyNode); default: break; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index f5782dc937..f6b1babf95 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -729,6 +729,18 @@ static int32_t stbSplSplitState(SSplitContext* pCxt, SStableSplitInfo* pInfo) { } } +static int32_t stbSplSplitEventForStream(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + return TSDB_CODE_PLAN_INTERNAL_ERROR; +} + +static int32_t stbSplSplitEvent(SSplitContext* pCxt, SStableSplitInfo* pInfo) { + if (pCxt->pPlanCxt->streamQuery) { + return stbSplSplitEventForStream(pCxt, pInfo); + } else { + return stbSplSplitSessionOrStateForBatch(pCxt, pInfo); + } +} + static bool stbSplIsPartTableWinodw(SWindowLogicNode* pWindow) { return stbSplHasPartTbname(stbSplGetPartKeys((SLogicNode*)nodesListGetNode(pWindow->node.pChildren, 0))); } @@ -741,6 +753,8 @@ static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitI return stbSplSplitSession(pCxt, pInfo); case WINDOW_TYPE_STATE: return stbSplSplitState(pCxt, pInfo); + case WINDOW_TYPE_EVENT: + return stbSplSplitEvent(pCxt, pInfo); default: break; } diff --git a/source/libs/planner/src/planUtil.c b/source/libs/planner/src/planUtil.c index a13e959a36..72931413cc 100644 --- a/source/libs/planner/src/planUtil.c +++ b/source/libs/planner/src/planUtil.c @@ -197,6 +197,15 @@ static int32_t adjustStateDataRequirement(SWindowLogicNode* pWindow, EDataOrderL return TSDB_CODE_SUCCESS; } +static int32_t adjustEventDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { + if (requirement <= pWindow->node.resultDataOrder) { + return TSDB_CODE_SUCCESS; + } + pWindow->node.resultDataOrder = requirement; + pWindow->node.requireDataOrder = requirement; + return TSDB_CODE_SUCCESS; +} + static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrderLevel requirement) { switch (pWindow->winType) { case WINDOW_TYPE_INTERVAL: @@ -205,6 +214,8 @@ static int32_t adjustWindowDataRequirement(SWindowLogicNode* pWindow, EDataOrder return adjustSessionDataRequirement(pWindow, requirement); case WINDOW_TYPE_STATE: return adjustStateDataRequirement(pWindow, requirement); + case WINDOW_TYPE_EVENT: + return adjustEventDataRequirement(pWindow, requirement); default: break; } diff --git a/source/libs/planner/test/planEventTest.cpp b/source/libs/planner/test/planEventTest.cpp new file mode 100644 index 0000000000..c4db145998 --- /dev/null +++ b/source/libs/planner/test/planEventTest.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "planTestUtil.h" +#include "planner.h" + +using namespace std; + +class PlanEventTest : public PlannerTestBase {}; + +TEST_F(PlanEventTest, basic) { + useDb("root", "test"); + + run("SELECT COUNT(*) FROM t1 EVENT_WINDOW START WITH c1 > 10 END WITH c2 = 'abc'"); +} + +TEST_F(PlanEventTest, stable) { + useDb("root", "test"); + + run("SELECT COUNT(*) FROM st1 EVENT_WINDOW START WITH c1 > 10 END WITH c2 = 'abc'"); +} diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h index 9d8fad6fea..eb6091d605 100644 --- a/source/libs/qworker/inc/qwInt.h +++ b/source/libs/qworker/inc/qwInt.h @@ -31,7 +31,7 @@ extern "C" { #define QW_DEFAULT_SCHEDULER_NUMBER 100 #define QW_DEFAULT_TASK_NUMBER 10000 -#define QW_DEFAULT_SCH_TASK_NUMBER 3000 +#define QW_DEFAULT_SCH_TASK_NUMBER 500 #define QW_DEFAULT_SHORT_RUN_TIMES 2 #define QW_DEFAULT_HEARTBEAT_MSEC 5000 #define QW_SCH_TIMEOUT_MSEC 180000 diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index f3d073634d..fdd2775daa 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -74,6 +74,8 @@ int32_t qwAddSchedulerImpl(SQWorker *mgmt, uint64_t sId, int32_t rwType) { SQWSchStatus newSch = {0}; newSch.tasksHash = taosHashInit(mgmt->cfg.maxSchTaskNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); + newSch.hbBrokenTs = taosGetTimestampMs(); + if (NULL == newSch.tasksHash) { QW_SCH_ELOG("taosHashInit %d failed", mgmt->cfg.maxSchTaskNum); QW_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); diff --git a/source/libs/scheduler/src/schStatus.c b/source/libs/scheduler/src/schStatus.c index 66d58c95d1..4c16a81a05 100644 --- a/source/libs/scheduler/src/schStatus.c +++ b/source/libs/scheduler/src/schStatus.c @@ -64,7 +64,7 @@ _return: int32_t schHandleOpBeginEvent(int64_t jobId, SSchJob** job, SCH_OP_TYPE type, SSchedulerReq* pReq) { SSchJob* pJob = schAcquireJob(jobId); if (NULL == pJob) { - qWarn("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, jobId); + qDebug("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, jobId); SCH_ERR_RET(TSDB_CODE_SCH_STATUS_ERROR); } diff --git a/source/libs/scheduler/src/scheduler.c b/source/libs/scheduler/src/scheduler.c index 1926c26dc9..7cd5e957b6 100644 --- a/source/libs/scheduler/src/scheduler.c +++ b/source/libs/scheduler/src/scheduler.c @@ -157,7 +157,7 @@ void schedulerFreeJob(int64_t *jobId, int32_t errCode) { SSchJob *pJob = schAcquireJob(*jobId); if (NULL == pJob) { - qWarn("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, *jobId); + qDebug("Acquire sch job failed, may be dropped, jobId:0x%" PRIx64, *jobId); return; } diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index dee0bf95c7..a5524ffbde 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -215,7 +215,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode); int32_t syncNodeStartStandBy(SSyncNode* pSyncNode); void syncNodeClose(SSyncNode* pSyncNode); void syncNodePreClose(SSyncNode* pSyncNode); -int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak); +int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t *seq); int32_t syncNodeRestore(SSyncNode* pSyncNode); void syncHbTimerDataFree(SSyncHbTimerData* pData); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 6fabab18cb..6a545424fc 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { } syncNodeStartHeartbeatTimer(pSyncNode); - //syncNodeReplicate(pSyncNode); + // syncNodeReplicate(pSyncNode); } syncNodeRelease(pSyncNode); @@ -218,6 +218,26 @@ int32_t syncLeaderTransfer(int64_t rid) { return ret; } +int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) { + SSyncNode* pNode = syncNodeAcquire(rid); + if (pNode == NULL) return -1; + + SRpcMsg rpcMsg = {0}; + int32_t ret = syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); + rpcMsg.code = TSDB_CODE_SYN_TIMEOUT; + + syncNodeRelease(pNode); + if (ret == 1) { + sInfo("send timeout response, seq:%" PRId64 " handle:%p ahandle:%p", seq, rpcMsg.info.handle, + rpcMsg.info.ahandle); + rpcSendResponse(&rpcMsg); + return 0; + } else { + sError("no message handle to send timeout response, seq:%" PRId64, seq); + return -1; + } +} + SyncIndex syncMinMatchIndex(SSyncNode* pSyncNode) { SyncIndex minMatchIndex = SYNC_INDEX_INVALID; @@ -538,7 +558,7 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) { pMsg->newLeaderId.vgId = pSyncNode->vgId; pMsg->newNodeInfo = newLeader; - int32_t ret = syncNodePropose(pSyncNode, &rpcMsg, false); + int32_t ret = syncNodePropose(pSyncNode, &rpcMsg, false, NULL); rpcFreeCont(rpcMsg.pCont); return ret; } @@ -670,19 +690,19 @@ void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet) { syncNodeRelease(pSyncNode); } -int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak) { +int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { SSyncNode* pSyncNode = syncNodeAcquire(rid); if (pSyncNode == NULL) { sError("sync propose error"); return -1; } - int32_t ret = syncNodePropose(pSyncNode, pMsg, isWeak); + int32_t ret = syncNodePropose(pSyncNode, pMsg, isWeak, seq); syncNodeRelease(pSyncNode); return ret; } -int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { +int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; sNError(pSyncNode, "sync propose not leader, %s, type:%s", syncStr(pSyncNode->state), TMSG_INFO(pMsg->msgType)); @@ -739,6 +759,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak) { (void)syncRespMgrDel(pSyncNode->pSyncRespMgr, seqNum); } + if (seq != NULL) *seq = seqNum; return code; } } diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 7bd8d75dd1..88727351c6 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -594,6 +594,7 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { int count = 0; int64_t firstIndex = -1; SyncTerm term = -1; + int64_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); for (SyncIndex index = pMgr->startIndex; index < pMgr->endIndex; index++) { int64_t pos = index % pMgr->size; @@ -620,7 +621,10 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { retried = true; if (firstIndex == -1) firstIndex = index; - count++; + + if (batchSize <= count++) { + break; + } } ret = 0; @@ -800,8 +804,9 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { ASSERT(pMgr->restored); + SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; - int32_t batchSize = TMAX(1, pMgr->size / 20); + int32_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); int32_t count = 0; int64_t nowMs = taosGetMonoTimestampMs(); int64_t limit = pMgr->size >> 1; diff --git a/source/libs/sync/src/syncRespMgr.c b/source/libs/sync/src/syncRespMgr.c index 049b02d73e..79a38cad7a 100644 --- a/source/libs/sync/src/syncRespMgr.c +++ b/source/libs/sync/src/syncRespMgr.c @@ -35,11 +35,16 @@ SSyncRespMgr *syncRespMgrCreate(void *data, int64_t ttl) { pObj->seqNum = 0; taosThreadMutexInit(&(pObj->mutex), NULL); + SSyncNode *pNode = pObj->data; + sTrace("vgId:%d, create resp manager", pNode->vgId); return pObj; } void syncRespMgrDestroy(SSyncRespMgr *pObj) { if (pObj != NULL) { + SSyncNode *pNode = pObj->data; + sTrace("vgId:%d, destroy resp manager", pNode->vgId); + taosThreadMutexLock(&pObj->mutex); taosHashCleanup(pObj->pRespHash); taosThreadMutexUnlock(&pObj->mutex); @@ -81,6 +86,8 @@ int32_t syncRespMgrGet(SSyncRespMgr *pObj, uint64_t seq, SRespStub *pStub) { taosThreadMutexUnlock(&pObj->mutex); return 1; // get one object + } else { + sNError(pObj->data, "get message handle, no object of seq:%" PRIu64, seq); } taosThreadMutexUnlock(&pObj->mutex); @@ -99,6 +106,8 @@ int32_t syncRespMgrGetAndDel(SSyncRespMgr *pObj, uint64_t seq, SRpcHandleInfo *p taosThreadMutexUnlock(&pObj->mutex); return 1; // get one object + } else { + sNError(pObj->data, "get-and-del message handle, no object of seq:%" PRIu64, seq); } taosThreadMutexUnlock(&pObj->mutex); @@ -114,7 +123,7 @@ static void syncRespCleanByTTL(SSyncRespMgr *pObj, int64_t ttl, bool rsp) { SArray *delIndexArray = taosArrayInit(4, sizeof(uint64_t)); if (delIndexArray == NULL) return; - sDebug("vgId:%d, resp mgr begin clean by ttl", pSyncNode->vgId); + sDebug("vgId:%d, resp manager begin clean by ttl", pSyncNode->vgId); while (pStub) { size_t len; void *key = taosHashGetKey(pStub, &len); @@ -143,34 +152,39 @@ static void syncRespCleanByTTL(SSyncRespMgr *pObj, int64_t ttl, bool rsp) { // TODO: and make rpcMsg body, call commit cb // pSyncNode->pFsm->FpCommitCb(pSyncNode->pFsm, &pStub->rpcMsg, cbMeta); - - pStub->rpcMsg.code = TSDB_CODE_SYN_NOT_LEADER; - if (pStub->rpcMsg.info.handle != NULL) { - tmsgSendRsp(&pStub->rpcMsg); - } + SRpcMsg rpcMsg = {.info = pStub->rpcMsg.info, .code = TSDB_CODE_SYN_TIMEOUT}; + sInfo("vgId:%d, message handle:%p expired, type:%s ahandle:%p", pSyncNode->vgId, rpcMsg.info.handle, + TMSG_INFO(pStub->rpcMsg.msgType), rpcMsg.info.ahandle); + rpcSendResponse(&rpcMsg); } pStub = taosHashIterate(pObj->pRespHash, pStub); } int32_t arraySize = taosArrayGetSize(delIndexArray); - sDebug("vgId:%d, resp mgr end clean by ttl, sum:%d, cnt:%d, array-size:%d", pSyncNode->vgId, sum, cnt, arraySize); + sDebug("vgId:%d, resp manager end clean by ttl, sum:%d, cnt:%d, array-size:%d", pSyncNode->vgId, sum, cnt, arraySize); for (int32_t i = 0; i < arraySize; ++i) { uint64_t *pSeqNum = taosArrayGet(delIndexArray, i); taosHashRemove(pObj->pRespHash, pSeqNum, sizeof(uint64_t)); - sDebug("vgId:%d, resp mgr clean by ttl, seq:%" PRId64 "", pSyncNode->vgId, *pSeqNum); + sDebug("vgId:%d, resp manager clean by ttl, seq:%" PRId64, pSyncNode->vgId, *pSeqNum); } taosArrayDestroy(delIndexArray); } void syncRespCleanRsp(SSyncRespMgr *pObj) { + SSyncNode *pNode = pObj->data; + sTrace("vgId:%d, clean all rsp", pNode->vgId); + taosThreadMutexLock(&pObj->mutex); syncRespCleanByTTL(pObj, -1, true); taosThreadMutexUnlock(&pObj->mutex); } void syncRespClean(SSyncRespMgr *pObj) { + SSyncNode *pNode = pObj->data; + sTrace("vgId:%d, clean rsp by ttl", pNode->vgId); + taosThreadMutexLock(&pObj->mutex); syncRespCleanByTTL(pObj, pObj->ttl, false); taosThreadMutexUnlock(&pObj->mutex); diff --git a/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp b/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp index 057f2ea6dd..7a5d0777bb 100644 --- a/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp +++ b/source/libs/sync/test/syncConfigChangeSnapshotTest.cpp @@ -337,7 +337,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncConfigChangeTest.cpp b/source/libs/sync/test/syncConfigChangeTest.cpp index bab3d2236f..f35a23b15b 100644 --- a/source/libs/sync/test/syncConfigChangeTest.cpp +++ b/source/libs/sync/test/syncConfigChangeTest.cpp @@ -249,7 +249,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncReplicateTest.cpp b/source/libs/sync/test/syncReplicateTest.cpp index 4a82bba15d..22132eb01f 100644 --- a/source/libs/sync/test/syncReplicateTest.cpp +++ b/source/libs/sync/test/syncReplicateTest.cpp @@ -189,7 +189,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader", s, alreadySend); } else { diff --git a/source/libs/sync/test/syncTestTool.cpp b/source/libs/sync/test/syncTestTool.cpp index 8c486df118..4bc2e92d0c 100644 --- a/source/libs/sync/test/syncTestTool.cpp +++ b/source/libs/sync/test/syncTestTool.cpp @@ -396,7 +396,7 @@ int main(int argc, char** argv) { if (alreadySend < writeRecordNum) { SRpcMsg* pRpcMsg = createRpcMsg(alreadySend, writeRecordNum, myIndex); - int32_t ret = syncPropose(rid, pRpcMsg, false); + int32_t ret = syncPropose(rid, pRpcMsg, false, NULL); if (ret == -1 && terrno == TSDB_CODE_SYN_NOT_LEADER) { sTrace("%s value%d write not leader, leaderTransferWait:%d", simpleStr, alreadySend, leaderTransferWait); } else { diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h index 57aba67b1d..2db4a72795 100644 --- a/source/libs/transport/inc/transportInt.h +++ b/source/libs/transport/inc/transportInt.h @@ -47,10 +47,8 @@ typedef struct { char label[TSDB_LABEL_LEN]; char user[TSDB_UNI_LEN]; // meter ID - int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size - int8_t encryption; // encrypt or not - int32_t retryLimit; // retry limit - int32_t retryInterval; // retry interval ms + int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size + int8_t encryption; // encrypt or not int32_t retryMinInterval; // retry init interval int32_t retryStepFactor; // retry interval factor diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index 0eac12f7c5..55c3c61b05 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -47,9 +47,11 @@ void* rpcOpen(const SRpcInit* pInit) { } pRpc->compressSize = pInit->compressSize; + if (pRpc->compressSize < 0) { + pRpc->compressSize = -1; + } + pRpc->encryption = pInit->encryption; - pRpc->retryLimit = pInit->retryLimit; - pRpc->retryInterval = pInit->retryInterval; pRpc->retryMinInterval = pInit->retryMinInterval; // retry init interval pRpc->retryStepFactor = pInit->retryStepFactor; diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 03e3fb52c4..6ad126162e 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -604,6 +604,7 @@ static int32_t allocConnRef(SCliConn* conn, bool update) { static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) { if (update) { + transReleaseExHandle(transGetRefMgt(), conn->refId); transRemoveExHandle(transGetRefMgt(), conn->refId); conn->refId = -1; } @@ -956,7 +957,6 @@ static void cliHandleRelease(SCliMsg* pMsg, SCliThrd* pThrd) { SCliConn* conn = exh->handle; transReleaseExHandle(transGetRefMgt(), refId); - tDebug("%s conn %p start to release to inst", CONN_GET_INST_LABEL(conn), conn); if (T_REF_VAL_GET(conn) == 2) { @@ -1574,6 +1574,9 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { pCtx->retryStep = 0; pCtx->retryInit = true; pCtx->retryCode = TSDB_CODE_SUCCESS; + + // already retry, not use handle specified by app; + pMsg->msg.info.handle = 0; } if (-1 != pCtx->retryMaxTimeout && taosGetTimestampMs() - pCtx->retryInitTimestamp >= pCtx->retryMaxTimeout) { @@ -1595,7 +1598,7 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { } else if (code == TSDB_CODE_SYN_NOT_LEADER || code == TSDB_CODE_SYN_INTERNAL_ERROR || code == TSDB_CODE_SYN_PROPOSE_NOT_READY || code == TSDB_CODE_VND_STOPPED || code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING || - code == TSDB_CODE_APP_IS_STOPPING) { + code == TSDB_CODE_APP_IS_STOPPING || code == TSDB_CODE_VND_STOPPED) { tTrace("code str %s, contlen:%d 1", tstrerror(code), pResp->contLen); noDelay = cliResetEpset(pCtx, pResp, true); transFreeMsg(pResp->pCont); diff --git a/source/os/src/osEnv.c b/source/os/src/osEnv.c index 7063d1f574..c4627ffb75 100644 --- a/source/os/src/osEnv.c +++ b/source/os/src/osEnv.c @@ -37,7 +37,7 @@ float tsNumOfCores = 0; int64_t tsTotalMemoryKB = 0; char *tsProcPath = NULL; -char tsSIMDEnable = 0; +char tsSIMDBuiltins = 0; char tsSSE42Enable = 0; char tsAVXEnable = 0; char tsAVX2Enable = 0; diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index 8c2170239f..d8cccc83ed 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -464,7 +464,9 @@ int64_t taosWriteFile(TdFilePtr pFile, const void *buf, int64_t count) { #if FILE_WITH_LOCK taosThreadRwlockWrlock(&(pFile->rwlock)); #endif - assert(pFile->fd >= 0); // Please check if you have closed the file. + if (pFile->fd < 0) { + return 0; + } int64_t nleft = count; int64_t nwritten = 0; diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 89b84ad395..e1abe84841 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -354,6 +354,10 @@ int32_t taosGetCpuInfo(char *cpuModel, int32_t maxLen, float *numOfCores) { code = 0; done |= 1; } + int endPos = strlen(cpuModel)-1; + if (cpuModel[endPos] == '\n') { + cpuModel[endPos] = '\0'; + } taosCloseCmd(&pCmd); pCmd = taosOpenCmd("sysctl -n machdep.cpu.core_count"); @@ -485,11 +489,11 @@ int32_t taosGetCpuInstructions(char* sse42, char* avx, char* avx2, char* fma) { #ifdef _TD_X86_ // Since the compiler is not support avx/avx2 instructions, the global variables always need to be // set to be false -#if __AVX__ || __AVX2__ - tsSIMDEnable = true; -#else - tsSIMDEnable = false; -#endif +//#if __AVX__ || __AVX2__ +// tsSIMDBuiltins = true; +//#else +// tsSIMDBuiltins = false; +//#endif uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; diff --git a/source/util/src/terror.c b/source/util/src/terror.c index a47fe1ed02..ba00d68320 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -282,6 +282,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_ALREADY_EXIST, "Stream already exists TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_NOT_EXIST, "Stream not exist") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_OPTION, "Invalid stream option") TAOS_DEFINE_ERROR(TSDB_CODE_MND_STREAM_MUST_BE_DELETED, "Stream must be dropped first") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_MULTI_REPLICA_SOURCE_DB, "Stream temporarily does not support source db having replica > 1") // mnode-sma TAOS_DEFINE_ERROR(TSDB_CODE_MND_SMA_ALREADY_EXIST, "SMA already exists") diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 747187254f..f6f814d82b 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -445,6 +445,9 @@ static inline int32_t taosBuildLogHead(char *buffer, const char *flags) { static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *buffer, int32_t len) { if ((dflag & DEBUG_FILE) && tsLogObj.logHandle && tsLogObj.logHandle->pFile != NULL && osLogSpaceAvailable()) { taosUpdateLogNums(level); +#if 0 + // DEBUG_FATAL and DEBUG_ERROR are duplicated + // fsync will cause thread blocking and may also generate log misalignment in case of asyncLog if (tsAsyncLog && level != DEBUG_FATAL) { taosPushLogBuffer(tsLogObj.logHandle, buffer, len); } else { @@ -453,6 +456,13 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b taosFsyncFile(tsLogObj.logHandle->pFile); } } +#else + if (tsAsyncLog) { + taosPushLogBuffer(tsLogObj.logHandle, buffer, len); + } else { + taosWriteFile(tsLogObj.logHandle->pFile, buffer, len); + } +#endif if (tsLogObj.maxLines > 0) { atomic_add_fetch_32(&tsLogObj.lines, 1); diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py index 163cdd0055..ba296584ba 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/commandline.py @@ -56,7 +56,7 @@ class TDTestCase: def run(self): binPath = self.getPath() - cmd = "%s -F 7 -H 9 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%%^*" %binPath + cmd = "%s -F 7 -n 10 -t 2 -x -y -M -C -d newtest -l 5 -A binary,nchar\(31\) -b tinyint,binary\(23\),bool,nchar -w 29 -E -m $%%^*" %binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.execute("use newtest") diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py index e5a2551e63..d706eea068 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/invalid_commandline.py @@ -53,7 +53,7 @@ class TDTestCase: def run(self): binPath = self.getPath() - cmd = "%s -F abc -P abc -I abc -T abc -H abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y" %binPath + cmd = "%s -F abc -P abc -I abc -T abc -i abc -S abc -B abc -r abc -t abc -n abc -l abc -w abc -w 16385 -R abc -O abc -a abc -n 2 -t 2 -r 1 -y" %binPath tdLog.info("%s" % cmd) os.system("%s" % cmd) tdSql.query("select count(*) from test.meters") diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 154eebb4de..5361ba356f 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,6 +10,7 @@ ,,y,script,./test.sh -f tsim/user/password.sim ,,y,script,./test.sh -f tsim/user/privilege_db.sim ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim +,,y,script,./test.sh -f tsim/user/privilege_topic.sim ,,y,script,./test.sh -f tsim/db/alter_option.sim ,,y,script,./test.sh -f tsim/db/alter_replica_13.sim ,,y,script,./test.sh -f tsim/db/alter_replica_31.sim @@ -173,6 +174,7 @@ ,,y,script,./test.sh -f tsim/query/scalarNull.sim ,,y,script,./test.sh -f tsim/query/session.sim ,,y,script,./test.sh -f tsim/query/udf.sim +,,y,script,./test.sh -f tsim/query/udf_with_const.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim ,,y,script,./test.sh -f tsim/mnode/basic1.sim diff --git a/examples/c/api_with_reqid_test.c b/tests/script/api/api_with_reqid_test.c similarity index 100% rename from examples/c/api_with_reqid_test.c rename to tests/script/api/api_with_reqid_test.c diff --git a/tests/script/api/apitest.c b/tests/script/api/apitest.c new file mode 100644 index 0000000000..7280522021 --- /dev/null +++ b/tests/script/api/apitest.c @@ -0,0 +1,936 @@ +// sample code to verify all TDengine API +// to compile: gcc -o apitest apitest.c -ltaos + +#include "cJSON.h" +#include "taoserror.h" + +#include +#include +#include +#include +#include "../../include/client/taos.h" + +static int64_t count = 10000; + +int64_t genReqid() { + count += 100; + return count; +} + +static void prepare_data(TAOS* taos) { + TAOS_RES* result; + result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test precision 'us';"); + taos_free_result(result); + usleep(100000); + taos_select_db(taos, "test"); + + result = taos_query(taos, "create table meters(ts timestamp, a int) tags(area int);"); + taos_free_result(result); + + result = taos_query(taos, "create table t0 using meters tags(0);"); + taos_free_result(result); + result = taos_query(taos, "create table t1 using meters tags(1);"); + taos_free_result(result); + result = taos_query(taos, "create table t2 using meters tags(2);"); + taos_free_result(result); + result = taos_query(taos, "create table t3 using meters tags(3);"); + taos_free_result(result); + result = taos_query(taos, "create table t4 using meters tags(4);"); + taos_free_result(result); + result = taos_query(taos, "create table t5 using meters tags(5);"); + taos_free_result(result); + result = taos_query(taos, "create table t6 using meters tags(6);"); + taos_free_result(result); + result = taos_query(taos, "create table t7 using meters tags(7);"); + taos_free_result(result); + result = taos_query(taos, "create table t8 using meters tags(8);"); + taos_free_result(result); + result = taos_query(taos, "create table t9 using meters tags(9);"); + taos_free_result(result); + + result = taos_query(taos, + "insert into t0 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:02:00.000', 0)" + " t1 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:02:00.000', 0)" + " ('2020-01-01 00:03:00.000', 0)" + " t2 values('2020-01-01 00:00:00.000', 0)" + " ('2020-01-01 00:01:00.000', 0)" + " ('2020-01-01 00:01:01.000', 0)" + " ('2020-01-01 00:01:02.000', 0)" + " t3 values('2020-01-01 00:01:02.000', 0)" + " t4 values('2020-01-01 00:01:02.000', 0)" + " t5 values('2020-01-01 00:01:02.000', 0)" + " t6 values('2020-01-01 00:01:02.000', 0)" + " t7 values('2020-01-01 00:01:02.000', 0)" + " t8 values('2020-01-01 00:01:02.000', 0)" + " t9 values('2020-01-01 00:01:02.000', 0)"); + int affected = taos_affected_rows(result); + if (affected != 18) { + printf("\033[31m%d rows affected by last insert statement, but it should be 18\033[0m\n", affected); + } + taos_free_result(result); + // super tables subscription + usleep(1000000); +} + +static int print_result(TAOS_RES* res, int blockFetch) { + TAOS_ROW row = NULL; + int num_fields = taos_num_fields(res); + TAOS_FIELD* fields = taos_fetch_fields(res); + int nRows = 0; + + if (blockFetch) { + int rows = 0; + while ((rows = taos_fetch_block(res, &row))) { + // for (int i = 0; i < rows; i++) { + // char temp[256]; + // taos_print_row(temp, row + i, fields, num_fields); + // puts(temp); + // } + nRows += rows; + } + } else { + while ((row = taos_fetch_row(res))) { + char temp[256] = {0}; + taos_print_row(temp, row, fields, num_fields); + puts(temp); + nRows++; + } + } + + printf("%d rows consumed.\n", nRows); + return nRows; +} + +static void check_row_count(int line, TAOS_RES* res, int expected) { + int actual = print_result(res, expected % 2); + if (actual != expected) { + printf("\033[31mline %d: row count mismatch, expected: %d, actual: %d\033[0m\n", line, expected, actual); + } else { + printf("line %d: %d rows consumed as expected\n", line, actual); + } +} + +static void verify_query(TAOS* taos) { + prepare_data(taos); + + int code = taos_load_table_info(taos, "t0,t1,t2,t3,t4,t5,t6,t7,t8,t9"); + if (code != 0) { + printf("\033[31mfailed to load table info: 0x%08x\033[0m\n", code); + } + + code = taos_validate_sql(taos, "select * from nonexisttable"); + if (code == 0) { + printf("\033[31mimpossible, the table does not exists\033[0m\n"); + } + + code = taos_validate_sql(taos, "select * from meters"); + if (code != 0) { + printf("\033[31mimpossible, the table does exists: 0x%08x\033[0m\n", code); + } + + TAOS_RES* res = taos_query_with_reqid(taos, "select * from meters", genReqid()); + check_row_count(__LINE__, res, 18); + printf("result precision is: %d\n", taos_result_precision(res)); + int c = taos_field_count(res); + printf("field count is: %d\n", c); + int* lengths = taos_fetch_lengths(res); + for (int i = 0; i < c; i++) { + printf("length of column %d is %d\n", i, lengths[i]); + } + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from t0", genReqid()); + check_row_count(__LINE__, res, 3); + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from nonexisttable", genReqid()); + code = taos_errno(res); + printf("code=%d, error msg=%s\n", code, taos_errstr(res)); + taos_free_result(res); + + res = taos_query_with_reqid(taos, "select * from meters", genReqid()); + taos_stop_query(res); + taos_free_result(res); +} + +void subscribe_callback(TAOS_SUB* tsub, TAOS_RES* res, void* param, int code) { + int rows = print_result(res, *(int*)param); + printf("%d rows consumed in subscribe_callback\n", rows); +} + +void verify_prepare(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10))"; + result = taos_query_with_reqid(taos, sql, genReqid()); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + // insert 10 records + struct { + int64_t ts; + int8_t b; + int8_t v1; + int16_t v2; + int32_t v4; + int64_t v8; + float f4; + double f8; + char bin[40]; + char blob[80]; + } v = {0}; + + int32_t boolLen = sizeof(int8_t); + int32_t sintLen = sizeof(int16_t); + int32_t intLen = sizeof(int32_t); + int32_t bintLen = sizeof(int64_t); + int32_t floatLen = sizeof(float); + int32_t doubleLen = sizeof(double); + int32_t binLen = sizeof(v.bin); + int32_t ncharLen = 30; + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts); + params[0].buffer = &v.ts; + params[0].length = &bintLen; + params[0].is_null = NULL; + params[0].num = 1; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b); + params[1].buffer = &v.b; + params[1].length = &boolLen; + params[1].is_null = NULL; + params[1].num = 1; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1); + params[2].buffer = &v.v1; + params[2].length = &boolLen; + params[2].is_null = NULL; + params[2].num = 1; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2); + params[3].buffer = &v.v2; + params[3].length = &sintLen; + params[3].is_null = NULL; + params[3].num = 1; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4); + params[4].buffer = &v.v4; + params[4].length = &intLen; + params[4].is_null = NULL; + params[4].num = 1; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8); + params[5].buffer = &v.v8; + params[5].length = &bintLen; + params[5].is_null = NULL; + params[5].num = 1; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4); + params[6].buffer = &v.f4; + params[6].length = &floatLen; + params[6].is_null = NULL; + params[6].num = 1; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8); + params[7].buffer = &v.f8; + params[7].length = &doubleLen; + params[7].is_null = NULL; + params[7].num = 1; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin); + params[8].buffer = v.bin; + params[8].length = &binLen; + params[8].is_null = NULL; + params[8].num = 1; + + strcpy(v.blob, "一二三四五六七八九十"); + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob); + params[9].buffer = v.blob; + params[9].length = &ncharLen; + params[9].is_null = NULL; + params[9].num = 1; + + char is_null = 1; + + sql = "insert into m1 values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + v.ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts += 1; + for (int j = 1; j < 10; ++j) { + params[j].is_null = ((i == j) ? &is_null : 0); + } + v.b = (int8_t)i % 2; + v.v1 = (int8_t)i; + v.v2 = (int16_t)(i * 2); + v.v4 = (int32_t)(i * 4); + v.v8 = (int64_t)(i * 8); + v.f4 = (float)(i * 40); + v.f8 = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin); ++j) { + v.bin[j] = (char)(i + '0'); + } + + taos_stmt_bind_param(stmt, params); + taos_stmt_add_batch(stmt); + } + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + v.v1 = 5; + v.v2 = 15; + taos_stmt_bind_param(stmt, params + 2); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); +} + +void verify_prepare2(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create table m1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10))"; + result = taos_query(taos, sql); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + // insert 10 records + struct { + int64_t ts[10]; + int8_t b[10]; + int8_t v1[10]; + int16_t v2[10]; + int32_t v4[10]; + int64_t v8[10]; + float f4[10]; + double f8[10]; + char bin[10][40]; + char blob[10][80]; + } v; + + int32_t* t8_len = malloc(sizeof(int32_t) * 10); + int32_t* t16_len = malloc(sizeof(int32_t) * 10); + int32_t* t32_len = malloc(sizeof(int32_t) * 10); + int32_t* t64_len = malloc(sizeof(int32_t) * 10); + int32_t* float_len = malloc(sizeof(int32_t) * 10); + int32_t* double_len = malloc(sizeof(int32_t) * 10); + int32_t* bin_len = malloc(sizeof(int32_t) * 10); + int32_t* blob_len = malloc(sizeof(int32_t) * 10); + + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + char is_null[10] = {0}; + + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts[0]); + params[0].buffer = v.ts; + params[0].length = t64_len; + params[0].is_null = is_null; + params[0].num = 10; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b[0]); + params[1].buffer = v.b; + params[1].length = t8_len; + params[1].is_null = is_null; + params[1].num = 10; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1[0]); + params[2].buffer = v.v1; + params[2].length = t8_len; + params[2].is_null = is_null; + params[2].num = 10; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2[0]); + params[3].buffer = v.v2; + params[3].length = t16_len; + params[3].is_null = is_null; + params[3].num = 10; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4[0]); + params[4].buffer = v.v4; + params[4].length = t32_len; + params[4].is_null = is_null; + params[4].num = 10; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8[0]); + params[5].buffer = v.v8; + params[5].length = t64_len; + params[5].is_null = is_null; + params[5].num = 10; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4[0]); + params[6].buffer = v.f4; + params[6].length = float_len; + params[6].is_null = is_null; + params[6].num = 10; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8[0]); + params[7].buffer = v.f8; + params[7].length = double_len; + params[7].is_null = is_null; + params[7].num = 10; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin[0]); + params[8].buffer = v.bin; + params[8].length = bin_len; + params[8].is_null = is_null; + params[8].num = 10; + + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob[0]); + params[9].buffer = v.blob; + params[9].length = blob_len; + params[9].is_null = is_null; + params[9].num = 10; + + sql = "insert into ? (ts, b, v1, v2, v4, v8, f4, f8, bin, blob) values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + code = taos_stmt_set_tbname(stmt, "m1"); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + int64_t ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts[i] = ts++; + is_null[i] = 0; + + v.b[i] = (int8_t)i % 2; + v.v1[i] = (int8_t)i; + v.v2[i] = (int16_t)(i * 2); + v.v4[i] = (int32_t)(i * 4); + v.v8[i] = (int64_t)(i * 8); + v.f4[i] = (float)(i * 40); + v.f8[i] = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin[0]); ++j) { + v.bin[i][j] = (char)(i + '0'); + } + strcpy(v.blob[i], "一二三四五六七八九十"); + + t8_len[i] = sizeof(int8_t); + t16_len[i] = sizeof(int16_t); + t32_len[i] = sizeof(int32_t); + t64_len[i] = sizeof(int64_t); + float_len[i] = sizeof(float); + double_len[i] = sizeof(double); + bin_len[i] = sizeof(v.bin[0]); + blob_len[i] = (int32_t)strlen(v.blob[i]); + } + + taos_stmt_bind_param_batch(stmt, params); + taos_stmt_add_batch(stmt); + + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + TAOS_MULTI_BIND qparams[2]; + + int8_t v1 = 5; + int16_t v2 = 15; + int32_t tinyLen = sizeof(v1); + int32_t smallLen = sizeof(v2); + + qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; + qparams[0].buffer_length = sizeof(v1); + qparams[0].buffer = &v1; + qparams[0].length = &tinyLen; + qparams[0].is_null = NULL; + qparams[0].num = 1; + + qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; + qparams[1].buffer_length = sizeof(v2); + qparams[1].buffer = &v2; + qparams[1].length = &smallLen; + qparams[1].is_null = NULL; + qparams[1].num = 1; + + taos_stmt_bind_param(stmt, qparams); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); + + free(t8_len); + free(t16_len); + free(t32_len); + free(t64_len); + free(float_len); + free(double_len); + free(bin_len); + free(blob_len); +} + +void verify_prepare3(TAOS* taos) { + TAOS_RES* result = taos_query(taos, "drop database if exists test;"); + taos_free_result(result); + usleep(100000); + result = taos_query(taos, "create database test;"); + + int code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create database, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + usleep(100000); + taos_select_db(taos, "test"); + + // create table + const char* sql = + "create stable st1 (ts timestamp, b bool, v1 tinyint, v2 smallint, v4 int, v8 bigint, f4 float, f8 double, bin " + "binary(40), blob nchar(10)) tags (id1 int, id2 binary(40))"; + result = taos_query(taos, sql); + code = taos_errno(result); + if (code != 0) { + printf("\033[31mfailed to create table, reason:%s\033[0m\n", taos_errstr(result)); + taos_free_result(result); + return; + } + taos_free_result(result); + + TAOS_MULTI_BIND tags[2]; + + int32_t id1 = 1; + char id2[40] = "abcdefghijklmnopqrstuvwxyz0123456789"; + int32_t id2_len = (int32_t)strlen(id2); + + tags[0].buffer_type = TSDB_DATA_TYPE_INT; + tags[0].buffer_length = sizeof(int); + tags[0].buffer = &id1; + tags[0].length = NULL; + tags[0].is_null = NULL; + tags[0].num = 1; + + tags[1].buffer_type = TSDB_DATA_TYPE_BINARY; + tags[1].buffer_length = sizeof(id2); + tags[1].buffer = id2; + tags[1].length = &id2_len; + tags[1].is_null = NULL; + tags[1].num = 1; + + // insert 10 records + struct { + int64_t ts[10]; + int8_t b[10]; + int8_t v1[10]; + int16_t v2[10]; + int32_t v4[10]; + int64_t v8[10]; + float f4[10]; + double f8[10]; + char bin[10][40]; + char blob[10][80]; + } v; + + int32_t* t8_len = malloc(sizeof(int32_t) * 10); + int32_t* t16_len = malloc(sizeof(int32_t) * 10); + int32_t* t32_len = malloc(sizeof(int32_t) * 10); + int32_t* t64_len = malloc(sizeof(int32_t) * 10); + int32_t* float_len = malloc(sizeof(int32_t) * 10); + int32_t* double_len = malloc(sizeof(int32_t) * 10); + int32_t* bin_len = malloc(sizeof(int32_t) * 10); + int32_t* blob_len = malloc(sizeof(int32_t) * 10); + + TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_MULTI_BIND params[10]; + char is_null[10] = {0}; + + params[0].buffer_type = TSDB_DATA_TYPE_TIMESTAMP; + params[0].buffer_length = sizeof(v.ts[0]); + params[0].buffer = v.ts; + params[0].length = t64_len; + params[0].is_null = is_null; + params[0].num = 10; + + params[1].buffer_type = TSDB_DATA_TYPE_BOOL; + params[1].buffer_length = sizeof(v.b[0]); + params[1].buffer = v.b; + params[1].length = t8_len; + params[1].is_null = is_null; + params[1].num = 10; + + params[2].buffer_type = TSDB_DATA_TYPE_TINYINT; + params[2].buffer_length = sizeof(v.v1[0]); + params[2].buffer = v.v1; + params[2].length = t8_len; + params[2].is_null = is_null; + params[2].num = 10; + + params[3].buffer_type = TSDB_DATA_TYPE_SMALLINT; + params[3].buffer_length = sizeof(v.v2[0]); + params[3].buffer = v.v2; + params[3].length = t16_len; + params[3].is_null = is_null; + params[3].num = 10; + + params[4].buffer_type = TSDB_DATA_TYPE_INT; + params[4].buffer_length = sizeof(v.v4[0]); + params[4].buffer = v.v4; + params[4].length = t32_len; + params[4].is_null = is_null; + params[4].num = 10; + + params[5].buffer_type = TSDB_DATA_TYPE_BIGINT; + params[5].buffer_length = sizeof(v.v8[0]); + params[5].buffer = v.v8; + params[5].length = t64_len; + params[5].is_null = is_null; + params[5].num = 10; + + params[6].buffer_type = TSDB_DATA_TYPE_FLOAT; + params[6].buffer_length = sizeof(v.f4[0]); + params[6].buffer = v.f4; + params[6].length = float_len; + params[6].is_null = is_null; + params[6].num = 10; + + params[7].buffer_type = TSDB_DATA_TYPE_DOUBLE; + params[7].buffer_length = sizeof(v.f8[0]); + params[7].buffer = v.f8; + params[7].length = double_len; + params[7].is_null = is_null; + params[7].num = 10; + + params[8].buffer_type = TSDB_DATA_TYPE_BINARY; + params[8].buffer_length = sizeof(v.bin[0]); + params[8].buffer = v.bin; + params[8].length = bin_len; + params[8].is_null = is_null; + params[8].num = 10; + + params[9].buffer_type = TSDB_DATA_TYPE_NCHAR; + params[9].buffer_length = sizeof(v.blob[0]); + params[9].buffer = v.blob; + params[9].length = blob_len; + params[9].is_null = is_null; + params[9].num = 10; + + sql = "insert into ? using st1 tags(?,?) values(?,?,?,?,?,?,?,?,?,?)"; + code = taos_stmt_prepare(stmt, sql, 0); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + code = taos_stmt_set_tbname_tags(stmt, "m1", tags); + if (code != 0) { + printf("\033[31mfailed to execute taos_stmt_prepare. error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + int64_t ts = 1591060628000; + for (int i = 0; i < 10; ++i) { + v.ts[i] = ts++; + is_null[i] = 0; + + v.b[i] = (int8_t)i % 2; + v.v1[i] = (int8_t)i; + v.v2[i] = (int16_t)(i * 2); + v.v4[i] = (int32_t)(i * 4); + v.v8[i] = (int64_t)(i * 8); + v.f4[i] = (float)(i * 40); + v.f8[i] = (double)(i * 80); + for (int j = 0; j < sizeof(v.bin[0]); ++j) { + v.bin[i][j] = (char)(i + '0'); + } + strcpy(v.blob[i], "一二三四五六七八九十"); + + t8_len[i] = sizeof(int8_t); + t16_len[i] = sizeof(int16_t); + t32_len[i] = sizeof(int32_t); + t64_len[i] = sizeof(int64_t); + float_len[i] = sizeof(float); + double_len[i] = sizeof(double); + bin_len[i] = sizeof(v.bin[0]); + blob_len[i] = (int32_t)strlen(v.blob[i]); + } + + taos_stmt_bind_param_batch(stmt, params); + taos_stmt_add_batch(stmt); + + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute insert statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + taos_stmt_close(stmt); + + // query the records + stmt = taos_stmt_init(taos); + taos_stmt_prepare(stmt, "SELECT * FROM m1 WHERE v1 > ? AND v2 < ?", 0); + + TAOS_MULTI_BIND qparams[2]; + + int8_t v1 = 5; + int16_t v2 = 15; + int32_t tinyLen = sizeof(v1); + int32_t smallLen = sizeof(v2); + + qparams[0].buffer_type = TSDB_DATA_TYPE_TINYINT; + qparams[0].buffer_length = sizeof(v1); + qparams[0].buffer = &v1; + qparams[0].length = &tinyLen; + qparams[0].is_null = NULL; + qparams[0].num = 1; + + qparams[1].buffer_type = TSDB_DATA_TYPE_SMALLINT; + qparams[1].buffer_length = sizeof(v2); + qparams[1].buffer = &v2; + qparams[1].length = &smallLen; + qparams[1].is_null = NULL; + qparams[1].num = 1; + + taos_stmt_bind_param(stmt, qparams); + if (taos_stmt_execute(stmt) != 0) { + printf("\033[31mfailed to execute select statement.error:%s\033[0m\n", taos_stmt_errstr(stmt)); + taos_stmt_close(stmt); + return; + } + + result = taos_stmt_use_result(stmt); + + TAOS_ROW row; + int rows = 0; + int num_fields = taos_num_fields(result); + TAOS_FIELD* fields = taos_fetch_fields(result); + + // fetch the records row by row + while ((row = taos_fetch_row(result))) { + char temp[256] = {0}; + rows++; + taos_print_row(temp, row, fields, num_fields); + printf("%s\n", temp); + } + + taos_free_result(result); + taos_stmt_close(stmt); + + free(t8_len); + free(t16_len); + free(t32_len); + free(t64_len); + free(float_len); + free(double_len); + free(bin_len); + free(blob_len); +} + +void retrieve_callback(void* param, TAOS_RES* tres, int numOfRows) { + if (numOfRows > 0) { + printf("%d rows async retrieved\n", numOfRows); + taos_fetch_rows_a(tres, retrieve_callback, param); + } else { + if (numOfRows < 0) { + printf("\033[31masync retrieve failed, code: %d\033[0m\n", numOfRows); + } else { + printf("async retrieve completed\n"); + } + taos_free_result(tres); + } +} + +void select_callback(void* param, TAOS_RES* tres, int code) { + if (code == 0 && tres) { + taos_fetch_rows_a(tres, retrieve_callback, param); + } else { + printf("\033[31masync select failed, code: %d\033[0m\n", code); + } +} + +void verify_async(TAOS* taos) { + prepare_data(taos); + taos_query_a(taos, "select * from meters", select_callback, NULL); + usleep(1000000); +} + +void stream_callback(void* param, TAOS_RES* res, TAOS_ROW row) { + if (res == NULL || row == NULL) { + return; + } + + int num_fields = taos_num_fields(res); + TAOS_FIELD* fields = taos_fetch_fields(res); + + printf("got one row from stream_callback\n"); + char temp[256] = {0}; + taos_print_row(temp, row, fields, num_fields); + puts(temp); +} + +int main(int argc, char* argv[]) { + const char* host = "127.0.0.1"; + const char* user = "root"; + const char* passwd = "taosdata"; + + taos_options(TSDB_OPTION_TIMEZONE, "GMT-8"); + TAOS* taos = taos_connect(host, user, passwd, "", 0); + if (taos == NULL) { + printf("\033[31mfailed to connect to db, reason:%s\033[0m\n", taos_errstr(taos)); + exit(1); + } + + const char* info = taos_get_server_info(taos); + printf("server info: %s\n", info); + info = taos_get_client_info(taos); + printf("client info: %s\n", info); + + printf("************ verify query *************\n"); + verify_query(taos); + + printf("********* verify async query **********\n"); + verify_async(taos); + + printf("************ verify prepare *************\n"); + verify_prepare(taos); + + printf("************ verify prepare2 *************\n"); + verify_prepare2(taos); + printf("************ verify prepare3 *************\n"); + verify_prepare3(taos); + + printf("done\n"); + taos_close(taos); + taos_cleanup(); +} diff --git a/examples/c/demoapi.c b/tests/script/api/demoapi.c similarity index 99% rename from examples/c/demoapi.c rename to tests/script/api/demoapi.c index 18f1b5a059..6c060a6325 100644 --- a/examples/c/demoapi.c +++ b/tests/script/api/demoapi.c @@ -21,7 +21,6 @@ #ifndef WINDOWS #include #endif -#include "osSleep.h" #include "taos.h" #define debugPrint(fmt, ...) \ @@ -81,11 +80,9 @@ static void prepare_data(TAOS* taos) { TAOS_RES *res; res = taos_query(taos, "drop database if exists test;"); taos_free_result(res); - taosMsleep(100); res = taos_query(taos, "create database test;"); taos_free_result(res); - taosMsleep(100); if (taos_select_db(taos, "test")) { errorPrint("%s() LN%d: taos_select_db() failed\n", __func__, __LINE__); diff --git a/tests/script/coverage_test.sh b/tests/script/coverage_test.sh index 3983f533da..b395047a1c 100755 --- a/tests/script/coverage_test.sh +++ b/tests/script/coverage_test.sh @@ -122,6 +122,9 @@ function runSimCases() { function runPythonCases() { echo "=== Run python cases ===" + + cd $TDENGINE_DIR/tests/parallel_test + sed -i '/compatibility.py/d' cases.task cd $TDENGINE_DIR/tests/system-test runCasesOneByOne ../parallel_test/cases.task system-test diff --git a/tests/script/sh/compile_udf.sh b/tests/script/sh/compile_udf.sh index c7148d7d7d..5265e5a99b 100755 --- a/tests/script/sh/compile_udf.sh +++ b/tests/script/sh/compile_udf.sh @@ -1,10 +1,11 @@ set +e -rm -rf /tmp/udf/libbitand.so /tmp/udf/libsqrsum.so +rm -rf /tmp/udf/libbitand.so /tmp/udf/libsqrsum.so /tmp/udf/libgpd.so mkdir -p /tmp/udf echo "compile udf bit_and and sqr_sum" gcc -fPIC -shared sh/bit_and.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libbitand.so gcc -fPIC -shared sh/l2norm.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libl2norm.so +gcc -fPIC -shared sh/gpd.c -I../../include/libs/function/ -I../../include/client -I../../include/util -o /tmp/udf/libgpd.so echo "debug show /tmp/udf/*.so" ls /tmp/udf/*.so diff --git a/tests/script/sh/gpd.c b/tests/script/sh/gpd.c index 8d69bacb5e..2259efa64a 100644 --- a/tests/script/sh/gpd.c +++ b/tests/script/sh/gpd.c @@ -12,13 +12,10 @@ TAOS* taos = NULL; DLL_EXPORT int32_t gpd_init() { - taos = taos_connect("localhost", "root", "taosdata", "", 7100); return 0; } DLL_EXPORT int32_t gpd_destroy() { - taos_close(taos); - taos_cleanup(); return 0; } @@ -32,43 +29,18 @@ DLL_EXPORT int32_t gpd(SUdfDataBlock* block, SUdfColumn *resultCol) { SUdfColumnData *resultData = &resultCol->colData; resultData->numOfRows = block->numOfRows; for (int32_t i = 0; i < resultData->numOfRows; ++i) { - int j = 0; - for (; j < block->numOfCols; ++j) { - if (udfColDataIsNull(block->udfCols[j], i)) { - udfColDataSetNull(resultCol, i); - break; - } - } - if ( j == block->numOfCols) { - int32_t luckyNum = 88; - udfColDataSet(resultCol, i, (char *)&luckyNum, false); - } + int64_t* calc_ts = (int64_t*)udfColDataGetData(block->udfCols[0], i); + char* varTbname = udfColDataGetData(block->udfCols[1], i); + char* varDbname = udfColDataGetData(block->udfCols[2], i); + + char dbName[256] = {0}; + char tblName[256] = {0}; + memcpy(dbName, varDataVal(varDbname), varDataLen(varDbname)); + memcpy(tblName, varDataVal(varTbname), varDataLen(varTbname)); + printf("%s, %s\n", dbName, tblName); + int32_t result = 0; + udfColDataSet(resultCol, i, (char*)&result, false); } - TAOS_RES* res = taos_query(taos, "create database if not exists gpd"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - res = taos_query(taos, "create table gpd.st (ts timestamp, f int) tags(t int)"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - taos_query(taos, "insert into gpd.t using gpd.st tags(1) values(now, 1) "); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - - taos_query(taos, "select * from gpd.t"); - if (taos_errno(res) != 0) { - char* errstr = taos_errstr(res); - } - - //to simulate actual processing delay by udf -#ifdef LINUX - usleep(1 * 1000); // usleep takes sleep time in us (1 millionth of a second) -#endif -#ifdef WINDOWS - Sleep(1); -#endif return 0; } diff --git a/tests/script/tsim/db/alter_option.sim b/tests/script/tsim/db/alter_option.sim index 63018aea8c..f4392fbca4 100644 --- a/tests/script/tsim/db/alter_option.sim +++ b/tests/script/tsim/db/alter_option.sim @@ -69,7 +69,7 @@ endi if $data4_db != 3 then # replica return -1 endi -if $data5_db != off then # strict +if $data5_db != on then # strict return -1 endi if $data6_db != 345600m then # duration diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index 7012fbac6c..382cc986e2 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -89,7 +89,7 @@ if $data4_db != 1 then # replica print expect 1, actual: $data4_db return -1 endi -if $data5_db != off then # strict +if $data5_db != on then # strict return -1 endi if $data6_db != 14400m then # duration diff --git a/tests/script/tsim/query/udf_with_const.sim b/tests/script/tsim/query/udf_with_const.sim new file mode 100644 index 0000000000..7a2a3389bd --- /dev/null +++ b/tests/script/tsim/query/udf_with_const.sim @@ -0,0 +1,45 @@ +system_content printf %OS% +if $system_content == Windows_NT then + return 0; +endi + +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c udf -v 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ======== step1 udf +system sh/compile_udf.sh +sql create database udf vgroups 3; +sql use udf; + +sql create table t (ts timestamp, f int); +sql insert into t values(now, 1)(now+1s, 2)(now+2s,3)(now+3s,4)(now+4s,5)(now+5s,6)(now+6s,7); + +system_content printf %OS% +if $system_content == Windows_NT then + return 0; +endi + +if $system_content == Windows_NT then + sql create function gpd as 'C:\\Windows\\Temp\\gpd.dll' outputtype int bufSize 8; +else + sql create function gpd as '/tmp/udf/libgpd.so' outputtype int bufSize 8; +endi +sql show functions; +if $rows != 1 then + return -1 +endi + +sql select gpd(ts, tbname, 'detail') from t; +if $rows != 7 then + return -1 +endi +print $data00 $data10 +if $data00 != @0@ then + return -1 +endi +sql drop function gpd; + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim index bb2ea42383..7bf10df637 100644 --- a/tests/script/tsim/stream/basic1.sim +++ b/tests/script/tsim/stream/basic1.sim @@ -792,4 +792,46 @@ if $rows != 1 then goto loop17 endi +#for TS-2242 +sql create database test5 vgroups 1; +sql use test5; +sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int); +sql create table ts1 using st tags(1,1,1); +sql create stream streams5 trigger at_once into streamt5 as select count(*), _wstart, _wend, max(a) from ts1 interval(10s) ; +sql create stream streams6 trigger at_once into streamt6 as select count(*), _wstart, _wend, max(a), _wstart as ts from ts1 interval(10s) ; + +sql_error create stream streams7 trigger at_once into streamt7 as select _wstart, count(*), _wstart, _wend, max(a) from ts1 interval(10s) ; +sql_error create stream streams8 trigger at_once into streamt8 as select count(*), _wstart, _wstart, _wend, max(a) from ts1 interval(10s) ; +sql_error create stream streams9 trigger at_once into streamt9 as select _wstart as ts, count(*), _wstart as ts, _wend, max(a) from ts1 interval(10s) ; + +sql insert into ts1 values(1648791211000,1,2,3); + +print ====== test _wstart + +$loop_count = 0 + +loop17: + +sleep 200 +sql select * from streamt5; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + +sql select * from streamt6; + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi + +print ====== test _wstart end + system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/stream/drop_stream.sim b/tests/script/tsim/stream/drop_stream.sim index 817780ca59..1a474bd9ae 100644 --- a/tests/script/tsim/stream/drop_stream.sim +++ b/tests/script/tsim/stream/drop_stream.sim @@ -219,7 +219,7 @@ sql drop database test; print ========== interval\session\state window -sql CREATE DATABASE test1 BUFFER 96 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 STRICT 'off' WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0; +sql CREATE DATABASE test1 BUFFER 96 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0; sql use test1; sql CREATE STABLE st (time TIMESTAMP, ca DOUBLE, cb DOUBLE, cc int) TAGS (ta VARCHAR(10) ); diff --git a/tests/script/tsim/stream/state0.sim b/tests/script/tsim/stream/state0.sim index 7c922658c9..ea7528b1cb 100644 --- a/tests/script/tsim/stream/state0.sim +++ b/tests/script/tsim/stream/state0.sim @@ -552,7 +552,7 @@ sql use test4; sql create table st (ts timestamp, c1 tinyint, c2 smallint) tags (t1 tinyint) ; sql create table t1 using st tags (-81) ; sql create table t2 using st tags (-81) ; -sql create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS start, min(c1),count(c1) from t1 state_window(c1); +sql create stream if not exists streams4 trigger window_close into streamt4 as select _wstart AS startts, min(c1),count(c1) from t1 state_window(c1); sql insert into t1 (ts, c1) values (1668073288209, 11); sql insert into t1 (ts, c1) values (1668073288210, 11); @@ -567,7 +567,7 @@ loop7: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -606,7 +606,7 @@ loop8: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -640,7 +640,7 @@ loop8: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then @@ -679,7 +679,7 @@ loop9: sleep 200 -sql select * from streamt4 order by start; +sql select * from streamt4 order by startts; $loop_count = $loop_count + 1 if $loop_count == 20 then diff --git a/tests/script/tsim/user/privilege_topic.sim b/tests/script/tsim/user/privilege_topic.sim new file mode 100644 index 0000000000..9ce5bebec3 --- /dev/null +++ b/tests/script/tsim/user/privilege_topic.sim @@ -0,0 +1,156 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print =============== create db +sql create database root_d1 vgroups 1; +sql create database root_d2 vgroups 1; +sql create database root_d3 vgroups 1; + +sql show user privileges +if $rows != 1 then + return -1 +endi +if $data(root)[1] != all then + return -1 +endi +if $data(root)[2] != all then + return -1 +endi + +print =============== create users +sql create user user1 PASS 'taosdata' +sql create user user2 PASS 'taosdata' +sql create user user3 PASS 'taosdata' +sql create user user4 PASS 'taosdata' +sql create user user5 PASS 'taosdata' +sql create user user6 PASS 'taosdata' +sql alter user user1 sysinfo 0 + +sql select * from information_schema.ins_users +if $rows != 7 then + return -1 +endi + +sql GRANT read ON root_d1.* to user1; +sql GRANT write ON root_d2.* to user2; +sql GRANT read ON root_d3.* to user3; +sql GRANT write ON root_d3.* to user3; + +sql show user privileges +if $rows != 5 then + return -1 +endi +if $data(user1)[1] != read then + return -1 +endi +if $data(user1)[2] != root_d1 then + return -1 +endi +if $data(user2)[1] != write then + return -1 +endi +if $data(user2)[2] != root_d2 then + return -1 +endi + +print =============== create topis +sql use root_d1 +sql create table root_d1_stb (ts timestamp, i int) tags (j int) +sql create topic root_d1_topic1 as select ts, i from root_d1_stb +sql create topic root_d1_topic2 as select ts, i from root_d1_stb +sql create topic root_d1_topic3 as select ts, i from root_d1_stb +sql create topic root_d1_topic4 as select ts, i from root_d1_stb + +sql show user privileges +if $rows != 5 then + return -1 +endi + +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi +if $data(user6)[1] != subscribe then + return -1 +endi +if $data(user6)[2] != root_d1_topic3 then + return -1 +endi + +sql REVOKE subscribe ON root_d1_topic3 from user6 +sql show user privileges +if $rows != 7 then + return -1 +endi +if $data(user4)[1] != subscribe then + return -1 +endi +if $data(user4)[2] != root_d1_topic1 then + return -1 +endi +if $data(user5)[1] != subscribe then + return -1 +endi +if $data(user5)[2] != root_d1_topic2 then + return -1 +endi + +print =============== repeat revoke/grant or invalid revoke/grant +sql GRANT subscribe ON root_d1_topic1 to user4 +sql GRANT subscribe ON root_d1_topic2 to user4 +sql GRANT subscribe ON root_d1_topic3 to user4 +sql GRANT subscribe ON root_d1_topic1 to user5 +sql GRANT subscribe ON root_d1_topic2 to user5 +sql GRANT subscribe ON root_d1_topic3 to user5 +sql GRANT subscribe ON root_d1_topic1 to user6 +sql GRANT subscribe ON root_d1_topic2 to user6 +sql GRANT subscribe ON root_d1_topic3 to user6 +sql REVOKE subscribe ON root_d1_topic1 from user4 +sql REVOKE subscribe ON root_d1_topic2 from user4 +sql REVOKE subscribe ON root_d1_topic3 from user4 +sql REVOKE subscribe ON root_d1_topic1 from user5 +sql REVOKE subscribe ON root_d1_topic2 from user5 +sql REVOKE subscribe ON root_d1_topic3 from user5 +sql REVOKE subscribe ON root_d1_topic1 from user6 +sql REVOKE subscribe ON root_d1_topic2 from user6 +sql REVOKE subscribe ON root_d1_topic3 from user6 + +print =============== invalid revoke/grant +sql_error GRANT subscribe ON root_d1_topicx from user5 +sql_error REVOKE subscribe ON root_d1_topicx from user5 + +print =============== check +sql GRANT subscribe ON root_d1_topic1 TO user4 +sql GRANT subscribe ON root_d1_topic2 TO user5 +sql GRANT subscribe ON root_d1_topic3 TO user6 +sql show user privileges +if $rows != 8 then + return -1 +endi + +print =============== re connect +print user u1 login +sql close +sql connect user1 + +sql_error show user privileges + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/system-test/0-others/taosdShell.py b/tests/system-test/0-others/taosdShell.py index 7ad7e4d0ef..2125b5eebe 100644 --- a/tests/system-test/0-others/taosdShell.py +++ b/tests/system-test/0-others/taosdShell.py @@ -136,7 +136,7 @@ class TDTestCase: tdSql.query("use source_db") tdSql.query("create table if not exists source_db.stb (ts timestamp, k int) tags (a int);") tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);") - tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS start, min(k), max(k), sum(k) from source_db.stb interval(10m);") + tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS startts, min(k), max(k), sum(k) from source_db.stb interval(10m);") #TD-19944 -Q=3 diff --git a/tests/system-test/1-insert/database_pre_suf.py b/tests/system-test/1-insert/database_pre_suf.py index 862edbdde9..488dfebff5 100755 --- a/tests/system-test/1-insert/database_pre_suf.py +++ b/tests/system-test/1-insert/database_pre_suf.py @@ -108,7 +108,7 @@ class TDTestCase: # create stream - tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''') + tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''') # insert data for i in range(num_random*n): @@ -187,20 +187,20 @@ class TDTestCase: sleep(5) # stream data check - tdSql.query("select start,wend,max_int from stream_max_stable_1 ;") + tdSql.query("select startts,wend,max_int from stream_max_stable_1 ;") tdSql.checkRows(20) tdSql.query("select sum(max_int) from stream_max_stable_1 ;") stream_data_1 = tdSql.queryResult[0][0] tdSql.query("select sum(min_int) from stream_max_stable_1 ;") stream_data_2 = tdSql.queryResult[0][0] - tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));") + tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));") sql_data_1 = tdSql.queryResult[0][0] sql_data_2 = tdSql.queryResult[0][1] self.stream_value_check(stream_data_1,sql_data_1) self.stream_value_check(stream_data_2,sql_data_2) - tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));") + tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));") sql_data_1 = tdSql.queryResult[0][0] sql_data_2 = tdSql.queryResult[0][1] diff --git a/tests/system-test/1-insert/drop.py b/tests/system-test/1-insert/drop.py index f8796bcf6a..c15a9bbc35 100644 --- a/tests/system-test/1-insert/drop.py +++ b/tests/system-test/1-insert/drop.py @@ -132,7 +132,7 @@ class TDTestCase: tdSql.execute(f'drop database {self.dbname}') def drop_stream_check(self): - tdSql.execute(f'create database {self.dbname} replica {self.replicaVar}') + tdSql.execute(f'create database {self.dbname} replica 1') tdSql.execute(f'use {self.dbname}') stbname = tdCom.getLongName(5,"letters") stream_name = tdCom.getLongName(5,"letters") @@ -158,4 +158,4 @@ class TDTestCase: tdLog.success("%s successfully executed" % __file__) tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode1mnode.py b/tests/system-test/6-cluster/5dnode1mnode.py index b576b37a4d..d0157ec7c7 100644 --- a/tests/system-test/6-cluster/5dnode1mnode.py +++ b/tests/system-test/6-cluster/5dnode1mnode.py @@ -125,7 +125,7 @@ class TDTestCase: tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') tdSql.query('select * from information_schema.ins_databases;') - tdSql.checkData(2,5,'off') + tdSql.checkData(2,5,'on') tdSql.error("alter database db strict 'off'") # tdSql.execute('alter database db strict 'on'') # tdSql.query('select * from information_schema.ins_databases;') diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c index add3ccc51f..bbb127b128 100644 --- a/tools/shell/src/shellWebsocket.c +++ b/tools/shell/src/shellWebsocket.c @@ -37,7 +37,9 @@ static int horizontalPrintWebsocket(WS_RES* wres, double* execute_time) { const void* data = NULL; int rows; ws_fetch_block(wres, &data, &rows); - *execute_time += (double)(ws_take_timing(wres)/1E6); + if (wres) { + *execute_time += (double)(ws_take_timing(wres)/1E6); + } if (!rows) { return 0; } @@ -77,7 +79,9 @@ static int verticalPrintWebsocket(WS_RES* wres, double* pexecute_time) { int rows = 0; const void* data = NULL; ws_fetch_block(wres, &data, &rows); - *pexecute_time += (double)(ws_take_timing(wres)/1E6); + if (wres) { + *pexecute_time += (double)(ws_take_timing(wres)/1E6); + } if (!rows) { return 0; } @@ -129,7 +133,9 @@ static int dumpWebsocketToFile(const char* fname, WS_RES* wres, double* pexecute int rows = 0; const void* data = NULL; ws_fetch_block(wres, &data, &rows); - *pexecute_time += (double)(ws_take_timing(wres)/1E6); + if (wres) { + *pexecute_time += (double)(ws_take_timing(wres)/1E6); + } if (!rows) { taosCloseFile(&pFile); return 0; @@ -223,17 +229,23 @@ void shellRunSingleCommandWebsocketImp(char *command) { if (code == TSDB_CODE_WS_SEND_TIMEOUT || code == TSDB_CODE_WS_RECV_TIMEOUT) { fprintf(stderr, "Hint: use -t to increase the timeout in seconds\n"); } else if (code == TSDB_CODE_WS_INTERNAL_ERRO || code == TSDB_CODE_WS_CLOSED) { - fprintf(stderr, "TDengine server is disconnected, will try to reconnect\n"); shell.ws_conn = NULL; } ws_free_result(res); - if (reconnectNum == 0) continue; + if (reconnectNum == 0) { + continue; + } else { + fprintf(stderr, "TDengine server is disconnected, will try to reconnect\n"); + } return; } break; } - double execute_time = ws_take_timing(res)/1E6; + double execute_time = 0; + if (res) { + execute_time = ws_take_timing(res)/1E6; + } if (shellRegexMatch(command, "^\\s*use\\s+[a-zA-Z0-9_]+\\s*;\\s*$", REG_EXTENDED | REG_ICASE)) { fprintf(stdout, "Database changed.\r\n\r\n");