diff --git a/deps/arm/dm_static/libdmodule.a b/deps/arm/dm_static/libdmodule.a index 49084af930..5f0f0e38b3 100644 Binary files a/deps/arm/dm_static/libdmodule.a and b/deps/arm/dm_static/libdmodule.a differ diff --git a/deps/win/x64/dm_static/dmodule.lib b/deps/win/x64/dm_static/dmodule.lib index cf3b4d99c6..52b8cd407d 100644 Binary files a/deps/win/x64/dm_static/dmodule.lib and b/deps/win/x64/dm_static/dmodule.lib differ diff --git a/deps/x86/dm_static/libdmodule.a b/deps/x86/dm_static/libdmodule.a index c4561fbd48..f5548e6988 100644 Binary files a/deps/x86/dm_static/libdmodule.a and b/deps/x86/dm_static/libdmodule.a differ diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index e7f3aa8d1b..255263ecfd 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -56,7 +56,7 @@ database_option: { - WAL_FSYNC_PERIOD: specifies the interval (in milliseconds) at which data is written from the WAL to disk. This parameter takes effect only when the WAL parameter is set to 2. The default value is 3000. Enter a value between 0 and 180000. The value 0 indicates that incoming data is immediately written to disk. - MAXROWS: specifies the maximum number of rows recorded in a block. The default value is 4096. - MINROWS: specifies the minimum number of rows recorded in a block. The default value is 100. -- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. TDengine Enterprise supports [Tiered Storage](https://docs.tdengine.com/tdinternal/arch/#tiered-storage) function, thus multiple KEEP values (comma separated and up to 3 values supported, and meet keep 0 <= keep 1 <= keep 2, e.g. KEEP 100h,100d,3650d) are supported; TDengine OSS does not support Tiered Storage function (although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP). +- KEEP: specifies the time for which data is retained. Enter a value between 1 and 365000. The default value is 3650. The value of the KEEP parameter must be greater than or equal to three times of the value of the DURATION parameter. TDengine automatically deletes data that is older than the value of the KEEP parameter. You can use m (minutes), h (hours), and d (days) as the unit, for example KEEP 100h or KEEP 10d. If you do not include a unit, d is used by default. TDengine Enterprise supports [Tiered Storage](https://docs.tdengine.com/tdinternal/arch/#tiered-storage) function, thus multiple KEEP values (comma separated and up to 3 values supported, and meet keep 0 <= keep 1 <= keep 2, e.g. KEEP 100h,100d,3650d) are supported; TDengine OSS does not support Tiered Storage function (although multiple keep values are configured, they do not take effect, only the maximum keep value is used as KEEP). - PAGES: specifies the number of pages in the metadata storage engine cache on each vnode. Enter a value greater than or equal to 64. The default value is 256. The space occupied by metadata storage on each vnode is equal to the product of the values of the PAGESIZE and PAGES parameters. The space occupied by default is 1 MB. - PAGESIZE: specifies the size (in KB) of each page in the metadata storage engine cache on each vnode. The default value is 4. Enter a value between 1 and 16384. - PRECISION: specifies the precision at which a database records timestamps. Enter ms for milliseconds, us for microseconds, or ns for nanoseconds. The default value is ms. diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index d38fc86975..f1e19a5449 100755 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -24,7 +24,7 @@ SELECT [hints] [DISTINCT] select_list hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ hint: - BATCH_SCAN | NO_BATCH_SCAN + BATCH_SCAN | NO_BATCH_SCAN | SORT_FOR_GROUP select_list: select_expr [, select_expr] ... @@ -87,15 +87,17 @@ Hints are a means of user control over query optimization for individual stateme The list of currently supported Hints is as follows: -| **Hint** | **Params** | **Comment** | **Scopt** | -| :-----------: | -------------- | -------------------------- | -------------------------- | -| BATCH_SCAN | None | Batch table scan | JOIN statment for stable | -| NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | +| **Hint** | **Params** | **Comment** | **Scopt** | +| :-----------: | -------------- | -------------------------- | -----------------------------------| +| BATCH_SCAN | None | Batch table scan | JOIN statment for stable | +| NO_BATCH_SCAN | None | Sequential table scan | JOIN statment for stable | +| SORT_FOR_GROUP| None | Use sort for partition | With normal column in partition by list | For example: ```sql SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; +SELECT /*+ SORT_FOR_GROUP() */ count(*), c1 FROM stable1 PARTITION BY c1; ``` ## Lists diff --git a/docs/en/12-taos-sql/16-operators.md b/docs/en/12-taos-sql/16-operators.md index 6b7adb4a3d..ce8ab8a03c 100644 --- a/docs/en/12-taos-sql/16-operators.md +++ b/docs/en/12-taos-sql/16-operators.md @@ -54,6 +54,7 @@ LIKE is used together with wildcards to match strings. Its usage is described as MATCH and NMATCH are used together with regular expressions to match strings. Their usage is described as follows: - Use POSIX regular expression syntax. For more information, see Regular Expressions. +- The `MATCH` operator returns true when the regular expression is matched. The `NMATCH` operator returns true when the regular expression is not matched. - Regular expression can be used against only table names, i.e. `tbname`, and tags/columns of binary/nchar types. - The maximum length of regular expression string is 128 bytes. Configuration parameter `maxRegexStringLen` can be used to set the maximum allowed regular expression. It's a configuration parameter on the client side, and will take effect after restarting the client. diff --git a/docs/en/12-taos-sql/24-show.md b/docs/en/12-taos-sql/24-show.md index 9e2897160c..2a3975f9a2 100644 --- a/docs/en/12-taos-sql/24-show.md +++ b/docs/en/12-taos-sql/24-show.md @@ -73,10 +73,10 @@ Shows the SQL statement used to create the specified table. This statement can b ## SHOW DATABASES ```sql -SHOW DATABASES; +SHOW [USER | SYSTEM] DATABASES; ``` -Shows all user-created databases. +Shows all databases. The `USER` qualifier specifies only user-created databases. The `SYSTEM` qualifier specifies only system databases. ## SHOW DNODES @@ -183,10 +183,10 @@ Shows all subscriptions in the system. ## SHOW TABLES ```sql -SHOW [db_name.]TABLES [LIKE 'pattern']; +SHOW [NORMAL | CHILD] [db_name.]TABLES [LIKE 'pattern']; ``` -Shows all standard tables and subtables in the current database. You can use LIKE for fuzzy matching. +Shows all standard tables and subtables in the current database. You can use LIKE for fuzzy matching. The `Normal` qualifier specifies standard tables. The `CHILD` qualifier specifies subtables. ## SHOW TABLE DISTRIBUTED diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index ac435debea..e9ca5405f4 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -56,7 +56,7 @@ database_option: { - WAL_FSYNC_PERIOD:当 WAL 参数设置为 2 时,落盘的周期。默认为 3000,单位毫秒。最小为 0,表示每次写入立即落盘;最大为 180000,即三分钟。 - MAXROWS:文件块中记录的最大条数,默认为 4096 条。 - MINROWS:文件块中记录的最小条数,默认为 100 条。 -- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/tdinternal/arch/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 <= keep 1 <= keep 2,如 KEEP 100h,100d,3650d); 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。 +- KEEP:表示数据文件保存的天数,缺省值为 3650,取值范围 [1, 365000],且必须大于或等于3倍的 DURATION 参数值。数据库会自动删除保存时间超过 KEEP 值的数据。KEEP 可以使用加单位的表示形式,如 KEEP 100h、KEEP 10d 等,支持 m(分钟)、h(小时)和 d(天)三个单位。也可以不写单位,如 KEEP 50,此时默认单位为天。企业版支持[多级存储](https://docs.taosdata.com/tdinternal/arch/#%E5%A4%9A%E7%BA%A7%E5%AD%98%E5%82%A8)功能, 因此, 可以设置多个保存时间(多个以英文逗号分隔,最多 3 个,满足 keep 0 <= keep 1 <= keep 2,如 KEEP 100h,100d,3650d); 社区版不支持多级存储功能(即使配置了多个保存时间, 也不会生效, KEEP 会取最大的保存时间)。 - PAGES:一个 VNODE 中元数据存储引擎的缓存页个数,默认为 256,最小 64。一个 VNODE 元数据存储占用 PAGESIZE \* PAGES,默认情况下为 1MB 内存。 - PAGESIZE:一个 VNODE 中元数据存储引擎的页大小,单位为 KB,默认为 4 KB。范围为 1 到 16384,即 1 KB 到 16 MB。 - PRECISION:数据库的时间戳精度。ms 表示毫秒,us 表示微秒,ns 表示纳秒,默认 ms 毫秒。 diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index 6d32d86f83..04508ceede 100755 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -24,7 +24,7 @@ SELECT [hints] [DISTINCT] select_list hints: /*+ [hint([hint_param_list])] [hint([hint_param_list])] */ hint: - BATCH_SCAN | NO_BATCH_SCAN + BATCH_SCAN | NO_BATCH_SCAN | SORT_FOR_GROUP select_list: select_expr [, select_expr] ... @@ -87,15 +87,17 @@ Hints 是用户控制单个语句查询优化的一种手段,当 Hint 不适 目前支持的 Hints 列表如下: -| **Hint** | **参数** | **说明** | **适用范围** | -| :-----------: | -------------- | -------------------------- | -------------------------- | -| BATCH_SCAN | 无 | 采用批量读表的方式 | 超级表 JOIN 语句 | -| NO_BATCH_SCAN | 无 | 采用顺序读表的方式 | 超级表 JOIN 语句 | +| **Hint** | **参数** | **说明** | **适用范围** | +| :-----------: | -------------- | -------------------------- | -----------------------------| +| BATCH_SCAN | 无 | 采用批量读表的方式 | 超级表 JOIN 语句 | +| NO_BATCH_SCAN | 无 | 采用顺序读表的方式 | 超级表 JOIN 语句 | +| SORT_FOR_GROUP| 无 | 采用sort方式进行分组 | partition by 列表有普通列时 | 举例: ```sql SELECT /*+ BATCH_SCAN() */ a.ts FROM stable1 a, stable2 b where a.tag0 = b.tag0 and a.ts = b.ts; +SELECT /*+ SORT_FOR_GROUP() */ count(*), c1 FROM stable1 PARTITION BY c1; ``` ## 列表 diff --git a/docs/zh/12-taos-sql/16-operators.md b/docs/zh/12-taos-sql/16-operators.md index 0636121edd..c2f0cae9c4 100644 --- a/docs/zh/12-taos-sql/16-operators.md +++ b/docs/zh/12-taos-sql/16-operators.md @@ -54,6 +54,7 @@ LIKE 条件使用通配符字符串进行匹配检查,规则如下: MATCH 条件和 NMATCH 条件使用正则表达式进行匹配,规则如下: - 支持符合 POSIX 规范的正则表达式,具体规范内容可参见 Regular Expressions。 +- MATCH 和正则表达式匹配时, 返回 TURE. NMATCH 和正则表达式不匹配时, 返回 TRUE. - 只能针对子表名(即 tbname)、字符串类型的标签值进行正则表达式过滤,不支持普通列的过滤。 - 正则匹配字符串长度不能超过 128 字节。可以通过参数 maxRegexStringLen 设置和调整最大允许的正则匹配字符串,该参数是客户端配置参数,需要重启客户端才能生效 diff --git a/docs/zh/12-taos-sql/24-show.md b/docs/zh/12-taos-sql/24-show.md index 197a7c78d6..09333dd0b7 100644 --- a/docs/zh/12-taos-sql/24-show.md +++ b/docs/zh/12-taos-sql/24-show.md @@ -73,10 +73,10 @@ SHOW CREATE TABLE [db_name.]tb_name ## SHOW DATABASES ```sql -SHOW DATABASES; +SHOW [USER | SYSTEM] DATABASES; ``` -显示用户定义的所有数据库。 +显示定义的所有数据库。SYSTEM 指定只显示系统数据库。USER 指定只显示用户创建的数据库。 ## SHOW DNODES @@ -183,10 +183,10 @@ SHOW SUBSCRIPTIONS; ## SHOW TABLES ```sql -SHOW [db_name.]TABLES [LIKE 'pattern']; +SHOW [NORMAL | CHILD] [db_name.]TABLES [LIKE 'pattern']; ``` -显示当前数据库下的所有普通表和子表的信息。可以使用 LIKE 对表名进行模糊匹配。 +显示当前数据库下的所有普通表和子表的信息。可以使用 LIKE 对表名进行模糊匹配。NORMAL 指定只显示普通表信息, CHILD 指定只显示子表信息。 ## SHOW TABLE DISTRIBUTED diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 4d33889336..edbc74bf18 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -51,8 +51,10 @@ typedef enum { } EGrantType; int32_t grantCheck(EGrantType grant); -#ifdef TD_ENTERPRISE +#ifndef TD_GRANT_OPTIMIZE int32_t grantAlterActiveCode(const char* old, const char* new, char* out, int8_t type); +#else +int32_t grantAlterActiveCode(int32_t did, const char* old, const char* new, char* out, int8_t type); #endif #ifndef GRANTS_CFG diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 7f0b9de321..18a0d119f8 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2048,6 +2048,7 @@ int32_t tDeserializeSRedistributeVgroupReq(void* buf, int32_t bufLen, SRedistrib typedef struct { int32_t useless; + int32_t vgId; } SBalanceVgroupLeaderReq; int32_t tSerializeSBalanceVgroupLeaderReq(void* buf, int32_t bufLen, SBalanceVgroupLeaderReq* pReq); diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index b5e1b37f89..28c6eba09b 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -362,6 +362,8 @@ #define TK_WAL 343 + + #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 #define TK_NK_ILLEGAL 602 diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h index d21fb8c459..dbcd682dab 100644 --- a/include/libs/executor/storageapi.h +++ b/include/libs/executor/storageapi.h @@ -38,6 +38,9 @@ extern "C" { #define META_READER_NOLOCK 0x1 +#define STREAM_STATE_BUFF_HASH 1 +#define STREAM_STATE_BUFF_SORT 2 + typedef struct SMeta SMeta; typedef TSKEY (*GetTsFun)(void*); @@ -115,6 +118,7 @@ typedef struct SRowBuffPos { void* pKey; bool beFlushed; bool beUsed; + bool needFree; } SRowBuffPos; // tq @@ -333,6 +337,8 @@ typedef struct { void* db; // rocksdb_t* db; void* pCur; int64_t number; + void* pStreamFileState; + int32_t buffIndex; } SStreamStateCur; typedef struct SStateStore { @@ -340,7 +346,8 @@ typedef struct SStateStore { int32_t (*streamStateGetParName)(SStreamState* pState, int64_t groupId, void** pVal); int32_t (*streamStateAddIfNotExist)(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); - int32_t (*streamStateReleaseBuf)(SStreamState* pState, const SWinKey* key, void* pVal); + int32_t (*streamStateReleaseBuf)(SStreamState* pState, void* pVal, bool used); + int32_t (*streamStateClearBuff)(SStreamState* pState, void* pVal); void (*streamStateFreeVal)(void* val); int32_t (*streamStatePut)(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen); @@ -371,7 +378,7 @@ typedef struct SStateStore { int32_t (*streamStateSessionAddIfNotExist)(SStreamState* pState, SSessionKey* key, TSKEY gap, void** pVal, int32_t* pVLen); - int32_t (*streamStateSessionPut)(SStreamState* pState, const SSessionKey* key, const void* value, int32_t vLen); + int32_t (*streamStateSessionPut)(SStreamState* pState, const SSessionKey* key, void* value, int32_t vLen); int32_t (*streamStateSessionGet)(SStreamState* pState, SSessionKey* key, void** pVal, int32_t* pVLen); int32_t (*streamStateSessionDel)(SStreamState* pState, const SSessionKey* key); int32_t (*streamStateSessionClear)(SStreamState* pState); @@ -400,7 +407,7 @@ typedef struct SStateStore { struct SStreamFileState* (*streamFileStateInit)(int64_t memSize, uint32_t keySize, uint32_t rowSize, uint32_t selectRowSize, GetTsFun fp, void* pFile, TSKEY delMark, - const char* id, int64_t ckId); + const char* id, int64_t ckId, int8_t type); void (*streamFileStateDestroy)(struct SStreamFileState* pFileState); void (*streamFileStateClear)(struct SStreamFileState* pFileState); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index f9ac7077f1..2b824c07be 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -507,6 +507,7 @@ typedef struct SBalanceVgroupStmt { typedef struct SBalanceVgroupLeaderStmt { ENodeType type; + int32_t vgId; } SBalanceVgroupLeaderStmt; typedef struct SMergeVgroupStmt { diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h index 4312da6f2c..b7f100733b 100644 --- a/include/libs/stream/streamState.h +++ b/include/libs/stream/streamState.h @@ -49,26 +49,30 @@ void streamStateSetNumber(SStreamState* pState, int32_t number); int32_t streamStateSaveInfo(SStreamState* pState, void* pKey, int32_t keyLen, void* pVal, int32_t vLen); int32_t streamStateGetInfo(SStreamState* pState, void* pKey, int32_t keyLen, void** pVal, int32_t* pLen); +//session window int32_t streamStateSessionAddIfNotExist(SStreamState* pState, SSessionKey* key, TSKEY gap, void** pVal, int32_t* pVLen); -int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, const void* value, int32_t vLen); +int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, void* value, int32_t vLen); int32_t streamStateSessionGet(SStreamState* pState, SSessionKey* key, void** pVal, int32_t* pVLen); int32_t streamStateSessionDel(SStreamState* pState, const SSessionKey* key); int32_t streamStateSessionClear(SStreamState* pState); int32_t streamStateSessionGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); -int32_t streamStateStateAddIfNotExist(SStreamState* pState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, - state_key_cmpr_fn fn, void** pVal, int32_t* pVLen); int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* range, SSessionKey* curKey); SStreamStateCur* streamStateSessionSeekKeyNext(SStreamState* pState, const SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyCurrentPrev(SStreamState* pState, const SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyCurrentNext(SStreamState* pState, const SSessionKey* key); +//state window +int32_t streamStateStateAddIfNotExist(SStreamState* pState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, + state_key_cmpr_fn fn, void** pVal, int32_t* pVLen); + int32_t streamStateFillPut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen); int32_t streamStateFillGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key); int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); -int32_t streamStateReleaseBuf(SStreamState* pState, const SWinKey* key, void* pVal); +int32_t streamStateReleaseBuf(SStreamState* pState, void* pVal, bool used); +int32_t streamStateClearBuff(SStreamState* pState, void* pVal); void streamStateFreeVal(void* val); SStreamStateCur* streamStateGetAndCheckCur(SStreamState* pState, SWinKey* key); @@ -76,14 +80,11 @@ SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key SStreamStateCur* streamStateFillSeekKeyNext(SStreamState* pState, const SWinKey* key); SStreamStateCur* streamStateFillSeekKeyPrev(SStreamState* pState, const SWinKey* key); void streamStateFreeCur(SStreamStateCur* pCur); +void streamStateResetCur(SStreamStateCur* pCur); int32_t streamStateGetGroupKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); -int32_t streamStateGetFirst(SStreamState* pState, SWinKey* key); -int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur); -int32_t streamStateSeekLast(SStreamState* pState, SStreamStateCur* pCur); - int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur); @@ -91,6 +92,7 @@ int32_t streamStatePutParName(SStreamState* pState, int64_t groupId, const char* int32_t streamStateGetParName(SStreamState* pState, int64_t groupId, void** pVal); void streamStateReloadInfo(SStreamState* pState, TSKEY ts); +SStreamStateCur* createStreamStateCursor(); /***compare func **/ diff --git a/include/libs/stream/tstreamFileState.h b/include/libs/stream/tstreamFileState.h index 052231fe39..2b567a7370 100644 --- a/include/libs/stream/tstreamFileState.h +++ b/include/libs/stream/tstreamFileState.h @@ -28,20 +28,33 @@ extern "C" { #endif typedef struct SStreamFileState SStreamFileState; -typedef SList SStreamSnapshot; +typedef SList SStreamSnapshot; + +typedef void* (*_state_buff_get_fn)(void* pRowBuff, const void* pKey, size_t keyLen); +typedef int32_t (*_state_buff_put_fn)(void* pRowBuff, const void* pKey, size_t keyLen, const void* data, size_t dataLen); +typedef int32_t (*_state_buff_remove_fn)(void* pRowBuff, const void* pKey, size_t keyLen); +typedef int32_t (*_state_buff_remove_by_pos_fn)(SStreamFileState* pState, SRowBuffPos* pPos); +typedef void (*_state_buff_cleanup_fn)(void* pRowBuff); +typedef void* (*_state_buff_create_statekey_fn)(SRowBuffPos* pPos, int64_t num); + +typedef int32_t (*_state_file_remove_fn)(SStreamFileState* pFileState, const void* pKey); +typedef int32_t (*_state_file_get_fn)(SStreamFileState* pFileState, void* pKey, void* data, int32_t* pDataLen); +typedef int32_t (*_state_file_clear_fn)(SStreamState* pState); SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_t rowSize, uint32_t selectRowSize, GetTsFun fp, void* pFile, TSKEY delMark, const char* taskId, - int64_t checkpointId); + int64_t checkpointId, int8_t type); void streamFileStateDestroy(SStreamFileState* pFileState); void streamFileStateClear(SStreamFileState* pFileState); bool needClearDiskBuff(SStreamFileState* pFileState); +void streamFileStateReleaseBuff(SStreamFileState* pFileState, SRowBuffPos* pPos, bool used); +int32_t streamFileStateClearBuff(SStreamFileState* pFileState, SRowBuffPos* pPos); int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, void** pVal, int32_t* pVLen); int32_t deleteRowBuff(SStreamFileState* pFileState, const void* pKey, int32_t keyLen); int32_t getRowBuffByPos(SStreamFileState* pFileState, SRowBuffPos* pPos, void** pVal); -void releaseRowBuffPos(SRowBuffPos* pBuff); bool hasRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen); +void putFreeBuff(SStreamFileState* pFileState, SRowBuffPos* pPos); SStreamSnapshot* getSnapshot(SStreamFileState* pFileState); int32_t flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot, bool flushState); @@ -52,6 +65,34 @@ int32_t deleteExpiredCheckPoint(SStreamFileState* pFileState, TSKEY mark); int32_t streamFileStateGeSelectRowSize(SStreamFileState* pFileState); void streamFileStateReloadInfo(SStreamFileState* pFileState, TSKEY ts); +void* getRowStateBuff(SStreamFileState* pFileState); +void* getStateFileStore(SStreamFileState* pFileState); +bool isDeteled(SStreamFileState* pFileState, TSKEY ts); +bool isFlushedState(SStreamFileState* pFileState, TSKEY ts, TSKEY gap); +SRowBuffPos* getNewRowPosForWrite(SStreamFileState* pFileState); +int32_t getRowStateRowSize(SStreamFileState* pFileState); + +// session window +int32_t getSessionWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, TSKEY gap, void** pVal, int32_t* pVLen); +int32_t putSessionWinResultBuff(SStreamFileState* pFileState, SRowBuffPos* pPos); +int32_t getSessionFlushedBuff(SStreamFileState* pFileState, SSessionKey* pKey, void** pVal, int32_t* pVLen); +int32_t deleteSessionWinStateBuffFn(void* pBuff, const void *key, size_t keyLen); +int32_t deleteSessionWinStateBuffByPosFn(SStreamFileState* pFileState, SRowBuffPos* pPos); + +void sessionWinStateClear(SStreamFileState* pFileState); +void sessionWinStateCleanup(void* pBuff); + +SStreamStateCur* sessionWinStateSeekKeyCurrentPrev(SStreamFileState* pFileState, const SSessionKey* pWinKey); +SStreamStateCur* sessionWinStateSeekKeyCurrentNext(SStreamFileState* pFileState, const SSessionKey* pWinKey); +SStreamStateCur* sessionWinStateSeekKeyNext(SStreamFileState* pFileState, const SSessionKey* pWinKey); +int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); +int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur); +int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey); + +// state window +int32_t getStateWinResultBuff(SStreamFileState* pFileState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, + state_key_cmpr_fn fn, void** pVal, int32_t* pVLen); + #ifdef __cplusplus } #endif diff --git a/include/util/tdef.h b/include/util/tdef.h index 7623b8dee9..287617970c 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -382,6 +382,7 @@ typedef enum ELogicConditionType { #define TSDB_MAX_STT_TRIGGER 1 #define TSDB_DEFAULT_SST_TRIGGER 1 #endif +#define TSDB_STT_TRIGGER_ARRAY_SIZE 16 // maximum of TSDB_MAX_STT_TRIGGER of TD_ENTERPRISE and TD_COMMUNITY #define TSDB_MIN_HASH_PREFIX (2 - TSDB_TABLE_NAME_LEN) #define TSDB_MAX_HASH_PREFIX (TSDB_TABLE_NAME_LEN - 2) #define TSDB_DEFAULT_HASH_PREFIX 0 diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 57cfa61847..5684411646 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -157,6 +157,10 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas tscDebug("new app inst mgr %p, user:%s, ip:%s, port:%d", p, user, epSet.epSet.eps[0].fqdn, epSet.epSet.eps[0].port); pInst = &p; + } else { + ASSERTS((*pInst) && (*pInst)->pAppHbMgr, "*pInst:%p, pAppHgMgr:%p", *pInst, (*pInst) ? (*pInst)->pAppHbMgr : NULL); + // reset to 0 in case of conn with duplicated user key but its user has ever been dropped. + atomic_store_8(&(*pInst)->pAppHbMgr->connHbFlag, 0); } taosThreadMutexUnlock(&appInfo.mutex); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 4b5663b126..0ba9539124 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5240,6 +5240,7 @@ int32_t tSerializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceVgr if (tStartEncode(&encoder) < 0) return -1; if (tEncodeI32(&encoder, pReq->useless) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -5253,6 +5254,9 @@ int32_t tDeserializeSBalanceVgroupLeaderReq(void *buf, int32_t bufLen, SBalanceV if (tStartDecode(&decoder) < 0) return -1; if (tDecodeI32(&decoder, &pReq->useless) < 0) return -1; + if(!tDecodeIsEnd(&decoder)){ + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c index d5d05565b5..4bd32cac20 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c @@ -21,7 +21,7 @@ static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) { if (dmStartStatusThread(pMgmt) != 0) { return -1; } -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +#if defined(TD_ENTERPRISE) if (dmStartNotifyThread(pMgmt) != 0) { return -1; } @@ -39,7 +39,9 @@ static void dmStopMgmt(SDnodeMgmt *pMgmt) { pMgmt->pData->stopped = true; dmStopMonitorThread(pMgmt); dmStopStatusThread(pMgmt); +#if defined(TD_ENTERPRISE) dmStopNotifyThread(pMgmt); +#endif dmStopCrashReportThread(pMgmt); } diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index ea7ded1879..f1a1bb8102 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -720,8 +720,8 @@ static int32_t mndProcessNotifyReq(SRpcMsg *pReq) { mndReleaseVgroup(pMnode, pVgroup); } } + mndUpdClusterInfo(pReq); _OVER: - mndUpdClusterInfo(pReq); tFreeSNotifyReq(¬ifyReq); return code; } @@ -781,10 +781,11 @@ static int32_t mndConfigDnode(SMnode *pMnode, SRpcMsg *pReq, SMCfgDnodeReq *pCfg SDnodeObj tmpDnode = *pDnode; if (action == DND_ACTIVE_CODE) { -#ifndef TD_CHECK_ACTIVE - strncpy(tmpDnode.active, pCfgReq->value, TSDB_ACTIVE_KEY_LEN); -#else +#ifndef TD_GRANT_OPTIMIZE if (grantAlterActiveCode(pDnode->active, pCfgReq->value, tmpDnode.active, 0) != 0) { +#else + if (grantAlterActiveCode(pDnode->id, pDnode->active, pCfgReq->value, tmpDnode.active, 0) != 0) { +#endif if (TSDB_CODE_DUP_KEY != terrno) { mError("dnode:%d, config dnode:%d, app:%p config:%s value:%s failed since %s", pDnode->id, pCfgReq->dnodeId, pReq->info.ahandle, pCfgReq->config, pCfgReq->value, terrstr()); @@ -799,12 +800,12 @@ static int32_t mndConfigDnode(SMnode *pMnode, SRpcMsg *pReq, SMCfgDnodeReq *pCfg if (cfgAll) continue; goto _OVER; } -#endif } else if (action == DND_CONN_ACTIVE_CODE) { -#ifndef TD_CHECK_ACTIVE - strncpy(tmpDnode.connActive, pCfgReq->value, TSDB_CONN_ACTIVE_KEY_LEN); -#else +#ifndef TD_GRANT_OPTIMIZE if (grantAlterActiveCode(pDnode->connActive, pCfgReq->value, tmpDnode.connActive, 1) != 0) { +#else + if (grantAlterActiveCode(pDnode->id, pDnode->connActive, pCfgReq->value, tmpDnode.connActive, 1) != 0) { +#endif if (TSDB_CODE_DUP_KEY != terrno) { mError("dnode:%d, config dnode:%d, app:%p config:%s value:%s failed since %s", pDnode->id, pCfgReq->dnodeId, pReq->info.ahandle, pCfgReq->config, pCfgReq->value, terrstr()); @@ -819,7 +820,6 @@ static int32_t mndConfigDnode(SMnode *pMnode, SRpcMsg *pReq, SMCfgDnodeReq *pCfg if (cfgAll) continue; goto _OVER; } -#endif } else { terrno = TSDB_CODE_INVALID_CFG; goto _OVER; diff --git a/source/dnode/mnode/impl/src/mndGrant.c b/source/dnode/mnode/impl/src/mndGrant.c index c4c5e0355d..9f2ac68da5 100644 --- a/source/dnode/mnode/impl/src/mndGrant.c +++ b/source/dnode/mnode/impl/src/mndGrant.c @@ -131,6 +131,13 @@ void grantAdd(EGrantType grant, uint64_t value) {} void grantRestore(EGrantType grant, uint64_t value) {} int32_t dmProcessGrantReq(void *pInfo, SRpcMsg *pMsg) { return TSDB_CODE_SUCCESS; } int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg) { return TSDB_CODE_SUCCESS; } +#ifndef TD_GRANT_OPTIMIZE +int32_t grantAlterActiveCode(const char *old, const char *new, char *out, int8_t type) { return TSDB_CODE_SUCCESS; } +#else +int32_t grantAlterActiveCode(int32_t did, const char *old, const char *new, char *out, int8_t type) { + return TSDB_CODE_SUCCESS; +} +#endif #endif diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 5d150b731c..3717530481 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -543,6 +543,10 @@ STrans *mndAcquireTrans(SMnode *pMnode, int32_t transId) { STrans *pTrans = sdbAcquire(pMnode->pSdb, SDB_TRANS, &transId); if (pTrans == NULL) { terrno = TSDB_CODE_MND_TRANS_NOT_EXIST; + } else { + #ifdef WINDOWS + taosThreadMutexInit(&pTrans->mutex, NULL); + #endif } return pTrans; } diff --git a/source/dnode/snode/src/snodeInitApi.c b/source/dnode/snode/src/snodeInitApi.c index e737e3fa37..389137f630 100644 --- a/source/dnode/snode/src/snodeInitApi.c +++ b/source/dnode/snode/src/snodeInitApi.c @@ -29,13 +29,12 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamFileStateInit = streamFileStateInit; pStore->updateInfoDestoryColseWinSBF = updateInfoDestoryColseWinSBF; - pStore->streamStateGetByPos = streamStateGetByPos; - pStore->streamStatePutParName = streamStatePutParName; pStore->streamStateGetParName = streamStateGetParName; pStore->streamStateAddIfNotExist = streamStateAddIfNotExist; pStore->streamStateReleaseBuf = streamStateReleaseBuf; + pStore->streamStateClearBuff = streamStateClearBuff; pStore->streamStateFreeVal = streamStateFreeVal; pStore->streamStatePut = streamStatePut; @@ -91,8 +90,6 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamStateSessionSeekKeyCurrentPrev = streamStateSessionSeekKeyCurrentPrev; pStore->streamStateSessionSeekKeyCurrentNext = streamStateSessionSeekKeyCurrentNext; - pStore->streamFileStateInit = streamFileStateInit; - pStore->streamFileStateDestroy = streamFileStateDestroy; pStore->streamFileStateClear = streamFileStateClear; pStore->needClearDiskBuff = needClearDiskBuff; diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index edcce83a05..66e7b99d55 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -625,7 +625,7 @@ struct SDFileSet { SDataFile *pDataF; SSmaFile *pSmaF; uint8_t nSttF; - SSttFile *aSttF[TSDB_MAX_STT_TRIGGER]; + SSttFile *aSttF[TSDB_STT_TRIGGER_ARRAY_SIZE]; }; struct STSDBRowIter { @@ -694,7 +694,7 @@ struct SDataFWriter { SHeadFile fHead; SDataFile fData; SSmaFile fSma; - SSttFile fStt[TSDB_MAX_STT_TRIGGER]; + SSttFile fStt[TSDB_STT_TRIGGER_ARRAY_SIZE]; uint8_t *aBuf[4]; }; @@ -705,7 +705,7 @@ struct SDataFReader { STsdbFD *pHeadFD; STsdbFD *pDataFD; STsdbFD *pSmaFD; - STsdbFD *aSttFD[TSDB_MAX_STT_TRIGGER]; + STsdbFD *aSttFD[TSDB_STT_TRIGGER_ARRAY_SIZE]; uint8_t *aBuf[3]; }; diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 863cd8006a..442a739076 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -195,7 +195,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche } static inline void metaTimeSeriesNotifyCheck(SMeta *pMeta) { -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +#if defined(TD_ENTERPRISE) int64_t nTimeSeries = metaGetTimeSeriesNum(pMeta, 0); int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries; if (deltaTS > tsTimeSeriesThreshold) { diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index 908c0eff34..b4c2c0a979 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -69,7 +69,7 @@ typedef struct { SDataIter *pIter; SRBTree rbt; SDataIter dataIter; - SDataIter aDataIter[TSDB_MAX_STT_TRIGGER]; + SDataIter aDataIter[TSDB_STT_TRIGGER_ARRAY_SIZE]; int8_t toLastOnly; }; struct { @@ -865,7 +865,7 @@ static int32_t tsdbCommitDataStart(SCommitter *pCommitter) { TSDB_CHECK_CODE(code, lino, _exit); // merger - for (int32_t iStt = 0; iStt < TSDB_MAX_STT_TRIGGER; iStt++) { + for (int32_t iStt = 0; iStt < TSDB_STT_TRIGGER_ARRAY_SIZE; iStt++) { SDataIter *pIter = &pCommitter->aDataIter[iStt]; pIter->aSttBlk = taosArrayInit(0, sizeof(SSttBlk)); if (pIter->aSttBlk == NULL) { @@ -915,7 +915,7 @@ static void tsdbCommitDataEnd(SCommitter *pCommitter) { tBlockDataDestroy(&pCommitter->dReader.bData); // merger - for (int32_t iStt = 0; iStt < TSDB_MAX_STT_TRIGGER; iStt++) { + for (int32_t iStt = 0; iStt < TSDB_STT_TRIGGER_ARRAY_SIZE; iStt++) { SDataIter *pIter = &pCommitter->aDataIter[iStt]; taosArrayDestroy(pIter->aSttBlk); tBlockDataDestroy(&pIter->bData); diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index 8c3efda856..f3bcfef703 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -1000,7 +1000,7 @@ int32_t tsdbDataFReaderClose(SDataFReader **ppReader) { tsdbCloseFile(&(*ppReader)->pSmaFD); // stt - for (int32_t iStt = 0; iStt < TSDB_MAX_STT_TRIGGER; iStt++) { + for (int32_t iStt = 0; iStt < TSDB_STT_TRIGGER_ARRAY_SIZE; iStt++) { if ((*ppReader)->aSttFD[iStt]) { tsdbCloseFile(&(*ppReader)->aSttFD[iStt]); } diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c index cb53876d97..c3b1a18fd8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRetention.c +++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c @@ -372,6 +372,14 @@ static int32_t tsdbDoRetention2(void *arg) { _exit: if (code) { + if (TARRAY2_DATA(rtner->fopArr)) { + TARRAY2_DESTROY(rtner->fopArr, NULL); + } + TFileSetArray **fsetArr = &rtner->fsetArr; + if (fsetArr[0]) { + tsdbFSDestroyCopySnapshot(&rtner->fsetArr); + } + TSDB_ERROR_LOG(TD_VID(rtner->tsdb->pVnode), lino, code); } return code; diff --git a/source/dnode/vnode/src/vnd/vnodeInitApi.c b/source/dnode/vnode/src/vnd/vnodeInitApi.c index c72ecd4824..72e5e9ca88 100644 --- a/source/dnode/vnode/src/vnd/vnodeInitApi.c +++ b/source/dnode/vnode/src/vnd/vnodeInitApi.c @@ -137,13 +137,12 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamFileStateInit = streamFileStateInit; pStore->updateInfoDestoryColseWinSBF = updateInfoDestoryColseWinSBF; - pStore->streamStateGetByPos = streamStateGetByPos; - pStore->streamStatePutParName = streamStatePutParName; pStore->streamStateGetParName = streamStateGetParName; pStore->streamStateAddIfNotExist = streamStateAddIfNotExist; pStore->streamStateReleaseBuf = streamStateReleaseBuf; + pStore->streamStateClearBuff = streamStateClearBuff; pStore->streamStateFreeVal = streamStateFreeVal; pStore->streamStatePut = streamStatePut; @@ -199,8 +198,6 @@ void initStateStoreAPI(SStateStore* pStore) { pStore->streamStateSessionSeekKeyCurrentPrev = streamStateSessionSeekKeyCurrentPrev; pStore->streamStateSessionSeekKeyCurrentNext = streamStateSessionSeekKeyCurrentNext; - pStore->streamFileStateInit = streamFileStateInit; - pStore->streamFileStateDestroy = streamFileStateDestroy; pStore->streamFileStateClear = streamFileStateClear; pStore->needClearDiskBuff = needClearDiskBuff; diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h index 8726f57977..d5d144ee65 100644 --- a/source/libs/executor/inc/executorInt.h +++ b/source/libs/executor/inc/executorInt.h @@ -548,9 +548,9 @@ typedef struct SWindowRowsSup { } SWindowRowsSup; typedef struct SResultWindowInfo { - void* pOutputBuf; - SSessionKey sessionWin; - bool isOutput; + SRowBuffPos* pStatePos; + SSessionKey sessionWin; + bool isOutput; } SResultWindowInfo; typedef struct SStreamSessionAggOperatorInfo { @@ -579,6 +579,7 @@ typedef struct SStreamSessionAggOperatorInfo { bool isHistoryOp; bool reCkBlock; SSDataBlock* pCheckpointRes; + bool clearState; } SStreamSessionAggOperatorInfo; typedef struct SStreamStateAggOperatorInfo { @@ -672,8 +673,6 @@ void cleanupAggSup(SAggSupporter* pAggSup); void initResultSizeInfo(SResultInfo* pResultInfo, int32_t numOfRows); -void doBuildStreamResBlock(struct SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, - SDiskbasedBuf* pBuf); void doBuildResultDatablock(struct SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, SDiskbasedBuf* pBuf); @@ -739,12 +738,6 @@ int32_t finalizeResultRows(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPos SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo); bool groupbyTbname(SNodeList* pGroupList); -int32_t buildDataBlockFromGroupRes(struct SOperatorInfo* pOperator, void* pState, SSDataBlock* pBlock, SExprSupp* pSup, - SGroupResInfo* pGroupResInfo); -int32_t saveSessionDiscBuf(void* pState, SSessionKey* key, void* buf, int32_t size, SStateStore* pAPI); -int32_t buildSessionResultDataBlock(struct SOperatorInfo* pOperator, void* pState, SSDataBlock* pBlock, SExprSupp* pSup, - SGroupResInfo* pGroupResInfo); -int32_t releaseOutputBuf(void* pState, SWinKey* pKey, SResultRow* pResult, SStateStore* pAPI); void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order); int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey, int32_t pos, int32_t order, int64_t* pData); diff --git a/source/libs/executor/src/executorInt.c b/source/libs/executor/src/executorInt.c index 519a308c3a..8ad174f366 100644 --- a/source/libs/executor/src/executorInt.c +++ b/source/libs/executor/src/executorInt.c @@ -720,38 +720,6 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS return 0; } -void doBuildStreamResBlock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, - SDiskbasedBuf* pBuf) { - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SStorageAPI* pAPI = &pTaskInfo->storageAPI; - - SSDataBlock* pBlock = pbInfo->pRes; - - // set output datablock version - pBlock->info.version = pTaskInfo->version; - - blockDataCleanup(pBlock); - if (!hasRemainResults(pGroupResInfo)) { - return; - } - - // clear the existed group id - pBlock->info.id.groupId = 0; - ASSERT(!pbInfo->mergeResultBlock); - doCopyToSDataBlock(pTaskInfo, pBlock, &pOperator->exprSupp, pBuf, pGroupResInfo, pOperator->resultInfo.threshold, - false); - - void* tbname = NULL; - if (pAPI->stateStore.streamStateGetParName((void*)pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, &tbname) < - 0) { - pBlock->info.parTbName[0] = 0; - } else { - memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); - } - - pAPI->stateStore.streamStateFreeVal(tbname); -} - void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SGroupResInfo* pGroupResInfo, SDiskbasedBuf* pBuf) { SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -960,109 +928,6 @@ int32_t createDataSinkParam(SDataSinkNode* pNode, void** pParam, SExecTaskInfo* return TSDB_CODE_SUCCESS; } -int32_t releaseOutputBuf(void* pState, SWinKey* pKey, SResultRow* pResult, SStateStore* pAPI) { - pAPI->streamStateReleaseBuf(pState, pKey, pResult); - return TSDB_CODE_SUCCESS; -} - -int32_t saveSessionDiscBuf(void* pState, SSessionKey* key, void* buf, int32_t size, SStateStore* pAPI) { - pAPI->streamStateSessionPut(pState, key, (const void*)buf, size); - releaseOutputBuf(pState, NULL, (SResultRow*)buf, pAPI); - return TSDB_CODE_SUCCESS; -} - -int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, void* pState, SSDataBlock* pBlock, SExprSupp* pSup, - SGroupResInfo* pGroupResInfo) { - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SStorageAPI* pAPI = &pTaskInfo->storageAPI; - - SExprInfo* pExprInfo = pSup->pExprInfo; - int32_t numOfExprs = pSup->numOfExprs; - int32_t* rowEntryOffset = pSup->rowEntryInfoOffset; - SqlFunctionCtx* pCtx = pSup->pCtx; - - int32_t numOfRows = getNumOfTotalRes(pGroupResInfo); - - for (int32_t i = pGroupResInfo->index; i < numOfRows; i += 1) { - SSessionKey* pKey = taosArrayGet(pGroupResInfo->pRows, i); - int32_t size = 0; - void* pVal = NULL; - int32_t code = pAPI->stateStore.streamStateSessionGet(pState, pKey, &pVal, &size); - // ASSERT(code == 0); - if (code == -1) { - // for history - qWarn("===stream===not found session result key:%" PRId64 ", ekey:%" PRId64 ", groupId:%" PRIu64 "", - pKey->win.skey, pKey->win.ekey, pKey->groupId); - pGroupResInfo->index += 1; - continue; - } - SResultRow* pRow = (SResultRow*)pVal; - doUpdateNumOfRows(pCtx, pRow, numOfExprs, rowEntryOffset); - // no results, continue to check the next one - if (pRow->numOfRows == 0) { - pGroupResInfo->index += 1; - releaseOutputBuf(pState, NULL, pRow, &pAPI->stateStore); - continue; - } - - if (pBlock->info.id.groupId == 0) { - pBlock->info.id.groupId = pKey->groupId; - - void* tbname = NULL; - if (pAPI->stateStore.streamStateGetParName((void*)pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, - &tbname) < 0) { - pBlock->info.parTbName[0] = 0; - } else { - memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); - } - pAPI->stateStore.streamStateFreeVal(tbname); - } else { - // current value belongs to different group, it can't be packed into one datablock - if (pBlock->info.id.groupId != pKey->groupId) { - releaseOutputBuf(pState, NULL, pRow, &pAPI->stateStore); - break; - } - } - - if (pBlock->info.rows + pRow->numOfRows > pBlock->info.capacity) { - ASSERT(pBlock->info.rows > 0); - releaseOutputBuf(pState, NULL, pRow, &pAPI->stateStore); - break; - } - - pGroupResInfo->index += 1; - - for (int32_t j = 0; j < numOfExprs; ++j) { - int32_t slotId = pExprInfo[j].base.resSchema.slotId; - - pCtx[j].resultInfo = getResultEntryInfo(pRow, j, rowEntryOffset); - if (pCtx[j].fpSet.finalize) { - int32_t code1 = pCtx[j].fpSet.finalize(&pCtx[j], pBlock); - if (TAOS_FAILED(code1)) { - qError("%s build result data block error, code %s", GET_TASKID(pTaskInfo), tstrerror(code1)); - T_LONG_JMP(pTaskInfo->env, code1); - } - } else if (strcmp(pCtx[j].pExpr->pExpr->_function.functionName, "_select_value") == 0) { - // do nothing, todo refactor - } else { - // expand the result into multiple rows. E.g., _wstart, top(k, 20) - // the _wstart needs to copy to 20 following rows, since the results of top-k expands to 20 different rows. - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId); - char* in = GET_ROWCELL_INTERBUF(pCtx[j].resultInfo); - for (int32_t k = 0; k < pRow->numOfRows; ++k) { - colDataSetVal(pColInfoData, pBlock->info.rows + k, in, pCtx[j].resultInfo->isNullRes); - } - } - } - - pBlock->info.dataLoad = 1; - pBlock->info.rows += pRow->numOfRows; - releaseOutputBuf(pState, NULL, pRow, &pAPI->stateStore); - } - blockDataUpdateTsWindow(pBlock, 0); - return TSDB_CODE_SUCCESS; -} - void streamOpReleaseState(SOperatorInfo* pOperator) { SOperatorInfo* downstream = pOperator->pDownstream[0]; if (downstream->fpSet.releaseStreamStateFn) { diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c index 1060dd4f0e..f6b0a87f54 100644 --- a/source/libs/executor/src/groupoperator.c +++ b/source/libs/executor/src/groupoperator.c @@ -1057,7 +1057,7 @@ void appendCreateTableRow(void* pState, SExprSupp* pTableSup, SExprSupp* pTagSup } else { memcpy(pSrcBlock->info.parTbName, pValue, TSDB_TABLE_NAME_LEN); } - pAPI->streamStateReleaseBuf(pState, NULL, pValue); + pAPI->streamStateFreeVal(pValue); } static SSDataBlock* buildStreamCreateTableResult(SOperatorInfo* pOperator) { diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c index 1c909cb47d..c9da3c99e7 100644 --- a/source/libs/executor/src/streamtimewindowoperator.c +++ b/source/libs/executor/src/streamtimewindowoperator.c @@ -152,8 +152,7 @@ static int32_t saveResult(SResultWindowInfo winInfo, SSHashObj* pStUpdated) { } static int32_t saveWinResult(SWinKey* pKey, SRowBuffPos* pPos, SSHashObj* pUpdatedMap) { - tSimpleHashPut(pUpdatedMap, pKey, sizeof(SWinKey), &pPos, POINTER_BYTES); - return TSDB_CODE_SUCCESS; + return tSimpleHashPut(pUpdatedMap, pKey, sizeof(SWinKey), &pPos, POINTER_BYTES); } static int32_t saveWinResultInfo(TSKEY ts, uint64_t groupId, SRowBuffPos* pPos, SSHashObj* pUpdatedMap) { @@ -696,7 +695,6 @@ int32_t buildDataBlockFromGroupRes(SOperatorInfo* pOperator, void* pState, SSDat int32_t slotId = pExprInfo[j].base.resSchema.slotId; pCtx[j].resultInfo = getResultEntryInfo(pRow, j, rowEntryOffset); - SResultRowEntryInfo* pEnryInfo = pCtx[j].resultInfo; if (pCtx[j].fpSet.finalize) { int32_t code1 = pCtx[j].fpSet.finalize(&pCtx[j], pBlock); @@ -931,17 +929,6 @@ void* decodeSWinKey(void* buf, SWinKey* key) { return buf; } -int32_t encodeSRowBuffPos(void** buf, SRowBuffPos* pos) { - int32_t tlen = 0; - tlen += encodeSWinKey(buf, pos->pKey); - return tlen; -} - -void* decodeSRowBuffPos(void* buf, SRowBuffPos* pos) { - buf = decodeSWinKey(buf, pos->pKey); - return buf; -} - int32_t encodeSTimeWindowAggSupp(void** buf, STimeWindowAggSupp* pTwAggSup) { int32_t tlen = 0; tlen += taosEncodeFixedI64(buf, pTwAggSup->minTs); @@ -1155,6 +1142,18 @@ static SSDataBlock* buildIntervalResult(SOperatorInfo* pOperator) { return NULL; } +static int32_t copyUpdateResult(SSHashObj** ppWinUpdated, SArray* pUpdated, __compar_fn_t compar) { + void* pIte = NULL; + int32_t iter = 0; + while ((pIte = tSimpleHashIterate(*ppWinUpdated, pIte, &iter)) != NULL) { + taosArrayPush(pUpdated, pIte); + } + taosArraySort(pUpdated, compar); + tSimpleHashCleanup(*ppWinUpdated); + *ppWinUpdated = NULL; + return TSDB_CODE_SUCCESS; +} + static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { SStreamIntervalOperatorInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; @@ -1311,15 +1310,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } pInfo->binfo.pRes->info.watermark = pInfo->twAggSup.maxTs; - void* pIte = NULL; - int32_t iter = 0; - while ((pIte = tSimpleHashIterate(pInfo->pUpdatedMap, pIte, &iter)) != NULL) { - taosArrayPush(pInfo->pUpdated, pIte); - } - - tSimpleHashCleanup(pInfo->pUpdatedMap); - pInfo->pUpdatedMap = NULL; - taosArraySort(pInfo->pUpdated, winPosCmprImpl); + copyUpdateResult(&pInfo->pUpdatedMap, pInfo->pUpdated, winPosCmprImpl); initMultiResInfoFromArrayList(&pInfo->groupResInfo, pInfo->pUpdated); pInfo->pUpdated = NULL; @@ -1480,7 +1471,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream, int32_t funResSize = getMaxFunResSize(&pOperator->exprSupp, numOfCols); pInfo->pState->pFileState = pAPI->stateStore.streamFileStateInit( tsStreamBufferSize, sizeof(SWinKey), pInfo->aggSup.resultRowSize, funResSize, compareTs, pInfo->pState, - pInfo->twAggSup.deleteMark, GET_TASKID(pTaskInfo), pHandle->checkpointId); + pInfo->twAggSup.deleteMark, GET_TASKID(pTaskInfo), pHandle->checkpointId, STREAM_STATE_BUFF_HASH); pInfo->dataVersion = 0; pInfo->stateStore = pTaskInfo->storageAPI.stateStore; pInfo->recvGetAll = false; @@ -1529,6 +1520,7 @@ void destroyStreamAggSupporter(SStreamAggSupporter* pSup) { tSimpleHashCleanup(pSup->pResultRows); destroyDiskbasedBuf(pSup->pResultBuf); blockDataDestroy(pSup->pScanBlock); + pSup->stateStore.streamFileStateDestroy(pSup->pState->pFileState); taosMemoryFreeClear(pSup->pState); taosMemoryFreeClear(pSup->pDummyCtx); } @@ -1607,10 +1599,16 @@ void initDownStream(SOperatorInfo* downstream, SStreamAggSupporter* pAggSup, uin pScanInfo->twAggSup = *pTwSup; } -int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, SqlFunctionCtx* pCtx, int32_t numOfOutput, int64_t gap, +static TSKEY sesionTs(void* pKey) { + SSessionKey* pWinKey = (SSessionKey*)pKey; + return pWinKey->win.skey; +} + +int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, SExprSupp* pExpSup, int32_t numOfOutput, int64_t gap, SStreamState* pState, int32_t keySize, int16_t keyType, SStateStore* pStore, - SReadHandle* pHandle, SStorageAPI* pApi) { - pSup->resultRowSize = keySize + getResultRowSize(pCtx, numOfOutput); + SReadHandle* pHandle, STimeWindowAggSupp* pTwAggSup, const char* taskIdStr, + SStorageAPI* pApi) { + pSup->resultRowSize = keySize + getResultRowSize(pExpSup->pCtx, numOfOutput); pSup->pScanBlock = createSpecialDataBlock(STREAM_CLEAR); pSup->gap = gap; pSup->stateKeySize = keySize; @@ -1622,10 +1620,14 @@ int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, SqlFunctionCtx* pCtx, pSup->stateStore = *pStore; - initDummyFunction(pSup->pDummyCtx, pCtx, numOfOutput); + initDummyFunction(pSup->pDummyCtx, pExpSup->pCtx, numOfOutput); pSup->pState = taosMemoryCalloc(1, sizeof(SStreamState)); *(pSup->pState) = *pState; pSup->stateStore.streamStateSetNumber(pSup->pState, -1); + int32_t funResSize = getMaxFunResSize(pExpSup, numOfOutput); + pSup->pState->pFileState = pSup->stateStore.streamFileStateInit( + tsStreamBufferSize, sizeof(SSessionKey), pSup->resultRowSize, funResSize, sesionTs, pSup->pState, + pTwAggSup->deleteMark, taskIdStr, pHandle->checkpointId, STREAM_STATE_BUFF_SORT); _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); pSup->pResultRows = tSimpleHashInit(32, hashFn); @@ -1648,7 +1650,7 @@ int32_t initStreamAggSupporter(SStreamAggSupporter* pSup, SqlFunctionCtx* pCtx, int32_t code = createDiskbasedBuf(&pSup->pResultBuf, pageSize, bufSize, "function", tsTempDir); for (int32_t i = 0; i < numOfOutput; ++i) { - pCtx[i].saveHandle.pBuf = pSup->pResultBuf; + pExpSup->pCtx[i].saveHandle.pBuf = pSup->pResultBuf; } pSup->pSessionAPI = pApi; @@ -1687,33 +1689,40 @@ bool inWinRange(STimeWindow* range, STimeWindow* cur) { return false; } +int32_t clearOutputBuf(void* pState, SRowBuffPos* pPos, SStateStore* pAPI) { + return pAPI->streamStateClearBuff(pState, pPos); +} + void setSessionOutputBuf(SStreamAggSupporter* pAggSup, TSKEY startTs, TSKEY endTs, uint64_t groupId, SResultWindowInfo* pCurWin) { pCurWin->sessionWin.groupId = groupId; pCurWin->sessionWin.win.skey = startTs; pCurWin->sessionWin.win.ekey = endTs; int32_t size = pAggSup->resultRowSize; - int32_t code = pAggSup->stateStore.streamStateSessionAddIfNotExist(pAggSup->pState, &pCurWin->sessionWin, - pAggSup->gap, &pCurWin->pOutputBuf, &size); + int32_t code = pAggSup->stateStore.streamStateSessionAddIfNotExist(pAggSup->pState, &pCurWin->sessionWin, + pAggSup->gap, (void**)&pCurWin->pStatePos, &size); if (code == TSDB_CODE_SUCCESS && !inWinRange(&pAggSup->winRange, &pCurWin->sessionWin.win)) { code = TSDB_CODE_FAILED; - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)pCurWin->pOutputBuf, &pAggSup->pSessionAPI->stateStore); - pCurWin->pOutputBuf = taosMemoryCalloc(1, size); + clearOutputBuf(pAggSup->pState, pCurWin->pStatePos, &pAggSup->pSessionAPI->stateStore); } if (code == TSDB_CODE_SUCCESS) { pCurWin->isOutput = true; - pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pCurWin->sessionWin); + if (pCurWin->pStatePos->needFree) { + pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pCurWin->sessionWin); + } } else { pCurWin->sessionWin.win.skey = startTs; pCurWin->sessionWin.win.ekey = endTs; } + qDebug("===stream===set session window buff .start:%" PRId64 ",end:%" PRId64 ",groupid:%" PRIu64, + pCurWin->sessionWin.win.skey, pCurWin->sessionWin.win.ekey, pCurWin->sessionWin.groupId); } int32_t getSessionWinBuf(SStreamAggSupporter* pAggSup, SStreamStateCur* pCur, SResultWindowInfo* pWinInfo) { int32_t size = 0; - int32_t code = - pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pWinInfo->sessionWin, &pWinInfo->pOutputBuf, &size); + int32_t code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pWinInfo->sessionWin, + (void**)&pWinInfo->pStatePos, &size); if (code != TSDB_CODE_SUCCESS) { return code; } @@ -1731,9 +1740,23 @@ void saveDeleteRes(SSHashObj* pStDelete, SSessionKey key) { tSimpleHashPut(pStDelete, &key, sizeof(SSessionKey), NULL, 0); } -static void removeSessionResult(SSHashObj* pHashMap, SSHashObj* pResMap, SSessionKey key) { +int32_t releaseOutputBuf(void* pState, SRowBuffPos* pPos, SStateStore* pAPI) { + pAPI->streamStateReleaseBuf(pState, pPos, false); + return TSDB_CODE_SUCCESS; +} + +int32_t reuseOutputBuf(void* pState, SRowBuffPos* pPos, SStateStore* pAPI) { + pAPI->streamStateReleaseBuf(pState, pPos, true); + return TSDB_CODE_SUCCESS; +} + +static void removeSessionResult(SStreamAggSupporter* pAggSup, SSHashObj* pHashMap, SSHashObj* pResMap, SSessionKey key) { key.win.ekey = key.win.skey; - tSimpleHashRemove(pHashMap, &key, sizeof(SSessionKey)); + void* pVal = tSimpleHashGet(pHashMap, &key, sizeof(SSessionKey)); + if (pVal) { + releaseOutputBuf(pAggSup->pState, *(void**)pVal, &pAggSup->pSessionAPI->stateStore); + tSimpleHashRemove(pHashMap, &key, sizeof(SSessionKey)); + } tSimpleHashRemove(pResMap, &key, sizeof(SSessionKey)); } @@ -1742,7 +1765,7 @@ static void getSessionHashKey(const SSessionKey* pKey, SSessionKey* pHashKey) { pHashKey->win.ekey = pKey->win.skey; } -static void removeSessionResults(SSHashObj* pHashMap, SArray* pWins) { +static void removeSessionDeleteResults(SSHashObj* pHashMap, SArray* pWins) { if (tSimpleHashGetSize(pHashMap) == 0) { return; } @@ -1756,7 +1779,25 @@ static void removeSessionResults(SSHashObj* pHashMap, SArray* pWins) { } } -int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t groupId, +static void removeSessionResults(SStreamAggSupporter* pAggSup, SSHashObj* pHashMap, SArray* pWins) { + if (tSimpleHashGetSize(pHashMap) == 0) { + return; + } + int32_t size = taosArrayGetSize(pWins); + for (int32_t i = 0; i < size; i++) { + SSessionKey* pWin = taosArrayGet(pWins, i); + if (!pWin) continue; + SSessionKey key = {0}; + getSessionHashKey(pWin, &key); + void* pVal = tSimpleHashGet(pHashMap, &key, sizeof(SSessionKey)); + if (pVal) { + releaseOutputBuf(pAggSup->pState, *(void**)pVal, &pAggSup->pSessionAPI->stateStore); + tSimpleHashRemove(pHashMap, &key, sizeof(SSessionKey)); + } + } +} + +int32_t updateSessionWindowInfo(SStreamAggSupporter* pAggSup, SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TSKEY* pEndTs, uint64_t groupId, int32_t rows, int32_t start, int64_t gap, SSHashObj* pResultRows, SSHashObj* pStUpdated, SSHashObj* pStDeleted) { for (int32_t i = start; i < rows; ++i) { @@ -1767,13 +1808,14 @@ int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TS if (pStDeleted && pWinInfo->isOutput) { saveDeleteRes(pStDeleted, pWinInfo->sessionWin); } - removeSessionResult(pStUpdated, pResultRows, pWinInfo->sessionWin); + removeSessionResult(pAggSup, pStUpdated, pResultRows, pWinInfo->sessionWin); pWinInfo->sessionWin.win.skey = pStartTs[i]; } pWinInfo->sessionWin.win.ekey = TMAX(pWinInfo->sessionWin.win.ekey, pStartTs[i]); if (pEndTs) { pWinInfo->sessionWin.win.ekey = TMAX(pWinInfo->sessionWin.win.ekey, pEndTs[i]); } + memcpy(pWinInfo->pStatePos->pKey, &pWinInfo->sessionWin, sizeof(SSessionKey)); } return rows - start; } @@ -1781,7 +1823,7 @@ int32_t updateSessionWindowInfo(SResultWindowInfo* pWinInfo, TSKEY* pStartTs, TS static int32_t initSessionOutputBuf(SResultWindowInfo* pWinInfo, SResultRow** pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) { ASSERT(pWinInfo->sessionWin.win.skey <= pWinInfo->sessionWin.win.ekey); - *pResult = (SResultRow*)pWinInfo->pOutputBuf; + *pResult = (SResultRow*)pWinInfo->pStatePos->pRowBuff; // set time window for current result (*pResult)->win = pWinInfo->sessionWin.win; setResultRowInitCtx(*pResult, pCtx, numOfOutput, rowEntryInfoOffset); @@ -1819,20 +1861,19 @@ static int32_t setSessionWinOutputInfo(SSHashObj* pStUpdated, SResultWindowInfo* return TSDB_CODE_SUCCESS; } -SStreamStateCur* getNextSessionWinInfo(SStreamAggSupporter* pAggSup, SSHashObj* pStUpdated, SResultWindowInfo* pCurWin, +void getNextSessionWinInfo(SStreamAggSupporter* pAggSup, SSHashObj* pStUpdated, SResultWindowInfo* pCurWin, SResultWindowInfo* pNextWin) { SStreamStateCur* pCur = pAggSup->stateStore.streamStateSessionSeekKeyNext(pAggSup->pState, &pCurWin->sessionWin); pNextWin->isOutput = true; setSessionWinOutputInfo(pStUpdated, pNextWin); int32_t size = 0; pNextWin->sessionWin = pCurWin->sessionWin; - int32_t code = - pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pNextWin->sessionWin, &pNextWin->pOutputBuf, &size); + int32_t code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pNextWin->sessionWin, + (void**)&pNextWin->pStatePos, &size); if (code != TSDB_CODE_SUCCESS) { - taosMemoryFreeClear(pNextWin->pOutputBuf); SET_SESSION_WIN_INVALID(*pNextWin); } - return pCur; + pAggSup->stateStore.streamStateFreeCur(pCur); } static int32_t compactSessionWindow(SOperatorInfo* pOperator, SResultWindowInfo* pCurWin, SSHashObj* pStUpdated, @@ -1850,16 +1891,16 @@ static int32_t compactSessionWindow(SOperatorInfo* pOperator, SResultWindowInfo* // Just look for the window behind StartIndex while (1) { SResultWindowInfo winInfo = {0}; - SStreamStateCur* pCur = getNextSessionWinInfo(pAggSup, pStUpdated, pCurWin, &winInfo); + getNextSessionWinInfo(pAggSup, pStUpdated, pCurWin, &winInfo); if (!IS_VALID_SESSION_WIN(winInfo) || !isInWindow(pCurWin, winInfo.sessionWin.win.skey, pAggSup->gap) || !inWinRange(&pAggSup->winRange, &winInfo.sessionWin.win)) { - taosMemoryFree(winInfo.pOutputBuf); - pAPI->stateStore.streamStateFreeCur(pCur); + releaseOutputBuf(pAggSup->pState, winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); break; } SResultRow* pWinResult = NULL; initSessionOutputBuf(&winInfo, &pWinResult, pAggSup->pDummyCtx, numOfOutput, pSup->rowEntryInfoOffset); pCurWin->sessionWin.win.ekey = TMAX(pCurWin->sessionWin.win.ekey, winInfo.sessionWin.win.ekey); + memcpy(pCurWin->pStatePos->pKey, &pCurWin->sessionWin, sizeof(SSessionKey)); int64_t winDelta = 0; if (addGap) { winDelta = pAggSup->gap; @@ -1870,10 +1911,9 @@ static int32_t compactSessionWindow(SOperatorInfo* pOperator, SResultWindowInfo* if (winInfo.isOutput && pStDeleted) { saveDeleteRes(pStDeleted, winInfo.sessionWin); } - removeSessionResult(pStUpdated, pAggSup->pResultRows, winInfo.sessionWin); + removeSessionResult(pAggSup, pStUpdated, pAggSup->pResultRows, winInfo.sessionWin); doDeleteSessionWindow(pAggSup, &winInfo.sessionWin); - pAPI->stateStore.streamStateFreeCur(pCur); - taosMemoryFree(winInfo.pOutputBuf); + releaseOutputBuf(pAggSup->pState, winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); winNum++; } return winNum; @@ -1890,25 +1930,23 @@ static void compactSessionSemiWindow(SOperatorInfo* pOperator, SResultWindowInfo // Just look for the window behind StartIndex while (1) { SResultWindowInfo winInfo = {0}; - SStreamStateCur* pCur = getNextSessionWinInfo(pAggSup, NULL, pCurWin, &winInfo); + getNextSessionWinInfo(pAggSup, NULL, pCurWin, &winInfo); if (!IS_VALID_SESSION_WIN(winInfo) || !isInWindow(pCurWin, winInfo.sessionWin.win.skey, pAggSup->gap) || !inWinRange(&pAggSup->winRange, &winInfo.sessionWin.win)) { - taosMemoryFree(winInfo.pOutputBuf); - pAPI->stateStore.streamStateFreeCur(pCur); + releaseOutputBuf(pAggSup->pState, winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); break; } pCurWin->sessionWin.win.ekey = TMAX(pCurWin->sessionWin.win.ekey, winInfo.sessionWin.win.ekey); + memcpy(pCurWin->pStatePos->pKey, &pCurWin->sessionWin, sizeof(SSessionKey)); doDeleteSessionWindow(pAggSup, &winInfo.sessionWin); - pAPI->stateStore.streamStateFreeCur(pCur); - taosMemoryFree(winInfo.pOutputBuf); + releaseOutputBuf(pAggSup->pState, winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); } } int32_t saveSessionOutputBuf(SStreamAggSupporter* pAggSup, SResultWindowInfo* pWinInfo) { - saveSessionDiscBuf(pAggSup->pState, &pWinInfo->sessionWin, pWinInfo->pOutputBuf, pAggSup->resultRowSize, - &pAggSup->stateStore); - pWinInfo->pOutputBuf = NULL; - return TSDB_CODE_SUCCESS; + qDebug("===stream===try save session result skey:%" PRId64 ", ekey:%" PRId64 ".pos%d", + pWinInfo->sessionWin.win.skey, pWinInfo->sessionWin.win.ekey, pWinInfo->pStatePos->needFree); + return pAggSup->stateStore.streamStateSessionPut(pAggSup->pState, &pWinInfo->sessionWin, pWinInfo->pStatePos, pAggSup->resultRowSize); } static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBlock, SSHashObj* pStUpdated, @@ -1946,13 +1984,13 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData } SResultWindowInfo winInfo = {0}; setSessionOutputBuf(pAggSup, startTsCols[i], endTsCols[i], groupId, &winInfo); - setSessionWinOutputInfo(pStUpdated, &winInfo); - winRows = updateSessionWindowInfo(&winInfo, startTsCols, endTsCols, groupId, rows, i, pAggSup->gap, - pAggSup->pResultRows, pStUpdated, pStDeleted); // coverity scan error - if (!winInfo.pOutputBuf) { - T_LONG_JMP(pTaskInfo->env, TSDB_CODE_OUT_OF_MEMORY); + if (!winInfo.pStatePos) { + continue; } + setSessionWinOutputInfo(pStUpdated, &winInfo); + winRows = updateSessionWindowInfo(pAggSup, &winInfo, startTsCols, endTsCols, groupId, rows, i, pAggSup->gap, + pAggSup->pResultRows, pStUpdated, pStDeleted); int64_t winDelta = 0; if (addGap) { @@ -2005,8 +2043,10 @@ static void doDeleteTimeWindows(SStreamAggSupporter* pAggSup, SSDataBlock* pBloc } static inline int32_t sessionKeyCompareAsc(const void* pKey1, const void* pKey2) { - SSessionKey* pWin1 = (SSessionKey*)pKey1; - SSessionKey* pWin2 = (SSessionKey*)pKey2; + SResultWindowInfo* pWinInfo1 = (SResultWindowInfo*)pKey1; + SResultWindowInfo* pWinInfo2 = (SResultWindowInfo*)pKey2; + SSessionKey* pWin1 = &pWinInfo1->sessionWin; + SSessionKey* pWin2 = &pWinInfo2->sessionWin; if (pWin1->groupId > pWin2->groupId) { return 1; @@ -2023,17 +2063,6 @@ static inline int32_t sessionKeyCompareAsc(const void* pKey1, const void* pKey2) return 0; } -static int32_t copyUpdateResult(SSHashObj* pStUpdated, SArray* pUpdated) { - void* pIte = NULL; - int32_t iter = 0; - while ((pIte = tSimpleHashIterate(pStUpdated, pIte, &iter)) != NULL) { - void* key = tSimpleHashGetKey(pIte, NULL); - taosArrayPush(pUpdated, key); - } - taosArraySort(pUpdated, sessionKeyCompareAsc); - return TSDB_CODE_SUCCESS; -} - void doBuildDeleteDataBlock(SOperatorInfo* pOp, SSHashObj* pStDeleted, SSDataBlock* pBlock, void** Ite) { SStorageAPI* pAPI = &pOp->pTaskInfo->storageAPI; @@ -2111,35 +2140,41 @@ static void rebuildSessionWindow(SOperatorInfo* pOperator, SArray* pWinArray, SS int32_t code = getSessionWinBuf(pChAggSup, pCur, &childWin); if (code == TSDB_CODE_SUCCESS && !inWinRange(&pAggSup->winRange, &childWin.sessionWin.win)) { - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)childWin.pOutputBuf, &pAggSup->stateStore); + releaseOutputBuf(pAggSup->pState, childWin.pStatePos, &pAggSup->stateStore); continue; } if (code == TSDB_CODE_SUCCESS && inWinRange(&pWinKey->win, &childWin.sessionWin.win)) { if (num == 0) { setSessionOutputBuf(pAggSup, pWinKey->win.skey, pWinKey->win.ekey, pWinKey->groupId, &parentWin); + parentWin.sessionWin = childWin.sessionWin; + memcpy(parentWin.pStatePos->pKey, &parentWin.sessionWin, sizeof(SSessionKey)); code = initSessionOutputBuf(&parentWin, &pResult, pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset); if (code != TSDB_CODE_SUCCESS || pResult == NULL) { - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)childWin.pOutputBuf, &pAggSup->stateStore); + releaseOutputBuf(pAggSup->pState, childWin.pStatePos, &pAggSup->stateStore); break; } } num++; + parentWin.sessionWin.win.skey = TMIN(parentWin.sessionWin.win.skey, childWin.sessionWin.win.skey); + parentWin.sessionWin.win.ekey = TMAX(parentWin.sessionWin.win.ekey, childWin.sessionWin.win.ekey); + memcpy(parentWin.pStatePos->pKey, &parentWin.sessionWin, sizeof(SSessionKey)); + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &parentWin.sessionWin.win, pAggSup->gap); initSessionOutputBuf(&childWin, &pChResult, pChild->exprSupp.pCtx, numOfOutput, pChild->exprSupp.rowEntryInfoOffset); compactFunctions(pSup->pCtx, pChild->exprSupp.pCtx, numOfOutput, pTaskInfo, &pInfo->twAggSup.timeWindowData); compactSessionWindow(pOperator, &parentWin, pStUpdated, NULL, true); - saveResult(parentWin, pStUpdated); - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)childWin.pOutputBuf, &pAggSup->stateStore); + releaseOutputBuf(pAggSup->pState, childWin.pStatePos, &pAggSup->stateStore); } else { - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)childWin.pOutputBuf, &pAggSup->stateStore); + releaseOutputBuf(pAggSup->pState, childWin.pStatePos, &pAggSup->stateStore); break; } } pAPI->stateStore.streamStateFreeCur(pCur); } if (num > 0) { + saveResult(parentWin, pStUpdated); saveSessionOutputBuf(pAggSup, &parentWin); } } @@ -2203,6 +2238,94 @@ void initGroupResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayL pGroupResInfo->freeItem = false; } +int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, void* pState, SSDataBlock* pBlock, SExprSupp* pSup, + SGroupResInfo* pGroupResInfo) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SStorageAPI* pAPI = &pTaskInfo->storageAPI; + SExprInfo* pExprInfo = pSup->pExprInfo; + int32_t numOfExprs = pSup->numOfExprs; + int32_t* rowEntryOffset = pSup->rowEntryInfoOffset; + SqlFunctionCtx* pCtx = pSup->pCtx; + + int32_t numOfRows = getNumOfTotalRes(pGroupResInfo); + + for (int32_t i = pGroupResInfo->index; i < numOfRows; i += 1) { + SResultWindowInfo* pWinInfo = taosArrayGet(pGroupResInfo->pRows, i); + SRowBuffPos* pPos = pWinInfo->pStatePos; + SResultRow* pRow = NULL; + SSessionKey* pKey = (SSessionKey*) pPos->pKey; + + if (pBlock->info.id.groupId == 0) { + pBlock->info.id.groupId = pKey->groupId; + + void* tbname = NULL; + if (pAPI->stateStore.streamStateGetParName((void*)pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, + &tbname) < 0) { + pBlock->info.parTbName[0] = 0; + } else { + memcpy(pBlock->info.parTbName, tbname, TSDB_TABLE_NAME_LEN); + } + pAPI->stateStore.streamStateFreeVal(tbname); + } else { + // current value belongs to different group, it can't be packed into one datablock + if (pBlock->info.id.groupId != pKey->groupId) { + break; + } + } + + int32_t code = pAPI->stateStore.streamStateGetByPos(pState, pPos, (void**)&pRow); + if (pBlock->info.rows + pRow->numOfRows > pBlock->info.capacity) { + ASSERT(pBlock->info.rows > 0); + break; + } + + if (code == -1) { + // for history + qWarn("===stream===not found session result key:%" PRId64 ", ekey:%" PRId64 ", groupId:%" PRIu64 "", + pKey->win.skey, pKey->win.ekey, pKey->groupId); + pGroupResInfo->index += 1; + continue; + } + + doUpdateNumOfRows(pCtx, pRow, numOfExprs, rowEntryOffset); + // no results, continue to check the next one + if (pRow->numOfRows == 0) { + pGroupResInfo->index += 1; + continue; + } + + pGroupResInfo->index += 1; + + for (int32_t j = 0; j < numOfExprs; ++j) { + int32_t slotId = pExprInfo[j].base.resSchema.slotId; + + pCtx[j].resultInfo = getResultEntryInfo(pRow, j, rowEntryOffset); + if (pCtx[j].fpSet.finalize) { + int32_t code1 = pCtx[j].fpSet.finalize(&pCtx[j], pBlock); + if (TAOS_FAILED(code1)) { + qError("%s build result data block error, code %s", GET_TASKID(pTaskInfo), tstrerror(code1)); + T_LONG_JMP(pTaskInfo->env, code1); + } + } else if (strcmp(pCtx[j].pExpr->pExpr->_function.functionName, "_select_value") == 0) { + // do nothing, todo refactor + } else { + // expand the result into multiple rows. E.g., _wstart, top(k, 20) + // the _wstart needs to copy to 20 following rows, since the results of top-k expands to 20 different rows. + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId); + char* in = GET_ROWCELL_INTERBUF(pCtx[j].resultInfo); + for (int32_t k = 0; k < pRow->numOfRows; ++k) { + colDataSetVal(pColInfoData, pBlock->info.rows + k, in, pCtx[j].resultInfo->isNullRes); + } + } + } + + pBlock->info.dataLoad = 1; + pBlock->info.rows += pRow->numOfRows; + } + blockDataUpdateTsWindow(pBlock, 0); + return TSDB_CODE_SUCCESS; +} + void doBuildSessionResult(SOperatorInfo* pOperator, void* pState, SGroupResInfo* pGroupResInfo, SSDataBlock* pBlock) { SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; // set output datablock version @@ -2232,6 +2355,7 @@ static SSDataBlock* buildSessionResult(SOperatorInfo* pOperator) { printDataBlock(pInfo->pDelRes, getStreamOpName(pOperator->operatorType), GET_TASKID(pTaskInfo)); return pInfo->pDelRes; } + doBuildSessionResult(pOperator, pAggSup->pState, &pInfo->groupResInfo, pBInfo->pRes); if (pBInfo->pRes->info.rows > 0) { printDataBlock(pBInfo->pRes, getStreamOpName(pOperator->operatorType), GET_TASKID(pTaskInfo)); @@ -2245,15 +2369,16 @@ void getMaxTsWins(const SArray* pAllWins, SArray* pMaxWins) { if (size == 0) { return; } - - SSessionKey* pSeKey = taosArrayGet(pAllWins, size - 1); + SResultWindowInfo* pWinInfo = taosArrayGet(pAllWins, size - 1); + SSessionKey* pSeKey = pWinInfo->pStatePos->pKey; taosArrayPush(pMaxWins, pSeKey); if (pSeKey->groupId == 0) { return; } uint64_t preGpId = pSeKey->groupId; for (int32_t i = size - 2; i >= 0; i--) { - pSeKey = taosArrayGet(pAllWins, i); + pWinInfo = taosArrayGet(pAllWins, i); + pSeKey = pWinInfo->pStatePos->pKey; if (preGpId != pSeKey->groupId) { taosArrayPush(pMaxWins, pSeKey); preGpId = pSeKey->groupId; @@ -2283,7 +2408,7 @@ int32_t encodeSResultWindowInfo(void** buf, SResultWindowInfo* key, int32_t outL void* decodeSResultWindowInfo(void* buf, SResultWindowInfo* key, int32_t outLen) { buf = taosDecodeFixedBool(buf, &key->isOutput); - key->pOutputBuf = NULL; + key->pStatePos->pRowBuff = NULL; buf = decodeSSessionKey(buf, &key->sessionWin); return buf; } @@ -2412,7 +2537,7 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { SOperatorInfo* downstream = pOperator->pDownstream[0]; if (!pInfo->pUpdated) { - pInfo->pUpdated = taosArrayInit(16, sizeof(SSessionKey)); + pInfo->pUpdated = taosArrayInit(16, sizeof(SResultWindowInfo)); } if (!pInfo->pStUpdated) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); @@ -2430,7 +2555,7 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { SArray* pWins = taosArrayInit(16, sizeof(SSessionKey)); // gap must be 0 doDeleteTimeWindows(pAggSup, pBlock, pWins); - removeSessionResults(pInfo->pStUpdated, pWins); + removeSessionResults(pAggSup, pInfo->pStUpdated, pWins); if (IS_FINAL_SESSION_OP(pOperator)) { int32_t childIndex = getChildIndex(pBlock); SOperatorInfo* pChildOp = taosArrayGetP(pInfo->pChildren, childIndex); @@ -2488,10 +2613,8 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { closeSessionWindow(pAggSup->pResultRows, &pInfo->twAggSup, pInfo->pStUpdated); closeChildSessionWindow(pInfo->pChildren, pInfo->twAggSup.maxTs); - copyUpdateResult(pInfo->pStUpdated, pInfo->pUpdated); - removeSessionResults(pInfo->pStDeleted, pInfo->pUpdated); - tSimpleHashCleanup(pInfo->pStUpdated); - pInfo->pStUpdated = NULL; + copyUpdateResult(&pInfo->pStUpdated, pInfo->pUpdated, sessionKeyCompareAsc); + removeSessionDeleteResults(pInfo->pStDeleted, pInfo->pUpdated); if (pInfo->isHistoryOp) { getMaxTsWins(pInfo->pUpdated, pInfo->historyWins); } @@ -2510,10 +2633,15 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) { void streamSessionReleaseState(SOperatorInfo* pOperator) { SStreamSessionAggOperatorInfo* pInfo = pOperator->info; - int32_t resSize = taosArrayGetSize(pInfo->historyWins) * sizeof(SSessionKey); + int32_t winSize = taosArrayGetSize(pInfo->historyWins) * sizeof(SSessionKey); + int32_t resSize = winSize + sizeof(TSKEY); + char* pBuff = taosMemoryCalloc(1, resSize); + memcpy(pBuff, pInfo->historyWins->pData, winSize); + memcpy(pBuff + winSize, &pInfo->twAggSup.maxTs, sizeof(TSKEY)); pInfo->streamAggSup.stateStore.streamStateSaveInfo(pInfo->streamAggSup.pState, STREAM_SESSION_OP_STATE_NAME, - strlen(STREAM_SESSION_OP_STATE_NAME), pInfo->historyWins->pData, - resSize); + strlen(STREAM_SESSION_OP_STATE_NAME), pBuff, resSize); + pInfo->streamAggSup.stateStore.streamStateCommit(pInfo->streamAggSup.pState); + taosMemoryFreeClear(pBuff); SOperatorInfo* downstream = pOperator->pDownstream[0]; if (downstream->fpSet.releaseStreamStateFn) { downstream->fpSet.releaseStreamStateFn(downstream); @@ -2525,6 +2653,20 @@ void resetWinRange(STimeWindow* winRange) { winRange->ekey = INT64_MAX; } +void getSessionWindowInfoByKey(SStreamAggSupporter* pAggSup, SSessionKey* pKey, SResultWindowInfo* pWinInfo) { + int32_t rowSize = pAggSup->resultRowSize; + int32_t code = pAggSup->stateStore.streamStateSessionGet(pAggSup->pState, pKey, (void**)&pWinInfo->pStatePos, &rowSize); + if (code == TSDB_CODE_SUCCESS) { + pWinInfo->sessionWin = *pKey; + pWinInfo->isOutput = true; + if (pWinInfo->pStatePos->needFree) { + pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pWinInfo->sessionWin); + } + } else { + SET_SESSION_WIN_INVALID((*pWinInfo)); + } +} + void streamSessionSemiReloadState(SOperatorInfo* pOperator) { SStreamSessionAggOperatorInfo* pInfo = pOperator->info; SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; @@ -2535,16 +2677,19 @@ void streamSessionSemiReloadState(SOperatorInfo* pOperator) { void* pBuf = NULL; int32_t code = pAggSup->stateStore.streamStateGetInfo(pAggSup->pState, STREAM_SESSION_OP_STATE_NAME, strlen(STREAM_SESSION_OP_STATE_NAME), &pBuf, &size); - int32_t num = size / sizeof(SSessionKey); + int32_t num = (size - sizeof(TSKEY)) / sizeof(SSessionKey); SSessionKey* pSeKeyBuf = (SSessionKey*) pBuf; - ASSERT(size == num * sizeof(SSessionKey)); + ASSERT(size == num * sizeof(SSessionKey) + sizeof(TSKEY)); for (int32_t i = 0; i < num; i++) { SResultWindowInfo winInfo = {0}; - setSessionOutputBuf(pAggSup, pSeKeyBuf[i].win.skey, pSeKeyBuf[i].win.ekey, pSeKeyBuf[i].groupId, &winInfo); + getSessionWindowInfoByKey(pAggSup, pSeKeyBuf + i, &winInfo); compactSessionSemiWindow(pOperator, &winInfo); saveSessionOutputBuf(pAggSup, &winInfo); } + TSKEY ts = *(TSKEY*)((char*)pBuf + size - sizeof(TSKEY)); taosMemoryFree(pBuf); + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, ts); + pAggSup->stateStore.streamStateReloadInfo(pAggSup->pState, ts); SOperatorInfo* downstream = pOperator->pDownstream[0]; if (downstream->fpSet.reloadStreamStateFn) { @@ -2557,21 +2702,28 @@ void streamSessionReloadState(SOperatorInfo* pOperator) { SStreamAggSupporter* pAggSup = &pInfo->streamAggSup; resetWinRange(&pAggSup->winRange); - SResultWindowInfo winInfo = {0}; int32_t size = 0; void* pBuf = NULL; int32_t code = pAggSup->stateStore.streamStateGetInfo(pAggSup->pState, STREAM_SESSION_OP_STATE_NAME, strlen(STREAM_SESSION_OP_STATE_NAME), &pBuf, &size); - int32_t num = size / sizeof(SSessionKey); + int32_t num = (size - sizeof(TSKEY)) / sizeof(SSessionKey); SSessionKey* pSeKeyBuf = (SSessionKey*)pBuf; - ASSERT(size == num * sizeof(SSessionKey)); + ASSERT(size == num * sizeof(SSessionKey) + sizeof(TSKEY)); + + TSKEY ts = *(TSKEY*)((char*)pBuf + size - sizeof(TSKEY)); + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, ts); + pAggSup->stateStore.streamStateReloadInfo(pAggSup->pState, ts); + if (!pInfo->pStUpdated && num > 0) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); pInfo->pStUpdated = tSimpleHashInit(64, hashFn); } for (int32_t i = 0; i < num; i++) { SResultWindowInfo winInfo = {0}; - setSessionOutputBuf(pAggSup, pSeKeyBuf[i].win.skey, pSeKeyBuf[i].win.ekey, pSeKeyBuf[i].groupId, &winInfo); + getSessionWindowInfoByKey(pAggSup, pSeKeyBuf + i, &winInfo); + if (!IS_VALID_SESSION_WIN(winInfo)) { + continue; + } int32_t winNum = compactSessionWindow(pOperator, &winInfo, pInfo->pStUpdated, pInfo->pStDeleted, true); if (winNum > 0) { qDebug("===stream=== reload state. save result %" PRId64 ", %" PRIu64, winInfo.sessionWin.win.skey, @@ -2619,18 +2771,18 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh goto _error; } } - SExprSupp* pSup = &pOperator->exprSupp; + SExprSupp* pExpSup = &pOperator->exprSupp; SExprInfo* pExprInfo = createExprInfo(pSessionNode->window.pFuncs, NULL, &numOfCols); SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); - code = initBasicInfoEx(&pInfo->binfo, pSup, pExprInfo, numOfCols, pResBlock, &pTaskInfo->storageAPI.functionStore); + code = initBasicInfoEx(&pInfo->binfo, pExpSup, pExprInfo, numOfCols, pResBlock, &pTaskInfo->storageAPI.functionStore); if (code != TSDB_CODE_SUCCESS) { goto _error; } - code = initStreamAggSupporter(&pInfo->streamAggSup, pSup->pCtx, numOfCols, pSessionNode->gap, + code = initStreamAggSupporter(&pInfo->streamAggSup, pExpSup, numOfCols, pSessionNode->gap, pTaskInfo->streamInfo.pState, 0, 0, &pTaskInfo->storageAPI.stateStore, pHandle, - &pTaskInfo->storageAPI); + &pInfo->twAggSup, GET_TASKID(pTaskInfo), &pTaskInfo->storageAPI); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -2670,6 +2822,7 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh } pInfo->pCheckpointRes = createSpecialDataBlock(STREAM_CHECKPOINT); + pInfo->clearState = false; pOperator->operatorType = QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION; // for stream void* buff = NULL; @@ -2727,18 +2880,25 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { return opRes; } + if (pInfo->clearState) { + clearFunctionContext(&pOperator->exprSupp); + // semi session operator clear disk buffer + clearStreamSessionOperator(pInfo); + } + if (pOperator->status == OP_RES_TO_RETURN) { clearFunctionContext(&pOperator->exprSupp); - // semi interval operator clear disk buffer + // semi session operator clear disk buffer clearStreamSessionOperator(pInfo); setOperatorCompleted(pOperator); + pInfo->clearState = false; return NULL; } } SOperatorInfo* downstream = pOperator->pDownstream[0]; if (!pInfo->pUpdated) { - pInfo->pUpdated = taosArrayInit(16, sizeof(SSessionKey)); + pInfo->pUpdated = taosArrayInit(16, sizeof(SResultWindowInfo)); } if (!pInfo->pStUpdated) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); @@ -2756,10 +2916,11 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { pBlock->info.type == STREAM_CLEAR) { // gap must be 0 SArray* pWins = taosArrayInit(16, sizeof(SSessionKey)); - doDeleteTimeWindows(&pInfo->streamAggSup, pBlock, pWins); - removeSessionResults(pInfo->pStUpdated, pWins); + doDeleteTimeWindows(pAggSup, pBlock, pWins); + removeSessionResults(pAggSup, pInfo->pStUpdated, pWins); copyDeleteWindowInfo(pWins, pInfo->pStDeleted); taosArrayDestroy(pWins); + pInfo->clearState = true; break; } else if (pBlock->info.type == STREAM_GET_ALL) { getAllSessionWindow(pInfo->streamAggSup.pResultRows, pInfo->pStUpdated); @@ -2787,10 +2948,8 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, maxTs); pBInfo->pRes->info.watermark = pInfo->twAggSup.maxTs; - copyUpdateResult(pInfo->pStUpdated, pInfo->pUpdated); - removeSessionResults(pInfo->pStDeleted, pInfo->pUpdated); - tSimpleHashCleanup(pInfo->pStUpdated); - pInfo->pStUpdated = NULL; + copyUpdateResult(&pInfo->pStUpdated, pInfo->pUpdated, sessionKeyCompareAsc); + removeSessionDeleteResults(pInfo->pStDeleted, pInfo->pUpdated); if(pInfo->isHistoryOp) { getMaxTsWins(pInfo->pUpdated, pInfo->historyWins); @@ -2806,7 +2965,7 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) { } clearFunctionContext(&pOperator->exprSupp); - // semi interval operator clear disk buffer + // semi session operator clear disk buffer clearStreamSessionOperator(pInfo); setOperatorCompleted(pOperator); return NULL; @@ -2836,7 +2995,7 @@ SOperatorInfo* createStreamFinalSessionAggOperatorInfo(SOperatorInfo* downstream if (numOfChild > 0) { pInfo->pChildren = taosArrayInit(numOfChild, sizeof(void*)); for (int32_t i = 0; i < numOfChild; i++) { - SOperatorInfo* pChildOp = createStreamFinalSessionAggOperatorInfo(NULL, pPhyNode, pTaskInfo, 0, NULL); + SOperatorInfo* pChildOp = createStreamFinalSessionAggOperatorInfo(NULL, pPhyNode, pTaskInfo, 0, pHandle); if (pChildOp == NULL) { goto _error; } @@ -2916,6 +3075,50 @@ bool compareWinStateKey(SStateKeys* left, SStateKeys* right) { return compareVal(left->pData, right); } +void getStateWindowInfoByKey(SStreamAggSupporter* pAggSup, SSessionKey* pKey, SStateWindowInfo* pCurWin, + SStateWindowInfo* pNextWin) { + int32_t size = pAggSup->resultRowSize; + pCurWin->winInfo.sessionWin.groupId = pKey->groupId; + pCurWin->winInfo.sessionWin.win.skey = pKey->win.skey; + pCurWin->winInfo.sessionWin.win.ekey = pKey->win.ekey; + getSessionWindowInfoByKey(pAggSup, pKey, &pCurWin->winInfo); + ASSERT(IS_VALID_SESSION_WIN(pCurWin->winInfo)); + pCurWin->pStateKey = + (SStateKeys*)((char*)pCurWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - pAggSup->stateKeySize)); + pCurWin->pStateKey->bytes = pAggSup->stateKeySize - sizeof(SStateKeys); + pCurWin->pStateKey->type = pAggSup->stateKeyType; + pCurWin->pStateKey->pData = (char*)pCurWin->pStateKey + sizeof(SStateKeys); + pCurWin->pStateKey->isNull = false; + pCurWin->winInfo.isOutput = true; + if (pCurWin->winInfo.pStatePos->needFree) { + pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pCurWin->winInfo.sessionWin); + } + + qDebug("===stream===get state cur win buff. skey:%" PRId64 ", endkey:%" PRId64, pCurWin->winInfo.sessionWin.win.skey, + pCurWin->winInfo.sessionWin.win.ekey); + + pNextWin->winInfo.sessionWin = pCurWin->winInfo.sessionWin; + SStreamStateCur* pCur = + pAggSup->stateStore.streamStateSessionSeekKeyNext(pAggSup->pState, &pNextWin->winInfo.sessionWin); + int32_t nextSize = pAggSup->resultRowSize; + int32_t code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pNextWin->winInfo.sessionWin, + (void**)&pNextWin->winInfo.pStatePos, &nextSize); + if (code != TSDB_CODE_SUCCESS) { + SET_SESSION_WIN_INVALID(pNextWin->winInfo); + } else { + pNextWin->pStateKey = + (SStateKeys*)((char*)pNextWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - pAggSup->stateKeySize)); + pNextWin->pStateKey->bytes = pAggSup->stateKeySize - sizeof(SStateKeys); + pNextWin->pStateKey->type = pAggSup->stateKeyType; + pNextWin->pStateKey->pData = (char*)pNextWin->pStateKey + sizeof(SStateKeys); + pNextWin->pStateKey->isNull = false; + pNextWin->winInfo.isOutput = true; + } + pAggSup->stateStore.streamStateFreeCur(pCur); + qDebug("===stream===get state next win buff. skey:%" PRId64 ", endkey:%" PRId64, pNextWin->winInfo.sessionWin.win.skey, + pNextWin->winInfo.sessionWin.win.ekey); +} + void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, char* pKeyData, SStateWindowInfo* pCurWin, SStateWindowInfo* pNextWin) { int32_t size = pAggSup->resultRowSize; @@ -2924,9 +3127,9 @@ void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, pCurWin->winInfo.sessionWin.win.ekey = ts; int32_t code = pAggSup->stateStore.streamStateStateAddIfNotExist(pAggSup->pState, &pCurWin->winInfo.sessionWin, pKeyData, pAggSup->stateKeySize, compareStateKey, - &pCurWin->winInfo.pOutputBuf, &size); + (void**)&pCurWin->winInfo.pStatePos, &size); pCurWin->pStateKey = - (SStateKeys*)((char*)pCurWin->winInfo.pOutputBuf + (pAggSup->resultRowSize - pAggSup->stateKeySize)); + (SStateKeys*)((char*)pCurWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - pAggSup->stateKeySize)); pCurWin->pStateKey->bytes = pAggSup->stateKeySize - sizeof(SStateKeys); pCurWin->pStateKey->type = pAggSup->stateKeyType; pCurWin->pStateKey->pData = (char*)pCurWin->pStateKey + sizeof(SStateKeys); @@ -2934,11 +3137,9 @@ void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, if (code == TSDB_CODE_SUCCESS && !inWinRange(&pAggSup->winRange, &pCurWin->winInfo.sessionWin.win)) { code = TSDB_CODE_FAILED; - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)pCurWin->winInfo.pOutputBuf, - &pAggSup->pSessionAPI->stateStore); - pCurWin->winInfo.pOutputBuf = taosMemoryCalloc(1, size); + clearOutputBuf(pAggSup->pState, pCurWin->winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); pCurWin->pStateKey = - (SStateKeys*)((char*)pCurWin->winInfo.pOutputBuf + (pAggSup->resultRowSize - pAggSup->stateKeySize)); + (SStateKeys*)((char*)pCurWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - pAggSup->stateKeySize)); pCurWin->pStateKey->bytes = pAggSup->stateKeySize - sizeof(SStateKeys); pCurWin->pStateKey->type = pAggSup->stateKeyType; pCurWin->pStateKey->pData = (char*)pCurWin->pStateKey + sizeof(SStateKeys); @@ -2952,7 +3153,9 @@ void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, if (code == TSDB_CODE_SUCCESS) { pCurWin->winInfo.isOutput = true; - pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pCurWin->winInfo.sessionWin); + if (pCurWin->winInfo.pStatePos->needFree) { + pAggSup->stateStore.streamStateSessionDel(pAggSup->pState, &pCurWin->winInfo.sessionWin); + } } else if (pKeyData) { if (IS_VAR_DATA_TYPE(pAggSup->stateKeyType)) { varDataCopy(pCurWin->pStateKey->pData, pKeyData); @@ -2961,17 +3164,20 @@ void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, } } + qDebug("===stream===set state cur win buff. skey:%" PRId64 ", endkey:%" PRId64, pCurWin->winInfo.sessionWin.win.skey, + pCurWin->winInfo.sessionWin.win.ekey); + pNextWin->winInfo.sessionWin = pCurWin->winInfo.sessionWin; SStreamStateCur* pCur = pAggSup->stateStore.streamStateSessionSeekKeyNext(pAggSup->pState, &pNextWin->winInfo.sessionWin); int32_t nextSize = pAggSup->resultRowSize; code = pAggSup->stateStore.streamStateSessionGetKVByCur(pCur, &pNextWin->winInfo.sessionWin, - &pNextWin->winInfo.pOutputBuf, &nextSize); + (void**)&pNextWin->winInfo.pStatePos, &nextSize); if (code != TSDB_CODE_SUCCESS) { SET_SESSION_WIN_INVALID(pNextWin->winInfo); } else { pNextWin->pStateKey = - (SStateKeys*)((char*)pNextWin->winInfo.pOutputBuf + (pAggSup->resultRowSize - pAggSup->stateKeySize)); + (SStateKeys*)((char*)pNextWin->winInfo.pStatePos->pRowBuff + (pAggSup->resultRowSize - pAggSup->stateKeySize)); pNextWin->pStateKey->bytes = pAggSup->stateKeySize - sizeof(SStateKeys); pNextWin->pStateKey->type = pAggSup->stateKeyType; pNextWin->pStateKey->pData = (char*)pNextWin->pStateKey + sizeof(SStateKeys); @@ -2979,9 +3185,11 @@ void setStateOutputBuf(SStreamAggSupporter* pAggSup, TSKEY ts, uint64_t groupId, pNextWin->winInfo.isOutput = true; } pAggSup->stateStore.streamStateFreeCur(pCur); + qDebug("===stream===set state next win buff. skey:%" PRId64 ", endkey:%" PRId64, pNextWin->winInfo.sessionWin.win.skey, + pNextWin->winInfo.sessionWin.win.ekey); } -int32_t updateStateWindowInfo(SStateWindowInfo* pWinInfo, SStateWindowInfo* pNextWin, TSKEY* pTs, uint64_t groupId, +int32_t updateStateWindowInfo(SStreamAggSupporter* pAggSup, SStateWindowInfo* pWinInfo, SStateWindowInfo* pNextWin, TSKEY* pTs, uint64_t groupId, SColumnInfoData* pKeyCol, int32_t rows, int32_t start, bool* allEqual, SSHashObj* pResultRows, SSHashObj* pSeUpdated, SSHashObj* pSeDeleted) { *allEqual = true; @@ -3004,10 +3212,11 @@ int32_t updateStateWindowInfo(SStateWindowInfo* pWinInfo, SStateWindowInfo* pNex if (pSeDeleted && pWinInfo->winInfo.isOutput) { saveDeleteRes(pSeDeleted, pWinInfo->winInfo.sessionWin); } - removeSessionResult(pSeUpdated, pResultRows, pWinInfo->winInfo.sessionWin); + removeSessionResult(pAggSup, pSeUpdated, pResultRows, pWinInfo->winInfo.sessionWin); pWinInfo->winInfo.sessionWin.win.skey = pTs[i]; } pWinInfo->winInfo.sessionWin.win.ekey = TMAX(pWinInfo->winInfo.sessionWin.win.ekey, pTs[i]); + memcpy(pWinInfo->winInfo.pStatePos->pKey, &pWinInfo->winInfo.sessionWin, sizeof(SSessionKey)); if (!isEqualStateKey(pWinInfo, pKeyData)) { *allEqual = false; } @@ -3056,11 +3265,10 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl SStateWindowInfo curWin = {0}; SStateWindowInfo nextWin = {0}; setStateOutputBuf(pAggSup, tsCols[i], groupId, pKeyData, &curWin, &nextWin); - if (IS_VALID_SESSION_WIN(nextWin.winInfo)) { - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)nextWin.winInfo.pOutputBuf, &pAPI->stateStore); - } + releaseOutputBuf(pAggSup->pState, nextWin.winInfo.pStatePos, &pAPI->stateStore); + setSessionWinOutputInfo(pSeUpdated, &curWin.winInfo); - winRows = updateStateWindowInfo(&curWin, &nextWin, tsCols, groupId, pKeyColInfo, rows, i, &allEqual, + winRows = updateStateWindowInfo(pAggSup, &curWin, &nextWin, tsCols, groupId, pKeyColInfo, rows, i, &allEqual, pAggSup->pResultRows, pSeUpdated, pStDeleted); if (!allEqual) { uint64_t uid = 0; @@ -3068,7 +3276,7 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl &curWin.winInfo.sessionWin.win.ekey, &uid, &groupId, NULL); tSimpleHashRemove(pSeUpdated, &curWin.winInfo.sessionWin, sizeof(SSessionKey)); doDeleteSessionWindow(pAggSup, &curWin.winInfo.sessionWin); - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)curWin.winInfo.pOutputBuf, &pAPI->stateStore); + releaseOutputBuf(pAggSup->pState, curWin.winInfo.pStatePos, &pAPI->stateStore); continue; } code = doOneWindowAggImpl(&pInfo->twAggSup.timeWindowData, &curWin.winInfo, &pResult, i, winRows, rows, numOfOutput, @@ -3109,7 +3317,7 @@ int32_t doStreamStateEncodeOpState(void** buf, int32_t len, SOperatorInfo* pOper size_t keyLen = 0; int32_t iter = 0; while ((pIte = tSimpleHashIterate(pInfo->streamAggSup.pResultRows, pIte, &iter)) != NULL) { - void* key = taosHashGetKey(pIte, &keyLen); + void* key = tSimpleHashGetKey(pIte, &keyLen); tlen += encodeSSessionKey(buf, key); tlen += encodeSResultWindowInfo(buf, pIte, pInfo->streamAggSup.resultRowSize); } @@ -3237,7 +3445,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { SOperatorInfo* downstream = pOperator->pDownstream[0]; if (!pInfo->pUpdated) { - pInfo->pUpdated = taosArrayInit(16, sizeof(SSessionKey)); + pInfo->pUpdated = taosArrayInit(16, sizeof(SResultWindowInfo)); } if (!pInfo->pSeUpdated) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); @@ -3254,7 +3462,7 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { pBlock->info.type == STREAM_CLEAR) { SArray* pWins = taosArrayInit(16, sizeof(SSessionKey)); doDeleteTimeWindows(&pInfo->streamAggSup, pBlock, pWins); - removeSessionResults(pInfo->pSeUpdated, pWins); + removeSessionResults(&pInfo->streamAggSup, pInfo->pSeUpdated, pWins); copyDeleteWindowInfo(pWins, pInfo->pSeDeleted); taosArrayDestroy(pWins); continue; @@ -3285,10 +3493,8 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { pOperator->status = OP_RES_TO_RETURN; closeSessionWindow(pInfo->streamAggSup.pResultRows, &pInfo->twAggSup, pInfo->pSeUpdated); - copyUpdateResult(pInfo->pSeUpdated, pInfo->pUpdated); - removeSessionResults(pInfo->pSeDeleted, pInfo->pUpdated); - tSimpleHashCleanup(pInfo->pSeUpdated); - pInfo->pSeUpdated = NULL; + copyUpdateResult(&pInfo->pSeUpdated, pInfo->pUpdated, sessionKeyCompareAsc); + removeSessionDeleteResults(pInfo->pSeDeleted, pInfo->pUpdated); if (pInfo->isHistoryOp) { getMaxTsWins(pInfo->pUpdated, pInfo->historyWins); @@ -3308,11 +3514,17 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) { void streamStateReleaseState(SOperatorInfo* pOperator) { SStreamStateAggOperatorInfo* pInfo = pOperator->info; - int32_t resSize = taosArrayGetSize(pInfo->historyWins) * sizeof(SSessionKey); + int32_t winSize = taosArrayGetSize(pInfo->historyWins) * sizeof(SSessionKey); + int32_t resSize = winSize + sizeof(TSKEY); + char* pBuff = taosMemoryCalloc(1, resSize); + memcpy(pBuff, pInfo->historyWins->pData, winSize); + memcpy(pBuff + winSize, &pInfo->twAggSup.maxTs, sizeof(TSKEY)); qDebug("===stream=== relase state. save result count:%d", (int32_t)taosArrayGetSize(pInfo->historyWins)); pInfo->streamAggSup.stateStore.streamStateSaveInfo(pInfo->streamAggSup.pState, STREAM_STATE_OP_STATE_NAME, - strlen(STREAM_STATE_OP_STATE_NAME), pInfo->historyWins->pData, - resSize); + strlen(STREAM_STATE_OP_STATE_NAME), pBuff, resSize); + pInfo->streamAggSup.stateStore.streamStateCommit(pInfo->streamAggSup.pState); + taosMemoryFreeClear(pBuff); + SOperatorInfo* downstream = pOperator->pDownstream[0]; if (downstream->fpSet.releaseStreamStateFn) { downstream->fpSet.releaseStreamStateFn(downstream); @@ -3333,6 +3545,7 @@ static void compactStateWindow(SOperatorInfo* pOperator, SResultWindowInfo* pCur SResultRow* pWinResult = NULL; initSessionOutputBuf(pNextWin, &pWinResult, pAggSup->pDummyCtx, numOfOutput, pSup->rowEntryInfoOffset); pCurWin->sessionWin.win.ekey = TMAX(pCurWin->sessionWin.win.ekey, pNextWin->sessionWin.win.ekey); + memcpy(pCurWin->pStatePos->pKey, &pCurWin->sessionWin, sizeof(SSessionKey)); updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pCurWin->sessionWin.win, 1); compactFunctions(pSup->pCtx, pAggSup->pDummyCtx, numOfOutput, pTaskInfo, &pInfo->twAggSup.timeWindowData); @@ -3342,9 +3555,9 @@ static void compactStateWindow(SOperatorInfo* pOperator, SResultWindowInfo* pCur pNextWin->sessionWin.groupId); saveDeleteRes(pStDeleted, pNextWin->sessionWin); } - removeSessionResult(pStUpdated, pAggSup->pResultRows, pNextWin->sessionWin); + removeSessionResult(pAggSup, pStUpdated, pAggSup->pResultRows, pNextWin->sessionWin); doDeleteSessionWindow(pAggSup, &pNextWin->sessionWin); - taosMemoryFree(pNextWin->pOutputBuf); + releaseOutputBuf(pAggSup->pState, pNextWin->pStatePos, &pAggSup->pSessionAPI->stateStore); } void streamStateReloadState(SOperatorInfo* pOperator) { @@ -3357,10 +3570,15 @@ void streamStateReloadState(SOperatorInfo* pOperator) { void* pBuf = NULL; int32_t code = pAggSup->stateStore.streamStateGetInfo(pAggSup->pState, STREAM_STATE_OP_STATE_NAME, strlen(STREAM_STATE_OP_STATE_NAME), &pBuf, &size); - int32_t num = size / sizeof(SSessionKey); + int32_t num = (size - sizeof(TSKEY)) / sizeof(SSessionKey); qDebug("===stream=== reload state. get result count:%d", num); SSessionKey* pSeKeyBuf = (SSessionKey*)pBuf; - ASSERT(size == num * sizeof(SSessionKey)); + ASSERT(size == num * sizeof(SSessionKey) + sizeof(TSKEY)); + + TSKEY ts = *(TSKEY*)((char*)pBuf + size - sizeof(TSKEY)); + pInfo->twAggSup.maxTs = TMAX(pInfo->twAggSup.maxTs, ts); + pAggSup->stateStore.streamStateReloadInfo(pAggSup->pState, ts); + if (!pInfo->pSeUpdated && num > 0) { _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); pInfo->pSeUpdated = tSimpleHashInit(64, hashFn); @@ -3375,7 +3593,7 @@ void streamStateReloadState(SOperatorInfo* pOperator) { SStateWindowInfo dummy = {0}; qDebug("===stream=== reload state. try process result %" PRId64 ", %" PRIu64 ", index:%d", pSeKeyBuf[i].win.skey, pSeKeyBuf[i].groupId, i); - setStateOutputBuf(pAggSup, pSeKeyBuf[i].win.skey, pSeKeyBuf[i].groupId, NULL, &curInfo, &nextInfo); + getStateWindowInfoByKey(pAggSup, pSeKeyBuf + i, &curInfo, &nextInfo); bool cpRes = compareWinStateKey(curInfo.pStateKey, nextInfo.pStateKey); qDebug("===stream=== reload state. next window info %" PRId64 ", %" PRIu64 ", compare:%d", nextInfo.winInfo.sessionWin.win.skey, nextInfo.winInfo.sessionWin.groupId, cpRes); @@ -3394,8 +3612,7 @@ void streamStateReloadState(SOperatorInfo* pOperator) { tSimpleHashPut(pAggSup->pResultRows, &key, sizeof(SSessionKey), &curInfo.winInfo, sizeof(SResultWindowInfo)); } } else if (IS_VALID_SESSION_WIN(nextInfo.winInfo)) { - releaseOutputBuf(pAggSup->pState, NULL, (SResultRow*)nextInfo.winInfo.pOutputBuf, - &pAggSup->pSessionAPI->stateStore); + releaseOutputBuf(pAggSup->pState, nextInfo.winInfo.pStatePos, &pAggSup->pSessionAPI->stateStore); } if (IS_VALID_SESSION_WIN(curInfo.winInfo)) { @@ -3444,18 +3661,19 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); - SExprSupp* pSup = &pOperator->exprSupp; + SExprSupp* pExpSup = &pOperator->exprSupp; int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &numOfCols); SSDataBlock* pResBlock = createDataBlockFromDescNode(pPhyNode->pOutputDataBlockDesc); - code = initBasicInfoEx(&pInfo->binfo, pSup, pExprInfo, numOfCols, pResBlock, &pTaskInfo->storageAPI.functionStore); + code = initBasicInfoEx(&pInfo->binfo, pExpSup, pExprInfo, numOfCols, pResBlock, &pTaskInfo->storageAPI.functionStore); if (code != TSDB_CODE_SUCCESS) { goto _error; } int32_t keySize = sizeof(SStateKeys) + pColNode->node.resType.bytes; int16_t type = pColNode->node.resType.type; - code = initStreamAggSupporter(&pInfo->streamAggSup, pSup->pCtx, numOfCols, 0, pTaskInfo->streamInfo.pState, keySize, - type, &pTaskInfo->storageAPI.stateStore, pHandle, &pTaskInfo->storageAPI); + code = initStreamAggSupporter(&pInfo->streamAggSup, pExpSup, numOfCols, 0, pTaskInfo->streamInfo.pState, keySize, + type, &pTaskInfo->storageAPI.stateStore, pHandle, &pInfo->twAggSup, + GET_TASKID(pTaskInfo), &pTaskInfo->storageAPI); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -3734,7 +3952,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys pInfo->pState->pFileState = pTaskInfo->storageAPI.stateStore.streamFileStateInit( tsStreamBufferSize, sizeof(SWinKey), pInfo->aggSup.resultRowSize, funResSize, compareTs, pInfo->pState, - pInfo->twAggSup.deleteMark, GET_TASKID(pTaskInfo), pHandle->checkpointId); + pInfo->twAggSup.deleteMark, GET_TASKID(pTaskInfo), pHandle->checkpointId, STREAM_STATE_BUFF_HASH); setOperatorInfo(pOperator, "StreamIntervalOperator", QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL, true, OP_NOT_OPENED, pInfo, pTaskInfo); diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 80c881acf2..91ba0aa9b5 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -245,7 +245,7 @@ SNode* createResumeStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, boo SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId); SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId); SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt); -SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt); +SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt, const SToken* pVgId); SNode* createMergeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId1, const SToken* pVgId2); SNode* createRedistributeVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId, SNodeList* pDnodes); SNode* createSplitVgroupStmt(SAstCreateContext* pCxt, const SToken* pVgId); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 7c6feab48a..2bab513602 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -691,11 +691,16 @@ cmd ::= KILL TRANSACTION NK_INTEGER(A). /************************************************ merge/redistribute/ vgroup ******************************************/ cmd ::= BALANCE VGROUP. { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } -cmd ::= BALANCE VGROUP LEADER. { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); } +cmd ::= BALANCE VGROUP LEADER on_vgroup_id(A). { pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &A); } cmd ::= MERGE VGROUP NK_INTEGER(A) NK_INTEGER(B). { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &A, &B); } cmd ::= REDISTRIBUTE VGROUP NK_INTEGER(A) dnode_list(B). { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &A, B); } cmd ::= SPLIT VGROUP NK_INTEGER(A). { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &A); } +%type on_vgroup_id { SToken } +%destructor on_vgroup_id { } +on_vgroup_id(A) ::= . { A = nil_token; } +on_vgroup_id(A) ::= ON NK_INTEGER(B). { A = B; } + %type dnode_list { SNodeList* } %destructor dnode_list { nodesDestroyList($$); } dnode_list(A) ::= DNODE NK_INTEGER(B). { A = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &B)); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 8de2ae2b8d..a418dc63b4 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -2322,10 +2322,13 @@ SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt) { return (SNode*)pStmt; } -SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt) { +SNode* createBalanceVgroupLeaderStmt(SAstCreateContext* pCxt, const SToken* pVgId) { CHECK_PARSER_STATUS(pCxt); SBalanceVgroupLeaderStmt* pStmt = (SBalanceVgroupLeaderStmt*)nodesMakeNode(QUERY_NODE_BALANCE_VGROUP_LEADER_STMT); CHECK_OUT_OF_MEM(pStmt); + if (NULL != pVgId && NULL != pVgId->z) { + pStmt->vgId = taosStr2Int32(pVgId->z, NULL, 10); + } return (SNode*)pStmt; } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index c1881e3d27..e58d803675 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#include "parInt.h" #include "parTranslater.h" +#include "parInt.h" #include "catalog.h" #include "cmdnodes.h" @@ -1211,37 +1211,37 @@ static EDealRes translateNormalValue(STranslateContext* pCxt, SValueNode* pVal, break; } case TSDB_DATA_TYPE_VARBINARY: { - if (pVal->node.resType.type != TSDB_DATA_TYPE_BINARY){ + if (pVal->node.resType.type != TSDB_DATA_TYPE_BINARY) { return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_WRONG_VALUE_TYPE, pVal->literal); } - void* data = NULL; + void* data = NULL; uint32_t size = 0; - bool isHexChar = isHex(pVal->literal, strlen(pVal->literal)); - if(isHexChar){ - if(!isValidateHex(pVal->literal, strlen(pVal->literal))){ + bool isHexChar = isHex(pVal->literal, strlen(pVal->literal)); + if (isHexChar) { + if (!isValidateHex(pVal->literal, strlen(pVal->literal))) { return TSDB_CODE_PAR_INVALID_VARBINARY; } - if(taosHex2Ascii(pVal->literal, strlen(pVal->literal), &data, &size) < 0){ + if (taosHex2Ascii(pVal->literal, strlen(pVal->literal), &data, &size) < 0) { return TSDB_CODE_OUT_OF_MEMORY; } - }else{ + } else { size = pVal->node.resType.bytes; data = pVal->literal; } if (size + VARSTR_HEADER_SIZE > targetDt.bytes) { - if(isHexChar) taosMemoryFree(data); + if (isHexChar) taosMemoryFree(data); return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_VALUE_TOO_LONG, pVal->literal); } pVal->datum.p = taosMemoryCalloc(1, size + VARSTR_HEADER_SIZE); if (NULL == pVal->datum.p) { - if(isHexChar) taosMemoryFree(data); + if (isHexChar) taosMemoryFree(data); return generateDealNodeErrMsg(pCxt, TSDB_CODE_OUT_OF_MEMORY); } varDataSetLen(pVal->datum.p, size); memcpy(varDataVal(pVal->datum.p), data, size); - if(isHexChar) taosMemoryFree(data); + if (isHexChar) taosMemoryFree(data); break; } case TSDB_DATA_TYPE_VARCHAR: @@ -1777,7 +1777,6 @@ static int32_t translateBlockDistFunc(STranslateContext* pCtx, SFunctionNode* pF return TSDB_CODE_SUCCESS; } - static bool isStarParam(SNode* pNode) { return nodesIsStar(pNode) || nodesIsTableStar(pNode); } static int32_t translateMultiResFunc(STranslateContext* pCxt, SFunctionNode* pFunc) { @@ -2890,7 +2889,8 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) { pJoinTable->table.precision = calcJoinTablePrecision(pJoinTable); pJoinTable->table.singleTable = joinTableIsSingleTable(pJoinTable); code = translateExpr(pCxt, &pJoinTable->pOnCond); - pJoinTable->hasSubQuery = (nodeType(pJoinTable->pLeft) != QUERY_NODE_REAL_TABLE) || (nodeType(pJoinTable->pRight) != QUERY_NODE_REAL_TABLE); + pJoinTable->hasSubQuery = (nodeType(pJoinTable->pLeft) != QUERY_NODE_REAL_TABLE) || + (nodeType(pJoinTable->pRight) != QUERY_NODE_REAL_TABLE); if (nodeType(pJoinTable->pLeft) == QUERY_NODE_JOIN_TABLE) { ((SJoinTableNode*)pJoinTable->pLeft)->isLowLevelJoin = true; } @@ -2906,7 +2906,7 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) { return code; } -static int32_t createAllColumns(STranslateContext* pCxt, bool igTags, SNodeList** pCols) { +static int32_t createAllColumns(STranslateContext* pCxt, bool igTags, SNodeList** pCols) { *pCols = nodesMakeList(); if (NULL == *pCols) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_OUT_OF_MEMORY); @@ -2949,7 +2949,7 @@ static SNode* createMultiResFunc(SFunctionNode* pSrcFunc, SExprNode* pExpr) { } else { len = snprintf(buf, sizeof(buf) - 1, "%s(%s.%s)", pSrcFunc->functionName, pCol->tableAlias, pCol->colName); taosCreateMD5Hash(buf, len); - strncpy(pFunc->node.aliasName, buf, TSDB_COL_NAME_LEN - 1); + strncpy(pFunc->node.aliasName, buf, TSDB_COL_NAME_LEN - 1); len = snprintf(buf, sizeof(buf) - 1, "%s(%s)", pSrcFunc->functionName, pCol->colName); // note: userAlias could be truncated here strncpy(pFunc->node.userAlias, buf, TSDB_COL_NAME_LEN - 1); @@ -3071,11 +3071,8 @@ static int32_t createTags(STranslateContext* pCxt, SNodeList** pOutput) { return TSDB_CODE_SUCCESS; } - #ifndef TD_ENTERPRISE -int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { - return TSDB_CODE_SUCCESS; -} +int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { return TSDB_CODE_SUCCESS; } #endif static int32_t translateStar(STranslateContext* pCxt, SSelectStmt* pSelect) { @@ -3791,7 +3788,8 @@ static int32_t removeConstantValueFromList(SNodeList** pList) { SNode* pNode = NULL; WHERE_EACH(pNode, *pList) { if (nodeType(pNode) == QUERY_NODE_VALUE || - (nodeType(pNode) == QUERY_NODE_FUNCTION && fmIsConstantResFunc((SFunctionNode*)pNode) && fmIsScalarFunc(((SFunctionNode*)pNode)->funcId))) { + (nodeType(pNode) == QUERY_NODE_FUNCTION && fmIsConstantResFunc((SFunctionNode*)pNode) && + fmIsScalarFunc(((SFunctionNode*)pNode)->funcId))) { ERASE_NODE(*pList); continue; } @@ -4636,9 +4634,9 @@ static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbNa daysPerFile = (-1 == daysPerFile ? dbCfg.daysPerFile : daysPerFile); daysToKeep0 = (-1 == daysToKeep0 ? dbCfg.daysToKeep0 : daysToKeep0); } - if (daysPerFile > daysToKeep0) { + if (daysPerFile > daysToKeep0 / 3) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, - "Invalid duration value, should be keep2 >= keep1 >= keep0 >= duration"); + "Invalid duration value, should be keep2 >= keep1 >= keep0 >= 3 * duration"); } return TSDB_CODE_SUCCESS; } @@ -7520,6 +7518,7 @@ static int32_t translateBalanceVgroup(STranslateContext* pCxt, SBalanceVgroupStm static int32_t translateBalanceVgroupLeader(STranslateContext* pCxt, SBalanceVgroupLeaderStmt* pStmt) { SBalanceVgroupLeaderReq req = {0}; + req.vgId = pStmt->vgId; return buildCmdMsg(pCxt, TDMT_MND_BALANCE_VGROUP_LEADER, (FSerializeFunc)tSerializeSBalanceVgroupLeaderReq, &req); } @@ -8193,7 +8192,6 @@ static int32_t addShowKindCond(const SShowStmt* pShow, SSelectStmt* pSelect) { return TSDB_CODE_SUCCESS; } - static int32_t createShowCondition(const SShowStmt* pShow, SSelectStmt* pSelect) { SNode* pDbCond = NULL; SNode* pTbCond = NULL; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 7a3ba58500..f79ec34f03 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -449,29 +449,29 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 501 +#define YYNOCODE 502 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SAlterOption yy29; - SNode* yy122; - SToken yy203; - SNodeList* yy298; - EFillMode yy312; - SShowTablesOption yy343; - STokenPair yy345; - SDataType yy388; - EOperatorType yy416; - EJoinType yy498; - EShowKind yy579; - EOrder yy626; - int32_t yy652; - int8_t yy797; - ENullOrder yy877; - bool yy983; - int64_t yy999; + int32_t yy88; + EJoinType yy184; + SAlterOption yy233; + SToken yy269; + bool yy345; + SNode* yy348; + EShowKind yy361; + int8_t yy371; + int64_t yy537; + EOperatorType yy696; + SDataType yy720; + SShowTablesOption yy749; + EFillMode yy758; + ENullOrder yy841; + SNodeList* yy860; + EOrder yy870; + STokenPair yy993; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -487,18 +487,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 818 -#define YYNRULE 622 -#define YYNRULE_WITH_ACTION 622 +#define YYNSTATE 820 +#define YYNRULE 624 +#define YYNRULE_WITH_ACTION 624 #define YYNTOKEN 344 -#define YY_MAX_SHIFT 817 -#define YY_MIN_SHIFTREDUCE 1208 -#define YY_MAX_SHIFTREDUCE 1829 -#define YY_ERROR_ACTION 1830 -#define YY_ACCEPT_ACTION 1831 -#define YY_NO_ACTION 1832 -#define YY_MIN_REDUCE 1833 -#define YY_MAX_REDUCE 2454 +#define YY_MAX_SHIFT 819 +#define YY_MIN_SHIFTREDUCE 1211 +#define YY_MAX_SHIFTREDUCE 1834 +#define YY_ERROR_ACTION 1835 +#define YY_ACCEPT_ACTION 1836 +#define YY_NO_ACTION 1837 +#define YY_MIN_REDUCE 1838 +#define YY_MAX_REDUCE 2461 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -565,640 +565,654 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3078) +#define YY_ACTTAB_COUNT (3215) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 2430, 454, 169, 2425, 461, 546, 453, 185, 547, 1876, - /* 10 */ 1959, 1248, 48, 46, 1756, 2150, 2008, 467, 2126, 2059, - /* 20 */ 408, 2429, 1601, 41, 40, 2426, 2428, 47, 45, 44, - /* 30 */ 43, 42, 1626, 2148, 692, 1682, 1916, 1599, 41, 40, - /* 40 */ 38, 312, 47, 45, 44, 43, 42, 2261, 647, 513, - /* 50 */ 511, 2425, 360, 1250, 1253, 1254, 202, 684, 142, 672, - /* 60 */ 687, 91, 2425, 30, 1677, 1834, 204, 1995, 2431, 189, - /* 70 */ 19, 704, 554, 2426, 673, 547, 1876, 1607, 378, 671, - /* 80 */ 189, 704, 417, 416, 2426, 673, 123, 2014, 2279, 122, - /* 90 */ 121, 120, 119, 118, 117, 116, 115, 114, 1626, 2215, - /* 100 */ 2229, 413, 721, 814, 2065, 2067, 15, 1608, 789, 788, - /* 110 */ 787, 786, 420, 704, 785, 784, 146, 779, 778, 777, - /* 120 */ 776, 775, 774, 773, 158, 769, 768, 767, 419, 418, - /* 130 */ 764, 763, 762, 177, 176, 761, 760, 1796, 1273, 2260, - /* 140 */ 1272, 2296, 1684, 1685, 110, 2262, 725, 2264, 2265, 720, - /* 150 */ 430, 715, 705, 2019, 1627, 138, 186, 51, 2349, 561, - /* 160 */ 705, 2019, 404, 2345, 291, 2357, 683, 51, 134, 682, - /* 170 */ 402, 2425, 133, 1274, 1657, 1667, 2072, 191, 167, 588, - /* 180 */ 133, 1683, 1686, 374, 411, 2379, 2021, 593, 671, 189, - /* 190 */ 2239, 2070, 164, 2426, 673, 170, 1602, 1845, 1600, 390, - /* 200 */ 2021, 684, 142, 1826, 2010, 41, 40, 2070, 258, 47, - /* 210 */ 45, 44, 43, 42, 2243, 123, 1856, 565, 122, 121, - /* 220 */ 120, 119, 118, 117, 116, 115, 114, 1855, 1605, 1606, - /* 230 */ 662, 1656, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, - /* 240 */ 717, 713, 1675, 1676, 1678, 1679, 1680, 1681, 2, 48, - /* 250 */ 46, 62, 1507, 1508, 359, 2245, 1624, 408, 672, 1601, - /* 260 */ 1626, 2425, 2261, 498, 182, 715, 516, 368, 1611, 2229, - /* 270 */ 1363, 515, 1682, 667, 1599, 722, 1443, 1444, 671, 189, - /* 280 */ 2229, 1572, 1573, 2426, 673, 1362, 376, 481, 2130, 517, - /* 290 */ 2066, 2067, 41, 40, 483, 646, 47, 45, 44, 43, - /* 300 */ 42, 1677, 1854, 2279, 1629, 52, 1825, 19, 188, 2357, - /* 310 */ 2358, 1711, 140, 2362, 1607, 2229, 295, 721, 607, 606, - /* 320 */ 605, 668, 663, 656, 223, 597, 139, 601, 549, 2150, - /* 330 */ 1883, 600, 2430, 632, 1367, 2425, 599, 604, 384, 383, - /* 340 */ 814, 377, 598, 15, 401, 594, 62, 2147, 692, 1366, - /* 350 */ 2194, 518, 469, 2429, 2260, 2229, 2296, 2426, 2427, 110, - /* 360 */ 2262, 725, 2264, 2265, 720, 12, 715, 10, 411, 145, - /* 370 */ 1712, 151, 2320, 2349, 1784, 562, 167, 404, 2345, 1684, - /* 380 */ 1685, 666, 2137, 2116, 2021, 505, 504, 503, 502, 497, - /* 390 */ 496, 495, 494, 493, 489, 488, 487, 486, 358, 478, - /* 400 */ 477, 476, 259, 471, 470, 375, 760, 1495, 1496, 2279, - /* 410 */ 295, 1657, 1667, 1514, 1833, 520, 705, 2019, 1683, 1686, - /* 420 */ 62, 60, 659, 658, 1782, 1783, 1785, 1786, 1787, 644, - /* 430 */ 2430, 563, 2143, 1602, 1919, 1600, 194, 182, 132, 131, - /* 440 */ 130, 129, 128, 127, 126, 125, 124, 1628, 209, 37, - /* 450 */ 406, 1706, 1707, 1708, 1709, 1710, 1714, 1715, 1716, 1717, - /* 460 */ 271, 2131, 684, 142, 295, 1605, 1606, 665, 1656, 1659, - /* 470 */ 1660, 1661, 1662, 1663, 1664, 1665, 1666, 717, 713, 1675, - /* 480 */ 1676, 1678, 1679, 1680, 1681, 2, 12, 48, 46, 87, - /* 490 */ 225, 2261, 86, 102, 549, 408, 1883, 1601, 47, 45, - /* 500 */ 44, 43, 42, 1853, 687, 295, 607, 606, 605, 452, - /* 510 */ 1682, 451, 1599, 597, 139, 601, 705, 2019, 2012, 600, - /* 520 */ 705, 2019, 2261, 442, 599, 604, 384, 383, 705, 2019, - /* 530 */ 598, 1852, 2279, 594, 1819, 722, 56, 1885, 1628, 1677, - /* 540 */ 458, 450, 303, 304, 2229, 19, 721, 302, 459, 67, - /* 550 */ 444, 440, 1607, 592, 41, 40, 2229, 591, 47, 45, - /* 560 */ 44, 43, 42, 2279, 473, 2126, 500, 2126, 686, 187, - /* 570 */ 2357, 2358, 257, 140, 2362, 2229, 256, 721, 814, 295, - /* 580 */ 707, 15, 2321, 2260, 2229, 2296, 2261, 154, 110, 2262, - /* 590 */ 725, 2264, 2265, 720, 12, 715, 1276, 1277, 34, 722, - /* 600 */ 186, 2387, 2349, 293, 41, 40, 404, 2345, 47, 45, - /* 610 */ 44, 43, 42, 207, 2260, 212, 2296, 1684, 1685, 110, - /* 620 */ 2262, 725, 2264, 2265, 720, 1607, 715, 2279, 1851, 2380, - /* 630 */ 108, 2445, 751, 2349, 705, 2019, 551, 404, 2345, 2229, - /* 640 */ 94, 721, 548, 363, 684, 142, 388, 143, 625, 1657, - /* 650 */ 1667, 62, 1831, 1795, 475, 2011, 1683, 1686, 41, 40, - /* 660 */ 2072, 55, 47, 45, 44, 43, 42, 389, 44, 43, - /* 670 */ 42, 1602, 771, 1600, 623, 2070, 705, 2019, 2260, 1627, - /* 680 */ 2296, 2229, 1713, 110, 2262, 725, 2264, 2265, 720, 621, - /* 690 */ 715, 619, 254, 253, 293, 2445, 490, 2349, 1273, 1256, - /* 700 */ 1272, 404, 2345, 1605, 1606, 1625, 1656, 1659, 1660, 1661, - /* 710 */ 1662, 1663, 1664, 1665, 1666, 717, 713, 1675, 1676, 1678, - /* 720 */ 1679, 1680, 1681, 2, 48, 46, 1687, 2261, 2072, 1629, - /* 730 */ 2072, 423, 408, 1274, 1601, 398, 422, 403, 240, 318, - /* 740 */ 722, 2103, 2400, 2070, 1850, 2070, 709, 1682, 2321, 1599, - /* 750 */ 414, 190, 2357, 2358, 174, 140, 2362, 1772, 167, 2261, - /* 760 */ 1996, 35, 582, 578, 574, 570, 2021, 239, 2279, 2239, - /* 770 */ 595, 1718, 722, 1760, 654, 2072, 1677, 1994, 647, 1626, - /* 780 */ 2229, 2425, 721, 2247, 543, 705, 2019, 705, 2019, 1607, - /* 790 */ 691, 1601, 541, 2243, 1349, 537, 533, 2229, 2431, 189, - /* 800 */ 2279, 1527, 1528, 2426, 673, 491, 1599, 564, 92, 1352, - /* 810 */ 295, 237, 2229, 1849, 721, 814, 1848, 1692, 49, 2260, - /* 820 */ 1753, 2296, 1307, 1626, 110, 2262, 725, 2264, 2265, 720, - /* 830 */ 2072, 715, 705, 2019, 2245, 405, 2445, 412, 2349, 1847, - /* 840 */ 1526, 1529, 404, 2345, 715, 2070, 1607, 705, 2019, 1354, - /* 850 */ 1844, 2260, 2016, 2296, 1684, 1685, 110, 2262, 725, 2264, - /* 860 */ 2265, 720, 1308, 715, 705, 2019, 2229, 260, 2445, 2229, - /* 870 */ 2349, 1843, 814, 1629, 404, 2345, 14, 13, 1842, 1841, - /* 880 */ 2364, 236, 229, 2364, 268, 205, 1657, 1667, 234, 559, - /* 890 */ 584, 583, 2229, 1683, 1686, 758, 156, 155, 755, 754, - /* 900 */ 753, 153, 485, 2229, 2364, 154, 2361, 227, 1602, 2360, - /* 910 */ 1600, 484, 758, 156, 155, 755, 754, 753, 153, 705, - /* 920 */ 2019, 41, 40, 2261, 2229, 47, 45, 44, 43, 42, - /* 930 */ 2359, 2229, 2229, 1658, 586, 585, 722, 2429, 2418, 690, - /* 940 */ 1605, 1606, 91, 1656, 1659, 1660, 1661, 1662, 1663, 1664, - /* 950 */ 1665, 1666, 717, 713, 1675, 1676, 1678, 1679, 1680, 1681, - /* 960 */ 2, 48, 46, 1840, 2279, 1602, 2239, 1600, 2015, 408, - /* 970 */ 2072, 1601, 603, 602, 1626, 1839, 2229, 1658, 721, 1567, - /* 980 */ 2248, 36, 1725, 507, 1682, 700, 1599, 41, 40, 1838, - /* 990 */ 2243, 47, 45, 44, 43, 42, 1837, 1605, 1606, 705, - /* 1000 */ 2019, 2004, 41, 40, 1836, 2261, 47, 45, 44, 43, - /* 1010 */ 42, 783, 781, 1677, 2222, 2260, 2229, 2296, 722, 307, - /* 1020 */ 110, 2262, 725, 2264, 2265, 720, 1607, 715, 2229, 270, - /* 1030 */ 772, 2245, 2445, 1981, 2349, 2261, 705, 2019, 404, 2345, - /* 1040 */ 2006, 715, 2229, 705, 2019, 213, 2279, 676, 722, 2229, - /* 1050 */ 2368, 2072, 814, 705, 2019, 49, 702, 2229, 2229, 144, - /* 1060 */ 721, 647, 2320, 703, 2425, 612, 2071, 506, 75, 705, - /* 1070 */ 2019, 167, 752, 313, 327, 2063, 2279, 2049, 2002, 2022, - /* 1080 */ 624, 2431, 189, 1752, 1861, 809, 2426, 673, 2229, 415, - /* 1090 */ 721, 1684, 1685, 1253, 1254, 756, 255, 2260, 2063, 2296, - /* 1100 */ 2369, 1745, 110, 2262, 725, 2264, 2265, 720, 757, 715, - /* 1110 */ 9, 2063, 615, 2212, 2324, 1997, 2349, 596, 85, 609, - /* 1120 */ 404, 2345, 2113, 1657, 1667, 252, 3, 2260, 1658, 2296, - /* 1130 */ 1683, 1686, 110, 2262, 725, 2264, 2265, 720, 54, 715, - /* 1140 */ 245, 1347, 154, 243, 2445, 1602, 2349, 1600, 147, 247, - /* 1150 */ 404, 2345, 246, 758, 156, 155, 755, 754, 753, 153, - /* 1160 */ 2261, 269, 249, 2023, 465, 248, 71, 135, 251, 70, - /* 1170 */ 166, 250, 712, 722, 382, 381, 1610, 1605, 1606, 84, - /* 1180 */ 1656, 1659, 1660, 1661, 1662, 1663, 1664, 1665, 1666, 717, - /* 1190 */ 713, 1675, 1676, 1678, 1679, 1680, 1681, 2, 48, 46, - /* 1200 */ 1903, 2279, 627, 50, 626, 95, 408, 50, 1601, 679, - /* 1210 */ 1408, 275, 154, 2229, 50, 721, 1570, 1828, 1829, 1609, - /* 1220 */ 675, 1682, 608, 1599, 1399, 750, 749, 748, 1403, 747, - /* 1230 */ 1405, 1406, 746, 743, 1894, 1414, 740, 1416, 1417, 737, - /* 1240 */ 734, 731, 2261, 2223, 1892, 380, 379, 264, 590, 765, - /* 1250 */ 1677, 630, 2260, 688, 2296, 722, 610, 110, 2262, 725, - /* 1260 */ 2264, 2265, 720, 1607, 715, 2250, 613, 716, 267, 2322, - /* 1270 */ 592, 2349, 766, 1326, 591, 404, 2345, 1781, 14, 13, - /* 1280 */ 300, 1780, 72, 2279, 1960, 277, 689, 1846, 1524, 814, - /* 1290 */ 647, 152, 15, 2425, 2393, 2229, 1324, 721, 647, 107, - /* 1300 */ 647, 2425, 677, 2425, 154, 65, 288, 660, 104, 137, - /* 1310 */ 2431, 189, 50, 50, 729, 2426, 673, 152, 2431, 189, - /* 1320 */ 2431, 189, 2252, 2426, 673, 2426, 673, 154, 1684, 1685, - /* 1330 */ 1703, 136, 1745, 1886, 2260, 437, 2296, 1613, 152, 110, - /* 1340 */ 2262, 725, 2264, 2265, 720, 282, 715, 168, 1957, 1956, - /* 1350 */ 2280, 708, 334, 2349, 305, 391, 697, 404, 2345, 421, - /* 1360 */ 1657, 1667, 1877, 2135, 2060, 309, 1882, 1683, 1686, 331, - /* 1370 */ 74, 2383, 685, 73, 290, 287, 294, 424, 1393, 1719, - /* 1380 */ 1612, 429, 1602, 356, 1600, 807, 1668, 326, 1421, 5, - /* 1390 */ 1632, 1425, 197, 446, 221, 528, 526, 523, 2261, 372, - /* 1400 */ 445, 1432, 196, 448, 199, 1430, 1548, 321, 1624, 462, - /* 1410 */ 1625, 722, 157, 211, 1605, 1606, 466, 1656, 1659, 1660, - /* 1420 */ 1661, 1662, 1663, 1664, 1665, 1666, 717, 713, 1675, 1676, - /* 1430 */ 1678, 1679, 1680, 1681, 2, 62, 417, 416, 468, 2279, - /* 1440 */ 1629, 2136, 472, 474, 479, 492, 1615, 509, 499, 2128, - /* 1450 */ 501, 2229, 521, 721, 508, 510, 522, 519, 215, 1682, - /* 1460 */ 216, 1608, 524, 1630, 525, 218, 680, 527, 544, 529, - /* 1470 */ 545, 2261, 4, 63, 553, 552, 555, 1627, 556, 226, - /* 1480 */ 228, 1631, 1633, 558, 722, 231, 557, 560, 1677, 1634, - /* 1490 */ 2260, 566, 2296, 2144, 587, 111, 2262, 725, 2264, 2265, - /* 1500 */ 720, 1607, 715, 616, 233, 89, 90, 589, 238, 2349, - /* 1510 */ 112, 617, 2279, 2348, 2345, 2009, 242, 82, 81, 457, - /* 1520 */ 353, 2005, 201, 629, 2229, 93, 721, 711, 631, 244, - /* 1530 */ 2203, 160, 161, 2007, 2003, 449, 447, 162, 163, 261, - /* 1540 */ 148, 635, 634, 265, 2261, 1555, 357, 2200, 2199, 438, - /* 1550 */ 642, 263, 436, 432, 428, 425, 450, 722, 639, 651, - /* 1560 */ 661, 640, 322, 2260, 2399, 2296, 695, 657, 111, 2262, - /* 1570 */ 725, 2264, 2265, 720, 8, 715, 2384, 2394, 641, 2398, - /* 1580 */ 2261, 670, 2349, 273, 636, 2279, 710, 2345, 394, 276, - /* 1590 */ 664, 652, 649, 719, 295, 650, 395, 2229, 681, 721, - /* 1600 */ 2448, 678, 1745, 141, 286, 1628, 1750, 179, 1748, 693, - /* 1610 */ 323, 296, 324, 694, 149, 2158, 698, 2157, 2365, 2156, - /* 1620 */ 1616, 2279, 1611, 400, 699, 325, 150, 101, 2020, 61, - /* 1630 */ 103, 727, 2064, 2229, 1982, 721, 723, 284, 2296, 2371, - /* 1640 */ 281, 111, 2262, 725, 2264, 2265, 720, 175, 715, 283, - /* 1650 */ 285, 1232, 1619, 1621, 2424, 2349, 2330, 808, 192, 367, - /* 1660 */ 2345, 1, 328, 316, 811, 713, 1675, 1676, 1678, 1679, - /* 1670 */ 1680, 1681, 2260, 159, 2296, 337, 289, 349, 2262, 725, - /* 1680 */ 2264, 2265, 720, 718, 715, 706, 2314, 2261, 813, 53, - /* 1690 */ 2221, 352, 364, 330, 365, 351, 332, 2220, 341, 2219, - /* 1700 */ 722, 79, 2216, 426, 427, 2261, 1592, 1593, 195, 431, - /* 1710 */ 2214, 433, 434, 435, 2213, 373, 2211, 439, 722, 443, - /* 1720 */ 441, 2261, 2210, 2209, 1583, 2190, 198, 2189, 2279, 200, - /* 1730 */ 1551, 80, 1550, 2171, 722, 2170, 2169, 455, 456, 2168, - /* 1740 */ 2229, 2167, 721, 2118, 460, 1494, 2279, 2112, 463, 2109, - /* 1750 */ 203, 464, 2108, 83, 2107, 2106, 2111, 2110, 2229, 2105, - /* 1760 */ 721, 206, 2279, 2104, 2102, 2101, 2100, 208, 480, 2099, - /* 1770 */ 482, 2115, 2098, 2097, 2229, 2096, 721, 2095, 2094, 2260, - /* 1780 */ 2093, 2296, 2092, 2261, 171, 2262, 725, 2264, 2265, 720, - /* 1790 */ 2091, 715, 2090, 2089, 2088, 2087, 722, 2260, 2086, 2296, - /* 1800 */ 2085, 2084, 172, 2262, 725, 2264, 2265, 720, 2083, 715, - /* 1810 */ 210, 2082, 88, 2260, 214, 2296, 2081, 2080, 111, 2262, - /* 1820 */ 725, 2264, 2265, 720, 2279, 715, 648, 2390, 2114, 2079, - /* 1830 */ 2078, 1500, 2349, 2077, 2076, 512, 2229, 2346, 721, 2075, - /* 1840 */ 2074, 2073, 1364, 1368, 1922, 2261, 361, 362, 514, 1360, - /* 1850 */ 217, 1921, 219, 1920, 1918, 674, 2446, 1915, 722, 530, - /* 1860 */ 2261, 531, 1914, 220, 534, 532, 535, 536, 1907, 538, - /* 1870 */ 539, 1896, 542, 722, 1872, 2260, 222, 2296, 540, 1255, - /* 1880 */ 171, 2262, 725, 2264, 2265, 720, 2279, 715, 77, 183, - /* 1890 */ 1871, 392, 2249, 224, 184, 2188, 550, 78, 2229, 2178, - /* 1900 */ 721, 2279, 2166, 230, 232, 2165, 393, 235, 2142, 1998, - /* 1910 */ 1917, 1913, 567, 2229, 568, 721, 1911, 571, 569, 1300, - /* 1920 */ 572, 573, 1909, 2391, 575, 577, 1906, 581, 2261, 576, - /* 1930 */ 579, 1891, 580, 1889, 1890, 1888, 1868, 2260, 2000, 2296, - /* 1940 */ 64, 722, 350, 2262, 725, 2264, 2265, 720, 1999, 715, - /* 1950 */ 241, 1437, 2260, 780, 2296, 1351, 1350, 350, 2262, 725, - /* 1960 */ 2264, 2265, 720, 1436, 715, 1348, 1346, 1345, 1337, 2279, - /* 1970 */ 1904, 385, 1895, 386, 1344, 1893, 1343, 782, 611, 1342, - /* 1980 */ 1339, 2229, 1338, 721, 1336, 387, 1867, 614, 1866, 1865, - /* 1990 */ 2261, 618, 1864, 620, 1863, 622, 113, 1577, 1579, 1576, - /* 2000 */ 29, 2261, 2187, 722, 1581, 1561, 68, 1559, 1557, 2177, - /* 2010 */ 2164, 2163, 165, 637, 722, 2430, 20, 6, 57, 31, - /* 2020 */ 2260, 17, 2296, 655, 1798, 343, 2262, 725, 2264, 2265, - /* 2030 */ 720, 2279, 715, 272, 7, 638, 653, 21, 22, 266, - /* 2040 */ 1536, 279, 2279, 2229, 280, 721, 1535, 399, 2250, 643, - /* 2050 */ 645, 33, 66, 23, 2229, 24, 721, 18, 1813, 274, - /* 2060 */ 1779, 173, 1812, 278, 32, 396, 2261, 1817, 1816, 397, - /* 2070 */ 669, 1771, 96, 292, 59, 1818, 1819, 2162, 178, 719, - /* 2080 */ 2141, 1742, 2260, 97, 2296, 1741, 98, 172, 2262, 725, - /* 2090 */ 2264, 2265, 720, 2260, 715, 2296, 633, 299, 350, 2262, - /* 2100 */ 725, 2264, 2265, 720, 25, 715, 301, 2279, 1777, 306, - /* 2110 */ 2140, 99, 58, 69, 817, 311, 26, 13, 1617, 2229, - /* 2120 */ 100, 721, 11, 1694, 1693, 180, 1704, 193, 104, 1649, - /* 2130 */ 320, 724, 2261, 2299, 728, 410, 732, 735, 738, 741, - /* 2140 */ 1672, 2447, 714, 308, 1670, 722, 181, 1669, 39, 16, - /* 2150 */ 726, 27, 314, 1641, 805, 801, 797, 793, 2260, 317, - /* 2160 */ 2296, 2261, 696, 349, 2262, 725, 2264, 2265, 720, 28, - /* 2170 */ 715, 1422, 2315, 2279, 722, 1419, 730, 733, 407, 1418, - /* 2180 */ 736, 744, 1415, 1413, 2261, 2229, 1409, 721, 739, 1412, - /* 2190 */ 742, 1431, 1411, 1407, 745, 105, 106, 722, 76, 1427, - /* 2200 */ 109, 1298, 2279, 310, 759, 1333, 1330, 409, 1410, 1329, - /* 2210 */ 1328, 1327, 1358, 1325, 2229, 1323, 721, 1322, 1321, 315, - /* 2220 */ 770, 1319, 1318, 1316, 2260, 2279, 2296, 1317, 1315, 350, - /* 2230 */ 2262, 725, 2264, 2265, 720, 701, 715, 2229, 1355, 721, - /* 2240 */ 1314, 1313, 1353, 1310, 1309, 1304, 1306, 1305, 1303, 1912, - /* 2250 */ 790, 791, 1910, 2260, 2261, 2296, 792, 794, 350, 2262, - /* 2260 */ 725, 2264, 2265, 720, 796, 715, 795, 722, 1908, 798, - /* 2270 */ 799, 800, 1905, 298, 802, 803, 628, 804, 2296, 1887, - /* 2280 */ 297, 345, 2262, 725, 2264, 2265, 720, 2261, 715, 1862, - /* 2290 */ 806, 1245, 1233, 810, 812, 2279, 319, 1603, 329, 262, - /* 2300 */ 722, 815, 816, 1832, 1832, 1832, 2261, 2229, 1832, 721, - /* 2310 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 722, - /* 2320 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 2279, 1832, - /* 2330 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2340 */ 2229, 1832, 721, 1832, 1832, 1832, 2260, 2279, 2296, 1832, - /* 2350 */ 1832, 335, 2262, 725, 2264, 2265, 720, 1832, 715, 2229, - /* 2360 */ 1832, 721, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2370 */ 2261, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 2260, - /* 2380 */ 1832, 2296, 1832, 722, 333, 2262, 725, 2264, 2265, 720, - /* 2390 */ 1832, 715, 1832, 1832, 1832, 1832, 1832, 1832, 2260, 1832, - /* 2400 */ 2296, 1832, 2261, 336, 2262, 725, 2264, 2265, 720, 1832, - /* 2410 */ 715, 2279, 1832, 1832, 1832, 722, 1832, 1832, 1832, 1832, - /* 2420 */ 1832, 1832, 1832, 2229, 1832, 721, 1832, 1832, 1832, 1832, - /* 2430 */ 1832, 1832, 2261, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2440 */ 1832, 1832, 1832, 2279, 1832, 722, 1832, 1832, 1832, 1832, - /* 2450 */ 1832, 1832, 1832, 1832, 1832, 2229, 1832, 721, 1832, 1832, - /* 2460 */ 1832, 1832, 2260, 1832, 2296, 1832, 1832, 342, 2262, 725, - /* 2470 */ 2264, 2265, 720, 2279, 715, 1832, 1832, 1832, 1832, 1832, - /* 2480 */ 1832, 1832, 1832, 1832, 1832, 2229, 1832, 721, 1832, 1832, - /* 2490 */ 1832, 1832, 1832, 1832, 2260, 1832, 2296, 1832, 1832, 346, - /* 2500 */ 2262, 725, 2264, 2265, 720, 2261, 715, 1832, 1832, 1832, - /* 2510 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 722, 1832, - /* 2520 */ 1832, 1832, 2261, 1832, 2260, 1832, 2296, 1832, 1832, 338, - /* 2530 */ 2262, 725, 2264, 2265, 720, 722, 715, 1832, 1832, 1832, - /* 2540 */ 1832, 1832, 1832, 1832, 1832, 1832, 2279, 1832, 1832, 1832, - /* 2550 */ 1832, 1832, 1832, 1832, 1832, 2261, 1832, 1832, 2229, 1832, - /* 2560 */ 721, 1832, 1832, 2279, 1832, 1832, 1832, 1832, 722, 1832, - /* 2570 */ 1832, 1832, 2261, 1832, 1832, 2229, 1832, 721, 1832, 1832, - /* 2580 */ 1832, 1832, 1832, 1832, 1832, 722, 1832, 2261, 1832, 1832, - /* 2590 */ 1832, 1832, 1832, 1832, 1832, 1832, 2279, 2260, 1832, 2296, - /* 2600 */ 722, 1832, 347, 2262, 725, 2264, 2265, 720, 2229, 715, - /* 2610 */ 721, 1832, 1832, 2279, 2260, 1832, 2296, 1832, 1832, 339, - /* 2620 */ 2262, 725, 2264, 2265, 720, 2229, 715, 721, 2279, 1832, - /* 2630 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2640 */ 2229, 1832, 721, 1832, 1832, 1832, 1832, 2260, 1832, 2296, - /* 2650 */ 1832, 1832, 348, 2262, 725, 2264, 2265, 720, 1832, 715, - /* 2660 */ 1832, 1832, 1832, 1832, 2260, 1832, 2296, 2261, 1832, 340, - /* 2670 */ 2262, 725, 2264, 2265, 720, 1832, 715, 1832, 1832, 2260, - /* 2680 */ 722, 2296, 1832, 1832, 354, 2262, 725, 2264, 2265, 720, - /* 2690 */ 2261, 715, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2700 */ 1832, 2261, 1832, 722, 1832, 1832, 1832, 1832, 2279, 1832, - /* 2710 */ 1832, 1832, 1832, 1832, 722, 1832, 1832, 1832, 1832, 1832, - /* 2720 */ 2229, 1832, 721, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2730 */ 1832, 2279, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2740 */ 1832, 1832, 2279, 2229, 1832, 721, 1832, 1832, 1832, 1832, - /* 2750 */ 1832, 1832, 1832, 1832, 2229, 1832, 721, 1832, 1832, 2260, - /* 2760 */ 1832, 2296, 1832, 2261, 355, 2262, 725, 2264, 2265, 720, - /* 2770 */ 1832, 715, 1832, 1832, 1832, 1832, 722, 1832, 1832, 1832, - /* 2780 */ 1832, 1832, 2260, 1832, 2296, 1832, 1832, 2273, 2262, 725, - /* 2790 */ 2264, 2265, 720, 2260, 715, 2296, 1832, 1832, 2272, 2262, - /* 2800 */ 725, 2264, 2265, 720, 2279, 715, 1832, 1832, 1832, 1832, - /* 2810 */ 1832, 1832, 1832, 1832, 1832, 2261, 2229, 1832, 721, 1832, - /* 2820 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 722, 1832, - /* 2830 */ 1832, 1832, 1832, 2261, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2840 */ 1832, 1832, 1832, 1832, 1832, 1832, 722, 1832, 1832, 1832, - /* 2850 */ 1832, 1832, 1832, 2261, 1832, 2260, 2279, 2296, 1832, 1832, - /* 2860 */ 2271, 2262, 725, 2264, 2265, 720, 722, 715, 2229, 1832, - /* 2870 */ 721, 1832, 1832, 1832, 2279, 1832, 1832, 1832, 1832, 1832, - /* 2880 */ 1832, 1832, 1832, 2261, 1832, 1832, 2229, 1832, 721, 1832, - /* 2890 */ 1832, 1832, 1832, 1832, 2279, 1832, 722, 1832, 1832, 1832, - /* 2900 */ 1832, 1832, 1832, 1832, 1832, 1832, 2229, 2260, 721, 2296, - /* 2910 */ 1832, 1832, 369, 2262, 725, 2264, 2265, 720, 1832, 715, - /* 2920 */ 1832, 1832, 1832, 1832, 2279, 2260, 1832, 2296, 1832, 1832, - /* 2930 */ 370, 2262, 725, 2264, 2265, 720, 2229, 715, 721, 1832, - /* 2940 */ 1832, 1832, 1832, 1832, 1832, 2260, 1832, 2296, 2261, 1832, - /* 2950 */ 366, 2262, 725, 2264, 2265, 720, 1832, 715, 1832, 1832, - /* 2960 */ 1832, 722, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 2970 */ 1832, 1832, 1832, 2261, 1832, 2260, 1832, 2296, 1832, 1832, - /* 2980 */ 371, 2262, 725, 2264, 2265, 720, 722, 715, 1832, 2279, - /* 2990 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 3000 */ 1832, 2229, 1832, 721, 1832, 1832, 1832, 1832, 1832, 1832, - /* 3010 */ 1832, 1832, 1832, 1832, 2279, 1832, 1832, 1832, 1832, 1832, - /* 3020 */ 1832, 1832, 1832, 1832, 1832, 1832, 2229, 1832, 721, 1832, - /* 3030 */ 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 3040 */ 723, 1832, 2296, 1832, 1832, 345, 2262, 725, 2264, 2265, - /* 3050 */ 720, 1832, 715, 1832, 1832, 1832, 1832, 1832, 1832, 1832, - /* 3060 */ 1832, 1832, 1832, 1832, 1832, 2260, 1832, 2296, 1832, 1832, - /* 3070 */ 344, 2262, 725, 2264, 2265, 720, 1832, 715, + /* 0 */ 403, 707, 2024, 412, 674, 2217, 2437, 2432, 167, 2432, + /* 10 */ 2199, 164, 48, 46, 1761, 463, 2026, 668, 391, 2026, + /* 20 */ 409, 133, 1606, 1839, 673, 189, 2075, 2436, 590, 2433, + /* 30 */ 675, 2433, 2435, 418, 417, 1687, 1921, 1604, 47, 45, + /* 40 */ 44, 43, 42, 1758, 123, 2286, 2268, 122, 121, 120, + /* 50 */ 119, 118, 117, 116, 115, 114, 686, 142, 1613, 689, + /* 60 */ 515, 513, 260, 361, 1682, 1838, 1631, 203, 548, 706, + /* 70 */ 19, 549, 1881, 1836, 2246, 123, 2371, 1612, 122, 121, + /* 80 */ 120, 119, 118, 117, 116, 115, 114, 2286, 2015, 132, + /* 90 */ 131, 130, 129, 128, 127, 126, 125, 124, 2250, 2236, + /* 100 */ 1632, 723, 2368, 816, 667, 706, 15, 553, 791, 790, + /* 110 */ 789, 788, 421, 550, 787, 786, 146, 781, 780, 779, + /* 120 */ 778, 777, 776, 775, 158, 771, 770, 769, 420, 419, + /* 130 */ 766, 765, 764, 177, 176, 763, 1631, 182, 2267, 648, + /* 140 */ 2252, 2303, 1689, 1690, 110, 2269, 727, 2271, 2272, 722, + /* 150 */ 717, 717, 424, 707, 2024, 51, 186, 423, 2356, 377, + /* 160 */ 2436, 2135, 405, 2352, 292, 2364, 685, 62, 134, 684, + /* 170 */ 563, 2432, 2155, 133, 1662, 1672, 2437, 191, 706, 2432, + /* 180 */ 595, 1688, 1691, 185, 67, 2386, 1765, 402, 673, 189, + /* 190 */ 2152, 694, 1631, 2433, 675, 2064, 1607, 2436, 1605, 625, + /* 200 */ 649, 2433, 2434, 2432, 556, 41, 40, 549, 1881, 47, + /* 210 */ 45, 44, 43, 42, 623, 1632, 621, 255, 254, 1616, + /* 220 */ 2438, 189, 1530, 1531, 1697, 2433, 675, 196, 1610, 1611, + /* 230 */ 1631, 1661, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, + /* 240 */ 719, 715, 1680, 1681, 1683, 1684, 1685, 1686, 2, 48, + /* 250 */ 46, 2155, 169, 1631, 360, 2268, 1629, 409, 2437, 1606, + /* 260 */ 1964, 1529, 1532, 500, 51, 60, 518, 369, 724, 2153, + /* 270 */ 694, 517, 1687, 646, 1604, 1633, 41, 40, 2077, 182, + /* 280 */ 47, 45, 44, 43, 42, 390, 62, 483, 1634, 519, + /* 290 */ 1510, 1511, 1251, 2075, 485, 414, 2286, 2077, 2070, 2072, + /* 300 */ 456, 1682, 1411, 2136, 399, 455, 1757, 19, 2236, 224, + /* 310 */ 723, 1716, 2075, 551, 1612, 1888, 1402, 752, 751, 750, + /* 320 */ 1406, 749, 1408, 1409, 748, 745, 296, 1417, 742, 1419, + /* 330 */ 1420, 739, 736, 733, 1253, 1256, 1257, 1446, 1447, 62, + /* 340 */ 816, 378, 1276, 15, 1275, 2002, 1663, 2267, 649, 1861, + /* 350 */ 2303, 2432, 471, 110, 2269, 727, 2271, 2272, 722, 138, + /* 360 */ 717, 567, 1824, 145, 1860, 151, 2327, 2356, 2438, 189, + /* 370 */ 1717, 405, 2352, 2433, 675, 469, 2131, 1277, 147, 1689, + /* 380 */ 1690, 52, 2142, 2121, 1663, 507, 506, 505, 504, 499, + /* 390 */ 498, 497, 496, 495, 491, 490, 489, 488, 359, 480, + /* 400 */ 479, 478, 2236, 473, 472, 376, 2371, 1498, 1499, 664, + /* 410 */ 226, 1662, 1672, 1517, 551, 1366, 1888, 2236, 1688, 1691, + /* 420 */ 259, 41, 40, 296, 205, 47, 45, 44, 43, 42, + /* 430 */ 1365, 294, 2367, 1607, 1924, 1605, 760, 156, 155, 757, + /* 440 */ 756, 755, 153, 677, 272, 296, 30, 707, 2024, 37, + /* 450 */ 407, 1711, 1712, 1713, 1714, 1715, 1719, 1720, 1721, 1722, + /* 460 */ 170, 564, 1850, 686, 142, 1610, 1611, 194, 1661, 1664, + /* 470 */ 1665, 1666, 1667, 1668, 1669, 1670, 1671, 719, 715, 1680, + /* 480 */ 1681, 1683, 1684, 1685, 1686, 2, 12, 48, 46, 707, + /* 490 */ 2024, 2268, 669, 1575, 1576, 409, 520, 1606, 296, 594, + /* 500 */ 670, 665, 658, 593, 689, 1633, 609, 608, 607, 56, + /* 510 */ 1687, 1859, 1604, 599, 139, 603, 2077, 565, 2148, 602, + /* 520 */ 1801, 91, 1631, 375, 601, 606, 385, 384, 14, 13, + /* 530 */ 600, 2075, 2286, 596, 686, 142, 707, 2024, 379, 1682, + /* 540 */ 296, 609, 608, 607, 2236, 19, 723, 2019, 599, 139, + /* 550 */ 603, 12, 1612, 10, 602, 167, 460, 707, 2024, 601, + /* 560 */ 606, 385, 384, 2027, 2236, 600, 475, 2131, 596, 762, + /* 570 */ 688, 187, 2364, 2365, 634, 140, 2369, 461, 816, 38, + /* 580 */ 313, 15, 2268, 2267, 258, 1606, 2303, 12, 257, 110, + /* 590 */ 2269, 727, 2271, 2272, 722, 724, 717, 1890, 1259, 674, + /* 600 */ 1604, 186, 2432, 2356, 1630, 41, 40, 405, 2352, 47, + /* 610 */ 45, 44, 43, 42, 108, 208, 2108, 1689, 1690, 673, + /* 620 */ 189, 707, 2024, 2286, 2433, 675, 1858, 2229, 707, 2024, + /* 630 */ 2387, 143, 1908, 1857, 1730, 2236, 1856, 723, 2077, 2016, + /* 640 */ 1612, 477, 188, 2364, 2365, 404, 140, 2369, 492, 1662, + /* 650 */ 1672, 545, 94, 2075, 610, 364, 1688, 1691, 389, 543, + /* 660 */ 627, 294, 539, 535, 383, 382, 816, 2001, 707, 2024, + /* 670 */ 1276, 1607, 1275, 1605, 2267, 649, 1663, 2303, 2432, 2236, + /* 680 */ 110, 2269, 727, 2271, 2272, 722, 2236, 717, 493, 2236, + /* 690 */ 502, 2131, 2452, 1355, 2356, 2438, 189, 1612, 405, 2352, + /* 700 */ 2433, 675, 1789, 1610, 1611, 1277, 1661, 1664, 1665, 1666, + /* 710 */ 1667, 1668, 1669, 1670, 1671, 719, 715, 1680, 1681, 1683, + /* 720 */ 1684, 1685, 1686, 2, 48, 46, 1692, 2268, 707, 2024, + /* 730 */ 2077, 2077, 409, 1357, 1606, 381, 380, 413, 592, 213, + /* 740 */ 724, 1999, 2394, 707, 2024, 2075, 693, 1687, 566, 1604, + /* 750 */ 661, 660, 1787, 1788, 1790, 1791, 1792, 686, 142, 1607, + /* 760 */ 594, 1605, 753, 2021, 593, 41, 40, 2371, 2286, 47, + /* 770 */ 45, 44, 43, 42, 707, 2024, 1682, 487, 707, 2024, + /* 780 */ 2236, 1370, 723, 304, 305, 1831, 486, 1855, 303, 1612, + /* 790 */ 773, 1610, 1611, 2366, 261, 91, 1369, 2268, 269, 44, + /* 800 */ 43, 42, 760, 156, 155, 757, 756, 755, 153, 102, + /* 810 */ 724, 709, 2407, 2328, 62, 816, 707, 2024, 49, 2267, + /* 820 */ 2268, 2020, 2303, 2071, 2072, 110, 2269, 727, 2271, 2272, + /* 830 */ 722, 444, 717, 724, 2017, 656, 692, 2452, 2286, 2356, + /* 840 */ 2236, 41, 40, 405, 2352, 47, 45, 44, 43, 42, + /* 850 */ 2236, 711, 723, 2328, 1689, 1690, 1279, 1280, 446, 442, + /* 860 */ 2000, 2286, 522, 1854, 1800, 190, 2364, 2365, 2013, 140, + /* 870 */ 2369, 586, 585, 2236, 319, 723, 760, 156, 155, 757, + /* 880 */ 756, 755, 153, 210, 707, 2024, 1662, 1672, 1830, 2267, + /* 890 */ 588, 587, 2303, 1688, 1691, 110, 2269, 727, 2271, 2272, + /* 900 */ 722, 2009, 717, 454, 308, 453, 1634, 2452, 1607, 2356, + /* 910 */ 1605, 1899, 2267, 405, 2352, 2303, 2236, 2011, 110, 2269, + /* 920 */ 727, 2271, 2272, 722, 87, 717, 412, 86, 1853, 762, + /* 930 */ 2452, 2230, 2356, 612, 167, 452, 405, 2352, 1852, 509, + /* 940 */ 1610, 1611, 2026, 1661, 1664, 1665, 1666, 1667, 1668, 1669, + /* 950 */ 1670, 1671, 719, 715, 1680, 1681, 1683, 1684, 1685, 1686, + /* 960 */ 2, 48, 46, 2246, 2007, 2268, 1849, 605, 604, 409, + /* 970 */ 2077, 1606, 2028, 296, 785, 783, 1634, 2255, 724, 649, + /* 980 */ 2425, 2236, 2432, 614, 1687, 702, 1604, 2250, 9, 41, + /* 990 */ 40, 2236, 1848, 47, 45, 44, 43, 42, 626, 2438, + /* 1000 */ 189, 214, 707, 2024, 2433, 675, 2286, 1718, 144, 166, + /* 1010 */ 678, 2327, 754, 1682, 256, 2068, 707, 2024, 2236, 2236, + /* 1020 */ 723, 34, 704, 508, 707, 2024, 1612, 41, 40, 2252, + /* 1030 */ 617, 47, 45, 44, 43, 42, 705, 611, 415, 717, + /* 1040 */ 1847, 707, 2024, 253, 314, 2236, 167, 632, 758, 265, + /* 1050 */ 1846, 2068, 816, 718, 2026, 49, 2268, 2267, 681, 2246, + /* 1060 */ 2303, 416, 206, 110, 2269, 727, 2271, 2272, 722, 724, + /* 1070 */ 717, 2375, 714, 2254, 1845, 2452, 1844, 2356, 1866, 811, + /* 1080 */ 1851, 405, 2352, 2250, 71, 2220, 35, 70, 1777, 1843, + /* 1090 */ 1842, 1689, 1690, 2236, 36, 649, 1723, 2286, 2432, 1841, + /* 1100 */ 41, 40, 690, 2236, 47, 45, 44, 43, 42, 2236, + /* 1110 */ 629, 723, 628, 2077, 759, 2438, 189, 2068, 268, 328, + /* 1120 */ 2433, 675, 2054, 1662, 1672, 2252, 406, 2236, 2076, 2236, + /* 1130 */ 1688, 1691, 271, 41, 40, 717, 431, 47, 45, 44, + /* 1140 */ 43, 42, 2236, 2236, 154, 1607, 774, 1605, 2267, 1986, + /* 1150 */ 649, 2303, 2236, 2432, 110, 2269, 727, 2271, 2272, 722, + /* 1160 */ 154, 717, 1256, 1257, 2376, 1750, 2452, 3, 2356, 2118, + /* 1170 */ 2438, 189, 405, 2352, 75, 2433, 675, 1610, 1611, 54, + /* 1180 */ 1661, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1671, 719, + /* 1190 */ 715, 1680, 1681, 1683, 1684, 1685, 1686, 2, 48, 46, + /* 1200 */ 135, 597, 2268, 598, 246, 154, 409, 244, 1606, 1897, + /* 1210 */ 1750, 467, 84, 248, 250, 724, 247, 249, 1570, 252, + /* 1220 */ 270, 1687, 251, 1604, 85, 1352, 2257, 1350, 1833, 1834, + /* 1230 */ 1708, 615, 50, 1310, 55, 2268, 50, 276, 1615, 154, + /* 1240 */ 1965, 14, 13, 2286, 107, 1614, 50, 301, 721, 72, + /* 1250 */ 1682, 152, 154, 104, 2400, 2236, 289, 723, 65, 662, + /* 1260 */ 137, 283, 767, 1612, 95, 679, 1962, 768, 1961, 50, + /* 1270 */ 50, 731, 1891, 1311, 392, 152, 2286, 154, 422, 1573, + /* 1280 */ 136, 152, 2287, 2259, 2140, 1882, 1329, 2390, 2236, 816, + /* 1290 */ 723, 1327, 15, 1887, 2267, 2065, 687, 2303, 291, 5, + /* 1300 */ 110, 2269, 727, 2271, 2272, 722, 1786, 717, 288, 425, + /* 1310 */ 1785, 278, 2331, 691, 2356, 682, 430, 373, 405, 2352, + /* 1320 */ 1527, 306, 295, 699, 809, 310, 1396, 2267, 1689, 1690, + /* 1330 */ 2303, 438, 1724, 350, 2269, 727, 2271, 2272, 722, 720, + /* 1340 */ 717, 708, 2321, 1673, 327, 1424, 439, 168, 1637, 1428, + /* 1350 */ 448, 1435, 335, 447, 1433, 157, 197, 198, 450, 200, + /* 1360 */ 1662, 1672, 1551, 322, 1629, 464, 1630, 1688, 1691, 332, + /* 1370 */ 74, 468, 212, 73, 470, 1634, 2141, 474, 476, 481, + /* 1380 */ 511, 494, 1607, 357, 1605, 503, 501, 2133, 510, 512, + /* 1390 */ 523, 217, 524, 521, 222, 530, 528, 525, 216, 1618, + /* 1400 */ 526, 219, 529, 527, 531, 1635, 1617, 546, 4, 547, + /* 1410 */ 555, 554, 227, 557, 1610, 1611, 1632, 1661, 1664, 1665, + /* 1420 */ 1666, 1667, 1668, 1669, 1670, 1671, 719, 715, 1680, 1681, + /* 1430 */ 1683, 1684, 1685, 1686, 2, 62, 418, 417, 558, 229, + /* 1440 */ 1636, 559, 1638, 560, 232, 562, 1620, 234, 1639, 89, + /* 1450 */ 2149, 90, 568, 589, 591, 239, 2014, 243, 2010, 1687, + /* 1460 */ 245, 1613, 160, 161, 618, 2012, 2008, 112, 619, 354, + /* 1470 */ 162, 2268, 631, 63, 633, 93, 163, 637, 262, 636, + /* 1480 */ 323, 148, 638, 264, 724, 266, 642, 1558, 1682, 2208, + /* 1490 */ 2205, 2204, 644, 8, 2406, 663, 641, 643, 653, 659, + /* 1500 */ 697, 1612, 395, 2405, 672, 284, 666, 2268, 2378, 2391, + /* 1510 */ 2401, 652, 2286, 282, 654, 285, 396, 82, 81, 459, + /* 1520 */ 724, 274, 202, 175, 2236, 277, 723, 713, 651, 1633, + /* 1530 */ 286, 2455, 683, 287, 2431, 451, 449, 680, 2268, 141, + /* 1540 */ 1750, 1755, 290, 1753, 2372, 179, 358, 297, 2286, 440, + /* 1550 */ 324, 724, 437, 433, 429, 426, 452, 695, 149, 696, + /* 1560 */ 2236, 2163, 723, 2267, 2162, 2161, 2303, 325, 700, 110, + /* 1570 */ 2269, 727, 2271, 2272, 722, 401, 717, 701, 150, 2286, + /* 1580 */ 61, 2329, 326, 2356, 2337, 103, 729, 405, 2352, 101, + /* 1590 */ 1, 2236, 2025, 723, 296, 192, 317, 2069, 329, 2267, + /* 1600 */ 1987, 1235, 2303, 2268, 813, 110, 2269, 727, 2271, 2272, + /* 1610 */ 722, 810, 717, 159, 815, 338, 724, 710, 331, 2356, + /* 1620 */ 1621, 353, 1616, 405, 2352, 333, 2228, 53, 352, 2227, + /* 1630 */ 2267, 2226, 79, 2303, 365, 342, 111, 2269, 727, 2271, + /* 1640 */ 2272, 722, 2221, 717, 2286, 427, 1597, 366, 428, 1598, + /* 1650 */ 2356, 195, 1624, 1626, 2355, 2352, 2236, 2219, 723, 432, + /* 1660 */ 434, 435, 436, 2218, 1596, 715, 1680, 1681, 1683, 1684, + /* 1670 */ 1685, 1686, 374, 2216, 441, 2215, 443, 2268, 2214, 1586, + /* 1680 */ 445, 2195, 199, 2194, 201, 1554, 80, 1553, 2176, 2175, + /* 1690 */ 724, 2174, 457, 2173, 458, 2267, 2172, 2123, 2303, 462, + /* 1700 */ 2268, 111, 2269, 727, 2271, 2272, 722, 1497, 717, 2117, + /* 1710 */ 466, 465, 2114, 724, 204, 2356, 83, 2112, 2286, 712, + /* 1720 */ 2352, 2113, 2111, 2116, 2115, 207, 2110, 2109, 2107, 2106, + /* 1730 */ 2236, 209, 723, 2105, 482, 2104, 484, 2120, 2103, 2102, + /* 1740 */ 2101, 2286, 2100, 2099, 2098, 2097, 2096, 2095, 2094, 2093, + /* 1750 */ 2092, 2091, 2090, 2236, 2089, 723, 211, 2088, 88, 2087, + /* 1760 */ 2086, 2085, 2119, 2084, 2083, 215, 2081, 514, 2268, 725, + /* 1770 */ 2082, 2080, 2303, 516, 2079, 111, 2269, 727, 2271, 2272, + /* 1780 */ 722, 724, 717, 2268, 2078, 1927, 362, 1503, 1926, 2356, + /* 1790 */ 1367, 1371, 2267, 368, 2352, 2303, 724, 1925, 171, 2269, + /* 1800 */ 727, 2271, 2272, 722, 1363, 717, 363, 1923, 1920, 2286, + /* 1810 */ 532, 1919, 1912, 536, 534, 1901, 540, 218, 544, 220, + /* 1820 */ 1877, 2236, 221, 723, 2286, 538, 533, 223, 241, 537, + /* 1830 */ 1258, 541, 542, 77, 183, 2256, 2236, 1876, 723, 2193, + /* 1840 */ 650, 2397, 225, 2183, 174, 184, 78, 552, 2171, 2268, + /* 1850 */ 2170, 231, 584, 580, 576, 572, 233, 240, 2147, 236, + /* 1860 */ 2267, 2003, 724, 2303, 1922, 1918, 172, 2269, 727, 2271, + /* 1870 */ 2272, 722, 569, 717, 1303, 2267, 570, 1916, 2303, 573, + /* 1880 */ 571, 111, 2269, 727, 2271, 2272, 722, 574, 717, 575, + /* 1890 */ 2286, 1914, 577, 579, 1911, 2356, 578, 581, 92, 583, + /* 1900 */ 2353, 238, 2236, 582, 723, 1896, 1894, 1895, 1893, 1873, + /* 1910 */ 2005, 1440, 242, 2004, 2268, 1439, 64, 1354, 1353, 676, + /* 1920 */ 2453, 1351, 1349, 1348, 1347, 1346, 1345, 724, 782, 2268, + /* 1930 */ 784, 1909, 1900, 1342, 1340, 1341, 1339, 1898, 386, 387, + /* 1940 */ 388, 2267, 724, 613, 2303, 1872, 1871, 171, 2269, 727, + /* 1950 */ 2271, 2272, 722, 1870, 717, 2286, 616, 620, 1869, 622, + /* 1960 */ 393, 1868, 624, 113, 1580, 1582, 1579, 2236, 29, 723, + /* 1970 */ 2286, 237, 230, 1584, 2192, 394, 68, 1562, 235, 561, + /* 1980 */ 1564, 57, 2236, 2182, 723, 2268, 1560, 639, 165, 640, + /* 1990 */ 2398, 2169, 2168, 267, 1539, 1538, 2437, 228, 724, 20, + /* 2000 */ 645, 6, 17, 281, 647, 21, 2267, 31, 273, 2303, + /* 2010 */ 1803, 275, 351, 2269, 727, 2271, 2272, 722, 655, 717, + /* 2020 */ 7, 2267, 22, 657, 2303, 2257, 2286, 351, 2269, 727, + /* 2030 */ 2271, 2272, 722, 1784, 717, 280, 173, 33, 2236, 279, + /* 2040 */ 723, 32, 66, 1776, 96, 24, 1823, 1818, 2268, 1824, + /* 2050 */ 1817, 397, 1822, 1821, 398, 293, 59, 23, 58, 1747, + /* 2060 */ 178, 724, 18, 2268, 1746, 2167, 2146, 98, 97, 25, + /* 2070 */ 2145, 300, 698, 99, 1782, 302, 724, 2267, 2268, 307, + /* 2080 */ 2303, 69, 312, 344, 2269, 727, 2271, 2272, 722, 2286, + /* 2090 */ 717, 721, 104, 100, 26, 13, 11, 1622, 1699, 1698, + /* 2100 */ 1709, 2236, 309, 723, 2286, 2306, 180, 1677, 1675, 400, + /* 2110 */ 1674, 716, 193, 39, 16, 27, 2236, 1654, 723, 2286, + /* 2120 */ 730, 411, 734, 737, 740, 1646, 28, 732, 671, 1425, + /* 2130 */ 726, 2236, 735, 723, 1422, 728, 1421, 1418, 738, 743, + /* 2140 */ 2267, 2268, 741, 2303, 1412, 1410, 172, 2269, 727, 2271, + /* 2150 */ 2272, 722, 744, 717, 724, 2267, 746, 747, 2303, 105, + /* 2160 */ 315, 351, 2269, 727, 2271, 2272, 722, 1416, 717, 1415, + /* 2170 */ 2267, 2268, 1414, 2303, 1413, 106, 350, 2269, 727, 2271, + /* 2180 */ 2272, 722, 2286, 717, 724, 2322, 1434, 408, 76, 1430, + /* 2190 */ 1336, 1301, 761, 1333, 2236, 1332, 723, 1331, 635, 1330, + /* 2200 */ 2454, 1328, 1326, 1325, 772, 1324, 1361, 316, 1322, 1321, + /* 2210 */ 1320, 1319, 2286, 1318, 1317, 1316, 819, 410, 1358, 1356, + /* 2220 */ 1313, 1312, 1307, 1309, 2236, 1308, 723, 1306, 1917, 792, + /* 2230 */ 793, 1915, 321, 2267, 1913, 794, 2303, 798, 796, 351, + /* 2240 */ 2269, 727, 2271, 2272, 722, 797, 717, 800, 181, 801, + /* 2250 */ 802, 1910, 804, 805, 806, 1892, 807, 803, 799, 795, + /* 2260 */ 808, 318, 2268, 2267, 1248, 1867, 2303, 1236, 812, 351, + /* 2270 */ 2269, 727, 2271, 2272, 722, 724, 717, 818, 320, 814, + /* 2280 */ 1837, 1608, 330, 817, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2290 */ 1837, 1837, 1837, 1837, 1837, 2268, 1837, 1837, 1837, 1837, + /* 2300 */ 1837, 1837, 109, 2286, 1837, 311, 1837, 1837, 724, 1837, + /* 2310 */ 1837, 1837, 1837, 1837, 1837, 2236, 1837, 723, 2268, 1837, + /* 2320 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2330 */ 1837, 724, 1837, 2268, 1837, 1837, 2286, 703, 1837, 1837, + /* 2340 */ 1837, 1837, 1837, 1837, 1837, 1837, 724, 1837, 2236, 1837, + /* 2350 */ 723, 1837, 1837, 1837, 630, 1837, 1837, 2303, 1837, 2286, + /* 2360 */ 346, 2269, 727, 2271, 2272, 722, 1837, 717, 1837, 1837, + /* 2370 */ 1837, 2236, 1837, 723, 2286, 299, 1837, 1837, 1837, 1837, + /* 2380 */ 1837, 1837, 298, 1837, 1837, 1837, 2236, 2267, 723, 1837, + /* 2390 */ 2303, 1837, 1837, 336, 2269, 727, 2271, 2272, 722, 1837, + /* 2400 */ 717, 263, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2268, + /* 2410 */ 2267, 1837, 1837, 2303, 1837, 1837, 334, 2269, 727, 2271, + /* 2420 */ 2272, 722, 724, 717, 2268, 2267, 1837, 1837, 2303, 1837, + /* 2430 */ 1837, 337, 2269, 727, 2271, 2272, 722, 724, 717, 2268, + /* 2440 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2450 */ 2286, 1837, 724, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2460 */ 1837, 1837, 2236, 1837, 723, 2286, 1837, 1837, 1837, 1837, + /* 2470 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2236, 1837, 723, + /* 2480 */ 2286, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2490 */ 1837, 1837, 2236, 1837, 723, 1837, 1837, 1837, 1837, 1837, + /* 2500 */ 1837, 2267, 2268, 1837, 2303, 1837, 1837, 343, 2269, 727, + /* 2510 */ 2271, 2272, 722, 1837, 717, 724, 2267, 1837, 1837, 2303, + /* 2520 */ 1837, 1837, 347, 2269, 727, 2271, 2272, 722, 1837, 717, + /* 2530 */ 1837, 2267, 2268, 1837, 2303, 1837, 1837, 339, 2269, 727, + /* 2540 */ 2271, 2272, 722, 2286, 717, 724, 1837, 1837, 1837, 1837, + /* 2550 */ 1837, 1837, 1837, 1837, 1837, 2236, 1837, 723, 1837, 1837, + /* 2560 */ 1837, 1837, 1837, 1837, 1837, 2268, 1837, 1837, 1837, 1837, + /* 2570 */ 1837, 1837, 1837, 2286, 1837, 1837, 1837, 1837, 724, 1837, + /* 2580 */ 1837, 1837, 1837, 1837, 1837, 2236, 1837, 723, 1837, 1837, + /* 2590 */ 1837, 1837, 1837, 1837, 2267, 1837, 1837, 2303, 1837, 1837, + /* 2600 */ 348, 2269, 727, 2271, 2272, 722, 2286, 717, 1837, 1837, + /* 2610 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2236, 1837, + /* 2620 */ 723, 1837, 1837, 1837, 2267, 1837, 1837, 2303, 1837, 1837, + /* 2630 */ 340, 2269, 727, 2271, 2272, 722, 1837, 717, 1837, 1837, + /* 2640 */ 1837, 1837, 1837, 2268, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2650 */ 1837, 1837, 1837, 1837, 1837, 1837, 724, 2267, 1837, 1837, + /* 2660 */ 2303, 1837, 1837, 349, 2269, 727, 2271, 2272, 722, 1837, + /* 2670 */ 717, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2268, + /* 2680 */ 1837, 1837, 1837, 1837, 2286, 1837, 1837, 1837, 1837, 1837, + /* 2690 */ 1837, 1837, 724, 1837, 1837, 1837, 2236, 1837, 723, 1837, + /* 2700 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2268, 1837, + /* 2710 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2720 */ 2286, 724, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2730 */ 1837, 1837, 2236, 1837, 723, 2267, 1837, 1837, 2303, 1837, + /* 2740 */ 1837, 341, 2269, 727, 2271, 2272, 722, 1837, 717, 2286, + /* 2750 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2760 */ 1837, 2236, 1837, 723, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2770 */ 1837, 2267, 1837, 2268, 2303, 1837, 1837, 355, 2269, 727, + /* 2780 */ 2271, 2272, 722, 1837, 717, 1837, 724, 1837, 1837, 1837, + /* 2790 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2800 */ 2267, 1837, 1837, 2303, 1837, 1837, 356, 2269, 727, 2271, + /* 2810 */ 2272, 722, 1837, 717, 2286, 1837, 1837, 1837, 1837, 1837, + /* 2820 */ 1837, 1837, 1837, 1837, 1837, 1837, 2236, 1837, 723, 1837, + /* 2830 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2840 */ 2268, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2850 */ 1837, 1837, 1837, 724, 1837, 1837, 2268, 1837, 1837, 1837, + /* 2860 */ 1837, 1837, 1837, 1837, 1837, 2267, 1837, 1837, 2303, 724, + /* 2870 */ 1837, 2280, 2269, 727, 2271, 2272, 722, 1837, 717, 1837, + /* 2880 */ 1837, 2286, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2890 */ 1837, 1837, 1837, 2236, 1837, 723, 1837, 2286, 1837, 1837, + /* 2900 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2236, + /* 2910 */ 1837, 723, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2920 */ 1837, 2268, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2930 */ 1837, 1837, 2267, 1837, 724, 2303, 1837, 1837, 2279, 2269, + /* 2940 */ 727, 2271, 2272, 722, 1837, 717, 1837, 1837, 2267, 1837, + /* 2950 */ 2268, 2303, 1837, 1837, 2278, 2269, 727, 2271, 2272, 722, + /* 2960 */ 1837, 717, 2286, 724, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2970 */ 1837, 1837, 1837, 1837, 2236, 1837, 723, 1837, 1837, 1837, + /* 2980 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 2990 */ 1837, 2286, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3000 */ 1837, 1837, 1837, 2236, 1837, 723, 1837, 1837, 1837, 1837, + /* 3010 */ 1837, 1837, 1837, 2267, 1837, 2268, 2303, 1837, 1837, 370, + /* 3020 */ 2269, 727, 2271, 2272, 722, 1837, 717, 1837, 724, 1837, + /* 3030 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3040 */ 1837, 1837, 2267, 1837, 2268, 2303, 1837, 1837, 371, 2269, + /* 3050 */ 727, 2271, 2272, 722, 1837, 717, 2286, 724, 1837, 1837, + /* 3060 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2236, 1837, + /* 3070 */ 723, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3080 */ 2268, 1837, 1837, 1837, 1837, 2286, 1837, 1837, 1837, 1837, + /* 3090 */ 1837, 1837, 1837, 724, 1837, 1837, 1837, 2236, 1837, 723, + /* 3100 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 2267, 1837, 2268, + /* 3110 */ 2303, 1837, 1837, 367, 2269, 727, 2271, 2272, 722, 1837, + /* 3120 */ 717, 2286, 724, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3130 */ 1837, 1837, 1837, 2236, 1837, 723, 2267, 1837, 1837, 2303, + /* 3140 */ 1837, 1837, 372, 2269, 727, 2271, 2272, 722, 1837, 717, + /* 3150 */ 2286, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3160 */ 1837, 1837, 2236, 1837, 723, 1837, 1837, 1837, 1837, 1837, + /* 3170 */ 1837, 1837, 725, 1837, 1837, 2303, 1837, 1837, 346, 2269, + /* 3180 */ 727, 2271, 2272, 722, 1837, 717, 1837, 1837, 1837, 1837, + /* 3190 */ 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, 1837, + /* 3200 */ 1837, 2267, 1837, 1837, 2303, 1837, 1837, 345, 2269, 727, + /* 3210 */ 2271, 2272, 722, 1837, 717, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 470, 423, 369, 473, 359, 354, 428, 387, 357, 358, - /* 10 */ 377, 4, 12, 13, 14, 402, 389, 359, 360, 399, - /* 20 */ 20, 491, 22, 8, 9, 495, 496, 12, 13, 14, - /* 30 */ 15, 16, 20, 420, 421, 35, 0, 37, 8, 9, - /* 40 */ 459, 460, 12, 13, 14, 15, 16, 347, 470, 404, - /* 50 */ 405, 473, 407, 46, 47, 48, 411, 359, 360, 470, - /* 60 */ 360, 368, 473, 33, 64, 0, 408, 0, 490, 491, - /* 70 */ 70, 20, 354, 495, 496, 357, 358, 77, 385, 490, - /* 80 */ 491, 20, 12, 13, 495, 496, 21, 394, 388, 24, - /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 20, 0, - /* 100 */ 400, 398, 402, 103, 401, 402, 106, 37, 72, 73, + /* 0 */ 380, 359, 360, 380, 471, 0, 471, 474, 388, 474, + /* 10 */ 384, 388, 12, 13, 14, 359, 396, 360, 395, 396, + /* 20 */ 20, 379, 22, 0, 491, 492, 403, 492, 386, 496, + /* 30 */ 497, 496, 497, 12, 13, 35, 0, 37, 12, 13, + /* 40 */ 14, 15, 16, 4, 21, 388, 347, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 359, 360, 37, 360, + /* 60 */ 404, 405, 436, 407, 64, 0, 20, 411, 354, 20, + /* 70 */ 70, 357, 358, 344, 376, 21, 444, 77, 24, 25, + /* 80 */ 26, 27, 28, 29, 30, 31, 32, 388, 390, 24, + /* 90 */ 25, 26, 27, 28, 29, 30, 31, 32, 400, 400, + /* 100 */ 20, 402, 470, 103, 447, 20, 106, 14, 72, 73, /* 110 */ 74, 75, 76, 20, 78, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 69, 107, 20, 439, - /* 140 */ 22, 441, 142, 143, 444, 445, 446, 447, 448, 449, - /* 150 */ 51, 451, 359, 360, 20, 37, 456, 106, 458, 20, - /* 160 */ 359, 360, 462, 463, 466, 467, 468, 106, 470, 471, - /* 170 */ 380, 473, 379, 55, 174, 175, 388, 477, 388, 386, - /* 180 */ 379, 181, 182, 395, 380, 485, 396, 386, 490, 491, - /* 190 */ 376, 403, 388, 495, 496, 346, 196, 348, 198, 395, - /* 200 */ 396, 359, 360, 188, 390, 8, 9, 403, 136, 12, - /* 210 */ 13, 14, 15, 16, 400, 21, 347, 69, 24, 25, - /* 220 */ 26, 27, 28, 29, 30, 31, 32, 347, 228, 229, - /* 230 */ 180, 231, 232, 233, 234, 235, 236, 237, 238, 239, + /* 130 */ 94, 95, 96, 97, 98, 99, 20, 388, 439, 50, + /* 140 */ 442, 442, 142, 143, 445, 446, 447, 448, 449, 450, + /* 150 */ 452, 452, 423, 359, 360, 106, 457, 428, 459, 410, + /* 160 */ 3, 412, 463, 464, 467, 468, 469, 106, 471, 472, + /* 170 */ 20, 474, 402, 379, 174, 175, 471, 478, 20, 474, + /* 180 */ 386, 181, 182, 387, 4, 486, 14, 417, 491, 492, + /* 190 */ 420, 421, 20, 496, 497, 399, 196, 492, 198, 21, + /* 200 */ 471, 496, 497, 474, 354, 8, 9, 357, 358, 12, + /* 210 */ 13, 14, 15, 16, 36, 20, 38, 39, 40, 198, + /* 220 */ 491, 492, 142, 143, 14, 496, 497, 222, 228, 229, + /* 230 */ 20, 231, 232, 233, 234, 235, 236, 237, 238, 239, /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 12, - /* 250 */ 13, 106, 174, 175, 18, 441, 20, 20, 470, 22, - /* 260 */ 20, 473, 347, 27, 388, 451, 30, 70, 198, 400, - /* 270 */ 22, 35, 35, 20, 37, 360, 142, 143, 490, 491, - /* 280 */ 400, 209, 210, 495, 496, 37, 410, 51, 412, 53, - /* 290 */ 401, 402, 8, 9, 58, 50, 12, 13, 14, 15, - /* 300 */ 16, 64, 347, 388, 20, 106, 291, 70, 466, 467, - /* 310 */ 468, 114, 470, 471, 77, 400, 265, 402, 72, 73, - /* 320 */ 74, 271, 272, 273, 355, 79, 80, 81, 359, 402, - /* 330 */ 361, 85, 470, 116, 22, 473, 90, 91, 92, 93, - /* 340 */ 103, 105, 96, 106, 417, 99, 106, 420, 421, 37, - /* 350 */ 384, 103, 116, 491, 439, 400, 441, 495, 496, 444, - /* 360 */ 445, 446, 447, 448, 449, 249, 451, 251, 380, 454, - /* 370 */ 173, 456, 457, 458, 228, 359, 388, 462, 463, 142, - /* 380 */ 143, 360, 146, 147, 396, 149, 150, 151, 152, 153, + /* 250 */ 13, 402, 369, 20, 18, 347, 20, 20, 3, 22, + /* 260 */ 377, 181, 182, 27, 106, 176, 30, 70, 360, 420, + /* 270 */ 421, 35, 35, 184, 37, 20, 8, 9, 388, 388, + /* 280 */ 12, 13, 14, 15, 16, 395, 106, 51, 20, 53, + /* 290 */ 174, 175, 4, 403, 58, 398, 388, 388, 401, 402, + /* 300 */ 423, 64, 103, 412, 395, 428, 267, 70, 400, 355, + /* 310 */ 402, 114, 403, 359, 77, 361, 117, 118, 119, 120, + /* 320 */ 121, 122, 123, 124, 125, 126, 265, 128, 129, 130, + /* 330 */ 131, 132, 133, 134, 46, 47, 48, 142, 143, 106, + /* 340 */ 103, 105, 20, 106, 22, 0, 174, 439, 471, 347, + /* 350 */ 442, 474, 116, 445, 446, 447, 448, 449, 450, 37, + /* 360 */ 452, 69, 107, 455, 347, 457, 458, 459, 491, 492, + /* 370 */ 173, 463, 464, 496, 497, 359, 360, 55, 33, 142, + /* 380 */ 143, 106, 146, 147, 174, 149, 150, 151, 152, 153, /* 390 */ 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - /* 400 */ 164, 165, 436, 167, 168, 169, 69, 171, 172, 388, - /* 410 */ 265, 174, 175, 177, 0, 103, 359, 360, 181, 182, - /* 420 */ 106, 176, 276, 277, 278, 279, 280, 281, 282, 184, - /* 430 */ 3, 415, 416, 196, 0, 198, 379, 388, 24, 25, - /* 440 */ 26, 27, 28, 29, 30, 31, 32, 20, 64, 252, + /* 400 */ 164, 165, 400, 167, 168, 169, 444, 171, 172, 180, + /* 410 */ 355, 174, 175, 177, 359, 22, 361, 400, 181, 182, + /* 420 */ 136, 8, 9, 265, 408, 12, 13, 14, 15, 16, + /* 430 */ 37, 176, 470, 196, 0, 198, 135, 136, 137, 138, + /* 440 */ 139, 140, 141, 286, 176, 265, 33, 359, 360, 252, /* 450 */ 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - /* 460 */ 176, 412, 359, 360, 265, 228, 229, 446, 231, 232, + /* 460 */ 346, 359, 348, 359, 360, 228, 229, 379, 231, 232, /* 470 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - /* 480 */ 243, 244, 245, 246, 247, 248, 249, 12, 13, 105, - /* 490 */ 355, 347, 108, 366, 359, 20, 361, 22, 12, 13, - /* 500 */ 14, 15, 16, 347, 360, 265, 72, 73, 74, 195, - /* 510 */ 35, 197, 37, 79, 80, 81, 359, 360, 391, 85, - /* 520 */ 359, 360, 347, 191, 90, 91, 92, 93, 359, 360, - /* 530 */ 96, 347, 388, 99, 107, 360, 379, 362, 20, 64, - /* 540 */ 379, 227, 136, 137, 400, 70, 402, 141, 379, 4, - /* 550 */ 218, 219, 77, 135, 8, 9, 400, 139, 12, 13, - /* 560 */ 14, 15, 16, 388, 359, 360, 359, 360, 465, 466, - /* 570 */ 467, 468, 137, 470, 471, 400, 141, 402, 103, 265, - /* 580 */ 455, 106, 457, 439, 400, 441, 347, 33, 444, 445, - /* 590 */ 446, 447, 448, 449, 249, 451, 56, 57, 2, 360, - /* 600 */ 456, 362, 458, 176, 8, 9, 462, 463, 12, 13, - /* 610 */ 14, 15, 16, 408, 439, 408, 441, 142, 143, 444, - /* 620 */ 445, 446, 447, 448, 449, 77, 451, 388, 347, 485, - /* 630 */ 366, 456, 116, 458, 359, 360, 14, 462, 463, 400, - /* 640 */ 205, 402, 20, 208, 359, 360, 211, 383, 213, 174, - /* 650 */ 175, 106, 344, 107, 379, 391, 181, 182, 8, 9, - /* 660 */ 388, 107, 12, 13, 14, 15, 16, 395, 14, 15, - /* 670 */ 16, 196, 77, 198, 21, 403, 359, 360, 439, 20, - /* 680 */ 441, 400, 173, 444, 445, 446, 447, 448, 449, 36, - /* 690 */ 451, 38, 39, 40, 176, 456, 379, 458, 20, 14, - /* 700 */ 22, 462, 463, 228, 229, 20, 231, 232, 233, 234, + /* 480 */ 243, 244, 245, 246, 247, 248, 249, 12, 13, 359, + /* 490 */ 360, 347, 20, 209, 210, 20, 103, 22, 265, 135, + /* 500 */ 271, 272, 273, 139, 360, 20, 72, 73, 74, 379, + /* 510 */ 35, 347, 37, 79, 80, 81, 388, 415, 416, 85, + /* 520 */ 107, 368, 20, 395, 90, 91, 92, 93, 1, 2, + /* 530 */ 96, 403, 388, 99, 359, 360, 359, 360, 385, 64, + /* 540 */ 265, 72, 73, 74, 400, 70, 402, 394, 79, 80, + /* 550 */ 81, 249, 77, 251, 85, 388, 379, 359, 360, 90, + /* 560 */ 91, 92, 93, 396, 400, 96, 359, 360, 99, 69, + /* 570 */ 466, 467, 468, 469, 116, 471, 472, 379, 103, 460, + /* 580 */ 461, 106, 347, 439, 137, 22, 442, 249, 141, 445, + /* 590 */ 446, 447, 448, 449, 450, 360, 452, 362, 14, 471, + /* 600 */ 37, 457, 474, 459, 20, 8, 9, 463, 464, 12, + /* 610 */ 13, 14, 15, 16, 366, 408, 0, 142, 143, 491, + /* 620 */ 492, 359, 360, 388, 496, 497, 347, 423, 359, 360, + /* 630 */ 486, 383, 0, 347, 107, 400, 347, 402, 388, 391, + /* 640 */ 77, 379, 467, 468, 469, 395, 471, 472, 379, 174, + /* 650 */ 175, 51, 205, 403, 22, 208, 181, 182, 211, 59, + /* 660 */ 213, 176, 62, 63, 39, 40, 103, 0, 359, 360, + /* 670 */ 20, 196, 22, 198, 439, 471, 174, 442, 474, 400, + /* 680 */ 445, 446, 447, 448, 449, 450, 400, 452, 379, 400, + /* 690 */ 359, 360, 457, 37, 459, 491, 492, 77, 463, 464, + /* 700 */ 496, 497, 228, 228, 229, 55, 231, 232, 233, 234, /* 710 */ 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - /* 720 */ 245, 246, 247, 248, 12, 13, 14, 347, 388, 20, - /* 730 */ 388, 423, 20, 55, 22, 395, 428, 395, 35, 34, - /* 740 */ 360, 0, 362, 403, 347, 403, 455, 35, 457, 37, - /* 750 */ 380, 466, 467, 468, 51, 470, 471, 107, 388, 347, - /* 760 */ 0, 252, 59, 60, 61, 62, 396, 64, 388, 376, - /* 770 */ 13, 262, 360, 14, 362, 388, 64, 0, 470, 20, - /* 780 */ 400, 473, 402, 390, 51, 359, 360, 359, 360, 77, - /* 790 */ 403, 22, 59, 400, 37, 62, 63, 400, 490, 491, - /* 800 */ 388, 142, 143, 495, 496, 379, 37, 379, 105, 37, - /* 810 */ 265, 108, 400, 347, 402, 103, 347, 14, 106, 439, - /* 820 */ 4, 441, 37, 20, 444, 445, 446, 447, 448, 449, - /* 830 */ 388, 451, 359, 360, 441, 442, 456, 395, 458, 347, - /* 840 */ 181, 182, 462, 463, 451, 403, 77, 359, 360, 77, - /* 850 */ 347, 439, 379, 441, 142, 143, 444, 445, 446, 447, - /* 860 */ 448, 449, 77, 451, 359, 360, 400, 379, 456, 400, - /* 870 */ 458, 347, 103, 20, 462, 463, 1, 2, 347, 347, - /* 880 */ 443, 178, 179, 443, 379, 176, 174, 175, 185, 186, - /* 890 */ 364, 365, 400, 181, 182, 135, 136, 137, 138, 139, - /* 900 */ 140, 141, 161, 400, 443, 33, 469, 204, 196, 469, - /* 910 */ 198, 170, 135, 136, 137, 138, 139, 140, 141, 359, - /* 920 */ 360, 8, 9, 347, 400, 12, 13, 14, 15, 16, - /* 930 */ 469, 400, 400, 174, 364, 365, 360, 3, 362, 379, - /* 940 */ 228, 229, 368, 231, 232, 233, 234, 235, 236, 237, + /* 720 */ 245, 246, 247, 248, 12, 13, 14, 347, 359, 360, + /* 730 */ 388, 388, 20, 77, 22, 110, 111, 395, 113, 408, + /* 740 */ 360, 0, 362, 359, 360, 403, 403, 35, 379, 37, + /* 750 */ 276, 277, 278, 279, 280, 281, 282, 359, 360, 196, + /* 760 */ 135, 198, 116, 379, 139, 8, 9, 444, 388, 12, + /* 770 */ 13, 14, 15, 16, 359, 360, 64, 161, 359, 360, + /* 780 */ 400, 22, 402, 136, 137, 188, 170, 347, 141, 77, + /* 790 */ 77, 228, 229, 470, 379, 368, 37, 347, 379, 14, + /* 800 */ 15, 16, 135, 136, 137, 138, 139, 140, 141, 366, + /* 810 */ 360, 456, 362, 458, 106, 103, 359, 360, 106, 439, + /* 820 */ 347, 394, 442, 401, 402, 445, 446, 447, 448, 449, + /* 830 */ 450, 191, 452, 360, 391, 362, 379, 457, 388, 459, + /* 840 */ 400, 8, 9, 463, 464, 12, 13, 14, 15, 16, + /* 850 */ 400, 456, 402, 458, 142, 143, 56, 57, 218, 219, + /* 860 */ 0, 388, 103, 347, 107, 467, 468, 469, 389, 471, + /* 870 */ 472, 364, 365, 400, 34, 402, 135, 136, 137, 138, + /* 880 */ 139, 140, 141, 64, 359, 360, 174, 175, 291, 439, + /* 890 */ 364, 365, 442, 181, 182, 445, 446, 447, 448, 449, + /* 900 */ 450, 389, 452, 195, 379, 197, 20, 457, 196, 459, + /* 910 */ 198, 0, 439, 463, 464, 442, 400, 389, 445, 446, + /* 920 */ 447, 448, 449, 450, 105, 452, 380, 108, 347, 69, + /* 930 */ 457, 423, 459, 22, 388, 227, 463, 464, 347, 86, + /* 940 */ 228, 229, 396, 231, 232, 233, 234, 235, 236, 237, /* 950 */ 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - /* 960 */ 248, 12, 13, 347, 388, 196, 376, 198, 394, 20, - /* 970 */ 388, 22, 373, 374, 20, 347, 400, 174, 402, 107, - /* 980 */ 390, 2, 107, 86, 35, 403, 37, 8, 9, 347, - /* 990 */ 400, 12, 13, 14, 15, 16, 347, 228, 229, 359, - /* 1000 */ 360, 389, 8, 9, 347, 347, 12, 13, 14, 15, - /* 1010 */ 16, 373, 374, 64, 423, 439, 400, 441, 360, 379, - /* 1020 */ 444, 445, 446, 447, 448, 449, 77, 451, 400, 176, - /* 1030 */ 375, 441, 456, 378, 458, 347, 359, 360, 462, 463, - /* 1040 */ 389, 451, 400, 359, 360, 148, 388, 33, 360, 400, - /* 1050 */ 362, 388, 103, 359, 360, 106, 379, 400, 400, 454, - /* 1060 */ 402, 470, 457, 379, 473, 4, 403, 170, 116, 359, - /* 1070 */ 360, 388, 397, 379, 381, 400, 388, 384, 389, 396, - /* 1080 */ 19, 490, 491, 267, 350, 351, 495, 496, 400, 379, - /* 1090 */ 402, 142, 143, 47, 48, 397, 35, 439, 400, 441, - /* 1100 */ 263, 264, 444, 445, 446, 447, 448, 449, 397, 451, - /* 1110 */ 42, 400, 51, 0, 456, 0, 458, 13, 166, 58, - /* 1120 */ 462, 463, 0, 174, 175, 64, 33, 439, 174, 441, - /* 1130 */ 181, 182, 444, 445, 446, 447, 448, 449, 45, 451, - /* 1140 */ 109, 37, 33, 112, 456, 196, 458, 198, 33, 109, - /* 1150 */ 462, 463, 112, 135, 136, 137, 138, 139, 140, 141, - /* 1160 */ 347, 64, 109, 389, 42, 112, 105, 33, 109, 108, - /* 1170 */ 176, 112, 70, 360, 39, 40, 37, 228, 229, 45, + /* 960 */ 248, 12, 13, 376, 389, 347, 347, 373, 374, 20, + /* 970 */ 388, 22, 389, 265, 373, 374, 20, 390, 360, 471, + /* 980 */ 362, 400, 474, 4, 35, 403, 37, 400, 42, 8, + /* 990 */ 9, 400, 347, 12, 13, 14, 15, 16, 19, 491, + /* 1000 */ 492, 148, 359, 360, 496, 497, 388, 173, 455, 176, + /* 1010 */ 33, 458, 397, 64, 35, 400, 359, 360, 400, 400, + /* 1020 */ 402, 2, 379, 170, 359, 360, 77, 8, 9, 442, + /* 1030 */ 51, 12, 13, 14, 15, 16, 379, 58, 380, 452, + /* 1040 */ 347, 359, 360, 64, 379, 400, 388, 423, 397, 389, + /* 1050 */ 347, 400, 103, 389, 396, 106, 347, 439, 33, 376, + /* 1060 */ 442, 379, 176, 445, 446, 447, 448, 449, 450, 360, + /* 1070 */ 452, 362, 70, 390, 347, 457, 347, 459, 350, 351, + /* 1080 */ 348, 463, 464, 400, 105, 0, 252, 108, 107, 347, + /* 1090 */ 347, 142, 143, 400, 2, 471, 262, 388, 474, 347, + /* 1100 */ 8, 9, 423, 400, 12, 13, 14, 15, 16, 400, + /* 1110 */ 212, 402, 214, 388, 397, 491, 492, 400, 429, 381, + /* 1120 */ 496, 497, 384, 174, 175, 442, 443, 400, 403, 400, + /* 1130 */ 181, 182, 176, 8, 9, 452, 51, 12, 13, 14, + /* 1140 */ 15, 16, 400, 400, 33, 196, 375, 198, 439, 378, + /* 1150 */ 471, 442, 400, 474, 445, 446, 447, 448, 449, 450, + /* 1160 */ 33, 452, 47, 48, 263, 264, 457, 33, 459, 0, + /* 1170 */ 491, 492, 463, 464, 116, 496, 497, 228, 229, 45, /* 1180 */ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, /* 1190 */ 241, 242, 243, 244, 245, 246, 247, 248, 12, 13, - /* 1200 */ 0, 388, 212, 33, 214, 108, 20, 33, 22, 33, - /* 1210 */ 103, 33, 33, 400, 33, 402, 107, 142, 143, 37, - /* 1220 */ 286, 35, 22, 37, 117, 118, 119, 120, 121, 122, - /* 1230 */ 123, 124, 125, 126, 0, 128, 129, 130, 131, 132, - /* 1240 */ 133, 134, 347, 423, 0, 110, 111, 389, 113, 13, - /* 1250 */ 64, 423, 439, 423, 441, 360, 22, 444, 445, 446, - /* 1260 */ 447, 448, 449, 77, 451, 49, 22, 389, 429, 456, - /* 1270 */ 135, 458, 13, 37, 139, 462, 463, 107, 1, 2, - /* 1280 */ 33, 107, 33, 388, 377, 107, 107, 348, 107, 103, - /* 1290 */ 470, 33, 106, 473, 413, 400, 37, 402, 470, 106, - /* 1300 */ 470, 473, 288, 473, 33, 33, 499, 488, 115, 363, - /* 1310 */ 490, 491, 33, 33, 33, 495, 496, 33, 490, 491, - /* 1320 */ 490, 491, 106, 495, 496, 495, 496, 33, 142, 143, - /* 1330 */ 228, 33, 264, 0, 439, 222, 441, 198, 33, 444, - /* 1340 */ 445, 446, 447, 448, 449, 482, 451, 18, 376, 376, - /* 1350 */ 388, 456, 23, 458, 107, 422, 107, 462, 463, 363, - /* 1360 */ 174, 175, 358, 413, 399, 107, 360, 181, 182, 40, - /* 1370 */ 41, 413, 472, 44, 492, 464, 475, 424, 107, 107, - /* 1380 */ 198, 51, 196, 54, 198, 52, 107, 107, 107, 268, - /* 1390 */ 20, 107, 368, 433, 65, 66, 67, 68, 347, 440, - /* 1400 */ 211, 107, 438, 433, 368, 107, 194, 426, 20, 359, - /* 1410 */ 20, 360, 107, 45, 228, 229, 360, 231, 232, 233, + /* 1200 */ 33, 13, 347, 13, 109, 33, 20, 112, 22, 0, + /* 1210 */ 264, 42, 45, 109, 109, 360, 112, 112, 107, 109, + /* 1220 */ 64, 35, 112, 37, 166, 37, 49, 37, 142, 143, + /* 1230 */ 228, 22, 33, 37, 107, 347, 33, 33, 37, 33, + /* 1240 */ 377, 1, 2, 388, 106, 37, 33, 33, 360, 33, + /* 1250 */ 64, 33, 33, 115, 413, 400, 500, 402, 33, 489, + /* 1260 */ 363, 483, 13, 77, 108, 288, 376, 13, 376, 33, + /* 1270 */ 33, 33, 0, 77, 422, 33, 388, 33, 363, 107, + /* 1280 */ 33, 33, 388, 106, 413, 358, 37, 413, 400, 103, + /* 1290 */ 402, 37, 106, 360, 439, 399, 473, 442, 493, 268, + /* 1300 */ 445, 446, 447, 448, 449, 450, 107, 452, 465, 424, + /* 1310 */ 107, 107, 457, 107, 459, 290, 51, 441, 463, 464, + /* 1320 */ 107, 107, 476, 107, 52, 107, 107, 439, 142, 143, + /* 1330 */ 442, 42, 107, 445, 446, 447, 448, 449, 450, 451, + /* 1340 */ 452, 453, 454, 107, 107, 107, 440, 18, 20, 107, + /* 1350 */ 433, 107, 23, 211, 107, 107, 438, 368, 433, 368, + /* 1360 */ 174, 175, 194, 426, 20, 359, 20, 181, 182, 40, + /* 1370 */ 41, 360, 45, 44, 409, 20, 413, 360, 409, 406, + /* 1380 */ 173, 359, 196, 54, 198, 409, 360, 359, 406, 406, + /* 1390 */ 104, 359, 372, 102, 65, 66, 67, 68, 371, 198, + /* 1400 */ 101, 359, 359, 370, 359, 20, 198, 352, 50, 356, + /* 1410 */ 356, 352, 368, 433, 228, 229, 20, 231, 232, 233, /* 1420 */ 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - /* 1430 */ 244, 245, 246, 247, 248, 106, 12, 13, 409, 388, - /* 1440 */ 20, 413, 360, 409, 406, 359, 22, 173, 360, 359, - /* 1450 */ 409, 400, 104, 402, 406, 406, 372, 102, 371, 35, - /* 1460 */ 359, 37, 101, 20, 370, 359, 290, 359, 352, 359, - /* 1470 */ 356, 347, 50, 144, 356, 352, 433, 20, 402, 368, - /* 1480 */ 368, 20, 20, 425, 360, 368, 361, 361, 64, 20, - /* 1490 */ 439, 359, 441, 416, 352, 444, 445, 446, 447, 448, - /* 1500 */ 449, 77, 451, 350, 368, 368, 368, 388, 368, 458, - /* 1510 */ 359, 350, 388, 462, 463, 388, 388, 188, 189, 190, - /* 1520 */ 352, 388, 193, 215, 400, 106, 402, 103, 437, 388, - /* 1530 */ 400, 388, 388, 388, 388, 206, 207, 388, 388, 366, - /* 1540 */ 435, 202, 201, 366, 347, 200, 217, 400, 400, 220, - /* 1550 */ 359, 431, 223, 224, 225, 226, 227, 360, 402, 400, - /* 1560 */ 275, 430, 433, 439, 481, 441, 274, 400, 444, 445, - /* 1570 */ 446, 447, 448, 449, 283, 451, 413, 413, 424, 481, - /* 1580 */ 347, 187, 458, 418, 432, 388, 462, 463, 400, 418, - /* 1590 */ 400, 285, 269, 360, 265, 284, 292, 400, 289, 402, - /* 1600 */ 500, 287, 264, 360, 424, 20, 116, 361, 266, 400, - /* 1610 */ 418, 366, 418, 400, 366, 400, 179, 400, 443, 400, - /* 1620 */ 196, 388, 198, 400, 414, 384, 366, 366, 360, 106, - /* 1630 */ 106, 392, 400, 400, 378, 402, 439, 479, 441, 484, - /* 1640 */ 483, 444, 445, 446, 447, 448, 449, 481, 451, 480, - /* 1650 */ 478, 22, 228, 229, 494, 458, 461, 38, 474, 462, - /* 1660 */ 463, 476, 359, 366, 349, 241, 242, 243, 244, 245, - /* 1670 */ 246, 247, 439, 353, 441, 382, 493, 444, 445, 446, - /* 1680 */ 447, 448, 449, 450, 451, 452, 453, 347, 352, 427, - /* 1690 */ 0, 434, 419, 367, 419, 382, 345, 0, 382, 0, - /* 1700 */ 360, 45, 0, 37, 221, 347, 37, 37, 37, 221, - /* 1710 */ 0, 37, 37, 221, 0, 221, 0, 37, 360, 37, - /* 1720 */ 22, 347, 0, 0, 216, 0, 204, 0, 388, 204, - /* 1730 */ 198, 205, 196, 0, 360, 0, 0, 192, 191, 0, - /* 1740 */ 400, 0, 402, 147, 49, 49, 388, 0, 37, 0, - /* 1750 */ 49, 51, 0, 45, 0, 0, 0, 0, 400, 0, - /* 1760 */ 402, 49, 388, 0, 0, 0, 0, 161, 37, 0, - /* 1770 */ 161, 0, 0, 0, 400, 0, 402, 0, 0, 439, - /* 1780 */ 0, 441, 0, 347, 444, 445, 446, 447, 448, 449, - /* 1790 */ 0, 451, 0, 0, 0, 0, 360, 439, 0, 441, - /* 1800 */ 0, 0, 444, 445, 446, 447, 448, 449, 0, 451, - /* 1810 */ 49, 0, 45, 439, 147, 441, 0, 0, 444, 445, - /* 1820 */ 446, 447, 448, 449, 388, 451, 486, 487, 0, 0, - /* 1830 */ 0, 22, 458, 0, 0, 146, 400, 463, 402, 0, - /* 1840 */ 0, 0, 22, 22, 0, 347, 50, 50, 145, 37, - /* 1850 */ 64, 0, 64, 0, 0, 497, 498, 0, 360, 37, - /* 1860 */ 347, 51, 0, 64, 37, 42, 51, 42, 0, 37, - /* 1870 */ 51, 0, 37, 360, 0, 439, 45, 441, 42, 14, - /* 1880 */ 444, 445, 446, 447, 448, 449, 388, 451, 42, 33, - /* 1890 */ 0, 393, 49, 43, 49, 0, 49, 42, 400, 0, - /* 1900 */ 402, 388, 0, 42, 187, 0, 393, 49, 0, 0, - /* 1910 */ 0, 0, 37, 400, 51, 402, 0, 37, 42, 71, - /* 1920 */ 51, 42, 0, 487, 37, 42, 0, 42, 347, 51, - /* 1930 */ 37, 0, 51, 0, 0, 0, 0, 439, 0, 441, - /* 1940 */ 114, 360, 444, 445, 446, 447, 448, 449, 0, 451, - /* 1950 */ 112, 37, 439, 33, 441, 37, 37, 444, 445, 446, - /* 1960 */ 447, 448, 449, 22, 451, 37, 37, 37, 22, 388, - /* 1970 */ 0, 22, 0, 22, 37, 0, 37, 33, 53, 37, - /* 1980 */ 37, 400, 37, 402, 37, 22, 0, 37, 0, 0, - /* 1990 */ 347, 37, 0, 37, 0, 22, 20, 37, 37, 37, - /* 2000 */ 106, 347, 0, 360, 107, 203, 106, 22, 37, 0, - /* 2010 */ 0, 0, 199, 22, 360, 3, 33, 50, 176, 106, - /* 2020 */ 439, 270, 441, 102, 107, 444, 445, 446, 447, 448, - /* 2030 */ 449, 388, 451, 106, 50, 176, 104, 33, 33, 179, - /* 2040 */ 176, 33, 388, 400, 49, 402, 176, 393, 49, 183, - /* 2050 */ 183, 33, 3, 270, 400, 33, 402, 270, 37, 107, - /* 2060 */ 107, 106, 37, 106, 106, 37, 347, 37, 37, 37, - /* 2070 */ 489, 107, 106, 49, 33, 107, 107, 0, 49, 360, - /* 2080 */ 0, 107, 439, 106, 441, 107, 42, 444, 445, 446, - /* 2090 */ 447, 448, 449, 439, 451, 441, 1, 107, 444, 445, - /* 2100 */ 446, 447, 448, 449, 106, 451, 106, 388, 107, 106, - /* 2110 */ 0, 42, 263, 106, 19, 49, 33, 2, 22, 400, - /* 2120 */ 106, 402, 250, 104, 104, 49, 228, 49, 115, 22, - /* 2130 */ 35, 230, 347, 106, 37, 37, 37, 37, 37, 37, - /* 2140 */ 107, 498, 106, 178, 107, 360, 51, 107, 106, 106, - /* 2150 */ 116, 106, 33, 107, 59, 60, 61, 62, 439, 64, - /* 2160 */ 441, 347, 180, 444, 445, 446, 447, 448, 449, 106, - /* 2170 */ 451, 107, 453, 388, 360, 107, 106, 106, 393, 107, - /* 2180 */ 106, 37, 107, 127, 347, 400, 107, 402, 106, 127, - /* 2190 */ 106, 37, 127, 107, 106, 106, 106, 360, 106, 22, - /* 2200 */ 105, 71, 388, 108, 70, 37, 37, 393, 127, 37, - /* 2210 */ 37, 37, 77, 37, 400, 37, 402, 37, 37, 33, - /* 2220 */ 100, 37, 37, 22, 439, 388, 441, 37, 37, 444, - /* 2230 */ 445, 446, 447, 448, 449, 140, 451, 400, 77, 402, - /* 2240 */ 37, 37, 37, 37, 37, 22, 37, 37, 37, 0, - /* 2250 */ 37, 51, 0, 439, 347, 441, 42, 37, 444, 445, - /* 2260 */ 446, 447, 448, 449, 42, 451, 51, 360, 0, 37, - /* 2270 */ 51, 42, 0, 178, 37, 51, 439, 42, 441, 0, - /* 2280 */ 185, 444, 445, 446, 447, 448, 449, 347, 451, 0, - /* 2290 */ 37, 37, 22, 33, 21, 388, 22, 22, 22, 204, - /* 2300 */ 360, 21, 20, 501, 501, 501, 347, 400, 501, 402, - /* 2310 */ 501, 501, 501, 501, 501, 501, 501, 501, 501, 360, - /* 2320 */ 501, 501, 501, 501, 501, 501, 501, 501, 388, 501, - /* 2330 */ 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2340 */ 400, 501, 402, 501, 501, 501, 439, 388, 441, 501, - /* 2350 */ 501, 444, 445, 446, 447, 448, 449, 501, 451, 400, - /* 2360 */ 501, 402, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2370 */ 347, 501, 501, 501, 501, 501, 501, 501, 501, 439, - /* 2380 */ 501, 441, 501, 360, 444, 445, 446, 447, 448, 449, - /* 2390 */ 501, 451, 501, 501, 501, 501, 501, 501, 439, 501, - /* 2400 */ 441, 501, 347, 444, 445, 446, 447, 448, 449, 501, - /* 2410 */ 451, 388, 501, 501, 501, 360, 501, 501, 501, 501, - /* 2420 */ 501, 501, 501, 400, 501, 402, 501, 501, 501, 501, - /* 2430 */ 501, 501, 347, 501, 501, 501, 501, 501, 501, 501, - /* 2440 */ 501, 501, 501, 388, 501, 360, 501, 501, 501, 501, - /* 2450 */ 501, 501, 501, 501, 501, 400, 501, 402, 501, 501, - /* 2460 */ 501, 501, 439, 501, 441, 501, 501, 444, 445, 446, - /* 2470 */ 447, 448, 449, 388, 451, 501, 501, 501, 501, 501, - /* 2480 */ 501, 501, 501, 501, 501, 400, 501, 402, 501, 501, - /* 2490 */ 501, 501, 501, 501, 439, 501, 441, 501, 501, 444, - /* 2500 */ 445, 446, 447, 448, 449, 347, 451, 501, 501, 501, - /* 2510 */ 501, 501, 501, 501, 501, 501, 501, 501, 360, 501, - /* 2520 */ 501, 501, 347, 501, 439, 501, 441, 501, 501, 444, - /* 2530 */ 445, 446, 447, 448, 449, 360, 451, 501, 501, 501, - /* 2540 */ 501, 501, 501, 501, 501, 501, 388, 501, 501, 501, - /* 2550 */ 501, 501, 501, 501, 501, 347, 501, 501, 400, 501, - /* 2560 */ 402, 501, 501, 388, 501, 501, 501, 501, 360, 501, - /* 2570 */ 501, 501, 347, 501, 501, 400, 501, 402, 501, 501, - /* 2580 */ 501, 501, 501, 501, 501, 360, 501, 347, 501, 501, - /* 2590 */ 501, 501, 501, 501, 501, 501, 388, 439, 501, 441, - /* 2600 */ 360, 501, 444, 445, 446, 447, 448, 449, 400, 451, - /* 2610 */ 402, 501, 501, 388, 439, 501, 441, 501, 501, 444, - /* 2620 */ 445, 446, 447, 448, 449, 400, 451, 402, 388, 501, - /* 2630 */ 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2640 */ 400, 501, 402, 501, 501, 501, 501, 439, 501, 441, - /* 2650 */ 501, 501, 444, 445, 446, 447, 448, 449, 501, 451, - /* 2660 */ 501, 501, 501, 501, 439, 501, 441, 347, 501, 444, - /* 2670 */ 445, 446, 447, 448, 449, 501, 451, 501, 501, 439, - /* 2680 */ 360, 441, 501, 501, 444, 445, 446, 447, 448, 449, - /* 2690 */ 347, 451, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2700 */ 501, 347, 501, 360, 501, 501, 501, 501, 388, 501, - /* 2710 */ 501, 501, 501, 501, 360, 501, 501, 501, 501, 501, - /* 2720 */ 400, 501, 402, 501, 501, 501, 501, 501, 501, 501, - /* 2730 */ 501, 388, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2740 */ 501, 501, 388, 400, 501, 402, 501, 501, 501, 501, - /* 2750 */ 501, 501, 501, 501, 400, 501, 402, 501, 501, 439, - /* 2760 */ 501, 441, 501, 347, 444, 445, 446, 447, 448, 449, - /* 2770 */ 501, 451, 501, 501, 501, 501, 360, 501, 501, 501, - /* 2780 */ 501, 501, 439, 501, 441, 501, 501, 444, 445, 446, - /* 2790 */ 447, 448, 449, 439, 451, 441, 501, 501, 444, 445, - /* 2800 */ 446, 447, 448, 449, 388, 451, 501, 501, 501, 501, - /* 2810 */ 501, 501, 501, 501, 501, 347, 400, 501, 402, 501, - /* 2820 */ 501, 501, 501, 501, 501, 501, 501, 501, 360, 501, - /* 2830 */ 501, 501, 501, 347, 501, 501, 501, 501, 501, 501, - /* 2840 */ 501, 501, 501, 501, 501, 501, 360, 501, 501, 501, - /* 2850 */ 501, 501, 501, 347, 501, 439, 388, 441, 501, 501, - /* 2860 */ 444, 445, 446, 447, 448, 449, 360, 451, 400, 501, - /* 2870 */ 402, 501, 501, 501, 388, 501, 501, 501, 501, 501, - /* 2880 */ 501, 501, 501, 347, 501, 501, 400, 501, 402, 501, - /* 2890 */ 501, 501, 501, 501, 388, 501, 360, 501, 501, 501, - /* 2900 */ 501, 501, 501, 501, 501, 501, 400, 439, 402, 441, - /* 2910 */ 501, 501, 444, 445, 446, 447, 448, 449, 501, 451, - /* 2920 */ 501, 501, 501, 501, 388, 439, 501, 441, 501, 501, - /* 2930 */ 444, 445, 446, 447, 448, 449, 400, 451, 402, 501, - /* 2940 */ 501, 501, 501, 501, 501, 439, 501, 441, 347, 501, - /* 2950 */ 444, 445, 446, 447, 448, 449, 501, 451, 501, 501, - /* 2960 */ 501, 360, 501, 501, 501, 501, 501, 501, 501, 501, - /* 2970 */ 501, 501, 501, 347, 501, 439, 501, 441, 501, 501, - /* 2980 */ 444, 445, 446, 447, 448, 449, 360, 451, 501, 388, - /* 2990 */ 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - /* 3000 */ 501, 400, 501, 402, 501, 501, 501, 501, 501, 501, - /* 3010 */ 501, 501, 501, 501, 388, 501, 501, 501, 501, 501, - /* 3020 */ 501, 501, 501, 501, 501, 501, 400, 501, 402, 501, - /* 3030 */ 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, - /* 3040 */ 439, 501, 441, 501, 501, 444, 445, 446, 447, 448, - /* 3050 */ 449, 501, 451, 501, 501, 501, 501, 501, 501, 501, - /* 3060 */ 501, 501, 501, 501, 501, 439, 501, 441, 501, 501, - /* 3070 */ 444, 445, 446, 447, 448, 449, 501, 451, 344, 344, - /* 3080 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3090 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3100 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3110 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3120 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3130 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3140 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3150 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3160 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3170 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3180 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3190 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3200 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3210 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 1430 */ 244, 245, 246, 247, 248, 106, 12, 13, 402, 368, + /* 1440 */ 20, 361, 20, 425, 368, 361, 22, 368, 20, 368, + /* 1450 */ 416, 368, 359, 352, 388, 368, 388, 388, 388, 35, + /* 1460 */ 388, 37, 388, 388, 350, 388, 388, 359, 350, 352, + /* 1470 */ 388, 347, 215, 144, 437, 106, 388, 202, 366, 201, + /* 1480 */ 433, 435, 432, 431, 360, 366, 430, 200, 64, 400, + /* 1490 */ 400, 400, 359, 283, 482, 275, 402, 424, 400, 400, + /* 1500 */ 274, 77, 400, 482, 187, 481, 400, 347, 485, 413, + /* 1510 */ 413, 284, 388, 484, 285, 480, 292, 188, 189, 190, + /* 1520 */ 360, 418, 193, 482, 400, 418, 402, 103, 269, 20, + /* 1530 */ 479, 501, 289, 424, 495, 206, 207, 287, 347, 360, + /* 1540 */ 264, 116, 494, 266, 444, 361, 217, 366, 388, 220, + /* 1550 */ 418, 360, 223, 224, 225, 226, 227, 400, 366, 400, + /* 1560 */ 400, 400, 402, 439, 400, 400, 442, 418, 179, 445, + /* 1570 */ 446, 447, 448, 449, 450, 400, 452, 414, 366, 388, + /* 1580 */ 106, 457, 384, 459, 462, 106, 392, 463, 464, 366, + /* 1590 */ 477, 400, 360, 402, 265, 475, 366, 400, 359, 439, + /* 1600 */ 378, 22, 442, 347, 349, 445, 446, 447, 448, 449, + /* 1610 */ 450, 38, 452, 353, 352, 382, 360, 457, 367, 459, + /* 1620 */ 196, 434, 198, 463, 464, 345, 0, 427, 382, 0, + /* 1630 */ 439, 0, 45, 442, 419, 382, 445, 446, 447, 448, + /* 1640 */ 449, 450, 0, 452, 388, 37, 37, 419, 221, 37, + /* 1650 */ 459, 37, 228, 229, 463, 464, 400, 0, 402, 221, + /* 1660 */ 37, 37, 221, 0, 37, 241, 242, 243, 244, 245, + /* 1670 */ 246, 247, 221, 0, 37, 0, 22, 347, 0, 216, + /* 1680 */ 37, 0, 204, 0, 204, 198, 205, 196, 0, 0, + /* 1690 */ 360, 0, 192, 0, 191, 439, 0, 147, 442, 49, + /* 1700 */ 347, 445, 446, 447, 448, 449, 450, 49, 452, 0, + /* 1710 */ 51, 37, 0, 360, 49, 459, 45, 0, 388, 463, + /* 1720 */ 464, 0, 0, 0, 0, 49, 0, 0, 0, 0, + /* 1730 */ 400, 161, 402, 0, 37, 0, 161, 0, 0, 0, + /* 1740 */ 0, 388, 0, 0, 0, 0, 0, 0, 0, 0, + /* 1750 */ 0, 0, 0, 400, 0, 402, 49, 0, 45, 0, + /* 1760 */ 0, 0, 0, 0, 0, 147, 0, 146, 347, 439, + /* 1770 */ 0, 0, 442, 145, 0, 445, 446, 447, 448, 449, + /* 1780 */ 450, 360, 452, 347, 0, 0, 50, 22, 0, 459, + /* 1790 */ 22, 22, 439, 463, 464, 442, 360, 0, 445, 446, + /* 1800 */ 447, 448, 449, 450, 37, 452, 50, 0, 0, 388, + /* 1810 */ 37, 0, 0, 37, 42, 0, 37, 64, 37, 64, + /* 1820 */ 0, 400, 64, 402, 388, 42, 51, 45, 35, 51, + /* 1830 */ 14, 51, 42, 42, 33, 49, 400, 0, 402, 0, + /* 1840 */ 487, 488, 43, 0, 51, 49, 42, 49, 0, 347, + /* 1850 */ 0, 42, 59, 60, 61, 62, 187, 64, 0, 49, + /* 1860 */ 439, 0, 360, 442, 0, 0, 445, 446, 447, 448, + /* 1870 */ 449, 450, 37, 452, 71, 439, 51, 0, 442, 37, + /* 1880 */ 42, 445, 446, 447, 448, 449, 450, 51, 452, 42, + /* 1890 */ 388, 0, 37, 42, 0, 459, 51, 37, 105, 42, + /* 1900 */ 464, 108, 400, 51, 402, 0, 0, 0, 0, 0, + /* 1910 */ 0, 37, 112, 0, 347, 22, 114, 37, 37, 498, + /* 1920 */ 499, 37, 37, 37, 37, 37, 37, 360, 33, 347, + /* 1930 */ 33, 0, 0, 37, 22, 37, 37, 0, 22, 22, + /* 1940 */ 22, 439, 360, 53, 442, 0, 0, 445, 446, 447, + /* 1950 */ 448, 449, 450, 0, 452, 388, 37, 37, 0, 37, + /* 1960 */ 393, 0, 22, 20, 37, 37, 37, 400, 106, 402, + /* 1970 */ 388, 178, 179, 107, 0, 393, 106, 22, 185, 186, + /* 1980 */ 203, 176, 400, 0, 402, 347, 37, 22, 199, 176, + /* 1990 */ 488, 0, 0, 179, 176, 176, 3, 204, 360, 33, + /* 2000 */ 183, 50, 270, 49, 183, 33, 439, 106, 106, 442, + /* 2010 */ 107, 107, 445, 446, 447, 448, 449, 450, 104, 452, + /* 2020 */ 50, 439, 33, 102, 442, 49, 388, 445, 446, 447, + /* 2030 */ 448, 449, 450, 107, 452, 33, 106, 33, 400, 106, + /* 2040 */ 402, 106, 3, 107, 106, 33, 107, 37, 347, 107, + /* 2050 */ 37, 37, 37, 37, 37, 49, 33, 270, 263, 107, + /* 2060 */ 49, 360, 270, 347, 107, 0, 0, 42, 106, 106, + /* 2070 */ 0, 107, 180, 42, 107, 106, 360, 439, 347, 106, + /* 2080 */ 442, 106, 49, 445, 446, 447, 448, 449, 450, 388, + /* 2090 */ 452, 360, 115, 106, 33, 2, 250, 22, 104, 104, + /* 2100 */ 228, 400, 178, 402, 388, 106, 49, 107, 107, 393, + /* 2110 */ 107, 106, 49, 106, 106, 106, 400, 22, 402, 388, + /* 2120 */ 37, 37, 37, 37, 37, 107, 106, 106, 490, 107, + /* 2130 */ 230, 400, 106, 402, 107, 116, 107, 107, 106, 37, + /* 2140 */ 439, 347, 106, 442, 107, 107, 445, 446, 447, 448, + /* 2150 */ 449, 450, 106, 452, 360, 439, 37, 106, 442, 106, + /* 2160 */ 33, 445, 446, 447, 448, 449, 450, 127, 452, 127, + /* 2170 */ 439, 347, 127, 442, 127, 106, 445, 446, 447, 448, + /* 2180 */ 449, 450, 388, 452, 360, 454, 37, 393, 106, 22, + /* 2190 */ 37, 71, 70, 37, 400, 37, 402, 37, 1, 37, + /* 2200 */ 499, 37, 37, 37, 100, 37, 77, 33, 37, 37, + /* 2210 */ 37, 22, 388, 37, 37, 37, 19, 393, 77, 37, + /* 2220 */ 37, 37, 22, 37, 400, 37, 402, 37, 0, 37, + /* 2230 */ 51, 0, 35, 439, 0, 42, 442, 42, 37, 445, + /* 2240 */ 446, 447, 448, 449, 450, 51, 452, 37, 51, 51, + /* 2250 */ 42, 0, 37, 51, 42, 0, 59, 60, 61, 62, + /* 2260 */ 37, 64, 347, 439, 37, 0, 442, 22, 33, 445, + /* 2270 */ 446, 447, 448, 449, 450, 360, 452, 20, 22, 21, + /* 2280 */ 502, 22, 22, 21, 502, 502, 502, 502, 502, 502, + /* 2290 */ 502, 502, 502, 502, 502, 347, 502, 502, 502, 502, + /* 2300 */ 502, 502, 105, 388, 502, 108, 502, 502, 360, 502, + /* 2310 */ 502, 502, 502, 502, 502, 400, 502, 402, 347, 502, + /* 2320 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2330 */ 502, 360, 502, 347, 502, 502, 388, 140, 502, 502, + /* 2340 */ 502, 502, 502, 502, 502, 502, 360, 502, 400, 502, + /* 2350 */ 402, 502, 502, 502, 439, 502, 502, 442, 502, 388, + /* 2360 */ 445, 446, 447, 448, 449, 450, 502, 452, 502, 502, + /* 2370 */ 502, 400, 502, 402, 388, 178, 502, 502, 502, 502, + /* 2380 */ 502, 502, 185, 502, 502, 502, 400, 439, 402, 502, + /* 2390 */ 442, 502, 502, 445, 446, 447, 448, 449, 450, 502, + /* 2400 */ 452, 204, 502, 502, 502, 502, 502, 502, 502, 347, + /* 2410 */ 439, 502, 502, 442, 502, 502, 445, 446, 447, 448, + /* 2420 */ 449, 450, 360, 452, 347, 439, 502, 502, 442, 502, + /* 2430 */ 502, 445, 446, 447, 448, 449, 450, 360, 452, 347, + /* 2440 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2450 */ 388, 502, 360, 502, 502, 502, 502, 502, 502, 502, + /* 2460 */ 502, 502, 400, 502, 402, 388, 502, 502, 502, 502, + /* 2470 */ 502, 502, 502, 502, 502, 502, 502, 400, 502, 402, + /* 2480 */ 388, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2490 */ 502, 502, 400, 502, 402, 502, 502, 502, 502, 502, + /* 2500 */ 502, 439, 347, 502, 442, 502, 502, 445, 446, 447, + /* 2510 */ 448, 449, 450, 502, 452, 360, 439, 502, 502, 442, + /* 2520 */ 502, 502, 445, 446, 447, 448, 449, 450, 502, 452, + /* 2530 */ 502, 439, 347, 502, 442, 502, 502, 445, 446, 447, + /* 2540 */ 448, 449, 450, 388, 452, 360, 502, 502, 502, 502, + /* 2550 */ 502, 502, 502, 502, 502, 400, 502, 402, 502, 502, + /* 2560 */ 502, 502, 502, 502, 502, 347, 502, 502, 502, 502, + /* 2570 */ 502, 502, 502, 388, 502, 502, 502, 502, 360, 502, + /* 2580 */ 502, 502, 502, 502, 502, 400, 502, 402, 502, 502, + /* 2590 */ 502, 502, 502, 502, 439, 502, 502, 442, 502, 502, + /* 2600 */ 445, 446, 447, 448, 449, 450, 388, 452, 502, 502, + /* 2610 */ 502, 502, 502, 502, 502, 502, 502, 502, 400, 502, + /* 2620 */ 402, 502, 502, 502, 439, 502, 502, 442, 502, 502, + /* 2630 */ 445, 446, 447, 448, 449, 450, 502, 452, 502, 502, + /* 2640 */ 502, 502, 502, 347, 502, 502, 502, 502, 502, 502, + /* 2650 */ 502, 502, 502, 502, 502, 502, 360, 439, 502, 502, + /* 2660 */ 442, 502, 502, 445, 446, 447, 448, 449, 450, 502, + /* 2670 */ 452, 502, 502, 502, 502, 502, 502, 502, 502, 347, + /* 2680 */ 502, 502, 502, 502, 388, 502, 502, 502, 502, 502, + /* 2690 */ 502, 502, 360, 502, 502, 502, 400, 502, 402, 502, + /* 2700 */ 502, 502, 502, 502, 502, 502, 502, 502, 347, 502, + /* 2710 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2720 */ 388, 360, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2730 */ 502, 502, 400, 502, 402, 439, 502, 502, 442, 502, + /* 2740 */ 502, 445, 446, 447, 448, 449, 450, 502, 452, 388, + /* 2750 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2760 */ 502, 400, 502, 402, 502, 502, 502, 502, 502, 502, + /* 2770 */ 502, 439, 502, 347, 442, 502, 502, 445, 446, 447, + /* 2780 */ 448, 449, 450, 502, 452, 502, 360, 502, 502, 502, + /* 2790 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2800 */ 439, 502, 502, 442, 502, 502, 445, 446, 447, 448, + /* 2810 */ 449, 450, 502, 452, 388, 502, 502, 502, 502, 502, + /* 2820 */ 502, 502, 502, 502, 502, 502, 400, 502, 402, 502, + /* 2830 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2840 */ 347, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2850 */ 502, 502, 502, 360, 502, 502, 347, 502, 502, 502, + /* 2860 */ 502, 502, 502, 502, 502, 439, 502, 502, 442, 360, + /* 2870 */ 502, 445, 446, 447, 448, 449, 450, 502, 452, 502, + /* 2880 */ 502, 388, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2890 */ 502, 502, 502, 400, 502, 402, 502, 388, 502, 502, + /* 2900 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 400, + /* 2910 */ 502, 402, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2920 */ 502, 347, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2930 */ 502, 502, 439, 502, 360, 442, 502, 502, 445, 446, + /* 2940 */ 447, 448, 449, 450, 502, 452, 502, 502, 439, 502, + /* 2950 */ 347, 442, 502, 502, 445, 446, 447, 448, 449, 450, + /* 2960 */ 502, 452, 388, 360, 502, 502, 502, 502, 502, 502, + /* 2970 */ 502, 502, 502, 502, 400, 502, 402, 502, 502, 502, + /* 2980 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 2990 */ 502, 388, 502, 502, 502, 502, 502, 502, 502, 502, + /* 3000 */ 502, 502, 502, 400, 502, 402, 502, 502, 502, 502, + /* 3010 */ 502, 502, 502, 439, 502, 347, 442, 502, 502, 445, + /* 3020 */ 446, 447, 448, 449, 450, 502, 452, 502, 360, 502, + /* 3030 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 3040 */ 502, 502, 439, 502, 347, 442, 502, 502, 445, 446, + /* 3050 */ 447, 448, 449, 450, 502, 452, 388, 360, 502, 502, + /* 3060 */ 502, 502, 502, 502, 502, 502, 502, 502, 400, 502, + /* 3070 */ 402, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 3080 */ 347, 502, 502, 502, 502, 388, 502, 502, 502, 502, + /* 3090 */ 502, 502, 502, 360, 502, 502, 502, 400, 502, 402, + /* 3100 */ 502, 502, 502, 502, 502, 502, 502, 439, 502, 347, + /* 3110 */ 442, 502, 502, 445, 446, 447, 448, 449, 450, 502, + /* 3120 */ 452, 388, 360, 502, 502, 502, 502, 502, 502, 502, + /* 3130 */ 502, 502, 502, 400, 502, 402, 439, 502, 502, 442, + /* 3140 */ 502, 502, 445, 446, 447, 448, 449, 450, 502, 452, + /* 3150 */ 388, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 3160 */ 502, 502, 400, 502, 402, 502, 502, 502, 502, 502, + /* 3170 */ 502, 502, 439, 502, 502, 442, 502, 502, 445, 446, + /* 3180 */ 447, 448, 449, 450, 502, 452, 502, 502, 502, 502, + /* 3190 */ 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + /* 3200 */ 502, 439, 502, 502, 442, 502, 502, 445, 446, 447, + /* 3210 */ 448, 449, 450, 502, 452, 344, 344, 344, 344, 344, /* 3220 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, /* 3230 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, /* 3240 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, @@ -1219,216 +1233,230 @@ static const YYCODETYPE yy_lookahead[] = { /* 3390 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, /* 3400 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, /* 3410 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, - /* 3420 */ 344, 344, + /* 3420 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3430 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3440 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3450 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3460 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3470 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3480 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3490 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3500 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3510 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3520 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3530 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3540 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + /* 3550 */ 344, 344, 344, 344, 344, 344, 344, 344, 344, }; -#define YY_SHIFT_COUNT (817) +#define YY_SHIFT_COUNT (819) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2289) +#define YY_SHIFT_MAX (2265) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1329, 0, 237, 0, 475, 475, 475, 475, 475, 475, /* 10 */ 475, 475, 475, 475, 475, 475, 712, 949, 949, 1186, /* 20 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, /* 30 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, /* 40 */ 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, - /* 50 */ 949, 51, 240, 314, 61, 145, 199, 145, 61, 61, - /* 60 */ 145, 1424, 145, 236, 1424, 1424, 545, 145, 12, 659, - /* 70 */ 93, 93, 659, 7, 7, 78, 134, 622, 622, 93, - /* 80 */ 93, 93, 93, 93, 93, 93, 93, 93, 93, 139, - /* 90 */ 93, 93, 148, 12, 93, 93, 253, 12, 93, 93, - /* 100 */ 12, 93, 93, 12, 93, 12, 12, 12, 93, 337, - /* 110 */ 197, 197, 246, 194, 769, 769, 769, 769, 769, 769, - /* 120 */ 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, - /* 130 */ 769, 769, 769, 1135, 427, 78, 134, 540, 540, 772, - /* 140 */ 518, 518, 518, 67, 116, 116, 772, 148, 217, 12, - /* 150 */ 12, 345, 12, 548, 12, 548, 548, 516, 595, 705, - /* 160 */ 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 2095, 434, - /* 170 */ 65, 284, 15, 146, 118, 50, 70, 70, 759, 245, - /* 180 */ 803, 678, 709, 1046, 685, 418, 853, 837, 1068, 934, - /* 190 */ 837, 1093, 816, 954, 1121, 1330, 1370, 1189, 148, 1370, - /* 200 */ 148, 1212, 1388, 1390, 1368, 1420, 1390, 1368, 1274, 1388, - /* 210 */ 1390, 1388, 1368, 1274, 1274, 1348, 1355, 1388, 1361, 1388, - /* 220 */ 1388, 1388, 1443, 1422, 1443, 1422, 1370, 148, 1457, 148, - /* 230 */ 1461, 1462, 148, 1461, 148, 1469, 148, 148, 1388, 148, - /* 240 */ 1443, 12, 12, 12, 12, 12, 12, 12, 12, 12, - /* 250 */ 12, 12, 1388, 705, 705, 1443, 548, 548, 548, 1308, - /* 260 */ 1419, 1370, 337, 1339, 1341, 1457, 337, 1345, 1121, 1388, - /* 270 */ 1420, 1420, 548, 1285, 1292, 548, 1285, 1292, 548, 548, - /* 280 */ 12, 1291, 1394, 1285, 1306, 1311, 1323, 1121, 1304, 1309, - /* 290 */ 1314, 1338, 1390, 1585, 1490, 1342, 1461, 337, 337, 1292, - /* 300 */ 548, 548, 548, 548, 548, 1292, 548, 1437, 337, 516, - /* 310 */ 337, 1390, 1523, 1524, 548, 595, 1388, 337, 1629, 1619, - /* 320 */ 1443, 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078, - /* 330 */ 36, 703, 414, 30, 1061, 546, 650, 760, 596, 979, - /* 340 */ 994, 777, 913, 913, 913, 913, 913, 913, 913, 913, - /* 350 */ 913, 1018, 435, 653, 486, 486, 733, 332, 741, 384, - /* 360 */ 897, 248, 312, 72, 406, 406, 654, 875, 509, 654, - /* 370 */ 654, 654, 99, 1113, 554, 1122, 1134, 952, 1115, 1031, - /* 380 */ 1040, 1053, 1059, 757, 1104, 1200, 1234, 1244, 990, 872, - /* 390 */ 1109, 1097, 1170, 1174, 1178, 1075, 1014, 1176, 1179, 1181, - /* 400 */ 1247, 1249, 1258, 1271, 1277, 1272, 1102, 1279, 1216, 1280, - /* 410 */ 1281, 1284, 1294, 1298, 1305, 1193, 1139, 1182, 1236, 1259, - /* 420 */ 785, 1333, 1690, 1697, 1699, 1656, 1702, 1666, 1483, 1669, - /* 430 */ 1670, 1671, 1488, 1710, 1674, 1675, 1492, 1714, 1494, 1716, - /* 440 */ 1680, 1722, 1698, 1723, 1682, 1508, 1725, 1522, 1727, 1525, - /* 450 */ 1526, 1532, 1536, 1733, 1735, 1736, 1545, 1547, 1739, 1741, - /* 460 */ 1596, 1695, 1696, 1747, 1711, 1700, 1749, 1701, 1752, 1708, - /* 470 */ 1754, 1755, 1756, 1712, 1757, 1759, 1763, 1764, 1765, 1766, - /* 480 */ 1606, 1731, 1769, 1609, 1771, 1772, 1773, 1775, 1777, 1778, - /* 490 */ 1780, 1782, 1790, 1792, 1793, 1794, 1795, 1798, 1800, 1801, - /* 500 */ 1761, 1808, 1767, 1811, 1816, 1817, 1828, 1829, 1830, 1809, - /* 510 */ 1833, 1667, 1834, 1689, 1839, 1703, 1840, 1841, 1820, 1796, - /* 520 */ 1821, 1797, 1844, 1786, 1812, 1851, 1788, 1853, 1799, 1854, - /* 530 */ 1857, 1822, 1810, 1823, 1862, 1827, 1815, 1825, 1868, 1832, - /* 540 */ 1819, 1836, 1871, 1835, 1874, 1831, 1846, 1856, 1843, 1845, - /* 550 */ 1865, 1847, 1890, 1850, 1855, 1895, 1899, 1902, 1861, 1717, - /* 560 */ 1905, 1843, 1858, 1908, 1909, 1848, 1910, 1911, 1875, 1863, - /* 570 */ 1876, 1916, 1880, 1869, 1879, 1922, 1887, 1878, 1883, 1926, - /* 580 */ 1893, 1881, 1885, 1931, 1933, 1934, 1935, 1936, 1938, 1826, - /* 590 */ 1838, 1914, 1941, 1948, 1918, 1919, 1928, 1929, 1930, 1937, - /* 600 */ 1939, 1942, 1920, 1944, 1943, 1945, 1946, 1947, 1970, 1949, - /* 610 */ 1972, 1951, 1925, 1975, 1963, 1950, 1986, 1988, 1989, 1954, - /* 620 */ 1992, 1956, 1994, 1973, 1976, 1960, 1961, 1962, 1897, 1894, - /* 630 */ 2002, 1842, 1900, 1802, 1971, 1985, 2009, 1813, 1991, 1859, - /* 640 */ 1860, 2010, 2011, 1864, 1866, 1870, 1867, 2012, 1983, 1751, - /* 650 */ 1913, 1917, 1927, 1967, 1932, 1984, 1921, 1952, 2004, 2005, - /* 660 */ 1953, 1955, 1957, 1958, 1964, 2008, 1995, 1999, 1966, 2018, - /* 670 */ 1783, 1968, 1969, 2049, 2022, 1787, 2021, 2025, 2028, 2030, - /* 680 */ 2031, 2032, 1974, 1978, 2024, 1849, 2041, 2029, 2077, 2080, - /* 690 */ 1977, 2044, 1998, 1990, 2001, 2000, 2003, 1982, 2007, 2110, - /* 700 */ 2069, 1965, 2014, 2013, 1843, 2066, 2083, 2019, 1872, 2020, - /* 710 */ 2115, 2096, 1898, 2027, 2033, 2036, 2037, 2042, 2040, 2076, - /* 720 */ 2043, 2045, 2078, 2046, 2107, 1901, 2063, 2034, 2064, 2097, - /* 730 */ 2098, 2070, 2068, 2099, 2071, 2072, 2100, 2074, 2075, 2101, - /* 740 */ 2082, 2079, 2102, 2084, 2086, 2144, 2088, 2056, 2062, 2065, - /* 750 */ 2081, 2089, 2119, 2090, 2154, 2092, 2119, 2119, 2177, 2130, - /* 760 */ 2134, 2168, 2169, 2172, 2173, 2174, 2176, 2178, 2180, 2181, - /* 770 */ 2135, 2120, 2186, 2184, 2185, 2190, 2201, 2191, 2203, 2204, - /* 780 */ 2161, 1920, 2205, 1944, 2206, 2207, 2209, 2210, 2223, 2211, - /* 790 */ 2249, 2213, 2200, 2214, 2252, 2220, 2215, 2222, 2268, 2232, - /* 800 */ 2219, 2229, 2272, 2237, 2224, 2235, 2279, 2253, 2254, 2289, - /* 810 */ 2270, 2260, 2274, 2273, 2275, 2276, 2280, 2282, + /* 50 */ 949, 158, 233, 708, 49, 61, 275, 61, 49, 49, + /* 60 */ 61, 1424, 61, 236, 1424, 1424, 180, 61, 46, 80, + /* 70 */ 85, 85, 80, 288, 288, 116, 195, 93, 93, 85, + /* 80 */ 85, 85, 85, 85, 85, 85, 85, 85, 85, 150, + /* 90 */ 85, 85, 292, 46, 85, 85, 472, 46, 85, 85, + /* 100 */ 46, 85, 85, 46, 85, 46, 46, 46, 85, 500, + /* 110 */ 197, 197, 469, 54, 563, 563, 563, 563, 563, 563, + /* 120 */ 563, 563, 563, 563, 563, 563, 563, 563, 563, 563, + /* 130 */ 563, 563, 563, 625, 255, 116, 195, 800, 800, 656, + /* 140 */ 485, 485, 485, 860, 302, 302, 656, 292, 458, 46, + /* 150 */ 46, 338, 46, 620, 46, 620, 620, 646, 713, 840, + /* 160 */ 199, 199, 199, 199, 199, 199, 199, 199, 2197, 434, + /* 170 */ 23, 268, 597, 474, 322, 229, 21, 21, 172, 89, + /* 180 */ 210, 650, 886, 1115, 584, 364, 956, 901, 946, 157, + /* 190 */ 901, 1134, 39, 502, 1031, 1265, 1289, 1328, 1142, 292, + /* 200 */ 1328, 292, 1168, 1344, 1346, 1327, 1355, 1346, 1327, 1207, + /* 210 */ 1344, 1346, 1344, 1327, 1207, 1207, 1286, 1291, 1344, 1299, + /* 220 */ 1344, 1344, 1344, 1385, 1358, 1385, 1358, 1328, 292, 1396, + /* 230 */ 292, 1420, 1422, 292, 1420, 292, 1428, 292, 292, 1344, + /* 240 */ 292, 1385, 46, 46, 46, 46, 46, 46, 46, 46, + /* 250 */ 46, 46, 46, 1344, 840, 840, 1385, 620, 620, 620, + /* 260 */ 1257, 1369, 1328, 500, 1275, 1278, 1396, 500, 1287, 1031, + /* 270 */ 1344, 1355, 1355, 620, 1220, 1226, 620, 1220, 1226, 620, + /* 280 */ 620, 46, 1210, 1317, 1220, 1229, 1227, 1259, 1031, 1224, + /* 290 */ 1243, 1250, 1276, 1346, 1509, 1425, 1277, 1420, 500, 500, + /* 300 */ 1226, 620, 620, 620, 620, 620, 1226, 620, 1389, 500, + /* 310 */ 646, 500, 1346, 1474, 1479, 620, 713, 1344, 500, 1579, + /* 320 */ 1573, 1385, 3215, 3215, 3215, 3215, 3215, 3215, 3215, 3215, + /* 330 */ 3215, 36, 1793, 65, 413, 979, 757, 981, 667, 1019, + /* 340 */ 1092, 833, 741, 1125, 1125, 1125, 1125, 1125, 1125, 1125, + /* 350 */ 1125, 1125, 301, 447, 178, 26, 26, 600, 640, 616, + /* 360 */ 819, 853, 393, 759, 284, 647, 647, 785, 527, 834, + /* 370 */ 785, 785, 785, 1085, 5, 1127, 1169, 1167, 1058, 345, + /* 380 */ 1095, 1104, 1105, 1110, 1188, 1190, 632, 911, 1209, 898, + /* 390 */ 1111, 1172, 1156, 1199, 1203, 1204, 1086, 977, 1025, 1206, + /* 400 */ 1213, 1214, 1216, 1218, 1219, 1240, 1225, 1002, 1236, 1177, + /* 410 */ 1237, 1238, 1242, 1244, 1247, 1248, 1138, 1201, 1208, 1249, + /* 420 */ 1254, 1196, 1272, 1626, 1629, 1631, 1587, 1642, 1608, 1427, + /* 430 */ 1609, 1612, 1614, 1438, 1657, 1623, 1624, 1441, 1627, 1663, + /* 440 */ 1451, 1673, 1637, 1675, 1654, 1678, 1643, 1463, 1681, 1478, + /* 450 */ 1683, 1480, 1481, 1487, 1491, 1688, 1689, 1691, 1500, 1503, + /* 460 */ 1693, 1696, 1550, 1650, 1658, 1709, 1674, 1659, 1712, 1665, + /* 470 */ 1721, 1671, 1717, 1722, 1723, 1676, 1724, 1726, 1727, 1728, + /* 480 */ 1729, 1733, 1570, 1697, 1735, 1575, 1737, 1738, 1739, 1740, + /* 490 */ 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, + /* 500 */ 1752, 1754, 1707, 1757, 1713, 1759, 1760, 1761, 1762, 1763, + /* 510 */ 1764, 1765, 1770, 1618, 1766, 1621, 1771, 1628, 1774, 1784, + /* 520 */ 1768, 1736, 1769, 1756, 1785, 1753, 1767, 1788, 1755, 1797, + /* 530 */ 1758, 1807, 1808, 1773, 1775, 1772, 1811, 1776, 1778, 1783, + /* 540 */ 1812, 1779, 1780, 1790, 1815, 1781, 1820, 1782, 1791, 1801, + /* 550 */ 1786, 1796, 1816, 1798, 1837, 1799, 1804, 1839, 1843, 1848, + /* 560 */ 1809, 1669, 1850, 1786, 1810, 1858, 1861, 1803, 1864, 1865, + /* 570 */ 1835, 1825, 1838, 1877, 1842, 1836, 1847, 1891, 1855, 1845, + /* 580 */ 1851, 1894, 1860, 1852, 1857, 1905, 1906, 1907, 1908, 1909, + /* 590 */ 1910, 1802, 1800, 1874, 1893, 1913, 1880, 1881, 1884, 1885, + /* 600 */ 1886, 1887, 1888, 1889, 1895, 1897, 1896, 1898, 1912, 1899, + /* 610 */ 1931, 1916, 1932, 1917, 1890, 1937, 1918, 1919, 1945, 1946, + /* 620 */ 1953, 1920, 1958, 1922, 1961, 1940, 1943, 1927, 1928, 1929, + /* 630 */ 1866, 1862, 1974, 1805, 1870, 1777, 1949, 1955, 1983, 1789, + /* 640 */ 1965, 1813, 1814, 1991, 1992, 1818, 1817, 1819, 1821, 1993, + /* 650 */ 1966, 1732, 1901, 1903, 1902, 1951, 1914, 1970, 1921, 1904, + /* 660 */ 1972, 1989, 1926, 1930, 1933, 1935, 1936, 2002, 1954, 1976, + /* 670 */ 1938, 2004, 1787, 1939, 1942, 2039, 2012, 1792, 2010, 2013, + /* 680 */ 2014, 2015, 2016, 2017, 1952, 1957, 2006, 1795, 2023, 2011, + /* 690 */ 2065, 2066, 1962, 2025, 1963, 1964, 1967, 1969, 1973, 1892, + /* 700 */ 1975, 2070, 2031, 1924, 1987, 1977, 1786, 2033, 2061, 1994, + /* 710 */ 1846, 1995, 2093, 2075, 1872, 1999, 2000, 2005, 2001, 2007, + /* 720 */ 2003, 2057, 2008, 2009, 2063, 2018, 2095, 1900, 2020, 2019, + /* 730 */ 2022, 2083, 2084, 2021, 2027, 2085, 2026, 2029, 2086, 2032, + /* 740 */ 2030, 2087, 2036, 2037, 2102, 2046, 2038, 2119, 2051, 2040, + /* 750 */ 2042, 2045, 2047, 2053, 2127, 2069, 2149, 2082, 2127, 2127, + /* 760 */ 2167, 2120, 2122, 2153, 2156, 2158, 2160, 2162, 2164, 2165, + /* 770 */ 2166, 2168, 2129, 2104, 2174, 2171, 2172, 2173, 2189, 2176, + /* 780 */ 2177, 2178, 2141, 1895, 2182, 1897, 2183, 2184, 2186, 2188, + /* 790 */ 2200, 2190, 2228, 2192, 2179, 2193, 2231, 2201, 2194, 2195, + /* 800 */ 2234, 2210, 2198, 2208, 2251, 2215, 2202, 2212, 2255, 2223, + /* 810 */ 2227, 2265, 2245, 2235, 2256, 2258, 2259, 2260, 2262, 2257, }; -#define YY_REDUCE_COUNT (329) -#define YY_REDUCE_MIN (-470) -#define YY_REDUCE_MAX (2626) +#define YY_REDUCE_COUNT (330) +#define YY_REDUCE_MIN (-467) +#define YY_REDUCE_MAX (2762) static const short yy_reduce_ofst[] = { - /* 0 */ 308, -300, -85, 144, 175, 239, 380, 412, 576, 688, - /* 10 */ 658, 813, 895, 1051, 1124, 1197, 1233, 1340, 1358, 1374, - /* 20 */ 1436, 1498, 1513, 1581, 1643, 1654, 1719, 1785, 1814, 1837, - /* 30 */ 1907, 1940, 1959, 2023, 2055, 2085, 2158, 2175, 2208, 2225, - /* 40 */ 2240, 2320, 2343, 2354, 2416, 2468, 2486, 2506, 2536, 2601, - /* 50 */ 2626, -302, -212, -422, 103, 591, 820, 828, -158, 285, - /* 60 */ 830, 393, -411, -355, -186, 590, -470, -138, -196, -73, - /* 70 */ -207, -199, -387, -349, -282, -124, -297, -31, 135, 57, - /* 80 */ 157, 161, 169, -342, 205, 275, 317, 426, 207, 16, - /* 90 */ 428, 473, -307, 272, 488, 505, 21, 340, 560, 640, - /* 100 */ -210, 677, 684, 342, 694, -12, 442, 370, 710, 264, - /* 110 */ -419, -419, -367, -151, -131, -120, -45, 156, 184, 281, - /* 120 */ 397, 466, 469, 492, 503, 524, 531, 532, 616, 628, - /* 130 */ 642, 649, 657, -380, 437, 49, -111, 526, 570, 599, - /* 140 */ 437, 440, 461, 127, 125, 291, 638, 574, -34, 387, - /* 150 */ 582, 605, 683, 675, 663, 698, 711, 693, 655, 734, - /* 160 */ -373, 612, 651, 689, 774, 858, 878, 774, 839, 907, - /* 170 */ 939, 881, 807, 819, 946, 863, 972, 973, 962, 933, - /* 180 */ 962, 996, 950, 1004, 1006, 965, 958, 900, 900, 882, - /* 190 */ 900, 911, 901, 962, 953, 959, 960, 964, 1024, 970, - /* 200 */ 1036, 981, 1050, 1056, 1029, 1028, 1082, 1034, 1038, 1086, - /* 210 */ 1088, 1090, 1041, 1048, 1049, 1084, 1087, 1101, 1094, 1106, - /* 220 */ 1108, 1110, 1116, 1114, 1123, 1118, 1043, 1111, 1076, 1112, - /* 230 */ 1125, 1058, 1117, 1126, 1136, 1077, 1137, 1138, 1132, 1140, - /* 240 */ 1142, 1119, 1127, 1128, 1133, 1141, 1143, 1144, 1145, 1146, - /* 250 */ 1149, 1150, 1151, 1153, 1161, 1168, 1130, 1147, 1148, 1091, - /* 260 */ 1105, 1129, 1173, 1152, 1120, 1156, 1177, 1131, 1154, 1191, - /* 270 */ 1163, 1164, 1159, 1083, 1165, 1167, 1098, 1171, 1188, 1190, - /* 280 */ 962, 1155, 1157, 1166, 1169, 1158, 1172, 1180, 1100, 1160, - /* 290 */ 1183, 900, 1243, 1175, 1185, 1184, 1246, 1245, 1248, 1192, - /* 300 */ 1209, 1213, 1215, 1217, 1219, 1194, 1223, 1210, 1260, 1241, - /* 310 */ 1261, 1268, 1195, 1239, 1232, 1256, 1303, 1297, 1315, 1320, - /* 320 */ 1336, 1262, 1257, 1273, 1275, 1293, 1313, 1316, 1326, 1351, + /* 0 */ -271, -301, -92, 144, 235, 380, 450, 473, 618, 709, + /* 10 */ 855, 1124, 1160, 1191, 1256, 1330, 888, 1353, 1421, 1436, + /* 20 */ 1502, 1567, 1582, 1638, 1701, 1716, 1731, 1794, 1824, 1915, + /* 30 */ 1948, 1971, 1986, 2062, 2077, 2092, 2155, 2185, 2218, 2296, + /* 40 */ 2332, 2361, 2426, 2493, 2509, 2574, 2603, 2668, 2697, 2733, + /* 50 */ 2762, -303, 128, -123, 104, 204, 508, 624, 175, 398, + /* 60 */ 679, 683, -467, -344, -302, 587, -465, -295, -377, -230, + /* 70 */ -358, -206, -151, -286, -150, -251, -103, -46, 55, 88, + /* 80 */ 130, 177, 198, 16, 207, 262, 269, 309, 331, 102, + /* 90 */ 369, 384, 153, -110, 415, 419, -343, -91, 457, 525, + /* 100 */ -380, 643, 657, 250, 665, 546, 342, 658, 682, 248, + /* 110 */ 119, 119, -117, 114, 2, 17, 164, 279, 286, 289, + /* 120 */ 440, 516, 581, 591, 619, 645, 693, 703, 727, 729, + /* 130 */ 742, 743, 752, -204, -368, -109, 422, 507, 526, 594, + /* 140 */ -368, -38, 323, 443, 355, 395, 601, 427, -374, 343, + /* 150 */ 582, 553, 167, 615, 725, 651, 717, 738, 771, 728, + /* 160 */ 479, 512, 528, 575, 583, 660, 664, 583, 689, 863, + /* 170 */ 732, 841, 756, 770, 897, 778, 890, 892, 894, 852, + /* 180 */ 894, 915, 871, 927, 933, 896, 874, 823, 823, 805, + /* 190 */ 823, 843, 846, 894, 885, 876, 906, 917, 918, 989, + /* 200 */ 925, 991, 937, 1006, 1011, 965, 963, 1017, 969, 973, + /* 210 */ 1022, 1026, 1028, 976, 982, 983, 1020, 1027, 1032, 1033, + /* 220 */ 1042, 1043, 1045, 1055, 1053, 1059, 1054, 980, 1044, 1036, + /* 230 */ 1071, 1080, 1018, 1076, 1084, 1079, 1034, 1081, 1083, 1093, + /* 240 */ 1087, 1101, 1066, 1068, 1069, 1070, 1072, 1074, 1075, 1077, + /* 250 */ 1078, 1082, 1088, 1108, 1114, 1118, 1117, 1089, 1090, 1091, + /* 260 */ 1037, 1046, 1047, 1112, 1050, 1052, 1094, 1119, 1056, 1073, + /* 270 */ 1133, 1096, 1097, 1098, 1012, 1103, 1099, 1021, 1107, 1102, + /* 280 */ 1106, 894, 1023, 1029, 1041, 1024, 1035, 1051, 1109, 1030, + /* 290 */ 1039, 1048, 823, 1179, 1100, 1113, 1120, 1184, 1181, 1192, + /* 300 */ 1132, 1157, 1159, 1161, 1164, 1165, 1149, 1175, 1163, 1212, + /* 310 */ 1198, 1223, 1232, 1122, 1194, 1197, 1222, 1239, 1230, 1255, + /* 320 */ 1260, 1262, 1200, 1187, 1215, 1228, 1233, 1246, 1253, 1251, + /* 330 */ 1280, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 10 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 20 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 30 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 40 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 50 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 60 */ 2159, 1830, 1830, 2122, 1830, 1830, 1830, 1830, 1830, 1830, - /* 70 */ 1830, 1830, 1830, 1830, 1830, 2129, 1830, 1830, 1830, 1830, - /* 80 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 90 */ 1830, 1830, 1926, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 100 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1924, - /* 110 */ 2351, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 120 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 130 */ 1830, 1830, 1830, 1830, 2363, 1830, 1830, 1900, 1900, 1830, - /* 140 */ 2363, 2363, 2363, 1924, 2323, 2323, 1830, 1926, 2193, 1830, - /* 150 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2048, 1830, 1860, - /* 160 */ 1830, 1830, 1830, 1830, 2072, 1830, 1830, 1830, 2185, 1830, - /* 170 */ 1830, 2392, 2449, 1830, 1830, 2395, 1830, 1830, 1830, 1830, - /* 180 */ 1830, 1830, 2134, 1830, 1830, 2001, 2382, 2355, 2369, 2433, - /* 190 */ 2356, 2353, 2376, 1830, 2386, 1830, 1830, 2207, 1926, 1830, - /* 200 */ 1926, 2172, 2117, 1830, 2127, 1830, 1830, 2127, 2124, 1830, - /* 210 */ 1830, 1830, 2127, 2124, 2124, 1990, 1986, 1830, 1984, 1830, - /* 220 */ 1830, 1830, 1830, 1884, 1830, 1884, 1830, 1926, 1830, 1926, - /* 230 */ 1830, 1830, 1926, 1830, 1926, 1830, 1926, 1926, 1830, 1926, - /* 240 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 250 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2205, - /* 260 */ 2191, 1830, 1924, 2183, 2181, 1830, 1924, 2179, 2386, 1830, - /* 270 */ 1830, 1830, 1830, 2403, 2401, 1830, 2403, 2401, 1830, 1830, - /* 280 */ 1830, 2417, 2413, 2403, 2422, 2419, 2388, 2386, 2452, 2439, - /* 290 */ 2435, 2369, 1830, 1830, 2374, 2372, 1830, 1924, 1924, 2401, - /* 300 */ 1830, 1830, 1830, 1830, 1830, 2401, 1830, 1830, 1924, 1830, - /* 310 */ 1924, 1830, 1830, 2017, 1830, 1830, 1830, 1924, 1830, 1869, - /* 320 */ 1830, 2174, 2196, 2155, 2155, 2051, 2051, 2051, 1927, 1835, - /* 330 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 340 */ 1830, 1830, 2416, 2415, 2278, 1830, 2327, 2326, 2325, 2316, - /* 350 */ 2277, 2013, 1830, 1830, 2276, 2275, 1830, 1830, 1830, 1830, - /* 360 */ 1830, 1830, 1830, 1830, 2146, 2145, 2269, 1830, 1830, 2270, - /* 370 */ 2268, 2267, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 380 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 390 */ 1830, 1830, 1830, 1830, 1830, 1830, 2436, 2440, 1830, 1830, - /* 400 */ 1830, 1830, 1830, 1830, 2352, 1830, 1830, 1830, 2251, 1830, - /* 410 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 420 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 430 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 440 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 450 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 460 */ 2123, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 470 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 480 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 490 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 500 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 510 */ 1830, 1830, 1830, 1830, 1830, 2138, 1830, 1830, 1830, 1830, - /* 520 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 530 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 540 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1874, 2256, 1830, - /* 550 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 560 */ 1830, 2259, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 570 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 580 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 590 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 600 */ 1830, 1830, 1966, 1965, 1830, 1830, 1830, 1830, 1830, 1830, - /* 610 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 620 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2260, 1830, - /* 630 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 640 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2432, 2389, 1830, - /* 650 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 660 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2251, 1830, 2414, - /* 670 */ 1830, 1830, 2430, 1830, 2434, 1830, 1830, 1830, 1830, 1830, - /* 680 */ 1830, 1830, 2362, 2358, 1830, 1830, 2354, 1830, 1830, 1830, - /* 690 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 700 */ 1830, 1830, 1830, 1830, 2250, 1830, 2313, 1830, 1830, 1830, - /* 710 */ 2347, 1830, 1830, 2298, 1830, 1830, 1830, 1830, 1830, 1830, - /* 720 */ 1830, 1830, 1830, 2260, 1830, 2263, 1830, 1830, 1830, 1830, - /* 730 */ 1830, 2045, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 740 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 2029, 2027, 2026, - /* 750 */ 2025, 1830, 2058, 1830, 1830, 1830, 2054, 2053, 1830, 1830, - /* 760 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 770 */ 1830, 1830, 1945, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 780 */ 1830, 1937, 1830, 1936, 1830, 1830, 1830, 1830, 1830, 1830, - /* 790 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 800 */ 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, 1830, - /* 810 */ 1830, 1859, 1830, 1830, 1830, 1830, 1830, 1830, + /* 0 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 10 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 20 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 30 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 40 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 50 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 60 */ 2164, 1835, 1835, 2127, 1835, 1835, 1835, 1835, 1835, 1835, + /* 70 */ 1835, 1835, 1835, 1835, 1835, 2134, 1835, 1835, 1835, 1835, + /* 80 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 90 */ 1835, 1835, 1931, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 100 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1929, + /* 110 */ 2358, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 120 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 130 */ 1835, 1835, 1835, 1835, 2370, 1835, 1835, 1905, 1905, 1835, + /* 140 */ 2370, 2370, 2370, 1929, 2330, 2330, 1835, 1931, 2198, 1835, + /* 150 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2053, 1835, 1865, + /* 160 */ 1835, 1835, 1835, 1835, 2077, 1835, 1835, 1835, 2190, 1835, + /* 170 */ 1835, 2399, 2456, 1835, 1835, 2402, 1835, 1835, 1835, 1835, + /* 180 */ 1835, 1835, 2139, 1835, 1835, 2006, 2389, 2362, 2376, 2440, + /* 190 */ 2363, 2360, 2383, 1835, 2393, 1835, 2222, 1835, 2212, 1931, + /* 200 */ 1835, 1931, 2177, 2122, 1835, 2132, 1835, 1835, 2132, 2129, + /* 210 */ 1835, 1835, 1835, 2132, 2129, 2129, 1995, 1991, 1835, 1989, + /* 220 */ 1835, 1835, 1835, 1835, 1889, 1835, 1889, 1835, 1931, 1835, + /* 230 */ 1931, 1835, 1835, 1931, 1835, 1931, 1835, 1931, 1931, 1835, + /* 240 */ 1931, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 250 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 260 */ 2210, 2196, 1835, 1929, 2188, 2186, 1835, 1929, 2184, 2393, + /* 270 */ 1835, 1835, 1835, 1835, 2410, 2408, 1835, 2410, 2408, 1835, + /* 280 */ 1835, 1835, 2424, 2420, 2410, 2429, 2426, 2395, 2393, 2459, + /* 290 */ 2446, 2442, 2376, 1835, 1835, 2381, 2379, 1835, 1929, 1929, + /* 300 */ 2408, 1835, 1835, 1835, 1835, 1835, 2408, 1835, 1835, 1929, + /* 310 */ 1835, 1929, 1835, 1835, 2022, 1835, 1835, 1835, 1929, 1835, + /* 320 */ 1874, 1835, 2179, 2201, 2160, 2160, 2056, 2056, 2056, 1932, + /* 330 */ 1840, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 340 */ 1835, 1835, 1835, 2423, 2422, 2285, 1835, 2334, 2333, 2332, + /* 350 */ 2323, 2284, 2018, 1835, 1835, 2283, 2282, 1835, 1835, 1835, + /* 360 */ 1835, 1835, 1835, 1835, 1835, 2151, 2150, 2276, 1835, 1835, + /* 370 */ 2277, 2275, 2274, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 380 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 390 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2443, 2447, 1835, + /* 400 */ 1835, 1835, 1835, 1835, 1835, 2359, 1835, 1835, 1835, 2258, + /* 410 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 420 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 430 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 440 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 450 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 460 */ 1835, 1835, 2128, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 470 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 480 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 490 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 500 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 510 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2143, 1835, 1835, + /* 520 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 530 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 540 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1879, + /* 550 */ 2263, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 560 */ 1835, 1835, 1835, 2266, 1835, 1835, 1835, 1835, 1835, 1835, + /* 570 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 580 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 590 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 600 */ 1835, 1835, 1835, 1835, 1971, 1970, 1835, 1835, 1835, 1835, + /* 610 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 620 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 630 */ 2267, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 640 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2439, + /* 650 */ 2396, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 660 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2258, + /* 670 */ 1835, 2421, 1835, 1835, 2437, 1835, 2441, 1835, 1835, 1835, + /* 680 */ 1835, 1835, 1835, 1835, 2369, 2365, 1835, 1835, 2361, 1835, + /* 690 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 700 */ 1835, 1835, 1835, 1835, 1835, 1835, 2257, 1835, 2320, 1835, + /* 710 */ 1835, 1835, 2354, 1835, 1835, 2305, 1835, 1835, 1835, 1835, + /* 720 */ 1835, 1835, 1835, 1835, 1835, 2267, 1835, 2270, 1835, 1835, + /* 730 */ 1835, 1835, 1835, 2050, 1835, 1835, 1835, 1835, 1835, 1835, + /* 740 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 2034, + /* 750 */ 2032, 2031, 2030, 1835, 2063, 1835, 1835, 1835, 2059, 2058, + /* 760 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 770 */ 1835, 1835, 1835, 1835, 1950, 1835, 1835, 1835, 1835, 1835, + /* 780 */ 1835, 1835, 1835, 1942, 1835, 1941, 1835, 1835, 1835, 1835, + /* 790 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 800 */ 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, 1835, + /* 810 */ 1835, 1835, 1835, 1864, 1835, 1835, 1835, 1835, 1835, 1835, }; /********** End of lemon-generated parsing tables *****************************/ @@ -2320,67 +2348,68 @@ static const char *const yyTokenName[] = { /* 437 */ "subtable_opt", /* 438 */ "ignore_opt", /* 439 */ "expression", - /* 440 */ "dnode_list", - /* 441 */ "literal_func", - /* 442 */ "literal_list", - /* 443 */ "table_alias", - /* 444 */ "expr_or_subquery", - /* 445 */ "pseudo_column", - /* 446 */ "column_reference", - /* 447 */ "function_expression", - /* 448 */ "case_when_expression", - /* 449 */ "star_func", - /* 450 */ "star_func_para_list", - /* 451 */ "noarg_func", - /* 452 */ "other_para_list", - /* 453 */ "star_func_para", - /* 454 */ "when_then_list", - /* 455 */ "case_when_else_opt", - /* 456 */ "common_expression", - /* 457 */ "when_then_expr", - /* 458 */ "predicate", - /* 459 */ "compare_op", - /* 460 */ "in_op", - /* 461 */ "in_predicate_value", - /* 462 */ "boolean_value_expression", - /* 463 */ "boolean_primary", - /* 464 */ "from_clause_opt", - /* 465 */ "table_reference_list", - /* 466 */ "table_reference", - /* 467 */ "table_primary", - /* 468 */ "joined_table", - /* 469 */ "alias_opt", - /* 470 */ "subquery", - /* 471 */ "parenthesized_joined_table", - /* 472 */ "join_type", - /* 473 */ "query_specification", - /* 474 */ "hint_list", - /* 475 */ "set_quantifier_opt", - /* 476 */ "tag_mode_opt", - /* 477 */ "select_list", - /* 478 */ "partition_by_clause_opt", - /* 479 */ "range_opt", - /* 480 */ "every_opt", - /* 481 */ "fill_opt", - /* 482 */ "twindow_clause_opt", - /* 483 */ "group_by_clause_opt", - /* 484 */ "having_clause_opt", - /* 485 */ "select_item", - /* 486 */ "partition_list", - /* 487 */ "partition_item", - /* 488 */ "fill_mode", - /* 489 */ "group_by_list", - /* 490 */ "query_expression", - /* 491 */ "query_simple", - /* 492 */ "order_by_clause_opt", - /* 493 */ "slimit_clause_opt", - /* 494 */ "limit_clause_opt", - /* 495 */ "union_query_expression", - /* 496 */ "query_simple_or_subquery", - /* 497 */ "sort_specification_list", - /* 498 */ "sort_specification", - /* 499 */ "ordering_specification_opt", - /* 500 */ "null_ordering_opt", + /* 440 */ "on_vgroup_id", + /* 441 */ "dnode_list", + /* 442 */ "literal_func", + /* 443 */ "literal_list", + /* 444 */ "table_alias", + /* 445 */ "expr_or_subquery", + /* 446 */ "pseudo_column", + /* 447 */ "column_reference", + /* 448 */ "function_expression", + /* 449 */ "case_when_expression", + /* 450 */ "star_func", + /* 451 */ "star_func_para_list", + /* 452 */ "noarg_func", + /* 453 */ "other_para_list", + /* 454 */ "star_func_para", + /* 455 */ "when_then_list", + /* 456 */ "case_when_else_opt", + /* 457 */ "common_expression", + /* 458 */ "when_then_expr", + /* 459 */ "predicate", + /* 460 */ "compare_op", + /* 461 */ "in_op", + /* 462 */ "in_predicate_value", + /* 463 */ "boolean_value_expression", + /* 464 */ "boolean_primary", + /* 465 */ "from_clause_opt", + /* 466 */ "table_reference_list", + /* 467 */ "table_reference", + /* 468 */ "table_primary", + /* 469 */ "joined_table", + /* 470 */ "alias_opt", + /* 471 */ "subquery", + /* 472 */ "parenthesized_joined_table", + /* 473 */ "join_type", + /* 474 */ "query_specification", + /* 475 */ "hint_list", + /* 476 */ "set_quantifier_opt", + /* 477 */ "tag_mode_opt", + /* 478 */ "select_list", + /* 479 */ "partition_by_clause_opt", + /* 480 */ "range_opt", + /* 481 */ "every_opt", + /* 482 */ "fill_opt", + /* 483 */ "twindow_clause_opt", + /* 484 */ "group_by_clause_opt", + /* 485 */ "having_clause_opt", + /* 486 */ "select_item", + /* 487 */ "partition_list", + /* 488 */ "partition_item", + /* 489 */ "fill_mode", + /* 490 */ "group_by_list", + /* 491 */ "query_expression", + /* 492 */ "query_simple", + /* 493 */ "order_by_clause_opt", + /* 494 */ "slimit_clause_opt", + /* 495 */ "limit_clause_opt", + /* 496 */ "union_query_expression", + /* 497 */ "query_simple_or_subquery", + /* 498 */ "sort_specification_list", + /* 499 */ "sort_specification", + /* 500 */ "ordering_specification_opt", + /* 501 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2768,248 +2797,250 @@ static const char *const yyRuleName[] = { /* 377 */ "cmd ::= KILL QUERY NK_STRING", /* 378 */ "cmd ::= KILL TRANSACTION NK_INTEGER", /* 379 */ "cmd ::= BALANCE VGROUP", - /* 380 */ "cmd ::= BALANCE VGROUP LEADER", + /* 380 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", /* 381 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", /* 382 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", /* 383 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 384 */ "dnode_list ::= DNODE NK_INTEGER", - /* 385 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 386 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 387 */ "cmd ::= query_or_subquery", - /* 388 */ "cmd ::= insert_query", - /* 389 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 390 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 391 */ "literal ::= NK_INTEGER", - /* 392 */ "literal ::= NK_FLOAT", - /* 393 */ "literal ::= NK_STRING", - /* 394 */ "literal ::= NK_BOOL", - /* 395 */ "literal ::= TIMESTAMP NK_STRING", - /* 396 */ "literal ::= duration_literal", - /* 397 */ "literal ::= NULL", - /* 398 */ "literal ::= NK_QUESTION", - /* 399 */ "duration_literal ::= NK_VARIABLE", - /* 400 */ "signed ::= NK_INTEGER", - /* 401 */ "signed ::= NK_PLUS NK_INTEGER", - /* 402 */ "signed ::= NK_MINUS NK_INTEGER", - /* 403 */ "signed ::= NK_FLOAT", - /* 404 */ "signed ::= NK_PLUS NK_FLOAT", - /* 405 */ "signed ::= NK_MINUS NK_FLOAT", - /* 406 */ "signed_literal ::= signed", - /* 407 */ "signed_literal ::= NK_STRING", - /* 408 */ "signed_literal ::= NK_BOOL", - /* 409 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 410 */ "signed_literal ::= duration_literal", - /* 411 */ "signed_literal ::= NULL", - /* 412 */ "signed_literal ::= literal_func", - /* 413 */ "signed_literal ::= NK_QUESTION", - /* 414 */ "literal_list ::= signed_literal", - /* 415 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 416 */ "db_name ::= NK_ID", - /* 417 */ "table_name ::= NK_ID", - /* 418 */ "column_name ::= NK_ID", - /* 419 */ "function_name ::= NK_ID", - /* 420 */ "table_alias ::= NK_ID", - /* 421 */ "column_alias ::= NK_ID", - /* 422 */ "user_name ::= NK_ID", - /* 423 */ "topic_name ::= NK_ID", - /* 424 */ "stream_name ::= NK_ID", - /* 425 */ "cgroup_name ::= NK_ID", - /* 426 */ "index_name ::= NK_ID", - /* 427 */ "expr_or_subquery ::= expression", - /* 428 */ "expression ::= literal", - /* 429 */ "expression ::= pseudo_column", - /* 430 */ "expression ::= column_reference", - /* 431 */ "expression ::= function_expression", - /* 432 */ "expression ::= case_when_expression", - /* 433 */ "expression ::= NK_LP expression NK_RP", - /* 434 */ "expression ::= NK_PLUS expr_or_subquery", - /* 435 */ "expression ::= NK_MINUS expr_or_subquery", - /* 436 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 437 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 438 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 439 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 440 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 441 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 442 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 443 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 444 */ "expression_list ::= expr_or_subquery", - /* 445 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 446 */ "column_reference ::= column_name", - /* 447 */ "column_reference ::= table_name NK_DOT column_name", - /* 448 */ "pseudo_column ::= ROWTS", - /* 449 */ "pseudo_column ::= TBNAME", - /* 450 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 451 */ "pseudo_column ::= QSTART", - /* 452 */ "pseudo_column ::= QEND", - /* 453 */ "pseudo_column ::= QDURATION", - /* 454 */ "pseudo_column ::= WSTART", - /* 455 */ "pseudo_column ::= WEND", - /* 456 */ "pseudo_column ::= WDURATION", - /* 457 */ "pseudo_column ::= IROWTS", - /* 458 */ "pseudo_column ::= ISFILLED", - /* 459 */ "pseudo_column ::= QTAGS", - /* 460 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 461 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 462 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 463 */ "function_expression ::= literal_func", - /* 464 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 465 */ "literal_func ::= NOW", - /* 466 */ "noarg_func ::= NOW", - /* 467 */ "noarg_func ::= TODAY", - /* 468 */ "noarg_func ::= TIMEZONE", - /* 469 */ "noarg_func ::= DATABASE", - /* 470 */ "noarg_func ::= CLIENT_VERSION", - /* 471 */ "noarg_func ::= SERVER_VERSION", - /* 472 */ "noarg_func ::= SERVER_STATUS", - /* 473 */ "noarg_func ::= CURRENT_USER", - /* 474 */ "noarg_func ::= USER", - /* 475 */ "star_func ::= COUNT", - /* 476 */ "star_func ::= FIRST", - /* 477 */ "star_func ::= LAST", - /* 478 */ "star_func ::= LAST_ROW", - /* 479 */ "star_func_para_list ::= NK_STAR", - /* 480 */ "star_func_para_list ::= other_para_list", - /* 481 */ "other_para_list ::= star_func_para", - /* 482 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 483 */ "star_func_para ::= expr_or_subquery", - /* 484 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 485 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 486 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 487 */ "when_then_list ::= when_then_expr", - /* 488 */ "when_then_list ::= when_then_list when_then_expr", - /* 489 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 490 */ "case_when_else_opt ::=", - /* 491 */ "case_when_else_opt ::= ELSE common_expression", - /* 492 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 493 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 494 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 495 */ "predicate ::= expr_or_subquery IS NULL", - /* 496 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 497 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 498 */ "compare_op ::= NK_LT", - /* 499 */ "compare_op ::= NK_GT", - /* 500 */ "compare_op ::= NK_LE", - /* 501 */ "compare_op ::= NK_GE", - /* 502 */ "compare_op ::= NK_NE", - /* 503 */ "compare_op ::= NK_EQ", - /* 504 */ "compare_op ::= LIKE", - /* 505 */ "compare_op ::= NOT LIKE", - /* 506 */ "compare_op ::= MATCH", - /* 507 */ "compare_op ::= NMATCH", - /* 508 */ "compare_op ::= CONTAINS", - /* 509 */ "in_op ::= IN", - /* 510 */ "in_op ::= NOT IN", - /* 511 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 512 */ "boolean_value_expression ::= boolean_primary", - /* 513 */ "boolean_value_expression ::= NOT boolean_primary", - /* 514 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 515 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 516 */ "boolean_primary ::= predicate", - /* 517 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 518 */ "common_expression ::= expr_or_subquery", - /* 519 */ "common_expression ::= boolean_value_expression", - /* 520 */ "from_clause_opt ::=", - /* 521 */ "from_clause_opt ::= FROM table_reference_list", - /* 522 */ "table_reference_list ::= table_reference", - /* 523 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 524 */ "table_reference ::= table_primary", - /* 525 */ "table_reference ::= joined_table", - /* 526 */ "table_primary ::= table_name alias_opt", - /* 527 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 528 */ "table_primary ::= subquery alias_opt", - /* 529 */ "table_primary ::= parenthesized_joined_table", - /* 530 */ "alias_opt ::=", - /* 531 */ "alias_opt ::= table_alias", - /* 532 */ "alias_opt ::= AS table_alias", - /* 533 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 534 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 535 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 536 */ "join_type ::=", - /* 537 */ "join_type ::= INNER", - /* 538 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 539 */ "hint_list ::=", - /* 540 */ "hint_list ::= NK_HINT", - /* 541 */ "tag_mode_opt ::=", - /* 542 */ "tag_mode_opt ::= TAGS", - /* 543 */ "set_quantifier_opt ::=", - /* 544 */ "set_quantifier_opt ::= DISTINCT", - /* 545 */ "set_quantifier_opt ::= ALL", - /* 546 */ "select_list ::= select_item", - /* 547 */ "select_list ::= select_list NK_COMMA select_item", - /* 548 */ "select_item ::= NK_STAR", - /* 549 */ "select_item ::= common_expression", - /* 550 */ "select_item ::= common_expression column_alias", - /* 551 */ "select_item ::= common_expression AS column_alias", - /* 552 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 553 */ "where_clause_opt ::=", - /* 554 */ "where_clause_opt ::= WHERE search_condition", - /* 555 */ "partition_by_clause_opt ::=", - /* 556 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 557 */ "partition_list ::= partition_item", - /* 558 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 559 */ "partition_item ::= expr_or_subquery", - /* 560 */ "partition_item ::= expr_or_subquery column_alias", - /* 561 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 562 */ "twindow_clause_opt ::=", - /* 563 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 564 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 565 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 566 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 567 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 568 */ "sliding_opt ::=", - /* 569 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 570 */ "fill_opt ::=", - /* 571 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 572 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 573 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 574 */ "fill_mode ::= NONE", - /* 575 */ "fill_mode ::= PREV", - /* 576 */ "fill_mode ::= NULL", - /* 577 */ "fill_mode ::= NULL_F", - /* 578 */ "fill_mode ::= LINEAR", - /* 579 */ "fill_mode ::= NEXT", - /* 580 */ "group_by_clause_opt ::=", - /* 581 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 582 */ "group_by_list ::= expr_or_subquery", - /* 583 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 584 */ "having_clause_opt ::=", - /* 585 */ "having_clause_opt ::= HAVING search_condition", - /* 586 */ "range_opt ::=", - /* 587 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 588 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 589 */ "every_opt ::=", - /* 590 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 591 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 592 */ "query_simple ::= query_specification", - /* 593 */ "query_simple ::= union_query_expression", - /* 594 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 595 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 596 */ "query_simple_or_subquery ::= query_simple", - /* 597 */ "query_simple_or_subquery ::= subquery", - /* 598 */ "query_or_subquery ::= query_expression", - /* 599 */ "query_or_subquery ::= subquery", - /* 600 */ "order_by_clause_opt ::=", - /* 601 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 602 */ "slimit_clause_opt ::=", - /* 603 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 604 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 605 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 606 */ "limit_clause_opt ::=", - /* 607 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 608 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 609 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 610 */ "subquery ::= NK_LP query_expression NK_RP", - /* 611 */ "subquery ::= NK_LP subquery NK_RP", - /* 612 */ "search_condition ::= common_expression", - /* 613 */ "sort_specification_list ::= sort_specification", - /* 614 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 615 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 616 */ "ordering_specification_opt ::=", - /* 617 */ "ordering_specification_opt ::= ASC", - /* 618 */ "ordering_specification_opt ::= DESC", - /* 619 */ "null_ordering_opt ::=", - /* 620 */ "null_ordering_opt ::= NULLS FIRST", - /* 621 */ "null_ordering_opt ::= NULLS LAST", + /* 384 */ "on_vgroup_id ::=", + /* 385 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 386 */ "dnode_list ::= DNODE NK_INTEGER", + /* 387 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 388 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 389 */ "cmd ::= query_or_subquery", + /* 390 */ "cmd ::= insert_query", + /* 391 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 392 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 393 */ "literal ::= NK_INTEGER", + /* 394 */ "literal ::= NK_FLOAT", + /* 395 */ "literal ::= NK_STRING", + /* 396 */ "literal ::= NK_BOOL", + /* 397 */ "literal ::= TIMESTAMP NK_STRING", + /* 398 */ "literal ::= duration_literal", + /* 399 */ "literal ::= NULL", + /* 400 */ "literal ::= NK_QUESTION", + /* 401 */ "duration_literal ::= NK_VARIABLE", + /* 402 */ "signed ::= NK_INTEGER", + /* 403 */ "signed ::= NK_PLUS NK_INTEGER", + /* 404 */ "signed ::= NK_MINUS NK_INTEGER", + /* 405 */ "signed ::= NK_FLOAT", + /* 406 */ "signed ::= NK_PLUS NK_FLOAT", + /* 407 */ "signed ::= NK_MINUS NK_FLOAT", + /* 408 */ "signed_literal ::= signed", + /* 409 */ "signed_literal ::= NK_STRING", + /* 410 */ "signed_literal ::= NK_BOOL", + /* 411 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 412 */ "signed_literal ::= duration_literal", + /* 413 */ "signed_literal ::= NULL", + /* 414 */ "signed_literal ::= literal_func", + /* 415 */ "signed_literal ::= NK_QUESTION", + /* 416 */ "literal_list ::= signed_literal", + /* 417 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 418 */ "db_name ::= NK_ID", + /* 419 */ "table_name ::= NK_ID", + /* 420 */ "column_name ::= NK_ID", + /* 421 */ "function_name ::= NK_ID", + /* 422 */ "table_alias ::= NK_ID", + /* 423 */ "column_alias ::= NK_ID", + /* 424 */ "user_name ::= NK_ID", + /* 425 */ "topic_name ::= NK_ID", + /* 426 */ "stream_name ::= NK_ID", + /* 427 */ "cgroup_name ::= NK_ID", + /* 428 */ "index_name ::= NK_ID", + /* 429 */ "expr_or_subquery ::= expression", + /* 430 */ "expression ::= literal", + /* 431 */ "expression ::= pseudo_column", + /* 432 */ "expression ::= column_reference", + /* 433 */ "expression ::= function_expression", + /* 434 */ "expression ::= case_when_expression", + /* 435 */ "expression ::= NK_LP expression NK_RP", + /* 436 */ "expression ::= NK_PLUS expr_or_subquery", + /* 437 */ "expression ::= NK_MINUS expr_or_subquery", + /* 438 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 439 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 440 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 441 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 442 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 443 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 444 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 445 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 446 */ "expression_list ::= expr_or_subquery", + /* 447 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 448 */ "column_reference ::= column_name", + /* 449 */ "column_reference ::= table_name NK_DOT column_name", + /* 450 */ "pseudo_column ::= ROWTS", + /* 451 */ "pseudo_column ::= TBNAME", + /* 452 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 453 */ "pseudo_column ::= QSTART", + /* 454 */ "pseudo_column ::= QEND", + /* 455 */ "pseudo_column ::= QDURATION", + /* 456 */ "pseudo_column ::= WSTART", + /* 457 */ "pseudo_column ::= WEND", + /* 458 */ "pseudo_column ::= WDURATION", + /* 459 */ "pseudo_column ::= IROWTS", + /* 460 */ "pseudo_column ::= ISFILLED", + /* 461 */ "pseudo_column ::= QTAGS", + /* 462 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 463 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 464 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 465 */ "function_expression ::= literal_func", + /* 466 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 467 */ "literal_func ::= NOW", + /* 468 */ "noarg_func ::= NOW", + /* 469 */ "noarg_func ::= TODAY", + /* 470 */ "noarg_func ::= TIMEZONE", + /* 471 */ "noarg_func ::= DATABASE", + /* 472 */ "noarg_func ::= CLIENT_VERSION", + /* 473 */ "noarg_func ::= SERVER_VERSION", + /* 474 */ "noarg_func ::= SERVER_STATUS", + /* 475 */ "noarg_func ::= CURRENT_USER", + /* 476 */ "noarg_func ::= USER", + /* 477 */ "star_func ::= COUNT", + /* 478 */ "star_func ::= FIRST", + /* 479 */ "star_func ::= LAST", + /* 480 */ "star_func ::= LAST_ROW", + /* 481 */ "star_func_para_list ::= NK_STAR", + /* 482 */ "star_func_para_list ::= other_para_list", + /* 483 */ "other_para_list ::= star_func_para", + /* 484 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 485 */ "star_func_para ::= expr_or_subquery", + /* 486 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 487 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 488 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 489 */ "when_then_list ::= when_then_expr", + /* 490 */ "when_then_list ::= when_then_list when_then_expr", + /* 491 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 492 */ "case_when_else_opt ::=", + /* 493 */ "case_when_else_opt ::= ELSE common_expression", + /* 494 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 495 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 496 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 497 */ "predicate ::= expr_or_subquery IS NULL", + /* 498 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 499 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 500 */ "compare_op ::= NK_LT", + /* 501 */ "compare_op ::= NK_GT", + /* 502 */ "compare_op ::= NK_LE", + /* 503 */ "compare_op ::= NK_GE", + /* 504 */ "compare_op ::= NK_NE", + /* 505 */ "compare_op ::= NK_EQ", + /* 506 */ "compare_op ::= LIKE", + /* 507 */ "compare_op ::= NOT LIKE", + /* 508 */ "compare_op ::= MATCH", + /* 509 */ "compare_op ::= NMATCH", + /* 510 */ "compare_op ::= CONTAINS", + /* 511 */ "in_op ::= IN", + /* 512 */ "in_op ::= NOT IN", + /* 513 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 514 */ "boolean_value_expression ::= boolean_primary", + /* 515 */ "boolean_value_expression ::= NOT boolean_primary", + /* 516 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 517 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 518 */ "boolean_primary ::= predicate", + /* 519 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 520 */ "common_expression ::= expr_or_subquery", + /* 521 */ "common_expression ::= boolean_value_expression", + /* 522 */ "from_clause_opt ::=", + /* 523 */ "from_clause_opt ::= FROM table_reference_list", + /* 524 */ "table_reference_list ::= table_reference", + /* 525 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 526 */ "table_reference ::= table_primary", + /* 527 */ "table_reference ::= joined_table", + /* 528 */ "table_primary ::= table_name alias_opt", + /* 529 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 530 */ "table_primary ::= subquery alias_opt", + /* 531 */ "table_primary ::= parenthesized_joined_table", + /* 532 */ "alias_opt ::=", + /* 533 */ "alias_opt ::= table_alias", + /* 534 */ "alias_opt ::= AS table_alias", + /* 535 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 536 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 537 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 538 */ "join_type ::=", + /* 539 */ "join_type ::= INNER", + /* 540 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 541 */ "hint_list ::=", + /* 542 */ "hint_list ::= NK_HINT", + /* 543 */ "tag_mode_opt ::=", + /* 544 */ "tag_mode_opt ::= TAGS", + /* 545 */ "set_quantifier_opt ::=", + /* 546 */ "set_quantifier_opt ::= DISTINCT", + /* 547 */ "set_quantifier_opt ::= ALL", + /* 548 */ "select_list ::= select_item", + /* 549 */ "select_list ::= select_list NK_COMMA select_item", + /* 550 */ "select_item ::= NK_STAR", + /* 551 */ "select_item ::= common_expression", + /* 552 */ "select_item ::= common_expression column_alias", + /* 553 */ "select_item ::= common_expression AS column_alias", + /* 554 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 555 */ "where_clause_opt ::=", + /* 556 */ "where_clause_opt ::= WHERE search_condition", + /* 557 */ "partition_by_clause_opt ::=", + /* 558 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 559 */ "partition_list ::= partition_item", + /* 560 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 561 */ "partition_item ::= expr_or_subquery", + /* 562 */ "partition_item ::= expr_or_subquery column_alias", + /* 563 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 564 */ "twindow_clause_opt ::=", + /* 565 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 566 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 567 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 568 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 569 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 570 */ "sliding_opt ::=", + /* 571 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 572 */ "fill_opt ::=", + /* 573 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 574 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 575 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 576 */ "fill_mode ::= NONE", + /* 577 */ "fill_mode ::= PREV", + /* 578 */ "fill_mode ::= NULL", + /* 579 */ "fill_mode ::= NULL_F", + /* 580 */ "fill_mode ::= LINEAR", + /* 581 */ "fill_mode ::= NEXT", + /* 582 */ "group_by_clause_opt ::=", + /* 583 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 584 */ "group_by_list ::= expr_or_subquery", + /* 585 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 586 */ "having_clause_opt ::=", + /* 587 */ "having_clause_opt ::= HAVING search_condition", + /* 588 */ "range_opt ::=", + /* 589 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 590 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 591 */ "every_opt ::=", + /* 592 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 593 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 594 */ "query_simple ::= query_specification", + /* 595 */ "query_simple ::= union_query_expression", + /* 596 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 597 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 598 */ "query_simple_or_subquery ::= query_simple", + /* 599 */ "query_simple_or_subquery ::= subquery", + /* 600 */ "query_or_subquery ::= query_expression", + /* 601 */ "query_or_subquery ::= subquery", + /* 602 */ "order_by_clause_opt ::=", + /* 603 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 604 */ "slimit_clause_opt ::=", + /* 605 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 606 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 607 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 608 */ "limit_clause_opt ::=", + /* 609 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 610 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 611 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 612 */ "subquery ::= NK_LP query_expression NK_RP", + /* 613 */ "subquery ::= NK_LP subquery NK_RP", + /* 614 */ "search_condition ::= common_expression", + /* 615 */ "sort_specification_list ::= sort_specification", + /* 616 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 617 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 618 */ "ordering_specification_opt ::=", + /* 619 */ "ordering_specification_opt ::= ASC", + /* 620 */ "ordering_specification_opt ::= DESC", + /* 621 */ "null_ordering_opt ::=", + /* 622 */ "null_ordering_opt ::= NULLS FIRST", + /* 623 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3174,46 +3205,46 @@ static void yy_destructor( case 434: /* stream_options */ case 437: /* subtable_opt */ case 439: /* expression */ - case 441: /* literal_func */ - case 444: /* expr_or_subquery */ - case 445: /* pseudo_column */ - case 446: /* column_reference */ - case 447: /* function_expression */ - case 448: /* case_when_expression */ - case 453: /* star_func_para */ - case 455: /* case_when_else_opt */ - case 456: /* common_expression */ - case 457: /* when_then_expr */ - case 458: /* predicate */ - case 461: /* in_predicate_value */ - case 462: /* boolean_value_expression */ - case 463: /* boolean_primary */ - case 464: /* from_clause_opt */ - case 465: /* table_reference_list */ - case 466: /* table_reference */ - case 467: /* table_primary */ - case 468: /* joined_table */ - case 470: /* subquery */ - case 471: /* parenthesized_joined_table */ - case 473: /* query_specification */ - case 479: /* range_opt */ - case 480: /* every_opt */ - case 481: /* fill_opt */ - case 482: /* twindow_clause_opt */ - case 484: /* having_clause_opt */ - case 485: /* select_item */ - case 487: /* partition_item */ - case 490: /* query_expression */ - case 491: /* query_simple */ - case 493: /* slimit_clause_opt */ - case 494: /* limit_clause_opt */ - case 495: /* union_query_expression */ - case 496: /* query_simple_or_subquery */ - case 498: /* sort_specification */ + case 442: /* literal_func */ + case 445: /* expr_or_subquery */ + case 446: /* pseudo_column */ + case 447: /* column_reference */ + case 448: /* function_expression */ + case 449: /* case_when_expression */ + case 454: /* star_func_para */ + case 456: /* case_when_else_opt */ + case 457: /* common_expression */ + case 458: /* when_then_expr */ + case 459: /* predicate */ + case 462: /* in_predicate_value */ + case 463: /* boolean_value_expression */ + case 464: /* boolean_primary */ + case 465: /* from_clause_opt */ + case 466: /* table_reference_list */ + case 467: /* table_reference */ + case 468: /* table_primary */ + case 469: /* joined_table */ + case 471: /* subquery */ + case 472: /* parenthesized_joined_table */ + case 474: /* query_specification */ + case 480: /* range_opt */ + case 481: /* every_opt */ + case 482: /* fill_opt */ + case 483: /* twindow_clause_opt */ + case 485: /* having_clause_opt */ + case 486: /* select_item */ + case 488: /* partition_item */ + case 491: /* query_expression */ + case 492: /* query_simple */ + case 494: /* slimit_clause_opt */ + case 495: /* limit_clause_opt */ + case 496: /* union_query_expression */ + case 497: /* query_simple_or_subquery */ + case 499: /* sort_specification */ { #line 7 "sql.y" - nodesDestroyNode((yypminor->yy122)); -#line 3216 "sql.c" + nodesDestroyNode((yypminor->yy348)); +#line 3247 "sql.c" } break; case 345: /* account_options */ @@ -3225,7 +3256,7 @@ static void yy_destructor( { #line 54 "sql.y" -#line 3228 "sql.c" +#line 3259 "sql.c" } break; case 349: /* ip_range_list */ @@ -3248,23 +3279,23 @@ static void yy_destructor( case 417: /* func_list */ case 435: /* col_list_opt */ case 436: /* tag_def_or_ref_opt */ - case 440: /* dnode_list */ - case 442: /* literal_list */ - case 450: /* star_func_para_list */ - case 452: /* other_para_list */ - case 454: /* when_then_list */ - case 474: /* hint_list */ - case 477: /* select_list */ - case 478: /* partition_by_clause_opt */ - case 483: /* group_by_clause_opt */ - case 486: /* partition_list */ - case 489: /* group_by_list */ - case 492: /* order_by_clause_opt */ - case 497: /* sort_specification_list */ + case 441: /* dnode_list */ + case 443: /* literal_list */ + case 451: /* star_func_para_list */ + case 453: /* other_para_list */ + case 455: /* when_then_list */ + case 475: /* hint_list */ + case 478: /* select_list */ + case 479: /* partition_by_clause_opt */ + case 484: /* group_by_clause_opt */ + case 487: /* partition_list */ + case 490: /* group_by_list */ + case 493: /* order_by_clause_opt */ + case 498: /* sort_specification_list */ { #line 85 "sql.y" - nodesDestroyList((yypminor->yy298)); -#line 3267 "sql.c" + nodesDestroyList((yypminor->yy860)); +#line 3298 "sql.c" } break; case 352: /* user_name */ @@ -3280,21 +3311,22 @@ static void yy_destructor( case 425: /* cgroup_name */ case 432: /* language_opt */ case 433: /* stream_name */ - case 443: /* table_alias */ - case 449: /* star_func */ - case 451: /* noarg_func */ - case 469: /* alias_opt */ + case 440: /* on_vgroup_id */ + case 444: /* table_alias */ + case 450: /* star_func */ + case 452: /* noarg_func */ + case 470: /* alias_opt */ { -#line 787 "sql.y" +#line 792 "sql.y" -#line 3290 "sql.c" +#line 3322 "sql.c" } break; case 353: /* sysinfo_opt */ { #line 112 "sql.y" -#line 3297 "sql.c" +#line 3329 "sql.c" } break; case 354: /* privileges */ @@ -3303,14 +3335,14 @@ static void yy_destructor( { #line 121 "sql.y" -#line 3306 "sql.c" +#line 3338 "sql.c" } break; case 355: /* priv_level */ { #line 137 "sql.y" -#line 3313 "sql.c" +#line 3345 "sql.c" } break; case 364: /* force_opt */ @@ -3321,12 +3353,12 @@ static void yy_destructor( case 429: /* or_replace_opt */ case 430: /* agg_func_opt */ case 438: /* ignore_opt */ - case 475: /* set_quantifier_opt */ - case 476: /* tag_mode_opt */ + case 476: /* set_quantifier_opt */ + case 477: /* tag_mode_opt */ { #line 166 "sql.y" -#line 3329 "sql.c" +#line 3361 "sql.c" } break; case 377: /* alter_db_option */ @@ -3334,14 +3366,14 @@ static void yy_destructor( { #line 264 "sql.y" -#line 3337 "sql.c" +#line 3369 "sql.c" } break; case 389: /* type_name */ { #line 386 "sql.y" -#line 3344 "sql.c" +#line 3376 "sql.c" } break; case 404: /* db_kind_opt */ @@ -3349,50 +3381,50 @@ static void yy_destructor( { #line 547 "sql.y" -#line 3352 "sql.c" +#line 3384 "sql.c" } break; case 405: /* table_kind_db_name_cond_opt */ { #line 512 "sql.y" -#line 3359 "sql.c" +#line 3391 "sql.c" } break; - case 459: /* compare_op */ - case 460: /* in_op */ + case 460: /* compare_op */ + case 461: /* in_op */ { -#line 975 "sql.y" +#line 980 "sql.y" -#line 3367 "sql.c" +#line 3399 "sql.c" } break; - case 472: /* join_type */ + case 473: /* join_type */ { -#line 1051 "sql.y" +#line 1056 "sql.y" -#line 3374 "sql.c" +#line 3406 "sql.c" } break; - case 488: /* fill_mode */ + case 489: /* fill_mode */ { -#line 1137 "sql.y" +#line 1142 "sql.y" -#line 3381 "sql.c" +#line 3413 "sql.c" } break; - case 499: /* ordering_specification_opt */ + case 500: /* ordering_specification_opt */ { -#line 1222 "sql.y" +#line 1227 "sql.y" -#line 3388 "sql.c" +#line 3420 "sql.c" } break; - case 500: /* null_ordering_opt */ + case 501: /* null_ordering_opt */ { -#line 1228 "sql.y" +#line 1233 "sql.y" -#line 3395 "sql.c" +#line 3427 "sql.c" } break; /********* End destructor definitions *****************************************/ @@ -4061,248 +4093,250 @@ static const YYCODETYPE yyRuleInfoLhs[] = { 344, /* (377) cmd ::= KILL QUERY NK_STRING */ 344, /* (378) cmd ::= KILL TRANSACTION NK_INTEGER */ 344, /* (379) cmd ::= BALANCE VGROUP */ - 344, /* (380) cmd ::= BALANCE VGROUP LEADER */ + 344, /* (380) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ 344, /* (381) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ 344, /* (382) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ 344, /* (383) cmd ::= SPLIT VGROUP NK_INTEGER */ - 440, /* (384) dnode_list ::= DNODE NK_INTEGER */ - 440, /* (385) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 344, /* (386) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 344, /* (387) cmd ::= query_or_subquery */ - 344, /* (388) cmd ::= insert_query */ - 428, /* (389) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 428, /* (390) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 347, /* (391) literal ::= NK_INTEGER */ - 347, /* (392) literal ::= NK_FLOAT */ - 347, /* (393) literal ::= NK_STRING */ - 347, /* (394) literal ::= NK_BOOL */ - 347, /* (395) literal ::= TIMESTAMP NK_STRING */ - 347, /* (396) literal ::= duration_literal */ - 347, /* (397) literal ::= NULL */ - 347, /* (398) literal ::= NK_QUESTION */ - 400, /* (399) duration_literal ::= NK_VARIABLE */ - 376, /* (400) signed ::= NK_INTEGER */ - 376, /* (401) signed ::= NK_PLUS NK_INTEGER */ - 376, /* (402) signed ::= NK_MINUS NK_INTEGER */ - 376, /* (403) signed ::= NK_FLOAT */ - 376, /* (404) signed ::= NK_PLUS NK_FLOAT */ - 376, /* (405) signed ::= NK_MINUS NK_FLOAT */ - 390, /* (406) signed_literal ::= signed */ - 390, /* (407) signed_literal ::= NK_STRING */ - 390, /* (408) signed_literal ::= NK_BOOL */ - 390, /* (409) signed_literal ::= TIMESTAMP NK_STRING */ - 390, /* (410) signed_literal ::= duration_literal */ - 390, /* (411) signed_literal ::= NULL */ - 390, /* (412) signed_literal ::= literal_func */ - 390, /* (413) signed_literal ::= NK_QUESTION */ - 442, /* (414) literal_list ::= signed_literal */ - 442, /* (415) literal_list ::= literal_list NK_COMMA signed_literal */ - 359, /* (416) db_name ::= NK_ID */ - 360, /* (417) table_name ::= NK_ID */ - 388, /* (418) column_name ::= NK_ID */ - 402, /* (419) function_name ::= NK_ID */ - 443, /* (420) table_alias ::= NK_ID */ - 413, /* (421) column_alias ::= NK_ID */ - 352, /* (422) user_name ::= NK_ID */ - 361, /* (423) topic_name ::= NK_ID */ - 433, /* (424) stream_name ::= NK_ID */ - 425, /* (425) cgroup_name ::= NK_ID */ - 416, /* (426) index_name ::= NK_ID */ - 444, /* (427) expr_or_subquery ::= expression */ - 439, /* (428) expression ::= literal */ - 439, /* (429) expression ::= pseudo_column */ - 439, /* (430) expression ::= column_reference */ - 439, /* (431) expression ::= function_expression */ - 439, /* (432) expression ::= case_when_expression */ - 439, /* (433) expression ::= NK_LP expression NK_RP */ - 439, /* (434) expression ::= NK_PLUS expr_or_subquery */ - 439, /* (435) expression ::= NK_MINUS expr_or_subquery */ - 439, /* (436) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 439, /* (437) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 439, /* (438) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 439, /* (439) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 439, /* (440) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 439, /* (441) expression ::= column_reference NK_ARROW NK_STRING */ - 439, /* (442) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 439, /* (443) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 393, /* (444) expression_list ::= expr_or_subquery */ - 393, /* (445) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 446, /* (446) column_reference ::= column_name */ - 446, /* (447) column_reference ::= table_name NK_DOT column_name */ - 445, /* (448) pseudo_column ::= ROWTS */ - 445, /* (449) pseudo_column ::= TBNAME */ - 445, /* (450) pseudo_column ::= table_name NK_DOT TBNAME */ - 445, /* (451) pseudo_column ::= QSTART */ - 445, /* (452) pseudo_column ::= QEND */ - 445, /* (453) pseudo_column ::= QDURATION */ - 445, /* (454) pseudo_column ::= WSTART */ - 445, /* (455) pseudo_column ::= WEND */ - 445, /* (456) pseudo_column ::= WDURATION */ - 445, /* (457) pseudo_column ::= IROWTS */ - 445, /* (458) pseudo_column ::= ISFILLED */ - 445, /* (459) pseudo_column ::= QTAGS */ - 447, /* (460) function_expression ::= function_name NK_LP expression_list NK_RP */ - 447, /* (461) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 447, /* (462) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 447, /* (463) function_expression ::= literal_func */ - 441, /* (464) literal_func ::= noarg_func NK_LP NK_RP */ - 441, /* (465) literal_func ::= NOW */ - 451, /* (466) noarg_func ::= NOW */ - 451, /* (467) noarg_func ::= TODAY */ - 451, /* (468) noarg_func ::= TIMEZONE */ - 451, /* (469) noarg_func ::= DATABASE */ - 451, /* (470) noarg_func ::= CLIENT_VERSION */ - 451, /* (471) noarg_func ::= SERVER_VERSION */ - 451, /* (472) noarg_func ::= SERVER_STATUS */ - 451, /* (473) noarg_func ::= CURRENT_USER */ - 451, /* (474) noarg_func ::= USER */ - 449, /* (475) star_func ::= COUNT */ - 449, /* (476) star_func ::= FIRST */ - 449, /* (477) star_func ::= LAST */ - 449, /* (478) star_func ::= LAST_ROW */ - 450, /* (479) star_func_para_list ::= NK_STAR */ - 450, /* (480) star_func_para_list ::= other_para_list */ - 452, /* (481) other_para_list ::= star_func_para */ - 452, /* (482) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 453, /* (483) star_func_para ::= expr_or_subquery */ - 453, /* (484) star_func_para ::= table_name NK_DOT NK_STAR */ - 448, /* (485) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 448, /* (486) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 454, /* (487) when_then_list ::= when_then_expr */ - 454, /* (488) when_then_list ::= when_then_list when_then_expr */ - 457, /* (489) when_then_expr ::= WHEN common_expression THEN common_expression */ - 455, /* (490) case_when_else_opt ::= */ - 455, /* (491) case_when_else_opt ::= ELSE common_expression */ - 458, /* (492) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 458, /* (493) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 458, /* (494) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 458, /* (495) predicate ::= expr_or_subquery IS NULL */ - 458, /* (496) predicate ::= expr_or_subquery IS NOT NULL */ - 458, /* (497) predicate ::= expr_or_subquery in_op in_predicate_value */ - 459, /* (498) compare_op ::= NK_LT */ - 459, /* (499) compare_op ::= NK_GT */ - 459, /* (500) compare_op ::= NK_LE */ - 459, /* (501) compare_op ::= NK_GE */ - 459, /* (502) compare_op ::= NK_NE */ - 459, /* (503) compare_op ::= NK_EQ */ - 459, /* (504) compare_op ::= LIKE */ - 459, /* (505) compare_op ::= NOT LIKE */ - 459, /* (506) compare_op ::= MATCH */ - 459, /* (507) compare_op ::= NMATCH */ - 459, /* (508) compare_op ::= CONTAINS */ - 460, /* (509) in_op ::= IN */ - 460, /* (510) in_op ::= NOT IN */ - 461, /* (511) in_predicate_value ::= NK_LP literal_list NK_RP */ - 462, /* (512) boolean_value_expression ::= boolean_primary */ - 462, /* (513) boolean_value_expression ::= NOT boolean_primary */ - 462, /* (514) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 462, /* (515) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 463, /* (516) boolean_primary ::= predicate */ - 463, /* (517) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 456, /* (518) common_expression ::= expr_or_subquery */ - 456, /* (519) common_expression ::= boolean_value_expression */ - 464, /* (520) from_clause_opt ::= */ - 464, /* (521) from_clause_opt ::= FROM table_reference_list */ - 465, /* (522) table_reference_list ::= table_reference */ - 465, /* (523) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 466, /* (524) table_reference ::= table_primary */ - 466, /* (525) table_reference ::= joined_table */ - 467, /* (526) table_primary ::= table_name alias_opt */ - 467, /* (527) table_primary ::= db_name NK_DOT table_name alias_opt */ - 467, /* (528) table_primary ::= subquery alias_opt */ - 467, /* (529) table_primary ::= parenthesized_joined_table */ - 469, /* (530) alias_opt ::= */ - 469, /* (531) alias_opt ::= table_alias */ - 469, /* (532) alias_opt ::= AS table_alias */ - 471, /* (533) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 471, /* (534) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 468, /* (535) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 472, /* (536) join_type ::= */ - 472, /* (537) join_type ::= INNER */ - 473, /* (538) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 474, /* (539) hint_list ::= */ - 474, /* (540) hint_list ::= NK_HINT */ - 476, /* (541) tag_mode_opt ::= */ - 476, /* (542) tag_mode_opt ::= TAGS */ - 475, /* (543) set_quantifier_opt ::= */ - 475, /* (544) set_quantifier_opt ::= DISTINCT */ - 475, /* (545) set_quantifier_opt ::= ALL */ - 477, /* (546) select_list ::= select_item */ - 477, /* (547) select_list ::= select_list NK_COMMA select_item */ - 485, /* (548) select_item ::= NK_STAR */ - 485, /* (549) select_item ::= common_expression */ - 485, /* (550) select_item ::= common_expression column_alias */ - 485, /* (551) select_item ::= common_expression AS column_alias */ - 485, /* (552) select_item ::= table_name NK_DOT NK_STAR */ - 424, /* (553) where_clause_opt ::= */ - 424, /* (554) where_clause_opt ::= WHERE search_condition */ - 478, /* (555) partition_by_clause_opt ::= */ - 478, /* (556) partition_by_clause_opt ::= PARTITION BY partition_list */ - 486, /* (557) partition_list ::= partition_item */ - 486, /* (558) partition_list ::= partition_list NK_COMMA partition_item */ - 487, /* (559) partition_item ::= expr_or_subquery */ - 487, /* (560) partition_item ::= expr_or_subquery column_alias */ - 487, /* (561) partition_item ::= expr_or_subquery AS column_alias */ - 482, /* (562) twindow_clause_opt ::= */ - 482, /* (563) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - 482, /* (564) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 482, /* (565) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - 482, /* (566) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - 482, /* (567) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 418, /* (568) sliding_opt ::= */ - 418, /* (569) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 481, /* (570) fill_opt ::= */ - 481, /* (571) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 481, /* (572) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 481, /* (573) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 488, /* (574) fill_mode ::= NONE */ - 488, /* (575) fill_mode ::= PREV */ - 488, /* (576) fill_mode ::= NULL */ - 488, /* (577) fill_mode ::= NULL_F */ - 488, /* (578) fill_mode ::= LINEAR */ - 488, /* (579) fill_mode ::= NEXT */ - 483, /* (580) group_by_clause_opt ::= */ - 483, /* (581) group_by_clause_opt ::= GROUP BY group_by_list */ - 489, /* (582) group_by_list ::= expr_or_subquery */ - 489, /* (583) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 484, /* (584) having_clause_opt ::= */ - 484, /* (585) having_clause_opt ::= HAVING search_condition */ - 479, /* (586) range_opt ::= */ - 479, /* (587) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 479, /* (588) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 480, /* (589) every_opt ::= */ - 480, /* (590) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 490, /* (591) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 491, /* (592) query_simple ::= query_specification */ - 491, /* (593) query_simple ::= union_query_expression */ - 495, /* (594) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 495, /* (595) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 496, /* (596) query_simple_or_subquery ::= query_simple */ - 496, /* (597) query_simple_or_subquery ::= subquery */ - 423, /* (598) query_or_subquery ::= query_expression */ - 423, /* (599) query_or_subquery ::= subquery */ - 492, /* (600) order_by_clause_opt ::= */ - 492, /* (601) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 493, /* (602) slimit_clause_opt ::= */ - 493, /* (603) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 493, /* (604) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 493, /* (605) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 494, /* (606) limit_clause_opt ::= */ - 494, /* (607) limit_clause_opt ::= LIMIT NK_INTEGER */ - 494, /* (608) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 494, /* (609) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 470, /* (610) subquery ::= NK_LP query_expression NK_RP */ - 470, /* (611) subquery ::= NK_LP subquery NK_RP */ - 362, /* (612) search_condition ::= common_expression */ - 497, /* (613) sort_specification_list ::= sort_specification */ - 497, /* (614) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 498, /* (615) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 499, /* (616) ordering_specification_opt ::= */ - 499, /* (617) ordering_specification_opt ::= ASC */ - 499, /* (618) ordering_specification_opt ::= DESC */ - 500, /* (619) null_ordering_opt ::= */ - 500, /* (620) null_ordering_opt ::= NULLS FIRST */ - 500, /* (621) null_ordering_opt ::= NULLS LAST */ + 440, /* (384) on_vgroup_id ::= */ + 440, /* (385) on_vgroup_id ::= ON NK_INTEGER */ + 441, /* (386) dnode_list ::= DNODE NK_INTEGER */ + 441, /* (387) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 344, /* (388) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 344, /* (389) cmd ::= query_or_subquery */ + 344, /* (390) cmd ::= insert_query */ + 428, /* (391) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 428, /* (392) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 347, /* (393) literal ::= NK_INTEGER */ + 347, /* (394) literal ::= NK_FLOAT */ + 347, /* (395) literal ::= NK_STRING */ + 347, /* (396) literal ::= NK_BOOL */ + 347, /* (397) literal ::= TIMESTAMP NK_STRING */ + 347, /* (398) literal ::= duration_literal */ + 347, /* (399) literal ::= NULL */ + 347, /* (400) literal ::= NK_QUESTION */ + 400, /* (401) duration_literal ::= NK_VARIABLE */ + 376, /* (402) signed ::= NK_INTEGER */ + 376, /* (403) signed ::= NK_PLUS NK_INTEGER */ + 376, /* (404) signed ::= NK_MINUS NK_INTEGER */ + 376, /* (405) signed ::= NK_FLOAT */ + 376, /* (406) signed ::= NK_PLUS NK_FLOAT */ + 376, /* (407) signed ::= NK_MINUS NK_FLOAT */ + 390, /* (408) signed_literal ::= signed */ + 390, /* (409) signed_literal ::= NK_STRING */ + 390, /* (410) signed_literal ::= NK_BOOL */ + 390, /* (411) signed_literal ::= TIMESTAMP NK_STRING */ + 390, /* (412) signed_literal ::= duration_literal */ + 390, /* (413) signed_literal ::= NULL */ + 390, /* (414) signed_literal ::= literal_func */ + 390, /* (415) signed_literal ::= NK_QUESTION */ + 443, /* (416) literal_list ::= signed_literal */ + 443, /* (417) literal_list ::= literal_list NK_COMMA signed_literal */ + 359, /* (418) db_name ::= NK_ID */ + 360, /* (419) table_name ::= NK_ID */ + 388, /* (420) column_name ::= NK_ID */ + 402, /* (421) function_name ::= NK_ID */ + 444, /* (422) table_alias ::= NK_ID */ + 413, /* (423) column_alias ::= NK_ID */ + 352, /* (424) user_name ::= NK_ID */ + 361, /* (425) topic_name ::= NK_ID */ + 433, /* (426) stream_name ::= NK_ID */ + 425, /* (427) cgroup_name ::= NK_ID */ + 416, /* (428) index_name ::= NK_ID */ + 445, /* (429) expr_or_subquery ::= expression */ + 439, /* (430) expression ::= literal */ + 439, /* (431) expression ::= pseudo_column */ + 439, /* (432) expression ::= column_reference */ + 439, /* (433) expression ::= function_expression */ + 439, /* (434) expression ::= case_when_expression */ + 439, /* (435) expression ::= NK_LP expression NK_RP */ + 439, /* (436) expression ::= NK_PLUS expr_or_subquery */ + 439, /* (437) expression ::= NK_MINUS expr_or_subquery */ + 439, /* (438) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 439, /* (439) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 439, /* (440) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 439, /* (441) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 439, /* (442) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 439, /* (443) expression ::= column_reference NK_ARROW NK_STRING */ + 439, /* (444) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 439, /* (445) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 393, /* (446) expression_list ::= expr_or_subquery */ + 393, /* (447) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 447, /* (448) column_reference ::= column_name */ + 447, /* (449) column_reference ::= table_name NK_DOT column_name */ + 446, /* (450) pseudo_column ::= ROWTS */ + 446, /* (451) pseudo_column ::= TBNAME */ + 446, /* (452) pseudo_column ::= table_name NK_DOT TBNAME */ + 446, /* (453) pseudo_column ::= QSTART */ + 446, /* (454) pseudo_column ::= QEND */ + 446, /* (455) pseudo_column ::= QDURATION */ + 446, /* (456) pseudo_column ::= WSTART */ + 446, /* (457) pseudo_column ::= WEND */ + 446, /* (458) pseudo_column ::= WDURATION */ + 446, /* (459) pseudo_column ::= IROWTS */ + 446, /* (460) pseudo_column ::= ISFILLED */ + 446, /* (461) pseudo_column ::= QTAGS */ + 448, /* (462) function_expression ::= function_name NK_LP expression_list NK_RP */ + 448, /* (463) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 448, /* (464) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 448, /* (465) function_expression ::= literal_func */ + 442, /* (466) literal_func ::= noarg_func NK_LP NK_RP */ + 442, /* (467) literal_func ::= NOW */ + 452, /* (468) noarg_func ::= NOW */ + 452, /* (469) noarg_func ::= TODAY */ + 452, /* (470) noarg_func ::= TIMEZONE */ + 452, /* (471) noarg_func ::= DATABASE */ + 452, /* (472) noarg_func ::= CLIENT_VERSION */ + 452, /* (473) noarg_func ::= SERVER_VERSION */ + 452, /* (474) noarg_func ::= SERVER_STATUS */ + 452, /* (475) noarg_func ::= CURRENT_USER */ + 452, /* (476) noarg_func ::= USER */ + 450, /* (477) star_func ::= COUNT */ + 450, /* (478) star_func ::= FIRST */ + 450, /* (479) star_func ::= LAST */ + 450, /* (480) star_func ::= LAST_ROW */ + 451, /* (481) star_func_para_list ::= NK_STAR */ + 451, /* (482) star_func_para_list ::= other_para_list */ + 453, /* (483) other_para_list ::= star_func_para */ + 453, /* (484) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 454, /* (485) star_func_para ::= expr_or_subquery */ + 454, /* (486) star_func_para ::= table_name NK_DOT NK_STAR */ + 449, /* (487) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 449, /* (488) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 455, /* (489) when_then_list ::= when_then_expr */ + 455, /* (490) when_then_list ::= when_then_list when_then_expr */ + 458, /* (491) when_then_expr ::= WHEN common_expression THEN common_expression */ + 456, /* (492) case_when_else_opt ::= */ + 456, /* (493) case_when_else_opt ::= ELSE common_expression */ + 459, /* (494) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 459, /* (495) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 459, /* (496) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 459, /* (497) predicate ::= expr_or_subquery IS NULL */ + 459, /* (498) predicate ::= expr_or_subquery IS NOT NULL */ + 459, /* (499) predicate ::= expr_or_subquery in_op in_predicate_value */ + 460, /* (500) compare_op ::= NK_LT */ + 460, /* (501) compare_op ::= NK_GT */ + 460, /* (502) compare_op ::= NK_LE */ + 460, /* (503) compare_op ::= NK_GE */ + 460, /* (504) compare_op ::= NK_NE */ + 460, /* (505) compare_op ::= NK_EQ */ + 460, /* (506) compare_op ::= LIKE */ + 460, /* (507) compare_op ::= NOT LIKE */ + 460, /* (508) compare_op ::= MATCH */ + 460, /* (509) compare_op ::= NMATCH */ + 460, /* (510) compare_op ::= CONTAINS */ + 461, /* (511) in_op ::= IN */ + 461, /* (512) in_op ::= NOT IN */ + 462, /* (513) in_predicate_value ::= NK_LP literal_list NK_RP */ + 463, /* (514) boolean_value_expression ::= boolean_primary */ + 463, /* (515) boolean_value_expression ::= NOT boolean_primary */ + 463, /* (516) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 463, /* (517) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 464, /* (518) boolean_primary ::= predicate */ + 464, /* (519) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 457, /* (520) common_expression ::= expr_or_subquery */ + 457, /* (521) common_expression ::= boolean_value_expression */ + 465, /* (522) from_clause_opt ::= */ + 465, /* (523) from_clause_opt ::= FROM table_reference_list */ + 466, /* (524) table_reference_list ::= table_reference */ + 466, /* (525) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 467, /* (526) table_reference ::= table_primary */ + 467, /* (527) table_reference ::= joined_table */ + 468, /* (528) table_primary ::= table_name alias_opt */ + 468, /* (529) table_primary ::= db_name NK_DOT table_name alias_opt */ + 468, /* (530) table_primary ::= subquery alias_opt */ + 468, /* (531) table_primary ::= parenthesized_joined_table */ + 470, /* (532) alias_opt ::= */ + 470, /* (533) alias_opt ::= table_alias */ + 470, /* (534) alias_opt ::= AS table_alias */ + 472, /* (535) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 472, /* (536) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 469, /* (537) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 473, /* (538) join_type ::= */ + 473, /* (539) join_type ::= INNER */ + 474, /* (540) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 475, /* (541) hint_list ::= */ + 475, /* (542) hint_list ::= NK_HINT */ + 477, /* (543) tag_mode_opt ::= */ + 477, /* (544) tag_mode_opt ::= TAGS */ + 476, /* (545) set_quantifier_opt ::= */ + 476, /* (546) set_quantifier_opt ::= DISTINCT */ + 476, /* (547) set_quantifier_opt ::= ALL */ + 478, /* (548) select_list ::= select_item */ + 478, /* (549) select_list ::= select_list NK_COMMA select_item */ + 486, /* (550) select_item ::= NK_STAR */ + 486, /* (551) select_item ::= common_expression */ + 486, /* (552) select_item ::= common_expression column_alias */ + 486, /* (553) select_item ::= common_expression AS column_alias */ + 486, /* (554) select_item ::= table_name NK_DOT NK_STAR */ + 424, /* (555) where_clause_opt ::= */ + 424, /* (556) where_clause_opt ::= WHERE search_condition */ + 479, /* (557) partition_by_clause_opt ::= */ + 479, /* (558) partition_by_clause_opt ::= PARTITION BY partition_list */ + 487, /* (559) partition_list ::= partition_item */ + 487, /* (560) partition_list ::= partition_list NK_COMMA partition_item */ + 488, /* (561) partition_item ::= expr_or_subquery */ + 488, /* (562) partition_item ::= expr_or_subquery column_alias */ + 488, /* (563) partition_item ::= expr_or_subquery AS column_alias */ + 483, /* (564) twindow_clause_opt ::= */ + 483, /* (565) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + 483, /* (566) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 483, /* (567) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + 483, /* (568) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + 483, /* (569) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 418, /* (570) sliding_opt ::= */ + 418, /* (571) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 482, /* (572) fill_opt ::= */ + 482, /* (573) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 482, /* (574) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 482, /* (575) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 489, /* (576) fill_mode ::= NONE */ + 489, /* (577) fill_mode ::= PREV */ + 489, /* (578) fill_mode ::= NULL */ + 489, /* (579) fill_mode ::= NULL_F */ + 489, /* (580) fill_mode ::= LINEAR */ + 489, /* (581) fill_mode ::= NEXT */ + 484, /* (582) group_by_clause_opt ::= */ + 484, /* (583) group_by_clause_opt ::= GROUP BY group_by_list */ + 490, /* (584) group_by_list ::= expr_or_subquery */ + 490, /* (585) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 485, /* (586) having_clause_opt ::= */ + 485, /* (587) having_clause_opt ::= HAVING search_condition */ + 480, /* (588) range_opt ::= */ + 480, /* (589) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 480, /* (590) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 481, /* (591) every_opt ::= */ + 481, /* (592) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 491, /* (593) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 492, /* (594) query_simple ::= query_specification */ + 492, /* (595) query_simple ::= union_query_expression */ + 496, /* (596) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 496, /* (597) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 497, /* (598) query_simple_or_subquery ::= query_simple */ + 497, /* (599) query_simple_or_subquery ::= subquery */ + 423, /* (600) query_or_subquery ::= query_expression */ + 423, /* (601) query_or_subquery ::= subquery */ + 493, /* (602) order_by_clause_opt ::= */ + 493, /* (603) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 494, /* (604) slimit_clause_opt ::= */ + 494, /* (605) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 494, /* (606) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 494, /* (607) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 495, /* (608) limit_clause_opt ::= */ + 495, /* (609) limit_clause_opt ::= LIMIT NK_INTEGER */ + 495, /* (610) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 495, /* (611) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 471, /* (612) subquery ::= NK_LP query_expression NK_RP */ + 471, /* (613) subquery ::= NK_LP subquery NK_RP */ + 362, /* (614) search_condition ::= common_expression */ + 498, /* (615) sort_specification_list ::= sort_specification */ + 498, /* (616) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 499, /* (617) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 500, /* (618) ordering_specification_opt ::= */ + 500, /* (619) ordering_specification_opt ::= ASC */ + 500, /* (620) ordering_specification_opt ::= DESC */ + 501, /* (621) null_ordering_opt ::= */ + 501, /* (622) null_ordering_opt ::= NULLS FIRST */ + 501, /* (623) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4688,248 +4722,250 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (377) cmd ::= KILL QUERY NK_STRING */ -3, /* (378) cmd ::= KILL TRANSACTION NK_INTEGER */ -2, /* (379) cmd ::= BALANCE VGROUP */ - -3, /* (380) cmd ::= BALANCE VGROUP LEADER */ + -4, /* (380) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -4, /* (381) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ -4, /* (382) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -3, /* (383) cmd ::= SPLIT VGROUP NK_INTEGER */ - -2, /* (384) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (385) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (386) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (387) cmd ::= query_or_subquery */ - -1, /* (388) cmd ::= insert_query */ - -7, /* (389) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (390) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (391) literal ::= NK_INTEGER */ - -1, /* (392) literal ::= NK_FLOAT */ - -1, /* (393) literal ::= NK_STRING */ - -1, /* (394) literal ::= NK_BOOL */ - -2, /* (395) literal ::= TIMESTAMP NK_STRING */ - -1, /* (396) literal ::= duration_literal */ - -1, /* (397) literal ::= NULL */ - -1, /* (398) literal ::= NK_QUESTION */ - -1, /* (399) duration_literal ::= NK_VARIABLE */ - -1, /* (400) signed ::= NK_INTEGER */ - -2, /* (401) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (402) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (403) signed ::= NK_FLOAT */ - -2, /* (404) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (405) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (406) signed_literal ::= signed */ - -1, /* (407) signed_literal ::= NK_STRING */ - -1, /* (408) signed_literal ::= NK_BOOL */ - -2, /* (409) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (410) signed_literal ::= duration_literal */ - -1, /* (411) signed_literal ::= NULL */ - -1, /* (412) signed_literal ::= literal_func */ - -1, /* (413) signed_literal ::= NK_QUESTION */ - -1, /* (414) literal_list ::= signed_literal */ - -3, /* (415) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (416) db_name ::= NK_ID */ - -1, /* (417) table_name ::= NK_ID */ - -1, /* (418) column_name ::= NK_ID */ - -1, /* (419) function_name ::= NK_ID */ - -1, /* (420) table_alias ::= NK_ID */ - -1, /* (421) column_alias ::= NK_ID */ - -1, /* (422) user_name ::= NK_ID */ - -1, /* (423) topic_name ::= NK_ID */ - -1, /* (424) stream_name ::= NK_ID */ - -1, /* (425) cgroup_name ::= NK_ID */ - -1, /* (426) index_name ::= NK_ID */ - -1, /* (427) expr_or_subquery ::= expression */ - -1, /* (428) expression ::= literal */ - -1, /* (429) expression ::= pseudo_column */ - -1, /* (430) expression ::= column_reference */ - -1, /* (431) expression ::= function_expression */ - -1, /* (432) expression ::= case_when_expression */ - -3, /* (433) expression ::= NK_LP expression NK_RP */ - -2, /* (434) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (435) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (436) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (437) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (438) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (439) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (440) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (441) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (442) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (443) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (444) expression_list ::= expr_or_subquery */ - -3, /* (445) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (446) column_reference ::= column_name */ - -3, /* (447) column_reference ::= table_name NK_DOT column_name */ - -1, /* (448) pseudo_column ::= ROWTS */ - -1, /* (449) pseudo_column ::= TBNAME */ - -3, /* (450) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (451) pseudo_column ::= QSTART */ - -1, /* (452) pseudo_column ::= QEND */ - -1, /* (453) pseudo_column ::= QDURATION */ - -1, /* (454) pseudo_column ::= WSTART */ - -1, /* (455) pseudo_column ::= WEND */ - -1, /* (456) pseudo_column ::= WDURATION */ - -1, /* (457) pseudo_column ::= IROWTS */ - -1, /* (458) pseudo_column ::= ISFILLED */ - -1, /* (459) pseudo_column ::= QTAGS */ - -4, /* (460) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (461) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (462) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (463) function_expression ::= literal_func */ - -3, /* (464) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (465) literal_func ::= NOW */ - -1, /* (466) noarg_func ::= NOW */ - -1, /* (467) noarg_func ::= TODAY */ - -1, /* (468) noarg_func ::= TIMEZONE */ - -1, /* (469) noarg_func ::= DATABASE */ - -1, /* (470) noarg_func ::= CLIENT_VERSION */ - -1, /* (471) noarg_func ::= SERVER_VERSION */ - -1, /* (472) noarg_func ::= SERVER_STATUS */ - -1, /* (473) noarg_func ::= CURRENT_USER */ - -1, /* (474) noarg_func ::= USER */ - -1, /* (475) star_func ::= COUNT */ - -1, /* (476) star_func ::= FIRST */ - -1, /* (477) star_func ::= LAST */ - -1, /* (478) star_func ::= LAST_ROW */ - -1, /* (479) star_func_para_list ::= NK_STAR */ - -1, /* (480) star_func_para_list ::= other_para_list */ - -1, /* (481) other_para_list ::= star_func_para */ - -3, /* (482) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (483) star_func_para ::= expr_or_subquery */ - -3, /* (484) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (485) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (486) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (487) when_then_list ::= when_then_expr */ - -2, /* (488) when_then_list ::= when_then_list when_then_expr */ - -4, /* (489) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (490) case_when_else_opt ::= */ - -2, /* (491) case_when_else_opt ::= ELSE common_expression */ - -3, /* (492) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (493) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (494) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (495) predicate ::= expr_or_subquery IS NULL */ - -4, /* (496) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (497) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (498) compare_op ::= NK_LT */ - -1, /* (499) compare_op ::= NK_GT */ - -1, /* (500) compare_op ::= NK_LE */ - -1, /* (501) compare_op ::= NK_GE */ - -1, /* (502) compare_op ::= NK_NE */ - -1, /* (503) compare_op ::= NK_EQ */ - -1, /* (504) compare_op ::= LIKE */ - -2, /* (505) compare_op ::= NOT LIKE */ - -1, /* (506) compare_op ::= MATCH */ - -1, /* (507) compare_op ::= NMATCH */ - -1, /* (508) compare_op ::= CONTAINS */ - -1, /* (509) in_op ::= IN */ - -2, /* (510) in_op ::= NOT IN */ - -3, /* (511) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (512) boolean_value_expression ::= boolean_primary */ - -2, /* (513) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (514) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (515) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (516) boolean_primary ::= predicate */ - -3, /* (517) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (518) common_expression ::= expr_or_subquery */ - -1, /* (519) common_expression ::= boolean_value_expression */ - 0, /* (520) from_clause_opt ::= */ - -2, /* (521) from_clause_opt ::= FROM table_reference_list */ - -1, /* (522) table_reference_list ::= table_reference */ - -3, /* (523) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (524) table_reference ::= table_primary */ - -1, /* (525) table_reference ::= joined_table */ - -2, /* (526) table_primary ::= table_name alias_opt */ - -4, /* (527) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (528) table_primary ::= subquery alias_opt */ - -1, /* (529) table_primary ::= parenthesized_joined_table */ - 0, /* (530) alias_opt ::= */ - -1, /* (531) alias_opt ::= table_alias */ - -2, /* (532) alias_opt ::= AS table_alias */ - -3, /* (533) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (534) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -6, /* (535) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - 0, /* (536) join_type ::= */ - -1, /* (537) join_type ::= INNER */ - -14, /* (538) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (539) hint_list ::= */ - -1, /* (540) hint_list ::= NK_HINT */ - 0, /* (541) tag_mode_opt ::= */ - -1, /* (542) tag_mode_opt ::= TAGS */ - 0, /* (543) set_quantifier_opt ::= */ - -1, /* (544) set_quantifier_opt ::= DISTINCT */ - -1, /* (545) set_quantifier_opt ::= ALL */ - -1, /* (546) select_list ::= select_item */ - -3, /* (547) select_list ::= select_list NK_COMMA select_item */ - -1, /* (548) select_item ::= NK_STAR */ - -1, /* (549) select_item ::= common_expression */ - -2, /* (550) select_item ::= common_expression column_alias */ - -3, /* (551) select_item ::= common_expression AS column_alias */ - -3, /* (552) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (553) where_clause_opt ::= */ - -2, /* (554) where_clause_opt ::= WHERE search_condition */ - 0, /* (555) partition_by_clause_opt ::= */ - -3, /* (556) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (557) partition_list ::= partition_item */ - -3, /* (558) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (559) partition_item ::= expr_or_subquery */ - -2, /* (560) partition_item ::= expr_or_subquery column_alias */ - -3, /* (561) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (562) twindow_clause_opt ::= */ - -6, /* (563) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - -4, /* (564) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (565) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (566) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (567) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 0, /* (568) sliding_opt ::= */ - -4, /* (569) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - 0, /* (570) fill_opt ::= */ - -4, /* (571) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (572) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (573) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (574) fill_mode ::= NONE */ - -1, /* (575) fill_mode ::= PREV */ - -1, /* (576) fill_mode ::= NULL */ - -1, /* (577) fill_mode ::= NULL_F */ - -1, /* (578) fill_mode ::= LINEAR */ - -1, /* (579) fill_mode ::= NEXT */ - 0, /* (580) group_by_clause_opt ::= */ - -3, /* (581) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (582) group_by_list ::= expr_or_subquery */ - -3, /* (583) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (584) having_clause_opt ::= */ - -2, /* (585) having_clause_opt ::= HAVING search_condition */ - 0, /* (586) range_opt ::= */ - -6, /* (587) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (588) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (589) every_opt ::= */ - -4, /* (590) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (591) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (592) query_simple ::= query_specification */ - -1, /* (593) query_simple ::= union_query_expression */ - -4, /* (594) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (595) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (596) query_simple_or_subquery ::= query_simple */ - -1, /* (597) query_simple_or_subquery ::= subquery */ - -1, /* (598) query_or_subquery ::= query_expression */ - -1, /* (599) query_or_subquery ::= subquery */ - 0, /* (600) order_by_clause_opt ::= */ - -3, /* (601) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (602) slimit_clause_opt ::= */ - -2, /* (603) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (604) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (605) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (606) limit_clause_opt ::= */ - -2, /* (607) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (608) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (609) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (610) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (611) subquery ::= NK_LP subquery NK_RP */ - -1, /* (612) search_condition ::= common_expression */ - -1, /* (613) sort_specification_list ::= sort_specification */ - -3, /* (614) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (615) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (616) ordering_specification_opt ::= */ - -1, /* (617) ordering_specification_opt ::= ASC */ - -1, /* (618) ordering_specification_opt ::= DESC */ - 0, /* (619) null_ordering_opt ::= */ - -2, /* (620) null_ordering_opt ::= NULLS FIRST */ - -2, /* (621) null_ordering_opt ::= NULLS LAST */ + 0, /* (384) on_vgroup_id ::= */ + -2, /* (385) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (386) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (387) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (388) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (389) cmd ::= query_or_subquery */ + -1, /* (390) cmd ::= insert_query */ + -7, /* (391) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (392) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (393) literal ::= NK_INTEGER */ + -1, /* (394) literal ::= NK_FLOAT */ + -1, /* (395) literal ::= NK_STRING */ + -1, /* (396) literal ::= NK_BOOL */ + -2, /* (397) literal ::= TIMESTAMP NK_STRING */ + -1, /* (398) literal ::= duration_literal */ + -1, /* (399) literal ::= NULL */ + -1, /* (400) literal ::= NK_QUESTION */ + -1, /* (401) duration_literal ::= NK_VARIABLE */ + -1, /* (402) signed ::= NK_INTEGER */ + -2, /* (403) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (404) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (405) signed ::= NK_FLOAT */ + -2, /* (406) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (407) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (408) signed_literal ::= signed */ + -1, /* (409) signed_literal ::= NK_STRING */ + -1, /* (410) signed_literal ::= NK_BOOL */ + -2, /* (411) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (412) signed_literal ::= duration_literal */ + -1, /* (413) signed_literal ::= NULL */ + -1, /* (414) signed_literal ::= literal_func */ + -1, /* (415) signed_literal ::= NK_QUESTION */ + -1, /* (416) literal_list ::= signed_literal */ + -3, /* (417) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (418) db_name ::= NK_ID */ + -1, /* (419) table_name ::= NK_ID */ + -1, /* (420) column_name ::= NK_ID */ + -1, /* (421) function_name ::= NK_ID */ + -1, /* (422) table_alias ::= NK_ID */ + -1, /* (423) column_alias ::= NK_ID */ + -1, /* (424) user_name ::= NK_ID */ + -1, /* (425) topic_name ::= NK_ID */ + -1, /* (426) stream_name ::= NK_ID */ + -1, /* (427) cgroup_name ::= NK_ID */ + -1, /* (428) index_name ::= NK_ID */ + -1, /* (429) expr_or_subquery ::= expression */ + -1, /* (430) expression ::= literal */ + -1, /* (431) expression ::= pseudo_column */ + -1, /* (432) expression ::= column_reference */ + -1, /* (433) expression ::= function_expression */ + -1, /* (434) expression ::= case_when_expression */ + -3, /* (435) expression ::= NK_LP expression NK_RP */ + -2, /* (436) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (437) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (438) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (439) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (440) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (441) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (442) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (443) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (444) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (445) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (446) expression_list ::= expr_or_subquery */ + -3, /* (447) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (448) column_reference ::= column_name */ + -3, /* (449) column_reference ::= table_name NK_DOT column_name */ + -1, /* (450) pseudo_column ::= ROWTS */ + -1, /* (451) pseudo_column ::= TBNAME */ + -3, /* (452) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (453) pseudo_column ::= QSTART */ + -1, /* (454) pseudo_column ::= QEND */ + -1, /* (455) pseudo_column ::= QDURATION */ + -1, /* (456) pseudo_column ::= WSTART */ + -1, /* (457) pseudo_column ::= WEND */ + -1, /* (458) pseudo_column ::= WDURATION */ + -1, /* (459) pseudo_column ::= IROWTS */ + -1, /* (460) pseudo_column ::= ISFILLED */ + -1, /* (461) pseudo_column ::= QTAGS */ + -4, /* (462) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (463) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (464) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (465) function_expression ::= literal_func */ + -3, /* (466) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (467) literal_func ::= NOW */ + -1, /* (468) noarg_func ::= NOW */ + -1, /* (469) noarg_func ::= TODAY */ + -1, /* (470) noarg_func ::= TIMEZONE */ + -1, /* (471) noarg_func ::= DATABASE */ + -1, /* (472) noarg_func ::= CLIENT_VERSION */ + -1, /* (473) noarg_func ::= SERVER_VERSION */ + -1, /* (474) noarg_func ::= SERVER_STATUS */ + -1, /* (475) noarg_func ::= CURRENT_USER */ + -1, /* (476) noarg_func ::= USER */ + -1, /* (477) star_func ::= COUNT */ + -1, /* (478) star_func ::= FIRST */ + -1, /* (479) star_func ::= LAST */ + -1, /* (480) star_func ::= LAST_ROW */ + -1, /* (481) star_func_para_list ::= NK_STAR */ + -1, /* (482) star_func_para_list ::= other_para_list */ + -1, /* (483) other_para_list ::= star_func_para */ + -3, /* (484) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (485) star_func_para ::= expr_or_subquery */ + -3, /* (486) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (487) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (488) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (489) when_then_list ::= when_then_expr */ + -2, /* (490) when_then_list ::= when_then_list when_then_expr */ + -4, /* (491) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (492) case_when_else_opt ::= */ + -2, /* (493) case_when_else_opt ::= ELSE common_expression */ + -3, /* (494) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (495) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (496) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (497) predicate ::= expr_or_subquery IS NULL */ + -4, /* (498) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (499) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (500) compare_op ::= NK_LT */ + -1, /* (501) compare_op ::= NK_GT */ + -1, /* (502) compare_op ::= NK_LE */ + -1, /* (503) compare_op ::= NK_GE */ + -1, /* (504) compare_op ::= NK_NE */ + -1, /* (505) compare_op ::= NK_EQ */ + -1, /* (506) compare_op ::= LIKE */ + -2, /* (507) compare_op ::= NOT LIKE */ + -1, /* (508) compare_op ::= MATCH */ + -1, /* (509) compare_op ::= NMATCH */ + -1, /* (510) compare_op ::= CONTAINS */ + -1, /* (511) in_op ::= IN */ + -2, /* (512) in_op ::= NOT IN */ + -3, /* (513) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (514) boolean_value_expression ::= boolean_primary */ + -2, /* (515) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (516) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (517) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (518) boolean_primary ::= predicate */ + -3, /* (519) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (520) common_expression ::= expr_or_subquery */ + -1, /* (521) common_expression ::= boolean_value_expression */ + 0, /* (522) from_clause_opt ::= */ + -2, /* (523) from_clause_opt ::= FROM table_reference_list */ + -1, /* (524) table_reference_list ::= table_reference */ + -3, /* (525) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (526) table_reference ::= table_primary */ + -1, /* (527) table_reference ::= joined_table */ + -2, /* (528) table_primary ::= table_name alias_opt */ + -4, /* (529) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (530) table_primary ::= subquery alias_opt */ + -1, /* (531) table_primary ::= parenthesized_joined_table */ + 0, /* (532) alias_opt ::= */ + -1, /* (533) alias_opt ::= table_alias */ + -2, /* (534) alias_opt ::= AS table_alias */ + -3, /* (535) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (536) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -6, /* (537) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + 0, /* (538) join_type ::= */ + -1, /* (539) join_type ::= INNER */ + -14, /* (540) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (541) hint_list ::= */ + -1, /* (542) hint_list ::= NK_HINT */ + 0, /* (543) tag_mode_opt ::= */ + -1, /* (544) tag_mode_opt ::= TAGS */ + 0, /* (545) set_quantifier_opt ::= */ + -1, /* (546) set_quantifier_opt ::= DISTINCT */ + -1, /* (547) set_quantifier_opt ::= ALL */ + -1, /* (548) select_list ::= select_item */ + -3, /* (549) select_list ::= select_list NK_COMMA select_item */ + -1, /* (550) select_item ::= NK_STAR */ + -1, /* (551) select_item ::= common_expression */ + -2, /* (552) select_item ::= common_expression column_alias */ + -3, /* (553) select_item ::= common_expression AS column_alias */ + -3, /* (554) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (555) where_clause_opt ::= */ + -2, /* (556) where_clause_opt ::= WHERE search_condition */ + 0, /* (557) partition_by_clause_opt ::= */ + -3, /* (558) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (559) partition_list ::= partition_item */ + -3, /* (560) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (561) partition_item ::= expr_or_subquery */ + -2, /* (562) partition_item ::= expr_or_subquery column_alias */ + -3, /* (563) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (564) twindow_clause_opt ::= */ + -6, /* (565) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + -4, /* (566) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (567) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (568) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (569) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 0, /* (570) sliding_opt ::= */ + -4, /* (571) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + 0, /* (572) fill_opt ::= */ + -4, /* (573) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (574) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (575) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (576) fill_mode ::= NONE */ + -1, /* (577) fill_mode ::= PREV */ + -1, /* (578) fill_mode ::= NULL */ + -1, /* (579) fill_mode ::= NULL_F */ + -1, /* (580) fill_mode ::= LINEAR */ + -1, /* (581) fill_mode ::= NEXT */ + 0, /* (582) group_by_clause_opt ::= */ + -3, /* (583) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (584) group_by_list ::= expr_or_subquery */ + -3, /* (585) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (586) having_clause_opt ::= */ + -2, /* (587) having_clause_opt ::= HAVING search_condition */ + 0, /* (588) range_opt ::= */ + -6, /* (589) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (590) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (591) every_opt ::= */ + -4, /* (592) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (593) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (594) query_simple ::= query_specification */ + -1, /* (595) query_simple ::= union_query_expression */ + -4, /* (596) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (597) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (598) query_simple_or_subquery ::= query_simple */ + -1, /* (599) query_simple_or_subquery ::= subquery */ + -1, /* (600) query_or_subquery ::= query_expression */ + -1, /* (601) query_or_subquery ::= subquery */ + 0, /* (602) order_by_clause_opt ::= */ + -3, /* (603) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (604) slimit_clause_opt ::= */ + -2, /* (605) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (606) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (607) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (608) limit_clause_opt ::= */ + -2, /* (609) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (610) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (611) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (612) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (613) subquery ::= NK_LP subquery NK_RP */ + -1, /* (614) search_condition ::= common_expression */ + -1, /* (615) sort_specification_list ::= sort_specification */ + -3, /* (616) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (617) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (618) ordering_specification_opt ::= */ + -1, /* (619) ordering_specification_opt ::= ASC */ + -1, /* (620) ordering_specification_opt ::= DESC */ + 0, /* (621) null_ordering_opt ::= */ + -2, /* (622) null_ordering_opt ::= NULLS FIRST */ + -2, /* (623) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4974,19 +5010,19 @@ static YYACTIONTYPE yy_reduce( case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ #line 50 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 4977 "sql.c" +#line 5013 "sql.c" yy_destructor(yypParser,345,&yymsp[0].minor); break; case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ #line 51 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 4983 "sql.c" +#line 5019 "sql.c" yy_destructor(yypParser,346,&yymsp[0].minor); break; case 2: /* account_options ::= */ #line 55 "sql.y" { } -#line 4989 "sql.c" +#line 5025 "sql.c" break; case 3: /* account_options ::= account_options PPS literal */ case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4); @@ -5000,7 +5036,7 @@ static YYACTIONTYPE yy_reduce( { yy_destructor(yypParser,345,&yymsp[-2].minor); #line 56 "sql.y" { } -#line 5003 "sql.c" +#line 5039 "sql.c" yy_destructor(yypParser,347,&yymsp[0].minor); } break; @@ -5008,14 +5044,14 @@ static YYACTIONTYPE yy_reduce( { yy_destructor(yypParser,348,&yymsp[0].minor); #line 68 "sql.y" { } -#line 5011 "sql.c" +#line 5047 "sql.c" } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ { yy_destructor(yypParser,346,&yymsp[-1].minor); #line 69 "sql.y" { } -#line 5018 "sql.c" +#line 5054 "sql.c" yy_destructor(yypParser,348,&yymsp[0].minor); } break; @@ -5031,25 +5067,25 @@ static YYACTIONTYPE yy_reduce( case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); #line 73 "sql.y" { } -#line 5034 "sql.c" +#line 5070 "sql.c" yy_destructor(yypParser,347,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ #line 86 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5040 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5076 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ #line 87 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 5046 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 5082 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; case 26: /* white_list ::= HOST ip_range_list */ #line 91 "sql.y" -{ yymsp[-1].minor.yy298 = yymsp[0].minor.yy298; } -#line 5052 "sql.c" +{ yymsp[-1].minor.yy860 = yymsp[0].minor.yy860; } +#line 5088 "sql.c" break; case 27: /* white_list_opt ::= */ case 184: /* specific_cols_opt ::= */ yytestcase(yyruleno==184); @@ -5057,219 +5093,219 @@ static YYACTIONTYPE yy_reduce( case 296: /* tag_list_opt ::= */ yytestcase(yyruleno==296); case 358: /* col_list_opt ::= */ yytestcase(yyruleno==358); case 360: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==360); - case 555: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==555); - case 580: /* group_by_clause_opt ::= */ yytestcase(yyruleno==580); - case 600: /* order_by_clause_opt ::= */ yytestcase(yyruleno==600); + case 557: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==557); + case 582: /* group_by_clause_opt ::= */ yytestcase(yyruleno==582); + case 602: /* order_by_clause_opt ::= */ yytestcase(yyruleno==602); #line 95 "sql.y" -{ yymsp[1].minor.yy298 = NULL; } -#line 5065 "sql.c" +{ yymsp[1].minor.yy860 = NULL; } +#line 5101 "sql.c" break; case 28: /* white_list_opt ::= white_list */ case 216: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==216); case 361: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==361); - case 480: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==480); + case 482: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==482); #line 96 "sql.y" -{ yylhsminor.yy298 = yymsp[0].minor.yy298; } -#line 5073 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = yymsp[0].minor.yy860; } +#line 5109 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ #line 100 "sql.y" { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy203, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy797); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy298); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy269, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy371); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy860); } -#line 5082 "sql.c" +#line 5118 "sql.c" break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ #line 104 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy203, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } -#line 5087 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +#line 5123 "sql.c" break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ #line 105 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy203, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } -#line 5092 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +#line 5128 "sql.c" break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ #line 106 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy203, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } -#line 5097 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +#line 5133 "sql.c" break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ #line 107 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy203, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy298); } -#line 5102 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy860); } +#line 5138 "sql.c" break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ #line 108 "sql.y" -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy203, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy298); } -#line 5107 "sql.c" +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy269, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy860); } +#line 5143 "sql.c" break; case 35: /* cmd ::= DROP USER user_name */ #line 109 "sql.y" -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy203); } -#line 5112 "sql.c" +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy269); } +#line 5148 "sql.c" break; case 36: /* sysinfo_opt ::= */ #line 113 "sql.y" -{ yymsp[1].minor.yy797 = 1; } -#line 5117 "sql.c" +{ yymsp[1].minor.yy371 = 1; } +#line 5153 "sql.c" break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ #line 114 "sql.y" -{ yymsp[-1].minor.yy797 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5122 "sql.c" +{ yymsp[-1].minor.yy371 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5158 "sql.c" break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ #line 117 "sql.y" -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy999, &yymsp[-3].minor.yy345, &yymsp[0].minor.yy203, yymsp[-2].minor.yy122); } -#line 5127 "sql.c" +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy537, &yymsp[-3].minor.yy993, &yymsp[0].minor.yy269, yymsp[-2].minor.yy348); } +#line 5163 "sql.c" break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ #line 118 "sql.y" -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy999, &yymsp[-3].minor.yy345, &yymsp[0].minor.yy203, yymsp[-2].minor.yy122); } -#line 5132 "sql.c" +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy537, &yymsp[-3].minor.yy993, &yymsp[0].minor.yy269, yymsp[-2].minor.yy348); } +#line 5168 "sql.c" break; case 40: /* privileges ::= ALL */ #line 122 "sql.y" -{ yymsp[0].minor.yy999 = PRIVILEGE_TYPE_ALL; } -#line 5137 "sql.c" +{ yymsp[0].minor.yy537 = PRIVILEGE_TYPE_ALL; } +#line 5173 "sql.c" break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); #line 123 "sql.y" -{ yylhsminor.yy999 = yymsp[0].minor.yy999; } -#line 5143 "sql.c" - yymsp[0].minor.yy999 = yylhsminor.yy999; +{ yylhsminor.yy537 = yymsp[0].minor.yy537; } +#line 5179 "sql.c" + yymsp[0].minor.yy537 = yylhsminor.yy537; break; case 42: /* privileges ::= SUBSCRIBE */ #line 124 "sql.y" -{ yymsp[0].minor.yy999 = PRIVILEGE_TYPE_SUBSCRIBE; } -#line 5149 "sql.c" +{ yymsp[0].minor.yy537 = PRIVILEGE_TYPE_SUBSCRIBE; } +#line 5185 "sql.c" break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ #line 129 "sql.y" -{ yylhsminor.yy999 = yymsp[-2].minor.yy999 | yymsp[0].minor.yy999; } -#line 5154 "sql.c" - yymsp[-2].minor.yy999 = yylhsminor.yy999; +{ yylhsminor.yy537 = yymsp[-2].minor.yy537 | yymsp[0].minor.yy537; } +#line 5190 "sql.c" + yymsp[-2].minor.yy537 = yylhsminor.yy537; break; case 45: /* priv_type ::= READ */ #line 133 "sql.y" -{ yymsp[0].minor.yy999 = PRIVILEGE_TYPE_READ; } -#line 5160 "sql.c" +{ yymsp[0].minor.yy537 = PRIVILEGE_TYPE_READ; } +#line 5196 "sql.c" break; case 46: /* priv_type ::= WRITE */ #line 134 "sql.y" -{ yymsp[0].minor.yy999 = PRIVILEGE_TYPE_WRITE; } -#line 5165 "sql.c" +{ yymsp[0].minor.yy537 = PRIVILEGE_TYPE_WRITE; } +#line 5201 "sql.c" break; case 47: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ #line 138 "sql.y" -{ yylhsminor.yy345.first = yymsp[-2].minor.yy0; yylhsminor.yy345.second = yymsp[0].minor.yy0; } -#line 5170 "sql.c" - yymsp[-2].minor.yy345 = yylhsminor.yy345; +{ yylhsminor.yy993.first = yymsp[-2].minor.yy0; yylhsminor.yy993.second = yymsp[0].minor.yy0; } +#line 5206 "sql.c" + yymsp[-2].minor.yy993 = yylhsminor.yy993; break; case 48: /* priv_level ::= db_name NK_DOT NK_STAR */ #line 139 "sql.y" -{ yylhsminor.yy345.first = yymsp[-2].minor.yy203; yylhsminor.yy345.second = yymsp[0].minor.yy0; } -#line 5176 "sql.c" - yymsp[-2].minor.yy345 = yylhsminor.yy345; +{ yylhsminor.yy993.first = yymsp[-2].minor.yy269; yylhsminor.yy993.second = yymsp[0].minor.yy0; } +#line 5212 "sql.c" + yymsp[-2].minor.yy993 = yylhsminor.yy993; break; case 49: /* priv_level ::= db_name NK_DOT table_name */ #line 140 "sql.y" -{ yylhsminor.yy345.first = yymsp[-2].minor.yy203; yylhsminor.yy345.second = yymsp[0].minor.yy203; } -#line 5182 "sql.c" - yymsp[-2].minor.yy345 = yylhsminor.yy345; +{ yylhsminor.yy993.first = yymsp[-2].minor.yy269; yylhsminor.yy993.second = yymsp[0].minor.yy269; } +#line 5218 "sql.c" + yymsp[-2].minor.yy993 = yylhsminor.yy993; break; case 50: /* priv_level ::= topic_name */ #line 141 "sql.y" -{ yylhsminor.yy345.first = yymsp[0].minor.yy203; yylhsminor.yy345.second = nil_token; } -#line 5188 "sql.c" - yymsp[0].minor.yy345 = yylhsminor.yy345; +{ yylhsminor.yy993.first = yymsp[0].minor.yy269; yylhsminor.yy993.second = nil_token; } +#line 5224 "sql.c" + yymsp[0].minor.yy993 = yylhsminor.yy993; break; case 51: /* with_opt ::= */ case 153: /* start_opt ::= */ yytestcase(yyruleno==153); case 157: /* end_opt ::= */ yytestcase(yyruleno==157); case 291: /* like_pattern_opt ::= */ yytestcase(yyruleno==291); case 372: /* subtable_opt ::= */ yytestcase(yyruleno==372); - case 490: /* case_when_else_opt ::= */ yytestcase(yyruleno==490); - case 520: /* from_clause_opt ::= */ yytestcase(yyruleno==520); - case 553: /* where_clause_opt ::= */ yytestcase(yyruleno==553); - case 562: /* twindow_clause_opt ::= */ yytestcase(yyruleno==562); - case 568: /* sliding_opt ::= */ yytestcase(yyruleno==568); - case 570: /* fill_opt ::= */ yytestcase(yyruleno==570); - case 584: /* having_clause_opt ::= */ yytestcase(yyruleno==584); - case 586: /* range_opt ::= */ yytestcase(yyruleno==586); - case 589: /* every_opt ::= */ yytestcase(yyruleno==589); - case 602: /* slimit_clause_opt ::= */ yytestcase(yyruleno==602); - case 606: /* limit_clause_opt ::= */ yytestcase(yyruleno==606); + case 492: /* case_when_else_opt ::= */ yytestcase(yyruleno==492); + case 522: /* from_clause_opt ::= */ yytestcase(yyruleno==522); + case 555: /* where_clause_opt ::= */ yytestcase(yyruleno==555); + case 564: /* twindow_clause_opt ::= */ yytestcase(yyruleno==564); + case 570: /* sliding_opt ::= */ yytestcase(yyruleno==570); + case 572: /* fill_opt ::= */ yytestcase(yyruleno==572); + case 586: /* having_clause_opt ::= */ yytestcase(yyruleno==586); + case 588: /* range_opt ::= */ yytestcase(yyruleno==588); + case 591: /* every_opt ::= */ yytestcase(yyruleno==591); + case 604: /* slimit_clause_opt ::= */ yytestcase(yyruleno==604); + case 608: /* limit_clause_opt ::= */ yytestcase(yyruleno==608); #line 143 "sql.y" -{ yymsp[1].minor.yy122 = NULL; } -#line 5209 "sql.c" +{ yymsp[1].minor.yy348 = NULL; } +#line 5245 "sql.c" break; case 52: /* with_opt ::= WITH search_condition */ - case 521: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==521); - case 554: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==554); - case 585: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==585); + case 523: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==523); + case 556: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==556); + case 587: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==587); #line 144 "sql.y" -{ yymsp[-1].minor.yy122 = yymsp[0].minor.yy122; } -#line 5217 "sql.c" +{ yymsp[-1].minor.yy348 = yymsp[0].minor.yy348; } +#line 5253 "sql.c" break; case 53: /* cmd ::= CREATE DNODE dnode_endpoint */ #line 147 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy203, NULL); } -#line 5222 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy269, NULL); } +#line 5258 "sql.c" break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ #line 148 "sql.y" -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy0); } -#line 5227 "sql.c" +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0); } +#line 5263 "sql.c" break; case 55: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ #line 149 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy983, false); } -#line 5232 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy345, false); } +#line 5268 "sql.c" break; case 56: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ #line 150 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy203, yymsp[0].minor.yy983, false); } -#line 5237 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy345, false); } +#line 5273 "sql.c" break; case 57: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ #line 151 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy983); } -#line 5242 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy345); } +#line 5278 "sql.c" break; case 58: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ #line 152 "sql.y" -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy203, false, yymsp[0].minor.yy983); } -#line 5247 "sql.c" +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy269, false, yymsp[0].minor.yy345); } +#line 5283 "sql.c" break; case 59: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ #line 153 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } -#line 5252 "sql.c" +#line 5288 "sql.c" break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ #line 154 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5257 "sql.c" +#line 5293 "sql.c" break; case 61: /* cmd ::= ALTER ALL DNODES NK_STRING */ #line 155 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); } -#line 5262 "sql.c" +#line 5298 "sql.c" break; case 62: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ #line 156 "sql.y" { pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5267 "sql.c" +#line 5303 "sql.c" break; case 63: /* cmd ::= RESTORE DNODE NK_INTEGER */ #line 157 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); } -#line 5272 "sql.c" +#line 5308 "sql.c" break; case 64: /* dnode_endpoint ::= NK_STRING */ case 65: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==65); @@ -5278,34 +5314,34 @@ static YYACTIONTYPE yy_reduce( case 319: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==319); case 320: /* sma_func_name ::= LAST */ yytestcase(yyruleno==320); case 321: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==321); - case 416: /* db_name ::= NK_ID */ yytestcase(yyruleno==416); - case 417: /* table_name ::= NK_ID */ yytestcase(yyruleno==417); - case 418: /* column_name ::= NK_ID */ yytestcase(yyruleno==418); - case 419: /* function_name ::= NK_ID */ yytestcase(yyruleno==419); - case 420: /* table_alias ::= NK_ID */ yytestcase(yyruleno==420); - case 421: /* column_alias ::= NK_ID */ yytestcase(yyruleno==421); - case 422: /* user_name ::= NK_ID */ yytestcase(yyruleno==422); - case 423: /* topic_name ::= NK_ID */ yytestcase(yyruleno==423); - case 424: /* stream_name ::= NK_ID */ yytestcase(yyruleno==424); - case 425: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==425); - case 426: /* index_name ::= NK_ID */ yytestcase(yyruleno==426); - case 466: /* noarg_func ::= NOW */ yytestcase(yyruleno==466); - case 467: /* noarg_func ::= TODAY */ yytestcase(yyruleno==467); - case 468: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==468); - case 469: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==469); - case 470: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==470); - case 471: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==471); - case 472: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==472); - case 473: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==473); - case 474: /* noarg_func ::= USER */ yytestcase(yyruleno==474); - case 475: /* star_func ::= COUNT */ yytestcase(yyruleno==475); - case 476: /* star_func ::= FIRST */ yytestcase(yyruleno==476); - case 477: /* star_func ::= LAST */ yytestcase(yyruleno==477); - case 478: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==478); + case 418: /* db_name ::= NK_ID */ yytestcase(yyruleno==418); + case 419: /* table_name ::= NK_ID */ yytestcase(yyruleno==419); + case 420: /* column_name ::= NK_ID */ yytestcase(yyruleno==420); + case 421: /* function_name ::= NK_ID */ yytestcase(yyruleno==421); + case 422: /* table_alias ::= NK_ID */ yytestcase(yyruleno==422); + case 423: /* column_alias ::= NK_ID */ yytestcase(yyruleno==423); + case 424: /* user_name ::= NK_ID */ yytestcase(yyruleno==424); + case 425: /* topic_name ::= NK_ID */ yytestcase(yyruleno==425); + case 426: /* stream_name ::= NK_ID */ yytestcase(yyruleno==426); + case 427: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==427); + case 428: /* index_name ::= NK_ID */ yytestcase(yyruleno==428); + case 468: /* noarg_func ::= NOW */ yytestcase(yyruleno==468); + case 469: /* noarg_func ::= TODAY */ yytestcase(yyruleno==469); + case 470: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==470); + case 471: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==471); + case 472: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==472); + case 473: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==473); + case 474: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==474); + case 475: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==475); + case 476: /* noarg_func ::= USER */ yytestcase(yyruleno==476); + case 477: /* star_func ::= COUNT */ yytestcase(yyruleno==477); + case 478: /* star_func ::= FIRST */ yytestcase(yyruleno==478); + case 479: /* star_func ::= LAST */ yytestcase(yyruleno==479); + case 480: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==480); #line 161 "sql.y" -{ yylhsminor.yy203 = yymsp[0].minor.yy0; } -#line 5307 "sql.c" - yymsp[0].minor.yy203 = yylhsminor.yy203; +{ yylhsminor.yy269 = yymsp[0].minor.yy0; } +#line 5343 "sql.c" + yymsp[0].minor.yy269 = yylhsminor.yy269; break; case 67: /* force_opt ::= */ case 91: /* not_exists_opt ::= */ yytestcase(yyruleno==91); @@ -5314,443 +5350,443 @@ static YYACTIONTYPE yy_reduce( case 346: /* agg_func_opt ::= */ yytestcase(yyruleno==346); case 352: /* or_replace_opt ::= */ yytestcase(yyruleno==352); case 374: /* ignore_opt ::= */ yytestcase(yyruleno==374); - case 541: /* tag_mode_opt ::= */ yytestcase(yyruleno==541); - case 543: /* set_quantifier_opt ::= */ yytestcase(yyruleno==543); + case 543: /* tag_mode_opt ::= */ yytestcase(yyruleno==543); + case 545: /* set_quantifier_opt ::= */ yytestcase(yyruleno==545); #line 167 "sql.y" -{ yymsp[1].minor.yy983 = false; } -#line 5321 "sql.c" +{ yymsp[1].minor.yy345 = false; } +#line 5357 "sql.c" break; case 68: /* force_opt ::= FORCE */ case 69: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==69); case 340: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==340); case 347: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==347); - case 542: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==542); - case 544: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==544); + case 544: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==544); + case 546: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==546); #line 168 "sql.y" -{ yymsp[0].minor.yy983 = true; } -#line 5331 "sql.c" +{ yymsp[0].minor.yy345 = true; } +#line 5367 "sql.c" break; case 70: /* cmd ::= ALTER LOCAL NK_STRING */ #line 175 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 5336 "sql.c" +#line 5372 "sql.c" break; case 71: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */ #line 176 "sql.y" { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 5341 "sql.c" +#line 5377 "sql.c" break; case 72: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ #line 179 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5346 "sql.c" +#line 5382 "sql.c" break; case 73: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */ #line 180 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5351 "sql.c" +#line 5387 "sql.c" break; case 74: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ #line 181 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); } -#line 5356 "sql.c" +#line 5392 "sql.c" break; case 75: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ #line 184 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5361 "sql.c" +#line 5397 "sql.c" break; case 76: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */ #line 185 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); } -#line 5366 "sql.c" +#line 5402 "sql.c" break; case 77: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ #line 188 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 5371 "sql.c" +#line 5407 "sql.c" break; case 78: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */ #line 189 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); } -#line 5376 "sql.c" +#line 5412 "sql.c" break; case 79: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ #line 192 "sql.y" { pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5381 "sql.c" +#line 5417 "sql.c" break; case 80: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */ #line 193 "sql.y" { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5386 "sql.c" +#line 5422 "sql.c" break; case 81: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ #line 194 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); } -#line 5391 "sql.c" +#line 5427 "sql.c" break; case 82: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ #line 197 "sql.y" { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } -#line 5396 "sql.c" +#line 5432 "sql.c" break; case 83: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ #line 200 "sql.y" -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy983, &yymsp[-1].minor.yy203, yymsp[0].minor.yy122); } -#line 5401 "sql.c" +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy345, &yymsp[-1].minor.yy269, yymsp[0].minor.yy348); } +#line 5437 "sql.c" break; case 84: /* cmd ::= DROP DATABASE exists_opt db_name */ #line 201 "sql.y" -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 5406 "sql.c" +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 5442 "sql.c" break; case 85: /* cmd ::= USE db_name */ #line 202 "sql.y" -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy203); } -#line 5411 "sql.c" +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy269); } +#line 5447 "sql.c" break; case 86: /* cmd ::= ALTER DATABASE db_name alter_db_options */ #line 203 "sql.y" -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy203, yymsp[0].minor.yy122); } -#line 5416 "sql.c" +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy348); } +#line 5452 "sql.c" break; case 87: /* cmd ::= FLUSH DATABASE db_name */ #line 204 "sql.y" -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy203); } -#line 5421 "sql.c" +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy269); } +#line 5457 "sql.c" break; case 88: /* cmd ::= TRIM DATABASE db_name speed_opt */ #line 205 "sql.y" -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy203, yymsp[0].minor.yy652); } -#line 5426 "sql.c" +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy88); } +#line 5462 "sql.c" break; case 89: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ #line 206 "sql.y" -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy203, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 5431 "sql.c" +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy269, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 5467 "sql.c" break; case 90: /* not_exists_opt ::= IF NOT EXISTS */ #line 210 "sql.y" -{ yymsp[-2].minor.yy983 = true; } -#line 5436 "sql.c" +{ yymsp[-2].minor.yy345 = true; } +#line 5472 "sql.c" break; case 92: /* exists_opt ::= IF EXISTS */ case 353: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==353); case 375: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==375); #line 215 "sql.y" -{ yymsp[-1].minor.yy983 = true; } -#line 5443 "sql.c" +{ yymsp[-1].minor.yy345 = true; } +#line 5479 "sql.c" break; case 94: /* db_options ::= */ #line 218 "sql.y" -{ yymsp[1].minor.yy122 = createDefaultDatabaseOptions(pCxt); } -#line 5448 "sql.c" +{ yymsp[1].minor.yy348 = createDefaultDatabaseOptions(pCxt); } +#line 5484 "sql.c" break; case 95: /* db_options ::= db_options BUFFER NK_INTEGER */ #line 219 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } -#line 5453 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } +#line 5489 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 96: /* db_options ::= db_options CACHEMODEL NK_STRING */ #line 220 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } -#line 5459 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } +#line 5495 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 97: /* db_options ::= db_options CACHESIZE NK_INTEGER */ #line 221 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } -#line 5465 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } +#line 5501 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 98: /* db_options ::= db_options COMP NK_INTEGER */ #line 222 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_COMP, &yymsp[0].minor.yy0); } -#line 5471 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_COMP, &yymsp[0].minor.yy0); } +#line 5507 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 99: /* db_options ::= db_options DURATION NK_INTEGER */ case 100: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==100); #line 223 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } -#line 5478 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } +#line 5514 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 101: /* db_options ::= db_options MAXROWS NK_INTEGER */ #line 225 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } -#line 5484 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } +#line 5520 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 102: /* db_options ::= db_options MINROWS NK_INTEGER */ #line 226 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } -#line 5490 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } +#line 5526 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 103: /* db_options ::= db_options KEEP integer_list */ case 104: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==104); #line 227 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_KEEP, yymsp[0].minor.yy298); } -#line 5497 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_KEEP, yymsp[0].minor.yy860); } +#line 5533 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 105: /* db_options ::= db_options PAGES NK_INTEGER */ #line 229 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } -#line 5503 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } +#line 5539 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 106: /* db_options ::= db_options PAGESIZE NK_INTEGER */ #line 230 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } -#line 5509 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5545 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 107: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ #line 231 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } -#line 5515 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } +#line 5551 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 108: /* db_options ::= db_options PRECISION NK_STRING */ #line 232 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } -#line 5521 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } +#line 5557 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 109: /* db_options ::= db_options REPLICA NK_INTEGER */ #line 233 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } -#line 5527 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } +#line 5563 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 110: /* db_options ::= db_options VGROUPS NK_INTEGER */ #line 235 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } -#line 5533 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } +#line 5569 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 111: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ #line 236 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } -#line 5539 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } +#line 5575 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 112: /* db_options ::= db_options RETENTIONS retention_list */ #line 237 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_RETENTIONS, yymsp[0].minor.yy298); } -#line 5545 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_RETENTIONS, yymsp[0].minor.yy860); } +#line 5581 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 113: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ #line 238 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } -#line 5551 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } +#line 5587 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 114: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ #line 239 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_WAL, &yymsp[0].minor.yy0); } -#line 5557 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL, &yymsp[0].minor.yy0); } +#line 5593 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 115: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ #line 240 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } -#line 5563 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } +#line 5599 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 116: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ #line 241 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } -#line 5569 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } +#line 5605 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 117: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ #line 242 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-3].minor.yy122, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-3].minor.yy348, DB_OPTION_WAL_RETENTION_PERIOD, &t); } -#line 5579 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +#line 5615 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 118: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ #line 247 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } -#line 5585 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } +#line 5621 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 119: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ #line 248 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-3].minor.yy122, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-3].minor.yy348, DB_OPTION_WAL_RETENTION_SIZE, &t); } -#line 5595 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +#line 5631 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 120: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ #line 253 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } -#line 5601 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } +#line 5637 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 121: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ #line 254 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } -#line 5607 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } +#line 5643 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 122: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ #line 255 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } -#line 5613 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } +#line 5649 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 123: /* db_options ::= db_options TABLE_PREFIX signed */ #line 256 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy122); } -#line 5619 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy348); } +#line 5655 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 124: /* db_options ::= db_options TABLE_SUFFIX signed */ #line 257 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy122); } -#line 5625 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy348); } +#line 5661 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 125: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ #line 258 "sql.y" -{ yylhsminor.yy122 = setDatabaseOption(pCxt, yymsp[-2].minor.yy122, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } -#line 5631 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setDatabaseOption(pCxt, yymsp[-2].minor.yy348, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } +#line 5667 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 126: /* alter_db_options ::= alter_db_option */ #line 260 "sql.y" -{ yylhsminor.yy122 = createAlterDatabaseOptions(pCxt); yylhsminor.yy122 = setAlterDatabaseOption(pCxt, yylhsminor.yy122, &yymsp[0].minor.yy29); } -#line 5637 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterDatabaseOptions(pCxt); yylhsminor.yy348 = setAlterDatabaseOption(pCxt, yylhsminor.yy348, &yymsp[0].minor.yy233); } +#line 5673 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 127: /* alter_db_options ::= alter_db_options alter_db_option */ #line 261 "sql.y" -{ yylhsminor.yy122 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy122, &yymsp[0].minor.yy29); } -#line 5643 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy348, &yymsp[0].minor.yy233); } +#line 5679 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 128: /* alter_db_option ::= BUFFER NK_INTEGER */ #line 265 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5649 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5685 "sql.c" break; case 129: /* alter_db_option ::= CACHEMODEL NK_STRING */ #line 266 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5654 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5690 "sql.c" break; case 130: /* alter_db_option ::= CACHESIZE NK_INTEGER */ #line 267 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5659 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5695 "sql.c" break; case 131: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ #line 268 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5664 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5700 "sql.c" break; case 132: /* alter_db_option ::= KEEP integer_list */ case 133: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==133); #line 269 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_KEEP; yymsp[-1].minor.yy29.pList = yymsp[0].minor.yy298; } -#line 5670 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_KEEP; yymsp[-1].minor.yy233.pList = yymsp[0].minor.yy860; } +#line 5706 "sql.c" break; case 134: /* alter_db_option ::= PAGES NK_INTEGER */ #line 271 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_PAGES; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5675 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_PAGES; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5711 "sql.c" break; case 135: /* alter_db_option ::= REPLICA NK_INTEGER */ #line 272 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5680 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5716 "sql.c" break; case 136: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ #line 274 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_WAL; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5685 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_WAL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5721 "sql.c" break; case 137: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ #line 275 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5690 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5726 "sql.c" break; case 138: /* alter_db_option ::= MINROWS NK_INTEGER */ #line 276 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5695 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5731 "sql.c" break; case 139: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ #line 277 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5700 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5736 "sql.c" break; case 140: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ #line 278 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy29.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy29.val = t; + yymsp[-2].minor.yy233.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy233.val = t; } -#line 5709 "sql.c" +#line 5745 "sql.c" break; case 141: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ #line 283 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5714 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5750 "sql.c" break; case 142: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ #line 284 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy29.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy29.val = t; + yymsp[-2].minor.yy233.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy233.val = t; } -#line 5723 "sql.c" +#line 5759 "sql.c" break; case 143: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ #line 289 "sql.y" -{ yymsp[-1].minor.yy29.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 5728 "sql.c" +{ yymsp[-1].minor.yy233.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 5764 "sql.c" break; case 144: /* integer_list ::= NK_INTEGER */ #line 293 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 5733 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5769 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 145: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 385: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==385); + case 387: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==387); #line 294 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 5740 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } +#line 5776 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; case 146: /* variable_list ::= NK_VARIABLE */ #line 298 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5746 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5782 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 147: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ #line 299 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5752 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5788 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; case 148: /* retention_list ::= retention */ case 178: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==178); @@ -5760,16 +5796,16 @@ static YYACTIONTYPE yy_reduce( case 237: /* col_name_list ::= col_name */ yytestcase(yyruleno==237); case 297: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==297); case 314: /* func_list ::= func */ yytestcase(yyruleno==314); - case 414: /* literal_list ::= signed_literal */ yytestcase(yyruleno==414); - case 481: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==481); - case 487: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==487); - case 546: /* select_list ::= select_item */ yytestcase(yyruleno==546); - case 557: /* partition_list ::= partition_item */ yytestcase(yyruleno==557); - case 613: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==613); + case 416: /* literal_list ::= signed_literal */ yytestcase(yyruleno==416); + case 483: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==483); + case 489: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==489); + case 548: /* select_list ::= select_item */ yytestcase(yyruleno==548); + case 559: /* partition_list ::= partition_item */ yytestcase(yyruleno==559); + case 615: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==615); #line 303 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, yymsp[0].minor.yy122); } -#line 5771 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = createNodeList(pCxt, yymsp[0].minor.yy348); } +#line 5807 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 149: /* retention_list ::= retention_list NK_COMMA retention */ case 182: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==182); @@ -5778,1812 +5814,1814 @@ static YYACTIONTYPE yy_reduce( case 238: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==238); case 298: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==298); case 315: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==315); - case 415: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==415); - case 482: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==482); - case 547: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==547); - case 558: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==558); - case 614: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==614); + case 417: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==417); + case 484: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==484); + case 549: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==549); + case 560: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==560); + case 616: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==616); #line 304 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, yymsp[0].minor.yy122); } -#line 5788 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, yymsp[0].minor.yy348); } +#line 5824 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; case 150: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ #line 306 "sql.y" -{ yylhsminor.yy122 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 5794 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 5830 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 151: /* speed_opt ::= */ case 348: /* bufsize_opt ::= */ yytestcase(yyruleno==348); #line 310 "sql.y" -{ yymsp[1].minor.yy652 = 0; } -#line 5801 "sql.c" +{ yymsp[1].minor.yy88 = 0; } +#line 5837 "sql.c" break; case 152: /* speed_opt ::= BWLIMIT NK_INTEGER */ case 349: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==349); #line 311 "sql.y" -{ yymsp[-1].minor.yy652 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } -#line 5807 "sql.c" +{ yymsp[-1].minor.yy88 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +#line 5843 "sql.c" break; case 154: /* start_opt ::= START WITH NK_INTEGER */ case 158: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==158); #line 314 "sql.y" -{ yymsp[-2].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } -#line 5813 "sql.c" +{ yymsp[-2].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +#line 5849 "sql.c" break; case 155: /* start_opt ::= START WITH NK_STRING */ case 159: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==159); #line 315 "sql.y" -{ yymsp[-2].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 5819 "sql.c" +{ yymsp[-2].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 5855 "sql.c" break; case 156: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 160: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==160); #line 316 "sql.y" -{ yymsp[-3].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 5825 "sql.c" +{ yymsp[-3].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +#line 5861 "sql.c" break; case 161: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 163: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==163); #line 325 "sql.y" -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy983, yymsp[-5].minor.yy122, yymsp[-3].minor.yy298, yymsp[-1].minor.yy298, yymsp[0].minor.yy122); } -#line 5831 "sql.c" +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy345, yymsp[-5].minor.yy348, yymsp[-3].minor.yy860, yymsp[-1].minor.yy860, yymsp[0].minor.yy348); } +#line 5867 "sql.c" break; case 162: /* cmd ::= CREATE TABLE multi_create_clause */ #line 326 "sql.y" -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy298); } -#line 5836 "sql.c" +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy860); } +#line 5872 "sql.c" break; case 164: /* cmd ::= DROP TABLE multi_drop_clause */ #line 329 "sql.y" -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy298); } -#line 5841 "sql.c" +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy860); } +#line 5877 "sql.c" break; case 165: /* cmd ::= DROP STABLE exists_opt full_table_name */ #line 330 "sql.y" -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy983, yymsp[0].minor.yy122); } -#line 5846 "sql.c" +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy348); } +#line 5882 "sql.c" break; case 166: /* cmd ::= ALTER TABLE alter_table_clause */ - case 387: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==387); - case 388: /* cmd ::= insert_query */ yytestcase(yyruleno==388); + case 389: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==389); + case 390: /* cmd ::= insert_query */ yytestcase(yyruleno==390); #line 332 "sql.y" -{ pCxt->pRootNode = yymsp[0].minor.yy122; } -#line 5853 "sql.c" +{ pCxt->pRootNode = yymsp[0].minor.yy348; } +#line 5889 "sql.c" break; case 167: /* cmd ::= ALTER STABLE alter_table_clause */ #line 333 "sql.y" -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy122); } -#line 5858 "sql.c" +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy348); } +#line 5894 "sql.c" break; case 168: /* alter_table_clause ::= full_table_name alter_table_options */ #line 335 "sql.y" -{ yylhsminor.yy122 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 5863 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 5899 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 169: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ #line 337 "sql.y" -{ yylhsminor.yy122 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy203, yymsp[0].minor.yy388); } -#line 5869 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy269, yymsp[0].minor.yy720); } +#line 5905 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 170: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ #line 338 "sql.y" -{ yylhsminor.yy122 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy122, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy203); } -#line 5875 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy348, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy269); } +#line 5911 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 171: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ #line 340 "sql.y" -{ yylhsminor.yy122 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy203, yymsp[0].minor.yy388); } -#line 5881 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy269, yymsp[0].minor.yy720); } +#line 5917 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 172: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ #line 342 "sql.y" -{ yylhsminor.yy122 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy203, &yymsp[0].minor.yy203); } -#line 5887 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } +#line 5923 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 173: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ #line 344 "sql.y" -{ yylhsminor.yy122 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy203, yymsp[0].minor.yy388); } -#line 5893 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy269, yymsp[0].minor.yy720); } +#line 5929 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 174: /* alter_table_clause ::= full_table_name DROP TAG column_name */ #line 345 "sql.y" -{ yylhsminor.yy122 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy122, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy203); } -#line 5899 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy348, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy269); } +#line 5935 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 175: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ #line 347 "sql.y" -{ yylhsminor.yy122 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy203, yymsp[0].minor.yy388); } -#line 5905 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy269, yymsp[0].minor.yy720); } +#line 5941 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 176: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ #line 349 "sql.y" -{ yylhsminor.yy122 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy122, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy203, &yymsp[0].minor.yy203); } -#line 5911 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy348, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } +#line 5947 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 177: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ #line 351 "sql.y" -{ yylhsminor.yy122 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy122, &yymsp[-2].minor.yy203, yymsp[0].minor.yy122); } -#line 5917 "sql.c" - yymsp[-5].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy348, &yymsp[-2].minor.yy269, yymsp[0].minor.yy348); } +#line 5953 "sql.c" + yymsp[-5].minor.yy348 = yylhsminor.yy348; break; case 179: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 488: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==488); + case 490: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==490); #line 356 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-1].minor.yy298, yymsp[0].minor.yy122); } -#line 5924 "sql.c" - yymsp[-1].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-1].minor.yy860, yymsp[0].minor.yy348); } +#line 5960 "sql.c" + yymsp[-1].minor.yy860 = yylhsminor.yy860; break; case 180: /* 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 */ #line 360 "sql.y" -{ yylhsminor.yy122 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy983, yymsp[-8].minor.yy122, yymsp[-6].minor.yy122, yymsp[-5].minor.yy298, yymsp[-2].minor.yy298, yymsp[0].minor.yy122); } -#line 5930 "sql.c" - yymsp[-9].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy345, yymsp[-8].minor.yy348, yymsp[-6].minor.yy348, yymsp[-5].minor.yy860, yymsp[-2].minor.yy860, yymsp[0].minor.yy348); } +#line 5966 "sql.c" + yymsp[-9].minor.yy348 = yylhsminor.yy348; break; case 183: /* drop_table_clause ::= exists_opt full_table_name */ #line 367 "sql.y" -{ yylhsminor.yy122 = createDropTableClause(pCxt, yymsp[-1].minor.yy983, yymsp[0].minor.yy122); } -#line 5936 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createDropTableClause(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy348); } +#line 5972 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 185: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ case 359: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==359); #line 372 "sql.y" -{ yymsp[-2].minor.yy298 = yymsp[-1].minor.yy298; } -#line 5943 "sql.c" +{ yymsp[-2].minor.yy860 = yymsp[-1].minor.yy860; } +#line 5979 "sql.c" break; case 186: /* full_table_name ::= table_name */ #line 374 "sql.y" -{ yylhsminor.yy122 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy203, NULL); } -#line 5948 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy269, NULL); } +#line 5984 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 187: /* full_table_name ::= db_name NK_DOT table_name */ #line 375 "sql.y" -{ yylhsminor.yy122 = createRealTableNode(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy203, NULL); } -#line 5954 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRealTableNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269, NULL); } +#line 5990 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 190: /* column_def ::= column_name type_name */ #line 382 "sql.y" -{ yylhsminor.yy122 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy203, yymsp[0].minor.yy388, NULL); } -#line 5960 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy269, yymsp[0].minor.yy720, NULL); } +#line 5996 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 191: /* type_name ::= BOOL */ #line 387 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BOOL); } -#line 5966 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_BOOL); } +#line 6002 "sql.c" break; case 192: /* type_name ::= TINYINT */ #line 388 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_TINYINT); } -#line 5971 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_TINYINT); } +#line 6007 "sql.c" break; case 193: /* type_name ::= SMALLINT */ #line 389 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_SMALLINT); } -#line 5976 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +#line 6012 "sql.c" break; case 194: /* type_name ::= INT */ case 195: /* type_name ::= INTEGER */ yytestcase(yyruleno==195); #line 390 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_INT); } -#line 5982 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_INT); } +#line 6018 "sql.c" break; case 196: /* type_name ::= BIGINT */ #line 392 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BIGINT); } -#line 5987 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_BIGINT); } +#line 6023 "sql.c" break; case 197: /* type_name ::= FLOAT */ #line 393 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_FLOAT); } -#line 5992 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_FLOAT); } +#line 6028 "sql.c" break; case 198: /* type_name ::= DOUBLE */ #line 394 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_DOUBLE); } -#line 5997 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +#line 6033 "sql.c" break; case 199: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ #line 395 "sql.y" -{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } -#line 6002 "sql.c" +{ yymsp[-3].minor.yy720 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +#line 6038 "sql.c" break; case 200: /* type_name ::= TIMESTAMP */ #line 396 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } -#line 6007 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +#line 6043 "sql.c" break; case 201: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ #line 397 "sql.y" -{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } -#line 6012 "sql.c" +{ yymsp[-3].minor.yy720 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +#line 6048 "sql.c" break; case 202: /* type_name ::= TINYINT UNSIGNED */ #line 398 "sql.y" -{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UTINYINT); } -#line 6017 "sql.c" +{ yymsp[-1].minor.yy720 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +#line 6053 "sql.c" break; case 203: /* type_name ::= SMALLINT UNSIGNED */ #line 399 "sql.y" -{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_USMALLINT); } -#line 6022 "sql.c" +{ yymsp[-1].minor.yy720 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +#line 6058 "sql.c" break; case 204: /* type_name ::= INT UNSIGNED */ #line 400 "sql.y" -{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UINT); } -#line 6027 "sql.c" +{ yymsp[-1].minor.yy720 = createDataType(TSDB_DATA_TYPE_UINT); } +#line 6063 "sql.c" break; case 205: /* type_name ::= BIGINT UNSIGNED */ #line 401 "sql.y" -{ yymsp[-1].minor.yy388 = createDataType(TSDB_DATA_TYPE_UBIGINT); } -#line 6032 "sql.c" +{ yymsp[-1].minor.yy720 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +#line 6068 "sql.c" break; case 206: /* type_name ::= JSON */ #line 402 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_JSON); } -#line 6037 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_JSON); } +#line 6073 "sql.c" break; case 207: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ #line 403 "sql.y" -{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } -#line 6042 "sql.c" +{ yymsp[-3].minor.yy720 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +#line 6078 "sql.c" break; case 208: /* type_name ::= MEDIUMBLOB */ #line 404 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } -#line 6047 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +#line 6083 "sql.c" break; case 209: /* type_name ::= BLOB */ #line 405 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_BLOB); } -#line 6052 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_BLOB); } +#line 6088 "sql.c" break; case 210: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ #line 406 "sql.y" -{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } -#line 6057 "sql.c" +{ yymsp[-3].minor.yy720 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +#line 6093 "sql.c" break; case 211: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ #line 407 "sql.y" -{ yymsp[-3].minor.yy388 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } -#line 6062 "sql.c" +{ yymsp[-3].minor.yy720 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); } +#line 6098 "sql.c" break; case 212: /* type_name ::= DECIMAL */ #line 408 "sql.y" -{ yymsp[0].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6067 "sql.c" +{ yymsp[0].minor.yy720 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6103 "sql.c" break; case 213: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ #line 409 "sql.y" -{ yymsp[-3].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6072 "sql.c" +{ yymsp[-3].minor.yy720 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6108 "sql.c" break; case 214: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ #line 410 "sql.y" -{ yymsp[-5].minor.yy388 = createDataType(TSDB_DATA_TYPE_DECIMAL); } -#line 6077 "sql.c" +{ yymsp[-5].minor.yy720 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +#line 6113 "sql.c" break; case 217: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ case 362: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==362); #line 419 "sql.y" -{ yymsp[-3].minor.yy298 = yymsp[-1].minor.yy298; } -#line 6083 "sql.c" +{ yymsp[-3].minor.yy860 = yymsp[-1].minor.yy860; } +#line 6119 "sql.c" break; case 218: /* table_options ::= */ #line 421 "sql.y" -{ yymsp[1].minor.yy122 = createDefaultTableOptions(pCxt); } -#line 6088 "sql.c" +{ yymsp[1].minor.yy348 = createDefaultTableOptions(pCxt); } +#line 6124 "sql.c" break; case 219: /* table_options ::= table_options COMMENT NK_STRING */ #line 422 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-2].minor.yy122, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } -#line 6093 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } +#line 6129 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 220: /* table_options ::= table_options MAX_DELAY duration_list */ #line 423 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-2].minor.yy122, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy298); } -#line 6099 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy860); } +#line 6135 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 221: /* table_options ::= table_options WATERMARK duration_list */ #line 424 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-2].minor.yy122, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy298); } -#line 6105 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy860); } +#line 6141 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 222: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ #line 425 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-4].minor.yy122, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy298); } -#line 6111 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-4].minor.yy348, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy860); } +#line 6147 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 223: /* table_options ::= table_options TTL NK_INTEGER */ #line 426 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-2].minor.yy122, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } -#line 6117 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } +#line 6153 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 224: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ #line 427 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-4].minor.yy122, TABLE_OPTION_SMA, yymsp[-1].minor.yy298); } -#line 6123 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-4].minor.yy348, TABLE_OPTION_SMA, yymsp[-1].minor.yy860); } +#line 6159 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; case 225: /* table_options ::= table_options DELETE_MARK duration_list */ #line 428 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-2].minor.yy122, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy298); } -#line 6129 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-2].minor.yy348, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy860); } +#line 6165 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 226: /* alter_table_options ::= alter_table_option */ #line 430 "sql.y" -{ yylhsminor.yy122 = createAlterTableOptions(pCxt); yylhsminor.yy122 = setTableOption(pCxt, yylhsminor.yy122, yymsp[0].minor.yy29.type, &yymsp[0].minor.yy29.val); } -#line 6135 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createAlterTableOptions(pCxt); yylhsminor.yy348 = setTableOption(pCxt, yylhsminor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } +#line 6171 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 227: /* alter_table_options ::= alter_table_options alter_table_option */ #line 431 "sql.y" -{ yylhsminor.yy122 = setTableOption(pCxt, yymsp[-1].minor.yy122, yymsp[0].minor.yy29.type, &yymsp[0].minor.yy29.val); } -#line 6141 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setTableOption(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy233.type, &yymsp[0].minor.yy233.val); } +#line 6177 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 228: /* alter_table_option ::= COMMENT NK_STRING */ #line 435 "sql.y" -{ yymsp[-1].minor.yy29.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 6147 "sql.c" +{ yymsp[-1].minor.yy233.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 6183 "sql.c" break; case 229: /* alter_table_option ::= TTL NK_INTEGER */ #line 436 "sql.y" -{ yymsp[-1].minor.yy29.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy29.val = yymsp[0].minor.yy0; } -#line 6152 "sql.c" +{ yymsp[-1].minor.yy233.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy233.val = yymsp[0].minor.yy0; } +#line 6188 "sql.c" break; case 230: /* duration_list ::= duration_literal */ - case 444: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==444); + case 446: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==446); #line 440 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 6158 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 6194 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; case 231: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 445: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==445); + case 447: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==447); #line 441 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 6165 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 6201 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; case 234: /* rollup_func_name ::= function_name */ #line 448 "sql.y" -{ yylhsminor.yy122 = createFunctionNode(pCxt, &yymsp[0].minor.yy203, NULL); } -#line 6171 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createFunctionNode(pCxt, &yymsp[0].minor.yy269, NULL); } +#line 6207 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 235: /* rollup_func_name ::= FIRST */ case 236: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==236); case 300: /* tag_item ::= QTAGS */ yytestcase(yyruleno==300); #line 449 "sql.y" -{ yylhsminor.yy122 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 6179 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 6215 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 239: /* col_name ::= column_name */ case 301: /* tag_item ::= column_name */ yytestcase(yyruleno==301); #line 457 "sql.y" -{ yylhsminor.yy122 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy203); } -#line 6186 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy269); } +#line 6222 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 240: /* cmd ::= SHOW DNODES */ #line 460 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } -#line 6192 "sql.c" +#line 6228 "sql.c" break; case 241: /* cmd ::= SHOW USERS */ #line 461 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } -#line 6197 "sql.c" +#line 6233 "sql.c" break; case 242: /* cmd ::= SHOW USER PRIVILEGES */ #line 462 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } -#line 6202 "sql.c" +#line 6238 "sql.c" break; case 243: /* cmd ::= SHOW db_kind_opt DATABASES */ #line 463 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy579); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy361); } -#line 6210 "sql.c" +#line 6246 "sql.c" break; case 244: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ #line 467 "sql.y" { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy343, yymsp[0].minor.yy122, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy749, yymsp[0].minor.yy348, OP_TYPE_LIKE); } -#line 6217 "sql.c" +#line 6253 "sql.c" break; case 245: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ #line 470 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy122, yymsp[0].minor.yy122, OP_TYPE_LIKE); } -#line 6222 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy348, yymsp[0].minor.yy348, OP_TYPE_LIKE); } +#line 6258 "sql.c" break; case 246: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ #line 471 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy122, NULL, OP_TYPE_LIKE); } -#line 6227 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy348, NULL, OP_TYPE_LIKE); } +#line 6263 "sql.c" break; case 247: /* cmd ::= SHOW MNODES */ #line 472 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } -#line 6232 "sql.c" +#line 6268 "sql.c" break; case 248: /* cmd ::= SHOW QNODES */ #line 474 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } -#line 6237 "sql.c" +#line 6273 "sql.c" break; case 249: /* cmd ::= SHOW FUNCTIONS */ #line 475 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } -#line 6242 "sql.c" +#line 6278 "sql.c" break; case 250: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ #line 476 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy122, yymsp[-1].minor.yy122, OP_TYPE_EQUAL); } -#line 6247 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy348, yymsp[-1].minor.yy348, OP_TYPE_EQUAL); } +#line 6283 "sql.c" break; case 251: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ #line 477 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy203), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy203), OP_TYPE_EQUAL); } -#line 6252 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy269), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy269), OP_TYPE_EQUAL); } +#line 6288 "sql.c" break; case 252: /* cmd ::= SHOW STREAMS */ #line 478 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } -#line 6257 "sql.c" +#line 6293 "sql.c" break; case 253: /* cmd ::= SHOW ACCOUNTS */ #line 479 "sql.y" { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } -#line 6262 "sql.c" +#line 6298 "sql.c" break; case 254: /* cmd ::= SHOW APPS */ #line 480 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } -#line 6267 "sql.c" +#line 6303 "sql.c" break; case 255: /* cmd ::= SHOW CONNECTIONS */ #line 481 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } -#line 6272 "sql.c" +#line 6308 "sql.c" break; case 256: /* cmd ::= SHOW LICENCES */ case 257: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==257); #line 482 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } -#line 6278 "sql.c" +#line 6314 "sql.c" break; case 258: /* cmd ::= SHOW CREATE DATABASE db_name */ #line 484 "sql.y" -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy203); } -#line 6283 "sql.c" +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy269); } +#line 6319 "sql.c" break; case 259: /* cmd ::= SHOW CREATE TABLE full_table_name */ #line 485 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy122); } -#line 6288 "sql.c" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy348); } +#line 6324 "sql.c" break; case 260: /* cmd ::= SHOW CREATE STABLE full_table_name */ #line 486 "sql.y" -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy122); } -#line 6293 "sql.c" +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy348); } +#line 6329 "sql.c" break; case 261: /* cmd ::= SHOW QUERIES */ #line 487 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } -#line 6298 "sql.c" +#line 6334 "sql.c" break; case 262: /* cmd ::= SHOW SCORES */ #line 488 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } -#line 6303 "sql.c" +#line 6339 "sql.c" break; case 263: /* cmd ::= SHOW TOPICS */ #line 489 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } -#line 6308 "sql.c" +#line 6344 "sql.c" break; case 264: /* cmd ::= SHOW VARIABLES */ case 265: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==265); #line 490 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } -#line 6314 "sql.c" +#line 6350 "sql.c" break; case 266: /* cmd ::= SHOW LOCAL VARIABLES */ #line 492 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } -#line 6319 "sql.c" +#line 6355 "sql.c" break; case 267: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ #line 493 "sql.y" -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy122); } -#line 6324 "sql.c" +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy348); } +#line 6360 "sql.c" break; case 268: /* cmd ::= SHOW BNODES */ #line 494 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } -#line 6329 "sql.c" +#line 6365 "sql.c" break; case 269: /* cmd ::= SHOW SNODES */ #line 495 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } -#line 6334 "sql.c" +#line 6370 "sql.c" break; case 270: /* cmd ::= SHOW CLUSTER */ #line 496 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } -#line 6339 "sql.c" +#line 6375 "sql.c" break; case 271: /* cmd ::= SHOW TRANSACTIONS */ #line 497 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } -#line 6344 "sql.c" +#line 6380 "sql.c" break; case 272: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ #line 498 "sql.y" -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy122); } -#line 6349 "sql.c" +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy348); } +#line 6385 "sql.c" break; case 273: /* cmd ::= SHOW CONSUMERS */ #line 499 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } -#line 6354 "sql.c" +#line 6390 "sql.c" break; case 274: /* cmd ::= SHOW SUBSCRIPTIONS */ #line 500 "sql.y" { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } -#line 6359 "sql.c" +#line 6395 "sql.c" break; case 275: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ #line 501 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy122, yymsp[-1].minor.yy122, OP_TYPE_EQUAL); } -#line 6364 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy348, yymsp[-1].minor.yy348, OP_TYPE_EQUAL); } +#line 6400 "sql.c" break; case 276: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ #line 502 "sql.y" -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy203), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy203), OP_TYPE_EQUAL); } -#line 6369 "sql.c" +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy269), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy269), OP_TYPE_EQUAL); } +#line 6405 "sql.c" break; case 277: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ #line 503 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy122, yymsp[0].minor.yy122, yymsp[-3].minor.yy298); } -#line 6374 "sql.c" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy348, yymsp[-3].minor.yy860); } +#line 6410 "sql.c" break; case 278: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ #line 504 "sql.y" -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy203), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy203), yymsp[-4].minor.yy298); } -#line 6379 "sql.c" +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy269), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy269), yymsp[-4].minor.yy860); } +#line 6415 "sql.c" break; case 279: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ #line 505 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } -#line 6384 "sql.c" +#line 6420 "sql.c" break; case 280: /* cmd ::= SHOW VNODES */ #line 506 "sql.y" { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } -#line 6389 "sql.c" +#line 6425 "sql.c" break; case 281: /* cmd ::= SHOW db_name_cond_opt ALIVE */ #line 508 "sql.y" -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy122, QUERY_NODE_SHOW_DB_ALIVE_STMT); } -#line 6394 "sql.c" +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy348, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +#line 6430 "sql.c" break; case 282: /* cmd ::= SHOW CLUSTER ALIVE */ #line 509 "sql.y" { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } -#line 6399 "sql.c" +#line 6435 "sql.c" break; case 283: /* table_kind_db_name_cond_opt ::= */ #line 513 "sql.y" -{ yymsp[1].minor.yy343.kind = SHOW_KIND_ALL; yymsp[1].minor.yy343.dbName = nil_token; } -#line 6404 "sql.c" +{ yymsp[1].minor.yy749.kind = SHOW_KIND_ALL; yymsp[1].minor.yy749.dbName = nil_token; } +#line 6440 "sql.c" break; case 284: /* table_kind_db_name_cond_opt ::= table_kind */ #line 514 "sql.y" -{ yylhsminor.yy343.kind = yymsp[0].minor.yy579; yylhsminor.yy343.dbName = nil_token; } -#line 6409 "sql.c" - yymsp[0].minor.yy343 = yylhsminor.yy343; +{ yylhsminor.yy749.kind = yymsp[0].minor.yy361; yylhsminor.yy749.dbName = nil_token; } +#line 6445 "sql.c" + yymsp[0].minor.yy749 = yylhsminor.yy749; break; case 285: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ #line 515 "sql.y" -{ yylhsminor.yy343.kind = SHOW_KIND_ALL; yylhsminor.yy343.dbName = yymsp[-1].minor.yy203; } -#line 6415 "sql.c" - yymsp[-1].minor.yy343 = yylhsminor.yy343; +{ yylhsminor.yy749.kind = SHOW_KIND_ALL; yylhsminor.yy749.dbName = yymsp[-1].minor.yy269; } +#line 6451 "sql.c" + yymsp[-1].minor.yy749 = yylhsminor.yy749; break; case 286: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ #line 516 "sql.y" -{ yylhsminor.yy343.kind = yymsp[-2].minor.yy579; yylhsminor.yy343.dbName = yymsp[-1].minor.yy203; } -#line 6421 "sql.c" - yymsp[-2].minor.yy343 = yylhsminor.yy343; +{ yylhsminor.yy749.kind = yymsp[-2].minor.yy361; yylhsminor.yy749.dbName = yymsp[-1].minor.yy269; } +#line 6457 "sql.c" + yymsp[-2].minor.yy749 = yylhsminor.yy749; break; case 287: /* table_kind ::= NORMAL */ #line 520 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_NORMAL; } -#line 6427 "sql.c" +{ yymsp[0].minor.yy361 = SHOW_KIND_TABLES_NORMAL; } +#line 6463 "sql.c" break; case 288: /* table_kind ::= CHILD */ #line 521 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_TABLES_CHILD; } -#line 6432 "sql.c" +{ yymsp[0].minor.yy361 = SHOW_KIND_TABLES_CHILD; } +#line 6468 "sql.c" break; case 289: /* db_name_cond_opt ::= */ case 294: /* from_db_opt ::= */ yytestcase(yyruleno==294); #line 523 "sql.y" -{ yymsp[1].minor.yy122 = createDefaultDatabaseCondValue(pCxt); } -#line 6438 "sql.c" +{ yymsp[1].minor.yy348 = createDefaultDatabaseCondValue(pCxt); } +#line 6474 "sql.c" break; case 290: /* db_name_cond_opt ::= db_name NK_DOT */ #line 524 "sql.y" -{ yylhsminor.yy122 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy203); } -#line 6443 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy269); } +#line 6479 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 292: /* like_pattern_opt ::= LIKE NK_STRING */ #line 527 "sql.y" -{ yymsp[-1].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 6449 "sql.c" +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 6485 "sql.c" break; case 293: /* table_name_cond ::= table_name */ #line 529 "sql.y" -{ yylhsminor.yy122 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy203); } -#line 6454 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy269); } +#line 6490 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 295: /* from_db_opt ::= FROM db_name */ #line 532 "sql.y" -{ yymsp[-1].minor.yy122 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy203); } -#line 6460 "sql.c" +{ yymsp[-1].minor.yy348 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy269); } +#line 6496 "sql.c" break; case 299: /* tag_item ::= TBNAME */ #line 540 "sql.y" -{ yylhsminor.yy122 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } -#line 6465 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } +#line 6501 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 302: /* tag_item ::= column_name column_alias */ #line 543 "sql.y" -{ yylhsminor.yy122 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy203), &yymsp[0].minor.yy203); } -#line 6471 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy269), &yymsp[0].minor.yy269); } +#line 6507 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; case 303: /* tag_item ::= column_name AS column_alias */ #line 544 "sql.y" -{ yylhsminor.yy122 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy203), &yymsp[0].minor.yy203); } -#line 6477 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy269), &yymsp[0].minor.yy269); } +#line 6513 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 304: /* db_kind_opt ::= */ #line 548 "sql.y" -{ yymsp[1].minor.yy579 = SHOW_KIND_ALL; } -#line 6483 "sql.c" +{ yymsp[1].minor.yy361 = SHOW_KIND_ALL; } +#line 6519 "sql.c" break; case 305: /* db_kind_opt ::= USER */ #line 549 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_USER; } -#line 6488 "sql.c" +{ yymsp[0].minor.yy361 = SHOW_KIND_DATABASES_USER; } +#line 6524 "sql.c" break; case 306: /* db_kind_opt ::= SYSTEM */ #line 550 "sql.y" -{ yymsp[0].minor.yy579 = SHOW_KIND_DATABASES_SYSTEM; } -#line 6493 "sql.c" +{ yymsp[0].minor.yy361 = SHOW_KIND_DATABASES_SYSTEM; } +#line 6529 "sql.c" break; case 307: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ #line 554 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy983, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, NULL, yymsp[0].minor.yy122); } -#line 6498 "sql.c" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy345, yymsp[-3].minor.yy348, yymsp[-1].minor.yy348, NULL, yymsp[0].minor.yy348); } +#line 6534 "sql.c" break; case 308: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ #line 556 "sql.y" -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy983, yymsp[-5].minor.yy122, yymsp[-3].minor.yy122, yymsp[-1].minor.yy298, NULL); } -#line 6503 "sql.c" +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy345, yymsp[-5].minor.yy348, yymsp[-3].minor.yy348, yymsp[-1].minor.yy860, NULL); } +#line 6539 "sql.c" break; case 309: /* cmd ::= DROP INDEX exists_opt full_index_name */ #line 557 "sql.y" -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy983, yymsp[0].minor.yy122); } -#line 6508 "sql.c" +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy345, yymsp[0].minor.yy348); } +#line 6544 "sql.c" break; case 310: /* full_index_name ::= index_name */ #line 559 "sql.y" -{ yylhsminor.yy122 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy203); } -#line 6513 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy269); } +#line 6549 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; case 311: /* full_index_name ::= db_name NK_DOT index_name */ #line 560 "sql.y" -{ yylhsminor.yy122 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy203); } -#line 6519 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269); } +#line 6555 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 312: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ #line 563 "sql.y" -{ yymsp[-9].minor.yy122 = createIndexOption(pCxt, yymsp[-7].minor.yy298, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), NULL, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 6525 "sql.c" +{ yymsp[-9].minor.yy348 = createIndexOption(pCxt, yymsp[-7].minor.yy860, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), NULL, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 6561 "sql.c" break; case 313: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ #line 566 "sql.y" -{ yymsp[-11].minor.yy122 = createIndexOption(pCxt, yymsp[-9].minor.yy298, releaseRawExprNode(pCxt, yymsp[-5].minor.yy122), releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 6530 "sql.c" +{ yymsp[-11].minor.yy348 = createIndexOption(pCxt, yymsp[-9].minor.yy860, releaseRawExprNode(pCxt, yymsp[-5].minor.yy348), releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 6566 "sql.c" break; case 316: /* func ::= sma_func_name NK_LP expression_list NK_RP */ #line 573 "sql.y" -{ yylhsminor.yy122 = createFunctionNode(pCxt, &yymsp[-3].minor.yy203, yymsp[-1].minor.yy298); } -#line 6535 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createFunctionNode(pCxt, &yymsp[-3].minor.yy269, yymsp[-1].minor.yy860); } +#line 6571 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 317: /* sma_func_name ::= function_name */ - case 531: /* alias_opt ::= table_alias */ yytestcase(yyruleno==531); + case 533: /* alias_opt ::= table_alias */ yytestcase(yyruleno==533); #line 577 "sql.y" -{ yylhsminor.yy203 = yymsp[0].minor.yy203; } -#line 6542 "sql.c" - yymsp[0].minor.yy203 = yylhsminor.yy203; +{ yylhsminor.yy269 = yymsp[0].minor.yy269; } +#line 6578 "sql.c" + yymsp[0].minor.yy269 = yylhsminor.yy269; break; case 322: /* sma_stream_opt ::= */ case 363: /* stream_options ::= */ yytestcase(yyruleno==363); #line 583 "sql.y" -{ yymsp[1].minor.yy122 = createStreamOptions(pCxt); } -#line 6549 "sql.c" +{ yymsp[1].minor.yy348 = createStreamOptions(pCxt); } +#line 6585 "sql.c" break; case 323: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ #line 584 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy122)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy122); yylhsminor.yy122 = yymsp[-2].minor.yy122; } -#line 6554 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ ((SStreamOptions*)yymsp[-2].minor.yy348)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); yylhsminor.yy348 = yymsp[-2].minor.yy348; } +#line 6590 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 324: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ #line 585 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy122)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy122); yylhsminor.yy122 = yymsp[-2].minor.yy122; } -#line 6560 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ ((SStreamOptions*)yymsp[-2].minor.yy348)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); yylhsminor.yy348 = yymsp[-2].minor.yy348; } +#line 6596 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 325: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ #line 586 "sql.y" -{ ((SStreamOptions*)yymsp[-2].minor.yy122)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy122); yylhsminor.yy122 = yymsp[-2].minor.yy122; } -#line 6566 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ ((SStreamOptions*)yymsp[-2].minor.yy348)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); yylhsminor.yy348 = yymsp[-2].minor.yy348; } +#line 6602 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 326: /* with_meta ::= AS */ #line 591 "sql.y" -{ yymsp[0].minor.yy652 = 0; } -#line 6572 "sql.c" +{ yymsp[0].minor.yy88 = 0; } +#line 6608 "sql.c" break; case 327: /* with_meta ::= WITH META AS */ #line 592 "sql.y" -{ yymsp[-2].minor.yy652 = 1; } -#line 6577 "sql.c" +{ yymsp[-2].minor.yy88 = 1; } +#line 6613 "sql.c" break; case 328: /* with_meta ::= ONLY META AS */ #line 593 "sql.y" -{ yymsp[-2].minor.yy652 = 2; } -#line 6582 "sql.c" +{ yymsp[-2].minor.yy88 = 2; } +#line 6618 "sql.c" break; case 329: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ #line 595 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy983, &yymsp[-2].minor.yy203, yymsp[0].minor.yy122); } -#line 6587 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy269, yymsp[0].minor.yy348); } +#line 6623 "sql.c" break; case 330: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ #line 597 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy983, &yymsp[-3].minor.yy203, &yymsp[0].minor.yy203, yymsp[-2].minor.yy652); } -#line 6592 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy345, &yymsp[-3].minor.yy269, &yymsp[0].minor.yy269, yymsp[-2].minor.yy88); } +#line 6628 "sql.c" break; case 331: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ #line 599 "sql.y" -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy983, &yymsp[-4].minor.yy203, yymsp[-1].minor.yy122, yymsp[-3].minor.yy652, yymsp[0].minor.yy122); } -#line 6597 "sql.c" +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy345, &yymsp[-4].minor.yy269, yymsp[-1].minor.yy348, yymsp[-3].minor.yy88, yymsp[0].minor.yy348); } +#line 6633 "sql.c" break; case 332: /* cmd ::= DROP TOPIC exists_opt topic_name */ #line 601 "sql.y" -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 6602 "sql.c" +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 6638 "sql.c" break; case 333: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ #line 602 "sql.y" -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy983, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy203); } -#line 6607 "sql.c" +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy345, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269); } +#line 6643 "sql.c" break; case 334: /* cmd ::= DESC full_table_name */ case 335: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==335); #line 605 "sql.y" -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy122); } -#line 6613 "sql.c" +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy348); } +#line 6649 "sql.c" break; case 336: /* cmd ::= RESET QUERY CACHE */ #line 609 "sql.y" { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } -#line 6618 "sql.c" +#line 6654 "sql.c" break; case 337: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ case 338: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==338); #line 612 "sql.y" -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy983, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 6624 "sql.c" +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy345, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 6660 "sql.c" break; case 341: /* explain_options ::= */ #line 620 "sql.y" -{ yymsp[1].minor.yy122 = createDefaultExplainOptions(pCxt); } -#line 6629 "sql.c" +{ yymsp[1].minor.yy348 = createDefaultExplainOptions(pCxt); } +#line 6665 "sql.c" break; case 342: /* explain_options ::= explain_options VERBOSE NK_BOOL */ #line 621 "sql.y" -{ yylhsminor.yy122 = setExplainVerbose(pCxt, yymsp[-2].minor.yy122, &yymsp[0].minor.yy0); } -#line 6634 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setExplainVerbose(pCxt, yymsp[-2].minor.yy348, &yymsp[0].minor.yy0); } +#line 6670 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 343: /* explain_options ::= explain_options RATIO NK_FLOAT */ #line 622 "sql.y" -{ yylhsminor.yy122 = setExplainRatio(pCxt, yymsp[-2].minor.yy122, &yymsp[0].minor.yy0); } -#line 6640 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setExplainRatio(pCxt, yymsp[-2].minor.yy348, &yymsp[0].minor.yy0); } +#line 6676 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 344: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ #line 627 "sql.y" -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy983, yymsp[-9].minor.yy983, &yymsp[-6].minor.yy203, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy388, yymsp[-1].minor.yy652, &yymsp[0].minor.yy203, yymsp[-10].minor.yy983); } -#line 6646 "sql.c" +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy345, yymsp[-9].minor.yy345, &yymsp[-6].minor.yy269, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy720, yymsp[-1].minor.yy88, &yymsp[0].minor.yy269, yymsp[-10].minor.yy345); } +#line 6682 "sql.c" break; case 345: /* cmd ::= DROP FUNCTION exists_opt function_name */ #line 628 "sql.y" -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 6651 "sql.c" +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 6687 "sql.c" break; case 350: /* language_opt ::= */ + case 384: /* on_vgroup_id ::= */ yytestcase(yyruleno==384); #line 642 "sql.y" -{ yymsp[1].minor.yy203 = nil_token; } -#line 6656 "sql.c" +{ yymsp[1].minor.yy269 = nil_token; } +#line 6693 "sql.c" break; case 351: /* language_opt ::= LANGUAGE NK_STRING */ + case 385: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==385); #line 643 "sql.y" -{ yymsp[-1].minor.yy203 = yymsp[0].minor.yy0; } -#line 6661 "sql.c" +{ yymsp[-1].minor.yy269 = yymsp[0].minor.yy0; } +#line 6699 "sql.c" break; case 354: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ #line 653 "sql.y" -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy983, &yymsp[-8].minor.yy203, yymsp[-5].minor.yy122, yymsp[-7].minor.yy122, yymsp[-3].minor.yy298, yymsp[-2].minor.yy122, yymsp[0].minor.yy122, yymsp[-4].minor.yy298); } -#line 6666 "sql.c" +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy345, &yymsp[-8].minor.yy269, yymsp[-5].minor.yy348, yymsp[-7].minor.yy348, yymsp[-3].minor.yy860, yymsp[-2].minor.yy348, yymsp[0].minor.yy348, yymsp[-4].minor.yy860); } +#line 6704 "sql.c" break; case 355: /* cmd ::= DROP STREAM exists_opt stream_name */ #line 654 "sql.y" -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 6671 "sql.c" +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 6709 "sql.c" break; case 356: /* cmd ::= PAUSE STREAM exists_opt stream_name */ #line 655 "sql.y" -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 6676 "sql.c" +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 6714 "sql.c" break; case 357: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ #line 656 "sql.y" -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy983, yymsp[-1].minor.yy983, &yymsp[0].minor.yy203); } -#line 6681 "sql.c" +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy345, yymsp[-1].minor.yy345, &yymsp[0].minor.yy269); } +#line 6719 "sql.c" break; case 364: /* stream_options ::= stream_options TRIGGER AT_ONCE */ case 365: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==365); #line 670 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-2].minor.yy122, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } -#line 6687 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-2].minor.yy348, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } +#line 6725 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 366: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ #line 672 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-3].minor.yy122, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 6693 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-3].minor.yy348, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 6731 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 367: /* stream_options ::= stream_options WATERMARK duration_literal */ #line 673 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-2].minor.yy122, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 6699 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-2].minor.yy348, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 6737 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 368: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ #line 674 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-3].minor.yy122, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } -#line 6705 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-3].minor.yy348, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } +#line 6743 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 369: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ #line 675 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-2].minor.yy122, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } -#line 6711 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-2].minor.yy348, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } +#line 6749 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 370: /* stream_options ::= stream_options DELETE_MARK duration_literal */ #line 676 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-2].minor.yy122, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 6717 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-2].minor.yy348, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 6755 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; case 371: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ #line 677 "sql.y" -{ yylhsminor.yy122 = setStreamOptions(pCxt, yymsp[-3].minor.yy122, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } -#line 6723 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = setStreamOptions(pCxt, yymsp[-3].minor.yy348, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } +#line 6761 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; case 373: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 569: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==569); - case 590: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==590); + case 571: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==571); + case 592: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==592); #line 680 "sql.y" -{ yymsp[-3].minor.yy122 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy122); } -#line 6731 "sql.c" +{ yymsp[-3].minor.yy348 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy348); } +#line 6769 "sql.c" break; case 376: /* cmd ::= KILL CONNECTION NK_INTEGER */ #line 688 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } -#line 6736 "sql.c" +#line 6774 "sql.c" break; case 377: /* cmd ::= KILL QUERY NK_STRING */ #line 689 "sql.y" { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } -#line 6741 "sql.c" +#line 6779 "sql.c" break; case 378: /* cmd ::= KILL TRANSACTION NK_INTEGER */ #line 690 "sql.y" { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } -#line 6746 "sql.c" +#line 6784 "sql.c" break; case 379: /* cmd ::= BALANCE VGROUP */ #line 693 "sql.y" { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } -#line 6751 "sql.c" +#line 6789 "sql.c" break; - case 380: /* cmd ::= BALANCE VGROUP LEADER */ + case 380: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ #line 694 "sql.y" -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt); } -#line 6756 "sql.c" +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy269); } +#line 6794 "sql.c" break; case 381: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ #line 695 "sql.y" { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 6761 "sql.c" +#line 6799 "sql.c" break; case 382: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ #line 696 "sql.y" -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy298); } -#line 6766 "sql.c" +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy860); } +#line 6804 "sql.c" break; case 383: /* cmd ::= SPLIT VGROUP NK_INTEGER */ #line 697 "sql.y" { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } -#line 6771 "sql.c" +#line 6809 "sql.c" break; - case 384: /* dnode_list ::= DNODE NK_INTEGER */ -#line 701 "sql.y" -{ yymsp[-1].minor.yy298 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } -#line 6776 "sql.c" - break; - case 386: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -#line 708 "sql.y" -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 6781 "sql.c" - break; - case 389: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -#line 717 "sql.y" -{ yymsp[-6].minor.yy122 = createInsertStmt(pCxt, yymsp[-4].minor.yy122, yymsp[-2].minor.yy298, yymsp[0].minor.yy122); } -#line 6786 "sql.c" - break; - case 390: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -#line 718 "sql.y" -{ yymsp[-3].minor.yy122 = createInsertStmt(pCxt, yymsp[-1].minor.yy122, NULL, yymsp[0].minor.yy122); } -#line 6791 "sql.c" - break; - case 391: /* literal ::= NK_INTEGER */ -#line 721 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } -#line 6796 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 392: /* literal ::= NK_FLOAT */ -#line 722 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } -#line 6802 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 393: /* literal ::= NK_STRING */ -#line 723 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } -#line 6808 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 394: /* literal ::= NK_BOOL */ -#line 724 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + case 386: /* dnode_list ::= DNODE NK_INTEGER */ +#line 706 "sql.y" +{ yymsp[-1].minor.yy860 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } #line 6814 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; break; - case 395: /* literal ::= TIMESTAMP NK_STRING */ -#line 725 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } -#line 6820 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; + case 388: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +#line 713 "sql.y" +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 6819 "sql.c" break; - case 396: /* literal ::= duration_literal */ - case 406: /* signed_literal ::= signed */ yytestcase(yyruleno==406); - case 427: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==427); - case 428: /* expression ::= literal */ yytestcase(yyruleno==428); - case 430: /* expression ::= column_reference */ yytestcase(yyruleno==430); - case 431: /* expression ::= function_expression */ yytestcase(yyruleno==431); - case 432: /* expression ::= case_when_expression */ yytestcase(yyruleno==432); - case 463: /* function_expression ::= literal_func */ yytestcase(yyruleno==463); - case 512: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==512); - case 516: /* boolean_primary ::= predicate */ yytestcase(yyruleno==516); - case 518: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==518); - case 519: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==519); - case 522: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==522); - case 524: /* table_reference ::= table_primary */ yytestcase(yyruleno==524); - case 525: /* table_reference ::= joined_table */ yytestcase(yyruleno==525); - case 529: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==529); - case 592: /* query_simple ::= query_specification */ yytestcase(yyruleno==592); - case 593: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==593); - case 596: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==596); - case 598: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==598); + case 391: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +#line 722 "sql.y" +{ yymsp[-6].minor.yy348 = createInsertStmt(pCxt, yymsp[-4].minor.yy348, yymsp[-2].minor.yy860, yymsp[0].minor.yy348); } +#line 6824 "sql.c" + break; + case 392: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +#line 723 "sql.y" +{ yymsp[-3].minor.yy348 = createInsertStmt(pCxt, yymsp[-1].minor.yy348, NULL, yymsp[0].minor.yy348); } +#line 6829 "sql.c" + break; + case 393: /* literal ::= NK_INTEGER */ #line 726 "sql.y" -{ yylhsminor.yy122 = yymsp[0].minor.yy122; } -#line 6845 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } +#line 6834 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 397: /* literal ::= NULL */ + case 394: /* literal ::= NK_FLOAT */ #line 727 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } -#line 6851 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } +#line 6840 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 398: /* literal ::= NK_QUESTION */ + case 395: /* literal ::= NK_STRING */ #line 728 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6857 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } +#line 6846 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 399: /* duration_literal ::= NK_VARIABLE */ + case 396: /* literal ::= NK_BOOL */ +#line 729 "sql.y" +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } +#line 6852 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 397: /* literal ::= TIMESTAMP NK_STRING */ #line 730 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } -#line 6863 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } +#line 6858 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 400: /* signed ::= NK_INTEGER */ + case 398: /* literal ::= duration_literal */ + case 408: /* signed_literal ::= signed */ yytestcase(yyruleno==408); + case 429: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==429); + case 430: /* expression ::= literal */ yytestcase(yyruleno==430); + case 432: /* expression ::= column_reference */ yytestcase(yyruleno==432); + case 433: /* expression ::= function_expression */ yytestcase(yyruleno==433); + case 434: /* expression ::= case_when_expression */ yytestcase(yyruleno==434); + case 465: /* function_expression ::= literal_func */ yytestcase(yyruleno==465); + case 514: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==514); + case 518: /* boolean_primary ::= predicate */ yytestcase(yyruleno==518); + case 520: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==520); + case 521: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==521); + case 524: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==524); + case 526: /* table_reference ::= table_primary */ yytestcase(yyruleno==526); + case 527: /* table_reference ::= joined_table */ yytestcase(yyruleno==527); + case 531: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==531); + case 594: /* query_simple ::= query_specification */ yytestcase(yyruleno==594); + case 595: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==595); + case 598: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==598); + case 600: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==600); +#line 731 "sql.y" +{ yylhsminor.yy348 = yymsp[0].minor.yy348; } +#line 6883 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 399: /* literal ::= NULL */ #line 732 "sql.y" -{ yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 6869 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } +#line 6889 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 401: /* signed ::= NK_PLUS NK_INTEGER */ + case 400: /* literal ::= NK_QUESTION */ #line 733 "sql.y" -{ yymsp[-1].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } -#line 6875 "sql.c" +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6895 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 402: /* signed ::= NK_MINUS NK_INTEGER */ -#line 734 "sql.y" -{ - SToken t = yymsp[-1].minor.yy0; - t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); - } -#line 6884 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; + case 401: /* duration_literal ::= NK_VARIABLE */ +#line 735 "sql.y" +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } +#line 6901 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 403: /* signed ::= NK_FLOAT */ + case 402: /* signed ::= NK_INTEGER */ +#line 737 "sql.y" +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 6907 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 403: /* signed ::= NK_PLUS NK_INTEGER */ +#line 738 "sql.y" +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } +#line 6913 "sql.c" + break; + case 404: /* signed ::= NK_MINUS NK_INTEGER */ #line 739 "sql.y" -{ yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 6890 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 404: /* signed ::= NK_PLUS NK_FLOAT */ -#line 740 "sql.y" -{ yymsp[-1].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } -#line 6896 "sql.c" - break; - case 405: /* signed ::= NK_MINUS NK_FLOAT */ -#line 741 "sql.y" { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } -#line 6905 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +#line 6922 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 407: /* signed_literal ::= NK_STRING */ -#line 748 "sql.y" -{ yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } -#line 6911 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; + case 405: /* signed ::= NK_FLOAT */ +#line 744 "sql.y" +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 6928 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 408: /* signed_literal ::= NK_BOOL */ -#line 749 "sql.y" -{ yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } -#line 6917 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; + case 406: /* signed ::= NK_PLUS NK_FLOAT */ +#line 745 "sql.y" +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } +#line 6934 "sql.c" break; - case 409: /* signed_literal ::= TIMESTAMP NK_STRING */ -#line 750 "sql.y" -{ yymsp[-1].minor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } -#line 6923 "sql.c" + case 407: /* signed ::= NK_MINUS NK_FLOAT */ +#line 746 "sql.y" +{ + SToken t = yymsp[-1].minor.yy0; + t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; + yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + } +#line 6943 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 410: /* signed_literal ::= duration_literal */ - case 412: /* signed_literal ::= literal_func */ yytestcase(yyruleno==412); - case 483: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==483); - case 549: /* select_item ::= common_expression */ yytestcase(yyruleno==549); - case 559: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==559); - case 597: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==597); - case 599: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==599); - case 612: /* search_condition ::= common_expression */ yytestcase(yyruleno==612); -#line 751 "sql.y" -{ yylhsminor.yy122 = releaseRawExprNode(pCxt, yymsp[0].minor.yy122); } -#line 6935 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; + case 409: /* signed_literal ::= NK_STRING */ +#line 753 "sql.y" +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +#line 6949 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 411: /* signed_literal ::= NULL */ -#line 752 "sql.y" -{ yylhsminor.yy122 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } -#line 6941 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 413: /* signed_literal ::= NK_QUESTION */ + case 410: /* signed_literal ::= NK_BOOL */ #line 754 "sql.y" -{ yylhsminor.yy122 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } -#line 6947 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } +#line 6955 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 429: /* expression ::= pseudo_column */ -#line 811 "sql.y" -{ yylhsminor.yy122 = yymsp[0].minor.yy122; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy122, true); } -#line 6953 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 433: /* expression ::= NK_LP expression NK_RP */ - case 517: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==517); - case 611: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==611); -#line 815 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy122)); } + case 411: /* signed_literal ::= TIMESTAMP NK_STRING */ +#line 755 "sql.y" +{ yymsp[-1].minor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } #line 6961 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; break; - case 434: /* expression ::= NK_PLUS expr_or_subquery */ -#line 816 "sql.y" -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); - } -#line 6970 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; + case 412: /* signed_literal ::= duration_literal */ + case 414: /* signed_literal ::= literal_func */ yytestcase(yyruleno==414); + case 485: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==485); + case 551: /* select_item ::= common_expression */ yytestcase(yyruleno==551); + case 561: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==561); + case 599: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==599); + case 601: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==601); + case 614: /* search_condition ::= common_expression */ yytestcase(yyruleno==614); +#line 756 "sql.y" +{ yylhsminor.yy348 = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); } +#line 6973 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 435: /* expression ::= NK_MINUS expr_or_subquery */ -#line 820 "sql.y" -{ - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy122), NULL)); - } + case 413: /* signed_literal ::= NULL */ +#line 757 "sql.y" +{ yylhsminor.yy348 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } #line 6979 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 436: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ -#line 824 "sql.y" + case 415: /* signed_literal ::= NK_QUESTION */ +#line 759 "sql.y" +{ yylhsminor.yy348 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } +#line 6985 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 431: /* expression ::= pseudo_column */ +#line 816 "sql.y" +{ yylhsminor.yy348 = yymsp[0].minor.yy348; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy348, true); } +#line 6991 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; + break; + case 435: /* expression ::= NK_LP expression NK_RP */ + case 519: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==519); + case 613: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==613); +#line 820 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } +#line 6999 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 436: /* expression ::= NK_PLUS expr_or_subquery */ +#line 821 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } -#line 6989 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7008 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 437: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 437: /* expression ::= NK_MINUS expr_or_subquery */ +#line 825 "sql.y" +{ + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy348), NULL)); + } +#line 7017 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 438: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ #line 829 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 6999 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7027 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 438: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 439: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ #line 834 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7009 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7037 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 439: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 440: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ #line 839 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7019 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7047 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 440: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 441: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ #line 844 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7029 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7057 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 441: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 442: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ #line 849 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7038 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7067 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 442: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ -#line 853 "sql.y" + case 443: /* expression ::= column_reference NK_ARROW NK_STRING */ +#line 854 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } -#line 7048 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7076 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 443: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 444: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ #line 858 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7058 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +#line 7086 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 446: /* column_reference ::= column_name */ -#line 869 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy203, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy203)); } -#line 7064 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; + case 445: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ +#line 863 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } +#line 7096 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 447: /* column_reference ::= table_name NK_DOT column_name */ -#line 870 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy203, createColumnNode(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy203)); } -#line 7070 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 448: /* pseudo_column ::= ROWTS */ - case 449: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==449); - case 451: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==451); - case 452: /* pseudo_column ::= QEND */ yytestcase(yyruleno==452); - case 453: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==453); - case 454: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==454); - case 455: /* pseudo_column ::= WEND */ yytestcase(yyruleno==455); - case 456: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==456); - case 457: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==457); - case 458: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==458); - case 459: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==459); - case 465: /* literal_func ::= NOW */ yytestcase(yyruleno==465); -#line 872 "sql.y" -{ yylhsminor.yy122 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } -#line 7087 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; - break; - case 450: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 448: /* column_reference ::= column_name */ #line 874 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy203)))); } -#line 7093 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy269, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy269)); } +#line 7102 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 460: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 461: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==461); -#line 885 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy203, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy203, yymsp[-1].minor.yy298)); } -#line 7100 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; + case 449: /* column_reference ::= table_name NK_DOT column_name */ +#line 875 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269, createColumnNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy269)); } +#line 7108 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 462: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -#line 888 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), yymsp[-1].minor.yy388)); } -#line 7106 "sql.c" - yymsp[-5].minor.yy122 = yylhsminor.yy122; - break; - case 464: /* literal_func ::= noarg_func NK_LP NK_RP */ -#line 891 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy203, NULL)); } -#line 7112 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 479: /* star_func_para_list ::= NK_STAR */ -#line 915 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } -#line 7118 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; - break; - case 484: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 552: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==552); -#line 924 "sql.y" -{ yylhsminor.yy122 = createColumnNode(pCxt, &yymsp[-2].minor.yy203, &yymsp[0].minor.yy0); } + case 450: /* pseudo_column ::= ROWTS */ + case 451: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==451); + case 453: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==453); + case 454: /* pseudo_column ::= QEND */ yytestcase(yyruleno==454); + case 455: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==455); + case 456: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==456); + case 457: /* pseudo_column ::= WEND */ yytestcase(yyruleno==457); + case 458: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==458); + case 459: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==459); + case 460: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==460); + case 461: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==461); + case 467: /* literal_func ::= NOW */ yytestcase(yyruleno==467); +#line 877 "sql.y" +{ yylhsminor.yy348 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } #line 7125 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 485: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -#line 927 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy298, yymsp[-1].minor.yy122)); } + case 452: /* pseudo_column ::= table_name NK_DOT TBNAME */ +#line 879 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy269)))); } #line 7131 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 486: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 462: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 463: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==463); +#line 890 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy269, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy269, yymsp[-1].minor.yy860)); } +#line 7138 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 464: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +#line 893 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), yymsp[-1].minor.yy720)); } +#line 7144 "sql.c" + yymsp[-5].minor.yy348 = yylhsminor.yy348; + break; + case 466: /* literal_func ::= noarg_func NK_LP NK_RP */ +#line 896 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy269, NULL)); } +#line 7150 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 481: /* star_func_para_list ::= NK_STAR */ +#line 920 "sql.y" +{ yylhsminor.yy860 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } +#line 7156 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; + break; + case 486: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 554: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==554); #line 929 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), yymsp[-2].minor.yy298, yymsp[-1].minor.yy122)); } -#line 7137 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; +{ yylhsminor.yy348 = createColumnNode(pCxt, &yymsp[-2].minor.yy269, &yymsp[0].minor.yy0); } +#line 7163 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 489: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -#line 936 "sql.y" -{ yymsp[-3].minor.yy122 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122)); } -#line 7143 "sql.c" + case 487: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +#line 932 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy860, yymsp[-1].minor.yy348)); } +#line 7169 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; - case 491: /* case_when_else_opt ::= ELSE common_expression */ -#line 939 "sql.y" -{ yymsp[-1].minor.yy122 = releaseRawExprNode(pCxt, yymsp[0].minor.yy122); } -#line 7148 "sql.c" + case 488: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +#line 934 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), yymsp[-2].minor.yy860, yymsp[-1].minor.yy348)); } +#line 7175 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; - case 492: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 497: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==497); -#line 942 "sql.y" + case 491: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +#line 941 "sql.y" +{ yymsp[-3].minor.yy348 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348)); } +#line 7181 "sql.c" + break; + case 493: /* case_when_else_opt ::= ELSE common_expression */ +#line 944 "sql.y" +{ yymsp[-1].minor.yy348 = releaseRawExprNode(pCxt, yymsp[0].minor.yy348); } +#line 7186 "sql.c" + break; + case 494: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 499: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==499); +#line 947 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy416, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); - } -#line 7158 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 493: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 949 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy122), releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); - } -#line 7168 "sql.c" - yymsp[-4].minor.yy122 = yylhsminor.yy122; - break; - case 494: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ -#line 955 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy122), releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); - } -#line 7178 "sql.c" - yymsp[-5].minor.yy122 = yylhsminor.yy122; - break; - case 495: /* predicate ::= expr_or_subquery IS NULL */ -#line 960 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), NULL)); - } -#line 7187 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 496: /* predicate ::= expr_or_subquery IS NOT NULL */ -#line 964 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy696, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } #line 7196 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 498: /* compare_op ::= NK_LT */ -#line 976 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_THAN; } -#line 7202 "sql.c" - break; - case 499: /* compare_op ::= NK_GT */ -#line 977 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_THAN; } -#line 7207 "sql.c" - break; - case 500: /* compare_op ::= NK_LE */ -#line 978 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_LOWER_EQUAL; } -#line 7212 "sql.c" - break; - case 501: /* compare_op ::= NK_GE */ -#line 979 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_GREATER_EQUAL; } -#line 7217 "sql.c" - break; - case 502: /* compare_op ::= NK_NE */ -#line 980 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_NOT_EQUAL; } -#line 7222 "sql.c" - break; - case 503: /* compare_op ::= NK_EQ */ -#line 981 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_EQUAL; } -#line 7227 "sql.c" - break; - case 504: /* compare_op ::= LIKE */ -#line 982 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_LIKE; } -#line 7232 "sql.c" - break; - case 505: /* compare_op ::= NOT LIKE */ -#line 983 "sql.y" -{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_LIKE; } -#line 7237 "sql.c" - break; - case 506: /* compare_op ::= MATCH */ -#line 984 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_MATCH; } -#line 7242 "sql.c" - break; - case 507: /* compare_op ::= NMATCH */ -#line 985 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_NMATCH; } -#line 7247 "sql.c" - break; - case 508: /* compare_op ::= CONTAINS */ -#line 986 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_JSON_CONTAINS; } -#line 7252 "sql.c" - break; - case 509: /* in_op ::= IN */ -#line 990 "sql.y" -{ yymsp[0].minor.yy416 = OP_TYPE_IN; } -#line 7257 "sql.c" - break; - case 510: /* in_op ::= NOT IN */ -#line 991 "sql.y" -{ yymsp[-1].minor.yy416 = OP_TYPE_NOT_IN; } -#line 7262 "sql.c" - break; - case 511: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -#line 993 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy298)); } -#line 7267 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 513: /* boolean_value_expression ::= NOT boolean_primary */ -#line 997 "sql.y" + case 495: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 954 "sql.y" { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy122), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy348), releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } -#line 7276 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; +#line 7206 "sql.c" + yymsp[-4].minor.yy348 = yylhsminor.yy348; break; - case 514: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 496: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ +#line 960 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy348), releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } +#line 7216 "sql.c" + yymsp[-5].minor.yy348 = yylhsminor.yy348; + break; + case 497: /* predicate ::= expr_or_subquery IS NULL */ +#line 965 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), NULL)); + } +#line 7225 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 498: /* predicate ::= expr_or_subquery IS NOT NULL */ +#line 969 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), NULL)); + } +#line 7234 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 500: /* compare_op ::= NK_LT */ +#line 981 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_LOWER_THAN; } +#line 7240 "sql.c" + break; + case 501: /* compare_op ::= NK_GT */ +#line 982 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_GREATER_THAN; } +#line 7245 "sql.c" + break; + case 502: /* compare_op ::= NK_LE */ +#line 983 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_LOWER_EQUAL; } +#line 7250 "sql.c" + break; + case 503: /* compare_op ::= NK_GE */ +#line 984 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_GREATER_EQUAL; } +#line 7255 "sql.c" + break; + case 504: /* compare_op ::= NK_NE */ +#line 985 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_NOT_EQUAL; } +#line 7260 "sql.c" + break; + case 505: /* compare_op ::= NK_EQ */ +#line 986 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_EQUAL; } +#line 7265 "sql.c" + break; + case 506: /* compare_op ::= LIKE */ +#line 987 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_LIKE; } +#line 7270 "sql.c" + break; + case 507: /* compare_op ::= NOT LIKE */ +#line 988 "sql.y" +{ yymsp[-1].minor.yy696 = OP_TYPE_NOT_LIKE; } +#line 7275 "sql.c" + break; + case 508: /* compare_op ::= MATCH */ +#line 989 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_MATCH; } +#line 7280 "sql.c" + break; + case 509: /* compare_op ::= NMATCH */ +#line 990 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_NMATCH; } +#line 7285 "sql.c" + break; + case 510: /* compare_op ::= CONTAINS */ +#line 991 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_JSON_CONTAINS; } +#line 7290 "sql.c" + break; + case 511: /* in_op ::= IN */ +#line 995 "sql.y" +{ yymsp[0].minor.yy696 = OP_TYPE_IN; } +#line 7295 "sql.c" + break; + case 512: /* in_op ::= NOT IN */ +#line 996 "sql.y" +{ yymsp[-1].minor.yy696 = OP_TYPE_NOT_IN; } +#line 7300 "sql.c" + break; + case 513: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +#line 998 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy860)); } +#line 7305 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 515: /* boolean_value_expression ::= NOT boolean_primary */ #line 1002 "sql.y" { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy348), NULL)); } -#line 7286 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 515: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ -#line 1008 "sql.y" -{ - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy122); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy122); - yylhsminor.yy122 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); - } -#line 7296 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 523: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -#line 1026 "sql.y" -{ yylhsminor.yy122 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy122, yymsp[0].minor.yy122, NULL); } -#line 7302 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 526: /* table_primary ::= table_name alias_opt */ -#line 1032 "sql.y" -{ yylhsminor.yy122 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy203, &yymsp[0].minor.yy203); } -#line 7308 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; - break; - case 527: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -#line 1033 "sql.y" -{ yylhsminor.yy122 = createRealTableNode(pCxt, &yymsp[-3].minor.yy203, &yymsp[-1].minor.yy203, &yymsp[0].minor.yy203); } #line 7314 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 528: /* table_primary ::= subquery alias_opt */ -#line 1034 "sql.y" -{ yylhsminor.yy122 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy122), &yymsp[0].minor.yy203); } -#line 7320 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; - break; - case 530: /* alias_opt ::= */ -#line 1039 "sql.y" -{ yymsp[1].minor.yy203 = nil_token; } -#line 7326 "sql.c" - break; - case 532: /* alias_opt ::= AS table_alias */ -#line 1041 "sql.y" -{ yymsp[-1].minor.yy203 = yymsp[0].minor.yy203; } -#line 7331 "sql.c" - break; - case 533: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 534: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==534); -#line 1043 "sql.y" -{ yymsp[-2].minor.yy122 = yymsp[-1].minor.yy122; } -#line 7337 "sql.c" - break; - case 535: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -#line 1048 "sql.y" -{ yylhsminor.yy122 = createJoinTableNode(pCxt, yymsp[-4].minor.yy498, yymsp[-5].minor.yy122, yymsp[-2].minor.yy122, yymsp[0].minor.yy122); } -#line 7342 "sql.c" - yymsp[-5].minor.yy122 = yylhsminor.yy122; - break; - case 536: /* join_type ::= */ -#line 1052 "sql.y" -{ yymsp[1].minor.yy498 = JOIN_TYPE_INNER; } -#line 7348 "sql.c" - break; - case 537: /* join_type ::= INNER */ -#line 1053 "sql.y" -{ yymsp[0].minor.yy498 = JOIN_TYPE_INNER; } -#line 7353 "sql.c" - break; - case 538: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ -#line 1059 "sql.y" + case 516: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ +#line 1007 "sql.y" { - yymsp[-13].minor.yy122 = createSelectStmt(pCxt, yymsp[-11].minor.yy983, yymsp[-9].minor.yy298, yymsp[-8].minor.yy122, yymsp[-12].minor.yy298); - yymsp[-13].minor.yy122 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy122, yymsp[-10].minor.yy983); - yymsp[-13].minor.yy122 = addWhereClause(pCxt, yymsp[-13].minor.yy122, yymsp[-7].minor.yy122); - yymsp[-13].minor.yy122 = addPartitionByClause(pCxt, yymsp[-13].minor.yy122, yymsp[-6].minor.yy298); - yymsp[-13].minor.yy122 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy122, yymsp[-2].minor.yy122); - yymsp[-13].minor.yy122 = addGroupByClause(pCxt, yymsp[-13].minor.yy122, yymsp[-1].minor.yy298); - yymsp[-13].minor.yy122 = addHavingClause(pCxt, yymsp[-13].minor.yy122, yymsp[0].minor.yy122); - yymsp[-13].minor.yy122 = addRangeClause(pCxt, yymsp[-13].minor.yy122, yymsp[-5].minor.yy122); - yymsp[-13].minor.yy122 = addEveryClause(pCxt, yymsp[-13].minor.yy122, yymsp[-4].minor.yy122); - yymsp[-13].minor.yy122 = addFillClause(pCxt, yymsp[-13].minor.yy122, yymsp[-3].minor.yy122); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } +#line 7324 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 517: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ +#line 1013 "sql.y" +{ + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy348); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy348); + yylhsminor.yy348 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); + } +#line 7334 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 525: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +#line 1031 "sql.y" +{ yylhsminor.yy348 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy348, yymsp[0].minor.yy348, NULL); } +#line 7340 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 528: /* table_primary ::= table_name alias_opt */ +#line 1037 "sql.y" +{ yylhsminor.yy348 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } +#line 7346 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 529: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +#line 1038 "sql.y" +{ yylhsminor.yy348 = createRealTableNode(pCxt, &yymsp[-3].minor.yy269, &yymsp[-1].minor.yy269, &yymsp[0].minor.yy269); } +#line 7352 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; + break; + case 530: /* table_primary ::= subquery alias_opt */ +#line 1039 "sql.y" +{ yylhsminor.yy348 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348), &yymsp[0].minor.yy269); } +#line 7358 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; + break; + case 532: /* alias_opt ::= */ +#line 1044 "sql.y" +{ yymsp[1].minor.yy269 = nil_token; } +#line 7364 "sql.c" + break; + case 534: /* alias_opt ::= AS table_alias */ +#line 1046 "sql.y" +{ yymsp[-1].minor.yy269 = yymsp[0].minor.yy269; } #line 7369 "sql.c" break; - case 539: /* hint_list ::= */ -#line 1074 "sql.y" -{ yymsp[1].minor.yy298 = createHintNodeList(pCxt, NULL); } -#line 7374 "sql.c" + case 535: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 536: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==536); +#line 1048 "sql.y" +{ yymsp[-2].minor.yy348 = yymsp[-1].minor.yy348; } +#line 7375 "sql.c" break; - case 540: /* hint_list ::= NK_HINT */ -#line 1075 "sql.y" -{ yylhsminor.yy298 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } -#line 7379 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; + case 537: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +#line 1053 "sql.y" +{ yylhsminor.yy348 = createJoinTableNode(pCxt, yymsp[-4].minor.yy184, yymsp[-5].minor.yy348, yymsp[-2].minor.yy348, yymsp[0].minor.yy348); } +#line 7380 "sql.c" + yymsp[-5].minor.yy348 = yylhsminor.yy348; break; - case 545: /* set_quantifier_opt ::= ALL */ -#line 1086 "sql.y" -{ yymsp[0].minor.yy983 = false; } -#line 7385 "sql.c" + case 538: /* join_type ::= */ +#line 1057 "sql.y" +{ yymsp[1].minor.yy184 = JOIN_TYPE_INNER; } +#line 7386 "sql.c" break; - case 548: /* select_item ::= NK_STAR */ -#line 1093 "sql.y" -{ yylhsminor.yy122 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } -#line 7390 "sql.c" - yymsp[0].minor.yy122 = yylhsminor.yy122; + case 539: /* join_type ::= INNER */ +#line 1058 "sql.y" +{ yymsp[0].minor.yy184 = JOIN_TYPE_INNER; } +#line 7391 "sql.c" break; - case 550: /* select_item ::= common_expression column_alias */ - case 560: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==560); -#line 1095 "sql.y" -{ yylhsminor.yy122 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy122), &yymsp[0].minor.yy203); } -#line 7397 "sql.c" - yymsp[-1].minor.yy122 = yylhsminor.yy122; + case 540: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ +#line 1064 "sql.y" +{ + yymsp[-13].minor.yy348 = createSelectStmt(pCxt, yymsp[-11].minor.yy345, yymsp[-9].minor.yy860, yymsp[-8].minor.yy348, yymsp[-12].minor.yy860); + yymsp[-13].minor.yy348 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy348, yymsp[-10].minor.yy345); + yymsp[-13].minor.yy348 = addWhereClause(pCxt, yymsp[-13].minor.yy348, yymsp[-7].minor.yy348); + yymsp[-13].minor.yy348 = addPartitionByClause(pCxt, yymsp[-13].minor.yy348, yymsp[-6].minor.yy860); + yymsp[-13].minor.yy348 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy348, yymsp[-2].minor.yy348); + yymsp[-13].minor.yy348 = addGroupByClause(pCxt, yymsp[-13].minor.yy348, yymsp[-1].minor.yy860); + yymsp[-13].minor.yy348 = addHavingClause(pCxt, yymsp[-13].minor.yy348, yymsp[0].minor.yy348); + yymsp[-13].minor.yy348 = addRangeClause(pCxt, yymsp[-13].minor.yy348, yymsp[-5].minor.yy348); + yymsp[-13].minor.yy348 = addEveryClause(pCxt, yymsp[-13].minor.yy348, yymsp[-4].minor.yy348); + yymsp[-13].minor.yy348 = addFillClause(pCxt, yymsp[-13].minor.yy348, yymsp[-3].minor.yy348); + } +#line 7407 "sql.c" break; - case 551: /* select_item ::= common_expression AS column_alias */ - case 561: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==561); -#line 1096 "sql.y" -{ yylhsminor.yy122 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), &yymsp[0].minor.yy203); } -#line 7404 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; - break; - case 556: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 581: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==581); - case 601: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==601); -#line 1105 "sql.y" -{ yymsp[-2].minor.yy298 = yymsp[0].minor.yy298; } + case 541: /* hint_list ::= */ +#line 1079 "sql.y" +{ yymsp[1].minor.yy860 = createHintNodeList(pCxt, NULL); } #line 7412 "sql.c" break; - case 563: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -#line 1118 "sql.y" -{ yymsp[-5].minor.yy122 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), releaseRawExprNode(pCxt, yymsp[-1].minor.yy122)); } + case 542: /* hint_list ::= NK_HINT */ +#line 1080 "sql.y" +{ yylhsminor.yy860 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } #line 7417 "sql.c" + yymsp[0].minor.yy860 = yylhsminor.yy860; break; - case 564: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -#line 1119 "sql.y" -{ yymsp[-3].minor.yy122 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy122)); } -#line 7422 "sql.c" + case 547: /* set_quantifier_opt ::= ALL */ +#line 1091 "sql.y" +{ yymsp[0].minor.yy345 = false; } +#line 7423 "sql.c" break; - case 565: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -#line 1121 "sql.y" -{ yymsp[-5].minor.yy122 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), NULL, yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 7427 "sql.c" + case 550: /* select_item ::= NK_STAR */ +#line 1098 "sql.y" +{ yylhsminor.yy348 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } +#line 7428 "sql.c" + yymsp[0].minor.yy348 = yylhsminor.yy348; break; - case 566: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -#line 1124 "sql.y" -{ yymsp[-7].minor.yy122 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy122), releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), yymsp[-1].minor.yy122, yymsp[0].minor.yy122); } -#line 7432 "sql.c" + case 552: /* select_item ::= common_expression column_alias */ + case 562: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==562); +#line 1100 "sql.y" +{ yylhsminor.yy348 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348), &yymsp[0].minor.yy269); } +#line 7435 "sql.c" + yymsp[-1].minor.yy348 = yylhsminor.yy348; break; - case 567: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -#line 1126 "sql.y" -{ yymsp[-6].minor.yy122 = createEventWindowNode(pCxt, yymsp[-3].minor.yy122, yymsp[0].minor.yy122); } -#line 7437 "sql.c" - break; - case 571: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -#line 1132 "sql.y" -{ yymsp[-3].minor.yy122 = createFillNode(pCxt, yymsp[-1].minor.yy312, NULL); } + case 553: /* select_item ::= common_expression AS column_alias */ + case 563: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==563); +#line 1101 "sql.y" +{ yylhsminor.yy348 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), &yymsp[0].minor.yy269); } #line 7442 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 572: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -#line 1133 "sql.y" -{ yymsp[-5].minor.yy122 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy298)); } -#line 7447 "sql.c" + case 558: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 583: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==583); + case 603: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==603); +#line 1110 "sql.y" +{ yymsp[-2].minor.yy860 = yymsp[0].minor.yy860; } +#line 7450 "sql.c" break; - case 573: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -#line 1134 "sql.y" -{ yymsp[-5].minor.yy122 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy298)); } -#line 7452 "sql.c" + case 565: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +#line 1123 "sql.y" +{ yymsp[-5].minor.yy348 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } +#line 7455 "sql.c" break; - case 574: /* fill_mode ::= NONE */ + case 566: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +#line 1124 "sql.y" +{ yymsp[-3].minor.yy348 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } +#line 7460 "sql.c" + break; + case 567: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +#line 1126 "sql.y" +{ yymsp[-5].minor.yy348 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), NULL, yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 7465 "sql.c" + break; + case 568: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +#line 1129 "sql.y" +{ yymsp[-7].minor.yy348 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy348), releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), yymsp[-1].minor.yy348, yymsp[0].minor.yy348); } +#line 7470 "sql.c" + break; + case 569: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +#line 1131 "sql.y" +{ yymsp[-6].minor.yy348 = createEventWindowNode(pCxt, yymsp[-3].minor.yy348, yymsp[0].minor.yy348); } +#line 7475 "sql.c" + break; + case 573: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +#line 1137 "sql.y" +{ yymsp[-3].minor.yy348 = createFillNode(pCxt, yymsp[-1].minor.yy758, NULL); } +#line 7480 "sql.c" + break; + case 574: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ #line 1138 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_NONE; } -#line 7457 "sql.c" +{ yymsp[-5].minor.yy348 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy860)); } +#line 7485 "sql.c" break; - case 575: /* fill_mode ::= PREV */ + case 575: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ #line 1139 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_PREV; } -#line 7462 "sql.c" +{ yymsp[-5].minor.yy348 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy860)); } +#line 7490 "sql.c" break; - case 576: /* fill_mode ::= NULL */ -#line 1140 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_NULL; } -#line 7467 "sql.c" - break; - case 577: /* fill_mode ::= NULL_F */ -#line 1141 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_NULL_F; } -#line 7472 "sql.c" - break; - case 578: /* fill_mode ::= LINEAR */ -#line 1142 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_LINEAR; } -#line 7477 "sql.c" - break; - case 579: /* fill_mode ::= NEXT */ + case 576: /* fill_mode ::= NONE */ #line 1143 "sql.y" -{ yymsp[0].minor.yy312 = FILL_MODE_NEXT; } -#line 7482 "sql.c" +{ yymsp[0].minor.yy758 = FILL_MODE_NONE; } +#line 7495 "sql.c" break; - case 582: /* group_by_list ::= expr_or_subquery */ -#line 1152 "sql.y" -{ yylhsminor.yy298 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); } -#line 7487 "sql.c" - yymsp[0].minor.yy298 = yylhsminor.yy298; + case 577: /* fill_mode ::= PREV */ +#line 1144 "sql.y" +{ yymsp[0].minor.yy758 = FILL_MODE_PREV; } +#line 7500 "sql.c" break; - case 583: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -#line 1153 "sql.y" -{ yylhsminor.yy298 = addNodeToList(pCxt, yymsp[-2].minor.yy298, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy122))); } -#line 7493 "sql.c" - yymsp[-2].minor.yy298 = yylhsminor.yy298; + case 578: /* fill_mode ::= NULL */ +#line 1145 "sql.y" +{ yymsp[0].minor.yy758 = FILL_MODE_NULL; } +#line 7505 "sql.c" break; - case 587: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -#line 1160 "sql.y" -{ yymsp[-5].minor.yy122 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy122), releaseRawExprNode(pCxt, yymsp[-1].minor.yy122)); } -#line 7499 "sql.c" + case 579: /* fill_mode ::= NULL_F */ +#line 1146 "sql.y" +{ yymsp[0].minor.yy758 = FILL_MODE_NULL_F; } +#line 7510 "sql.c" break; - case 588: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -#line 1162 "sql.y" -{ yymsp[-3].minor.yy122 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy122)); } -#line 7504 "sql.c" + case 580: /* fill_mode ::= LINEAR */ +#line 1147 "sql.y" +{ yymsp[0].minor.yy758 = FILL_MODE_LINEAR; } +#line 7515 "sql.c" break; - case 591: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ -#line 1169 "sql.y" -{ - yylhsminor.yy122 = addOrderByClause(pCxt, yymsp[-3].minor.yy122, yymsp[-2].minor.yy298); - yylhsminor.yy122 = addSlimitClause(pCxt, yylhsminor.yy122, yymsp[-1].minor.yy122); - yylhsminor.yy122 = addLimitClause(pCxt, yylhsminor.yy122, yymsp[0].minor.yy122); - } -#line 7513 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; + case 581: /* fill_mode ::= NEXT */ +#line 1148 "sql.y" +{ yymsp[0].minor.yy758 = FILL_MODE_NEXT; } +#line 7520 "sql.c" break; - case 594: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -#line 1179 "sql.y" -{ yylhsminor.yy122 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy122, yymsp[0].minor.yy122); } -#line 7519 "sql.c" - yymsp[-3].minor.yy122 = yylhsminor.yy122; - break; - case 595: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -#line 1181 "sql.y" -{ yylhsminor.yy122 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy122, yymsp[0].minor.yy122); } + case 584: /* group_by_list ::= expr_or_subquery */ +#line 1157 "sql.y" +{ yylhsminor.yy860 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } #line 7525 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; + yymsp[0].minor.yy860 = yylhsminor.yy860; break; - case 603: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 607: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==607); -#line 1195 "sql.y" -{ yymsp[-1].minor.yy122 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } -#line 7532 "sql.c" + case 585: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +#line 1158 "sql.y" +{ yylhsminor.yy860 = addNodeToList(pCxt, yymsp[-2].minor.yy860, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy348))); } +#line 7531 "sql.c" + yymsp[-2].minor.yy860 = yylhsminor.yy860; break; - case 604: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 608: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==608); -#line 1196 "sql.y" -{ yymsp[-3].minor.yy122 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 7538 "sql.c" + case 589: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +#line 1165 "sql.y" +{ yymsp[-5].minor.yy348 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy348), releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } +#line 7537 "sql.c" break; - case 605: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 609: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==609); -#line 1197 "sql.y" -{ yymsp[-3].minor.yy122 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } -#line 7544 "sql.c" + case 590: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +#line 1167 "sql.y" +{ yymsp[-3].minor.yy348 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy348)); } +#line 7542 "sql.c" break; - case 610: /* subquery ::= NK_LP query_expression NK_RP */ -#line 1205 "sql.y" -{ yylhsminor.yy122 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy122); } -#line 7549 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; + case 593: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ +#line 1174 "sql.y" +{ + yylhsminor.yy348 = addOrderByClause(pCxt, yymsp[-3].minor.yy348, yymsp[-2].minor.yy860); + yylhsminor.yy348 = addSlimitClause(pCxt, yylhsminor.yy348, yymsp[-1].minor.yy348); + yylhsminor.yy348 = addLimitClause(pCxt, yylhsminor.yy348, yymsp[0].minor.yy348); + } +#line 7551 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; - case 615: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -#line 1219 "sql.y" -{ yylhsminor.yy122 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy122), yymsp[-1].minor.yy626, yymsp[0].minor.yy877); } -#line 7555 "sql.c" - yymsp[-2].minor.yy122 = yylhsminor.yy122; + case 596: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +#line 1184 "sql.y" +{ yylhsminor.yy348 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy348, yymsp[0].minor.yy348); } +#line 7557 "sql.c" + yymsp[-3].minor.yy348 = yylhsminor.yy348; break; - case 616: /* ordering_specification_opt ::= */ -#line 1223 "sql.y" -{ yymsp[1].minor.yy626 = ORDER_ASC; } -#line 7561 "sql.c" + case 597: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +#line 1186 "sql.y" +{ yylhsminor.yy348 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy348, yymsp[0].minor.yy348); } +#line 7563 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; break; - case 617: /* ordering_specification_opt ::= ASC */ -#line 1224 "sql.y" -{ yymsp[0].minor.yy626 = ORDER_ASC; } -#line 7566 "sql.c" + case 605: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 609: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==609); +#line 1200 "sql.y" +{ yymsp[-1].minor.yy348 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } +#line 7570 "sql.c" break; - case 618: /* ordering_specification_opt ::= DESC */ -#line 1225 "sql.y" -{ yymsp[0].minor.yy626 = ORDER_DESC; } -#line 7571 "sql.c" - break; - case 619: /* null_ordering_opt ::= */ -#line 1229 "sql.y" -{ yymsp[1].minor.yy877 = NULL_ORDER_DEFAULT; } + case 606: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 610: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==610); +#line 1201 "sql.y" +{ yymsp[-3].minor.yy348 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } #line 7576 "sql.c" break; - case 620: /* null_ordering_opt ::= NULLS FIRST */ -#line 1230 "sql.y" -{ yymsp[-1].minor.yy877 = NULL_ORDER_FIRST; } -#line 7581 "sql.c" + case 607: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 611: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==611); +#line 1202 "sql.y" +{ yymsp[-3].minor.yy348 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } +#line 7582 "sql.c" break; - case 621: /* null_ordering_opt ::= NULLS LAST */ -#line 1231 "sql.y" -{ yymsp[-1].minor.yy877 = NULL_ORDER_LAST; } -#line 7586 "sql.c" + case 612: /* subquery ::= NK_LP query_expression NK_RP */ +#line 1210 "sql.y" +{ yylhsminor.yy348 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy348); } +#line 7587 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 617: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +#line 1224 "sql.y" +{ yylhsminor.yy348 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy348), yymsp[-1].minor.yy870, yymsp[0].minor.yy841); } +#line 7593 "sql.c" + yymsp[-2].minor.yy348 = yylhsminor.yy348; + break; + case 618: /* ordering_specification_opt ::= */ +#line 1228 "sql.y" +{ yymsp[1].minor.yy870 = ORDER_ASC; } +#line 7599 "sql.c" + break; + case 619: /* ordering_specification_opt ::= ASC */ +#line 1229 "sql.y" +{ yymsp[0].minor.yy870 = ORDER_ASC; } +#line 7604 "sql.c" + break; + case 620: /* ordering_specification_opt ::= DESC */ +#line 1230 "sql.y" +{ yymsp[0].minor.yy870 = ORDER_DESC; } +#line 7609 "sql.c" + break; + case 621: /* null_ordering_opt ::= */ +#line 1234 "sql.y" +{ yymsp[1].minor.yy841 = NULL_ORDER_DEFAULT; } +#line 7614 "sql.c" + break; + case 622: /* null_ordering_opt ::= NULLS FIRST */ +#line 1235 "sql.y" +{ yymsp[-1].minor.yy841 = NULL_ORDER_FIRST; } +#line 7619 "sql.c" + break; + case 623: /* null_ordering_opt ::= NULLS LAST */ +#line 1236 "sql.y" +{ yymsp[-1].minor.yy841 = NULL_ORDER_LAST; } +#line 7624 "sql.c" break; default: break; @@ -7656,7 +7694,7 @@ static void yy_syntax_error( } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z); } -#line 7659 "sql.c" +#line 7697 "sql.c" /************ End %syntax_error code ******************************************/ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ ParseCTX_STORE diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 28e07fe98d..f10c42310d 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -3646,32 +3646,73 @@ static SSortLogicNode* partColOptCreateSort(SPartitionLogicNode* pPartition) { } static int32_t partitionColsOpt(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) { - int32_t code = TSDB_CODE_SUCCESS; - SPartitionLogicNode* pNode = (SPartitionLogicNode*)optFindPossibleNode(pLogicSubplan->pNode, partColOptShouldBeOptimized); + SNode* node; + int32_t code = TSDB_CODE_SUCCESS; + SPartitionLogicNode* pNode = + (SPartitionLogicNode*)optFindPossibleNode(pLogicSubplan->pNode, partColOptShouldBeOptimized); if (NULL == pNode) return TSDB_CODE_SUCCESS; - SLogicNode* pRootNode = getLogicNodeRootNode((SLogicNode*)pNode); - if (!pRootNode->pHint || !getSortForGroupOptHint(pRootNode->pHint)) { + + + if (pRootNode->pHint && getSortForGroupOptHint(pRootNode->pHint)) { + // replace with sort node + SSortLogicNode* pSort = partColOptCreateSort(pNode); + if (!pSort) { + // if sort create failed, we eat the error, skip the optimization + code = TSDB_CODE_SUCCESS; + } else { + TSWAP(pSort->node.pChildren, pNode->node.pChildren); + TSWAP(pSort->node.pTargets, pNode->node.pTargets); + optResetParent((SLogicNode*)pSort); + pSort->calcGroupId = true; + code = replaceLogicNode(pLogicSubplan, (SLogicNode*)pNode, (SLogicNode*)pSort); + if (code == TSDB_CODE_SUCCESS) { + pCxt->optimized = true; + } else { + nodesDestroyNode((SNode*)pSort); + } + } + return code; + } else if (pNode->node.pParent && nodeType(pNode->node.pParent) == QUERY_NODE_LOGIC_PLAN_AGG) { + // Check if we can delete partition node + SAggLogicNode* pAgg = (SAggLogicNode*)pNode->node.pParent; + FOREACH(node, pNode->pPartitionKeys) { + SGroupingSetNode* pgsNode = (SGroupingSetNode*)nodesMakeNode(QUERY_NODE_GROUPING_SET); + if (!pgsNode) code = TSDB_CODE_OUT_OF_MEMORY; + if (code == TSDB_CODE_SUCCESS) { + pgsNode->groupingSetType = GP_TYPE_NORMAL; + pgsNode->pParameterList = nodesMakeList(); + if (!pgsNode->pParameterList) code = TSDB_CODE_OUT_OF_MEMORY; + } + if (code == TSDB_CODE_SUCCESS) { + code = nodesListAppend(pgsNode->pParameterList, nodesCloneNode(node)); + } + if (code == TSDB_CODE_SUCCESS) { + // Now we are using hash agg + code = nodesListMakeAppend(&pAgg->pGroupKeys, (SNode*)pgsNode); + } + if (code != TSDB_CODE_SUCCESS) { + nodesDestroyNode((SNode*)pgsNode); + break; + } + } + + if (code == TSDB_CODE_SUCCESS) { + code = + replaceLogicNode(pLogicSubplan, (SLogicNode*)pNode, (SLogicNode*)nodesListGetNode(pNode->node.pChildren, 0)); + NODES_CLEAR_LIST(pNode->node.pChildren); + } + if (code == TSDB_CODE_SUCCESS) { + // For hash agg, nonblocking mode is meaningless, slimit is useless, so we reset it + pAgg->node.forceCreateNonBlockingOptr = false; + nodesDestroyNode(pAgg->node.pSlimit); + pAgg->node.pSlimit = NULL; + nodesDestroyNode((SNode*)pNode); + pCxt->optimized = true; + } return code; } - // replace with sort node - SSortLogicNode* pSort = partColOptCreateSort(pNode); - if (!pSort) { - // if sort create failed, we eat the error, skip the optimization - code = TSDB_CODE_SUCCESS; - } else { - TSWAP(pSort->node.pChildren, pNode->node.pChildren); - TSWAP(pSort->node.pTargets, pNode->node.pTargets); - optResetParent((SLogicNode*)pSort); - pSort->calcGroupId = true; - code = replaceLogicNode(pLogicSubplan, (SLogicNode*)pNode, (SLogicNode*)pSort); - if (code == TSDB_CODE_SUCCESS) { - pCxt->optimized = true; - } else { - nodesDestroyNode((SNode*)pSort); - } - } return code; } diff --git a/source/libs/stream/inc/streamBackendRocksdb.h b/source/libs/stream/inc/streamBackendRocksdb.h index 39854d1824..b34b3420fe 100644 --- a/source/libs/stream/inc/streamBackendRocksdb.h +++ b/source/libs/stream/inc/streamBackendRocksdb.h @@ -65,11 +65,11 @@ int32_t streamStateCurNext_rocksdb(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStateGetFirst_rocksdb(SStreamState* pState, SWinKey* key); int32_t streamStateGetGroupKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); int32_t streamStateAddIfNotExist_rocksdb(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); -int32_t streamStateCurPrev_rocksdb(SStreamState* pState, SStreamStateCur* pCur); +int32_t streamStateCurPrev_rocksdb(SStreamStateCur* pCur); int32_t streamStateGetKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); SStreamStateCur* streamStateGetAndCheckCur_rocksdb(SStreamState* pState, SWinKey* key); SStreamStateCur* streamStateSeekKeyNext_rocksdb(SStreamState* pState, const SWinKey* key); -SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState, const SWinKey* key); +SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState); SStreamStateCur* streamStateGetCur_rocksdb(SStreamState* pState, const SWinKey* key); // func cf @@ -84,10 +84,14 @@ int32_t streamStateSessionDel_rocksdb(SStreamState* pState, const SSessionKey* k SStreamStateCur* streamStateSessionSeekKeyCurrentPrev_rocksdb(SStreamState* pState, const SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyCurrentNext_rocksdb(SStreamState* pState, SSessionKey* key); SStreamStateCur* streamStateSessionSeekKeyNext_rocksdb(SStreamState* pState, const SSessionKey* key); +SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState); +int32_t streamStateSessionCurPrev_rocksdb(SStreamStateCur* pCur); + int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen); int32_t streamStateSessionGetKeyByRange_rocksdb(SStreamState* pState, const SSessionKey* key, SSessionKey* curKey); int32_t streamStateSessionAddIfNotExist_rocksdb(SStreamState* pState, SSessionKey* key, TSKEY gap, void** pVal, int32_t* pVLen); + int32_t streamStateSessionClear_rocksdb(SStreamState* pState); int32_t streamStateStateAddIfNotExist_rocksdb(SStreamState* pState, SSessionKey* key, char* pKeyData, diff --git a/source/libs/stream/src/streamBackendRocksdb.c b/source/libs/stream/src/streamBackendRocksdb.c index 0cc8bfb6fe..6cef3cca75 100644 --- a/source/libs/stream/src/streamBackendRocksdb.c +++ b/source/libs/stream/src/streamBackendRocksdb.c @@ -779,7 +779,10 @@ int32_t chkpGetAllDbCfHandle(SStreamMeta* pMeta, rocksdb_column_family_handle_t* int64_t id = *(int64_t*)pIter; SBackendCfWrapper* wrapper = taosAcquireRef(streamBackendCfWrapperId, id); - if (wrapper == NULL) continue; + if (wrapper == NULL) { + pIter = taosHashIterate(pMeta->pTaskBackendUnique, pIter); + continue; + } taosThreadRwlockRdlock(&wrapper->rwLock); for (int i = 0; i < sizeof(ginitDict) / sizeof(ginitDict[0]); i++) { @@ -795,6 +798,10 @@ int32_t chkpGetAllDbCfHandle(SStreamMeta* pMeta, rocksdb_column_family_handle_t* } int32_t nCf = taosArrayGetSize(pHandle); + if (nCf == 0) { + taosArrayDestroy(pHandle); + return nCf; + } rocksdb_column_family_handle_t** ppCf = taosMemoryCalloc(nCf, sizeof(rocksdb_column_family_handle_t*)); for (int i = 0; i < nCf; i++) { @@ -827,6 +834,7 @@ _ERROR: return code; } int32_t chkpPreFlushDb(rocksdb_t* db, rocksdb_column_family_handle_t** cf, int32_t nCf) { + if (nCf == 0) return 0; int code = 0; char* err = NULL; @@ -1962,7 +1970,7 @@ int32_t streamStateAddIfNotExist_rocksdb(SStreamState* pState, const SWinKey* ke memset(*pVal, 0, size); return 0; } -int32_t streamStateCurPrev_rocksdb(SStreamState* pState, SStreamStateCur* pCur) { +int32_t streamStateCurPrev_rocksdb(SStreamStateCur* pCur) { qDebug("streamStateCurPrev_rocksdb"); if (!pCur) return -1; @@ -2007,7 +2015,7 @@ SStreamStateCur* streamStateGetAndCheckCur_rocksdb(SStreamState* pState, SWinKey SStreamStateCur* streamStateSeekKeyNext_rocksdb(SStreamState* pState, const SWinKey* key) { qDebug("streamStateSeekKeyNext_rocksdb"); - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return NULL; } @@ -2044,7 +2052,7 @@ SStreamStateCur* streamStateSeekKeyNext_rocksdb(SStreamState* pState, const SWin return NULL; } -SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState, const SWinKey* key) { +SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState) { qDebug("streamStateGetCur_rocksdb"); int32_t code = 0; @@ -2054,16 +2062,13 @@ SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState, const SWinK return NULL; } - char buf[128] = {0}; - int32_t klen = stateKeyEncode((void*)&maxStateKey, buf); - { char tbuf[256] = {0}; stateKeyToString((void*)&maxStateKey, tbuf); qDebug("seek to last:%s", tbuf); } - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) return NULL; pCur->number = pState->number; @@ -2071,6 +2076,8 @@ SStreamStateCur* streamStateSeekToLast_rocksdb(SStreamState* pState, const SWinK pCur->iter = streamStateIterCreate(pState, "state", (rocksdb_snapshot_t**)&pCur->snapshot, (rocksdb_readoptions_t**)&pCur->readOpt); + char buf[128] = {0}; + int32_t klen = stateKeyEncode((void*)&maxStateKey, buf); rocksdb_iter_seek(pCur->iter, buf, (size_t)klen); rocksdb_iter_prev(pCur->iter); while (rocksdb_iter_valid(pCur->iter) && iterValueIsStale(pCur->iter)) { @@ -2090,7 +2097,7 @@ SStreamStateCur* streamStateGetCur_rocksdb(SStreamState* pState, const SWinKey* qDebug("streamStateGetCur_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) return NULL; pCur->db = wrapper->rocksdb; @@ -2175,11 +2182,57 @@ int32_t streamStateSessionDel_rocksdb(SStreamState* pState, const SSessionKey* k STREAM_STATE_DEL_ROCKSDB(pState, "sess", &sKey); return code; } + +SStreamStateCur* streamStateSessionSeekToLast_rocksdb(SStreamState* pState) { + qDebug("streamStateSessionSeekToLast_rocksdb"); + + int32_t code = 0; + + SSessionKey maxSessionKey = {.groupId = UINT64_MAX, .win = {.skey = INT64_MAX, .ekey = INT64_MAX}}; + SStateSessionKey maxKey = {.key = maxSessionKey, .opNum = INT64_MAX}; + + STREAM_STATE_PUT_ROCKSDB(pState, "sess", &maxKey, "", 0); + if (code != 0) { + return NULL; + } + + SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; + SStreamStateCur* pCur = createStreamStateCursor(); + pCur->number = pState->number; + pCur->db = wrapper->rocksdb; + pCur->iter = streamStateIterCreate(pState, "sess", (rocksdb_snapshot_t**)&pCur->snapshot, + (rocksdb_readoptions_t**)&pCur->readOpt); + + char buf[128] = {0}; + int32_t klen = stateSessionKeyEncode((void*)&maxKey, buf); + rocksdb_iter_seek(pCur->iter, buf, (size_t)klen); + rocksdb_iter_prev(pCur->iter); + while (rocksdb_iter_valid(pCur->iter) && iterValueIsStale(pCur->iter)) { + rocksdb_iter_prev(pCur->iter); + } + + if (!rocksdb_iter_valid(pCur->iter)) { + streamStateFreeCur(pCur); + pCur = NULL; + } + + STREAM_STATE_DEL_ROCKSDB(pState, "sess", &maxKey); + return pCur; +} + +int32_t streamStateSessionCurPrev_rocksdb(SStreamStateCur* pCur) { + qDebug("streamStateCurPrev_rocksdb"); + if (!pCur) return -1; + + rocksdb_iter_prev(pCur->iter); + return 0; +} + SStreamStateCur* streamStateSessionSeekKeyCurrentPrev_rocksdb(SStreamState* pState, const SSessionKey* key) { qDebug("streamStateSessionSeekKeyCurrentPrev_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return NULL; } @@ -2219,7 +2272,7 @@ SStreamStateCur* streamStateSessionSeekKeyCurrentPrev_rocksdb(SStreamState* pSta SStreamStateCur* streamStateSessionSeekKeyCurrentNext_rocksdb(SStreamState* pState, SSessionKey* key) { qDebug("streamStateSessionSeekKeyCurrentNext_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return NULL; } @@ -2257,7 +2310,7 @@ SStreamStateCur* streamStateSessionSeekKeyCurrentNext_rocksdb(SStreamState* pSta SStreamStateCur* streamStateSessionSeekKeyNext_rocksdb(SStreamState* pState, const SSessionKey* key) { qDebug("streamStateSessionSeekKeyNext_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return NULL; } @@ -2293,6 +2346,7 @@ SStreamStateCur* streamStateSessionSeekKeyNext_rocksdb(SStreamState* pState, con } return pCur; } + int32_t streamStateSessionGetKVByCur_rocksdb(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { qDebug("streamStateSessionGetKVByCur_rocksdb"); if (!pCur) { @@ -2358,7 +2412,7 @@ int32_t streamStateFillDel_rocksdb(SStreamState* pState, const SWinKey* key) { SStreamStateCur* streamStateFillGetCur_rocksdb(SStreamState* pState, const SWinKey* key) { qDebug("streamStateFillGetCur_rocksdb"); - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; if (pCur == NULL) return NULL; @@ -2419,7 +2473,7 @@ int32_t streamStateFillGetKVByCur_rocksdb(SStreamStateCur* pCur, SWinKey* pKey, SStreamStateCur* streamStateFillSeekKeyNext_rocksdb(SStreamState* pState, const SWinKey* key) { qDebug("streamStateFillSeekKeyNext_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (!pCur) { return NULL; } @@ -2457,7 +2511,7 @@ SStreamStateCur* streamStateFillSeekKeyNext_rocksdb(SStreamState* pState, const SStreamStateCur* streamStateFillSeekKeyPrev_rocksdb(SStreamState* pState, const SWinKey* key) { qDebug("streamStateFillSeekKeyPrev_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return NULL; } @@ -2495,7 +2549,7 @@ SStreamStateCur* streamStateFillSeekKeyPrev_rocksdb(SStreamState* pState, const int32_t streamStateSessionGetKeyByRange_rocksdb(SStreamState* pState, const SSessionKey* key, SSessionKey* curKey) { qDebug("streamStateSessionGetKeyByRange_rocksdb"); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); if (pCur == NULL) { return -1; } @@ -2765,7 +2819,7 @@ int32_t streamDefaultIterGet_rocksdb(SStreamState* pState, const void* start, co return code; } void* streamDefaultIterCreate_rocksdb(SStreamState* pState) { - SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + SStreamStateCur* pCur = createStreamStateCursor(); SBackendCfWrapper* wrapper = pState->pTdbState->pBackendCfWrapper; pCur->db = wrapper->rocksdb; diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 70371c4add..85380151f3 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -238,8 +238,6 @@ int32_t streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) { return -1; } } - taosMemoryFree(defaultPath); - taosMemoryFree(newPath); pMeta->streamBackend = streamBackendInit(pMeta->path, pMeta->chkpId); while (pMeta->streamBackend == NULL) { @@ -254,6 +252,8 @@ int32_t streamMetaReopen(SStreamMeta* pMeta, int64_t chkpId) { pMeta->streamBackendRid = taosAddRef(streamBackendId, pMeta->streamBackend); streamBackendLoadCheckpointInfo(pMeta); + taosMemoryFree(defaultPath); + taosMemoryFree(newPath); return 0; } diff --git a/source/libs/stream/src/streamSessionState.c b/source/libs/stream/src/streamSessionState.c new file mode 100644 index 0000000000..cc96778762 --- /dev/null +++ b/source/libs/stream/src/streamSessionState.c @@ -0,0 +1,583 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "tstreamFileState.h" + +#include "query.h" +#include "streamBackendRocksdb.h" +#include "taos.h" +#include "tcommon.h" +#include "thash.h" +#include "tsimplehash.h" + + +typedef int (*__session_compare_fn_t) (const SSessionKey* pWin, const void* pDatas, int pos); + +int sessionStateKeyCompare(const SSessionKey* pWin1, const void* pDatas, int pos) { + SRowBuffPos* pPos2 = taosArrayGetP(pDatas, pos); + SSessionKey* pWin2 = (SSessionKey*) pPos2->pKey; + return sessionWinKeyCmpr(pWin1, pWin2); +} + +int32_t binarySearch(void* keyList, int num, const void* key, __session_compare_fn_t cmpFn) { + int firstPos = 0, lastPos = num - 1, midPos = -1; + int numOfRows = 0; + + if (num <= 0) return -1; + // find the first position which is smaller or equal than the key. + // if all data is bigger than the key return -1 + while (1) { + if (cmpFn(key, keyList, lastPos) >= 0) return lastPos; + if (cmpFn(key, keyList, firstPos) == 0) return firstPos; + if (cmpFn(key, keyList, firstPos) < 0) return firstPos - 1; + + numOfRows = lastPos - firstPos + 1; + midPos = (numOfRows >> 1) + firstPos; + + if (cmpFn(key, keyList, midPos) < 0) { + lastPos = midPos - 1; + } else if (cmpFn(key, keyList, midPos) > 0) { + firstPos = midPos + 1; + } else { + break; + } + } + + return midPos; +} + +int64_t getSessionWindowEndkey(void* data, int32_t index) { + SArray* pWinInfos = (SArray*)data; + SRowBuffPos** ppos = taosArrayGet(pWinInfos, index); + SSessionKey* pWin = (SSessionKey*)((*ppos)->pKey); + return pWin->win.ekey; +} + +bool inSessionWindow(SSessionKey* pKey, TSKEY ts, int64_t gap) { + if (ts + gap >= pKey->win.skey && ts - gap <= pKey->win.ekey) { + return true; + } + return false; +} + +static SRowBuffPos* addNewSessionWindow(SStreamFileState* pFileState, SArray* pWinInfos, SSessionKey* pKey) { + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); + ASSERT(pNewPos->pRowBuff); + memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); + taosArrayPush(pWinInfos, &pNewPos); + return pNewPos; +} + +static SRowBuffPos* insertNewSessionWindow(SStreamFileState* pFileState, SArray* pWinInfos, SSessionKey* pKey, int32_t index) { + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); + ASSERT(pNewPos->pRowBuff); + memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); + taosArrayInsert(pWinInfos, index, &pNewPos); + return pNewPos; +} + +SRowBuffPos* createSessionWinBuff(SStreamFileState* pFileState, SSessionKey* pKey, void* p, int32_t* pVLen) { + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); + memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); + pNewPos->needFree = true; + memcpy(pNewPos->pRowBuff, p, *pVLen); + taosMemoryFree(p); + return pNewPos; +} + +int32_t getSessionWinResultBuff(SStreamFileState* pFileState, SSessionKey* pKey, TSKEY gap, void** pVal, int32_t* pVLen) { + int32_t code = TSDB_CODE_SUCCESS; + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SArray* pWinStates = NULL; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pKey->groupId, sizeof(uint64_t)); + if (ppBuff) { + pWinStates = (SArray*)(*ppBuff); + } else { + pWinStates = taosArrayInit(16, POINTER_BYTES); + tSimpleHashPut(pSessionBuff, &pKey->groupId, sizeof(uint64_t), &pWinStates, POINTER_BYTES); + } + + TSKEY startTs = pKey->win.skey; + TSKEY endTs = pKey->win.ekey; + + int32_t size = taosArrayGetSize(pWinStates); + if (size == 0) { + void* pFileStore = getStateFileStore(pFileState); + void* p = NULL; + int32_t code_file = streamStateSessionAddIfNotExist_rocksdb(pFileStore, pKey, gap, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS) { + (*pVal) = createSessionWinBuff(pFileState, pKey, p, pVLen); + code = code_file; + qDebug("===stream===0 get session win:%" PRId64 ",%" PRId64 " from disc, res %d", startTs, endTs, code_file); + } else { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pKey); + code = TSDB_CODE_FAILED; + taosMemoryFree(p); + } + goto _end; + } + + // find the first position which is smaller than the pKey + int32_t index = binarySearch(pWinStates, size, pKey, sessionStateKeyCompare); + SRowBuffPos* pPos = NULL; + + if (index >= 0) { + pPos = taosArrayGetP(pWinStates, index); + if (inSessionWindow(pPos->pKey, startTs, gap)) { + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *pKey = *pDestWinKey; + goto _end; + } + } + + if (index + 1 < size) { + pPos = taosArrayGetP(pWinStates, index + 1); + if (inSessionWindow(pPos->pKey, startTs, gap) || (endTs != INT64_MIN && inSessionWindow(pPos->pKey, endTs, gap)) ) { + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *pKey = *pDestWinKey; + goto _end; + } + } + + if (index + 1 == 0) { + if (!isDeteled(pFileState, endTs) && isFlushedState(pFileState, endTs, gap)) { + void* p = NULL; + void* pFileStore = getStateFileStore(pFileState); + int32_t code_file = streamStateSessionAddIfNotExist_rocksdb(pFileStore, pKey, gap, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS || isFlushedState(pFileState, endTs, 0)) { + (*pVal) = createSessionWinBuff(pFileState, pKey, p, pVLen); + code = code_file; + qDebug("===stream===1 get session win:%" PRId64 ",%" PRId64 " from disc, res %d", startTs, endTs, code_file); + goto _end; + } else { + taosMemoryFree(p); + } + } + } + + if (index == size - 1) { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, pKey); + code = TSDB_CODE_FAILED; + goto _end; + } + (*pVal) = insertNewSessionWindow(pFileState, pWinStates, pKey, index + 1); + code = TSDB_CODE_FAILED; + +_end: + return code; +} + +int32_t putSessionWinResultBuff(SStreamFileState* pFileState, SRowBuffPos* pPos) { + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SSessionKey* pKey = pPos->pKey; + SArray* pWinStates = NULL; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pKey->groupId, sizeof(uint64_t)); + if (ppBuff) { + pWinStates = (SArray*)(*ppBuff); + } else { + pWinStates = taosArrayInit(16, POINTER_BYTES); + tSimpleHashPut(pSessionBuff, &pKey->groupId, sizeof(uint64_t), &pWinStates, POINTER_BYTES); + } + + int32_t size = taosArrayGetSize(pWinStates); + if (size == 0) { + taosArrayPush(pWinStates, &pPos); + goto _end; + } + + // find the first position which is smaller than the pKey + int32_t index = binarySearch(pWinStates, size, pKey, sessionStateKeyCompare); + if (index >= 0) { + taosArrayInsert(pWinStates, index, &pPos); + } else { + taosArrayInsert(pWinStates, 0, &pPos); + } + +_end: + pPos->needFree = false; + return TSDB_CODE_SUCCESS; +} + +int32_t getSessionFlushedBuff(SStreamFileState* pFileState, SSessionKey* pKey, void** pVal, int32_t* pVLen) { + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); + memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); + pNewPos->needFree = true; + void* pBuff = NULL; + int32_t code = streamStateSessionGet_rocksdb(getStateFileStore(pFileState), pKey, &pBuff, pVLen); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + memcpy(pNewPos->pRowBuff, pBuff, *pVLen); + taosMemoryFreeClear(pBuff); + (*pVal) = pNewPos; + return TSDB_CODE_SUCCESS; +} + +int32_t deleteSessionWinStateBuffFn(void* pBuff, const void *key, size_t keyLen) { + SSHashObj* pSessionBuff = (SSHashObj*) pBuff; + SSessionKey* pWinKey = (SSessionKey*) key; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (!ppBuff) { + return TSDB_CODE_SUCCESS; + } + SArray* pWinStates = (SArray*)(*ppBuff); + int32_t size = taosArrayGetSize(pWinStates); + TSKEY gap = 0; + int32_t index = binarySearch(pWinStates, size, pWinKey, sessionStateKeyCompare); + if (index >= 0) { + SRowBuffPos* pPos = taosArrayGetP(pWinStates, index); + if (inSessionWindow(pPos->pKey, pWinKey->win.skey, gap)) { + pPos->beFlushed = true; + taosArrayRemove(pWinStates, index); + } + } + return TSDB_CODE_SUCCESS; +} + +int32_t deleteSessionWinStateBuffByPosFn(SStreamFileState* pFileState, SRowBuffPos* pPos) { + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SSessionKey* pWinKey = (SSessionKey*) pPos->pKey; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (!ppBuff) { + return TSDB_CODE_SUCCESS; + } + SArray* pWinStates = (SArray*)(*ppBuff); + int32_t size = taosArrayGetSize(pWinStates); + TSKEY gap = 0; + int32_t index = binarySearch(pWinStates, size, pWinKey, sessionStateKeyCompare); + if (index >= 0) { + SRowBuffPos* pItemPos = taosArrayGetP(pWinStates, index); + if (pItemPos == pPos) { + taosArrayRemove(pWinStates, index); + } + } + return TSDB_CODE_SUCCESS; +} + +void sessionWinStateClear(SStreamFileState* pFileState) { + int32_t buffSize = getRowStateRowSize(pFileState); + void* pIte = NULL; + size_t keyLen = 0; + int32_t iter = 0; + void* pBuff = getRowStateBuff(pFileState); + while ((pIte = tSimpleHashIterate(pBuff, pIte, &iter)) != NULL) { + SArray* pWinStates = *((void**)pIte); + int32_t size = taosArrayGetSize(pWinStates); + for (int32_t i = 0; i < size; i++) { + SRowBuffPos* pPos = taosArrayGetP(pWinStates, i); + memset(pPos->pRowBuff, 0, buffSize); + } + } +} + +void sessionWinStateCleanup(void* pBuff) { + void* pIte = NULL; + size_t keyLen = 0; + int32_t iter = 0; + while ((pIte = tSimpleHashIterate(pBuff, pIte, &iter)) != NULL) { + SArray* pWinStates = (SArray*) (*(void**)pIte); + taosArrayDestroy(pWinStates); + } + tSimpleHashCleanup(pBuff); +} + +static SStreamStateCur* seekKeyCurrentPrev_buff(SStreamFileState* pFileState, const SSessionKey* pWinKey, + SArray** pWins, int32_t* pIndex) { + SStreamStateCur* pCur = NULL; + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (!ppBuff) { + return NULL; + } + + SArray* pWinStates = (SArray*)(*ppBuff); + int32_t size = taosArrayGetSize(pWinStates); + TSKEY gap = 0; + int32_t index = binarySearch(pWinStates, size, pWinKey, sessionStateKeyCompare); + + if (pWins) { + (*pWins) = pWinStates; + } + + if (index >= 0) { + pCur = createStreamStateCursor(); + pCur->buffIndex = index; + pCur->pStreamFileState = pFileState; + if (pIndex) { + *pIndex = index; + } + } + return pCur; +} + +SStreamStateCur* sessionWinStateSeekKeyCurrentPrev(SStreamFileState* pFileState, const SSessionKey* pWinKey) { + SStreamStateCur* pCur = seekKeyCurrentPrev_buff(pFileState, pWinKey, NULL, NULL); + if (pCur) { + return pCur; + } + + void* pFileStore = getStateFileStore(pFileState); + pCur = streamStateSessionSeekKeyCurrentPrev_rocksdb(pFileStore, pWinKey); + if (!pCur) { + return NULL; + } + pCur->buffIndex = -1; + pCur->pStreamFileState = pFileState; + return pCur; +} +static void transformCursor(SStreamFileState* pFileState, SStreamStateCur* pCur) { + if (!pCur) { + return; + } + streamStateResetCur(pCur); + pCur->buffIndex = 0; + pCur->pStreamFileState = pFileState; +} + +static void checkAndTransformCursor(SStreamFileState* pFileState, const uint64_t groupId, SArray* pWinStates, SStreamStateCur** ppCur) { + SSessionKey key = {.groupId = groupId}; + int32_t code = streamStateSessionGetKVByCur_rocksdb(*ppCur, &key, NULL, NULL); + if (taosArrayGetSize(pWinStates) > 0 && (code == TSDB_CODE_FAILED || sessionStateKeyCompare(&key, pWinStates, 0) >= 0)) { + if ( !(*ppCur) ) { + (*ppCur) = createStreamStateCursor(); + } + transformCursor(pFileState, *ppCur); + } else if (*ppCur) { + (*ppCur)->buffIndex = -1; + (*ppCur)->pStreamFileState = pFileState; + } +} + +SStreamStateCur* sessionWinStateSeekKeyCurrentNext(SStreamFileState* pFileState, const SSessionKey* pWinKey) { + SArray* pWinStates = NULL; + int32_t index = -1; + SStreamStateCur* pCur = seekKeyCurrentPrev_buff(pFileState, pWinKey, &pWinStates, &index); + if (pCur) { + if (sessionStateKeyCompare(pWinKey, pWinStates, index) > 0) { + sessionWinStateMoveToNext(pCur); + } + return pCur; + } + + void* pFileStore = getStateFileStore(pFileState); + pCur = streamStateSessionSeekKeyCurrentNext_rocksdb(pFileStore, (SSessionKey*)pWinKey); + checkAndTransformCursor(pFileState, pWinKey->groupId, pWinStates, &pCur); + return pCur; +} + +SStreamStateCur* sessionWinStateSeekKeyNext(SStreamFileState* pFileState, const SSessionKey* pWinKey) { + SArray* pWinStates = NULL; + int32_t index = -1; + SStreamStateCur* pCur = seekKeyCurrentPrev_buff(pFileState, pWinKey, &pWinStates, &index); + if (pCur) { + sessionWinStateMoveToNext(pCur); + return pCur; + } + + void* pFileStore = getStateFileStore(pFileState); + pCur = streamStateSessionSeekKeyNext_rocksdb(pFileStore, pWinKey); + checkAndTransformCursor(pFileState, pWinKey->groupId, pWinStates, &pCur); + return pCur; +} + +int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { + if (!pCur) { + return TSDB_CODE_FAILED; + } + int32_t code = TSDB_CODE_SUCCESS; + + SSHashObj* pSessionBuff = getRowStateBuff(pCur->pStreamFileState); + void** ppBuff = tSimpleHashGet(pSessionBuff, &pKey->groupId, sizeof(uint64_t)); + if (!ppBuff) { + return TSDB_CODE_FAILED; + } + + SArray* pWinStates = (SArray*)(*ppBuff); + int32_t size = taosArrayGetSize(pWinStates); + if (pCur->buffIndex >= 0) { + if (pCur->buffIndex >= size) { + return TSDB_CODE_FAILED; + } + SRowBuffPos* pPos = taosArrayGetP(pWinStates, pCur->buffIndex); + if (pVal) { + *pVal = pPos; + } + *pKey = *(SSessionKey*)(pPos->pKey); + } else { + void* pData = NULL; + code = streamStateSessionGetKVByCur_rocksdb(pCur, pKey, &pData, pVLen); + if (taosArrayGetSize(pWinStates) > 0 && (code == TSDB_CODE_FAILED || sessionStateKeyCompare(pKey, pWinStates, 0) >= 0)) { + transformCursor(pCur->pStreamFileState, pCur); + SRowBuffPos* pPos = taosArrayGetP(pWinStates, pCur->buffIndex); + if (pVal) { + *pVal = pPos; + } + *pKey = *(SSessionKey*)(pPos->pKey); + code = TSDB_CODE_SUCCESS; + } else if (code == TSDB_CODE_SUCCESS && pVal) { + SRowBuffPos* pNewPos = getNewRowPosForWrite(pCur->pStreamFileState); + memcpy(pNewPos->pKey, pKey, sizeof(SSessionKey)); + pNewPos->needFree = true; + memcpy(pNewPos->pRowBuff, pData, *pVLen); + (*pVal) = pNewPos; + } + taosMemoryFreeClear(pData); + } + return code; +} + +int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur) { + if (pCur && pCur->buffIndex >= 0) { + pCur->buffIndex++; + } else { + streamStateCurNext_rocksdb(NULL, pCur); + } + return TSDB_CODE_SUCCESS; +} + +int32_t sessionWinStateGetKeyByRange(SStreamFileState* pFileState, const SSessionKey* key, SSessionKey* curKey) { + SStreamStateCur* pCur = sessionWinStateSeekKeyCurrentPrev(pFileState, key); + SSessionKey tmpKey = *key; + int32_t code = sessionWinStateGetKVByCur(pCur, &tmpKey, NULL, NULL); + bool hasCurrentPrev = true; + if (code == TSDB_CODE_FAILED) { + streamStateFreeCur(pCur); + pCur = sessionWinStateSeekKeyNext(pFileState, key); + code = sessionWinStateGetKVByCur(pCur, &tmpKey, NULL, NULL); + hasCurrentPrev = false; + } + + if (code == TSDB_CODE_FAILED) { + code = TSDB_CODE_FAILED; + goto _end; + } + + if (sessionRangeKeyCmpr(key, &tmpKey) == 0) { + *curKey = tmpKey; + goto _end; + } else if (!hasCurrentPrev) { + code = TSDB_CODE_FAILED; + goto _end; + } + + sessionWinStateMoveToNext(pCur); + code = sessionWinStateGetKVByCur(pCur, &tmpKey, NULL, NULL); + if (code == TSDB_CODE_SUCCESS && sessionRangeKeyCmpr(key, &tmpKey) == 0) { + *curKey = tmpKey; + } else { + code = TSDB_CODE_FAILED; + } + +_end: + streamStateFreeCur(pCur); + return code; +} + +int32_t getStateWinResultBuff(SStreamFileState* pFileState, SSessionKey* key, char* pKeyData, int32_t keyDataLen, + state_key_cmpr_fn fn, void** pVal, int32_t* pVLen) { + SSessionKey* pWinKey = key; + TSKEY gap = 0; + int32_t code = TSDB_CODE_SUCCESS; + SSHashObj* pSessionBuff = getRowStateBuff(pFileState); + SArray* pWinStates = NULL; + void** ppBuff = tSimpleHashGet(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t)); + if (ppBuff) { + pWinStates = (SArray*)(*ppBuff); + } else { + pWinStates = taosArrayInit(16, POINTER_BYTES); + tSimpleHashPut(pSessionBuff, &pWinKey->groupId, sizeof(uint64_t), &pWinStates, POINTER_BYTES); + } + + TSKEY startTs = pWinKey->win.skey; + TSKEY endTs = pWinKey->win.ekey; + + int32_t size = taosArrayGetSize(pWinStates); + if (size == 0) { + void* pFileStore = getStateFileStore(pFileState); + void* p = NULL; + int32_t code_file = streamStateStateAddIfNotExist_rocksdb(pFileStore, pWinKey, pKeyData, keyDataLen, fn, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS) { + (*pVal) = createSessionWinBuff(pFileState, pWinKey, p, pVLen); + code = code_file; + qDebug("===stream===0 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code_file); + } else { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, key); + code = TSDB_CODE_FAILED; + taosMemoryFree(p); + } + goto _end; + } + + // find the first position which is smaller than the pWinKey + int32_t index = binarySearch(pWinStates, size, pWinKey, sessionStateKeyCompare); + SRowBuffPos* pPos = NULL; + int32_t valSize = *pVLen; + + if (index >= 0) { + pPos = taosArrayGetP(pWinStates, index); + void* stateKey = (char*)(pPos->pRowBuff) + (valSize - keyDataLen); + if (inSessionWindow(pPos->pKey, startTs, gap) || fn(pKeyData, stateKey) == true) { + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *key = *pDestWinKey; + goto _end; + } + } + + if (index + 1 < size) { + pPos = taosArrayGetP(pWinStates, index + 1); + void* stateKey = (char*)(pPos->pRowBuff) + (valSize - keyDataLen); + if (inSessionWindow(pPos->pKey, startTs, gap) || (endTs != INT64_MIN && inSessionWindow(pPos->pKey, endTs, gap)) || fn(pKeyData, stateKey) == true) { + (*pVal) = pPos; + SSessionKey* pDestWinKey = (SSessionKey*)pPos->pKey; + pPos->beUsed = true; + *key = *pDestWinKey; + goto _end; + } + } + + if (index + 1 == 0) { + if (!isDeteled(pFileState, endTs)) { + void* p = NULL; + void* pFileStore = getStateFileStore(pFileState); + int32_t code_file = + streamStateStateAddIfNotExist_rocksdb(pFileStore, pWinKey, pKeyData, keyDataLen, fn, &p, pVLen); + if (code_file == TSDB_CODE_SUCCESS || isFlushedState(pFileState, endTs, 0)) { + (*pVal) = createSessionWinBuff(pFileState, pWinKey, p, pVLen); + code = code_file; + qDebug("===stream===1 get state win:%" PRId64 ",%" PRId64 " from disc, res %d", pWinKey->win.skey, pWinKey->win.ekey, code_file); + goto _end; + } else { + taosMemoryFree(p); + } + } + } + + if (index == size - 1) { + (*pVal) = addNewSessionWindow(pFileState, pWinStates, key); + code = TSDB_CODE_FAILED; + goto _end; + } + (*pVal) = insertNewSessionWindow(pFileState, pWinStates, key, index + 1); + code = TSDB_CODE_FAILED; + +_end: + return code; +} diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index 44c7b4f2e0..60b93a5590 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -351,7 +351,7 @@ bool streamStateCheck(SStreamState* pState, const SWinKey* key) { int32_t streamStateGetByPos(SStreamState* pState, void* pos, void** pVal) { int32_t code = getRowBuffByPos(pState->pFileState, pos, pVal); - releaseRowBuffPos(pos); + streamFileStateReleaseBuff(pState->pFileState, pos, false); return code; } @@ -395,9 +395,6 @@ int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key) { int32_t streamStateClear(SStreamState* pState) { #ifdef USE_ROCKSDB streamFileStateClear(pState->pFileState); - if (needClearDiskBuff(pState->pFileState)) { - streamStateClear_rocksdb(pState); - } return 0; #else SWinKey key = {.ts = 0, .groupId = 0}; @@ -422,19 +419,16 @@ void streamStateSetNumber(SStreamState* pState, int32_t number) { pState->number int32_t streamStateSaveInfo(SStreamState* pState, void* pKey, int32_t keyLen, void* pVal, int32_t vLen) { #ifdef USE_ROCKSDB int32_t code = 0; - void* batch = streamStateCreateBatch(); - code = streamStatePutBatch(pState, "default", batch, pKey, pVal, vLen, 0); + char* cfName = "default"; + void* batch = streamStateCreateBatch(); + code = streamStatePutBatch(pState, cfName, batch, pKey, pVal, vLen, 0); if (code != 0) { streamStateDestroyBatch(batch); return code; } code = streamStatePutBatch_rocksdb(pState, batch); streamStateDestroyBatch(batch); - // code = streamDefaultPut_rocksdb(pState, pKey, pVal, vLen); - // char* Val = NULL; - // int32_t len = 0; - // code = streamDefaultGet_rocksdb(pState, pKey, (void**)&Val, &len); return code; #else return 0; @@ -466,20 +460,24 @@ int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void* #endif } -int32_t streamStateReleaseBuf(SStreamState* pState, const SWinKey* key, void* pVal) { +int32_t streamStateReleaseBuf(SStreamState* pState, void* pVal, bool used) { // todo refactor qDebug("streamStateReleaseBuf"); if (!pVal) { return 0; } #ifdef USE_ROCKSDB - taosMemoryFree(pVal); + streamFileStateReleaseBuff(pState->pFileState, pVal, used); #else streamStateFreeVal(pVal); #endif return 0; } +int32_t streamStateClearBuff(SStreamState* pState, void* pVal) { + return streamFileStateClearBuff(pState->pFileState, pVal); +} + SStreamStateCur* streamStateFillGetCur(SStreamState* pState, const SWinKey* key) { #ifdef USE_ROCKSDB return streamStateFillGetCur_rocksdb(pState, key); @@ -569,39 +567,6 @@ int32_t streamStateGetGroupKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const v #endif } -int32_t streamStateGetFirst(SStreamState* pState, SWinKey* key) { -#ifdef USE_ROCKSDB - return streamStateGetFirst_rocksdb(pState, key); -#else - // todo refactor - SWinKey tmp = {.ts = 0, .groupId = 0}; - streamStatePut(pState, &tmp, NULL, 0); - SStreamStateCur* pCur = streamStateSeekKeyNext(pState, &tmp); - int32_t code = streamStateGetKVByCur(pCur, key, NULL, 0); - streamStateFreeCur(pCur); - streamStateDel(pState, &tmp); - return code; -#endif -} - -int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur) { -#ifdef USE_ROCKSDB - rocksdb_iter_seek_to_first(pCur->iter); - return 0; -#else - return tdbTbcMoveToFirst(pCur->pCur); -#endif -} - -int32_t streamStateSeekLast(SStreamState* pState, SStreamStateCur* pCur) { -#ifdef USE_ROCKSDB - rocksdb_iter_seek_to_last(pCur->iter); - return 0; -#else - return tdbTbcMoveToLast(pCur->pCur); -#endif -} - SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key) { #ifdef USE_ROCKSDB return streamStateSeekKeyNext_rocksdb(pState, key); @@ -693,7 +658,7 @@ SStreamStateCur* streamStateFillSeekKeyPrev(SStreamState* pState, const SWinKey* int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur) { #ifdef USE_ROCKSDB - return streamStateCurNext_rocksdb(pState, pCur); + return sessionWinStateMoveToNext(pCur); #else if (!pCur) { return -1; @@ -705,7 +670,7 @@ int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur) { int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur) { #ifdef USE_ROCKSDB - return streamStateCurPrev_rocksdb(pState, pCur); + return streamStateCurPrev_rocksdb(pCur); #else if (!pCur) { return -1; @@ -713,16 +678,29 @@ int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur) { return tdbTbcMoveToPrev(pCur->pCur); #endif } -void streamStateFreeCur(SStreamStateCur* pCur) { + +void streamStateResetCur(SStreamStateCur* pCur) { if (!pCur) { return; } - qDebug("streamStateFreeCur"); - rocksdb_iter_destroy(pCur->iter); + if (pCur->iter) rocksdb_iter_destroy(pCur->iter); if (pCur->snapshot) rocksdb_release_snapshot(pCur->db, pCur->snapshot); - rocksdb_readoptions_destroy(pCur->readOpt); + if (pCur->readOpt) rocksdb_readoptions_destroy(pCur->readOpt); tdbTbcClose(pCur->pCur); + + memset(pCur, 0, sizeof(SStreamStateCur)); + + pCur->buffIndex = -1; +} + +void streamStateFreeCur(SStreamStateCur* pCur) { + if (!pCur || pCur->buffIndex >= 0) { + taosMemoryFree(pCur); + return; + } + qDebug("streamStateFreeCur"); + streamStateResetCur(pCur); taosMemoryFree(pCur); } @@ -734,11 +712,25 @@ void streamStateFreeVal(void* val) { #endif } -int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, const void* value, int32_t vLen) { +int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, void* value, int32_t vLen) { #ifdef USE_ROCKSDB - qDebug("===stream===save skey:%" PRId64 ", ekey:%" PRId64 ", groupId:%" PRIu64, key->win.skey, key->win.ekey, - key->groupId); - return streamStateSessionPut_rocksdb(pState, key, value, vLen); + int32_t code = TSDB_CODE_SUCCESS; + SRowBuffPos* pos = (SRowBuffPos*)value; + if (pos->needFree) { + if (isFlushedState(pState->pFileState, key->win.ekey, 0)) { + if (!pos->pRowBuff) { + return code; + } + code = streamStateSessionPut_rocksdb(pState, key, pos->pRowBuff, vLen); + streamStateReleaseBuf(pState, pos, true); + putFreeBuff(pState->pFileState, pos); + qDebug("===stream===save skey:%" PRId64 ", ekey:%" PRId64 ", groupId:%" PRIu64 ".code:%d", key->win.skey, + key->win.ekey, key->groupId, code); + } else { + code = putSessionWinResultBuff(pState->pFileState, value); + } + } + return code; #else SStateSessionKey sKey = {.key = *key, .opNum = pState->number}; return tdbTbUpsert(pState->pTdbState->pSessionStateDb, &sKey, sizeof(SStateSessionKey), value, vLen, @@ -748,7 +740,7 @@ int32_t streamStateSessionPut(SStreamState* pState, const SSessionKey* key, cons int32_t streamStateSessionGet(SStreamState* pState, SSessionKey* key, void** pVal, int32_t* pVLen) { #ifdef USE_ROCKSDB - return streamStateSessionGet_rocksdb(pState, key, pVal, pVLen); + return getSessionFlushedBuff(pState->pFileState, key, pVal, pVLen); #else SStreamStateCur* pCur = streamStateSessionSeekKeyCurrentNext(pState, key); @@ -773,7 +765,7 @@ int32_t streamStateSessionDel(SStreamState* pState, const SSessionKey* key) { #ifdef USE_ROCKSDB qDebug("===stream===delete skey:%" PRId64 ", ekey:%" PRId64 ", groupId:%" PRIu64, key->win.skey, key->win.ekey, key->groupId); - return streamStateSessionDel_rocksdb(pState, key); + return deleteRowBuff(pState->pFileState, key, sizeof(SSessionKey)); #else SStateSessionKey sKey = {.key = *key, .opNum = pState->number}; return tdbTbDelete(pState->pTdbState->pSessionStateDb, &sKey, sizeof(SStateSessionKey), pState->pTdbState->txn); @@ -782,7 +774,7 @@ int32_t streamStateSessionDel(SStreamState* pState, const SSessionKey* key) { SStreamStateCur* streamStateSessionSeekKeyCurrentPrev(SStreamState* pState, const SSessionKey* key) { #ifdef USE_ROCKSDB - return streamStateSessionSeekKeyCurrentPrev_rocksdb(pState, key); + return sessionWinStateSeekKeyCurrentPrev(pState->pFileState, key); #else SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { @@ -813,7 +805,7 @@ SStreamStateCur* streamStateSessionSeekKeyCurrentPrev(SStreamState* pState, cons SStreamStateCur* streamStateSessionSeekKeyCurrentNext(SStreamState* pState, const SSessionKey* key) { #ifdef USE_ROCKSDB - return streamStateSessionSeekKeyCurrentNext_rocksdb(pState, (SSessionKey*)key); + return sessionWinStateSeekKeyCurrentNext(pState->pFileState, key); #else SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { @@ -845,7 +837,7 @@ SStreamStateCur* streamStateSessionSeekKeyCurrentNext(SStreamState* pState, cons SStreamStateCur* streamStateSessionSeekKeyNext(SStreamState* pState, const SSessionKey* key) { #ifdef USE_ROCKSDB - return streamStateSessionSeekKeyNext_rocksdb(pState, key); + return sessionWinStateSeekKeyNext(pState->pFileState, key); #else SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { @@ -876,7 +868,7 @@ SStreamStateCur* streamStateSessionSeekKeyNext(SStreamState* pState, const SSess int32_t streamStateSessionGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void** pVal, int32_t* pVLen) { #ifdef USE_ROCKSDB - return streamStateSessionGetKVByCur_rocksdb(pCur, pKey, pVal, pVLen); + return sessionWinStateGetKVByCur(pCur, pKey, pVal, pVLen); #else if (!pCur) { return -1; @@ -899,6 +891,7 @@ int32_t streamStateSessionGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, v int32_t streamStateSessionClear(SStreamState* pState) { #ifdef USE_ROCKSDB + sessionWinStateClear(pState->pFileState); return streamStateSessionClear_rocksdb(pState); #else SSessionKey key = {.win.skey = 0, .win.ekey = 0, .groupId = 0}; @@ -923,7 +916,7 @@ int32_t streamStateSessionClear(SStreamState* pState) { int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* key, SSessionKey* curKey) { #ifdef USE_ROCKSDB - return streamStateSessionGetKeyByRange_rocksdb(pState, key, curKey); + return sessionWinStateGetKeyByRange(pState->pFileState, key, curKey); #else SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); if (pCur == NULL) { @@ -976,7 +969,7 @@ int32_t streamStateSessionGetKeyByRange(SStreamState* pState, const SSessionKey* int32_t streamStateSessionAddIfNotExist(SStreamState* pState, SSessionKey* key, TSKEY gap, void** pVal, int32_t* pVLen) { #ifdef USE_ROCKSDB - return streamStateSessionAddIfNotExist_rocksdb(pState, key, gap, pVal, pVLen); + return getSessionWinResultBuff(pState->pFileState, key, gap, pVal, pVLen); #else // todo refactor int32_t res = 0; @@ -1032,7 +1025,7 @@ int32_t streamStateStateAddIfNotExist(SStreamState* pState, SSessionKey* key, ch // todo refactor #ifdef USE_ROCKSDB - return streamStateStateAddIfNotExist_rocksdb(pState, key, pKeyData, keyDataLen, fn, pVal, pVLen); + return getStateWinResultBuff(pState->pFileState, key, pKeyData, keyDataLen, fn, pVal, pVLen); #else int32_t res = 0; SSessionKey tmpKey = *key; @@ -1143,6 +1136,12 @@ int32_t streamStateDeleteCheckPoint(SStreamState* pState, TSKEY mark) { void streamStateReloadInfo(SStreamState* pState, TSKEY ts) { streamFileStateReloadInfo(pState->pFileState, ts); } +SStreamStateCur* createStreamStateCursor() { + SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); + pCur->buffIndex = -1; + return pCur; +} + #if 0 char* streamStateSessionDump(SStreamState* pState) { SStreamStateCur* pCur = taosMemoryCalloc(1, sizeof(SStreamStateCur)); diff --git a/source/libs/stream/src/tstreamFileState.c b/source/libs/stream/src/tstreamFileState.c index be3ad73472..ac404893f0 100644 --- a/source/libs/stream/src/tstreamFileState.c +++ b/source/libs/stream/src/tstreamFileState.c @@ -16,7 +16,6 @@ #include "tstreamFileState.h" #include "query.h" -#include "storageapi.h" #include "streamBackendRocksdb.h" #include "taos.h" #include "tcommon.h" @@ -29,29 +28,94 @@ #define MIN_NUM_OF_ROW_BUFF 10240 struct SStreamFileState { - SList* usedBuffs; - SList* freeBuffs; - SSHashObj* rowBuffMap; - void* pFileStore; - int32_t rowSize; - int32_t selectivityRowSize; - int32_t keyLen; - uint64_t preCheckPointVersion; - uint64_t checkPointVersion; - TSKEY maxTs; - TSKEY deleteMark; - TSKEY flushMark; - uint64_t maxRowCount; - uint64_t curRowCount; - GetTsFun getTs; - char* id; + SList* usedBuffs; + SList* freeBuffs; + void* rowStateBuff; + void* pFileStore; + int32_t rowSize; + int32_t selectivityRowSize; + int32_t keyLen; + uint64_t preCheckPointVersion; + uint64_t checkPointVersion; + TSKEY maxTs; + TSKEY deleteMark; + TSKEY flushMark; + uint64_t maxRowCount; + uint64_t curRowCount; + GetTsFun getTs; + char* id; + char* cfName; + + _state_buff_cleanup_fn stateBuffCleanupFn; + _state_buff_remove_fn stateBuffRemoveFn; + _state_buff_remove_by_pos_fn stateBuffRemoveByPosFn; + _state_buff_create_statekey_fn stateBuffCreateStateKeyFn; + + _state_file_remove_fn stateFileRemoveFn; + _state_file_get_fn stateFileGetFn; + _state_file_clear_fn stateFileClearFn; }; typedef SRowBuffPos SRowBuffInfo; +int32_t stateHashBuffRemoveFn(void* pBuff, const void* pKey, size_t keyLen) { + SRowBuffPos** pos = tSimpleHashGet(pBuff, pKey, keyLen); + if (pos) { + (*pos)->beFlushed = true; + } + return tSimpleHashRemove(pBuff, pKey, keyLen); +} + +int32_t stateHashBuffRemoveByPosFn(SStreamFileState* pFileState, SRowBuffPos* pPos) { + size_t keyLen = pFileState->keyLen; + SRowBuffPos** ppPos = tSimpleHashGet(pFileState->rowStateBuff, pPos->pKey, keyLen); + if (ppPos) { + if ((*ppPos) == pPos) { + return tSimpleHashRemove(pFileState->rowStateBuff, pPos->pKey, keyLen); + } + } + return TSDB_CODE_SUCCESS; +} + +void stateHashBuffClearFn(void* pBuff) { tSimpleHashClear(pBuff); } + +void stateHashBuffCleanupFn(void* pBuff) { tSimpleHashCleanup(pBuff); } + +int32_t intervalFileRemoveFn(SStreamFileState* pFileState, const void* pKey) { + return streamStateDel_rocksdb(pFileState->pFileStore, pKey); +} + +int32_t intervalFileGetFn(SStreamFileState* pFileState, void* pKey, void* data, int32_t* pDataLen) { + return streamStateGet_rocksdb(pFileState->pFileStore, pKey, data, pDataLen); +} + +void* intervalCreateStateKey(SRowBuffPos* pPos, int64_t num) { + SStateKey* pStateKey = taosMemoryCalloc(1, sizeof(SStateKey)); + SWinKey* pWinKey = pPos->pKey; + pStateKey->key = *pWinKey; + pStateKey->opNum = num; + return pStateKey; +} + +int32_t sessionFileRemoveFn(SStreamFileState* pFileState, const void* pKey) { + return streamStateSessionDel_rocksdb(pFileState->pFileStore, pKey); +} + +int32_t sessionFileGetFn(SStreamFileState* pFileState, void* pKey, void* data, int32_t* pDataLen) { + return streamStateSessionGet_rocksdb(pFileState->pFileStore, pKey, data, pDataLen); +} + +void* sessionCreateStateKey(SRowBuffPos* pPos, int64_t num) { + SStateSessionKey* pStateKey = taosMemoryCalloc(1, sizeof(SStateSessionKey)); + SSessionKey* pWinKey = pPos->pKey; + pStateKey->key = *pWinKey; + pStateKey->opNum = num; + return pStateKey; +} + SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_t rowSize, uint32_t selectRowSize, - GetTsFun fp, void* pFile, TSKEY delMark, const char* taskId, - int64_t checkpointId) { + GetTsFun fp, void* pFile, TSKEY delMark, const char* taskId, int64_t checkpointId, + int8_t type) { if (memSize <= 0) { memSize = DEFAULT_MAX_STREAM_BUFFER_SIZE; } @@ -69,8 +133,31 @@ SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_ pFileState->freeBuffs = tdListNew(POINTER_BYTES); _hash_fn_t hashFn = taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY); int32_t cap = TMIN(MIN_NUM_OF_ROW_BUFF, pFileState->maxRowCount); - pFileState->rowBuffMap = tSimpleHashInit(cap, hashFn); - if (!pFileState->usedBuffs || !pFileState->freeBuffs || !pFileState->rowBuffMap) { + if (type == STREAM_STATE_BUFF_HASH) { + pFileState->rowStateBuff = tSimpleHashInit(cap, hashFn); + pFileState->stateBuffCleanupFn = stateHashBuffCleanupFn; + pFileState->stateBuffRemoveFn = stateHashBuffRemoveFn; + pFileState->stateBuffRemoveByPosFn = stateHashBuffRemoveByPosFn; + pFileState->stateBuffCreateStateKeyFn = intervalCreateStateKey; + + pFileState->stateFileRemoveFn = intervalFileRemoveFn; + pFileState->stateFileGetFn = intervalFileGetFn; + pFileState->stateFileClearFn = streamStateClear_rocksdb; + pFileState->cfName = taosStrdup("state"); + } else { + pFileState->rowStateBuff = tSimpleHashInit(cap, hashFn); + pFileState->stateBuffCleanupFn = sessionWinStateCleanup; + pFileState->stateBuffRemoveFn = deleteSessionWinStateBuffFn; + pFileState->stateBuffRemoveByPosFn = deleteSessionWinStateBuffByPosFn; + pFileState->stateBuffCreateStateKeyFn = sessionCreateStateKey; + + pFileState->stateFileRemoveFn = sessionFileRemoveFn; + pFileState->stateFileGetFn = sessionFileGetFn; + pFileState->stateFileClearFn = streamStateSessionClear_rocksdb; + pFileState->cfName = taosStrdup("sess"); + } + + if (!pFileState->usedBuffs || !pFileState->freeBuffs || !pFileState->rowStateBuff) { goto _error; } @@ -87,7 +174,10 @@ SStreamFileState* streamFileStateInit(int64_t memSize, uint32_t keySize, uint32_ pFileState->maxTs = INT64_MIN; pFileState->id = taosStrdup(taskId); - recoverSnapshot(pFileState, checkpointId); + // todo(liuyao) optimize + if (type == STREAM_STATE_BUFF_HASH) { + recoverSnapshot(pFileState, checkpointId); + } return pFileState; _error: @@ -132,12 +222,20 @@ void streamFileStateDestroy(SStreamFileState* pFileState) { } taosMemoryFree(pFileState->id); + taosMemoryFree(pFileState->cfName); tdListFreeP(pFileState->usedBuffs, destroyRowBuffAllPosPtr); tdListFreeP(pFileState->freeBuffs, destroyRowBuff); - tSimpleHashCleanup(pFileState->rowBuffMap); + pFileState->stateBuffCleanupFn(pFileState->rowStateBuff); taosMemoryFree(pFileState); } +void putFreeBuff(SStreamFileState* pFileState, SRowBuffPos* pPos) { + if (pPos->pRowBuff) { + tdListAppend(pFileState->freeBuffs, &(pPos->pRowBuff)); + pPos->pRowBuff = NULL; + } +} + void clearExpiredRowBuff(SStreamFileState* pFileState, TSKEY ts, bool all) { SListIter iter = {0}; tdListInitIter(pFileState->usedBuffs, &iter, TD_LIST_FORWARD); @@ -146,11 +244,10 @@ void clearExpiredRowBuff(SStreamFileState* pFileState, TSKEY ts, bool all) { while ((pNode = tdListNext(&iter)) != NULL) { SRowBuffPos* pPos = *(SRowBuffPos**)(pNode->data); if (all || (pFileState->getTs(pPos->pKey) < ts && !pPos->beUsed)) { - ASSERT(pPos->pRowBuff != NULL); - tdListAppend(pFileState->freeBuffs, &(pPos->pRowBuff)); - pPos->pRowBuff = NULL; + putFreeBuff(pFileState, pPos); + if (!all) { - tSimpleHashRemove(pFileState->rowBuffMap, pPos->pKey, pFileState->keyLen); + pFileState->stateBuffRemoveByPosFn(pFileState, pPos); } destroyRowBuffPos(pPos); tdListPopNode(pFileState->usedBuffs, pNode); @@ -159,15 +256,38 @@ void clearExpiredRowBuff(SStreamFileState* pFileState, TSKEY ts, bool all) { } } +void clearFlushedRowBuff(SStreamFileState* pFileState, SStreamSnapshot* pFlushList, uint64_t max) { + uint64_t i = 0; + SListIter iter = {0}; + tdListInitIter(pFileState->usedBuffs, &iter, TD_LIST_FORWARD); + + SListNode* pNode = NULL; + while ((pNode = tdListNext(&iter)) != NULL && i < max) { + SRowBuffPos* pPos = *(SRowBuffPos**)pNode->data; + if (isFlushedState(pFileState, pFileState->getTs(pPos->pKey), 0) && !pPos->beUsed) { + tdListAppend(pFlushList, &pPos); + pFileState->flushMark = TMAX(pFileState->flushMark, pFileState->getTs(pPos->pKey)); + pFileState->stateBuffRemoveByPosFn(pFileState, pPos); + tdListPopNode(pFileState->usedBuffs, pNode); + taosMemoryFreeClear(pNode); + if (pPos->pRowBuff) { + i++; + } + } + } +} + void streamFileStateClear(SStreamFileState* pFileState) { pFileState->flushMark = INT64_MIN; pFileState->maxTs = INT64_MIN; - tSimpleHashClear(pFileState->rowBuffMap); + tSimpleHashClear(pFileState->rowStateBuff); clearExpiredRowBuff(pFileState, 0, true); } bool needClearDiskBuff(SStreamFileState* pFileState) { return pFileState->flushMark > 0; } +void streamFileStateReleaseBuff(SStreamFileState* pFileState, SRowBuffPos* pPos, bool used) { pPos->beUsed = used; } + void popUsedBuffs(SStreamFileState* pFileState, SStreamSnapshot* pFlushList, uint64_t max, bool used) { uint64_t i = 0; SListIter iter = {0}; @@ -179,10 +299,12 @@ void popUsedBuffs(SStreamFileState* pFileState, SStreamSnapshot* pFlushList, uin if (pPos->beUsed == used) { tdListAppend(pFlushList, &pPos); pFileState->flushMark = TMAX(pFileState->flushMark, pFileState->getTs(pPos->pKey)); - tSimpleHashRemove(pFileState->rowBuffMap, pPos->pKey, pFileState->keyLen); + pFileState->stateBuffRemoveByPosFn(pFileState, pPos); tdListPopNode(pFileState->usedBuffs, pNode); taosMemoryFreeClear(pNode); - i++; + if (pPos->pRowBuff) { + i++; + } } } @@ -197,10 +319,13 @@ int32_t flushRowBuff(SStreamFileState* pFileState) { uint64_t num = (uint64_t)(pFileState->curRowCount * FLUSH_RATIO); num = TMAX(num, FLUSH_NUM); - popUsedBuffs(pFileState, pFlushList, num, false); - + clearFlushedRowBuff(pFileState, pFlushList, num); if (isListEmpty(pFlushList)) { - popUsedBuffs(pFileState, pFlushList, num, true); + popUsedBuffs(pFileState, pFlushList, num, false); + + if (isListEmpty(pFlushList)) { + popUsedBuffs(pFileState, pFlushList, num, true); + } } flushSnapshot(pFileState, pFlushList, false); @@ -210,9 +335,7 @@ int32_t flushRowBuff(SStreamFileState* pFileState) { SListNode* pNode = NULL; while ((pNode = tdListNext(&fIter)) != NULL) { SRowBuffPos* pPos = *(SRowBuffPos**)pNode->data; - ASSERT(pPos->pRowBuff != NULL); - tdListAppend(pFileState->freeBuffs, &pPos->pRowBuff); - pPos->pRowBuff = NULL; + putFreeBuff(pFileState, pPos); } tdListFreeP(pFlushList, destroyRowBuffPosPtr); @@ -227,7 +350,9 @@ int32_t clearRowBuff(SStreamFileState* pFileState) { return TSDB_CODE_SUCCESS; } -void* getFreeBuff(SList* lists, int32_t buffSize) { +void* getFreeBuff(SStreamFileState* pFileState) { + SList* lists = pFileState->freeBuffs; + int32_t buffSize = pFileState->rowSize; SListNode* pNode = tdListPopHead(lists); if (!pNode) { return NULL; @@ -238,10 +363,18 @@ void* getFreeBuff(SList* lists, int32_t buffSize) { return ptr; } +int32_t streamFileStateClearBuff(SStreamFileState* pFileState, SRowBuffPos* pPos) { + if (pPos->pRowBuff) { + memset(pPos->pRowBuff, 0, pFileState->rowSize); + return TSDB_CODE_SUCCESS; + } + return TSDB_CODE_FAILED; +} + SRowBuffPos* getNewRowPos(SStreamFileState* pFileState) { SRowBuffPos* pPos = taosMemoryCalloc(1, sizeof(SRowBuffPos)); pPos->pKey = taosMemoryCalloc(1, pFileState->keyLen); - void* pBuff = getFreeBuff(pFileState->freeBuffs, pFileState->rowSize); + void* pBuff = getFreeBuff(pFileState); if (pBuff) { pPos->pRowBuff = pBuff; goto _end; @@ -258,7 +391,7 @@ SRowBuffPos* getNewRowPos(SStreamFileState* pFileState) { int32_t code = clearRowBuff(pFileState); ASSERT(code == 0); - pPos->pRowBuff = getFreeBuff(pFileState->freeBuffs, pFileState->rowSize); + pPos->pRowBuff = getFreeBuff(pFileState); _end: tdListAppend(pFileState->usedBuffs, &pPos); @@ -266,9 +399,17 @@ _end: return pPos; } +SRowBuffPos* getNewRowPosForWrite(SStreamFileState* pFileState) { + SRowBuffPos* newPos = getNewRowPos(pFileState); + newPos->beUsed = true; + newPos->beFlushed = false; + newPos->needFree = false; + return newPos; +} + int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, void** pVal, int32_t* pVLen) { pFileState->maxTs = TMAX(pFileState->maxTs, pFileState->getTs(pKey)); - SRowBuffPos** pos = tSimpleHashGet(pFileState->rowBuffMap, pKey, keyLen); + SRowBuffPos** pos = tSimpleHashGet(pFileState->rowStateBuff, pKey, keyLen); if (pos) { *pVLen = pFileState->rowSize; *pVal = *pos; @@ -276,14 +417,12 @@ int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, voi (*pos)->beFlushed = false; return TSDB_CODE_SUCCESS; } - SRowBuffPos* pNewPos = getNewRowPos(pFileState); - pNewPos->beUsed = true; - pNewPos->beFlushed = false; + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); ASSERT(pNewPos->pRowBuff); memcpy(pNewPos->pKey, pKey, keyLen); TSKEY ts = pFileState->getTs(pKey); - if (ts > pFileState->maxTs - pFileState->deleteMark && ts < pFileState->flushMark) { + if (!isDeteled(pFileState, ts) && isFlushedState(pFileState, ts, 0)) { int32_t len = 0; void* p = NULL; int32_t code = streamStateGet_rocksdb(pFileState->pFileStore, pKey, &p, &len); @@ -294,7 +433,7 @@ int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, voi taosMemoryFree(p); } - tSimpleHashPut(pFileState->rowBuffMap, pKey, keyLen, &pNewPos, POINTER_BYTES); + tSimpleHashPut(pFileState->rowStateBuff, pKey, keyLen, &pNewPos, POINTER_BYTES); if (pVal) { *pVLen = pFileState->rowSize; *pVal = pNewPos; @@ -303,45 +442,60 @@ int32_t getRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen, voi } int32_t deleteRowBuff(SStreamFileState* pFileState, const void* pKey, int32_t keyLen) { - int32_t code_buff = tSimpleHashRemove(pFileState->rowBuffMap, pKey, keyLen); - int32_t code_rocks = streamStateDel_rocksdb(pFileState->pFileStore, pKey); - return code_buff == TSDB_CODE_SUCCESS ? code_buff : code_rocks; + int32_t code_buff = pFileState->stateBuffRemoveFn(pFileState->rowStateBuff, pKey, keyLen); + int32_t code_file = pFileState->stateFileRemoveFn(pFileState, pKey); + if (code_buff == TSDB_CODE_SUCCESS || code_file == TSDB_CODE_SUCCESS) { + return TSDB_CODE_SUCCESS; + } + return TSDB_CODE_FAILED; +} + +static void recoverSessionRowBuff(SStreamFileState* pFileState, SRowBuffPos* pPos) { + int32_t len = 0; + void* pBuff = NULL; + pFileState->stateFileGetFn(pFileState, pPos->pKey, &pBuff, &len); + memcpy(pPos->pRowBuff, pBuff, len); + taosMemoryFree(pBuff); } int32_t getRowBuffByPos(SStreamFileState* pFileState, SRowBuffPos* pPos, void** pVal) { if (pPos->pRowBuff) { + if (pPos->needFree) { + recoverSessionRowBuff(pFileState, pPos); + } (*pVal) = pPos->pRowBuff; return TSDB_CODE_SUCCESS; } - pPos->pRowBuff = getFreeBuff(pFileState->freeBuffs, pFileState->rowSize); + pPos->pRowBuff = getFreeBuff(pFileState); if (!pPos->pRowBuff) { - int32_t code = clearRowBuff(pFileState); - ASSERT(code == 0); - pPos->pRowBuff = getFreeBuff(pFileState->freeBuffs, pFileState->rowSize); + if (pFileState->curRowCount < pFileState->maxRowCount) { + pPos->pRowBuff = taosMemoryCalloc(1, pFileState->rowSize); + pFileState->curRowCount++; + } else { + int32_t code = clearRowBuff(pFileState); + ASSERT(code == 0); + pPos->pRowBuff = getFreeBuff(pFileState); + } ASSERT(pPos->pRowBuff); } - int32_t len = 0; - void* pBuff = NULL; - streamStateGet_rocksdb(pFileState->pFileStore, pPos->pKey, &pBuff, &len); - memcpy(pPos->pRowBuff, pBuff, len); - taosMemoryFree(pBuff); + recoverSessionRowBuff(pFileState, pPos); (*pVal) = pPos->pRowBuff; - tdListPrepend(pFileState->usedBuffs, &pPos); + if (!pPos->needFree) { + tdListPrepend(pFileState->usedBuffs, &pPos); + } return TSDB_CODE_SUCCESS; } bool hasRowBuff(SStreamFileState* pFileState, void* pKey, int32_t keyLen) { - SRowBuffPos** pos = tSimpleHashGet(pFileState->rowBuffMap, pKey, keyLen); + SRowBuffPos** pos = tSimpleHashGet(pFileState->rowStateBuff, pKey, keyLen); if (pos) { return true; } return false; } -void releaseRowBuffPos(SRowBuffPos* pBuff) { pBuff->beUsed = false; } - SStreamSnapshot* getSnapshot(SStreamFileState* pFileState) { int64_t mark = (INT64_MIN + pFileState->deleteMark >= pFileState->maxTs) ? INT64_MIN : pFileState->maxTs - pFileState->deleteMark; @@ -349,13 +503,13 @@ SStreamSnapshot* getSnapshot(SStreamFileState* pFileState) { return pFileState->usedBuffs; } -void streamFileStateDecode(TSKEY* key, void* pBuff, int32_t len) { pBuff = taosDecodeFixedI64(pBuff, key); } +void streamFileStateDecode(TSKEY* pKey, void* pBuff, int32_t len) { pBuff = taosDecodeFixedI64(pBuff, pKey); } -void streamFileStateEncode(TSKEY* key, void** pVal, int32_t* pLen) { +void streamFileStateEncode(TSKEY* pKey, void** pVal, int32_t* pLen) { *pLen = sizeof(TSKEY); (*pVal) = taosMemoryCalloc(1, *pLen); void* buff = *pVal; - taosEncodeFixedI64(&buff, *key); + taosEncodeFixedI64(&buff, *pKey); } int32_t flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot, bool flushState) { @@ -369,7 +523,7 @@ int32_t flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot, int32_t numOfElems = listNEles(pSnapshot); SListNode* pNode = NULL; - int idx = streamStateGetCfIdx(pFileState->pFileStore, "state"); + int idx = streamStateGetCfIdx(pFileState->pFileStore, pFileState->cfName); int32_t len = pFileState->rowSize + sizeof(uint64_t) + sizeof(int32_t) + 1; char* buf = taosMemoryCalloc(1, len); @@ -377,23 +531,23 @@ int32_t flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot, void* batch = streamStateCreateBatch(); while ((pNode = tdListNext(&iter)) != NULL && code == TSDB_CODE_SUCCESS) { SRowBuffPos* pPos = *(SRowBuffPos**)pNode->data; - ASSERT(pPos->pRowBuff && pFileState->rowSize > 0); - if (pPos->beFlushed) { + if (pPos->beFlushed || !pPos->pRowBuff) { continue; } pPos->beFlushed = true; + qDebug("===stream===flushed start:%" PRId64, pFileState->getTs(pPos->pKey)); if (streamStateGetBatchSize(batch) >= BATCH_LIMIT) { streamStatePutBatch_rocksdb(pFileState->pFileStore, batch); streamStateClearBatch(batch); } - SStateKey sKey = {.key = *((SWinKey*)pPos->pKey), .opNum = ((SStreamState*)pFileState->pFileStore)->number}; - code = streamStatePutBatchOptimize(pFileState->pFileStore, idx, batch, &sKey, pPos->pRowBuff, pFileState->rowSize, + void* pSKey = pFileState->stateBuffCreateStateKeyFn(pPos, ((SStreamState*)pFileState->pFileStore)->number); + code = streamStatePutBatchOptimize(pFileState->pFileStore, idx, batch, pSKey, pPos->pRowBuff, pFileState->rowSize, 0, buf); + taosMemoryFreeClear(pSKey); // todo handle failure memset(buf, 0, len); - // qDebug("===stream===put %" PRId64 " to disc, res %d", sKey.key.ts, code); } taosMemoryFree(buf); @@ -487,6 +641,26 @@ int32_t deleteExpiredCheckPoint(SStreamFileState* pFileState, TSKEY mark) { return code; } +int32_t recoverSesssion(SStreamFileState* pFileState, int64_t ckId) { + int code = TSDB_CODE_SUCCESS; + SStreamStateCur* pCur = streamStateSessionSeekToLast_rocksdb(pFileState->pFileStore); + if (pCur == NULL) { + return -1; + } + while (code == TSDB_CODE_SUCCESS) { + void* pVal = NULL; + int32_t vlen = 0; + SSessionKey key = {0}; + code = streamStateSessionGetKVByCur_rocksdb(pCur, &key, &pVal, &vlen); + if (code != 0) { + break; + } + taosMemoryFree(pVal); + code = streamStateSessionCurPrev_rocksdb(pCur); + } + streamStateFreeCur(pCur); + return code; +} int32_t recoverSnapshot(SStreamFileState* pFileState, int64_t ckId) { int32_t code = TSDB_CODE_SUCCESS; if (pFileState->maxTs != INT64_MIN) { @@ -496,8 +670,7 @@ int32_t recoverSnapshot(SStreamFileState* pFileState, int64_t ckId) { deleteExpiredCheckPoint(pFileState, mark); } - SWinKey key = {.groupId = 0, .ts = 0}; - SStreamStateCur* pCur = streamStateSeekToLast_rocksdb(pFileState->pFileStore, &key); + SStreamStateCur* pCur = streamStateSeekToLast_rocksdb(pFileState->pFileStore); if (pCur == NULL) { return -1; } @@ -507,9 +680,9 @@ int32_t recoverSnapshot(SStreamFileState* pFileState, int64_t ckId) { break; } void* pVal = NULL; - int32_t pVLen = 0; - SRowBuffPos* pNewPos = getNewRowPos(pFileState); - code = streamStateGetKVByCur_rocksdb(pCur, pNewPos->pKey, (const void**)&pVal, &pVLen); + int32_t vlen = 0; + SRowBuffPos* pNewPos = getNewRowPosForWrite(pFileState); + code = streamStateGetKVByCur_rocksdb(pCur, pNewPos->pKey, (const void**)&pVal, &vlen); if (code != TSDB_CODE_SUCCESS || pFileState->getTs(pNewPos->pKey) < pFileState->flushMark) { destroyRowBuffPos(pNewPos); SListNode* pNode = tdListPopTail(pFileState->usedBuffs); @@ -517,16 +690,16 @@ int32_t recoverSnapshot(SStreamFileState* pFileState, int64_t ckId) { taosMemoryFreeClear(pVal); break; } - ASSERT(pVLen == pFileState->rowSize); - memcpy(pNewPos->pRowBuff, pVal, pVLen); + ASSERT(vlen == pFileState->rowSize); + memcpy(pNewPos->pRowBuff, pVal, vlen); taosMemoryFreeClear(pVal); pNewPos->beFlushed = true; - code = tSimpleHashPut(pFileState->rowBuffMap, pNewPos->pKey, pFileState->keyLen, &pNewPos, POINTER_BYTES); + code = tSimpleHashPut(pFileState->rowStateBuff, pNewPos->pKey, pFileState->keyLen, &pNewPos, POINTER_BYTES); if (code != TSDB_CODE_SUCCESS) { destroyRowBuffPos(pNewPos); break; } - code = streamStateCurPrev_rocksdb(pFileState->pFileStore, pCur); + code = streamStateCurPrev_rocksdb(pCur); } streamStateFreeCur(pCur); @@ -539,3 +712,15 @@ void streamFileStateReloadInfo(SStreamFileState* pFileState, TSKEY ts) { pFileState->flushMark = TMAX(pFileState->flushMark, ts); pFileState->maxTs = TMAX(pFileState->maxTs, ts); } + +void* getRowStateBuff(SStreamFileState* pFileState) { return pFileState->rowStateBuff; } + +void* getStateFileStore(SStreamFileState* pFileState) { return pFileState->pFileStore; } + +bool isDeteled(SStreamFileState* pFileState, TSKEY ts) { + return pFileState->deleteMark > 0 && ts < (pFileState->maxTs - pFileState->deleteMark); +} + +bool isFlushedState(SStreamFileState* pFileState, TSKEY ts, TSKEY gap) { return ts <= (pFileState->flushMark + gap); } + +int32_t getRowStateRowSize(SStreamFileState* pFileState) { return pFileState->rowSize; } diff --git a/source/libs/transport/src/tmsgcb.c b/source/libs/transport/src/tmsgcb.c index fc95cab76e..1b1fa8cc1c 100644 --- a/source/libs/transport/src/tmsgcb.c +++ b/source/libs/transport/src/tmsgcb.c @@ -26,6 +26,10 @@ void tmsgSetDefault(const SMsgCb* msgcb) { defaultMsgCb = *msgcb; } int32_t tmsgPutToQueue(const SMsgCb* msgcb, EQueueType qtype, SRpcMsg* pMsg) { int32_t code = (*msgcb->putToQueueFp)(msgcb->mgmt, qtype, pMsg); if (code != 0) { + SRpcMsg rsp = {.code = code, .info = pMsg->info}; + if (rsp.info.handle != NULL) { + tmsgSendRsp(&rsp); + } rpcFreeCont(pMsg->pCont); pMsg->pCont = NULL; } diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 7afef03f0d..abf0e128fe 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -207,7 +207,8 @@ ,,n,system-test,python3 ./test.py -f 0-others/tag_index_basic.py ,,n,system-test,python3 ./test.py -f 0-others/udfpy_main.py ,,n,system-test,python3 ./test.py -N 3 -f 0-others/walRetention.py -#,,n,system-test,python3 ./test.py -f 0-others/splitVGroup.py -N 5 +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/splitVGroupRep1.py -N 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/splitVGroupRep3.py -N 3 ,,n,system-test,python3 ./test.py -f 0-others/timeRangeWise.py -N 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_database.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/alter_replica.py -N 3 diff --git a/tests/script/api/passwdTest.c b/tests/script/api/passwdTest.c index 24059bd35d..928525750e 100644 --- a/tests/script/api/passwdTest.c +++ b/tests/script/api/passwdTest.c @@ -48,6 +48,7 @@ void createUsers(TAOS *taos, const char *host, char *qstr); void passVerTestMulti(const char *host, char *qstr); void sysInfoTest(TAOS *taos, const char *host, char *qstr); void userDroppedTest(TAOS *taos, const char *host, char *qstr); +void clearTestEnv(TAOS *taos, const char *host, char *qstr); int nPassVerNotified = 0; int nUserDropped = 0; @@ -210,6 +211,7 @@ int main(int argc, char *argv[]) { passVerTestMulti(argv[1], qstr); sysInfoTest(taos, argv[1], qstr); userDroppedTest(taos, argv[1], qstr); + clearTestEnv(taos, argv[1], qstr); taos_close(taos); taos_cleanup(); @@ -267,9 +269,9 @@ void passVerTestMulti(const char *host, char *qstr) { queryDB(taos[0], "create database if not exists demo2 vgroups 1 minrows 10"); queryDB(taos[0], "create database if not exists demo3 vgroups 1 minrows 10"); - queryDB(taos[0], "create table demo1.stb (ts timestamp, c1 int) tags(t1 int)"); - queryDB(taos[0], "create table demo2.stb (ts timestamp, c1 int) tags(t1 int)"); - queryDB(taos[0], "create table demo3.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taos[0], "create table if not exists demo1.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taos[0], "create table if not exists demo2.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taos[0], "create table if not exists demo3.stb (ts timestamp, c1 int) tags(t1 int)"); strcpy(qstr, "alter user root pass 'taos'"); queryDB(taos[0], qstr); @@ -326,9 +328,9 @@ void sysInfoTest(TAOS *taosRoot, const char *host, char *qstr) { queryDB(taosRoot, "create database if not exists demo12 vgroups 1 minrows 10"); queryDB(taosRoot, "create database if not exists demo13 vgroups 1 minrows 10"); - queryDB(taosRoot, "create table demo11.stb (ts timestamp, c1 int) tags(t1 int)"); - queryDB(taosRoot, "create table demo12.stb (ts timestamp, c1 int) tags(t1 int)"); - queryDB(taosRoot, "create table demo13.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taosRoot, "create table if not exists demo11.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taosRoot, "create table if not exists demo12.stb (ts timestamp, c1 int) tags(t1 int)"); + queryDB(taosRoot, "create table if not exists demo13.stb (ts timestamp, c1 int) tags(t1 int)"); sprintf(qstr, "show grants"); char output[BUF_LEN]; @@ -387,10 +389,14 @@ _REP: fprintf(stderr, ">>> succeed to run sysInfoTest\n"); fprintf(stderr, "######## %s #########\n", __func__); } - +static bool isDropUser = true; void userDroppedTest(TAOS *taos, const char *host, char *qstr) { // users int nTestUsers = nUser; + int nLoop = 0; +_loop: + ++nLoop; + printf("\n\n%s:%d LOOP %d, nTestUsers:%d\n", __func__, __LINE__, nLoop, nTestUsers); for (int i = 0; i < nTestUsers; ++i) { // sprintf(users[i], "user%d", i); taosu[i] = taos_connect(host, users[i], "taos", NULL, 0); @@ -426,7 +432,6 @@ void userDroppedTest(TAOS *taos, const char *host, char *qstr) { for (int i = 0; i < nTestUsers; ++i) { taos_close(taosu[i]); printf("%s:%d close taosu[%d]\n", __func__, __LINE__, i); - sleep(1); } fprintf(stderr, "######## %s #########\n", __func__); @@ -437,5 +442,32 @@ void userDroppedTest(TAOS *taos, const char *host, char *qstr) { exit(1); } fprintf(stderr, "######## %s #########\n", __func__); - // sleep(300); + + if (nLoop < 5) { + nUserDropped = 0; + for (int i = 0; i < nTestUsers; ++i) { + sprintf(users[i], "user%d", i); + sprintf(qstr, "CREATE USER %s PASS 'taos'", users[i]); + fprintf(stderr, "%s:%d create user:%s\n", __func__, __LINE__, users[i]); + queryDB(taos, qstr); + } + goto _loop; + } + isDropUser = false; +} + +void clearTestEnv(TAOS *taos, const char *host, char *qstr) { + fprintf(stderr, "######## %s start #########\n", __func__); + // restore password + sprintf(qstr, "alter user root pass 'taosdata'"); + queryDB(taos, qstr); + + if (isDropUser) { + for (int i = 0; i < nUser; ++i) { + sprintf(qstr, "drop user %s", users[i]); + queryDB(taos, qstr); + } + } + // sleep(3000); + fprintf(stderr, "######## %s end #########\n", __func__); } \ No newline at end of file diff --git a/tests/script/tsim/parser/alter.sim b/tests/script/tsim/parser/alter.sim index f2481576d1..99e014a011 100644 --- a/tests/script/tsim/parser/alter.sim +++ b/tests/script/tsim/parser/alter.sim @@ -17,7 +17,7 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db duration 10 keep 20,20,20 +sql create database $db duration 3 keep 20,20,20 sql use $db sql_error alter database $db keep "20" @@ -27,8 +27,8 @@ sql_error alter database $db keep 20.0 sql_error alter database $db keep 20.0,20.0,20.0 sql_error alter database $db keep 0,0,0 sql_error alter database $db keep -1,-1,-1 -sql_error alter database $db keep 9,20 -sql_error alter database $db keep 9,9,9 +sql_error alter database $db keep 8,20 +sql_error alter database $db keep 8,9,9 sql_error alter database $db keep 20,20,19 sql_error alter database $db keep 20,19,20 sql_error alter database $db keep 20,19,19 diff --git a/tests/script/tsim/parser/alter__for_community_version.sim b/tests/script/tsim/parser/alter__for_community_version.sim index 48fb2f8246..29c748d441 100644 --- a/tests/script/tsim/parser/alter__for_community_version.sim +++ b/tests/script/tsim/parser/alter__for_community_version.sim @@ -17,7 +17,7 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db duration 10 keep 20 +sql create database $db duration 3 keep 20 sql use $db sql select * from information_schema.ins_databases if $rows != 3 then @@ -36,7 +36,7 @@ sql_error alter database $db keep 0,0,0 sql_error alter database $db keep 3 sql_error alter database $db keep -1,-1,-1 sql alter database $db keep 20,20 -sql_error alter database $db keep 9,9,9 +sql_error alter database $db keep 8,9,9 sql_error alter database $db keep 20,20,19 sql_error alter database $db keep 20,19,20 sql_error alter database $db keep 20,19,19 diff --git a/tests/script/tsim/parser/create_db.sim b/tests/script/tsim/parser/create_db.sim index db25240262..a5722f9819 100644 --- a/tests/script/tsim/parser/create_db.sim +++ b/tests/script/tsim/parser/create_db.sim @@ -150,26 +150,26 @@ sql_error create database $db keep 12,11,12 sql_error create database $db keep 8 sql_error create database $db keep 12,11 sql_error create database $db keep 365001,365001,365001 -sql create database dbk0 keep 19 +sql create database dbk0 keep 39 sql select * from information_schema.ins_databases if $rows != 3 then return -1 endi -if $data27 != 27360m,27360m,27360m then +if $data27 != 56160m,56160m,56160m then return -1 endi sql drop database dbk0 -sql create database dbka keep 19,20 +sql create database dbka keep 39,40 sql select * from information_schema.ins_databases if $rows != 3 then return -1 endi -if $data27 != 27360m,28800m,28800m then +if $data27 != 56160m,57600m,57600m then return -1 endi sql drop database dbka -sql create database dbk1 keep 11,11,11 +sql create database dbk1 duration 3 keep 11,11,11 sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -178,7 +178,7 @@ if $data27 != 15840m,15840m,15840m then return -1 endi sql drop database dbk1 -sql create database dbk2 keep 11,12,13 +sql create database dbk2 duration 3 keep 11,12,13 sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -187,7 +187,7 @@ if $data27 != 15840m,17280m,18720m then return -1 endi sql drop database dbk2 -sql create database dbk3 keep 11,11,13 +sql create database dbk3 duration 3 keep 11,11,13 sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -196,7 +196,7 @@ if $data27 != 15840m,15840m,18720m then return -1 endi sql drop database dbk3 -sql create database dbk4 keep 11,13,13 +sql create database dbk4 duration 3 keep 11,13,13 sql select * from information_schema.ins_databases if $rows != 3 then return -1 diff --git a/tests/script/tsim/stream/basic4.sim b/tests/script/tsim/stream/basic4.sim index 29cbef3109..b4e3d62545 100644 --- a/tests/script/tsim/stream/basic4.sim +++ b/tests/script/tsim/stream/basic4.sim @@ -8,10 +8,12 @@ sleep 500 sql connect +print step1============= + sql create database test vgroups 1; sql use test; sql create table t1(ts timestamp, a int, b int , c int, d double); -sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1 from t1 interval(1s); +sql create stream streams0 trigger at_once ignore expired 0 ignore update 0 into streamt as select _wstart, count(*) c1 from t1 interval(1s); sql insert into t1 values(1648791211000,1,2,3,1.0); sql insert into t1 values(1648791212001,2,2,3,1.1); @@ -71,13 +73,13 @@ if $rows != 29 then goto loop1 endi - +print step2============= sql create database test2 vgroups 10; sql use test2; sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int); sql create table t1 using st tags(1,1,1); -sql create stream streams2 trigger at_once ignore expired 0 waterMark 200s into streamt2 as select _wstart, count(*) c1 from t1 interval(1s); +sql create stream streams2 trigger at_once ignore expired 0 ignore update 0 waterMark 200s into streamt2 as select _wstart, count(*) c1 from t1 interval(1s); sql insert into t1 values(1648791211000,1,2,3,1.0); sql insert into t1 values(1648791212001,2,2,3,1.1); @@ -137,4 +139,184 @@ if $rows != 29 then goto loop3 endi +print step3============= + +sql create database test1 vgroups 1; +sql use test1; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams1 trigger at_once ignore expired 0 ignore update 0 into streamt1 as select _wstart, count(*) c1 from t1 session(ts, 1s); + +sql insert into t1 values(1648791211000,1,2,3,1.0); +sql insert into t1 values(1648791213000,1,2,3,1.1); +sql insert into t1 values(1648791215000,1,2,3,1.1); +sql insert into t1 values(1648791217000,1,2,3,1.1); +sql insert into t1 values(1648791219000,1,2,3,1.1); +sql insert into t1 values(1648791221000,1,2,3,1.0); +sql insert into t1 values(1648791223000,1,2,3,1.0); +sql insert into t1 values(1648791225000,1,2,3,1.0); +sql insert into t1 values(1648791227000,1,2,3,1.0); +sql insert into t1 values(1648791229000,1,2,3,1.0); + +sql insert into t1 values(1648791231000,1,2,3,1.0); +sql insert into t1 values(1648791233000,1,2,3,1.1); +sql insert into t1 values(1648791235000,1,2,3,1.1); +sql insert into t1 values(1648791237000,1,2,3,1.1); +sql insert into t1 values(1648791239000,1,2,3,1.1); +sql insert into t1 values(1648791241000,1,2,3,1.0); +sql insert into t1 values(1648791243000,1,2,3,1.0); +sql insert into t1 values(1648791245000,1,2,3,1.0); +sql insert into t1 values(1648791247000,1,2,3,1.0); +sql insert into t1 values(1648791249000,1,2,3,1.0); + +sql insert into t1 values(1648791251000,1,2,3,1.0); +sql insert into t1 values(1648791253000,1,2,3,1.1); +sql insert into t1 values(1648791255000,1,2,3,1.1); +sql insert into t1 values(1648791257000,1,2,3,1.1); +sql insert into t1 values(1648791259000,1,2,3,1.1); +sql insert into t1 values(1648791261000,1,2,3,1.0); +sql insert into t1 values(1648791263000,1,2,3,1.0); +sql insert into t1 values(1648791265000,1,2,3,1.0); +sql insert into t1 values(1648791267000,1,2,3,1.0); +sql insert into t1 values(1648791269000,1,2,3,1.0); + +$loop_count = 0 + +loop4: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt1; +sql select * from streamt1; + +if $rows != 30 then + print =====rows=$rows + goto loop4 +endi + +sql insert into t1 values(1648791211001,1,2,3,1.0); +sql insert into t1 values(1648791213001,1,2,3,1.1); +sql insert into t1 values(1648791215001,1,2,3,1.1); +sql insert into t1 values(1648791217001,1,2,3,1.1); +sql insert into t1 values(1648791219001,1,2,3,1.1); +sql insert into t1 values(1648791221001,1,2,3,1.0); +sql insert into t1 values(1648791223001,1,2,3,1.0); +sql insert into t1 values(1648791225001,1,2,3,1.0); +sql insert into t1 values(1648791227001,1,2,3,1.0); +sql insert into t1 values(1648791229001,1,2,3,1.0); + +$loop_count = 0 + +loop5: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt1; +sql select * from streamt1; + +if $rows != 30 then + print =====rows=$rows + goto loop5 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop5 +endi + +if $data91 != 2 then + print =====data91=$data91 + goto loop5 +endi + +sql insert into t1 values(1648791231001,1,2,3,1.0); +sql insert into t1 values(1648791233001,1,2,3,1.1); +sql insert into t1 values(1648791235001,1,2,3,1.1); +sql insert into t1 values(1648791237001,1,2,3,1.1); +sql insert into t1 values(1648791239001,1,2,3,1.1); +sql insert into t1 values(1648791241001,1,2,3,1.0); +sql insert into t1 values(1648791243001,1,2,3,1.0); +sql insert into t1 values(1648791245001,1,2,3,1.0); +sql insert into t1 values(1648791247001,1,2,3,1.0); +sql insert into t1 values(1648791249001,1,2,3,1.0); + +$loop_count = 0 + +loop6: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt1; +sql select * from streamt1; + +if $rows != 30 then + print =====rows=$rows + goto loop6 +endi + +if $data[10][1] != 2 then + print =====data[10][1]=$data[10][1] + goto loop6 +endi + +if $data[19][1] != 2 then + print =====data[19][1]=$data[19][1] + goto loop6 +endi + +sql insert into t1 values(1648791251001,1,2,3,1.0); +sql insert into t1 values(1648791253001,1,2,3,1.1); +sql insert into t1 values(1648791255001,1,2,3,1.1); +sql insert into t1 values(1648791257001,1,2,3,1.1); +sql insert into t1 values(1648791259001,1,2,3,1.1); +sql insert into t1 values(1648791261001,1,2,3,1.0); +sql insert into t1 values(1648791263001,1,2,3,1.0); +sql insert into t1 values(1648791265001,1,2,3,1.0); +sql insert into t1 values(1648791267001,1,2,3,1.0); +sql insert into t1 values(1648791269001,1,2,3,1.0); + +$loop_count = 0 + +loop7: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt1; +sql select * from streamt1; + +if $rows != 30 then + print =====rows=$rows + goto loop7 +endi + +if $data[20][1] != 2 then + print =====[20][1]=$[20][1] + goto loop7 +endi + +if $data[29][1] != 2 then + print =====[29][1]=$[29][1] + goto loop7 +endi + + system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/stream/basic5.sim b/tests/script/tsim/stream/basic5.sim new file mode 100644 index 0000000000..583c803e4e --- /dev/null +++ b/tests/script/tsim/stream/basic5.sim @@ -0,0 +1,217 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 135 +system sh/cfg.sh -n dnode1 -c streamBufferSize -v 10 +system sh/exec.sh -n dnode1 -s start + +sleep 500 + +sql connect + +print step1============= + +sql create database test3 vgroups 1; +sql use test3; +sql create table t1(ts timestamp, a int, b int , c int, d double); +sql create stream streams3 trigger at_once ignore expired 0 ignore update 0 into streamt3 as select _wstart, count(*) c1 from t1 state_window(a); + +sql insert into t1 values(1648791211000,1,2,3,1.0); +sql insert into t1 values(1648791213000,2,2,3,1.1); +sql insert into t1 values(1648791215000,3,2,3,1.1); +sql insert into t1 values(1648791217000,4,2,3,1.1); +sql insert into t1 values(1648791219000,5,2,3,1.1); +sql insert into t1 values(1648791221000,6,2,3,1.0); +sql insert into t1 values(1648791223000,7,2,3,1.0); +sql insert into t1 values(1648791225000,8,2,3,1.0); +sql insert into t1 values(1648791227000,9,2,3,1.0); +sql insert into t1 values(1648791229000,10,2,3,1.0); + +sql insert into t1 values(1648791231000,11,2,3,1.0); +sql insert into t1 values(1648791233000,12,2,3,1.1); +sql insert into t1 values(1648791235000,13,2,3,1.1); +sql insert into t1 values(1648791237000,14,2,3,1.1); +sql insert into t1 values(1648791239000,15,2,3,1.1); +sql insert into t1 values(1648791241000,16,2,3,1.0); +sql insert into t1 values(1648791243000,17,2,3,1.0); +sql insert into t1 values(1648791245000,18,2,3,1.0); +sql insert into t1 values(1648791247000,19,2,3,1.0); +sql insert into t1 values(1648791249000,20,2,3,1.0); + +sql insert into t1 values(1648791251000,21,2,3,1.0); +sql insert into t1 values(1648791253000,22,2,3,1.1); +sql insert into t1 values(1648791255000,23,2,3,1.1); +sql insert into t1 values(1648791257000,24,2,3,1.1); +sql insert into t1 values(1648791259000,25,2,3,1.1); +sql insert into t1 values(1648791261000,26,2,3,1.0); +sql insert into t1 values(1648791263000,27,2,3,1.0); +sql insert into t1 values(1648791265000,28,2,3,1.0); +sql insert into t1 values(1648791267000,29,2,3,1.0); +sql insert into t1 values(1648791269000,30,2,3,1.0); + +$loop_count = 0 + +loop8: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt3; +sql select * from streamt3; + +if $rows != 30 then + print =====rows=$rows + goto loop8 +endi + +sql insert into t1 values(1648791211001,1,2,3,1.0); +sql insert into t1 values(1648791213001,2,2,3,1.1); +sql insert into t1 values(1648791215001,3,2,3,1.1); +sql insert into t1 values(1648791217001,4,2,3,1.1); +sql insert into t1 values(1648791219001,5,2,3,1.1); +sql insert into t1 values(1648791221001,6,2,3,1.0); +sql insert into t1 values(1648791223001,7,2,3,1.0); +sql insert into t1 values(1648791225001,8,2,3,1.0); +sql insert into t1 values(1648791227001,9,2,3,1.0); +sql insert into t1 values(1648791229001,10,2,3,1.0); + +$loop_count = 0 + +loop9: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt3; +sql select * from streamt3; + +if $rows != 30 then + print =====rows=$rows + goto loop9 +endi + +if $data01 != 2 then + print =====data01=$data01 + goto loop9 +endi + +if $data91 != 2 then + print =====data91=$data91 + goto loop9 +endi + +sql insert into t1 values(1648791231001,11,2,3,1.0); +sql insert into t1 values(1648791233001,12,2,3,1.1); +sql insert into t1 values(1648791235001,13,2,3,1.1); +sql insert into t1 values(1648791237001,14,2,3,1.1); +sql insert into t1 values(1648791239001,15,2,3,1.1); +sql insert into t1 values(1648791241001,16,2,3,1.0); +sql insert into t1 values(1648791243001,17,2,3,1.0); +sql insert into t1 values(1648791245001,18,2,3,1.0); +sql insert into t1 values(1648791247001,19,2,3,1.0); +sql insert into t1 values(1648791249001,20,2,3,1.0); + +$loop_count = 0 + +loop10: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt3; +sql select * from streamt3; + +if $rows != 30 then + print =====rows=$rows + goto loop10 +endi + +if $data[10][1] != 2 then + print =====data[10][1]=$data[10][1] + goto loop10 +endi + +if $data[19][1] != 2 then + print =====data[19][1]=$data[19][1] + goto loop10 +endi + +sql insert into t1 values(1648791251001,21,2,3,1.0); +sql insert into t1 values(1648791253001,22,2,3,1.1); +sql insert into t1 values(1648791255001,23,2,3,1.1); +sql insert into t1 values(1648791257001,24,2,3,1.1); + +#/////////////////////// +$loop_count = 0 + +loop11: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt3; +sql select * from streamt3; + +if $rows != 30 then + print =====rows=$rows + goto loop11 +endi + +if $data[20][1] != 2 then + print =====[20][1]=$[20][1] + goto loop11 +endi +#/////////////////////// + +sql insert into t1 values(1648791259001,25,2,3,1.1); +sql insert into t1 values(1648791261001,26,2,3,1.0); +sql insert into t1 values(1648791263001,27,2,3,1.0); +sql insert into t1 values(1648791265001,28,2,3,1.0); +sql insert into t1 values(1648791267001,29,2,3,1.0); +sql insert into t1 values(1648791269001,30,2,3,1.0); + +$loop_count = 0 + +loop11: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +print 1 select * from streamt3; +sql select * from streamt3; + +if $rows != 30 then + print =====rows=$rows + goto loop11 +endi + +if $data[20][1] != 2 then + print =====[20][1]=$[20][1] + goto loop11 +endi + +if $data[29][1] != 2 then + print =====[29][1]=$[29][1] + goto loop11 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/stream/session1.sim b/tests/script/tsim/stream/session1.sim index 3be604a828..cf42159d84 100644 --- a/tests/script/tsim/stream/session1.sim +++ b/tests/script/tsim/stream/session1.sim @@ -132,85 +132,85 @@ sql select * from streamt order by s desc; # row 0 if $data01 != 2 then - print ======$data01 + print =====data01=$data01 goto loop2 endi if $data02 != 29 then - print ======$data02 + print =====data02=$data02 goto loop2 endi if $data03 != 7 then - print ======$data03 + print =====data03=$data03 goto loop2 endi if $data04 != 22 then - print ======$data04 + print =====data04=$data04 goto loop2 endi # row 1 if $data11 != 3 then - print ======$data11 + print =====data11=$data11 goto loop2 endi if $data12 != 33 then - print ======$data12 + print =====data12=$data12 goto loop2 endi if $data13 != 8 then - print ======$data13 + print =====data13=$data13 goto loop2 endi if $data14 != 21 then - print ======$data14 + print =====data14=$data14 goto loop2 endi # row 2 if $data21 != 4 then - print ======$data21 + print =====data21=$data21 goto loop2 endi if $data22 != 25 then - print ======$data22 + print =====data22=$data22 goto loop2 endi if $data23 != 2 then - print ======$data23 + print =====data23=$data23 goto loop2 endi if $data24 != 20 then - print ======$data24 + print =====data24=$data24 goto loop2 endi # row 3 if $data31 != 10 then - print ======$data31 + print =====data31=$data31 goto loop2 endi if $data32 != 54 then - print ======$data32 + print =====data32=$data32 goto loop2 endi if $data33 != 1 then - print ======$data33 + print =====data33=$data33 goto loop2 endi if $data34 != 19 then - print ======$data34 + print =====data34=$data34 goto loop2 endi diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 7f4b291776..eaea4e18b2 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -242,7 +242,7 @@ class TDTestCase: self.str510 = self.str255 + self.str255 tdSql.error('alter dnode 1 "activeCode" "a"') tdSql.error('alter dnode 1 "activeCode" "' + self.str107 + '"') - # tdSql.error('alter all dnodes "activeCode" "' + self.str108 + '"') + tdSql.error('alter all dnodes "activeCode" "' + self.str108 + '"') tdSql.error('alter dnode 1 "activeCode" "' + self.str109 + '"') tdSql.error('alter all dnodes "activeCode" "' + self.str510 + '"') tdSql.query(f'select * from information_schema.ins_dnodes') @@ -257,12 +257,12 @@ class TDTestCase: tdSql.error('alter all dnodes "cActiveCode" "' + self.str255 + '"') tdSql.error('alter all dnodes "cActiveCode" "' + self.str256 + '"') tdSql.error('alter all dnodes "cActiveCode" "' + self.str257 + '"') - # tdSql.error('alter all dnodes "cActiveCode" "' + self.str254 + '"') + tdSql.error('alter all dnodes "cActiveCode" "' + self.str254 + '"') tdSql.error('alter dnode 1 "cActiveCode" "' + self.str510 + '"') tdSql.query(f'select active_code,c_active_code from information_schema.ins_dnodes') tdSql.checkEqual(tdSql.queryResult[0][0],"") tdSql.checkEqual(tdSql.queryResult[0][1],"") - # tdSql.error('alter dnode 1 "cActiveCode" "' + self.str109 + '"') + tdSql.error('alter dnode 1 "cActiveCode" "' + self.str109 + '"') tdSql.query(f'show dnodes') tdSql.checkEqual(tdSql.queryResult[0][9],"") tdSql.execute('alter all dnodes "cActiveCode" ""') diff --git a/tests/system-test/0-others/multilevel.py b/tests/system-test/0-others/multilevel.py index f086dcb735..66434fff67 100644 --- a/tests/system-test/0-others/multilevel.py +++ b/tests/system-test/0-others/multilevel.py @@ -100,7 +100,7 @@ class TDTestCase: tdDnodes.deploy(1,cfg) tdDnodes.start(1) - tdSql.execute("create database test duration 1") + tdSql.execute("create database test duration 8h") tdSql.execute("use test") tdSql.execute("create table stb(ts timestamp, c int) tags(t int)") @@ -117,7 +117,7 @@ class TDTestCase: tdLog.info("================= step3") tdSql.execute('drop database test') for i in range(10): - tdSql.execute("create database test%d duration 1" %(i)) + tdSql.execute("create database test%d duration 8h" %(i)) tdSql.execute("use test%d" %(i)) tdSql.execute("create table tb (ts timestamp,i int)") for j in range(10): @@ -216,7 +216,7 @@ class TDTestCase: tdDnodes.deploy(1,cfg) tdDnodes.start(1) - tdSql.execute('create database dbtest') + tdSql.execute('create database dbtest duration 3') tdSql.execute('use dbtest') tdSql.execute('create table stb (ts timestamp,c0 int) tags(t0 int)') tdSql.execute('create table tb1 using stb tags(1)') diff --git a/tests/system-test/0-others/splitVGroupRep1.py b/tests/system-test/0-others/splitVGroupRep1.py new file mode 100644 index 0000000000..b119ba0a32 --- /dev/null +++ b/tests/system-test/0-others/splitVGroupRep1.py @@ -0,0 +1,440 @@ +################################################################### +# 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 sys +import random +import time +import copy +import string + +import taos +from util.log import * +from util.cases import * +from util.sql import * + +class TDTestCase: + + # random string + def random_string(self, count): + letters = string.ascii_letters + return ''.join(random.choice(letters) for i in range(count)) + + # get col value and total max min ... + def getColsValue(self, i, j): + # c1 value + if random.randint(1, 10) == 5: + c1 = None + else: + c1 = 1 + + # c2 value + if j % 3200 == 0: + c2 = 8764231 + elif random.randint(1, 10) == 5: + c2 = None + else: + c2 = random.randint(-87654297, 98765321) + + + value = f"({self.ts}, " + + # c1 + if c1 is None: + value += "null," + else: + self.c1Cnt += 1 + value += f"{c1}," + # c2 + if c2 is None: + value += "null," + else: + value += f"{c2}," + # total count + self.c2Cnt += 1 + # max + if self.c2Max is None: + self.c2Max = c2 + else: + if c2 > self.c2Max: + self.c2Max = c2 + # min + if self.c2Min is None: + self.c2Min = c2 + else: + if c2 < self.c2Min: + self.c2Min = c2 + # sum + if self.c2Sum is None: + self.c2Sum = c2 + else: + self.c2Sum += c2 + + # c3 same with ts + value += f"{self.ts})" + + # move next + self.ts += 1 + + return value + + # insert data + def insertData(self): + tdLog.info("insert data ....") + sqls = "" + for i in range(self.childCnt): + # insert child table + values = "" + pre_insert = f"insert into @db_name.t{i} values " + for j in range(self.childRow): + if values == "": + values = self.getColsValue(i, j) + else: + values += "," + self.getColsValue(i, j) + + # batch insert + if j % self.batchSize == 0 and values != "": + sql = pre_insert + values + self.exeDouble(sql) + values = "" + # append last + if values != "": + sql = pre_insert + values + self.exeDouble(sql) + values = "" + + # insert nomal talbe + for i in range(20): + self.ts += 1000 + name = self.random_string(20) + sql = f"insert into @db_name.ta values({self.ts}, {i}, {self.ts%100000}, '{name}', false)" + self.exeDouble(sql) + + # insert finished + tdLog.info(f"insert data successfully.\n" + f" inserted child table = {self.childCnt}\n" + f" inserted child rows = {self.childRow}\n" + f" total inserted rows = {self.childCnt*self.childRow}\n") + return + + def exeDouble(self, sql): + # dbname replace + sql1 = sql.replace("@db_name", self.db1) + + if len(sql1) > 100: + tdLog.info(sql1[:100]) + else: + tdLog.info(sql1) + tdSql.execute(sql1) + + sql2 = sql.replace("@db_name", self.db2) + if len(sql2) > 100: + tdLog.info(sql2[:100]) + else: + tdLog.info(sql2) + tdSql.execute(sql2) + + + # prepareEnv + def prepareEnv(self): + # init + self.ts = 1680000000000 + self.childCnt = 4 + self.childRow = 10000 + self.batchSize = 50000 + self.vgroups1 = 1 + self.vgroups2 = 1 + self.db1 = "db1" + self.db2 = "db2" + + # total + self.c1Cnt = 0 + self.c2Cnt = 0 + self.c2Max = None + self.c2Min = None + self.c2Sum = None + + # create database db + sql = f"create database @db_name vgroups {self.vgroups1} replica 1" + self.exeDouble(sql) + + # create super talbe st + sql = f"create table @db_name.st(ts timestamp, c1 int, c2 bigint, ts1 timestamp) tags(area int)" + self.exeDouble(sql) + + # create child table + for i in range(self.childCnt): + sql = f"create table @db_name.t{i} using @db_name.st tags({i}) " + self.exeDouble(sql) + + # create normal table + sql = f"create table @db_name.ta(ts timestamp, c1 int, c2 bigint, c3 binary(32), c4 bool)" + self.exeDouble(sql) + + # insert data + self.insertData() + + # update + self.ts = 1680000000000 + 20000 + self.childRow = 1000 + + + # delete data + sql = "delete from @db_name.st where ts > 1680000019000 and ts < 1680000062000" + self.exeDouble(sql) + sql = "delete from @db_name.st where ts > 1680000099000 and ts < 1680000170000" + self.exeDouble(sql) + + # check data correct + def checkExpect(self, sql, expectVal): + tdSql.query(sql) + rowCnt = tdSql.getRows() + for i in range(rowCnt): + val = tdSql.getData(i,0) + if val != expectVal: + tdLog.exit(f"Not expect . query={val} expect={expectVal} i={i} sql={sql}") + return False + + tdLog.info(f"check expect ok. sql={sql} expect ={expectVal} rowCnt={rowCnt}") + return True + + # init + def init(self, conn, logSql, replicaVar=1): + seed = time.time() % 10000 + random.seed(seed) + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), True) + + # check query result same + def queryDouble(self, sql): + # sql + sql1 = sql.replace('@db_name', self.db1) + tdLog.info(sql1) + start1 = time.time() + rows1 = tdSql.query(sql1) + spend1 = time.time() - start1 + res1 = copy.copy(tdSql.queryResult) + + sql2 = sql.replace('@db_name', self.db2) + tdLog.info(sql2) + start2 = time.time() + tdSql.query(sql2) + spend2 = time.time() - start2 + res2 = tdSql.queryResult + + rowlen1 = len(res1) + rowlen2 = len(res2) + + if rowlen1 != rowlen2: + tdLog.exit(f"both row count not equal. rowlen1={rowlen1} rowlen2={rowlen2} ") + return False + + for i in range(rowlen1): + row1 = res1[i] + row2 = res2[i] + collen1 = len(row1) + collen2 = len(row2) + if collen1 != collen2: + tdLog.exit(f"both col count not equal. collen1={collen1} collen2={collen2}") + return False + for j in range(collen1): + if row1[j] != row2[j]: + tdLog.exit(f"both col not equal. row={i} col={j} col1={row1[j]} col2={row2[j]} .") + return False + + # warning performance + diff = (spend2 - spend1)*100/spend1 + tdLog.info("spend1=%.6fs spend2=%.6fs diff=%.1f%%"%(spend1, spend2, diff)) + if spend2 > spend1 and diff > 20: + tdLog.info("warning: the diff for performance after spliting is over 20%") + + return True + + + # check result + def checkResult(self): + # check vgroupid + sql = f"select vgroup_id from information_schema.ins_vgroups where db_name='{self.db2}'" + tdSql.query(sql) + tdSql.checkRows(self.vgroups2) + + # check child table count same + sql = "select table_name from information_schema.ins_tables where db_name='@db_name' order by table_name" + self.queryDouble(sql) + + # check row value is ok + sql = "select * from @db_name.st order by ts" + self.queryDouble(sql) + + # where + sql = "select *,tbname from @db_name.st where c1 < 1000 order by ts" + self.queryDouble(sql) + + # max + sql = "select max(c1) from @db_name.st" + self.queryDouble(sql) + + # min + sql = "select min(c2) from @db_name.st" + self.queryDouble(sql) + + # sum + sql = "select sum(c1) from @db_name.st" + self.queryDouble(sql) + + # normal table + + # count + sql = "select count(*) from @db_name.ta" + self.queryDouble(sql) + + # all rows + sql = "select * from @db_name.ta" + self.queryDouble(sql) + + # sum + sql = "select sum(c1) from @db_name.ta" + self.queryDouble(sql) + + + # get vgroup list + def getVGroup(self, db_name): + vgidList = [] + sql = f"select vgroup_id from information_schema.ins_vgroups where db_name='{db_name}'" + res = tdSql.getResult(sql) + rows = len(res) + for i in range(rows): + vgidList.append(res[i][0]) + + return vgidList; + + # split vgroup on db2 + def splitVGroup(self, db_name): + vgids = self.getVGroup(db_name) + selid = random.choice(vgids) + sql = f"split vgroup {selid}" + tdLog.info(sql) + tdSql.execute(sql) + + # wait end + seconds = 300 + for i in range(seconds): + sql ="show transactions;" + rows = tdSql.query(sql) + if rows == 0: + tdLog.info("split vgroup finished.") + return True + #tdLog.info(f"i={i} wait split vgroup ...") + time.sleep(1) + + tdLog.exit(f"split vgroup transaction is not finished after executing {seconds}s") + return False + + # split error + def expectSplitError(self, dbName): + vgids = self.getVGroup(dbName) + selid = random.choice(vgids) + sql = f"split vgroup {selid}" + tdLog.info(sql) + tdSql.error(sql) + + # expect split ok + def expectSplitOk(self, dbName): + # split vgroup + vgList1 = self.getVGroup(dbName) + self.splitVGroup(dbName) + vgList2 = self.getVGroup(dbName) + vgNum1 = len(vgList1) + 1 + vgNum2 = len(vgList2) + if vgNum1 != vgNum2: + tdLog.exit(f" vglist len={vgNum1} is not same for expect {vgNum2}") + return + + # split empty database + def splitEmptyDB(self): + dbName = "emptydb" + vgNum = 2 + # create database + sql = f"create database {dbName} vgroups {vgNum} replica 1" + tdLog.info(sql) + tdSql.execute(sql) + + # split vgroup + self.expectSplitOk(dbName) + + + # forbid + def checkForbid(self): + # stream + tdLog.info("check forbid split having stream...") + tdSql.execute("create database streamdb;") + tdSql.execute("use streamdb;") + tdSql.execute("create table ta(ts timestamp, age int);") + tdSql.execute("create stream ma into sta as select count(*) from ta interval(1s);") + self.expectSplitError("streamdb") + tdSql.execute("drop stream ma;") + self.expectSplitOk("streamdb") + + # topic + tdLog.info("check forbid split having topic...") + tdSql.execute("create database topicdb wal_retention_period 10;") + tdSql.execute("use topicdb;") + tdSql.execute("create table ta(ts timestamp, age int);") + tdSql.execute("create topic toa as select * from ta;") + + #self.expectSplitError("topicdb") + tdSql.execute("drop topic toa;") + self.expectSplitOk("topicdb") + + # compact and check db2 + def compactAndCheck(self): + tdLog.info("compact db2 and check result ...") + # compact + tdSql.execute(f"compact database {self.db2};") + # check result + self.checkResult() + + # run + def run(self): + # prepare env + self.prepareEnv() + + for i in range(3): + # split vgroup on db2 + start = time.time() + self.splitVGroup(self.db2) + end = time.time() + self.vgroups2 += 1 + + # check two db query result same + self.checkResult() + spend = "%.3f"%(end-start) + tdLog.info(f"split vgroup i={i} passed. spend = {spend}s") + + # split empty db + self.splitEmptyDB() + + # check topic and stream forib + self.checkForbid() + + # compact database + self.compactAndCheck() + + # stop + 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/0-others/splitVGroup.py b/tests/system-test/0-others/splitVGroupRep3.py similarity index 93% rename from tests/system-test/0-others/splitVGroup.py rename to tests/system-test/0-others/splitVGroupRep3.py index ed80505ce2..68c915eeaf 100644 --- a/tests/system-test/0-others/splitVGroup.py +++ b/tests/system-test/0-others/splitVGroupRep3.py @@ -137,10 +137,10 @@ class TDTestCase: tdSql.execute(sql1) sql2 = sql.replace("@db_name", self.db2) - if len(sql1) > 100: - tdLog.info(sql1[:100]) + if len(sql2) > 100: + tdLog.info(sql2[:100]) else: - tdLog.info(sql1) + tdLog.info(sql2) tdSql.execute(sql2) @@ -151,8 +151,8 @@ class TDTestCase: self.childCnt = 10 self.childRow = 10000 self.batchSize = 5000 - self.vgroups1 = 4 - self.vgroups2 = 4 + self.vgroups1 = 2 + self.vgroups2 = 2 self.db1 = "db1" self.db2 = "db2" @@ -183,6 +183,16 @@ class TDTestCase: # insert data self.insertData() + # update + self.ts = 1680000000000 + 10000 + self.childRow = 2000 + + # delete data + sql = "delete from @db_name.st where ts > 1680000001900 and ts < 1680000012000" + self.exeDouble(sql) + sql = "delete from @db_name.st where ts > 1680000029000 and ts < 1680000048000" + self.exeDouble(sql) + # check data correct def checkExpect(self, sql, expectVal): tdSql.query(sql) @@ -225,7 +235,7 @@ class TDTestCase: rowlen2 = len(res2) if rowlen1 != rowlen2: - tdLog.exit(f"rowlen1={rowlen1} rowlen2={rowlen2} both not equal.") + tdLog.exit(f"both row count not equal. rowlen1={rowlen1} rowlen2={rowlen2} ") return False for i in range(rowlen1): @@ -234,11 +244,11 @@ class TDTestCase: collen1 = len(row1) collen2 = len(row2) if collen1 != collen2: - tdLog.exit(f"collen1={collen1} collen2={collen2} both not equal.") + tdLog.exit(f"both col count not equal. collen1={collen1} collen2={collen2}") return False for j in range(collen1): if row1[j] != row2[j]: - tdLog.exit(f"col={j} col1={row1[j]} col2={row2[j]} both col not equal.") + tdLog.exit(f"both col not equal. row={i} col={j} col1={row1[j]} col2={row2[j]} .") return False # warning performance @@ -354,7 +364,7 @@ class TDTestCase: dbName = "emptydb" vgNum = 2 # create database - sql = f"create database {dbName} vgroups {vgNum}" + sql = f"create database {dbName} vgroups {vgNum} replica 3" tdLog.info(sql) tdSql.execute(sql) @@ -380,7 +390,7 @@ class TDTestCase: tdSql.execute("use topicdb;") tdSql.execute("create table ta(ts timestamp, age int);") tdSql.execute("create topic toa as select * from ta;") - self.expectSplitError("topicdb") + #self.expectSplitError("topicdb") tdSql.execute("drop topic toa;") self.expectSplitOk("topicdb") @@ -397,7 +407,7 @@ class TDTestCase: # prepare env self.prepareEnv() - for i in range(5): + for i in range(2): # split vgroup on db2 start = time.time() self.splitVGroup(self.db2) diff --git a/tests/system-test/1-insert/keep_expired.py b/tests/system-test/1-insert/keep_expired.py index 0cb6d841ed..4c8be55be5 100644 --- a/tests/system-test/1-insert/keep_expired.py +++ b/tests/system-test/1-insert/keep_expired.py @@ -15,7 +15,7 @@ class TDTestCase: self.stbname = "stb" self.ctbname = "ctb" self.keep_value = "2d,2d,2d" - self.duration_value = "1d" + self.duration_value = "16h" self.offset_time = 5 self.sleep_time = self.offset_time*2 diff --git a/tests/system-test/2-query/partition_by_col.py b/tests/system-test/2-query/partition_by_col.py index 1a394649d6..230b7582d9 100644 --- a/tests/system-test/2-query/partition_by_col.py +++ b/tests/system-test/2-query/partition_by_col.py @@ -141,12 +141,12 @@ class TDTestCase: def test_sort_for_partition_hint(self): sql = 'select count(*), c1 from meters partition by c1' sql_hint = 'select /*+ sort_for_group() */count(*), c1 from meters partition by c1' - self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) + #self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) self.check_explain_res_has_row("Sort", self.explain_sql(sql_hint)) sql = 'select count(*), c1, tbname from meters partition by tbname, c1' sql_hint = 'select /*+ sort_for_group() */ count(*), c1, tbname from meters partition by tbname, c1' - self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) + #self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) self.check_explain_res_has_row("Sort", self.explain_sql(sql_hint)) sql = 'select count(*), c1, tbname from meters partition by tbname, c1 interval(1s)' @@ -156,7 +156,7 @@ class TDTestCase: sql = 'select count(*), c1, t1 from meters partition by t1, c1' sql_hint = 'select /*+ sort_for_group() */ count(*), c1, t1 from meters partition by t1, c1' - self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) + #self.check_explain_res_has_row("Partition on", self.explain_sql(sql)) self.check_explain_res_has_row("Sort", self.explain_sql(sql_hint)) sql = 'select count(*), c1, t1 from meters partition by t1, c1 interval(1s)' @@ -208,7 +208,7 @@ class TDTestCase: sql_hint = self.add_order_by(self.add_hint(sql), order_by, select_list) sql = self.add_order_by(sql, order_by, select_list) self.check_explain_res_has_row("Sort", self.explain_sql(sql_hint)) - self.check_explain_res_has_row("Partition", self.explain_sql(sql)) + #self.check_explain_res_has_row("Partition", self.explain_sql(sql)) self.query_and_compare_res(sql, sql_hint, compare_what=compare_what) def test_sort_for_partition_res(self): diff --git a/tests/system-test/2-query/partition_by_col_agg.py b/tests/system-test/2-query/partition_by_col_agg.py index c522eb1e2b..011415867b 100644 --- a/tests/system-test/2-query/partition_by_col_agg.py +++ b/tests/system-test/2-query/partition_by_col_agg.py @@ -137,6 +137,10 @@ class TDTestCase: if not plan_found: tdLog.exit("plan: %s not found in res: [%s]" % (plan_str_expect, str(rows))) + def check_explain_res_no_row(self, plan_str_not_expect: str, res): + for row in res: + if str(row).find(plan_str_not_expect) >= 0: + tdLog.exit('plan: [%s] found in: [%s]' % (plan_str_not_expect, str(row))) def test_sort_for_partition_hint(self): pass @@ -146,6 +150,9 @@ class TDTestCase: def add_hint(self, sql: str) -> str: return "select /*+ sort_for_group() */ %s" % sql[6:] + + def add_remove_partition_hint(self, sql: str) -> str: + return "select /*+ remove_partition() */ %s" % sql[6:] def query_with_time(self, sql): start = datetime.now() @@ -200,8 +207,8 @@ class TDTestCase: def check_explain(self, sql): sql_hint = self.add_hint(sql) explain_res = self.explain_sql(sql) - self.check_explain_res_has_row('SortMerge', explain_res) - self.check_explain_res_has_row("blocking=0", explain_res) + #self.check_explain_res_has_row('SortMerge', explain_res) + #self.check_explain_res_has_row("blocking=0", explain_res) explain_res = self.explain_sql(sql_hint) self.check_explain_res_has_row('SortMerge', explain_res) self.check_explain_res_has_row('blocking=0', explain_res) @@ -233,14 +240,27 @@ class TDTestCase: sql_hint = self.add_hint(sql) sql = self.add_order_by(sql, ele[3]) sql_no_slimit = sql_template % (ele[0], ele[1], '') + sql_no_slimit = self.add_order_by(sql_no_slimit, ele[3]) self.query_and_compare_first_rows(sql_hint, sql_no_slimit) + def test_remove_partition(self): + sql = 'select c1, count(*) from meters partition by c1 slimit 10' + explain_res = self.explain_sql(sql) + self.check_explain_res_no_row("Partition", explain_res) + self.check_explain_res_has_row("blocking=1", explain_res) + + sql = 'select c1, count(*) from meters partition by c1,c2 slimit 10' + explain_res = self.explain_sql(sql) + self.check_explain_res_no_row("Partition", explain_res) + self.check_explain_res_has_row("blocking=1", explain_res) + def run(self): self.prepareTestEnv() #time.sleep(99999999) self.test_pipelined_agg_plan_with_slimit() self.test_pipelined_agg_data_with_slimit() + self.test_remove_partition() def stop(self): tdSql.close() diff --git a/tests/system-test/3-enterprise/restore/restoreBasic.py b/tests/system-test/3-enterprise/restore/restoreBasic.py index 485f896f05..77fa606b9c 100644 --- a/tests/system-test/3-enterprise/restore/restoreBasic.py +++ b/tests/system-test/3-enterprise/restore/restoreBasic.py @@ -107,8 +107,8 @@ class RestoreBasic: status = True break else: - time.sleep(0.5) - tdLog.info(f"sleep 500ms retry {i} to check status again...") + time.sleep(1) + tdLog.info(f"sleep 1s retry {i} to check status again...") if status == False: tdLog.exit("check vgroups status failed, exit.")