diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 80f6b8e9e7..1920d8da17 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -173,7 +173,7 @@ def pre_test_build_mac() { ''' sh ''' cd ${WK}/debug - cmake .. -DBUILD_TEST=true -DBUILD_HTTPS=false + cmake .. -DBUILD_TEST=true -DBUILD_HTTPS=false -DCMAKE_BUILD_TYPE=Release make -j10 ctest -j10 || exit 7 ''' diff --git a/cmake/cmake.define b/cmake/cmake.define index 7410c92525..542b4b4489 100644 --- a/cmake/cmake.define +++ b/cmake/cmake.define @@ -124,7 +124,9 @@ ELSE () ENDIF () INCLUDE(CheckCCompilerFlag) - IF (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")) + IF (TD_ARM_64 OR TD_ARM_32) + SET(COMPILER_SUPPORT_SSE42 false) + ELSEIF (("${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() diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 75679a8ff5..a47b3b0feb 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG 566540d + GIT_TAG f0c1753 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index c5fe95da58..0cc57d1246 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 b20c9d1 + GIT_TAG 261fcca SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index f0daf4b82a..30422ca20c 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -876,7 +876,8 @@ INTERP(expr) - The number of rows in the result set of `INTERP` is determined by the parameter `EVERY`. Starting from timestamp1, one interpolation is performed for every time interval specified `EVERY` parameter. The parameter `EVERY` must be an integer, with no quotes, with a time unit of: b(nanosecond), u(microsecond), a(millisecond)), s(second), m(minute), h(hour), d(day), or w(week). For example, `EVERY(500a)` will interpolate every 500 milliseconds. - Interpolation is performed based on `FILL` parameter. - `INTERP` can only be used to interpolate in single timeline. So it must be used with `partition by tbname` when it's used on a STable. -- Pseudo column `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4). +- Pseudocolumn `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4). +- Pseudocolumn `_isfilled` can be used along with `INTERP` to indicate whether the results are original records or data points generated by interpolation algorithm(support after version 3.0.2.1). ### LAST diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md index c47d2da0eb..e70e962668 100644 --- a/docs/en/12-taos-sql/14-stream.md +++ b/docs/en/12-taos-sql/14-stream.md @@ -108,7 +108,7 @@ SHOW STREAMS; When you create a stream, you can use the TRIGGER parameter to specify triggering conditions for it. -For non-windowed processing, triggering occurs in real time. For windowed processing, there are three methods of triggering: +For non-windowed processing, triggering occurs in real time. For windowed processing, there are three methods of triggering,the default value is AT_ONCE: 1. AT_ONCE: triggers on write diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md index 1bda4a118d..08e8df6252 100644 --- a/docs/en/12-taos-sql/24-show.md +++ b/docs/en/12-taos-sql/24-show.md @@ -178,6 +178,77 @@ SHOW TABLE DISTRIBUTED table_name; Shows how table data is distributed. +Examples: show table distributed d0\G; Display the block distribution of table `d0` in detailed format. + +*************************** 1.row *************************** +_block_dist: Total_Blocks=[5] Total_Size=[93.65 Kb] Average_size=[18.73 Kb] Compression_Ratio=[23.98 %] + +Total_Blocks : Table `d0` contains total 5 blocks +Total_Size: The total size of all the data blocks in table `d0` is 93.65 KB +Average_size: The average size of each block is 18.73 KB +Compression_Ratio: The data compression rate is 23.98% + +*************************** 2.row *************************** +_block_dist: Total_Rows=[20000] Inmem_Rows=[0] MinRows=[3616] MaxRows=[4096] Average_Rows=[4000] + +Total_Rows: Table `d0` contains 20,000 rows +Inmem_Rows: The rows still in memory, i.e. not committed in disk, is 0, i.e. none such rows +MinRows: The minimum number of rows in a block is 3,616 +MaxRows: The maximum number of rows in a block is 4,096B +Average_Rows: The average number of rows in a block is 4,000 + +*************************** 3.row *************************** +_block_dist: Total_Tables=[1] Total_Files=[2] + +Total_Tables: The number of child tables, 1 in this example +Total_Files: The number of files storing the table's data, 2 in this example + +*************************** 4.row *************************** +_block_dist: -------------------------------------------------------------------------------- +*************************** 5.row *************************** +_block_dist: 0100 | +*************************** 6.row *************************** +_block_dist: 0299 | +*************************** 7.row *************************** +_block_dist: 0498 | +*************************** 8.row *************************** +_block_dist: 0697 | +*************************** 9.row *************************** +_block_dist: 0896 | +*************************** 10.row *************************** +_block_dist: 1095 | +*************************** 11.row *************************** +_block_dist: 1294 | +*************************** 12.row *************************** +_block_dist: 1493 | +*************************** 13.row *************************** +_block_dist: 1692 | +*************************** 14.row *************************** +_block_dist: 1891 | +*************************** 15.row *************************** +_block_dist: 2090 | +*************************** 16.row *************************** +_block_dist: 2289 | +*************************** 17.row *************************** +_block_dist: 2488 | +*************************** 18.row *************************** +_block_dist: 2687 | +*************************** 19.row *************************** +_block_dist: 2886 | +*************************** 20.row *************************** +_block_dist: 3085 | +*************************** 21.row *************************** +_block_dist: 3284 | +*************************** 22.row *************************** +_block_dist: 3483 ||||||||||||||||| 1 (20.00%) +*************************** 23.row *************************** +_block_dist: 3682 | +*************************** 24.row *************************** +_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%) +Query OK, 24 row(s) in set (0.002444s) + + The above show the block distribution percentage according to the number of rows in each block. In the above example, `_block_dist: 3483 ||||||||||||||||| 1 (20.00%)` means there is one block whose rows is between 3,483 and 3,681. `_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%)` means there are 4 blocks whose rows is between 3,881 and 4,096. The number of blocks whose rows fall in other range is zero. + ## SHOW TAGS ```sql diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index e33970c407..bcfcaf9ffb 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://w import Release from "/components/ReleaseV3"; +## 3.0.2.1 + + + ## 3.0.2.0 diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md index f2212bb2d4..6013aacc35 100644 --- a/docs/en/28-releases/02-tools.md +++ b/docs/en/28-releases/02-tools.md @@ -10,6 +10,10 @@ For other historical version installers, please visit [here](https://www.taosdat import Release from "/components/ReleaseV3"; +## 2.3.3 + + + ## 2.3.2 diff --git a/docs/examples/go/sub/main.go b/docs/examples/go/sub/main.go index 7721eed134..3aa2fed729 100644 --- a/docs/examples/go/sub/main.go +++ b/docs/examples/go/sub/main.go @@ -24,7 +24,7 @@ func main() { if err != nil { panic(err) } - _, err = db.Exec("create topic if not exists example_tmq_topic with meta as DATABASE example_tmq") + _, err = db.Exec("create topic if not exists example_tmq_topic as DATABASE example_tmq") if err != nil { panic(err) } diff --git a/docs/zh/08-connector/05-schemaless-api.mdx b/docs/zh/08-connector/05-schemaless-api.mdx index f6d7e09212..8f0a9273b9 100644 --- a/docs/zh/08-connector/05-schemaless-api.mdx +++ b/docs/zh/08-connector/05-schemaless-api.mdx @@ -19,6 +19,7 @@ TDengine 提供了兼容 InfluxDB (v1) 和 OpenTSDB 行协议的 Schemaless API - `precision` TDengine 使用的时间精度 - `u` TDengine 用户名 - `p` TDengine 密码 +- `ttl` 自动创建的子表生命周期,以子表的第一条数据的 TTL 参数为准,不可更新。更多信息请参考[创建表文档](taos-sql/table/#创建表)的 TTL 参数 注意: 目前不支持 InfluxDB 的 token 验证方式,仅支持 Basic 验证和查询参数验证。 diff --git a/docs/zh/12-taos-sql/04-stable.md b/docs/zh/12-taos-sql/04-stable.md index bd32da68ae..c5933228de 100644 --- a/docs/zh/12-taos-sql/04-stable.md +++ b/docs/zh/12-taos-sql/04-stable.md @@ -139,10 +139,10 @@ alter_table_option: { - ADD COLUMN:添加列。 - DROP COLUMN:删除列。 -- MODIFY COLUMN:修改列定义,如果数据列的类型是可变长类型,那么可以使用此指令修改其宽度,只能改大,不能改小。 +- MODIFY COLUMN:修改列的宽度,数据列的类型必须是 nchar 和 binary,使用此指令可以修改其宽度,只能改大,不能改小。 - ADD TAG:给超级表添加一个标签。 - DROP TAG:删除超级表的一个标签。从超级表删除某个标签后,该超级表下的所有子表也会自动删除该标签。 -- MODIFY TAG:修改超级表的一个标签的定义。如果标签的类型是可变长类型,那么可以使用此指令修改其宽度,只能改大,不能改小。 +- MODIFY TAG:修改超级表的一个标签的列宽度。标签的类型只能是 nchar 和 binary,使用此指令可以修改其宽度,只能改大,不能改小。 - RENAME TAG:修改超级表的一个标签的名称。从超级表修改某个标签名后,该超级表下的所有子表也会自动更新该标签名。 ### 增加列 diff --git a/docs/zh/12-taos-sql/10-function.md b/docs/zh/12-taos-sql/10-function.md index afe90b8a93..cb99c83cc5 100644 --- a/docs/zh/12-taos-sql/10-function.md +++ b/docs/zh/12-taos-sql/10-function.md @@ -880,6 +880,7 @@ INTERP(expr) - INTERP 根据 FILL 字段来决定在每个符合输出条件的时刻如何进行插值。 - INTERP 只能在一个时间序列内进行插值,因此当作用于超级表时必须跟 partition by tbname 一起使用。 - INTERP 可以与伪列 _irowts 一起使用,返回插值点所对应的时间戳(3.0.1.4版本以后支持)。 +- INTERP 可以与伪列 _isfilled 一起使用,显示返回结果是否为原始记录或插值算法产生的数据(3.0.2.1版本以后支持)。 ### LAST diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md index a70d559a86..9e2fde526e 100644 --- a/docs/zh/12-taos-sql/14-stream.md +++ b/docs/zh/12-taos-sql/14-stream.md @@ -114,7 +114,7 @@ SELECT * from information_schema.`ins_streams`; 在创建流时,可以通过 TRIGGER 指令指定流式计算的触发模式。 -对于非窗口计算,流式计算的触发是实时的;对于窗口计算,目前提供 3 种触发模式: +对于非窗口计算,流式计算的触发是实时的;对于窗口计算,目前提供 3 种触发模式,默认为 AT_ONCE: 1. AT_ONCE:写入立即触发 diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md index 4bd1e52284..a65746e7f9 100644 --- a/docs/zh/12-taos-sql/24-show.md +++ b/docs/zh/12-taos-sql/24-show.md @@ -179,6 +179,75 @@ SHOW TABLE DISTRIBUTED table_name; 显示表的数据分布信息。 +示例说明: + +语句: show table distributed d0\G; 竖行显示表 d0 的 BLOCK 分布情况 + +*************************** 1.row *************************** + +_block_dist: Total_Blocks=[5] Total_Size=[93.65 Kb] Average_size=[18.73 Kb] Compression_Ratio=[23.98 %] + +Total_Blocks : 表d0 占用的 block 个数为 5 个 + +Total_Size. : 表 d0 所有 block 在文件中占用的大小为 93.65 KB + +Average_size: 平均每个 block 在文件中占用的空间大小为 18.73 KB + +Compression_Ratio: 数据压缩率为 23.98% + + +*************************** 2.row *************************** + +_block_dist: Total_Rows=[20000] Inmem_Rows=[0] MinRows=[3616] MaxRows=[4096] Average_Rows=[4000] + +Total_Rows: 统计表 d0 的所有行数 为20000 行 + +Inmem_Rows: 表示仍然还存放在内存中的行数,即没有落盘的行数,为 0行,表示没有 + +MinRows: BLOCK 中最小的行数,为 3616 行 + +MaxRows: BLOCK 中最大的行数,为 4096行 + +Average_Rows: BLOCK 中的平均行数,为4000 行 + + +*************************** 3.row *************************** + +_block_dist: Total_Tables=[1] Total_Files=[2] + +Total_Tables: 表示子表的个数,这里为1 + +Total_Files: 表数据保存在几个文件中,这里保存在 2 个文件中 + + +*************************** 5.row *************************** + +_block_dist: 0100 | + +*************************** 6.row *************************** + +_block_dist: 0299 | + +...... + +*************************** 22.row *************************** + +_block_dist: 3483 ||||||||||||||||| 1 (20.00%) + +*************************** 23.row *************************** + +_block_dist: 3682 | + +*************************** 24.row *************************** + +_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%) + +Query OK, 24 row(s) in set (0.002444s) + + + 上面是块中包含数据行数的块儿分布情况图,这里的 0100 0299 0498 … 表示的是每个块中包含的数据行数,上面的意思就是这个表的 5 个块,分布在 3483 ~3681 行的块有 1 个,占整个块的 20%,分布在 3881 ~ 4096(最大行数)的块数为 4 个,占整个块的 80%, 其它区域内分布块数为 0。 + + ## SHOW TAGS ```sql diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index 0ea34829a5..0fe6555162 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do import Release from "/components/ReleaseV3"; +## 3.0.2.1 + + + ## 3.0.2.0 diff --git a/docs/zh/28-releases/02-tools.md b/docs/zh/28-releases/02-tools.md index 6471826b50..331f6832c0 100644 --- a/docs/zh/28-releases/02-tools.md +++ b/docs/zh/28-releases/02-tools.md @@ -10,6 +10,10 @@ taosTools 各版本安装包下载链接如下: import Release from "/components/ReleaseV3"; +## 2.3.3 + + + ## 2.3.2 diff --git a/examples/c/asyncdemo.c b/examples/c/asyncdemo.c index 83d217769b..c86cd44354 100644 --- a/examples/c/asyncdemo.c +++ b/examples/c/asyncdemo.c @@ -35,7 +35,7 @@ int64_t st, et; typedef struct { int id; TAOS *taos; - char name[16]; + char name[32]; time_t timeStamp; int value; int rowsInserted; diff --git a/examples/c/tmq.c b/examples/c/tmq.c index 71e571d4dd..eb41ad039a 100644 --- a/examples/c/tmq.c +++ b/examples/c/tmq.c @@ -20,7 +20,7 @@ #include #include "taos.h" -static int running = 1; +static int running = 1; static int32_t msg_process(TAOS_RES* msg) { char buf[1024]; @@ -40,8 +40,8 @@ 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 precision = taos_result_precision(msg); + // int32_t* length = taos_fetch_lengths(msg); + int32_t precision = taos_result_precision(msg); rows++; taos_print_row(buf, row, fields, numOfFields); printf("precision: %d, row content: %s\n", precision, buf); @@ -62,14 +62,12 @@ static int32_t init_env() { 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)); - return -1; } taos_free_result(pRes); @@ -77,7 +75,7 @@ static int32_t init_env() { pRes = taos_query(pConn, "create database tmqdb precision 'ns'"); if (taos_errno(pRes) != 0) { printf("error in create tmqdb, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); @@ -87,7 +85,7 @@ static int32_t init_env() { pConn, "create table tmqdb.stb (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"); if (taos_errno(pRes) != 0) { printf("failed to create super table stb, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); @@ -96,28 +94,28 @@ static int32_t init_env() { pRes = taos_query(pConn, "create table tmqdb.ctb0 using tmqdb.stb tags(0, 'subtable0')"); if (taos_errno(pRes) != 0) { printf("failed to create super table ctb0, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "create table tmqdb.ctb1 using tmqdb.stb tags(1, 'subtable1')"); if (taos_errno(pRes) != 0) { printf("failed to create super table ctb1, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "create table tmqdb.ctb2 using tmqdb.stb tags(2, 'subtable2')"); if (taos_errno(pRes) != 0) { printf("failed to create super table ctb2, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "create table tmqdb.ctb3 using tmqdb.stb tags(3, 'subtable3')"); if (taos_errno(pRes) != 0) { printf("failed to create super table ctb3, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); @@ -126,33 +124,37 @@ static int32_t init_env() { pRes = taos_query(pConn, "insert into tmqdb.ctb0 values(now, 0, 0, 'a0')(now+1s, 0, 0, 'a00')"); if (taos_errno(pRes) != 0) { printf("failed to insert into ctb0, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "insert into tmqdb.ctb1 values(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11')"); if (taos_errno(pRes) != 0) { printf("failed to insert into ctb0, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "insert into tmqdb.ctb2 values(now, 2, 2, 'a1')(now+1s, 22, 22, 'a22')"); if (taos_errno(pRes) != 0) { printf("failed to insert into ctb0, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); pRes = taos_query(pConn, "insert into tmqdb.ctb3 values(now, 3, 3, 'a1')(now+1s, 33, 33, 'a33')"); if (taos_errno(pRes) != 0) { printf("failed to insert into ctb0, reason:%s\n", taos_errstr(pRes)); - return -1; + goto END; } taos_free_result(pRes); - taos_close(pConn); return 0; + +END: + taos_free_result(pRes); + taos_close(pConn); + return -1; } int32_t create_topic() { diff --git a/include/client/taos.h b/include/client/taos.h index 379363c51d..647f906d4f 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -59,6 +59,7 @@ typedef enum { TSDB_OPTION_TIMEZONE, TSDB_OPTION_CONFIGDIR, TSDB_OPTION_SHELL_ACTIVITY_TIMER, + TSDB_OPTION_USE_ADAPTER, TSDB_MAX_OPTIONS } TSDB_OPTION; @@ -218,7 +219,7 @@ DLL_EXPORT const void *taos_get_raw_block(TAOS_RES *res); DLL_EXPORT int taos_get_db_route_info(TAOS *taos, const char *db, TAOS_DB_ROUTE_INFO *dbInfo); DLL_EXPORT int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId); -DLL_EXPORT int taos_load_table_info(TAOS *taos, const char *tableNameList); +DLL_EXPORT int taos_load_table_info(TAOS *taos, const char *tableNameList); /* --------------------------schemaless INTERFACE------------------------------- */ @@ -229,13 +230,14 @@ DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len int precision); DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int64_t reqid); -DLL_EXPORT TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl); +DLL_EXPORT TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, + int32_t ttl); DLL_EXPORT TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, - int precision, int32_t ttl, int64_t reqid); + int precision, int32_t ttl, int64_t reqid); DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, - int precision, int32_t ttl); + int precision, int32_t ttl); DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, - int protocol, int precision, int32_t ttl, int64_t reqid); + int protocol, int precision, int32_t ttl, int64_t reqid); /* --------------------------TMQ INTERFACE------------------------------- */ @@ -308,7 +310,8 @@ DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res); DLL_EXPORT int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw); DLL_EXPORT int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw); DLL_EXPORT int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char *tbname); -DLL_EXPORT int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const char* tbname, TAOS_FIELD *fields, int numFields); +DLL_EXPORT int taos_write_raw_block_with_fields(TAOS *taos, int rows, char *pData, const char *tbname, + TAOS_FIELD *fields, int numFields); DLL_EXPORT void tmq_free_raw(tmq_raw_data raw); // Returning null means error. Returned result need to be freed by tmq_free_json_meta DLL_EXPORT char *tmq_get_json_meta(TAOS_RES *res); diff --git a/include/common/tcommon.h b/include/common/tcommon.h index 19bd511c1f..9ecbd2f839 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -195,7 +195,7 @@ typedef struct SDataBlockInfo { uint32_t capacity; SBlockID id; int16_t hasVarCol; - int16_t dataLoad; // denote if the data is loaded or not + 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 @@ -204,8 +204,9 @@ typedef struct SDataBlockInfo { STimeWindow calWin; // used for stream, do not serialize TSKEY watermark; // used for stream - char parTbName[TSDB_TABLE_NAME_LEN]; // used for stream partition - STag* pTag; // used for stream partition + char parTbName[TSDB_TABLE_NAME_LEN]; // used for stream partition + int32_t tagLen; + void* pTag; // used for stream partition } SDataBlockInfo; typedef struct SSDataBlock { @@ -239,22 +240,22 @@ typedef struct SVarColAttr { // pBlockAgg->numOfNull == info.rows, all data are null // pBlockAgg->numOfNull == 0, no data are null. typedef struct SColumnInfoData { - char* pData; // the corresponding block data in memory + char* pData; // the corresponding block data in memory union { char* nullbitmap; // bitmap, one bit for each item in the list SVarColAttr varmeta; }; - SColumnInfo info; // column info - bool hasNull; // if current column data has null value. + SColumnInfo info; // column info + bool hasNull; // if current column data has null value. } SColumnInfoData; typedef struct SQueryTableDataCond { uint64_t suid; - int32_t order; // desc|asc order to iterate the data block + int32_t order; // desc|asc order to iterate the data block int32_t numOfCols; SColumnInfo* colList; - int32_t* pSlotList; // the column output destation slot, and it may be null - int32_t type; // data block load type: + int32_t* pSlotList; // the column output destation slot, and it may be null + int32_t type; // data block load type: STimeWindow twindows; int64_t startVersion; int64_t endVersion; diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 92672311d0..9e8a139b31 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -101,6 +101,7 @@ extern int32_t tsRedirectPeriod; extern int32_t tsRedirectFactor; extern int32_t tsRedirectMaxPeriod; extern int32_t tsMaxRetryWaitTime; +extern bool tsUseAdapter; // client extern int32_t tsMinSlidingTime; diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 7533cfbb02..04970ccc34 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -16,329 +16,330 @@ #ifndef _TD_COMMON_TOKEN_H_ #define _TD_COMMON_TOKEN_H_ -#define TK_OR 1 -#define TK_AND 2 -#define TK_UNION 3 -#define TK_ALL 4 -#define TK_MINUS 5 -#define TK_EXCEPT 6 -#define TK_INTERSECT 7 -#define TK_NK_BITAND 8 -#define TK_NK_BITOR 9 -#define TK_NK_LSHIFT 10 -#define TK_NK_RSHIFT 11 -#define TK_NK_PLUS 12 -#define TK_NK_MINUS 13 -#define TK_NK_STAR 14 -#define TK_NK_SLASH 15 -#define TK_NK_REM 16 -#define TK_NK_CONCAT 17 -#define TK_CREATE 18 -#define TK_ACCOUNT 19 -#define TK_NK_ID 20 -#define TK_PASS 21 -#define TK_NK_STRING 22 -#define TK_ALTER 23 -#define TK_PPS 24 -#define TK_TSERIES 25 -#define TK_STORAGE 26 -#define TK_STREAMS 27 -#define TK_QTIME 28 -#define TK_DBS 29 -#define TK_USERS 30 -#define TK_CONNS 31 -#define TK_STATE 32 -#define TK_USER 33 -#define TK_ENABLE 34 -#define TK_NK_INTEGER 35 -#define TK_SYSINFO 36 -#define TK_DROP 37 -#define TK_GRANT 38 -#define TK_ON 39 -#define TK_TO 40 -#define TK_REVOKE 41 -#define TK_FROM 42 -#define TK_SUBSCRIBE 43 -#define TK_NK_COMMA 44 -#define TK_READ 45 -#define TK_WRITE 46 -#define TK_NK_DOT 47 -#define TK_DNODE 48 -#define TK_PORT 49 -#define TK_DNODES 50 -#define TK_NK_IPTOKEN 51 -#define TK_FORCE 52 -#define TK_LOCAL 53 -#define TK_QNODE 54 -#define TK_BNODE 55 -#define TK_SNODE 56 -#define TK_MNODE 57 -#define TK_DATABASE 58 -#define TK_USE 59 -#define TK_FLUSH 60 -#define TK_TRIM 61 -#define TK_IF 62 -#define TK_NOT 63 -#define TK_EXISTS 64 -#define TK_BUFFER 65 -#define TK_CACHEMODEL 66 -#define TK_CACHESIZE 67 -#define TK_COMP 68 -#define TK_DURATION 69 -#define TK_NK_VARIABLE 70 -#define TK_MAXROWS 71 -#define TK_MINROWS 72 -#define TK_KEEP 73 -#define TK_PAGES 74 -#define TK_PAGESIZE 75 -#define TK_TSDB_PAGESIZE 76 -#define TK_PRECISION 77 -#define TK_REPLICA 78 -#define TK_VGROUPS 79 -#define TK_SINGLE_STABLE 80 -#define TK_RETENTIONS 81 -#define TK_SCHEMALESS 82 -#define TK_WAL_LEVEL 83 -#define TK_WAL_FSYNC_PERIOD 84 -#define TK_WAL_RETENTION_PERIOD 85 -#define TK_WAL_RETENTION_SIZE 86 -#define TK_WAL_ROLL_PERIOD 87 -#define TK_WAL_SEGMENT_SIZE 88 -#define TK_STT_TRIGGER 89 -#define TK_TABLE_PREFIX 90 -#define TK_TABLE_SUFFIX 91 -#define TK_NK_COLON 92 -#define TK_MAX_SPEED 93 -#define TK_TABLE 94 -#define TK_NK_LP 95 -#define TK_NK_RP 96 -#define TK_STABLE 97 -#define TK_ADD 98 -#define TK_COLUMN 99 -#define TK_MODIFY 100 -#define TK_RENAME 101 -#define TK_TAG 102 -#define TK_SET 103 -#define TK_NK_EQ 104 -#define TK_USING 105 -#define TK_TAGS 106 -#define TK_COMMENT 107 -#define TK_BOOL 108 -#define TK_TINYINT 109 -#define TK_SMALLINT 110 -#define TK_INT 111 -#define TK_INTEGER 112 -#define TK_BIGINT 113 -#define TK_FLOAT 114 -#define TK_DOUBLE 115 -#define TK_BINARY 116 -#define TK_TIMESTAMP 117 -#define TK_NCHAR 118 -#define TK_UNSIGNED 119 -#define TK_JSON 120 -#define TK_VARCHAR 121 -#define TK_MEDIUMBLOB 122 -#define TK_BLOB 123 -#define TK_VARBINARY 124 -#define TK_DECIMAL 125 -#define TK_MAX_DELAY 126 -#define TK_WATERMARK 127 -#define TK_ROLLUP 128 -#define TK_TTL 129 -#define TK_SMA 130 -#define TK_DELETE_MARK 131 -#define TK_FIRST 132 -#define TK_LAST 133 -#define TK_SHOW 134 -#define TK_PRIVILEGES 135 -#define TK_DATABASES 136 -#define TK_TABLES 137 -#define TK_STABLES 138 -#define TK_MNODES 139 -#define TK_QNODES 140 -#define TK_FUNCTIONS 141 -#define TK_INDEXES 142 -#define TK_ACCOUNTS 143 -#define TK_APPS 144 -#define TK_CONNECTIONS 145 -#define TK_LICENCES 146 -#define TK_GRANTS 147 -#define TK_QUERIES 148 -#define TK_SCORES 149 -#define TK_TOPICS 150 -#define TK_VARIABLES 151 -#define TK_CLUSTER 152 -#define TK_BNODES 153 -#define TK_SNODES 154 -#define TK_TRANSACTIONS 155 -#define TK_DISTRIBUTED 156 -#define TK_CONSUMERS 157 -#define TK_SUBSCRIPTIONS 158 -#define TK_VNODES 159 -#define TK_LIKE 160 -#define TK_TBNAME 161 -#define TK_QTAGS 162 -#define TK_AS 163 -#define TK_INDEX 164 -#define TK_FUNCTION 165 -#define TK_INTERVAL 166 -#define TK_TOPIC 167 -#define TK_WITH 168 -#define TK_META 169 -#define TK_CONSUMER 170 -#define TK_GROUP 171 -#define TK_DESC 172 -#define TK_DESCRIBE 173 -#define TK_RESET 174 -#define TK_QUERY 175 -#define TK_CACHE 176 -#define TK_EXPLAIN 177 -#define TK_ANALYZE 178 -#define TK_VERBOSE 179 -#define TK_NK_BOOL 180 -#define TK_RATIO 181 -#define TK_NK_FLOAT 182 -#define TK_OUTPUTTYPE 183 -#define TK_AGGREGATE 184 -#define TK_BUFSIZE 185 -#define TK_STREAM 186 -#define TK_INTO 187 -#define TK_TRIGGER 188 -#define TK_AT_ONCE 189 -#define TK_WINDOW_CLOSE 190 -#define TK_IGNORE 191 -#define TK_EXPIRED 192 -#define TK_FILL_HISTORY 193 -#define TK_SUBTABLE 194 -#define TK_KILL 195 -#define TK_CONNECTION 196 -#define TK_TRANSACTION 197 -#define TK_BALANCE 198 -#define TK_VGROUP 199 -#define TK_MERGE 200 -#define TK_REDISTRIBUTE 201 -#define TK_SPLIT 202 -#define TK_DELETE 203 -#define TK_INSERT 204 -#define TK_NULL 205 -#define TK_NK_QUESTION 206 -#define TK_NK_ARROW 207 -#define TK_ROWTS 208 -#define TK_QSTART 209 -#define TK_QEND 210 -#define TK_QDURATION 211 -#define TK_WSTART 212 -#define TK_WEND 213 -#define TK_WDURATION 214 -#define TK_IROWTS 215 -#define TK_CAST 216 -#define TK_NOW 217 -#define TK_TODAY 218 -#define TK_TIMEZONE 219 -#define TK_CLIENT_VERSION 220 -#define TK_SERVER_VERSION 221 -#define TK_SERVER_STATUS 222 -#define TK_CURRENT_USER 223 -#define TK_COUNT 224 -#define TK_LAST_ROW 225 -#define TK_CASE 226 -#define TK_END 227 -#define TK_WHEN 228 -#define TK_THEN 229 -#define TK_ELSE 230 -#define TK_BETWEEN 231 -#define TK_IS 232 -#define TK_NK_LT 233 -#define TK_NK_GT 234 -#define TK_NK_LE 235 -#define TK_NK_GE 236 -#define TK_NK_NE 237 -#define TK_MATCH 238 -#define TK_NMATCH 239 -#define TK_CONTAINS 240 -#define TK_IN 241 -#define TK_JOIN 242 -#define TK_INNER 243 -#define TK_SELECT 244 -#define TK_DISTINCT 245 -#define TK_WHERE 246 -#define TK_PARTITION 247 -#define TK_BY 248 -#define TK_SESSION 249 -#define TK_STATE_WINDOW 250 -#define TK_EVENT_WINDOW 251 -#define TK_START 252 -#define TK_SLIDING 253 -#define TK_FILL 254 -#define TK_VALUE 255 -#define TK_NONE 256 -#define TK_PREV 257 -#define TK_LINEAR 258 -#define TK_NEXT 259 -#define TK_HAVING 260 -#define TK_RANGE 261 -#define TK_EVERY 262 -#define TK_ORDER 263 -#define TK_SLIMIT 264 -#define TK_SOFFSET 265 -#define TK_LIMIT 266 -#define TK_OFFSET 267 -#define TK_ASC 268 -#define TK_NULLS 269 -#define TK_ABORT 270 -#define TK_AFTER 271 -#define TK_ATTACH 272 -#define TK_BEFORE 273 -#define TK_BEGIN 274 -#define TK_BITAND 275 -#define TK_BITNOT 276 -#define TK_BITOR 277 -#define TK_BLOCKS 278 -#define TK_CHANGE 279 -#define TK_COMMA 280 -#define TK_COMPACT 281 -#define TK_CONCAT 282 -#define TK_CONFLICT 283 -#define TK_COPY 284 -#define TK_DEFERRED 285 -#define TK_DELIMITERS 286 -#define TK_DETACH 287 -#define TK_DIVIDE 288 -#define TK_DOT 289 -#define TK_EACH 290 -#define TK_FAIL 291 -#define TK_FILE 292 -#define TK_FOR 293 -#define TK_GLOB 294 -#define TK_ID 295 -#define TK_IMMEDIATE 296 -#define TK_IMPORT 297 -#define TK_INITIALLY 298 -#define TK_INSTEAD 299 -#define TK_ISNULL 300 -#define TK_KEY 301 -#define TK_MODULES 302 -#define TK_NK_BITNOT 303 -#define TK_NK_SEMI 304 -#define TK_NOTNULL 305 -#define TK_OF 306 -#define TK_PLUS 307 -#define TK_PRIVILEGE 308 -#define TK_RAISE 309 -#define TK_REPLACE 310 -#define TK_RESTRICT 311 -#define TK_ROW 312 -#define TK_SEMI 313 -#define TK_STAR 314 -#define TK_STATEMENT 315 -#define TK_STRICT 316 -#define TK_STRING 317 -#define TK_TIMES 318 -#define TK_UPDATE 319 -#define TK_VALUES 320 -#define TK_VARIABLE 321 -#define TK_VIEW 322 -#define TK_WAL 323 +#define TK_OR 1 +#define TK_AND 2 +#define TK_UNION 3 +#define TK_ALL 4 +#define TK_MINUS 5 +#define TK_EXCEPT 6 +#define TK_INTERSECT 7 +#define TK_NK_BITAND 8 +#define TK_NK_BITOR 9 +#define TK_NK_LSHIFT 10 +#define TK_NK_RSHIFT 11 +#define TK_NK_PLUS 12 +#define TK_NK_MINUS 13 +#define TK_NK_STAR 14 +#define TK_NK_SLASH 15 +#define TK_NK_REM 16 +#define TK_NK_CONCAT 17 +#define TK_CREATE 18 +#define TK_ACCOUNT 19 +#define TK_NK_ID 20 +#define TK_PASS 21 +#define TK_NK_STRING 22 +#define TK_ALTER 23 +#define TK_PPS 24 +#define TK_TSERIES 25 +#define TK_STORAGE 26 +#define TK_STREAMS 27 +#define TK_QTIME 28 +#define TK_DBS 29 +#define TK_USERS 30 +#define TK_CONNS 31 +#define TK_STATE 32 +#define TK_USER 33 +#define TK_ENABLE 34 +#define TK_NK_INTEGER 35 +#define TK_SYSINFO 36 +#define TK_DROP 37 +#define TK_GRANT 38 +#define TK_ON 39 +#define TK_TO 40 +#define TK_REVOKE 41 +#define TK_FROM 42 +#define TK_SUBSCRIBE 43 +#define TK_NK_COMMA 44 +#define TK_READ 45 +#define TK_WRITE 46 +#define TK_NK_DOT 47 +#define TK_DNODE 48 +#define TK_PORT 49 +#define TK_DNODES 50 +#define TK_NK_IPTOKEN 51 +#define TK_FORCE 52 +#define TK_LOCAL 53 +#define TK_QNODE 54 +#define TK_BNODE 55 +#define TK_SNODE 56 +#define TK_MNODE 57 +#define TK_DATABASE 58 +#define TK_USE 59 +#define TK_FLUSH 60 +#define TK_TRIM 61 +#define TK_IF 62 +#define TK_NOT 63 +#define TK_EXISTS 64 +#define TK_BUFFER 65 +#define TK_CACHEMODEL 66 +#define TK_CACHESIZE 67 +#define TK_COMP 68 +#define TK_DURATION 69 +#define TK_NK_VARIABLE 70 +#define TK_MAXROWS 71 +#define TK_MINROWS 72 +#define TK_KEEP 73 +#define TK_PAGES 74 +#define TK_PAGESIZE 75 +#define TK_TSDB_PAGESIZE 76 +#define TK_PRECISION 77 +#define TK_REPLICA 78 +#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_COUNT 167 +#define TK_LAST_ROW 168 +#define TK_TOPIC 169 +#define TK_WITH 170 +#define TK_META 171 +#define TK_CONSUMER 172 +#define TK_GROUP 173 +#define TK_DESC 174 +#define TK_DESCRIBE 175 +#define TK_RESET 176 +#define TK_QUERY 177 +#define TK_CACHE 178 +#define TK_EXPLAIN 179 +#define TK_ANALYZE 180 +#define TK_VERBOSE 181 +#define TK_NK_BOOL 182 +#define TK_RATIO 183 +#define TK_NK_FLOAT 184 +#define TK_OUTPUTTYPE 185 +#define TK_AGGREGATE 186 +#define TK_BUFSIZE 187 +#define TK_STREAM 188 +#define TK_INTO 189 +#define TK_TRIGGER 190 +#define TK_AT_ONCE 191 +#define TK_WINDOW_CLOSE 192 +#define TK_IGNORE 193 +#define TK_EXPIRED 194 +#define TK_FILL_HISTORY 195 +#define TK_SUBTABLE 196 +#define TK_KILL 197 +#define TK_CONNECTION 198 +#define TK_TRANSACTION 199 +#define TK_BALANCE 200 +#define TK_VGROUP 201 +#define TK_MERGE 202 +#define TK_REDISTRIBUTE 203 +#define TK_SPLIT 204 +#define TK_DELETE 205 +#define TK_INSERT 206 +#define TK_NULL 207 +#define TK_NK_QUESTION 208 +#define TK_NK_ARROW 209 +#define TK_ROWTS 210 +#define TK_QSTART 211 +#define TK_QEND 212 +#define TK_QDURATION 213 +#define TK_WSTART 214 +#define TK_WEND 215 +#define TK_WDURATION 216 +#define TK_IROWTS 217 +#define TK_ISFILLED 218 +#define TK_CAST 219 +#define TK_NOW 220 +#define TK_TODAY 221 +#define TK_TIMEZONE 222 +#define TK_CLIENT_VERSION 223 +#define TK_SERVER_VERSION 224 +#define TK_SERVER_STATUS 225 +#define TK_CURRENT_USER 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_STRICT 317 +#define TK_STRING 318 +#define TK_TIMES 319 +#define TK_UPDATE 320 +#define TK_VALUES 321 +#define TK_VARIABLE 322 +#define TK_VIEW 323 +#define TK_WAL 324 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/common/ttypes.h b/include/common/ttypes.h index 6350057c1f..d0f72fbfe5 100644 --- a/include/common/ttypes.h +++ b/include/common/ttypes.h @@ -266,6 +266,7 @@ typedef struct { #define IS_FLOAT_TYPE(_t) ((_t) == TSDB_DATA_TYPE_FLOAT || (_t) == TSDB_DATA_TYPE_DOUBLE) #define IS_INTEGER_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t))) #define IS_TIMESTAMP_TYPE(_t) ((_t) == TSDB_DATA_TYPE_TIMESTAMP) +#define IS_BOOLEAN_TYPE(_t) ((_t) == TSDB_DATA_TYPE_BOOL) #define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t))) #define IS_MATHABLE_TYPE(_t) \ diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index 9ca6a7a9fa..e98e341f15 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -120,6 +120,7 @@ typedef enum EFunctionType { FUNCTION_TYPE_WEND, FUNCTION_TYPE_WDURATION, FUNCTION_TYPE_IROWTS, + FUNCTION_TYPE_ISFILLED, FUNCTION_TYPE_TAGS, // internal function diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index b1054e7b85..66988ff135 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -171,10 +171,10 @@ typedef struct SCreateSubTableClause { STableOptions* pOptions; } SCreateSubTableClause; -typedef struct SCreateMultiTableStmt { +typedef struct SCreateMultiTablesStmt { ENodeType type; SNodeList* pSubTables; -} SCreateMultiTableStmt; +} SCreateMultiTablesStmt; typedef struct SDropTableClause { ENodeType type; @@ -209,14 +209,14 @@ typedef struct SAlterTableStmt { typedef struct SCreateUserStmt { ENodeType type; - char useName[TSDB_USER_LEN]; + char userName[TSDB_USER_LEN]; char password[TSDB_USET_PASSWORD_LEN]; int8_t sysinfo; } SCreateUserStmt; typedef struct SAlterUserStmt { ENodeType type; - char useName[TSDB_USER_LEN]; + char userName[TSDB_USER_LEN]; int8_t alterType; char password[TSDB_USET_PASSWORD_LEN]; int8_t enable; @@ -225,7 +225,7 @@ typedef struct SAlterUserStmt { typedef struct SDropUserStmt { ENodeType type; - char useName[TSDB_USER_LEN]; + char userName[TSDB_USER_LEN]; } SDropUserStmt; typedef struct SCreateDnodeStmt { diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index 1f266cd0ef..e111f36077 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -117,7 +117,7 @@ typedef enum ENodeType { // Statement nodes are used in parser and planner module. QUERY_NODE_SET_OPERATOR = 100, QUERY_NODE_SELECT_STMT, - QUERY_NODE_VNODE_MODIF_STMT, + QUERY_NODE_VNODE_MODIFY_STMT, QUERY_NODE_CREATE_DATABASE_STMT, QUERY_NODE_DROP_DATABASE_STMT, QUERY_NODE_ALTER_DATABASE_STMT, @@ -125,7 +125,7 @@ typedef enum ENodeType { QUERY_NODE_TRIM_DATABASE_STMT, QUERY_NODE_CREATE_TABLE_STMT, QUERY_NODE_CREATE_SUBTABLE_CLAUSE, - QUERY_NODE_CREATE_MULTI_TABLE_STMT, + QUERY_NODE_CREATE_MULTI_TABLES_STMT, QUERY_NODE_DROP_TABLE_CLAUSE, QUERY_NODE_DROP_TABLE_STMT, QUERY_NODE_DROP_SUPER_TABLE_STMT, diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index ec13dda5a4..3f0fc048de 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -364,7 +364,7 @@ typedef struct SVgDataBlocks { typedef void (*FFreeTableBlockHash)(SHashObj*); typedef void (*FFreeVgourpBlockArray)(SArray*); -typedef struct SVnodeModifOpStmt { +typedef struct SVnodeModifyOpStmt { ENodeType nodeType; ENodeType sqlNodeType; SArray* pDataBlocks; // data block for each vgroup, SArray. @@ -388,7 +388,7 @@ typedef struct SVnodeModifOpStmt { FFreeVgourpBlockArray freeArrayFunc; bool usingTableProcessing; bool fileProcessing; -} SVnodeModifOpStmt; +} SVnodeModifyOpStmt; typedef struct SExplainOptions { ENodeType type; diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h index 8fdac0da7f..d7bc151ecc 100644 --- a/include/libs/stream/streamState.h +++ b/include/libs/stream/streamState.h @@ -35,6 +35,7 @@ typedef struct STdbState { TTB* pFillStateDb; // todo refactor TTB* pSessionStateDb; TTB* pParNameDb; + TTB* pParTagDb; TXN* txn; } STdbState; @@ -108,6 +109,9 @@ int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char* tbname); int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal); +int32_t streamStatePutParTag(SStreamState* pState, int64_t groupId, const void* tag, int32_t tagLen); +int32_t streamStateGetParTag(SStreamState* pState, int64_t groupId, void** tagVal, int32_t* tagLen); + #if 0 char* streamStateSessionDump(SStreamState* pState); #endif diff --git a/packaging/release.sh b/packaging/release.sh index a3334e734d..7a8a08352f 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -3,7 +3,7 @@ # Generate the deb package for ubuntu, or rpm package for centos, or tar.gz package for other linux os set -e -#set -x +# set -x # release.sh -v [cluster | edge] # -c [aarch32 | aarch64 | x64 | x86 | mips64 | loongarch64...] @@ -96,6 +96,8 @@ while getopts "hv:V:c:o:l:s:d:a:n:m:H:" arg; do esac done +osType=$(uname) + echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode} soMode=${soMode} dbName=${dbName} allocator=${allocator} verNumber=${verNumber} verNumberComp=${verNumberComp} httpdBuild=${httpdBuild}" curr_dir=$(pwd) @@ -233,7 +235,12 @@ else exit 1 fi -CORES=$(grep -c ^processor /proc/cpuinfo) +ostype=`uname` +if [ "${ostype}" == "Darwin" ]; then + CORES=$(sysctl -n hw.ncpu) +else + CORES=$(grep -c ^processor /proc/cpuinfo) +fi if [[ "$allocator" == "jemalloc" ]]; then # jemalloc need compile first, so disable parallel build @@ -306,7 +313,7 @@ if [ "$osType" != "Darwin" ]; then ${csudo}./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} else - # only make client for Darwin cd ${script_dir}/tools + ./makepkg.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${verNumberComp} ${dbName} ./makeclient.sh ${compile_dir} ${verNumber} "${build_time}" ${cpuType} ${osType} ${verMode} ${verType} ${pagMode} ${dbName} fi diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index edec338c55..db28de8dec 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -2,7 +2,7 @@ # # Generate tar.gz package for linux client in all os system set -e -#set -x +# set -x curr_dir=$(pwd) compile_dir=$1 @@ -249,9 +249,9 @@ if [ "$osType" != "Darwin" ]; then tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : else tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) || : - mv "$(basename ${pkg_name}).tar.gz" .. - rm -rf ./* - mv ../"$(basename ${pkg_name}).tar.gz" . +# mv "$(basename ${pkg_name}).tar.gz" .. + rm -rf ${install_dir} ||: +# mv ../"$(basename ${pkg_name}).tar.gz" . fi cd ${curr_dir} diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index 4169bed3eb..f30a8a637e 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -3,7 +3,7 @@ # Generate tar.gz package for all os system set -e -#set -x +# set -x curr_dir=$(pwd) compile_dir=$1 @@ -74,14 +74,16 @@ else tdinsight_caches="" cd ${build_dir}/bin/ && \ chmod +x TDinsight.sh - tdinsight_caches=$(./TDinsight.sh --download-only | xargs -i printf "${build_dir}/bin/{} ") + ./TDinsight.sh --download-only ||: +# tdinsight_caches=$(./TDinsight.sh --download-only | xargs -I printf "${build_dir}/bin/{} ") cd $orig_pwd echo "TDinsight caches: $tdinsight_caches" taostools_bin_files=" ${build_dir}/bin/taosdump \ ${build_dir}/bin/taosBenchmark \ ${build_dir}/bin/TDinsight.sh \ - $tdinsight_caches" + ${build_dir}/bin/tdengine-datasource.zip \ + ${build_dir}/bin/tdengine-datasource.zip.md5sum" [ -f ${build_dir}/bin/taosx ] && taosx_bin="${build_dir}/bin/taosx" bin_files="${build_dir}/bin/${serverName} \ @@ -96,8 +98,13 @@ else ${script_dir}/taosd-dump-cfg.gdb" fi -lib_files="${build_dir}/lib/libtaos.so.${version}" -wslib_files="${build_dir}/lib/libtaosws.so" +if [ "$osType" == "Darwin" ]; then + lib_files="${build_dir}/lib/libtaos.${version}.dylib" + wslib_files="${build_dir}/lib/libtaosws.dylib" +else + lib_files="${build_dir}/lib/libtaos.so.${version}" + wslib_files="${build_dir}/lib/libtaosws.so" +fi header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/libs/function/taosudf.h" wsheader_files="${build_dir}/include/taosws.h" @@ -226,7 +233,12 @@ if [ "$verMode" == "cloud" ]; then fi cd ${install_dir} -tar -zcv -f ${tarName} * --remove-files || : +if [ "$osType" != "Darwin" ]; then + tar -zcv -f ${tarName} * --remove-files || : +else + tar -zcv -f ${tarName} * || : +fi + exitcode=$? if [ "$exitcode" != "0" ]; then echo "tar ${tarName} error !!!" @@ -288,7 +300,7 @@ if [[ $dbName == "taos" ]]; then if [ "$verMode" == "cluster" ] || [ "$verMode" == "cloud" ]; then if [ -d "${web_dir}/admin" ] ; then mkdir -p ${install_dir}/share/ - cp ${web_dir}/admin ${install_dir}/share/ -r + cp -Rfap ${web_dir}/admin ${install_dir}/share/ cp ${web_dir}/png/taos.png ${install_dir}/share/admin/images/taos.png else echo "directory not found for enterprise release: ${web_dir}/admin" @@ -362,7 +374,15 @@ if [ "$pagMode" == "lite" ]; then pkg_name=${pkg_name}-Lite fi -tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || : + +if [ "$osType" != "Darwin" ]; then + tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || : +else + tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" || : + rm -rf ${install_dir} ||: + ([ -d build-taoskeeper ] && rm -rf build-taoskeeper ) ||: +fi + exitcode=$? if [ "$exitcode" != "0" ]; then echo "tar ${pkg_name}.tar.gz error !!!" @@ -371,7 +391,12 @@ fi if [ -n "${taostools_bin_files}" ]; then wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh -O ${taostools_install_dir}/bin/TDinsight.sh && echo "TDinsight.sh downloaded!"|| echo "failed to download TDinsight.sh" - tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || : + if [ "$osType" != "Darwin" ]; then + tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || : + else + tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" || : + rm -rf ${taostools_install_dir} ||: + fi exitcode=$? if [ "$exitcode" != "0" ]; then echo "tar ${taostools_pkg_name}.tar.gz error !!!" diff --git a/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h b/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h index 3b728a3142..a88bf0f7a6 100644 --- a/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h +++ b/source/client/jni/com_taosdata_jdbc_TSDBJNIConnector.h @@ -260,6 +260,14 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_insertLinesImp(JN JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsertImp(JNIEnv *, jobject, jobjectArray, jlong, jint, jint); +/** + * Class: com_taosdata_jdbc_TSDBJNIConnector + * Method: getTableVgID + * Signature: (Ljava/lang/String;Ljava/lang/String)Lcom/taosdata/jdbc/VGroupIDResp + */ +JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getTableVgID(JNIEnv *, jobject, jlong, jstring, + jstring, jobject); + #ifdef __cplusplus } #endif diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 98c96dcfb1..d429e52111 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -77,19 +77,18 @@ static void deregisterRequest(SRequestObj *pRequest) { pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst); tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 - "us, exec:%" PRId64 "us, stmtType:%d", + "us, exec:%" PRId64 "us, stmtType:%d", duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart, - pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - - pRequest->metric.ctgEnd, pRequest->metric.execEnd - pRequest->metric.semanticEnd, - pRequest->stmtType); + pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - pRequest->metric.ctgEnd, + pRequest->metric.execEnd - pRequest->metric.semanticEnd, pRequest->stmtType); - if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) { -// tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 -// "us, exec:%" PRId64 "us", -// duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart, -// pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - -// pRequest->metric.ctgEnd, pRequest->metric.execEnd - pRequest->metric.semanticEnd); -// atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration); + if (QUERY_NODE_VNODE_MODIFY_STMT == pRequest->stmtType) { + // tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 + // "us, exec:%" PRId64 "us", + // duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart, + // pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - + // pRequest->metric.ctgEnd, pRequest->metric.execEnd - pRequest->metric.semanticEnd); + // atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration); } else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) { // tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 // "us, planner:%" PRId64 "us, exec:%" PRId64 "us, reqId:0x%" PRIx64, @@ -475,6 +474,9 @@ int taos_options_imp(TSDB_OPTION option, const char *str) { case TSDB_OPTION_TIMEZONE: pItem = cfgGetItem(pCfg, "timezone"); break; + case TSDB_OPTION_USE_ADAPTER: + pItem = cfgGetItem(pCfg, "useAdapter"); + break; default: break; } diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 97ac315b77..d0fc88425d 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -734,7 +734,7 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList } int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog, SEpSet* epset) { - SArray* pArray = NULL; + SArray* pArray = NULL; SSubmitRsp2* pRsp = (SSubmitRsp2*)res; if (NULL == pRsp->aCreateTbRsp) { return TSDB_CODE_SUCCESS; @@ -849,7 +849,7 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { } static bool incompletaFileParsing(SNode* pStmt) { - return QUERY_NODE_VNODE_MODIF_STMT != nodeType(pStmt) ? false : ((SVnodeModifOpStmt*)pStmt)->fileProcessing; + return QUERY_NODE_VNODE_MODIFY_STMT != nodeType(pStmt) ? false : ((SVnodeModifyOpStmt*)pStmt)->fileProcessing; } // todo refacto the error code mgmt @@ -928,7 +928,7 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue if (pQuery->pRoot && !pRequest->inRetry) { STscObj* pTscObj = pRequest->pTscObj; SAppClusterSummary* pActivity = &pTscObj->pAppInfo->summary; - if (QUERY_NODE_VNODE_MODIF_STMT == pQuery->pRoot->type) { + if (QUERY_NODE_VNODE_MODIFY_STMT == pQuery->pRoot->type) { atomic_add_fetch_64((int64_t*)&pActivity->numOfInsertsReq, 1); } else if (QUERY_NODE_SELECT_STMT == pQuery->pRoot->type) { atomic_add_fetch_64((int64_t*)&pActivity->numOfQueryReq, 1); @@ -1033,7 +1033,7 @@ static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaDat } if (TSDB_CODE_SUCCESS == code && !pRequest->validateOnly) { SArray* pNodeList = NULL; - if (QUERY_NODE_VNODE_MODIF_STMT != nodeType(pQuery->pRoot)) { + if (QUERY_NODE_VNODE_MODIFY_STMT != nodeType(pQuery->pRoot)) { buildAsyncExecNodeList(pRequest, &pNodeList, pMnodeList, pResultMeta); } diff --git a/source/client/src/clientJniConnector.c b/source/client/src/clientJniConnector.c index 34fc480432..859d4ec80f 100644 --- a/source/client/src/clientJniConnector.c +++ b/source/client/src/clientJniConnector.c @@ -488,7 +488,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn numOfFields); return JNI_FETCH_END; } else { - jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: %d, msg:%s", jobj, tscon, code, taos_errstr(result)); + jniDebug("jobj:%p, conn:%p, interrupted query. fetch row error code: %d, msg:%s", jobj, tscon, code, + taos_errstr(result)); return JNI_RESULT_SET_NULL; } } @@ -583,7 +584,8 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchBlockImp(JNI jniDebug("jobj:%p, conn:%p, resultset:%p, no data to retrieve", jobj, tscon, (void *)res); return JNI_FETCH_END; } else { - jniError("jobj:%p, conn:%p, query interrupted. fetch block error code:%d, msg:%s", jobj, tscon, error_code, taos_errstr(tres)); + jniError("jobj:%p, conn:%p, query interrupted. fetch block error code:%d, msg:%s", jobj, tscon, error_code, + taos_errstr(tres)); return JNI_RESULT_SET_NULL; } } @@ -1028,3 +1030,62 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_schemalessInsert } return (jlong)tres; } + +// TABLE_VG_ID_FID_CACHE cache resp object for getTableVgID +typedef struct TABLE_VG_ID_FIELD_CACHE { + int cached; + jclass clazz; + jfieldID codeField; + jfieldID vgIDField; +} TABLE_VG_ID_FIELD_CACHE; + +TABLE_VG_ID_FIELD_CACHE tableVgIdFieldCache; + +void cacheTableVgIDField(JNIEnv *env, jobject jobj) { + if (tableVgIdFieldCache.cached) { + return; + } + + tableVgIdFieldCache.clazz = (*env)->GetObjectClass(env, jobj); + tableVgIdFieldCache.codeField = (*env)->GetFieldID(env, tableVgIdFieldCache.clazz, "code", "I"); + tableVgIdFieldCache.vgIDField = (*env)->GetFieldID(env, tableVgIdFieldCache.clazz, "vgID", "I"); + tableVgIdFieldCache.cached = 1; +} + +JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getTableVgID(JNIEnv *env, jobject jobj, jlong conn, + jstring jdb, jstring jtable, + jobject resp) { + if (!tableVgIdFieldCache.cached) { + cacheTableVgIDField(env, resp); + } + + TAOS *taos = (TAOS *)conn; + if (taos == NULL) { + jniError("jobj:%p, connection already closed", jobj); + (*env)->SetIntField(env, resp, tableVgIdFieldCache.codeField, JNI_CONNECTION_NULL); + return resp; + } + + const char *db = NULL; + const char *table = NULL; + int vgID = 0; + + if (jdb != NULL) { + db = (*env)->GetStringUTFChars(env, jdb, NULL); + } + if (jtable != NULL) { + table = (*env)->GetStringUTFChars(env, jtable, NULL); + } + + int code = taos_get_table_vgId(taos, db, table, &vgID); + if (db != NULL) { + (*env)->ReleaseStringUTFChars(env, jdb, db); + } + if (table != NULL) { + (*env)->ReleaseStringUTFChars(env, jtable, table); + } + + (*env)->SetIntField(env, resp, tableVgIdFieldCache.codeField, code); + (*env)->SetIntField(env, resp, tableVgIdFieldCache.vgIDField, vgID); + return resp; +} diff --git a/source/client/src/clientRawBlockWrite.c b/source/client/src/clientRawBlockWrite.c index 412af37162..bdd38fa690 100644 --- a/source/client/src/clientRawBlockWrite.c +++ b/source/client/src/clientRawBlockWrite.c @@ -1201,7 +1201,8 @@ end: return code; } -int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const char* tbname, TAOS_FIELD *fields, int numFields){ +int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const char* tbname, TAOS_FIELD* fields, + int numFields) { int32_t code = TSDB_CODE_SUCCESS; STableMeta* pTableMeta = NULL; SQuery* pQuery = NULL; @@ -1251,7 +1252,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch goto end; } pQuery = smlInitHandle(); - if(pQuery == NULL){ + if (pQuery == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto end; } @@ -1273,7 +1274,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch launchQueryImpl(pRequest, pQuery, true, NULL); code = pRequest->code; - end: +end: taosMemoryFreeClear(pTableMeta); qDestroyQuery(pQuery); destroyRequest(pRequest); @@ -1331,7 +1332,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname) goto end; } pQuery = smlInitHandle(); - if(pQuery == NULL){ + if (pQuery == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto end; } @@ -1408,7 +1409,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) { conn.mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp); pQuery = smlInitHandle(); - if(pQuery == NULL){ + if (pQuery == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto end; } @@ -1454,7 +1455,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) { void* hData = taosHashGet(pVgHash, &vg.vgId, sizeof(vg.vgId)); if (hData == NULL) { - taosHashPut(pVgHash, (const char *)&vg.vgId, sizeof(vg.vgId), (char *)&vg, sizeof(vg)); + taosHashPut(pVgHash, (const char*)&vg.vgId, sizeof(vg.vgId), (char*)&vg, sizeof(vg)); } code = rawBlockBindData(pQuery, pTableMeta, pRetrieve->data, NULL, NULL, 0); @@ -1463,7 +1464,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) { goto end; } } - + code = smlBuildOutput(pQuery, pVgHash); if (code != TSDB_CODE_SUCCESS) { uError("smlBuildOutput failed"); @@ -1483,7 +1484,6 @@ end: return code; } - static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) { int32_t code = TSDB_CODE_SUCCESS; SHashObj* pVgHash = NULL; @@ -1531,7 +1531,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) conn.mgmtEps = getEpSet_s(&pRequest->pTscObj->pAppInfo->mgmtEp); pQuery = smlInitHandle(); - if(pQuery == NULL){ + if (pQuery == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto end; } @@ -1564,7 +1564,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) void** dataTmp = taosArrayGet(rspObj.rsp.createTableReq, j); int32_t* lenTmp = taosArrayGet(rspObj.rsp.createTableLen, j); - SDecoder decoderTmp = {0}; + SDecoder decoderTmp = {0}; tDecoderInit(&decoderTmp, *dataTmp, *lenTmp); memset(&pCreateReq, 0, sizeof(SVCreateTbReq)); if (tDecodeSVCreateTbReq(&decoderTmp, &pCreateReq) < 0) { @@ -1601,7 +1601,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) void* hData = taosHashGet(pVgHash, &vg.vgId, sizeof(vg.vgId)); if (hData == NULL) { - taosHashPut(pVgHash, (const char *)&vg.vgId, sizeof(vg.vgId), (char *)&vg, sizeof(vg)); + taosHashPut(pVgHash, (const char*)&vg.vgId, sizeof(vg.vgId), (char*)&vg, sizeof(vg)); } code = rawBlockBindData(pQuery, pTableMeta, pRetrieve->data, &pCreateReq, NULL, 0); @@ -1614,7 +1614,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen) launchQueryImpl(pRequest, pQuery, true, NULL); code = pRequest->code; - end: +end: tDeleteSTaosxRsp(&rspObj.rsp); tDecoderClear(&decoder); qDestroyQuery(pQuery); diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 1fb74cb128..ba154c95bd 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -24,15 +24,15 @@ int64_t smlToMilli[3] = {3600000LL, 60000LL, 1000LL}; int64_t smlFactorNS[3] = {NANOSECOND_PER_MSEC, NANOSECOND_PER_USEC, 1}; int64_t smlFactorS[3] = {1000LL, 1000000LL, 1000000000LL}; -void* nodeListGet(NodeList* list, const void *key, int32_t len, _equal_fn_sml fn){ +void *nodeListGet(NodeList *list, const void *key, int32_t len, _equal_fn_sml fn) { NodeList *tmp = list; - while(tmp){ - if(fn == NULL){ - if(tmp->data.used && tmp->data.keyLen == len && memcmp(tmp->data.key, key, len) == 0) { + while (tmp) { + if (fn == NULL) { + if (tmp->data.used && tmp->data.keyLen == len && memcmp(tmp->data.key, key, len) == 0) { return tmp->data.value; } - }else{ - if(tmp->data.used && fn(tmp->data.key, key) == 0) { + } else { + if (tmp->data.used && fn(tmp->data.key, key) == 0) { return tmp->data.value; } } @@ -42,30 +42,30 @@ void* nodeListGet(NodeList* list, const void *key, int32_t len, _equal_fn_sml fn return NULL; } -int nodeListSet(NodeList** list, const void *key, int32_t len, void* value, _equal_fn_sml fn){ +int nodeListSet(NodeList **list, const void *key, int32_t len, void *value, _equal_fn_sml fn) { NodeList *tmp = *list; - while (tmp){ - if(!tmp->data.used) break; - if(fn == NULL){ - if(tmp->data.keyLen == len && memcmp(tmp->data.key, key, len) == 0) { + while (tmp) { + if (!tmp->data.used) break; + if (fn == NULL) { + if (tmp->data.keyLen == len && memcmp(tmp->data.key, key, len) == 0) { return -1; } - }else{ - if(tmp->data.keyLen == len && fn(tmp->data.key, key) == 0) { + } else { + if (tmp->data.keyLen == len && fn(tmp->data.key, key) == 0) { return -1; } } tmp = tmp->next; } - if(tmp){ + if (tmp) { tmp->data.key = key; tmp->data.keyLen = len; tmp->data.value = value; tmp->data.used = true; - }else{ + } else { NodeList *newNode = (NodeList *)taosMemoryCalloc(1, sizeof(NodeList)); - if(newNode == NULL){ + if (newNode == NULL) { return -1; } newNode->data.key = key; @@ -78,11 +78,13 @@ int nodeListSet(NodeList** list, const void *key, int32_t len, void* value, _equ return 0; } -int nodeListSize(NodeList* list){ +int nodeListSize(NodeList *list) { int cnt = 0; - while(list){ - if(list->data.used) cnt++; - else break; + while (list) { + if (list->data.used) + cnt++; + else + break; list = list->next; } return cnt; @@ -106,7 +108,6 @@ int32_t smlBuildInvalidDataMsg(SSmlMsgBuf *pBuf, const char *msg1, const char *m return TSDB_CODE_SML_INVALID_DATA; } - int64_t smlGetTimeValue(const char *value, int32_t len, uint8_t fromPrecision, uint8_t toPrecision) { char *endPtr = NULL; int64_t tsInt64 = taosStr2Int64(value, &endPtr, 10); @@ -114,9 +115,9 @@ int64_t smlGetTimeValue(const char *value, int32_t len, uint8_t fromPrecision, u return -1; } - if(unlikely(fromPrecision >= TSDB_TIME_PRECISION_HOURS)){ + if (unlikely(fromPrecision >= TSDB_TIME_PRECISION_HOURS)) { int64_t unit = smlToMilli[fromPrecision - TSDB_TIME_PRECISION_HOURS]; - if(unit > INT64_MAX / tsInt64){ + if (unit > INT64_MAX / tsInt64) { return -1; } tsInt64 *= unit; @@ -136,7 +137,7 @@ int8_t smlGetTsTypeByLen(int32_t len) { } } -SSmlTableInfo *smlBuildTableInfo(int numRows, const char* measure, int32_t measureLen) { +SSmlTableInfo *smlBuildTableInfo(int numRows, const char *measure, int32_t measureLen) { SSmlTableInfo *tag = (SSmlTableInfo *)taosMemoryCalloc(sizeof(SSmlTableInfo), 1); if (!tag) { return NULL; @@ -151,23 +152,23 @@ SSmlTableInfo *smlBuildTableInfo(int numRows, const char* measure, int32_t measu goto cleanup; } -// tag->tags = taosArrayInit(16, sizeof(SSmlKv)); -// if (tag->tags == NULL) { -// uError("SML:smlBuildTableInfo failed to allocate memory"); -// goto cleanup; -// } + // tag->tags = taosArrayInit(16, sizeof(SSmlKv)); + // if (tag->tags == NULL) { + // uError("SML:smlBuildTableInfo failed to allocate memory"); + // goto cleanup; + // } return tag; - cleanup: +cleanup: taosMemoryFree(tag); return NULL; } static int32_t smlParseTableName(SArray *tags, char *childTableName) { - size_t childTableNameLen = strlen(tsSmlChildTableName); + size_t childTableNameLen = strlen(tsSmlChildTableName); if (childTableNameLen <= 0) return TSDB_CODE_SUCCESS; - for(int i = 0; i < taosArrayGetSize(tags); i++){ + for (int i = 0; i < taosArrayGetSize(tags); i++) { SSmlKv *tag = (SSmlKv *)taosArrayGet(tags, i); // handle child table name if (childTableNameLen == tag->keyLen && strncmp(tag->key, tsSmlChildTableName, tag->keyLen) == 0) { @@ -180,13 +181,12 @@ static int32_t smlParseTableName(SArray *tags, char *childTableName) { return TSDB_CODE_SUCCESS; } -int32_t smlSetCTableName(SSmlTableInfo *oneTable){ +int32_t smlSetCTableName(SSmlTableInfo *oneTable) { smlParseTableName(oneTable->tags, oneTable->childTableName); if (strlen(oneTable->childTableName) == 0) { - SArray* dst = taosArrayDup(oneTable->tags, NULL); - RandTableName rName = {dst, oneTable->sTableName, (uint8_t)oneTable->sTableNameLen, - oneTable->childTableName, 0}; + SArray *dst = taosArrayDup(oneTable->tags, NULL); + RandTableName rName = {dst, oneTable->sTableName, (uint8_t)oneTable->sTableNameLen, oneTable->childTableName, 0}; buildChildTableName(&rName); taosArrayDestroy(dst); @@ -203,7 +203,7 @@ SSmlSTableMeta *smlBuildSTableMeta(bool isDataFormat) { return NULL; } - if(unlikely(!isDataFormat)){ + if (unlikely(!isDataFormat)) { meta->tagHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_NO_LOCK); if (meta->tagHash == NULL) { uError("SML:smlBuildSTableMeta failed to allocate memory"); @@ -230,116 +230,117 @@ SSmlSTableMeta *smlBuildSTableMeta(bool isDataFormat) { } return meta; - cleanup: +cleanup: taosMemoryFree(meta); return NULL; } -//uint16_t smlCalTypeSum(char* endptr, int32_t left){ -// uint16_t sum = 0; -// for(int i = 0; i < left; i++){ -// sum += endptr[i]; -// } -// return sum; -//} +// uint16_t smlCalTypeSum(char* endptr, int32_t left){ +// uint16_t sum = 0; +// for(int i = 0; i < left; i++){ +// sum += endptr[i]; +// } +// return sum; +// } -#define RETURN_FALSE \ -smlBuildInvalidDataMsg(msg, "invalid data", pVal); \ -return false; +#define RETURN_FALSE \ + smlBuildInvalidDataMsg(msg, "invalid data", pVal); \ + return false; -#define SET_DOUBLE kvVal->type = TSDB_DATA_TYPE_DOUBLE;\ - kvVal->d = result; +#define SET_DOUBLE \ + kvVal->type = TSDB_DATA_TYPE_DOUBLE; \ + kvVal->d = result; -#define SET_FLOAT \ - if (!IS_VALID_FLOAT(result)) {\ - smlBuildInvalidDataMsg(msg, "float out of range[-3.402823466e+38,3.402823466e+38]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_FLOAT;\ +#define SET_FLOAT \ + if (!IS_VALID_FLOAT(result)) { \ + smlBuildInvalidDataMsg(msg, "float out of range[-3.402823466e+38,3.402823466e+38]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_FLOAT; \ kvVal->f = (float)result; -#define SET_BIGINT \ - if (smlDoubleToInt64OverFlow(result)) {\ - errno = 0;\ - int64_t tmp = taosStr2Int64(pVal, &endptr, 10);\ - if (errno == ERANGE) {\ - smlBuildInvalidDataMsg(msg, "big int out of range[-9223372036854775808,9223372036854775807]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_BIGINT;\ - kvVal->i = tmp;\ - return true;\ - }\ - kvVal->type = TSDB_DATA_TYPE_BIGINT;\ +#define SET_BIGINT \ + if (smlDoubleToInt64OverFlow(result)) { \ + errno = 0; \ + int64_t tmp = taosStr2Int64(pVal, &endptr, 10); \ + if (errno == ERANGE) { \ + smlBuildInvalidDataMsg(msg, "big int out of range[-9223372036854775808,9223372036854775807]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_BIGINT; \ + kvVal->i = tmp; \ + return true; \ + } \ + kvVal->type = TSDB_DATA_TYPE_BIGINT; \ kvVal->i = (int64_t)result; -#define SET_INT \ - if (!IS_VALID_INT(result)) {\ - smlBuildInvalidDataMsg(msg, "int out of range[-2147483648,2147483647]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_INT;\ +#define SET_INT \ + if (!IS_VALID_INT(result)) { \ + smlBuildInvalidDataMsg(msg, "int out of range[-2147483648,2147483647]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_INT; \ kvVal->i = result; -#define SET_SMALL_INT \ - if (!IS_VALID_SMALLINT(result)) {\ - smlBuildInvalidDataMsg(msg, "small int our of range[-32768,32767]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_SMALLINT;\ +#define SET_SMALL_INT \ + if (!IS_VALID_SMALLINT(result)) { \ + smlBuildInvalidDataMsg(msg, "small int our of range[-32768,32767]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_SMALLINT; \ kvVal->i = result; -#define SET_UBIGINT \ - if (result >= (double)UINT64_MAX || result < 0) {\ - errno = 0;\ - uint64_t tmp = taosStr2UInt64(pVal, &endptr, 10);\ - if (errno == ERANGE || result < 0) {\ - smlBuildInvalidDataMsg(msg, "unsigned big int out of range[0,18446744073709551615]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_UBIGINT;\ - kvVal->u = tmp;\ - return true;\ - }\ - kvVal->type = TSDB_DATA_TYPE_UBIGINT;\ +#define SET_UBIGINT \ + if (result >= (double)UINT64_MAX || result < 0) { \ + errno = 0; \ + uint64_t tmp = taosStr2UInt64(pVal, &endptr, 10); \ + if (errno == ERANGE || result < 0) { \ + smlBuildInvalidDataMsg(msg, "unsigned big int out of range[0,18446744073709551615]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_UBIGINT; \ + kvVal->u = tmp; \ + return true; \ + } \ + kvVal->type = TSDB_DATA_TYPE_UBIGINT; \ kvVal->u = result; -#define SET_UINT \ - if (!IS_VALID_UINT(result)) {\ - smlBuildInvalidDataMsg(msg, "unsigned int out of range[0,4294967295]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_UINT;\ +#define SET_UINT \ + if (!IS_VALID_UINT(result)) { \ + smlBuildInvalidDataMsg(msg, "unsigned int out of range[0,4294967295]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_UINT; \ kvVal->u = result; -#define SET_USMALL_INT \ - if (!IS_VALID_USMALLINT(result)) {\ - smlBuildInvalidDataMsg(msg, "unsigned small int out of rang[0,65535]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_USMALLINT;\ +#define SET_USMALL_INT \ + if (!IS_VALID_USMALLINT(result)) { \ + smlBuildInvalidDataMsg(msg, "unsigned small int out of rang[0,65535]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_USMALLINT; \ kvVal->u = result; -#define SET_TINYINT \ - if (!IS_VALID_TINYINT(result)) { \ - smlBuildInvalidDataMsg(msg, "tiny int out of range[-128,127]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_TINYINT;\ +#define SET_TINYINT \ + if (!IS_VALID_TINYINT(result)) { \ + smlBuildInvalidDataMsg(msg, "tiny int out of range[-128,127]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_TINYINT; \ kvVal->i = result; -#define SET_UTINYINT \ - if (!IS_VALID_UTINYINT(result)) {\ - smlBuildInvalidDataMsg(msg, "unsigned tiny int out of range[0,255]", pVal);\ - return false;\ - }\ - kvVal->type = TSDB_DATA_TYPE_UTINYINT;\ +#define SET_UTINYINT \ + if (!IS_VALID_UTINYINT(result)) { \ + smlBuildInvalidDataMsg(msg, "unsigned tiny int out of range[0,255]", pVal); \ + return false; \ + } \ + kvVal->type = TSDB_DATA_TYPE_UTINYINT; \ kvVal->u = result; bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg) { const char *pVal = kvVal->value; int32_t len = kvVal->length; - char * endptr = NULL; + char *endptr = NULL; double result = taosStr2Double(pVal, &endptr); if (pVal == endptr) { RETURN_FALSE @@ -349,59 +350,59 @@ bool smlParseNumber(SSmlKv *kvVal, SSmlMsgBuf *msg) { if (left == 0) { SET_DOUBLE } else if (left == 3) { - if(endptr[0] == 'f' || endptr[0] == 'F'){ - if(endptr[1] == '6' && endptr[2] == '4'){ + if (endptr[0] == 'f' || endptr[0] == 'F') { + if (endptr[1] == '6' && endptr[2] == '4') { SET_DOUBLE - }else if(endptr[1] == '3' && endptr[2] == '2'){ + } else if (endptr[1] == '3' && endptr[2] == '2') { SET_FLOAT - }else{ + } else { RETURN_FALSE } - }else if(endptr[0] == 'i' || endptr[0] == 'I'){ - if(endptr[1] == '6' && endptr[2] == '4'){ + } else if (endptr[0] == 'i' || endptr[0] == 'I') { + if (endptr[1] == '6' && endptr[2] == '4') { SET_BIGINT - }else if(endptr[1] == '3' && endptr[2] == '2'){ + } else if (endptr[1] == '3' && endptr[2] == '2') { SET_INT - }else if(endptr[1] == '1' && endptr[2] == '6'){ + } else if (endptr[1] == '1' && endptr[2] == '6') { SET_SMALL_INT - }else{ + } else { RETURN_FALSE } - }else if(endptr[0] == 'u' || endptr[0] == 'U'){ - if(endptr[1] == '6' && endptr[2] == '4'){ + } else if (endptr[0] == 'u' || endptr[0] == 'U') { + if (endptr[1] == '6' && endptr[2] == '4') { SET_UBIGINT - }else if(endptr[1] == '3' && endptr[2] == '2'){ + } else if (endptr[1] == '3' && endptr[2] == '2') { SET_UINT - }else if(endptr[1] == '1' && endptr[2] == '6'){ + } else if (endptr[1] == '1' && endptr[2] == '6') { SET_USMALL_INT - }else{ + } else { RETURN_FALSE } - }else{ + } else { RETURN_FALSE } - } else if(left == 2){ - if(endptr[0] == 'i' || endptr[0] == 'I'){ - if(endptr[1] == '8') { + } else if (left == 2) { + if (endptr[0] == 'i' || endptr[0] == 'I') { + if (endptr[1] == '8') { SET_TINYINT - }else{ + } else { RETURN_FALSE } - }else if(endptr[0] == 'u' || endptr[0] == 'U') { + } else if (endptr[0] == 'u' || endptr[0] == 'U') { if (endptr[1] == '8') { SET_UTINYINT } else { RETURN_FALSE } - }else{ + } else { RETURN_FALSE } - } else if(left == 1){ - if(endptr[0] == 'i' || endptr[0] == 'I'){ + } else if (left == 1) { + if (endptr[0] == 'i' || endptr[0] == 'I') { SET_BIGINT - }else if(endptr[0] == 'u' || endptr[0] == 'U') { + } else if (endptr[0] == 'u' || endptr[0] == 'U') { SET_UBIGINT - }else{ + } else { RETURN_FALSE } } else { @@ -508,7 +509,7 @@ bool smlParseNumberOld(SSmlKv *kvVal, SSmlMsgBuf *msg) { return true; } -STableMeta* smlGetMeta(SSmlHandle *info, const void* measure, int32_t measureLen){ +STableMeta *smlGetMeta(SSmlHandle *info, const void *measure, int32_t measureLen) { STableMeta *pTableMeta = NULL; SName pName = {TSDB_TABLE_NAME_T, info->taos->acctId, {0}, {0}}; @@ -526,7 +527,6 @@ STableMeta* smlGetMeta(SSmlHandle *info, const void* measure, int32_t measureLen return pTableMeta; } - static int64_t smlGenId() { static volatile int64_t linesSmlHandleId = 0; @@ -736,14 +736,14 @@ static int32_t smlSendMetaMsg(SSmlHandle *info, SName *pName, SArray *pColumns, code = pRequest->code; taosMemoryFree(pCmdMsg.pMsg); - end: +end: destroyRequest(pRequest); tFreeSMCreateStbReq(&pReq); return code; } static int32_t smlModifyDBSchemas(SSmlHandle *info) { - if(info->dataFormat && !info->needModifySchema){ + if (info->dataFormat && !info->needModifySchema) { return TSDB_CODE_SUCCESS; } int32_t code = 0; @@ -764,8 +764,8 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) { SSmlSTableMeta *sTableData = (SSmlSTableMeta *)tmp->data.value; bool needCheckMeta = false; // for multi thread - size_t superTableLen = (size_t)tmp->data.keyLen; - const void *superTable = tmp->data.key; + size_t superTableLen = (size_t)tmp->data.keyLen; + const void *superTable = tmp->data.key; memset(pName.tname, 0, TSDB_TABLE_NAME_LEN); memcpy(pName.tname, superTable, superTableLen); @@ -918,14 +918,13 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) { } return 0; - end: +end: taosHashCleanup(hashTmp); taosMemoryFreeClear(pTableMeta); -// catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1); + // catalogRefreshTableMeta(info->pCatalog, &conn, &pName, 1); return code; } - /* static int32_t smlCheckDupUnit(SHashObj *dumplicateKey, SArray *tags, SSmlMsgBuf *msg){ for(int i = 0; i < taosArrayGetSize(tags); i++) { @@ -955,11 +954,11 @@ static int32_t smlJudgeDupColName(SArray *cols, SArray *tags, SSmlMsgBuf *msg) { } */ -static void smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols){ +static void smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols) { for (int16_t i = 0; i < taosArrayGetSize(cols); ++i) { SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, i); - int ret = taosHashPut(metaHash, kv->key, kv->keyLen, &i, SHORT_BYTES); - if(ret == 0){ + int ret = taosHashPut(metaHash, kv->key, kv->keyLen, &i, SHORT_BYTES); + if (ret == 0) { taosArrayPush(metaArray, kv); } } @@ -981,7 +980,7 @@ static int32_t smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols int16_t *index = (int16_t *)taosHashGet(metaHash, kv->key, kv->keyLen); if (index) { SSmlKv *value = (SSmlKv *)taosArrayGet(metaArray, *index); - if (isTag){ + if (isTag) { if (kv->length > value->length) { value->length = kv->length; } @@ -999,8 +998,8 @@ static int32_t smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols size_t tmp = taosArrayGetSize(metaArray); ASSERT(tmp <= INT16_MAX); int16_t size = tmp; - int ret = taosHashPut(metaHash, kv->key, kv->keyLen, &size, SHORT_BYTES); - if(ret == 0){ + int ret = taosHashPut(metaHash, kv->key, kv->keyLen, &size, SHORT_BYTES); + if (ret == 0) { taosArrayPush(metaArray, kv); } } @@ -1026,12 +1025,12 @@ void smlDestroyInfo(SSmlHandle *info) { qDestroyQuery(info->pQuery); // destroy info->childTables - NodeList* tmp = info->childTables; + NodeList *tmp = info->childTables; while (tmp) { - if(tmp->data.used) { - smlDestroyTableInfo((SSmlTableInfo*)tmp->data.value); + if (tmp->data.used) { + smlDestroyTableInfo((SSmlTableInfo *)tmp->data.value); } - NodeList* t = tmp->next; + NodeList *t = tmp->next; taosMemoryFree(tmp); tmp = t; } @@ -1039,10 +1038,10 @@ void smlDestroyInfo(SSmlHandle *info) { // destroy info->superTables tmp = info->superTables; while (tmp) { - if(tmp->data.used) { - smlDestroySTableMeta((SSmlSTableMeta*)tmp->data.value); + if (tmp->data.used) { + smlDestroySTableMeta((SSmlSTableMeta *)tmp->data.value); } - NodeList* t = tmp->next; + NodeList *t = tmp->next; taosMemoryFree(tmp); tmp = t; } @@ -1053,8 +1052,8 @@ void smlDestroyInfo(SSmlHandle *info) { taosArrayDestroy(info->preLineTagKV); taosArrayDestroy(info->preLineColKV); - if(!info->dataFormat){ - for(int i = 0; i < info->lineNum; i++){ + if (!info->dataFormat) { + for (int i = 0; i < info->lineNum; i++) { taosArrayDestroy(info->lines[i].colArray); } taosMemoryFree(info->lines); @@ -1069,7 +1068,7 @@ SSmlHandle *smlBuildSmlInfo(TAOS *taos) { if (NULL == info) { return NULL; } - if(taos != NULL){ + if (taos != NULL) { info->taos = acquireTscObj(*(int64_t *)taos); code = catalogGetHandle(info->taos->pAppInfo->clusterId, &info->pCatalog); if (code != TSDB_CODE_SUCCESS) { @@ -1114,20 +1113,20 @@ static int32_t smlPushCols(SArray *colsArray, SArray *cols) { } static int32_t smlParseLineBottom(SSmlHandle *info) { - if(info->dataFormat) return TSDB_CODE_SUCCESS; + if (info->dataFormat) return TSDB_CODE_SUCCESS; - for(int32_t i = 0; i < info->lineNum; i ++){ - SSmlLineInfo* elements = info->lines + i; + for (int32_t i = 0; i < info->lineNum; i++) { + SSmlLineInfo *elements = info->lines + i; SSmlTableInfo *tinfo = NULL; - if(info->protocol == TSDB_SML_LINE_PROTOCOL){ + if (info->protocol == TSDB_SML_LINE_PROTOCOL) { tinfo = (SSmlTableInfo *)nodeListGet(info->childTables, elements->measure, elements->measureTagsLen, NULL); - }else if(info->protocol == TSDB_SML_TELNET_PROTOCOL){ + } else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) { tinfo = (SSmlTableInfo *)nodeListGet(info->childTables, elements, POINTER_BYTES, is_same_child_table_telnet); - }else{ + } else { tinfo = (SSmlTableInfo *)nodeListGet(info->childTables, elements, POINTER_BYTES, is_same_child_table_telnet); } - if(tinfo == NULL){ + if (tinfo == NULL) { uError("SML:0x%" PRIx64 "get oneTable failed, line num:%d", info->id, i); smlBuildInvalidDataMsg(&info->msgBuf, "get oneTable failed", elements->measure); return TSDB_CODE_SML_INVALID_DATA; @@ -1148,7 +1147,8 @@ static int32_t smlParseLineBottom(SSmlHandle *info) { return ret; } - SSmlSTableMeta *tableMeta = (SSmlSTableMeta *)nodeListGet(info->superTables, elements->measure, elements->measureLen, NULL); + SSmlSTableMeta *tableMeta = + (SSmlSTableMeta *)nodeListGet(info->superTables, elements->measure, elements->measureLen, NULL); if (tableMeta) { // update meta ret = smlUpdateMeta(tableMeta->colHash, tableMeta->cols, elements->colArray, false, &info->msgBuf); if (ret == TSDB_CODE_SUCCESS) { @@ -1159,11 +1159,11 @@ static int32_t smlParseLineBottom(SSmlHandle *info) { return ret; } } else { -// ret = smlJudgeDupColName(elements->colArray, tinfo->tags, &info->msgBuf); -// if (ret != TSDB_CODE_SUCCESS) { -// uError("SML:0x%" PRIx64 " smlUpdateMeta failed", info->id); -// return ret; -// } + // ret = smlJudgeDupColName(elements->colArray, tinfo->tags, &info->msgBuf); + // if (ret != TSDB_CODE_SUCCESS) { + // uError("SML:0x%" PRIx64 " smlUpdateMeta failed", info->id); + // return ret; + // } SSmlSTableMeta *meta = smlBuildSTableMeta(info->dataFormat); smlInsertMeta(meta->tagHash, meta->tags, tinfo->tags); @@ -1175,11 +1175,10 @@ static int32_t smlParseLineBottom(SSmlHandle *info) { return TSDB_CODE_SUCCESS; } - static int32_t smlInsertData(SSmlHandle *info) { int32_t code = TSDB_CODE_SUCCESS; - NodeList* tmp = info->childTables; + NodeList *tmp = info->childTables; while (tmp) { SSmlTableInfo *tableData = (SSmlTableInfo *)tmp->data.value; @@ -1209,9 +1208,9 @@ static int32_t smlInsertData(SSmlHandle *info) { pMeta->tableMeta->vgId = vg.vgId; pMeta->tableMeta->uid = tableData->uid; // one table merge data block together according uid - code = smlBindData(info->pQuery, info->dataFormat, tableData->tags, pMeta->cols, tableData->cols, - pMeta->tableMeta, tableData->childTableName, tableData->sTableName, tableData->sTableNameLen, - info->ttl, info->msgBuf.buf, info->msgBuf.len); + code = smlBindData(info->pQuery, info->dataFormat, tableData->tags, pMeta->cols, tableData->cols, pMeta->tableMeta, + tableData->childTableName, tableData->sTableName, tableData->sTableNameLen, info->ttl, + info->msgBuf.buf, info->msgBuf.len); if (code != TSDB_CODE_SUCCESS) { uError("SML:0x%" PRIx64 " smlBindData failed", info->id); return code; @@ -1234,24 +1233,25 @@ static int32_t smlInsertData(SSmlHandle *info) { } static void smlPrintStatisticInfo(SSmlHandle *info) { - uError("SML:0x%" PRIx64 - " smlInsertLines result, code:%d,lineNum:%d,stable num:%d,ctable num:%d,create stable num:%d,alter stable tag num:%d,alter stable col num:%d \ + uError( + "SML:0x%" PRIx64 + " smlInsertLines result, code:%d,lineNum:%d,stable num:%d,ctable num:%d,create stable num:%d,alter stable tag num:%d,alter stable col num:%d \ parse cost:%" PRId64 ",schema cost:%" PRId64 ",bind cost:%" PRId64 ",rpc cost:%" PRId64 ",total cost:%" PRId64 - "", - info->id, info->cost.code, info->cost.lineNum, info->cost.numOfSTables, info->cost.numOfCTables, - info->cost.numOfCreateSTables, info->cost.numOfAlterTagSTables, info->cost.numOfAlterColSTables, - info->cost.schemaTime - info->cost.parseTime, - info->cost.insertBindTime - info->cost.schemaTime, info->cost.insertRpcTime - info->cost.insertBindTime, - info->cost.endTime - info->cost.insertRpcTime, info->cost.endTime - info->cost.parseTime); + "", + info->id, info->cost.code, info->cost.lineNum, info->cost.numOfSTables, info->cost.numOfCTables, + info->cost.numOfCreateSTables, info->cost.numOfAlterTagSTables, info->cost.numOfAlterColSTables, + info->cost.schemaTime - info->cost.parseTime, info->cost.insertBindTime - info->cost.schemaTime, + info->cost.insertRpcTime - info->cost.insertBindTime, info->cost.endTime - info->cost.insertRpcTime, + info->cost.endTime - info->cost.parseTime); } -int32_t smlClearForRerun(SSmlHandle *info){ +int32_t smlClearForRerun(SSmlHandle *info) { info->reRun = false; // clear info->childTables - NodeList* pList = info->childTables; + NodeList *pList = info->childTables; while (pList) { - if(pList->data.used) { - smlDestroyTableInfo((SSmlTableInfo*)pList->data.value); + if (pList->data.used) { + smlDestroyTableInfo((SSmlTableInfo *)pList->data.value); pList->data.used = false; } pList = pList->next; @@ -1260,24 +1260,24 @@ int32_t smlClearForRerun(SSmlHandle *info){ // clear info->superTables pList = info->superTables; while (pList) { - if(pList->data.used) { - smlDestroySTableMeta((SSmlSTableMeta*)pList->data.value); + if (pList->data.used) { + smlDestroySTableMeta((SSmlSTableMeta *)pList->data.value); pList->data.used = false; } pList = pList->next; } - if(unlikely(info->lines != NULL)){ + if (unlikely(info->lines != NULL)) { uError("SML:0x%" PRIx64 " info->lines != NULL", info->id); return TSDB_CODE_SML_INVALID_DATA; } - info->lines = (SSmlLineInfo*)taosMemoryCalloc(info->lineNum, sizeof(SSmlLineInfo)); + info->lines = (SSmlLineInfo *)taosMemoryCalloc(info->lineNum, sizeof(SSmlLineInfo)); memset(&info->preLine, 0, sizeof(SSmlLineInfo)); info->currSTableMeta = NULL; info->currTableDataCtx = NULL; - SVnodeModifOpStmt* stmt= (SVnodeModifOpStmt*)(info->pQuery->pRoot); + SVnodeModifyOpStmt *stmt = (SVnodeModifyOpStmt *)(info->pQuery->pRoot); stmt->freeHashFunc(stmt->pTableBlockHashObj); stmt->pTableBlockHashObj = taosHashInit(16, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK); return TSDB_CODE_SUCCESS; @@ -1298,7 +1298,7 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char return code; } - char *oldRaw = rawLine; + char *oldRaw = rawLine; int32_t i = 0; while (i < numLines) { char *tmp = NULL; @@ -1319,20 +1319,21 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char } } - uDebug("SML:0x%" PRIx64 " smlParseLine israw:%d, len:%d, sql:%s", info->id, info->isRawLine, len, (info->isRawLine ? "rawdata" : tmp)); + uDebug("SML:0x%" PRIx64 " smlParseLine israw:%d, len:%d, sql:%s", info->id, info->isRawLine, len, + (info->isRawLine ? "rawdata" : tmp)); if (info->protocol == TSDB_SML_LINE_PROTOCOL) { - if(info->dataFormat){ + if (info->dataFormat) { SSmlLineInfo element = {0}; code = smlParseInfluxString(info, tmp, tmp + len, &element); - }else{ + } else { code = smlParseInfluxString(info, tmp, tmp + len, info->lines + i); } } else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) { - if(info->dataFormat) { + if (info->dataFormat) { SSmlLineInfo element = {0}; code = smlParseTelnetString(info, (char *)tmp, (char *)tmp + len, &element); - }else{ + } else { code = smlParseTelnetString(info, (char *)tmp, (char *)tmp + len, info->lines + i); } @@ -1343,11 +1344,11 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char uError("SML:0x%" PRIx64 " smlParseLine failed. line %d : %s", info->id, i, tmp); return code; } - if(info->reRun){ + if (info->reRun) { i = 0; rawLine = oldRaw; code = smlClearForRerun(info); - if(code != TSDB_CODE_SUCCESS){ + if (code != TSDB_CODE_SUCCESS) { return code; } continue; @@ -1401,8 +1402,8 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL return code; } -TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine, char *rawLineEnd, - int numLines, int protocol, int precision, int32_t ttl, int64_t reqid) { +TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine, char *rawLineEnd, int numLines, + int protocol, int precision, int32_t ttl, int64_t reqid) { int32_t code = TSDB_CODE_SUCCESS; if (NULL == taos) { terrno = TSDB_CODE_TSC_DISCONNECTED; @@ -1423,7 +1424,7 @@ TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine, } info->pRequest = request; info->isRawLine = rawLine != NULL; - info->ttl = ttl; + info->ttl = ttl; info->precision = precision; info->protocol = (TSDB_SML_PROTOCOL_TYPE)protocol; info->msgBuf.buf = info->pRequest->msgBuf; @@ -1462,7 +1463,7 @@ TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine, request->code = code; info->cost.endTime = taosGetTimestampUs(); info->cost.code = code; -// smlPrintStatisticInfo(info); + // smlPrintStatisticInfo(info); end: smlDestroyInfo(info); @@ -1497,12 +1498,15 @@ TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int pr return taos_schemaless_insert_ttl_with_reqid(taos, lines, numLines, protocol, precision, TSDB_DEFAULT_TABLE_TTL, 0); } -TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int32_t ttl) { +TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision, + int32_t ttl) { return taos_schemaless_insert_ttl_with_reqid(taos, lines, numLines, protocol, precision, ttl, 0); } -TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, int64_t reqid) { - return taos_schemaless_insert_ttl_with_reqid(taos, lines, numLines, protocol, precision, TSDB_DEFAULT_TABLE_TTL, reqid); +TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision, + int64_t reqid) { + return taos_schemaless_insert_ttl_with_reqid(taos, lines, numLines, protocol, precision, TSDB_DEFAULT_TABLE_TTL, + reqid); } TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, @@ -1522,13 +1526,18 @@ TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int return taos_schemaless_insert_inner(taos, NULL, lines, lines + len, *totalRows, protocol, precision, ttl, reqid); } -TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int64_t reqid) { - return taos_schemaless_insert_raw_ttl_with_reqid(taos, lines, len, totalRows, protocol, precision, TSDB_DEFAULT_TABLE_TTL, reqid); +TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, + int precision, int64_t reqid) { + return taos_schemaless_insert_raw_ttl_with_reqid(taos, lines, len, totalRows, protocol, precision, + TSDB_DEFAULT_TABLE_TTL, reqid); } -TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision, int32_t ttl) { +TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, + int precision, int32_t ttl) { return taos_schemaless_insert_raw_ttl_with_reqid(taos, lines, len, totalRows, protocol, precision, ttl, 0); } -TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, int precision) { - return taos_schemaless_insert_raw_ttl_with_reqid(taos, lines, len, totalRows, protocol, precision, TSDB_DEFAULT_TABLE_TTL, 0); +TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol, + int precision) { + return taos_schemaless_insert_raw_ttl_with_reqid(taos, lines, len, totalRows, protocol, precision, + TSDB_DEFAULT_TABLE_TTL, 0); } diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index 350ecdd373..1dd8117c1e 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -438,6 +438,7 @@ int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) { taosMemoryFree(pParam->pOffset); taosMemoryFree(pBuf->pData); + taosMemoryFree(pBuf->pEpSet); /*tscDebug("receive offset commit cb of %s on vgId:%d, offset is %" PRId64, pParam->pOffset->subKey, pParam->->vgId, * pOffset->version);*/ @@ -529,7 +530,6 @@ static int32_t tmqSendCommitReq(tmq_t* tmq, SMqClientVg* pVg, SMqClientTopic* pT int32_t tmqCommitMsgImpl(tmq_t* tmq, const TAOS_RES* msg, int8_t async, tmq_commit_cb* userCb, void* userParam) { char* topic; int32_t vgId; - ASSERT(msg != NULL); if (TD_RES_TMQ(msg)) { SMqRspObj* pRspObj = (SMqRspObj*)msg; topic = pRspObj->topic; @@ -724,7 +724,10 @@ void tmqAssignDelayedReportTask(void* param, void* tmrId) { } int32_t tmqHbCb(void* param, SDataBuf* pMsg, int32_t code) { - if (pMsg && pMsg->pData) taosMemoryFree(pMsg->pData); + if (pMsg) { + taosMemoryFree(pMsg->pData); + taosMemoryFree(pMsg->pEpSet); + } return 0; } @@ -805,8 +808,6 @@ int32_t tmqHandleAllDelayedTask(tmq_t* tmq) { taosTmrReset(tmqAssignDelayedCommitTask, tmq->autoCommitInterval, pRefId, tmqMgmt.timer, &tmq->commitTimer); } else if (*pTaskType == TMQ_DELAYED_TASK__REPORT) { - } else { - ASSERT(0); } taosFreeQitem(pTaskType); } @@ -869,6 +870,8 @@ void tmqClearUnhandleMsg(tmq_t* tmq) { int32_t tmqSubscribeCb(void* param, SDataBuf* pMsg, int32_t code) { SMqSubscribeCbParam* pParam = (SMqSubscribeCbParam*)param; pParam->rspErr = code; + + taosMemoryFree(pMsg->pEpSet); tsem_post(&pParam->rspSem); return 0; } @@ -947,10 +950,6 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) { const char* user = conf->user == NULL ? TSDB_DEFAULT_USER : conf->user; const char* pass = conf->pass == NULL ? TSDB_DEFAULT_PASS : conf->pass; - ASSERT(user); - ASSERT(pass); - ASSERT(conf->groupId[0]); - pTmq->clientTopics = taosArrayInit(0, sizeof(SMqClientTopic)); pTmq->mqueue = taosOpenQueue(); pTmq->qall = taosAllocateQall(); @@ -1166,6 +1165,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { if (code != 0) { tscWarn("msg discard from vgId:%d, epoch %d, since %s", vgId, epoch, terrstr()); if (pMsg->pData) taosMemoryFree(pMsg->pData); + if (pMsg->pEpSet) taosMemoryFree(pMsg->pEpSet); + if (code == TSDB_CODE_TMQ_CONSUMER_MISMATCH) { atomic_store_8(&tmq->status, TMQ_CONSUMER_STATUS__RECOVER); goto CREATE_MSG_FAIL; @@ -1239,8 +1240,6 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) { tDecodeSTaosxRsp(&decoder, &pRspWrapper->taosxRsp); tDecoderClear(&decoder); memcpy(&pRspWrapper->taosxRsp, pMsg->pData, sizeof(SMqRspHead)); - } else { - ASSERT(0); } taosMemoryFree(pMsg->pData); @@ -1365,6 +1364,7 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) { taosMemoryFree(pParam); } taosMemoryFree(pMsg->pData); + taosMemoryFree(pMsg->pEpSet); terrno = TSDB_CODE_TMQ_CONSUMER_CLOSED; return -1; } @@ -1416,6 +1416,8 @@ END: } else { taosMemoryFree(pParam); } + + taosMemoryFree(pMsg->pEpSet); taosMemoryFree(pMsg->pData); return code; } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index f57d59fb41..9caf0cc33e 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -96,6 +96,7 @@ int32_t tsRedirectPeriod = 10; int32_t tsRedirectFactor = 2; int32_t tsRedirectMaxPeriod = 1000; int32_t tsMaxRetryWaitTime = 10000; +bool tsUseAdapter = false; /* * denote if the server needs to compress response message at the application layer to client, including query rsp, @@ -201,9 +202,7 @@ 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) { @@ -314,6 +313,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { 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, "maxRetryWaitTime", tsMaxRetryWaitTime, 0, 86400000, 0) != 0) return -1; + if (cfgAddBool(pCfg, "useAdapter", tsUseAdapter, true) != 0) return -1; tsNumOfTaskQueueThreads = tsNumOfCores / 2; tsNumOfTaskQueueThreads = TMAX(tsNumOfTaskQueueThreads, 4); @@ -668,6 +668,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { tsQueryNodeChunkSize = cfgGetItem(pCfg, "queryNodeChunkSize")->i32; tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval; tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval; + tsUseAdapter = cfgGetItem(pCfg, "useAdapter")->bval; tsMaxRetryWaitTime = cfgGetItem(pCfg, "maxRetryWaitTime")->i32; return 0; diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 3c42f7b832..4e93a1d96e 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -174,6 +174,7 @@ typedef struct { void* param; char opername[TSDB_TRANS_OPER_LEN]; SArray* pRpcArray; + SRWLatch lockRpcArray; } STrans; typedef struct { diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 0a00980c14..b2ca1e7ad8 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -133,7 +133,10 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) { SMnode *pMnode = pMsg->info.node; SMqConsumerRecoverMsg *pRecoverMsg = pMsg->pCont; SMqConsumerObj *pConsumer = mndAcquireConsumer(pMnode, pRecoverMsg->consumerId); - ASSERT(pConsumer); + if (pConsumer == NULL) { + mError("cannot find consumer %" PRId64 " when processing consumer recover msg", pRecoverMsg->consumerId); + return -1; + } mInfo("receive consumer recover msg, consumer id %" PRId64 ", status %s", pRecoverMsg->consumerId, mndConsumerStatusName(pConsumer->status)); @@ -381,8 +384,6 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) { return -1; } - ASSERT(strcmp(req.cgroup, pConsumer->cgroup) == 0); - atomic_store_32(&pConsumer->hbStatus, 0); // 1. check consumer status @@ -428,9 +429,8 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) { for (int32_t i = 0; i < numOfTopics; i++) { char *topic = taosArrayGetP(pConsumer->currentTopics, i); SMqSubscribeObj *pSub = mndAcquireSubscribe(pMnode, pConsumer->cgroup, topic); - // txn guarantees pSub is created - ASSERT(pSub); + taosRLockLatch(&pSub->lock); SMqSubTopicEp topicEp = {0}; @@ -438,7 +438,6 @@ static int32_t mndProcessAskEpReq(SRpcMsg *pMsg) { // 2.1 fetch topic schema SMqTopicObj *pTopic = mndAcquireTopic(pMnode, topic); - ASSERT(pTopic); taosRLockLatch(&pTopic->lock); tstrncpy(topicEp.db, pTopic->db, TSDB_DB_FNAME_LEN); topicEp.schema.nCols = pTopic->schema.nCols; @@ -779,8 +778,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, taosWLockLatch(&pOldConsumer->lock); if (pNewConsumer->updateType == CONSUMER_UPDATE__MODIFY) { - ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0); - ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0); + /*A(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);*/ + /*A(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);*/ if (taosArrayGetSize(pNewConsumer->rebNewTopics) == 0 && taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0) { pOldConsumer->status = MQ_CONSUMER_STATUS__READY; @@ -802,8 +801,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, pOldConsumer->status = MQ_CONSUMER_STATUS__MODIFY; } } else if (pNewConsumer->updateType == CONSUMER_UPDATE__LOST) { - ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0); - ASSERT(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0); + /*A(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);*/ + /*A(taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0);*/ int32_t sz = taosArrayGetSize(pOldConsumer->currentTopics); /*pOldConsumer->rebRemovedTopics = taosArrayInit(sz, sizeof(void *));*/ @@ -816,8 +815,8 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, pOldConsumer->status = MQ_CONSUMER_STATUS__LOST; } else if (pNewConsumer->updateType == CONSUMER_UPDATE__RECOVER) { - ASSERT(taosArrayGetSize(pOldConsumer->currentTopics) == 0); - ASSERT(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0); + /*A(taosArrayGetSize(pOldConsumer->currentTopics) == 0);*/ + /*A(taosArrayGetSize(pOldConsumer->rebNewTopics) == 0);*/ int32_t sz = taosArrayGetSize(pOldConsumer->assignedTopics); for (int32_t i = 0; i < sz; i++) { @@ -834,15 +833,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, pOldConsumer->rebalanceTime = pNewConsumer->upTime; } else if (pNewConsumer->updateType == CONSUMER_UPDATE__ADD) { - ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1); - ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0); + /*A(taosArrayGetSize(pNewConsumer->rebNewTopics) == 1);*/ + /*A(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 0);*/ char *addedTopic = strdup(taosArrayGetP(pNewConsumer->rebNewTopics, 0)); // not exist in current topic -#if 1 +#if 0 for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->currentTopics); i++) { char *topic = taosArrayGetP(pOldConsumer->currentTopics, i); - ASSERT(strcmp(topic, addedTopic) != 0); + A(strcmp(topic, addedTopic) != 0); } #endif @@ -883,15 +882,15 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, atomic_add_fetch_32(&pOldConsumer->epoch, 1); } else if (pNewConsumer->updateType == CONSUMER_UPDATE__REMOVE) { - ASSERT(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0); - ASSERT(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1); + /*A(taosArrayGetSize(pNewConsumer->rebNewTopics) == 0);*/ + /*A(taosArrayGetSize(pNewConsumer->rebRemovedTopics) == 1);*/ char *removedTopic = taosArrayGetP(pNewConsumer->rebRemovedTopics, 0); // not exist in new topic -#if 1 +#if 0 for (int32_t i = 0; i < taosArrayGetSize(pOldConsumer->rebNewTopics); i++) { char *topic = taosArrayGetP(pOldConsumer->rebNewTopics, i); - ASSERT(strcmp(topic, removedTopic) != 0); + A(strcmp(topic, removedTopic) != 0); } #endif @@ -917,7 +916,7 @@ static int32_t mndConsumerActionUpdate(SSdb *pSdb, SMqConsumerObj *pOldConsumer, } } // must find the topic - ASSERT(i < sz); + /*A(i < sz);*/ // set status if (taosArrayGetSize(pOldConsumer->rebNewTopics) == 0 && taosArrayGetSize(pOldConsumer->rebRemovedTopics) == 0) { diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index af1a29def0..bdef8000bd 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -115,13 +115,11 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream if (pStream->fixedSinkVgId == 0) { SDbObj* pDb = mndAcquireDb(pMnode, pStream->targetDb); - ASSERT(pDb); if (pDb->cfg.numOfVgroups > 1) { isShuffle = true; pTask->outputType = TASK_OUTPUT__SHUFFLE_DISPATCH; pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH; if (mndExtractDbInfo(pMnode, pDb, &pTask->shuffleDispatcher.dbInfo, NULL) < 0) { - ASSERT(0); return -1; } } @@ -140,9 +138,7 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream for (int32_t j = 0; j < sinkLvSize; j++) { SStreamTask* pLastLevelTask = taosArrayGetP(sinkLv, j); if (pLastLevelTask->nodeId == pVgInfo->vgId) { - ASSERT(pVgInfo->vgId > 0); pVgInfo->taskId = pLastLevelTask->taskId; - ASSERT(pVgInfo->taskId != 0); break; } } @@ -152,7 +148,6 @@ int32_t mndAddDispatcherToInnerTask(SMnode* pMnode, SStreamObj* pStream, SStream pTask->dispatchMsgType = TDMT_STREAM_TASK_DISPATCH; SArray* pArray = taosArrayGetP(pStream->tasks, 0); // one sink only - ASSERT(taosArrayGetSize(pArray) == 1); SStreamTask* lastLevelTask = taosArrayGetP(pArray, 0); pTask->fixedEpDispatcher.taskId = lastLevelTask->taskId; pTask->fixedEpDispatcher.nodeId = lastLevelTask->nodeId; @@ -170,7 +165,6 @@ int32_t mndAssignTaskToVg(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan, co plan->execNode.epSet = pTask->epSet; if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) { - ASSERT(0); terrno = TSDB_CODE_QRY_INVALID_INPUT; return -1; } @@ -195,7 +189,6 @@ int32_t mndAssignTaskToSnode(SMnode* pMnode, SStreamTask* pTask, SSubplan* plan, plan->execNode.epSet = pTask->epSet; if (qSubPlanToString(plan, &pTask->exec.qmsg, &msgLen) < 0) { - ASSERT(0); terrno = TSDB_CODE_QRY_INVALID_INPUT; return -1; } @@ -222,8 +215,6 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) { void* pIter = NULL; SArray* tasks = taosArrayGetP(pStream->tasks, 0); - ASSERT(taosArrayGetSize(pStream->tasks) == 1); - while (1) { SVgObj* pVgroup = NULL; pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void**)&pVgroup); @@ -257,7 +248,10 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) { pTask->tbSink.stbUid = pStream->targetStbUid; memcpy(pTask->tbSink.stbFullName, pStream->targetSTbName, TSDB_TABLE_FNAME_LEN); pTask->tbSink.pSchemaWrapper = tCloneSSchemaWrapper(&pStream->outputSchema); - ASSERT(pTask->tbSink.pSchemaWrapper); + if (pTask->tbSink.pSchemaWrapper == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } } sdbRelease(pSdb, pVgroup); } @@ -265,7 +259,6 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) { } int32_t mndAddFixedSinkTaskToStream(SMnode* pMnode, SStreamObj* pStream) { - ASSERT(pStream->fixedSinkVgId != 0); SArray* tasks = taosArrayGetP(pStream->tasks, 0); SStreamTask* pTask = tNewSStreamTask(pStream->uid); if (pTask == NULL) { @@ -275,8 +268,6 @@ int32_t mndAddFixedSinkTaskToStream(SMnode* pMnode, SStreamObj* pStream) { pTask->fillHistory = pStream->fillHistory; mndAddTaskToTaskSet(tasks, pTask); - ASSERT(pStream->fixedSinkVg.vgId == pStream->fixedSinkVgId); - pTask->nodeId = pStream->fixedSinkVgId; #if 0 SVgObj* pVgroup = mndAcquireVgroup(pMnode, pStream->fixedSinkVgId); @@ -311,13 +302,16 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { return -1; } int32_t planTotLevel = LIST_LENGTH(pPlan->pSubplans); - ASSERT(planTotLevel <= 2); + pStream->tasks = taosArrayInit(planTotLevel, sizeof(void*)); bool hasExtraSink = false; bool externalTargetDB = strcmp(pStream->sourceDb, pStream->targetDb) != 0; SDbObj* pDbObj = mndAcquireDb(pMnode, pStream->targetDb); - ASSERT(pDbObj != NULL); + if (pDbObj == NULL) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } bool multiTarget = pDbObj->cfg.numOfVgroups > 1; sdbRelease(pSdb, pDbObj); @@ -351,7 +345,10 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); - ASSERT(plan->subplanType == SUBPLAN_TYPE_MERGE); + if (plan->subplanType != SUBPLAN_TYPE_MERGE) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } pInnerTask = tNewSStreamTask(pStream->uid); if (pInnerTask == NULL) { @@ -409,7 +406,10 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 1); SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); - ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN); + if (plan->subplanType != SUBPLAN_TYPE_SCAN) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } void* pIter = NULL; while (1) { @@ -471,9 +471,15 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { taosArrayPush(pStream->tasks, &taskOneLevel); SNodeListNode* inner = (SNodeListNode*)nodesListGetNode(pPlan->pSubplans, 0); - ASSERT(LIST_LENGTH(inner->pNodeList) == 1); + if (LIST_LENGTH(inner->pNodeList) != 1) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } SSubplan* plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); - ASSERT(plan->subplanType == SUBPLAN_TYPE_SCAN); + if (plan->subplanType != SUBPLAN_TYPE_SCAN) { + terrno = TSDB_CODE_QRY_INVALID_INPUT; + return -1; + } void* pIter = NULL; while (1) { @@ -550,9 +556,6 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib plan = (SSubplan*)nodesListGetNode(inner->pNodeList, 0); } - ASSERT(pSub->unassignedVgs); - ASSERT(taosHashGetSize(pSub->consumerHash) == 0); - void* pIter = NULL; while (1) { pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void**)&pVgroup); @@ -590,10 +593,6 @@ int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscrib sdbRelease(pSdb, pVgroup); } - ASSERT(pSub->unassignedVgs->size > 0); - - ASSERT(taosHashGetSize(pSub->consumerHash) == 0); - qDestroyQueryPlan(pPlan); return 0; diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 05c0594339..10ecd56280 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -326,13 +326,11 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, // deserialize ast if (nodesStringToNode(pObj->ast, &pAst) < 0) { - /*ASSERT(0);*/ goto FAIL; } // extract output schema from ast if (qExtractResultSchema(pAst, (int32_t *)&pObj->outputSchema.nCols, &pObj->outputSchema.pSchema) != 0) { - /*ASSERT(0);*/ goto FAIL; } @@ -347,13 +345,11 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, // using ast and param to build physical plan if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { - /*ASSERT(0);*/ goto FAIL; } // save physcial plan if (nodesNodeToString((SNode *)pPlan, false, &pObj->physicalPlan, NULL) != 0) { - /*ASSERT(0);*/ goto FAIL; } @@ -361,7 +357,7 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, if (pCreate->numOfTags) { pObj->tagSchema.pSchema = taosMemoryCalloc(pCreate->numOfTags, sizeof(SSchema)); } - ASSERT(pCreate->numOfTags == taosArrayGetSize(pCreate->pTags)); + /*A(pCreate->numOfTags == taosArrayGetSize(pCreate->pTags));*/ for (int32_t i = 0; i < pCreate->numOfTags; i++) { SField *pField = taosArrayGet(pCreate->pTags, i); pObj->tagSchema.pSchema[i].colId = pObj->outputSchema.nCols + i + 1; @@ -378,9 +374,6 @@ FAIL: } int32_t mndPersistTaskDeployReq(STrans *pTrans, const SStreamTask *pTask) { - if (pTask->taskLevel == TASK_LEVEL__AGG) { - ASSERT(taosArrayGetSize(pTask->childEpInfo) != 0); - } SEncoder encoder; tEncoderInit(&encoder, NULL, 0); tEncodeSStreamTask(&encoder, pTask); @@ -545,8 +538,6 @@ _OVER: } static int32_t mndPersistTaskDropReq(STrans *pTrans, SStreamTask *pTask) { - ASSERT(pTask->nodeId != 0); - // vnode /*if (pTask->nodeId > 0) {*/ SVDropStreamTaskReq *pReq = taosMemoryCalloc(1, sizeof(SVDropStreamTaskReq)); @@ -800,10 +791,9 @@ static int32_t mndProcessStreamDoCheckpoint(SRpcMsg *pReq) { int32_t sz = taosArrayGetSize(pLevel); for (int32_t j = 0; j < sz; j++) { SStreamTask *pTask = taosArrayGetP(pLevel, j); - ASSERT(pTask->nodeId > 0); + /*A(pTask->nodeId > 0);*/ SVgObj *pVgObj = mndAcquireVgroup(pMnode, pTask->nodeId); if (pVgObj == NULL) { - ASSERT(0); taosRUnLockLatch(&pStream->lock); mndReleaseStream(pMnode, pStream); mndTransDrop(pTrans); @@ -863,7 +853,6 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) { SMDropStreamReq dropReq = {0}; if (tDeserializeSMDropStreamReq(pReq->pCont, pReq->contLen, &dropReq) < 0) { - ASSERT(0); terrno = TSDB_CODE_INVALID_MSG; return -1; } diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index d2fc2dc9b1..b92be19741 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -628,6 +628,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict, pTrans->undoActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction)); pTrans->commitActions = taosArrayInit(TRANS_ARRAY_SIZE, sizeof(STransAction)); pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo)); + taosInitRWLatch(&pTrans->lockRpcArray); if (pTrans->redoActions == NULL || pTrans->undoActions == NULL || pTrans->commitActions == NULL || pTrans->pRpcArray == NULL) { @@ -737,12 +738,14 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c if (pTrans->oper == oper) { if (strcasecmp(dbname, pTrans->dbname) == 0) { mInfo("trans:%d, db:%s oper:%d matched with input", pTrans->id, dbname, oper); + taosWLockLatch(&pTrans->lockRpcArray); if (pTrans->pRpcArray == NULL) { - pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo)); + pTrans->pRpcArray = taosArrayInit(4, sizeof(SRpcHandleInfo)); } if (pTrans->pRpcArray != NULL && taosArrayPush(pTrans->pRpcArray, &pMsg->info) != NULL) { code = 0; } + taosWUnLockLatch(&pTrans->lockRpcArray); sdbRelease(pMnode->pSdb, pTrans); break; @@ -944,8 +947,12 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) { pTrans->failedTimes, code); } + taosWLockLatch(&pTrans->lockRpcArray); int32_t size = taosArrayGetSize(pTrans->pRpcArray); - if (size <= 0) return; + if (size <= 0) { + taosWUnLockLatch(&pTrans->lockRpcArray); + return; + } for (int32_t i = 0; i < size; ++i) { SRpcHandleInfo *pInfo = taosArrayGet(pTrans->pRpcArray, i); @@ -997,6 +1004,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) { } } taosArrayClear(pTrans->pRpcArray); + taosWUnLockLatch(&pTrans->lockRpcArray); } int32_t mndTransProcessRsp(SRpcMsg *pRsp) { diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index 806ba0c98e..efce6255fb 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -838,9 +838,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock if (pUser->superUser) { cols = 0; - SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - char userName[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; + char userName[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(userName, pUser->user, pShow->pMeta->pSchemas[cols].bytes); + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)userName, false); char privilege[20] = {0}; @@ -859,9 +859,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock char *db = taosHashIterate(pUser->readDbs, NULL); while (db != NULL) { cols = 0; - SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - char userName[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; + char userName[TSDB_USER_LEN + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(userName, pUser->user, pShow->pMeta->pSchemas[cols].bytes); + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)userName, false); char privilege[20] = {0}; diff --git a/source/dnode/vnode/src/meta/metaSnapshot.c b/source/dnode/vnode/src/meta/metaSnapshot.c index 974f8a9218..054e785980 100644 --- a/source/dnode/vnode/src/meta/metaSnapshot.c +++ b/source/dnode/vnode/src/meta/metaSnapshot.c @@ -161,7 +161,10 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) { SMetaSnapWriter* pWriter = *ppWriter; if (rollback) { + metaInfo("vgId:%d, meta snapshot writer close and rollback start ", TD_VID(pWriter->pMeta->pVnode)); code = metaAbort(pWriter->pMeta); + metaInfo("vgId:%d, meta snapshot writer close and rollback finished, code:0x%x", TD_VID(pWriter->pMeta->pVnode), + code); if (code) goto _err; } else { code = metaCommit(pWriter->pMeta, pWriter->pMeta->txn); diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 722a93137c..dc295ae5e7 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -710,6 +710,9 @@ int metaUpdateCtimeIdx(SMeta *pMeta, const SMetaEntry *pME) { if (metaBuildCtimeIdxKey(&ctimeKey, pME) < 0) { return 0; } + metaDebug("vgId:%d, start to save ctime:%" PRId64 " uid:%" PRId64 " ct:%" PRId64, TD_VID(pMeta->pVnode), pME->version, + pME->uid, ctimeKey.ctime); + return tdbTbInsert(pMeta->pCtimeIdx, &ctimeKey, sizeof(ctimeKey), NULL, 0, pMeta->txn); } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index fdaedd795b..6490906298 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -92,21 +92,21 @@ STQ* tqOpen(const char* path, SVnode* pVnode) { taosHashSetFreeFp(pTq->pCheckInfo, (FDelete)tDeleteSTqCheckInfo); if (tqMetaOpen(pTq) < 0) { - ASSERT(0); + return NULL; } pTq->pOffsetStore = tqOffsetOpen(pTq); if (pTq->pOffsetStore == NULL) { - ASSERT(0); + return NULL; } pTq->pStreamMeta = streamMetaOpen(path, pTq, (FTaskExpand*)tqExpandTask, pTq->pVnode->config.vgId); if (pTq->pStreamMeta == NULL) { - ASSERT(0); + return NULL; } if (streamLoadTasks(pTq->pStreamMeta) < 0) { - ASSERT(0); + return NULL; } return pTq; @@ -166,19 +166,17 @@ int32_t tqSendMetaPollRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) { SMqDataRsp* pRsp = &pPushEntry->dataRsp; - ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); - ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); +#if 0 + A(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); + A(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); - ASSERT(!pRsp->withSchema); - ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0); + A(!pRsp->withSchema); + A(taosArrayGetSize(pRsp->blockSchema) == 0); if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) { - /*if (pRsp->blockNum > 0) {*/ - /*ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);*/ - /*} else {*/ - ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version); - /*}*/ + A(pRsp->rspOffset.version > pRsp->reqOffset.version); } +#endif int32_t len = 0; int32_t code = 0; @@ -223,19 +221,21 @@ int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) { } int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp) { - ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); - ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); +#if 0 + A(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); + A(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); - ASSERT(!pRsp->withSchema); - ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0); + A(!pRsp->withSchema); + A(taosArrayGetSize(pRsp->blockSchema) == 0); if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) { if (pRsp->blockNum > 0) { - ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version); + A(pRsp->rspOffset.version > pRsp->reqOffset.version); } else { - ASSERT(pRsp->rspOffset.version >= pRsp->reqOffset.version); + A(pRsp->rspOffset.version >= pRsp->reqOffset.version); } } +#endif int32_t len = 0; int32_t code = 0; @@ -279,22 +279,24 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con } int32_t tqSendTaosxRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const STaosxRsp* pRsp) { - ASSERT(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); - ASSERT(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); +#if 0 + A(taosArrayGetSize(pRsp->blockData) == pRsp->blockNum); + A(taosArrayGetSize(pRsp->blockDataLen) == pRsp->blockNum); if (pRsp->withSchema) { - ASSERT(taosArrayGetSize(pRsp->blockSchema) == pRsp->blockNum); + A(taosArrayGetSize(pRsp->blockSchema) == pRsp->blockNum); } else { - ASSERT(taosArrayGetSize(pRsp->blockSchema) == 0); + A(taosArrayGetSize(pRsp->blockSchema) == 0); } if (pRsp->reqOffset.type == TMQ_OFFSET__LOG) { if (pRsp->blockNum > 0) { - ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version); + A(pRsp->rspOffset.version > pRsp->reqOffset.version); } else { - ASSERT(pRsp->rspOffset.version >= pRsp->reqOffset.version); + A(pRsp->rspOffset.version >= pRsp->reqOffset.version); } } +#endif int32_t len = 0; int32_t code = 0; @@ -348,7 +350,6 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m SDecoder decoder; tDecoderInit(&decoder, msg, msgLen); if (tDecodeSTqOffset(&decoder, &offset) < 0) { - ASSERT(0); return -1; } tDecoderClear(&decoder); @@ -362,8 +363,8 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m if (offset.val.version + 1 == version) { offset.val.version += 1; } - } else { - ASSERT(0); + /*} else {*/ + /*A(0);*/ } STqOffset* pOffset = tqOffsetRead(pTq->pOffsetStore, offset.subKey); if (pOffset != NULL && tqOffsetLessOrEqual(&offset, pOffset)) { @@ -371,7 +372,6 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t version, char* msg, int32_t m } if (tqOffsetWrite(pTq->pOffsetStore, &offset) < 0) { - ASSERT(0); return -1; } @@ -434,7 +434,7 @@ static int32_t tqInitDataRsp(SMqDataRsp* pRsp, const SMqPollReq* pReq, int8_t su } #endif - ASSERT(subType == TOPIC_SUB_TYPE__COLUMN); + /*A(subType == TOPIC_SUB_TYPE__COLUMN);*/ pRsp->withSchema = false; return 0; @@ -473,7 +473,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { // 1.find handle STqHandle* pHandle = taosHashGet(pTq->pHandle, req.subKey, strlen(req.subKey)); - /*ASSERT(pHandle);*/ if (pHandle == NULL) { tqError("tmq poll: no consumer handle for consumer:%" PRId64 ", in vgId:%d, subkey %s", consumerId, TD_VID(pTq->pVnode), req.subKey); @@ -560,7 +559,9 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { tqInitDataRsp(&dataRsp, &req, pHandle->execHandle.subType); // lock taosWLockLatch(&pTq->pushLock); - tqScanData(pTq, pHandle, &dataRsp, &fetchOffsetNew); + if (tqScanData(pTq, pHandle, &dataRsp, &fetchOffsetNew) < 0) { + return -1; + } #if 1 if (dataRsp.blockNum == 0 && dataRsp.reqOffset.type == TMQ_OFFSET__LOG && @@ -599,7 +600,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { } // for taosx - ASSERT(pHandle->execHandle.subType != TOPIC_SUB_TYPE__COLUMN); + /*A(pHandle->execHandle.subType != TOPIC_SUB_TYPE__COLUMN);*/ SMqMetaRsp metaRsp = {0}; @@ -607,7 +608,9 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { tqInitTaosxRsp(&taosxRsp, &req); if (fetchOffsetNew.type != TMQ_OFFSET__LOG) { - tqScanTaosx(pTq, pHandle, &taosxRsp, &metaRsp, &fetchOffsetNew); + if (tqScanTaosx(pTq, pHandle, &taosxRsp, &metaRsp, &fetchOffsetNew) < 0) { + return -1; + } if (metaRsp.metaRspLen > 0) { if (tqSendMetaPollRsp(pTq, pMsg, &req, &metaRsp) < 0) { @@ -693,8 +696,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { } } else { - ASSERT(pHandle->fetchMeta); - ASSERT(IS_META_MSG(pHead->msgType)); + /*A(pHandle->fetchMeta);*/ + /*A(IS_META_MSG(pHead->msgType));*/ tqDebug("fetch meta msg, ver:%" PRId64 ", type:%d", pHead->version, pHead->msgType); tqOffsetResetToLog(&metaRsp.rspOffset, fetchVer); metaRsp.resMsgType = pHead->msgType; @@ -730,7 +733,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t version, char* msg, int32_t msgL STqHandle* pHandle = taosHashGet(pTq->pHandle, pReq->subKey, strlen(pReq->subKey)); if (pHandle) { - //walCloseRef(pHandle->pWalReader->pWal, pHandle->pRef->refId); + // walCloseRef(pHandle->pWalReader->pWal, pHandle->pRef->refId); if (pHandle->pRef) { walCloseRef(pTq->pVnode->pWal, pHandle->pRef->refId); } @@ -812,7 +815,6 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL // TODO version should be assigned and refed during preprocess SWalRef* pRef = walRefCommittedVer(pTq->pVnode->pWal); if (pRef == NULL) { - ASSERT(0); return -1; } int64_t ver = pRef->refVer; @@ -833,12 +835,12 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL pHandle->execHandle.task = qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, &pHandle->execHandle.numOfCols, NULL); - ASSERT(pHandle->execHandle.task); + /*A(pHandle->execHandle.task);*/ void* scanner = NULL; qExtractStreamScanner(pHandle->execHandle.task, &scanner); - ASSERT(scanner); + /*A(scanner);*/ pHandle->execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner); - ASSERT(pHandle->execHandle.pExecReader); + /*A(pHandle->execHandle.pExecReader);*/ } else if (pHandle->execHandle.subType == TOPIC_SUB_TYPE__DB) { pHandle->pWalReader = walOpenReader(pTq->pVnode->pWal, NULL); pHandle->execHandle.pExecReader = tqOpenReader(pTq->pVnode); @@ -871,19 +873,14 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL taosHashPut(pTq->pHandle, req.subKey, strlen(req.subKey), pHandle, sizeof(STqHandle)); tqDebug("try to persist handle %s consumer %" PRId64, req.subKey, pHandle->consumerId); if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) { - // TODO - ASSERT(0); } } else { - /*ASSERT(pExec->consumerId == req.oldConsumerId);*/ // TODO handle qmsg and exec modification atomic_store_32(&pHandle->epoch, -1); atomic_store_64(&pHandle->consumerId, req.newConsumerId); atomic_add_fetch_32(&pHandle->epoch, 1); taosMemoryFree(req.qmsg); if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) { - // TODO - ASSERT(0); } // close handle } @@ -892,9 +889,11 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) { +#if 0 if (pTask->taskLevel == TASK_LEVEL__AGG) { - ASSERT(taosArrayGetSize(pTask->childEpInfo) != 0); + A(taosArrayGetSize(pTask->childEpInfo) != 0); } +#endif pTask->refCnt = 1; pTask->schedStatus = TASK_SCHED_STATUS__INACTIVE; @@ -931,7 +930,9 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) { .pStateBackend = pTask->pState, }; pTask->exec.executor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &handle); - ASSERT(pTask->exec.executor); + if (pTask->exec.executor == NULL) { + return -1; + } } else if (pTask->taskLevel == TASK_LEVEL__AGG) { pTask->pState = streamStateOpen(pTq->pStreamMeta->path, pTask, false, -1, -1); @@ -944,7 +945,9 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) { .pStateBackend = pTask->pState, }; pTask->exec.executor = qCreateStreamExecTaskInfo(pTask->exec.qmsg, &mgHandle); - ASSERT(pTask->exec.executor); + if (pTask->exec.executor == NULL) { + return -1; + } } // sink @@ -956,8 +959,8 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) { pTask->tbSink.vnode = pTq->pVnode; pTask->tbSink.tbSinkFunc = tqSinkToTablePipeline2; - ASSERT(pTask->tbSink.pSchemaWrapper); - ASSERT(pTask->tbSink.pSchemaWrapper->pSchema); + /*A(pTask->tbSink.pSchemaWrapper);*/ + /*A(pTask->tbSink.pSchemaWrapper->pSchema);*/ pTask->tbSink.pTSchema = tBuildTSchema(pTask->tbSink.pSchemaWrapper->pSchema, pTask->tbSink.pSchemaWrapper->nCols, 1); @@ -1007,7 +1010,8 @@ int32_t tqProcessStreamTaskCheckReq(STQ* pTq, SRpcMsg* pMsg) { int32_t len; tEncodeSize(tEncodeSStreamTaskCheckRsp, &rsp, len, code); if (code < 0) { - ASSERT(0); + tqError("unable to encode rsp %d", __LINE__); + return -1; } void* buf = rpcMallocCont(sizeof(SMsgHead) + len); ((SMsgHead*)buf)->vgId = htonl(req.upstreamNodeId); @@ -1100,12 +1104,10 @@ int32_t tqProcessTaskRecover1Req(STQ* pTq, SRpcMsg* pMsg) { if (pTask == NULL) { return -1; } - ASSERT(pReq->taskId == pTask->taskId); // check param int64_t fillVer1 = pTask->startVer; if (fillVer1 <= 0) { - ASSERT(0); streamMetaReleaseTask(pTq->pStreamMeta, pTask); return -1; } @@ -1300,7 +1302,7 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { } int32_t ref = atomic_sub_fetch_32(pRef, 1); - ASSERT(ref >= 0); + /*A(ref >= 0);*/ if (ref == 0) { blockDataDestroy(pDelBlock); taosMemoryFree(pRef); diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index 1074e2f6d5..8e80f81fed 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -29,7 +29,6 @@ int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t int32_t actualLen = blockEncode(pBlock, pRetrieve->data, numOfCols); actualLen += sizeof(SRetrieveTableRsp); - ASSERT(actualLen <= dataStrLen); taosArrayPush(pRsp->blockDataLen, &actualLen); taosArrayPush(pRsp->blockData, &buf); return 0; @@ -62,7 +61,6 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, SMqDataRsp* pRsp, i int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal* pOffset) { const STqExecHandle* pExec = &pHandle->execHandle; - ASSERT(pExec->subType == TOPIC_SUB_TYPE__COLUMN); qTaskInfo_t task = pExec->task; @@ -87,7 +85,8 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs uint64_t ts = 0; tqDebug("vgId:%d, tmq task start to execute", pTq->pVnode->config.vgId); if (qExecTask(task, &pDataBlock, &ts) < 0) { - ASSERT(0); + tqError("vgId:%d task exec error since %s", pTq->pVnode->config.vgId, terrstr()); + return -1; } tqDebug("vgId:%d, tmq task executed, get %p", pTq->pVnode->config.vgId, pDataBlock); @@ -105,10 +104,14 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs } if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) { - ASSERT(0); return -1; } - ASSERT(pRsp->rspOffset.type != 0); + + if (pRsp->rspOffset.type == 0) { + tqError("expected rsp offset: type %d %" PRId64 " %" PRId64 " %" PRId64, pRsp->rspOffset.type, pRsp->rspOffset.ts, + pRsp->rspOffset.uid, pRsp->rspOffset.version); + return -1; + } ASSERT(pRsp->withTbName == false); ASSERT(pRsp->withSchema == false); @@ -141,7 +144,8 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta uint64_t ts = 0; tqDebug("tmqsnap task start to execute"); if (qExecTask(task, &pDataBlock, &ts) < 0) { - ASSERT(0); + tqError("vgId:%d task exec error since %s", pTq->pVnode->config.vgId, terrstr()); + return -1; } tqDebug("tmqsnap task execute end, get %p", pDataBlock); @@ -207,17 +211,20 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta break; } - if (qStreamExtractOffset(task, &pRsp->rspOffset) < 0) { - ASSERT(0); + qStreamExtractOffset(task, &pRsp->rspOffset); + + if (pRsp->rspOffset.type == 0) { + tqError("expected rsp offset: type %d %" PRId64 " %" PRId64 " %" PRId64, pRsp->rspOffset.type, pRsp->rspOffset.ts, + pRsp->rspOffset.uid, pRsp->rspOffset.version); + return -1; } - ASSERT(pRsp->rspOffset.type != 0); return 0; } int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp) { STqExecHandle* pExec = &pHandle->execHandle; - ASSERT(pExec->subType != TOPIC_SUB_TYPE__COLUMN); + /*A(pExec->subType != TOPIC_SUB_TYPE__COLUMN);*/ SArray* pBlocks = taosArrayInit(0, sizeof(SSDataBlock)); SArray* pSchemas = taosArrayInit(0, sizeof(void*)); diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c index f476f58b56..05ed8d7348 100644 --- a/source/dnode/vnode/src/tq/tqMeta.c +++ b/source/dnode/vnode/src/tq/tqMeta.c @@ -71,17 +71,14 @@ int32_t tDecodeSTqHandle(SDecoder* pDecoder, STqHandle* pHandle) { int32_t tqMetaOpen(STQ* pTq) { if (tdbOpen(pTq->path, 16 * 1024, 1, &pTq->pMetaDB, 0) < 0) { - ASSERT(0); return -1; } if (tdbTbOpen("tq.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pExecStore, 0) < 0) { - ASSERT(0); return -1; } if (tdbTbOpen("tq.check.db", -1, -1, NULL, pTq->pMetaDB, &pTq->pCheckStore, 0) < 0) { - ASSERT(0); return -1; } @@ -135,19 +132,19 @@ int32_t tqMetaDeleteCheckInfo(STQ* pTq, const char* key) { if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) < 0) { - ASSERT(0); + return -1; } if (tdbTbDelete(pTq->pCheckStore, key, (int)strlen(key), txn) < 0) { - /*ASSERT(0);*/ + tqWarn("vgId:%d, tq try delete checkinfo failed %s", pTq->pVnode->config.vgId, key); } if (tdbCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } if (tdbPostCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } return 0; @@ -156,7 +153,6 @@ int32_t tqMetaDeleteCheckInfo(STQ* pTq, const char* key) { int32_t tqMetaRestoreCheckInfo(STQ* pTq) { TBC* pCur = NULL; if (tdbTbcOpen(pTq->pCheckStore, &pCur, NULL) < 0) { - ASSERT(0); return -1; } @@ -197,40 +193,42 @@ int32_t tqMetaSaveHandle(STQ* pTq, const char* key, const STqHandle* pHandle) { int32_t code; int32_t vlen; tEncodeSize(tEncodeSTqHandle, pHandle, vlen, code); - ASSERT(code == 0); + if (code < 0) { + return -1; + } tqDebug("tq save %s(%d) consumer %" PRId64 " vgId:%d", pHandle->subKey, (int32_t)strlen(pHandle->subKey), pHandle->consumerId, TD_VID(pTq->pVnode)); void* buf = taosMemoryCalloc(1, vlen); if (buf == NULL) { - ASSERT(0); + return -1; } SEncoder encoder; tEncoderInit(&encoder, buf, vlen); if (tEncodeSTqHandle(&encoder, pHandle) < 0) { - ASSERT(0); + return -1; } TXN* txn; if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) < 0) { - ASSERT(0); + return -1; } if (tdbTbUpsert(pTq->pExecStore, key, (int)strlen(key), buf, vlen, txn) < 0) { - ASSERT(0); + return -1; } if (tdbCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } if (tdbPostCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } tEncoderClear(&encoder); @@ -243,19 +241,18 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) { if (tdbBegin(pTq->pMetaDB, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED) < 0) { - ASSERT(0); + return -1; } if (tdbTbDelete(pTq->pExecStore, key, (int)strlen(key), txn) < 0) { - /*ASSERT(0);*/ } if (tdbCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } if (tdbPostCommit(pTq->pMetaDB, txn) < 0) { - ASSERT(0); + return -1; } return 0; @@ -264,7 +261,6 @@ int32_t tqMetaDeleteHandle(STQ* pTq, const char* key) { int32_t tqMetaRestoreHandle(STQ* pTq) { TBC* pCur = NULL; if (tdbTbcOpen(pTq->pExecStore, &pCur, NULL) < 0) { - ASSERT(0); return -1; } @@ -284,7 +280,6 @@ int32_t tqMetaRestoreHandle(STQ* pTq) { handle.pRef = walOpenRef(pTq->pVnode->pWal); if (handle.pRef == NULL) { - ASSERT(0); return -1; } walRefVer(handle.pRef, handle.snapshotVer); @@ -300,12 +295,19 @@ int32_t tqMetaRestoreHandle(STQ* pTq) { if (handle.execHandle.subType == TOPIC_SUB_TYPE__COLUMN) { handle.execHandle.task = qCreateQueueExecTaskInfo(handle.execHandle.execCol.qmsg, &reader, &handle.execHandle.numOfCols, NULL); - ASSERT(handle.execHandle.task); + if (handle.execHandle.task == NULL) { + tqError("cannot create exec task for %s", handle.subKey); + return -1; + } void* scanner = NULL; qExtractStreamScanner(handle.execHandle.task, &scanner); - ASSERT(scanner); + if (scanner == NULL) { + tqError("cannot extract stream scanner for %s", handle.subKey); + } handle.execHandle.pExecReader = qExtractReaderFromStreamScanner(scanner); - ASSERT(handle.execHandle.pExecReader); + if (handle.execHandle.pExecReader == NULL) { + tqError("cannot extract exec reader for %s", handle.subKey); + } } else if (handle.execHandle.subType == TOPIC_SUB_TYPE__DB) { handle.pWalReader = walOpenReader(pTq->pVnode->pWal, NULL); handle.execHandle.pExecReader = tqOpenReader(pTq->pVnode); diff --git a/source/dnode/vnode/src/tq/tqOffset.c b/source/dnode/vnode/src/tq/tqOffset.c index dd56c165fd..5a4d414ab7 100644 --- a/source/dnode/vnode/src/tq/tqOffset.c +++ b/source/dnode/vnode/src/tq/tqOffset.c @@ -40,26 +40,23 @@ int32_t tqOffsetRestoreFromFile(STqOffsetStore* pStore, const char* fname) { if (code == 0) { break; } else { - ASSERT(0); - // TODO handle error + return -1; } } int32_t size = htonl(head.size); void* memBuf = taosMemoryCalloc(1, size); if ((code = taosReadFile(pFile, memBuf, size)) != size) { - ASSERT(0); - // TODO handle error + return -1; } STqOffset offset; SDecoder decoder; tDecoderInit(&decoder, memBuf, size); if (tDecodeSTqOffset(&decoder, &offset) < 0) { - ASSERT(0); + return -1; } tDecoderClear(&decoder); if (taosHashPut(pStore->pHash, offset.subKey, strlen(offset.subKey), &offset, sizeof(STqOffset)) < 0) { - ASSERT(0); - // TODO + return -1; } taosMemoryFree(memBuf); } @@ -85,7 +82,9 @@ STqOffsetStore* tqOffsetOpen(STQ* pTq) { } char* fname = tqOffsetBuildFName(pStore->pTq->path, 0); if (tqOffsetRestoreFromFile(pStore, fname) < 0) { - ASSERT(0); + taosMemoryFree(fname); + taosMemoryFree(pStore); + return NULL; } taosMemoryFree(fname); return pStore; @@ -124,7 +123,6 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) { const char* sysErrStr = strerror(errno); tqError("vgId:%d, cannot open file %s when commit offset since %s", pStore->pTq->pVnode->config.vgId, fname, sysErrStr); - ASSERT(0); return -1; } taosMemoryFree(fname); @@ -136,9 +134,7 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) { int32_t bodyLen; int32_t code; tEncodeSize(tEncodeSTqOffset, pOffset, bodyLen, code); - ASSERT(code == 0); if (code < 0) { - ASSERT(0); taosHashCancelIterate(pStore->pHash, pIter); return -1; } @@ -154,7 +150,6 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore) { // write file int64_t writeLen; if ((writeLen = taosWriteFile(pFile, buf, totLen)) != totLen) { - ASSERT(0); tqError("write offset incomplete, len %d, write len %" PRId64, bodyLen, writeLen); taosHashCancelIterate(pStore->pHash, pIter); taosMemoryFree(buf); diff --git a/source/dnode/vnode/src/tq/tqOffsetSnapshot.c b/source/dnode/vnode/src/tq/tqOffsetSnapshot.c index b63ff8af1d..2413a792c6 100644 --- a/source/dnode/vnode/src/tq/tqOffsetSnapshot.c +++ b/source/dnode/vnode/src/tq/tqOffsetSnapshot.c @@ -56,24 +56,28 @@ int32_t tqOffsetSnapRead(STqOffsetReader* pReader, uint8_t** ppData) { TdFilePtr pFile = taosOpenFile(fname, TD_FILE_READ); if (pFile == NULL) { taosMemoryFree(fname); - return 0; + return -1; } int64_t sz = 0; if (taosStatFile(fname, &sz, NULL) < 0) { - ASSERT(0); + taosCloseFile(&pFile); + taosMemoryFree(fname); + return -1; } taosMemoryFree(fname); SSnapDataHdr* buf = taosMemoryCalloc(1, sz + sizeof(SSnapDataHdr)); if (buf == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; + taosCloseFile(&pFile); return terrno; } void* abuf = POINTER_SHIFT(buf, sizeof(SSnapDataHdr)); int64_t contLen = taosReadFile(pFile, abuf, sz); if (contLen != sz) { - ASSERT(0); + taosCloseFile(&pFile); + taosMemoryFree(buf); return -1; } buf->size = sz; @@ -122,14 +126,17 @@ int32_t tqOffsetWriterClose(STqOffsetWriter** ppWriter, int8_t rollback) { if (rollback) { if (taosRemoveFile(pWriter->fname) < 0) { - ASSERT(0); + taosMemoryFree(fname); + return -1; } } else { if (taosRenameFile(pWriter->fname, fname) < 0) { - ASSERT(0); + taosMemoryFree(fname); + return -1; } if (tqOffsetRestoreFromFile(pTq->pOffsetStore, fname) < 0) { - ASSERT(0); + taosMemoryFree(fname); + return -1; } } taosMemoryFree(fname); @@ -146,14 +153,13 @@ int32_t tqOffsetSnapWrite(STqOffsetWriter* pWriter, uint8_t* pData, uint32_t nDa TdFilePtr pFile = taosOpenFile(pWriter->fname, TD_FILE_CREATE | TD_FILE_WRITE); SSnapDataHdr* pHdr = (SSnapDataHdr*)pData; int64_t size = pHdr->size; - ASSERT(size == nData - sizeof(SSnapDataHdr)); if (pFile) { int64_t contLen = taosWriteFile(pFile, pHdr->data, size); if (contLen != size) { - ASSERT(0); + taosCloseFile(&pFile); + return -1; } } else { - ASSERT(0); return -1; } return 0; diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index 948e037c97..559a3b76fe 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -25,9 +25,7 @@ void tqTmrRspFunc(void* param, void* tmrId) { static int32_t tqLoopExecFromQueue(STQ* pTq, STqHandle* pHandle, SStreamDataSubmit** ppSubmit, SMqDataRsp* pRsp) { SStreamDataSubmit* pSubmit = *ppSubmit; while (pSubmit != NULL) { - ASSERT(pSubmit->ver == pHandle->pushHandle.processedVer + 1); if (tqLogScanExec(pTq, &pHandle->execHandle, pSubmit->data, pRsp, 0) < 0) { - /*ASSERT(0);*/ } // update processed atomic_store_64(&pHandle->pushHandle.processedVer, pSubmit->ver); @@ -160,8 +158,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_ if (msgType == TDMT_VND_SUBMIT) { tqLogScanExec(pTq, &pHandle->execHandle, pReq, &rsp, workerId); } else { - // TODO - ASSERT(0); + tqError("tq push unexpected msg type %d", msgType); } if (rsp.blockNum == 0) { @@ -169,9 +166,6 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_ continue; } - ASSERT(taosArrayGetSize(rsp.blockData) == rsp.blockNum); - ASSERT(taosArrayGetSize(rsp.blockDataLen) == rsp.blockNum); - rsp.rspOffset = fetchOffset; int32_t tlen = sizeof(SMqRspHead) + tEncodeSMqDataBlkRsp(NULL, &rsp); @@ -270,7 +264,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) SSDataBlock* pDataBlock = NULL; uint64_t ts = 0; if (qExecTask(task, &pDataBlock, &ts) < 0) { - ASSERT(0); + tqDebug("vgId:%d, tq exec error since %s", pTq->pVnode->config.vgId, terrstr()); } if (pDataBlock == NULL) { @@ -289,7 +283,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) // remove from hash size_t kLen; void* key = taosHashGetKey(pIter, &kLen); - void* keyCopy = taosMemoryMalloc(kLen); + void* keyCopy = taosMemoryCalloc(1, kLen + 1); memcpy(keyCopy, key, kLen); taosArrayPush(cachedKeys, &keyCopy); @@ -303,7 +297,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) void* key = taosArrayGetP(cachedKeys, i); size_t kLen = *(size_t*)taosArrayGet(cachedKeyLens, i); if (taosHashRemove(pTq->pPushMgr, key, kLen) != 0) { - ASSERT(0); + tqError("vgId:%d, tq push hash remove key error, key: %s", pTq->pVnode->config.vgId, (char*)key); } } taosArrayDestroyP(cachedKeys, (FDelete)taosMemoryFree); diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index e662a7daad..eb9c0c3eeb 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -176,8 +176,6 @@ bool isValValidForTable(STqHandle* pHandle, SWalCont* pHead) { goto end; } realTbSuid = req.suid; - } else { - ASSERT(0); } end: @@ -206,7 +204,6 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea code = walFetchBody(pHandle->pWalReader, ppCkHead); if (code < 0) { - ASSERT(0); *fetchOffset = offset; code = -1; goto END; @@ -220,7 +217,6 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea if (IS_META_MSG(pHead->msgType)) { code = walFetchBody(pHandle->pWalReader, ppCkHead); if (code < 0) { - ASSERT(0); *fetchOffset = offset; code = -1; goto END; @@ -238,7 +234,6 @@ int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHea } code = walSkipFetchBody(pHandle->pWalReader, *ppCkHead); if (code < 0) { - ASSERT(0); *fetchOffset = offset; code = -1; goto END; @@ -297,11 +292,8 @@ void tqCloseReader(STqReader* pReader) { int32_t tqSeekVer(STqReader* pReader, int64_t ver) { if (walReadSeekVer(pReader->pWalReader, ver) < 0) { - ASSERT(pReader->pWalReader->curInvalid); - ASSERT(pReader->pWalReader->curVersion == ver); return -1; } - ASSERT(pReader->pWalReader->curVersion == ver); return 0; } @@ -317,7 +309,6 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { ret->offset.version = pReader->ver; ret->fetchType = FETCH_TYPE__NONE; tqDebug("return offset %" PRId64 ", no more valid", ret->offset.version); - ASSERT(ret->offset.version >= 0); return -1; } void* body = POINTER_SHIFT(pReader->pWalReader->pHead->head.body, sizeof(SMsgHead)); @@ -343,7 +334,6 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { memset(&ret->data, 0, sizeof(SSDataBlock)); int32_t code = tqRetrieveDataBlock2(&ret->data, pReader); if (code != 0 || ret->data.info.rows == 0) { - ASSERT(0); continue; } ret->fetchType = FETCH_TYPE__DATA; @@ -354,7 +344,6 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { if (fromProcessedMsg) { ret->offset.type = TMQ_OFFSET__LOG; ret->offset.version = pReader->ver; - ASSERT(pReader->ver >= 0); ret->fetchType = FETCH_TYPE__SEP; tqDebug("return offset %" PRId64 ", processed finish", ret->offset.version); return 0; @@ -518,7 +507,6 @@ bool tqNextDataBlockFilterOut(STqReader* pHandle, SHashObj* filterOutUids) { } if (pHandle->pBlock == NULL) return false; - ASSERT(pHandle->tbIdHash == NULL); void* ret = taosHashGet(filterOutUids, &pHandle->msgIter.uid, sizeof(int64_t)); if (ret == NULL) { return true; @@ -784,7 +772,6 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { if (pReader->pSchema == NULL) { tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table", pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer); - /*ASSERT(0);*/ pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; @@ -795,7 +782,6 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { if (pReader->pSchemaWrapper == NULL) { tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table", pReader->msgIter.uid, pReader->cachedSchemaVer); - /*ASSERT(0);*/ pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; @@ -898,7 +884,6 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas if (pReader->pSchema == NULL) { tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table", pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer); - /*ASSERT(0);*/ pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; @@ -909,7 +894,6 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas if (pReader->pSchemaWrapper == NULL) { tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table", pReader->msgIter.uid, pReader->cachedSchemaVer); - /*ASSERT(0);*/ pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; @@ -1002,8 +986,6 @@ int32_t tqRetrieveTaosxBlock(STqReader* pReader, SArray* blocks, SArray* schemas break; } - ASSERT(sVal.valType != TD_VTYPE_NONE); - if (colDataAppend(pColData, curRow, sVal.val, sVal.valType == TD_VTYPE_NULL) < 0) { goto FAIL; } @@ -1075,8 +1057,6 @@ int tqReaderAddTbUidList(STqReader* pReader, const SArray* tbUidList) { } int tqReaderRemoveTbUidList(STqReader* pReader, const SArray* tbUidList) { - ASSERT(pReader->tbIdHash != NULL); - for (int32_t i = 0; i < taosArrayGetSize(tbUidList); i++) { int64_t* pKey = (int64_t*)taosArrayGet(tbUidList, i); taosHashRemove(pReader->tbIdHash, pKey, sizeof(int64_t)); @@ -1093,7 +1073,10 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) { STqHandle* pExec = (STqHandle*)pIter; if (pExec->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) { int32_t code = qUpdateQualifiedTableId(pExec->execHandle.task, tbUidList, isAdd); - ASSERT(code == 0); + if (code != 0) { + tqError("update qualified table error for %s", pExec->subKey); + continue; + } } else if (pExec->execHandle.subType == TOPIC_SUB_TYPE__DB) { if (!isAdd) { int32_t sz = taosArrayGetSize(tbUidList); @@ -1112,7 +1095,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) { int32_t code = metaGetTableEntryByUidCache(&mr, *id); if (code != TSDB_CODE_SUCCESS) { - qError("failed to get table meta, uid:%" PRIu64 " code:%s", *id, tstrerror(terrno)); + tqError("failed to get table meta, uid:%" PRIu64 " code:%s", *id, tstrerror(terrno)); continue; } @@ -1133,8 +1116,6 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) { } else { // TODO handle delete table from stb } - } else { - ASSERT(0); } } while (1) { @@ -1143,7 +1124,10 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) { SStreamTask* pTask = *(SStreamTask**)pIter; if (pTask->taskLevel == TASK_LEVEL__SOURCE) { int32_t code = qUpdateQualifiedTableId(pTask->exec.executor, tbUidList, isAdd); - ASSERT(code == 0); + if (code != 0) { + tqError("update qualified table error for stream task %d", pTask->taskId); + continue; + } } } return 0; diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index b9969409d1..86e530c10b 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -19,7 +19,6 @@ int32_t tqBuildDeleteReq(SVnode* pVnode, const char* stbFullName, const SSDataBlock* pDataBlock, SBatchDeleteReq* deleteReq) { - ASSERT(pDataBlock->info.type == STREAM_DELETE_RESULT); int32_t totRow = pDataBlock->info.rows; SColumnInfoData* pStartTsCol = taosArrayGet(pDataBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pDataBlock->pDataBlock, END_TS_COLUMN_INDEX); @@ -528,8 +527,8 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d int32_t code; tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code); if (code < 0) { - // - ASSERT(0); + terrno = TSDB_CODE_OUT_OF_MEMORY; + return; } SEncoder encoder; void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead)); @@ -1000,7 +999,6 @@ void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data tqDebug("vgId:%d, task %d write into table, block num: %d", TD_VID(pVnode), pTask->taskId, (int32_t)pRes->size); - ASSERT(pTask->tbSink.pTSchema); deleteReq.deleteReqs = taosArrayInit(0, sizeof(SSingleDeleteReq)); SSubmitReq* submitReq = tqBlockToSubmit(pVnode, pRes, pTask->tbSink.pTSchema, pTask->tbSink.pSchemaWrapper, true, pTask->tbSink.stbUid, pTask->tbSink.stbFullName, &deleteReq); @@ -1011,10 +1009,6 @@ void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data int32_t code; int32_t len; tEncodeSize(tEncodeSBatchDeleteReq, &deleteReq, len, code); - if (code < 0) { - // - ASSERT(0); - } SEncoder encoder; void* serializedDeleteReq = rpcMallocCont(len + sizeof(SMsgHead)); void* abuf = POINTER_SHIFT(serializedDeleteReq, sizeof(SMsgHead)); diff --git a/source/dnode/vnode/src/tq/tqSnapshot.c b/source/dnode/vnode/src/tq/tqSnapshot.c index d811d943ed..ab7093a701 100644 --- a/source/dnode/vnode/src/tq/tqSnapshot.c +++ b/source/dnode/vnode/src/tq/tqSnapshot.c @@ -100,8 +100,6 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) { } } - ASSERT(pVal && vLen); - *ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen); if (*ppData == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; diff --git a/source/dnode/vnode/src/tq/tqStreamStateSnap.c b/source/dnode/vnode/src/tq/tqStreamStateSnap.c index b1f00bdf74..ab7093a701 100644 --- a/source/dnode/vnode/src/tq/tqStreamStateSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamStateSnap.c @@ -100,8 +100,6 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) { } } - ASSERT(pVal && vLen); - *ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen); if (*ppData == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; @@ -168,7 +166,6 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) { if (rollback) { tdbAbort(pWriter->pTq->pMetaDB, pWriter->txn); - ASSERT(0); } else { code = tdbCommit(pWriter->pTq->pMetaDB, pWriter->txn); if (code) goto _err; diff --git a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c index 305378bc93..ab7093a701 100644 --- a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c @@ -100,8 +100,6 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) { } } - ASSERT(pVal && vLen); - *ppData = taosMemoryMalloc(sizeof(SSnapDataHdr) + vLen); if (*ppData == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; @@ -146,7 +144,7 @@ int32_t tqSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapWriter** p pWriter->sver = sver; pWriter->ever = ever; - if (tdbBegin(pTq->pMetaStore, &pWriter->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) { + if (tdbBegin(pTq->pMetaDB, &pWriter->txn, tdbDefaultMalloc, tdbDefaultFree, NULL, 0) < 0) { code = -1; taosMemoryFree(pWriter); goto _err; @@ -167,12 +165,11 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) { STQ* pTq = pWriter->pTq; if (rollback) { - tdbAbort(pWriter->pTq->pMetaStore, pWriter->txn); - ASSERT(0); + tdbAbort(pWriter->pTq->pMetaDB, pWriter->txn); } else { - code = tdbCommit(pWriter->pTq->pMetaStore, pWriter->txn); + code = tdbCommit(pWriter->pTq->pMetaDB, pWriter->txn); if (code) goto _err; - code = tdbPostCommit(pWriter->pTq->pMetaStore, pWriter->txn); + code = tdbPostCommit(pWriter->pTq->pMetaDB, pWriter->txn); if (code) goto _err; } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index a7a06ee946..fe71d62c52 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -1109,7 +1109,7 @@ static int32_t tsdbSnapWriteData(STsdbSnapWriter* pWriter, uint8_t* pData, uint3 if (pWriter->dWriter.pWriter == NULL || pWriter->fid != fid) { if (pWriter->dWriter.pWriter) { - ASSERT(fid > pWriter->fid); + // ASSERT(fid > pWriter->fid); code = tsdbSnapWriteCloseFile(pWriter); if (code) goto _err; diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 5f1b87a138..a179ec24f9 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -231,10 +231,6 @@ static const char* cacheModelStr(int8_t cacheModel) { return TSDB_CACHE_MODEL_NONE_STR; } -static const char* strictStr(int8_t strict) { - return TSDB_DB_STRICT_ON == strict ? TSDB_DB_STRICT_ON_STR : TSDB_DB_STRICT_OFF_STR; -} - static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, SDbCfgInfo* pCfg) { blockDataEnsureCapacity(pBlock, 1); pBlock->info.rows = 1; @@ -269,11 +265,11 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S buf2 + VARSTR_HEADER_SIZE, "CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm " "WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d " - "STRICT '%s' WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d", + "WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d", dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, - pCfg->pages, pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, - pCfg->numOfVgroups, 1 == pCfg->numOfStables); + pCfg->pages, pCfg->pageSize, prec, pCfg->replications, pCfg->walLevel, pCfg->numOfVgroups, + 1 == pCfg->numOfStables); if (retentions) { len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, " RETENTIONS %s", retentions); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 76c07a9611..8a87cd5a0e 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1347,6 +1347,36 @@ static int32_t generateScanRange(SStreamScanInfo* pInfo, SSDataBlock* pSrcBlock, return code; } +#if 0 +void calBlockTag(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { + SExprSupp* pTagCalSup = &pInfo->tagCalSup; + SStreamState* pState = pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState; + if (pTagCalSup == NULL || pTagCalSup->numOfExprs == 0) return; + if (pBlock == NULL || pBlock->info.rows == 0) return; + + void* tag = NULL; + int32_t tagLen = 0; + if (streamStateGetParTag(pState, pBlock->info.id.groupId, &tag, &tagLen) == 0) { + pBlock->info.tagLen = tagLen; + void* pTag = taosMemoryRealloc(pBlock->info.pTag, tagLen); + if (pTag == NULL) { + tdbFree(tag); + taosMemoryFree(pBlock->info.pTag); + pBlock->info.pTag = NULL; + pBlock->info.tagLen = 0; + return; + } + pBlock->info.pTag = pTag; + memcpy(pBlock->info.pTag, tag, tagLen); + tdbFree(tag); + return; + } else { + pBlock->info.pTag = NULL; + } + tdbFree(tag); +} +#endif + void calBlockTbName(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { SExprSupp* pTbNameCalSup = &pInfo->tbnameCalSup; SStreamState* pState = pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState; @@ -1354,10 +1384,12 @@ void calBlockTbName(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { if (pBlock == NULL || pBlock->info.rows == 0) return; void* tbname = NULL; - if (streamStateGetParName(pInfo->pStreamScanOp->pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < 0) { - pBlock->info.parTbName[0] = 0; - } else { + if (streamStateGetParName(pState, pBlock->info.id.groupId, &tbname) == 0) { memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); + tdbFree(tbname); + return; + } else { + pBlock->info.parTbName[0] = 0; } tdbFree(tbname); diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index a82dc13318..8db03f99c5 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -163,6 +163,10 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { colDataAppend(pDst, rows, (char*)&pSliceInfo->current, false); continue; + } else if (IS_BOOLEAN_TYPE(pExprInfo->base.resSchema.type)) { + bool isFilled = true; + colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false); + continue; } int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; @@ -274,6 +278,9 @@ static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp* if (IS_TIMESTAMP_TYPE(pExprInfo->base.resSchema.type)) { colDataAppend(pDst, pResBlock->info.rows, (char*)&pSliceInfo->current, false); + } else if (IS_BOOLEAN_TYPE(pExprInfo->base.resSchema.type)) { + bool isFilled = false; + colDataAppend(pDst, pResBlock->info.rows, (char*)&isFilled, false); } else { int32_t srcSlot = pExprInfo->base.pParam[0].pCol->slotId; SColumnInfoData* pSrc = taosArrayGet(pSrcBlock->pDataBlock, srcSlot); diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 07e480ee1d..06406d158f 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -466,7 +466,7 @@ static int32_t translateStddevMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t static int32_t translateWduration(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // pseudo column do not need to check parameters - pFunc->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_BIGINT}; + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes, .type = TSDB_DATA_TYPE_BIGINT}; return TSDB_CODE_SUCCESS; } @@ -480,14 +480,21 @@ static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t le return code; } - pFunc->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_TIMESTAMP}; + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP}; return TSDB_CODE_SUCCESS; } static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // pseudo column do not need to check parameters - pFunc->node.resType = (SDataType){.bytes = sizeof(int64_t), .type = TSDB_DATA_TYPE_TIMESTAMP}; + pFunc->node.resType = (SDataType){.bytes =tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes, .type = TSDB_DATA_TYPE_TIMESTAMP}; + return TSDB_CODE_SUCCESS; +} + +static int32_t translateIsFilledPseudoColumn(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { + // pseudo column do not need to check parameters + + pFunc->node.resType = (SDataType){.bytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes, .type = TSDB_DATA_TYPE_BOOL}; return TSDB_CODE_SUCCESS; } @@ -3254,6 +3261,16 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .sprocessFunc = NULL, .finalizeFunc = NULL }, + { + .name = "_isfilled", + .type = FUNCTION_TYPE_ISFILLED, + .classification = FUNC_MGT_PSEUDO_COLUMN_FUNC | FUNC_MGT_INTERP_PC_FUNC, + .translateFunc = translateIsFilledPseudoColumn, + .getEnvFunc = NULL, + .initFunc = NULL, + .sprocessFunc = NULL, + .finalizeFunc = NULL + }, { .name = "_tags", .type = FUNCTION_TYPE_TAGS, diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 38884a37e0..45d65d5ea1 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -79,6 +79,10 @@ const char* nodesNodeName(ENodeType type) { return "TableOptions"; case QUERY_NODE_INDEX_OPTIONS: return "IndexOptions"; + case QUERY_NODE_EXPLAIN_OPTIONS: + return "ExplainOptions"; + case QUERY_NODE_STREAM_OPTIONS: + return "StreamOptions"; case QUERY_NODE_LEFT_VALUE: return "LeftValue"; case QUERY_NODE_WHEN_THEN: @@ -91,7 +95,7 @@ const char* nodesNodeName(ENodeType type) { return "SetOperator"; case QUERY_NODE_SELECT_STMT: return "SelectStmt"; - case QUERY_NODE_VNODE_MODIF_STMT: + case QUERY_NODE_VNODE_MODIFY_STMT: return "VnodeModifStmt"; case QUERY_NODE_CREATE_DATABASE_STMT: return "CreateDatabaseStmt"; @@ -99,11 +103,15 @@ const char* nodesNodeName(ENodeType type) { return "DropDatabaseStmt"; case QUERY_NODE_ALTER_DATABASE_STMT: return "AlterDatabaseStmt"; + case QUERY_NODE_FLUSH_DATABASE_STMT: + return "FlushDatabaseStmt"; + case QUERY_NODE_TRIM_DATABASE_STMT: + return "TrimDatabaseStmt"; case QUERY_NODE_CREATE_TABLE_STMT: return "CreateTableStmt"; case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: return "CreateSubtableClause"; - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: return "CreateMultiTableStmt"; case QUERY_NODE_DROP_TABLE_CLAUSE: return "DropTableClause"; @@ -137,12 +145,42 @@ const char* nodesNodeName(ENodeType type) { return "CreateQnodeStmt"; case QUERY_NODE_DROP_QNODE_STMT: return "DropQnodeStmt"; + case QUERY_NODE_CREATE_SNODE_STMT: + return "CreateSnodeStmt"; + case QUERY_NODE_DROP_SNODE_STMT: + return "DropSnodeStmt"; + case QUERY_NODE_CREATE_MNODE_STMT: + return "CreateMnodeStmt"; + case QUERY_NODE_DROP_MNODE_STMT: + return "DropMnodeStmt"; case QUERY_NODE_CREATE_TOPIC_STMT: return "CreateTopicStmt"; case QUERY_NODE_DROP_TOPIC_STMT: return "DropTopicStmt"; + case QUERY_NODE_DROP_CGROUP_STMT: + return "DropConsumerGroupStmt"; case QUERY_NODE_ALTER_LOCAL_STMT: return "AlterLocalStmt"; + case QUERY_NODE_EXPLAIN_STMT: + return "ExplainStmt"; + case QUERY_NODE_DESCRIBE_STMT: + return "DescribeStmt"; + case QUERY_NODE_CREATE_STREAM_STMT: + return "CreateStreamStmt"; + case QUERY_NODE_DROP_STREAM_STMT: + return "DropStreamStmt"; + case QUERY_NODE_BALANCE_VGROUP_STMT: + return "BalanceVgroupStmt"; + case QUERY_NODE_MERGE_VGROUP_STMT: + return "MergeVgroupStmt"; + case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT: + return "RedistributeVgroupStmt"; + case QUERY_NODE_SPLIT_VGROUP_STMT: + return "SplitVgroupStmt"; + case QUERY_NODE_GRANT_STMT: + return "GrantStmt"; + case QUERY_NODE_REVOKE_STMT: + return "RevokeStmt"; case QUERY_NODE_SHOW_DNODES_STMT: return "ShowDnodesStmt"; case QUERY_NODE_SHOW_MNODES_STMT: @@ -155,6 +193,8 @@ const char* nodesNodeName(ENodeType type) { return "ShowSnodesStmt"; case QUERY_NODE_SHOW_BNODES_STMT: return "ShowBnodesStmt"; + case QUERY_NODE_SHOW_CLUSTER_STMT: + return "ShowClusterStmt"; case QUERY_NODE_SHOW_DATABASES_STMT: return "ShowDatabaseStmt"; case QUERY_NODE_SHOW_FUNCTIONS_STMT: @@ -181,8 +221,30 @@ const char* nodesNodeName(ENodeType type) { return "ShowConsumersStmt"; case QUERY_NODE_SHOW_QUERIES_STMT: return "ShowQueriesStmt"; + case QUERY_NODE_SHOW_VARIABLES_STMT: + return "ShowVariablesStmt"; + case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: + return "ShowDnodeVariablesStmt"; + case QUERY_NODE_SHOW_TRANSACTIONS_STMT: + return "ShowTransactionsStmt"; + case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT: + return "ShowSubscriptionsStmt"; case QUERY_NODE_SHOW_VNODES_STMT: return "ShowVnodeStmt"; + case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT: + return "ShowUserPrivilegesStmt"; + case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: + return "ShowCreateDatabasesStmt"; + case QUERY_NODE_SHOW_CREATE_TABLE_STMT: + return "ShowCreateTablesStmt"; + case QUERY_NODE_SHOW_CREATE_STABLE_STMT: + return "ShowCreateStablesStmt"; + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: + return "ShowTableDistributedStmt"; + case QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT: + return "ShowLocalVariablesStmt"; + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: + return "ShowTableTagsStmt"; case QUERY_NODE_DELETE_STMT: return "DeleteStmt"; case QUERY_NODE_INSERT_STMT: @@ -1364,6 +1426,23 @@ static int32_t logicJoinNodeToJson(const void* pObj, SJson* pJson) { return code; } +static int32_t jsonToLogicJoinNode(const SJson* pJson, void* pObj) { + SJoinLogicNode* pNode = (SJoinLogicNode*)pObj; + + int32_t code = jsonToLogicPlanNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + tjsonGetNumberValue(pJson, jkJoinLogicPlanJoinType, pNode->joinType, code); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkJoinLogicPlanMergeCondition, &pNode->pMergeCondition); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkJoinLogicPlanOnConditions, &pNode->pOnConditions); + } + + return code; +} + static const char* jkPhysiPlanOutputDataBlockDesc = "OutputDataBlockDesc"; static const char* jkPhysiPlanConditions = "Conditions"; static const char* jkPhysiPlanChildren = "Children"; @@ -3569,6 +3648,51 @@ static int32_t jsonToTempTableNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkJoinTableJoinType = "JoinType"; +static const char* jkJoinTableLeft = "Left"; +static const char* jkJoinTableRight = "Right"; +static const char* jkJoinTableOnCond = "OnCond"; + +static int32_t joinTableNodeToJson(const void* pObj, SJson* pJson) { + const SJoinTableNode* pNode = (const SJoinTableNode*)pObj; + + int32_t code = tableNodeToJson(pObj, pJson); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkJoinTableJoinType, pNode->joinType); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkJoinTableLeft, nodeToJson, pNode->pLeft); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkJoinTableRight, nodeToJson, pNode->pRight); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkJoinTableOnCond, nodeToJson, pNode->pOnCond); + } + + return code; +} + +static int32_t jsonToJoinTableNode(const SJson* pJson, void* pObj) { + SJoinTableNode* pNode = (SJoinTableNode*)pObj; + + int32_t code = jsonToTableNode(pJson, pObj); + if (TSDB_CODE_SUCCESS == code) { + tjsonGetNumberValue(pJson, jkJoinTableJoinType, pNode->joinType, code); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkJoinTableLeft, &pNode->pLeft); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkJoinTableRight, &pNode->pRight); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkJoinTableOnCond, &pNode->pOnCond); + } + + return code; +} + static const char* jkGroupingSetType = "GroupingSetType"; static const char* jkGroupingSetParameter = "Parameters"; @@ -3923,6 +4047,45 @@ static int32_t jsonToSlotDescNode(const SJson* pJson, void* pObj) { return code; } +static const char* jkColumnDefColName = "ColName"; +static const char* jkColumnDefDataType = "DataType"; +static const char* jkColumnDefComments = "Comments"; +static const char* jkColumnDefSma = "Sma"; + +static int32_t columnDefNodeToJson(const void* pObj, SJson* pJson) { + const SColumnDefNode* pNode = (const SColumnDefNode*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkColumnDefColName, pNode->colName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkColumnDefDataType, dataTypeToJson, &pNode->dataType); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkColumnDefComments, pNode->comments); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkColumnDefSma, pNode->sma); + } + + return code; +} + +static int32_t jsonToColumnDefNode(const SJson* pJson, void* pObj) { + SColumnDefNode* pNode = (SColumnDefNode*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkColumnDefColName, pNode->colName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonToObject(pJson, jkColumnDefDataType, jsonToDataType, &pNode->dataType); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkColumnDefComments, pNode->comments); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkColumnDefSma, &pNode->sma); + } + + return code; +} + static const char* jkDownstreamSourceAddr = "Addr"; static const char* jkDownstreamSourceTaskId = "TaskId"; static const char* jkDownstreamSourceSchedId = "SchedId"; @@ -4113,6 +4276,190 @@ static int32_t jsonToDatabaseOptions(const SJson* pJson, void* pObj) { return code; } +static const char* jkTableOptionsComment = "Comment"; +static const char* jkTableOptionsMaxDelay = "MaxDelay"; +static const char* jkTableOptionsWatermark = "Watermark"; +static const char* jkTableOptionsDeleteMark = "DeleteMark"; +static const char* jkTableOptionsRollupFuncs = "RollupFuncs"; +static const char* jkTableOptionsTtl = "Ttl"; +static const char* jkTableOptionsSma = "Sma"; + +static int32_t tableOptionsToJson(const void* pObj, SJson* pJson) { + const STableOptions* pNode = (const STableOptions*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkTableOptionsComment, pNode->comment); + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkTableOptionsMaxDelay, pNode->pMaxDelay); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkTableOptionsWatermark, pNode->pWatermark); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkTableOptionsDeleteMark, pNode->pDeleteMark); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkTableOptionsRollupFuncs, pNode->pRollupFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkTableOptionsTtl, pNode->ttl); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkTableOptionsSma, pNode->pSma); + } + + return code; +} + +static int32_t jsonToTableOptions(const SJson* pJson, void* pObj) { + STableOptions* pNode = (STableOptions*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkTableOptionsComment, pNode->comment); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkTableOptionsMaxDelay, &pNode->pMaxDelay); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkTableOptionsWatermark, &pNode->pWatermark); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkTableOptionsDeleteMark, &pNode->pDeleteMark); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkTableOptionsRollupFuncs, &pNode->pRollupFuncs); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkTableOptionsTtl, &pNode->ttl); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkTableOptionsSma, &pNode->pSma); + } + + return code; +} + +static const char* jkIndexOptionsFuncs = "Funcs"; +static const char* jkIndexOptionsInterval = "Interval"; +static const char* jkIndexOptionsOffset = "Offset"; +static const char* jkIndexOptionsSliding = "Sliding"; +static const char* jkIndexOptionsStreamOptions = "StreamOptions"; + +static int32_t indexOptionsToJson(const void* pObj, SJson* pJson) { + const SIndexOptions* pNode = (const SIndexOptions*)pObj; + + int32_t code = nodeListToJson(pJson, jkIndexOptionsFuncs, pNode->pFuncs); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkIndexOptionsInterval, nodeToJson, pNode->pInterval); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkIndexOptionsOffset, nodeToJson, pNode->pOffset); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkIndexOptionsSliding, nodeToJson, pNode->pSliding); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkIndexOptionsStreamOptions, nodeToJson, pNode->pStreamOptions); + } + + return code; +} + +static int32_t jsonToIndexOptions(const SJson* pJson, void* pObj) { + SIndexOptions* pNode = (SIndexOptions*)pObj; + + int32_t code = jsonToNodeList(pJson, jkIndexOptionsFuncs, &pNode->pFuncs); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkIndexOptionsInterval, &pNode->pInterval); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkIndexOptionsOffset, &pNode->pOffset); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkIndexOptionsSliding, &pNode->pSliding); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkIndexOptionsStreamOptions, &pNode->pStreamOptions); + } + + return code; +} + +static const char* jkExplainOptionsVerbose = "Verbose"; +static const char* jkExplainOptionsRatio = "Ratio"; + +static int32_t explainOptionsToJson(const void* pObj, SJson* pJson) { + const SExplainOptions* pNode = (const SExplainOptions*)pObj; + + int32_t code = tjsonAddBoolToObject(pJson, jkExplainOptionsVerbose, pNode->verbose); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddDoubleToObject(pJson, jkExplainOptionsRatio, pNode->ratio); + } + + return code; +} + +static int32_t jsonToExplainOptions(const SJson* pJson, void* pObj) { + SExplainOptions* pNode = (SExplainOptions*)pObj; + + int32_t code = tjsonGetBoolValue(pJson, jkExplainOptionsVerbose, &pNode->verbose); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetDoubleValue(pJson, jkExplainOptionsRatio, &pNode->ratio); + } + + return code; +} + +static const char* jkStreamOptionsTriggerType = "TriggerType"; +static const char* jkStreamOptionsDelay = "Delay"; +static const char* jkStreamOptionsWatermark = "Watermark"; +static const char* jkStreamOptionsDeleteMark = "DeleteMark"; +static const char* jkStreamOptionsFillHistory = "FillHistory"; +static const char* jkStreamOptionsIgnoreExpired = "IgnoreExpired"; + +static int32_t streamOptionsToJson(const void* pObj, SJson* pJson) { + const SStreamOptions* pNode = (const SStreamOptions*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkStreamOptionsTriggerType, pNode->triggerType); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkStreamOptionsDelay, nodeToJson, pNode->pDelay); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkStreamOptionsWatermark, nodeToJson, pNode->pWatermark); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkStreamOptionsDeleteMark, nodeToJson, pNode->pDeleteMark); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkStreamOptionsFillHistory, pNode->fillHistory); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkStreamOptionsIgnoreExpired, pNode->ignoreExpired); + } + + return code; +} + +static int32_t jsonToStreamOptions(const SJson* pJson, void* pObj) { + SStreamOptions* pNode = (SStreamOptions*)pObj; + + int32_t code = tjsonGetTinyIntValue(pJson, jkStreamOptionsTriggerType, &pNode->triggerType); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkStreamOptionsDelay, &pNode->pDelay); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkStreamOptionsWatermark, &pNode->pWatermark); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkStreamOptionsDeleteMark, &pNode->pDeleteMark); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkStreamOptionsFillHistory, &pNode->fillHistory); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkStreamOptionsIgnoreExpired, &pNode->ignoreExpired); + } + + return code; +} + static const char* jkWhenThenWhen = "When"; static const char* jkWhenThenThen = "Then"; @@ -4398,6 +4745,71 @@ static int32_t jsonToSelectStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkVnodeModifyOpStmtSqlNodeType = "SqlNodeType"; +static const char* jkVnodeModifyOpStmtTotalRowsNum = "TotalRowsNum"; +static const char* jkVnodeModifyOpStmtTotalTbNum = "TotalTbNum"; + +static int32_t vnodeModifyStmtToJson(const void* pObj, SJson* pJson) { + const SVnodeModifyOpStmt* pNode = (const SVnodeModifyOpStmt*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkVnodeModifyOpStmtSqlNodeType, pNode->sqlNodeType); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkVnodeModifyOpStmtTotalRowsNum, pNode->totalRowsNum); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkVnodeModifyOpStmtTotalTbNum, pNode->totalTbNum); + } + + return code; +} + +static int32_t jsonToVnodeModifyStmt(const SJson* pJson, void* pObj) { + SVnodeModifyOpStmt* pNode = (SVnodeModifyOpStmt*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + tjsonGetNumberValue(pJson, jkVnodeModifyOpStmtSqlNodeType, pNode->sqlNodeType, code); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkVnodeModifyOpStmtTotalRowsNum, &pNode->totalRowsNum); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkVnodeModifyOpStmtTotalTbNum, &pNode->totalTbNum); + } + + return code; +} + +static const char* jkCreateDatabaseStmtDbName = "DbName"; +static const char* jkCreateDatabaseStmtIgnoreExists = "IgnoreExists"; +static const char* jkCreateDatabaseStmtOptions = "Options"; + +static int32_t createDatabaseStmtToJson(const void* pObj, SJson* pJson) { + const SCreateDatabaseStmt* pNode = (const SCreateDatabaseStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateDatabaseStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkCreateDatabaseStmtIgnoreExists, pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateDatabaseStmtOptions, nodeToJson, pNode->pOptions); + } + + return code; +} + +static int32_t jsonToCreateDatabaseStmt(const SJson* pJson, void* pObj) { + SCreateDatabaseStmt* pNode = (SCreateDatabaseStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateDatabaseStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkCreateDatabaseStmtIgnoreExists, &pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateDatabaseStmtOptions, (SNode**)&pNode->pOptions); + } + + return code; +} + static const char* jkAlterDatabaseStmtDbName = "DbName"; static const char* jkAlterDatabaseStmtOptions = "Options"; @@ -4423,6 +4835,239 @@ static int32_t jsonToAlterDatabaseStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkTrimDatabaseStmtDbName = "DbName"; +static const char* jkTrimDatabaseStmtMaxSpeed = "MaxSpeed"; + +static int32_t trimDatabaseStmtToJson(const void* pObj, SJson* pJson) { + const STrimDatabaseStmt* pNode = (const STrimDatabaseStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkTrimDatabaseStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkTrimDatabaseStmtMaxSpeed, pNode->maxSpeed); + } + + return code; +} + +static int32_t jsonToTrimDatabaseStmt(const SJson* pJson, void* pObj) { + STrimDatabaseStmt* pNode = (STrimDatabaseStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkTrimDatabaseStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkTrimDatabaseStmtMaxSpeed, &pNode->maxSpeed); + } + + return code; +} + +static const char* jkCreateTableStmtDbName = "DbName"; +static const char* jkCreateTableStmtTableName = "TableName"; +static const char* jkCreateTableStmtIgnoreExists = "IgnoreExists"; +static const char* jkCreateTableStmtCols = "Cols"; +static const char* jkCreateTableStmtTags = "Tags"; +static const char* jkCreateTableStmtOptions = "Options"; + +static int32_t createTableStmtToJson(const void* pObj, SJson* pJson) { + const SCreateTableStmt* pNode = (const SCreateTableStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateTableStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkCreateTableStmtIgnoreExists, pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateTableStmtCols, pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateTableStmtTags, pNode->pTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateTableStmtOptions, nodeToJson, pNode->pOptions); + } + + return code; +} + +static int32_t jsonToCreateTableStmt(const SJson* pJson, void* pObj) { + SCreateTableStmt* pNode = (SCreateTableStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateTableStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkCreateTableStmtIgnoreExists, &pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateTableStmtCols, &pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateTableStmtTags, &pNode->pTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateTableStmtOptions, (SNode**)&pNode->pOptions); + } + + return code; +} + +static const char* jkCreateSubTableClauseDbName = "DbName"; +static const char* jkCreateSubTableClauseTableName = "TableName"; +static const char* jkCreateSubTableClauseUseDbName = "UseDbName"; +static const char* jkCreateSubTableClauseUseTableName = "UseTableName"; +static const char* jkCreateSubTableClauseIgnoreExists = "IgnoreExists"; +static const char* jkCreateSubTableClauseSpecificTags = "SpecificTags"; +static const char* jkCreateSubTableClauseValsOfTags = "ValsOfTags"; +static const char* jkCreateSubTableClauseOptions = "Options"; + +static int32_t createSubTableClauseToJson(const void* pObj, SJson* pJson) { + const SCreateSubTableClause* pNode = (const SCreateSubTableClause*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateSubTableClauseDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateSubTableClauseTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateSubTableClauseUseDbName, pNode->useDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateSubTableClauseUseTableName, pNode->useTableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkCreateSubTableClauseIgnoreExists, pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateSubTableClauseSpecificTags, pNode->pSpecificTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateSubTableClauseValsOfTags, pNode->pValsOfTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateSubTableClauseOptions, nodeToJson, pNode->pOptions); + } + + return code; +} + +static int32_t jsonToCreateSubTableClause(const SJson* pJson, void* pObj) { + SCreateSubTableClause* pNode = (SCreateSubTableClause*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateSubTableClauseDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateSubTableClauseTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateSubTableClauseUseDbName, pNode->useDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateSubTableClauseUseTableName, pNode->useTableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkCreateSubTableClauseIgnoreExists, &pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateSubTableClauseSpecificTags, &pNode->pSpecificTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateSubTableClauseValsOfTags, &pNode->pValsOfTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateSubTableClauseOptions, (SNode**)&pNode->pOptions); + } + + return code; +} + +static const char* jkCreateMultiTablesStmtSubTables = "SubTables"; + +static int32_t createMultiTablesStmtToJson(const void* pObj, SJson* pJson) { + const SCreateMultiTablesStmt* pNode = (const SCreateMultiTablesStmt*)pObj; + return nodeListToJson(pJson, jkCreateMultiTablesStmtSubTables, pNode->pSubTables); +} + +static int32_t jsonToCreateMultiTablesStmt(const SJson* pJson, void* pObj) { + SCreateMultiTablesStmt* pNode = (SCreateMultiTablesStmt*)pObj; + return jsonToNodeList(pJson, jkCreateMultiTablesStmtSubTables, &pNode->pSubTables); +} + +static const char* jkDropTableClauseDbName = "DbName"; +static const char* jkDropTableClauseTableName = "TableName"; +static const char* jkDropTableClauseIgnoreNotExists = "IgnoreNotExists"; + +static int32_t dropTableClauseToJson(const void* pObj, SJson* pJson) { + const SDropTableClause* pNode = (const SDropTableClause*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDropTableClauseDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropTableClauseTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropTableClauseIgnoreNotExists, pNode->ignoreNotExists); + } + + return code; +} + +static int32_t jsonToDropTableClause(const SJson* pJson, void* pObj) { + SDropTableClause* pNode = (SDropTableClause*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDropTableClauseDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropTableClauseTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropTableClauseIgnoreNotExists, &pNode->ignoreNotExists); + } + + return code; +} + +static const char* jkDropTableStmtTables = "Tables"; + +static int32_t dropTableStmtToJson(const void* pObj, SJson* pJson) { + const SDropTableStmt* pNode = (const SDropTableStmt*)pObj; + return nodeListToJson(pJson, jkDropTableStmtTables, pNode->pTables); +} + +static int32_t jsonToDropTableStmt(const SJson* pJson, void* pObj) { + SDropTableStmt* pNode = (SDropTableStmt*)pObj; + return jsonToNodeList(pJson, jkDropTableStmtTables, &pNode->pTables); +} + +static const char* jkDropSuperTableStmtDbName = "DbName"; +static const char* jkDropSuperTableStmtTableName = "TableName"; +static const char* jkDropSuperTableStmtIgnoreNotExists = "IgnoreNotExists"; + +static int32_t dropStableStmtToJson(const void* pObj, SJson* pJson) { + const SDropSuperTableStmt* pNode = (const SDropSuperTableStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDropSuperTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropSuperTableStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropSuperTableStmtIgnoreNotExists, pNode->ignoreNotExists); + } + + return code; +} + +static int32_t jsonToDropStableStmt(const SJson* pJson, void* pObj) { + SDropSuperTableStmt* pNode = (SDropSuperTableStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDropSuperTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropSuperTableStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropSuperTableStmtIgnoreNotExists, &pNode->ignoreNotExists); + } + + return code; +} + static const char* jkAlterTableStmtDbName = "DbName"; static const char* jkAlterTableStmtTableName = "TableName"; static const char* jkAlterTableStmtAlterType = "AlterType"; @@ -4490,6 +5135,137 @@ static int32_t jsonToAlterTableStmt(const SJson* pJson, void* pObj) { return code; } +static int32_t alterStableStmtToJson(const void* pObj, SJson* pJson) { return alterTableStmtToJson(pObj, pJson); } + +static int32_t jsonToAlterStableStmt(const SJson* pJson, void* pObj) { return jsonToAlterTableStmt(pJson, pObj); } + +static const char* jkCreateUserStmtUserName = "UserName"; +static const char* jkCreateUserStmtPassword = "Password"; +static const char* jkCreateUserStmtSysinfo = "Sysinfo"; + +static int32_t createUserStmtToJson(const void* pObj, SJson* pJson) { + const SCreateUserStmt* pNode = (const SCreateUserStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateUserStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateUserStmtPassword, pNode->password); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCreateUserStmtSysinfo, pNode->sysinfo); + } + + return code; +} + +static int32_t jsonToCreateUserStmt(const SJson* pJson, void* pObj) { + SCreateUserStmt* pNode = (SCreateUserStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateUserStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateUserStmtPassword, pNode->password); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkCreateUserStmtSysinfo, &pNode->sysinfo); + } + + return code; +} + +static const char* jkAlterUserStmtUserName = "UserName"; +static const char* jkAlterUserStmtAlterType = "AlterType"; +static const char* jkAlterUserStmtPassword = "Password"; +static const char* jkAlterUserStmtEnable = "Enable"; +static const char* jkAlterUserStmtSysinfo = "Sysinfo"; + +static int32_t alterUserStmtToJson(const void* pObj, SJson* pJson) { + const SAlterUserStmt* pNode = (const SAlterUserStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkAlterUserStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkAlterUserStmtAlterType, pNode->alterType); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkAlterUserStmtPassword, pNode->password); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkAlterUserStmtEnable, pNode->enable); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkAlterUserStmtSysinfo, pNode->sysinfo); + } + + return code; +} + +static int32_t jsonToAlterUserStmt(const SJson* pJson, void* pObj) { + SAlterUserStmt* pNode = (SAlterUserStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkAlterUserStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkAlterUserStmtAlterType, &pNode->alterType); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkAlterUserStmtPassword, pNode->password); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkAlterUserStmtEnable, &pNode->enable); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetTinyIntValue(pJson, jkAlterUserStmtSysinfo, &pNode->sysinfo); + } + + return code; +} + +static const char* jkDropUserStmtUserName = "UserName"; + +static int32_t dropUserStmtToJson(const void* pObj, SJson* pJson) { + const SDropUserStmt* pNode = (const SDropUserStmt*)pObj; + return tjsonAddStringToObject(pJson, jkDropUserStmtUserName, pNode->userName); +} + +static int32_t jsonToDropUserStmt(const SJson* pJson, void* pObj) { + SDropUserStmt* pNode = (SDropUserStmt*)pObj; + return tjsonGetStringValue(pJson, jkDropUserStmtUserName, pNode->userName); +} + +static const char* jkUseDatabaseStmtDbName = "DbName"; + +static int32_t useDatabaseStmtToJson(const void* pObj, SJson* pJson) { + const SUseDatabaseStmt* pNode = (const SUseDatabaseStmt*)pObj; + return tjsonAddStringToObject(pJson, jkUseDatabaseStmtDbName, pNode->dbName); +} + +static int32_t jsonToUseDatabaseStmt(const SJson* pJson, void* pObj) { + SUseDatabaseStmt* pNode = (SUseDatabaseStmt*)pObj; + return tjsonGetStringValue(pJson, jkUseDatabaseStmtDbName, pNode->dbName); +} + +static const char* jkCreateDnodeStmtFqdn = "Fqdn"; +static const char* jkCreateDnodeStmtPort = "Port"; + +static int32_t createDnodeStmtToJson(const void* pObj, SJson* pJson) { + const SCreateDnodeStmt* pNode = (const SCreateDnodeStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateDnodeStmtFqdn, pNode->fqdn); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkCreateDnodeStmtPort, pNode->port); + } + + return code; +} + +static int32_t jsonToCreateDnodeStmt(const SJson* pJson, void* pObj) { + SCreateDnodeStmt* pNode = (SCreateDnodeStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateDnodeStmtFqdn, pNode->fqdn); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkCreateDnodeStmtPort, &pNode->port); + } + + return code; +} + static const char* jkAlterDnodeStmtDnodeId = "DnodeId"; static const char* jkAlterDnodeStmtConfig = "Config"; static const char* jkAlterDnodeStmtValue = "Value"; @@ -4522,6 +5298,205 @@ static int32_t jsonToAlterDnodeStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkCreateIndexStmtIndexType = "IndexType"; +static const char* jkCreateIndexStmtIgnoreExists = "IgnoreExists"; +static const char* jkCreateIndexStmtIndexDbName = "IndexDbName"; +static const char* jkCreateIndexStmtIndexName = "indexName"; +static const char* jkCreateIndexStmtDbName = "DbName"; +static const char* jkCreateIndexStmtTableName = "TableName"; +static const char* jkCreateIndexStmtCols = "Cols"; +static const char* jkCreateIndexStmtOptions = "Options"; + +static int32_t createIndexStmtToJson(const void* pObj, SJson* pJson) { + const SCreateIndexStmt* pNode = (const SCreateIndexStmt*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkCreateIndexStmtIndexType, pNode->indexType); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkCreateIndexStmtIgnoreExists, pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateIndexStmtIndexDbName, pNode->indexDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateIndexStmtIndexName, pNode->indexName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateIndexStmtDbName, pNode->dbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateIndexStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateIndexStmtCols, pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateIndexStmtOptions, nodeToJson, pNode->pOptions); + } + + return code; +} + +static int32_t jsonToCreateIndexStmt(const SJson* pJson, void* pObj) { + SCreateIndexStmt* pNode = (SCreateIndexStmt*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + tjsonGetNumberValue(pJson, jkCreateIndexStmtIndexType, pNode->indexType, code); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkCreateIndexStmtIgnoreExists, &pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateIndexStmtIndexDbName, pNode->indexDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateIndexStmtIndexName, pNode->indexName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateIndexStmtDbName, pNode->dbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateIndexStmtTableName, pNode->tableName); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateIndexStmtCols, &pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateIndexStmtOptions, (SNode**)&pNode->pOptions); + } + + return code; +} + +static const char* jkDropIndexStmtIgnoreNotExists = "IgnoreNotExists"; +static const char* jkDropIndexStmtIndexDbName = "IndexDbName"; +static const char* jkDropIndexStmtIndexName = "IndexName"; + +static int32_t dropIndexStmtToJson(const void* pObj, SJson* pJson) { + const SDropIndexStmt* pNode = (const SDropIndexStmt*)pObj; + + int32_t code = tjsonAddBoolToObject(pJson, jkDropIndexStmtIgnoreNotExists, pNode->ignoreNotExists); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropIndexStmtIndexDbName, pNode->indexDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropIndexStmtIndexName, pNode->indexName); + } + + return code; +} + +static int32_t jsonToDropIndexStmt(const SJson* pJson, void* pObj) { + SDropIndexStmt* pNode = (SDropIndexStmt*)pObj; + + int32_t code = tjsonGetBoolValue(pJson, jkDropIndexStmtIgnoreNotExists, &pNode->ignoreNotExists); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropIndexStmtIndexDbName, pNode->indexDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropIndexStmtIndexName, pNode->indexName); + } + + return code; +} + +static const char* jkCreateComponentNodeStmtDnodeId = "DnodeId"; + +static int32_t createComponentNodeStmtToJson(const void* pObj, SJson* pJson) { + const SCreateComponentNodeStmt* pNode = (const SCreateComponentNodeStmt*)pObj; + return tjsonAddIntegerToObject(pJson, jkCreateComponentNodeStmtDnodeId, pNode->dnodeId); +} + +static int32_t jsonToCreateComponentNodeStmt(const SJson* pJson, void* pObj) { + SCreateComponentNodeStmt* pNode = (SCreateComponentNodeStmt*)pObj; + return tjsonGetIntValue(pJson, jkCreateComponentNodeStmtDnodeId, &pNode->dnodeId); +} + +static const char* jkDropComponentNodeStmtDnodeId = "DnodeId"; + +static int32_t dropComponentNodeStmtToJson(const void* pObj, SJson* pJson) { + const SDropComponentNodeStmt* pNode = (const SDropComponentNodeStmt*)pObj; + return tjsonAddIntegerToObject(pJson, jkDropComponentNodeStmtDnodeId, pNode->dnodeId); +} + +static int32_t jsonToDropComponentNodeStmt(const SJson* pJson, void* pObj) { + SDropComponentNodeStmt* pNode = (SDropComponentNodeStmt*)pObj; + return tjsonGetIntValue(pJson, jkDropComponentNodeStmtDnodeId, &pNode->dnodeId); +} + +static int32_t createQnodeStmtToJson(const void* pObj, SJson* pJson) { + return createComponentNodeStmtToJson(pObj, pJson); +} + +static int32_t jsonToCreateQnodeStmt(const SJson* pJson, void* pObj) { + return jsonToCreateComponentNodeStmt(pJson, pObj); +} + +static int32_t dropQnodeStmtToJson(const void* pObj, SJson* pJson) { return dropComponentNodeStmtToJson(pObj, pJson); } + +static int32_t jsonToDropQnodeStmt(const SJson* pJson, void* pObj) { return jsonToDropComponentNodeStmt(pJson, pObj); } + +static int32_t createSnodeStmtToJson(const void* pObj, SJson* pJson) { + return createComponentNodeStmtToJson(pObj, pJson); +} + +static int32_t jsonToCreateSnodeStmt(const SJson* pJson, void* pObj) { + return jsonToCreateComponentNodeStmt(pJson, pObj); +} + +static int32_t dropSnodeStmtToJson(const void* pObj, SJson* pJson) { return dropComponentNodeStmtToJson(pObj, pJson); } + +static int32_t jsonToDropSnodeStmt(const SJson* pJson, void* pObj) { return jsonToDropComponentNodeStmt(pJson, pObj); } + +static int32_t createMnodeStmtToJson(const void* pObj, SJson* pJson) { + return createComponentNodeStmtToJson(pObj, pJson); +} + +static int32_t jsonToCreateMnodeStmt(const SJson* pJson, void* pObj) { + return jsonToCreateComponentNodeStmt(pJson, pObj); +} + +static int32_t dropMnodeStmtToJson(const void* pObj, SJson* pJson) { return dropComponentNodeStmtToJson(pObj, pJson); } + +static int32_t jsonToDropMnodeStmt(const SJson* pJson, void* pObj) { return jsonToDropComponentNodeStmt(pJson, pObj); } + +static const char* jkDropDnodeStmtDnodeId = "DnodeId"; +static const char* jkDropDnodeStmtFqdn = "Fqdn"; +static const char* jkDropDnodeStmtPort = "Port"; +static const char* jkDropDnodeStmtForce = "Force"; + +static int32_t dropDnodeStmtToJson(const void* pObj, SJson* pJson) { + const SDropDnodeStmt* pNode = (const SDropDnodeStmt*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkDropDnodeStmtDnodeId, pNode->dnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropDnodeStmtFqdn, pNode->fqdn); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkDropDnodeStmtPort, pNode->port); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropDnodeStmtForce, pNode->force); + } + + return code; +} + +static int32_t jsonToDropDnodeStmt(const SJson* pJson, void* pObj) { + SDropDnodeStmt* pNode = (SDropDnodeStmt*)pObj; + + int32_t code = tjsonGetIntValue(pJson, jkDropDnodeStmtDnodeId, &pNode->dnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropDnodeStmtFqdn, pNode->fqdn); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkDropDnodeStmtPort, &pNode->port); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropDnodeStmtForce, &pNode->force); + } + + return code; +} + static const char* jkCreateTopicStmtTopicName = "TopicName"; static const char* jkCreateTopicStmtSubscribeDbName = "SubscribeDbName"; static const char* jkCreateTopicStmtIgnoreExists = "IgnoreExists"; @@ -4561,6 +5536,616 @@ static int32_t jsonToCreateTopicStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkDropTopicStmtTopicName = "TopicName"; +static const char* jkDropTopicStmtIgnoreNotExists = "IgnoreNotExists"; + +static int32_t dropTopicStmtToJson(const void* pObj, SJson* pJson) { + const SDropTopicStmt* pNode = (const SDropTopicStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDropTopicStmtTopicName, pNode->topicName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropTopicStmtIgnoreNotExists, pNode->ignoreNotExists); + } + + return code; +} + +static int32_t jsonToDropTopicStmt(const SJson* pJson, void* pObj) { + SDropTopicStmt* pNode = (SDropTopicStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDropTopicStmtTopicName, pNode->topicName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropTopicStmtIgnoreNotExists, &pNode->ignoreNotExists); + } + + return code; +} + +static const char* jkDropCGroupStmtTopicName = "TopicName"; +static const char* jkDropCGroupStmtConsumerGroup = "ConsumerGroup"; +static const char* jkDropCGroupStmtIgnoreNotExists = "IgnoreNotExists"; + +static int32_t dropConsumerGroupStmtToJson(const void* pObj, SJson* pJson) { + const SDropCGroupStmt* pNode = (const SDropCGroupStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDropCGroupStmtTopicName, pNode->topicName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDropCGroupStmtConsumerGroup, pNode->cgroup); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropCGroupStmtIgnoreNotExists, pNode->ignoreNotExists); + } + + return code; +} + +static int32_t jsonToDropConsumerGroupStmt(const SJson* pJson, void* pObj) { + SDropCGroupStmt* pNode = (SDropCGroupStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDropCGroupStmtTopicName, pNode->topicName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDropCGroupStmtConsumerGroup, pNode->cgroup); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropCGroupStmtIgnoreNotExists, &pNode->ignoreNotExists); + } + + return code; +} + +static const char* jkAlterLocalStmtConfig = "Config"; +static const char* jkAlterLocalStmtValue = "Value"; + +static int32_t alterLocalStmtToJson(const void* pObj, SJson* pJson) { + const SAlterLocalStmt* pNode = (const SAlterLocalStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkAlterLocalStmtConfig, pNode->config); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkAlterLocalStmtValue, pNode->value); + } + + return code; +} + +static int32_t jsonToAlterLocalStmt(const SJson* pJson, void* pObj) { + SAlterLocalStmt* pNode = (SAlterLocalStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkAlterLocalStmtConfig, pNode->config); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkAlterLocalStmtValue, pNode->value); + } + + return code; +} + +static const char* jkExplainStmtAnalyze = "Analyze"; +static const char* jkExplainStmtOptions = "Options"; +static const char* jkExplainStmtQuery = "Query"; + +static int32_t explainStmtToJson(const void* pObj, SJson* pJson) { + const SExplainStmt* pNode = (const SExplainStmt*)pObj; + + int32_t code = tjsonAddBoolToObject(pJson, jkExplainStmtAnalyze, pNode->analyze); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkExplainStmtOptions, nodeToJson, pNode->pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkExplainStmtQuery, nodeToJson, pNode->pQuery); + } + + return code; +} + +static int32_t jsonToExplainStmt(const SJson* pJson, void* pObj) { + SExplainStmt* pNode = (SExplainStmt*)pObj; + + int32_t code = tjsonGetBoolValue(pJson, jkExplainStmtAnalyze, &pNode->analyze); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkExplainStmtOptions, (SNode**)&pNode->pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkExplainStmtQuery, &pNode->pQuery); + } + + return code; +} + +static const char* jkDescribeStmtDbName = "DbName"; +static const char* jkDescribeStmtTableName = "TableName"; + +static int32_t describeStmtToJson(const void* pObj, SJson* pJson) { + const SDescribeStmt* pNode = (const SDescribeStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDescribeStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkDescribeStmtTableName, pNode->tableName); + } + + return code; +} + +static int32_t jsonToDescribeStmt(const SJson* pJson, void* pObj) { + SDescribeStmt* pNode = (SDescribeStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDescribeStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkDescribeStmtTableName, pNode->tableName); + } + + return code; +} + +static const char* jkCreateStreamStmtStreamName = "StreamName"; +static const char* jkCreateStreamStmtTargetDbName = "TargetDbName"; +static const char* jkCreateStreamStmtTargetTabName = "TargetTabName"; +static const char* jkCreateStreamStmtIgnoreExists = "IgnoreExists"; +static const char* jkCreateStreamStmtOptions = "Options"; +static const char* jkCreateStreamStmtQuery = "Query"; +static const char* jkCreateStreamStmtTags = "Tags"; +static const char* jkCreateStreamStmtSubtable = "Subtable"; + +static int32_t createStreamStmtToJson(const void* pObj, SJson* pJson) { + const SCreateStreamStmt* pNode = (const SCreateStreamStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkCreateStreamStmtStreamName, pNode->streamName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateStreamStmtTargetDbName, pNode->targetDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkCreateStreamStmtTargetTabName, pNode->targetTabName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkCreateStreamStmtIgnoreExists, pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateStreamStmtOptions, nodeToJson, pNode->pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateStreamStmtQuery, nodeToJson, pNode->pQuery); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkCreateStreamStmtTags, pNode->pTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkCreateStreamStmtSubtable, nodeToJson, pNode->pSubtable); + } + + return code; +} + +static int32_t jsonToCreateStreamStmt(const SJson* pJson, void* pObj) { + SCreateStreamStmt* pNode = (SCreateStreamStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkCreateStreamStmtStreamName, pNode->streamName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateStreamStmtTargetDbName, pNode->targetDbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkCreateStreamStmtTargetTabName, pNode->targetTabName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkCreateStreamStmtIgnoreExists, &pNode->ignoreExists); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateStreamStmtOptions, (SNode**)&pNode->pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateStreamStmtQuery, &pNode->pQuery); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkCreateStreamStmtTags, &pNode->pTags); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkCreateStreamStmtSubtable, &pNode->pSubtable); + } + + return code; +} + +static const char* jkDropStreamStmtStreamName = "StreamName"; +static const char* jkDropStreamStmtIgnoreNotExists = "IgnoreNotExists"; + +static int32_t dropStreamStmtToJson(const void* pObj, SJson* pJson) { + const SDropStreamStmt* pNode = (const SDropStreamStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkDropStreamStmtStreamName, pNode->streamName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddBoolToObject(pJson, jkDropStreamStmtIgnoreNotExists, pNode->ignoreNotExists); + } + + return code; +} + +static int32_t jsonToDropStreamStmt(const SJson* pJson, void* pObj) { + SDropStreamStmt* pNode = (SDropStreamStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkDropStreamStmtStreamName, pNode->streamName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBoolValue(pJson, jkDropStreamStmtIgnoreNotExists, &pNode->ignoreNotExists); + } + + return code; +} + +static const char* jkMergeVgroupStmtVgroupId1 = "VgroupId1"; +static const char* jkMergeVgroupStmtVgroupId2 = "VgroupId2"; + +static int32_t mergeVgroupStmtToJson(const void* pObj, SJson* pJson) { + const SMergeVgroupStmt* pNode = (const SMergeVgroupStmt*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkMergeVgroupStmtVgroupId1, pNode->vgId1); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkMergeVgroupStmtVgroupId2, pNode->vgId2); + } + + return code; +} + +static int32_t jsonToMergeVgroupStmt(const SJson* pJson, void* pObj) { + SMergeVgroupStmt* pNode = (SMergeVgroupStmt*)pObj; + + int32_t code = tjsonGetIntValue(pJson, jkMergeVgroupStmtVgroupId1, &pNode->vgId1); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkMergeVgroupStmtVgroupId2, &pNode->vgId2); + } + + return code; +} + +static const char* jkRedistributeVgroupStmtVgroupId = "VgroupId"; +static const char* jkRedistributeVgroupStmtDnodeId1 = "DnodeId1"; +static const char* jkRedistributeVgroupStmtDnodeId2 = "DnodeId2"; +static const char* jkRedistributeVgroupStmtDnodeId3 = "DnodeId3"; +static const char* jkRedistributeVgroupStmtDnodes = "Dnodes"; + +static int32_t redistributeVgroupStmtToJson(const void* pObj, SJson* pJson) { + const SRedistributeVgroupStmt* pNode = (const SRedistributeVgroupStmt*)pObj; + + int32_t code = tjsonAddIntegerToObject(pJson, jkRedistributeVgroupStmtVgroupId, pNode->vgId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkRedistributeVgroupStmtDnodeId1, pNode->dnodeId1); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkRedistributeVgroupStmtDnodeId2, pNode->dnodeId2); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkRedistributeVgroupStmtDnodeId3, pNode->dnodeId3); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkRedistributeVgroupStmtDnodes, pNode->pDnodes); + } + + return code; +} + +static int32_t jsonToRedistributeVgroupStmt(const SJson* pJson, void* pObj) { + SRedistributeVgroupStmt* pNode = (SRedistributeVgroupStmt*)pObj; + + int32_t code = tjsonGetIntValue(pJson, jkRedistributeVgroupStmtVgroupId, &pNode->vgId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkRedistributeVgroupStmtDnodeId1, &pNode->dnodeId1); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkRedistributeVgroupStmtDnodeId2, &pNode->dnodeId2); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetIntValue(pJson, jkRedistributeVgroupStmtDnodeId3, &pNode->dnodeId3); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkRedistributeVgroupStmtDnodes, &pNode->pDnodes); + } + + return code; +} + +static const char* jkSplitVgroupStmtVgroupId = "VgroupId"; + +static int32_t splitVgroupStmtToJson(const void* pObj, SJson* pJson) { + const SSplitVgroupStmt* pNode = (const SSplitVgroupStmt*)pObj; + return tjsonAddIntegerToObject(pJson, jkSplitVgroupStmtVgroupId, pNode->vgId); +} + +static int32_t jsonToSplitVgroupStmt(const SJson* pJson, void* pObj) { + SSplitVgroupStmt* pNode = (SSplitVgroupStmt*)pObj; + return tjsonGetIntValue(pJson, jkSplitVgroupStmtVgroupId, &pNode->vgId); +} + +static const char* jkGrantStmtUserName = "UserName"; +static const char* jkGrantStmtObjName = "ObjName"; +static const char* jkGrantStmtPrivileges = "Privileges"; + +static int32_t grantStmtToJson(const void* pObj, SJson* pJson) { + const SGrantStmt* pNode = (const SGrantStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkGrantStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkGrantStmtObjName, pNode->objName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkGrantStmtPrivileges, pNode->privileges); + } + + return code; +} + +static int32_t jsonToGrantStmt(const SJson* pJson, void* pObj) { + SGrantStmt* pNode = (SGrantStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkGrantStmtUserName, pNode->userName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkGrantStmtObjName, pNode->objName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkGrantStmtPrivileges, &pNode->privileges); + } + + return code; +} + +static int32_t revokeStmtToJson(const void* pObj, SJson* pJson) { return grantStmtToJson(pObj, pJson); } + +static int32_t jsonToRevokeStmt(const SJson* pJson, void* pObj) { return jsonToGrantStmt(pJson, pObj); } + +static const char* jkShowStmtDbName = "DbName"; +static const char* jkShowStmtTbName = "TbName"; +static const char* jkShowStmtTableCondType = "TableCondType"; + +static int32_t showStmtToJson(const void* pObj, SJson* pJson) { + const SShowStmt* pNode = (const SShowStmt*)pObj; + + int32_t code = tjsonAddObject(pJson, jkShowStmtDbName, nodeToJson, pNode->pDbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkShowStmtTbName, nodeToJson, pNode->pTbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkShowStmtTableCondType, pNode->tableCondType); + } + + return code; +} + +static int32_t jsonToShowStmt(const SJson* pJson, void* pObj) { + SShowStmt* pNode = (SShowStmt*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkShowStmtDbName, &pNode->pDbName); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkShowStmtTbName, &pNode->pTbName); + } + if (TSDB_CODE_SUCCESS == code) { + tjsonGetNumberValue(pJson, jkShowStmtTableCondType, pNode->tableCondType, code); + } + + return code; +} + +static int32_t showDnodesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowDnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showMnodesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowMnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showQnodesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowQnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showClusterStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowClusterStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showDatabasesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowDatabasesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showFunctionsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowFunctionsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showIndexesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowIndexesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showStablesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowStablesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showStreamsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowStreamsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showTablesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowTablesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showTagsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowTagsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showUsersStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowUsersStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showVgroupsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowVgroupsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showConsumersStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowConsumersStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showVariablesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowVariablesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static const char* jkShowDnodeVariablesStmtDnodeId = "DnodeId"; +static const char* jkShowDnodeVariablesStmtLikePattern = "LikePattern"; + +static int32_t showDnodeVariablesStmtToJson(const void* pObj, SJson* pJson) { + const SShowDnodeVariablesStmt* pNode = (const SShowDnodeVariablesStmt*)pObj; + + int32_t code = tjsonAddObject(pJson, jkShowDnodeVariablesStmtDnodeId, nodeToJson, pNode->pDnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkShowDnodeVariablesStmtLikePattern, nodeToJson, pNode->pLikePattern); + } + + return code; +} + +static int32_t jsonToShowDnodeVariablesStmt(const SJson* pJson, void* pObj) { + SShowDnodeVariablesStmt* pNode = (SShowDnodeVariablesStmt*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkShowDnodeVariablesStmtDnodeId, &pNode->pDnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkShowDnodeVariablesStmtLikePattern, &pNode->pLikePattern); + } + + return code; +} + +static int32_t showTransactionsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowTransactionsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static int32_t showSubscriptionsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowSubscriptionsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static const char* jkShowVnodesStmtDnodeId = "DnodeId"; +static const char* jkShowVnodesStmtDnodeEndpoint = "DnodeEndpoint"; + +static int32_t showVnodesStmtToJson(const void* pObj, SJson* pJson) { + const SShowVnodesStmt* pNode = (const SShowVnodesStmt*)pObj; + + int32_t code = tjsonAddObject(pJson, jkShowVnodesStmtDnodeId, nodeToJson, pNode->pDnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkShowVnodesStmtDnodeEndpoint, nodeToJson, pNode->pDnodeEndpoint); + } + + return code; +} + +static int32_t jsonToShowVnodesStmt(const SJson* pJson, void* pObj) { + SShowVnodesStmt* pNode = (SShowVnodesStmt*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkShowVnodesStmtDnodeId, &pNode->pDnodeId); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkShowVnodesStmtDnodeEndpoint, &pNode->pDnodeEndpoint); + } + + return code; +} + +static int32_t showUserPrivilegesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowUserPrivilegesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static const char* jkShowCreateDatabaseStmtDbName = "DbName"; + +static int32_t showCreateDatabaseStmtToJson(const void* pObj, SJson* pJson) { + const SShowCreateDatabaseStmt* pNode = (const SShowCreateDatabaseStmt*)pObj; + return tjsonAddStringToObject(pJson, jkShowCreateDatabaseStmtDbName, pNode->dbName); +} + +static int32_t jsonToShowCreateDatabaseStmt(const SJson* pJson, void* pObj) { + SShowCreateDatabaseStmt* pNode = (SShowCreateDatabaseStmt*)pObj; + return tjsonGetStringValue(pJson, jkShowCreateDatabaseStmtDbName, pNode->dbName); +} + +static const char* jkShowCreateTableStmtDbName = "DbName"; +static const char* jkShowCreateTableStmtTableName = "TableName"; + +static int32_t showCreateTableStmtToJson(const void* pObj, SJson* pJson) { + const SShowCreateTableStmt* pNode = (const SShowCreateTableStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkShowCreateTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkShowCreateTableStmtTableName, pNode->tableName); + } + + return code; +} + +static int32_t jsonToShowCreateTableStmt(const SJson* pJson, void* pObj) { + SShowCreateTableStmt* pNode = (SShowCreateTableStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkShowCreateTableStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkShowCreateTableStmtTableName, pNode->tableName); + } + + return code; +} + +static int32_t showCreateStableStmtToJson(const void* pObj, SJson* pJson) { + return showCreateTableStmtToJson(pObj, pJson); +} + +static int32_t jsonToShowCreateStableStmt(const SJson* pJson, void* pObj) { + return jsonToShowCreateTableStmt(pJson, pObj); +} + +static const char* jkShowTableDistributedStmtDbName = "DbName"; +static const char* jkShowTableDistributedStmtTableName = "TableName"; + +static int32_t showTableDistributedStmtToJson(const void* pObj, SJson* pJson) { + const SShowTableDistributedStmt* pNode = (const SShowTableDistributedStmt*)pObj; + + int32_t code = tjsonAddStringToObject(pJson, jkShowTableDistributedStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddStringToObject(pJson, jkShowTableDistributedStmtTableName, pNode->tableName); + } + + return code; +} + +static int32_t jsonToShowTableDistributedStmt(const SJson* pJson, void* pObj) { + SShowTableDistributedStmt* pNode = (SShowTableDistributedStmt*)pObj; + + int32_t code = tjsonGetStringValue(pJson, jkShowTableDistributedStmtDbName, pNode->dbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetStringValue(pJson, jkShowTableDistributedStmtTableName, pNode->tableName); + } + + return code; +} + +static int32_t showLocalVariablesStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowLocalVariablesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + +static const char* jkShowTableTagsStmtDbName = "DbName"; +static const char* jkShowTableTagsStmtTbName = "TbName"; +static const char* jkShowTableTagsStmtTags = "Tags"; + +static int32_t showTableTagsStmtToJson(const void* pObj, SJson* pJson) { + const SShowTableTagsStmt* pNode = (const SShowTableTagsStmt*)pObj; + + int32_t code = tjsonAddObject(pJson, jkShowTableTagsStmtDbName, nodeToJson, pNode->pDbName); + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkShowTableTagsStmtTbName, nodeToJson, pNode->pTbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkShowTableTagsStmtTags, pNode->pTags); + } + + return code; +} + +static int32_t jsonToShowTableTagsStmt(const SJson* pJson, void* pObj) { + SShowTableTagsStmt* pNode = (SShowTableTagsStmt*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkShowTableTagsStmtDbName, &pNode->pDbName); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkShowTableTagsStmtTbName, &pNode->pTbName); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkShowTableTagsStmtTags, &pNode->pTags); + } + + return code; +} + static const char* jkDeleteStmtFromTable = "FromTable"; static const char* jkDeleteStmtWhere = "Where"; static const char* jkDeleteStmtCountFunc = "CountFunc"; @@ -4628,6 +6213,45 @@ static int32_t jsonToDeleteStmt(const SJson* pJson, void* pObj) { return code; } +static const char* jkInsertStmtTable = "Table"; +static const char* jkInsertStmtCols = "Cols"; +static const char* jkInsertStmtQuery = "Query"; +static const char* jkInsertStmtPrecision = "Precision"; + +static int32_t insertStmtToJson(const void* pObj, SJson* pJson) { + const SInsertStmt* pNode = (const SInsertStmt*)pObj; + + int32_t code = tjsonAddObject(pJson, jkInsertStmtTable, nodeToJson, pNode->pTable); + if (TSDB_CODE_SUCCESS == code) { + code = nodeListToJson(pJson, jkInsertStmtCols, pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddObject(pJson, jkInsertStmtQuery, nodeToJson, pNode->pQuery); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkInsertStmtPrecision, pNode->precision); + } + + return code; +} + +static int32_t jsonToInsertStmt(const SJson* pJson, void* pObj) { + SInsertStmt* pNode = (SInsertStmt*)pObj; + + int32_t code = jsonToNodeObject(pJson, jkInsertStmtTable, &pNode->pTable); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkInsertStmtCols, &pNode->pCols); + } + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeObject(pJson, jkInsertStmtQuery, &pNode->pQuery); + } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetUTinyIntValue(pJson, jkInsertStmtPrecision, &pNode->precision); + } + + return code; +} + static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { switch (nodeType(pObj)) { case QUERY_NODE_COLUMN: @@ -4645,7 +6269,7 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_TEMP_TABLE: return tempTableNodeToJson(pObj, pJson); case QUERY_NODE_JOIN_TABLE: - break; + return joinTableNodeToJson(pObj, pJson); case QUERY_NODE_GROUPING_SET: return groupingSetNodeToJson(pObj, pJson); case QUERY_NODE_ORDER_BY_EXPR: @@ -4671,11 +6295,19 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { case QUERY_NODE_SLOT_DESC: return slotDescNodeToJson(pObj, pJson); case QUERY_NODE_COLUMN_DEF: - break; + return columnDefNodeToJson(pObj, pJson); case QUERY_NODE_DOWNSTREAM_SOURCE: return downstreamSourceNodeToJson(pObj, pJson); case QUERY_NODE_DATABASE_OPTIONS: return databaseOptionsToJson(pObj, pJson); + case QUERY_NODE_TABLE_OPTIONS: + return tableOptionsToJson(pObj, pJson); + case QUERY_NODE_INDEX_OPTIONS: + return indexOptionsToJson(pObj, pJson); + case QUERY_NODE_EXPLAIN_OPTIONS: + return explainOptionsToJson(pObj, pJson); + case QUERY_NODE_STREAM_OPTIONS: + return streamOptionsToJson(pObj, pJson); case QUERY_NODE_LEFT_VALUE: return TSDB_CODE_SUCCESS; // SLeftValueNode has no fields to serialize. case QUERY_NODE_WHEN_THEN: @@ -4688,27 +6320,144 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return setOperatorToJson(pObj, pJson); case QUERY_NODE_SELECT_STMT: return selectStmtToJson(pObj, pJson); - case QUERY_NODE_VNODE_MODIF_STMT: + case QUERY_NODE_VNODE_MODIFY_STMT: + return vnodeModifyStmtToJson(pObj, pJson); case QUERY_NODE_CREATE_DATABASE_STMT: - break; + return createDatabaseStmtToJson(pObj, pJson); case QUERY_NODE_ALTER_DATABASE_STMT: return alterDatabaseStmtToJson(pObj, pJson); + case QUERY_NODE_TRIM_DATABASE_STMT: + return trimDatabaseStmtToJson(pObj, pJson); case QUERY_NODE_CREATE_TABLE_STMT: - break; + return createTableStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: + return createSubTableClauseToJson(pObj, pJson); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + return createMultiTablesStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_TABLE_CLAUSE: + return dropTableClauseToJson(pObj, pJson); + case QUERY_NODE_DROP_TABLE_STMT: + return dropTableStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_SUPER_TABLE_STMT: + return dropStableStmtToJson(pObj, pJson); case QUERY_NODE_ALTER_TABLE_STMT: return alterTableStmtToJson(pObj, pJson); + case QUERY_NODE_ALTER_SUPER_TABLE_STMT: + return alterStableStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_USER_STMT: + return createUserStmtToJson(pObj, pJson); + case QUERY_NODE_ALTER_USER_STMT: + return alterUserStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_USER_STMT: + return dropUserStmtToJson(pObj, pJson); case QUERY_NODE_USE_DATABASE_STMT: - break; + return useDatabaseStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_DNODE_STMT: + return createDnodeStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_DNODE_STMT: + return dropDnodeStmtToJson(pObj, pJson); case QUERY_NODE_ALTER_DNODE_STMT: return alterDnodeStmtToJson(pObj, pJson); - case QUERY_NODE_SHOW_DATABASES_STMT: - case QUERY_NODE_SHOW_TABLES_STMT: - case QUERY_NODE_SHOW_TAGS_STMT: - break; + case QUERY_NODE_CREATE_INDEX_STMT: + return createIndexStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_INDEX_STMT: + return dropIndexStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_QNODE_STMT: + return createQnodeStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_QNODE_STMT: + return dropQnodeStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_SNODE_STMT: + return createSnodeStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_SNODE_STMT: + return dropSnodeStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_MNODE_STMT: + return createMnodeStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_MNODE_STMT: + return dropMnodeStmtToJson(pObj, pJson); case QUERY_NODE_CREATE_TOPIC_STMT: return createTopicStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_TOPIC_STMT: + return dropTopicStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_CGROUP_STMT: + return dropConsumerGroupStmtToJson(pObj, pJson); + case QUERY_NODE_ALTER_LOCAL_STMT: + return alterLocalStmtToJson(pObj, pJson); + case QUERY_NODE_EXPLAIN_STMT: + return explainStmtToJson(pObj, pJson); + case QUERY_NODE_DESCRIBE_STMT: + return describeStmtToJson(pObj, pJson); + case QUERY_NODE_CREATE_STREAM_STMT: + return createStreamStmtToJson(pObj, pJson); + case QUERY_NODE_DROP_STREAM_STMT: + return dropStreamStmtToJson(pObj, pJson); + case QUERY_NODE_BALANCE_VGROUP_STMT: + return TSDB_CODE_SUCCESS; // SBalanceVgroupStmt has no fields to serialize. + case QUERY_NODE_MERGE_VGROUP_STMT: + return mergeVgroupStmtToJson(pObj, pJson); + case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT: + return redistributeVgroupStmtToJson(pObj, pJson); + case QUERY_NODE_SPLIT_VGROUP_STMT: + return splitVgroupStmtToJson(pObj, pJson); + case QUERY_NODE_GRANT_STMT: + return grantStmtToJson(pObj, pJson); + case QUERY_NODE_REVOKE_STMT: + return revokeStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_DNODES_STMT: + return showDnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_MNODES_STMT: + return showMnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_QNODES_STMT: + return showQnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_CLUSTER_STMT: + return showClusterStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_DATABASES_STMT: + return showDatabasesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_FUNCTIONS_STMT: + return showFunctionsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_INDEXES_STMT: + return showIndexesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_STABLES_STMT: + return showStablesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_STREAMS_STMT: + return showStreamsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_TABLES_STMT: + return showTablesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_TAGS_STMT: + return showTagsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_USERS_STMT: + return showUsersStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_VGROUPS_STMT: + return showVgroupsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_CONSUMERS_STMT: + return showConsumersStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_VARIABLES_STMT: + return showVariablesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: + return showDnodeVariablesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_TRANSACTIONS_STMT: + return showTransactionsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT: + return showSubscriptionsStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_VNODES_STMT: + return showVnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT: + return showUserPrivilegesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: + return showCreateDatabaseStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_CREATE_TABLE_STMT: + return showCreateTableStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_CREATE_STABLE_STMT: + return showCreateStableStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: + return showTableDistributedStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT: + return showLocalVariablesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: + return showTableTagsStmtToJson(pObj, pJson); case QUERY_NODE_DELETE_STMT: return deleteStmtToJson(pObj, pJson); + case QUERY_NODE_INSERT_STMT: + return insertStmtToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_SCAN: return logicScanNodeToJson(pObj, pJson); case QUERY_NODE_LOGIC_PLAN_JOIN: @@ -4827,6 +6576,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRealTableNode(pJson, pObj); case QUERY_NODE_TEMP_TABLE: return jsonToTempTableNode(pJson, pObj); + case QUERY_NODE_JOIN_TABLE: + return jsonToJoinTableNode(pJson, pObj); case QUERY_NODE_GROUPING_SET: return jsonToGroupingSetNode(pJson, pObj); case QUERY_NODE_ORDER_BY_EXPR: @@ -4849,10 +6600,20 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToDataBlockDescNode(pJson, pObj); case QUERY_NODE_SLOT_DESC: return jsonToSlotDescNode(pJson, pObj); + case QUERY_NODE_COLUMN_DEF: + return jsonToColumnDefNode(pJson, pObj); case QUERY_NODE_DOWNSTREAM_SOURCE: return jsonToDownstreamSourceNode(pJson, pObj); case QUERY_NODE_DATABASE_OPTIONS: return jsonToDatabaseOptions(pJson, pObj); + case QUERY_NODE_TABLE_OPTIONS: + return jsonToTableOptions(pJson, pObj); + case QUERY_NODE_INDEX_OPTIONS: + return jsonToIndexOptions(pJson, pObj); + case QUERY_NODE_EXPLAIN_OPTIONS: + return jsonToExplainOptions(pJson, pObj); + case QUERY_NODE_STREAM_OPTIONS: + return jsonToStreamOptions(pJson, pObj); case QUERY_NODE_LEFT_VALUE: return TSDB_CODE_SUCCESS; // SLeftValueNode has no fields to deserialize. case QUERY_NODE_WHEN_THEN: @@ -4865,18 +6626,148 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToSetOperator(pJson, pObj); case QUERY_NODE_SELECT_STMT: return jsonToSelectStmt(pJson, pObj); + case QUERY_NODE_VNODE_MODIFY_STMT: + return jsonToVnodeModifyStmt(pJson, pObj); + case QUERY_NODE_CREATE_DATABASE_STMT: + return jsonToCreateDatabaseStmt(pJson, pObj); case QUERY_NODE_ALTER_DATABASE_STMT: return jsonToAlterDatabaseStmt(pJson, pObj); + case QUERY_NODE_TRIM_DATABASE_STMT: + return jsonToTrimDatabaseStmt(pJson, pObj); + case QUERY_NODE_CREATE_TABLE_STMT: + return jsonToCreateTableStmt(pJson, pObj); + case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: + return jsonToCreateSubTableClause(pJson, pObj); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + return jsonToCreateMultiTablesStmt(pJson, pObj); + case QUERY_NODE_DROP_TABLE_CLAUSE: + return jsonToDropTableClause(pJson, pObj); + case QUERY_NODE_DROP_TABLE_STMT: + return jsonToDropTableStmt(pJson, pObj); + case QUERY_NODE_DROP_SUPER_TABLE_STMT: + return jsonToDropStableStmt(pJson, pObj); case QUERY_NODE_ALTER_TABLE_STMT: return jsonToAlterTableStmt(pJson, pObj); + case QUERY_NODE_ALTER_SUPER_TABLE_STMT: + return jsonToAlterStableStmt(pJson, pObj); + case QUERY_NODE_CREATE_USER_STMT: + return jsonToCreateUserStmt(pJson, pObj); + case QUERY_NODE_ALTER_USER_STMT: + return jsonToAlterUserStmt(pJson, pObj); + case QUERY_NODE_DROP_USER_STMT: + return jsonToDropUserStmt(pJson, pObj); + case QUERY_NODE_USE_DATABASE_STMT: + return jsonToUseDatabaseStmt(pJson, pObj); + case QUERY_NODE_CREATE_DNODE_STMT: + return jsonToCreateDnodeStmt(pJson, pObj); + case QUERY_NODE_DROP_DNODE_STMT: + return jsonToDropDnodeStmt(pJson, pObj); case QUERY_NODE_ALTER_DNODE_STMT: return jsonToAlterDnodeStmt(pJson, pObj); + case QUERY_NODE_CREATE_INDEX_STMT: + return jsonToCreateIndexStmt(pJson, pObj); + case QUERY_NODE_DROP_INDEX_STMT: + return jsonToDropIndexStmt(pJson, pObj); + case QUERY_NODE_CREATE_QNODE_STMT: + return jsonToCreateQnodeStmt(pJson, pObj); + case QUERY_NODE_DROP_QNODE_STMT: + return jsonToDropQnodeStmt(pJson, pObj); + case QUERY_NODE_CREATE_SNODE_STMT: + return jsonToCreateSnodeStmt(pJson, pObj); + case QUERY_NODE_DROP_SNODE_STMT: + return jsonToDropSnodeStmt(pJson, pObj); + case QUERY_NODE_CREATE_MNODE_STMT: + return jsonToCreateMnodeStmt(pJson, pObj); + case QUERY_NODE_DROP_MNODE_STMT: + return jsonToDropMnodeStmt(pJson, pObj); case QUERY_NODE_CREATE_TOPIC_STMT: return jsonToCreateTopicStmt(pJson, pObj); + case QUERY_NODE_DROP_TOPIC_STMT: + return jsonToDropTopicStmt(pJson, pObj); + case QUERY_NODE_DROP_CGROUP_STMT: + return jsonToDropConsumerGroupStmt(pJson, pObj); + case QUERY_NODE_ALTER_LOCAL_STMT: + return jsonToAlterLocalStmt(pJson, pObj); + case QUERY_NODE_EXPLAIN_STMT: + return jsonToExplainStmt(pJson, pObj); + case QUERY_NODE_DESCRIBE_STMT: + return jsonToDescribeStmt(pJson, pObj); + case QUERY_NODE_CREATE_STREAM_STMT: + return jsonToCreateStreamStmt(pJson, pObj); + case QUERY_NODE_DROP_STREAM_STMT: + return jsonToDropStreamStmt(pJson, pObj); + case QUERY_NODE_BALANCE_VGROUP_STMT: + return TSDB_CODE_SUCCESS; // SBalanceVgroupStmt has no fields to deserialize. + case QUERY_NODE_MERGE_VGROUP_STMT: + return jsonToMergeVgroupStmt(pJson, pObj); + case QUERY_NODE_REDISTRIBUTE_VGROUP_STMT: + return jsonToRedistributeVgroupStmt(pJson, pObj); + case QUERY_NODE_SPLIT_VGROUP_STMT: + return jsonToSplitVgroupStmt(pJson, pObj); + case QUERY_NODE_GRANT_STMT: + return jsonToGrantStmt(pJson, pObj); + case QUERY_NODE_REVOKE_STMT: + return jsonToRevokeStmt(pJson, pObj); + case QUERY_NODE_SHOW_DNODES_STMT: + return jsonToShowDnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_MNODES_STMT: + return jsonToShowMnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_QNODES_STMT: + return jsonToShowQnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_CLUSTER_STMT: + return jsonToShowClusterStmt(pJson, pObj); + case QUERY_NODE_SHOW_DATABASES_STMT: + return jsonToShowDatabasesStmt(pJson, pObj); + case QUERY_NODE_SHOW_FUNCTIONS_STMT: + return jsonToShowFunctionsStmt(pJson, pObj); + case QUERY_NODE_SHOW_INDEXES_STMT: + return jsonToShowIndexesStmt(pJson, pObj); + case QUERY_NODE_SHOW_STABLES_STMT: + return jsonToShowStablesStmt(pJson, pObj); + case QUERY_NODE_SHOW_STREAMS_STMT: + return jsonToShowStreamsStmt(pJson, pObj); + case QUERY_NODE_SHOW_TABLES_STMT: + return jsonToShowTablesStmt(pJson, pObj); + case QUERY_NODE_SHOW_TAGS_STMT: + return jsonToShowTagsStmt(pJson, pObj); + case QUERY_NODE_SHOW_USERS_STMT: + return jsonToShowUsersStmt(pJson, pObj); + case QUERY_NODE_SHOW_VGROUPS_STMT: + return jsonToShowVgroupsStmt(pJson, pObj); + case QUERY_NODE_SHOW_CONSUMERS_STMT: + return jsonToShowConsumersStmt(pJson, pObj); + case QUERY_NODE_SHOW_VARIABLES_STMT: + return jsonToShowVariablesStmt(pJson, pObj); + case QUERY_NODE_SHOW_DNODE_VARIABLES_STMT: + return jsonToShowDnodeVariablesStmt(pJson, pObj); + case QUERY_NODE_SHOW_TRANSACTIONS_STMT: + return jsonToShowTransactionsStmt(pJson, pObj); + case QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT: + return jsonToShowSubscriptionsStmt(pJson, pObj); + case QUERY_NODE_SHOW_VNODES_STMT: + return jsonToShowVnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_USER_PRIVILEGES_STMT: + return jsonToShowUserPrivilegesStmt(pJson, pObj); + case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: + return jsonToShowCreateDatabaseStmt(pJson, pObj); + case QUERY_NODE_SHOW_CREATE_TABLE_STMT: + return jsonToShowCreateTableStmt(pJson, pObj); + case QUERY_NODE_SHOW_CREATE_STABLE_STMT: + return jsonToShowCreateStableStmt(pJson, pObj); + case QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT: + return jsonToShowTableDistributedStmt(pJson, pObj); + case QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT: + return jsonToShowLocalVariablesStmt(pJson, pObj); + case QUERY_NODE_SHOW_TABLE_TAGS_STMT: + return jsonToShowTableTagsStmt(pJson, pObj); case QUERY_NODE_DELETE_STMT: return jsonToDeleteStmt(pJson, pObj); + case QUERY_NODE_INSERT_STMT: + return jsonToInsertStmt(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_SCAN: return jsonToLogicScanNode(pJson, pObj); + case QUERY_NODE_LOGIC_PLAN_JOIN: + return jsonToLogicJoinNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_AGG: return jsonToLogicAggNode(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_PROJECT: diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index e3210966a0..dd06326dcb 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -305,8 +305,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SSetOperator)); case QUERY_NODE_SELECT_STMT: return makeNode(type, sizeof(SSelectStmt)); - case QUERY_NODE_VNODE_MODIF_STMT: - return makeNode(type, sizeof(SVnodeModifOpStmt)); + case QUERY_NODE_VNODE_MODIFY_STMT: + return makeNode(type, sizeof(SVnodeModifyOpStmt)); case QUERY_NODE_CREATE_DATABASE_STMT: return makeNode(type, sizeof(SCreateDatabaseStmt)); case QUERY_NODE_DROP_DATABASE_STMT: @@ -321,8 +321,8 @@ SNode* nodesMakeNode(ENodeType type) { return makeNode(type, sizeof(SCreateTableStmt)); case QUERY_NODE_CREATE_SUBTABLE_CLAUSE: return makeNode(type, sizeof(SCreateSubTableClause)); - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: - return makeNode(type, sizeof(SCreateMultiTableStmt)); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + return makeNode(type, sizeof(SCreateMultiTablesStmt)); case QUERY_NODE_DROP_TABLE_CLAUSE: return makeNode(type, sizeof(SDropTableClause)); case QUERY_NODE_DROP_TABLE_STMT: @@ -818,8 +818,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode((SNode*)pStmt->pSlimit); break; } - case QUERY_NODE_VNODE_MODIF_STMT: { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pNode; + case QUERY_NODE_VNODE_MODIFY_STMT: { + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pNode; destroyVgDataBlockArray(pStmt->pDataBlocks); taosMemoryFreeClear(pStmt->pTableMeta); taosHashCleanup(pStmt->pVgroupsHashObj); @@ -862,8 +862,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode((SNode*)pStmt->pOptions); break; } - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: - nodesDestroyList(((SCreateMultiTableStmt*)pNode)->pSubTables); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + nodesDestroyList(((SCreateMultiTablesStmt*)pNode)->pSubTables); break; case QUERY_NODE_DROP_TABLE_CLAUSE: // no pointer field break; diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index e01d0243a9..cd1260584e 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -473,7 +473,15 @@ index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL func_list(A) ::= func(B). { A = createNodeList(pCxt, B); } func_list(A) ::= func_list(B) NK_COMMA func(C). { A = addNodeToList(pCxt, B, C); } -func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } +func(A) ::= sma_func_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } + +%type sma_func_name { SToken } +%destructor sma_func_name { } +sma_func_name(A) ::= function_name(B). { A = B; } +sma_func_name(A) ::= COUNT(B). { A = B; } +sma_func_name(A) ::= FIRST(B). { A = B; } +sma_func_name(A) ::= LAST(B). { A = B; } +sma_func_name(A) ::= LAST_ROW(B). { A = B; } sma_stream_opt(A) ::= . { A = createStreamOptions(pCxt); } sma_stream_opt(A) ::= sma_stream_opt(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } @@ -733,6 +741,7 @@ pseudo_column(A) ::= WSTART(B). pseudo_column(A) ::= WEND(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= WDURATION(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= IROWTS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } +pseudo_column(A) ::= ISFILLED(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } pseudo_column(A) ::= QTAGS(B). { A = createRawExprNode(pCxt, &B, createFunctionNode(pCxt, &B, NULL)); } function_expression(A) ::= function_name(B) NK_LP expression_list(C) NK_RP(D). { A = createRawExprNodeExt(pCxt, &B, &D, createFunctionNode(pCxt, &B, C)); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 446f758ed7..6e6fdd64b2 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1208,7 +1208,7 @@ SNode* createCreateSubTableClause(SAstCreateContext* pCxt, bool ignoreExists, SN SNode* createCreateMultiTableStmt(SAstCreateContext* pCxt, SNodeList* pSubTables) { CHECK_PARSER_STATUS(pCxt); - SCreateMultiTableStmt* pStmt = (SCreateMultiTableStmt*)nodesMakeNode(QUERY_NODE_CREATE_MULTI_TABLE_STMT); + SCreateMultiTablesStmt* pStmt = (SCreateMultiTablesStmt*)nodesMakeNode(QUERY_NODE_CREATE_MULTI_TABLES_STMT); CHECK_OUT_OF_MEM(pStmt); pStmt->pSubTables = pSubTables; return (SNode*)pStmt; @@ -1430,7 +1430,7 @@ SNode* createCreateUserStmt(SAstCreateContext* pCxt, SToken* pUserName, const ST } SCreateUserStmt* pStmt = (SCreateUserStmt*)nodesMakeNode(QUERY_NODE_CREATE_USER_STMT); CHECK_OUT_OF_MEM(pStmt); - COPY_STRING_FORM_ID_TOKEN(pStmt->useName, pUserName); + COPY_STRING_FORM_ID_TOKEN(pStmt->userName, pUserName); strcpy(pStmt->password, password); pStmt->sysinfo = sysinfo; return (SNode*)pStmt; @@ -1443,7 +1443,7 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t al } SAlterUserStmt* pStmt = (SAlterUserStmt*)nodesMakeNode(QUERY_NODE_ALTER_USER_STMT); CHECK_OUT_OF_MEM(pStmt); - COPY_STRING_FORM_ID_TOKEN(pStmt->useName, pUserName); + COPY_STRING_FORM_ID_TOKEN(pStmt->userName, pUserName); pStmt->alterType = alterType; switch (alterType) { case TSDB_ALTER_USER_PASSWD: { @@ -1474,7 +1474,7 @@ SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName) { } SDropUserStmt* pStmt = (SDropUserStmt*)nodesMakeNode(QUERY_NODE_DROP_USER_STMT); CHECK_OUT_OF_MEM(pStmt); - COPY_STRING_FORM_ID_TOKEN(pStmt->useName, pUserName); + COPY_STRING_FORM_ID_TOKEN(pStmt->userName, pUserName); return (SNode*)pStmt; } diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index f90a42add3..b57690f9b1 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -245,10 +245,14 @@ static int32_t collectMetaKeyFromCreateTable(SCollectMetaKeyCxt* pCxt, SCreateTa if (TSDB_CODE_SUCCESS == code && NULL == pStmt->pTags) { code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache); } + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, AUTH_TYPE_WRITE, + pCxt->pMetaCache); + } return code; } -static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCreateMultiTableStmt* pStmt) { +static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCreateMultiTablesStmt* pStmt) { int32_t code = TSDB_CODE_SUCCESS; SNode* pNode = NULL; FOREACH(pNode, pStmt->pSubTables) { @@ -261,6 +265,10 @@ static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCre if (TSDB_CODE_SUCCESS == code) { code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pClause->dbName, pClause->tableName, pCxt->pMetaCache); } + if (TSDB_CODE_SUCCESS == code) { + code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pClause->dbName, AUTH_TYPE_WRITE, + pCxt->pMetaCache); + } if (TSDB_CODE_SUCCESS != code) { break; } @@ -351,38 +359,59 @@ static int32_t collectMetaKeyFromCreateStream(SCollectMetaKeyCxt* pCxt, SCreateS } static int32_t collectMetaKeyFromShowDnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_DNODES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowMnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MNODES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MNODES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowModules(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MODULES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_MODULES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowQnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_QNODES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_QNODES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowSnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_SNODES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_SNODES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_BNODES, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_BNODES, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowCluster(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, - pCxt->pMetaCache); + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; } static int32_t collectMetaKeyFromShowDatabases(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { @@ -584,8 +613,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromFlushDatabase(pCxt, (SFlushDatabaseStmt*)pStmt); case QUERY_NODE_CREATE_TABLE_STMT: return collectMetaKeyFromCreateTable(pCxt, (SCreateTableStmt*)pStmt); - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: - return collectMetaKeyFromCreateMultiTable(pCxt, (SCreateMultiTableStmt*)pStmt); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + return collectMetaKeyFromCreateMultiTable(pCxt, (SCreateMultiTablesStmt*)pStmt); case QUERY_NODE_DROP_TABLE_STMT: return collectMetaKeyFromDropTable(pCxt, (SDropTableStmt*)pStmt); case QUERY_NODE_ALTER_TABLE_STMT: diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index f7ab4fccbe..fe82ce8706 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -78,7 +78,7 @@ static int32_t authSetOperator(SAuthCxt* pCxt, SSetOperator* pSetOper) { } static int32_t authDropUser(SAuthCxt* pCxt, SDropUserStmt* pStmt) { - if (!pCxt->pParseCxt->isSuperUser || 0 == strcmp(pStmt->useName, TSDB_DEFAULT_USER)) { + if (!pCxt->pParseCxt->isSuperUser || 0 == strcmp(pStmt->userName, TSDB_DEFAULT_USER)) { return TSDB_CODE_PAR_PERMISSION_DENIED; } return TSDB_CODE_SUCCESS; @@ -104,6 +104,22 @@ static int32_t authShowCreateTable(SAuthCxt* pCxt, SShowCreateTableStmt* pStmt) return checkAuth(pCxt, pStmt->dbName, AUTH_TYPE_READ); } +static int32_t authCreateTable(SAuthCxt* pCxt, SCreateTableStmt* pStmt) { + return checkAuth(pCxt, pStmt->dbName, AUTH_TYPE_WRITE); +} + +static int32_t authCreateMultiTable(SAuthCxt* pCxt, SCreateMultiTablesStmt* pStmt) { + int32_t code = TSDB_CODE_SUCCESS; + SNode* pNode = NULL; + FOREACH(pNode, pStmt->pSubTables) { + code = checkAuth(pCxt, ((SCreateSubTableClause*)pNode)->dbName, AUTH_TYPE_WRITE); + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + return code; +} + static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { switch (nodeType(pStmt)) { case QUERY_NODE_SET_OPERATOR: @@ -116,6 +132,10 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { return authDelete(pCxt, (SDeleteStmt*)pStmt); case QUERY_NODE_INSERT_STMT: return authInsert(pCxt, (SInsertStmt*)pStmt); + case QUERY_NODE_CREATE_TABLE_STMT: + return authCreateTable(pCxt, (SCreateTableStmt*)pStmt); + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: + return authCreateMultiTable(pCxt, (SCreateMultiTablesStmt*)pStmt); case QUERY_NODE_SHOW_DNODES_STMT: case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: diff --git a/source/libs/parser/src/parInsertSml.c b/source/libs/parser/src/parInsertSml.c index 2ab061a4c1..0bb6d90fa9 100644 --- a/source/libs/parser/src/parInsertSml.c +++ b/source/libs/parser/src/parInsertSml.c @@ -158,11 +158,11 @@ end: return code; } -STableDataCxt* smlInitTableDataCtx(SQuery* query, STableMeta* pTableMeta){ +STableDataCxt* smlInitTableDataCtx(SQuery* query, STableMeta* pTableMeta) { STableDataCxt* pTableCxt = NULL; - SVCreateTbReq *pCreateTbReq = NULL; - int ret = insGetTableDataCxt(((SVnodeModifOpStmt *)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, sizeof(pTableMeta->uid), - pTableMeta, &pCreateTbReq, &pTableCxt, false); + SVCreateTbReq* pCreateTbReq = NULL; + int ret = insGetTableDataCxt(((SVnodeModifyOpStmt*)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, + sizeof(pTableMeta->uid), pTableMeta, &pCreateTbReq, &pTableCxt, false); if (ret != TSDB_CODE_SUCCESS) { return NULL; } @@ -174,9 +174,9 @@ STableDataCxt* smlInitTableDataCtx(SQuery* query, STableMeta* pTableMeta){ return pTableCxt; } -int32_t smlBuildRow(STableDataCxt* pTableCxt){ +int32_t smlBuildRow(STableDataCxt* pTableCxt) { SRow** pRow = taosArrayReserve(pTableCxt->pData->aRowP, 1); - int ret = tRowBuild(pTableCxt->pValues, pTableCxt->pSchema, pRow); + int ret = tRowBuild(pTableCxt->pValues, pTableCxt->pSchema, pRow); if (TSDB_CODE_SUCCESS != ret) { return ret; } @@ -184,12 +184,12 @@ int32_t smlBuildRow(STableDataCxt* pTableCxt){ return TSDB_CODE_SUCCESS; } -int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void *data, int32_t index){ - int ret = TSDB_CODE_SUCCESS; +int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void* data, int32_t index) { + int ret = TSDB_CODE_SUCCESS; SSchema* pColSchema = schema + index; SColVal* pVal = taosArrayGet(pTableCxt->pValues, index); - SSmlKv* kv = (SSmlKv*)data; - if (kv->type == TSDB_DATA_TYPE_NCHAR){ + SSmlKv* kv = (SSmlKv*)data; + if (kv->type == TSDB_DATA_TYPE_NCHAR) { int32_t len = 0; char* pUcs4 = taosMemoryCalloc(1, pColSchema->bytes - VARSTR_HEADER_SIZE); if (NULL == pUcs4) { @@ -206,9 +206,9 @@ int32_t smlBuildCol(STableDataCxt* pTableCxt, SSchema* schema, void *data, int32 } pVal->value.pData = pUcs4; pVal->value.nData = len; - } else if(kv->type == TSDB_DATA_TYPE_BINARY) { + } else if (kv->type == TSDB_DATA_TYPE_BINARY) { pVal->value.nData = kv->length; - pVal->value.pData = (uint8_t *)kv->value; + pVal->value.pData = (uint8_t*)kv->value; } else { memcpy(&pVal->value.val, &(kv->value), kv->length); } @@ -218,8 +218,9 @@ end: return ret; } -int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSchema, SArray* cols, STableMeta* pTableMeta, - char* tableName, const char* sTableName, int32_t sTableNameLen, int32_t ttl, char* msgBuf, int16_t msgBufLen) { +int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSchema, SArray* cols, + STableMeta* pTableMeta, char* tableName, const char* sTableName, int32_t sTableNameLen, int32_t ttl, + char* msgBuf, int16_t msgBufLen) { SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; SSchema* pTagsSchema = getTableTagSchema(pTableMeta); @@ -252,8 +253,9 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc pCreateTblReq->ctb.stbName = taosMemoryCalloc(1, sTableNameLen + 1); memcpy(pCreateTblReq->ctb.stbName, sTableName, sTableNameLen); - if(dataFormat){ - STableDataCxt** pTableCxt = (STableDataCxt**)taosHashGet(((SVnodeModifOpStmt *)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, sizeof(pTableMeta->uid)); + if (dataFormat) { + STableDataCxt** pTableCxt = (STableDataCxt**)taosHashGet(((SVnodeModifyOpStmt*)(query->pRoot))->pTableBlockHashObj, + &pTableMeta->uid, sizeof(pTableMeta->uid)); if (NULL == pTableCxt) { ret = buildInvalidOperationMsg(&pBuf, "dataformat true. get tableDataCtx error"); goto end; @@ -267,7 +269,7 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc } STableDataCxt* pTableCxt = NULL; - ret = insGetTableDataCxt(((SVnodeModifOpStmt*)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, + ret = insGetTableDataCxt(((SVnodeModifyOpStmt*)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, sizeof(pTableMeta->uid), pTableMeta, &pCreateTblReq, &pTableCxt, false); if (ret != TSDB_CODE_SUCCESS) { buildInvalidOperationMsg(&pBuf, "insGetTableDataCxt error"); @@ -300,11 +302,11 @@ int32_t smlBindData(SQuery* query, bool dataFormat, SArray* tags, SArray* colsSc for (int c = 0; c < pTableCxt->boundColsInfo.numOfBound; ++c) { SSchema* pColSchema = &pSchema[pTableCxt->boundColsInfo.pColIndex[c]]; SColVal* pVal = taosArrayGet(pTableCxt->pValues, pTableCxt->boundColsInfo.pColIndex[c]); - void** p = taosHashGet(rowData, pColSchema->name, strlen(pColSchema->name)); + void** p = taosHashGet(rowData, pColSchema->name, strlen(pColSchema->name)); if (p == NULL) { continue; } - SSmlKv *kv = *(SSmlKv **)p; + SSmlKv* kv = *(SSmlKv**)p; if (pColSchema->type == TSDB_DATA_TYPE_TIMESTAMP) { kv->i = convertTimePrecision(kv->i, TSDB_TIME_PRECISION_NANO, pTableMeta->tableInfo.precision); @@ -361,9 +363,9 @@ SQuery* smlInitHandle() { pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; pQuery->haveResultSet = false; pQuery->msgType = TDMT_VND_SUBMIT; - SVnodeModifOpStmt* stmt = (SVnodeModifOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); + SVnodeModifyOpStmt* stmt = (SVnodeModifyOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIFY_STMT); if (NULL == stmt) { - uError("create SVnodeModifOpStmt error"); + uError("create SVnodeModifyOpStmt error"); qDestroyQuery(pQuery); return NULL; } @@ -376,7 +378,7 @@ SQuery* smlInitHandle() { } int32_t smlBuildOutput(SQuery* handle, SHashObj* pVgHash) { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)(handle)->pRoot; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)(handle)->pRoot; // merge according to vgId int32_t code = insMergeTableDataCxt(pStmt->pTableBlockHashObj, &pStmt->pVgDataBlocks); if (code != TSDB_CODE_SUCCESS) { diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 742d7cd806..20a9770c5f 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -155,7 +155,7 @@ static int32_t ignoreUsingClause(SInsertParseContext* pCxt, const char** pSql) { return code; } -static int32_t parseDuplicateUsingClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool* pDuplicate) { +static int32_t parseDuplicateUsingClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, bool* pDuplicate) { *pDuplicate = false; char tbFName[TSDB_TABLE_FNAME_LEN]; @@ -482,7 +482,7 @@ static int32_t parseTagToken(const char** end, SToken* pToken, SSchema* pSchema, // input pStmt->pSql: [(tag1_name, ...)] TAGS (tag1_value, ...) ... // output pStmt->pSql: TAGS (tag1_value, ...) ... -static int32_t parseBoundTagsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseBoundTagsClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { insInitBoundColsInfo(getNumOfTags(pStmt->pTableMeta), &pCxt->tags); SToken token; @@ -496,7 +496,7 @@ static int32_t parseBoundTagsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt return parseBoundColumns(pCxt, &pStmt->pSql, true, getTableTagSchema(pStmt->pTableMeta), &pCxt->tags); } -static int32_t parseTagValue(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SSchema* pTagSchema, SToken* pToken, +static int32_t parseTagValue(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SSchema* pTagSchema, SToken* pToken, SArray* pTagName, SArray* pTagVals, STag** pTag) { if (!isNullValue(pTagSchema->type, pToken)) { taosArrayPush(pTagName, pTagSchema->name); @@ -524,7 +524,7 @@ static int32_t parseTagValue(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt return code; } -static int32_t buildCreateTbReq(SVnodeModifOpStmt* pStmt, STag* pTag, SArray* pTagName) { +static int32_t buildCreateTbReq(SVnodeModifyOpStmt* pStmt, STag* pTag, SArray* pTagName) { pStmt->pCreateTblReq = taosMemoryCalloc(1, sizeof(SVCreateTbReq)); if (NULL == pStmt->pCreateTblReq) { return TSDB_CODE_OUT_OF_MEMORY; @@ -559,7 +559,7 @@ static int32_t checkAndTrimValue(SToken* pToken, char* tmpTokenBuf, SMsgBuf* pMs } // pSql -> tag1_value, ...) -static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { int32_t code = TSDB_CODE_SUCCESS; SSchema* pSchema = getTableTagSchema(pStmt->pTableMeta); SArray* pTagVals = taosArrayInit(pCxt->tags.numOfBound, sizeof(STagVal)); @@ -617,7 +617,7 @@ static int32_t parseTagsClauseImpl(SInsertParseContext* pCxt, SVnodeModifOpStmt* // input pStmt->pSql: TAGS (tag1_value, ...) [table_options] ... // output pStmt->pSql: [table_options] ... -static int32_t parseTagsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseTagsClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SToken token; NEXT_TOKEN(pStmt->pSql, token); if (TK_TAGS != token.type) { @@ -641,7 +641,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pSt return code; } -static int32_t storeTableMeta(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t storeTableMeta(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { pStmt->pTableMeta->suid = pStmt->pTableMeta->uid; pStmt->pTableMeta->uid = pStmt->totalTbNum; pStmt->pTableMeta->tableType = TSDB_CHILD_TABLE; @@ -656,7 +656,7 @@ static int32_t storeTableMeta(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStm return taosHashPut(pStmt->pSubTableHashObj, tbFName, strlen(tbFName), &pBackup, POINTER_BYTES); } -static int32_t parseTableOptions(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseTableOptions(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { do { int32_t index = 0; SToken token; @@ -699,7 +699,7 @@ static int32_t parseTableOptions(SInsertParseContext* pCxt, SVnodeModifOpStmt* p // output pStmt->pSql: // 1. [(field1_name, ...)] // 2. VALUES ... | FILE ... -static int32_t parseUsingClauseBottom(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseUsingClauseBottom(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { if (!pStmt->usingTableProcessing || pCxt->usingDuplicateTable) { return TSDB_CODE_SUCCESS; } @@ -773,7 +773,7 @@ static int32_t getTableMeta(SInsertParseContext* pCxt, SName* pTbName, bool isSt return code; } -static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool isStb, bool* pMissCache) { +static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifyOpStmt* pStmt, bool isStb, bool* pMissCache) { int32_t code = TSDB_CODE_SUCCESS; SVgroupInfo vg; bool exists = true; @@ -798,7 +798,7 @@ static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, boo return code; } -static int32_t getTableMetaAndVgroupImpl(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool* pMissCache) { +static int32_t getTableMetaAndVgroupImpl(SParseContext* pCxt, SVnodeModifyOpStmt* pStmt, bool* pMissCache) { SVgroupInfo vg; int32_t code = catalogGetCachedTableVgMeta(pCxt->pCatalog, &pStmt->targetTableName, &vg, &pStmt->pTableMeta); if (TSDB_CODE_SUCCESS == code) { @@ -810,7 +810,7 @@ static int32_t getTableMetaAndVgroupImpl(SParseContext* pCxt, SVnodeModifOpStmt* return code; } -static int32_t getTableMetaAndVgroup(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, bool* pMissCache) { +static int32_t getTableMetaAndVgroup(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, bool* pMissCache) { SParseContext* pComCxt = pCxt->pComCxt; int32_t code = TSDB_CODE_SUCCESS; if (pComCxt->async) { @@ -836,25 +836,16 @@ static int32_t collectUseDatabase(const SName* pName, SHashObj* pDbs) { return taosHashPut(pDbs, dbFName, strlen(dbFName), dbFName, sizeof(dbFName)); } -static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { if (pCxt->forceUpdate) { pCxt->missCache = true; return TSDB_CODE_SUCCESS; } int32_t code = checkAuth(pCxt->pComCxt, &pStmt->targetTableName, &pCxt->missCache); -#if 0 - if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { - code = getTableMeta(pCxt, &pStmt->targetTableName, false, &pStmt->pTableMeta, &pCxt->missCache); - } - if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { - code = getTableVgroup(pCxt->pComCxt, pStmt, false, &pCxt->missCache); - } -#else if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableMetaAndVgroup(pCxt, pStmt, &pCxt->missCache); } -#endif if (TSDB_CODE_SUCCESS == code && !pCxt->pComCxt->async) { code = collectUseDatabase(&pStmt->targetTableName, pStmt->pDbFNameHashObj); if (TSDB_CODE_SUCCESS == code) { @@ -864,11 +855,11 @@ static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt return code; } -static int32_t preParseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pTbName) { +static int32_t preParseUsingTableName(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pTbName) { return insCreateSName(&pStmt->usingTableName, pTbName, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg); } -static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { if (pCxt->forceUpdate) { pCxt->missCache = true; return TSDB_CODE_SUCCESS; @@ -890,7 +881,7 @@ static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* return code; } -static int32_t parseUsingTableNameImpl(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseUsingTableNameImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SToken token; NEXT_TOKEN(pStmt->pSql, token); int32_t code = preParseUsingTableName(pCxt, pStmt, &token); @@ -909,7 +900,7 @@ static int32_t parseUsingTableNameImpl(SInsertParseContext* pCxt, SVnodeModifOpS // output pStmt->pSql: // 1. [(tag1_name, ...)] TAGS (tag1_value, ...) [table_options]] ... // 2. VALUES ... | FILE ... -static int32_t parseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseUsingTableName(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SToken token; int32_t index = 0; NEXT_TOKEN_KEEP_SQL(pStmt->pSql, token, index); @@ -927,7 +918,7 @@ static int32_t parseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpStmt* return code; } -static int32_t preParseTargetTableName(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pTbName) { +static int32_t preParseTargetTableName(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pTbName) { return insCreateSName(&pStmt->targetTableName, pTbName, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg); } @@ -938,7 +929,7 @@ static int32_t preParseTargetTableName(SInsertParseContext* pCxt, SVnodeModifOpS // output pStmt->pSql: // 1. [ USING ... ] ... // 2. VALUES ... | FILE ... -static int32_t preParseBoundColumnsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t preParseBoundColumnsClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SToken token; int32_t index = 0; NEXT_TOKEN_KEEP_SQL(pStmt->pSql, token, index); @@ -952,7 +943,7 @@ static int32_t preParseBoundColumnsClause(SInsertParseContext* pCxt, SVnodeModif return skipParentheses(pCxt, &pStmt->pSql); } -static int32_t getTableDataCxt(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt** pTableCxt) { +static int32_t getTableDataCxt(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt** pTableCxt) { if (pCxt->pComCxt->async) { return insGetTableDataCxt(pStmt->pTableBlockHashObj, &pStmt->pTableMeta->uid, sizeof(pStmt->pTableMeta->uid), pStmt->pTableMeta, &pStmt->pCreateTblReq, pTableCxt, false); @@ -967,7 +958,7 @@ static int32_t getTableDataCxt(SInsertParseContext* pCxt, SVnodeModifOpStmt* pSt &pStmt->pCreateTblReq, pTableCxt, NULL != pCxt->pComCxt->pStmtCb); } -static int32_t parseBoundColumnsClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt) { +static int32_t parseBoundColumnsClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt) { SToken token; int32_t index = 0; NEXT_TOKEN_KEEP_SQL(pStmt->pSql, token, index); @@ -1010,7 +1001,8 @@ int32_t initTableColSubmitData(STableDataCxt* pTableCxt) { // 1. [(tag1_name, ...)] ... // 2. VALUES ... | FILE ... // output pStmt->pSql: VALUES ... | FILE ... -static int32_t parseSchemaClauseBottom(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt** pTableCxt) { +static int32_t parseSchemaClauseBottom(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, + STableDataCxt** pTableCxt) { int32_t code = parseUsingClauseBottom(pCxt, pStmt); if (TSDB_CODE_SUCCESS == code) { code = getTableDataCxt(pCxt, pStmt, pTableCxt); @@ -1028,7 +1020,7 @@ static int32_t parseSchemaClauseBottom(SInsertParseContext* pCxt, SVnodeModifOpS // output pStmt->pSql: // 1. [(tag1_name, ...)] ... // 2. VALUES ... | FILE ... -static int32_t parseSchemaClauseTop(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pTbName) { +static int32_t parseSchemaClauseTop(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pTbName) { int32_t code = preParseTargetTableName(pCxt, pStmt, pTbName); if (TSDB_CODE_SUCCESS == code) { // option: [(field1_name, ...)] @@ -1297,7 +1289,7 @@ static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataC } // pSql -> (field1_value, ...) [(field1_value2, ...) ...] -static int32_t parseValues(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt, +static int32_t parseValues(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt, int32_t* pNumOfRows, SToken* pToken) { int32_t code = TSDB_CODE_SUCCESS; @@ -1337,7 +1329,7 @@ static int32_t parseValues(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, } // VALUES (field1_value, ...) [(field1_value2, ...) ...] -static int32_t parseValuesClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt, +static int32_t parseValuesClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt, SToken* pToken) { int32_t numOfRows = 0; int32_t code = parseValues(pCxt, pStmt, pTableCxt, &numOfRows, pToken); @@ -1349,7 +1341,7 @@ static int32_t parseValuesClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* p return code; } -static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt, +static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt, int32_t* pNumOfRows) { int32_t code = TSDB_CODE_SUCCESS; (*pNumOfRows) = 0; @@ -1401,7 +1393,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, return code; } -static int32_t parseDataFromFileImpl(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt) { +static int32_t parseDataFromFileImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt) { int32_t numOfRows = 0; int32_t code = parseCsvFile(pCxt, pStmt, pTableCxt, &numOfRows); if (TSDB_CODE_SUCCESS == code) { @@ -1417,7 +1409,7 @@ static int32_t parseDataFromFileImpl(SInsertParseContext* pCxt, SVnodeModifOpStm return code; } -static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pFilePath, +static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pFilePath, STableDataCxt* pTableCxt) { char filePathStr[TSDB_FILENAME_LEN] = {0}; if (TK_NK_STRING == pFilePath->type) { @@ -1433,8 +1425,12 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* p return parseDataFromFileImpl(pCxt, pStmt, pTableCxt); } -static int32_t parseFileClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt, +static int32_t parseFileClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt, SToken* pToken) { + if (tsUseAdapter) { + return buildInvalidOperationMsg(&pCxt->msg, "proxy mode does not support csv loading"); + } + NEXT_TOKEN(pStmt->pSql, *pToken); if (0 == pToken->n || (TK_NK_STRING != pToken->type && TK_NK_ID != pToken->type)) { return buildSyntaxErrMsg(&pCxt->msg, "file path is required following keyword FILE", pToken->z); @@ -1443,7 +1439,7 @@ static int32_t parseFileClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pSt } // VALUES (field1_value, ...) [(field1_value2, ...) ...] | FILE csv_file_path -static int32_t parseDataClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, STableDataCxt* pTableCxt) { +static int32_t parseDataClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, STableDataCxt* pTableCxt) { SToken token; NEXT_TOKEN(pStmt->pSql, token); switch (token.type) { @@ -1460,7 +1456,7 @@ static int32_t parseDataClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pSt // input pStmt->pSql: // 1. [(tag1_name, ...)] ... // 2. VALUES ... | FILE ... -static int32_t parseInsertTableClauseBottom(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertTableClauseBottom(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { STableDataCxt* pTableCxt = NULL; int32_t code = parseSchemaClauseBottom(pCxt, pStmt, &pTableCxt); if (TSDB_CODE_SUCCESS == code) { @@ -1469,7 +1465,7 @@ static int32_t parseInsertTableClauseBottom(SInsertParseContext* pCxt, SVnodeMod return code; } -static void resetEnvPreTable(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static void resetEnvPreTable(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { destroyBoundColInfo(&pCxt->tags); taosMemoryFreeClear(pStmt->pTableMeta); tdDestroySVCreateTbReq(pStmt->pCreateTblReq); @@ -1482,7 +1478,7 @@ static void resetEnvPreTable(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt } // input pStmt->pSql: [(field1_name, ...)] [ USING ... ] VALUES ... | FILE ... -static int32_t parseInsertTableClause(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pTbName) { +static int32_t parseInsertTableClause(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pTbName) { resetEnvPreTable(pCxt, pStmt); int32_t code = parseSchemaClauseTop(pCxt, pStmt, pTbName); if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { @@ -1491,7 +1487,7 @@ static int32_t parseInsertTableClause(SInsertParseContext* pCxt, SVnodeModifOpSt return code; } -static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SToken* pTbName, +static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pTbName, bool* pHasData) { // no data in the sql string anymore. if (0 == pTbName->n) { @@ -1530,7 +1526,7 @@ static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModif return TSDB_CODE_SUCCESS; } -static int32_t setStmtInfo(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t setStmtInfo(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SParsedDataColInfo* tags = taosMemoryMalloc(sizeof(pCxt->tags)); if (NULL == tags) { return TSDB_CODE_OUT_OF_MEMORY; @@ -1548,7 +1544,7 @@ static int32_t setStmtInfo(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) return code; } -static int32_t parseInsertBodyBottom(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertBodyBottom(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { if (TSDB_QUERY_HAS_TYPE(pStmt->insertType, TSDB_QUERY_TYPE_STMT_INSERT)) { return setStmtInfo(pCxt, pStmt); } @@ -1567,7 +1563,7 @@ static int32_t parseInsertBodyBottom(SInsertParseContext* pCxt, SVnodeModifOpStm // [(field1_name, ...)] // VALUES (field1_value, ...) [(field1_value2, ...) ...] | FILE csv_file_path // [...]; -static int32_t parseInsertBody(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertBody(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { SToken token; int32_t code = TSDB_CODE_SUCCESS; bool hasData = true; @@ -1590,7 +1586,7 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt, SVnodeModifOpStmt* pSt static void destroySubTableHashElem(void* p) { taosMemoryFree(*(STableMeta**)p); } static int32_t createVnodeModifOpStmt(SInsertParseContext* pCxt, bool reentry, SNode** pOutput) { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIFY_STMT); if (NULL == pStmt) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -1657,6 +1653,8 @@ static int32_t getTableMetaFromMetaData(const SArray* pTables, STableMeta** pMet if (1 != taosArrayGetSize(pTables)) { return TSDB_CODE_FAILED; } + + taosMemoryFreeClear(*pMeta); SMetaRes* pRes = taosArrayGet(pTables, 0); if (TSDB_CODE_SUCCESS == pRes->code) { *pMeta = tableMetaDup((const STableMeta*)pRes->pRes); @@ -1667,7 +1665,7 @@ static int32_t getTableMetaFromMetaData(const SArray* pTables, STableMeta** pMet return pRes->code; } -static int32_t getTableVgroupFromMetaData(const SArray* pTables, SVnodeModifOpStmt* pStmt, bool isStb) { +static int32_t getTableVgroupFromMetaData(const SArray* pTables, SVnodeModifyOpStmt* pStmt, bool isStb) { if (1 != taosArrayGetSize(pTables)) { return TSDB_CODE_FAILED; } @@ -1686,7 +1684,7 @@ static int32_t getTableVgroupFromMetaData(const SArray* pTables, SVnodeModifOpSt } static int32_t getTableSchemaFromMetaData(SInsertParseContext* pCxt, const SMetaData* pMetaData, - SVnodeModifOpStmt* pStmt, bool isStb) { + SVnodeModifyOpStmt* pStmt, bool isStb) { int32_t code = checkAuthFromMetaData(pMetaData->pUser); if (TSDB_CODE_SUCCESS == code) { code = getTableMetaFromMetaData(pMetaData->pTableMeta, &pStmt->pTableMeta); @@ -1719,7 +1717,7 @@ static void clearCatalogReq(SCatalogReq* pCatalogReq) { } static int32_t setVnodeModifOpStmt(SInsertParseContext* pCxt, SCatalogReq* pCatalogReq, const SMetaData* pMetaData, - SVnodeModifOpStmt* pStmt) { + SVnodeModifyOpStmt* pStmt) { clearCatalogReq(pCatalogReq); if (pStmt->usingTableProcessing) { @@ -1733,7 +1731,7 @@ static int32_t resetVnodeModifOpStmt(SInsertParseContext* pCxt, SQuery* pQuery) int32_t code = createVnodeModifOpStmt(pCxt, true, &pQuery->pRoot); if (TSDB_CODE_SUCCESS == code) { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot; (*pCxt->pComCxt->pStmtCb->getExecInfoFn)(pCxt->pComCxt->pStmtCb->pStmt, &pStmt->pVgroupsHashObj, &pStmt->pTableBlockHashObj); @@ -1762,7 +1760,7 @@ static int32_t initInsertQuery(SInsertParseContext* pCxt, SCatalogReq* pCatalogR return resetVnodeModifOpStmt(pCxt, *pQuery); } - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)(*pQuery)->pRoot; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)(*pQuery)->pRoot; if (!pStmt->fileProcessing) { return setVnodeModifOpStmt(pCxt, pCatalogReq, pMetaData, pStmt); @@ -1772,7 +1770,7 @@ static int32_t initInsertQuery(SInsertParseContext* pCxt, SCatalogReq* pCatalogR } static int32_t setRefreshMate(SQuery* pQuery) { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot; if (taosHashGetSize(pStmt->pTableNameHashObj) > 0) { taosArrayDestroy(pQuery->pTableList); @@ -1803,7 +1801,7 @@ static int32_t setRefreshMate(SQuery* pQuery) { // [(field1_name, ...)] // VALUES (field1_value, ...) [(field1_value2, ...) ...] | FILE csv_file_path // [...]; -static int32_t parseInsertSqlFromStart(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertSqlFromStart(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { int32_t code = skipInsertInto(&pStmt->pSql, &pCxt->msg); if (TSDB_CODE_SUCCESS == code) { code = parseInsertBody(pCxt, pStmt); @@ -1811,7 +1809,7 @@ static int32_t parseInsertSqlFromStart(SInsertParseContext* pCxt, SVnodeModifOpS return code; } -static int32_t parseInsertSqlFromCsv(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertSqlFromCsv(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { STableDataCxt* pTableCxt = NULL; int32_t code = getTableDataCxt(pCxt, pStmt, &pTableCxt); if (TSDB_CODE_SUCCESS == code) { @@ -1829,7 +1827,7 @@ static int32_t parseInsertSqlFromCsv(SInsertParseContext* pCxt, SVnodeModifOpStm return code; } -static int32_t parseInsertSqlFromTable(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertSqlFromTable(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { int32_t code = parseInsertTableClauseBottom(pCxt, pStmt); if (TSDB_CODE_SUCCESS == code) { code = parseInsertBody(pCxt, pStmt); @@ -1837,7 +1835,7 @@ static int32_t parseInsertSqlFromTable(SInsertParseContext* pCxt, SVnodeModifOpS return code; } -static int32_t parseInsertSqlImpl(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { +static int32_t parseInsertSqlImpl(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt) { if (pStmt->pSql == pCxt->pComCxt->pSql || NULL != pCxt->pComCxt->pStmtCb) { return parseInsertSqlFromStart(pCxt, pStmt); } @@ -1889,7 +1887,7 @@ static int32_t buildInsertUserAuthReq(const char* pUser, SName* pName, SArray** return TSDB_CODE_SUCCESS; } -static int32_t buildInsertCatalogReq(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt, SCatalogReq* pCatalogReq) { +static int32_t buildInsertCatalogReq(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SCatalogReq* pCatalogReq) { int32_t code = buildInsertUserAuthReq(pCxt->pComCxt->pUser, &pStmt->targetTableName, &pCatalogReq->pUser); if (TSDB_CODE_SUCCESS == code) { if (0 == pStmt->usingTableName.type) { @@ -1905,7 +1903,7 @@ static int32_t buildInsertCatalogReq(SInsertParseContext* pCxt, SVnodeModifOpStm } static int32_t setNextStageInfo(SInsertParseContext* pCxt, SQuery* pQuery, SCatalogReq* pCatalogReq) { - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot; if (pCxt->missCache) { parserDebug("0x%" PRIx64 " %d rows of %d tables have been inserted before cache miss", pCxt->pComCxt->requestId, pStmt->totalRowsNum, pStmt->totalTbNum); @@ -1930,7 +1928,7 @@ int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatal int32_t code = initInsertQuery(&context, pCatalogReq, pMetaData, pQuery); if (TSDB_CODE_SUCCESS == code) { - code = parseInsertSqlImpl(&context, (SVnodeModifOpStmt*)(*pQuery)->pRoot); + code = parseInsertSqlImpl(&context, (SVnodeModifyOpStmt*)(*pQuery)->pRoot); } if (TSDB_CODE_SUCCESS == code) { code = setNextStageInfo(&context, *pQuery, pCatalogReq); diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c index 3aebf89f41..01a635e4b2 100644 --- a/source/libs/parser/src/parInsertStmt.c +++ b/source/libs/parser/src/parInsertStmt.c @@ -29,34 +29,33 @@ typedef struct SKvParam { char buf[TSDB_MAX_TAGS_LEN]; } SKvParam; -int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData **pData) { +int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData) { *pData = taosMemoryCalloc(1, sizeof(SSubmitTbData)); if (NULL == *pData) { return TSDB_CODE_OUT_OF_MEMORY; } - SSubmitTbData *pNew = *pData; - + SSubmitTbData* pNew = *pData; + *pNew = *pDataBlock->pData; - + cloneSVreateTbReq(pDataBlock->pData->pCreateTbReq, &pNew->pCreateTbReq); pNew->aCol = taosArrayDup(pDataBlock->pData->aCol, NULL); int32_t colNum = taosArrayGetSize(pNew->aCol); for (int32_t i = 0; i < colNum; ++i) { - SColData *pCol = (SColData*)taosArrayGet(pNew->aCol, i); + SColData* pCol = (SColData*)taosArrayGet(pNew->aCol, i); tColDataDeepClear(pCol); } return TSDB_CODE_SUCCESS; } - int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash) { - int32_t code = TSDB_CODE_SUCCESS; - SArray* pVgDataBlocks = NULL; - SVnodeModifOpStmt *pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; - + int32_t code = TSDB_CODE_SUCCESS; + SArray* pVgDataBlocks = NULL; + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot; + // merge according to vgId if (taosHashGetSize(pBlockHash) > 0) { code = insMergeTableDataCxt(pBlockHash, &pVgDataBlocks); @@ -64,7 +63,7 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash if (TSDB_CODE_SUCCESS == code) { code = insBuildVgDataBlocks(pVgHash, pVgDataBlocks, &pStmt->pDataBlocks); } - + if (pStmt->freeArrayFunc) { pStmt->freeArrayFunc(pVgDataBlocks); } @@ -73,9 +72,9 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const char* sTableName, char* tName, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen) { - STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; - SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; - int32_t code = TSDB_CODE_SUCCESS; + STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; + SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; + int32_t code = TSDB_CODE_SUCCESS; SBoundColInfo* tags = (SBoundColInfo*)boundTags; if (NULL == tags) { return TSDB_CODE_APP_ERROR; @@ -172,7 +171,8 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch } } - insBuildCreateTbReq(pDataBlock->pData->pCreateTbReq, tName, pTag, suid, sTableName, tagName, pDataBlock->pMeta->tableInfo.numOfTags, TSDB_DEFAULT_TABLE_TTL); + insBuildCreateTbReq(pDataBlock->pData->pCreateTbReq, tName, pTag, suid, sTableName, tagName, + pDataBlock->pMeta->tableInfo.numOfTags, TSDB_DEFAULT_TABLE_TTL); end: for (int i = 0; i < taosArrayGetSize(pTagArray); ++i) { @@ -211,8 +211,9 @@ int32_t convertStmtNcharCol(SMsgBuf* pMsgBuf, SSchema* pSchema, TAOS_MULTI_BIND* if (src->is_null && src->is_null[i]) { continue; } - - if (!taosMbsToUcs4(((char*)src->buffer) + src->buffer_length * i, src->length[i], (TdUcs4*)(((char*)dst->buffer) + dst->buffer_length * i), dst->buffer_length, &output)) { + + if (!taosMbsToUcs4(((char*)src->buffer) + src->buffer_length * i, src->length[i], + (TdUcs4*)(((char*)dst->buffer) + dst->buffer_length * i), dst->buffer_length, &output)) { if (errno == E2BIG) { return generateSyntaxErrMsg(pMsgBuf, TSDB_CODE_PAR_VALUE_TOO_LONG, pSchema->name); } @@ -232,17 +233,17 @@ int32_t convertStmtNcharCol(SMsgBuf* pMsgBuf, SSchema* pSchema, TAOS_MULTI_BIND* } int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen) { - STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; - SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta); - SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo; - SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; - int32_t rowNum = bind->num; - TAOS_MULTI_BIND ncharBind = {0}; - TAOS_MULTI_BIND* pBind = NULL; - int32_t code = 0; + STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; + SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta); + SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo; + SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; + int32_t rowNum = bind->num; + TAOS_MULTI_BIND ncharBind = {0}; + TAOS_MULTI_BIND* pBind = NULL; + int32_t code = 0; for (int c = 0; c < boundInfo->numOfBound; ++c) { - SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]]; + SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]]; SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, c); if (bind[c].num != rowNum) { @@ -280,20 +281,20 @@ _return: int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, int32_t colIdx, int32_t rowNum) { - STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; - SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta); - SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo; - SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; - SSchema* pColSchema = &pSchema[boundInfo->pColIndex[colIdx]]; - SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, colIdx); - TAOS_MULTI_BIND ncharBind = {0}; - TAOS_MULTI_BIND* pBind = NULL; - int32_t code = 0; - + STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; + SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta); + SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo; + SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen}; + SSchema* pColSchema = &pSchema[boundInfo->pColIndex[colIdx]]; + SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, colIdx); + TAOS_MULTI_BIND ncharBind = {0}; + TAOS_MULTI_BIND* pBind = NULL; + int32_t code = 0; + if (bind->num != rowNum) { return buildInvalidOperationMsg(&pBuf, "row number in each bind param should be the same"); } - + if (bind->buffer_type != pColSchema->type) { return buildInvalidOperationMsg(&pBuf, "column type mis-match with buffer type"); } @@ -307,7 +308,7 @@ int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBu } else { pBind = bind; } - + tColDataAddValueByBind(pCol, pBind); qDebug("stmt col %d bind %d rows data", colIdx, rowNum); @@ -320,8 +321,8 @@ _return: return code; } -int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSchema, int32_t* fieldNum, TAOS_FIELD_E** fields, - uint8_t timePrec) { +int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSchema, int32_t* fieldNum, + TAOS_FIELD_E** fields, uint8_t timePrec) { if (fields) { *fields = taosMemoryCalloc(numOfBound, sizeof(TAOS_FIELD_E)); if (NULL == *fields) { @@ -347,7 +348,7 @@ int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSc } int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TAOS_FIELD_E** fields) { - STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; + STableDataCxt* pDataBlock = (STableDataCxt*)pBlock; SBoundColInfo* tags = (SBoundColInfo*)boundTags; if (NULL == tags) { return TSDB_CODE_APP_ERROR; @@ -382,18 +383,18 @@ int32_t qBuildStmtColFields(void* pBlock, int32_t* fieldNum, TAOS_FIELD_E** fiel return TSDB_CODE_SUCCESS; } - CHECK_CODE(buildBoundFields(pDataBlock->boundColsInfo.numOfBound, pDataBlock->boundColsInfo.pColIndex, pSchema, fieldNum, fields, - pDataBlock->pMeta->tableInfo.precision)); + CHECK_CODE(buildBoundFields(pDataBlock->boundColsInfo.numOfBound, pDataBlock->boundColsInfo.pColIndex, pSchema, + fieldNum, fields, pDataBlock->pMeta->tableInfo.precision)); return TSDB_CODE_SUCCESS; } int32_t qResetStmtDataBlock(STableDataCxt* block, bool deepClear) { STableDataCxt* pBlock = (STableDataCxt*)block; - int32_t colNum = taosArrayGetSize(pBlock->pData->aCol); + int32_t colNum = taosArrayGetSize(pBlock->pData->aCol); for (int32_t i = 0; i < colNum; ++i) { - SColData *pCol = (SColData*)taosArrayGet(pBlock->pData->aCol, i); + SColData* pCol = (SColData*)taosArrayGet(pBlock->pData->aCol, i); if (deepClear) { tColDataDeepClear(pCol); } else { @@ -406,7 +407,7 @@ int32_t qResetStmtDataBlock(STableDataCxt* block, bool deepClear) { int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool reset) { int32_t code = 0; - + *pDst = taosMemoryCalloc(1, sizeof(STableDataCxt)); if (NULL == *pDst) { return TSDB_CODE_OUT_OF_MEMORY; @@ -429,19 +430,20 @@ int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool rese memcpy(&pNewCxt->boundColsInfo, &pCxt->boundColsInfo, sizeof(pCxt->boundColsInfo)); pNewCxt->boundColsInfo.pColIndex = NULL; - + if (pCxt->boundColsInfo.pColIndex) { void* pNewColIdx = taosMemoryMalloc(pCxt->boundColsInfo.numOfBound * sizeof(*pCxt->boundColsInfo.pColIndex)); if (NULL == pNewColIdx) { insDestroyTableDataCxt(*pDst); return TSDB_CODE_OUT_OF_MEMORY; } - memcpy(pNewColIdx, pCxt->boundColsInfo.pColIndex, pCxt->boundColsInfo.numOfBound * sizeof(*pCxt->boundColsInfo.pColIndex)); + memcpy(pNewColIdx, pCxt->boundColsInfo.pColIndex, + pCxt->boundColsInfo.numOfBound * sizeof(*pCxt->boundColsInfo.pColIndex)); pNewCxt->boundColsInfo.pColIndex = pNewColIdx; } if (pCxt->pData) { - SSubmitTbData *pNewTb = (SSubmitTbData*)taosMemoryMalloc(sizeof(SSubmitTbData)); + SSubmitTbData* pNewTb = (SSubmitTbData*)taosMemoryMalloc(sizeof(SSubmitTbData)); if (NULL == pNewTb) { insDestroyTableDataCxt(*pDst); return TSDB_CODE_OUT_OF_MEMORY; @@ -457,17 +459,17 @@ int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool rese } pNewCxt->pData = pNewTb; - + if (reset) { code = qResetStmtDataBlock(*pDst, true); } } - return code; } -int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId, bool rebuildCreateTb) { +int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId, + bool rebuildCreateTb) { int32_t code = qCloneStmtDataBlock(pDst, pSrc, false); if (code) { return code; diff --git a/source/libs/parser/src/parInsertUtil.c b/source/libs/parser/src/parInsertUtil.c index f767519468..cc2ca48a1f 100644 --- a/source/libs/parser/src/parInsertUtil.c +++ b/source/libs/parser/src/parInsertUtil.c @@ -206,7 +206,7 @@ void qDestroyBoundColInfo(void* pInfo) { } static int32_t createTableDataBlock(size_t defaultSize, int32_t rowSize, int32_t startOffset, STableMeta* pTableMeta, - STableDataBlocks** dataBlocks) { + STableDataBlocks** dataBlocks) { STableDataBlocks* dataBuf = (STableDataBlocks*)taosMemoryCalloc(1, sizeof(STableDataBlocks)); if (dataBuf == NULL) { return TSDB_CODE_OUT_OF_MEMORY; @@ -1373,7 +1373,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, return code; } -static int bindFileds(SBoundColInfo* pBoundInfo, SSchema* pSchema, TAOS_FIELD *fields, int numFields){ +static int bindFileds(SBoundColInfo* pBoundInfo, SSchema* pSchema, TAOS_FIELD* fields, int numFields) { bool* pUseCols = taosMemoryCalloc(pBoundInfo->numOfCols, sizeof(bool)); if (NULL == pUseCols) { return TSDB_CODE_OUT_OF_MEMORY; @@ -1383,7 +1383,7 @@ static int bindFileds(SBoundColInfo* pBoundInfo, SSchema* pSchema, TAOS_FIELD *f int16_t lastColIdx = -1; // last column found int32_t code = TSDB_CODE_SUCCESS; - for(int i = 0; i < numFields; i++) { + for (int i = 0; i < numFields; i++) { SToken token; token.z = fields[i].name; token.n = strlen(fields[i].name); @@ -1418,15 +1418,16 @@ static int bindFileds(SBoundColInfo* pBoundInfo, SSchema* pSchema, TAOS_FIELD *f return code; } -int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreateTbReq *pCreateTb, TAOS_FIELD *tFields, int numFields){ +int rawBlockBindData(SQuery* query, STableMeta* pTableMeta, void* data, SVCreateTbReq* pCreateTb, TAOS_FIELD* tFields, + int numFields) { STableDataCxt* pTableCxt = NULL; - int ret = insGetTableDataCxt(((SVnodeModifOpStmt *)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, sizeof(pTableMeta->uid), - pTableMeta, &pCreateTb, &pTableCxt, true); + int ret = insGetTableDataCxt(((SVnodeModifyOpStmt*)(query->pRoot))->pTableBlockHashObj, &pTableMeta->uid, + sizeof(pTableMeta->uid), pTableMeta, &pCreateTb, &pTableCxt, true); if (ret != TSDB_CODE_SUCCESS) { uError("insGetTableDataCxt error"); goto end; } - if (tFields != NULL){ + if (tFields != NULL) { ret = bindFileds(&pTableCxt->boundColsInfo, getTableColumnSchema(pTableMeta), tFields, numFields); if (ret != TSDB_CODE_SUCCESS) { uError("bindFileds error"); @@ -1436,12 +1437,13 @@ int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreate // no need to bind, because select * get all fields ret = initTableColSubmitData(pTableCxt); if (ret != TSDB_CODE_SUCCESS) { - uError( "initTableColSubmitData error"); + uError("initTableColSubmitData error"); goto end; } char* p = (char*)data; - // | 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 | p += sizeof(int32_t); p += sizeof(int32_t); @@ -1454,7 +1456,7 @@ int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreate p += sizeof(int32_t); p += sizeof(uint64_t); - int8_t *fields = p; + int8_t* fields = p; p += numOfCols * (sizeof(int8_t) + sizeof(int32_t)); int32_t* colLength = (int32_t*)p; @@ -1462,20 +1464,20 @@ int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreate char* pStart = p; - SSchema* pSchema = getTableColumnSchema(pTableCxt->pMeta); - SBoundColInfo* boundInfo = &pTableCxt->boundColsInfo; + SSchema* pSchema = getTableColumnSchema(pTableCxt->pMeta); + SBoundColInfo* boundInfo = &pTableCxt->boundColsInfo; - if(boundInfo->numOfBound != numOfCols){ + if (boundInfo->numOfBound != numOfCols) { uError("boundInfo->numOfBound:%d != numOfCols:%d", boundInfo->numOfBound, numOfCols); ret = TSDB_CODE_INVALID_PARA; goto end; } for (int c = 0; c < boundInfo->numOfBound; ++c) { - SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]]; + SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]]; SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, c); if (*fields != pColSchema->type && *(int32_t*)(fields + sizeof(int8_t)) != pColSchema->bytes) { - uError( "type or bytes not equal"); + uError("type or bytes not equal"); ret = TSDB_CODE_INVALID_PARA; goto end; } @@ -1487,7 +1489,7 @@ int rawBlockBindData(SQuery *query, STableMeta* pTableMeta, void* data, SVCreate } else { pStart += BitmapLen(numOfRows); } - char *pData = pStart; + char* pData = pStart; tColDataAddValueByDataBlock(pCol, pColSchema->type, pColSchema->bytes, numOfRows, offset, pData); fields += sizeof(int8_t) + sizeof(int32_t); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 1f9e4e9ab1..94b32a3de2 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -260,6 +260,7 @@ static SKeyword keywordTable[] = { {"WRITE", TK_WRITE}, {"_C0", TK_ROWTS}, {"_IROWTS", TK_IROWTS}, + {"_ISFILLED", TK_ISFILLED}, {"_QDURATION", TK_QDURATION}, {"_QEND", TK_QEND}, {"_QSTART", TK_QSTART}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 3f66a4f8de..a5bb660c37 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -352,7 +352,7 @@ static int32_t getTableMetaImpl(STranslateContext* pCxt, const SName* pName, STa code = catalogGetTableMeta(pParCxt->pCatalog, &conn, pName, pMeta); } } - if (TSDB_CODE_SUCCESS != code) { + if (TSDB_CODE_SUCCESS != code && TSDB_CODE_TSC_INVALID_TABLE_NAME != code) { parserError("0x%" PRIx64 " catalogGetTableMeta error, code:%s, dbName:%s, tbName:%s", pCxt->pParseCxt->requestId, tstrerror(code), pName->dbname, pName->tname); } @@ -5083,7 +5083,7 @@ static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* p static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pStmt) { SCreateUserReq createReq = {0}; - strcpy(createReq.user, pStmt->useName); + strcpy(createReq.user, pStmt->userName); createReq.createType = 0; createReq.superUser = 0; createReq.sysInfo = pStmt->sysinfo; @@ -5095,7 +5095,7 @@ static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pSt static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt) { SAlterUserReq alterReq = {0}; - strcpy(alterReq.user, pStmt->useName); + strcpy(alterReq.user, pStmt->userName); alterReq.alterType = pStmt->alterType; alterReq.superUser = 0; alterReq.enable = pStmt->enable; @@ -5110,7 +5110,7 @@ static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt static int32_t translateDropUser(STranslateContext* pCxt, SDropUserStmt* pStmt) { SDropUserReq dropReq = {0}; - strcpy(dropReq.user, pStmt->useName); + strcpy(dropReq.user, pStmt->userName); return buildCmdMsg(pCxt, TDMT_MND_DROP_USER, (FSerializeFunc)tSerializeSDropUserReq, &dropReq); } @@ -6645,7 +6645,7 @@ static void destroyCreateTbReqBatch(void* data) { } int32_t rewriteToVnodeModifyOpStmt(SQuery* pQuery, SArray* pBufArray) { - SVnodeModifOpStmt* pNewStmt = (SVnodeModifOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIF_STMT); + SVnodeModifyOpStmt* pNewStmt = (SVnodeModifyOpStmt*)nodesMakeNode(QUERY_NODE_VNODE_MODIFY_STMT); if (pNewStmt == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -7029,7 +7029,7 @@ SArray* serializeVgroupsCreateTableBatch(SHashObj* pVgroupHashmap) { } static int32_t rewriteCreateMultiTable(STranslateContext* pCxt, SQuery* pQuery) { - SCreateMultiTableStmt* pStmt = (SCreateMultiTableStmt*)pQuery->pRoot; + SCreateMultiTablesStmt* pStmt = (SCreateMultiTablesStmt*)pQuery->pRoot; SHashObj* pVgroupHashmap = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); if (NULL == pVgroupHashmap) { @@ -7637,7 +7637,7 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { code = rewriteCreateTable(pCxt, pQuery); } break; - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: code = rewriteCreateMultiTable(pCxt, pQuery); break; case QUERY_NODE_DROP_TABLE_STMT: @@ -7734,9 +7734,9 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) { pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; pQuery->msgType = TDMT_VND_SUBMIT; break; - case QUERY_NODE_VNODE_MODIF_STMT: + case QUERY_NODE_VNODE_MODIFY_STMT: pQuery->execMode = QUERY_EXEC_MODE_SCHEDULE; - pQuery->msgType = toMsgType(((SVnodeModifOpStmt*)pQuery->pRoot)->sqlNodeType); + pQuery->msgType = toMsgType(((SVnodeModifyOpStmt*)pQuery->pRoot)->sqlNodeType); break; case QUERY_NODE_DESCRIBE_STMT: case QUERY_NODE_SHOW_CREATE_DATABASE_STMT: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index b383d02006..1021aab6f0 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 459 +#define YYNOCODE 461 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOperatorType yy20; - SNode* yy74; - ENullOrder yy109; - SToken yy317; - EOrder yy326; - bool yy335; - int8_t yy449; - int64_t yy531; - EJoinType yy630; - SAlterOption yy767; - EFillMode yy828; - int32_t yy856; - SNodeList* yy874; - SDataType yy898; + EOrder yy32; + SToken yy77; + int32_t yy248; + int8_t yy287; + ENullOrder yy385; + EJoinType yy560; + SNode* yy600; + SNodeList* yy601; + SAlterOption yy661; + EOperatorType yy666; + int64_t yy717; + EFillMode yy798; + bool yy841; + SDataType yy888; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -140,16 +140,17 @@ typedef union { #define ParseCTX_STORE #define YYFALLBACK 1 #define YYNSTATE 714 -#define YYNRULE 539 -#define YYNTOKEN 324 +#define YYNRULE 545 +#define YYNRULE_WITH_ACTION 545 +#define YYNTOKEN 325 #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 +#define YY_MIN_SHIFTREDUCE 1061 +#define YY_MAX_SHIFTREDUCE 1605 +#define YY_ERROR_ACTION 1606 +#define YY_ACCEPT_ACTION 1607 +#define YY_NO_ACTION 1608 +#define YY_MIN_REDUCE 1609 +#define YY_MAX_REDUCE 2153 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,790 +217,843 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2968) +#define YY_ACTTAB_COUNT (3069) static const YYACTIONTYPE yy_action[] = { - /* 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, + /* 0 */ 35, 276, 460, 1876, 461, 1645, 469, 367, 461, 1645, + /* 10 */ 1808, 1810, 45, 43, 1535, 1954, 1874, 590, 1751, 466, + /* 20 */ 362, 407, 1385, 38, 37, 462, 1950, 44, 42, 41, + /* 30 */ 40, 39, 169, 1465, 459, 1383, 229, 464, 1651, 1792, + /* 40 */ 571, 602, 38, 37, 2124, 602, 44, 42, 41, 40, + /* 50 */ 39, 8, 602, 334, 1862, 1946, 1952, 345, 1460, 570, + /* 60 */ 175, 320, 187, 18, 2125, 572, 613, 38, 37, 1967, + /* 70 */ 1391, 44, 42, 41, 40, 39, 468, 1411, 583, 464, + /* 80 */ 1651, 38, 37, 45, 43, 44, 42, 41, 40, 39, + /* 90 */ 2129, 362, 171, 1385, 1609, 14, 136, 327, 81, 2026, + /* 100 */ 1985, 80, 60, 27, 1465, 1802, 1383, 1412, 586, 134, + /* 110 */ 159, 1572, 1621, 1936, 603, 619, 48, 710, 125, 124, + /* 120 */ 123, 122, 121, 120, 119, 118, 117, 48, 126, 1460, + /* 130 */ 100, 160, 1467, 1468, 18, 499, 1716, 443, 1494, 1966, + /* 140 */ 64, 1391, 478, 2002, 135, 1762, 103, 1968, 623, 1970, + /* 150 */ 1971, 618, 1754, 613, 1410, 2129, 1815, 146, 172, 2124, + /* 160 */ 2055, 1440, 1450, 355, 356, 2051, 14, 1466, 1469, 257, + /* 170 */ 2063, 582, 1813, 127, 581, 2128, 566, 2124, 177, 2125, + /* 180 */ 2127, 2129, 1386, 1595, 1384, 2124, 2081, 528, 710, 1263, + /* 190 */ 1264, 260, 570, 175, 1495, 191, 190, 2125, 572, 49, + /* 200 */ 526, 2128, 524, 1467, 1468, 2125, 2126, 1389, 1390, 53, + /* 210 */ 1439, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 615, + /* 220 */ 611, 1458, 1459, 1461, 1462, 1463, 1464, 2, 60, 60, + /* 230 */ 89, 60, 1440, 1450, 2070, 1410, 156, 116, 1466, 1469, + /* 240 */ 115, 114, 113, 112, 111, 110, 109, 108, 107, 648, + /* 250 */ 259, 227, 178, 1386, 2070, 1384, 1528, 38, 37, 1632, + /* 260 */ 2067, 44, 42, 41, 40, 39, 34, 360, 1489, 1490, + /* 270 */ 1491, 1492, 1493, 1497, 1498, 1499, 1500, 178, 1389, 1390, + /* 280 */ 2066, 1439, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, + /* 290 */ 615, 611, 1458, 1459, 1461, 1462, 1463, 1464, 2, 396, + /* 300 */ 11, 45, 43, 1936, 1954, 1385, 1539, 1631, 1985, 362, + /* 310 */ 408, 1385, 1410, 86, 322, 1950, 565, 532, 1383, 530, + /* 320 */ 398, 394, 1465, 409, 1383, 1220, 645, 644, 643, 1224, + /* 330 */ 642, 1226, 1227, 641, 1229, 638, 1678, 1235, 635, 1237, + /* 340 */ 1238, 632, 629, 213, 1946, 1952, 357, 1460, 1180, 178, + /* 350 */ 401, 1936, 18, 1391, 1815, 613, 564, 1532, 164, 1391, + /* 360 */ 1113, 366, 1112, 1410, 495, 491, 487, 483, 210, 1630, + /* 370 */ 1813, 1629, 45, 43, 1470, 212, 1316, 1317, 178, 178, + /* 380 */ 362, 178, 1385, 1182, 14, 44, 42, 41, 40, 39, + /* 390 */ 657, 1114, 547, 1465, 1409, 1383, 2124, 1113, 1628, 1112, + /* 400 */ 710, 514, 513, 512, 85, 1094, 710, 208, 1610, 131, + /* 410 */ 508, 2130, 175, 1936, 507, 1936, 2125, 572, 1460, 506, + /* 420 */ 511, 1467, 1468, 1602, 1627, 505, 267, 268, 1114, 116, + /* 430 */ 1391, 266, 115, 114, 113, 112, 111, 110, 109, 108, + /* 440 */ 107, 583, 1936, 1411, 1096, 1626, 1099, 1100, 1391, 1876, + /* 450 */ 1440, 1450, 603, 1441, 1815, 46, 1466, 1469, 11, 353, + /* 460 */ 9, 331, 1873, 590, 603, 1386, 54, 1384, 1936, 575, + /* 470 */ 1813, 1386, 134, 1384, 207, 201, 1625, 710, 180, 206, + /* 480 */ 38, 37, 474, 1762, 44, 42, 41, 40, 39, 1936, + /* 490 */ 1389, 1390, 1467, 1468, 84, 1762, 1389, 1390, 199, 1439, + /* 500 */ 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 615, 611, + /* 510 */ 1458, 1459, 1461, 1462, 1463, 1464, 2, 1758, 1601, 1412, + /* 520 */ 1936, 1440, 1450, 583, 1142, 1624, 571, 1466, 1469, 603, + /* 530 */ 2124, 585, 173, 2063, 2064, 603, 132, 2068, 1413, 514, + /* 540 */ 513, 512, 1386, 405, 1384, 570, 175, 131, 508, 406, + /* 550 */ 2125, 572, 507, 1623, 134, 1330, 1331, 506, 511, 1143, + /* 560 */ 1762, 1967, 1620, 505, 1809, 1810, 1762, 1389, 1390, 1936, + /* 570 */ 1439, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 615, + /* 580 */ 611, 1458, 1459, 1461, 1462, 1463, 1464, 2, 45, 43, + /* 590 */ 1329, 1332, 1985, 1740, 84, 354, 362, 1936, 1385, 1531, + /* 600 */ 620, 1607, 605, 157, 2027, 1936, 1936, 619, 130, 1465, + /* 610 */ 228, 1383, 1764, 11, 174, 2063, 2064, 1757, 132, 2068, + /* 620 */ 38, 37, 1967, 2070, 44, 42, 41, 40, 39, 519, + /* 630 */ 561, 1966, 1413, 603, 1460, 2002, 669, 1562, 103, 1968, + /* 640 */ 623, 1970, 1971, 618, 529, 613, 1391, 126, 137, 2065, + /* 650 */ 143, 2026, 2055, 1985, 504, 478, 356, 2051, 226, 45, + /* 660 */ 43, 620, 259, 603, 1762, 377, 1936, 362, 619, 1385, + /* 670 */ 607, 46, 2027, 522, 1619, 1362, 1363, 415, 516, 1618, + /* 680 */ 1465, 184, 1383, 225, 1753, 60, 558, 1560, 1561, 1563, + /* 690 */ 1564, 576, 1966, 710, 1762, 1950, 2002, 510, 509, 161, + /* 700 */ 1968, 623, 1970, 1971, 618, 1460, 613, 547, 1467, 1468, + /* 710 */ 1738, 2124, 542, 368, 567, 562, 556, 1391, 1936, 67, + /* 720 */ 1739, 157, 66, 1936, 1946, 1952, 2130, 175, 1475, 1747, + /* 730 */ 1764, 2125, 572, 1617, 1410, 613, 649, 1440, 1450, 1806, + /* 740 */ 548, 2092, 14, 1466, 1469, 603, 38, 37, 1496, 1749, + /* 750 */ 44, 42, 41, 40, 39, 31, 169, 2128, 1386, 429, + /* 760 */ 1384, 38, 37, 503, 710, 44, 42, 41, 40, 39, + /* 770 */ 1745, 400, 657, 399, 1616, 237, 1762, 1936, 1863, 1467, + /* 780 */ 1468, 1737, 1615, 1389, 1390, 502, 1439, 1442, 1443, 1444, + /* 790 */ 1445, 1446, 1447, 1448, 1449, 615, 611, 1458, 1459, 1461, + /* 800 */ 1462, 1463, 1464, 2, 41, 40, 39, 603, 1440, 1450, + /* 810 */ 319, 50, 1408, 3, 1466, 1469, 365, 94, 1936, 437, + /* 820 */ 32, 430, 450, 232, 157, 449, 1936, 655, 614, 1386, + /* 830 */ 1501, 1384, 1614, 1764, 1551, 178, 681, 679, 1762, 1755, + /* 840 */ 421, 1955, 451, 647, 157, 423, 148, 147, 652, 651, + /* 850 */ 650, 145, 1950, 1765, 1389, 1390, 1410, 1439, 1442, 1443, + /* 860 */ 1444, 1445, 1446, 1447, 1448, 1449, 615, 611, 1458, 1459, + /* 870 */ 1461, 1462, 1463, 1464, 2, 1441, 1936, 670, 1413, 1732, + /* 880 */ 158, 1946, 1952, 33, 1845, 296, 335, 1675, 655, 38, + /* 890 */ 37, 1858, 613, 44, 42, 41, 40, 39, 411, 294, + /* 900 */ 70, 1815, 183, 69, 1858, 1858, 1622, 148, 147, 652, + /* 910 */ 651, 650, 145, 13, 12, 185, 189, 1814, 1099, 1100, + /* 920 */ 99, 195, 456, 454, 653, 2095, 654, 1806, 447, 1806, + /* 930 */ 96, 442, 441, 440, 439, 436, 435, 434, 433, 432, + /* 940 */ 428, 427, 426, 425, 336, 418, 417, 416, 589, 413, + /* 950 */ 412, 333, 687, 686, 685, 684, 372, 60, 683, 682, + /* 960 */ 138, 677, 676, 675, 674, 673, 672, 671, 150, 667, + /* 970 */ 666, 665, 371, 370, 662, 661, 660, 659, 658, 1613, + /* 980 */ 254, 603, 655, 1612, 290, 603, 375, 1792, 374, 578, + /* 990 */ 547, 2075, 1528, 603, 2124, 476, 102, 1441, 1717, 477, + /* 1000 */ 1967, 148, 147, 652, 651, 650, 145, 1759, 1508, 2130, + /* 1010 */ 175, 140, 1762, 128, 2125, 572, 1762, 218, 574, 71, + /* 1020 */ 216, 236, 220, 1936, 1762, 219, 52, 1936, 547, 603, + /* 1030 */ 547, 1985, 2124, 546, 2124, 424, 78, 77, 404, 586, + /* 1040 */ 583, 182, 603, 142, 1936, 1394, 619, 2130, 175, 2130, + /* 1050 */ 175, 559, 2125, 572, 2125, 572, 543, 1923, 535, 318, + /* 1060 */ 1762, 603, 392, 235, 390, 386, 382, 379, 376, 79, + /* 1070 */ 1966, 134, 1967, 1762, 2002, 587, 1393, 103, 1968, 623, + /* 1080 */ 1970, 1971, 618, 603, 613, 222, 62, 224, 221, 172, + /* 1090 */ 223, 2055, 1762, 1665, 211, 356, 2051, 271, 603, 603, + /* 1100 */ 547, 1658, 87, 1985, 2124, 384, 1656, 178, 603, 610, + /* 1110 */ 339, 620, 598, 600, 1762, 515, 1936, 2082, 619, 2130, + /* 1120 */ 175, 1957, 601, 517, 2125, 572, 1967, 603, 520, 1762, + /* 1130 */ 1762, 176, 2063, 2064, 241, 132, 2068, 248, 1559, 1762, + /* 1140 */ 47, 277, 1966, 1604, 1605, 1986, 2002, 264, 373, 103, + /* 1150 */ 1968, 623, 1970, 1971, 618, 663, 613, 1985, 1762, 68, + /* 1160 */ 144, 2144, 1867, 2055, 146, 620, 1646, 356, 2051, 1959, + /* 1170 */ 1936, 340, 619, 338, 337, 62, 501, 1161, 2089, 664, + /* 1180 */ 503, 1652, 1803, 603, 47, 47, 243, 1967, 13, 12, + /* 1190 */ 2085, 627, 1327, 584, 1397, 144, 1966, 369, 256, 269, + /* 1200 */ 2002, 1159, 502, 103, 1968, 623, 1970, 1971, 618, 253, + /* 1210 */ 613, 595, 273, 579, 1762, 2144, 1213, 2055, 1985, 1, + /* 1220 */ 146, 356, 2051, 129, 4, 1396, 620, 1502, 359, 358, + /* 1230 */ 705, 1936, 2102, 619, 378, 1349, 1451, 289, 1399, 144, + /* 1240 */ 383, 332, 284, 1241, 188, 410, 1413, 1245, 414, 1465, + /* 1250 */ 1967, 1392, 1868, 1486, 445, 419, 1408, 1966, 438, 444, + /* 1260 */ 431, 2002, 1860, 446, 103, 1968, 623, 1970, 1971, 618, + /* 1270 */ 1967, 613, 1252, 452, 1460, 1250, 2144, 453, 2055, 192, + /* 1280 */ 455, 1985, 356, 2051, 457, 1414, 1391, 458, 467, 620, + /* 1290 */ 1416, 149, 470, 554, 1936, 198, 619, 200, 1411, 471, + /* 1300 */ 1415, 1985, 472, 1417, 473, 203, 205, 475, 82, 620, + /* 1310 */ 83, 479, 1116, 209, 1936, 496, 619, 497, 500, 498, + /* 1320 */ 1966, 1752, 321, 106, 2002, 534, 215, 103, 1968, 623, + /* 1330 */ 1970, 1971, 618, 609, 613, 536, 285, 230, 1748, 2144, + /* 1340 */ 1966, 2055, 217, 151, 2002, 356, 2051, 103, 1968, 623, + /* 1350 */ 1970, 1971, 618, 152, 613, 1750, 2118, 1746, 153, 2144, + /* 1360 */ 154, 2055, 1913, 1912, 537, 356, 2051, 538, 233, 541, + /* 1370 */ 713, 544, 560, 1967, 551, 2086, 2074, 2101, 593, 557, + /* 1380 */ 2100, 346, 2096, 7, 283, 563, 569, 249, 239, 242, + /* 1390 */ 2077, 165, 247, 552, 550, 250, 549, 347, 1400, 168, + /* 1400 */ 1395, 580, 577, 1528, 1985, 703, 699, 695, 691, 281, + /* 1410 */ 251, 2147, 620, 255, 252, 2123, 133, 1936, 1412, 619, + /* 1420 */ 2071, 588, 261, 1403, 1405, 350, 591, 596, 286, 287, + /* 1430 */ 592, 1884, 1967, 1883, 1882, 352, 611, 1458, 1459, 1461, + /* 1440 */ 1462, 1463, 1464, 1966, 288, 101, 1763, 2002, 274, 597, + /* 1450 */ 103, 1968, 623, 1970, 1971, 618, 59, 613, 91, 93, + /* 1460 */ 2036, 95, 2030, 1985, 2055, 625, 280, 1807, 356, 2051, + /* 1470 */ 1733, 620, 291, 706, 707, 709, 1936, 315, 619, 51, + /* 1480 */ 295, 599, 1930, 323, 324, 293, 1967, 1929, 300, 75, + /* 1490 */ 1928, 314, 304, 1927, 76, 1924, 380, 381, 1377, 1378, + /* 1500 */ 181, 1922, 1966, 385, 387, 388, 2002, 389, 1921, 103, + /* 1510 */ 1968, 623, 1970, 1971, 618, 391, 613, 1985, 1920, 393, + /* 1520 */ 262, 2028, 1919, 2055, 395, 620, 397, 356, 2051, 1918, + /* 1530 */ 1936, 1352, 619, 1895, 1351, 1894, 402, 1356, 1893, 231, + /* 1540 */ 403, 1892, 1853, 1307, 1852, 1850, 139, 1967, 1849, 1848, + /* 1550 */ 1851, 1847, 1846, 1844, 1843, 1842, 1966, 186, 420, 1841, + /* 1560 */ 2002, 422, 1840, 103, 1968, 623, 1970, 1971, 618, 1839, + /* 1570 */ 613, 1838, 1837, 1836, 1835, 606, 1834, 2055, 1985, 1833, + /* 1580 */ 1832, 356, 2051, 1831, 1830, 1829, 620, 1828, 1827, 1826, + /* 1590 */ 1825, 1936, 1824, 619, 448, 1817, 1816, 1309, 141, 1823, + /* 1600 */ 1822, 1821, 1820, 1819, 1818, 1967, 1680, 1679, 1677, 1641, + /* 1610 */ 196, 170, 1188, 1956, 1640, 193, 194, 1966, 1908, 1102, + /* 1620 */ 73, 2002, 197, 1902, 104, 1968, 623, 1970, 1971, 618, + /* 1630 */ 1101, 613, 1891, 463, 1890, 204, 1985, 74, 2055, 1870, + /* 1640 */ 465, 1741, 2054, 2051, 620, 1676, 1674, 480, 1672, 1936, + /* 1650 */ 202, 619, 482, 1670, 484, 1135, 486, 488, 481, 1967, + /* 1660 */ 490, 1668, 492, 485, 494, 1655, 1654, 1637, 489, 1743, + /* 1670 */ 1257, 1256, 493, 1742, 61, 1966, 1171, 1179, 1178, 2002, + /* 1680 */ 678, 680, 104, 1968, 623, 1970, 1971, 618, 1967, 613, + /* 1690 */ 1985, 1177, 1176, 1173, 1172, 1170, 2055, 1666, 620, 214, + /* 1700 */ 608, 2051, 341, 1936, 1659, 619, 342, 1657, 343, 521, + /* 1710 */ 1636, 523, 518, 1635, 525, 1634, 527, 1367, 105, 1985, + /* 1720 */ 1366, 531, 1369, 26, 1907, 1358, 55, 617, 1901, 621, + /* 1730 */ 539, 155, 1936, 2002, 619, 1889, 104, 1968, 623, 1970, + /* 1740 */ 1971, 618, 1887, 613, 2129, 28, 1967, 19, 16, 553, + /* 1750 */ 2055, 1574, 246, 555, 326, 2051, 58, 63, 1966, 238, + /* 1760 */ 245, 1957, 2002, 30, 240, 312, 1968, 623, 1970, 1971, + /* 1770 */ 618, 616, 613, 604, 2020, 21, 163, 1985, 1589, 20, + /* 1780 */ 17, 1588, 348, 1558, 244, 620, 29, 1593, 1550, 1594, + /* 1790 */ 1936, 88, 619, 540, 234, 1595, 344, 1592, 349, 1888, + /* 1800 */ 1967, 57, 545, 258, 56, 1525, 166, 1524, 5, 1886, + /* 1810 */ 6, 1885, 22, 594, 263, 265, 1966, 1556, 270, 1869, + /* 1820 */ 2002, 65, 90, 162, 1968, 623, 1970, 1971, 618, 92, + /* 1830 */ 613, 1985, 96, 275, 272, 23, 12, 1401, 1432, 620, + /* 1840 */ 2005, 167, 179, 612, 1936, 1455, 619, 1453, 36, 626, + /* 1850 */ 624, 1234, 364, 15, 1967, 630, 1452, 1424, 1487, 24, + /* 1860 */ 25, 622, 1242, 628, 633, 1239, 631, 636, 639, 1236, + /* 1870 */ 1966, 634, 1477, 1230, 2002, 573, 2145, 104, 1968, 623, + /* 1880 */ 1970, 1971, 618, 637, 613, 1985, 1228, 640, 1219, 1233, + /* 1890 */ 278, 2055, 646, 620, 1232, 97, 2052, 1231, 1936, 98, + /* 1900 */ 619, 10, 1251, 1476, 1247, 72, 1967, 1133, 656, 1167, + /* 1910 */ 1166, 1165, 1164, 1163, 1162, 1160, 1158, 1186, 1157, 1156, + /* 1920 */ 668, 1154, 1967, 1153, 1966, 1152, 1151, 1183, 2002, 279, + /* 1930 */ 1150, 161, 1968, 623, 1970, 1971, 618, 1985, 613, 1139, + /* 1940 */ 1149, 1148, 1181, 1145, 1144, 620, 1141, 1140, 1138, 1673, + /* 1950 */ 1936, 688, 619, 1985, 690, 1671, 692, 694, 689, 1669, + /* 1960 */ 696, 620, 693, 698, 1667, 700, 1936, 697, 619, 1653, + /* 1970 */ 701, 702, 704, 2093, 1091, 1633, 1966, 712, 282, 708, + /* 1980 */ 2002, 1608, 1387, 306, 1968, 623, 1970, 1971, 618, 711, + /* 1990 */ 613, 1608, 1966, 292, 1608, 1608, 2002, 1608, 1608, 162, + /* 2000 */ 1968, 623, 1970, 1971, 618, 1608, 613, 1608, 1608, 1608, + /* 2010 */ 1608, 1967, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2020 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 568, 1608, 1967, + /* 2030 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2040 */ 1608, 1608, 1985, 1608, 1608, 1608, 1608, 351, 1608, 1608, + /* 2050 */ 620, 1608, 2146, 1608, 1608, 1936, 1608, 619, 1608, 1608, + /* 2060 */ 1985, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 617, 1608, + /* 2070 */ 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, + /* 2080 */ 1608, 1966, 1608, 1967, 1608, 2002, 1608, 1608, 313, 1968, + /* 2090 */ 623, 1970, 1971, 618, 1608, 613, 1608, 1608, 1608, 1966, + /* 2100 */ 1967, 1608, 1608, 2002, 1608, 1608, 312, 1968, 623, 1970, + /* 2110 */ 1971, 618, 1608, 613, 1985, 2021, 1608, 1608, 1608, 361, + /* 2120 */ 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, + /* 2130 */ 1608, 1985, 1608, 1608, 1608, 1608, 363, 1608, 1608, 620, + /* 2140 */ 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, + /* 2150 */ 1608, 1608, 1967, 1966, 1608, 1608, 1608, 2002, 1608, 1608, + /* 2160 */ 313, 1968, 623, 1970, 1971, 618, 1608, 613, 1967, 1608, + /* 2170 */ 1966, 1608, 1608, 1608, 2002, 1608, 1608, 313, 1968, 623, + /* 2180 */ 1970, 1971, 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, + /* 2190 */ 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, 1985, + /* 2200 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, 1608, + /* 2210 */ 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, 1608, + /* 2220 */ 1967, 1608, 533, 1608, 1608, 1608, 2002, 1608, 1608, 308, + /* 2230 */ 1968, 623, 1970, 1971, 618, 1608, 613, 1608, 1966, 1608, + /* 2240 */ 1608, 1608, 2002, 1608, 1608, 297, 1968, 623, 1970, 1971, + /* 2250 */ 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, 1608, 620, + /* 2260 */ 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, + /* 2270 */ 1608, 1608, 1608, 1608, 1967, 1608, 1608, 1608, 1608, 1608, + /* 2280 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2290 */ 1966, 1608, 1608, 1608, 2002, 1967, 1608, 298, 1968, 623, + /* 2300 */ 1970, 1971, 618, 1608, 613, 1985, 1608, 1608, 1608, 1608, + /* 2310 */ 1608, 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, + /* 2320 */ 619, 1608, 1608, 1608, 1608, 1608, 1985, 1608, 1608, 1608, + /* 2330 */ 1608, 1608, 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, + /* 2340 */ 1608, 619, 1608, 1608, 1966, 1608, 1608, 1608, 2002, 1608, + /* 2350 */ 1608, 299, 1968, 623, 1970, 1971, 618, 1608, 613, 1608, + /* 2360 */ 1608, 1608, 1608, 1608, 1608, 1966, 1608, 1608, 1608, 2002, + /* 2370 */ 1608, 1967, 305, 1968, 623, 1970, 1971, 618, 1608, 613, + /* 2380 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1967, + /* 2390 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2400 */ 1608, 1608, 1985, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2410 */ 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, + /* 2420 */ 1985, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, + /* 2430 */ 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, + /* 2440 */ 1608, 1966, 1608, 1967, 1608, 2002, 1608, 1608, 309, 1968, + /* 2450 */ 623, 1970, 1971, 618, 1608, 613, 1608, 1608, 1608, 1966, + /* 2460 */ 1967, 1608, 1608, 2002, 1608, 1608, 301, 1968, 623, 1970, + /* 2470 */ 1971, 618, 1608, 613, 1985, 1608, 1608, 1608, 1608, 1608, + /* 2480 */ 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, + /* 2490 */ 1608, 1985, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, + /* 2500 */ 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, + /* 2510 */ 1608, 1608, 1967, 1966, 1608, 1608, 1608, 2002, 1608, 1608, + /* 2520 */ 310, 1968, 623, 1970, 1971, 618, 1608, 613, 1967, 1608, + /* 2530 */ 1966, 1608, 1608, 1608, 2002, 1608, 1608, 302, 1968, 623, + /* 2540 */ 1970, 1971, 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, + /* 2550 */ 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, 1985, + /* 2560 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, 1608, + /* 2570 */ 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, 1608, + /* 2580 */ 1967, 1608, 1966, 1608, 1608, 1608, 2002, 1608, 1608, 311, + /* 2590 */ 1968, 623, 1970, 1971, 618, 1608, 613, 1608, 1966, 1608, + /* 2600 */ 1608, 1608, 2002, 1967, 1608, 303, 1968, 623, 1970, 1971, + /* 2610 */ 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, 1608, 620, + /* 2620 */ 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, + /* 2630 */ 1608, 1608, 1608, 1608, 1985, 1608, 1608, 1608, 1608, 1608, + /* 2640 */ 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, + /* 2650 */ 1966, 1608, 1608, 1608, 2002, 1967, 1608, 316, 1968, 623, + /* 2660 */ 1970, 1971, 618, 1608, 613, 1608, 1608, 1608, 1608, 1608, + /* 2670 */ 1608, 1608, 1608, 1966, 1608, 1608, 1608, 2002, 1608, 1608, + /* 2680 */ 317, 1968, 623, 1970, 1971, 618, 1985, 613, 1608, 1608, + /* 2690 */ 1608, 1608, 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, + /* 2700 */ 1608, 619, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2710 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1967, 1608, + /* 2720 */ 1608, 1608, 1608, 1608, 1608, 1966, 1608, 1608, 1608, 2002, + /* 2730 */ 1608, 1608, 1979, 1968, 623, 1970, 1971, 618, 1608, 613, + /* 2740 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1985, + /* 2750 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, 1608, + /* 2760 */ 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, 1608, + /* 2770 */ 1967, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2780 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1966, 1967, + /* 2790 */ 1608, 1608, 2002, 1608, 1608, 1978, 1968, 623, 1970, 1971, + /* 2800 */ 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, 1608, 620, + /* 2810 */ 1608, 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, + /* 2820 */ 1985, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, + /* 2830 */ 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, + /* 2840 */ 1966, 1967, 1608, 1608, 2002, 1608, 1608, 1977, 1968, 623, + /* 2850 */ 1970, 1971, 618, 1608, 613, 1608, 1608, 1967, 1608, 1966, + /* 2860 */ 1608, 1608, 1608, 2002, 1608, 1608, 328, 1968, 623, 1970, + /* 2870 */ 1971, 618, 1985, 613, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2880 */ 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, 1985, 1608, + /* 2890 */ 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, 1608, 1608, + /* 2900 */ 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, 1608, 1967, + /* 2910 */ 1608, 1966, 1608, 1608, 1608, 2002, 1608, 1608, 329, 1968, + /* 2920 */ 623, 1970, 1971, 618, 1608, 613, 1608, 1966, 1608, 1608, + /* 2930 */ 1608, 2002, 1967, 1608, 325, 1968, 623, 1970, 1971, 618, + /* 2940 */ 1985, 613, 1608, 1608, 1608, 1608, 1608, 1608, 620, 1608, + /* 2950 */ 1608, 1608, 1608, 1936, 1608, 619, 1608, 1608, 1608, 1608, + /* 2960 */ 1608, 1608, 1608, 1985, 1608, 1608, 1608, 1608, 1608, 1608, + /* 2970 */ 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, 619, 1966, + /* 2980 */ 1608, 1608, 1608, 2002, 1967, 1608, 330, 1968, 623, 1970, + /* 2990 */ 1971, 618, 1608, 613, 1608, 1608, 1608, 1608, 1608, 1608, + /* 3000 */ 1608, 1608, 621, 1608, 1608, 1608, 2002, 1608, 1608, 308, + /* 3010 */ 1968, 623, 1970, 1971, 618, 1985, 613, 1608, 1608, 1608, + /* 3020 */ 1608, 1608, 1608, 620, 1608, 1608, 1608, 1608, 1936, 1608, + /* 3030 */ 619, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 3040 */ 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, 1608, + /* 3050 */ 1608, 1608, 1608, 1608, 1966, 1608, 1608, 1608, 2002, 1608, + /* 3060 */ 1608, 307, 1968, 623, 1970, 1971, 618, 1608, 613, }; static const YYCODETYPE yy_lookahead[] = { - /* 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, + /* 0 */ 420, 421, 332, 374, 334, 335, 332, 370, 334, 335, + /* 10 */ 373, 374, 12, 13, 14, 361, 387, 388, 360, 14, + /* 20 */ 20, 336, 22, 8, 9, 20, 372, 12, 13, 14, + /* 30 */ 15, 16, 359, 33, 333, 35, 352, 336, 337, 355, + /* 40 */ 431, 20, 8, 9, 435, 20, 12, 13, 14, 15, + /* 50 */ 16, 39, 20, 380, 381, 401, 402, 403, 58, 450, + /* 60 */ 451, 376, 58, 63, 455, 456, 412, 8, 9, 328, + /* 70 */ 70, 12, 13, 14, 15, 16, 333, 20, 336, 336, + /* 80 */ 337, 8, 9, 12, 13, 12, 13, 14, 15, 16, + /* 90 */ 3, 20, 358, 22, 0, 95, 415, 63, 94, 418, + /* 100 */ 359, 97, 95, 44, 33, 371, 35, 20, 367, 367, + /* 110 */ 327, 96, 329, 372, 336, 374, 95, 117, 24, 25, + /* 120 */ 26, 27, 28, 29, 30, 31, 32, 95, 350, 58, + /* 130 */ 340, 343, 132, 133, 63, 357, 348, 79, 104, 398, + /* 140 */ 4, 70, 62, 402, 354, 367, 405, 406, 407, 408, + /* 150 */ 409, 410, 362, 412, 20, 431, 359, 44, 417, 435, + /* 160 */ 419, 161, 162, 366, 423, 424, 95, 167, 168, 427, + /* 170 */ 428, 429, 375, 431, 432, 451, 20, 435, 437, 455, + /* 180 */ 456, 431, 182, 96, 184, 435, 445, 21, 117, 132, + /* 190 */ 133, 58, 450, 451, 160, 137, 138, 455, 456, 95, + /* 200 */ 34, 451, 36, 132, 133, 455, 456, 207, 208, 96, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 161, 162, 399, - /* 230 */ 400, 20, 161, 162, 425, 426, 427, 350, 429, 430, - /* 240 */ 410, 43, 433, 45, 46, 358, 95, 20, 358, 22, - /* 250 */ 37, 180, 205, 182, 367, 187, 188, 448, 449, 191, - /* 260 */ 79, 193, 453, 454, 374, 231, 232, 233, 234, 235, - /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 51, 208, - /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 3, 228, - /* 300 */ 12, 13, 255, 256, 257, 258, 259, 228, 20, 230, - /* 310 */ 22, 98, 20, 100, 101, 20, 103, 335, 137, 138, - /* 320 */ 107, 33, 244, 35, 108, 109, 110, 111, 112, 113, - /* 330 */ 114, 115, 116, 117, 118, 0, 120, 121, 122, 123, - /* 340 */ 124, 125, 129, 132, 133, 58, 58, 58, 366, 58, - /* 350 */ 429, 63, 126, 63, 433, 339, 21, 228, 70, 24, - /* 360 */ 25, 26, 27, 28, 29, 30, 31, 32, 358, 353, - /* 370 */ 449, 12, 13, 14, 453, 454, 414, 361, 416, 20, - /* 380 */ 387, 22, 95, 95, 97, 94, 97, 95, 97, 95, - /* 390 */ 380, 96, 33, 21, 35, 244, 24, 25, 26, 27, - /* 400 */ 28, 29, 30, 31, 32, 117, 424, 425, 426, 427, - /* 410 */ 95, 429, 430, 33, 373, 189, 190, 58, 373, 429, - /* 420 */ 132, 133, 429, 433, 383, 341, 433, 386, 48, 70, - /* 430 */ 20, 386, 22, 166, 54, 55, 56, 57, 58, 449, - /* 440 */ 22, 448, 449, 453, 454, 35, 453, 454, 364, 161, - /* 450 */ 162, 126, 127, 35, 95, 0, 131, 20, 163, 8, - /* 460 */ 9, 51, 358, 12, 13, 14, 15, 16, 180, 365, - /* 470 */ 182, 20, 20, 179, 94, 181, 117, 97, 374, 24, - /* 480 */ 25, 26, 27, 28, 29, 30, 31, 32, 70, 402, - /* 490 */ 327, 132, 133, 205, 206, 205, 208, 209, 210, 211, - /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 510 */ 222, 223, 224, 225, 226, 428, 249, 250, 251, 14, - /* 520 */ 161, 162, 8, 9, 160, 20, 12, 13, 14, 15, - /* 530 */ 16, 244, 95, 429, 371, 117, 244, 433, 244, 180, - /* 540 */ 175, 182, 20, 358, 164, 165, 0, 167, 418, 419, - /* 550 */ 170, 366, 448, 449, 358, 387, 20, 453, 454, 244, - /* 560 */ 327, 196, 197, 367, 205, 206, 186, 208, 209, 210, - /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 335, 335, - /* 590 */ 405, 358, 372, 373, 20, 231, 22, 429, 180, 366, - /* 600 */ 182, 433, 349, 349, 371, 241, 373, 33, 62, 35, - /* 610 */ 96, 14, 15, 16, 163, 163, 448, 449, 358, 366, - /* 620 */ 366, 453, 454, 205, 206, 365, 387, 344, 345, 396, - /* 630 */ 3, 335, 58, 400, 374, 39, 403, 404, 405, 406, - /* 640 */ 407, 408, 0, 410, 70, 349, 413, 402, 415, 416, - /* 650 */ 417, 327, 356, 402, 421, 422, 387, 12, 13, 20, - /* 660 */ 4, 21, 366, 335, 327, 20, 161, 22, 429, 95, - /* 670 */ 1, 2, 433, 428, 34, 19, 36, 349, 33, 428, - /* 680 */ 35, 244, 358, 339, 356, 366, 35, 448, 449, 33, - /* 690 */ 366, 117, 453, 454, 366, 371, 377, 373, 429, 344, - /* 700 */ 345, 20, 433, 58, 48, 361, 132, 133, 371, 53, - /* 710 */ 413, 335, 106, 416, 58, 70, 327, 448, 449, 327, - /* 720 */ 396, 70, 453, 454, 400, 349, 366, 403, 404, 405, - /* 730 */ 406, 407, 408, 335, 410, 161, 162, 377, 62, 415, - /* 740 */ 95, 417, 366, 335, 335, 421, 422, 349, 351, 107, - /* 750 */ 94, 354, 368, 97, 180, 371, 182, 349, 349, 107, - /* 760 */ 371, 327, 117, 371, 366, 96, 0, 443, 126, 127, - /* 770 */ 128, 129, 130, 131, 366, 366, 70, 132, 133, 205, - /* 780 */ 206, 129, 208, 209, 210, 211, 212, 213, 214, 215, - /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 800 */ 226, 18, 163, 20, 335, 371, 161, 162, 327, 368, - /* 810 */ 27, 368, 371, 30, 371, 49, 33, 351, 349, 70, - /* 820 */ 354, 346, 42, 348, 44, 180, 0, 182, 327, 327, - /* 830 */ 327, 48, 44, 50, 2, 366, 53, 45, 46, 243, - /* 840 */ 8, 9, 0, 0, 12, 13, 14, 15, 16, 20, - /* 850 */ 205, 206, 371, 208, 209, 210, 211, 212, 213, 214, - /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - /* 870 */ 225, 226, 371, 371, 371, 8, 9, 94, 359, 12, - /* 880 */ 13, 14, 15, 16, 96, 99, 242, 243, 102, 106, - /* 890 */ 263, 65, 66, 67, 68, 69, 4, 71, 72, 73, - /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 42, 136, - /* 920 */ 44, 35, 139, 140, 141, 142, 143, 144, 145, 146, - /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 106, - /* 940 */ 157, 158, 159, 18, 44, 387, 8, 9, 23, 107, - /* 950 */ 12, 13, 14, 15, 16, 99, 99, 327, 102, 102, - /* 960 */ 327, 327, 37, 38, 99, 328, 41, 102, 126, 127, - /* 970 */ 128, 129, 130, 131, 359, 8, 9, 327, 335, 12, - /* 980 */ 13, 14, 15, 16, 59, 60, 61, 429, 358, 156, - /* 990 */ 161, 433, 349, 335, 151, 44, 366, 327, 327, 327, - /* 1000 */ 95, 371, 22, 373, 371, 371, 448, 449, 358, 366, - /* 1010 */ 105, 453, 454, 335, 163, 35, 366, 335, 335, 168, - /* 1020 */ 95, 371, 327, 373, 366, 0, 396, 349, 44, 44, - /* 1030 */ 400, 349, 349, 403, 404, 405, 406, 407, 408, 172, - /* 1040 */ 410, 371, 371, 371, 366, 415, 396, 417, 366, 366, - /* 1050 */ 400, 421, 422, 403, 404, 405, 406, 407, 408, 134, - /* 1060 */ 410, 35, 432, 96, 335, 415, 371, 417, 182, 327, - /* 1070 */ 107, 421, 422, 48, 327, 132, 133, 327, 349, 359, - /* 1080 */ 96, 96, 432, 425, 426, 427, 359, 429, 430, 126, - /* 1090 */ 127, 128, 129, 130, 131, 366, 359, 172, 173, 174, - /* 1100 */ 358, 163, 177, 335, 359, 335, 347, 381, 366, 446, - /* 1110 */ 335, 0, 327, 371, 44, 373, 327, 349, 371, 349, - /* 1120 */ 195, 371, 457, 198, 349, 200, 201, 202, 203, 204, - /* 1130 */ 335, 1, 2, 22, 366, 268, 366, 245, 396, 335, - /* 1140 */ 335, 366, 400, 358, 349, 403, 404, 405, 406, 407, - /* 1150 */ 408, 366, 410, 349, 349, 327, 371, 415, 373, 417, - /* 1160 */ 371, 366, 0, 421, 422, 0, 96, 267, 327, 244, - /* 1170 */ 366, 366, 8, 9, 432, 44, 12, 13, 14, 15, - /* 1180 */ 16, 396, 335, 337, 22, 400, 358, 22, 403, 404, - /* 1190 */ 405, 406, 407, 408, 366, 410, 349, 440, 47, 371, - /* 1200 */ 415, 373, 417, 44, 44, 44, 421, 422, 182, 337, - /* 1210 */ 44, 44, 371, 366, 334, 44, 265, 432, 44, 12, - /* 1220 */ 13, 44, 327, 44, 396, 13, 44, 96, 400, 22, - /* 1230 */ 44, 403, 404, 405, 406, 407, 408, 13, 410, 35, - /* 1240 */ 33, 358, 35, 415, 381, 417, 95, 35, 370, 421, - /* 1250 */ 422, 381, 431, 358, 423, 96, 96, 96, 450, 35, - /* 1260 */ 432, 366, 96, 96, 434, 58, 371, 96, 373, 246, - /* 1270 */ 96, 398, 397, 96, 70, 96, 327, 70, 96, 48, - /* 1280 */ 178, 42, 96, 389, 378, 20, 378, 160, 381, 376, - /* 1290 */ 20, 396, 335, 335, 378, 400, 376, 376, 403, 404, - /* 1300 */ 405, 406, 407, 408, 93, 410, 335, 358, 343, 335, - /* 1310 */ 415, 335, 417, 20, 20, 366, 421, 422, 329, 329, - /* 1320 */ 371, 393, 373, 341, 117, 373, 20, 341, 336, 20, - /* 1330 */ 388, 336, 341, 335, 341, 341, 52, 341, 341, 338, - /* 1340 */ 338, 329, 329, 335, 371, 396, 358, 194, 371, 400, - /* 1350 */ 395, 392, 403, 404, 405, 406, 407, 408, 358, 410, - /* 1360 */ 339, 358, 327, 358, 415, 358, 417, 358, 358, 358, - /* 1370 */ 421, 422, 358, 358, 358, 185, 393, 373, 339, 335, - /* 1380 */ 381, 260, 254, 439, 439, 253, 171, 180, 442, 182, - /* 1390 */ 371, 371, 438, 358, 441, 371, 262, 261, 381, 371, - /* 1400 */ 439, 366, 384, 437, 247, 436, 371, 269, 373, 266, - /* 1410 */ 264, 384, 205, 206, 458, 243, 452, 366, 20, 451, - /* 1420 */ 398, 335, 339, 336, 217, 218, 219, 220, 221, 222, - /* 1430 */ 223, 396, 402, 384, 371, 400, 327, 371, 403, 404, - /* 1440 */ 405, 406, 407, 408, 371, 410, 371, 371, 384, 371, - /* 1450 */ 415, 165, 417, 382, 339, 354, 421, 422, 339, 366, - /* 1460 */ 95, 420, 95, 371, 348, 362, 36, 358, 335, 330, - /* 1470 */ 329, 390, 352, 394, 339, 366, 385, 352, 352, 327, - /* 1480 */ 371, 385, 373, 325, 340, 0, 0, 187, 0, 0, - /* 1490 */ 42, 0, 35, 35, 199, 35, 35, 199, 0, 35, - /* 1500 */ 35, 199, 0, 199, 0, 396, 35, 0, 0, 400, - /* 1510 */ 358, 35, 403, 404, 405, 406, 407, 408, 366, 410, - /* 1520 */ 182, 22, 327, 371, 180, 373, 417, 176, 175, 0, - /* 1530 */ 421, 422, 0, 0, 0, 0, 0, 47, 0, 42, - /* 1540 */ 0, 0, 0, 0, 0, 0, 0, 0, 396, 35, - /* 1550 */ 327, 151, 400, 358, 0, 403, 404, 405, 406, 407, - /* 1560 */ 408, 366, 410, 151, 0, 0, 371, 0, 373, 417, - /* 1570 */ 42, 0, 0, 421, 422, 0, 0, 0, 0, 0, - /* 1580 */ 0, 358, 0, 0, 0, 0, 0, 0, 0, 366, - /* 1590 */ 0, 396, 0, 0, 371, 400, 373, 0, 403, 404, - /* 1600 */ 405, 406, 407, 408, 0, 410, 0, 135, 0, 35, - /* 1610 */ 0, 22, 417, 58, 0, 58, 421, 422, 0, 396, - /* 1620 */ 0, 14, 19, 400, 0, 44, 403, 404, 405, 406, - /* 1630 */ 407, 408, 409, 410, 411, 412, 33, 42, 327, 39, - /* 1640 */ 14, 47, 40, 47, 39, 47, 0, 0, 0, 171, - /* 1650 */ 39, 48, 0, 0, 0, 64, 0, 54, 55, 56, - /* 1660 */ 57, 58, 0, 35, 48, 0, 35, 48, 39, 358, - /* 1670 */ 0, 39, 35, 48, 39, 0, 35, 366, 48, 39, - /* 1680 */ 0, 327, 371, 0, 373, 0, 0, 0, 22, 44, - /* 1690 */ 35, 22, 35, 35, 35, 35, 0, 94, 327, 35, - /* 1700 */ 97, 22, 35, 104, 0, 44, 35, 396, 0, 35, - /* 1710 */ 22, 400, 358, 50, 403, 404, 405, 406, 407, 408, - /* 1720 */ 366, 410, 22, 102, 0, 371, 35, 373, 0, 358, - /* 1730 */ 35, 0, 22, 130, 20, 96, 35, 366, 35, 95, - /* 1740 */ 192, 0, 371, 0, 373, 183, 35, 22, 0, 0, - /* 1750 */ 396, 44, 327, 3, 400, 444, 445, 403, 404, 405, - /* 1760 */ 406, 407, 408, 248, 410, 252, 165, 396, 327, 96, - /* 1770 */ 167, 400, 163, 96, 403, 404, 405, 406, 407, 408, - /* 1780 */ 163, 410, 169, 358, 95, 163, 227, 184, 417, 186, - /* 1790 */ 44, 366, 95, 422, 96, 44, 371, 95, 373, 358, - /* 1800 */ 95, 168, 168, 47, 95, 47, 44, 366, 96, 455, - /* 1810 */ 456, 95, 371, 96, 373, 96, 248, 3, 44, 96, - /* 1820 */ 35, 396, 35, 35, 35, 400, 35, 35, 403, 404, - /* 1830 */ 405, 406, 407, 408, 96, 410, 0, 396, 327, 44, - /* 1840 */ 47, 400, 0, 47, 403, 404, 405, 406, 407, 408, - /* 1850 */ 0, 410, 95, 0, 327, 96, 96, 242, 95, 95, - /* 1860 */ 248, 95, 39, 95, 47, 44, 105, 229, 2, 358, - /* 1870 */ 445, 22, 166, 205, 95, 95, 227, 366, 227, 164, - /* 1880 */ 47, 95, 371, 22, 373, 358, 96, 47, 447, 95, - /* 1890 */ 363, 207, 95, 366, 96, 96, 96, 327, 371, 95, - /* 1900 */ 373, 96, 35, 35, 95, 22, 96, 396, 106, 35, - /* 1910 */ 95, 400, 96, 35, 403, 404, 405, 406, 407, 408, - /* 1920 */ 95, 410, 96, 396, 35, 95, 35, 400, 358, 95, - /* 1930 */ 403, 404, 405, 406, 407, 408, 366, 410, 119, 96, - /* 1940 */ 95, 371, 107, 373, 44, 35, 119, 119, 119, 95, - /* 1950 */ 95, 22, 64, 63, 327, 35, 35, 35, 35, 35, - /* 1960 */ 35, 35, 35, 35, 92, 35, 396, 456, 70, 35, - /* 1970 */ 400, 35, 22, 403, 404, 405, 406, 407, 408, 44, - /* 1980 */ 410, 35, 412, 35, 35, 358, 35, 70, 35, 35, - /* 1990 */ 363, 35, 35, 366, 35, 22, 35, 0, 371, 35, - /* 2000 */ 373, 39, 0, 35, 39, 327, 48, 0, 48, 35, - /* 2010 */ 39, 48, 0, 35, 48, 39, 0, 35, 35, 0, - /* 2020 */ 22, 21, 21, 396, 20, 22, 327, 400, 22, 459, - /* 2030 */ 403, 404, 405, 406, 407, 408, 358, 410, 459, 459, - /* 2040 */ 459, 363, 459, 459, 366, 459, 459, 459, 327, 371, - /* 2050 */ 459, 373, 459, 459, 459, 459, 459, 358, 459, 459, - /* 2060 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, - /* 2070 */ 371, 459, 373, 459, 396, 459, 459, 459, 400, 358, - /* 2080 */ 459, 403, 404, 405, 406, 407, 408, 366, 410, 459, - /* 2090 */ 459, 459, 371, 459, 373, 396, 459, 459, 459, 400, - /* 2100 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, - /* 2110 */ 459, 327, 459, 459, 459, 459, 459, 396, 459, 459, - /* 2120 */ 459, 400, 459, 459, 403, 404, 405, 406, 407, 408, - /* 2130 */ 459, 410, 459, 459, 459, 327, 459, 459, 459, 459, - /* 2140 */ 459, 459, 358, 459, 459, 459, 459, 459, 459, 459, - /* 2150 */ 366, 459, 459, 459, 459, 371, 459, 373, 459, 459, - /* 2160 */ 459, 459, 459, 459, 459, 459, 358, 459, 459, 459, - /* 2170 */ 459, 459, 459, 459, 366, 459, 459, 459, 459, 371, - /* 2180 */ 396, 373, 459, 459, 400, 459, 459, 403, 404, 405, - /* 2190 */ 406, 407, 408, 459, 410, 459, 459, 327, 459, 459, - /* 2200 */ 459, 459, 459, 459, 396, 459, 459, 459, 400, 459, - /* 2210 */ 459, 403, 404, 405, 406, 407, 408, 459, 410, 459, - /* 2220 */ 459, 327, 459, 459, 459, 459, 459, 459, 358, 459, - /* 2230 */ 459, 459, 459, 459, 459, 459, 366, 459, 459, 459, - /* 2240 */ 459, 371, 459, 373, 459, 459, 459, 459, 459, 459, - /* 2250 */ 459, 459, 358, 459, 459, 459, 459, 459, 459, 459, - /* 2260 */ 366, 459, 459, 459, 327, 371, 396, 373, 459, 459, - /* 2270 */ 400, 459, 459, 403, 404, 405, 406, 407, 408, 459, - /* 2280 */ 410, 459, 327, 459, 459, 459, 459, 459, 459, 459, - /* 2290 */ 396, 459, 459, 459, 400, 358, 459, 403, 404, 405, - /* 2300 */ 406, 407, 408, 366, 410, 459, 459, 459, 371, 459, - /* 2310 */ 373, 459, 459, 358, 459, 459, 459, 459, 459, 459, - /* 2320 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, - /* 2330 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, - /* 2340 */ 403, 404, 405, 406, 407, 408, 459, 410, 459, 459, - /* 2350 */ 459, 396, 459, 459, 327, 400, 459, 459, 403, 404, - /* 2360 */ 405, 406, 407, 408, 459, 410, 459, 459, 459, 459, - /* 2370 */ 459, 459, 327, 459, 459, 459, 459, 459, 459, 459, - /* 2380 */ 459, 459, 459, 459, 459, 358, 459, 459, 459, 459, - /* 2390 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, - /* 2400 */ 373, 459, 459, 358, 459, 459, 459, 459, 459, 459, - /* 2410 */ 459, 366, 459, 459, 459, 327, 371, 459, 373, 459, - /* 2420 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, - /* 2430 */ 403, 404, 405, 406, 407, 408, 459, 410, 459, 327, - /* 2440 */ 459, 396, 459, 459, 459, 400, 358, 459, 403, 404, - /* 2450 */ 405, 406, 407, 408, 366, 410, 459, 459, 459, 371, - /* 2460 */ 459, 373, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2470 */ 358, 459, 459, 459, 459, 459, 459, 459, 366, 459, - /* 2480 */ 459, 459, 459, 371, 396, 373, 459, 459, 400, 459, - /* 2490 */ 459, 403, 404, 405, 406, 407, 408, 459, 410, 459, - /* 2500 */ 459, 459, 327, 459, 459, 459, 459, 459, 396, 459, - /* 2510 */ 459, 459, 400, 459, 459, 403, 404, 405, 406, 407, - /* 2520 */ 408, 459, 410, 459, 459, 459, 459, 459, 459, 459, - /* 2530 */ 459, 459, 459, 358, 459, 459, 459, 459, 459, 459, - /* 2540 */ 459, 366, 459, 459, 459, 459, 371, 459, 373, 459, - /* 2550 */ 459, 459, 459, 459, 459, 459, 327, 459, 459, 459, - /* 2560 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2570 */ 459, 396, 459, 459, 459, 400, 459, 459, 403, 404, - /* 2580 */ 405, 406, 407, 408, 459, 410, 459, 358, 459, 459, - /* 2590 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 459, - /* 2600 */ 371, 459, 373, 459, 459, 459, 459, 459, 459, 459, - /* 2610 */ 327, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2620 */ 459, 459, 459, 459, 459, 396, 327, 459, 459, 400, - /* 2630 */ 459, 459, 403, 404, 405, 406, 407, 408, 459, 410, - /* 2640 */ 459, 358, 459, 459, 459, 459, 459, 459, 459, 366, - /* 2650 */ 459, 459, 459, 459, 371, 459, 373, 358, 459, 459, - /* 2660 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 327, - /* 2670 */ 371, 459, 373, 459, 459, 459, 459, 459, 459, 396, - /* 2680 */ 459, 459, 459, 400, 459, 459, 403, 404, 405, 406, - /* 2690 */ 407, 408, 459, 410, 459, 396, 459, 459, 459, 400, - /* 2700 */ 358, 459, 403, 404, 405, 406, 407, 408, 366, 410, - /* 2710 */ 459, 459, 459, 371, 459, 373, 459, 459, 459, 459, - /* 2720 */ 459, 459, 459, 459, 459, 459, 327, 459, 459, 459, - /* 2730 */ 459, 459, 459, 459, 459, 459, 459, 459, 396, 459, - /* 2740 */ 459, 459, 400, 327, 459, 403, 404, 405, 406, 407, - /* 2750 */ 408, 459, 410, 459, 459, 459, 459, 358, 459, 459, - /* 2760 */ 459, 459, 459, 459, 459, 366, 459, 459, 459, 327, - /* 2770 */ 371, 459, 373, 459, 358, 459, 459, 459, 459, 459, - /* 2780 */ 459, 459, 366, 459, 459, 459, 459, 371, 459, 373, - /* 2790 */ 459, 459, 459, 459, 459, 396, 459, 459, 459, 400, - /* 2800 */ 358, 459, 403, 404, 405, 406, 407, 408, 366, 410, - /* 2810 */ 459, 459, 396, 371, 459, 373, 400, 459, 459, 403, - /* 2820 */ 404, 405, 406, 407, 408, 459, 410, 459, 459, 459, - /* 2830 */ 327, 459, 459, 459, 459, 459, 459, 459, 396, 459, - /* 2840 */ 459, 459, 400, 459, 459, 403, 404, 405, 406, 407, - /* 2850 */ 408, 459, 410, 459, 459, 459, 459, 459, 459, 459, - /* 2860 */ 459, 358, 459, 459, 459, 459, 459, 459, 459, 366, - /* 2870 */ 459, 459, 459, 459, 371, 459, 373, 459, 459, 459, - /* 2880 */ 459, 459, 459, 459, 327, 459, 459, 459, 459, 459, - /* 2890 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 396, - /* 2900 */ 459, 459, 459, 400, 459, 459, 403, 404, 405, 406, - /* 2910 */ 407, 408, 459, 410, 459, 358, 459, 459, 459, 459, - /* 2920 */ 459, 459, 459, 366, 459, 459, 459, 459, 371, 459, - /* 2930 */ 373, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2940 */ 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - /* 2950 */ 459, 459, 459, 396, 459, 459, 459, 400, 459, 459, - /* 2960 */ 403, 404, 405, 406, 407, 408, 459, 410, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 95, 95, + /* 230 */ 97, 95, 161, 162, 404, 20, 163, 21, 167, 168, + /* 240 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 106, + /* 250 */ 163, 127, 245, 182, 404, 184, 244, 8, 9, 328, + /* 260 */ 430, 12, 13, 14, 15, 16, 232, 233, 234, 235, + /* 270 */ 236, 237, 238, 239, 240, 241, 242, 245, 207, 208, + /* 280 */ 430, 210, 211, 212, 213, 214, 215, 216, 217, 218, + /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 177, + /* 300 */ 229, 12, 13, 372, 361, 22, 14, 328, 359, 20, + /* 310 */ 22, 22, 20, 189, 190, 372, 367, 193, 35, 195, + /* 320 */ 198, 199, 33, 35, 35, 108, 109, 110, 111, 112, + /* 330 */ 113, 114, 115, 116, 117, 118, 0, 120, 121, 122, + /* 340 */ 123, 124, 125, 33, 401, 402, 403, 58, 35, 245, + /* 350 */ 389, 372, 63, 70, 359, 412, 407, 4, 48, 70, + /* 360 */ 20, 366, 22, 20, 54, 55, 56, 57, 58, 328, + /* 370 */ 375, 328, 12, 13, 14, 35, 161, 162, 245, 245, + /* 380 */ 20, 245, 22, 70, 95, 12, 13, 14, 15, 16, + /* 390 */ 62, 51, 431, 33, 20, 35, 435, 20, 328, 22, + /* 400 */ 117, 65, 66, 67, 94, 4, 117, 97, 0, 73, + /* 410 */ 74, 450, 451, 372, 78, 372, 455, 456, 58, 83, + /* 420 */ 84, 132, 133, 174, 328, 89, 126, 127, 51, 21, + /* 430 */ 70, 131, 24, 25, 26, 27, 28, 29, 30, 31, + /* 440 */ 32, 336, 372, 20, 43, 328, 45, 46, 70, 374, + /* 450 */ 161, 162, 336, 161, 359, 95, 167, 168, 229, 384, + /* 460 */ 231, 366, 387, 388, 336, 182, 350, 184, 372, 44, + /* 470 */ 375, 182, 367, 184, 164, 165, 328, 117, 350, 169, + /* 480 */ 8, 9, 172, 367, 12, 13, 14, 15, 16, 372, + /* 490 */ 207, 208, 132, 133, 342, 367, 207, 208, 188, 210, + /* 500 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + /* 510 */ 221, 222, 223, 224, 225, 226, 227, 365, 269, 20, + /* 520 */ 372, 161, 162, 336, 35, 328, 431, 167, 168, 336, + /* 530 */ 435, 426, 427, 428, 429, 336, 431, 432, 20, 65, + /* 540 */ 66, 67, 182, 350, 184, 450, 451, 73, 74, 350, + /* 550 */ 455, 456, 78, 328, 367, 132, 133, 83, 84, 70, + /* 560 */ 367, 328, 328, 89, 373, 374, 367, 207, 208, 372, + /* 570 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 580 */ 220, 221, 222, 223, 224, 225, 226, 227, 12, 13, + /* 590 */ 167, 168, 359, 0, 342, 351, 20, 372, 22, 246, + /* 600 */ 367, 325, 416, 359, 418, 372, 372, 374, 356, 33, + /* 610 */ 126, 35, 368, 229, 427, 428, 429, 365, 431, 432, + /* 620 */ 8, 9, 328, 404, 12, 13, 14, 15, 16, 4, + /* 630 */ 166, 398, 20, 336, 58, 402, 70, 207, 405, 406, + /* 640 */ 407, 408, 409, 410, 19, 412, 70, 350, 415, 430, + /* 650 */ 417, 418, 419, 359, 357, 62, 423, 424, 33, 12, + /* 660 */ 13, 367, 163, 336, 367, 389, 372, 20, 374, 22, + /* 670 */ 416, 95, 418, 48, 328, 191, 192, 350, 53, 328, + /* 680 */ 33, 163, 35, 58, 361, 95, 256, 257, 258, 259, + /* 690 */ 260, 266, 398, 117, 367, 372, 402, 345, 346, 405, + /* 700 */ 406, 407, 408, 409, 410, 58, 412, 431, 132, 133, + /* 710 */ 0, 435, 393, 351, 250, 251, 252, 70, 372, 94, + /* 720 */ 0, 359, 97, 372, 401, 402, 450, 451, 14, 360, + /* 730 */ 368, 455, 456, 328, 20, 412, 369, 161, 162, 372, + /* 740 */ 446, 447, 95, 167, 168, 336, 8, 9, 160, 360, + /* 750 */ 12, 13, 14, 15, 16, 2, 359, 3, 182, 350, + /* 760 */ 184, 8, 9, 107, 117, 12, 13, 14, 15, 16, + /* 770 */ 360, 181, 62, 183, 328, 163, 367, 372, 381, 132, + /* 780 */ 133, 0, 328, 207, 208, 129, 210, 211, 212, 213, + /* 790 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + /* 800 */ 224, 225, 226, 227, 14, 15, 16, 336, 161, 162, + /* 810 */ 18, 42, 20, 44, 167, 168, 351, 340, 372, 27, + /* 820 */ 232, 350, 30, 360, 359, 33, 372, 107, 360, 182, + /* 830 */ 242, 184, 328, 368, 96, 245, 345, 346, 367, 362, + /* 840 */ 48, 361, 50, 360, 359, 53, 126, 127, 128, 129, + /* 850 */ 130, 131, 372, 368, 207, 208, 20, 210, 211, 212, + /* 860 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + /* 870 */ 223, 224, 225, 226, 227, 161, 372, 347, 20, 349, + /* 880 */ 18, 401, 402, 2, 0, 23, 94, 0, 107, 8, + /* 890 */ 9, 367, 412, 12, 13, 14, 15, 16, 106, 37, + /* 900 */ 38, 359, 378, 41, 367, 367, 329, 126, 127, 128, + /* 910 */ 129, 130, 131, 1, 2, 378, 378, 375, 45, 46, + /* 920 */ 95, 59, 60, 61, 369, 382, 369, 372, 136, 372, + /* 930 */ 105, 139, 140, 141, 142, 143, 144, 145, 146, 147, + /* 940 */ 148, 149, 150, 151, 152, 153, 154, 155, 389, 157, + /* 950 */ 158, 159, 65, 66, 67, 68, 69, 95, 71, 72, + /* 960 */ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + /* 970 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 328, + /* 980 */ 459, 336, 107, 328, 352, 336, 389, 355, 389, 44, + /* 990 */ 431, 243, 244, 336, 435, 350, 134, 161, 348, 350, + /* 1000 */ 328, 126, 127, 128, 129, 130, 131, 350, 96, 450, + /* 1010 */ 451, 42, 367, 44, 455, 456, 367, 99, 264, 106, + /* 1020 */ 102, 163, 99, 372, 367, 102, 163, 372, 431, 336, + /* 1030 */ 431, 359, 435, 170, 435, 151, 174, 175, 176, 367, + /* 1040 */ 336, 179, 336, 350, 372, 35, 374, 450, 451, 450, + /* 1050 */ 451, 448, 455, 456, 455, 456, 350, 0, 389, 197, + /* 1060 */ 367, 336, 200, 58, 202, 203, 204, 205, 206, 156, + /* 1070 */ 398, 367, 328, 367, 402, 350, 35, 405, 406, 407, + /* 1080 */ 408, 409, 410, 336, 412, 99, 44, 99, 102, 417, + /* 1090 */ 102, 419, 367, 0, 338, 423, 424, 350, 336, 336, + /* 1100 */ 431, 0, 97, 359, 435, 48, 0, 245, 336, 63, + /* 1110 */ 37, 367, 350, 350, 367, 22, 372, 445, 374, 450, + /* 1120 */ 451, 47, 350, 22, 455, 456, 328, 336, 22, 367, + /* 1130 */ 367, 427, 428, 429, 44, 431, 432, 442, 96, 367, + /* 1140 */ 44, 350, 398, 132, 133, 359, 402, 44, 338, 405, + /* 1150 */ 406, 407, 408, 409, 410, 13, 412, 359, 367, 44, + /* 1160 */ 44, 417, 382, 419, 44, 367, 335, 423, 424, 95, + /* 1170 */ 372, 98, 374, 100, 101, 44, 103, 35, 434, 13, + /* 1180 */ 107, 0, 371, 336, 44, 44, 96, 328, 1, 2, + /* 1190 */ 382, 44, 96, 433, 184, 44, 398, 350, 452, 96, + /* 1200 */ 402, 35, 129, 405, 406, 407, 408, 409, 410, 425, + /* 1210 */ 412, 96, 96, 268, 367, 417, 96, 419, 359, 436, + /* 1220 */ 44, 423, 424, 44, 247, 184, 367, 96, 12, 13, + /* 1230 */ 49, 372, 434, 374, 400, 180, 96, 96, 22, 44, + /* 1240 */ 48, 399, 391, 96, 42, 379, 20, 96, 379, 33, + /* 1250 */ 328, 35, 382, 207, 160, 377, 20, 398, 379, 377, + /* 1260 */ 336, 402, 336, 377, 405, 406, 407, 408, 409, 410, + /* 1270 */ 328, 412, 96, 93, 58, 96, 417, 344, 419, 336, + /* 1280 */ 336, 359, 423, 424, 336, 20, 70, 330, 330, 367, + /* 1290 */ 20, 96, 395, 434, 372, 342, 374, 342, 20, 374, + /* 1300 */ 20, 359, 337, 20, 390, 342, 342, 337, 342, 367, + /* 1310 */ 342, 336, 52, 342, 372, 339, 374, 339, 359, 330, + /* 1320 */ 398, 359, 330, 336, 402, 196, 359, 405, 406, 407, + /* 1330 */ 408, 409, 410, 117, 412, 397, 395, 340, 359, 417, + /* 1340 */ 398, 419, 359, 359, 402, 423, 424, 405, 406, 407, + /* 1350 */ 408, 409, 410, 359, 412, 359, 434, 359, 359, 417, + /* 1360 */ 359, 419, 372, 372, 187, 423, 424, 394, 340, 374, + /* 1370 */ 19, 336, 255, 328, 372, 382, 434, 441, 254, 372, + /* 1380 */ 441, 372, 382, 261, 33, 372, 173, 440, 385, 385, + /* 1390 */ 444, 441, 443, 263, 262, 439, 248, 270, 182, 48, + /* 1400 */ 184, 267, 265, 244, 359, 54, 55, 56, 57, 58, + /* 1410 */ 438, 460, 367, 453, 400, 454, 367, 372, 20, 374, + /* 1420 */ 404, 336, 340, 207, 208, 337, 372, 165, 385, 385, + /* 1430 */ 372, 372, 328, 372, 372, 372, 220, 221, 222, 223, + /* 1440 */ 224, 225, 226, 398, 355, 94, 367, 402, 97, 383, + /* 1450 */ 405, 406, 407, 408, 409, 410, 95, 412, 340, 340, + /* 1460 */ 422, 95, 417, 359, 419, 363, 340, 372, 423, 424, + /* 1470 */ 349, 367, 336, 36, 331, 330, 372, 396, 374, 392, + /* 1480 */ 326, 130, 0, 386, 386, 341, 328, 0, 353, 189, + /* 1490 */ 0, 353, 353, 0, 42, 0, 35, 201, 35, 35, + /* 1500 */ 35, 0, 398, 201, 35, 35, 402, 201, 0, 405, + /* 1510 */ 406, 407, 408, 409, 410, 201, 412, 359, 0, 35, + /* 1520 */ 169, 417, 0, 419, 22, 367, 35, 423, 424, 0, + /* 1530 */ 372, 184, 374, 0, 182, 0, 178, 186, 0, 188, + /* 1540 */ 177, 0, 0, 47, 0, 0, 42, 328, 0, 0, + /* 1550 */ 0, 0, 0, 0, 0, 0, 398, 151, 35, 0, + /* 1560 */ 402, 151, 0, 405, 406, 407, 408, 409, 410, 0, + /* 1570 */ 412, 0, 0, 0, 0, 417, 0, 419, 359, 0, + /* 1580 */ 0, 423, 424, 0, 0, 0, 367, 0, 0, 0, + /* 1590 */ 0, 372, 0, 374, 135, 0, 0, 22, 42, 0, + /* 1600 */ 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, + /* 1610 */ 42, 44, 35, 47, 0, 58, 58, 398, 0, 14, + /* 1620 */ 39, 402, 40, 0, 405, 406, 407, 408, 409, 410, + /* 1630 */ 14, 412, 0, 47, 0, 173, 359, 39, 419, 0, + /* 1640 */ 47, 0, 423, 424, 367, 0, 0, 35, 0, 372, + /* 1650 */ 39, 374, 39, 0, 35, 64, 39, 35, 48, 328, + /* 1660 */ 39, 0, 35, 48, 39, 0, 0, 0, 48, 0, + /* 1670 */ 35, 22, 48, 0, 104, 398, 22, 35, 35, 402, + /* 1680 */ 44, 44, 405, 406, 407, 408, 409, 410, 328, 412, + /* 1690 */ 359, 35, 35, 35, 35, 35, 419, 0, 367, 102, + /* 1700 */ 423, 424, 22, 372, 0, 374, 22, 0, 22, 35, + /* 1710 */ 0, 35, 50, 0, 35, 0, 22, 35, 20, 359, + /* 1720 */ 35, 194, 96, 95, 0, 35, 163, 367, 0, 398, + /* 1730 */ 22, 185, 372, 402, 374, 0, 405, 406, 407, 408, + /* 1740 */ 409, 410, 0, 412, 3, 95, 328, 44, 249, 228, + /* 1750 */ 419, 96, 47, 253, 423, 424, 44, 3, 398, 95, + /* 1760 */ 44, 47, 402, 44, 96, 405, 406, 407, 408, 409, + /* 1770 */ 410, 411, 412, 413, 414, 44, 95, 359, 35, 249, + /* 1780 */ 249, 35, 35, 96, 95, 367, 95, 35, 96, 96, + /* 1790 */ 372, 95, 374, 163, 165, 96, 163, 35, 35, 0, + /* 1800 */ 328, 44, 171, 47, 243, 96, 47, 96, 170, 0, + /* 1810 */ 170, 0, 95, 166, 96, 95, 398, 96, 95, 0, + /* 1820 */ 402, 95, 39, 405, 406, 407, 408, 409, 410, 95, + /* 1830 */ 412, 359, 105, 47, 164, 44, 2, 22, 22, 367, + /* 1840 */ 95, 47, 47, 95, 372, 96, 374, 96, 95, 35, + /* 1850 */ 106, 119, 35, 95, 328, 35, 96, 96, 207, 95, + /* 1860 */ 95, 209, 96, 95, 35, 96, 95, 35, 35, 96, + /* 1870 */ 398, 95, 228, 96, 402, 457, 458, 405, 406, 407, + /* 1880 */ 408, 409, 410, 95, 412, 359, 96, 95, 22, 119, + /* 1890 */ 44, 419, 107, 367, 119, 95, 424, 119, 372, 95, + /* 1900 */ 374, 230, 35, 228, 22, 95, 328, 64, 63, 35, + /* 1910 */ 35, 35, 35, 35, 35, 35, 35, 70, 35, 35, + /* 1920 */ 92, 35, 328, 35, 398, 35, 22, 70, 402, 44, + /* 1930 */ 35, 405, 406, 407, 408, 409, 410, 359, 412, 22, + /* 1940 */ 35, 35, 35, 35, 35, 367, 35, 35, 35, 0, + /* 1950 */ 372, 35, 374, 359, 39, 0, 35, 39, 48, 0, + /* 1960 */ 35, 367, 48, 39, 0, 35, 372, 48, 374, 0, + /* 1970 */ 48, 39, 35, 447, 35, 0, 398, 20, 22, 21, + /* 1980 */ 402, 461, 22, 405, 406, 407, 408, 409, 410, 21, + /* 1990 */ 412, 461, 398, 22, 461, 461, 402, 461, 461, 405, + /* 2000 */ 406, 407, 408, 409, 410, 461, 412, 461, 461, 461, + /* 2010 */ 461, 328, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2020 */ 461, 461, 461, 461, 461, 461, 461, 449, 461, 328, + /* 2030 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2040 */ 461, 461, 359, 461, 461, 461, 461, 364, 461, 461, + /* 2050 */ 367, 461, 458, 461, 461, 372, 461, 374, 461, 461, + /* 2060 */ 359, 461, 461, 461, 461, 461, 461, 461, 367, 461, + /* 2070 */ 461, 461, 461, 372, 461, 374, 461, 461, 461, 461, + /* 2080 */ 461, 398, 461, 328, 461, 402, 461, 461, 405, 406, + /* 2090 */ 407, 408, 409, 410, 461, 412, 461, 461, 461, 398, + /* 2100 */ 328, 461, 461, 402, 461, 461, 405, 406, 407, 408, + /* 2110 */ 409, 410, 461, 412, 359, 414, 461, 461, 461, 364, + /* 2120 */ 461, 461, 367, 461, 461, 461, 461, 372, 461, 374, + /* 2130 */ 461, 359, 461, 461, 461, 461, 364, 461, 461, 367, + /* 2140 */ 461, 461, 461, 461, 372, 461, 374, 461, 461, 461, + /* 2150 */ 461, 461, 328, 398, 461, 461, 461, 402, 461, 461, + /* 2160 */ 405, 406, 407, 408, 409, 410, 461, 412, 328, 461, + /* 2170 */ 398, 461, 461, 461, 402, 461, 461, 405, 406, 407, + /* 2180 */ 408, 409, 410, 359, 412, 461, 461, 461, 461, 461, + /* 2190 */ 461, 367, 461, 461, 461, 461, 372, 461, 374, 359, + /* 2200 */ 461, 461, 461, 461, 461, 461, 461, 367, 461, 461, + /* 2210 */ 461, 461, 372, 461, 374, 461, 461, 461, 461, 461, + /* 2220 */ 328, 461, 398, 461, 461, 461, 402, 461, 461, 405, + /* 2230 */ 406, 407, 408, 409, 410, 461, 412, 461, 398, 461, + /* 2240 */ 461, 461, 402, 461, 461, 405, 406, 407, 408, 409, + /* 2250 */ 410, 359, 412, 461, 461, 461, 461, 461, 461, 367, + /* 2260 */ 461, 461, 461, 461, 372, 461, 374, 461, 461, 461, + /* 2270 */ 461, 461, 461, 461, 328, 461, 461, 461, 461, 461, + /* 2280 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2290 */ 398, 461, 461, 461, 402, 328, 461, 405, 406, 407, + /* 2300 */ 408, 409, 410, 461, 412, 359, 461, 461, 461, 461, + /* 2310 */ 461, 461, 461, 367, 461, 461, 461, 461, 372, 461, + /* 2320 */ 374, 461, 461, 461, 461, 461, 359, 461, 461, 461, + /* 2330 */ 461, 461, 461, 461, 367, 461, 461, 461, 461, 372, + /* 2340 */ 461, 374, 461, 461, 398, 461, 461, 461, 402, 461, + /* 2350 */ 461, 405, 406, 407, 408, 409, 410, 461, 412, 461, + /* 2360 */ 461, 461, 461, 461, 461, 398, 461, 461, 461, 402, + /* 2370 */ 461, 328, 405, 406, 407, 408, 409, 410, 461, 412, + /* 2380 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 328, + /* 2390 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2400 */ 461, 461, 359, 461, 461, 461, 461, 461, 461, 461, + /* 2410 */ 367, 461, 461, 461, 461, 372, 461, 374, 461, 461, + /* 2420 */ 359, 461, 461, 461, 461, 461, 461, 461, 367, 461, + /* 2430 */ 461, 461, 461, 372, 461, 374, 461, 461, 461, 461, + /* 2440 */ 461, 398, 461, 328, 461, 402, 461, 461, 405, 406, + /* 2450 */ 407, 408, 409, 410, 461, 412, 461, 461, 461, 398, + /* 2460 */ 328, 461, 461, 402, 461, 461, 405, 406, 407, 408, + /* 2470 */ 409, 410, 461, 412, 359, 461, 461, 461, 461, 461, + /* 2480 */ 461, 461, 367, 461, 461, 461, 461, 372, 461, 374, + /* 2490 */ 461, 359, 461, 461, 461, 461, 461, 461, 461, 367, + /* 2500 */ 461, 461, 461, 461, 372, 461, 374, 461, 461, 461, + /* 2510 */ 461, 461, 328, 398, 461, 461, 461, 402, 461, 461, + /* 2520 */ 405, 406, 407, 408, 409, 410, 461, 412, 328, 461, + /* 2530 */ 398, 461, 461, 461, 402, 461, 461, 405, 406, 407, + /* 2540 */ 408, 409, 410, 359, 412, 461, 461, 461, 461, 461, + /* 2550 */ 461, 367, 461, 461, 461, 461, 372, 461, 374, 359, + /* 2560 */ 461, 461, 461, 461, 461, 461, 461, 367, 461, 461, + /* 2570 */ 461, 461, 372, 461, 374, 461, 461, 461, 461, 461, + /* 2580 */ 328, 461, 398, 461, 461, 461, 402, 461, 461, 405, + /* 2590 */ 406, 407, 408, 409, 410, 461, 412, 461, 398, 461, + /* 2600 */ 461, 461, 402, 328, 461, 405, 406, 407, 408, 409, + /* 2610 */ 410, 359, 412, 461, 461, 461, 461, 461, 461, 367, + /* 2620 */ 461, 461, 461, 461, 372, 461, 374, 461, 461, 461, + /* 2630 */ 461, 461, 461, 461, 359, 461, 461, 461, 461, 461, + /* 2640 */ 461, 461, 367, 461, 461, 461, 461, 372, 461, 374, + /* 2650 */ 398, 461, 461, 461, 402, 328, 461, 405, 406, 407, + /* 2660 */ 408, 409, 410, 461, 412, 461, 461, 461, 461, 461, + /* 2670 */ 461, 461, 461, 398, 461, 461, 461, 402, 461, 461, + /* 2680 */ 405, 406, 407, 408, 409, 410, 359, 412, 461, 461, + /* 2690 */ 461, 461, 461, 461, 367, 461, 461, 461, 461, 372, + /* 2700 */ 461, 374, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2710 */ 461, 461, 461, 461, 461, 461, 461, 461, 328, 461, + /* 2720 */ 461, 461, 461, 461, 461, 398, 461, 461, 461, 402, + /* 2730 */ 461, 461, 405, 406, 407, 408, 409, 410, 461, 412, + /* 2740 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 359, + /* 2750 */ 461, 461, 461, 461, 461, 461, 461, 367, 461, 461, + /* 2760 */ 461, 461, 372, 461, 374, 461, 461, 461, 461, 461, + /* 2770 */ 328, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 2780 */ 461, 461, 461, 461, 461, 461, 461, 461, 398, 328, + /* 2790 */ 461, 461, 402, 461, 461, 405, 406, 407, 408, 409, + /* 2800 */ 410, 359, 412, 461, 461, 461, 461, 461, 461, 367, + /* 2810 */ 461, 461, 461, 461, 372, 461, 374, 461, 461, 461, + /* 2820 */ 359, 461, 461, 461, 461, 461, 461, 461, 367, 461, + /* 2830 */ 461, 461, 461, 372, 461, 374, 461, 461, 461, 461, + /* 2840 */ 398, 328, 461, 461, 402, 461, 461, 405, 406, 407, + /* 2850 */ 408, 409, 410, 461, 412, 461, 461, 328, 461, 398, + /* 2860 */ 461, 461, 461, 402, 461, 461, 405, 406, 407, 408, + /* 2870 */ 409, 410, 359, 412, 461, 461, 461, 461, 461, 461, + /* 2880 */ 367, 461, 461, 461, 461, 372, 461, 374, 359, 461, + /* 2890 */ 461, 461, 461, 461, 461, 461, 367, 461, 461, 461, + /* 2900 */ 461, 372, 461, 374, 461, 461, 461, 461, 461, 328, + /* 2910 */ 461, 398, 461, 461, 461, 402, 461, 461, 405, 406, + /* 2920 */ 407, 408, 409, 410, 461, 412, 461, 398, 461, 461, + /* 2930 */ 461, 402, 328, 461, 405, 406, 407, 408, 409, 410, + /* 2940 */ 359, 412, 461, 461, 461, 461, 461, 461, 367, 461, + /* 2950 */ 461, 461, 461, 372, 461, 374, 461, 461, 461, 461, + /* 2960 */ 461, 461, 461, 359, 461, 461, 461, 461, 461, 461, + /* 2970 */ 461, 367, 461, 461, 461, 461, 372, 461, 374, 398, + /* 2980 */ 461, 461, 461, 402, 328, 461, 405, 406, 407, 408, + /* 2990 */ 409, 410, 461, 412, 461, 461, 461, 461, 461, 461, + /* 3000 */ 461, 461, 398, 461, 461, 461, 402, 461, 461, 405, + /* 3010 */ 406, 407, 408, 409, 410, 359, 412, 461, 461, 461, + /* 3020 */ 461, 461, 461, 367, 461, 461, 461, 461, 372, 461, + /* 3030 */ 374, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 3040 */ 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, + /* 3050 */ 461, 461, 461, 461, 398, 461, 461, 461, 402, 461, + /* 3060 */ 461, 405, 406, 407, 408, 409, 410, 461, 412, 325, + /* 3070 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3080 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3090 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3100 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3110 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3120 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3130 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3140 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3150 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3160 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3170 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3180 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3190 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3200 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3210 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3220 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3230 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3240 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3250 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3260 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3270 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3280 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3290 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3300 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3310 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3320 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3330 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3340 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3350 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3360 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3370 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3380 */ 325, 325, 325, 325, 325, 325, 325, 325, 325, 325, + /* 3390 */ 325, 325, 325, 325, }; #define YY_SHIFT_COUNT (713) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2019) +#define YY_SHIFT_MAX (1975) static const unsigned short int yy_shift_ofst[] = { - /* 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, + /* 0 */ 862, 0, 71, 0, 289, 289, 289, 289, 289, 289, + /* 10 */ 289, 289, 289, 289, 289, 360, 576, 576, 647, 576, + /* 20 */ 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, + /* 30 */ 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, + /* 40 */ 576, 576, 576, 576, 576, 576, 576, 576, 32, 134, + /* 50 */ 21, 590, 133, 7, 104, 7, 21, 21, 1216, 1216, + /* 60 */ 7, 1216, 1216, 136, 7, 423, 25, 25, 423, 401, + /* 70 */ 401, 215, 57, 5, 5, 25, 25, 25, 25, 25, + /* 80 */ 25, 25, 25, 25, 25, 80, 25, 25, 156, 25, + /* 90 */ 25, 25, 343, 25, 25, 343, 25, 343, 343, 343, + /* 100 */ 25, 328, 792, 34, 34, 216, 474, 283, 283, 283, + /* 110 */ 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + /* 120 */ 283, 283, 283, 283, 283, 283, 1073, 87, 215, 57, + /* 130 */ 593, 313, 499, 499, 499, 710, 229, 229, 313, 374, + /* 140 */ 374, 374, 143, 384, 343, 378, 343, 378, 378, 143, + /* 150 */ 566, 217, 217, 217, 217, 217, 217, 217, 1351, 408, + /* 160 */ 336, 612, 249, 430, 340, 464, 292, 714, 377, 518, + /* 170 */ 873, 656, 858, 748, 12, 754, 748, 769, 353, 836, + /* 180 */ 977, 1192, 1055, 1202, 1226, 1202, 1094, 1236, 1236, 1202, + /* 190 */ 1094, 1094, 1180, 1236, 1236, 1236, 1265, 1265, 1270, 80, + /* 200 */ 1278, 80, 1280, 1283, 80, 1280, 80, 80, 80, 1236, + /* 210 */ 80, 1260, 1260, 1265, 343, 343, 343, 343, 343, 343, + /* 220 */ 343, 343, 343, 343, 343, 1236, 1265, 378, 378, 1129, + /* 230 */ 1270, 328, 1177, 1278, 328, 1236, 1226, 1226, 378, 1117, + /* 240 */ 1124, 378, 1117, 1124, 378, 378, 343, 1122, 1213, 1117, + /* 250 */ 1130, 1132, 1148, 977, 1127, 1134, 1137, 1159, 374, 1398, + /* 260 */ 1236, 1280, 328, 1124, 378, 378, 378, 378, 378, 1124, + /* 270 */ 378, 1262, 328, 143, 328, 374, 1361, 1366, 378, 566, + /* 280 */ 1236, 328, 1437, 1265, 3069, 3069, 3069, 3069, 3069, 3069, + /* 290 */ 3069, 3069, 3069, 887, 310, 94, 625, 15, 59, 738, + /* 300 */ 720, 753, 881, 73, 781, 472, 472, 472, 472, 472, + /* 310 */ 472, 472, 472, 472, 875, 124, 373, 373, 122, 4, + /* 320 */ 58, 166, 484, 300, 300, 790, 912, 588, 790, 790, + /* 330 */ 790, 113, 1057, 288, 969, 913, 884, 918, 923, 986, + /* 340 */ 988, 1093, 1101, 1106, 1005, 1042, 1090, 1011, 425, 945, + /* 350 */ 863, 1096, 1103, 1115, 1116, 1120, 1187, 1131, 1010, 1041, + /* 360 */ 1046, 1140, 1074, 1141, 1147, 1151, 1176, 1179, 1195, 825, + /* 370 */ 1142, 1166, 489, 1181, 1482, 1487, 1300, 1490, 1493, 1452, + /* 380 */ 1495, 1461, 1296, 1463, 1464, 1465, 1302, 1501, 1469, 1470, + /* 390 */ 1306, 1508, 1314, 1518, 1484, 1522, 1502, 1529, 1491, 1347, + /* 400 */ 1352, 1533, 1535, 1358, 1363, 1538, 1541, 1496, 1542, 1544, + /* 410 */ 1545, 1504, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, + /* 420 */ 1406, 1523, 1559, 1410, 1562, 1569, 1571, 1572, 1573, 1574, + /* 430 */ 1576, 1579, 1580, 1583, 1584, 1585, 1587, 1588, 1589, 1556, + /* 440 */ 1590, 1592, 1599, 1600, 1601, 1575, 1602, 1603, 1604, 1459, + /* 450 */ 1595, 1596, 1577, 1606, 1557, 1607, 1558, 1608, 1609, 1568, + /* 460 */ 1581, 1567, 1566, 1605, 1586, 1616, 1593, 1614, 1582, 1598, + /* 470 */ 1618, 1623, 1632, 1611, 1462, 1634, 1639, 1641, 1591, 1645, + /* 480 */ 1646, 1612, 1610, 1613, 1648, 1619, 1615, 1617, 1653, 1622, + /* 490 */ 1620, 1621, 1661, 1627, 1624, 1625, 1665, 1666, 1667, 1669, + /* 500 */ 1570, 1597, 1635, 1649, 1673, 1642, 1643, 1656, 1657, 1636, + /* 510 */ 1637, 1658, 1659, 1654, 1660, 1697, 1680, 1704, 1684, 1662, + /* 520 */ 1707, 1686, 1674, 1710, 1676, 1713, 1679, 1715, 1694, 1698, + /* 530 */ 1682, 1685, 1527, 1626, 1628, 1724, 1563, 1690, 1728, 1546, + /* 540 */ 1708, 1630, 1629, 1735, 1742, 1633, 1631, 1741, 1703, 1499, + /* 550 */ 1650, 1655, 1664, 1638, 1521, 1640, 1500, 1668, 1712, 1687, + /* 560 */ 1681, 1689, 1691, 1692, 1716, 1705, 1714, 1696, 1719, 1530, + /* 570 */ 1693, 1699, 1754, 1731, 1531, 1743, 1746, 1747, 1752, 1762, + /* 580 */ 1763, 1709, 1711, 1756, 1561, 1757, 1759, 1799, 1809, 1811, + /* 590 */ 1717, 1718, 1721, 1720, 1723, 1647, 1726, 1819, 1783, 1670, + /* 600 */ 1734, 1727, 1566, 1786, 1791, 1644, 1671, 1675, 1834, 1815, + /* 610 */ 1651, 1745, 1749, 1748, 1751, 1753, 1760, 1794, 1758, 1764, + /* 620 */ 1795, 1761, 1816, 1652, 1765, 1744, 1766, 1814, 1817, 1768, + /* 630 */ 1769, 1820, 1771, 1773, 1829, 1776, 1777, 1832, 1788, 1790, + /* 640 */ 1833, 1792, 1732, 1770, 1775, 1778, 1866, 1785, 1800, 1846, + /* 650 */ 1804, 1867, 1810, 1846, 1846, 1882, 1843, 1845, 1874, 1875, + /* 660 */ 1876, 1877, 1878, 1879, 1880, 1881, 1883, 1884, 1847, 1828, + /* 670 */ 1885, 1886, 1888, 1890, 1904, 1895, 1905, 1906, 1857, 1636, + /* 680 */ 1907, 1637, 1908, 1909, 1911, 1912, 1917, 1913, 1949, 1916, + /* 690 */ 1910, 1915, 1955, 1921, 1914, 1918, 1959, 1925, 1919, 1924, + /* 700 */ 1964, 1930, 1922, 1932, 1969, 1937, 1939, 1975, 1956, 1958, + /* 710 */ 1960, 1971, 1968, 1957, }; #define YY_REDUCE_COUNT (292) -#define YY_REDUCE_MIN (-381) -#define YY_REDUCE_MAX (2557) +#define YY_REDUCE_MIN (-420) +#define YY_REDUCE_MAX (2656) static const short yy_reduce_ofst[] = { - /* 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, + /* 0 */ 276, -259, 233, 672, 744, 798, 859, 922, 942, 1045, + /* 10 */ 1104, 1158, 1219, 1277, 1331, 1360, 294, 1418, 1472, 1526, + /* 20 */ 1578, 1594, 1683, 1701, 1755, 1772, 1824, 1840, 1892, 1946, + /* 30 */ 1967, 2043, 2061, 2115, 2132, 2184, 2200, 2252, 2275, 2327, + /* 40 */ 2390, 2442, 2461, 2513, 2529, 2581, 2604, 2656, -258, 95, + /* 50 */ 105, -39, 559, 597, 599, 669, 187, 704, -346, -57, + /* 60 */ -391, 323, 480, -276, -250, 75, -222, 297, -371, -330, + /* 70 */ -326, -327, -363, -299, -257, 116, 128, 193, 199, 327, + /* 80 */ 409, 471, 645, 649, 657, 252, 693, 706, -51, 725, + /* 90 */ 747, 762, 244, 763, 772, -203, 791, 465, -5, 362, + /* 100 */ 847, -210, -315, -420, -420, -217, -212, -69, -21, 41, + /* 110 */ 43, 70, 96, 117, 148, 197, 225, 234, 346, 351, + /* 120 */ 405, 446, 454, 504, 651, 655, -266, -170, 397, 191, + /* 130 */ 152, 352, -170, -150, 219, 477, 186, 254, 491, 524, + /* 140 */ 537, 538, -316, -319, 485, 367, 542, 555, 557, 632, + /* 150 */ 530, -342, 369, 389, 410, 463, 468, 483, 319, 577, + /* 160 */ 650, 543, 521, 603, 756, 695, 786, 786, 810, 780, + /* 170 */ 831, 811, 808, 760, 760, 746, 760, 784, 783, 786, + /* 180 */ 834, 842, 851, 866, 870, 869, 878, 924, 926, 879, + /* 190 */ 882, 886, 933, 943, 944, 948, 957, 958, 897, 953, + /* 200 */ 925, 955, 965, 914, 963, 970, 964, 966, 968, 975, + /* 210 */ 971, 976, 978, 989, 959, 962, 967, 979, 983, 984, + /* 220 */ 994, 996, 998, 999, 1001, 987, 992, 990, 991, 938, + /* 230 */ 941, 997, 973, 995, 1028, 1035, 993, 1000, 1002, 936, + /* 240 */ 1003, 1007, 939, 1004, 1009, 1013, 786, 946, 949, 950, + /* 250 */ 947, 956, 972, 1014, 951, 961, 960, 760, 1049, 1016, + /* 260 */ 1085, 1088, 1082, 1043, 1054, 1058, 1059, 1061, 1062, 1044, + /* 270 */ 1063, 1066, 1118, 1089, 1119, 1079, 1038, 1102, 1095, 1121, + /* 280 */ 1136, 1126, 1143, 1145, 1087, 1081, 1097, 1098, 1135, 1138, + /* 290 */ 1139, 1144, 1154, }; static const YYACTIONTYPE yy_default[] = { - /* 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, + /* 0 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 10 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 20 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 30 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 40 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 50 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 60 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 70 */ 1606, 1861, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 80 */ 1606, 1606, 1606, 1606, 1606, 1684, 1606, 1606, 1606, 1606, + /* 90 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 100 */ 1606, 1682, 1854, 2057, 1606, 1606, 1606, 1606, 1606, 1606, + /* 110 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 120 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 2069, 1606, 1606, + /* 130 */ 1684, 1606, 2069, 2069, 2069, 1682, 2029, 2029, 1606, 1606, + /* 140 */ 1606, 1606, 1791, 1606, 1606, 1606, 1606, 1606, 1606, 1791, + /* 150 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1903, 1606, + /* 160 */ 1606, 2094, 2148, 1606, 1606, 2097, 1606, 1606, 1606, 1866, + /* 170 */ 1606, 1744, 2084, 2061, 2075, 2132, 2062, 2059, 2078, 1606, + /* 180 */ 2088, 1606, 1896, 1859, 1606, 1859, 1856, 1606, 1606, 1859, + /* 190 */ 1856, 1856, 1735, 1606, 1606, 1606, 1606, 1606, 1606, 1684, + /* 200 */ 1606, 1684, 1606, 1606, 1684, 1606, 1684, 1684, 1684, 1606, + /* 210 */ 1684, 1663, 1663, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 220 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1916, + /* 230 */ 1606, 1682, 1905, 1606, 1682, 1606, 1606, 1606, 1606, 2105, + /* 240 */ 2103, 1606, 2105, 2103, 1606, 1606, 1606, 2117, 2113, 2105, + /* 250 */ 2121, 2119, 2090, 2088, 2151, 2138, 2134, 2075, 1606, 1606, + /* 260 */ 1606, 1606, 1682, 2103, 1606, 1606, 1606, 1606, 1606, 2103, + /* 270 */ 1606, 1606, 1682, 1606, 1682, 1606, 1606, 1760, 1606, 1606, + /* 280 */ 1606, 1682, 1638, 1606, 1898, 1909, 1881, 1881, 1794, 1794, + /* 290 */ 1794, 1685, 1611, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 300 */ 1606, 1606, 1606, 1606, 1606, 2116, 2115, 1984, 1606, 2033, + /* 310 */ 2032, 2031, 2022, 1983, 1756, 1606, 1982, 1981, 1606, 1606, + /* 320 */ 1606, 1606, 1606, 1872, 1871, 1975, 1606, 1606, 1976, 1974, + /* 330 */ 1973, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 340 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 2135, 2139, + /* 350 */ 1606, 1606, 1606, 1606, 1606, 1606, 2058, 1606, 1606, 1606, + /* 360 */ 1606, 1606, 1958, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 370 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 380 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 390 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 400 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 410 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 420 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 430 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 440 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 450 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 460 */ 1606, 1643, 1963, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 470 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 480 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 490 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 500 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1723, + /* 510 */ 1722, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 520 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 530 */ 1606, 1606, 1606, 1966, 1606, 1606, 1606, 1606, 1606, 1606, + /* 540 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 2131, 2091, 1606, + /* 550 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 560 */ 1606, 1606, 1606, 1606, 1606, 1606, 1958, 1606, 2114, 1606, + /* 570 */ 1606, 2129, 1606, 2133, 1606, 1606, 1606, 1606, 1606, 1606, + /* 580 */ 1606, 2068, 2064, 1606, 1606, 2060, 1606, 1606, 1606, 1606, + /* 590 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 600 */ 1606, 1606, 1957, 1606, 2019, 1606, 1606, 1606, 2053, 1606, + /* 610 */ 1606, 2004, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 620 */ 1606, 1966, 1606, 1969, 1606, 1606, 1606, 1606, 1606, 1788, + /* 630 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 640 */ 1606, 1606, 1773, 1771, 1770, 1769, 1606, 1766, 1606, 1801, + /* 650 */ 1606, 1606, 1606, 1797, 1796, 1606, 1606, 1606, 1606, 1606, + /* 660 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 670 */ 1703, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1695, + /* 680 */ 1606, 1694, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 690 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 700 */ 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + /* 710 */ 1606, 1606, 1606, 1606, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1186,6 +1240,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* INDEX => nothing */ 0, /* FUNCTION => nothing */ 0, /* INTERVAL => nothing */ + 0, /* COUNT => nothing */ + 0, /* LAST_ROW => nothing */ 0, /* TOPIC => nothing */ 0, /* WITH => nothing */ 0, /* META => nothing */ @@ -1235,6 +1291,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* WEND => nothing */ 0, /* WDURATION => nothing */ 0, /* IROWTS => nothing */ + 0, /* ISFILLED => nothing */ 0, /* CAST => nothing */ 0, /* NOW => nothing */ 0, /* TODAY => nothing */ @@ -1243,10 +1300,8 @@ static const YYCODETYPE yyFallback[] = { 0, /* SERVER_VERSION => nothing */ 0, /* SERVER_STATUS => nothing */ 0, /* CURRENT_USER => nothing */ - 0, /* COUNT => nothing */ - 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 270, /* END => ABORT */ + 271, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1290,59 +1345,59 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 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 */ + 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, /* STRICT => ABORT */ + 271, /* STRING => ABORT */ + 271, /* TIMES => ABORT */ + 271, /* UPDATE => ABORT */ + 271, /* VALUES => ABORT */ + 271, /* VARIABLE => ABORT */ + 271, /* VIEW => ABORT */ + 271, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1597,298 +1652,300 @@ static const char *const yyTokenName[] = { /* 164 */ "INDEX", /* 165 */ "FUNCTION", /* 166 */ "INTERVAL", - /* 167 */ "TOPIC", - /* 168 */ "WITH", - /* 169 */ "META", - /* 170 */ "CONSUMER", - /* 171 */ "GROUP", - /* 172 */ "DESC", - /* 173 */ "DESCRIBE", - /* 174 */ "RESET", - /* 175 */ "QUERY", - /* 176 */ "CACHE", - /* 177 */ "EXPLAIN", - /* 178 */ "ANALYZE", - /* 179 */ "VERBOSE", - /* 180 */ "NK_BOOL", - /* 181 */ "RATIO", - /* 182 */ "NK_FLOAT", - /* 183 */ "OUTPUTTYPE", - /* 184 */ "AGGREGATE", - /* 185 */ "BUFSIZE", - /* 186 */ "STREAM", - /* 187 */ "INTO", - /* 188 */ "TRIGGER", - /* 189 */ "AT_ONCE", - /* 190 */ "WINDOW_CLOSE", - /* 191 */ "IGNORE", - /* 192 */ "EXPIRED", - /* 193 */ "FILL_HISTORY", - /* 194 */ "SUBTABLE", - /* 195 */ "KILL", - /* 196 */ "CONNECTION", - /* 197 */ "TRANSACTION", - /* 198 */ "BALANCE", - /* 199 */ "VGROUP", - /* 200 */ "MERGE", - /* 201 */ "REDISTRIBUTE", - /* 202 */ "SPLIT", - /* 203 */ "DELETE", - /* 204 */ "INSERT", - /* 205 */ "NULL", - /* 206 */ "NK_QUESTION", - /* 207 */ "NK_ARROW", - /* 208 */ "ROWTS", - /* 209 */ "QSTART", - /* 210 */ "QEND", - /* 211 */ "QDURATION", - /* 212 */ "WSTART", - /* 213 */ "WEND", - /* 214 */ "WDURATION", - /* 215 */ "IROWTS", - /* 216 */ "CAST", - /* 217 */ "NOW", - /* 218 */ "TODAY", - /* 219 */ "TIMEZONE", - /* 220 */ "CLIENT_VERSION", - /* 221 */ "SERVER_VERSION", - /* 222 */ "SERVER_STATUS", - /* 223 */ "CURRENT_USER", - /* 224 */ "COUNT", - /* 225 */ "LAST_ROW", - /* 226 */ "CASE", - /* 227 */ "END", - /* 228 */ "WHEN", - /* 229 */ "THEN", - /* 230 */ "ELSE", - /* 231 */ "BETWEEN", - /* 232 */ "IS", - /* 233 */ "NK_LT", - /* 234 */ "NK_GT", - /* 235 */ "NK_LE", - /* 236 */ "NK_GE", - /* 237 */ "NK_NE", - /* 238 */ "MATCH", - /* 239 */ "NMATCH", - /* 240 */ "CONTAINS", - /* 241 */ "IN", - /* 242 */ "JOIN", - /* 243 */ "INNER", - /* 244 */ "SELECT", - /* 245 */ "DISTINCT", - /* 246 */ "WHERE", - /* 247 */ "PARTITION", - /* 248 */ "BY", - /* 249 */ "SESSION", - /* 250 */ "STATE_WINDOW", - /* 251 */ "EVENT_WINDOW", - /* 252 */ "START", - /* 253 */ "SLIDING", - /* 254 */ "FILL", - /* 255 */ "VALUE", - /* 256 */ "NONE", - /* 257 */ "PREV", - /* 258 */ "LINEAR", - /* 259 */ "NEXT", - /* 260 */ "HAVING", - /* 261 */ "RANGE", - /* 262 */ "EVERY", - /* 263 */ "ORDER", - /* 264 */ "SLIMIT", - /* 265 */ "SOFFSET", - /* 266 */ "LIMIT", - /* 267 */ "OFFSET", - /* 268 */ "ASC", - /* 269 */ "NULLS", - /* 270 */ "ABORT", - /* 271 */ "AFTER", - /* 272 */ "ATTACH", - /* 273 */ "BEFORE", - /* 274 */ "BEGIN", - /* 275 */ "BITAND", - /* 276 */ "BITNOT", - /* 277 */ "BITOR", - /* 278 */ "BLOCKS", - /* 279 */ "CHANGE", - /* 280 */ "COMMA", - /* 281 */ "COMPACT", - /* 282 */ "CONCAT", - /* 283 */ "CONFLICT", - /* 284 */ "COPY", - /* 285 */ "DEFERRED", - /* 286 */ "DELIMITERS", - /* 287 */ "DETACH", - /* 288 */ "DIVIDE", - /* 289 */ "DOT", - /* 290 */ "EACH", - /* 291 */ "FAIL", - /* 292 */ "FILE", - /* 293 */ "FOR", - /* 294 */ "GLOB", - /* 295 */ "ID", - /* 296 */ "IMMEDIATE", - /* 297 */ "IMPORT", - /* 298 */ "INITIALLY", - /* 299 */ "INSTEAD", - /* 300 */ "ISNULL", - /* 301 */ "KEY", - /* 302 */ "MODULES", - /* 303 */ "NK_BITNOT", - /* 304 */ "NK_SEMI", - /* 305 */ "NOTNULL", - /* 306 */ "OF", - /* 307 */ "PLUS", - /* 308 */ "PRIVILEGE", - /* 309 */ "RAISE", - /* 310 */ "REPLACE", - /* 311 */ "RESTRICT", - /* 312 */ "ROW", - /* 313 */ "SEMI", - /* 314 */ "STAR", - /* 315 */ "STATEMENT", - /* 316 */ "STRICT", - /* 317 */ "STRING", - /* 318 */ "TIMES", - /* 319 */ "UPDATE", - /* 320 */ "VALUES", - /* 321 */ "VARIABLE", - /* 322 */ "VIEW", - /* 323 */ "WAL", - /* 324 */ "cmd", - /* 325 */ "account_options", - /* 326 */ "alter_account_options", - /* 327 */ "literal", - /* 328 */ "alter_account_option", - /* 329 */ "user_name", - /* 330 */ "sysinfo_opt", - /* 331 */ "privileges", - /* 332 */ "priv_level", - /* 333 */ "priv_type_list", - /* 334 */ "priv_type", - /* 335 */ "db_name", - /* 336 */ "topic_name", - /* 337 */ "dnode_endpoint", - /* 338 */ "force_opt", - /* 339 */ "not_exists_opt", - /* 340 */ "db_options", - /* 341 */ "exists_opt", - /* 342 */ "alter_db_options", - /* 343 */ "speed_opt", - /* 344 */ "integer_list", - /* 345 */ "variable_list", - /* 346 */ "retention_list", - /* 347 */ "alter_db_option", - /* 348 */ "retention", - /* 349 */ "full_table_name", - /* 350 */ "column_def_list", - /* 351 */ "tags_def_opt", - /* 352 */ "table_options", - /* 353 */ "multi_create_clause", - /* 354 */ "tags_def", - /* 355 */ "multi_drop_clause", - /* 356 */ "alter_table_clause", - /* 357 */ "alter_table_options", - /* 358 */ "column_name", - /* 359 */ "type_name", - /* 360 */ "signed_literal", - /* 361 */ "create_subtable_clause", - /* 362 */ "specific_cols_opt", - /* 363 */ "expression_list", - /* 364 */ "drop_table_clause", - /* 365 */ "col_name_list", - /* 366 */ "table_name", - /* 367 */ "column_def", - /* 368 */ "duration_list", - /* 369 */ "rollup_func_list", - /* 370 */ "alter_table_option", - /* 371 */ "duration_literal", - /* 372 */ "rollup_func_name", - /* 373 */ "function_name", - /* 374 */ "col_name", - /* 375 */ "db_name_cond_opt", - /* 376 */ "like_pattern_opt", - /* 377 */ "table_name_cond", - /* 378 */ "from_db_opt", - /* 379 */ "tag_list_opt", - /* 380 */ "tag_item", - /* 381 */ "column_alias", - /* 382 */ "index_options", - /* 383 */ "func_list", - /* 384 */ "sliding_opt", - /* 385 */ "sma_stream_opt", - /* 386 */ "func", - /* 387 */ "query_or_subquery", - /* 388 */ "cgroup_name", - /* 389 */ "analyze_opt", - /* 390 */ "explain_options", - /* 391 */ "agg_func_opt", - /* 392 */ "bufsize_opt", - /* 393 */ "stream_name", - /* 394 */ "stream_options", - /* 395 */ "subtable_opt", - /* 396 */ "expression", - /* 397 */ "dnode_list", - /* 398 */ "where_clause_opt", - /* 399 */ "signed", - /* 400 */ "literal_func", - /* 401 */ "literal_list", - /* 402 */ "table_alias", - /* 403 */ "expr_or_subquery", - /* 404 */ "pseudo_column", - /* 405 */ "column_reference", - /* 406 */ "function_expression", - /* 407 */ "case_when_expression", - /* 408 */ "star_func", - /* 409 */ "star_func_para_list", - /* 410 */ "noarg_func", - /* 411 */ "other_para_list", - /* 412 */ "star_func_para", - /* 413 */ "when_then_list", - /* 414 */ "case_when_else_opt", - /* 415 */ "common_expression", - /* 416 */ "when_then_expr", - /* 417 */ "predicate", - /* 418 */ "compare_op", - /* 419 */ "in_op", - /* 420 */ "in_predicate_value", - /* 421 */ "boolean_value_expression", - /* 422 */ "boolean_primary", - /* 423 */ "from_clause_opt", - /* 424 */ "table_reference_list", - /* 425 */ "table_reference", - /* 426 */ "table_primary", - /* 427 */ "joined_table", - /* 428 */ "alias_opt", - /* 429 */ "subquery", - /* 430 */ "parenthesized_joined_table", - /* 431 */ "join_type", - /* 432 */ "search_condition", - /* 433 */ "query_specification", - /* 434 */ "set_quantifier_opt", - /* 435 */ "select_list", - /* 436 */ "partition_by_clause_opt", - /* 437 */ "range_opt", - /* 438 */ "every_opt", - /* 439 */ "fill_opt", - /* 440 */ "twindow_clause_opt", - /* 441 */ "group_by_clause_opt", - /* 442 */ "having_clause_opt", - /* 443 */ "select_item", - /* 444 */ "partition_list", - /* 445 */ "partition_item", - /* 446 */ "fill_mode", - /* 447 */ "group_by_list", - /* 448 */ "query_expression", - /* 449 */ "query_simple", - /* 450 */ "order_by_clause_opt", - /* 451 */ "slimit_clause_opt", - /* 452 */ "limit_clause_opt", - /* 453 */ "union_query_expression", - /* 454 */ "query_simple_or_subquery", - /* 455 */ "sort_specification_list", - /* 456 */ "sort_specification", - /* 457 */ "ordering_specification_opt", - /* 458 */ "null_ordering_opt", + /* 167 */ "COUNT", + /* 168 */ "LAST_ROW", + /* 169 */ "TOPIC", + /* 170 */ "WITH", + /* 171 */ "META", + /* 172 */ "CONSUMER", + /* 173 */ "GROUP", + /* 174 */ "DESC", + /* 175 */ "DESCRIBE", + /* 176 */ "RESET", + /* 177 */ "QUERY", + /* 178 */ "CACHE", + /* 179 */ "EXPLAIN", + /* 180 */ "ANALYZE", + /* 181 */ "VERBOSE", + /* 182 */ "NK_BOOL", + /* 183 */ "RATIO", + /* 184 */ "NK_FLOAT", + /* 185 */ "OUTPUTTYPE", + /* 186 */ "AGGREGATE", + /* 187 */ "BUFSIZE", + /* 188 */ "STREAM", + /* 189 */ "INTO", + /* 190 */ "TRIGGER", + /* 191 */ "AT_ONCE", + /* 192 */ "WINDOW_CLOSE", + /* 193 */ "IGNORE", + /* 194 */ "EXPIRED", + /* 195 */ "FILL_HISTORY", + /* 196 */ "SUBTABLE", + /* 197 */ "KILL", + /* 198 */ "CONNECTION", + /* 199 */ "TRANSACTION", + /* 200 */ "BALANCE", + /* 201 */ "VGROUP", + /* 202 */ "MERGE", + /* 203 */ "REDISTRIBUTE", + /* 204 */ "SPLIT", + /* 205 */ "DELETE", + /* 206 */ "INSERT", + /* 207 */ "NULL", + /* 208 */ "NK_QUESTION", + /* 209 */ "NK_ARROW", + /* 210 */ "ROWTS", + /* 211 */ "QSTART", + /* 212 */ "QEND", + /* 213 */ "QDURATION", + /* 214 */ "WSTART", + /* 215 */ "WEND", + /* 216 */ "WDURATION", + /* 217 */ "IROWTS", + /* 218 */ "ISFILLED", + /* 219 */ "CAST", + /* 220 */ "NOW", + /* 221 */ "TODAY", + /* 222 */ "TIMEZONE", + /* 223 */ "CLIENT_VERSION", + /* 224 */ "SERVER_VERSION", + /* 225 */ "SERVER_STATUS", + /* 226 */ "CURRENT_USER", + /* 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", + /* 317 */ "STRICT", + /* 318 */ "STRING", + /* 319 */ "TIMES", + /* 320 */ "UPDATE", + /* 321 */ "VALUES", + /* 322 */ "VARIABLE", + /* 323 */ "VIEW", + /* 324 */ "WAL", + /* 325 */ "cmd", + /* 326 */ "account_options", + /* 327 */ "alter_account_options", + /* 328 */ "literal", + /* 329 */ "alter_account_option", + /* 330 */ "user_name", + /* 331 */ "sysinfo_opt", + /* 332 */ "privileges", + /* 333 */ "priv_level", + /* 334 */ "priv_type_list", + /* 335 */ "priv_type", + /* 336 */ "db_name", + /* 337 */ "topic_name", + /* 338 */ "dnode_endpoint", + /* 339 */ "force_opt", + /* 340 */ "not_exists_opt", + /* 341 */ "db_options", + /* 342 */ "exists_opt", + /* 343 */ "alter_db_options", + /* 344 */ "speed_opt", + /* 345 */ "integer_list", + /* 346 */ "variable_list", + /* 347 */ "retention_list", + /* 348 */ "alter_db_option", + /* 349 */ "retention", + /* 350 */ "full_table_name", + /* 351 */ "column_def_list", + /* 352 */ "tags_def_opt", + /* 353 */ "table_options", + /* 354 */ "multi_create_clause", + /* 355 */ "tags_def", + /* 356 */ "multi_drop_clause", + /* 357 */ "alter_table_clause", + /* 358 */ "alter_table_options", + /* 359 */ "column_name", + /* 360 */ "type_name", + /* 361 */ "signed_literal", + /* 362 */ "create_subtable_clause", + /* 363 */ "specific_cols_opt", + /* 364 */ "expression_list", + /* 365 */ "drop_table_clause", + /* 366 */ "col_name_list", + /* 367 */ "table_name", + /* 368 */ "column_def", + /* 369 */ "duration_list", + /* 370 */ "rollup_func_list", + /* 371 */ "alter_table_option", + /* 372 */ "duration_literal", + /* 373 */ "rollup_func_name", + /* 374 */ "function_name", + /* 375 */ "col_name", + /* 376 */ "db_name_cond_opt", + /* 377 */ "like_pattern_opt", + /* 378 */ "table_name_cond", + /* 379 */ "from_db_opt", + /* 380 */ "tag_list_opt", + /* 381 */ "tag_item", + /* 382 */ "column_alias", + /* 383 */ "index_options", + /* 384 */ "func_list", + /* 385 */ "sliding_opt", + /* 386 */ "sma_stream_opt", + /* 387 */ "func", + /* 388 */ "sma_func_name", + /* 389 */ "query_or_subquery", + /* 390 */ "cgroup_name", + /* 391 */ "analyze_opt", + /* 392 */ "explain_options", + /* 393 */ "agg_func_opt", + /* 394 */ "bufsize_opt", + /* 395 */ "stream_name", + /* 396 */ "stream_options", + /* 397 */ "subtable_opt", + /* 398 */ "expression", + /* 399 */ "dnode_list", + /* 400 */ "where_clause_opt", + /* 401 */ "signed", + /* 402 */ "literal_func", + /* 403 */ "literal_list", + /* 404 */ "table_alias", + /* 405 */ "expr_or_subquery", + /* 406 */ "pseudo_column", + /* 407 */ "column_reference", + /* 408 */ "function_expression", + /* 409 */ "case_when_expression", + /* 410 */ "star_func", + /* 411 */ "star_func_para_list", + /* 412 */ "noarg_func", + /* 413 */ "other_para_list", + /* 414 */ "star_func_para", + /* 415 */ "when_then_list", + /* 416 */ "case_when_else_opt", + /* 417 */ "common_expression", + /* 418 */ "when_then_expr", + /* 419 */ "predicate", + /* 420 */ "compare_op", + /* 421 */ "in_op", + /* 422 */ "in_predicate_value", + /* 423 */ "boolean_value_expression", + /* 424 */ "boolean_primary", + /* 425 */ "from_clause_opt", + /* 426 */ "table_reference_list", + /* 427 */ "table_reference", + /* 428 */ "table_primary", + /* 429 */ "joined_table", + /* 430 */ "alias_opt", + /* 431 */ "subquery", + /* 432 */ "parenthesized_joined_table", + /* 433 */ "join_type", + /* 434 */ "search_condition", + /* 435 */ "query_specification", + /* 436 */ "set_quantifier_opt", + /* 437 */ "select_list", + /* 438 */ "partition_by_clause_opt", + /* 439 */ "range_opt", + /* 440 */ "every_opt", + /* 441 */ "fill_opt", + /* 442 */ "twindow_clause_opt", + /* 443 */ "group_by_clause_opt", + /* 444 */ "having_clause_opt", + /* 445 */ "select_item", + /* 446 */ "partition_list", + /* 447 */ "partition_item", + /* 448 */ "fill_mode", + /* 449 */ "group_by_list", + /* 450 */ "query_expression", + /* 451 */ "query_simple", + /* 452 */ "order_by_clause_opt", + /* 453 */ "slimit_clause_opt", + /* 454 */ "limit_clause_opt", + /* 455 */ "union_query_expression", + /* 456 */ "query_simple_or_subquery", + /* 457 */ "sort_specification_list", + /* 458 */ "sort_specification", + /* 459 */ "ordering_specification_opt", + /* 460 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2162,279 +2219,285 @@ static const char *const yyRuleName[] = { /* 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", + /* 266 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 267 */ "sma_func_name ::= function_name", + /* 268 */ "sma_func_name ::= COUNT", + /* 269 */ "sma_func_name ::= FIRST", + /* 270 */ "sma_func_name ::= LAST", + /* 271 */ "sma_func_name ::= LAST_ROW", + /* 272 */ "sma_stream_opt ::=", + /* 273 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 274 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 275 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 278 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 279 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 280 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 281 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 282 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 283 */ "cmd ::= DESC full_table_name", + /* 284 */ "cmd ::= DESCRIBE full_table_name", + /* 285 */ "cmd ::= RESET QUERY CACHE", + /* 286 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 287 */ "analyze_opt ::=", + /* 288 */ "analyze_opt ::= ANALYZE", + /* 289 */ "explain_options ::=", + /* 290 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 291 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 292 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 293 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 294 */ "agg_func_opt ::=", + /* 295 */ "agg_func_opt ::= AGGREGATE", + /* 296 */ "bufsize_opt ::=", + /* 297 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 298 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 299 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 300 */ "stream_options ::=", + /* 301 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 302 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 303 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 304 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 305 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 306 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 307 */ "subtable_opt ::=", + /* 308 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 309 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 310 */ "cmd ::= KILL QUERY NK_STRING", + /* 311 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 312 */ "cmd ::= BALANCE VGROUP", + /* 313 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 314 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 315 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 316 */ "dnode_list ::= DNODE NK_INTEGER", + /* 317 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 318 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 319 */ "cmd ::= query_or_subquery", + /* 320 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 321 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 322 */ "literal ::= NK_INTEGER", + /* 323 */ "literal ::= NK_FLOAT", + /* 324 */ "literal ::= NK_STRING", + /* 325 */ "literal ::= NK_BOOL", + /* 326 */ "literal ::= TIMESTAMP NK_STRING", + /* 327 */ "literal ::= duration_literal", + /* 328 */ "literal ::= NULL", + /* 329 */ "literal ::= NK_QUESTION", + /* 330 */ "duration_literal ::= NK_VARIABLE", + /* 331 */ "signed ::= NK_INTEGER", + /* 332 */ "signed ::= NK_PLUS NK_INTEGER", + /* 333 */ "signed ::= NK_MINUS NK_INTEGER", + /* 334 */ "signed ::= NK_FLOAT", + /* 335 */ "signed ::= NK_PLUS NK_FLOAT", + /* 336 */ "signed ::= NK_MINUS NK_FLOAT", + /* 337 */ "signed_literal ::= signed", + /* 338 */ "signed_literal ::= NK_STRING", + /* 339 */ "signed_literal ::= NK_BOOL", + /* 340 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 341 */ "signed_literal ::= duration_literal", + /* 342 */ "signed_literal ::= NULL", + /* 343 */ "signed_literal ::= literal_func", + /* 344 */ "signed_literal ::= NK_QUESTION", + /* 345 */ "literal_list ::= signed_literal", + /* 346 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 347 */ "db_name ::= NK_ID", + /* 348 */ "table_name ::= NK_ID", + /* 349 */ "column_name ::= NK_ID", + /* 350 */ "function_name ::= NK_ID", + /* 351 */ "table_alias ::= NK_ID", + /* 352 */ "column_alias ::= NK_ID", + /* 353 */ "user_name ::= NK_ID", + /* 354 */ "topic_name ::= NK_ID", + /* 355 */ "stream_name ::= NK_ID", + /* 356 */ "cgroup_name ::= NK_ID", + /* 357 */ "expr_or_subquery ::= expression", + /* 358 */ "expression ::= literal", + /* 359 */ "expression ::= pseudo_column", + /* 360 */ "expression ::= column_reference", + /* 361 */ "expression ::= function_expression", + /* 362 */ "expression ::= case_when_expression", + /* 363 */ "expression ::= NK_LP expression NK_RP", + /* 364 */ "expression ::= NK_PLUS expr_or_subquery", + /* 365 */ "expression ::= NK_MINUS expr_or_subquery", + /* 366 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 367 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 368 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 369 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 370 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 371 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 372 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 373 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 374 */ "expression_list ::= expr_or_subquery", + /* 375 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 376 */ "column_reference ::= column_name", + /* 377 */ "column_reference ::= table_name NK_DOT column_name", + /* 378 */ "pseudo_column ::= ROWTS", + /* 379 */ "pseudo_column ::= TBNAME", + /* 380 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 381 */ "pseudo_column ::= QSTART", + /* 382 */ "pseudo_column ::= QEND", + /* 383 */ "pseudo_column ::= QDURATION", + /* 384 */ "pseudo_column ::= WSTART", + /* 385 */ "pseudo_column ::= WEND", + /* 386 */ "pseudo_column ::= WDURATION", + /* 387 */ "pseudo_column ::= IROWTS", + /* 388 */ "pseudo_column ::= ISFILLED", + /* 389 */ "pseudo_column ::= QTAGS", + /* 390 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 391 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 392 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 393 */ "function_expression ::= literal_func", + /* 394 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 395 */ "literal_func ::= NOW", + /* 396 */ "noarg_func ::= NOW", + /* 397 */ "noarg_func ::= TODAY", + /* 398 */ "noarg_func ::= TIMEZONE", + /* 399 */ "noarg_func ::= DATABASE", + /* 400 */ "noarg_func ::= CLIENT_VERSION", + /* 401 */ "noarg_func ::= SERVER_VERSION", + /* 402 */ "noarg_func ::= SERVER_STATUS", + /* 403 */ "noarg_func ::= CURRENT_USER", + /* 404 */ "noarg_func ::= USER", + /* 405 */ "star_func ::= COUNT", + /* 406 */ "star_func ::= FIRST", + /* 407 */ "star_func ::= LAST", + /* 408 */ "star_func ::= LAST_ROW", + /* 409 */ "star_func_para_list ::= NK_STAR", + /* 410 */ "star_func_para_list ::= other_para_list", + /* 411 */ "other_para_list ::= star_func_para", + /* 412 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 413 */ "star_func_para ::= expr_or_subquery", + /* 414 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 415 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 416 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 417 */ "when_then_list ::= when_then_expr", + /* 418 */ "when_then_list ::= when_then_list when_then_expr", + /* 419 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 420 */ "case_when_else_opt ::=", + /* 421 */ "case_when_else_opt ::= ELSE common_expression", + /* 422 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 423 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 424 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 425 */ "predicate ::= expr_or_subquery IS NULL", + /* 426 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 427 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 428 */ "compare_op ::= NK_LT", + /* 429 */ "compare_op ::= NK_GT", + /* 430 */ "compare_op ::= NK_LE", + /* 431 */ "compare_op ::= NK_GE", + /* 432 */ "compare_op ::= NK_NE", + /* 433 */ "compare_op ::= NK_EQ", + /* 434 */ "compare_op ::= LIKE", + /* 435 */ "compare_op ::= NOT LIKE", + /* 436 */ "compare_op ::= MATCH", + /* 437 */ "compare_op ::= NMATCH", + /* 438 */ "compare_op ::= CONTAINS", + /* 439 */ "in_op ::= IN", + /* 440 */ "in_op ::= NOT IN", + /* 441 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 442 */ "boolean_value_expression ::= boolean_primary", + /* 443 */ "boolean_value_expression ::= NOT boolean_primary", + /* 444 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 445 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 446 */ "boolean_primary ::= predicate", + /* 447 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 448 */ "common_expression ::= expr_or_subquery", + /* 449 */ "common_expression ::= boolean_value_expression", + /* 450 */ "from_clause_opt ::=", + /* 451 */ "from_clause_opt ::= FROM table_reference_list", + /* 452 */ "table_reference_list ::= table_reference", + /* 453 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 454 */ "table_reference ::= table_primary", + /* 455 */ "table_reference ::= joined_table", + /* 456 */ "table_primary ::= table_name alias_opt", + /* 457 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 458 */ "table_primary ::= subquery alias_opt", + /* 459 */ "table_primary ::= parenthesized_joined_table", + /* 460 */ "alias_opt ::=", + /* 461 */ "alias_opt ::= table_alias", + /* 462 */ "alias_opt ::= AS table_alias", + /* 463 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 464 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 465 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 466 */ "join_type ::=", + /* 467 */ "join_type ::= INNER", + /* 468 */ "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", + /* 469 */ "set_quantifier_opt ::=", + /* 470 */ "set_quantifier_opt ::= DISTINCT", + /* 471 */ "set_quantifier_opt ::= ALL", + /* 472 */ "select_list ::= select_item", + /* 473 */ "select_list ::= select_list NK_COMMA select_item", + /* 474 */ "select_item ::= NK_STAR", + /* 475 */ "select_item ::= common_expression", + /* 476 */ "select_item ::= common_expression column_alias", + /* 477 */ "select_item ::= common_expression AS column_alias", + /* 478 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 479 */ "where_clause_opt ::=", + /* 480 */ "where_clause_opt ::= WHERE search_condition", + /* 481 */ "partition_by_clause_opt ::=", + /* 482 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 483 */ "partition_list ::= partition_item", + /* 484 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 485 */ "partition_item ::= expr_or_subquery", + /* 486 */ "partition_item ::= expr_or_subquery column_alias", + /* 487 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 488 */ "twindow_clause_opt ::=", + /* 489 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 490 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 491 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 492 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 493 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 494 */ "sliding_opt ::=", + /* 495 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 496 */ "fill_opt ::=", + /* 497 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 498 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 499 */ "fill_mode ::= NONE", + /* 500 */ "fill_mode ::= PREV", + /* 501 */ "fill_mode ::= NULL", + /* 502 */ "fill_mode ::= LINEAR", + /* 503 */ "fill_mode ::= NEXT", + /* 504 */ "group_by_clause_opt ::=", + /* 505 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 506 */ "group_by_list ::= expr_or_subquery", + /* 507 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 508 */ "having_clause_opt ::=", + /* 509 */ "having_clause_opt ::= HAVING search_condition", + /* 510 */ "range_opt ::=", + /* 511 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 512 */ "every_opt ::=", + /* 513 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 514 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 515 */ "query_simple ::= query_specification", + /* 516 */ "query_simple ::= union_query_expression", + /* 517 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 518 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 519 */ "query_simple_or_subquery ::= query_simple", + /* 520 */ "query_simple_or_subquery ::= subquery", + /* 521 */ "query_or_subquery ::= query_expression", + /* 522 */ "query_or_subquery ::= subquery", + /* 523 */ "order_by_clause_opt ::=", + /* 524 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 525 */ "slimit_clause_opt ::=", + /* 526 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 527 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 528 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 529 */ "limit_clause_opt ::=", + /* 530 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 531 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 532 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 533 */ "subquery ::= NK_LP query_expression NK_RP", + /* 534 */ "subquery ::= NK_LP subquery NK_RP", + /* 535 */ "search_condition ::= common_expression", + /* 536 */ "sort_specification_list ::= sort_specification", + /* 537 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 538 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 539 */ "ordering_specification_opt ::=", + /* 540 */ "ordering_specification_opt ::= ASC", + /* 541 */ "ordering_specification_opt ::= DESC", + /* 542 */ "null_ordering_opt ::=", + /* 543 */ "null_ordering_opt ::= NULLS FIRST", + /* 544 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2561,193 +2624,194 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 324: /* cmd */ - case 327: /* literal */ - case 340: /* db_options */ - case 342: /* alter_db_options */ - case 348: /* retention */ - case 349: /* full_table_name */ - case 352: /* table_options */ - case 356: /* alter_table_clause */ - case 357: /* alter_table_options */ - case 360: /* signed_literal */ - case 361: /* create_subtable_clause */ - case 364: /* drop_table_clause */ - case 367: /* column_def */ - case 371: /* duration_literal */ - case 372: /* rollup_func_name */ - case 374: /* col_name */ - case 375: /* db_name_cond_opt */ - case 376: /* like_pattern_opt */ - case 377: /* table_name_cond */ - case 378: /* from_db_opt */ - case 380: /* tag_item */ - case 382: /* index_options */ - case 384: /* sliding_opt */ - case 385: /* sma_stream_opt */ - case 386: /* func */ - case 387: /* query_or_subquery */ - case 390: /* explain_options */ - case 394: /* stream_options */ - case 395: /* subtable_opt */ - case 396: /* expression */ - case 398: /* where_clause_opt */ - case 399: /* signed */ - case 400: /* literal_func */ - case 403: /* expr_or_subquery */ - case 404: /* pseudo_column */ - case 405: /* column_reference */ - case 406: /* function_expression */ - case 407: /* case_when_expression */ - case 412: /* star_func_para */ - case 414: /* case_when_else_opt */ - case 415: /* common_expression */ - case 416: /* when_then_expr */ - case 417: /* predicate */ - case 420: /* in_predicate_value */ - case 421: /* boolean_value_expression */ - case 422: /* boolean_primary */ - case 423: /* from_clause_opt */ - case 424: /* table_reference_list */ - case 425: /* table_reference */ - case 426: /* table_primary */ - case 427: /* joined_table */ - case 429: /* subquery */ - case 430: /* parenthesized_joined_table */ - case 432: /* search_condition */ - case 433: /* query_specification */ - case 437: /* range_opt */ - case 438: /* every_opt */ - case 439: /* fill_opt */ - case 440: /* twindow_clause_opt */ - case 442: /* having_clause_opt */ - case 443: /* select_item */ - case 445: /* partition_item */ - case 448: /* query_expression */ - case 449: /* query_simple */ - case 451: /* slimit_clause_opt */ - case 452: /* limit_clause_opt */ - case 453: /* union_query_expression */ - case 454: /* query_simple_or_subquery */ - case 456: /* sort_specification */ + case 325: /* cmd */ + case 328: /* literal */ + case 341: /* db_options */ + case 343: /* alter_db_options */ + case 349: /* retention */ + case 350: /* full_table_name */ + case 353: /* table_options */ + case 357: /* alter_table_clause */ + case 358: /* alter_table_options */ + case 361: /* signed_literal */ + case 362: /* create_subtable_clause */ + case 365: /* drop_table_clause */ + case 368: /* column_def */ + case 372: /* duration_literal */ + case 373: /* rollup_func_name */ + case 375: /* col_name */ + case 376: /* db_name_cond_opt */ + case 377: /* like_pattern_opt */ + case 378: /* table_name_cond */ + case 379: /* from_db_opt */ + case 381: /* tag_item */ + case 383: /* index_options */ + case 385: /* sliding_opt */ + case 386: /* sma_stream_opt */ + case 387: /* func */ + case 389: /* query_or_subquery */ + case 392: /* explain_options */ + case 396: /* stream_options */ + case 397: /* subtable_opt */ + case 398: /* expression */ + case 400: /* where_clause_opt */ + case 401: /* signed */ + case 402: /* literal_func */ + case 405: /* expr_or_subquery */ + case 406: /* pseudo_column */ + case 407: /* column_reference */ + case 408: /* function_expression */ + case 409: /* case_when_expression */ + case 414: /* star_func_para */ + case 416: /* case_when_else_opt */ + case 417: /* common_expression */ + case 418: /* when_then_expr */ + case 419: /* predicate */ + case 422: /* in_predicate_value */ + case 423: /* boolean_value_expression */ + case 424: /* boolean_primary */ + case 425: /* from_clause_opt */ + case 426: /* table_reference_list */ + case 427: /* table_reference */ + case 428: /* table_primary */ + case 429: /* joined_table */ + case 431: /* subquery */ + case 432: /* parenthesized_joined_table */ + case 434: /* search_condition */ + case 435: /* query_specification */ + case 439: /* range_opt */ + case 440: /* every_opt */ + case 441: /* fill_opt */ + case 442: /* twindow_clause_opt */ + case 444: /* having_clause_opt */ + case 445: /* select_item */ + case 447: /* partition_item */ + case 450: /* query_expression */ + case 451: /* query_simple */ + case 453: /* slimit_clause_opt */ + case 454: /* limit_clause_opt */ + case 455: /* union_query_expression */ + case 456: /* query_simple_or_subquery */ + case 458: /* sort_specification */ { - nodesDestroyNode((yypminor->yy74)); + nodesDestroyNode((yypminor->yy600)); } break; - case 325: /* account_options */ - case 326: /* alter_account_options */ - case 328: /* alter_account_option */ - case 343: /* speed_opt */ - case 392: /* bufsize_opt */ + case 326: /* account_options */ + case 327: /* alter_account_options */ + case 329: /* alter_account_option */ + case 344: /* speed_opt */ + case 394: /* bufsize_opt */ { } break; - case 329: /* user_name */ - case 332: /* priv_level */ - case 335: /* db_name */ - case 336: /* topic_name */ - case 337: /* dnode_endpoint */ - case 358: /* column_name */ - case 366: /* table_name */ - case 373: /* function_name */ - case 381: /* column_alias */ - case 388: /* cgroup_name */ - case 393: /* stream_name */ - case 402: /* table_alias */ - case 408: /* star_func */ - case 410: /* noarg_func */ - case 428: /* alias_opt */ + case 330: /* user_name */ + case 333: /* priv_level */ + case 336: /* db_name */ + case 337: /* topic_name */ + case 338: /* dnode_endpoint */ + case 359: /* column_name */ + case 367: /* table_name */ + case 374: /* function_name */ + case 382: /* column_alias */ + case 388: /* sma_func_name */ + case 390: /* cgroup_name */ + case 395: /* stream_name */ + case 404: /* table_alias */ + case 410: /* star_func */ + case 412: /* noarg_func */ + case 430: /* alias_opt */ { } break; - case 330: /* sysinfo_opt */ + case 331: /* sysinfo_opt */ { } break; - case 331: /* privileges */ - case 333: /* priv_type_list */ - case 334: /* priv_type */ + case 332: /* privileges */ + case 334: /* priv_type_list */ + case 335: /* priv_type */ { } break; - case 338: /* force_opt */ - case 339: /* not_exists_opt */ - case 341: /* exists_opt */ - case 389: /* analyze_opt */ - case 391: /* agg_func_opt */ - case 434: /* set_quantifier_opt */ + case 339: /* force_opt */ + case 340: /* not_exists_opt */ + case 342: /* exists_opt */ + case 391: /* analyze_opt */ + case 393: /* agg_func_opt */ + case 436: /* set_quantifier_opt */ { } break; - case 344: /* integer_list */ - case 345: /* variable_list */ - case 346: /* retention_list */ - case 350: /* column_def_list */ - case 351: /* tags_def_opt */ - case 353: /* multi_create_clause */ - case 354: /* tags_def */ - case 355: /* multi_drop_clause */ - case 362: /* specific_cols_opt */ - case 363: /* expression_list */ - case 365: /* col_name_list */ - case 368: /* duration_list */ - case 369: /* rollup_func_list */ - case 379: /* tag_list_opt */ - case 383: /* func_list */ - case 397: /* dnode_list */ - case 401: /* literal_list */ - case 409: /* star_func_para_list */ - case 411: /* other_para_list */ - case 413: /* when_then_list */ - case 435: /* select_list */ - case 436: /* partition_by_clause_opt */ - case 441: /* group_by_clause_opt */ - case 444: /* partition_list */ - case 447: /* group_by_list */ - case 450: /* order_by_clause_opt */ - case 455: /* sort_specification_list */ + case 345: /* integer_list */ + case 346: /* variable_list */ + case 347: /* retention_list */ + case 351: /* column_def_list */ + case 352: /* tags_def_opt */ + case 354: /* multi_create_clause */ + case 355: /* tags_def */ + case 356: /* multi_drop_clause */ + case 363: /* specific_cols_opt */ + case 364: /* expression_list */ + case 366: /* col_name_list */ + case 369: /* duration_list */ + case 370: /* rollup_func_list */ + case 380: /* tag_list_opt */ + case 384: /* func_list */ + case 399: /* dnode_list */ + case 403: /* literal_list */ + case 411: /* star_func_para_list */ + case 413: /* other_para_list */ + case 415: /* when_then_list */ + case 437: /* select_list */ + case 438: /* partition_by_clause_opt */ + case 443: /* group_by_clause_opt */ + case 446: /* partition_list */ + case 449: /* group_by_list */ + case 452: /* order_by_clause_opt */ + case 457: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy874)); + nodesDestroyList((yypminor->yy601)); } break; - case 347: /* alter_db_option */ - case 370: /* alter_table_option */ + case 348: /* alter_db_option */ + case 371: /* alter_table_option */ { } break; - case 359: /* type_name */ + case 360: /* type_name */ { } break; - case 418: /* compare_op */ - case 419: /* in_op */ + case 420: /* compare_op */ + case 421: /* in_op */ { } break; - case 431: /* join_type */ + case 433: /* join_type */ { } break; - case 446: /* fill_mode */ + case 448: /* fill_mode */ { } break; - case 457: /* ordering_specification_opt */ + case 459: /* ordering_specification_opt */ { } break; - case 458: /* null_ordering_opt */ + case 460: /* null_ordering_opt */ { } @@ -2875,15 +2939,18 @@ static YYACTIONTYPE yy_find_shift_action( do{ i = yy_shift_ofst[stateno]; assert( i>=0 ); - /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */ + assert( i<=YY_ACTTAB_COUNT ); + assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; - if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){ + assert( i<(int)YY_NLOOKAHEAD ); + if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - if( iLookAhead %s\n", @@ -2898,16 +2965,8 @@ static YYACTIONTYPE yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( -#if YY_SHIFT_MIN+YYWILDCARD<0 - j>=0 && -#endif -#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT - j0 - ){ + assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); + if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -2921,6 +2980,7 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ + assert( i>=0 && iyytos; #ifndef NDEBUG if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ - yysize = yyRuleInfo[yyruleno].nrhs; + yysize = yyRuleInfoNRhs[yyruleno]; if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", + fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyTracePrompt, - yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); + yyruleno, yyRuleName[yyruleno], + yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ yypParser->yyhwm++; @@ -3673,11 +4288,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,326,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,326,&yymsp[0].minor); + yy_destructor(yypParser,327,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3691,20 +4306,20 @@ static YYACTIONTYPE yy_reduce( case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9); case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10); case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11); -{ yy_destructor(yypParser,325,&yymsp[-2].minor); +{ yy_destructor(yypParser,326,&yymsp[-2].minor); { } - yy_destructor(yypParser,327,&yymsp[0].minor); + yy_destructor(yypParser,328,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,328,&yymsp[0].minor); +{ yy_destructor(yypParser,329,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,326,&yymsp[-1].minor); +{ yy_destructor(yypParser,327,&yymsp[-1].minor); { } - yy_destructor(yypParser,328,&yymsp[0].minor); + yy_destructor(yypParser,329,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3718,80 +4333,81 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,327,&yymsp[0].minor); + yy_destructor(yypParser,328,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy0, yymsp[0].minor.yy449); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy77, &yymsp[-1].minor.yy0, yymsp[0].minor.yy287); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy77, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy77, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy77, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy77); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy449 = 1; } +{ yymsp[1].minor.yy287 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy449 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy287 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy717, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy717, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy717 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy531 = yymsp[0].minor.yy531; } - yymsp[0].minor.yy531 = yylhsminor.yy531; +{ yylhsminor.yy717 = yymsp[0].minor.yy717; } + yymsp[0].minor.yy717 = yylhsminor.yy717; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy717 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy531 = yymsp[-2].minor.yy531 | yymsp[0].minor.yy531; } - yymsp[-2].minor.yy531 = yylhsminor.yy531; +{ yylhsminor.yy717 = yymsp[-2].minor.yy717 | yymsp[0].minor.yy717; } + yymsp[-2].minor.yy717 = yylhsminor.yy717; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy717 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy717 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy317 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy317 = yylhsminor.yy317; +{ yylhsminor.yy77 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy77 = yylhsminor.yy77; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy317 = yymsp[-2].minor.yy317; } - yymsp[-2].minor.yy317 = yylhsminor.yy317; +{ yylhsminor.yy77 = yymsp[-2].minor.yy77; } + yymsp[-2].minor.yy77 = yylhsminor.yy77; break; case 42: /* priv_level ::= topic_name */ - case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); -{ yylhsminor.yy317 = yymsp[0].minor.yy317; } - yymsp[0].minor.yy317 = yylhsminor.yy317; + case 267: /* sma_func_name ::= function_name */ yytestcase(yyruleno==267); + case 461: /* alias_opt ::= table_alias */ yytestcase(yyruleno==461); +{ yylhsminor.yy77 = yymsp[0].minor.yy77; } + yymsp[0].minor.yy77 = yylhsminor.yy77; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy317, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy77, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy335); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy841); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy335); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy77, yymsp[0].minor.yy841); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3808,45 +4424,49 @@ 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 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; + case 268: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==268); + case 269: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==269); + case 270: /* sma_func_name ::= LAST */ yytestcase(yyruleno==270); + case 271: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==271); + case 347: /* db_name ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* table_name ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* column_name ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* function_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* table_alias ::= NK_ID */ yytestcase(yyruleno==351); + case 352: /* column_alias ::= NK_ID */ yytestcase(yyruleno==352); + case 353: /* user_name ::= NK_ID */ yytestcase(yyruleno==353); + case 354: /* topic_name ::= NK_ID */ yytestcase(yyruleno==354); + case 355: /* stream_name ::= NK_ID */ yytestcase(yyruleno==355); + case 356: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==356); + case 396: /* noarg_func ::= NOW */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= TODAY */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==398); + case 399: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==399); + case 400: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==400); + case 401: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==401); + case 402: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==402); + case 403: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==403); + case 404: /* noarg_func ::= USER */ yytestcase(yyruleno==404); + case 405: /* star_func ::= COUNT */ yytestcase(yyruleno==405); + case 406: /* star_func ::= FIRST */ yytestcase(yyruleno==406); + case 407: /* star_func ::= LAST */ yytestcase(yyruleno==407); + case 408: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==408); +{ yylhsminor.yy77 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy77 = yylhsminor.yy77; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - 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; } + case 287: /* analyze_opt ::= */ yytestcase(yyruleno==287); + case 294: /* agg_func_opt ::= */ yytestcase(yyruleno==294); + case 469: /* set_quantifier_opt ::= */ yytestcase(yyruleno==469); +{ yymsp[1].minor.yy841 = false; } break; case 55: /* force_opt ::= FORCE */ - 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; } + case 288: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==288); + case 295: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==295); + case 470: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==470); +{ yymsp[0].minor.yy841 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3879,206 +4499,206 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy335, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy841, &yymsp[-1].minor.yy77, yymsp[0].minor.yy600); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy841, &yymsp[0].minor.yy77); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy77); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy77, yymsp[0].minor.yy600); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy77); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy856); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy77, yymsp[0].minor.yy248); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy335 = true; } +{ yymsp[-2].minor.yy841 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy335 = true; } +{ yymsp[-1].minor.yy841 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy74 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy600 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_KEEP, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_KEEP, yymsp[0].minor.yy601); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_RETENTIONS, yymsp[0].minor.yy601); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-3].minor.yy600, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-3].minor.yy600, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; case 102: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 103: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 104: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 105: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 106: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 107: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy74 = createAlterDatabaseOptions(pCxt); yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yylhsminor.yy74, &yymsp[0].minor.yy767); } - yymsp[0].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterDatabaseOptions(pCxt); yylhsminor.yy600 = setAlterDatabaseOption(pCxt, yylhsminor.yy600, &yymsp[0].minor.yy661); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 108: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy74, &yymsp[0].minor.yy767); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy600, &yymsp[0].minor.yy661); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; case 109: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 110: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 111: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 113: /* alter_db_option ::= KEEP integer_list */ case 114: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==114); -{ yymsp[-1].minor.yy767.type = DB_OPTION_KEEP; yymsp[-1].minor.yy767.pList = yymsp[0].minor.yy874; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_KEEP; yymsp[-1].minor.yy661.pList = yymsp[0].minor.yy601; } break; case 115: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_PAGES; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_PAGES; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 116: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 117: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_WAL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_WAL; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 118: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy767.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy661.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; case 119: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy601 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; case 120: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; + case 317: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==317); +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-2].minor.yy601, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy601 = yylhsminor.yy601; break; case 121: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy601 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; case 122: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-2].minor.yy601, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy601 = yylhsminor.yy601; break; case 123: /* retention_list ::= retention */ case 145: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==145); @@ -4088,14 +4708,14 @@ static YYACTIONTYPE yy_reduce( 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; + case 345: /* literal_list ::= signed_literal */ yytestcase(yyruleno==345); + case 411: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==411); + case 417: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==417); + case 472: /* select_list ::= select_item */ yytestcase(yyruleno==472); + case 483: /* partition_list ::= partition_item */ yytestcase(yyruleno==483); + case 536: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==536); +{ yylhsminor.yy601 = createNodeList(pCxt, yymsp[0].minor.yy600); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; case 124: /* retention_list ::= retention_list NK_COMMA retention */ case 156: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==156); @@ -4103,271 +4723,271 @@ static YYACTIONTYPE yy_reduce( 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; + case 346: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==346); + case 412: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==412); + case 473: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==473); + case 484: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==484); + case 537: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==537); +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-2].minor.yy601, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy601 = yylhsminor.yy601; break; case 125: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy74 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; case 126: /* speed_opt ::= */ - case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); -{ yymsp[1].minor.yy856 = 0; } + case 296: /* bufsize_opt ::= */ yytestcase(yyruleno==296); +{ yymsp[1].minor.yy248 = 0; } break; case 127: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); -{ yymsp[-1].minor.yy856 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 297: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==297); +{ yymsp[-1].minor.yy248 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 128: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 130: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==130); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-5].minor.yy74, yymsp[-3].minor.yy874, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy841, yymsp[-5].minor.yy600, yymsp[-3].minor.yy601, yymsp[-1].minor.yy601, yymsp[0].minor.yy600); } break; case 129: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy601); } break; case 131: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy601); } break; case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy841, yymsp[0].minor.yy600); } break; case 133: /* cmd ::= ALTER TABLE alter_table_clause */ - case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); -{ pCxt->pRootNode = yymsp[0].minor.yy74; } + case 319: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==319); +{ pCxt->pRootNode = yymsp[0].minor.yy600; } break; case 134: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy74); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy600); } break; case 135: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy74 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; case 136: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy77, yymsp[0].minor.yy888); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 137: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy317); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy600, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy77); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; case 138: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy77, yymsp[0].minor.yy888); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 139: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy77, &yymsp[0].minor.yy77); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 140: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy77, yymsp[0].minor.yy888); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 141: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy317); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy600, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy77); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; case 142: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy77, yymsp[0].minor.yy888); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 143: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy77, &yymsp[0].minor.yy77); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; case 144: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy74 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy74, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); } - yymsp[-5].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy600, &yymsp[-2].minor.yy77, yymsp[0].minor.yy600); } + yymsp[-5].minor.yy600 = yylhsminor.yy600; break; case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149); - case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); } - yymsp[-1].minor.yy874 = yylhsminor.yy874; + case 418: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==418); +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-1].minor.yy601, yymsp[0].minor.yy600); } + yymsp[-1].minor.yy601 = yylhsminor.yy601; break; 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; +{ yylhsminor.yy600 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy841, yymsp[-8].minor.yy600, yymsp[-6].minor.yy600, yymsp[-5].minor.yy601, yymsp[-2].minor.yy601, yymsp[0].minor.yy600); } + yymsp[-9].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createDropTableClause(pCxt, yymsp[-1].minor.yy841, yymsp[0].minor.yy600); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; 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; } + case 481: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==481); + case 504: /* group_by_clause_opt ::= */ yytestcase(yyruleno==504); + case 523: /* order_by_clause_opt ::= */ yytestcase(yyruleno==523); +{ yymsp[1].minor.yy601 = NULL; } break; case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; } +{ yymsp[-2].minor.yy601 = yymsp[-1].minor.yy601; } break; case 153: /* full_table_name ::= table_name */ -{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy317, NULL); } - yymsp[0].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy77, NULL); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createRealTableNode(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77, NULL); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy77, yymsp[0].minor.yy888, NULL); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy77, yymsp[-2].minor.yy888, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; case 159: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 160: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 161: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 162: /* type_name ::= INT */ case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163); -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_INT); } break; case 164: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 165: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 166: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 167: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy888 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 168: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 169: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy888 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 170: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy888 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 171: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy888 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 172: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy888 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 173: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy888 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 174: /* type_name ::= JSON */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 175: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy888 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 176: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 177: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 178: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy888 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 179: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy888 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy888 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy888 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; 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; + case 410: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==410); +{ yylhsminor.yy601 = yymsp[0].minor.yy601; } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; } +{ yymsp[-3].minor.yy601 = yymsp[-1].minor.yy601; } break; case 185: /* table_options ::= */ -{ yymsp[1].minor.yy74 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy600 = createDefaultTableOptions(pCxt); } break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy601); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy601); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-4].minor.yy600, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy601); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-4].minor.yy600, TABLE_OPTION_SMA, yymsp[-1].minor.yy601); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy601); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createAlterTableOptions(pCxt); yylhsminor.yy600 = setTableOption(pCxt, yylhsminor.yy600, yymsp[0].minor.yy661.type, &yymsp[0].minor.yy661.val); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy661.type, &yymsp[0].minor.yy661.val); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; 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; } +{ yymsp[-1].minor.yy661.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; 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; } +{ yymsp[-1].minor.yy661.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy661.val = yymsp[0].minor.yy0; } break; 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; + case 374: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==374); +{ yylhsminor.yy601 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; 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; + case 375: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==375); +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-2].minor.yy601, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); } + yymsp[-2].minor.yy601 = yylhsminor.yy601; break; case 201: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy317, NULL); } - yymsp[0].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[0].minor.yy77, NULL); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy77); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 207: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -4382,13 +5002,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; 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); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, OP_TYPE_LIKE); } break; 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); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, OP_TYPE_LIKE); } break; 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); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy600, NULL, OP_TYPE_LIKE); } break; case 214: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -4400,7 +5020,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; 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); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy600, yymsp[-1].minor.yy600, OP_TYPE_EQUAL); } break; case 218: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -4419,13 +5039,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; case 224: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy317); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy77); } break; case 225: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy600); } break; case 226: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy600); } break; case 227: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -4444,7 +5064,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; 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); } +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy600); } break; case 234: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } @@ -4459,7 +5079,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy600); } break; case 239: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -4468,10 +5088,10 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; 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); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy600, yymsp[-1].minor.yy600, OP_TYPE_EQUAL); } break; 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); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600, yymsp[-3].minor.yy601); } break; case 243: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } @@ -4481,744 +5101,745 @@ static YYACTIONTYPE yy_reduce( break; case 245: /* db_name_cond_opt ::= */ case 250: /* from_db_opt ::= */ yytestcase(yyruleno==250); -{ yymsp[1].minor.yy74 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy600 = createDefaultDatabaseCondValue(pCxt); } break; case 246: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy317); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy77); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; 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; } + case 307: /* subtable_opt ::= */ yytestcase(yyruleno==307); + case 420: /* case_when_else_opt ::= */ yytestcase(yyruleno==420); + case 450: /* from_clause_opt ::= */ yytestcase(yyruleno==450); + case 479: /* where_clause_opt ::= */ yytestcase(yyruleno==479); + case 488: /* twindow_clause_opt ::= */ yytestcase(yyruleno==488); + case 494: /* sliding_opt ::= */ yytestcase(yyruleno==494); + case 496: /* fill_opt ::= */ yytestcase(yyruleno==496); + case 508: /* having_clause_opt ::= */ yytestcase(yyruleno==508); + case 510: /* range_opt ::= */ yytestcase(yyruleno==510); + case 512: /* every_opt ::= */ yytestcase(yyruleno==512); + case 525: /* slimit_clause_opt ::= */ yytestcase(yyruleno==525); + case 529: /* limit_clause_opt ::= */ yytestcase(yyruleno==529); +{ yymsp[1].minor.yy600 = NULL; } break; case 248: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 249: /* table_name_cond ::= table_name */ -{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } - yymsp[0].minor.yy74 = yylhsminor.yy74; +{ yylhsminor.yy600 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy77); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; case 251: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); } +{ yymsp[-1].minor.yy600 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy77); } break; 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; +{ yylhsminor.yy600 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy77), &yymsp[0].minor.yy77); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; 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; +{ yylhsminor.yy600 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy77), &yymsp[0].minor.yy77); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; 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); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy841, yymsp[-3].minor.yy600, yymsp[-1].minor.yy600, NULL, yymsp[0].minor.yy600); } break; case 261: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy841, yymsp[0].minor.yy600); } break; 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); } +{ yymsp[-9].minor.yy600 = createIndexOption(pCxt, yymsp[-7].minor.yy601, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; 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); } +{ yymsp[-11].minor.yy600 = createIndexOption(pCxt, yymsp[-9].minor.yy601, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; - 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; + case 266: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[-3].minor.yy77, yymsp[-1].minor.yy601); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - case 267: /* sma_stream_opt ::= */ - case 295: /* stream_options ::= */ yytestcase(yyruleno==295); -{ yymsp[1].minor.yy74 = createStreamOptions(pCxt); } + case 272: /* sma_stream_opt ::= */ + case 300: /* stream_options ::= */ yytestcase(yyruleno==300); +{ yymsp[1].minor.yy600 = createStreamOptions(pCxt); } break; - 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; + case 273: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 304: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==304); +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 274: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 275: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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); } + case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy841, &yymsp[-2].minor.yy77, yymsp[0].minor.yy600); } break; - 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); } + case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy841, &yymsp[-3].minor.yy77, &yymsp[0].minor.yy77, false); } break; - 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); } + case 278: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy841, &yymsp[-5].minor.yy77, &yymsp[0].minor.yy77, true); } break; - 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); } + case 279: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy841, &yymsp[-3].minor.yy77, yymsp[0].minor.yy600, false); } break; - 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); } + case 280: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy841, &yymsp[-5].minor.yy77, yymsp[0].minor.yy600, true); } break; - case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } + case 281: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy841, &yymsp[0].minor.yy77); } break; - 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); } + case 282: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy841, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77); } break; - 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); } + case 283: /* cmd ::= DESC full_table_name */ + case 284: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==284); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy600); } break; - case 280: /* cmd ::= RESET QUERY CACHE */ + case 285: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - 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); } + case 286: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy841, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; - case 284: /* explain_options ::= */ -{ yymsp[1].minor.yy74 = createDefaultExplainOptions(pCxt); } + case 289: /* explain_options ::= */ +{ yymsp[1].minor.yy600 = createDefaultExplainOptions(pCxt); } break; - 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; + case 290: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy600 = setExplainVerbose(pCxt, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 291: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy600 = setExplainRatio(pCxt, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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); } + case 292: /* 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.yy841, yymsp[-8].minor.yy841, &yymsp[-5].minor.yy77, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy888, yymsp[0].minor.yy248); } break; - case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } + case 293: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy841, &yymsp[0].minor.yy77); } break; - 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); } + case 298: /* 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.yy841, &yymsp[-7].minor.yy77, yymsp[-4].minor.yy600, yymsp[-6].minor.yy600, yymsp[-3].minor.yy601, yymsp[-2].minor.yy600, yymsp[0].minor.yy600); } break; - case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); } + case 299: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy841, &yymsp[0].minor.yy77); } break; - 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; + case 301: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 302: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 303: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy600)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy600)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-3].minor.yy600; } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 305: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy600)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy600 = yymsp[-3].minor.yy600; } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 306: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy600)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy600 = yymsp[-2].minor.yy600; } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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); } + case 308: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 495: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==495); + case 513: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==513); +{ yymsp[-3].minor.yy600 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy600); } break; - case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 309: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 305: /* cmd ::= KILL QUERY NK_STRING */ + case 310: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 311: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= BALANCE VGROUP */ + case 312: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 313: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); } + case 314: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy601); } break; - case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 315: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 311: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 316: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy601 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); } + case 318: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; - 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); } + case 320: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy600, yymsp[-2].minor.yy601, yymsp[0].minor.yy600); } break; - case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); } + case 321: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy600, NULL, yymsp[0].minor.yy600); } break; - 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; + case 322: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 323: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 324: /* literal ::= NK_STRING */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 325: /* literal ::= NK_BOOL */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 326: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - 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; + case 327: /* literal ::= duration_literal */ + case 337: /* signed_literal ::= signed */ yytestcase(yyruleno==337); + case 357: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==357); + case 358: /* expression ::= literal */ yytestcase(yyruleno==358); + case 359: /* expression ::= pseudo_column */ yytestcase(yyruleno==359); + case 360: /* expression ::= column_reference */ yytestcase(yyruleno==360); + case 361: /* expression ::= function_expression */ yytestcase(yyruleno==361); + case 362: /* expression ::= case_when_expression */ yytestcase(yyruleno==362); + case 393: /* function_expression ::= literal_func */ yytestcase(yyruleno==393); + case 442: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==442); + case 446: /* boolean_primary ::= predicate */ yytestcase(yyruleno==446); + case 448: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==448); + case 449: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==449); + case 452: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==452); + case 454: /* table_reference ::= table_primary */ yytestcase(yyruleno==454); + case 455: /* table_reference ::= joined_table */ yytestcase(yyruleno==455); + case 459: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==459); + case 515: /* query_simple ::= query_specification */ yytestcase(yyruleno==515); + case 516: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==516); + case 519: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==519); + case 521: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==521); +{ yylhsminor.yy600 = yymsp[0].minor.yy600; } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 328: /* literal ::= NULL */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 329: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 330: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 326: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 331: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 327: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 332: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 328: /* signed ::= NK_MINUS NK_INTEGER */ + case 333: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 329: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 334: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 330: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 335: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 331: /* signed ::= NK_MINUS NK_FLOAT */ + case 336: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 333: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 338: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 334: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 339: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 340: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - 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; + case 341: /* signed_literal ::= duration_literal */ + case 343: /* signed_literal ::= literal_func */ yytestcase(yyruleno==343); + case 413: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==413); + case 475: /* select_item ::= common_expression */ yytestcase(yyruleno==475); + case 485: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==485); + case 520: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==520); + case 522: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==522); + case 535: /* search_condition ::= common_expression */ yytestcase(yyruleno==535); +{ yylhsminor.yy600 = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 337: /* signed_literal ::= NULL */ -{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 342: /* signed_literal ::= NULL */ +{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - case 339: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy74 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 344: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy600 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 363: /* expression ::= NK_LP expression NK_RP */ + case 447: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==447); + case 534: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==534); +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 359: /* expression ::= NK_PLUS expr_or_subquery */ + case 364: /* 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)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 360: /* expression ::= NK_MINUS expr_or_subquery */ + case 365: /* 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)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy600), NULL)); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 366: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 367: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 368: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 369: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 370: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 371: /* 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))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 372: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 373: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 376: /* column_reference ::= column_name */ +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy77, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy77)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 377: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77, createColumnNode(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy77)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 378: /* pseudo_column ::= ROWTS */ + case 379: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==379); + case 381: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= QEND */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==383); + case 384: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==384); + case 385: /* pseudo_column ::= WEND */ yytestcase(yyruleno==385); + case 386: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==386); + case 387: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==387); + case 388: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==388); + case 389: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==389); + case 395: /* literal_func ::= NOW */ yytestcase(yyruleno==395); +{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 380: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy77)))); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 390: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 391: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==391); +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy77, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy77, yymsp[-1].minor.yy601)); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 392: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy888)); } + yymsp[-5].minor.yy600 = yylhsminor.yy600; break; - 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; + case 394: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy77, NULL)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 409: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy601 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; - 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; + case 414: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 478: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==478); +{ yylhsminor.yy600 = createColumnNode(pCxt, &yymsp[-2].minor.yy77, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 415: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy601, yymsp[-1].minor.yy600)); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 416: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-2].minor.yy601, yymsp[-1].minor.yy600)); } + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; - 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)); } + case 419: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy600 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); } break; - case 415: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); } + case 421: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy600 = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); } break; - 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); + case 422: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 427: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==427); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy666, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 423: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy600), releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-4].minor.yy74 = yylhsminor.yy74; + yymsp[-4].minor.yy600 = yylhsminor.yy600; break; - case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 424: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-5].minor.yy74 = yylhsminor.yy74; + yymsp[-5].minor.yy600 = yylhsminor.yy600; break; - case 419: /* predicate ::= expr_or_subquery IS NULL */ + case 425: /* 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)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), NULL)); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 426: /* 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)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL)); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - case 422: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } + case 428: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy666 = OP_TYPE_LOWER_THAN; } break; - case 423: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } + case 429: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy666 = OP_TYPE_GREATER_THAN; } break; - case 424: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } + case 430: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy666 = OP_TYPE_LOWER_EQUAL; } break; - case 425: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } + case 431: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy666 = OP_TYPE_GREATER_EQUAL; } break; - case 426: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } + case 432: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy666 = OP_TYPE_NOT_EQUAL; } break; - case 427: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } + case 433: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy666 = OP_TYPE_EQUAL; } break; - case 428: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy20 = OP_TYPE_LIKE; } + case 434: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy666 = OP_TYPE_LIKE; } break; - case 429: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } + case 435: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy666 = OP_TYPE_NOT_LIKE; } break; - case 430: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy20 = OP_TYPE_MATCH; } + case 436: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy666 = OP_TYPE_MATCH; } break; - case 431: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } + case 437: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy666 = OP_TYPE_NMATCH; } break; - case 432: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } + case 438: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy666 = OP_TYPE_JSON_CONTAINS; } break; - case 433: /* in_op ::= IN */ -{ yymsp[0].minor.yy20 = OP_TYPE_IN; } + case 439: /* in_op ::= IN */ +{ yymsp[0].minor.yy666 = OP_TYPE_IN; } break; - case 434: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } + case 440: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy666 = OP_TYPE_NOT_IN; } break; - 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; + case 441: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy601)); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 437: /* boolean_value_expression ::= NOT boolean_primary */ + case 443: /* 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)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy600), NULL)); } - yymsp[-1].minor.yy74 = yylhsminor.yy74; + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 444: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 445: /* 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); - yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600); + yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } - yymsp[-2].minor.yy74 = yylhsminor.yy74; + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; } + case 451: /* from_clause_opt ::= FROM table_reference_list */ + case 480: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==480); + case 509: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==509); +{ yymsp[-1].minor.yy600 = yymsp[0].minor.yy600; } break; - 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; + case 453: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy600 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, NULL); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 456: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy600 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy77, &yymsp[0].minor.yy77); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - 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; + case 457: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy600 = createRealTableNode(pCxt, &yymsp[-3].minor.yy77, &yymsp[-1].minor.yy77, &yymsp[0].minor.yy77); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 458: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy600 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600), &yymsp[0].minor.yy77); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - case 454: /* alias_opt ::= */ -{ yymsp[1].minor.yy317 = nil_token; } + case 460: /* alias_opt ::= */ +{ yymsp[1].minor.yy77 = nil_token; } break; - case 456: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy317 = yymsp[0].minor.yy317; } + case 462: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy77 = yymsp[0].minor.yy77; } break; - 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; } + case 463: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 464: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==464); +{ yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600; } break; - 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; + case 465: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy600 = createJoinTableNode(pCxt, yymsp[-4].minor.yy560, yymsp[-5].minor.yy600, yymsp[-2].minor.yy600, yymsp[0].minor.yy600); } + yymsp[-5].minor.yy600 = yylhsminor.yy600; break; - case 460: /* join_type ::= */ -{ yymsp[1].minor.yy630 = JOIN_TYPE_INNER; } + case 466: /* join_type ::= */ +{ yymsp[1].minor.yy560 = JOIN_TYPE_INNER; } break; - case 461: /* join_type ::= INNER */ -{ yymsp[0].minor.yy630 = JOIN_TYPE_INNER; } + case 467: /* join_type ::= INNER */ +{ yymsp[0].minor.yy560 = JOIN_TYPE_INNER; } break; - 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 */ + case 468: /* 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); - yymsp[-11].minor.yy74 = addPartitionByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-6].minor.yy874); - yymsp[-11].minor.yy74 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy74, yymsp[-2].minor.yy74); - yymsp[-11].minor.yy74 = addGroupByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-1].minor.yy874); - yymsp[-11].minor.yy74 = addHavingClause(pCxt, yymsp[-11].minor.yy74, yymsp[0].minor.yy74); - yymsp[-11].minor.yy74 = addRangeClause(pCxt, yymsp[-11].minor.yy74, yymsp[-5].minor.yy74); - yymsp[-11].minor.yy74 = addEveryClause(pCxt, yymsp[-11].minor.yy74, yymsp[-4].minor.yy74); - yymsp[-11].minor.yy74 = addFillClause(pCxt, yymsp[-11].minor.yy74, yymsp[-3].minor.yy74); + yymsp[-11].minor.yy600 = createSelectStmt(pCxt, yymsp[-10].minor.yy841, yymsp[-9].minor.yy601, yymsp[-8].minor.yy600); + yymsp[-11].minor.yy600 = addWhereClause(pCxt, yymsp[-11].minor.yy600, yymsp[-7].minor.yy600); + yymsp[-11].minor.yy600 = addPartitionByClause(pCxt, yymsp[-11].minor.yy600, yymsp[-6].minor.yy601); + yymsp[-11].minor.yy600 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy600, yymsp[-2].minor.yy600); + yymsp[-11].minor.yy600 = addGroupByClause(pCxt, yymsp[-11].minor.yy600, yymsp[-1].minor.yy601); + yymsp[-11].minor.yy600 = addHavingClause(pCxt, yymsp[-11].minor.yy600, yymsp[0].minor.yy600); + yymsp[-11].minor.yy600 = addRangeClause(pCxt, yymsp[-11].minor.yy600, yymsp[-5].minor.yy600); + yymsp[-11].minor.yy600 = addEveryClause(pCxt, yymsp[-11].minor.yy600, yymsp[-4].minor.yy600); + yymsp[-11].minor.yy600 = addFillClause(pCxt, yymsp[-11].minor.yy600, yymsp[-3].minor.yy600); } break; - case 465: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy335 = false; } + case 471: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy841 = false; } break; - case 468: /* select_item ::= NK_STAR */ -{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy74 = yylhsminor.yy74; + case 474: /* select_item ::= NK_STAR */ +{ yylhsminor.yy600 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy600 = yylhsminor.yy600; break; - 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; + case 476: /* select_item ::= common_expression column_alias */ + case 486: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==486); +{ yylhsminor.yy600 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600), &yymsp[0].minor.yy77); } + yymsp[-1].minor.yy600 = yylhsminor.yy600; break; - 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; + case 477: /* select_item ::= common_expression AS column_alias */ + case 487: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==487); +{ yylhsminor.yy600 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), &yymsp[0].minor.yy77); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; } + case 482: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 505: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==505); + case 524: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==524); +{ yymsp[-2].minor.yy601 = yymsp[0].minor.yy601; } break; - 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)); } + case 489: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy600 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); } break; - 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)); } + case 490: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy600 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); } break; - 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); } + case 491: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy600 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; - 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); } + case 492: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy600 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy600, yymsp[0].minor.yy600); } break; - 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); } + case 493: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy600 = createEventWindowNode(pCxt, yymsp[-3].minor.yy600, yymsp[0].minor.yy600); } break; - case 491: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy74 = createFillNode(pCxt, yymsp[-1].minor.yy828, NULL); } + case 497: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy600 = createFillNode(pCxt, yymsp[-1].minor.yy798, NULL); } break; - 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)); } + case 498: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy600 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy601)); } break; - case 493: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy828 = FILL_MODE_NONE; } + case 499: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy798 = FILL_MODE_NONE; } break; - case 494: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy828 = FILL_MODE_PREV; } + case 500: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy798 = FILL_MODE_PREV; } break; - case 495: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy828 = FILL_MODE_NULL; } + case 501: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy798 = FILL_MODE_NULL; } break; - case 496: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy828 = FILL_MODE_LINEAR; } + case 502: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy798 = FILL_MODE_LINEAR; } break; - case 497: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy828 = FILL_MODE_NEXT; } + case 503: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy798 = FILL_MODE_NEXT; } break; - 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; + case 506: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy601 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } + yymsp[0].minor.yy601 = yylhsminor.yy601; break; - 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; + case 507: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy601 = addNodeToList(pCxt, yymsp[-2].minor.yy601, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); } + yymsp[-2].minor.yy601 = yylhsminor.yy601; break; - 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)); } + case 511: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy600 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); } break; - case 508: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 514: /* 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); - yylhsminor.yy74 = addLimitClause(pCxt, yylhsminor.yy74, yymsp[0].minor.yy74); + yylhsminor.yy600 = addOrderByClause(pCxt, yymsp[-3].minor.yy600, yymsp[-2].minor.yy601); + yylhsminor.yy600 = addSlimitClause(pCxt, yylhsminor.yy600, yymsp[-1].minor.yy600); + yylhsminor.yy600 = addLimitClause(pCxt, yylhsminor.yy600, yymsp[0].minor.yy600); } - yymsp[-3].minor.yy74 = yylhsminor.yy74; + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 517: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy600 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy600, yymsp[0].minor.yy600); } + yymsp[-3].minor.yy600 = yylhsminor.yy600; break; - 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; + case 518: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy600 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy600, yymsp[0].minor.yy600); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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); } + case 526: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 530: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==530); +{ yymsp[-1].minor.yy600 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - 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); } + case 527: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 531: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==531); +{ yymsp[-3].minor.yy600 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - 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); } + case 528: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 532: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==532); +{ yymsp[-3].minor.yy600 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - 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; + case 533: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy600); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - 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; + case 538: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy600 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), yymsp[-1].minor.yy32, yymsp[0].minor.yy385); } + yymsp[-2].minor.yy600 = yylhsminor.yy600; break; - case 533: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy326 = ORDER_ASC; } + case 539: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy32 = ORDER_ASC; } break; - case 534: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy326 = ORDER_ASC; } + case 540: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy32 = ORDER_ASC; } break; - case 535: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy326 = ORDER_DESC; } + case 541: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy32 = ORDER_DESC; } break; - case 536: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; } + case 542: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy385 = NULL_ORDER_DEFAULT; } break; - case 537: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; } + case 543: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy385 = NULL_ORDER_FIRST; } break; - case 538: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; } + case 544: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy385 = NULL_ORDER_LAST; } break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyrulenopRoot), QUERY_NODE_VNODE_MODIF_STMT); - SVnodeModifOpStmt* pStmt = (SVnodeModifOpStmt*)pQuery->pRoot; + ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_VNODE_MODIFY_STMT); + SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot; ASSERT_EQ(pStmt->sqlNodeType, QUERY_NODE_ALTER_TABLE_STMT); ASSERT_NE(pStmt->pDataBlocks, nullptr); diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 205c70e0df..4e1e98c9c0 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -953,6 +953,10 @@ static int32_t createFillLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect code = TSDB_CODE_OUT_OF_MEMORY; } + if (TSDB_CODE_SUCCESS == code && 0 == LIST_LENGTH(pFill->node.pTargets)) { + code = createColumnByRewriteExpr(pFill->pWStartTs, &pFill->node.pTargets); + } + if (TSDB_CODE_SUCCESS == code) { *pLogicNode = (SLogicNode*)pFill; } else { @@ -1382,7 +1386,7 @@ static int32_t createSetOperatorLogicNode(SLogicPlanContext* pCxt, SSetOperator* static int32_t getMsgType(ENodeType sqlType) { switch (sqlType) { case QUERY_NODE_CREATE_TABLE_STMT: - case QUERY_NODE_CREATE_MULTI_TABLE_STMT: + case QUERY_NODE_CREATE_MULTI_TABLES_STMT: return TDMT_VND_CREATE_TABLE; case QUERY_NODE_DROP_TABLE_STMT: return TDMT_VND_DROP_TABLE; @@ -1396,7 +1400,7 @@ static int32_t getMsgType(ENodeType sqlType) { return TDMT_VND_SUBMIT; } -static int32_t createVnodeModifLogicNode(SLogicPlanContext* pCxt, SVnodeModifOpStmt* pStmt, SLogicNode** pLogicNode) { +static int32_t createVnodeModifLogicNode(SLogicPlanContext* pCxt, SVnodeModifyOpStmt* pStmt, SLogicNode** pLogicNode) { SVnodeModifyLogicNode* pModif = (SVnodeModifyLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_VNODE_MODIFY); if (NULL == pModif) { return TSDB_CODE_OUT_OF_MEMORY; @@ -1580,8 +1584,8 @@ static int32_t createQueryLogicNode(SLogicPlanContext* pCxt, SNode* pStmt, SLogi switch (nodeType(pStmt)) { case QUERY_NODE_SELECT_STMT: return createSelectLogicNode(pCxt, (SSelectStmt*)pStmt, pLogicNode); - case QUERY_NODE_VNODE_MODIF_STMT: - return createVnodeModifLogicNode(pCxt, (SVnodeModifOpStmt*)pStmt, pLogicNode); + case QUERY_NODE_VNODE_MODIFY_STMT: + return createVnodeModifLogicNode(pCxt, (SVnodeModifyOpStmt*)pStmt, pLogicNode); case QUERY_NODE_EXPLAIN_STMT: return createQueryLogicNode(pCxt, ((SExplainStmt*)pStmt)->pQuery, pLogicNode); case QUERY_NODE_SET_OPERATOR: diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index 150df76416..10ab71ab0e 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -104,6 +104,8 @@ TEST_F(PlanBasicTest, interpFunc) { run("SELECT _IROWTS, INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); + run("SELECT _IROWTS, INTERP(c1), _ISFILLED FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); + run("SELECT TBNAME, _IROWTS, INTERP(c1) FROM t1 PARTITION BY TBNAME " "RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); } diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index f3ef8c4afc..5ceb8228b0 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -461,6 +461,7 @@ int32_t schHandleLinkBrokenCallback(void *param, SDataBuf *pMsg, int32_t code) { if (head->isHbParam) { taosMemoryFree(pMsg->pData); + taosMemoryFree(pMsg->pEpSet); SSchHbCallbackParam *hbParam = (SSchHbCallbackParam *)param; SSchTrans trans = {.pTrans = hbParam->pTrans, .pHandle = NULL}; diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 85a27f404a..c5161ca502 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -122,7 +122,11 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) { block.info.childId = pTask->selfChildId; taosArrayPush(pRes, &block); - if (++batchCnt >= batchSz) break; + batchCnt++; + + qDebug("task %d scan exec block num %d, block limit %d", pTask->taskId, batchCnt, batchSz); + + if (batchCnt >= batchSz) break; } if (taosArrayGetSize(pRes) == 0) { taosArrayDestroy(pRes); @@ -140,6 +144,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) { streamTaskOutput(pTask, qRes); if (pTask->outputType == TASK_OUTPUT__FIXED_DISPATCH || pTask->outputType == TASK_OUTPUT__SHUFFLE_DISPATCH) { + qDebug("task %d scan exec dispatch block num %d", pTask->taskId, batchCnt); streamDispatch(pTask); } if (finished) break; diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index af1d738de0..cf388da92c 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -159,6 +159,11 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath, int goto _err; } + if (tdbTbOpen("partag.state.db", sizeof(int64_t), -1, NULL, pState->pTdbState->db, &pState->pTdbState->pParTagDb, 0) < + 0) { + goto _err; + } + if (streamStateBegin(pState) < 0) { goto _err; } @@ -173,6 +178,7 @@ _err: tdbTbClose(pState->pTdbState->pFillStateDb); tdbTbClose(pState->pTdbState->pSessionStateDb); tdbTbClose(pState->pTdbState->pParNameDb); + tdbTbClose(pState->pTdbState->pParTagDb); tdbClose(pState->pTdbState->db); streamStateDestroy(pState); return NULL; @@ -186,6 +192,7 @@ void streamStateClose(SStreamState* pState) { tdbTbClose(pState->pTdbState->pFillStateDb); tdbTbClose(pState->pTdbState->pSessionStateDb); tdbTbClose(pState->pTdbState->pParNameDb); + tdbTbClose(pState->pTdbState->pParTagDb); tdbClose(pState->pTdbState->db); streamStateDestroy(pState); @@ -821,10 +828,17 @@ _end: return res; } +int32_t streamStatePutParTag(SStreamState* pState, int64_t groupId, const void* tag, int32_t tagLen) { + return tdbTbUpsert(pState->pTdbState->pParTagDb, &groupId, sizeof(int64_t), tag, tagLen, pState->pTdbState->txn); +} + +int32_t streamStateGetParTag(SStreamState* pState, int64_t groupId, void** tagVal, int32_t* tagLen) { + return tdbTbGet(pState->pTdbState->pParTagDb, &groupId, sizeof(int64_t), tagVal, tagLen); +} + int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char tbname[TSDB_TABLE_NAME_LEN]) { - tdbTbUpsert(pState->pTdbState->pParNameDb, &groupId, sizeof(int64_t), tbname, TSDB_TABLE_NAME_LEN, - pState->pTdbState->txn); - return 0; + return tdbTbUpsert(pState->pTdbState->pParNameDb, &groupId, sizeof(int64_t), tbname, TSDB_TABLE_NAME_LEN, + pState->pTdbState->txn); } int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal) { diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 88727351c6..d875d3ca09 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -275,6 +275,8 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt SyncIndex index = pEntry->index; SyncIndex prevIndex = pEntry->index - 1; SyncTerm lastMatchTerm = syncLogBufferGetLastMatchTerm(pBuf); + SSyncRaftEntry* pExist = NULL; + bool inBuf = true; if (index <= pBuf->commitIndex) { sTrace("vgId:%d, already committed. index: %" PRId64 ", term: %" PRId64 ". log buffer: [%" PRId64 " %" PRId64 @@ -306,10 +308,9 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt } // check current in buffer - SSyncRaftEntry* pExist = pBuf->entries[index % pBuf->size].pItem; + pExist = syncLogBufferGetOneEntry(pBuf, pNode, index, &inBuf); if (pExist != NULL) { ASSERT(pEntry->index == pExist->index); - if (pEntry->term != pExist->term) { (void)syncLogBufferRollback(pBuf, pNode, index); } else { @@ -317,14 +318,15 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt " %" PRId64 " %" PRId64 ", %" PRId64 ")", pNode->vgId, pEntry->index, pEntry->term, pBuf->startIndex, pBuf->commitIndex, pBuf->matchIndex, pBuf->endIndex); - SyncTerm existPrevTerm = pBuf->entries[index % pBuf->size].prevLogTerm; - ASSERT(pEntry->term == pExist->term && prevTerm == existPrevTerm); + SyncTerm existPrevTerm = syncLogReplMgrGetPrevLogTerm(NULL, pNode, index); + ASSERT(pEntry->term == pExist->term && (pEntry->index > pBuf->matchIndex || prevTerm == existPrevTerm)); ret = 0; goto _out; } } // update + ASSERT(pBuf->entries[index % pBuf->size].pItem == NULL); SSyncLogBufEntry tmp = {.pItem = pEntry, .prevLogIndex = prevIndex, .prevLogTerm = prevTerm}; pEntry = NULL; pBuf->entries[index % pBuf->size] = tmp; @@ -337,6 +339,10 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt _out: syncEntryDestroy(pEntry); + if (!inBuf) { + syncEntryDestroy(pExist); + pExist = NULL; + } syncLogBufferValidate(pBuf); taosThreadMutexUnlock(&pBuf->mutex); return ret; @@ -1008,6 +1014,16 @@ int32_t syncLogBufferRollback(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncIndex lastVer = pNode->pLogStore->syncLogLastIndex(pNode->pLogStore); ASSERT(toIndex == lastVer + 1); + // refill buffer on need + if (toIndex <= pBuf->startIndex) { + int32_t ret = syncLogBufferInitWithoutLock(pBuf, pNode); + if (ret < 0) { + sError("vgId:%d, failed to refill sync log buffer since %s", pNode->vgId, terrstr()); + return -1; + } + } + + ASSERT(pBuf->endIndex == toIndex); syncLogBufferValidate(pBuf); return 0; } diff --git a/source/libs/tdb/src/db/tdbPCache.c b/source/libs/tdb/src/db/tdbPCache.c index b67fe562eb..30dcb05f80 100644 --- a/source/libs/tdb/src/db/tdbPCache.c +++ b/source/libs/tdb/src/db/tdbPCache.c @@ -192,6 +192,28 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) { return pPage; } +void tdbPCacheMarkFree(SPCache *pCache, SPage *pPage) { + tdbPCacheLock(pCache); + tdbPCacheRemovePageFromHash(pCache, pPage); + pPage->isFree = 1; + tdbPCacheUnlock(pCache); +} + +static void tdbPCacheFreePage(SPCache *pCache, SPage *pPage) { + if (pPage->id < pCache->nPages) { + pPage->pFreeNext = pCache->pFree; + pCache->pFree = pPage; + pPage->isFree = 0; + ++pCache->nFree; + tdbTrace("pcache/free page %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + } else { + tdbTrace("pcache destroy page: %p/%d/%d", pPage, TDB_PAGE_PGNO(pPage), pPage->id); + + tdbPCacheRemovePageFromHash(pCache, pPage); + tdbPageDestroy(pPage, tdbDefaultFree, NULL); + } +} + void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) { i32 nRef; @@ -209,7 +231,11 @@ void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn) { // nRef = tdbGetPageRef(pPage); // if (nRef == 0) { if (pPage->isLocal) { - tdbPCacheUnpinPage(pCache, pPage); + if (!pPage->isFree) { + tdbPCacheUnpinPage(pCache, pPage); + } else { + tdbPCacheFreePage(pCache, pPage); + } } else { if (TDB_TXN_IS_WRITE(pTxn)) { // remove from hash diff --git a/source/libs/tdb/src/db/tdbPage.c b/source/libs/tdb/src/db/tdbPage.c index ac2725d8ec..50dc8e0a65 100644 --- a/source/libs/tdb/src/db/tdbPage.c +++ b/source/libs/tdb/src/db/tdbPage.c @@ -111,6 +111,9 @@ void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell void tdbPageInit(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell *, int, TXN *, SBTree *pBt)) { tdbTrace("page/init: %p %" PRIu8 " %p", pPage, szAmHdr, xCellSize); pPage->pPageHdr = pPage->pData + szAmHdr; + if (TDB_PAGE_NCELLS(pPage) == 0) { + return tdbPageZero(pPage, szAmHdr, xCellSize); + } pPage->pCellIdx = pPage->pPageHdr + TDB_PAGE_HDR_SIZE(pPage); pPage->pFreeStart = pPage->pCellIdx + TDB_PAGE_OFFSET_SIZE(pPage) * TDB_PAGE_NCELLS(pPage); pPage->pFreeEnd = pPage->pData + TDB_PAGE_CCELLS(pPage); diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 648e99d6a5..b554170b39 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -466,11 +466,19 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } + if (tdbOsLSeek(jfd, 0L, SEEK_SET) < 0) { + tdbError("failed to lseek jfd due to %s. file:%s, offset:0", strerror(errno), pPager->dbFileName); + terrno = TAOS_SYSTEM_ERROR(errno); + return -1; + } + u8 *pageBuf = tdbOsCalloc(1, pPager->pageSize); if (pageBuf == NULL) { return -1; } + tdbDebug("tdb/abort: pager:%p,", pPager); + for (int pgIndex = 0; pgIndex < journalSize; ++pgIndex) { // read pgno & the page from journal SPgno pgno; @@ -481,6 +489,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } + tdbTrace("tdb/abort: pgno:%d,", pgno); + ret = tdbOsRead(jfd, pageBuf, pPager->pageSize); if (ret < 0) { tdbOsFree(pageBuf); @@ -524,6 +534,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage); hashset_remove(pTxn->jPageSet, (void *)((long)TDB_PAGE_PGNO(pPage))); + tdbPCacheMarkFree(pPager->pCache, pPage); tdbPCacheRelease(pPager->pCache, pPage, pTxn); } @@ -577,12 +588,12 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) { return -1; } - tdbTrace("tdb/flush:%p, %d/%d/%d", pPager, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); + tdbTrace("tdb/flush:%p, pgno:%d, %d/%d/%d", pPager, pgno, pPager->dbOrigSize, pPager->dbFileSize, maxPgno); pPager->dbOrigSize = maxPgno; pPage->isDirty = 0; - tdbTrace("pager/flush drop page: %p %d from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); + tdbTrace("pager/flush drop page: %p, pgno:%d, from dirty tree: %p", pPage, TDB_PAGE_PGNO(pPage), &pPager->rbt); tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage); tdbPCacheRelease(pPager->pCache, pPage, pTxn); @@ -829,7 +840,7 @@ static int tdbPagerPWritePageToDB(SPager *pPager, SPage *pPage) { return 0; } -static int tdbPagerRestore(SPager *pPager, SBTree *pBt, const char *jFileName) { +static int tdbPagerRestore(SPager *pPager, const char *jFileName) { int ret = 0; SPgno journalSize = 0; u8 *pageBuf = NULL; @@ -907,7 +918,7 @@ static int tdbPagerRestore(SPager *pPager, SBTree *pBt, const char *jFileName) { return 0; } -int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) { +int tdbPagerRestoreJournals(SPager *pPager) { tdbDirEntryPtr pDirEntry; tdbDirPtr pDir = taosOpenDir(pPager->pEnv->dbName); if (pDir == NULL) { @@ -918,7 +929,7 @@ int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) { while ((pDirEntry = tdbReadDir(pDir)) != NULL) { char *name = tdbDirEntryBaseName(tdbGetDirEntryName(pDirEntry)); if (strncmp(TDB_MAINDB_NAME "-journal", name, 16) == 0) { - if (tdbPagerRestore(pPager, pBt, name) < 0) { + if (tdbPagerRestore(pPager, name) < 0) { tdbCloseDir(&pDir); tdbError("failed to restore file due to %s. jFileName:%s", strerror(errno), name); diff --git a/source/libs/tdb/src/db/tdbTable.c b/source/libs/tdb/src/db/tdbTable.c index c5c2d6aebe..2950169979 100644 --- a/source/libs/tdb/src/db/tdbTable.c +++ b/source/libs/tdb/src/db/tdbTable.c @@ -107,6 +107,16 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF ASSERT(pPager != NULL); + if (rollback) { + tdbPagerRollback(pPager); + } else { + ret = tdbPagerRestoreJournals(pPager); + if (ret < 0) { + tdbOsFree(pTb); + return -1; + } + } + // pTb->pBt ret = tdbBtreeOpen(keyLen, valLen, pPager, tbname, pgno, keyCmprFn, pEnv, &(pTb->pBt)); if (ret < 0) { @@ -114,16 +124,6 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF return -1; } - if (rollback) { - tdbPagerRollback(pPager); - } else { - ret = tdbPagerRestoreJournals(pPager, pTb->pBt); - if (ret < 0) { - tdbOsFree(pTb); - return -1; - } - } - *ppTb = pTb; return 0; } diff --git a/source/libs/tdb/src/inc/tdbInt.h b/source/libs/tdb/src/inc/tdbInt.h index 055a8a1062..45e01e83f3 100644 --- a/source/libs/tdb/src/inc/tdbInt.h +++ b/source/libs/tdb/src/inc/tdbInt.h @@ -197,7 +197,7 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initP TXN *pTxn); void tdbPagerReturnPage(SPager *pPager, SPage *pPage, TXN *pTxn); int tdbPagerAllocPage(SPager *pPager, SPgno *ppgno); -int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt); +int tdbPagerRestoreJournals(SPager *pPager); int tdbPagerRollback(SPager *pPager); // tdbPCache.c ==================================== @@ -205,6 +205,7 @@ int tdbPagerRollback(SPager *pPager); u8 isAnchor; \ u8 isLocal; \ u8 isDirty; \ + u8 isFree; \ volatile i32 nRef; \ i32 id; \ SPage *pFreeNext; \ @@ -222,6 +223,7 @@ int tdbPCacheClose(SPCache *pCache); int tdbPCacheAlter(SPCache *pCache, int32_t nPage); SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn); void tdbPCacheRelease(SPCache *pCache, SPage *pPage, TXN *pTxn); +void tdbPCacheMarkFree(SPCache *pCache, SPage *pPage); int tdbPCacheGetPageSize(SPCache *pCache); // tdbPage.c ==================================== diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 6ad126162e..d144a76eb0 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -599,6 +599,10 @@ static int32_t allocConnRef(SCliConn* conn, bool update) { exh->pThrd = conn->hostThrd; exh->refId = transAddExHandle(transGetRefMgt(), exh); conn->refId = exh->refId; + + if (conn->refId == -1) { + taosMemoryFree(exh); + } return 0; } diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 8e6628bb21..da8cf24627 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -25,7 +25,7 @@ bool FORCE_INLINE walLogExist(SWal* pWal, int64_t ver) { } bool FORCE_INLINE walIsEmpty(SWal* pWal) { - return (pWal->vers.firstVer == -1 || pWal->vers.lastVer < pWal->vers.firstVer); // [firstVer, lastVer + 1) + return (pWal->vers.firstVer == -1 || pWal->vers.lastVer < pWal->vers.firstVer); // [firstVer, lastVer + 1) } int64_t FORCE_INLINE walGetFirstVer(SWal* pWal) { return pWal->vers.firstVer; } @@ -49,7 +49,6 @@ static FORCE_INLINE int walBuildTmpMetaName(SWal* pWal, char* buf) { static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx) { int32_t sz = taosArrayGetSize(pWal->fileInfoSet); terrno = TSDB_CODE_SUCCESS; - ASSERT(fileIdx >= 0 && fileIdx < sz); SWalFileInfo* pFileInfo = taosArrayGet(pWal->fileInfoSet, fileIdx); char fnameStr[WAL_FILE_LEN]; @@ -101,7 +100,6 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx) { offsetBackward = offset; } - ASSERT(offset <= end); readSize = end - offset; capacity = readSize + sizeof(magic); @@ -257,7 +255,6 @@ static void walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList) { SWalFileInfo* pLogInfo = taosArrayGet(actualLogList, i); while (j < metaFileNum) { SWalFileInfo* pMetaInfo = taosArrayGet(metaLogList, j); - ASSERT(pMetaInfo != NULL); if (pMetaInfo->firstVer < pLogInfo->firstVer) { j++; } else if (pMetaInfo->firstVer == pLogInfo->firstVer) { @@ -385,7 +382,6 @@ int walCheckAndRepairMeta(SWal* pWal) { taosArrayDestroy(actualLog); int32_t sz = taosArrayGetSize(pWal->fileInfoSet); - ASSERT(sz == actualFileNum); // scan and determine the lastVer int32_t fileIdx = sz; @@ -403,8 +399,6 @@ int walCheckAndRepairMeta(SWal* pWal) { return -1; } - ASSERT(pFileInfo->firstVer >= 0); - if (pFileInfo->lastVer >= pFileInfo->firstVer && fileSize == pFileInfo->fileSize) { totSize += pFileInfo->fileSize; continue; @@ -417,7 +411,6 @@ int walCheckAndRepairMeta(SWal* pWal) { wError("failed to scan wal last ver since %s", terrstr()); return -1; } - ASSERT(pFileInfo->fileSize == 0); // remove the empty wal log, and its idx wInfo("vgId:%d, wal remove empty file %s", pWal->cfg.vgId, fnameStr); taosRemoveFile(fnameStr); @@ -477,8 +470,7 @@ int walReadLogHead(TdFilePtr pLogFile, int64_t offset, SWalCkHead* pCkHead) { } int walCheckAndRepairIdxFile(SWal* pWal, int32_t fileIdx) { - int32_t sz = taosArrayGetSize(pWal->fileInfoSet); - ASSERT(fileIdx >= 0 && fileIdx < sz); + int32_t sz = taosArrayGetSize(pWal->fileInfoSet); SWalFileInfo* pFileInfo = taosArrayGet(pWal->fileInfoSet, fileIdx); char fnameStr[WAL_FILE_LEN]; walBuildIdxName(pWal, pFileInfo->firstVer, fnameStr); @@ -492,7 +484,6 @@ int walCheckAndRepairIdxFile(SWal* pWal, int32_t fileIdx) { return -1; } - ASSERT(pFileInfo->fileSize > 0 && pFileInfo->firstVer >= 0 && pFileInfo->lastVer >= pFileInfo->firstVer); if (fileSize == (pFileInfo->lastVer - pFileInfo->firstVer + 1) * sizeof(SWalIdxEntry)) { return 0; } @@ -556,7 +547,7 @@ int walCheckAndRepairIdxFile(SWal* pWal, int32_t fileIdx) { } offset += sizeof(SWalIdxEntry); - ASSERT(offset == (idxEntry.ver - pFileInfo->firstVer + 1) * sizeof(SWalIdxEntry)); + /*A(offset == (idxEntry.ver - pFileInfo->firstVer + 1) * sizeof(SWalIdxEntry));*/ // ftruncate idx file if (offset < fileSize) { @@ -577,7 +568,7 @@ int walCheckAndRepairIdxFile(SWal* pWal, int32_t fileIdx) { } while (idxEntry.ver < pFileInfo->lastVer) { - ASSERT(idxEntry.ver == ckHead.head.version); + /*A(idxEntry.ver == ckHead.head.version);*/ idxEntry.ver += 1; idxEntry.offset += sizeof(SWalCkHead) + ckHead.head.bodyLen; @@ -649,8 +640,7 @@ int walRollFileInfo(SWal* pWal) { } char* walMetaSerialize(SWal* pWal) { - char buf[30]; - ASSERT(pWal->fileInfoSet); + char buf[30]; int sz = taosArrayGetSize(pWal->fileInfoSet); cJSON* pRoot = cJSON_CreateObject(); cJSON* pMeta = cJSON_CreateObject(); @@ -707,7 +697,7 @@ char* walMetaSerialize(SWal* pWal) { } int walMetaDeserialize(SWal* pWal, const char* bytes) { - ASSERT(taosArrayGetSize(pWal->fileInfoSet) == 0); + /*A(taosArrayGetSize(pWal->fileInfoSet) == 0);*/ cJSON *pRoot, *pMeta, *pFiles, *pInfoJson, *pField; pRoot = cJSON_Parse(bytes); if (!pRoot) goto _err; @@ -823,7 +813,9 @@ int walSaveMeta(SWal* pWal) { // flush to a tmpfile n = walBuildTmpMetaName(pWal, tmpFnameStr); - ASSERT(n < sizeof(tmpFnameStr) && "Buffer overflow of file name"); + if (n >= sizeof(tmpFnameStr)) { + return -1; + } TdFilePtr pMetaFile = taosOpenFile(tmpFnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (pMetaFile == NULL) { @@ -854,7 +846,9 @@ int walSaveMeta(SWal* pWal) { // rename it n = walBuildMetaName(pWal, metaVer + 1, fnameStr); - ASSERT(n < sizeof(fnameStr) && "Buffer overflow of file name"); + if (n >= sizeof(fnameStr)) { + goto _err; + } if (taosRenameFile(tmpFnameStr, fnameStr) < 0) { wError("failed to rename file due to %s. dest:%s", strerror(errno), fnameStr); @@ -877,7 +871,6 @@ _err: } int walLoadMeta(SWal* pWal) { - ASSERT(pWal->fileInfoSet->size == 0); // find existing meta file int metaVer = walFindCurMetaVer(pWal); if (metaVer == -1) { diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c index 4c3fb3c0ba..1846beb411 100644 --- a/source/libs/wal/src/walRead.c +++ b/source/libs/wal/src/walRead.c @@ -97,7 +97,6 @@ int32_t walNextValidMsg(SWalReader *pReader) { return -1; } fetchVer++; - ASSERT(fetchVer == pReader->curVersion); } } pReader->curStopped = 1; @@ -132,7 +131,6 @@ static int64_t walReadSeekFilePos(SWalReader *pReader, int64_t fileFirstVer, int return -1; } - ASSERT(entry.ver == ver); ret = taosLSeekFile(pLogTFile, entry.offset, SEEK_SET); if (ret < 0) { terrno = TAOS_SYSTEM_ERROR(errno); @@ -241,7 +239,6 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) { if (pRead->curInvalid || pRead->curVersion != fetchVer) { if (walReadSeekVer(pRead, fetchVer) < 0) { - ASSERT(0); pRead->curVersion = fetchVer; pRead->curInvalid = 1; return -1; @@ -262,7 +259,6 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) { } else { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } - ASSERT(0); pRead->curInvalid = 1; return -1; } @@ -300,7 +296,6 @@ static int32_t walFetchBodyNew(SWalReader *pReader) { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } pReader->curInvalid = 1; - ASSERT(0); return -1; } @@ -309,7 +304,6 @@ static int32_t walFetchBodyNew(SWalReader *pReader) { pReader->pHead->head.version, ver); pReader->curInvalid = 1; terrno = TSDB_CODE_WAL_FILE_CORRUPTED; - ASSERT(0); return -1; } @@ -317,7 +311,6 @@ static int32_t walFetchBodyNew(SWalReader *pReader) { wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pReader->pWal->cfg.vgId, ver); pReader->curInvalid = 1; terrno = TSDB_CODE_WAL_FILE_CORRUPTED; - ASSERT(0); return -1; } @@ -329,14 +322,10 @@ static int32_t walFetchBodyNew(SWalReader *pReader) { static int32_t walSkipFetchBodyNew(SWalReader *pRead) { int64_t code; - ASSERT(pRead->curVersion == pRead->pHead->head.version); - ASSERT(pRead->curInvalid == 0); - code = taosLSeekFile(pRead->pLogFile, pRead->pHead->head.bodyLen, SEEK_CUR); if (code < 0) { terrno = TAOS_SYSTEM_ERROR(errno); pRead->curInvalid = 1; - ASSERT(0); return -1; } @@ -385,7 +374,6 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) { } else { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } - ASSERT(0); pRead->curInvalid = 1; return -1; } @@ -411,9 +399,6 @@ int32_t walSkipFetchBody(SWalReader *pRead, const SWalCkHead *pHead) { pRead->pWal->cfg.vgId, pHead->head.version, pRead->pWal->vers.firstVer, pRead->pWal->vers.commitVer, pRead->pWal->vers.lastVer, pRead->pWal->vers.appliedVer); - ASSERT(pRead->curVersion == pHead->head.version); - ASSERT(pRead->curInvalid == 0); - code = taosLSeekFile(pRead->pLogFile, pHead->head.bodyLen, SEEK_CUR); if (code < 0) { terrno = TAOS_SYSTEM_ERROR(errno); @@ -448,7 +433,6 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) { if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) { if (pReadHead->bodyLen < 0) { - ASSERT(0); terrno = TAOS_SYSTEM_ERROR(errno); wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s", pRead->pWal->cfg.vgId, pReadHead->version, ver, tstrerror(terrno)); @@ -458,12 +442,10 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } pRead->curInvalid = 1; - ASSERT(0); return -1; } if (pReadHead->version != ver) { - ASSERT(0); wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId, pReadHead->version, ver); pRead->curInvalid = 1; @@ -472,7 +454,6 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) { } if (walValidBodyCksum(*ppHead) != 0) { - ASSERT(0); wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver); pRead->curInvalid = 1; diff --git a/source/libs/wal/src/walRef.c b/source/libs/wal/src/walRef.c index e86111109c..fa04ba3e58 100644 --- a/source/libs/wal/src/walRef.c +++ b/source/libs/wal/src/walRef.c @@ -61,7 +61,7 @@ int32_t walRefVer(SWalRef *pRef, int64_t ver) { SWalFileInfo tmpInfo; tmpInfo.firstVer = ver; SWalFileInfo *pRet = taosArraySearch(pWal->fileInfoSet, &tmpInfo, compareWalFileInfo, TD_LE); - ASSERT(pRet != NULL); + /*A(pRet != NULL);*/ pRef->refFile = pRet->firstVer; taosThreadMutexUnlock(&pWal->mutex); @@ -80,6 +80,7 @@ void walUnrefVer(SWalRef *pRef) { SWalRef *walRefCommittedVer(SWal *pWal) { SWalRef *pRef = walOpenRef(pWal); if (pRef == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } taosThreadMutexLock(&pWal->mutex); @@ -91,7 +92,7 @@ SWalRef *walRefCommittedVer(SWal *pWal) { SWalFileInfo tmpInfo; tmpInfo.firstVer = ver; SWalFileInfo *pRet = taosArraySearch(pWal->fileInfoSet, &tmpInfo, compareWalFileInfo, TD_LE); - ASSERT(pRet != NULL); + /*A(pRet != NULL);*/ pRef->refFile = pRet->firstVer; taosThreadMutexUnlock(&pWal->mutex); diff --git a/source/libs/wal/src/walSeek.c b/source/libs/wal/src/walSeek.c index 2cb6614b01..cbfd0ef741 100644 --- a/source/libs/wal/src/walSeek.c +++ b/source/libs/wal/src/walSeek.c @@ -40,7 +40,6 @@ static int64_t walSeekWritePos(SWal* pWal, int64_t ver) { terrno = TAOS_SYSTEM_ERROR(errno); return -1; } - ASSERT(entry.ver == ver); code = taosLSeekFile(pLogTFile, entry.offset, SEEK_SET); if (code < 0) { terrno = TAOS_SYSTEM_ERROR(errno); @@ -53,8 +52,7 @@ static int64_t walSeekWritePos(SWal* pWal, int64_t ver) { int walInitWriteFile(SWal* pWal) { TdFilePtr pIdxTFile, pLogTFile; SWalFileInfo* pRet = taosArrayGetLast(pWal->fileInfoSet); - ASSERT(pRet != NULL); - int64_t fileFirstVer = pRet->firstVer; + int64_t fileFirstVer = pRet->firstVer; char fnameStr[WAL_FILE_LEN]; walBuildIdxName(pWal, fileFirstVer, fnameStr); @@ -109,9 +107,8 @@ int64_t walChangeWrite(SWal* pWal, int64_t ver) { tmpInfo.firstVer = ver; // bsearch in fileSet int32_t idx = taosArraySearchIdx(pWal->fileInfoSet, &tmpInfo, compareWalFileInfo, TD_LE); - ASSERT(idx != -1); + /*A(idx != -1);*/ SWalFileInfo* pFileInfo = taosArrayGet(pWal->fileInfoSet, idx); - /*ASSERT(pFileInfo != NULL);*/ int64_t fileFirstVer = pFileInfo->firstVer; walBuildIdxName(pWal, fileFirstVer, fnameStr); diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index a5c7bf1abd..4233c089a4 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -87,12 +87,10 @@ int32_t walApplyVer(SWal *pWal, int64_t ver) { } int32_t walCommit(SWal *pWal, int64_t ver) { - ASSERT(pWal->vers.commitVer >= pWal->vers.snapshotVer); - ASSERT(pWal->vers.commitVer <= pWal->vers.lastVer); if (ver < pWal->vers.commitVer) { return 0; } - if (ver > pWal->vers.lastVer) { + if (ver > pWal->vers.lastVer || pWal->vers.commitVer < pWal->vers.snapshotVer) { terrno = TSDB_CODE_WAL_INVALID_VER; return -1; } @@ -138,25 +136,21 @@ int32_t walRollback(SWal *pWal, int64_t ver) { TdFilePtr pIdxFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ | TD_FILE_APPEND); if (pIdxFile == NULL) { - ASSERT(0); taosThreadMutexUnlock(&pWal->mutex); return -1; } int64_t idxOff = walGetVerIdxOffset(pWal, ver); code = taosLSeekFile(pIdxFile, idxOff, SEEK_SET); if (code < 0) { - ASSERT(0); taosThreadMutexUnlock(&pWal->mutex); return -1; } // read idx file and get log file pos SWalIdxEntry entry; if (taosReadFile(pIdxFile, &entry, sizeof(SWalIdxEntry)) != sizeof(SWalIdxEntry)) { - ASSERT(0); taosThreadMutexUnlock(&pWal->mutex); return -1; } - ASSERT(entry.ver == ver); walBuildLogName(pWal, walGetCurFileFirstVer(pWal), fnameStr); TdFilePtr pLogFile = taosOpenFile(fnameStr, TD_FILE_WRITE | TD_FILE_READ | TD_FILE_APPEND); @@ -176,24 +170,19 @@ int32_t walRollback(SWal *pWal, int64_t ver) { } // validate offset SWalCkHead head; - ASSERT(taosValidFile(pLogFile)); - int64_t size = taosReadFile(pLogFile, &head, sizeof(SWalCkHead)); + int64_t size = taosReadFile(pLogFile, &head, sizeof(SWalCkHead)); if (size != sizeof(SWalCkHead)) { - ASSERT(0); taosThreadMutexUnlock(&pWal->mutex); return -1; } code = walValidHeadCksum(&head); - ASSERT(code == 0); if (code != 0) { terrno = TSDB_CODE_WAL_FILE_CORRUPTED; - ASSERT(0); taosThreadMutexUnlock(&pWal->mutex); return -1; } if (head.head.version != ver) { - ASSERT(0); terrno = TSDB_CODE_WAL_FILE_CORRUPTED; taosThreadMutexUnlock(&pWal->mutex); return -1; @@ -202,22 +191,22 @@ int32_t walRollback(SWal *pWal, int64_t ver) { // truncate old files code = taosFtruncateFile(pLogFile, entry.offset); if (code < 0) { - ASSERT(0); terrno = TAOS_SYSTEM_ERROR(errno); taosThreadMutexUnlock(&pWal->mutex); return -1; } code = taosFtruncateFile(pIdxFile, idxOff); if (code < 0) { - ASSERT(0); terrno = TAOS_SYSTEM_ERROR(errno); taosThreadMutexUnlock(&pWal->mutex); return -1; } pWal->vers.lastVer = ver - 1; +#if 0 if (pWal->vers.lastVer < pWal->vers.firstVer) { - ASSERT(pWal->vers.lastVer == pWal->vers.firstVer - 1); + A(pWal->vers.lastVer == pWal->vers.firstVer - 1); } +#endif ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->lastVer = ver - 1; ((SWalFileInfo *)taosArrayGetLast(pWal->fileInfoSet))->fileSize = entry.offset; taosCloseFile(&pIdxFile); @@ -386,7 +375,8 @@ int32_t walEndSnapshot(SWal *pWal) { walBuildIdxName(pWal, pInfo->firstVer, fnameStr); wDebug("vgId:%d, wal remove file %s", pWal->cfg.vgId, fnameStr); if (taosRemoveFile(fnameStr) < 0 && errno != ENOENT) { - ASSERT(0); + wError("vgId:%d, failed to remove idx file %s due to %s", pWal->cfg.vgId, fnameStr, strerror(errno)); + goto END; } } taosArrayClear(pWal->toDeleteFiles); @@ -441,7 +431,6 @@ int32_t walRollImpl(SWal *pWal) { pWal->pIdxFile = pIdxFile; pWal->pLogFile = pLogFile; pWal->writeCur = taosArrayGetSize(pWal->fileInfoSet) - 1; - ASSERT(pWal->writeCur >= 0); pWal->lastRollSeq = walGetSeq(); @@ -458,8 +447,7 @@ END: static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) { SWalIdxEntry entry = {.ver = ver, .offset = offset}; SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); - ASSERT(pFileInfo != NULL); - ASSERT(pFileInfo->firstVer >= 0); + int64_t idxOffset = (entry.ver - pFileInfo->firstVer) * sizeof(SWalIdxEntry); wDebug("vgId:%d, write index, index:%" PRId64 ", offset:%" PRId64 ", at %" PRId64, pWal->cfg.vgId, ver, offset, idxOffset); @@ -476,7 +464,6 @@ static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) { if (endOffset < 0) { wFatal("vgId:%d, failed to seek end of idxfile due to %s. ver:%" PRId64 "", pWal->cfg.vgId, strerror(errno), ver); } - ASSERT(endOffset == idxOffset + sizeof(SWalIdxEntry) && "Offset of idx entries misaligned"); return 0; } @@ -486,9 +473,7 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy int64_t offset = walGetCurFileOffset(pWal); SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); - ASSERT(pFileInfo != NULL); - ASSERT(pFileInfo->firstVer != -1); pWal->writeHead.head.version = index; pWal->writeHead.head.bodyLen = bodyLen; pWal->writeHead.head.msgType = msgType; @@ -525,7 +510,6 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy // set status if (pWal->vers.firstVer == -1) { - ASSERT(index == 0); pWal->vers.firstVer = 0; } pWal->vers.lastVer = index; @@ -541,7 +525,6 @@ END: wFatal("vgId:%d, failed to ftruncate logfile to offset:%" PRId64 " during recovery due to %s", pWal->cfg.vgId, offset, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); - ASSERT(0 && "failed to recover from error"); } int64_t idxOffset = (index - pFileInfo->firstVer) * sizeof(SWalIdxEntry); @@ -549,7 +532,6 @@ END: wFatal("vgId:%d, failed to ftruncate idxfile to offset:%" PRId64 "during recovery due to %s", pWal->cfg.vgId, idxOffset, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); - ASSERT(0 && "failed to recover from error"); } return -1; } @@ -576,8 +558,6 @@ int64_t walAppendLog(SWal *pWal, int64_t index, tmsg_t msgType, SWalSyncInfo syn } } - ASSERT(pWal->pLogFile != NULL && pWal->pIdxFile != NULL && pWal->writeCur >= 0); - if (walWriteImpl(pWal, index, msgType, syncMeta, body, bodyLen) < 0) { taosThreadMutexUnlock(&pWal->mutex); return -1; @@ -614,8 +594,6 @@ int32_t walWriteWithSyncInfo(SWal *pWal, int64_t index, tmsg_t msgType, SWalSync } } - ASSERT(pWal->pIdxFile != NULL && pWal->pLogFile != NULL && pWal->writeCur >= 0); - if (walWriteImpl(pWal, index, msgType, syncMeta, body, bodyLen) < 0) { taosThreadMutexUnlock(&pWal->mutex); return -1; diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py index 4e3c9d07ce..a6167158a2 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/auto_create_table_json.py @@ -153,6 +153,8 @@ class TDTestCase: tdSql.query("select count(*) from db.`stb4-2`") tdSql.checkData(0, 0, 160) + tAdapter.stop() + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py index e63908ce33..54657995e2 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/insert_alltypes_json.py @@ -320,7 +320,8 @@ class TDTestCase: tdSql.checkData(0, 0, 160) tdSql.query("select count(*) from db.stb where t13 like 'b1%' or t13 like 'b2%'") tdSql.checkData(0, 0, 160) - + + tAdapter.stop() def stop(self): tdSql.close() diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py index 375113c3ef..c906f61675 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/query_json.py @@ -116,11 +116,11 @@ class TDTestCase: assert times == 1, "result is %s != expect: 1" % times - + tAdapter.stop() def stop(self): - tdSql.close() + tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 5361ba356f..44bf6cc6f1 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -480,8 +480,8 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/countAlwaysReturnValue.py -R -,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py -,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/db.py -N 3 -n 3 -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py @@ -648,6 +648,9 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 6 -M 3 -n 3 + +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeModifyMeta.py -N 6 -M 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeModifyMeta.py -N 6 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 6 -M 3 @@ -658,6 +661,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3 + ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 @@ -1018,6 +1022,11 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py #develop test diff --git a/tests/pytest/util/cluster.py b/tests/pytest/util/cluster.py index 72b7e1fddf..2607cf63c2 100644 --- a/tests/pytest/util/cluster.py +++ b/tests/pytest/util/cluster.py @@ -53,7 +53,7 @@ class ConfigureyCluster: # configure dnoe of independent mnodes if num <= self.mnodeNums and self.mnodeNums != 0 and independentMnode == True : - dnode.addExtraCfg("supportVnodes", 0) + dnode.addExtraCfg("supportVnodes", 1024) # print(dnode) self.dnodes.append(dnode) return self.dnodes diff --git a/tests/pytest/util/taosadapter.py b/tests/pytest/util/taosadapter.py index 440c23dc65..5210825cde 100644 --- a/tests/pytest/util/taosadapter.py +++ b/tests/pytest/util/taosadapter.py @@ -227,7 +227,7 @@ class TAdapter: time.sleep(0.1) def stop(self, force_kill=False): - signal = "-SIGKILL" if force_kill else "-SIGTERM" + signal = "-9" if force_kill else "-15" if self.remoteIP: self.remote_exec(self.taosadapter_cfg_dict, "tAdapter.running=1\ntAdapter.stop()") @@ -238,16 +238,13 @@ class TAdapter: if self.running != 0: psCmd = f"ps -ef|grep -w {toBeKilled}| grep -v grep | awk '{{print $2}}'" - # psCmd = f"pgrep {toBeKilled}" - processID = subprocess.check_output( - psCmd, shell=True) - - while(processID): - killCmd = f"pkill {signal} {processID} > /dev/null " + # psCmd = f"pgrep {toBeKilled}" + processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() + while(processID): + killCmd = "kill %s %s > /dev/null 2>&1" % (signal, processID) os.system(killCmd) time.sleep(1) - processID = subprocess.check_output( - psCmd, shell=True).decode("utf-8") + processID = subprocess.check_output(psCmd, shell=True).decode("utf-8").strip() if not platform.system().lower() == 'windows': port = 6041 fuserCmd = f"fuser -k -n tcp {port} > /dev/null" diff --git a/tests/script/tmp/data.sim b/tests/script/tmp/data.sim index cdabc97c09..e3bfe23c3d 100644 --- a/tests/script/tmp/data.sim +++ b/tests/script/tmp/data.sim @@ -3,6 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 +system sh/deploy.sh -n dnode5 -i 5 +system sh/deploy.sh -n dnode6 -i 6 +system sh/deploy.sh -n dnode7 -i 7 system sh/cfg.sh -n dnode1 -c supportVnodes -v 0 system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode2 -s start @@ -14,6 +17,9 @@ print =============== step1: create dnodes sql create dnode $hostname port 7200 sql create dnode $hostname port 7300 sql create dnode $hostname port 7400 +sql create dnode $hostname port 7500 +sql create dnode $hostname port 7600 +sql create dnode $hostname port 7700 $x = 0 step1: @@ -29,7 +35,7 @@ print ===> $data00 $data01 $data02 $data03 $data04 $data05 print ===> $data10 $data11 $data12 $data13 $data14 $data15 print ===> $data20 $data21 $data22 $data23 $data24 $data25 print ===> $data30 $data31 $data32 $data33 $data24 $data35 -if $rows != 4 then +if $rows != 7 then return -1 endi if $data(1)[4] != ready then diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index cd4acae438..7220088369 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -68,6 +68,7 @@ class TDTestCase: my_file = Path(f"{packagePath}/{packageName}") if not my_file.exists(): print(f"{packageName} is not exists") + tdLog.info(f"cd {packagePath} && wget https://www.tdengine.com/assets-download/3.0/{packageName}") os.system(f"cd {packagePath} && wget https://www.tdengine.com/assets-download/3.0/{packageName}") else: print(f"{packageName} has been exists") diff --git a/tests/system-test/2-query/db.py b/tests/system-test/2-query/db.py index 7fe8b96157..d79e2074dd 100644 --- a/tests/system-test/2-query/db.py +++ b/tests/system-test/2-query/db.py @@ -42,16 +42,36 @@ class TDTestCase: tdSql.query("select count(c1) from dbns.ntb interval(1b)") tdSql.checkRows(2) + + def case2(self): + tdSql.query("show variables") + tdSql.checkRows(4) + + for i in range(self.replicaVar): + tdSql.query("show dnode %d variables like 'debugFlag'" % (i + 1)) + tdSql.checkRows(1) + tdSql.checkData(0, 0, i + 1) + tdSql.checkData(0, 1, 'debugFlag') + tdSql.checkData(0, 2, 0) + + tdSql.query("show dnode 1 variables like '%debugFlag'") + tdSql.checkRows(21) + + tdSql.query("show dnode 1 variables like '____debugFlag'") + tdSql.checkRows(2) def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring - tdSql.prepare() + tdSql.prepare(replica = self.replicaVar) + tdLog.printNoPrefix("==========start case1 run ...............") - self.case1() - tdLog.printNoPrefix("==========end case1 run ...............") + tdLog.printNoPrefix("==========start case2 run ...............") + self.case2() + tdLog.printNoPrefix("==========end case2 run ...............") + def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") diff --git a/tests/system-test/2-query/insert_null_none.py b/tests/system-test/2-query/insert_null_none.py new file mode 100755 index 0000000000..cf5636fb1f --- /dev/null +++ b/tests/system-test/2-query/insert_null_none.py @@ -0,0 +1,2579 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import os +import time +import taos +import subprocess +from faker import Faker +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql +from util.dnodes import tdDnodes +from util.dnodes import * + +class TDTestCase: + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"querySmaOptimize":1} + + def init(self, conn, logSql, replicaVar): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + self.testcasePath = os.path.split(__file__)[0] + self.testcaseFilename = os.path.split(__file__)[-1] + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.db = "insert_null_none" + + def dropandcreateDB_random(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + tdSql.execute('''drop database if exists %s ;''' %database) + tdSql.execute('''create database %s keep 36500 ;'''%(database)) + tdSql.execute('''use %s;'''%database) + + tdSql.execute('''create stable %s.stable_1 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);'''%database) + tdSql.execute('''create stable %s.stable_2 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);'''%database) + + for i in range(num_random): + tdSql.execute('''create table %s.table_%d \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp ) ;'''%(database,i)) + tdSql.execute('''create table %s.stable_1_%d using %s.stable_1 tags('stable_1_%d', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;''' + %(database,i,database,i,fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1))) + + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.query("select count(*) from %s.stable_1;" %database) + tdSql.checkData(0,0,num_random*n) + tdSql.query("select count(*) from %s.table_0;"%database) + tdSql.checkData(0,0,n) + + def qint_none(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qint_null(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qint_none_null(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qint_none_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qint_null_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qint_none_null_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, 'NULL', + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qbigint_none(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbigint_null(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), 'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), 'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbigint_none_null(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), 'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1),'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbigint_none_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbigint_null_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1),'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1),'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qbigint_none_null_value(self,database,n): + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1),'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1),'NULL', + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qsmallint_none(self,database,n): + tdLog.info("qsmallint_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qsmallint_null(self,database,n): + tdLog.info("qsmallint_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qsmallint_none_null(self,database,n): + tdLog.info("qsmallint_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , 'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qsmallint_none_value(self,database,n): + tdLog.info("qsmallint_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qsmallint_null_value(self,database,n): + tdLog.info("qsmallint_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qsmallint_none_null_value(self,database,n): + tdLog.info("qsmallint_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , 'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) ,'NULL', fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + + def qtinyint_none(self,database,n): + tdLog.info("qtinyint_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qtinyint_null(self,database,n): + tdLog.info("qtinyint_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qtinyint_none_null(self,database,n): + tdLog.info("qtinyint_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qtinyint_none_value(self,database,n): + tdLog.info("qtinyint_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qtinyint_null_value(self,database,n): + tdLog.info("qtinyint_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qtinyint_none_null_value(self,database,n): + tdLog.info("qtinyint_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qfloat_none(self,database,n): + tdLog.info("qfloat_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qfloat_null(self,database,n): + tdLog.info("qfloat_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , 'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qfloat_none_null(self,database,n): + tdLog.info("qfloat_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qfloat_none_value(self,database,n): + tdLog.info("qfloat_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qfloat_null_value(self,database,n): + tdLog.info("qfloat_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qfloat_none_null_value(self,database,n): + tdLog.info("qfloat_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) ,'NULL', + fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + + def qdouble_none(self,database,n): + tdLog.info("qdouble_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qdouble_null(self,database,n): + tdLog.info("qdouble_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + def qdouble_none_null(self,database,n): + tdLog.info("qdouble_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL' , fake.pystr() , fake.pystr() , ts + i )) + + def qdouble_none_value(self,database,n): + tdLog.info("qdouble_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qdouble_null_value(self,database,n): + tdLog.info("qdouble_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1), + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1), + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + + def qdouble_none_null_value(self,database,n): + tdLog.info("qdouble_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + + + + + def qbinary_none(self,database,n): + tdLog.info("qbinary_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + def qbinary_null(self,database,n): + tdLog.info("qbinary_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %s, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL', fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %s, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL', fake.pystr() , ts + i )) + + def qbinary_none_null(self,database,n): + tdLog.info("qbinary_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL', fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL', fake.pystr() , ts + i )) + + def qbinary_none_value(self,database,n): + tdLog.info("qbinary_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbinary_null_value(self,database,n): + tdLog.info("qbinary_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL', fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , ts + i )) + + + def qbinary_none_null_value(self,database,n): + tdLog.info("qbinary_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,'NULL' , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat(), 'NULL' , fake.pystr() , ts + i )) + + + + def qnchar_none(self,database,n): + tdLog.info("qnchar_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + def qnchar_null(self,database,n): + tdLog.info("qnchar_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() , 'NULL', ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() , 'NULL', ts + i )) + + def qnchar_none_null(self,database,n): + tdLog.info("qnchar_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() ,'NULL', ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() ,'NULL', ts + i )) + + def qnchar_none_value(self,database,n): + tdLog.info("qnchar_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary ,q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qnchar_null_value(self,database,n): + tdLog.info("qnchar_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() , 'NULL', ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,fake.pystr() ,'NULL', ts + i )) + + + def qnchar_none_null_value(self,database,n): + tdLog.info("qnchar_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary , q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %s , %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() , 'NULL' , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %s , %d) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat(), fake.pystr() , 'NULL' , ts + i )) + + def qts_none(self,database,n): + tdLog.info("qts_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + def qts_null(self,database,n): + tdLog.info("qts_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr(),fake.pystr() , 'NULL')) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr(),fake.pystr() , 'NULL' )) + + def qts_none_null(self,database,n): + tdLog.info("qts_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr(),'NULL')) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr(),'NULL' )) + + def qts_none_value(self,database,n): + tdLog.info("qts_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qts_null_value(self,database,n): + tdLog.info("qts_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s','nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() ,fake.pystr(), 'NULL')) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s','nchar.%s', %s) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,fake.pystr() ,fake.pystr(),'NULL' )) + + + def qts_none_null_value(self,database,n): + tdLog.info("qts_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary , q_nchar)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s' , %s) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() ,fake.pystr() ,fake.pystr() , 'NULL' )) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s' , %s) ;''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat(), fake.pystr() ,fake.pystr() , 'NULL' )) + + + def qbool_none(self,database,n): + tdLog.info("qbool_none") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat(), fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +1, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat(), fake.pystr() , fake.pystr() , ts + i )) + + def qbool_null(self,database,n): + tdLog.info("qbool_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +2, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) ,fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + def qbool_none_null(self,database,n): + tdLog.info("qbool_none_null") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +3, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +4, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + def qbool_none_value(self,database,n): + tdLog.info("qbool_none_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d);''' + % (database,i,ts + i*1000 + j + 5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +5, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat(), fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + def qbool_null_value(self,database,n): + tdLog.info("qbool_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(), fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1), + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +6, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1), + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + + def qbool_none_null_value(self,database,n): + tdLog.info("qbool_none_null_value") + ts = 1630000000000 + num_random = 10 + fake = Faker('zh_CN') + # insert data + for i in range(num_random): + for j in range(n): + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j + 7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j +7, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.random_int(min=-127, max=127, step=1) , fake.pyfloat() , fake.pyfloat(), fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)\ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i)) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;''' + % (database,i,ts + i*1000 + j, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d );''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat(),fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + tdSql.execute('''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts) \ + values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d );''' + % (database,i,ts + i*1000 + j + 8, + fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() ,fake.pyfloat() ,'NULL', fake.pystr() , fake.pystr() , ts + i )) + + def sqls(self,database): + sql = "select * from %s.stable_1 ;" %database + tdSql.query(sql) + sql = "select * from %s.table_1 ;" %database + tdSql.query(sql) + + sql1 = "select count(*) from %s.stable_1 ;" %database + tdSql.query(sql1) + sql1_value = tdSql.getData(0,0) + + sql2 = "select count(ts) from %s.stable_1 ;" %database + self.constant_check(sql1,sql2) + + sql3 = "select count(q_int) from %s.stable_1 ;" %database + self.constant_check(sql1,sql3) + + sql4 = "select count(q_bigint) from %s.stable_1 ;" %database + self.constant_check(sql1,sql4) + + sql5 = "select count(q_smallint) from %s.stable_1 ;" %database + self.constant_check(sql1,sql5) + + sql6 = "select count(q_tinyint) from %s.stable_1 ;" %database + self.constant_check(sql1,sql6) + + sql7 = "select count(q_float) from %s.stable_1 ;" %database + self.constant_check(sql1,sql7) + + sql8 = "select count(q_double) from %s.stable_1 ;" %database + self.constant_check(sql1,sql8) + + sql9 = "select count(q_bool) from %s.stable_1 ;" %database + self.constant_check(sql1,sql9) + + sql10 = "select count(q_binary) from %s.stable_1 ;" %database + self.constant_check(sql1,sql10) + + sql11 = "select count(q_nchar) from %s.stable_1 ;" %database + self.constant_check(sql1,sql11) + + sql12 = "select count(q_ts) from %s.stable_1 ;" %database + self.constant_check(sql1,sql12) + + def check_flushdb(self,database): + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qint_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qbigint_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbigint_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbigint_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbigint_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbigint_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbigint_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qsmallint_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qsmallint_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qsmallint_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qsmallint_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qsmallint_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qsmallint_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qtinyint_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qtinyint_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qtinyint_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qtinyint_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qtinyint_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qtinyint_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qfloat_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qfloat_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qfloat_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qfloat_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qfloat_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qfloat_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qdouble_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qdouble_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qdouble_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qdouble_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qdouble_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qdouble_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbinary_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qnchar_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qts_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qts_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qts_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qts_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qts_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qts_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + self.qbool_none(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbool_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbool_none_null(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbool_none_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbool_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + self.qbool_none_null_value(database, 10); + self.sqls(database); + tdSql.execute(" flush database %s;" %database) + tdLog.info("flush database success") + self.sqls(database); + + + def constant_check(self,sql1,sql2): + tdLog.info("\n=============sql1:(%s)___sql2:(%s) ====================\n" %(sql1,sql2)) + tdSql.query(sql1) + sql1_value = tdSql.getData(0,0) + tdSql.query(sql2) + sql2_value = tdSql.getData(0,0) + self.value_check(sql1_value,sql2_value) + + def value_check(self,base_value,check_value): + if base_value==check_value: + tdLog.info(f"checkEqual success, base_value={base_value},check_value={check_value}") + elif base_value > check_value: + tdLog.info(f"checkEqual success,but count not include NULL, base_value=={base_value},check_value={check_value}") + else : + tdLog.exit(f"checkEqual error, base_value=={base_value},check_value={check_value}") + + def run(self): + + startTime = time.time() + + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db, 10) + + self.check_flushdb("%s" %self.db) + + + # #taos -f sql + # startTime1 = time.time() + # print("taos -f sql start!") + # taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + # _ = subprocess.check_output(taos_cmd1, shell=True) + # print("taos -f sql over!") + # endTime1 = time.time() + # print("total time %ds" % (endTime1 - startTime1)) + + endTime = time.time() + print("total time %ds" % (endTime - startTime)) + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/system-test/2-query/interp.py b/tests/system-test/2-query/interp.py index ce57357abd..5077b70d72 100644 --- a/tests/system-test/2-query/interp.py +++ b/tests/system-test/2-query/interp.py @@ -362,12 +362,12 @@ class TDTestCase: tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(linear)") tdSql.checkRows(0) - tdLog.printNoPrefix("==========step8:test _irowts with interp") + tdLog.printNoPrefix("==========step8:test _irowts,_isfilled with interp") # fill null - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(null)") + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(null)") tdSql.checkRows(9) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') @@ -379,9 +379,19 @@ class TDTestCase: tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, False) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(null)") tdSql.checkRows(13) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') @@ -397,9 +407,23 @@ class TDTestCase: tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') tdSql.checkData(12, 0, '2020-02-01 00:00:16.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(null)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, False) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, False) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + tdSql.checkData(9, 1, True) + tdSql.checkData(10, 1, True) + tdSql.checkData(11, 1, False) + tdSql.checkData(12, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(null)") tdSql.checkRows(6) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') @@ -408,10 +432,16 @@ class TDTestCase: tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) # fill value - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(value, 1)") + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(value, 1)") tdSql.checkRows(9) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') @@ -423,9 +453,19 @@ class TDTestCase: tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, False) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)") tdSql.checkRows(13) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') @@ -441,9 +481,23 @@ class TDTestCase: tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') tdSql.checkData(12, 0, '2020-02-01 00:00:16.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(value, 1)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, False) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, False) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + tdSql.checkData(9, 1, True) + tdSql.checkData(10, 1, True) + tdSql.checkData(11, 1, False) + tdSql.checkData(12, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(value, 1)") tdSql.checkRows(6) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') @@ -452,10 +506,17 @@ class TDTestCase: tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) + # fill prev - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(prev)") + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(prev)") tdSql.checkRows(9) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') @@ -467,9 +528,19 @@ class TDTestCase: tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(prev)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, False) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(prev)") tdSql.checkRows(12) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:06.000') @@ -484,9 +555,22 @@ class TDTestCase: tdSql.checkData(10, 0, '2020-02-01 00:00:15.000') tdSql.checkData(11, 0, '2020-02-01 00:00:16.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(prev)") + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + tdSql.checkData(9, 1, True) + tdSql.checkData(10, 1, False) + tdSql.checkData(11, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(prev)") tdSql.checkRows(6) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') @@ -495,10 +579,16 @@ class TDTestCase: tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) # fill next - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(next)") + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(next)") tdSql.checkRows(9) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') @@ -510,9 +600,19 @@ class TDTestCase: tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, False) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") tdSql.checkRows(12) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') tdSql.checkData(1, 0, '2020-02-01 00:00:05.000') @@ -527,9 +627,22 @@ class TDTestCase: tdSql.checkData(10, 0, '2020-02-01 00:00:14.000') tdSql.checkData(11, 0, '2020-02-01 00:00:15.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(next)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, False) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, False) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + tdSql.checkData(9, 1, True) + tdSql.checkData(10, 1, True) + tdSql.checkData(11, 1, False) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(next)") tdSql.checkRows(6) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') @@ -538,10 +651,17 @@ class TDTestCase: tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) + # fill linear - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(linear)") + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:08', '2020-02-01 00:00:12') every(500a) fill(linear)") tdSql.checkRows(9) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:08.000') tdSql.checkData(1, 0, '2020-02-01 00:00:08.500') @@ -553,9 +673,19 @@ class TDTestCase: tdSql.checkData(7, 0, '2020-02-01 00:00:11.500') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkData(0, 1, True) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, False) + tdSql.checkData(5, 1, True) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") tdSql.checkRows(11) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:06.000') @@ -569,9 +699,21 @@ class TDTestCase: tdSql.checkData(9, 0, '2020-02-01 00:00:14.000') tdSql.checkData(10, 0, '2020-02-01 00:00:15.000') - tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(linear)") + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) + tdSql.checkData(6, 1, True) + tdSql.checkData(7, 1, True) + tdSql.checkData(8, 1, True) + tdSql.checkData(9, 1, True) + tdSql.checkData(10, 1, False) + + tdSql.query(f"select _irowts,_isfilled,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:05', '2020-02-01 00:00:15') every(2s) fill(linear)") tdSql.checkRows(6) - tdSql.checkCols(2) + tdSql.checkCols(3) tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(1, 0, '2020-02-01 00:00:07.000') @@ -580,28 +722,47 @@ class TDTestCase: tdSql.checkData(4, 0, '2020-02-01 00:00:13.000') tdSql.checkData(5, 0, '2020-02-01 00:00:15.000') - # multiple _irowts - tdSql.query(f"select interp(c0),_irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") - tdSql.checkRows(11) - tdSql.checkCols(2) + tdSql.checkData(0, 1, False) + tdSql.checkData(1, 1, True) + tdSql.checkData(2, 1, True) + tdSql.checkData(3, 1, True) + tdSql.checkData(4, 1, True) + tdSql.checkData(5, 1, False) - tdSql.checkData(0, 1, '2020-02-01 00:00:05.000') - tdSql.checkData(1, 1, '2020-02-01 00:00:06.000') - tdSql.checkData(2, 1, '2020-02-01 00:00:07.000') - tdSql.checkData(3, 1, '2020-02-01 00:00:08.000') - tdSql.checkData(4, 1, '2020-02-01 00:00:09.000') - tdSql.checkData(5, 1, '2020-02-01 00:00:10.000') - tdSql.checkData(6, 1, '2020-02-01 00:00:11.000') - tdSql.checkData(7, 1, '2020-02-01 00:00:12.000') - tdSql.checkData(8, 1, '2020-02-01 00:00:13.000') - tdSql.checkData(9, 1, '2020-02-01 00:00:14.000') + # multiple _irowts,_isfilled + tdSql.query(f"select interp(c0),_irowts,_isfilled from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkRows(11) + tdSql.checkCols(3) + + tdSql.checkData(0, 1, '2020-02-01 00:00:05.000') + tdSql.checkData(1, 1, '2020-02-01 00:00:06.000') + tdSql.checkData(2, 1, '2020-02-01 00:00:07.000') + tdSql.checkData(3, 1, '2020-02-01 00:00:08.000') + tdSql.checkData(4, 1, '2020-02-01 00:00:09.000') + tdSql.checkData(5, 1, '2020-02-01 00:00:10.000') + tdSql.checkData(6, 1, '2020-02-01 00:00:11.000') + tdSql.checkData(7, 1, '2020-02-01 00:00:12.000') + tdSql.checkData(8, 1, '2020-02-01 00:00:13.000') + tdSql.checkData(9, 1, '2020-02-01 00:00:14.000') tdSql.checkData(10, 1, '2020-02-01 00:00:15.000') - tdSql.query(f"select _irowts, interp(c0), interp(c0), _irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") - tdSql.checkRows(11) - tdSql.checkCols(4) + tdSql.checkData(0, 2, False) + tdSql.checkData(1, 2, True) + tdSql.checkData(2, 2, True) + tdSql.checkData(3, 2, True) + tdSql.checkData(4, 2, True) + tdSql.checkData(5, 2, False) + tdSql.checkData(6, 2, True) + tdSql.checkData(7, 2, True) + tdSql.checkData(8, 2, True) + tdSql.checkData(9, 2, True) + tdSql.checkData(10, 2, False) - cols = (0, 3) + tdSql.query(f"select _irowts, _isfilled, interp(c0), interp(c0), _isfilled, _irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") + tdSql.checkRows(11) + tdSql.checkCols(6) + + cols = (0, 5) for i in cols: tdSql.checkData(0, i, '2020-02-01 00:00:05.000') tdSql.checkData(1, i, '2020-02-01 00:00:06.000') @@ -615,6 +776,20 @@ class TDTestCase: tdSql.checkData(9, i, '2020-02-01 00:00:14.000') tdSql.checkData(10, i, '2020-02-01 00:00:15.000') + cols = (1, 4) + for i in cols: + tdSql.checkData(0, i, False) + tdSql.checkData(1, i, True) + tdSql.checkData(2, i, True) + tdSql.checkData(3, i, True) + tdSql.checkData(4, i, True) + tdSql.checkData(5, i, False) + tdSql.checkData(6, i, True) + tdSql.checkData(7, i, True) + tdSql.checkData(8, i, True) + tdSql.checkData(9, i, True) + tdSql.checkData(10, i, False) + tdLog.printNoPrefix("==========step9:test intra block interpolation") tdSql.execute(f"drop database {dbname}"); diff --git a/tests/system-test/2-query/leastsquares.py b/tests/system-test/2-query/leastsquares.py index 8ece4c46f0..1718802a82 100644 --- a/tests/system-test/2-query/leastsquares.py +++ b/tests/system-test/2-query/leastsquares.py @@ -19,12 +19,17 @@ BINARY_COL = "c8" NCHAR_COL = "c9" TS_COL = "c10" -NUM_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, ] +UINT_COL = "c11" +UBINT_COL = "c12" +USINT_COL = "c13" +UTINT_COL = "c14" + +NUM_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, UINT_COL, UBINT_COL, USINT_COL, UTINT_COL] CHAR_COL = [ BINARY_COL, NCHAR_COL, ] BOOLEAN_COL = [ BOOL_COL, ] TS_TYPE_COL = [ TS_COL, ] -ALL_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, BOOL_COL, BINARY_COL, NCHAR_COL, TS_COL ] +ALL_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, BOOL_COL, BINARY_COL, NCHAR_COL, TS_COL, UINT_COL, UBINT_COL, USINT_COL, UTINT_COL ] DBNAME = "db" class TDTestCase: @@ -208,6 +213,13 @@ class TDTestCase: tdLog.info(f"sql: {current_sqls[i]}") tdSql.query(current_sqls[i]) + def check_result(self): + for col in NUM_COL: + tdSql.query("select leastsquares(%s, 1, 9) from %s.stb1" % (col, DBNAME)) + tdSql.checkRows(1) + res = tdSql.getData(0, 0) + if res is None: + tdLog.exit("result is not correct") def __test_current(self): # tdSql.query("explain select c1 from {dbname}.ct1") @@ -236,6 +248,7 @@ class TDTestCase: def all_test(self): self.__test_error() self.__test_current() + self.check_result() def __create_tb(self, dbname=DBNAME): @@ -243,13 +256,15 @@ class TDTestCase: create_stb_sql = f'''create table {dbname}.stb1( ts timestamp, {INT_COL} int, {BINT_COL} bigint, {SINT_COL} smallint, {TINT_COL} tinyint, {FLOAT_COL} float, {DOUBLE_COL} double, {BOOL_COL} bool, - {BINARY_COL} binary(16), {NCHAR_COL} nchar(32), {TS_COL} timestamp + {BINARY_COL} binary(16), {NCHAR_COL} nchar(32), {TS_COL} timestamp, {UINT_COL} int unsigned, + {UBINT_COL} bigint unsigned, {USINT_COL} smallint unsigned, {UTINT_COL} tinyint unsigned ) tags (t1 int) ''' create_ntb_sql = f'''create table {dbname}.nt1( ts timestamp, {INT_COL} int, {BINT_COL} bigint, {SINT_COL} smallint, {TINT_COL} tinyint, {FLOAT_COL} float, {DOUBLE_COL} double, {BOOL_COL} bool, - {BINARY_COL} binary(16), {NCHAR_COL} nchar(32), {TS_COL} timestamp + {BINARY_COL} binary(16), {NCHAR_COL} nchar(32), {TS_COL} timestamp, {UINT_COL} int unsigned, + {UBINT_COL} bigint unsigned, {USINT_COL} smallint unsigned, {UTINT_COL} tinyint unsigned ) ''' tdSql.execute(create_stb_sql) @@ -262,49 +277,49 @@ class TDTestCase: now_time = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000) for i in range(rows): tdSql.execute( - f"insert into {dbname}.ct1 values ( { now_time - i * 1000 }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127}, {1.11*i}, {1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i } )" + f"insert into {dbname}.ct1 values ( { now_time - i * 1000 }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127}, {1.11*i}, {1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127} )" ) tdSql.execute( - f"insert into {dbname}.ct4 values ( { now_time - i * 7776000000 }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127}, {1.11*i}, {1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i } )" + f"insert into {dbname}.ct4 values ( { now_time - i * 7776000000 }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127}, {1.11*i}, {1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127} )" ) tdSql.execute( - f"insert into {dbname}.ct2 values ( { now_time - i * 7776000000 }, {-i}, {-11111 * i}, {-111 * i % 32767 }, {-11 * i % 127}, {-1.11*i}, {-1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i } )" + f"insert into {dbname}.ct2 values ( { now_time - i * 7776000000 }, {-i}, {-11111 * i}, {-111 * i % 32767 }, {-11 * i % 127}, {-1.11*i}, {-1100.0011*i}, {i%2}, 'binary{i}', 'nchar_测试_{i}', { now_time + 1 * i }, {i}, {11111 * i}, {111 * i % 32767 }, {11 * i % 127} )" ) tdSql.execute( f'''insert into {dbname}.ct1 values - ( { now_time - rows * 5 }, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar_测试_0', { now_time + 8 } ) - ( { now_time + 10000 }, { rows }, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar_测试_9', { now_time + 9 } ) + ( { now_time - rows * 5 }, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar_测试_0', { now_time + 8 }, 0, 0, 0, 0) + ( { now_time + 10000 }, { rows }, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar_测试_9', { now_time + 9 }, 0, 0, 0, NULL ) ''' ) tdSql.execute( f'''insert into {dbname}.ct4 values - ( { now_time - rows * 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time - rows * 3888000000 + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time + 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time - rows * 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time - rows * 3888000000 + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time + 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) ( { now_time + 5184000000}, {pow(2,31)-pow(2,15)}, {pow(2,63)-pow(2,30)}, 32767, 127, - { 3.3 * pow(10,38) }, { 1.3 * pow(10,308) }, { rows % 2 }, "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000} + { 3.3 * pow(10,38) }, { 1.3 * pow(10,308) }, { rows % 2 }, "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000}, NULL, NULL, NULL, NULL ) ( { now_time + 2592000000 }, {pow(2,31)-pow(2,16)}, {pow(2,63)-pow(2,31)}, 32766, 126, - { 3.2 * pow(10,38) }, { 1.2 * pow(10,308) }, { (rows-1) % 2 }, "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000} + { 3.2 * pow(10,38) }, { 1.2 * pow(10,308) }, { (rows-1) % 2 }, "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000}, NULL, NULL, NULL, NULL ) ''' ) tdSql.execute( f'''insert into {dbname}.ct2 values - ( { now_time - rows * 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time - rows * 3888000000 + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time + 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time - rows * 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) + ( { now_time - rows * 3888000000 + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time + 7776000000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ( { now_time + 5184000000 }, { -1 * pow(2,31) + pow(2,15) }, { -1 * pow(2,63) + pow(2,30) }, -32766, -126, - { -1 * 3.2 * pow(10,38) }, { -1.2 * pow(10,308) }, { rows % 2 }, "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000 } + { -1 * 3.2 * pow(10,38) }, { -1.2 * pow(10,308) }, { rows % 2 }, "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000 }, NULL, NULL, NULL, NULL ) ( { now_time + 2592000000 }, { -1 * pow(2,31) + pow(2,16) }, { -1 * pow(2,63) + pow(2,31) }, -32767, -127, - { - 3.3 * pow(10,38) }, { -1.3 * pow(10,308) }, { (rows-1) % 2 }, "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000 } + { - 3.3 * pow(10,38) }, { -1.3 * pow(10,308) }, { (rows-1) % 2 }, "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000 }, NULL, NULL, NULL, NULL ) ''' ) @@ -312,22 +327,22 @@ class TDTestCase: for i in range(rows): insert_data = f'''insert into {dbname}.nt1 values ( { now_time - i * 3600000 }, {i}, {i * 11111}, { i % 32767 }, { i % 127}, { i * 1.11111 }, { i * 1000.1111 }, { i % 2}, - "binary_{i}", "nchar_测试_{i}", { now_time - 1000 * i } ) + "binary_{i}", "nchar_测试_{i}", { now_time - 1000 * i }, NULL, NULL, NULL, NULL ) ''' tdSql.execute(insert_data) tdSql.execute( f'''insert into {dbname}.nt1 values - ( { now_time + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time - (( rows // 2 ) * 60 + 30) * 60000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) - ( { now_time - rows * 3600000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time + 10800000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time - (( rows // 2 ) * 60 + 30) * 60000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) + ( { now_time - rows * 3600000 }, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ( { now_time + 7200000 }, { pow(2,31) - pow(2,15) }, { pow(2,63) - pow(2,30) }, 32767, 127, { 3.3 * pow(10,38) }, { 1.3 * pow(10,308) }, { rows % 2 }, - "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000 } + "binary_limit-1", "nchar_测试_limit-1", { now_time - 86400000 }, NULL, NULL, NULL, NULL ) ( { now_time + 3600000 } , { pow(2,31) - pow(2,16) }, { pow(2,63) - pow(2,31) }, 32766, 126, { 3.2 * pow(10,38) }, { 1.2 * pow(10,308) }, { (rows-1) % 2 }, - "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000 } + "binary_limit-2", "nchar_测试_limit-2", { now_time - 172800000 }, NULL, NULL, NULL, NULL ) ''' ) diff --git a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py index 94e02b77b3..392b0d7764 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py +++ b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py @@ -161,6 +161,19 @@ class TDTestCase: stableName= '%s_%d'%(paraDict['stbName'],i) newTdSql=tdCom.newTdSql() threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) + + for i in range(5): + clusterComCreate.createUser(newTdSql,f"user{i}",f"pass{i}") + userTdSql=tdCom.newTdSql(user=f"user{i}",password=f"pass{i}") + clusterComCreate.alterUser(userTdSql,f"user{i}",f"pass{i+1}") + clusterComCreate.deleteUser(newTdSql,f"user{i}") + for j in range(5): + i=100 + clusterComCreate.createUser(newTdSql,f"user{i}",f"pass{i}") + userTdSql=tdCom.newTdSql(user=f"user{i}",password=f"pass{i}") + clusterComCreate.alterUser(userTdSql,f"user{i}",f"pass{i+1}") + clusterComCreate.deleteUser(newTdSql,f"user{i}") + for tr in threads: tr.start() for tr in threads: diff --git a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py index d6d06446a1..66c2fdd14f 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py +++ b/tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py @@ -67,29 +67,11 @@ class TDTestCase: self._async_raise(thread.ident, SystemExit) - def insertData(self,countstart,countstop): - # fisrt add data : db\stable\childtable\general table - - for couti in range(countstart,countstop): - tdLog.debug("drop database if exists db%d" %couti) - tdSql.execute("drop database if exists db%d" %couti) - print("create database if not exists db%d replica 1 duration 300" %couti) - tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) - tdSql.execute("use db%d" %couti) - tdSql.execute( - '''create table stb1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - tags (t1 int) - ''' - ) - tdSql.execute( - ''' - create table t1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - ''' - ) - for i in range(4): - tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') + def reCreateUser(self, tdsql, count, user, passwd): + clusterComCreate.createUser(tdsql,f"{user}{count}",f"{passwd}{count}") + userTdSql=tdCom.newTdSql(user=f"{user}{count}",password=f"{passwd}{count}") + clusterComCreate.alterUser(userTdSql,f"{user}{count}",f"{passwd}{count+1}") + clusterComCreate.deleteUser(tdsql,f"{user}{count}") def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): @@ -161,6 +143,8 @@ class TDTestCase: stableName= '%s_%d'%(paraDict['stbName'],i) newTdSql=tdCom.newTdSql() threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) + threads.append(threading.Thread(target=self.reCreateUser,args=(newTdSql,i,"user","passwd"))) + for tr in threads: tr.start() diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py index 881f383b8c..b55c689eee 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py @@ -147,6 +147,9 @@ class TDTestCase: # print(f"==================={dbNameIndex},{a11111}") threads.append(threading.Thread(target=clusterComCreate.createDeltedatabases, args=(newTdSql, dbNameIndex,repeatNumber,paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']))) + redbNameIndex = '%s%d'%(paraDict["dbName"],i+100) + threads.append(threading.Thread(target=clusterComCreate.createDeltedatabases, args=(newTdSql, redbNameIndex,1,paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']))) + for tr in threads: tr.start() @@ -199,7 +202,7 @@ class TDTestCase: def run(self): # print(self.master_dnode.cfgDict) - self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=4,stopRole='dnode') + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=1,stopRole='dnode') def stop(self): tdSql.close() diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeInsertData.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeInsertData.py index 265000bdc9..296e9daeca 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeInsertData.py +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeInsertData.py @@ -97,7 +97,7 @@ class TDTestCase: 'dropFlag': 1, 'event': '', 'vgroups': 4, - 'replica': 1, + 'replica': 3, 'stbName': 'stb', 'stbNumbers': 2, 'colPrefix': 'c', @@ -105,9 +105,9 @@ class TDTestCase: 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], 'ctbPrefix': 'ctb', - 'ctbNum': 200, + 'ctbNum': 100, 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 - "rowsPerTbl": 10000, + "rowsPerTbl": 100000, "batchNum": 5000 } @@ -198,16 +198,16 @@ class TDTestCase: clusterComCheck.checkDbRows(dbNumbers) # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"]) - tdSql.execute("use %s" %(paraDict["dbName"])) - tdSql.query("show stables") + # tdSql.execute("use %s" %(paraDict["dbName"])) + tdSql.query("show %s.stables"%(paraDict["dbName"])) tdSql.checkRows(paraDict["stbNumbers"]) for i in range(paraDict['stbNumbers']): - stableName= '%s_%d'%(paraDict['stbName'],i) - tdSql.query("select * from %s"%stableName) - tdSql.checkRows(rowsPerStb) + stableName= '%s.%s_%d'%(paraDict["dbName"],paraDict['stbName'],i) + tdSql.query("select count(*) from %s"%stableName) + tdSql.checkData(0,0,rowsPerStb) def run(self): # print(self.master_dnode.cfgDict) - self.fiveDnodeThreeMnode(dnodeNumbers=5,mnodeNums=3,restartNumbers=2,stopRole='dnode') + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=1,stopRole='dnode') def stop(self): tdSql.close() diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeModifyMeta.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeModifyMeta.py new file mode 100644 index 0000000000..06d626b77c --- /dev/null +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeModifyMeta.py @@ -0,0 +1,202 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +from numpy import row_stack +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +sys.path.append("./6-cluster") +from clusterCommonCreate import * +from clusterCommonCheck import clusterComCheck + +import time +import socket +import subprocess +from multiprocessing import Process +import threading +import time +import inspect +import ctypes + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + self.TDDnodes = None + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def _async_raise(self, tid, exctype): + """raises the exception, performs cleanup if needed""" + if not inspect.isclass(exctype): + exctype = type(exctype) + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) + if res == 0: + raise ValueError("invalid thread id") + elif res != 1: + # """if it returns a number greater than one, you're in trouble, + # and you should call it again with exc=NULL to revert the effect""" + ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None) + raise SystemError("PyThreadState_SetAsyncExc failed") + + def stopThread(self,thread): + self._async_raise(thread.ident, SystemExit) + + + def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): + tdLog.printNoPrefix("======== test case 1: ") + paraDict = {'dbName': 'db0_0', + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'replica': 3, + 'stbName': 'stb', + 'stbNumbers': 2, + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbNum': 200, + 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 + "rowsPerTbl": 1000, + "batchNum": 5000 + } + + dnodeNumbers=int(dnodeNumbers) + mnodeNums=int(mnodeNums) + vnodeNumbers = int(dnodeNumbers-mnodeNums) + allctbNumbers=(paraDict['stbNumbers']*paraDict["ctbNum"]) + rowsPerStb=paraDict["ctbNum"]*paraDict["rowsPerTbl"] + rowsall=rowsPerStb*paraDict['stbNumbers'] + dbNumbers = 1 + + tdLog.info("first check dnode and mnode") + tdSql.query("select * from information_schema.ins_dnodes;") + tdSql.checkData(0,1,'%s:6030'%self.host) + tdSql.checkData(4,1,'%s:6430'%self.host) + clusterComCheck.checkDnodes(dnodeNumbers) + + #check mnode status + tdLog.info("check mnode status") + clusterComCheck.checkMnodeStatus(mnodeNums) + + # add some error operations and + tdLog.info("Confirm the status of the dnode again") + tdSql.error("create mnode on dnode 2") + tdSql.query("select * from information_schema.ins_dnodes;") + print(tdSql.queryResult) + clusterComCheck.checkDnodes(dnodeNumbers) + + # create database and stable + clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) + tdLog.info("Take turns stopping Mnodes ") + + tdDnodes=cluster.dnodes + stopcount =0 + threads=[] + + # create stable:stb_0 + stableName= paraDict['stbName'] + newTdSql=tdCom.newTdSql() + clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers']) + #create child table:ctb_0 + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum']) + #insert date + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) + for tr in threads: + tr.start() + for tr in threads: + tr.join() + + while stopcount < restartNumbers: + tdLog.info(" restart loop: %d"%stopcount ) + if stopRole == "mnode": + for i in range(mnodeNums): + tdDnodes[i].stoptaosd() + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + elif stopRole == "vnode": + for i in range(vnodeNumbers): + tdDnodes[i+mnodeNums].stoptaosd() + # sleep(10) + tdDnodes[i+mnodeNums].starttaosd() + # sleep(10) + elif stopRole == "dnode": + for i in range(dnodeNumbers): + tdDnodes[i].stoptaosd() + clusterComCheck.checkDbRows(dbNumbers) + if i == 0 : + stableName= '%s_%d'%(paraDict['stbName'],0) + newTdSql=tdCom.newTdSql() + clusterComCreate.alterStbMetaData(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"]) + # sleep(10) + tdDnodes[i].starttaosd() + + + # dnodeNumbers don't include database of schema + if clusterComCheck.checkDnodes(dnodeNumbers): + tdLog.info("123") + else: + print("456") + + self.stopThread(threads) + tdLog.exit("one or more of dnodes failed to start ") + # self.check3mnode() + stopcount+=1 + + + clusterComCheck.checkDnodes(dnodeNumbers) + clusterComCheck.checkDbRows(dbNumbers) + # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"]) + + # tdSql.execute("use %s" %(paraDict["dbName"])) + tdSql.query("show %s.stables"%(paraDict["dbName"])) + tdSql.checkRows(paraDict["stbNumbers"]) + for i in range(paraDict['stbNumbers']): + stableName= '%s.%s_%d'%(paraDict["dbName"],paraDict['stbName'],i) + tdSql.query("select count(*) from %s"%stableName) + if i == 0 : + tdSql.checkData(0,0,rowsPerStb*2) + else: + tdSql.checkData(0,0,rowsPerStb) + def run(self): + # print(self.master_dnode.cfgDict) + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=1,stopRole='dnode') + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeRCreateDb.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeRCreateDb.py new file mode 100644 index 0000000000..9d99980b88 --- /dev/null +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopDnodeRCreateDb.py @@ -0,0 +1,209 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +sys.path.append("./6-cluster") +from clusterCommonCreate import * +from clusterCommonCheck import clusterComCheck + +import time +import socket +import subprocess +from multiprocessing import Process +import threading +import time +import inspect +import ctypes + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + self.TDDnodes = None + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + self.replicaVar=int(replicaVar) + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def _async_raise(self, tid, exctype): + """raises the exception, performs cleanup if needed""" + if not inspect.isclass(exctype): + exctype = type(exctype) + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) + if res == 0: + raise ValueError("invalid thread id") + elif res != 1: + # """if it returns a number greater than one, you're in trouble, + # and you should call it again with exc=NULL to revert the effect""" + ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None) + raise SystemError("PyThreadState_SetAsyncExc failed") + + def stopThread(self,thread): + self._async_raise(thread.ident, SystemExit) + + + def insertData(self,countstart,countstop): + # fisrt add data : db\stable\childtable\general table + + for couti in range(countstart,countstop): + tdLog.debug("drop database if exists db%d" %couti) + tdSql.execute("drop database if exists db%d" %couti) + print("create database if not exists db%d replica 1 duration 300" %couti) + tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) + tdSql.execute("use db%d" %couti) + tdSql.execute( + '''create table stb1 + (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) + tags (t1 int) + ''' + ) + tdSql.execute( + ''' + create table t1 + (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) + ''' + ) + for i in range(4): + tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') + + + def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): + tdLog.printNoPrefix("======== test case 1: ") + paraDict = {'dbName': 'db', + 'dbNumbers': 4, + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'replica': 3, + 'stbName': 'stb', + 'stbNumbers': 100, + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbNum': 1, + } + + dnodeNumbers=int(dnodeNumbers) + dbNumbers=paraDict['dbNumbers'] + mnodeNums=int(mnodeNums) + repeatNumber = 2 + vnodeNumbers = int(dnodeNumbers-mnodeNums) + allDbNumbers=dbNumbers + allStbNumbers=(paraDict['stbNumbers']*restartNumbers) + paraDict['replica'] = self.replicaVar + + tdLog.info("first check dnode and mnode") + tdSql.query("select * from information_schema.ins_dnodes;") + tdSql.checkData(0,1,'%s:6030'%self.host) + tdSql.checkData(4,1,'%s:6430'%self.host) + clusterComCheck.checkDnodes(dnodeNumbers) + + #check mnode status + tdLog.info("check mnode status") + clusterComCheck.checkMnodeStatus(mnodeNums) + + # add some error operations and + tdLog.info("Confirm the status of the dnode again") + tdSql.error("create mnode on dnode 2") + tdSql.query("select * from information_schema.ins_dnodes;") + print(tdSql.queryResult) + clusterComCheck.checkDnodes(dnodeNumbers) + + # create database and stable + + + tdDnodes=cluster.dnodes + stopcount =0 + threads=[] + for i in range(dbNumbers): + dbNameIndex = '%s%d'%(paraDict["dbName"],0) + newTdSql=tdCom.newTdSql() + # a11111=paraDict["dbNumbers"] + # print(f"==================={dbNameIndex},{a11111}") + clusterComCreate.createDeltedatabases(newTdSql, dbNameIndex,repeatNumber,paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) + + redbNameIndex = '%s%d'%(paraDict["dbName"],100) + clusterComCreate.createDeltedatabases(newTdSql, redbNameIndex,1,paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) + + + tdLog.info("Take turns stopping Mnodes ") + while stopcount < restartNumbers: + tdLog.info(" restart loop: %d"%stopcount ) + if stopRole == "mnode": + for i in range(mnodeNums): + tdDnodes[i].stoptaosd() + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + elif stopRole == "vnode": + for i in range(vnodeNumbers): + tdDnodes[i+mnodeNums].stoptaosd() + # sleep(10) + tdDnodes[i+mnodeNums].starttaosd() + # sleep(10) + elif stopRole == "dnode": + for i in range(dnodeNumbers): + tdDnodes[i].stoptaosd() + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + + # dnodeNumbers don't include database of schema + if clusterComCheck.checkDnodes(dnodeNumbers): + tdLog.info("check dnodes status is ready") + else: + tdLog.info("check dnodes status is not ready") + self.stopThread(threads) + tdLog.exit("one or more of dnodes failed to start ") + # self.check3mnode() + stopcount+=1 + + + tdLog.info("check dnode number:") + clusterComCheck.checkDnodes(dnodeNumbers) + tdSql.query("select * from information_schema.ins_databases") + tdLog.debug("we find %d databases but exepect to create %d databases "%(tdSql.queryRows-2,allDbNumbers)) + + # tdLog.info("check DB Rows:") + # clusterComCheck.checkDbRows(allDbNumbers) + # tdLog.info("check DB Status on by on") + # for i in range(restartNumbers): + # clusterComCheck.checkDb(paraDict['dbNumbers'],restartNumbers,dbNameIndex = '%s%d'%(paraDict["dbName"],i)) + + + + def run(self): + # print(self.master_dnode.cfgDict) + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=2,stopRole='dnode') + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeModifyMeta.py b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeModifyMeta.py new file mode 100644 index 0000000000..3e4dc2483f --- /dev/null +++ b/tests/system-test/6-cluster/5dnode3mnodeSep1VnodeStopMnodeModifyMeta.py @@ -0,0 +1,207 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +from numpy import row_stack +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +sys.path.append("./6-cluster") +from clusterCommonCreate import * +from clusterCommonCheck import clusterComCheck + +import time +import socket +import subprocess +from multiprocessing import Process +import threading +import time +import inspect +import ctypes + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + self.TDDnodes = None + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def _async_raise(self, tid, exctype): + """raises the exception, performs cleanup if needed""" + if not inspect.isclass(exctype): + exctype = type(exctype) + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) + if res == 0: + raise ValueError("invalid thread id") + elif res != 1: + # """if it returns a number greater than one, you're in trouble, + # and you should call it again with exc=NULL to revert the effect""" + ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None) + raise SystemError("PyThreadState_SetAsyncExc failed") + + def stopThread(self,thread): + self._async_raise(thread.ident, SystemExit) + + + def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): + tdLog.printNoPrefix("======== test case 1: ") + paraDict = {'dbName': 'db0_0', + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'replica': 3, + 'stbName': 'stb', + 'stbNumbers': 2, + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbNum': 200, + 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 + "rowsPerTbl": 1000, + "batchNum": 5000 + } + + dnodeNumbers=int(dnodeNumbers) + mnodeNums=int(mnodeNums) + vnodeNumbers = int(dnodeNumbers-mnodeNums) + allctbNumbers=(paraDict['stbNumbers']*paraDict["ctbNum"]) + rowsPerStb=paraDict["ctbNum"]*paraDict["rowsPerTbl"] + rowsall=rowsPerStb*paraDict['stbNumbers'] + dbNumbers = 1 + + tdLog.info("first check dnode and mnode") + tdSql.query("select * from information_schema.ins_dnodes;") + tdSql.checkData(0,1,'%s:6030'%self.host) + tdSql.checkData(4,1,'%s:6430'%self.host) + clusterComCheck.checkDnodes(dnodeNumbers) + + #check mnode status + tdLog.info("check mnode status") + clusterComCheck.checkMnodeStatus(mnodeNums) + + # add some error operations and + tdLog.info("Confirm the status of the dnode again") + tdSql.error("create mnode on dnode 2") + tdSql.query("select * from information_schema.ins_dnodes;") + print(tdSql.queryResult) + clusterComCheck.checkDnodes(dnodeNumbers) + + # create database and stable + clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) + tdLog.info("Take turns stopping Mnodes ") + + tdDnodes=cluster.dnodes + stopcount =0 + threads=[] + + # create stable:stb_0 + stableName= paraDict['stbName'] + newTdSql=tdCom.newTdSql() + clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers']) + #create child table:ctb_0 + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum']) + #insert date + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) + for tr in threads: + tr.start() + for tr in threads: + tr.join() + + while stopcount < restartNumbers: + tdLog.info(" restart loop: %d"%stopcount ) + if stopRole == "mnode": + for i in range(mnodeNums): + tdDnodes[i].stoptaosd() + if i == 0 : + stableName= '%s_%d'%(paraDict['stbName'],0) + newTdSql=tdCom.newTdSql() + clusterComCreate.alterStbMetaData(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"]) + elif i == 1 : + tdSql.execute("ALTER TABLE db0_0.stb_0_0 SET TAG t1r=10000;") + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + elif stopRole == "vnode": + for i in range(vnodeNumbers): + tdDnodes[i+mnodeNums].stoptaosd() + # sleep(10) + tdDnodes[i+mnodeNums].starttaosd() + # sleep(10) + elif stopRole == "dnode": + for i in range(dnodeNumbers): + tdDnodes[i].stoptaosd() + clusterComCheck.checkDbRows(dbNumbers) + + # sleep(10) + tdDnodes[i].starttaosd() + + + # dnodeNumbers don't include database of schema + if clusterComCheck.checkDnodes(dnodeNumbers): + tdLog.info("123") + else: + print("456") + + self.stopThread(threads) + tdLog.exit("one or more of dnodes failed to start ") + # self.check3mnode() + stopcount+=1 + + + clusterComCheck.checkDnodes(dnodeNumbers) + clusterComCheck.checkDbRows(dbNumbers) + # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"]) + + # tdSql.execute("use %s" %(paraDict["dbName"])) + tdSql.query("select t1r from db0_0.stb_0_0 limit 1;") + tdSql.checkData(0,0,10000) + tdSql.query("show %s.stables"%(paraDict["dbName"])) + tdSql.checkRows(paraDict["stbNumbers"]) + for i in range(paraDict['stbNumbers']): + stableName= '%s.%s_%d'%(paraDict["dbName"],paraDict['stbName'],i) + tdSql.query("select count(*) from %s"%stableName) + if i == 0 : + tdSql.checkData(0,0,rowsPerStb*2) + else: + tdSql.checkData(0,0,rowsPerStb) + def run(self): + # print(self.master_dnode.cfgDict) + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=1,stopRole='mnode') + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode3mnodeSepVnodeStopDnodeCreateUser.py b/tests/system-test/6-cluster/5dnode3mnodeSepVnodeStopDnodeCreateUser.py new file mode 100644 index 0000000000..94e02b77b3 --- /dev/null +++ b/tests/system-test/6-cluster/5dnode3mnodeSepVnodeStopDnodeCreateUser.py @@ -0,0 +1,224 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +from numpy import row_stack +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +sys.path.append("./6-cluster") +from clusterCommonCreate import * +from clusterCommonCheck import clusterComCheck + +import time +import socket +import subprocess +from multiprocessing import Process +import threading +import time +import inspect +import ctypes + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + self.TDDnodes = None + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + self.replicaVar = int(replicaVar) + + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root) - len("/build/bin")] + break + return buildPath + + def _async_raise(self, tid, exctype): + """raises the exception, performs cleanup if needed""" + if not inspect.isclass(exctype): + exctype = type(exctype) + res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) + if res == 0: + raise ValueError("invalid thread id") + elif res != 1: + # """if it returns a number greater than one, you're in trouble, + # and you should call it again with exc=NULL to revert the effect""" + ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None) + raise SystemError("PyThreadState_SetAsyncExc failed") + + def stopThread(self,thread): + self._async_raise(thread.ident, SystemExit) + + + def insertData(self,countstart,countstop): + # fisrt add data : db\stable\childtable\general table + + for couti in range(countstart,countstop): + tdLog.debug("drop database if exists db%d" %couti) + tdSql.execute("drop database if exists db%d" %couti) + print("create database if not exists db%d replica 1 duration 300" %couti) + tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) + tdSql.execute("use db%d" %couti) + tdSql.execute( + '''create table stb1 + (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) + tags (t1 int) + ''' + ) + tdSql.execute( + ''' + create table t1 + (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) + ''' + ) + for i in range(4): + tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') + + + def fiveDnodeThreeMnode(self,dnodeNumbers,mnodeNums,restartNumbers,stopRole): + tdLog.printNoPrefix("======== test case 1: ") + paraDict = {'dbName': 'db0_0', + 'dropFlag': 1, + 'event': '', + 'vgroups': 4, + 'replica': 1, + 'stbName': 'stb', + 'stbNumbers': 2, + 'colPrefix': 'c', + 'tagPrefix': 't', + 'colSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'tagSchema': [{'type': 'INT', 'count':1}, {'type': 'binary', 'len':20, 'count':1}], + 'ctbPrefix': 'ctb', + 'ctbNum': 200, + 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 + "rowsPerTbl": 100, + "batchNum": 5000 + } + + dnodeNumbers=int(dnodeNumbers) + mnodeNums=int(mnodeNums) + vnodeNumbers = int(dnodeNumbers-mnodeNums) + allctbNumbers=(paraDict['stbNumbers']*paraDict["ctbNum"]) + rowsPerStb=paraDict["ctbNum"]*paraDict["rowsPerTbl"] + rowsall=rowsPerStb*paraDict['stbNumbers'] + dbNumbers = 1 + paraDict['replica'] = self.replicaVar + + tdLog.info("first check dnode and mnode") + tdSql.query("select * from information_schema.ins_dnodes;") + tdSql.checkData(0,1,'%s:6030'%self.host) + tdSql.checkData(4,1,'%s:6430'%self.host) + clusterComCheck.checkDnodes(dnodeNumbers) + + #check mnode status + tdLog.info("check mnode status") + clusterComCheck.checkMnodeStatus(mnodeNums) + + + # add some error operations and + tdLog.info("Confirm the status of the dnode again") + tdSql.error("create mnode on dnode 2") + tdSql.query("select * from information_schema.ins_dnodes;") + print(tdSql.queryResult) + clusterComCheck.checkDnodes(dnodeNumbers) + + # create database and stable + clusterComCreate.create_database(tdSql, paraDict["dbName"],paraDict["dropFlag"], paraDict["vgroups"],paraDict['replica']) + tdLog.info("Take turns stopping Mnodes ") + + tdDnodes=cluster.dnodes + stopcount =0 + threads=[] + + # create stable:stb_0 + stableName= paraDict['stbName'] + newTdSql=tdCom.newTdSql() + clusterComCreate.create_stables(newTdSql, paraDict["dbName"],stableName,paraDict['stbNumbers']) + #create child table:ctb_0 + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + clusterComCreate.create_ctable(newTdSql, paraDict["dbName"],stableName,stableName, paraDict['ctbNum']) + #insert data + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql=tdCom.newTdSql() + threads.append(threading.Thread(target=clusterComCreate.insert_data, args=(newTdSql, paraDict["dbName"],stableName,paraDict["ctbNum"],paraDict["rowsPerTbl"],paraDict["batchNum"],paraDict["startTs"]))) + for tr in threads: + tr.start() + for tr in threads: + tr.join() + + while stopcount < restartNumbers: + tdLog.info(" restart loop: %d"%stopcount ) + if stopRole == "mnode": + for i in range(mnodeNums): + tdDnodes[i].stoptaosd() + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + elif stopRole == "vnode": + for i in range(vnodeNumbers): + tdDnodes[i+mnodeNums].stoptaosd() + # sleep(10) + tdDnodes[i+mnodeNums].starttaosd() + # sleep(10) + elif stopRole == "dnode": + for i in range(dnodeNumbers): + tdDnodes[i].stoptaosd() + # sleep(10) + tdDnodes[i].starttaosd() + # sleep(10) + + # dnodeNumbers don't include database of schema + if clusterComCheck.checkDnodes(dnodeNumbers): + tdLog.info("dnode is ready") + else: + print("dnodes is not ready") + self.stopThread(threads) + tdLog.exit("one or more of dnodes failed to start ") + # self.check3mnode() + stopcount+=1 + + + clusterComCheck.checkDnodes(dnodeNumbers) + clusterComCheck.checkDbRows(dbNumbers) + # clusterComCheck.checkDb(dbNumbers,1,paraDict["dbName"]) + + newTdSql=tdCom.newTdSql() + newTdSql.execute("reset query cache") + newTdSql.execute("use %s" %(paraDict["dbName"])) + newTdSql.query("show %s.stables"%(paraDict["dbName"])) + newTdSql.checkRows(paraDict["stbNumbers"]) + for i in range(paraDict['stbNumbers']): + stableName= '%s_%d'%(paraDict['stbName'],i) + newTdSql.query("select * from %s"%stableName) + newTdSql.checkRows(rowsPerStb) + + def run(self): + # print(self.master_dnode.cfgDict) + self.fiveDnodeThreeMnode(dnodeNumbers=6,mnodeNums=3,restartNumbers=2,stopRole='dnode') + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/5dnode3mnodeSeperate1VnodeStopInsert.py b/tests/system-test/6-cluster/5dnode3mnodeSeperate1VnodeStopInsert.py deleted file mode 100644 index a34895ff42..0000000000 --- a/tests/system-test/6-cluster/5dnode3mnodeSeperate1VnodeStopInsert.py +++ /dev/null @@ -1,324 +0,0 @@ -from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE -import taos -import sys -import time -import os - -from util.log import * -from util.sql import * -from util.cases import * -from util.dnodes import TDDnodes -from util.dnodes import TDDnode -from util.cluster import * -from util.common import * -sys.path.append("./7-tmq") -from tmqCommon import * - -import time -import socket -import subprocess -from multiprocessing import Process -import threading -import time -import inspect -import ctypes - -class TDTestCase: - - def init(self, conn, logSql, replicaVar=1): - tdLog.debug(f"start to excute {__file__}") - # tdSql.init(conn.cursor()) - # self.host = socket.gethostname() - - def getBuildPath(self): - selfPath = os.path.dirname(os.path.realpath(__file__)) - - if ("community" in selfPath): - projPath = selfPath[:selfPath.find("community")] - else: - projPath = selfPath[:selfPath.find("tests")] - - for root, dirs, files in os.walk(projPath): - if ("taosd" in files): - rootRealPath = os.path.dirname(os.path.realpath(root)) - if ("packaging" not in rootRealPath): - buildPath = root[:len(root) - len("/build/bin")] - break - return buildPath - - def _async_raise(self, tid, exctype): - """raises the exception, performs cleanup if needed""" - if not inspect.isclass(exctype): - exctype = type(exctype) - res = ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, ctypes.py_object(exctype)) - if res == 0: - raise ValueError("invalid thread id") - elif res != 1: - # """if it returns a number greater than one, you're in trouble, - # and you should call it again with exc=NULL to revert the effect""" - ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None) - raise SystemError("PyThreadState_SetAsyncExc failed") - - def stop_thread(self,thread): - self._async_raise(thread.ident, SystemExit) - - - def insert_data(self,countstart,countstop): - # fisrt add data : db\stable\childtable\general table - - for couti in range(countstart,countstop): - tdLog.debug("drop database if exists db%d" %couti) - tdSql.execute("drop database if exists db%d" %couti) - print("create database if not exists db%d replica 1 duration 300" %couti) - tdSql.execute("create database if not exists db%d replica 1 duration 300" %couti) - tdSql.execute("use db%d" %couti) - tdSql.execute( - '''create table stb1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - tags (t1 int) - ''' - ) - tdSql.execute( - ''' - create table t1 - (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) - ''' - ) - for i in range(4): - tdSql.execute(f'create table ct{i+1} using stb1 tags ( {i+1} )') - - def checkData(self,dbname,stbname,stableCount,CtableCount,rowsPerSTable,): - tdSql.execute("use %s"%dbname) - tdSql.query("show stables") - tdSql.checkRows(stableCount) - tdSql.query("show tables") - tdSql.checkRows(CtableCount) - for i in range(stableCount): - tdSql.query("select count(*) from %s%d"%(stbname,i)) - tdSql.checkData(0,0,rowsPerSTable) - return - - def checkdnodes(self,dnodenumber): - count=0 - while count < 100: - time.sleep(1) - statusReadyBumber=0 - tdSql.query("select * from information_schema.ins_dnodes;") - if tdSql.checkRows(dnodenumber) : - print("dnode is %d nodes"%dnodenumber) - for i in range(dnodenumber): - if tdSql.queryResult[i][4] !='ready' : - status=tdSql.queryResult[i][4] - print("dnode:%d status is %s "%(i,status)) - break - else: - statusReadyBumber+=1 - print(statusReadyBumber) - if statusReadyBumber == dnodenumber : - print("all of %d mnodes is ready in 10s "%dnodenumber) - return True - break - count+=1 - else: - print("%d mnodes is not ready in 10s "%dnodenumber) - return False - - - def check3mnode(self): - count=0 - while count < 10: - time.sleep(1) - tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(3) : - print("mnode is three nodes") - if tdSql.queryResult[0][2]=='leader' : - if tdSql.queryResult[1][2]=='follower': - if tdSql.queryResult[2][2]=='follower': - print("three mnodes is ready in 10s") - break - elif tdSql.queryResult[0][2]=='follower' : - if tdSql.queryResult[1][2]=='leader': - if tdSql.queryResult[2][2]=='follower': - print("three mnodes is ready in 10s") - break - elif tdSql.queryResult[0][2]=='follower' : - if tdSql.queryResult[1][2]=='follower': - if tdSql.queryResult[2][2]=='leader': - print("three mnodes is ready in 10s") - break - count+=1 - else: - print("three mnodes is not ready in 10s ") - return -1 - - tdSql.query("select * from information_schema.ins_mnodes;") - tdSql.checkRows(3) - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,3,'ready') - tdSql.checkData(1,1,'%s:6130'%self.host) - tdSql.checkData(1,3,'ready') - tdSql.checkData(2,1,'%s:6230'%self.host) - tdSql.checkData(2,3,'ready') - - def check3mnode1off(self): - count=0 - while count < 10: - time.sleep(1) - tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(3) : - print("mnode is three nodes") - if tdSql.queryResult[0][2]=='offline' : - if tdSql.queryResult[1][2]=='leader': - if tdSql.queryResult[2][2]=='follower': - print("stop mnodes on dnode 2 successfully in 10s") - break - elif tdSql.queryResult[1][2]=='follower': - if tdSql.queryResult[2][2]=='leader': - print("stop mnodes on dnode 2 successfully in 10s") - break - count+=1 - else: - print("stop mnodes on dnode 2 failed in 10s ") - return -1 - tdSql.error("drop mnode on dnode 1;") - - tdSql.query("select * from information_schema.ins_mnodes;") - tdSql.checkRows(3) - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,2,'offline') - tdSql.checkData(0,3,'ready') - tdSql.checkData(1,1,'%s:6130'%self.host) - tdSql.checkData(1,3,'ready') - tdSql.checkData(2,1,'%s:6230'%self.host) - tdSql.checkData(2,3,'ready') - - def check3mnode2off(self): - count=0 - while count < 40: - time.sleep(1) - tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(3) : - print("mnode is three nodes") - if tdSql.queryResult[0][2]=='leader' : - if tdSql.queryResult[1][2]=='offline': - if tdSql.queryResult[2][2]=='follower': - print("stop mnodes on dnode 2 successfully in 10s") - break - count+=1 - else: - print("stop mnodes on dnode 2 failed in 10s ") - return -1 - tdSql.error("drop mnode on dnode 2;") - - tdSql.query("select * from information_schema.ins_mnodes;") - tdSql.checkRows(3) - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,2,'leader') - tdSql.checkData(0,3,'ready') - tdSql.checkData(1,1,'%s:6130'%self.host) - tdSql.checkData(1,2,'offline') - tdSql.checkData(1,3,'ready') - tdSql.checkData(2,1,'%s:6230'%self.host) - tdSql.checkData(2,2,'follower') - tdSql.checkData(2,3,'ready') - - def check3mnode3off(self): - count=0 - while count < 10: - time.sleep(1) - tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(3) : - print("mnode is three nodes") - if tdSql.queryResult[0][2]=='leader' : - if tdSql.queryResult[2][2]=='offline': - if tdSql.queryResult[1][2]=='follower': - print("stop mnodes on dnode 3 successfully in 10s") - break - count+=1 - else: - print("stop mnodes on dnode 3 failed in 10s") - return -1 - tdSql.error("drop mnode on dnode 3;") - tdSql.query("select * from information_schema.ins_mnodes;") - tdSql.checkRows(3) - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,2,'leader') - tdSql.checkData(0,3,'ready') - tdSql.checkData(1,1,'%s:6130'%self.host) - tdSql.checkData(1,2,'follower') - tdSql.checkData(1,3,'ready') - tdSql.checkData(2,1,'%s:6230'%self.host) - tdSql.checkData(2,2,'offline') - tdSql.checkData(2,3,'ready') - - - def check5dnode(self): - tdSql.query("select * from information_schema.ins_dnodes;") - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(4,1,'%s:6430'%self.host) - tdSql.checkData(0,4,'ready') - tdSql.checkData(4,4,'ready') - - def five_dnode_three_mnode(self,dnodenumber): - tdSql.query("select * from information_schema.ins_dnodes;") - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(4,1,'%s:6430'%self.host) - tdSql.checkData(0,4,'ready') - tdSql.checkData(4,4,'ready') - tdSql.query("select * from information_schema.ins_mnodes;") - tdSql.checkRows(1) - tdSql.checkData(0,1,'%s:6030'%self.host) - tdSql.checkData(0,2,'leader') - tdSql.checkData(0,3,'ready') - - # fisr add three mnodes; - tdSql.execute("create mnode on dnode 2") - tdSql.execute("create mnode on dnode 3") - - # fisrt check statut ready - self.check3mnode() - - tdSql.error("create mnode on dnode 2") - tdSql.query("select * from information_schema.ins_dnodes;") - print(tdSql.queryResult) - tdLog.debug("stop all of mnode ") - - # seperate vnode and mnode in different dnodes. - # create database and stable - stopcount =0 - while stopcount < 2: - for i in range(dnodenumber): - # threads=[] - # threads = MyThreadFunc(self.insert_data(i*2,i*2+2)) - threads=threading.Thread(target=self.insert_data, args=(i,i+1)) - threads.start() - self.TDDnodes.stoptaosd(i+1) - self.TDDnodes.starttaosd(i+1) - - if self.checkdnodes(5): - print("123") - threads.join() - else: - print("456") - threads.join() - self.stop_thread(threads) - assert 1 == 2 ,"some dnode started failed" - return False - # self.check3mnode() - self.check3mnode() - - - stopcount+=1 - self.check3mnode() - - - def run(self): - # print(self.master_dnode.cfgDict) - self.five_dnode_three_mnode(5) - - def stop(self): - tdSql.close() - tdLog.success(f"{__file__} successfully executed") - -tdCases.addLinux(__file__, TDTestCase()) -tdCases.addWindows(__file__, TDTestCase()) diff --git a/tests/system-test/6-cluster/clusterCommonCheck.py b/tests/system-test/6-cluster/clusterCommonCheck.py index 7cbe9d9680..2a50e1ee31 100644 --- a/tests/system-test/6-cluster/clusterCommonCheck.py +++ b/tests/system-test/6-cluster/clusterCommonCheck.py @@ -64,7 +64,7 @@ class ClusterComCheck: dbNumbers=int(dbNumbers) count=0 while count < 5: - tdSql.query("select * from information_schema.ins_databases;") + tdSql.query("select * from information_schema.ins_databases where name!='collectd' ;") count+=1 if tdSql.checkRows(dbNumbers+2): tdLog.success("we find %d databases and expect %d in clusters! " %(tdSql.queryRows,dbNumbers+2)) diff --git a/tests/system-test/6-cluster/clusterCommonCreate.py b/tests/system-test/6-cluster/clusterCommonCreate.py index 236708cf07..6e699e2396 100644 --- a/tests/system-test/6-cluster/clusterCommonCreate.py +++ b/tests/system-test/6-cluster/clusterCommonCreate.py @@ -137,12 +137,24 @@ class ClusterComCreate: # for i in range(dbNumbers): for i in range(dbNumbers): if dropFlag == 1: - tsql.execute("drop database if exists %s_%d"%(dbNameIndex,1)) - tdLog.debug("create database if not exists %s_%d vgroups %d replica %d"%(dbNameIndex,1, vgroups, replica)) - tsql.execute("create database if not exists %s_%d vgroups %d replica %d"%(dbNameIndex,1, vgroups, replica)) - tdLog.debug("complete to create database %s_%d"%(dbNameIndex,1)) + tsql.execute("drop database if exists %s_%d"%(dbNameIndex,i)) + tdLog.debug("create database if not exists %s_%d vgroups %d replica %d"%(dbNameIndex,i, vgroups, replica)) + tsql.execute("create database if not exists %s_%d vgroups %d replica %d"%(dbNameIndex,i, vgroups, replica)) + tdLog.debug("complete to create database %s_%d"%(dbNameIndex,i)) + def createUser(self,tsql,user,password): + tdLog.info(f"create new user f{user}") + tsql.execute(f"CREATE USER {user} PASS '{password}';") + def alterUser(self,tsql,user,password): + tdLog.info(f"alter user {user} pass '{password}'") + tsql.execute(f"alter USER {user} pass '{password}' ;") + + def deleteUser(self,tsql,user): + tdLog.info(f"drop user f{user}") + tsql.execute(f"DROP USER {user} ;") + + def create_stable(self,tsql, dbName,stbName): tsql.execute("create table if not exists %s.%s (ts timestamp, c1 int, c2 int, c3 binary(16)) tags(t1 int, t2 binary(32))"%(dbName, stbName)) tdLog.debug("complete to create %s.%s" %(dbName, stbName)) @@ -202,6 +214,52 @@ class ClusterComCreate: tdLog.debug("insert data ............ [OK]") return + def alterStbMetaData(self,tsql,dbName,stbName,ctbNum,rowsPerTbl,batchNum,startTs=None): + tdLog.debug("alter Stb column ............") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} MODIFY COLUMN c3 binary(20);") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} MODIFY COLUMN c3 binary(20);") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} ADD COLUMN c4 DOUBLE;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} ADD COLUMN c4 DOUBLE;") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} DROP COLUMN c2;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} DROP COLUMN c2;") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} RENAME TAG t1 t1r;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} RENAME TAG t1 t1r;") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} DROP TAG t2;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} DROP TAG t2;") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} ADD TAG t2 binary(32) ;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} ADD TAG t2 binary(32);") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} MODIFY TAG t2 binary(34) ;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} MODIFY TAG t2 binary(34);") + tdLog.debug(f"ALTER STABLE {dbName}.{stbName} ADD TAG t3 double ;") + tsql.execute(f" ALTER STABLE {dbName}.{stbName} ADD TAG t3 double;") + tsql.error(f" ALTER STABLE {dbName}.{stbName} ADD TAG t2 double;") + + tdLog.debug("start to insert data ............") + # tsql.execute("use %s" %dbName) + pre_insert = "insert into " + sql = pre_insert + + if startTs is None: + t = time.time() + startTs = int(round(t * 1000)) + #tdLog.debug("doing insert data into stable:%s rows:%d ..."%(stbName, allRows)) + for i in range(ctbNum): + sql += " %s.%s_%d values "%(dbName,stbName,i) + for j in range(rowsPerTbl): + sql += "(%d, %d,'mnode_%d', %d ) "%(startTs + j, j, j,j) + if (j > 0) and ((j%batchNum == 0) or (j == rowsPerTbl - 1)): + tsql.execute(sql) + if j < rowsPerTbl - 1: + sql = "insert into %s.%s_%d values " %(dbName,stbName,i) + else: + sql = "insert into " + #end sql + if sql != pre_insert: + #print("insert sql:%s"%sql) + tsql.execute(sql) + tdLog.debug("insert data ............ [OK]") + return + def insert_data_1(self,tsql,dbName,ctbPrefix,ctbNum,rowsPerTbl,batchNum,startTs): tdLog.debug("start to insert data ............") tsql.execute("use %s" %dbName) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 01c8042c0e..b391d59725 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -969,38 +969,43 @@ bool matchVarWord(SWord* word1, SWord* word2) { // ------------------- match words -------------------------- // -// compare command cmd1 come from shellCommands , cmd2 come from user input -int32_t compareCommand(SWords* cmd1, SWords* cmd2) { - SWord* word1 = cmd1->head; - SWord* word2 = cmd2->head; +// compare command cmdPattern come from shellCommands , cmdInput come from user input +int32_t compareCommand(SWords* cmdPattern, SWords* cmdInput) { + SWord* wordPattern = cmdPattern->head; + SWord* wordInput = cmdInput->head; - if (word1 == NULL || word2 == NULL) { + if (wordPattern == NULL || wordInput == NULL) { return -1; } - for (int32_t i = 0; i < cmd1->count; i++) { - if (word1->type == WT_TEXT) { + for (int32_t i = 0; i < cmdPattern->count; i++) { + if (wordPattern->type == WT_TEXT) { // WT_TEXT match - if (word1->len == word2->len) { - if (strncasecmp(word1->word, word2->word, word1->len) != 0) return -1; - } else if (word1->len < word2->len) { + if (wordPattern->len == wordInput->len) { + if (strncasecmp(wordPattern->word, wordInput->word, wordPattern->len) != 0) return -1; + } else if (wordPattern->len < wordInput->len) { return -1; } else { - // word1->len > word2->len - if (strncasecmp(word1->word, word2->word, word2->len) == 0) { - cmd1->matchIndex = i; - cmd1->matchLen = word2->len; - return i; + // wordPattern->len > wordInput->len + if (strncasecmp(wordPattern->word, wordInput->word, wordInput->len) == 0) { + if (i + 1 == cmdInput->count) { + // last word return match + cmdPattern->matchIndex = i; + cmdPattern->matchLen = wordInput->len; + return i; + } else { + return -1; + } } else { return -1; } } } else { // WT_VAR auto match any one word - if (word2->next == NULL) { // input words last one - if (matchVarWord(word1, word2)) { - cmd1->matchIndex = i; - cmd1->matchLen = word2->len; + if (wordInput->next == NULL) { // input words last one + if (matchVarWord(wordPattern, wordInput)) { + cmdPattern->matchIndex = i; + cmdPattern->matchLen = wordInput->len; varMode = true; return i; } @@ -1009,9 +1014,9 @@ int32_t compareCommand(SWords* cmd1, SWords* cmd2) { } // move next - word1 = word1->next; - word2 = word2->next; - if (word1 == NULL || word2 == NULL) { + wordPattern = wordPattern->next; + wordInput = wordInput->next; + if (wordPattern == NULL || wordInput == NULL) { return -1; } }