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/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/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 6ec3d5db10..f74795a250 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 bb1addf1b6..ad6077db09 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 a09c87eea8..7533cfbb02 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -94,244 +94,244 @@ #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_EVENT_WINDOW 252 -#define TK_START 253 -#define TK_SLIDING 254 -#define TK_FILL 255 -#define TK_VALUE 256 -#define TK_NONE 257 -#define TK_PREV 258 -#define TK_LINEAR 259 -#define TK_NEXT 260 -#define TK_HAVING 261 -#define TK_RANGE 262 -#define TK_EVERY 263 -#define TK_ORDER 264 -#define TK_SLIMIT 265 -#define TK_SOFFSET 266 -#define TK_LIMIT 267 -#define TK_OFFSET 268 -#define TK_ASC 269 -#define TK_NULLS 270 -#define TK_ABORT 271 -#define TK_AFTER 272 -#define TK_ATTACH 273 -#define TK_BEFORE 274 -#define TK_BEGIN 275 -#define TK_BITAND 276 -#define TK_BITNOT 277 -#define TK_BITOR 278 -#define TK_BLOCKS 279 -#define TK_CHANGE 280 -#define TK_COMMA 281 -#define TK_COMPACT 282 -#define TK_CONCAT 283 -#define TK_CONFLICT 284 -#define TK_COPY 285 -#define TK_DEFERRED 286 -#define TK_DELIMITERS 287 -#define TK_DETACH 288 -#define TK_DIVIDE 289 -#define TK_DOT 290 -#define TK_EACH 291 -#define TK_FAIL 292 -#define TK_FILE 293 -#define TK_FOR 294 -#define TK_GLOB 295 -#define TK_ID 296 -#define TK_IMMEDIATE 297 -#define TK_IMPORT 298 -#define TK_INITIALLY 299 -#define TK_INSTEAD 300 -#define TK_ISNULL 301 -#define TK_KEY 302 -#define TK_MODULES 303 -#define TK_NK_BITNOT 304 -#define TK_NK_SEMI 305 -#define TK_NOTNULL 306 -#define TK_OF 307 -#define TK_PLUS 308 -#define TK_PRIVILEGE 309 -#define TK_RAISE 310 -#define TK_REPLACE 311 -#define TK_RESTRICT 312 -#define TK_ROW 313 -#define TK_SEMI 314 -#define TK_STAR 315 -#define TK_STATEMENT 316 +#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 diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 91ec5f52e5..3f11d2a218 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -58,8 +58,7 @@ typedef enum { #define QUERY_RSP_POLICY_QUICK 1 #define QUERY_MSG_MASK_SHOW_REWRITE() (1 << 0) -#define TEST_SHOW_REWRITE_MASK(m) (((m) & QUERY_MSG_MASK_SHOW_REWRITE()) != 0) - +#define TEST_SHOW_REWRITE_MASK(m) (((m)&QUERY_MSG_MASK_SHOW_REWRITE()) != 0) typedef struct STableComInfo { uint8_t numOfTags; // the number of tags in schema @@ -128,7 +127,7 @@ typedef struct SDBVgInfo { int8_t hashMethod; int32_t numOfTable; // DB's table num, unit is TSDB_TABLE_NUM_UNIT int64_t stateTs; - SHashObj* vgHash; // key:vgId, value:SVgroupInfo + SHashObj* vgHash; // key:vgId, value:SVgroupInfo SArray* vgArray; } SDBVgInfo; @@ -262,23 +261,26 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t (NEED_CLIENT_RM_TBLMETA_ERROR(_code) || NEED_CLIENT_REFRESH_VG_ERROR(_code) || \ NEED_CLIENT_REFRESH_TBLMETA_ERROR(_code)) -#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || (_code) == TSDB_CODE_VND_STOPPED || (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) -#define SYNC_SELF_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_RESTORING || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR) -#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_MNODE_NOT_FOUND) +#define SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) \ + ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR || \ + (_code) == TSDB_CODE_VND_STOPPED || (_code) == TSDB_CODE_APP_IS_STARTING || (_code) == TSDB_CODE_APP_IS_STOPPING) +#define SYNC_SELF_LEADER_REDIRECT_ERROR(_code) \ + ((_code) == TSDB_CODE_SYN_NOT_LEADER || (_code) == TSDB_CODE_SYN_RESTORING || (_code) == TSDB_CODE_SYN_INTERNAL_ERROR) +#define SYNC_OTHER_LEADER_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_MNODE_NOT_FOUND) #define NO_RET_REDIRECT_ERROR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) -#define NEED_REDIRECT_ERROR(_code) \ +#define NEED_REDIRECT_ERROR(_code) \ (NO_RET_REDIRECT_ERROR(_code) || SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || \ SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) - #define NEED_CLIENT_RM_TBLMETA_REQ(_type) \ ((_type) == TDMT_VND_CREATE_TABLE || (_type) == TDMT_MND_CREATE_STB || (_type) == TDMT_VND_DROP_TABLE || \ (_type) == TDMT_MND_DROP_STB) -#define NEED_SCHEDULER_REDIRECT_ERROR(_code) \ - (SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) +#define NEED_SCHEDULER_REDIRECT_ERROR(_code) \ + (SYNC_UNKNOWN_LEADER_REDIRECT_ERROR(_code) || SYNC_SELF_LEADER_REDIRECT_ERROR(_code) || \ + SYNC_OTHER_LEADER_REDIRECT_ERROR(_code)) #define REQUEST_TOTAL_EXEC_TIMES 2 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 e352cfb569..52221bdd44 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -342,6 +342,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 e0089014aa..e1d421a399 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -337,7 +337,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" @@ -497,6 +497,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 c694a6c1a0..2cb337fc4c 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -146,8 +146,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; @@ -232,7 +231,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 e26512d065..807c752873 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); @@ -1646,7 +1646,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; @@ -1972,8 +1973,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) { @@ -2295,14 +2294,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; } @@ -2318,13 +2317,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 4f726ab194..2b43229b83 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -358,7 +358,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; } @@ -1157,13 +1161,14 @@ 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*/); + ASSERT(numOfRows > 0); if (numOfRows <= pBlockInfo->capacity) { return TSDB_CODE_SUCCESS; } @@ -1220,7 +1225,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)) { @@ -2427,6 +2432,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/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/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 99260ffefd..540f0c3127 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 8cf212cb1d..e56f130c2c 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, int 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); @@ -238,6 +246,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); @@ -344,7 +353,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 09717c823e..4a941b3c20 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -738,7 +738,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 c3a4cefc66..46b31bc5b0 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -533,6 +533,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 139347fd69..24a614800e 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; @@ -2538,6 +2539,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); @@ -3622,6 +3624,7 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, STSRow* i += 1; } + pBlock->info.dataLoad = 1; pBlock->info.rows += 1; pScanInfo->lastKey = pTSRow->ts; return TSDB_CODE_SUCCESS; @@ -3669,6 +3672,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 8be4904349..c61ff343ab 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 0fc42f3744..6092888136 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -317,11 +317,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 65bb40b195..8e81a00098 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -654,6 +654,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 eae2ff3c72..d074ceede8 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); @@ -1793,6 +1796,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: @@ -1970,6 +1974,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/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/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 343dd855e6..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); } @@ -1069,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/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 36420599b3..a6bead89aa 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -1411,6 +1411,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])) { @@ -1418,6 +1419,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, } if (readLen == 0) { + firstLine = false; continue; } @@ -1431,6 +1433,11 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, strtolower(pLine, pLine); const char* pRow = pLine; code = parseOneRow(pCxt, (const char**)&pRow, pDataBuf, &gotRow, &token); + if (code && firstLine) { + firstLine = false; + code = 0; + continue; + } } if (TSDB_CODE_SUCCESS == code && gotRow) { @@ -1442,6 +1449,8 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, pStmt->fileProcessing = true; break; } + + firstLine = false; } taosMemoryFree(pLine); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index d805c76d77..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); } @@ -3899,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]))) { @@ -4055,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); @@ -5515,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; @@ -5527,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); @@ -5535,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; @@ -5637,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 c9dec76a0a..b383d02006 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 715 -#define YYNRULE 540 +#define YYNSTATE 714 +#define YYNRULE 539 #define YYNTOKEN 324 -#define YY_MAX_SHIFT 714 -#define YY_MIN_SHIFTREDUCE 1057 -#define YY_MAX_SHIFTREDUCE 1596 -#define YY_ERROR_ACTION 1597 -#define YY_ACCEPT_ACTION 1598 -#define YY_NO_ACTION 1599 -#define YY_MIN_REDUCE 1600 -#define YY_MAX_REDUCE 2139 +#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,714 +216,790 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2586) +#define YY_ACTTAB_COUNT (2968) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1954, 460, 1743, 461, 1636, 571, 590, 35, 276, 2110, - /* 10 */ 160, 1807, 45, 43, 1526, 1708, 353, 2115, 331, 1865, - /* 20 */ 362, 2110, 1377, 1600, 570, 175, 603, 1805, 354, 2111, - /* 30 */ 572, 1972, 159, 1456, 1612, 1375, 157, 2114, 1403, 586, - /* 40 */ 54, 2111, 2113, 401, 1923, 1756, 619, 124, 123, 122, - /* 50 */ 121, 120, 119, 118, 117, 116, 466, 1754, 1451, 602, - /* 60 */ 38, 37, 462, 18, 44, 42, 41, 40, 39, 1953, - /* 70 */ 1383, 171, 469, 1988, 461, 1636, 102, 1955, 623, 1957, - /* 80 */ 1958, 618, 571, 613, 1794, 547, 2110, 2056, 172, 2110, - /* 90 */ 2041, 1523, 1745, 169, 356, 2037, 14, 60, 603, 1954, - /* 100 */ 1941, 570, 175, 1937, 2116, 175, 2111, 572, 177, 2111, - /* 110 */ 572, 1937, 125, 2053, 334, 1854, 2067, 115, 711, 499, - /* 120 */ 114, 113, 112, 111, 110, 109, 108, 107, 106, 1754, - /* 130 */ 1972, 1933, 1939, 1458, 1459, 48, 1598, 1807, 620, 1933, - /* 140 */ 1939, 345, 613, 1923, 355, 619, 45, 43, 1910, 1563, - /* 150 */ 613, 1260, 1261, 1805, 362, 1731, 1377, 367, 1807, 1954, - /* 160 */ 1800, 1802, 1432, 1441, 1109, 366, 1108, 1456, 1953, 1375, - /* 170 */ 603, 1109, 1988, 1108, 1805, 102, 1955, 623, 1957, 1958, - /* 180 */ 618, 1378, 613, 1376, 180, 136, 212, 143, 2012, 2041, - /* 190 */ 1972, 260, 1451, 356, 2037, 1110, 384, 18, 586, 377, - /* 200 */ 602, 1754, 1110, 1923, 1383, 619, 1381, 1382, 602, 1431, - /* 210 */ 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, - /* 220 */ 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, 1953, 60, - /* 230 */ 14, 87, 1988, 1954, 227, 102, 1955, 623, 1957, 1958, - /* 240 */ 618, 547, 613, 1402, 648, 2110, 178, 172, 82, 2041, - /* 250 */ 1090, 561, 711, 356, 2037, 44, 42, 41, 40, 39, - /* 260 */ 2116, 175, 129, 655, 1972, 2111, 572, 1458, 1459, 267, - /* 270 */ 268, 1749, 620, 64, 266, 2068, 48, 1923, 1402, 619, - /* 280 */ 45, 43, 148, 147, 652, 651, 650, 145, 362, 1092, - /* 290 */ 1377, 1095, 1096, 1954, 84, 322, 1432, 1441, 532, 583, - /* 300 */ 530, 1456, 1953, 1375, 459, 528, 1988, 464, 1642, 102, - /* 310 */ 1955, 623, 1957, 1958, 618, 1378, 613, 1376, 526, 60, - /* 320 */ 524, 2016, 1732, 2041, 1972, 1729, 1451, 356, 2037, 590, - /* 330 */ 133, 18, 620, 1522, 567, 562, 556, 1923, 1383, 619, - /* 340 */ 1381, 1382, 1866, 1431, 1434, 1435, 1436, 1437, 1438, 1439, - /* 350 */ 1440, 615, 611, 1449, 1450, 1452, 1453, 1454, 1455, 1457, - /* 360 */ 1460, 2, 1953, 11, 14, 60, 1988, 1801, 1802, 102, - /* 370 */ 1955, 623, 1957, 1958, 618, 2115, 613, 60, 178, 2110, - /* 380 */ 1807, 2130, 49, 2041, 478, 1623, 711, 356, 2037, 257, - /* 390 */ 2049, 582, 407, 126, 581, 2114, 1806, 2110, 2075, 2111, - /* 400 */ 2112, 1458, 1459, 38, 37, 603, 228, 44, 42, 41, - /* 410 */ 40, 39, 570, 175, 45, 43, 1461, 2111, 572, 125, - /* 420 */ 1313, 1314, 362, 478, 1377, 178, 504, 1954, 1530, 1923, - /* 430 */ 1432, 1441, 320, 655, 1402, 1456, 1754, 1375, 2056, 468, - /* 440 */ 38, 37, 464, 1642, 44, 42, 41, 40, 39, 1378, - /* 450 */ 566, 1376, 148, 147, 652, 651, 650, 145, 1972, 1466, - /* 460 */ 1451, 400, 187, 399, 2052, 1402, 620, 589, 178, 1354, - /* 470 */ 1355, 1923, 1383, 619, 1381, 1382, 27, 1431, 1434, 1435, - /* 480 */ 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, 1450, 1452, - /* 490 */ 1453, 1454, 1455, 1457, 1460, 2, 1953, 169, 46, 79, - /* 500 */ 1988, 1403, 78, 102, 1955, 623, 1957, 1958, 618, 547, - /* 510 */ 613, 510, 509, 2110, 178, 2130, 1972, 2041, 655, 1855, - /* 520 */ 711, 356, 2037, 1622, 565, 1402, 178, 82, 2116, 175, - /* 530 */ 213, 178, 2088, 2111, 572, 1458, 1459, 148, 147, 652, - /* 540 */ 651, 650, 145, 13, 12, 164, 603, 1621, 45, 43, - /* 550 */ 1750, 495, 491, 487, 483, 210, 362, 1837, 1377, 603, - /* 560 */ 405, 682, 680, 564, 1432, 1441, 396, 1923, 1593, 1456, - /* 570 */ 1404, 1375, 1601, 406, 38, 37, 1433, 1754, 44, 42, - /* 580 */ 41, 40, 39, 1378, 2056, 1376, 1405, 398, 394, 443, - /* 590 */ 1754, 1923, 83, 115, 1451, 208, 114, 113, 112, 111, - /* 600 */ 110, 109, 108, 107, 106, 1553, 1383, 1433, 1381, 1382, - /* 610 */ 2051, 1431, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, - /* 620 */ 611, 1449, 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, - /* 630 */ 359, 358, 46, 2115, 1401, 603, 1177, 38, 37, 1499, - /* 640 */ 1391, 44, 42, 41, 40, 39, 657, 191, 190, 415, - /* 650 */ 1404, 1456, 157, 1384, 711, 558, 1551, 1552, 1554, 1555, - /* 660 */ 1620, 1757, 207, 201, 1592, 206, 1754, 31, 474, 1458, - /* 670 */ 1459, 1179, 1619, 38, 37, 99, 1451, 44, 42, 41, - /* 680 */ 40, 39, 45, 43, 199, 41, 40, 39, 1383, 134, - /* 690 */ 362, 11, 1377, 514, 513, 512, 714, 1746, 1432, 1441, - /* 700 */ 1405, 130, 508, 1456, 1923, 1375, 507, 603, 603, 424, - /* 710 */ 283, 1730, 506, 511, 259, 1487, 1923, 1378, 505, 1376, - /* 720 */ 1618, 429, 430, 1617, 408, 168, 1542, 1586, 1451, 1405, - /* 730 */ 237, 704, 700, 696, 692, 281, 609, 409, 1754, 1754, - /* 740 */ 1383, 135, 1381, 1382, 2012, 1431, 1434, 1435, 1436, 1437, - /* 750 */ 1438, 1439, 1440, 615, 611, 1449, 1450, 1452, 1453, 1454, - /* 760 */ 1455, 1457, 1460, 2, 1923, 1616, 14, 1923, 1739, 603, - /* 770 */ 365, 603, 100, 657, 1383, 274, 368, 11, 157, 9, - /* 780 */ 319, 1669, 1400, 476, 157, 477, 32, 1756, 711, 437, - /* 790 */ 1615, 1614, 450, 1756, 259, 449, 1492, 1095, 1096, 1392, - /* 800 */ 1754, 1387, 1754, 1458, 1459, 1611, 1610, 33, 599, 1923, - /* 810 */ 421, 669, 451, 38, 37, 423, 1609, 44, 42, 41, - /* 820 */ 40, 39, 38, 37, 1395, 1397, 44, 42, 41, 40, - /* 830 */ 39, 1608, 1432, 1441, 1923, 1923, 611, 1449, 1450, 1452, - /* 840 */ 1453, 1454, 1455, 8, 184, 262, 514, 513, 512, 1923, - /* 850 */ 1923, 1378, 93, 1376, 130, 508, 1607, 335, 1666, 507, - /* 860 */ 1923, 605, 1348, 2013, 231, 506, 511, 1850, 607, 411, - /* 870 */ 2013, 505, 2114, 236, 1747, 1923, 1381, 1382, 183, 1431, - /* 880 */ 1434, 1435, 1436, 1437, 1438, 1439, 1440, 615, 611, 1449, - /* 890 */ 1450, 1452, 1453, 1454, 1455, 1457, 1460, 2, 229, 447, - /* 900 */ 1923, 1784, 442, 441, 440, 439, 436, 435, 434, 433, - /* 910 */ 432, 428, 427, 426, 425, 336, 418, 417, 416, 1944, - /* 920 */ 413, 412, 333, 688, 687, 686, 685, 372, 583, 684, - /* 930 */ 683, 137, 678, 677, 676, 675, 674, 673, 672, 671, - /* 940 */ 150, 667, 666, 665, 371, 370, 662, 661, 660, 659, - /* 950 */ 658, 158, 1606, 1605, 1402, 235, 296, 38, 37, 133, - /* 960 */ 1377, 44, 42, 41, 40, 39, 1942, 603, 1946, 503, - /* 970 */ 294, 68, 649, 1375, 67, 1798, 603, 1937, 156, 38, - /* 980 */ 37, 1751, 1954, 44, 42, 41, 40, 39, 1850, 1850, - /* 990 */ 141, 502, 195, 456, 454, 85, 1923, 1923, 1754, 185, - /* 1000 */ 189, 653, 339, 575, 1798, 1933, 1939, 1754, 1383, 1604, - /* 1010 */ 603, 654, 327, 1972, 1798, 1741, 613, 585, 173, 2049, - /* 1020 */ 2050, 620, 131, 2054, 543, 670, 1923, 1724, 619, 60, - /* 1030 */ 1217, 645, 644, 643, 1221, 642, 1223, 1224, 641, 1226, - /* 1040 */ 638, 1754, 1232, 635, 1234, 1235, 632, 629, 1519, 290, - /* 1050 */ 1603, 1953, 1784, 1923, 1485, 1988, 711, 603, 102, 1955, - /* 1060 */ 623, 1957, 1958, 618, 340, 613, 338, 337, 101, 501, - /* 1070 */ 2130, 587, 2041, 503, 1954, 1386, 356, 2037, 603, 2061, - /* 1080 */ 1519, 583, 1656, 603, 603, 603, 603, 554, 1754, 50, - /* 1090 */ 69, 3, 271, 146, 1923, 502, 1433, 598, 600, 601, - /* 1100 */ 277, 139, 610, 127, 515, 1972, 76, 75, 404, 1754, - /* 1110 */ 1486, 182, 133, 620, 1754, 1754, 1754, 1754, 1923, 1378, - /* 1120 */ 619, 1376, 1385, 218, 220, 583, 216, 219, 603, 318, - /* 1130 */ 1595, 1596, 392, 574, 390, 386, 382, 379, 376, 578, - /* 1140 */ 77, 62, 369, 1953, 1381, 1382, 53, 1988, 241, 542, - /* 1150 */ 102, 1955, 623, 1957, 1958, 618, 133, 613, 1649, 1754, - /* 1160 */ 375, 1954, 2130, 222, 2041, 47, 221, 224, 356, 2037, - /* 1170 */ 223, 174, 2049, 2050, 1647, 131, 2054, 1737, 178, 2104, - /* 1180 */ 517, 34, 360, 1480, 1481, 1482, 1483, 1484, 1488, 1489, - /* 1190 */ 1490, 1491, 1972, 52, 1550, 1613, 520, 232, 546, 264, - /* 1200 */ 620, 243, 547, 614, 1954, 1923, 2110, 619, 142, 144, - /* 1210 */ 647, 146, 62, 13, 12, 176, 2049, 2050, 1324, 131, - /* 1220 */ 2054, 2116, 175, 1389, 2081, 576, 2111, 572, 1709, 254, - /* 1230 */ 1953, 663, 1954, 47, 1988, 1972, 47, 102, 1955, 623, - /* 1240 */ 1957, 1958, 618, 620, 613, 1477, 664, 1643, 1923, 2130, - /* 1250 */ 619, 2041, 269, 1158, 627, 356, 2037, 98, 1138, 559, - /* 1260 */ 211, 595, 273, 1972, 1210, 1493, 2060, 95, 1156, 248, - /* 1270 */ 1388, 620, 144, 1953, 1973, 1954, 1923, 1988, 619, 146, - /* 1280 */ 102, 1955, 623, 1957, 1958, 618, 1442, 613, 128, 289, - /* 1290 */ 144, 373, 2014, 1139, 2041, 1859, 706, 1637, 356, 2037, - /* 1300 */ 374, 1953, 1795, 2071, 584, 1988, 1972, 1238, 102, 1955, - /* 1310 */ 623, 1957, 1958, 618, 620, 613, 256, 253, 1, 1923, - /* 1320 */ 606, 619, 2041, 4, 378, 1242, 356, 2037, 383, 1341, - /* 1330 */ 535, 284, 1249, 332, 188, 410, 1405, 1860, 414, 445, - /* 1340 */ 1954, 1247, 547, 149, 1953, 419, 2110, 1400, 1988, 431, - /* 1350 */ 1852, 103, 1955, 623, 1957, 1958, 618, 438, 613, 452, - /* 1360 */ 444, 2116, 175, 579, 1954, 2041, 2111, 572, 446, 2040, - /* 1370 */ 2037, 1972, 547, 453, 1406, 458, 2110, 192, 455, 620, - /* 1380 */ 457, 467, 1408, 1954, 1923, 198, 619, 470, 1407, 471, - /* 1390 */ 472, 2116, 175, 1409, 200, 1972, 2111, 572, 473, 203, - /* 1400 */ 475, 205, 80, 620, 479, 1112, 81, 209, 1923, 1953, - /* 1410 */ 619, 496, 497, 1988, 1972, 498, 103, 1955, 623, 1957, - /* 1420 */ 1958, 618, 620, 613, 105, 534, 500, 1923, 1744, 619, - /* 1430 */ 2041, 321, 2072, 1953, 608, 2037, 1954, 1988, 215, 1740, - /* 1440 */ 162, 1955, 623, 1957, 1958, 618, 217, 613, 151, 152, - /* 1450 */ 1742, 1738, 621, 230, 153, 1900, 1988, 1954, 154, 103, - /* 1460 */ 1955, 623, 1957, 1958, 618, 1899, 613, 1972, 537, 538, - /* 1470 */ 536, 285, 541, 2041, 233, 617, 544, 326, 2037, 2082, - /* 1480 */ 1923, 551, 619, 557, 560, 593, 346, 2087, 1972, 239, - /* 1490 */ 242, 563, 573, 2131, 2086, 7, 620, 569, 549, 2063, - /* 1500 */ 552, 1923, 550, 619, 577, 1953, 252, 1519, 250, 1988, - /* 1510 */ 1954, 1941, 312, 1955, 623, 1957, 1958, 618, 616, 613, - /* 1520 */ 604, 2006, 1937, 249, 247, 347, 1953, 580, 132, 1404, - /* 1530 */ 1988, 2109, 588, 161, 1955, 623, 1957, 1958, 618, 2057, - /* 1540 */ 613, 1972, 165, 251, 350, 261, 591, 286, 592, 620, - /* 1550 */ 1933, 1939, 357, 1871, 1923, 1870, 619, 1869, 352, 2133, - /* 1560 */ 287, 613, 255, 1954, 596, 90, 92, 597, 288, 1755, - /* 1570 */ 59, 94, 2022, 625, 548, 2078, 1799, 291, 707, 1953, - /* 1580 */ 1725, 708, 280, 1988, 1954, 710, 103, 1955, 623, 1957, - /* 1590 */ 1958, 618, 51, 613, 1972, 315, 295, 300, 323, 293, - /* 1600 */ 2041, 324, 620, 1917, 314, 2038, 1954, 1923, 1916, 619, - /* 1610 */ 304, 73, 1915, 1914, 74, 1972, 1911, 380, 381, 1369, - /* 1620 */ 1370, 181, 385, 620, 1909, 387, 388, 389, 1923, 1908, - /* 1630 */ 619, 391, 1953, 1907, 393, 1906, 1988, 1972, 1905, 161, - /* 1640 */ 1955, 623, 1957, 1958, 618, 620, 613, 395, 1344, 397, - /* 1650 */ 1923, 1343, 619, 1953, 1882, 1881, 403, 1988, 402, 1880, - /* 1660 */ 306, 1955, 623, 1957, 1958, 618, 1879, 613, 1304, 1845, - /* 1670 */ 1844, 1842, 1954, 138, 1841, 1953, 1840, 1843, 1839, 1988, - /* 1680 */ 186, 2079, 162, 1955, 623, 1957, 1958, 618, 1838, 613, - /* 1690 */ 519, 1836, 1954, 1835, 1834, 420, 1833, 422, 1832, 1831, - /* 1700 */ 1830, 1829, 1828, 1972, 568, 529, 1827, 1826, 351, 1825, - /* 1710 */ 1824, 620, 1823, 1822, 1821, 1820, 1923, 1819, 619, 226, - /* 1720 */ 1818, 140, 1817, 1972, 1816, 1815, 1814, 1813, 1812, 1811, - /* 1730 */ 1306, 617, 1810, 448, 522, 2132, 1923, 1809, 619, 516, - /* 1740 */ 1808, 1953, 1671, 193, 225, 1988, 1185, 1954, 313, 1955, - /* 1750 */ 623, 1957, 1958, 618, 1670, 613, 1668, 1632, 71, 1098, - /* 1760 */ 196, 1953, 1097, 1954, 1631, 1988, 1895, 170, 312, 1955, - /* 1770 */ 623, 1957, 1958, 618, 194, 613, 197, 2007, 1972, 1889, - /* 1780 */ 1943, 66, 463, 361, 65, 465, 620, 1878, 72, 202, - /* 1790 */ 204, 1923, 1877, 619, 1972, 1862, 1733, 1667, 1131, 363, - /* 1800 */ 1665, 481, 620, 480, 482, 1663, 1954, 1923, 484, 619, - /* 1810 */ 486, 485, 1661, 490, 1659, 488, 1953, 489, 492, 1646, - /* 1820 */ 1988, 494, 1645, 313, 1955, 623, 1957, 1958, 618, 493, - /* 1830 */ 613, 1628, 1953, 1735, 214, 61, 1988, 1972, 1254, 313, - /* 1840 */ 1955, 623, 1957, 1958, 618, 620, 613, 1253, 1734, 1954, - /* 1850 */ 1923, 1176, 619, 1175, 679, 1174, 1168, 681, 1173, 1170, - /* 1860 */ 1657, 1169, 1167, 341, 1650, 1954, 342, 518, 1648, 343, - /* 1870 */ 521, 1627, 1626, 523, 525, 533, 1625, 527, 104, 1988, - /* 1880 */ 1972, 1359, 308, 1955, 623, 1957, 1958, 618, 620, 613, - /* 1890 */ 531, 1358, 1894, 1923, 26, 619, 1972, 1350, 1361, 1888, - /* 1900 */ 539, 1876, 1874, 55, 620, 155, 2115, 540, 1565, 1923, - /* 1910 */ 234, 619, 16, 19, 58, 344, 1954, 545, 1953, 245, - /* 1920 */ 553, 5, 1988, 30, 28, 297, 1955, 623, 1957, 1958, - /* 1930 */ 618, 246, 613, 1954, 1953, 555, 238, 1944, 1988, 6, - /* 1940 */ 240, 298, 1955, 623, 1957, 1958, 618, 1972, 613, 1549, - /* 1950 */ 163, 63, 20, 244, 21, 620, 1541, 29, 1580, 86, - /* 1960 */ 1923, 1579, 619, 1585, 1972, 348, 1584, 1583, 349, 258, - /* 1970 */ 1586, 1516, 620, 57, 1515, 166, 1875, 1923, 1873, 619, - /* 1980 */ 1872, 22, 594, 263, 1547, 1953, 1861, 265, 1954, 1988, - /* 1990 */ 17, 270, 299, 1955, 623, 1957, 1958, 618, 56, 613, - /* 2000 */ 88, 89, 1953, 91, 95, 275, 1988, 1954, 23, 305, - /* 2010 */ 1955, 623, 1957, 1958, 618, 272, 613, 1468, 10, 1972, - /* 2020 */ 12, 1467, 1393, 1991, 167, 1424, 179, 620, 624, 626, - /* 2030 */ 612, 1954, 1923, 1446, 619, 1478, 364, 1444, 1972, 36, - /* 2040 */ 622, 1443, 15, 24, 630, 25, 620, 1416, 1239, 628, - /* 2050 */ 631, 1923, 1236, 619, 1233, 633, 634, 1953, 1227, 636, - /* 2060 */ 1225, 1988, 1972, 637, 309, 1955, 623, 1957, 1958, 618, - /* 2070 */ 620, 613, 639, 1216, 646, 1923, 1953, 619, 640, 1231, - /* 2080 */ 1988, 96, 278, 301, 1955, 623, 1957, 1958, 618, 1954, - /* 2090 */ 613, 1230, 1229, 1228, 97, 1248, 1244, 656, 70, 1129, - /* 2100 */ 1953, 1164, 1163, 1162, 1988, 1954, 1161, 310, 1955, 623, - /* 2110 */ 1957, 1958, 618, 1160, 613, 1159, 1157, 1155, 1154, 1153, - /* 2120 */ 1972, 668, 1183, 279, 1149, 1151, 1150, 1148, 620, 1147, - /* 2130 */ 1146, 1145, 1144, 1923, 1180, 619, 1972, 1135, 1178, 1141, - /* 2140 */ 1664, 1140, 690, 1137, 620, 1136, 1134, 689, 1954, 1923, - /* 2150 */ 1662, 619, 691, 693, 1660, 695, 697, 694, 1953, 699, - /* 2160 */ 1658, 701, 1988, 703, 1954, 302, 1955, 623, 1957, 1958, - /* 2170 */ 618, 698, 613, 702, 1953, 282, 705, 1087, 1988, 1972, - /* 2180 */ 1644, 311, 1955, 623, 1957, 1958, 618, 620, 613, 1624, - /* 2190 */ 709, 712, 1923, 1379, 619, 1972, 292, 713, 1599, 1599, - /* 2200 */ 1599, 1599, 1599, 620, 1599, 1599, 1599, 1954, 1923, 1599, - /* 2210 */ 619, 1599, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, - /* 2220 */ 1599, 1988, 1599, 1954, 303, 1955, 623, 1957, 1958, 618, - /* 2230 */ 1599, 613, 1599, 1953, 1599, 1599, 1599, 1988, 1972, 1599, - /* 2240 */ 316, 1955, 623, 1957, 1958, 618, 620, 613, 1599, 1599, - /* 2250 */ 1599, 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, - /* 2260 */ 1599, 1599, 620, 1599, 1599, 1599, 1954, 1923, 1599, 619, - /* 2270 */ 1599, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, 1599, - /* 2280 */ 1988, 1599, 1599, 317, 1955, 623, 1957, 1958, 618, 1599, - /* 2290 */ 613, 1599, 1953, 1599, 1599, 1599, 1988, 1972, 1599, 1966, - /* 2300 */ 1955, 623, 1957, 1958, 618, 620, 613, 1599, 1599, 1599, - /* 2310 */ 1923, 1599, 619, 1599, 1599, 1599, 1599, 1954, 1599, 1599, - /* 2320 */ 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, - /* 2330 */ 1599, 1599, 1599, 1599, 1954, 1953, 1599, 1599, 1599, 1988, - /* 2340 */ 1599, 1599, 1965, 1955, 623, 1957, 1958, 618, 1972, 613, - /* 2350 */ 1599, 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, - /* 2360 */ 1954, 1923, 1599, 619, 1599, 1972, 1599, 1599, 1599, 1599, - /* 2370 */ 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, - /* 2380 */ 619, 1599, 1599, 1599, 1599, 1599, 1953, 1599, 1599, 1599, - /* 2390 */ 1988, 1972, 1599, 1964, 1955, 623, 1957, 1958, 618, 620, - /* 2400 */ 613, 1599, 1599, 1953, 1923, 1599, 619, 1988, 1599, 1599, - /* 2410 */ 328, 1955, 623, 1957, 1958, 618, 1954, 613, 1599, 1599, - /* 2420 */ 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1953, - /* 2430 */ 1599, 1599, 1954, 1988, 1599, 1599, 329, 1955, 623, 1957, - /* 2440 */ 1958, 618, 1599, 613, 1599, 1599, 1599, 1972, 1599, 1599, - /* 2450 */ 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, - /* 2460 */ 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, 1599, - /* 2470 */ 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, 619, 1599, - /* 2480 */ 1599, 1599, 1599, 1599, 1599, 1953, 1954, 1599, 1599, 1988, - /* 2490 */ 1599, 1599, 325, 1955, 623, 1957, 1958, 618, 1599, 613, - /* 2500 */ 1599, 1953, 1954, 1599, 1599, 1988, 1599, 1599, 330, 1955, - /* 2510 */ 623, 1957, 1958, 618, 1599, 613, 1599, 1972, 1599, 1599, - /* 2520 */ 1599, 1599, 1599, 1599, 1599, 620, 1599, 1599, 1599, 1599, - /* 2530 */ 1923, 1599, 619, 1972, 1599, 1599, 1599, 1599, 1599, 1599, - /* 2540 */ 1599, 620, 1599, 1599, 1599, 1599, 1923, 1599, 619, 1599, - /* 2550 */ 1599, 1599, 1599, 1599, 1599, 621, 1599, 1599, 1599, 1988, - /* 2560 */ 1599, 1599, 308, 1955, 623, 1957, 1958, 618, 1599, 613, - /* 2570 */ 1599, 1953, 1599, 1599, 1599, 1988, 1599, 1599, 307, 1955, - /* 2580 */ 623, 1957, 1958, 618, 1599, 613, + /* 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 */ 327, 331, 359, 333, 334, 429, 373, 418, 419, 433, - /* 10 */ 342, 358, 12, 13, 14, 347, 383, 429, 365, 386, - /* 20 */ 20, 433, 22, 0, 448, 449, 335, 374, 350, 453, - /* 30 */ 454, 358, 326, 33, 328, 35, 358, 449, 20, 366, - /* 40 */ 349, 453, 454, 387, 371, 367, 373, 24, 25, 26, - /* 50 */ 27, 28, 29, 30, 31, 32, 14, 366, 58, 20, - /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 396, - /* 70 */ 70, 357, 331, 400, 333, 334, 403, 404, 405, 406, - /* 80 */ 407, 408, 429, 410, 370, 429, 433, 402, 415, 433, - /* 90 */ 417, 4, 360, 358, 421, 422, 96, 96, 335, 327, - /* 100 */ 360, 448, 449, 371, 448, 449, 453, 454, 435, 453, - /* 110 */ 454, 371, 349, 428, 379, 380, 443, 21, 118, 356, - /* 120 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 366, - /* 130 */ 358, 399, 400, 133, 134, 96, 324, 358, 366, 399, - /* 140 */ 400, 401, 410, 371, 365, 373, 12, 13, 0, 97, - /* 150 */ 410, 133, 134, 374, 20, 0, 22, 369, 358, 327, - /* 160 */ 372, 373, 162, 163, 20, 365, 22, 33, 396, 35, - /* 170 */ 335, 20, 400, 22, 374, 403, 404, 405, 406, 407, - /* 180 */ 408, 181, 410, 183, 349, 413, 35, 415, 416, 417, - /* 190 */ 358, 58, 58, 421, 422, 51, 48, 63, 366, 387, - /* 200 */ 20, 366, 51, 371, 70, 373, 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, 396, 96, - /* 230 */ 96, 98, 400, 327, 128, 403, 404, 405, 406, 407, - /* 240 */ 408, 429, 410, 20, 107, 433, 245, 415, 341, 417, - /* 250 */ 4, 167, 118, 421, 422, 12, 13, 14, 15, 16, - /* 260 */ 448, 449, 355, 108, 358, 453, 454, 133, 134, 127, - /* 270 */ 128, 364, 366, 4, 132, 443, 96, 371, 20, 373, - /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 43, - /* 290 */ 22, 45, 46, 327, 188, 189, 162, 163, 192, 335, - /* 300 */ 194, 33, 396, 35, 332, 21, 400, 335, 336, 403, - /* 310 */ 404, 405, 406, 407, 408, 181, 410, 183, 34, 96, - /* 320 */ 36, 415, 0, 417, 358, 0, 58, 421, 422, 373, - /* 330 */ 366, 63, 366, 246, 250, 251, 252, 371, 70, 373, - /* 340 */ 206, 207, 386, 209, 210, 211, 212, 213, 214, 215, - /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 360 */ 226, 227, 396, 229, 96, 96, 400, 372, 373, 403, - /* 370 */ 404, 405, 406, 407, 408, 429, 410, 96, 245, 433, - /* 380 */ 358, 415, 96, 417, 62, 327, 118, 421, 422, 425, - /* 390 */ 426, 427, 335, 429, 430, 449, 374, 433, 432, 453, - /* 400 */ 454, 133, 134, 8, 9, 335, 127, 12, 13, 14, - /* 410 */ 15, 16, 448, 449, 12, 13, 14, 453, 454, 349, - /* 420 */ 162, 163, 20, 62, 22, 245, 356, 327, 14, 371, - /* 430 */ 162, 163, 375, 108, 20, 33, 366, 35, 402, 332, - /* 440 */ 8, 9, 335, 336, 12, 13, 14, 15, 16, 181, - /* 450 */ 20, 183, 127, 128, 129, 130, 131, 132, 358, 14, - /* 460 */ 58, 180, 58, 182, 428, 20, 366, 387, 245, 190, - /* 470 */ 191, 371, 70, 373, 206, 207, 44, 209, 210, 211, - /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 490 */ 222, 223, 224, 225, 226, 227, 396, 358, 96, 95, - /* 500 */ 400, 20, 98, 403, 404, 405, 406, 407, 408, 429, - /* 510 */ 410, 344, 345, 433, 245, 415, 358, 417, 108, 380, - /* 520 */ 118, 421, 422, 327, 366, 20, 245, 341, 448, 449, - /* 530 */ 33, 245, 432, 453, 454, 133, 134, 127, 128, 129, - /* 540 */ 130, 131, 132, 1, 2, 48, 335, 327, 12, 13, - /* 550 */ 364, 54, 55, 56, 57, 58, 20, 0, 22, 335, - /* 560 */ 349, 344, 345, 405, 162, 163, 176, 371, 173, 33, - /* 570 */ 20, 35, 0, 349, 8, 9, 162, 366, 12, 13, - /* 580 */ 14, 15, 16, 181, 402, 183, 20, 197, 198, 80, - /* 590 */ 366, 371, 95, 21, 58, 98, 24, 25, 26, 27, - /* 600 */ 28, 29, 30, 31, 32, 206, 70, 162, 206, 207, - /* 610 */ 428, 209, 210, 211, 212, 213, 214, 215, 216, 217, - /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - /* 630 */ 12, 13, 96, 3, 20, 335, 35, 8, 9, 97, - /* 640 */ 22, 12, 13, 14, 15, 16, 62, 138, 139, 349, - /* 650 */ 20, 33, 358, 35, 118, 256, 257, 258, 259, 260, - /* 660 */ 327, 367, 165, 166, 269, 168, 366, 2, 171, 133, - /* 670 */ 134, 70, 327, 8, 9, 339, 58, 12, 13, 14, - /* 680 */ 15, 16, 12, 13, 187, 14, 15, 16, 70, 353, - /* 690 */ 20, 229, 22, 65, 66, 67, 19, 361, 162, 163, - /* 700 */ 20, 73, 74, 33, 371, 35, 78, 335, 335, 152, - /* 710 */ 33, 0, 84, 85, 164, 161, 371, 181, 90, 183, - /* 720 */ 327, 349, 349, 327, 22, 48, 97, 97, 58, 20, - /* 730 */ 164, 54, 55, 56, 57, 58, 118, 35, 366, 366, - /* 740 */ 70, 413, 206, 207, 416, 209, 210, 211, 212, 213, - /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - /* 760 */ 224, 225, 226, 227, 371, 327, 96, 371, 359, 335, - /* 770 */ 350, 335, 95, 62, 70, 98, 350, 229, 358, 231, - /* 780 */ 18, 0, 20, 349, 358, 349, 232, 367, 118, 27, - /* 790 */ 327, 327, 30, 367, 164, 33, 242, 45, 46, 181, - /* 800 */ 366, 183, 366, 133, 134, 327, 327, 2, 131, 371, - /* 810 */ 48, 70, 50, 8, 9, 53, 327, 12, 13, 14, - /* 820 */ 15, 16, 8, 9, 206, 207, 12, 13, 14, 15, - /* 830 */ 16, 327, 162, 163, 371, 371, 218, 219, 220, 221, - /* 840 */ 222, 223, 224, 39, 164, 168, 65, 66, 67, 371, - /* 850 */ 371, 181, 339, 183, 73, 74, 327, 95, 0, 78, - /* 860 */ 371, 414, 185, 416, 187, 84, 85, 366, 414, 107, - /* 870 */ 416, 90, 3, 164, 361, 371, 206, 207, 377, 209, - /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 351, 137, - /* 900 */ 371, 354, 140, 141, 142, 143, 144, 145, 146, 147, - /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 47, - /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 335, 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, 327, 327, 20, 58, 23, 8, 9, 366, - /* 960 */ 22, 12, 13, 14, 15, 16, 360, 335, 96, 108, - /* 970 */ 37, 38, 368, 35, 41, 371, 335, 371, 164, 8, - /* 980 */ 9, 349, 327, 12, 13, 14, 15, 16, 366, 366, - /* 990 */ 349, 130, 59, 60, 61, 98, 371, 371, 366, 377, - /* 1000 */ 377, 368, 37, 44, 371, 399, 400, 366, 70, 327, - /* 1010 */ 335, 368, 63, 358, 371, 359, 410, 424, 425, 426, - /* 1020 */ 427, 366, 429, 430, 349, 346, 371, 348, 373, 96, - /* 1030 */ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - /* 1040 */ 119, 366, 121, 122, 123, 124, 125, 126, 244, 351, - /* 1050 */ 327, 396, 354, 371, 105, 400, 118, 335, 403, 404, - /* 1060 */ 405, 406, 407, 408, 99, 410, 101, 102, 135, 104, - /* 1070 */ 415, 349, 417, 108, 327, 35, 421, 422, 335, 243, - /* 1080 */ 244, 335, 0, 335, 335, 335, 335, 432, 366, 42, - /* 1090 */ 107, 44, 349, 44, 371, 130, 162, 349, 349, 349, - /* 1100 */ 349, 42, 63, 44, 22, 358, 173, 174, 175, 366, - /* 1110 */ 161, 178, 366, 366, 366, 366, 366, 366, 371, 181, - /* 1120 */ 373, 183, 35, 100, 100, 335, 103, 103, 335, 196, - /* 1130 */ 133, 134, 199, 264, 201, 202, 203, 204, 205, 44, - /* 1140 */ 157, 44, 349, 396, 206, 207, 97, 400, 44, 391, - /* 1150 */ 403, 404, 405, 406, 407, 408, 366, 410, 0, 366, - /* 1160 */ 387, 327, 415, 100, 417, 44, 103, 100, 421, 422, - /* 1170 */ 103, 425, 426, 427, 0, 429, 430, 359, 245, 432, - /* 1180 */ 22, 232, 233, 234, 235, 236, 237, 238, 239, 240, - /* 1190 */ 241, 242, 358, 164, 97, 328, 22, 359, 169, 44, - /* 1200 */ 366, 97, 429, 359, 327, 371, 433, 373, 44, 44, - /* 1210 */ 359, 44, 44, 1, 2, 425, 426, 427, 97, 429, - /* 1220 */ 430, 448, 449, 183, 381, 266, 453, 454, 347, 457, - /* 1230 */ 396, 13, 327, 44, 400, 358, 44, 403, 404, 405, - /* 1240 */ 406, 407, 408, 366, 410, 206, 13, 0, 371, 415, - /* 1250 */ 373, 417, 97, 35, 44, 421, 422, 96, 35, 446, - /* 1260 */ 337, 97, 97, 358, 97, 97, 432, 106, 35, 440, - /* 1270 */ 183, 366, 44, 396, 358, 327, 371, 400, 373, 44, - /* 1280 */ 403, 404, 405, 406, 407, 408, 97, 410, 44, 97, - /* 1290 */ 44, 337, 415, 70, 417, 381, 49, 334, 421, 422, - /* 1300 */ 387, 396, 370, 381, 431, 400, 358, 97, 403, 404, - /* 1310 */ 405, 406, 407, 408, 366, 410, 450, 423, 434, 371, - /* 1320 */ 415, 373, 417, 247, 398, 97, 421, 422, 48, 179, - /* 1330 */ 387, 389, 97, 397, 42, 378, 20, 381, 378, 161, - /* 1340 */ 327, 97, 429, 97, 396, 376, 433, 20, 400, 335, - /* 1350 */ 335, 403, 404, 405, 406, 407, 408, 378, 410, 94, - /* 1360 */ 376, 448, 449, 268, 327, 417, 453, 454, 376, 421, - /* 1370 */ 422, 358, 429, 343, 20, 329, 433, 335, 335, 366, - /* 1380 */ 335, 329, 20, 327, 371, 341, 373, 393, 20, 373, - /* 1390 */ 336, 448, 449, 20, 341, 358, 453, 454, 388, 341, - /* 1400 */ 336, 341, 341, 366, 335, 52, 341, 341, 371, 396, - /* 1410 */ 373, 338, 338, 400, 358, 329, 403, 404, 405, 406, - /* 1420 */ 407, 408, 366, 410, 335, 195, 358, 371, 358, 373, - /* 1430 */ 417, 329, 381, 396, 421, 422, 327, 400, 358, 358, - /* 1440 */ 403, 404, 405, 406, 407, 408, 358, 410, 358, 358, - /* 1450 */ 358, 358, 396, 339, 358, 371, 400, 327, 358, 403, - /* 1460 */ 404, 405, 406, 407, 408, 371, 410, 358, 186, 392, - /* 1470 */ 395, 393, 373, 417, 339, 366, 335, 421, 422, 381, - /* 1480 */ 371, 371, 373, 371, 255, 254, 371, 439, 358, 384, - /* 1490 */ 384, 371, 455, 456, 439, 261, 366, 172, 248, 442, - /* 1500 */ 263, 371, 262, 373, 265, 396, 398, 244, 437, 400, - /* 1510 */ 327, 360, 403, 404, 405, 406, 407, 408, 409, 410, - /* 1520 */ 411, 412, 371, 438, 441, 270, 396, 267, 366, 20, - /* 1530 */ 400, 452, 335, 403, 404, 405, 406, 407, 408, 402, - /* 1540 */ 410, 358, 439, 436, 336, 339, 371, 384, 371, 366, - /* 1550 */ 399, 400, 401, 371, 371, 371, 373, 371, 371, 458, - /* 1560 */ 384, 410, 451, 327, 166, 339, 339, 382, 354, 366, - /* 1570 */ 96, 96, 420, 362, 444, 445, 371, 335, 36, 396, - /* 1580 */ 348, 330, 339, 400, 327, 329, 403, 404, 405, 406, - /* 1590 */ 407, 408, 390, 410, 358, 394, 325, 352, 385, 340, - /* 1600 */ 417, 385, 366, 0, 352, 422, 327, 371, 0, 373, - /* 1610 */ 352, 188, 0, 0, 42, 358, 0, 35, 200, 35, - /* 1620 */ 35, 35, 200, 366, 0, 35, 35, 200, 371, 0, - /* 1630 */ 373, 200, 396, 0, 35, 0, 400, 358, 0, 403, - /* 1640 */ 404, 405, 406, 407, 408, 366, 410, 22, 183, 35, - /* 1650 */ 371, 181, 373, 396, 0, 0, 176, 400, 177, 0, - /* 1660 */ 403, 404, 405, 406, 407, 408, 0, 410, 47, 0, - /* 1670 */ 0, 0, 327, 42, 0, 396, 0, 0, 0, 400, - /* 1680 */ 152, 445, 403, 404, 405, 406, 407, 408, 0, 410, - /* 1690 */ 4, 0, 327, 0, 0, 35, 0, 152, 0, 0, - /* 1700 */ 0, 0, 0, 358, 447, 19, 0, 0, 363, 0, - /* 1710 */ 0, 366, 0, 0, 0, 0, 371, 0, 373, 33, - /* 1720 */ 0, 42, 0, 358, 0, 0, 0, 0, 0, 0, - /* 1730 */ 22, 366, 0, 136, 48, 456, 371, 0, 373, 53, - /* 1740 */ 0, 396, 0, 58, 58, 400, 35, 327, 403, 404, - /* 1750 */ 405, 406, 407, 408, 0, 410, 0, 0, 39, 14, - /* 1760 */ 42, 396, 14, 327, 0, 400, 0, 44, 403, 404, - /* 1770 */ 405, 406, 407, 408, 58, 410, 40, 412, 358, 0, - /* 1780 */ 47, 95, 47, 363, 98, 47, 366, 0, 39, 39, - /* 1790 */ 172, 371, 0, 373, 358, 0, 0, 0, 64, 363, - /* 1800 */ 0, 48, 366, 35, 39, 0, 327, 371, 35, 373, - /* 1810 */ 39, 48, 0, 39, 0, 35, 396, 48, 35, 0, - /* 1820 */ 400, 39, 0, 403, 404, 405, 406, 407, 408, 48, - /* 1830 */ 410, 0, 396, 0, 103, 105, 400, 358, 35, 403, - /* 1840 */ 404, 405, 406, 407, 408, 366, 410, 22, 0, 327, - /* 1850 */ 371, 35, 373, 35, 44, 35, 22, 44, 35, 35, - /* 1860 */ 0, 35, 35, 22, 0, 327, 22, 50, 0, 22, - /* 1870 */ 35, 0, 0, 35, 35, 396, 0, 22, 20, 400, - /* 1880 */ 358, 35, 403, 404, 405, 406, 407, 408, 366, 410, - /* 1890 */ 193, 35, 0, 371, 96, 373, 358, 35, 97, 0, - /* 1900 */ 22, 0, 0, 164, 366, 184, 3, 164, 97, 371, - /* 1910 */ 166, 373, 249, 44, 44, 164, 327, 170, 396, 44, - /* 1920 */ 228, 169, 400, 44, 96, 403, 404, 405, 406, 407, - /* 1930 */ 408, 47, 410, 327, 396, 253, 96, 47, 400, 169, - /* 1940 */ 97, 403, 404, 405, 406, 407, 408, 358, 410, 97, - /* 1950 */ 96, 3, 249, 96, 44, 366, 97, 96, 35, 96, - /* 1960 */ 371, 35, 373, 97, 358, 35, 35, 35, 35, 47, - /* 1970 */ 97, 97, 366, 44, 97, 47, 0, 371, 0, 373, - /* 1980 */ 0, 96, 167, 97, 97, 396, 0, 96, 327, 400, - /* 1990 */ 249, 96, 403, 404, 405, 406, 407, 408, 243, 410, - /* 2000 */ 96, 39, 396, 96, 106, 47, 400, 327, 44, 403, - /* 2010 */ 404, 405, 406, 407, 408, 165, 410, 228, 230, 358, - /* 2020 */ 2, 228, 22, 96, 47, 22, 47, 366, 107, 35, - /* 2030 */ 96, 327, 371, 97, 373, 206, 35, 97, 358, 96, - /* 2040 */ 208, 97, 96, 96, 35, 96, 366, 97, 97, 96, - /* 2050 */ 96, 371, 97, 373, 97, 35, 96, 396, 97, 35, - /* 2060 */ 97, 400, 358, 96, 403, 404, 405, 406, 407, 408, - /* 2070 */ 366, 410, 35, 22, 108, 371, 396, 373, 96, 120, - /* 2080 */ 400, 96, 44, 403, 404, 405, 406, 407, 408, 327, - /* 2090 */ 410, 120, 120, 120, 96, 35, 22, 63, 96, 64, - /* 2100 */ 396, 35, 35, 35, 400, 327, 35, 403, 404, 405, - /* 2110 */ 406, 407, 408, 35, 410, 35, 35, 35, 35, 35, - /* 2120 */ 358, 93, 70, 44, 22, 35, 35, 35, 366, 22, - /* 2130 */ 35, 35, 35, 371, 70, 373, 358, 22, 35, 35, - /* 2140 */ 0, 35, 48, 35, 366, 35, 35, 35, 327, 371, - /* 2150 */ 0, 373, 39, 35, 0, 39, 35, 48, 396, 39, - /* 2160 */ 0, 35, 400, 39, 327, 403, 404, 405, 406, 407, - /* 2170 */ 408, 48, 410, 48, 396, 22, 35, 35, 400, 358, - /* 2180 */ 0, 403, 404, 405, 406, 407, 408, 366, 410, 0, - /* 2190 */ 21, 21, 371, 22, 373, 358, 22, 20, 459, 459, - /* 2200 */ 459, 459, 459, 366, 459, 459, 459, 327, 371, 459, - /* 2210 */ 373, 459, 459, 459, 459, 459, 459, 396, 459, 459, - /* 2220 */ 459, 400, 459, 327, 403, 404, 405, 406, 407, 408, - /* 2230 */ 459, 410, 459, 396, 459, 459, 459, 400, 358, 459, - /* 2240 */ 403, 404, 405, 406, 407, 408, 366, 410, 459, 459, - /* 2250 */ 459, 371, 459, 373, 358, 459, 459, 459, 459, 459, - /* 2260 */ 459, 459, 366, 459, 459, 459, 327, 371, 459, 373, - /* 2270 */ 459, 459, 459, 459, 459, 459, 396, 459, 459, 459, - /* 2280 */ 400, 459, 459, 403, 404, 405, 406, 407, 408, 459, - /* 2290 */ 410, 459, 396, 459, 459, 459, 400, 358, 459, 403, - /* 2300 */ 404, 405, 406, 407, 408, 366, 410, 459, 459, 459, - /* 2310 */ 371, 459, 373, 459, 459, 459, 459, 327, 459, 459, - /* 2320 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2330 */ 459, 459, 459, 459, 327, 396, 459, 459, 459, 400, - /* 2340 */ 459, 459, 403, 404, 405, 406, 407, 408, 358, 410, - /* 2350 */ 459, 459, 459, 459, 459, 459, 366, 459, 459, 459, - /* 2360 */ 327, 371, 459, 373, 459, 358, 459, 459, 459, 459, - /* 2370 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, - /* 2380 */ 373, 459, 459, 459, 459, 459, 396, 459, 459, 459, - /* 2390 */ 400, 358, 459, 403, 404, 405, 406, 407, 408, 366, - /* 2400 */ 410, 459, 459, 396, 371, 459, 373, 400, 459, 459, - /* 2410 */ 403, 404, 405, 406, 407, 408, 327, 410, 459, 459, - /* 2420 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 396, - /* 2430 */ 459, 459, 327, 400, 459, 459, 403, 404, 405, 406, - /* 2440 */ 407, 408, 459, 410, 459, 459, 459, 358, 459, 459, - /* 2450 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, - /* 2460 */ 371, 459, 373, 358, 459, 459, 459, 459, 459, 459, - /* 2470 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, - /* 2480 */ 459, 459, 459, 459, 459, 396, 327, 459, 459, 400, - /* 2490 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, - /* 2500 */ 459, 396, 327, 459, 459, 400, 459, 459, 403, 404, - /* 2510 */ 405, 406, 407, 408, 459, 410, 459, 358, 459, 459, - /* 2520 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, - /* 2530 */ 371, 459, 373, 358, 459, 459, 459, 459, 459, 459, + /* 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, 396, 459, 459, 459, 400, - /* 2560 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, + /* 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, + /* 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 (714) +#define YY_SHIFT_COUNT (713) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2189) +#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, 268, 268, 402, 536, 536, 670, 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, 536, 536, 180, 223, - /* 50 */ 39, 281, 133, 1, 286, 1, 39, 39, 618, 618, - /* 60 */ 1, 618, 618, 269, 1, 188, 188, 246, 246, 258, - /* 70 */ 18, 42, 42, 188, 188, 188, 188, 188, 188, 188, - /* 80 */ 188, 188, 188, 361, 188, 188, 430, 188, 481, 188, - /* 90 */ 188, 505, 188, 188, 505, 188, 505, 505, 505, 188, - /* 100 */ 584, 762, 949, 949, 96, 628, 938, 938, 938, 938, - /* 110 */ 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, - /* 120 */ 938, 938, 938, 938, 938, 965, 630, 258, 18, 322, - /* 130 */ 601, 550, 550, 550, 711, 548, 548, 601, 614, 614, - /* 140 */ 614, 137, 481, 462, 505, 704, 505, 704, 704, 137, - /* 150 */ 741, 921, 921, 921, 921, 921, 921, 921, 677, 572, - /* 160 */ 781, 566, 395, 399, 151, 84, 414, 445, 144, 680, - /* 170 */ 752, 861, 709, 836, 804, 869, 836, 1047, 87, 934, - /* 180 */ 1076, 1280, 1150, 1292, 1316, 1292, 1178, 1327, 1327, 1292, - /* 190 */ 1178, 1178, 1265, 1327, 1327, 1327, 1354, 1354, 1362, 361, - /* 200 */ 481, 361, 1368, 1373, 361, 1368, 361, 361, 361, 1327, - /* 210 */ 361, 1353, 1353, 1354, 505, 505, 505, 505, 505, 505, - /* 220 */ 505, 505, 505, 505, 505, 1327, 1354, 704, 704, 1230, - /* 230 */ 1362, 584, 1282, 481, 584, 1327, 1316, 1316, 704, 1229, - /* 240 */ 1231, 704, 1229, 1231, 704, 704, 505, 1234, 1325, 1229, - /* 250 */ 1237, 1240, 1250, 1076, 1255, 1260, 1239, 1263, 614, 1509, - /* 260 */ 1327, 1368, 584, 1231, 704, 704, 704, 704, 704, 1231, - /* 270 */ 704, 1398, 584, 137, 584, 614, 1474, 1475, 704, 741, - /* 280 */ 1327, 584, 1542, 1354, 2586, 2586, 2586, 2586, 2586, 2586, - /* 290 */ 2586, 2586, 2586, 858, 497, 23, 1686, 52, 432, 629, - /* 300 */ 155, 665, 805, 814, 325, 971, 971, 971, 971, 971, - /* 310 */ 971, 971, 971, 971, 410, 106, 243, 243, 390, 404, - /* 320 */ 509, 284, 279, 142, 142, 671, 542, 554, 671, 671, - /* 330 */ 671, 1049, 148, 702, 1059, 983, 557, 1023, 1024, 1063, - /* 340 */ 1067, 1082, 1158, 1174, 897, 1097, 1104, 997, 959, 1095, - /* 350 */ 1029, 1121, 1155, 1164, 1165, 1167, 1212, 1168, 1040, 1087, - /* 360 */ 1039, 1189, 872, 1192, 1210, 1228, 1235, 1244, 1246, 1161, - /* 370 */ 1218, 1233, 1223, 1247, 1603, 1608, 1423, 1612, 1613, 1572, - /* 380 */ 1616, 1582, 1418, 1584, 1585, 1586, 1422, 1624, 1590, 1591, - /* 390 */ 1427, 1629, 1431, 1633, 1599, 1635, 1625, 1638, 1614, 1465, - /* 400 */ 1470, 1654, 1655, 1481, 1480, 1659, 1666, 1621, 1669, 1670, - /* 410 */ 1671, 1631, 1674, 1676, 1677, 1678, 1688, 1691, 1693, 1694, - /* 420 */ 1528, 1660, 1696, 1545, 1698, 1699, 1700, 1701, 1702, 1706, - /* 430 */ 1707, 1709, 1710, 1712, 1713, 1714, 1715, 1717, 1720, 1679, - /* 440 */ 1722, 1724, 1725, 1726, 1727, 1708, 1728, 1729, 1732, 1597, - /* 450 */ 1737, 1740, 1711, 1742, 1685, 1754, 1716, 1756, 1757, 1718, - /* 460 */ 1719, 1723, 1733, 1745, 1735, 1748, 1738, 1764, 1736, 1749, - /* 470 */ 1766, 1779, 1787, 1750, 1618, 1792, 1795, 1796, 1734, 1797, - /* 480 */ 1800, 1768, 1753, 1765, 1805, 1773, 1763, 1771, 1812, 1780, - /* 490 */ 1769, 1774, 1814, 1783, 1781, 1782, 1819, 1822, 1831, 1833, - /* 500 */ 1730, 1731, 1803, 1825, 1848, 1816, 1818, 1820, 1823, 1810, - /* 510 */ 1813, 1824, 1826, 1834, 1827, 1860, 1841, 1864, 1844, 1817, - /* 520 */ 1868, 1847, 1835, 1871, 1838, 1872, 1839, 1876, 1855, 1858, - /* 530 */ 1846, 1856, 1697, 1801, 1798, 1892, 1739, 1862, 1899, 1721, - /* 540 */ 1878, 1743, 1744, 1901, 1902, 1751, 1747, 1903, 1869, 1663, - /* 550 */ 1828, 1811, 1840, 1752, 1692, 1770, 1682, 1843, 1870, 1852, - /* 560 */ 1854, 1857, 1861, 1859, 1875, 1884, 1890, 1863, 1879, 1703, - /* 570 */ 1866, 1873, 1948, 1910, 1741, 1923, 1926, 1930, 1931, 1932, - /* 580 */ 1933, 1874, 1877, 1922, 1755, 1929, 1928, 1976, 1978, 1980, - /* 590 */ 1885, 1886, 1887, 1891, 1895, 1815, 1904, 1986, 1962, 1850, - /* 600 */ 1907, 1898, 1733, 1958, 1964, 1789, 1788, 1793, 2018, 2000, - /* 610 */ 1829, 1927, 1936, 1934, 1940, 1943, 1944, 1977, 1946, 1947, - /* 620 */ 1979, 1950, 2003, 1832, 1949, 1921, 1951, 1994, 2001, 1953, - /* 630 */ 1955, 2009, 1954, 1957, 2020, 1960, 1961, 2024, 1967, 1963, - /* 640 */ 2037, 1982, 1959, 1971, 1972, 1973, 2051, 1966, 1985, 2038, - /* 650 */ 1998, 2060, 2002, 2038, 2038, 2074, 2035, 2034, 2066, 2067, - /* 660 */ 2068, 2071, 2078, 2080, 2081, 2082, 2083, 2084, 2052, 2028, - /* 670 */ 2079, 2090, 2091, 2102, 2092, 2107, 2095, 2096, 2097, 2064, - /* 680 */ 1810, 2103, 1813, 2104, 2106, 2108, 2110, 2115, 2111, 2140, - /* 690 */ 2112, 2094, 2113, 2150, 2118, 2109, 2116, 2154, 2121, 2123, - /* 700 */ 2120, 2160, 2126, 2125, 2124, 2180, 2141, 2142, 2189, 2153, - /* 710 */ 2169, 2171, 2174, 2170, 2177, + /* 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 (292) -#define YY_REDUCE_MIN (-424) -#define YY_REDUCE_MAX (2175) +#define YY_REDUCE_MIN (-381) +#define YY_REDUCE_MAX (2557) static const short yy_reduce_ofst[] = { - /* 0 */ -188, -327, -228, -168, -34, 100, 655, 747, 834, -94, - /* 10 */ 877, 905, 948, 1013, 1056, 1109, 1130, 1037, 1183, 1236, - /* 20 */ 1257, 1279, 1345, 1365, 1420, 1436, 1479, 1522, 1538, 1589, - /* 30 */ 1606, 1661, 1680, 1704, 1762, 1778, 1821, 1837, 1880, 1896, - /* 40 */ 1939, 1990, 2007, 2033, 2089, 2105, 2159, 2175, -36, -347, - /* 50 */ 593, -344, 80, 773, 913, 943, 746, 790, -260, 1151, - /* 60 */ -424, -268, 606, -412, -54, -237, 70, -330, -259, -265, - /* 70 */ -212, -28, 107, -309, -165, 211, 224, 300, 372, 373, - /* 80 */ 434, 436, 632, -93, 641, 675, 158, 722, -367, 743, - /* 90 */ 748, -322, 749, 750, -221, 751, 420, -200, 426, 793, - /* 100 */ 336, 57, -411, -411, -294, -332, 58, 196, 220, 333, - /* 110 */ 345, 393, 396, 438, 463, 464, 478, 479, 489, 504, - /* 120 */ 529, 625, 626, 682, 723, -286, -315, 139, -5, 186, - /* 130 */ 167, -315, 36, 182, 513, 447, 454, 217, 501, 622, - /* 140 */ 623, 547, -44, 328, 294, 604, 22, 633, 643, 698, - /* 150 */ 679, -357, 409, 656, 818, 838, 844, 851, 758, 867, - /* 160 */ 881, 843, 772, 813, 923, 829, 916, 916, 954, 914, - /* 170 */ 963, 932, 922, 873, 873, 866, 873, 894, 884, 916, - /* 180 */ 926, 936, 942, 957, 956, 960, 969, 1014, 1015, 979, - /* 190 */ 984, 992, 1030, 1042, 1043, 1045, 1046, 1052, 994, 1044, - /* 200 */ 1016, 1053, 1054, 1010, 1058, 1064, 1060, 1061, 1065, 1069, - /* 210 */ 1066, 1073, 1074, 1086, 1068, 1070, 1080, 1081, 1088, 1090, - /* 220 */ 1091, 1092, 1093, 1096, 1100, 1089, 1102, 1084, 1094, 1075, - /* 230 */ 1078, 1114, 1077, 1099, 1135, 1141, 1051, 1098, 1110, 1048, - /* 240 */ 1105, 1112, 1055, 1106, 1115, 1120, 916, 1057, 1083, 1103, - /* 250 */ 1085, 1071, 1107, 1108, 1101, 1079, 1111, 873, 1162, 1137, - /* 260 */ 1197, 1208, 1206, 1163, 1175, 1177, 1182, 1184, 1186, 1176, - /* 270 */ 1187, 1185, 1226, 1214, 1227, 1203, 1152, 1211, 1205, 1232, - /* 280 */ 1242, 1243, 1251, 1256, 1202, 1201, 1213, 1216, 1245, 1252, - /* 290 */ 1258, 1259, 1271, + /* 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 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 10 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 20 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 30 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 40 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 50 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 60 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1853, - /* 70 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 80 */ 1597, 1597, 1597, 1675, 1597, 1597, 1597, 1597, 1597, 1597, - /* 90 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 100 */ 1673, 1846, 2043, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 110 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 120 */ 1597, 1597, 1597, 1597, 1597, 1597, 2055, 1597, 1597, 1675, - /* 130 */ 1597, 2055, 2055, 2055, 1673, 2015, 2015, 1597, 1597, 1597, - /* 140 */ 1597, 1783, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1783, - /* 150 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1890, 1597, - /* 160 */ 1597, 2080, 2134, 1597, 1597, 2083, 1597, 1597, 1597, 1858, - /* 170 */ 1597, 1736, 2070, 2047, 2061, 2118, 2048, 2045, 2064, 1597, - /* 180 */ 2074, 1597, 1883, 1851, 1597, 1851, 1848, 1597, 1597, 1851, - /* 190 */ 1848, 1848, 1727, 1597, 1597, 1597, 1597, 1597, 1597, 1675, - /* 200 */ 1597, 1675, 1597, 1597, 1675, 1597, 1675, 1675, 1675, 1597, - /* 210 */ 1675, 1654, 1654, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 220 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1903, - /* 230 */ 1597, 1673, 1892, 1597, 1673, 1597, 1597, 1597, 1597, 2091, - /* 240 */ 2089, 1597, 2091, 2089, 1597, 1597, 1597, 2103, 2099, 2091, - /* 250 */ 2107, 2105, 2076, 2074, 2137, 2124, 2120, 2061, 1597, 1597, - /* 260 */ 1597, 1597, 1673, 2089, 1597, 1597, 1597, 1597, 1597, 2089, - /* 270 */ 1597, 1597, 1673, 1597, 1673, 1597, 1597, 1752, 1597, 1597, - /* 280 */ 1597, 1673, 1629, 1597, 1885, 1896, 1868, 1868, 1786, 1786, - /* 290 */ 1786, 1676, 1602, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 300 */ 1597, 1597, 1597, 1597, 1597, 2102, 2101, 1971, 1597, 2019, - /* 310 */ 2018, 2017, 2008, 1970, 1748, 1597, 1969, 1968, 1597, 1597, - /* 320 */ 1597, 1597, 1597, 1864, 1863, 1962, 1597, 1597, 1963, 1961, - /* 330 */ 1960, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 340 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 2121, 2125, - /* 350 */ 1597, 1597, 1597, 1597, 1597, 1597, 2044, 1597, 1597, 1597, - /* 360 */ 1597, 1597, 1945, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 370 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 380 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 390 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 400 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 410 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 420 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 430 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 440 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 450 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 460 */ 1597, 1634, 1950, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 470 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 480 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 490 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 500 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1715, - /* 510 */ 1714, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 520 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 530 */ 1597, 1597, 1597, 1953, 1597, 1597, 1597, 1597, 1597, 1597, - /* 540 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 2117, 2077, 1597, - /* 550 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 560 */ 1597, 1597, 1597, 1597, 1597, 1597, 1945, 1597, 2100, 1597, - /* 570 */ 1597, 2115, 1597, 2119, 1597, 1597, 1597, 1597, 1597, 1597, - /* 580 */ 1597, 2054, 2050, 1597, 1597, 2046, 1597, 1597, 1597, 1597, - /* 590 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 600 */ 1597, 1597, 1944, 1597, 2005, 1597, 1597, 1597, 2039, 1597, - /* 610 */ 1597, 1990, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 620 */ 1597, 1953, 1597, 1956, 1597, 1597, 1597, 1597, 1597, 1780, - /* 630 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 640 */ 1597, 1597, 1765, 1763, 1762, 1761, 1597, 1758, 1597, 1793, - /* 650 */ 1597, 1597, 1597, 1789, 1788, 1597, 1597, 1597, 1597, 1597, - /* 660 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 670 */ 1695, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 680 */ 1686, 1597, 1685, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 690 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 700 */ 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, - /* 710 */ 1597, 1597, 1597, 1597, 1597, + /* 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 *****************************/ @@ -1022,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 */ @@ -1171,7 +1246,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 271, /* END => ABORT */ + 270, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1215,58 +1290,59 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 271, /* AFTER => ABORT */ - 271, /* ATTACH => ABORT */ - 271, /* BEFORE => ABORT */ - 271, /* BEGIN => ABORT */ - 271, /* BITAND => ABORT */ - 271, /* BITNOT => ABORT */ - 271, /* BITOR => ABORT */ - 271, /* BLOCKS => ABORT */ - 271, /* CHANGE => ABORT */ - 271, /* COMMA => ABORT */ - 271, /* COMPACT => ABORT */ - 271, /* CONCAT => ABORT */ - 271, /* CONFLICT => ABORT */ - 271, /* COPY => ABORT */ - 271, /* DEFERRED => ABORT */ - 271, /* DELIMITERS => ABORT */ - 271, /* DETACH => ABORT */ - 271, /* DIVIDE => ABORT */ - 271, /* DOT => ABORT */ - 271, /* EACH => ABORT */ - 271, /* FAIL => ABORT */ - 271, /* FILE => ABORT */ - 271, /* FOR => ABORT */ - 271, /* GLOB => ABORT */ - 271, /* ID => ABORT */ - 271, /* IMMEDIATE => ABORT */ - 271, /* IMPORT => ABORT */ - 271, /* INITIALLY => ABORT */ - 271, /* INSTEAD => ABORT */ - 271, /* ISNULL => ABORT */ - 271, /* KEY => ABORT */ - 271, /* MODULES => ABORT */ - 271, /* NK_BITNOT => ABORT */ - 271, /* NK_SEMI => ABORT */ - 271, /* NOTNULL => ABORT */ - 271, /* OF => ABORT */ - 271, /* PLUS => ABORT */ - 271, /* PRIVILEGE => ABORT */ - 271, /* RAISE => ABORT */ - 271, /* REPLACE => ABORT */ - 271, /* RESTRICT => ABORT */ - 271, /* ROW => ABORT */ - 271, /* SEMI => ABORT */ - 271, /* STAR => ABORT */ - 271, /* STATEMENT => ABORT */ - 271, /* STRING => ABORT */ - 271, /* TIMES => ABORT */ - 271, /* UPDATE => ABORT */ - 271, /* VALUES => ABORT */ - 271, /* VARIABLE => ABORT */ - 271, /* VIEW => ABORT */ - 271, /* 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 */ @@ -1433,244 +1509,244 @@ 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 */ "EVENT_WINDOW", - /* 253 */ "START", - /* 254 */ "SLIDING", - /* 255 */ "FILL", - /* 256 */ "VALUE", - /* 257 */ "NONE", - /* 258 */ "PREV", - /* 259 */ "LINEAR", - /* 260 */ "NEXT", - /* 261 */ "HAVING", - /* 262 */ "RANGE", - /* 263 */ "EVERY", - /* 264 */ "ORDER", - /* 265 */ "SLIMIT", - /* 266 */ "SOFFSET", - /* 267 */ "LIMIT", - /* 268 */ "OFFSET", - /* 269 */ "ASC", - /* 270 */ "NULLS", - /* 271 */ "ABORT", - /* 272 */ "AFTER", - /* 273 */ "ATTACH", - /* 274 */ "BEFORE", - /* 275 */ "BEGIN", - /* 276 */ "BITAND", - /* 277 */ "BITNOT", - /* 278 */ "BITOR", - /* 279 */ "BLOCKS", - /* 280 */ "CHANGE", - /* 281 */ "COMMA", - /* 282 */ "COMPACT", - /* 283 */ "CONCAT", - /* 284 */ "CONFLICT", - /* 285 */ "COPY", - /* 286 */ "DEFERRED", - /* 287 */ "DELIMITERS", - /* 288 */ "DETACH", - /* 289 */ "DIVIDE", - /* 290 */ "DOT", - /* 291 */ "EACH", - /* 292 */ "FAIL", - /* 293 */ "FILE", - /* 294 */ "FOR", - /* 295 */ "GLOB", - /* 296 */ "ID", - /* 297 */ "IMMEDIATE", - /* 298 */ "IMPORT", - /* 299 */ "INITIALLY", - /* 300 */ "INSTEAD", - /* 301 */ "ISNULL", - /* 302 */ "KEY", - /* 303 */ "MODULES", - /* 304 */ "NK_BITNOT", - /* 305 */ "NK_SEMI", - /* 306 */ "NOTNULL", - /* 307 */ "OF", - /* 308 */ "PLUS", - /* 309 */ "PRIVILEGE", - /* 310 */ "RAISE", - /* 311 */ "REPLACE", - /* 312 */ "RESTRICT", - /* 313 */ "ROW", - /* 314 */ "SEMI", - /* 315 */ "STAR", - /* 316 */ "STATEMENT", + /* 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", @@ -1912,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 ::= WAL_LEVEL NK_INTEGER", - /* 119 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 120 */ "integer_list ::= NK_INTEGER", - /* 121 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 122 */ "variable_list ::= NK_VARIABLE", - /* 123 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 124 */ "retention_list ::= retention", - /* 125 */ "retention_list ::= retention_list NK_COMMA retention", - /* 126 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 127 */ "speed_opt ::=", - /* 128 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 129 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 130 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 131 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 132 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 133 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 134 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 135 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 136 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 137 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 138 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 139 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 140 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 141 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 142 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 143 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 144 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 145 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 146 */ "multi_create_clause ::= create_subtable_clause", - /* 147 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 148 */ "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", - /* 149 */ "multi_drop_clause ::= drop_table_clause", - /* 150 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 151 */ "drop_table_clause ::= exists_opt full_table_name", - /* 152 */ "specific_cols_opt ::=", - /* 153 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 154 */ "full_table_name ::= table_name", - /* 155 */ "full_table_name ::= db_name NK_DOT table_name", - /* 156 */ "column_def_list ::= column_def", - /* 157 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 158 */ "column_def ::= column_name type_name", - /* 159 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 160 */ "type_name ::= BOOL", - /* 161 */ "type_name ::= TINYINT", - /* 162 */ "type_name ::= SMALLINT", - /* 163 */ "type_name ::= INT", - /* 164 */ "type_name ::= INTEGER", - /* 165 */ "type_name ::= BIGINT", - /* 166 */ "type_name ::= FLOAT", - /* 167 */ "type_name ::= DOUBLE", - /* 168 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 169 */ "type_name ::= TIMESTAMP", - /* 170 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 171 */ "type_name ::= TINYINT UNSIGNED", - /* 172 */ "type_name ::= SMALLINT UNSIGNED", - /* 173 */ "type_name ::= INT UNSIGNED", - /* 174 */ "type_name ::= BIGINT UNSIGNED", - /* 175 */ "type_name ::= JSON", - /* 176 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 177 */ "type_name ::= MEDIUMBLOB", - /* 178 */ "type_name ::= BLOB", - /* 179 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 180 */ "type_name ::= DECIMAL", - /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 182 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 183 */ "tags_def_opt ::=", - /* 184 */ "tags_def_opt ::= tags_def", - /* 185 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 186 */ "table_options ::=", - /* 187 */ "table_options ::= table_options COMMENT NK_STRING", - /* 188 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 189 */ "table_options ::= table_options WATERMARK duration_list", - /* 190 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 191 */ "table_options ::= table_options TTL NK_INTEGER", - /* 192 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 193 */ "table_options ::= table_options DELETE_MARK duration_list", - /* 194 */ "alter_table_options ::= alter_table_option", - /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 196 */ "alter_table_option ::= COMMENT NK_STRING", - /* 197 */ "alter_table_option ::= TTL NK_INTEGER", - /* 198 */ "duration_list ::= duration_literal", - /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 200 */ "rollup_func_list ::= rollup_func_name", - /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 202 */ "rollup_func_name ::= function_name", - /* 203 */ "rollup_func_name ::= FIRST", - /* 204 */ "rollup_func_name ::= LAST", - /* 205 */ "col_name_list ::= col_name", - /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 207 */ "col_name ::= column_name", - /* 208 */ "cmd ::= SHOW DNODES", - /* 209 */ "cmd ::= SHOW USERS", - /* 210 */ "cmd ::= SHOW USER PRIVILEGES", - /* 211 */ "cmd ::= SHOW DATABASES", - /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 215 */ "cmd ::= SHOW MNODES", - /* 216 */ "cmd ::= SHOW QNODES", - /* 217 */ "cmd ::= SHOW FUNCTIONS", - /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 219 */ "cmd ::= SHOW STREAMS", - /* 220 */ "cmd ::= SHOW ACCOUNTS", - /* 221 */ "cmd ::= SHOW APPS", - /* 222 */ "cmd ::= SHOW CONNECTIONS", - /* 223 */ "cmd ::= SHOW LICENCES", - /* 224 */ "cmd ::= SHOW GRANTS", - /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 228 */ "cmd ::= SHOW QUERIES", - /* 229 */ "cmd ::= SHOW SCORES", - /* 230 */ "cmd ::= SHOW TOPICS", - /* 231 */ "cmd ::= SHOW VARIABLES", - /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 233 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 235 */ "cmd ::= SHOW BNODES", - /* 236 */ "cmd ::= SHOW SNODES", - /* 237 */ "cmd ::= SHOW CLUSTER", - /* 238 */ "cmd ::= SHOW TRANSACTIONS", - /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 240 */ "cmd ::= SHOW CONSUMERS", - /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 245 */ "cmd ::= SHOW VNODES NK_STRING", - /* 246 */ "db_name_cond_opt ::=", - /* 247 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 248 */ "like_pattern_opt ::=", - /* 249 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 250 */ "table_name_cond ::= table_name", - /* 251 */ "from_db_opt ::=", - /* 252 */ "from_db_opt ::= FROM db_name", - /* 253 */ "tag_list_opt ::=", - /* 254 */ "tag_list_opt ::= tag_item", - /* 255 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 256 */ "tag_item ::= TBNAME", - /* 257 */ "tag_item ::= QTAGS", - /* 258 */ "tag_item ::= column_name", - /* 259 */ "tag_item ::= column_name column_alias", - /* 260 */ "tag_item ::= column_name AS column_alias", - /* 261 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 262 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 263 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 264 */ "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", - /* 265 */ "func_list ::= func", - /* 266 */ "func_list ::= func_list NK_COMMA func", - /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 268 */ "sma_stream_opt ::=", - /* 269 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 270 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 271 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 277 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 278 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 279 */ "cmd ::= DESC full_table_name", - /* 280 */ "cmd ::= DESCRIBE full_table_name", - /* 281 */ "cmd ::= RESET QUERY CACHE", - /* 282 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 283 */ "analyze_opt ::=", - /* 284 */ "analyze_opt ::= ANALYZE", - /* 285 */ "explain_options ::=", - /* 286 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 287 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 288 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 289 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 290 */ "agg_func_opt ::=", - /* 291 */ "agg_func_opt ::= AGGREGATE", - /* 292 */ "bufsize_opt ::=", - /* 293 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 294 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 295 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 296 */ "stream_options ::=", - /* 297 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 298 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 299 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 300 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 301 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 302 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 303 */ "subtable_opt ::=", - /* 304 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 305 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 306 */ "cmd ::= KILL QUERY NK_STRING", - /* 307 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 308 */ "cmd ::= BALANCE VGROUP", - /* 309 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 310 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 311 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 312 */ "dnode_list ::= DNODE NK_INTEGER", - /* 313 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 314 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 315 */ "cmd ::= query_or_subquery", - /* 316 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 317 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 318 */ "literal ::= NK_INTEGER", - /* 319 */ "literal ::= NK_FLOAT", - /* 320 */ "literal ::= NK_STRING", - /* 321 */ "literal ::= NK_BOOL", - /* 322 */ "literal ::= TIMESTAMP NK_STRING", - /* 323 */ "literal ::= duration_literal", - /* 324 */ "literal ::= NULL", - /* 325 */ "literal ::= NK_QUESTION", - /* 326 */ "duration_literal ::= NK_VARIABLE", - /* 327 */ "signed ::= NK_INTEGER", - /* 328 */ "signed ::= NK_PLUS NK_INTEGER", - /* 329 */ "signed ::= NK_MINUS NK_INTEGER", - /* 330 */ "signed ::= NK_FLOAT", - /* 331 */ "signed ::= NK_PLUS NK_FLOAT", - /* 332 */ "signed ::= NK_MINUS NK_FLOAT", - /* 333 */ "signed_literal ::= signed", - /* 334 */ "signed_literal ::= NK_STRING", - /* 335 */ "signed_literal ::= NK_BOOL", - /* 336 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 337 */ "signed_literal ::= duration_literal", - /* 338 */ "signed_literal ::= NULL", - /* 339 */ "signed_literal ::= literal_func", - /* 340 */ "signed_literal ::= NK_QUESTION", - /* 341 */ "literal_list ::= signed_literal", - /* 342 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 343 */ "db_name ::= NK_ID", - /* 344 */ "table_name ::= NK_ID", - /* 345 */ "column_name ::= NK_ID", - /* 346 */ "function_name ::= NK_ID", - /* 347 */ "table_alias ::= NK_ID", - /* 348 */ "column_alias ::= NK_ID", - /* 349 */ "user_name ::= NK_ID", - /* 350 */ "topic_name ::= NK_ID", - /* 351 */ "stream_name ::= NK_ID", - /* 352 */ "cgroup_name ::= NK_ID", - /* 353 */ "expr_or_subquery ::= expression", - /* 354 */ "expression ::= literal", - /* 355 */ "expression ::= pseudo_column", - /* 356 */ "expression ::= column_reference", - /* 357 */ "expression ::= function_expression", - /* 358 */ "expression ::= case_when_expression", - /* 359 */ "expression ::= NK_LP expression NK_RP", - /* 360 */ "expression ::= NK_PLUS expr_or_subquery", - /* 361 */ "expression ::= NK_MINUS expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 366 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 367 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 368 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 369 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 370 */ "expression_list ::= expr_or_subquery", - /* 371 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 372 */ "column_reference ::= column_name", - /* 373 */ "column_reference ::= table_name NK_DOT column_name", - /* 374 */ "pseudo_column ::= ROWTS", - /* 375 */ "pseudo_column ::= TBNAME", - /* 376 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 377 */ "pseudo_column ::= QSTART", - /* 378 */ "pseudo_column ::= QEND", - /* 379 */ "pseudo_column ::= QDURATION", - /* 380 */ "pseudo_column ::= WSTART", - /* 381 */ "pseudo_column ::= WEND", - /* 382 */ "pseudo_column ::= WDURATION", - /* 383 */ "pseudo_column ::= IROWTS", - /* 384 */ "pseudo_column ::= QTAGS", - /* 385 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 386 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 387 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 388 */ "function_expression ::= literal_func", - /* 389 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 390 */ "literal_func ::= NOW", - /* 391 */ "noarg_func ::= NOW", - /* 392 */ "noarg_func ::= TODAY", - /* 393 */ "noarg_func ::= TIMEZONE", - /* 394 */ "noarg_func ::= DATABASE", - /* 395 */ "noarg_func ::= CLIENT_VERSION", - /* 396 */ "noarg_func ::= SERVER_VERSION", - /* 397 */ "noarg_func ::= SERVER_STATUS", - /* 398 */ "noarg_func ::= CURRENT_USER", - /* 399 */ "noarg_func ::= USER", - /* 400 */ "star_func ::= COUNT", - /* 401 */ "star_func ::= FIRST", - /* 402 */ "star_func ::= LAST", - /* 403 */ "star_func ::= LAST_ROW", - /* 404 */ "star_func_para_list ::= NK_STAR", - /* 405 */ "star_func_para_list ::= other_para_list", - /* 406 */ "other_para_list ::= star_func_para", - /* 407 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 408 */ "star_func_para ::= expr_or_subquery", - /* 409 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 410 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 411 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 412 */ "when_then_list ::= when_then_expr", - /* 413 */ "when_then_list ::= when_then_list when_then_expr", - /* 414 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 415 */ "case_when_else_opt ::=", - /* 416 */ "case_when_else_opt ::= ELSE common_expression", - /* 417 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 418 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 420 */ "predicate ::= expr_or_subquery IS NULL", - /* 421 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 422 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 423 */ "compare_op ::= NK_LT", - /* 424 */ "compare_op ::= NK_GT", - /* 425 */ "compare_op ::= NK_LE", - /* 426 */ "compare_op ::= NK_GE", - /* 427 */ "compare_op ::= NK_NE", - /* 428 */ "compare_op ::= NK_EQ", - /* 429 */ "compare_op ::= LIKE", - /* 430 */ "compare_op ::= NOT LIKE", - /* 431 */ "compare_op ::= MATCH", - /* 432 */ "compare_op ::= NMATCH", - /* 433 */ "compare_op ::= CONTAINS", - /* 434 */ "in_op ::= IN", - /* 435 */ "in_op ::= NOT IN", - /* 436 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 437 */ "boolean_value_expression ::= boolean_primary", - /* 438 */ "boolean_value_expression ::= NOT boolean_primary", - /* 439 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 440 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 441 */ "boolean_primary ::= predicate", - /* 442 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 443 */ "common_expression ::= expr_or_subquery", - /* 444 */ "common_expression ::= boolean_value_expression", - /* 445 */ "from_clause_opt ::=", - /* 446 */ "from_clause_opt ::= FROM table_reference_list", - /* 447 */ "table_reference_list ::= table_reference", - /* 448 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 449 */ "table_reference ::= table_primary", - /* 450 */ "table_reference ::= joined_table", - /* 451 */ "table_primary ::= table_name alias_opt", - /* 452 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 453 */ "table_primary ::= subquery alias_opt", - /* 454 */ "table_primary ::= parenthesized_joined_table", - /* 455 */ "alias_opt ::=", - /* 456 */ "alias_opt ::= table_alias", - /* 457 */ "alias_opt ::= AS table_alias", - /* 458 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 459 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 460 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 461 */ "join_type ::=", - /* 462 */ "join_type ::= INNER", - /* 463 */ "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", - /* 464 */ "set_quantifier_opt ::=", - /* 465 */ "set_quantifier_opt ::= DISTINCT", - /* 466 */ "set_quantifier_opt ::= ALL", - /* 467 */ "select_list ::= select_item", - /* 468 */ "select_list ::= select_list NK_COMMA select_item", - /* 469 */ "select_item ::= NK_STAR", - /* 470 */ "select_item ::= common_expression", - /* 471 */ "select_item ::= common_expression column_alias", - /* 472 */ "select_item ::= common_expression AS column_alias", - /* 473 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 474 */ "where_clause_opt ::=", - /* 475 */ "where_clause_opt ::= WHERE search_condition", - /* 476 */ "partition_by_clause_opt ::=", - /* 477 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 478 */ "partition_list ::= partition_item", - /* 479 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 480 */ "partition_item ::= expr_or_subquery", - /* 481 */ "partition_item ::= expr_or_subquery column_alias", - /* 482 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 483 */ "twindow_clause_opt ::=", - /* 484 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 485 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 488 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 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 */ @@ -3063,454 +3138,453 @@ static const struct { { 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 STRICT NK_STRING */ - { 340, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 340, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 340, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 340, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 340, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 340, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 340, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 340, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 340, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 340, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 340, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 340, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 340, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 340, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 340, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 342, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 342, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 347, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 347, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 347, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 347, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 347, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 347, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 347, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 347, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 347, -2 }, /* (118) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 347, -2 }, /* (119) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 344, -1 }, /* (120) integer_list ::= NK_INTEGER */ - { 344, -3 }, /* (121) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 345, -1 }, /* (122) variable_list ::= NK_VARIABLE */ - { 345, -3 }, /* (123) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 346, -1 }, /* (124) retention_list ::= retention */ - { 346, -3 }, /* (125) retention_list ::= retention_list NK_COMMA retention */ - { 348, -3 }, /* (126) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 343, 0 }, /* (127) speed_opt ::= */ - { 343, -2 }, /* (128) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 324, -9 }, /* (129) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 324, -3 }, /* (130) cmd ::= CREATE TABLE multi_create_clause */ - { 324, -9 }, /* (131) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 324, -3 }, /* (132) cmd ::= DROP TABLE multi_drop_clause */ - { 324, -4 }, /* (133) cmd ::= DROP STABLE exists_opt full_table_name */ - { 324, -3 }, /* (134) cmd ::= ALTER TABLE alter_table_clause */ - { 324, -3 }, /* (135) cmd ::= ALTER STABLE alter_table_clause */ - { 356, -2 }, /* (136) alter_table_clause ::= full_table_name alter_table_options */ - { 356, -5 }, /* (137) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 356, -4 }, /* (138) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 356, -5 }, /* (139) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 356, -5 }, /* (140) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 356, -5 }, /* (141) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 356, -4 }, /* (142) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 356, -5 }, /* (143) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 356, -5 }, /* (144) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 356, -6 }, /* (145) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 353, -1 }, /* (146) multi_create_clause ::= create_subtable_clause */ - { 353, -2 }, /* (147) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 361, -10 }, /* (148) 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 }, /* (149) multi_drop_clause ::= drop_table_clause */ - { 355, -2 }, /* (150) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 364, -2 }, /* (151) drop_table_clause ::= exists_opt full_table_name */ - { 362, 0 }, /* (152) specific_cols_opt ::= */ - { 362, -3 }, /* (153) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 349, -1 }, /* (154) full_table_name ::= table_name */ - { 349, -3 }, /* (155) full_table_name ::= db_name NK_DOT table_name */ - { 350, -1 }, /* (156) column_def_list ::= column_def */ - { 350, -3 }, /* (157) column_def_list ::= column_def_list NK_COMMA column_def */ - { 367, -2 }, /* (158) column_def ::= column_name type_name */ - { 367, -4 }, /* (159) column_def ::= column_name type_name COMMENT NK_STRING */ - { 359, -1 }, /* (160) type_name ::= BOOL */ - { 359, -1 }, /* (161) type_name ::= TINYINT */ - { 359, -1 }, /* (162) type_name ::= SMALLINT */ - { 359, -1 }, /* (163) type_name ::= INT */ - { 359, -1 }, /* (164) type_name ::= INTEGER */ - { 359, -1 }, /* (165) type_name ::= BIGINT */ - { 359, -1 }, /* (166) type_name ::= FLOAT */ - { 359, -1 }, /* (167) type_name ::= DOUBLE */ - { 359, -4 }, /* (168) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 359, -1 }, /* (169) type_name ::= TIMESTAMP */ - { 359, -4 }, /* (170) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 359, -2 }, /* (171) type_name ::= TINYINT UNSIGNED */ - { 359, -2 }, /* (172) type_name ::= SMALLINT UNSIGNED */ - { 359, -2 }, /* (173) type_name ::= INT UNSIGNED */ - { 359, -2 }, /* (174) type_name ::= BIGINT UNSIGNED */ - { 359, -1 }, /* (175) type_name ::= JSON */ - { 359, -4 }, /* (176) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 359, -1 }, /* (177) type_name ::= MEDIUMBLOB */ - { 359, -1 }, /* (178) type_name ::= BLOB */ - { 359, -4 }, /* (179) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 359, -1 }, /* (180) type_name ::= DECIMAL */ - { 359, -4 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 359, -6 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 351, 0 }, /* (183) tags_def_opt ::= */ - { 351, -1 }, /* (184) tags_def_opt ::= tags_def */ - { 354, -4 }, /* (185) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 352, 0 }, /* (186) table_options ::= */ - { 352, -3 }, /* (187) table_options ::= table_options COMMENT NK_STRING */ - { 352, -3 }, /* (188) table_options ::= table_options MAX_DELAY duration_list */ - { 352, -3 }, /* (189) table_options ::= table_options WATERMARK duration_list */ - { 352, -5 }, /* (190) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 352, -3 }, /* (191) table_options ::= table_options TTL NK_INTEGER */ - { 352, -5 }, /* (192) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 352, -3 }, /* (193) table_options ::= table_options DELETE_MARK duration_list */ - { 357, -1 }, /* (194) alter_table_options ::= alter_table_option */ - { 357, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ - { 370, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ - { 370, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ - { 368, -1 }, /* (198) duration_list ::= duration_literal */ - { 368, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ - { 369, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ - { 369, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 372, -1 }, /* (202) rollup_func_name ::= function_name */ - { 372, -1 }, /* (203) rollup_func_name ::= FIRST */ - { 372, -1 }, /* (204) rollup_func_name ::= LAST */ - { 365, -1 }, /* (205) col_name_list ::= col_name */ - { 365, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ - { 374, -1 }, /* (207) col_name ::= column_name */ - { 324, -2 }, /* (208) cmd ::= SHOW DNODES */ - { 324, -2 }, /* (209) cmd ::= SHOW USERS */ - { 324, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ - { 324, -2 }, /* (211) cmd ::= SHOW DATABASES */ - { 324, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 324, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 324, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 324, -2 }, /* (215) cmd ::= SHOW MNODES */ - { 324, -2 }, /* (216) cmd ::= SHOW QNODES */ - { 324, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ - { 324, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 324, -2 }, /* (219) cmd ::= SHOW STREAMS */ - { 324, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ - { 324, -2 }, /* (221) cmd ::= SHOW APPS */ - { 324, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ - { 324, -2 }, /* (223) cmd ::= SHOW LICENCES */ - { 324, -2 }, /* (224) cmd ::= SHOW GRANTS */ - { 324, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ - { 324, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ - { 324, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ - { 324, -2 }, /* (228) cmd ::= SHOW QUERIES */ - { 324, -2 }, /* (229) cmd ::= SHOW SCORES */ - { 324, -2 }, /* (230) cmd ::= SHOW TOPICS */ - { 324, -2 }, /* (231) cmd ::= SHOW VARIABLES */ - { 324, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ - { 324, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ - { 324, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 324, -2 }, /* (235) cmd ::= SHOW BNODES */ - { 324, -2 }, /* (236) cmd ::= SHOW SNODES */ - { 324, -2 }, /* (237) cmd ::= SHOW CLUSTER */ - { 324, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ - { 324, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 324, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ - { 324, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ - { 324, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 324, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 324, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ - { 324, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ - { 375, 0 }, /* (246) db_name_cond_opt ::= */ - { 375, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ - { 376, 0 }, /* (248) like_pattern_opt ::= */ - { 376, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ - { 377, -1 }, /* (250) table_name_cond ::= table_name */ - { 378, 0 }, /* (251) from_db_opt ::= */ - { 378, -2 }, /* (252) from_db_opt ::= FROM db_name */ - { 379, 0 }, /* (253) tag_list_opt ::= */ - { 379, -1 }, /* (254) tag_list_opt ::= tag_item */ - { 379, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 380, -1 }, /* (256) tag_item ::= TBNAME */ - { 380, -1 }, /* (257) tag_item ::= QTAGS */ - { 380, -1 }, /* (258) tag_item ::= column_name */ - { 380, -2 }, /* (259) tag_item ::= column_name column_alias */ - { 380, -3 }, /* (260) tag_item ::= column_name AS column_alias */ - { 324, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 324, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ - { 382, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 382, -12 }, /* (264) 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 }, /* (265) func_list ::= func */ - { 383, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ - { 386, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ - { 385, 0 }, /* (268) sma_stream_opt ::= */ - { 385, -3 }, /* (269) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - { 385, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - { 385, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - { 324, -6 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 324, -7 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 324, -9 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 324, -7 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 324, -9 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 324, -4 }, /* (277) cmd ::= DROP TOPIC exists_opt topic_name */ - { 324, -7 }, /* (278) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 324, -2 }, /* (279) cmd ::= DESC full_table_name */ - { 324, -2 }, /* (280) cmd ::= DESCRIBE full_table_name */ - { 324, -3 }, /* (281) cmd ::= RESET QUERY CACHE */ - { 324, -4 }, /* (282) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 389, 0 }, /* (283) analyze_opt ::= */ - { 389, -1 }, /* (284) analyze_opt ::= ANALYZE */ - { 390, 0 }, /* (285) explain_options ::= */ - { 390, -3 }, /* (286) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 390, -3 }, /* (287) explain_options ::= explain_options RATIO NK_FLOAT */ - { 324, -10 }, /* (288) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 324, -4 }, /* (289) cmd ::= DROP FUNCTION exists_opt function_name */ - { 391, 0 }, /* (290) agg_func_opt ::= */ - { 391, -1 }, /* (291) agg_func_opt ::= AGGREGATE */ - { 392, 0 }, /* (292) bufsize_opt ::= */ - { 392, -2 }, /* (293) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 324, -11 }, /* (294) 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 }, /* (295) cmd ::= DROP STREAM exists_opt stream_name */ - { 394, 0 }, /* (296) stream_options ::= */ - { 394, -3 }, /* (297) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 394, -3 }, /* (298) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 394, -4 }, /* (299) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 394, -3 }, /* (300) stream_options ::= stream_options WATERMARK duration_literal */ - { 394, -4 }, /* (301) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 394, -3 }, /* (302) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 395, 0 }, /* (303) subtable_opt ::= */ - { 395, -4 }, /* (304) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 324, -3 }, /* (305) cmd ::= KILL CONNECTION NK_INTEGER */ - { 324, -3 }, /* (306) cmd ::= KILL QUERY NK_STRING */ - { 324, -3 }, /* (307) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 324, -2 }, /* (308) cmd ::= BALANCE VGROUP */ - { 324, -4 }, /* (309) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 324, -4 }, /* (310) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 324, -3 }, /* (311) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 397, -2 }, /* (312) dnode_list ::= DNODE NK_INTEGER */ - { 397, -3 }, /* (313) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 324, -4 }, /* (314) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 324, -1 }, /* (315) cmd ::= query_or_subquery */ - { 324, -7 }, /* (316) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 324, -4 }, /* (317) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 327, -1 }, /* (318) literal ::= NK_INTEGER */ - { 327, -1 }, /* (319) literal ::= NK_FLOAT */ - { 327, -1 }, /* (320) literal ::= NK_STRING */ - { 327, -1 }, /* (321) literal ::= NK_BOOL */ - { 327, -2 }, /* (322) literal ::= TIMESTAMP NK_STRING */ - { 327, -1 }, /* (323) literal ::= duration_literal */ - { 327, -1 }, /* (324) literal ::= NULL */ - { 327, -1 }, /* (325) literal ::= NK_QUESTION */ - { 371, -1 }, /* (326) duration_literal ::= NK_VARIABLE */ - { 399, -1 }, /* (327) signed ::= NK_INTEGER */ - { 399, -2 }, /* (328) signed ::= NK_PLUS NK_INTEGER */ - { 399, -2 }, /* (329) signed ::= NK_MINUS NK_INTEGER */ - { 399, -1 }, /* (330) signed ::= NK_FLOAT */ - { 399, -2 }, /* (331) signed ::= NK_PLUS NK_FLOAT */ - { 399, -2 }, /* (332) signed ::= NK_MINUS NK_FLOAT */ - { 360, -1 }, /* (333) signed_literal ::= signed */ - { 360, -1 }, /* (334) signed_literal ::= NK_STRING */ - { 360, -1 }, /* (335) signed_literal ::= NK_BOOL */ - { 360, -2 }, /* (336) signed_literal ::= TIMESTAMP NK_STRING */ - { 360, -1 }, /* (337) signed_literal ::= duration_literal */ - { 360, -1 }, /* (338) signed_literal ::= NULL */ - { 360, -1 }, /* (339) signed_literal ::= literal_func */ - { 360, -1 }, /* (340) signed_literal ::= NK_QUESTION */ - { 401, -1 }, /* (341) literal_list ::= signed_literal */ - { 401, -3 }, /* (342) literal_list ::= literal_list NK_COMMA signed_literal */ - { 335, -1 }, /* (343) db_name ::= NK_ID */ - { 366, -1 }, /* (344) table_name ::= NK_ID */ - { 358, -1 }, /* (345) column_name ::= NK_ID */ - { 373, -1 }, /* (346) function_name ::= NK_ID */ - { 402, -1 }, /* (347) table_alias ::= NK_ID */ - { 381, -1 }, /* (348) column_alias ::= NK_ID */ - { 329, -1 }, /* (349) user_name ::= NK_ID */ - { 336, -1 }, /* (350) topic_name ::= NK_ID */ - { 393, -1 }, /* (351) stream_name ::= NK_ID */ - { 388, -1 }, /* (352) cgroup_name ::= NK_ID */ - { 403, -1 }, /* (353) expr_or_subquery ::= expression */ - { 396, -1 }, /* (354) expression ::= literal */ - { 396, -1 }, /* (355) expression ::= pseudo_column */ - { 396, -1 }, /* (356) expression ::= column_reference */ - { 396, -1 }, /* (357) expression ::= function_expression */ - { 396, -1 }, /* (358) expression ::= case_when_expression */ - { 396, -3 }, /* (359) expression ::= NK_LP expression NK_RP */ - { 396, -2 }, /* (360) expression ::= NK_PLUS expr_or_subquery */ - { 396, -2 }, /* (361) expression ::= NK_MINUS expr_or_subquery */ - { 396, -3 }, /* (362) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 396, -3 }, /* (363) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 396, -3 }, /* (364) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 396, -3 }, /* (365) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 396, -3 }, /* (366) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 396, -3 }, /* (367) expression ::= column_reference NK_ARROW NK_STRING */ - { 396, -3 }, /* (368) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 396, -3 }, /* (369) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 363, -1 }, /* (370) expression_list ::= expr_or_subquery */ - { 363, -3 }, /* (371) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 405, -1 }, /* (372) column_reference ::= column_name */ - { 405, -3 }, /* (373) column_reference ::= table_name NK_DOT column_name */ - { 404, -1 }, /* (374) pseudo_column ::= ROWTS */ - { 404, -1 }, /* (375) pseudo_column ::= TBNAME */ - { 404, -3 }, /* (376) pseudo_column ::= table_name NK_DOT TBNAME */ - { 404, -1 }, /* (377) pseudo_column ::= QSTART */ - { 404, -1 }, /* (378) pseudo_column ::= QEND */ - { 404, -1 }, /* (379) pseudo_column ::= QDURATION */ - { 404, -1 }, /* (380) pseudo_column ::= WSTART */ - { 404, -1 }, /* (381) pseudo_column ::= WEND */ - { 404, -1 }, /* (382) pseudo_column ::= WDURATION */ - { 404, -1 }, /* (383) pseudo_column ::= IROWTS */ - { 404, -1 }, /* (384) pseudo_column ::= QTAGS */ - { 406, -4 }, /* (385) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 406, -4 }, /* (386) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 406, -6 }, /* (387) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 406, -1 }, /* (388) function_expression ::= literal_func */ - { 400, -3 }, /* (389) literal_func ::= noarg_func NK_LP NK_RP */ - { 400, -1 }, /* (390) literal_func ::= NOW */ - { 410, -1 }, /* (391) noarg_func ::= NOW */ - { 410, -1 }, /* (392) noarg_func ::= TODAY */ - { 410, -1 }, /* (393) noarg_func ::= TIMEZONE */ - { 410, -1 }, /* (394) noarg_func ::= DATABASE */ - { 410, -1 }, /* (395) noarg_func ::= CLIENT_VERSION */ - { 410, -1 }, /* (396) noarg_func ::= SERVER_VERSION */ - { 410, -1 }, /* (397) noarg_func ::= SERVER_STATUS */ - { 410, -1 }, /* (398) noarg_func ::= CURRENT_USER */ - { 410, -1 }, /* (399) noarg_func ::= USER */ - { 408, -1 }, /* (400) star_func ::= COUNT */ - { 408, -1 }, /* (401) star_func ::= FIRST */ - { 408, -1 }, /* (402) star_func ::= LAST */ - { 408, -1 }, /* (403) star_func ::= LAST_ROW */ - { 409, -1 }, /* (404) star_func_para_list ::= NK_STAR */ - { 409, -1 }, /* (405) star_func_para_list ::= other_para_list */ - { 411, -1 }, /* (406) other_para_list ::= star_func_para */ - { 411, -3 }, /* (407) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 412, -1 }, /* (408) star_func_para ::= expr_or_subquery */ - { 412, -3 }, /* (409) star_func_para ::= table_name NK_DOT NK_STAR */ - { 407, -4 }, /* (410) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 407, -5 }, /* (411) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 413, -1 }, /* (412) when_then_list ::= when_then_expr */ - { 413, -2 }, /* (413) when_then_list ::= when_then_list when_then_expr */ - { 416, -4 }, /* (414) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 414, 0 }, /* (415) case_when_else_opt ::= */ - { 414, -2 }, /* (416) case_when_else_opt ::= ELSE common_expression */ - { 417, -3 }, /* (417) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 417, -5 }, /* (418) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 417, -6 }, /* (419) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 417, -3 }, /* (420) predicate ::= expr_or_subquery IS NULL */ - { 417, -4 }, /* (421) predicate ::= expr_or_subquery IS NOT NULL */ - { 417, -3 }, /* (422) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 418, -1 }, /* (423) compare_op ::= NK_LT */ - { 418, -1 }, /* (424) compare_op ::= NK_GT */ - { 418, -1 }, /* (425) compare_op ::= NK_LE */ - { 418, -1 }, /* (426) compare_op ::= NK_GE */ - { 418, -1 }, /* (427) compare_op ::= NK_NE */ - { 418, -1 }, /* (428) compare_op ::= NK_EQ */ - { 418, -1 }, /* (429) compare_op ::= LIKE */ - { 418, -2 }, /* (430) compare_op ::= NOT LIKE */ - { 418, -1 }, /* (431) compare_op ::= MATCH */ - { 418, -1 }, /* (432) compare_op ::= NMATCH */ - { 418, -1 }, /* (433) compare_op ::= CONTAINS */ - { 419, -1 }, /* (434) in_op ::= IN */ - { 419, -2 }, /* (435) in_op ::= NOT IN */ - { 420, -3 }, /* (436) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 421, -1 }, /* (437) boolean_value_expression ::= boolean_primary */ - { 421, -2 }, /* (438) boolean_value_expression ::= NOT boolean_primary */ - { 421, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 421, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 422, -1 }, /* (441) boolean_primary ::= predicate */ - { 422, -3 }, /* (442) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 415, -1 }, /* (443) common_expression ::= expr_or_subquery */ - { 415, -1 }, /* (444) common_expression ::= boolean_value_expression */ - { 423, 0 }, /* (445) from_clause_opt ::= */ - { 423, -2 }, /* (446) from_clause_opt ::= FROM table_reference_list */ - { 424, -1 }, /* (447) table_reference_list ::= table_reference */ - { 424, -3 }, /* (448) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 425, -1 }, /* (449) table_reference ::= table_primary */ - { 425, -1 }, /* (450) table_reference ::= joined_table */ - { 426, -2 }, /* (451) table_primary ::= table_name alias_opt */ - { 426, -4 }, /* (452) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 426, -2 }, /* (453) table_primary ::= subquery alias_opt */ - { 426, -1 }, /* (454) table_primary ::= parenthesized_joined_table */ - { 428, 0 }, /* (455) alias_opt ::= */ - { 428, -1 }, /* (456) alias_opt ::= table_alias */ - { 428, -2 }, /* (457) alias_opt ::= AS table_alias */ - { 430, -3 }, /* (458) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 430, -3 }, /* (459) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 427, -6 }, /* (460) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 431, 0 }, /* (461) join_type ::= */ - { 431, -1 }, /* (462) join_type ::= INNER */ - { 433, -12 }, /* (463) 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 }, /* (464) set_quantifier_opt ::= */ - { 434, -1 }, /* (465) set_quantifier_opt ::= DISTINCT */ - { 434, -1 }, /* (466) set_quantifier_opt ::= ALL */ - { 435, -1 }, /* (467) select_list ::= select_item */ - { 435, -3 }, /* (468) select_list ::= select_list NK_COMMA select_item */ - { 443, -1 }, /* (469) select_item ::= NK_STAR */ - { 443, -1 }, /* (470) select_item ::= common_expression */ - { 443, -2 }, /* (471) select_item ::= common_expression column_alias */ - { 443, -3 }, /* (472) select_item ::= common_expression AS column_alias */ - { 443, -3 }, /* (473) select_item ::= table_name NK_DOT NK_STAR */ - { 398, 0 }, /* (474) where_clause_opt ::= */ - { 398, -2 }, /* (475) where_clause_opt ::= WHERE search_condition */ - { 436, 0 }, /* (476) partition_by_clause_opt ::= */ - { 436, -3 }, /* (477) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 444, -1 }, /* (478) partition_list ::= partition_item */ - { 444, -3 }, /* (479) partition_list ::= partition_list NK_COMMA partition_item */ - { 445, -1 }, /* (480) partition_item ::= expr_or_subquery */ - { 445, -2 }, /* (481) partition_item ::= expr_or_subquery column_alias */ - { 445, -3 }, /* (482) partition_item ::= expr_or_subquery AS column_alias */ - { 440, 0 }, /* (483) twindow_clause_opt ::= */ - { 440, -6 }, /* (484) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 440, -4 }, /* (485) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 440, -6 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 440, -8 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 440, -7 }, /* (488) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - { 384, 0 }, /* (489) sliding_opt ::= */ - { 384, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 439, 0 }, /* (491) fill_opt ::= */ - { 439, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 439, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 446, -1 }, /* (494) fill_mode ::= NONE */ - { 446, -1 }, /* (495) fill_mode ::= PREV */ - { 446, -1 }, /* (496) fill_mode ::= NULL */ - { 446, -1 }, /* (497) fill_mode ::= LINEAR */ - { 446, -1 }, /* (498) fill_mode ::= NEXT */ - { 441, 0 }, /* (499) group_by_clause_opt ::= */ - { 441, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ - { 447, -1 }, /* (501) group_by_list ::= expr_or_subquery */ - { 447, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 442, 0 }, /* (503) having_clause_opt ::= */ - { 442, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ - { 437, 0 }, /* (505) range_opt ::= */ - { 437, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 438, 0 }, /* (507) every_opt ::= */ - { 438, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 448, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 449, -1 }, /* (510) query_simple ::= query_specification */ - { 449, -1 }, /* (511) query_simple ::= union_query_expression */ - { 453, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 453, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 454, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ - { 454, -1 }, /* (515) query_simple_or_subquery ::= subquery */ - { 387, -1 }, /* (516) query_or_subquery ::= query_expression */ - { 387, -1 }, /* (517) query_or_subquery ::= subquery */ - { 450, 0 }, /* (518) order_by_clause_opt ::= */ - { 450, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 451, 0 }, /* (520) slimit_clause_opt ::= */ - { 451, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 451, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 451, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 452, 0 }, /* (524) limit_clause_opt ::= */ - { 452, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 452, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 452, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 429, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ - { 429, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ - { 432, -1 }, /* (530) search_condition ::= common_expression */ - { 455, -1 }, /* (531) sort_specification_list ::= sort_specification */ - { 455, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 456, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 457, 0 }, /* (534) ordering_specification_opt ::= */ - { 457, -1 }, /* (535) ordering_specification_opt ::= ASC */ - { 457, -1 }, /* (536) ordering_specification_opt ::= DESC */ - { 458, 0 }, /* (537) null_ordering_opt ::= */ - { 458, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ - { 458, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ + { 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 */ @@ -3703,7 +3777,7 @@ static YYACTIONTYPE yy_reduce( yymsp[-2].minor.yy317 = yylhsminor.yy317; break; case 42: /* priv_level ::= topic_name */ - case 456: /* alias_opt ::= table_alias */ yytestcase(yyruleno==456); + case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); { yylhsminor.yy317 = yymsp[0].minor.yy317; } yymsp[0].minor.yy317 = yylhsminor.yy317; break; @@ -3734,44 +3808,44 @@ 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 343: /* db_name ::= NK_ID */ yytestcase(yyruleno==343); - case 344: /* table_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* column_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* function_name ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* table_alias ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* column_alias ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* user_name ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* topic_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* stream_name ::= NK_ID */ yytestcase(yyruleno==351); - case 352: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==352); - case 391: /* noarg_func ::= NOW */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= TODAY */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==398); - case 399: /* noarg_func ::= USER */ yytestcase(yyruleno==399); - case 400: /* star_func ::= COUNT */ yytestcase(yyruleno==400); - case 401: /* star_func ::= FIRST */ yytestcase(yyruleno==401); - case 402: /* star_func ::= LAST */ yytestcase(yyruleno==402); - case 403: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==403); + 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 283: /* analyze_opt ::= */ yytestcase(yyruleno==283); - case 290: /* agg_func_opt ::= */ yytestcase(yyruleno==290); - case 464: /* set_quantifier_opt ::= */ yytestcase(yyruleno==464); + 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 284: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==284); - case 291: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==291); - case 465: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==465); + 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 */ @@ -3885,39 +3959,35 @@ static YYACTIONTYPE yy_reduce( { 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.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; - break; - case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ + 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 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 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 95: /* db_options ::= db_options RETENTIONS retention_list */ + 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 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ + 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 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 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 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 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 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 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 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; @@ -3925,11 +3995,11 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 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; @@ -3937,732 +4007,732 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 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 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 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 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 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 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + 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 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + 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 108: /* alter_db_options ::= alter_db_option */ + 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 109: /* alter_db_options ::= alter_db_options alter_db_option */ + 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 110: /* alter_db_option ::= BUFFER NK_INTEGER */ + 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 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ + 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 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ + 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 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 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 114: /* alter_db_option ::= KEEP integer_list */ - case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); + 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 116: /* alter_db_option ::= PAGES NK_INTEGER */ + 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 117: /* alter_db_option ::= REPLICA NK_INTEGER */ + 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 118: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 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 119: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 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 120: /* integer_list ::= NK_INTEGER */ + 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 121: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 313: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==313); + 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 122: /* variable_list ::= NK_VARIABLE */ + case 121: /* variable_list ::= NK_VARIABLE */ { yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy874 = yylhsminor.yy874; break; - case 123: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 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 124: /* retention_list ::= retention */ - case 146: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==146); - case 149: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==149); - case 156: /* column_def_list ::= column_def */ yytestcase(yyruleno==156); - case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); - case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); - case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); - case 265: /* func_list ::= func */ yytestcase(yyruleno==265); - case 341: /* literal_list ::= signed_literal */ yytestcase(yyruleno==341); - case 406: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==406); - case 412: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==412); - case 467: /* select_list ::= select_item */ yytestcase(yyruleno==467); - case 478: /* partition_list ::= partition_item */ yytestcase(yyruleno==478); - case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); + 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 125: /* retention_list ::= retention_list NK_COMMA retention */ - case 157: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==157); - case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); - case 342: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==342); - case 407: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==407); - case 468: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==468); - case 479: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==479); - case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); + 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 126: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 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 127: /* speed_opt ::= */ - case 292: /* bufsize_opt ::= */ yytestcase(yyruleno==292); + case 126: /* speed_opt ::= */ + case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); { yymsp[1].minor.yy856 = 0; } break; - case 128: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 293: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==293); + 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 129: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 131: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==131); + 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 130: /* cmd ::= CREATE TABLE multi_create_clause */ + case 129: /* cmd ::= CREATE TABLE multi_create_clause */ { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); } break; - case 132: /* cmd ::= DROP TABLE multi_drop_clause */ + case 131: /* cmd ::= DROP TABLE multi_drop_clause */ { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); } break; - case 133: /* cmd ::= DROP STABLE exists_opt full_table_name */ + case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */ { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } break; - case 134: /* cmd ::= ALTER TABLE alter_table_clause */ - case 315: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==315); + 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 135: /* cmd ::= ALTER STABLE alter_table_clause */ + case 134: /* cmd ::= ALTER STABLE alter_table_clause */ { pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy74); } break; - case 136: /* alter_table_clause ::= full_table_name alter_table_options */ + 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 137: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 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 138: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 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 139: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 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 140: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 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 141: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 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 142: /* alter_table_clause ::= full_table_name DROP TAG column_name */ + 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 143: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 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 144: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 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 145: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + 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 147: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 150: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==150); - case 413: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==413); + 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 148: /* 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 */ + 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 151: /* drop_table_clause ::= exists_opt full_table_name */ + 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 152: /* specific_cols_opt ::= */ - case 183: /* tags_def_opt ::= */ yytestcase(yyruleno==183); - case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); - case 476: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==476); - case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); - case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); + 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 153: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ { yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 154: /* full_table_name ::= table_name */ + 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 155: /* full_table_name ::= db_name NK_DOT table_name */ + 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 158: /* column_def ::= column_name type_name */ + 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 159: /* column_def ::= column_name type_name COMMENT NK_STRING */ + 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 160: /* type_name ::= BOOL */ + case 159: /* type_name ::= BOOL */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 161: /* type_name ::= TINYINT */ + case 160: /* type_name ::= TINYINT */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 162: /* type_name ::= SMALLINT */ + case 161: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 163: /* type_name ::= INT */ - case 164: /* type_name ::= INTEGER */ yytestcase(yyruleno==164); + case 162: /* type_name ::= INT */ + case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163); { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 165: /* type_name ::= BIGINT */ + case 164: /* type_name ::= BIGINT */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 166: /* type_name ::= FLOAT */ + case 165: /* type_name ::= FLOAT */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 167: /* type_name ::= DOUBLE */ + case 166: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 168: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 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 169: /* type_name ::= TIMESTAMP */ + case 168: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 170: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 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 171: /* type_name ::= TINYINT UNSIGNED */ + case 170: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 172: /* type_name ::= SMALLINT UNSIGNED */ + case 171: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 173: /* type_name ::= INT UNSIGNED */ + case 172: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 174: /* type_name ::= BIGINT UNSIGNED */ + case 173: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 175: /* type_name ::= JSON */ + case 174: /* type_name ::= JSON */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 176: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 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 177: /* type_name ::= MEDIUMBLOB */ + case 176: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 178: /* type_name ::= BLOB */ + case 177: /* type_name ::= BLOB */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 179: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 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 180: /* type_name ::= DECIMAL */ + case 179: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 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 184: /* tags_def_opt ::= tags_def */ - case 405: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==405); + 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 185: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ { yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; } break; - case 186: /* table_options ::= */ + case 185: /* table_options ::= */ { yymsp[1].minor.yy74 = createDefaultTableOptions(pCxt); } break; - case 187: /* table_options ::= table_options COMMENT NK_STRING */ + 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 188: /* table_options ::= table_options MAX_DELAY duration_list */ + 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 189: /* table_options ::= table_options WATERMARK duration_list */ + 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 190: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 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 191: /* table_options ::= table_options TTL NK_INTEGER */ + 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 192: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 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 193: /* table_options ::= table_options DELETE_MARK duration_list */ + 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 194: /* alter_table_options ::= alter_table_option */ + 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 195: /* alter_table_options ::= alter_table_options alter_table_option */ + 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 196: /* alter_table_option ::= COMMENT NK_STRING */ + 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 197: /* alter_table_option ::= TTL NK_INTEGER */ + 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 198: /* duration_list ::= duration_literal */ - case 370: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==370); + 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 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 371: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==371); + 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 202: /* rollup_func_name ::= function_name */ + case 201: /* rollup_func_name ::= function_name */ { yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy317, NULL); } yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 203: /* rollup_func_name ::= FIRST */ - case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); - case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); + 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 207: /* col_name ::= column_name */ - case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); + 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 208: /* cmd ::= SHOW DNODES */ + case 207: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 209: /* cmd ::= SHOW USERS */ + case 208: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 210: /* cmd ::= SHOW USER PRIVILEGES */ + case 209: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 211: /* cmd ::= SHOW DATABASES */ + case 210: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + 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 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 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 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + 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 215: /* cmd ::= SHOW MNODES */ + case 214: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 216: /* cmd ::= SHOW QNODES */ + case 215: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 217: /* cmd ::= SHOW FUNCTIONS */ + case 216: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 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 219: /* cmd ::= SHOW STREAMS */ + case 218: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 220: /* cmd ::= SHOW ACCOUNTS */ + case 219: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 221: /* cmd ::= SHOW APPS */ + case 220: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 222: /* cmd ::= SHOW CONNECTIONS */ + case 221: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 223: /* cmd ::= SHOW LICENCES */ - case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224); + case 222: /* cmd ::= SHOW LICENCES */ + case 223: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==223); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 224: /* cmd ::= SHOW CREATE DATABASE db_name */ { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } break; - case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ + 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 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ + 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 228: /* cmd ::= SHOW QUERIES */ + case 227: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 229: /* cmd ::= SHOW SCORES */ + case 228: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 230: /* cmd ::= SHOW TOPICS */ + case 229: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 231: /* cmd ::= SHOW VARIABLES */ - case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232); + 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 233: /* cmd ::= SHOW LOCAL VARIABLES */ + case 232: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 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 235: /* cmd ::= SHOW BNODES */ + case 234: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 236: /* cmd ::= SHOW SNODES */ + case 235: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 237: /* cmd ::= SHOW CLUSTER */ + case 236: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 238: /* cmd ::= SHOW TRANSACTIONS */ + case 237: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy74); } break; - case 240: /* cmd ::= SHOW CONSUMERS */ + case 239: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 241: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 240: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 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 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 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 244: /* 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 245: /* 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 246: /* db_name_cond_opt ::= */ - case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); + case 245: /* db_name_cond_opt ::= */ + case 250: /* from_db_opt ::= */ yytestcase(yyruleno==250); { yymsp[1].minor.yy74 = createDefaultDatabaseCondValue(pCxt); } break; - case 247: /* db_name_cond_opt ::= db_name NK_DOT */ + 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 248: /* like_pattern_opt ::= */ - case 303: /* subtable_opt ::= */ yytestcase(yyruleno==303); - case 415: /* case_when_else_opt ::= */ yytestcase(yyruleno==415); - case 445: /* from_clause_opt ::= */ yytestcase(yyruleno==445); - case 474: /* where_clause_opt ::= */ yytestcase(yyruleno==474); - case 483: /* twindow_clause_opt ::= */ yytestcase(yyruleno==483); - 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); + 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 249: /* like_pattern_opt ::= LIKE NK_STRING */ + case 248: /* like_pattern_opt ::= LIKE NK_STRING */ { yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 250: /* table_name_cond ::= table_name */ + case 249: /* table_name_cond ::= table_name */ { yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 252: /* from_db_opt ::= FROM db_name */ + case 251: /* from_db_opt ::= FROM db_name */ { yymsp[-1].minor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } break; - case 256: /* tag_item ::= TBNAME */ + 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 259: /* tag_item ::= column_name column_alias */ + 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 260: /* tag_item ::= column_name AS column_alias */ + 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 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + 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 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ + case 261: /* cmd ::= DROP INDEX exists_opt full_table_name */ { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } break; - case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 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 264: /* 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 */ + 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 267: /* func ::= function_name NK_LP expression_list NK_RP */ + 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 268: /* sma_stream_opt ::= */ - case 296: /* stream_options ::= */ yytestcase(yyruleno==296); + case 267: /* sma_stream_opt ::= */ + case 295: /* stream_options ::= */ yytestcase(yyruleno==295); { yymsp[1].minor.yy74 = createStreamOptions(pCxt); } break; - case 269: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - case 300: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==300); + 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 270: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 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 271: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 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 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 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 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + 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 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + 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 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + 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 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + 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 277: /* cmd ::= DROP TOPIC exists_opt topic_name */ + case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 278: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 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 279: /* cmd ::= DESC full_table_name */ - case 280: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==280); + 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 281: /* cmd ::= RESET QUERY CACHE */ + case 280: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 282: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 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 285: /* explain_options ::= */ + case 284: /* explain_options ::= */ { yymsp[1].minor.yy74 = createDefaultExplainOptions(pCxt); } break; - case 286: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + 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 287: /* explain_options ::= explain_options RATIO NK_FLOAT */ + 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 288: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + 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 289: /* cmd ::= DROP FUNCTION exists_opt function_name */ + case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 294: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + 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 295: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } break; - case 297: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + 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 298: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 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 299: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 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 301: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 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 302: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 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 304: /* 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); + 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 305: /* 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 306: /* cmd ::= KILL QUERY NK_STRING */ + case 305: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 307: /* 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 308: /* cmd ::= BALANCE VGROUP */ + case 307: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 309: /* 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 310: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); } break; - case 311: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 312: /* dnode_list ::= DNODE NK_INTEGER */ + 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 314: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + 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 316: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 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 317: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ + 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 318: /* literal ::= NK_INTEGER */ + 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 319: /* literal ::= NK_FLOAT */ + 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 320: /* literal ::= NK_STRING */ + 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 321: /* literal ::= NK_BOOL */ + 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 322: /* literal ::= TIMESTAMP NK_STRING */ + 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 323: /* literal ::= duration_literal */ - case 333: /* signed_literal ::= signed */ yytestcase(yyruleno==333); - case 353: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==353); - case 354: /* expression ::= literal */ yytestcase(yyruleno==354); - case 355: /* expression ::= pseudo_column */ yytestcase(yyruleno==355); - case 356: /* expression ::= column_reference */ yytestcase(yyruleno==356); - case 357: /* expression ::= function_expression */ yytestcase(yyruleno==357); - case 358: /* expression ::= case_when_expression */ yytestcase(yyruleno==358); - case 388: /* function_expression ::= literal_func */ yytestcase(yyruleno==388); - case 437: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==437); - case 441: /* boolean_primary ::= predicate */ yytestcase(yyruleno==441); - case 443: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==443); - case 444: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==444); - case 447: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==447); - case 449: /* table_reference ::= table_primary */ yytestcase(yyruleno==449); - case 450: /* table_reference ::= joined_table */ yytestcase(yyruleno==450); - case 454: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==454); - 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); + 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 324: /* literal ::= NULL */ + 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 325: /* literal ::= NK_QUESTION */ + 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 326: /* duration_literal ::= NK_VARIABLE */ + 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 327: /* signed ::= NK_INTEGER */ + 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 328: /* signed ::= NK_PLUS NK_INTEGER */ + case 327: /* signed ::= NK_PLUS NK_INTEGER */ { yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 329: /* 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; @@ -4670,14 +4740,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 330: /* signed ::= NK_FLOAT */ + 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 331: /* signed ::= NK_PLUS NK_FLOAT */ + case 330: /* signed ::= NK_PLUS NK_FLOAT */ { yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 332: /* 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; @@ -4685,57 +4755,57 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy74 = yylhsminor.yy74; break; - case 334: /* signed_literal ::= NK_STRING */ + 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 335: /* signed_literal ::= NK_BOOL */ + 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 336: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ { yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 337: /* signed_literal ::= duration_literal */ - case 339: /* signed_literal ::= literal_func */ yytestcase(yyruleno==339); - case 408: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==408); - case 470: /* select_item ::= common_expression */ yytestcase(yyruleno==470); - case 480: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==480); - 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); + 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 338: /* signed_literal ::= NULL */ + 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 340: /* signed_literal ::= NK_QUESTION */ + case 339: /* signed_literal ::= NK_QUESTION */ { yylhsminor.yy74 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 359: /* expression ::= NK_LP expression NK_RP */ - case 442: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==442); - case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); + 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 360: /* expression ::= NK_PLUS expr_or_subquery */ + case 359: /* expression ::= NK_PLUS expr_or_subquery */ { 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.yy74 = yylhsminor.yy74; break; - case 361: /* expression ::= NK_MINUS expr_or_subquery */ + case 360: /* expression ::= NK_MINUS expr_or_subquery */ { 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.yy74 = yylhsminor.yy74; break; - case 362: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4743,7 +4813,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 363: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4751,7 +4821,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 364: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4759,7 +4829,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 365: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4767,7 +4837,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 366: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4775,14 +4845,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 367: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ { 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.yy74 = yylhsminor.yy74; break; - case 368: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4790,7 +4860,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 369: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4798,70 +4868,70 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 372: /* column_reference ::= column_name */ + 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 373: /* column_reference ::= table_name NK_DOT column_name */ + 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 374: /* pseudo_column ::= ROWTS */ - case 375: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==375); - case 377: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= QEND */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WEND */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==383); - case 384: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==384); - case 390: /* literal_func ::= NOW */ yytestcase(yyruleno==390); + 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 376: /* pseudo_column ::= table_name NK_DOT TBNAME */ + 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 385: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 386: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==386); + 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 387: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 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 389: /* literal_func ::= noarg_func NK_LP NK_RP */ + 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 404: /* star_func_para_list ::= NK_STAR */ + 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 409: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 473: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==473); + 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 410: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 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 411: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 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 414: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + 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 416: /* case_when_else_opt ::= ELSE common_expression */ + case 415: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } break; - case 417: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 422: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==422); + 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4869,7 +4939,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 418: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4877,7 +4947,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy74 = yylhsminor.yy74; break; - case 419: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4885,71 +4955,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy74 = yylhsminor.yy74; break; - case 420: /* predicate ::= expr_or_subquery IS NULL */ + case 419: /* predicate ::= expr_or_subquery IS 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.yy74 = yylhsminor.yy74; break; - case 421: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 420: /* predicate ::= expr_or_subquery IS NOT 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.yy74 = yylhsminor.yy74; break; - case 423: /* compare_op ::= NK_LT */ + case 422: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 424: /* compare_op ::= NK_GT */ + case 423: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 425: /* compare_op ::= NK_LE */ + case 424: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 426: /* compare_op ::= NK_GE */ + case 425: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 427: /* compare_op ::= NK_NE */ + case 426: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 428: /* compare_op ::= NK_EQ */ + case 427: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 429: /* compare_op ::= LIKE */ + case 428: /* compare_op ::= LIKE */ { yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 430: /* compare_op ::= NOT LIKE */ + case 429: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 431: /* compare_op ::= MATCH */ + case 430: /* compare_op ::= MATCH */ { yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 432: /* compare_op ::= NMATCH */ + case 431: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 433: /* compare_op ::= CONTAINS */ + case 432: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 434: /* in_op ::= IN */ + case 433: /* in_op ::= IN */ { yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 435: /* in_op ::= NOT IN */ + case 434: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 436: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + 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 438: /* boolean_value_expression ::= NOT boolean_primary */ + case 437: /* boolean_value_expression ::= NOT boolean_primary */ { 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.yy74 = yylhsminor.yy74; break; - case 439: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4957,7 +5027,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 440: /* 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.yy74); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); @@ -4965,48 +5035,48 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy74 = yylhsminor.yy74; break; - case 446: /* from_clause_opt ::= FROM table_reference_list */ - case 475: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==475); - case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); + 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 448: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 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 451: /* table_primary ::= table_name alias_opt */ + 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 452: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + 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 453: /* table_primary ::= subquery alias_opt */ + 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 455: /* alias_opt ::= */ + case 454: /* alias_opt ::= */ { yymsp[1].minor.yy317 = nil_token; } break; - case 457: /* alias_opt ::= AS table_alias */ + case 456: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy317 = yymsp[0].minor.yy317; } break; - case 458: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 459: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==459); + 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 460: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 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 461: /* join_type ::= */ + case 460: /* join_type ::= */ { yymsp[1].minor.yy630 = JOIN_TYPE_INNER; } break; - case 462: /* join_type ::= INNER */ + case 461: /* join_type ::= INNER */ { yymsp[0].minor.yy630 = JOIN_TYPE_INNER; } break; - case 463: /* 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.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); @@ -5019,76 +5089,76 @@ static YYACTIONTYPE yy_reduce( yymsp[-11].minor.yy74 = addFillClause(pCxt, yymsp[-11].minor.yy74, yymsp[-3].minor.yy74); } break; - case 466: /* set_quantifier_opt ::= ALL */ + case 465: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy335 = false; } break; - case 469: /* select_item ::= NK_STAR */ + case 468: /* select_item ::= NK_STAR */ { yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy74 = yylhsminor.yy74; break; - case 471: /* select_item ::= common_expression column_alias */ - case 481: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==481); + 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 472: /* select_item ::= common_expression AS column_alias */ - case 482: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==482); + 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 477: /* 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); + 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 484: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + 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 485: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 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 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + 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 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + 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 488: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 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 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 491: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy74 = createFillNode(pCxt, yymsp[-1].minor.yy828, NULL); } break; - case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + 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 494: /* fill_mode ::= NONE */ + case 493: /* fill_mode ::= NONE */ { yymsp[0].minor.yy828 = FILL_MODE_NONE; } break; - case 495: /* fill_mode ::= PREV */ + case 494: /* fill_mode ::= PREV */ { yymsp[0].minor.yy828 = FILL_MODE_PREV; } break; - case 496: /* fill_mode ::= NULL */ + case 495: /* fill_mode ::= NULL */ { yymsp[0].minor.yy828 = FILL_MODE_NULL; } break; - case 497: /* fill_mode ::= LINEAR */ + case 496: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy828 = FILL_MODE_LINEAR; } break; - case 498: /* fill_mode ::= NEXT */ + case 497: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy828 = FILL_MODE_NEXT; } break; - case 501: /* group_by_list ::= expr_or_subquery */ + 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 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 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 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 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 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 508: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy74 = addOrderByClause(pCxt, yymsp[-3].minor.yy74, yymsp[-2].minor.yy874); yylhsminor.yy74 = addSlimitClause(pCxt, yylhsminor.yy74, yymsp[-1].minor.yy74); @@ -5096,50 +5166,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy74 = yylhsminor.yy74; break; - case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 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 */ + 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); + 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); + 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); + 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 */ + 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 */ + 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 ::= */ + case 533: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy326 = ORDER_ASC; } break; - case 535: /* ordering_specification_opt ::= ASC */ + case 534: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy326 = ORDER_ASC; } break; - case 536: /* ordering_specification_opt ::= DESC */ + case 535: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy326 = ORDER_DESC; } break; - case 537: /* null_ordering_opt ::= */ + case 536: /* null_ordering_opt ::= */ { yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } break; - case 538: /* null_ordering_opt ::= NULLS FIRST */ + case 537: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } break; - case 539: /* null_ordering_opt ::= NULLS LAST */ + case 538: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } break; default: 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/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 eb989d6957..e1abe84841 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -489,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 656d775ea4..4b9dde5059 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -281,6 +281,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 4cbba106ba..5361ba356f 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -174,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/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/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 ebcd6b9002..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; @@ -236,7 +242,10 @@ void shellRunSingleCommandWebsocketImp(char *command) { 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");