diff --git a/cmake/cmake.version b/cmake/cmake.version
index 156e99bd03..44ac989200 100644
--- a/cmake/cmake.version
+++ b/cmake/cmake.version
@@ -2,7 +2,7 @@
IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER})
ELSE ()
- SET(TD_VER_NUMBER "3.3.1.0.alpha")
+ SET(TD_VER_NUMBER "3.3.2.0.alpha")
ENDIF ()
IF (DEFINED VERCOMPATIBLE)
diff --git a/cmake/libuv_CMakeLists.txt.in b/cmake/libuv_CMakeLists.txt.in
index 9c48ddefef..673c771fb0 100644
--- a/cmake/libuv_CMakeLists.txt.in
+++ b/cmake/libuv_CMakeLists.txt.in
@@ -2,7 +2,7 @@
# libuv
ExternalProject_Add(libuv
GIT_REPOSITORY https://github.com/libuv/libuv.git
- GIT_TAG v1.44.2
+ GIT_TAG v1.48.0
SOURCE_DIR "${TD_CONTRIB_DIR}/libuv"
BINARY_DIR "${TD_CONTRIB_DIR}/libuv"
CONFIGURE_COMMAND ""
diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in
index 9bbda8309f..9a6a5329ae 100644
--- a/cmake/taostools_CMakeLists.txt.in
+++ b/cmake/taostools_CMakeLists.txt.in
@@ -2,7 +2,7 @@
# taos-tools
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
- GIT_TAG main
+ GIT_TAG 3.0
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
diff --git a/docs/en/12-taos-sql/14-stream.md b/docs/en/12-taos-sql/14-stream.md
index e7cefc1d7a..fcd782b429 100644
--- a/docs/en/12-taos-sql/14-stream.md
+++ b/docs/en/12-taos-sql/14-stream.md
@@ -47,7 +47,7 @@ window_clause: {
}
```
-`SESSION` indicates a session window, and `tol_val` indicates the maximum range of the time interval. If the time interval between two continuous rows are within the time interval specified by `tol_val` they belong to the same session window; otherwise a new session window is started automatically.
+`SESSION` indicates a session window, and `tol_val` indicates the maximum range of the time interval. If the time interval between two continuous rows are within the time interval specified by `tol_val` they belong to the same session window; otherwise a new session window is started automatically.The `_wend` of this window is the time of the last data plus `tol_val`.
`EVENT_WINDOW` is determined according to the window start condition and the window close condition. The window is started when `start_trigger_condition` is evaluated to true, the window is closed when `end_trigger_condition` is evaluated to true. `start_trigger_condition` and `end_trigger_condition` can be any conditional expressions supported by TDengine and can include multiple columns.
diff --git a/docs/en/14-reference/12-config/index.md b/docs/en/14-reference/12-config/index.md
index 5e4eadcceb..f50551b5de 100755
--- a/docs/en/14-reference/12-config/index.md
+++ b/docs/en/14-reference/12-config/index.md
@@ -432,7 +432,7 @@ The charset that takes effect is UTF-8.
| Applicable | Server Only |
| Meaning | Maximum number of threads to commit |
| Value Range | 0-1024 |
-| Default Value | |
+| Default Value | 4 |
## Log Parameters
diff --git a/docs/en/21-tdinternal/08-compress.md b/docs/en/21-tdinternal/08-compress.md
index a3b073c3a7..10a06a4c91 100644
--- a/docs/en/21-tdinternal/08-compress.md
+++ b/docs/en/21-tdinternal/08-compress.md
@@ -1,12 +1,8 @@
-
---
-
title: Configurable Column Compression
description: Configurable column storage compression method
---
-# Configurable Storage Compression
-
Since TDengine 3.3.0.0, more advanced compression feature is introduced, you can specify compression or not, the compression method and compression level for each column.
## Compression Terminology Definition
@@ -32,16 +28,14 @@ In this article, it specifically refers to the level within the secondary compre
- Default compression algorithm list and applicable range for each data type
-| Data Type | Optional Encoding Algorithm | Default Encoding Algorithm | Optional Compression Algorithm|Default Compression Algorithm| Default Compression Level|
+| Data Type | Optional Encoding Algorithm | Default Encoding Algorithm | Optional Compression Algorithm|Default Compression Algorithm| Default Compression Level|
| :-----------:|:----------:|:-------:|:-------:|:----------:|:----:|
- tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium|
+| tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium|
| bigint/ubigint/timestamp | simple8b/delta-i | delta-i |lz4/zlib/zstd/xz | lz4| medium|
-|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|tsz| medium|
+|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|lz4| medium|
|binary/nchar| disabled| disabled|lz4/zlib/zstd/xz| lz4| medium|
|bool| bit-packing| bit-packing| lz4/zlib/zstd/xz| lz4| medium|
-Note: For floating point types, if configured as tsz, its precision is determined by the global configuration of taosd. If configured as tsz, but the lossy compression flag is not configured, lz4 is used for compression by default.
-
## SQL
### Create Table with Compression
@@ -76,7 +70,7 @@ ALTER TABLE [db_name.]tabName MODIFY COLUMN colName [ENCODE 'ecode_type'] [COMPR
- Change the compression method of the column
-### View Compression Dethod
+### View Compression Method
```sql
DESCRIBE [dbname.]tabName
diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md
index f295e57bb5..119f22d96b 100644
--- a/docs/en/28-releases/01-tdengine.md
+++ b/docs/en/28-releases/01-tdengine.md
@@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://t
import Release from "/components/ReleaseV3";
+## 3.3.1.0
+
+
+
## 3.3.0.3
diff --git a/docs/zh/12-taos-sql/14-stream.md b/docs/zh/12-taos-sql/14-stream.md
index cc057c3b72..38d913dfaf 100644
--- a/docs/zh/12-taos-sql/14-stream.md
+++ b/docs/zh/12-taos-sql/14-stream.md
@@ -54,8 +54,10 @@ window_clause: {
}
```
-其中,SESSION 是会话窗口,tol_val 是时间间隔的最大范围。在 tol_val 时间间隔范围内的数据都属于同一个窗口,如果连续的两条数据的时间超过 tol_val,则自动开启下一个窗口。
+其中,SESSION 是会话窗口,tol_val 是时间间隔的最大范围。在 tol_val 时间间隔范围内的数据都属于同一个窗口,如果连续的两条数据的时间超过 tol_val,则自动开启下一个窗口。该窗口的 _wend 等于最后一条数据的时间加上 tol_val。
+
EVENT_WINDOW 是事件窗口,根据开始条件和结束条件来划定窗口。当 start_trigger_condition 满足时则窗口开始,直到 end_trigger_condition 满足时窗口关闭。 start_trigger_condition 和 end_trigger_condition 可以是任意 TDengine 支持的条件表达式,且可以包含不同的列。
+
COUNT_WINDOW 是计数窗口,按固定的数据行数来划分窗口。 count_val 是常量,是正整数,必须大于等于2,小于2147483648。 count_val 表示每个 COUNT_WINDOW 包含的最大数据行数,总数据行数不能整除 count_val 时,最后一个窗口的行数会小于 count_val 。 sliding_val 是常量,表示窗口滑动的数量,类似于 INTERVAL 的 SLIDING 。
窗口的定义与时序数据特色查询中的定义完全相同,详见 [TDengine 特色查询](../distinguished)
diff --git a/docs/zh/14-reference/12-config/index.md b/docs/zh/14-reference/12-config/index.md
index 6fce985927..effa72099a 100755
--- a/docs/zh/14-reference/12-config/index.md
+++ b/docs/zh/14-reference/12-config/index.md
@@ -430,7 +430,7 @@ charset 的有效值是 UTF-8。
| 适用范围 | 仅服务端适用 |
| 含义 | 设置写入线程的最大数量 |
| 取值范围 | 0-1024 |
-| 缺省值 | |
+| 缺省值 | 4 |
## 日志相关
diff --git a/docs/zh/21-tdinternal/08-compress.md b/docs/zh/21-tdinternal/08-compress.md
index 9653a9366b..dfec63c212 100644
--- a/docs/zh/21-tdinternal/08-compress.md
+++ b/docs/zh/21-tdinternal/08-compress.md
@@ -3,8 +3,6 @@ title: 可配置压缩算法
description: 可配置压缩算法
---
-# 可配置存储压缩
-
从 TDengine 3.3.0.0 版本开始,TDengine 提供了更高级的压缩功能,用户可以在建表时针对每一列配置是否进行压缩、以及使用的压缩算法和压缩级别。
## 压缩术语定义
@@ -30,16 +28,14 @@ description: 可配置压缩算法
- 各个数据类型的默认压缩算法列表和适用范围
-| 数据类型 | 可选编码算法 | 编码算法默认值 | 可选压缩算法|可选压缩算法| 压缩等级默认值|
+| 数据类型 | 可选编码算法 | 编码算法默认值 | 可选压缩算法|压缩算法默认值| 压缩等级默认值|
| :-----------:|:----------:|:-------:|:-------:|:----------:|:----:|
- tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium|
+| tinyint/untinyint/smallint/usmallint/int/uint | simple8b| simple8b | lz4/zlib/zstd/xz| lz4 | medium|
| bigint/ubigint/timestamp | simple8b/delta-i | delta-i |lz4/zlib/zstd/xz | lz4| medium|
-|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|tsz| medium|
+|float/double | delta-d|delta-d |lz4/zlib/zstd/xz/tsz|lz4| medium|
|binary/nchar| disabled| disabled|lz4/zlib/zstd/xz| lz4| medium|
|bool| bit-packing| bit-packing| lz4/zlib/zstd/xz| lz4| medium|
-注意: 针对浮点类型,如果配置为tsz, 其精度由taosd的全局配置决定,如果配置为tsz, 但是没有配置有损压缩标志, 则使用lz4进行压缩
-
## SQL 语法
### 建表时指定压缩
diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md
index f69e1fd4a8..cddb8160f6 100644
--- a/docs/zh/28-releases/01-tdengine.md
+++ b/docs/zh/28-releases/01-tdengine.md
@@ -10,6 +10,10 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do
import Release from "/components/ReleaseV3";
+## 3.3.1.0
+
+
+
## 3.3.0.3
diff --git a/include/client/taos.h b/include/client/taos.h
index 46e4e7633b..a22c8e5138 100644
--- a/include/client/taos.h
+++ b/include/client/taos.h
@@ -150,6 +150,12 @@ typedef struct TAOS_DB_ROUTE_INFO {
TAOS_VGROUP_HASH_INFO *vgHash;
} TAOS_DB_ROUTE_INFO;
+typedef struct TAOS_STMT_OPTIONS {
+ int64_t reqId;
+ bool singleStbInsert;
+ bool singleTableBindOnce;
+} TAOS_STMT_OPTIONS;
+
DLL_EXPORT void taos_cleanup(void);
DLL_EXPORT int taos_options(TSDB_OPTION option, const void *arg, ...);
DLL_EXPORT setConfRet taos_set_config(const char *config);
@@ -162,6 +168,7 @@ DLL_EXPORT const char *taos_data_type(int type);
DLL_EXPORT TAOS_STMT *taos_stmt_init(TAOS *taos);
DLL_EXPORT TAOS_STMT *taos_stmt_init_with_reqid(TAOS *taos, int64_t reqid);
+DLL_EXPORT TAOS_STMT *taos_stmt_init_with_options(TAOS *taos, TAOS_STMT_OPTIONS* options);
DLL_EXPORT int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length);
DLL_EXPORT int taos_stmt_set_tbname_tags(TAOS_STMT *stmt, const char *name, TAOS_MULTI_BIND *tags);
DLL_EXPORT int taos_stmt_set_tbname(TAOS_STMT *stmt, const char *name);
diff --git a/include/common/tcommon.h b/include/common/tcommon.h
index a5a805ff40..5714990dd5 100644
--- a/include/common/tcommon.h
+++ b/include/common/tcommon.h
@@ -240,7 +240,7 @@ typedef struct SDataBlockInfo {
} SDataBlockInfo;
typedef struct SSDataBlock {
- SColumnDataAgg** pBlockAgg;
+ SColumnDataAgg* pBlockAgg;
SArray* pDataBlock; // SArray
SDataBlockInfo info;
} SSDataBlock;
diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h
index 197fa125f5..ec998e9365 100644
--- a/include/common/tdatablock.h
+++ b/include/common/tdatablock.h
@@ -102,7 +102,7 @@ static FORCE_INLINE bool colDataIsNull(const SColumnInfoData* pColumnInfoData, u
return false;
}
- if (pColAgg != NULL) {
+ if (pColAgg != NULL && pColAgg->colId != -1) {
if (pColAgg->numOfNull == totalRows) {
ASSERT(pColumnInfoData->nullbitmap == NULL);
return true;
@@ -282,6 +282,8 @@ int32_t buildCtbNameByGroupIdImpl(const char* stbName, uint64_t groupId, char* p
void trimDataBlock(SSDataBlock* pBlock, int32_t totalRows, const bool* pBoolList);
+void copyPkVal(SDataBlockInfo* pDst, const SDataBlockInfo* pSrc);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/common/tdataformat.h b/include/common/tdataformat.h
index ce9b95522a..7aec39817a 100644
--- a/include/common/tdataformat.h
+++ b/include/common/tdataformat.h
@@ -370,6 +370,14 @@ int32_t tDecompressData(void *input, // input
int32_t tCompressDataToBuffer(void *input, SCompressInfo *info, SBuffer *output, SBuffer *assist);
int32_t tDecompressDataToBuffer(void *input, SCompressInfo *info, SBuffer *output, SBuffer *assist);
+typedef struct {
+ int32_t columnId;
+ int32_t type;
+ TAOS_MULTI_BIND *bind;
+} SBindInfo;
+int32_t tRowBuildFromBind(SBindInfo *infos, int32_t numOfInfos, bool infoSorted, const STSchema *pTSchema,
+ SArray *rowArray);
+
#endif
#ifdef __cplusplus
diff --git a/include/common/tglobal.h b/include/common/tglobal.h
index 90ee6f7cc0..e7035fe297 100644
--- a/include/common/tglobal.h
+++ b/include/common/tglobal.h
@@ -86,6 +86,7 @@ extern int32_t tsNumOfQnodeFetchThreads;
extern int32_t tsNumOfSnodeStreamThreads;
extern int32_t tsNumOfSnodeWriteThreads;
extern int64_t tsRpcQueueMemoryAllowed;
+extern int32_t tsRetentionSpeedLimitMB;
// sync raft
extern int32_t tsElectInterval;
diff --git a/include/common/tmsg.h b/include/common/tmsg.h
index fa294c3fc5..9301b31f95 100644
--- a/include/common/tmsg.h
+++ b/include/common/tmsg.h
@@ -37,6 +37,7 @@ extern "C" {
#define TD_MSG_NUMBER_
#undef TD_MSG_DICT_
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_RANGE_CODE_
#undef TD_MSG_SEG_CODE_
#include "tmsgdef.h"
@@ -44,6 +45,7 @@ extern "C" {
#undef TD_MSG_NUMBER_
#undef TD_MSG_DICT_
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_RANGE_CODE_
#define TD_MSG_SEG_CODE_
#include "tmsgdef.h"
@@ -51,6 +53,7 @@ extern "C" {
#undef TD_MSG_NUMBER_
#undef TD_MSG_DICT_
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_SEG_CODE_
#undef TD_MSG_RANGE_CODE_
#include "tmsgdef.h"
@@ -190,6 +193,7 @@ typedef enum _mgmt_table {
#define TSDB_ALTER_USER_DEL_PRIVILEGES 0x6
#define TSDB_ALTER_USER_ADD_WHITE_LIST 0x7
#define TSDB_ALTER_USER_DROP_WHITE_LIST 0x8
+#define TSDB_ALTER_USER_CREATEDB 0x9
#define TSDB_KILL_MSG_LEN 30
@@ -1044,11 +1048,18 @@ int32_t tSerializeRetrieveIpWhite(void* buf, int32_t bufLen, SRetrieveIpWhiteReq
int32_t tDeserializeRetrieveIpWhite(void* buf, int32_t bufLen, SRetrieveIpWhiteReq* pReq);
typedef struct {
- int8_t alterType;
- int8_t superUser;
- int8_t sysInfo;
- int8_t enable;
- int8_t isView;
+ int8_t alterType;
+ int8_t superUser;
+ int8_t sysInfo;
+ int8_t enable;
+ int8_t isView;
+ union {
+ uint8_t flag;
+ struct {
+ uint8_t createdb : 1;
+ uint8_t reserve : 7;
+ };
+ };
char user[TSDB_USER_LEN];
char pass[TSDB_USET_PASSWORD_LEN];
char objname[TSDB_DB_FNAME_LEN]; // db or topic
@@ -2117,6 +2128,7 @@ typedef struct {
int8_t precision;
int8_t compressed;
int8_t streamBlockType;
+ int32_t payloadLen;
int32_t compLen;
int32_t numOfBlocks;
int64_t numOfRows; // from int32_t change to int64_t
@@ -2129,6 +2141,14 @@ typedef struct {
char data[];
} SRetrieveTableRsp;
+#define PAYLOAD_PREFIX_LEN ((sizeof(int32_t)) << 1)
+
+#define SET_PAYLOAD_LEN(_p, _compLen, _fullLen) \
+ do { \
+ ((int32_t*)(_p))[0] = (_compLen); \
+ ((int32_t*)(_p))[1] = (_fullLen); \
+ } while (0);
+
typedef struct {
int64_t version;
int64_t numOfRows;
@@ -2145,6 +2165,7 @@ typedef struct {
int8_t compressed;
int32_t compLen;
int32_t numOfRows;
+ int32_t fullLen;
char data[];
} SRetrieveMetaTableRsp;
@@ -2500,6 +2521,7 @@ typedef struct SSubQueryMsg {
int8_t taskType;
int8_t explain;
int8_t needFetch;
+ int8_t compress;
uint32_t sqlLen;
char* sql;
uint32_t msgLen;
@@ -3472,9 +3494,9 @@ typedef struct SVUpdateCheckpointInfoReq {
int64_t checkpointVer;
int64_t checkpointTs;
int32_t transId;
- int8_t dropRelHTask;
- int64_t hStreamId;
+ int64_t hStreamId; // add encode/decode
int64_t hTaskId;
+ int8_t dropRelHTask;
} SVUpdateCheckpointInfoReq;
typedef struct {
@@ -3627,10 +3649,6 @@ typedef struct {
int32_t taskId;
} SVPauseStreamTaskReq, SVResetStreamTaskReq;
-typedef struct {
- int8_t reserved;
-} SVPauseStreamTaskRsp;
-
typedef struct {
char name[TSDB_STREAM_FNAME_LEN];
int8_t igNotExists;
diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h
index 6e1980c0af..c79e66f2e2 100644
--- a/include/common/tmsgdef.h
+++ b/include/common/tmsgdef.h
@@ -17,6 +17,7 @@
#if 0
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_NUMBER_
#undef TD_MSG_DICT_
#undef TD_MSG_SEG_CODE_
@@ -76,6 +77,23 @@
#define TD_CLOSE_MSG_SEG(TYPE)
enum {
+#elif defined(TD_MSG_TYPE_INFO_)
+
+ typedef struct {
+ const char *name;
+ const char *rspName;
+ int32_t type;
+ int32_t rspType;
+ } SMsgTypeInfo;
+
+ #undef TD_NEW_MSG_SEG
+ #undef TD_DEF_MSG_TYPE
+ #undef TD_CLOSE_MSG_SEG
+ #define TD_NEW_MSG_SEG(TYPE)
+ #define TD_DEF_MSG_TYPE(TYPE, MSG, REQ, RSP) { #TYPE, #TYPE "_RSP", TYPE, TYPE##_RSP },
+ #define TD_CLOSE_MSG_SEG(TYPE)
+
+ SMsgTypeInfo tMsgTypeInfo[] = {
#else
#undef TD_NEW_MSG_SEG
@@ -207,9 +225,9 @@
TD_DEF_MSG_TYPE(TDMT_MND_RESTORE_DNODE, "restore-dnode", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_PAUSE_STREAM, "pause-stream", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_RESUME_STREAM, "resume-stream", NULL, NULL)
- TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHECKPOINT_TIMER, "stream-checkpoint-tmr", NULL, NULL)
+ TD_DEF_MSG_TYPE(TDMT_MND_STREAM_UPDATE_CHKPT_EVT, "stream-update-chkpt-evt", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_STREAM_BEGIN_CHECKPOINT, "stream-begin-checkpoint", NULL, NULL)
- TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHECKPOINT_CANDIDITATE, "stream-checkpoint-remain", NULL, NULL)
+ TD_DEF_MSG_TYPE(TDMT_MND_STREAM_CHKPT_REPORT, "stream-chkpt-report", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_STREAM_NODECHANGE_CHECK, "stream-nodechange-check", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_TRIM_DB_TIMER, "trim-db-tmr", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_MND_GRANT_NOTIFY, "grant-notify", NULL, NULL)
@@ -372,6 +390,7 @@
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TASK_RESET, "vnode-stream-reset", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_TASK_CHECK, "vnode-stream-task-check", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_UNUSED, "vnd-stream-unused", NULL, NULL)
+
TD_DEF_MSG_TYPE(TDMT_VND_GET_STREAM_PROGRESS, "vnd-stream-progress", NULL, NULL)
TD_DEF_MSG_TYPE(TDMT_VND_STREAM_MAX_MSG, "vnd-stream-max", NULL, NULL)
TD_CLOSE_MSG_SEG(TDMT_END_VND_STREAM_MSG)
diff --git a/include/common/trow.h b/include/common/trow.h
index 92713e8e63..e43c67f931 100644
--- a/include/common/trow.h
+++ b/include/common/trow.h
@@ -289,7 +289,6 @@ int32_t tdGetBitmapValType(const void *pBitmap, int16_t colIdx, TDRowValT *pValT
*/
static FORCE_INLINE void tdSRowInit(SRowBuilder *pBuilder, int16_t sver) {
- pBuilder->rowType = pBuilder->rowType;
pBuilder->sver = sver;
}
int32_t tdSRowSetInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBoundCols, int32_t flen);
diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h
index 0c15fd3b9d..9060c145a4 100644
--- a/include/common/ttokendef.h
+++ b/include/common/ttokendef.h
@@ -16,381 +16,382 @@
#ifndef _TD_COMMON_TOKEN_H_
#define _TD_COMMON_TOKEN_H_
-#define TK_OR 1
-#define TK_AND 2
-#define TK_UNION 3
-#define TK_ALL 4
-#define TK_MINUS 5
-#define TK_EXCEPT 6
-#define TK_INTERSECT 7
-#define TK_NK_BITAND 8
-#define TK_NK_BITOR 9
-#define TK_NK_LSHIFT 10
-#define TK_NK_RSHIFT 11
-#define TK_NK_PLUS 12
-#define TK_NK_MINUS 13
-#define TK_NK_STAR 14
-#define TK_NK_SLASH 15
-#define TK_NK_REM 16
-#define TK_NK_CONCAT 17
-#define TK_CREATE 18
-#define TK_ACCOUNT 19
-#define TK_NK_ID 20
-#define TK_PASS 21
-#define TK_NK_STRING 22
-#define TK_ALTER 23
-#define TK_PPS 24
-#define TK_TSERIES 25
-#define TK_STORAGE 26
-#define TK_STREAMS 27
-#define TK_QTIME 28
-#define TK_DBS 29
-#define TK_USERS 30
-#define TK_CONNS 31
-#define TK_STATE 32
-#define TK_NK_COMMA 33
-#define TK_HOST 34
-#define TK_USER 35
-#define TK_ENABLE 36
-#define TK_NK_INTEGER 37
-#define TK_SYSINFO 38
-#define TK_ADD 39
-#define TK_DROP 40
-#define TK_GRANT 41
-#define TK_ON 42
-#define TK_TO 43
-#define TK_REVOKE 44
-#define TK_FROM 45
-#define TK_SUBSCRIBE 46
-#define TK_READ 47
-#define TK_WRITE 48
-#define TK_NK_DOT 49
-#define TK_WITH 50
-#define TK_ENCRYPT_KEY 51
-#define TK_DNODE 52
-#define TK_PORT 53
-#define TK_DNODES 54
-#define TK_RESTORE 55
-#define TK_NK_IPTOKEN 56
-#define TK_FORCE 57
-#define TK_UNSAFE 58
-#define TK_CLUSTER 59
-#define TK_LOCAL 60
-#define TK_QNODE 61
-#define TK_BNODE 62
-#define TK_SNODE 63
-#define TK_MNODE 64
-#define TK_VNODE 65
-#define TK_DATABASE 66
-#define TK_USE 67
-#define TK_FLUSH 68
-#define TK_TRIM 69
-#define TK_S3MIGRATE 70
-#define TK_COMPACT 71
-#define TK_IF 72
-#define TK_NOT 73
-#define TK_EXISTS 74
-#define TK_BUFFER 75
-#define TK_CACHEMODEL 76
-#define TK_CACHESIZE 77
-#define TK_COMP 78
-#define TK_DURATION 79
-#define TK_NK_VARIABLE 80
-#define TK_MAXROWS 81
-#define TK_MINROWS 82
-#define TK_KEEP 83
-#define TK_PAGES 84
-#define TK_PAGESIZE 85
-#define TK_TSDB_PAGESIZE 86
-#define TK_PRECISION 87
-#define TK_REPLICA 88
-#define TK_VGROUPS 89
-#define TK_SINGLE_STABLE 90
-#define TK_RETENTIONS 91
-#define TK_SCHEMALESS 92
-#define TK_WAL_LEVEL 93
-#define TK_WAL_FSYNC_PERIOD 94
-#define TK_WAL_RETENTION_PERIOD 95
-#define TK_WAL_RETENTION_SIZE 96
-#define TK_WAL_ROLL_PERIOD 97
-#define TK_WAL_SEGMENT_SIZE 98
-#define TK_STT_TRIGGER 99
-#define TK_TABLE_PREFIX 100
-#define TK_TABLE_SUFFIX 101
-#define TK_S3_CHUNKSIZE 102
-#define TK_S3_KEEPLOCAL 103
-#define TK_S3_COMPACT 104
-#define TK_KEEP_TIME_OFFSET 105
-#define TK_ENCRYPT_ALGORITHM 106
-#define TK_NK_COLON 107
-#define TK_BWLIMIT 108
-#define TK_START 109
-#define TK_TIMESTAMP 110
-#define TK_END 111
-#define TK_TABLE 112
-#define TK_NK_LP 113
-#define TK_NK_RP 114
-#define TK_STABLE 115
-#define TK_COLUMN 116
-#define TK_MODIFY 117
-#define TK_RENAME 118
-#define TK_TAG 119
-#define TK_SET 120
-#define TK_NK_EQ 121
-#define TK_USING 122
-#define TK_TAGS 123
-#define TK_BOOL 124
-#define TK_TINYINT 125
-#define TK_SMALLINT 126
-#define TK_INT 127
-#define TK_INTEGER 128
-#define TK_BIGINT 129
-#define TK_FLOAT 130
-#define TK_DOUBLE 131
-#define TK_BINARY 132
-#define TK_NCHAR 133
-#define TK_UNSIGNED 134
-#define TK_JSON 135
-#define TK_VARCHAR 136
-#define TK_MEDIUMBLOB 137
-#define TK_BLOB 138
-#define TK_VARBINARY 139
-#define TK_GEOMETRY 140
-#define TK_DECIMAL 141
-#define TK_COMMENT 142
-#define TK_MAX_DELAY 143
-#define TK_WATERMARK 144
-#define TK_ROLLUP 145
-#define TK_TTL 146
-#define TK_SMA 147
-#define TK_DELETE_MARK 148
-#define TK_FIRST 149
-#define TK_LAST 150
-#define TK_SHOW 151
-#define TK_PRIVILEGES 152
-#define TK_DATABASES 153
-#define TK_TABLES 154
-#define TK_STABLES 155
-#define TK_MNODES 156
-#define TK_QNODES 157
-#define TK_ARBGROUPS 158
-#define TK_FUNCTIONS 159
-#define TK_INDEXES 160
-#define TK_ACCOUNTS 161
-#define TK_APPS 162
-#define TK_CONNECTIONS 163
-#define TK_LICENCES 164
-#define TK_GRANTS 165
-#define TK_FULL 166
-#define TK_LOGS 167
-#define TK_MACHINES 168
-#define TK_ENCRYPTIONS 169
-#define TK_QUERIES 170
-#define TK_SCORES 171
-#define TK_TOPICS 172
-#define TK_VARIABLES 173
-#define TK_BNODES 174
-#define TK_SNODES 175
-#define TK_TRANSACTIONS 176
-#define TK_DISTRIBUTED 177
-#define TK_CONSUMERS 178
-#define TK_SUBSCRIPTIONS 179
-#define TK_VNODES 180
-#define TK_ALIVE 181
-#define TK_VIEWS 182
-#define TK_VIEW 183
-#define TK_COMPACTS 184
-#define TK_NORMAL 185
-#define TK_CHILD 186
-#define TK_LIKE 187
-#define TK_TBNAME 188
-#define TK_QTAGS 189
-#define TK_AS 190
-#define TK_SYSTEM 191
-#define TK_TSMA 192
-#define TK_INTERVAL 193
-#define TK_RECURSIVE 194
-#define TK_TSMAS 195
-#define TK_FUNCTION 196
-#define TK_INDEX 197
-#define TK_COUNT 198
-#define TK_LAST_ROW 199
-#define TK_META 200
-#define TK_ONLY 201
-#define TK_TOPIC 202
-#define TK_CONSUMER 203
-#define TK_GROUP 204
-#define TK_DESC 205
-#define TK_DESCRIBE 206
-#define TK_RESET 207
-#define TK_QUERY 208
-#define TK_CACHE 209
-#define TK_EXPLAIN 210
-#define TK_ANALYZE 211
-#define TK_VERBOSE 212
-#define TK_NK_BOOL 213
-#define TK_RATIO 214
-#define TK_NK_FLOAT 215
-#define TK_OUTPUTTYPE 216
-#define TK_AGGREGATE 217
-#define TK_BUFSIZE 218
-#define TK_LANGUAGE 219
-#define TK_REPLACE 220
-#define TK_STREAM 221
-#define TK_INTO 222
-#define TK_PAUSE 223
-#define TK_RESUME 224
-#define TK_PRIMARY 225
-#define TK_KEY 226
-#define TK_TRIGGER 227
-#define TK_AT_ONCE 228
-#define TK_WINDOW_CLOSE 229
-#define TK_IGNORE 230
-#define TK_EXPIRED 231
-#define TK_FILL_HISTORY 232
-#define TK_UPDATE 233
-#define TK_SUBTABLE 234
-#define TK_UNTREATED 235
-#define TK_KILL 236
-#define TK_CONNECTION 237
-#define TK_TRANSACTION 238
-#define TK_BALANCE 239
-#define TK_VGROUP 240
-#define TK_LEADER 241
-#define TK_MERGE 242
-#define TK_REDISTRIBUTE 243
-#define TK_SPLIT 244
-#define TK_DELETE 245
-#define TK_INSERT 246
-#define TK_NK_BIN 247
-#define TK_NK_HEX 248
-#define TK_NULL 249
-#define TK_NK_QUESTION 250
-#define TK_NK_ALIAS 251
-#define TK_NK_ARROW 252
-#define TK_ROWTS 253
-#define TK_QSTART 254
-#define TK_QEND 255
-#define TK_QDURATION 256
-#define TK_WSTART 257
-#define TK_WEND 258
-#define TK_WDURATION 259
-#define TK_IROWTS 260
-#define TK_ISFILLED 261
-#define TK_CAST 262
-#define TK_NOW 263
-#define TK_TODAY 264
-#define TK_TIMEZONE 265
-#define TK_CLIENT_VERSION 266
-#define TK_SERVER_VERSION 267
-#define TK_SERVER_STATUS 268
-#define TK_CURRENT_USER 269
-#define TK_CASE 270
-#define TK_WHEN 271
-#define TK_THEN 272
-#define TK_ELSE 273
-#define TK_BETWEEN 274
-#define TK_IS 275
-#define TK_NK_LT 276
-#define TK_NK_GT 277
-#define TK_NK_LE 278
-#define TK_NK_GE 279
-#define TK_NK_NE 280
-#define TK_MATCH 281
-#define TK_NMATCH 282
-#define TK_CONTAINS 283
-#define TK_IN 284
-#define TK_JOIN 285
-#define TK_INNER 286
-#define TK_LEFT 287
-#define TK_RIGHT 288
-#define TK_OUTER 289
-#define TK_SEMI 290
-#define TK_ANTI 291
-#define TK_ASOF 292
-#define TK_WINDOW 293
-#define TK_WINDOW_OFFSET 294
-#define TK_JLIMIT 295
-#define TK_SELECT 296
-#define TK_NK_HINT 297
-#define TK_DISTINCT 298
-#define TK_WHERE 299
-#define TK_PARTITION 300
-#define TK_BY 301
-#define TK_SESSION 302
-#define TK_STATE_WINDOW 303
-#define TK_EVENT_WINDOW 304
-#define TK_COUNT_WINDOW 305
-#define TK_SLIDING 306
-#define TK_FILL 307
-#define TK_VALUE 308
-#define TK_VALUE_F 309
-#define TK_NONE 310
-#define TK_PREV 311
-#define TK_NULL_F 312
-#define TK_LINEAR 313
-#define TK_NEXT 314
-#define TK_HAVING 315
-#define TK_RANGE 316
-#define TK_EVERY 317
-#define TK_ORDER 318
-#define TK_SLIMIT 319
-#define TK_SOFFSET 320
-#define TK_LIMIT 321
-#define TK_OFFSET 322
-#define TK_ASC 323
-#define TK_NULLS 324
-#define TK_ABORT 325
-#define TK_AFTER 326
-#define TK_ATTACH 327
-#define TK_BEFORE 328
-#define TK_BEGIN 329
-#define TK_BITAND 330
-#define TK_BITNOT 331
-#define TK_BITOR 332
-#define TK_BLOCKS 333
-#define TK_CHANGE 334
-#define TK_COMMA 335
-#define TK_CONCAT 336
-#define TK_CONFLICT 337
-#define TK_COPY 338
-#define TK_DEFERRED 339
-#define TK_DELIMITERS 340
-#define TK_DETACH 341
-#define TK_DIVIDE 342
-#define TK_DOT 343
-#define TK_EACH 344
-#define TK_FAIL 345
-#define TK_FILE 346
-#define TK_FOR 347
-#define TK_GLOB 348
-#define TK_ID 349
-#define TK_IMMEDIATE 350
-#define TK_IMPORT 351
-#define TK_INITIALLY 352
-#define TK_INSTEAD 353
-#define TK_ISNULL 354
-#define TK_MODULES 355
-#define TK_NK_BITNOT 356
-#define TK_NK_SEMI 357
-#define TK_NOTNULL 358
-#define TK_OF 359
-#define TK_PLUS 360
-#define TK_PRIVILEGE 361
-#define TK_RAISE 362
-#define TK_RESTRICT 363
-#define TK_ROW 364
-#define TK_STAR 365
-#define TK_STATEMENT 366
-#define TK_STRICT 367
-#define TK_STRING 368
-#define TK_TIMES 369
-#define TK_VALUES 370
-#define TK_VARIABLE 371
-#define TK_WAL 372
-#define TK_ENCODE 373
-#define TK_COMPRESS 374
-#define TK_LEVEL 375
+#define TK_OR 1
+#define TK_AND 2
+#define TK_UNION 3
+#define TK_ALL 4
+#define TK_MINUS 5
+#define TK_EXCEPT 6
+#define TK_INTERSECT 7
+#define TK_NK_BITAND 8
+#define TK_NK_BITOR 9
+#define TK_NK_LSHIFT 10
+#define TK_NK_RSHIFT 11
+#define TK_NK_PLUS 12
+#define TK_NK_MINUS 13
+#define TK_NK_STAR 14
+#define TK_NK_SLASH 15
+#define TK_NK_REM 16
+#define TK_NK_CONCAT 17
+#define TK_CREATE 18
+#define TK_ACCOUNT 19
+#define TK_NK_ID 20
+#define TK_PASS 21
+#define TK_NK_STRING 22
+#define TK_ALTER 23
+#define TK_PPS 24
+#define TK_TSERIES 25
+#define TK_STORAGE 26
+#define TK_STREAMS 27
+#define TK_QTIME 28
+#define TK_DBS 29
+#define TK_USERS 30
+#define TK_CONNS 31
+#define TK_STATE 32
+#define TK_NK_COMMA 33
+#define TK_HOST 34
+#define TK_USER 35
+#define TK_ENABLE 36
+#define TK_NK_INTEGER 37
+#define TK_SYSINFO 38
+#define TK_CREATEDB 39
+#define TK_ADD 40
+#define TK_DROP 41
+#define TK_GRANT 42
+#define TK_ON 43
+#define TK_TO 44
+#define TK_REVOKE 45
+#define TK_FROM 46
+#define TK_SUBSCRIBE 47
+#define TK_READ 48
+#define TK_WRITE 49
+#define TK_NK_DOT 50
+#define TK_WITH 51
+#define TK_ENCRYPT_KEY 52
+#define TK_DNODE 53
+#define TK_PORT 54
+#define TK_DNODES 55
+#define TK_RESTORE 56
+#define TK_NK_IPTOKEN 57
+#define TK_FORCE 58
+#define TK_UNSAFE 59
+#define TK_CLUSTER 60
+#define TK_LOCAL 61
+#define TK_QNODE 62
+#define TK_BNODE 63
+#define TK_SNODE 64
+#define TK_MNODE 65
+#define TK_VNODE 66
+#define TK_DATABASE 67
+#define TK_USE 68
+#define TK_FLUSH 69
+#define TK_TRIM 70
+#define TK_S3MIGRATE 71
+#define TK_COMPACT 72
+#define TK_IF 73
+#define TK_NOT 74
+#define TK_EXISTS 75
+#define TK_BUFFER 76
+#define TK_CACHEMODEL 77
+#define TK_CACHESIZE 78
+#define TK_COMP 79
+#define TK_DURATION 80
+#define TK_NK_VARIABLE 81
+#define TK_MAXROWS 82
+#define TK_MINROWS 83
+#define TK_KEEP 84
+#define TK_PAGES 85
+#define TK_PAGESIZE 86
+#define TK_TSDB_PAGESIZE 87
+#define TK_PRECISION 88
+#define TK_REPLICA 89
+#define TK_VGROUPS 90
+#define TK_SINGLE_STABLE 91
+#define TK_RETENTIONS 92
+#define TK_SCHEMALESS 93
+#define TK_WAL_LEVEL 94
+#define TK_WAL_FSYNC_PERIOD 95
+#define TK_WAL_RETENTION_PERIOD 96
+#define TK_WAL_RETENTION_SIZE 97
+#define TK_WAL_ROLL_PERIOD 98
+#define TK_WAL_SEGMENT_SIZE 99
+#define TK_STT_TRIGGER 100
+#define TK_TABLE_PREFIX 101
+#define TK_TABLE_SUFFIX 102
+#define TK_S3_CHUNKSIZE 103
+#define TK_S3_KEEPLOCAL 104
+#define TK_S3_COMPACT 105
+#define TK_KEEP_TIME_OFFSET 106
+#define TK_ENCRYPT_ALGORITHM 107
+#define TK_NK_COLON 108
+#define TK_BWLIMIT 109
+#define TK_START 110
+#define TK_TIMESTAMP 111
+#define TK_END 112
+#define TK_TABLE 113
+#define TK_NK_LP 114
+#define TK_NK_RP 115
+#define TK_STABLE 116
+#define TK_COLUMN 117
+#define TK_MODIFY 118
+#define TK_RENAME 119
+#define TK_TAG 120
+#define TK_SET 121
+#define TK_NK_EQ 122
+#define TK_USING 123
+#define TK_TAGS 124
+#define TK_BOOL 125
+#define TK_TINYINT 126
+#define TK_SMALLINT 127
+#define TK_INT 128
+#define TK_INTEGER 129
+#define TK_BIGINT 130
+#define TK_FLOAT 131
+#define TK_DOUBLE 132
+#define TK_BINARY 133
+#define TK_NCHAR 134
+#define TK_UNSIGNED 135
+#define TK_JSON 136
+#define TK_VARCHAR 137
+#define TK_MEDIUMBLOB 138
+#define TK_BLOB 139
+#define TK_VARBINARY 140
+#define TK_GEOMETRY 141
+#define TK_DECIMAL 142
+#define TK_COMMENT 143
+#define TK_MAX_DELAY 144
+#define TK_WATERMARK 145
+#define TK_ROLLUP 146
+#define TK_TTL 147
+#define TK_SMA 148
+#define TK_DELETE_MARK 149
+#define TK_FIRST 150
+#define TK_LAST 151
+#define TK_SHOW 152
+#define TK_PRIVILEGES 153
+#define TK_DATABASES 154
+#define TK_TABLES 155
+#define TK_STABLES 156
+#define TK_MNODES 157
+#define TK_QNODES 158
+#define TK_ARBGROUPS 159
+#define TK_FUNCTIONS 160
+#define TK_INDEXES 161
+#define TK_ACCOUNTS 162
+#define TK_APPS 163
+#define TK_CONNECTIONS 164
+#define TK_LICENCES 165
+#define TK_GRANTS 166
+#define TK_FULL 167
+#define TK_LOGS 168
+#define TK_MACHINES 169
+#define TK_ENCRYPTIONS 170
+#define TK_QUERIES 171
+#define TK_SCORES 172
+#define TK_TOPICS 173
+#define TK_VARIABLES 174
+#define TK_BNODES 175
+#define TK_SNODES 176
+#define TK_TRANSACTIONS 177
+#define TK_DISTRIBUTED 178
+#define TK_CONSUMERS 179
+#define TK_SUBSCRIPTIONS 180
+#define TK_VNODES 181
+#define TK_ALIVE 182
+#define TK_VIEWS 183
+#define TK_VIEW 184
+#define TK_COMPACTS 185
+#define TK_NORMAL 186
+#define TK_CHILD 187
+#define TK_LIKE 188
+#define TK_TBNAME 189
+#define TK_QTAGS 190
+#define TK_AS 191
+#define TK_SYSTEM 192
+#define TK_TSMA 193
+#define TK_INTERVAL 194
+#define TK_RECURSIVE 195
+#define TK_TSMAS 196
+#define TK_FUNCTION 197
+#define TK_INDEX 198
+#define TK_COUNT 199
+#define TK_LAST_ROW 200
+#define TK_META 201
+#define TK_ONLY 202
+#define TK_TOPIC 203
+#define TK_CONSUMER 204
+#define TK_GROUP 205
+#define TK_DESC 206
+#define TK_DESCRIBE 207
+#define TK_RESET 208
+#define TK_QUERY 209
+#define TK_CACHE 210
+#define TK_EXPLAIN 211
+#define TK_ANALYZE 212
+#define TK_VERBOSE 213
+#define TK_NK_BOOL 214
+#define TK_RATIO 215
+#define TK_NK_FLOAT 216
+#define TK_OUTPUTTYPE 217
+#define TK_AGGREGATE 218
+#define TK_BUFSIZE 219
+#define TK_LANGUAGE 220
+#define TK_REPLACE 221
+#define TK_STREAM 222
+#define TK_INTO 223
+#define TK_PAUSE 224
+#define TK_RESUME 225
+#define TK_PRIMARY 226
+#define TK_KEY 227
+#define TK_TRIGGER 228
+#define TK_AT_ONCE 229
+#define TK_WINDOW_CLOSE 230
+#define TK_IGNORE 231
+#define TK_EXPIRED 232
+#define TK_FILL_HISTORY 233
+#define TK_UPDATE 234
+#define TK_SUBTABLE 235
+#define TK_UNTREATED 236
+#define TK_KILL 237
+#define TK_CONNECTION 238
+#define TK_TRANSACTION 239
+#define TK_BALANCE 240
+#define TK_VGROUP 241
+#define TK_LEADER 242
+#define TK_MERGE 243
+#define TK_REDISTRIBUTE 244
+#define TK_SPLIT 245
+#define TK_DELETE 246
+#define TK_INSERT 247
+#define TK_NK_BIN 248
+#define TK_NK_HEX 249
+#define TK_NULL 250
+#define TK_NK_QUESTION 251
+#define TK_NK_ALIAS 252
+#define TK_NK_ARROW 253
+#define TK_ROWTS 254
+#define TK_QSTART 255
+#define TK_QEND 256
+#define TK_QDURATION 257
+#define TK_WSTART 258
+#define TK_WEND 259
+#define TK_WDURATION 260
+#define TK_IROWTS 261
+#define TK_ISFILLED 262
+#define TK_CAST 263
+#define TK_NOW 264
+#define TK_TODAY 265
+#define TK_TIMEZONE 266
+#define TK_CLIENT_VERSION 267
+#define TK_SERVER_VERSION 268
+#define TK_SERVER_STATUS 269
+#define TK_CURRENT_USER 270
+#define TK_CASE 271
+#define TK_WHEN 272
+#define TK_THEN 273
+#define TK_ELSE 274
+#define TK_BETWEEN 275
+#define TK_IS 276
+#define TK_NK_LT 277
+#define TK_NK_GT 278
+#define TK_NK_LE 279
+#define TK_NK_GE 280
+#define TK_NK_NE 281
+#define TK_MATCH 282
+#define TK_NMATCH 283
+#define TK_CONTAINS 284
+#define TK_IN 285
+#define TK_JOIN 286
+#define TK_INNER 287
+#define TK_LEFT 288
+#define TK_RIGHT 289
+#define TK_OUTER 290
+#define TK_SEMI 291
+#define TK_ANTI 292
+#define TK_ASOF 293
+#define TK_WINDOW 294
+#define TK_WINDOW_OFFSET 295
+#define TK_JLIMIT 296
+#define TK_SELECT 297
+#define TK_NK_HINT 298
+#define TK_DISTINCT 299
+#define TK_WHERE 300
+#define TK_PARTITION 301
+#define TK_BY 302
+#define TK_SESSION 303
+#define TK_STATE_WINDOW 304
+#define TK_EVENT_WINDOW 305
+#define TK_COUNT_WINDOW 306
+#define TK_SLIDING 307
+#define TK_FILL 308
+#define TK_VALUE 309
+#define TK_VALUE_F 310
+#define TK_NONE 311
+#define TK_PREV 312
+#define TK_NULL_F 313
+#define TK_LINEAR 314
+#define TK_NEXT 315
+#define TK_HAVING 316
+#define TK_RANGE 317
+#define TK_EVERY 318
+#define TK_ORDER 319
+#define TK_SLIMIT 320
+#define TK_SOFFSET 321
+#define TK_LIMIT 322
+#define TK_OFFSET 323
+#define TK_ASC 324
+#define TK_NULLS 325
+#define TK_ABORT 326
+#define TK_AFTER 327
+#define TK_ATTACH 328
+#define TK_BEFORE 329
+#define TK_BEGIN 330
+#define TK_BITAND 331
+#define TK_BITNOT 332
+#define TK_BITOR 333
+#define TK_BLOCKS 334
+#define TK_CHANGE 335
+#define TK_COMMA 336
+#define TK_CONCAT 337
+#define TK_CONFLICT 338
+#define TK_COPY 339
+#define TK_DEFERRED 340
+#define TK_DELIMITERS 341
+#define TK_DETACH 342
+#define TK_DIVIDE 343
+#define TK_DOT 344
+#define TK_EACH 345
+#define TK_FAIL 346
+#define TK_FILE 347
+#define TK_FOR 348
+#define TK_GLOB 349
+#define TK_ID 350
+#define TK_IMMEDIATE 351
+#define TK_IMPORT 352
+#define TK_INITIALLY 353
+#define TK_INSTEAD 354
+#define TK_ISNULL 355
+#define TK_MODULES 356
+#define TK_NK_BITNOT 357
+#define TK_NK_SEMI 358
+#define TK_NOTNULL 359
+#define TK_OF 360
+#define TK_PLUS 361
+#define TK_PRIVILEGE 362
+#define TK_RAISE 363
+#define TK_RESTRICT 364
+#define TK_ROW 365
+#define TK_STAR 366
+#define TK_STATEMENT 367
+#define TK_STRICT 368
+#define TK_STRING 369
+#define TK_TIMES 370
+#define TK_VALUES 371
+#define TK_VARIABLE 372
+#define TK_WAL 373
+#define TK_ENCODE 374
+#define TK_COMPRESS 375
+#define TK_LEVEL 376
#define TK_NK_SPACE 600
#define TK_NK_COMMENT 601
diff --git a/include/dnode/vnode/tqCommon.h b/include/dnode/vnode/tqCommon.h
index 0076d79312..f0ab2a0e95 100644
--- a/include/dnode/vnode/tqCommon.h
+++ b/include/dnode/vnode/tqCommon.h
@@ -28,6 +28,7 @@ int32_t tqStreamTaskProcessCheckRsp(SStreamMeta* pMeta, SRpcMsg* pMsg, bool isLe
int32_t tqStreamTaskProcessCheckpointReadyMsg(SStreamMeta* pMeta, SRpcMsg* pMsg);
int32_t tqStreamProcessStreamHbRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
int32_t tqStreamProcessReqCheckpointRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
+int32_t tqStreamProcessChkptReportRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
int32_t tqStreamProcessCheckpointReadyRsp(SStreamMeta* pMeta, SRpcMsg* pMsg);
int32_t tqStreamTaskProcessDeployReq(SStreamMeta* pMeta, SMsgCb* cb, int64_t sversion, char* msg, int32_t msgLen,
bool isLeader, bool restored);
@@ -42,7 +43,7 @@ int32_t tqStreamTaskProcessTaskPauseReq(SStreamMeta* pMeta, char* pMsg);
int32_t tqStreamTaskProcessTaskResumeReq(void* handle, int64_t sversion, char* pMsg, bool fromVnode);
int32_t tqStreamTaskProcessUpdateCheckpointReq(SStreamMeta* pMeta, char* msg, int32_t msgLen);
-int32_t tqExpandStreamTask(SStreamTask* pTask, SStreamMeta* pMeta);
void tqSetRestoreVersionInfo(SStreamTask* pTask);
+int32_t tqExpandStreamTask(SStreamTask* pTask);
#endif // TDENGINE_TQ_COMMON_H
diff --git a/include/libs/executor/dataSinkMgt.h b/include/libs/executor/dataSinkMgt.h
index 2e2882e35e..130de8c030 100644
--- a/include/libs/executor/dataSinkMgt.h
+++ b/include/libs/executor/dataSinkMgt.h
@@ -55,6 +55,7 @@ typedef struct SDataSinkStat {
} SDataSinkStat;
typedef struct SDataSinkMgtCfg {
+ int8_t compress;
uint32_t maxDataBlockNum; // todo: this should be numOfRows?
uint32_t maxDataBlockNumPerQuery;
} SDataSinkMgtCfg;
@@ -104,7 +105,7 @@ void dsReset(DataSinkHandle handle);
* @param handle
* @param pLen data length
*/
-void dsGetDataLength(DataSinkHandle handle, int64_t* pLen, bool* pQueryEnd);
+void dsGetDataLength(DataSinkHandle handle, int64_t* pLen, int64_t* pRawLen, bool* pQueryEnd);
/**
* Get data, the caller needs to allocate data memory.
diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h
index 9b557500f0..78a977c86f 100644
--- a/include/libs/executor/executor.h
+++ b/include/libs/executor/executor.h
@@ -139,8 +139,9 @@ void qUpdateOperatorParam(qTaskInfo_t tinfo, void* pParam);
* @param qId
* @return
*/
-int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, struct SSubplan* pPlan,
- qTaskInfo_t* pTaskInfo, DataSinkHandle* handle, char* sql, EOPTR_EXEC_MODEL model);
+int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, struct SSubplan* pSubplan,
+ qTaskInfo_t* pTaskInfo, DataSinkHandle* handle, int8_t compressResult, char* sql,
+ EOPTR_EXEC_MODEL model);
/**
*
diff --git a/include/libs/executor/storageapi.h b/include/libs/executor/storageapi.h
index 330ba31c65..8c67f77adb 100644
--- a/include/libs/executor/storageapi.h
+++ b/include/libs/executor/storageapi.h
@@ -410,7 +410,7 @@ typedef struct SStateStore {
void (*streamFileStateClear)(struct SStreamFileState* pFileState);
bool (*needClearDiskBuff)(struct SStreamFileState* pFileState);
- SStreamState* (*streamStateOpen)(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages);
+ SStreamState* (*streamStateOpen)(const char* path, void* pTask, int64_t streamId, int32_t taskId, bool specPath, int32_t szPage, int32_t pages);
void (*streamStateClose)(SStreamState* pState, bool remove);
int32_t (*streamStateBegin)(SStreamState* pState);
int32_t (*streamStateCommit)(SStreamState* pState);
diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h
index c2e5be96ad..112411d524 100644
--- a/include/libs/nodes/cmdnodes.h
+++ b/include/libs/nodes/cmdnodes.h
@@ -271,6 +271,7 @@ typedef struct SAlterUserStmt {
char password[TSDB_USET_PASSWORD_LEN];
int8_t enable;
int8_t sysinfo;
+ int8_t createdb;
int32_t numIpRanges;
SIpV4Range* pIpRanges;
diff --git a/include/libs/parser/parser.h b/include/libs/parser/parser.h
index 37d5f3f0b6..4c4505544b 100644
--- a/include/libs/parser/parser.h
+++ b/include/libs/parser/parser.h
@@ -118,7 +118,11 @@ int32_t qExtractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** p
int32_t qSetSTableIdForRsma(SNode* pStmt, int64_t uid);
void qCleanupKeywordsTable();
+int32_t qAppendStmtTableOutput(SQuery* pQuery, SHashObj* pAllVgHash, STableColsData* pTbData, STableDataCxt* pTbCtx, SStbInterlaceInfo* pBuildInfo);
+int32_t qBuildStmtFinOutput(SQuery* pQuery, SHashObj* pAllVgHash, SArray* pVgDataBlocks);
+//int32_t qBuildStmtOutputFromTbList(SQuery* pQuery, SHashObj* pVgHash, SArray* pBlockList, STableDataCxt* pTbCtx, int32_t tbNum);
int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash);
+int32_t qResetStmtColumns(SArray* pCols, bool deepClear);
int32_t qResetStmtDataBlock(STableDataCxt* block, bool keepBuf);
int32_t qCloneStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, bool reset);
int32_t qRebuildStmtDataBlock(STableDataCxt** pDst, STableDataCxt* pSrc, uint64_t uid, uint64_t suid, int32_t vgId,
@@ -129,8 +133,9 @@ int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData
int32_t qStmtBindParams(SQuery* pQuery, TAOS_MULTI_BIND* pParams, int32_t colIdx);
int32_t qStmtParseQuerySql(SParseContext* pCxt, SQuery* pQuery);
-int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen);
-int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, int32_t colIdx,
+int32_t qBindStmtStbColsValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, STSchema** pTSchema, SBindInfo* pBindInfos);
+int32_t qBindStmtColsValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen);
+int32_t qBindStmtSingleColValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, int32_t colIdx,
int32_t rowNum);
int32_t qBuildStmtColFields(void* pDataBlock, int32_t* fieldNum, TAOS_FIELD_E** fields);
int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TAOS_FIELD_E** fields);
@@ -160,6 +165,7 @@ SArray* serializeVgroupsCreateTableBatch(SHashObj* pVgroupHashmap);
SArray* serializeVgroupsDropTableBatch(SHashObj* pVgroupHashmap);
void destoryCatalogReq(SCatalogReq *pCatalogReq);
bool isPrimaryKeyImpl(SNode* pExpr);
+int32_t insAppendStmtTableDataCxt(SHashObj* pAllVgHash, STableColsData* pTbData, STableDataCxt* pTbCtx, SStbInterlaceInfo* pBuildInfo);
#ifdef __cplusplus
}
diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h
index 32f7cef12c..ef702f24d7 100644
--- a/include/libs/qcom/query.h
+++ b/include/libs/qcom/query.h
@@ -25,6 +25,7 @@ extern "C" {
#include "tarray.h"
#include "thash.h"
#include "tlog.h"
+#include "tsimplehash.h"
#include "tmsg.h"
#include "tmsgcb.h"
@@ -193,6 +194,27 @@ typedef struct SBoundColInfo {
int32_t numOfBound;
} SBoundColInfo;
+typedef struct STableColsData {
+ char tbName[TSDB_TABLE_NAME_LEN];
+ SArray* aCol;
+ bool getFromHash;
+} STableColsData;
+
+typedef struct STableVgUid {
+ uint64_t uid;
+ int32_t vgid;
+} STableVgUid;
+
+typedef struct STableBufInfo {
+ void* pCurBuff;
+ SArray* pBufList;
+ int64_t buffUnit;
+ int64_t buffSize;
+ int64_t buffIdx;
+ int64_t buffOffset;
+} STableBufInfo;
+
+
typedef struct STableDataCxt {
STableMeta* pMeta;
STSchema* pSchema;
@@ -204,6 +226,33 @@ typedef struct STableDataCxt {
bool duplicateTs;
} STableDataCxt;
+typedef struct SStbInterlaceInfo {
+ void* pCatalog;
+ void* pQuery;
+ int32_t acctId;
+ char* dbname;
+ void* transport;
+ SEpSet mgmtEpSet;
+ void* pRequest;
+ uint64_t requestId;
+ int64_t requestSelf;
+ bool tbFromHash;
+ SHashObj* pVgroupHash;
+ SArray* pVgroupList;
+ SSHashObj* pTableHash;
+ int64_t tbRemainNum;
+ STableBufInfo tbBuf;
+ char firstName[TSDB_TABLE_NAME_LEN];
+ STSchema *pTSchema;
+ STableDataCxt *pDataCtx;
+ void *boundTags;
+
+ bool tableColsReady;
+ SArray *pTableCols;
+ int32_t pTableColsIdx;
+} SStbInterlaceInfo;
+
+
typedef int32_t (*__async_send_cb_fn_t)(void* param, SDataBuf* pMsg, int32_t code);
typedef int32_t (*__async_exec_fn_t)(void* param);
diff --git a/include/libs/qworker/qworker.h b/include/libs/qworker/qworker.h
index bbd2d76b59..ac27534ab0 100644
--- a/include/libs/qworker/qworker.h
+++ b/include/libs/qworker/qworker.h
@@ -61,6 +61,7 @@ typedef struct SQWMsgInfo {
int8_t taskType;
int8_t explain;
int8_t needFetch;
+ int8_t compressMsg;
} SQWMsgInfo;
typedef struct SQWMsg {
diff --git a/include/libs/scalar/filter.h b/include/libs/scalar/filter.h
index c1ce1e6fd8..750179ee3b 100644
--- a/include/libs/scalar/filter.h
+++ b/include/libs/scalar/filter.h
@@ -58,7 +58,7 @@ extern int32_t filterGetTimeRange(SNode *pNode, STimeWindow *win, bool *isStrict
extern int32_t filterConverNcharColumns(SFilterInfo *pFilterInfo, int32_t rows, bool *gotNchar);
extern int32_t filterFreeNcharColumns(SFilterInfo *pFilterInfo);
extern void filterFreeInfo(SFilterInfo *info);
-extern bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pColsAgg, int32_t numOfCols, int32_t numOfRows);
+extern bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pColsAgg, int32_t numOfCols, int32_t numOfRows);
/* condition split interface */
int32_t filterPartitionCond(SNode **pCondition, SNode **pPrimaryKeyCond, SNode **pTagIndexCond, SNode **pTagCond,
diff --git a/include/libs/scheduler/scheduler.h b/include/libs/scheduler/scheduler.h
index 952af3c443..1e2ccf8705 100644
--- a/include/libs/scheduler/scheduler.h
+++ b/include/libs/scheduler/scheduler.h
@@ -48,16 +48,6 @@ typedef struct SQueryProfileSummary {
uint64_t resultSize; // generated result size in Kb.
} SQueryProfileSummary;
-typedef struct STaskInfo {
- SQueryNodeAddr addr;
- SSubQueryMsg* msg;
-} STaskInfo;
-
-typedef struct SSchdFetchParam {
- void** pData;
- int32_t* code;
-} SSchdFetchParam;
-
typedef void (*schedulerExecFp)(SExecResult* pResult, void* param, int32_t code);
typedef void (*schedulerFetchFp)(void* pResult, void* param, int32_t code);
typedef bool (*schedulerChkKillFp)(void* param);
diff --git a/include/libs/stream/streamState.h b/include/libs/stream/streamState.h
index ae5a733ae9..1333257dfb 100644
--- a/include/libs/stream/streamState.h
+++ b/include/libs/stream/streamState.h
@@ -29,7 +29,8 @@ extern "C" {
#include "storageapi.h"
-SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages);
+SStreamState* streamStateOpen(const char* path, void* pTask, int64_t streamId, int32_t taskId, bool specPath,
+ int32_t szPage, int32_t pages);
void streamStateClose(SStreamState* pState, bool remove);
int32_t streamStateBegin(SStreamState* pState);
int32_t streamStateCommit(SStreamState* pState);
diff --git a/include/libs/stream/streammsg.h b/include/libs/stream/streammsg.h
index 91bfc6afc8..723c9fd099 100644
--- a/include/libs/stream/streammsg.h
+++ b/include/libs/stream/streammsg.h
@@ -190,6 +190,20 @@ typedef struct SCheckpointTriggerRsp {
int32_t rspCode;
} SCheckpointTriggerRsp;
+typedef struct SCheckpointReport {
+ int64_t streamId;
+ int32_t taskId;
+ int32_t nodeId;
+ int64_t checkpointId;
+ int64_t checkpointVer;
+ int64_t checkpointTs;
+ int32_t transId;
+ int8_t dropHTask;
+} SCheckpointReport;
+
+int32_t tEncodeStreamTaskChkptReport(SEncoder* pEncoder, const SCheckpointReport* pReq);
+int32_t tDecodeStreamTaskChkptReport(SDecoder* pDecoder, SCheckpointReport* pReq);
+
typedef struct {
SMsgHead head;
int64_t streamId;
diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h
index d07a302920..03c42e5c7e 100644
--- a/include/libs/stream/tstream.h
+++ b/include/libs/stream/tstream.h
@@ -157,7 +157,8 @@ typedef enum EStreamTaskEvent {
typedef void FTbSink(SStreamTask* pTask, void* vnode, void* data);
typedef void FSmaSink(void* vnode, int64_t smaId, const SArray* data);
-typedef int32_t FTaskExpand(void* ahandle, SStreamTask* pTask, int64_t ver);
+typedef int32_t FTaskBuild(void* ahandle, SStreamTask* pTask, int64_t ver);
+typedef int32_t FTaskExpand(SStreamTask* pTask);
typedef struct {
int8_t type;
@@ -205,7 +206,6 @@ typedef struct {
typedef struct {
char stbFullName[TSDB_TABLE_FNAME_LEN];
- int32_t waitingRspCnt;
SUseDbRsp dbInfo;
} STaskDispatcherShuffle;
@@ -312,15 +312,18 @@ typedef struct SMetaHbInfo SMetaHbInfo;
typedef struct SDispatchMsgInfo {
SStreamDispatchReq* pData; // current dispatch data
- int8_t dispatchMsgType;
- int64_t checkpointId;// checkpoint id msg
- int32_t transId; // transId for current checkpoint
- int16_t msgType; // dispatch msg type
- int32_t retryCount; // retry send data count
- int64_t startTs; // dispatch start time, record total elapsed time for dispatch
- SArray* pRetryList; // current dispatch successfully completed node of downstream
- void* pRetryTmr; // used to dispatch data after a given time duration
- void* pRspTmr; // used to dispatch data after a given time duration
+
+ int8_t dispatchMsgType;
+ int64_t checkpointId; // checkpoint id msg
+ int32_t transId; // transId for current checkpoint
+ int16_t msgType; // dispatch msg type
+ int32_t msgId;
+ int64_t startTs; // dispatch start time, record total elapsed time for dispatch
+ int64_t rspTs; // latest rsp time
+ void* pRetryTmr; // used to dispatch data after a given time duration
+ TdThreadMutex lock;
+ int8_t inMonitor;
+ SArray* pSendInfo; // SArray
} SDispatchMsgInfo;
typedef struct STaskQueue {
@@ -484,7 +487,8 @@ typedef struct SStreamMeta {
SArray* pTaskList; // SArray
void* ahandle;
TXN* txn;
- FTaskExpand* expandFunc;
+ FTaskBuild* buildTaskFn;
+ FTaskExpand* expandTaskFn;
int32_t vgId;
int64_t stage;
int32_t role;
@@ -708,8 +712,8 @@ SScanhistoryDataInfo streamScanHistoryData(SStreamTask* pTask, int64_t st);
// stream task meta
void streamMetaInit();
void streamMetaCleanup();
-SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc, int32_t vgId, int64_t stage,
- startComplete_fn_t fn);
+SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskBuild expandFunc, FTaskExpand expandTaskFn,
+ int32_t vgId, int64_t stage, startComplete_fn_t fn);
void streamMetaClose(SStreamMeta* streamMeta);
int32_t streamMetaSaveTask(SStreamMeta* pMeta, SStreamTask* pTask); // save to stream meta store
int32_t streamMetaRemoveTask(SStreamMeta* pMeta, STaskId* pKey);
@@ -734,6 +738,9 @@ int32_t streamMetaAddFailedTask(SStreamMeta* pMeta, int64_t streamId, int32
void streamMetaAddFailedTaskSelf(SStreamTask* pTask, int64_t failedTs);
void streamMetaAddIntoUpdateTaskList(SStreamMeta* pMeta, SStreamTask* pTask, SStreamTask* pHTask, int32_t transId,
int64_t startTs);
+void streamMetaClearUpdateTaskList(SStreamMeta* pMeta);
+void streamMetaInitUpdateTaskList(SStreamMeta* pMeta, int32_t transId);
+
void streamMetaRLock(SStreamMeta* pMeta);
void streamMetaRUnLock(SStreamMeta* pMeta);
void streamMetaWLock(SStreamMeta* pMeta);
@@ -762,8 +769,7 @@ int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskI
int32_t streamAddCheckpointSourceRspMsg(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SStreamTask* pTask);
int32_t streamTaskBuildCheckpointSourceRsp(SStreamCheckpointSourceReq* pReq, SRpcHandleInfo* pRpcInfo, SRpcMsg* pMsg,
int32_t setCode);
-int32_t streamBuildAndSendCheckpointUpdateMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, STaskId* pHTaskId,
- SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask);
+int32_t streamSendChkptReportMsg(SStreamTask* pTask, SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask);
int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpointInfoReq* pReq);
SActiveCheckpointInfo* streamTaskCreateActiveChkptInfo();
diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h
index c3b5beb3e3..b7a459f957 100644
--- a/include/libs/transport/trpc.h
+++ b/include/libs/transport/trpc.h
@@ -62,6 +62,7 @@ typedef struct SRpcHandleInfo {
SRpcConnInfo conn;
int8_t forbiddenIp;
int8_t notFreeAhandle;
+ int8_t compressed;
} SRpcHandleInfo;
typedef struct SRpcMsg {
diff --git a/include/util/taoserror.h b/include/util/taoserror.h
index 8f8434dfc1..a06581bcad 100644
--- a/include/util/taoserror.h
+++ b/include/util/taoserror.h
@@ -24,6 +24,14 @@ extern "C" {
// clang-format off
+typedef struct {
+ int32_t val;
+ const char* str;
+ const char* macro;
+} STaosError;
+
+extern STaosError errors[];
+
#define TAOS_DEF_ERROR_CODE(mod, code) ((int32_t)((0x80000000 | ((mod)<<16) | (code))))
#define TAOS_SYSTEM_ERROR(code) (0x80ff0000 | (code))
@@ -38,6 +46,7 @@ const char* terrstr();
char* taosGetErrMsgReturn();
char* taosGetErrMsg();
int32_t* taosGetErrno();
+int32_t taosGetErrSize();
#define terrno (*taosGetErrno())
#define terrMsg (taosGetErrMsg())
@@ -316,7 +325,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_DB_OPTION_UNCHANGED TAOS_DEF_ERROR_CODE(0, 0x038A) //
#define TSDB_CODE_MND_DB_INDEX_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x038B)
#define TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO TAOS_DEF_ERROR_CODE(0, 0x038C)
-#define TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038D)
+// #define TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038D) // unused
#define TSDB_CODE_MND_INVALID_ENCRYPT_KEY TAOS_DEF_ERROR_CODE(0, 0x038E)
// #define TSDB_CODE_MND_INVALID_DB_OPTION_DAYS TAOS_DEF_ERROR_CODE(0, 0x0390) // 2.x
// #define TSDB_CODE_MND_INVALID_DB_OPTION_KEEP TAOS_DEF_ERROR_CODE(0, 0x0391) // 2.x
diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh
index 5a83cdc6a8..03e0a0b5f5 100755
--- a/packaging/tools/install.sh
+++ b/packaging/tools/install.sh
@@ -795,10 +795,10 @@ function is_version_compatible() {
if [ -f ${script_dir}/driver/vercomp.txt ]; then
min_compatible_version=$(cat ${script_dir}/driver/vercomp.txt)
else
- min_compatible_version=$(${script_dir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 5)
+ min_compatible_version=$(${script_dir}/bin/${serverName} -V | grep version | head -1 | cut -d ' ' -f 5)
fi
- exist_version=$(${installDir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 3)
+ exist_version=$(${installDir}/bin/${serverName} -V | grep version | head -1 | cut -d ' ' -f 3)
vercomp $exist_version "3.0.0.0"
case $? in
2)
diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h
index 577b7d7ac4..2fbf4eeabb 100644
--- a/source/client/inc/clientInt.h
+++ b/source/client/inc/clientInt.h
@@ -124,7 +124,6 @@ struct SAppInstInfo {
typedef struct SAppInfo {
int64_t startTime;
char appName[TSDB_APP_NAME_LEN];
- char* ep;
int32_t pid;
int32_t numOfThreads;
SHashObj* pInstMap;
@@ -197,8 +196,10 @@ typedef struct SReqResultInfo {
uint64_t current;
bool localResultFetched;
bool completed;
- int32_t precision;
bool convertUcs4;
+ char* decompBuf;
+ int32_t decompBufSize;
+ int32_t precision;
int32_t payloadLen;
char* convertJson;
} SReqResultInfo;
diff --git a/source/client/inc/clientStmt.h b/source/client/inc/clientStmt.h
index cbef80b6da..64b2acf732 100644
--- a/source/client/inc/clientStmt.h
+++ b/source/client/inc/clientStmt.h
@@ -40,6 +40,8 @@ typedef enum {
STMT_MAX,
} STMT_STATUS;
+#define STMT_TABLE_COLS_NUM 1000
+
typedef struct SStmtTableCache {
STableDataCxt *pDataCtx;
void *boundTags;
@@ -57,6 +59,7 @@ typedef struct SStmtBindInfo {
bool inExecCache;
uint64_t tbUid;
uint64_t tbSuid;
+ int32_t tbVgId;
int32_t sBindRowNum;
int32_t sBindLastIdx;
int8_t tbType;
@@ -66,8 +69,15 @@ typedef struct SStmtBindInfo {
char tbFName[TSDB_TABLE_FNAME_LEN];
char stbFName[TSDB_TABLE_FNAME_LEN];
SName sname;
+
+ char statbName[TSDB_TABLE_FNAME_LEN];
} SStmtBindInfo;
+typedef struct SStmtAsyncParam {
+ STableColsData *pTbData;
+ void* pStmt;
+} SStmtAsyncParam;
+
typedef struct SStmtExecInfo {
int32_t affectedRows;
SRequestObj *pRequest;
@@ -77,8 +87,10 @@ typedef struct SStmtExecInfo {
} SStmtExecInfo;
typedef struct SStmtSQLInfo {
+ bool stbInterlaceMode;
STMT_TYPE type;
STMT_STATUS status;
+ uint64_t suid;
uint64_t runTimes;
SHashObj *pTableCache; // SHash
SQuery *pQuery;
@@ -88,21 +100,60 @@ typedef struct SStmtSQLInfo {
SStmtQueryResInfo queryRes;
bool autoCreateTbl;
SHashObj *pVgHash;
+ SBindInfo *pBindInfo;
+
+ SStbInterlaceInfo siInfo;
} SStmtSQLInfo;
+typedef struct SStmtStatInfo {
+ int64_t ctgGetTbMetaNum;
+ int64_t getCacheTbInfo;
+ int64_t parseSqlNum;
+ int64_t bindDataNum;
+ int64_t setTbNameUs;
+ int64_t bindDataUs1;
+ int64_t bindDataUs2;
+ int64_t bindDataUs3;
+ int64_t bindDataUs4;
+ int64_t addBatchUs;
+ int64_t execWaitUs;
+ int64_t execUseUs;
+} SStmtStatInfo;
+
+typedef struct SStmtQNode {
+ bool restoreTbCols;
+ STableColsData tblData;
+ struct SStmtQNode* next;
+} SStmtQNode;
+
+typedef struct SStmtQueue {
+ bool stopQueue;
+ SStmtQNode* head;
+ SStmtQNode* tail;
+ uint64_t qRemainNum;
+} SStmtQueue;
+
+
typedef struct STscStmt {
- STscObj *taos;
- SCatalog *pCatalog;
- int32_t affectedRows;
- uint32_t seqId;
- uint32_t seqIds[STMT_MAX];
+ STscObj *taos;
+ SCatalog *pCatalog;
+ int32_t affectedRows;
+ uint32_t seqId;
+ uint32_t seqIds[STMT_MAX];
+ bool bindThreadInUse;
+ TdThread bindThread;
+ TAOS_STMT_OPTIONS options;
+ bool stbInterlaceMode;
+ SStmtQueue queue;
- SStmtSQLInfo sql;
- SStmtExecInfo exec;
- SStmtBindInfo bInfo;
+ SStmtSQLInfo sql;
+ SStmtExecInfo exec;
+ SStmtBindInfo bInfo;
- int64_t reqid;
- int32_t errCode;
+ int64_t reqid;
+ int32_t errCode;
+
+ SStmtStatInfo stat;
} STscStmt;
extern char *gStmtStatusStr[];
@@ -154,13 +205,14 @@ extern char *gStmtStatusStr[];
} while (0)
+#define STMT_FLOG(param, ...) qFatal("stmt:%p " param, pStmt, __VA_ARGS__)
#define STMT_ELOG(param, ...) qError("stmt:%p " param, pStmt, __VA_ARGS__)
#define STMT_DLOG(param, ...) qDebug("stmt:%p " param, pStmt, __VA_ARGS__)
#define STMT_ELOG_E(param) qError("stmt:%p " param, pStmt)
#define STMT_DLOG_E(param) qDebug("stmt:%p " param, pStmt)
-TAOS_STMT *stmtInit(STscObj *taos, int64_t reqid);
+TAOS_STMT *stmtInit(STscObj* taos, int64_t reqid, TAOS_STMT_OPTIONS* pOptions);
int stmtClose(TAOS_STMT *stmt);
int stmtExec(TAOS_STMT *stmt);
const char *stmtErrstr(TAOS_STMT *stmt);
diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c
index 6406bcbcd8..23b9649c6b 100644
--- a/source/client/src/clientEnv.c
+++ b/source/client/src/clientEnv.c
@@ -334,6 +334,7 @@ void *createRequest(uint64_t connId, int32_t type, int64_t reqid) {
}
SSyncQueryParam *interParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam));
if (interParam == NULL) {
+ releaseTscObj(connId);
doDestroyRequest(pRequest);
terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL;
@@ -374,6 +375,7 @@ void doFreeReqResultInfo(SReqResultInfo *pResInfo) {
taosMemoryFreeClear(pResInfo->fields);
taosMemoryFreeClear(pResInfo->userFields);
taosMemoryFreeClear(pResInfo->convertJson);
+ taosMemoryFreeClear(pResInfo->decompBuf);
if (pResInfo->convertBuf != NULL) {
for (int32_t i = 0; i < pResInfo->numOfCols; ++i) {
@@ -763,7 +765,6 @@ void taos_init_imp(void) {
clientConnRefPool = taosOpenRef(200, destroyTscObj);
clientReqRefPool = taosOpenRef(40960, doDestroyRequest);
- // transDestroyBuffer(&conn->readBuf);
taosGetAppName(appInfo.appName, NULL);
taosThreadMutexInit(&appInfo.mutex, NULL);
diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c
index 1d5bc9cfb4..1057a00725 100644
--- a/source/client/src/clientImpl.c
+++ b/source/client/src/clientImpl.c
@@ -1711,10 +1711,8 @@ void* doFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUcs4)
}
SReqResultInfo* pResInfo = &pRequest->body.resInfo;
- SSchedulerReq req = {
- .syncReq = true,
- .pFetchRes = (void**)&pResInfo->pData,
- };
+ SSchedulerReq req = { .syncReq = true, .pFetchRes = (void**)&pResInfo->pData };
+
pRequest->code = schedulerFetchRows(pRequest->body.queryJob, &req);
if (pRequest->code != TSDB_CODE_SUCCESS) {
pResultInfo->numOfRows = 0;
@@ -2065,6 +2063,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
tscError("setResultDataPtr paras error");
return TSDB_CODE_TSC_INTERNAL_ERROR;
}
+
if (numOfRows == 0) {
return TSDB_CODE_SUCCESS;
}
@@ -2195,17 +2194,58 @@ int32_t setQueryResultFromRsp(SReqResultInfo* pResultInfo, const SRetrieveTableR
taosMemoryFreeClear(pResultInfo->pRspMsg);
pResultInfo->pRspMsg = (const char*)pRsp;
- pResultInfo->pData = (void*)pRsp->data;
pResultInfo->numOfRows = htobe64(pRsp->numOfRows);
pResultInfo->current = 0;
pResultInfo->completed = (pRsp->completed == 1);
- pResultInfo->payloadLen = htonl(pRsp->compLen);
pResultInfo->precision = pRsp->precision;
+ // decompress data if needed
+ int32_t payloadLen = htonl(pRsp->payloadLen);
+
+ if (pRsp->compressed) {
+ if (pResultInfo->decompBuf == NULL) {
+ pResultInfo->decompBuf = taosMemoryMalloc(payloadLen);
+ pResultInfo->decompBufSize = payloadLen;
+ } else {
+ if (pResultInfo->decompBufSize < payloadLen) {
+ char* p = taosMemoryRealloc(pResultInfo->decompBuf, payloadLen);
+ if (p == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ tscError("failed to prepare the decompress buffer, size:%d", payloadLen);
+ return terrno;
+ }
+
+ pResultInfo->decompBuf = p;
+ pResultInfo->decompBufSize = payloadLen;
+ }
+ }
+ }
+
+ if (payloadLen > 0) {
+ int32_t compLen = *(int32_t*)pRsp->data;
+ int32_t rawLen = *(int32_t*)(pRsp->data + sizeof(int32_t));
+
+ char* pStart = (char*)pRsp->data + sizeof(int32_t) * 2;
+
+ if (pRsp->compressed && compLen < rawLen) {
+ int32_t len = tsDecompressString(pStart, compLen, 1, pResultInfo->decompBuf, rawLen, ONE_STAGE_COMP, NULL, 0);
+ ASSERT(len == rawLen);
+
+ pResultInfo->pData = pResultInfo->decompBuf;
+ pResultInfo->payloadLen = rawLen;
+ } else {
+ pResultInfo->pData = pStart;
+ pResultInfo->payloadLen = htonl(pRsp->compLen);
+ ASSERT(pRsp->compLen == pRsp->payloadLen);
+ }
+ }
+
// TODO handle the compressed case
pResultInfo->totalRows += pResultInfo->numOfRows;
- return setResultDataPtr(pResultInfo, pResultInfo->fields, pResultInfo->numOfCols, pResultInfo->numOfRows,
- convertUcs4);
+
+ int32_t code =
+ setResultDataPtr(pResultInfo, pResultInfo->fields, pResultInfo->numOfCols, pResultInfo->numOfRows, convertUcs4);
+ return code;
}
TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* details, int maxlen) {
diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c
index da5da044a7..81ae465cd2 100644
--- a/source/client/src/clientMain.c
+++ b/source/client/src/clientMain.c
@@ -1552,7 +1552,7 @@ TAOS_STMT *taos_stmt_init(TAOS *taos) {
return NULL;
}
- TAOS_STMT *pStmt = stmtInit(pObj, 0);
+ TAOS_STMT *pStmt = stmtInit(pObj, 0, NULL);
releaseTscObj(*(int64_t *)taos);
@@ -1567,13 +1567,29 @@ TAOS_STMT *taos_stmt_init_with_reqid(TAOS *taos, int64_t reqid) {
return NULL;
}
- TAOS_STMT *pStmt = stmtInit(pObj, reqid);
+ TAOS_STMT *pStmt = stmtInit(pObj, reqid, NULL);
releaseTscObj(*(int64_t *)taos);
return pStmt;
}
+TAOS_STMT *taos_stmt_init_with_options(TAOS *taos, TAOS_STMT_OPTIONS *options) {
+ STscObj *pObj = acquireTscObj(*(int64_t *)taos);
+ if (NULL == pObj) {
+ tscError("invalid parameter for %s", __FUNCTION__);
+ terrno = TSDB_CODE_TSC_DISCONNECTED;
+ return NULL;
+ }
+
+ TAOS_STMT *pStmt = stmtInit(pObj, options->reqId, options);
+
+ releaseTscObj(*(int64_t *)taos);
+
+ return pStmt;
+}
+
+
int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length) {
if (stmt == NULL || sql == NULL) {
tscError("NULL parameter for %s", __FUNCTION__);
diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c
index 360a346fb7..f04e5e53c6 100644
--- a/source/client/src/clientMsgHandler.c
+++ b/source/client/src/clientMsgHandler.c
@@ -25,6 +25,7 @@
#include "tglobal.h"
#include "tname.h"
#include "tversion.h"
+#include "command.h"
extern SClientHbMgr clientHbMgr;
@@ -499,7 +500,7 @@ static int32_t buildShowVariablesRsp(SArray* pVars, SRetrieveTableRsp** pRsp) {
return code;
}
- size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
+ size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
*pRsp = taosMemoryCalloc(1, rspSize);
if (NULL == *pRsp) {
blockDataDestroy(pBlock);
@@ -510,14 +511,20 @@ static int32_t buildShowVariablesRsp(SArray* pVars, SRetrieveTableRsp** pRsp) {
(*pRsp)->completed = 1;
(*pRsp)->precision = 0;
(*pRsp)->compressed = 0;
- (*pRsp)->compLen = 0;
+
(*pRsp)->numOfRows = htobe64((int64_t)pBlock->info.rows);
(*pRsp)->numOfCols = htonl(SHOW_VARIABLES_RESULT_COLS);
- int32_t len = blockEncode(pBlock, (*pRsp)->data, SHOW_VARIABLES_RESULT_COLS);
+ int32_t len = blockEncode(pBlock, (*pRsp)->data + PAYLOAD_PREFIX_LEN, SHOW_VARIABLES_RESULT_COLS);
blockDataDestroy(pBlock);
- if (len != rspSize - sizeof(SRetrieveTableRsp)) {
+ SET_PAYLOAD_LEN((*pRsp)->data, len, len);
+
+ int32_t payloadLen = len + PAYLOAD_PREFIX_LEN;
+ (*pRsp)->payloadLen = htonl(payloadLen);
+ (*pRsp)->compLen = htonl(payloadLen);
+
+ if (payloadLen != rspSize - sizeof(SRetrieveTableRsp)) {
uError("buildShowVariablesRsp error, len:%d != rspSize - sizeof(SRetrieveTableRsp):%" PRIu64, len,
(uint64_t)(rspSize - sizeof(SRetrieveTableRsp)));
return TSDB_CODE_TSC_INVALID_INPUT;
@@ -611,7 +618,7 @@ static int32_t buildRetriveTableRspForCompactDb(SCompactDbRsp* pCompactDb, SRetr
return code;
}
- size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
+ size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
*pRsp = taosMemoryCalloc(1, rspSize);
if (NULL == *pRsp) {
blockDataDestroy(pBlock);
@@ -623,13 +630,20 @@ static int32_t buildRetriveTableRspForCompactDb(SCompactDbRsp* pCompactDb, SRetr
(*pRsp)->precision = 0;
(*pRsp)->compressed = 0;
(*pRsp)->compLen = 0;
+ (*pRsp)->payloadLen = 0;
(*pRsp)->numOfRows = htobe64((int64_t)pBlock->info.rows);
(*pRsp)->numOfCols = htonl(COMPACT_DB_RESULT_COLS);
- int32_t len = blockEncode(pBlock, (*pRsp)->data, COMPACT_DB_RESULT_COLS);
+ int32_t len = blockEncode(pBlock, (*pRsp)->data + PAYLOAD_PREFIX_LEN, COMPACT_DB_RESULT_COLS);
blockDataDestroy(pBlock);
- if (len != rspSize - sizeof(SRetrieveTableRsp)) {
+ SET_PAYLOAD_LEN((*pRsp)->data, len, len);
+
+ int32_t payloadLen = len + PAYLOAD_PREFIX_LEN;
+ (*pRsp)->payloadLen = htonl(payloadLen);
+ (*pRsp)->compLen = htonl(payloadLen);
+
+ if (payloadLen != rspSize - sizeof(SRetrieveTableRsp)) {
uError("buildRetriveTableRspForCompactDb error, len:%d != rspSize - sizeof(SRetrieveTableRsp):%" PRIu64, len,
(uint64_t)(rspSize - sizeof(SRetrieveTableRsp)));
return TSDB_CODE_TSC_INVALID_INPUT;
diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c
index 36a3e50aef..32d31585ea 100644
--- a/source/client/src/clientStmt.c
+++ b/source/client/src/clientStmt.c
@@ -8,6 +8,60 @@
char* gStmtStatusStr[] = {"unknown", "init", "prepare", "settbname", "settags",
"fetchFields", "bind", "bindCol", "addBatch", "exec"};
+static FORCE_INLINE int32_t stmtAllocQNodeFromBuf(STableBufInfo* pTblBuf, void** pBuf) {
+ if (pTblBuf->buffOffset < pTblBuf->buffSize) {
+ *pBuf = (char*)pTblBuf->pCurBuff + pTblBuf->buffOffset;
+ pTblBuf->buffOffset += pTblBuf->buffUnit;
+ } else if (pTblBuf->buffIdx < taosArrayGetSize(pTblBuf->pBufList)) {
+ pTblBuf->pCurBuff = taosArrayGetP(pTblBuf->pBufList, pTblBuf->buffIdx++);
+ *pBuf = pTblBuf->pCurBuff;
+ pTblBuf->buffOffset = pTblBuf->buffUnit;
+ } else {
+ void *buff = taosMemoryMalloc(pTblBuf->buffSize);
+ if (NULL == buff) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ taosArrayPush(pTblBuf->pBufList, &buff);
+
+ pTblBuf->buffIdx++;
+ pTblBuf->pCurBuff = buff;
+ *pBuf = buff;
+ pTblBuf->buffOffset = pTblBuf->buffUnit;
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
+bool stmtDequeue(STscStmt* pStmt, SStmtQNode **param) {
+ while (0 == atomic_load_64(&pStmt->queue.qRemainNum)) {
+ taosUsleep(1);
+ return false;
+ }
+
+ SStmtQNode *orig = pStmt->queue.head;
+
+ SStmtQNode *node = pStmt->queue.head->next;
+ pStmt->queue.head = pStmt->queue.head->next;
+
+ //taosMemoryFreeClear(orig);
+
+ *param = node;
+
+ atomic_sub_fetch_64(&pStmt->queue.qRemainNum, 1);
+
+ return true;
+}
+
+void stmtEnqueue(STscStmt* pStmt, SStmtQNode* param) {
+ pStmt->queue.tail->next = param;
+ pStmt->queue.tail = param;
+
+ pStmt->stat.bindDataNum++;
+ atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1);
+}
+
+
static int32_t stmtCreateRequest(STscStmt* pStmt) {
int32_t code = 0;
@@ -42,7 +96,10 @@ int32_t stmtSwitchStatus(STscStmt* pStmt, STMT_STATUS newStatus) {
pStmt->errCode = 0;
break;
case STMT_SETTBNAME:
- if (STMT_STATUS_EQ(INIT) || STMT_STATUS_EQ(BIND) || STMT_STATUS_EQ(BIND_COL)) {
+ if (STMT_STATUS_EQ(INIT)) {
+ code = TSDB_CODE_TSC_STMT_API_ERROR;
+ }
+ if (!pStmt->sql.stbInterlaceMode && (STMT_STATUS_EQ(BIND) || STMT_STATUS_EQ(BIND_COL))) {
code = TSDB_CODE_TSC_STMT_API_ERROR;
}
break;
@@ -170,6 +227,7 @@ int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags,
pStmt->bInfo.tbUid = autoCreateTbl ? 0 : pTableMeta->uid;
pStmt->bInfo.tbSuid = pTableMeta->suid;
+ pStmt->bInfo.tbVgId = pTableMeta->vgId;
pStmt->bInfo.tbType = pTableMeta->tableType;
pStmt->bInfo.boundTags = tags;
pStmt->bInfo.tagsCached = false;
@@ -195,6 +253,9 @@ int32_t stmtUpdateInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, SNam
STMT_ERR_RET(stmtUpdateExecInfo(stmt, pVgHash, pBlockHash));
pStmt->sql.autoCreateTbl = autoCreateTbl;
+ if (pStmt->sql.autoCreateTbl) {
+ pStmt->sql.stbInterlaceMode = false;
+ }
return TSDB_CODE_SUCCESS;
}
@@ -261,14 +322,46 @@ int32_t stmtParseSql(STscStmt* pStmt) {
STMT_ERR_RET(stmtCreateRequest(pStmt));
+ pStmt->stat.parseSqlNum++;
STMT_ERR_RET(parseSql(pStmt->exec.pRequest, false, &pStmt->sql.pQuery, &stmtCb));
-
+ pStmt->sql.siInfo.pQuery = pStmt->sql.pQuery;
+
pStmt->bInfo.needParse = false;
if (pStmt->sql.pQuery->pRoot && 0 == pStmt->sql.type) {
pStmt->sql.type = STMT_TYPE_INSERT;
+ pStmt->sql.stbInterlaceMode = false;
} else if (pStmt->sql.pQuery->pPrepareRoot) {
pStmt->sql.type = STMT_TYPE_QUERY;
+ pStmt->sql.stbInterlaceMode = false;
+
+ return TSDB_CODE_SUCCESS;
+ }
+
+ STableDataCxt** pSrc = (STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
+ if (NULL == pSrc || NULL == *pSrc) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ STableDataCxt* pTableCtx = *pSrc;
+ if (pStmt->sql.stbInterlaceMode) {
+ int16_t lastIdx = -1;
+
+ for (int32_t i = 0; i < pTableCtx->boundColsInfo.numOfBound; ++i) {
+ if (pTableCtx->boundColsInfo.pColIndex[i] < lastIdx) {
+ pStmt->sql.stbInterlaceMode = false;
+ break;
+ }
+
+ lastIdx = pTableCtx->boundColsInfo.pColIndex[i];
+ }
+ }
+
+ if (NULL == pStmt->sql.pBindInfo) {
+ pStmt->sql.pBindInfo = taosMemoryMalloc(pTableCtx->boundColsInfo.numOfBound * sizeof(*pStmt->sql.pBindInfo));
+ if (NULL == pStmt->sql.pBindInfo) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
}
return TSDB_CODE_SUCCESS;
@@ -277,6 +370,7 @@ int32_t stmtParseSql(STscStmt* pStmt) {
int32_t stmtCleanBindInfo(STscStmt* pStmt) {
pStmt->bInfo.tbUid = 0;
pStmt->bInfo.tbSuid = 0;
+ pStmt->bInfo.tbVgId = -1;
pStmt->bInfo.tbType = 0;
pStmt->bInfo.needParse = true;
pStmt->bInfo.inExecCache = false;
@@ -287,55 +381,96 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
qDestroyBoundColInfo(pStmt->bInfo.boundTags);
taosMemoryFreeClear(pStmt->bInfo.boundTags);
}
- memset(pStmt->bInfo.stbFName, 0, TSDB_TABLE_FNAME_LEN);
+ pStmt->bInfo.stbFName[0] = 0;;
return TSDB_CODE_SUCCESS;
}
+void stmtFreeTableBlkList(STableColsData* pTb) {
+ qResetStmtColumns(pTb->aCol, true);
+ taosArrayDestroy(pTb->aCol);
+}
+
+void stmtResetQueueTableBuf(STableBufInfo* pTblBuf, SStmtQueue* pQueue) {
+ pTblBuf->pCurBuff = taosArrayGetP(pTblBuf->pBufList, 0);
+ pTblBuf->buffIdx = 1;
+ pTblBuf->buffOffset = sizeof(*pQueue->head);
+
+ pQueue->head = pQueue->tail = pTblBuf->pCurBuff;
+ pQueue->qRemainNum = 0;
+ pQueue->head->next = NULL;
+}
+
int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
- if (STMT_TYPE_QUERY != pStmt->sql.type || deepClean) {
- taos_free_result(pStmt->exec.pRequest);
- pStmt->exec.pRequest = NULL;
- }
+ if (pStmt->sql.stbInterlaceMode) {
+ if (deepClean) {
+ taosHashCleanup(pStmt->exec.pBlockHash);
+ pStmt->exec.pBlockHash = NULL;
- size_t keyLen = 0;
- void* pIter = taosHashIterate(pStmt->exec.pBlockHash, NULL);
- while (pIter) {
- STableDataCxt* pBlocks = *(STableDataCxt**)pIter;
- char* key = taosHashGetKey(pIter, &keyLen);
- STableMeta* pMeta = qGetTableMetaInDataBlock(pBlocks);
-
- if (keepTable && pBlocks == pStmt->exec.pCurrBlock) {
- TSWAP(pBlocks->pData, pStmt->exec.pCurrTbData);
- STMT_ERR_RET(qResetStmtDataBlock(pBlocks, false));
-
- pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
- continue;
+ if (NULL != pStmt->exec.pCurrBlock) {
+ taosMemoryFreeClear(pStmt->exec.pCurrBlock->pData);
+ qDestroyStmtDataBlock(pStmt->exec.pCurrBlock);
+ }
+ } else {
+ pStmt->sql.siInfo.pTableColsIdx = 0;
+ stmtResetQueueTableBuf(&pStmt->sql.siInfo.tbBuf, &pStmt->queue);
+ }
+ } else {
+ if (STMT_TYPE_QUERY != pStmt->sql.type || deepClean) {
+ taos_free_result(pStmt->exec.pRequest);
+ pStmt->exec.pRequest = NULL;
}
- qDestroyStmtDataBlock(pBlocks);
- taosHashRemove(pStmt->exec.pBlockHash, key, keyLen);
+ size_t keyLen = 0;
+ void* pIter = taosHashIterate(pStmt->exec.pBlockHash, NULL);
+ while (pIter) {
+ STableDataCxt* pBlocks = *(STableDataCxt**)pIter;
+ char* key = taosHashGetKey(pIter, &keyLen);
+ STableMeta* pMeta = qGetTableMetaInDataBlock(pBlocks);
- pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
+ if (keepTable && pBlocks == pStmt->exec.pCurrBlock) {
+ TSWAP(pBlocks->pData, pStmt->exec.pCurrTbData);
+ STMT_ERR_RET(qResetStmtDataBlock(pBlocks, false));
+
+ pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
+ continue;
+ }
+
+ qDestroyStmtDataBlock(pBlocks);
+ taosHashRemove(pStmt->exec.pBlockHash, key, keyLen);
+
+ pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
+ }
+
+ if (keepTable) {
+ return TSDB_CODE_SUCCESS;
+ }
+
+ taosHashCleanup(pStmt->exec.pBlockHash);
+ pStmt->exec.pBlockHash = NULL;
+
+ tDestroySubmitTbData(pStmt->exec.pCurrTbData, TSDB_MSG_FLG_ENCODE);
+ taosMemoryFreeClear(pStmt->exec.pCurrTbData);
}
- if (keepTable) {
- return TSDB_CODE_SUCCESS;
- }
-
- taosHashCleanup(pStmt->exec.pBlockHash);
- pStmt->exec.pBlockHash = NULL;
-
- tDestroySubmitTbData(pStmt->exec.pCurrTbData, TSDB_MSG_FLG_ENCODE);
- taosMemoryFreeClear(pStmt->exec.pCurrTbData);
-
STMT_ERR_RET(stmtCleanBindInfo(pStmt));
return TSDB_CODE_SUCCESS;
}
+void stmtFreeTbBuf(void *buf) {
+ void* pBuf = *(void**)buf;
+ taosMemoryFree(pBuf);
+}
+
+void stmtFreeTbCols(void *buf) {
+ SArray* pCols = *(SArray**)buf;
+ taosArrayDestroy(pCols);
+}
+
int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
STMT_DLOG_E("start to free SQL info");
-
+
+ taosMemoryFree(pStmt->sql.pBindInfo);
taosMemoryFree(pStmt->sql.queryRes.fields);
taosMemoryFree(pStmt->sql.queryRes.userFields);
taosMemoryFree(pStmt->sql.sqlStr);
@@ -360,34 +495,68 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
STMT_ERR_RET(stmtCleanExecInfo(pStmt, false, true));
STMT_ERR_RET(stmtCleanBindInfo(pStmt));
+ taos_free_result(pStmt->sql.siInfo.pRequest);
+ taosHashCleanup(pStmt->sql.siInfo.pVgroupHash);
+ tSimpleHashCleanup(pStmt->sql.siInfo.pTableHash);
+ taosArrayDestroyEx(pStmt->sql.siInfo.tbBuf.pBufList, stmtFreeTbBuf);
+ taosMemoryFree(pStmt->sql.siInfo.pTSchema);
+ qDestroyStmtDataBlock(pStmt->sql.siInfo.pDataCtx);
+ taosArrayDestroyEx(pStmt->sql.siInfo.pTableCols, stmtFreeTbCols);
+
memset(&pStmt->sql, 0, sizeof(pStmt->sql));
+ pStmt->sql.siInfo.tableColsReady = true;
+
STMT_DLOG_E("end to free SQL info");
return TSDB_CODE_SUCCESS;
}
-int32_t stmtRebuildDataBlock(STscStmt* pStmt, STableDataCxt* pDataBlock, STableDataCxt** newBlock, uint64_t uid,
- uint64_t suid) {
- SEpSet ep = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
+
+int32_t stmtTryAddTableVgroupInfo(STscStmt* pStmt, int32_t* vgId) {
+ if (*vgId >= 0 && taosHashGet(pStmt->sql.pVgHash, (const char*)vgId, sizeof(*vgId))) {
+ return TSDB_CODE_SUCCESS;
+ }
+
SVgroupInfo vgInfo = {0};
SRequestConnInfo conn = {.pTrans = pStmt->taos->pAppInfo->pTransporter,
.requestId = pStmt->exec.pRequest->requestId,
.requestObjRefId = pStmt->exec.pRequest->self,
.mgmtEps = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp)};
- STMT_ERR_RET(catalogGetTableHashVgroup(pStmt->pCatalog, &conn, &pStmt->bInfo.sname, &vgInfo));
- STMT_ERR_RET(
- taosHashPut(pStmt->sql.pVgHash, (const char*)&vgInfo.vgId, sizeof(vgInfo.vgId), (char*)&vgInfo, sizeof(vgInfo)));
+ int32_t code = catalogGetTableHashVgroup(pStmt->pCatalog, &conn, &pStmt->bInfo.sname, &vgInfo);
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ code = taosHashPut(pStmt->sql.pVgHash, (const char*)&vgInfo.vgId, sizeof(vgInfo.vgId), (char*)&vgInfo, sizeof(vgInfo));
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
- STMT_ERR_RET(qRebuildStmtDataBlock(newBlock, pDataBlock, uid, suid, vgInfo.vgId, pStmt->sql.autoCreateTbl));
+ *vgId = vgInfo.vgId;
+
+ return TSDB_CODE_SUCCESS;
+}
- STMT_DLOG("tableDataCxt rebuilt, uid:%" PRId64 ", vgId:%d", uid, vgInfo.vgId);
+
+int32_t stmtRebuildDataBlock(STscStmt* pStmt, STableDataCxt* pDataBlock, STableDataCxt** newBlock, uint64_t uid,
+ uint64_t suid, int32_t vgId) {
+ STMT_ERR_RET(stmtTryAddTableVgroupInfo(pStmt, &vgId));
+ STMT_ERR_RET(qRebuildStmtDataBlock(newBlock, pDataBlock, uid, suid, vgId, pStmt->sql.autoCreateTbl));
+
+ STMT_DLOG("tableDataCxt rebuilt, uid:%" PRId64 ", vgId:%d", uid, vgId);
return TSDB_CODE_SUCCESS;
}
int32_t stmtGetFromCache(STscStmt* pStmt) {
+ if (pStmt->sql.stbInterlaceMode && pStmt->sql.siInfo.pDataCtx) {
+ pStmt->bInfo.needParse = false;
+ pStmt->bInfo.inExecCache = false;
+ return TSDB_CODE_SUCCESS;
+ }
+
pStmt->bInfo.needParse = true;
pStmt->bInfo.inExecCache = false;
@@ -404,6 +573,11 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
}
}
+ if (NULL == pStmt->pCatalog) {
+ STMT_ERR_RET(catalogGetHandle(pStmt->taos->pAppInfo->clusterId, &pStmt->pCatalog));
+ pStmt->sql.siInfo.pCatalog = pStmt->pCatalog;
+ }
+
if (NULL == pStmt->sql.pTableCache || taosHashGetSize(pStmt->sql.pTableCache) <= 0) {
if (pStmt->bInfo.inExecCache) {
pStmt->bInfo.needParse = false;
@@ -415,9 +589,6 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
return TSDB_CODE_SUCCESS;
}
- if (NULL == pStmt->pCatalog) {
- STMT_ERR_RET(catalogGetHandle(pStmt->taos->pAppInfo->clusterId, &pStmt->pCatalog));
- }
if (pStmt->sql.autoCreateTbl) {
SStmtTableCache* pCache = taosHashGet(pStmt->sql.pTableCache, &pStmt->bInfo.tbSuid, sizeof(pStmt->bInfo.tbSuid));
@@ -426,7 +597,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
pStmt->bInfo.tbUid = 0;
STableDataCxt* pNewBlock = NULL;
- STMT_ERR_RET(stmtRebuildDataBlock(pStmt, pCache->pDataCtx, &pNewBlock, 0, pStmt->bInfo.tbSuid));
+ STMT_ERR_RET(stmtRebuildDataBlock(pStmt, pCache->pDataCtx, &pNewBlock, 0, pStmt->bInfo.tbSuid, -1));
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
POINTER_BYTES)) {
@@ -443,12 +614,19 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
STMT_RET(stmtCleanBindInfo(pStmt));
}
+ uint64_t uid, suid;
+ int32_t vgId;
+ int8_t tableType;
+
STableMeta* pTableMeta = NULL;
SRequestConnInfo conn = {.pTrans = pStmt->taos->pAppInfo->pTransporter,
.requestId = pStmt->exec.pRequest->requestId,
.requestObjRefId = pStmt->exec.pRequest->self,
.mgmtEps = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp)};
int32_t code = catalogGetTableMeta(pStmt->pCatalog, &conn, &pStmt->bInfo.sname, &pTableMeta);
+
+ pStmt->stat.ctgGetTbMetaNum++;
+
if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code) {
tscDebug("tb %s not exist", pStmt->bInfo.tbFName);
stmtCleanBindInfo(pStmt);
@@ -458,10 +636,14 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
STMT_ERR_RET(code);
- uint64_t uid = pTableMeta->uid;
- uint64_t suid = pTableMeta->suid;
- int8_t tableType = pTableMeta->tableType;
+ uid = pTableMeta->uid;
+ suid = pTableMeta->suid;
+ tableType = pTableMeta->tableType;
+ pStmt->bInfo.tbVgId = pTableMeta->vgId;
+ vgId = pTableMeta->vgId;
+
taosMemoryFree(pTableMeta);
+
uint64_t cacheUid = (TSDB_CHILD_TABLE == tableType) ? suid : uid;
if (uid == pStmt->bInfo.tbUid) {
@@ -493,7 +675,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
return TSDB_CODE_SUCCESS;
}
-
+
SStmtTableCache* pCache = taosHashGet(pStmt->sql.pTableCache, &cacheUid, sizeof(cacheUid));
if (pCache) {
pStmt->bInfo.needParse = false;
@@ -505,7 +687,7 @@ int32_t stmtGetFromCache(STscStmt* pStmt) {
pStmt->bInfo.tagsCached = true;
STableDataCxt* pNewBlock = NULL;
- STMT_ERR_RET(stmtRebuildDataBlock(pStmt, pCache->pDataCtx, &pNewBlock, uid, suid));
+ STMT_ERR_RET(stmtRebuildDataBlock(pStmt, pCache->pDataCtx, &pNewBlock, uid, suid, vgId));
if (taosHashPut(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName), &pNewBlock,
POINTER_BYTES)) {
@@ -538,9 +720,102 @@ int32_t stmtResetStmt(STscStmt* pStmt) {
return TSDB_CODE_SUCCESS;
}
-TAOS_STMT* stmtInit(STscObj* taos, int64_t reqid) {
+
+int32_t stmtAsyncOutput(STscStmt* pStmt, void* param) {
+ SStmtQNode* pParam = (SStmtQNode*)param;
+
+ if (pParam->restoreTbCols) {
+ for (int32_t i = 0; i < pStmt->sql.siInfo.pTableColsIdx; ++i) {
+ SArray** p = (SArray**)TARRAY_GET_ELEM(pStmt->sql.siInfo.pTableCols, i);
+ *p = taosArrayInit(20, POINTER_BYTES);
+ }
+
+ atomic_store_8((int8_t*)&pStmt->sql.siInfo.tableColsReady, true);
+ } else {
+ STMT_ERR_RET(qAppendStmtTableOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, &pParam->tblData, pStmt->exec.pCurrBlock, &pStmt->sql.siInfo));
+
+ //taosMemoryFree(pParam->pTbData);
+
+ atomic_sub_fetch_64(&pStmt->sql.siInfo.tbRemainNum, 1);
+ }
+ return TSDB_CODE_SUCCESS;
+}
+
+
+void *stmtBindThreadFunc(void *param) {
+ setThreadName("stmtBind");
+
+ qInfo("stmt bind thread started");
+
+ STscStmt* pStmt = (STscStmt*)param;
+
+ while (true) {
+ if (atomic_load_8((int8_t *)&pStmt->queue.stopQueue)) {
+ break;
+ }
+
+ SStmtQNode *asyncParam = NULL;
+ if (!stmtDequeue(pStmt, &asyncParam)) {
+ continue;
+ }
+
+ stmtAsyncOutput(pStmt, asyncParam);
+ }
+
+ qInfo("stmt bind thread stopped");
+
+ return NULL;
+}
+
+
+int32_t stmtStartBindThread(STscStmt* pStmt) {
+ TdThreadAttr thAttr;
+ taosThreadAttrInit(&thAttr);
+ taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE);
+
+ if (taosThreadCreate(&pStmt->bindThread, &thAttr, stmtBindThreadFunc, pStmt) != 0) {
+ terrno = TAOS_SYSTEM_ERROR(errno);
+ STMT_ERR_RET(terrno);
+ }
+
+ pStmt->bindThreadInUse = true;
+
+ taosThreadAttrDestroy(&thAttr);
+ return TSDB_CODE_SUCCESS;
+}
+
+int32_t stmtInitQueue(STscStmt* pStmt) {
+ STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)&pStmt->queue.head));
+ pStmt->queue.tail = pStmt->queue.head;
+
+ return TSDB_CODE_SUCCESS;
+}
+
+int32_t stmtInitTableBuf(STableBufInfo* pTblBuf) {
+ pTblBuf->buffUnit = sizeof(SStmtQNode);
+ pTblBuf->buffSize = pTblBuf->buffUnit * 1000;
+ pTblBuf->pBufList = taosArrayInit(100, POINTER_BYTES);
+ if (NULL == pTblBuf->pBufList) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ void *buff = taosMemoryMalloc(pTblBuf->buffSize);
+ if (NULL == buff) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ taosArrayPush(pTblBuf->pBufList, &buff);
+
+ pTblBuf->pCurBuff = buff;
+ pTblBuf->buffIdx = 1;
+ pTblBuf->buffOffset = 0;
+
+ return TSDB_CODE_SUCCESS;
+}
+
+TAOS_STMT* stmtInit(STscObj* taos, int64_t reqid, TAOS_STMT_OPTIONS* pOptions) {
STscObj* pObj = (STscObj*)taos;
STscStmt* pStmt = NULL;
+ int32_t code = 0;
pStmt = taosMemoryCalloc(1, sizeof(STscStmt));
if (NULL == pStmt) {
@@ -560,6 +835,45 @@ TAOS_STMT* stmtInit(STscObj* taos, int64_t reqid) {
pStmt->sql.status = STMT_INIT;
pStmt->reqid = reqid;
+ if (NULL != pOptions) {
+ memcpy(&pStmt->options, pOptions, sizeof(pStmt->options));
+ if (pOptions->singleStbInsert && pOptions->singleTableBindOnce) {
+ pStmt->stbInterlaceMode = true;
+ }
+ }
+
+ if (pStmt->stbInterlaceMode) {
+ pStmt->sql.siInfo.transport = taos->pAppInfo->pTransporter;
+ pStmt->sql.siInfo.acctId = taos->acctId;
+ pStmt->sql.siInfo.dbname = taos->db;
+ pStmt->sql.siInfo.mgmtEpSet = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp);
+ pStmt->sql.siInfo.pTableHash = tSimpleHashInit(100, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY));
+ if (NULL == pStmt->sql.siInfo.pTableHash) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ stmtClose(pStmt);
+ return NULL;
+ }
+ pStmt->sql.siInfo.pTableCols = taosArrayInit(STMT_TABLE_COLS_NUM, POINTER_BYTES);
+ if (NULL == pStmt->sql.siInfo.pTableCols) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ stmtClose(pStmt);
+ return NULL;
+ }
+
+ code = stmtInitTableBuf(&pStmt->sql.siInfo.tbBuf);
+ if (TSDB_CODE_SUCCESS == code) {
+ stmtInitQueue(pStmt);
+ code = stmtStartBindThread(pStmt);
+ }
+ if (TSDB_CODE_SUCCESS != code) {
+ terrno = code;
+ stmtClose(pStmt);
+ return NULL;
+ }
+ }
+
+ pStmt->sql.siInfo.tableColsReady = true;
+
STMT_LOG_SEQ(STMT_INIT);
tscDebug("stmt:%p initialized", pStmt);
@@ -584,6 +898,33 @@ int stmtPrepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
pStmt->sql.sqlStr = strndup(sql, length);
pStmt->sql.sqlLen = length;
+ pStmt->sql.stbInterlaceMode = pStmt->stbInterlaceMode;
+
+ return TSDB_CODE_SUCCESS;
+}
+
+int32_t stmtInitStbInterlaceTableInfo(STscStmt* pStmt) {
+ STableDataCxt** pSrc = taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
+ if (!pSrc) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ STableDataCxt* pDst = NULL;
+
+ STMT_ERR_RET(qCloneStmtDataBlock(&pDst, *pSrc, true));
+ pStmt->sql.siInfo.pDataCtx = pDst;
+
+ SArray* pTblCols = NULL;
+ for (int32_t i = 0; i < STMT_TABLE_COLS_NUM; i++) {
+ pTblCols = taosArrayInit(20, POINTER_BYTES);
+ if (NULL == pTblCols) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ taosArrayPush(pStmt->sql.siInfo.pTableCols, &pTblCols);
+ }
+
+ pStmt->sql.siInfo.boundTags = pStmt->bInfo.boundTags;
+
return TSDB_CODE_SUCCESS;
}
@@ -591,6 +932,8 @@ int stmtPrepare(TAOS_STMT* stmt, const char* sql, unsigned long length) {
int stmtSetTbName(TAOS_STMT* stmt, const char* tbName) {
STscStmt* pStmt = (STscStmt*)stmt;
+ int64_t startUs = taosGetTimestampUs();
+
STMT_DLOG("start to set tbName: %s", tbName);
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_SETTBNAME));
@@ -602,21 +945,35 @@ int stmtSetTbName(TAOS_STMT* stmt, const char* tbName) {
STMT_ERR_RET(TSDB_CODE_TSC_STMT_API_ERROR);
}
- STMT_ERR_RET(stmtCreateRequest(pStmt));
+ if (!pStmt->sql.stbInterlaceMode || NULL == pStmt->sql.siInfo.pDataCtx) {
+ STMT_ERR_RET(stmtCreateRequest(pStmt));
- STMT_ERR_RET(qCreateSName(&pStmt->bInfo.sname, tbName, pStmt->taos->acctId, pStmt->exec.pRequest->pDb,
- pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen));
- tNameExtractFullName(&pStmt->bInfo.sname, pStmt->bInfo.tbFName);
+ STMT_ERR_RET(qCreateSName(&pStmt->bInfo.sname, tbName, pStmt->taos->acctId, pStmt->exec.pRequest->pDb,
+ pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen));
+ tNameExtractFullName(&pStmt->bInfo.sname, pStmt->bInfo.tbFName);
+
+ STMT_ERR_RET(stmtGetFromCache(pStmt));
- STMT_ERR_RET(stmtGetFromCache(pStmt));
-
- if (pStmt->bInfo.needParse) {
+ if (pStmt->bInfo.needParse) {
+ strncpy(pStmt->bInfo.tbName, tbName, sizeof(pStmt->bInfo.tbName) - 1);
+ pStmt->bInfo.tbName[sizeof(pStmt->bInfo.tbName) - 1] = 0;
+
+ STMT_ERR_RET(stmtParseSql(pStmt));
+ }
+ } else {
strncpy(pStmt->bInfo.tbName, tbName, sizeof(pStmt->bInfo.tbName) - 1);
pStmt->bInfo.tbName[sizeof(pStmt->bInfo.tbName) - 1] = 0;
-
- STMT_ERR_RET(stmtParseSql(pStmt));
+ pStmt->exec.pRequest->requestId++;
+ pStmt->bInfo.needParse = false;
}
+ if (pStmt->sql.stbInterlaceMode && NULL == pStmt->sql.siInfo.pDataCtx) {
+ STMT_ERR_RET(stmtInitStbInterlaceTableInfo(pStmt));
+ }
+
+ int64_t startUs2 = taosGetTimestampUs();
+ pStmt->stat.setTbNameUs += startUs2 - startUs;
+
return TSDB_CODE_SUCCESS;
}
@@ -670,11 +1027,16 @@ int stmtFetchColFields(STscStmt* pStmt, int32_t* fieldNum, TAOS_FIELD_E** fields
STMT_ERR_RET(TSDB_CODE_TSC_STMT_API_ERROR);
}
- STableDataCxt** pDataBlock =
- (STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
- if (NULL == pDataBlock) {
- tscError("table %s not found in exec blockHash", pStmt->bInfo.tbFName);
- STMT_ERR_RET(TSDB_CODE_APP_ERROR);
+ STableDataCxt** pDataBlock = NULL;
+
+ if (pStmt->sql.stbInterlaceMode) {
+ pDataBlock = &pStmt->sql.siInfo.pDataCtx;
+ } else {
+ pDataBlock = (STableDataCxt**)taosHashGet(pStmt->exec.pBlockHash, pStmt->bInfo.tbFName, strlen(pStmt->bInfo.tbFName));
+ if (NULL == pDataBlock) {
+ tscError("table %s not found in exec blockHash", pStmt->bInfo.tbFName);
+ STMT_ERR_RET(TSDB_CODE_APP_ERROR);
+ }
}
STMT_ERR_RET(qBuildStmtColFields(*pDataBlock, fieldNum, fields));
@@ -682,9 +1044,90 @@ int stmtFetchColFields(STscStmt* pStmt, int32_t* fieldNum, TAOS_FIELD_E** fields
return TSDB_CODE_SUCCESS;
}
+/*
+SArray* stmtGetFreeCol(STscStmt* pStmt, int32_t* idx) {
+ while (true) {
+ if (pStmt->exec.smInfo.pColIdx >= STMT_COL_BUF_SIZE) {
+ pStmt->exec.smInfo.pColIdx = 0;
+ }
+
+ if ((pStmt->exec.smInfo.pColIdx + 1) == atomic_load_32(&pStmt->exec.smInfo.pColFreeIdx)) {
+ taosUsleep(1);
+ continue;
+ }
+
+ *idx = pStmt->exec.smInfo.pColIdx;
+ return pStmt->exec.smInfo.pCols[pStmt->exec.smInfo.pColIdx++];
+ }
+}
+*/
+
+int32_t stmtAppendTablePostHandle(STscStmt* pStmt, SStmtQNode* param) {
+ if (NULL == pStmt->sql.siInfo.pVgroupHash) {
+ pStmt->sql.siInfo.pVgroupHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
+ }
+ if (NULL == pStmt->sql.siInfo.pVgroupList) {
+ pStmt->sql.siInfo.pVgroupList = taosArrayInit(64, POINTER_BYTES);
+ }
+
+ if (NULL == pStmt->sql.siInfo.pRequest) {
+ STMT_ERR_RET(buildRequest(pStmt->taos->id, pStmt->sql.sqlStr, pStmt->sql.sqlLen, NULL, false, (SRequestObj**)&pStmt->sql.siInfo.pRequest,
+ pStmt->reqid));
+
+ if (pStmt->reqid != 0) {
+ pStmt->reqid++;
+ }
+ pStmt->exec.pRequest->syncQuery = true;
+
+ pStmt->sql.siInfo.requestId = ((SRequestObj*)pStmt->sql.siInfo.pRequest)->requestId;
+ pStmt->sql.siInfo.requestSelf = ((SRequestObj*)pStmt->sql.siInfo.pRequest)->self;
+ }
+
+ if (!pStmt->sql.siInfo.tbFromHash && pStmt->sql.siInfo.firstName[0] && 0 == strcmp(pStmt->sql.siInfo.firstName, pStmt->bInfo.tbName)) {
+ pStmt->sql.siInfo.tbFromHash = true;
+ }
+
+ if (0 == pStmt->sql.siInfo.firstName[0]) {
+ strcpy(pStmt->sql.siInfo.firstName, pStmt->bInfo.tbName);
+ }
+
+ param->tblData.getFromHash = pStmt->sql.siInfo.tbFromHash;
+ param->next = NULL;
+
+ atomic_add_fetch_64(&pStmt->sql.siInfo.tbRemainNum, 1);
+
+ stmtEnqueue(pStmt, param);
+
+ return TSDB_CODE_SUCCESS;
+}
+
+static FORCE_INLINE int32_t stmtGetTableColsFromCache(STscStmt* pStmt, SArray** pTableCols) {
+ while (true) {
+ if (pStmt->sql.siInfo.pTableColsIdx < taosArrayGetSize(pStmt->sql.siInfo.pTableCols)) {
+ *pTableCols = (SArray*)taosArrayGetP(pStmt->sql.siInfo.pTableCols, pStmt->sql.siInfo.pTableColsIdx++);
+ break;
+ } else {
+ SArray* pTblCols = NULL;
+ for (int32_t i = 0; i < 100; i++) {
+ pTblCols = taosArrayInit(20, POINTER_BYTES);
+ if (NULL == pTblCols) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ taosArrayPush(pStmt->sql.siInfo.pTableCols, &pTblCols);
+ }
+ }
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
STscStmt* pStmt = (STscStmt*)stmt;
+ int32_t code = 0;
+ int64_t startUs = taosGetTimestampUs();
+
STMT_DLOG("start to bind stmt data, colIdx: %d", colIdx);
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_BIND));
@@ -744,6 +1187,10 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
return TSDB_CODE_SUCCESS;
}
+ if (pStmt->sql.stbInterlaceMode && NULL == pStmt->sql.siInfo.pDataCtx) {
+ STMT_ERR_RET(stmtInitStbInterlaceTableInfo(pStmt));
+ }
+
STableDataCxt** pDataBlock = NULL;
if (pStmt->exec.pCurrBlock) {
@@ -756,15 +1203,50 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
STMT_ERR_RET(TSDB_CODE_TSC_STMT_CACHE_ERROR);
}
pStmt->exec.pCurrBlock = *pDataBlock;
+ if (pStmt->sql.stbInterlaceMode) {
+ taosArrayDestroy(pStmt->exec.pCurrBlock->pData->aCol);
+ pStmt->exec.pCurrBlock->pData->aCol = NULL;
+ }
}
+ int64_t startUs2 = taosGetTimestampUs();
+ pStmt->stat.bindDataUs1 += startUs2 - startUs;
+
+ SStmtQNode* param = NULL;
+ if (pStmt->sql.stbInterlaceMode) {
+ STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m));
+ STMT_ERR_RET(stmtGetTableColsFromCache(pStmt, ¶m->tblData.aCol));
+ taosArrayClear(param->tblData.aCol);
+
+ //param->tblData.aCol = taosArrayInit(20, POINTER_BYTES);
+
+ param->restoreTbCols = false;
+ strcpy(param->tblData.tbName, pStmt->bInfo.tbName);
+ }
+
+ int64_t startUs3 = taosGetTimestampUs();
+ pStmt->stat.bindDataUs2 += startUs3 - startUs2;
+
+ SArray* pCols = pStmt->sql.stbInterlaceMode ? param->tblData.aCol : (*pDataBlock)->pData->aCol;
+
if (colIdx < 0) {
- int32_t code = qBindStmtColsValue(*pDataBlock, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen);
+ if (pStmt->sql.stbInterlaceMode) {
+ (*pDataBlock)->pData->flags = 0;
+ code = qBindStmtStbColsValue(*pDataBlock, pCols, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen, &pStmt->sql.siInfo.pTSchema, pStmt->sql.pBindInfo);
+ } else {
+ code = qBindStmtColsValue(*pDataBlock, pCols, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen);
+ }
+
if (code) {
tscError("qBindStmtColsValue failed, error:%s", tstrerror(code));
STMT_ERR_RET(code);
}
} else {
+ if (pStmt->sql.stbInterlaceMode) {
+ tscError("bind single column not allowed in stb insert mode");
+ STMT_ERR_RET(TSDB_CODE_TSC_STMT_API_ERROR);
+ }
+
if (colIdx != (pStmt->bInfo.sBindLastIdx + 1) && colIdx != 0) {
tscError("bind column index not in sequence");
STMT_ERR_RET(TSDB_CODE_APP_ERROR);
@@ -776,20 +1258,47 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
pStmt->bInfo.sBindRowNum = bind->num;
}
- qBindStmtSingleColValue(*pDataBlock, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen, colIdx,
+ qBindStmtSingleColValue(*pDataBlock, pCols, bind, pStmt->exec.pRequest->msgBuf, pStmt->exec.pRequest->msgBufLen, colIdx,
pStmt->bInfo.sBindRowNum);
}
+ int64_t startUs4 = taosGetTimestampUs();
+ pStmt->stat.bindDataUs3 += startUs4 - startUs3;
+
+ if (pStmt->sql.stbInterlaceMode) {
+ STMT_ERR_RET(stmtAppendTablePostHandle(pStmt, param));
+ }
+
+ pStmt->stat.bindDataUs4 += taosGetTimestampUs() - startUs4;
+
return TSDB_CODE_SUCCESS;
}
int stmtAddBatch(TAOS_STMT* stmt) {
STscStmt* pStmt = (STscStmt*)stmt;
+ int64_t startUs = taosGetTimestampUs();
+
STMT_DLOG_E("start to add batch");
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_ADD_BATCH));
+ if (pStmt->sql.stbInterlaceMode) {
+ int64_t startUs2 = taosGetTimestampUs();
+ pStmt->stat.addBatchUs += startUs2 - startUs;
+
+ pStmt->sql.siInfo.tableColsReady = false;
+
+ SStmtQNode* param = NULL;
+ STMT_ERR_RET(stmtAllocQNodeFromBuf(&pStmt->sql.siInfo.tbBuf, (void**)¶m));
+ param->restoreTbCols = true;
+ param->next = NULL;
+
+ stmtEnqueue(pStmt, param);
+
+ return TSDB_CODE_SUCCESS;
+ }
+
STMT_ERR_RET(stmtCacheBlock(pStmt));
return TSDB_CODE_SUCCESS;
@@ -858,6 +1367,8 @@ int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
.mgmtEps = getEpSet_s(&pStmt->taos->pAppInfo->mgmtEp)};
int32_t code = catalogGetTableMeta(pStmt->pCatalog, &conn, &pStmt->bInfo.sname, &pTableMeta);
+ pStmt->stat.ctgGetTbMetaNum++;
+
taos_free_result(pStmt->exec.pRequest);
pStmt->exec.pRequest = NULL;
@@ -879,11 +1390,58 @@ int stmtUpdateTableUid(STscStmt* pStmt, SSubmitRsp* pRsp) {
return finalCode;
}
+/*
+int stmtStaticModeExec(TAOS_STMT* stmt) {
+ STscStmt* pStmt = (STscStmt*)stmt;
+ int32_t code = 0;
+ SSubmitRsp* pRsp = NULL;
+ if (pStmt->sql.staticMode) {
+ return TSDB_CODE_TSC_STMT_API_ERROR;
+ }
+
+ STMT_DLOG_E("start to exec");
+
+ STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE));
+
+ STMT_ERR_RET(qBuildStmtOutputFromTbList(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->exec.pTbBlkList, pStmt->exec.pCurrBlock, pStmt->exec.tbBlkNum));
+
+ launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
+
+ if (pStmt->exec.pRequest->code && NEED_CLIENT_HANDLE_ERROR(pStmt->exec.pRequest->code)) {
+ code = refreshMeta(pStmt->exec.pRequest->pTscObj, pStmt->exec.pRequest);
+ if (code) {
+ pStmt->exec.pRequest->code = code;
+ } else {
+ tFreeSSubmitRsp(pRsp);
+ STMT_ERR_RET(stmtResetStmt(pStmt));
+ STMT_ERR_RET(TSDB_CODE_NEED_RETRY);
+ }
+ }
+
+ STMT_ERR_JRET(pStmt->exec.pRequest->code);
+
+ pStmt->exec.affectedRows = taos_affected_rows(pStmt->exec.pRequest);
+ pStmt->affectedRows += pStmt->exec.affectedRows;
+
+_return:
+
+ stmtCleanExecInfo(pStmt, (code ? false : true), false);
+
+ tFreeSSubmitRsp(pRsp);
+
+ ++pStmt->sql.runTimes;
+
+ STMT_RET(code);
+}
+*/
+
int stmtExec(TAOS_STMT* stmt) {
STscStmt* pStmt = (STscStmt*)stmt;
int32_t code = 0;
SSubmitRsp* pRsp = NULL;
+ int64_t startUs = taosGetTimestampUs();
+
STMT_DLOG_E("start to exec");
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE));
@@ -891,12 +1449,26 @@ int stmtExec(TAOS_STMT* stmt) {
if (STMT_TYPE_QUERY == pStmt->sql.type) {
launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
} else {
- tDestroySubmitTbData(pStmt->exec.pCurrTbData, TSDB_MSG_FLG_ENCODE);
- taosMemoryFreeClear(pStmt->exec.pCurrTbData);
+ if (pStmt->sql.stbInterlaceMode) {
+ int64_t startTs = taosGetTimestampUs();
+ while (atomic_load_64(&pStmt->sql.siInfo.tbRemainNum)) {
+ taosUsleep(1);
+ }
+ pStmt->stat.execWaitUs += taosGetTimestampUs() - startTs;
+
+ STMT_ERR_RET(qBuildStmtFinOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->sql.siInfo.pVgroupList));
+ taosHashCleanup(pStmt->sql.siInfo.pVgroupHash);
+ pStmt->sql.siInfo.pVgroupHash = NULL;
+ pStmt->sql.siInfo.pVgroupList = NULL;
+ } else {
+ tDestroySubmitTbData(pStmt->exec.pCurrTbData, TSDB_MSG_FLG_ENCODE);
+ taosMemoryFreeClear(pStmt->exec.pCurrTbData);
- STMT_ERR_RET(qCloneCurrentTbData(pStmt->exec.pCurrBlock, &pStmt->exec.pCurrTbData));
+ STMT_ERR_RET(qCloneCurrentTbData(pStmt->exec.pCurrBlock, &pStmt->exec.pCurrTbData));
- STMT_ERR_RET(qBuildStmtOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->exec.pBlockHash));
+ STMT_ERR_RET(qBuildStmtOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->exec.pBlockHash));
+ }
+
launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
}
@@ -918,12 +1490,19 @@ int stmtExec(TAOS_STMT* stmt) {
_return:
- stmtCleanExecInfo(pStmt, (code ? false : true), false);
+ while (0 == atomic_load_8((int8_t*)&pStmt->sql.siInfo.tableColsReady)) {
+ taosUsleep(1);
+ }
+ stmtCleanExecInfo(pStmt, (code ? false : true), false);
+
tFreeSSubmitRsp(pRsp);
++pStmt->sql.runTimes;
+ int64_t startUs2 = taosGetTimestampUs();
+ pStmt->stat.execUseUs += startUs2 - startUs;
+
STMT_RET(code);
}
@@ -932,6 +1511,21 @@ int stmtClose(TAOS_STMT* stmt) {
STMT_DLOG_E("start to free stmt");
+ pStmt->queue.stopQueue = true;
+
+ if (pStmt->bindThreadInUse) {
+ taosThreadJoin(pStmt->bindThread, NULL);
+ pStmt->bindThreadInUse = false;
+ }
+
+ STMT_DLOG("stmt %p closed, stbInterlaceMode: %d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64 ", parseSqlNum=>%" PRId64
+ ", pStmt->stat.bindDataNum=>%" PRId64 ", settbnameAPI:%u, bindAPI:%u, addbatchAPI:%u, execAPI:%u"
+ ", setTbNameUs:%" PRId64 ", bindDataUs:%" PRId64 ",%" PRId64 ",%" PRId64 ",%" PRId64 " addBatchUs:%" PRId64 ", execWaitUs:%" PRId64 ", execUseUs:%" PRId64,
+ pStmt, pStmt->sql.stbInterlaceMode, pStmt->stat.ctgGetTbMetaNum, pStmt->stat.getCacheTbInfo, pStmt->stat.parseSqlNum, pStmt->stat.bindDataNum,
+ pStmt->seqIds[STMT_SETTBNAME], pStmt->seqIds[STMT_BIND], pStmt->seqIds[STMT_ADD_BATCH], pStmt->seqIds[STMT_EXECUTE],
+ pStmt->stat.setTbNameUs, pStmt->stat.bindDataUs1, pStmt->stat.bindDataUs2, pStmt->stat.bindDataUs3, pStmt->stat.bindDataUs4,
+ pStmt->stat.addBatchUs, pStmt->stat.execWaitUs, pStmt->stat.execUseUs);
+
stmtCleanSQLInfo(pStmt);
taosMemoryFree(stmt);
@@ -1027,6 +1621,7 @@ int stmtGetColFields(TAOS_STMT* stmt, int* nums, TAOS_FIELD_E** fields) {
if (pStmt->exec.pRequest && STMT_TYPE_QUERY == pStmt->sql.type && pStmt->sql.runTimes) {
taos_free_result(pStmt->exec.pRequest);
pStmt->exec.pRequest = NULL;
+ STMT_ERR_RET(stmtCreateRequest(pStmt));
}
STMT_ERRI_JRET(stmtCreateRequest(pStmt));
@@ -1062,6 +1657,7 @@ int stmtGetParamNum(TAOS_STMT* stmt, int* nums) {
}
STMT_ERR_RET(stmtCreateRequest(pStmt));
+
if (pStmt->bInfo.needParse) {
STMT_ERR_RET(stmtParseSql(pStmt));
}
diff --git a/source/client/test/clientTests.cpp b/source/client/test/clientTests.cpp
index 1498476634..b5bad92dc4 100644
--- a/source/client/test/clientTests.cpp
+++ b/source/client/test/clientTests.cpp
@@ -821,32 +821,21 @@ TEST(clientCase, projection_query_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(pConn, nullptr);
+ TAOS_RES* pRes = NULL;
+
// TAOS_RES* pRes = taos_query(pConn, "create database if not exists abc1 vgroups 1");
// if (taos_errno(pRes) != 0) {
// printf("error in create db, reason:%s\n", taos_errstr(pRes));
// }
// taos_free_result(pRes);
-
- TAOS_RES* pRes = taos_query(pConn, "alter local 'fqdn 127.0.0.1'");
- if (taos_errno(pRes) != 0) {
- printf("failed to exec query, %s\n", taos_errstr(pRes));
- }
-
- taos_free_result(pRes);
-
- pRes = taos_query(pConn, "select last(ts), ts from cache_1.t1");
+/*
+ TAOS_RES* pRes = taos_query(pConn, "select last(ts), ts from cache_1.t1");
// pRes = taos_query(pConn, "select last(ts), ts from cache_1.no_pk_t1");
if (taos_errno(pRes) != 0) {
- printf("failed to exec query, %s\n", taos_errstr(pRes));
+ printf("failed to create table tu, reason:%s\n", taos_errstr(pRes));
}
taos_free_result(pRes);
-// pRes = taos_query(pConn, "create stream stream_1 trigger at_once fill_history 1 ignore expired 0 into str_res1 as select _wstart as ts, count(*) from stable_1 interval(10s);");
-// if (taos_errno(pRes) != 0) {
-// printf("failed to create table tu, reason:%s\n", taos_errstr(pRes));
-// }
-// taos_free_result(pRes);
-
pRes = taos_query(pConn, "create table tu using st2 tags(2)");
if (taos_errno(pRes) != 0) {
printf("failed to create table tu, reason:%s\n", taos_errstr(pRes));
@@ -876,27 +865,27 @@ TEST(clientCase, projection_query_tables) {
for(int32_t j = 0; j < 1; ++j) {
start += 20;
for (int32_t i = 0; i < 1; ++i) {
- createNewTable(pConn, i, 100, start, pstr);
+ createNewTable(pConn, i, 100000, 0, pstr);
}
}
+*/
- //
- // pRes = taos_query(pConn, "select * from tu");
- // if (taos_errno(pRes) != 0) {
- // printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
- // taos_free_result(pRes);
- // ASSERT_TRUE(false);
- // }
- //
- // TAOS_ROW pRow = NULL;
- // TAOS_FIELD* pFields = taos_fetch_fields(pRes);
- // int32_t numOfFields = taos_num_fields(pRes);
- //
- // char str[512] = {0};
- // while ((pRow = taos_fetch_row(pRes)) != NULL) {
- // int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
- // printf("%s\n", str);
- // }
+ pRes = taos_query(pConn, "select * from abc1.st2");
+ if (taos_errno(pRes) != 0) {
+ printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
+ taos_free_result(pRes);
+ ASSERT_TRUE(false);
+ }
+
+ TAOS_ROW pRow = NULL;
+ TAOS_FIELD* pFields = taos_fetch_fields(pRes);
+ int32_t numOfFields = taos_num_fields(pRes);
+
+ char str[512] = {0};
+ while ((pRow = taos_fetch_row(pRes)) != NULL) {
+// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
+// printf("%s\n", str);
+ }
taos_free_result(pRes);
taos_close(pConn);
@@ -915,25 +904,44 @@ TEST(clientCase, projection_query_stables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(pConn, nullptr);
- TAOS_RES* pRes = taos_query(pConn, "use test");
- taos_free_result(pRes);
+ TAOS_RES* pRes = taos_query(pConn, "explain select * from dbvg.st where tbname='ct1'");
+// taos_free_result(pRes);
- pRes = taos_query(pConn, "select * from meters limit 50000000");
- if (taos_errno(pRes) != 0) {
- printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
- taos_free_result(pRes);
- ASSERT_TRUE(false);
- }
+// pRes = taos_query(pConn, "select * from st2");
+// if (taos_errno(pRes) != 0) {
+// printf("failed to select from table, reason:%s\n", taos_errstr(pRes));
+// taos_free_result(pRes);
+// ASSERT_TRUE(false);
+// }
TAOS_ROW pRow = NULL;
TAOS_FIELD* pFields = taos_fetch_fields(pRes);
int32_t numOfFields = taos_num_fields(pRes);
- char str[512] = {0};
- while ((pRow = taos_fetch_row(pRes)) != NULL) {
- // int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
- // printf("%s\n", str);
+ int32_t numOfRows = 0;
+ int32_t i = 0;
+ int32_t prev = 0;
+
+ char str[512] = {0};
+ while (1) {
+ pRow = taos_fetch_row(pRes);
+ if (pRow == NULL) {
+ break;
+ }
+ i += numOfRows;
+
+ if ( (i / 1000000) > prev) {
+ printf("%d\n", i);
+ prev = i/1000000;
+ }
+ //printf("%d\n", i);
}
+// while ((pRow = taos_fetch_row(pRes)) != NULL) {
+// int32_t code = taos_print_row(str, pRow, pFields, numOfFields);
+// if (i++ % 100000 == 0) {
+// printf("%d\n", i);
+// }
+// }
taos_free_result(pRes);
taos_close(pConn);
diff --git a/source/common/src/systable.c b/source/common/src/systable.c
index 93167a1ccd..6558df1fc1 100644
--- a/source/common/src/systable.c
+++ b/source/common/src/systable.c
@@ -264,6 +264,7 @@ static const SSysDbTableSchema userUsersSchema[] = {
{.name = "super", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true},
{.name = "enable", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true},
{.name = "sysinfo", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true},
+ {.name = "createdb", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true},
{.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "allowed_host", .bytes = TSDB_PRIVILEDGE_HOST_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
};
diff --git a/source/common/src/tcol.c b/source/common/src/tcol.c
index ba36558587..a949d0793a 100644
--- a/source/common/src/tcol.c
+++ b/source/common/src/tcol.c
@@ -327,7 +327,9 @@ int32_t setColCompressByOption(uint8_t type, uint8_t encode, uint16_t compressTy
return TSDB_CODE_SUCCESS;
}
-bool useCompress(uint8_t tableType) { return TSDB_SUPER_TABLE == tableType || TSDB_NORMAL_TABLE == tableType; }
+bool useCompress(uint8_t tableType) {
+ return TSDB_SUPER_TABLE == tableType || TSDB_NORMAL_TABLE == tableType || TSDB_CHILD_TABLE == tableType;
+}
int8_t validColCompressLevel(uint8_t type, uint8_t level) {
if (level == TSDB_COLVAL_LEVEL_DISABLED) return 1;
diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c
index ac4811fb1b..809721d606 100644
--- a/source/common/src/tdatablock.c
+++ b/source/common/src/tdatablock.c
@@ -21,7 +21,7 @@
#define MALLOC_ALIGN_BYTES 32
-static void copyPkVal(SDataBlockInfo* pDst, const SDataBlockInfo* pSrc);
+
int32_t colDataGetLength(const SColumnInfoData* pColumnInfoData, int32_t numOfRows) {
if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) {
@@ -848,7 +848,7 @@ SSDataBlock* blockDataExtractBlock(SSDataBlock* pBlock, int32_t startIndex, int3
if (pBlock->pBlockAgg == NULL) {
isNull = colDataIsNull_s(pColData, j);
} else {
- isNull = colDataIsNull(pColData, pBlock->info.rows, j, pBlock->pBlockAgg[i]);
+ isNull = colDataIsNull(pColData, pBlock->info.rows, j, &pBlock->pBlockAgg[i]);
}
if (isNull) {
@@ -1362,6 +1362,8 @@ void blockDataEmpty(SSDataBlock* pDataBlock) {
return;
}
+ taosMemoryFreeClear(pDataBlock->pBlockAgg);
+
size_t numOfCols = taosArrayGetSize(pDataBlock->pDataBlock);
for (int32_t i = 0; i < numOfCols; ++i) {
SColumnInfoData* p = taosArrayGet(pDataBlock->pDataBlock, i);
diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c
index 0e80d431d1..698714da86 100644
--- a/source/common/src/tdataformat.c
+++ b/source/common/src/tdataformat.c
@@ -426,6 +426,79 @@ int32_t tRowBuild(SArray *aColVal, const STSchema *pTSchema, SRow **ppRow) {
return code;
}
+static int32_t tBindInfoCompare(const void *p1, const void *p2, const void *param) {
+ if (((SBindInfo *)p1)->columnId < ((SBindInfo *)p2)->columnId) {
+ return -1;
+ } else if (((SBindInfo *)p1)->columnId > ((SBindInfo *)p2)->columnId) {
+ return 1;
+ }
+ return 0;
+}
+
+/* build rows to `rowArray` from bind
+ * `infos` is the bind information array
+ * `numOfInfos` is the number of bind information
+ * `infoSorted` is whether the bind information is sorted by column id
+ * `pTSchema` is the schema of the table
+ * `rowArray` is the array to store the rows
+ */
+int32_t tRowBuildFromBind(SBindInfo *infos, int32_t numOfInfos, bool infoSorted, const STSchema *pTSchema,
+ SArray *rowArray) {
+ if (infos == NULL || numOfInfos <= 0 || numOfInfos > pTSchema->numOfCols || pTSchema == NULL || rowArray == NULL) {
+ return TSDB_CODE_INVALID_PARA;
+ }
+
+ if (!infoSorted) {
+ taosqsort_r(infos, numOfInfos, sizeof(SBindInfo), NULL, tBindInfoCompare);
+ }
+
+ int32_t code = 0;
+ int32_t numOfRows = infos[0].bind->num;
+ SArray *colValArray;
+ SColVal colVal;
+
+ if ((colValArray = taosArrayInit(numOfInfos, sizeof(SColVal))) == NULL) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ for (int32_t iRow = 0; iRow < numOfRows; iRow++) {
+ taosArrayClear(colValArray);
+
+ for (int32_t iInfo = 0; iInfo < numOfInfos; iInfo++) {
+ if (infos[iInfo].bind->is_null && infos[iInfo].bind->is_null[iRow]) {
+ colVal = COL_VAL_NULL(infos[iInfo].columnId, infos[iInfo].type);
+ } else {
+ SValue value = {
+ .type = infos[iInfo].type,
+ };
+ if (IS_VAR_DATA_TYPE(infos[iInfo].type)) {
+ value.nData = infos[iInfo].bind->length[iRow];
+ value.pData = (uint8_t *)infos[iInfo].bind->buffer + infos[iInfo].bind->buffer_length * iRow;
+ } else {
+ memcpy(&value.val, (uint8_t *)infos[iInfo].bind->buffer + infos[iInfo].bind->buffer_length * iRow,
+ infos[iInfo].bind->buffer_length);
+ }
+ colVal = COL_VAL_VALUE(infos[iInfo].columnId, value);
+ }
+ taosArrayPush(colValArray, &colVal);
+ }
+
+ SRow *row;
+ if ((code = tRowBuild(colValArray, pTSchema, &row))) {
+ goto _exit;
+ }
+
+ if ((taosArrayPush(rowArray, &row)) == NULL) {
+ code = TSDB_CODE_OUT_OF_MEMORY;
+ goto _exit;
+ }
+ }
+
+_exit:
+ taosArrayDestroy(colValArray);
+ return code;
+}
+
int32_t tRowGet(SRow *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal) {
ASSERT(iCol < pTSchema->numOfCols);
ASSERT(pRow->sver == pTSchema->version);
diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c
index f034244c69..da692e78fd 100644
--- a/source/common/src/tglobal.c
+++ b/source/common/src/tglobal.c
@@ -74,6 +74,7 @@ int32_t tsNumOfSnodeStreamThreads = 4;
int32_t tsNumOfSnodeWriteThreads = 1;
int32_t tsMaxStreamBackendCache = 128; // M
int32_t tsPQSortMemThreshold = 16; // M
+int32_t tsRetentionSpeedLimitMB = 0; // unlimited
// sync raft
int32_t tsElectInterval = 25 * 1000;
@@ -667,6 +668,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if (cfgAddInt32(pCfg, "queryBufferSize", tsQueryBufferSize, -1, 500000000000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
if (cfgAddInt32(pCfg, "queryRspPolicy", tsQueryRspPolicy, 0, 1, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
if (cfgAddInt32(pCfg, "numOfCommitThreads", tsNumOfCommitThreads, 1, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
+ if (cfgAddInt32(pCfg, "retentionSpeedLimitMB", tsRetentionSpeedLimitMB, 0, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
if (cfgAddInt32(pCfg, "numOfMnodeReadThreads", tsNumOfMnodeReadThreads, 1, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
if (cfgAddInt32(pCfg, "numOfVnodeQueryThreads", tsNumOfVnodeQueryThreads, 4, 1024, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1;
@@ -776,7 +778,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
// min free disk space used to check if the disk is full [50MB, 1GB]
if (cfgAddInt64(pCfg, "minDiskFreeSize", tsMinDiskFreeSize, TFS_MIN_DISK_FREE_SIZE, 1024 * 1024 * 1024, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
- if (cfgAddBool(pCfg, "enableWhiteList", tsEnableWhiteList, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1;
+ if (cfgAddBool(pCfg, "enableWhiteList", tsEnableWhiteList, CFG_SCOPE_SERVER, CFG_DYN_SERVER) != 0) return -1;
// clang-format on
@@ -1117,6 +1119,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32;
tsNumOfCommitThreads = cfgGetItem(pCfg, "numOfCommitThreads")->i32;
+ tsRetentionSpeedLimitMB = cfgGetItem(pCfg, "retentionSpeedLimitMB")->i32;
tsNumOfMnodeReadThreads = cfgGetItem(pCfg, "numOfMnodeReadThreads")->i32;
tsNumOfVnodeQueryThreads = cfgGetItem(pCfg, "numOfVnodeQueryThreads")->i32;
tsRatioOfVnodeStreamThreads = cfgGetItem(pCfg, "ratioOfVnodeStreamThreads")->fval;
@@ -1299,8 +1302,8 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
return 0;
}
-int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd,
- const char *envFile, char *apolloUrl, SArray *pArgs) {
+int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl,
+ SArray *pArgs) {
if (tsCfg == NULL) osDefaultInit();
SConfig *pCfg = cfgInit();
diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c
index 06fb39f409..1cbd646413 100644
--- a/source/common/src/tmsg.c
+++ b/source/common/src/tmsg.c
@@ -20,11 +20,13 @@
#undef TD_MSG_DICT_
#undef TD_MSG_RANGE_CODE_
#define TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_SEG_CODE_
#include "tmsgdef.h"
#undef TD_MSG_NUMBER_
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_RANGE_CODE_
#define TD_MSG_DICT_
#undef TD_MSG_SEG_CODE_
@@ -32,6 +34,7 @@
#undef TD_MSG_NUMBER_
#undef TD_MSG_INFO_
+#undef TD_MSG_TYPE_INFO_
#undef TD_MSG_DICT_
#undef TD_MSG_SEG_CODE_
#define TD_MSG_RANGE_CODE_
@@ -1810,6 +1813,7 @@ int32_t tSerializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq)
}
if (tEncodeI64(&encoder, pReq->privileges) < 0) return -1;
ENCODESQL();
+ if (tEncodeU8(&encoder, pReq->flag) < 0) return -1;
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
@@ -1849,6 +1853,9 @@ int32_t tDeserializeSAlterUserReq(void *buf, int32_t bufLen, SAlterUserReq *pReq
}
if (tDecodeI64(&decoder, &pReq->privileges) < 0) return -1;
DECODESQL();
+ if (!tDecodeIsEnd(&decoder)) {
+ if (tDecodeU8(&decoder, &pReq->flag) < 0) return -1;
+ }
tEndDecode(&decoder);
tDecoderClear(&decoder);
@@ -7046,6 +7053,7 @@ int32_t tSerializeSSubQueryMsg(void *buf, int32_t bufLen, SSubQueryMsg *pReq) {
if (tEncodeI8(&encoder, pReq->taskType) < 0) return -1;
if (tEncodeI8(&encoder, pReq->explain) < 0) return -1;
if (tEncodeI8(&encoder, pReq->needFetch) < 0) return -1;
+ if (tEncodeI8(&encoder, pReq->compress) < 0) return -1;
if (tEncodeU32(&encoder, pReq->sqlLen) < 0) return -1;
if (tEncodeCStrWithLen(&encoder, pReq->sql, pReq->sqlLen) < 0) return -1;
if (tEncodeU32(&encoder, pReq->msgLen) < 0) return -1;
@@ -7086,6 +7094,7 @@ int32_t tDeserializeSSubQueryMsg(void *buf, int32_t bufLen, SSubQueryMsg *pReq)
if (tDecodeI8(&decoder, &pReq->taskType) < 0) return -1;
if (tDecodeI8(&decoder, &pReq->explain) < 0) return -1;
if (tDecodeI8(&decoder, &pReq->needFetch) < 0) return -1;
+ if (tDecodeI8(&decoder, &pReq->compress) < 0) return -1;
if (tDecodeU32(&decoder, &pReq->sqlLen) < 0) return -1;
if (tDecodeCStrAlloc(&decoder, &pReq->sql) < 0) return -1;
if (tDecodeU32(&decoder, &pReq->msgLen) < 0) return -1;
@@ -9728,6 +9737,7 @@ void tDestroySubmitTbData(SSubmitTbData *pTbData, int32_t flag) {
for (int32_t i = 0; i < nRow; ++i) {
tRowDestroy(rows[i]);
+ rows[i] = NULL;
}
taosArrayDestroy(pTbData->aRowP);
}
diff --git a/source/common/src/tvariant.c b/source/common/src/tvariant.c
index ae2c8c0c14..aad877312b 100644
--- a/source/common/src/tvariant.c
+++ b/source/common/src/tvariant.c
@@ -88,7 +88,7 @@ static int32_t parseSignAndUInteger(const char *z, int32_t n, bool *is_neg, uint
if (errno == ERANGE || errno == EINVAL || endPtr - z != n) {
return TSDB_CODE_FAILED;
}
- if (val > UINT64_MAX) {
+ if (val > (double)UINT64_MAX) {
errno = ERANGE;
return TSDB_CODE_FAILED;
}
@@ -172,7 +172,7 @@ int32_t toIntegerEx(const char *z, int32_t n, uint32_t type, int64_t *value) {
} break;
case TK_NK_FLOAT: {
double val = round(taosStr2Double(z, &endPtr));
- if (!IS_VALID_INT64(val)) {
+ if(val < (double)INT64_MIN || val > (double)INT64_MAX){
return TSDB_CODE_FAILED;
}
if (errno == ERANGE || errno == EINVAL || endPtr - z != n) {
@@ -271,7 +271,7 @@ int32_t toUIntegerEx(const char *z, int32_t n, uint32_t type, uint64_t *value) {
} break;
case TK_NK_FLOAT: {
double val = round(taosStr2Double(p, &endPtr));
- if (!IS_VALID_UINT64(val)) {
+ if (val < 0 || val > (double)UINT64_MAX) {
return TSDB_CODE_FAILED;
}
if (errno == ERANGE || errno == EINVAL || endPtr - z != n) {
diff --git a/source/common/test/CMakeLists.txt b/source/common/test/CMakeLists.txt
index 51c733e796..bacc766990 100644
--- a/source/common/test/CMakeLists.txt
+++ b/source/common/test/CMakeLists.txt
@@ -41,11 +41,11 @@ add_test(
)
# tmsg test
-# add_executable(tmsgTest "")
-# target_sources(tmsgTest
-# PRIVATE
-# "tmsgTest.cpp"
-# "../src/tmsg.c"
-# )
-# target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/")
-# target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main)
\ No newline at end of file
+add_executable(tmsgTest "")
+target_sources(tmsgTest
+ PRIVATE
+ "tmsgTest.cpp"
+ "../src/tmsg.c"
+)
+target_include_directories(tmsgTest PUBLIC "${TD_SOURCE_DIR}/include/common/")
+target_link_libraries(tmsgTest PUBLIC os util gtest gtest_main)
\ No newline at end of file
diff --git a/source/common/test/tmsgTest.cpp b/source/common/test/tmsgTest.cpp
index e8c3284ea5..910e133c64 100644
--- a/source/common/test/tmsgTest.cpp
+++ b/source/common/test/tmsgTest.cpp
@@ -4,8 +4,23 @@
#include "tmsg.h"
+#undef TD_MSG_NUMBER_
+#undef TD_MSG_DICT_
+#undef TD_MSG_INFO_
+#define TD_MSG_TYPE_INFO_
+#undef TD_MSG_RANGE_CODE_
+#undef TD_MSG_SEG_CODE_
+#include "tmsgdef.h"
+
TEST(td_msg_test, simple_msg_test) {
// std::cout << TMSG_INFO(TDMT_VND_DROP_TABLE) << std::endl;
// std::cout << TMSG_INFO(TDMT_MND_DROP_SUPER_TABLE) << std::endl;
// std::cout << TMSG_INFO(TDMT_MND_CREATE_SUPER_TABLE) << std::endl;
+
+ int32_t msgSize = sizeof(tMsgTypeInfo) / sizeof(SMsgTypeInfo);
+ for (int32_t i = 0; i < msgSize; ++i) {
+ SMsgTypeInfo *pInfo = &tMsgTypeInfo[i];
+ std::cout << i * 2 + 1 << " " << pInfo->name << " " << pInfo->type << std::endl;
+ std::cout << i * 2 + 2 << " " << pInfo->rspName << " " << pInfo->rspType << std::endl;
+ }
}
\ No newline at end of file
diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
index e4afba6722..e137bcbdec 100644
--- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
@@ -232,6 +232,7 @@ SArray *mmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_CREATE, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_DROP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_CREATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
@@ -240,6 +241,7 @@ SArray *mmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT, mmPutMsgToReadQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_KILL_COMPACT_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
diff --git a/source/dnode/mgmt/mgmt_snode/src/smHandle.c b/source/dnode/mgmt/mgmt_snode/src/smHandle.c
index 9b07b6a3d8..6a9f2f1275 100644
--- a/source/dnode/mgmt/mgmt_snode/src/smHandle.c
+++ b/source/dnode/mgmt/mgmt_snode/src/smHandle.c
@@ -75,26 +75,27 @@ SArray *smGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_UPDATE, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DEPLOY, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DROP, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RUN, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_DISPATCH_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_PAUSE, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_RESUME, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_STOP, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_CHECKPOINT_READY_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_TRIGGER_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_CHECK_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, smPutNodeMsgToMgmtQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
- if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT_RSP, smPutNodeMsgToStreamQueue, 1) == NULL) goto _OVER;
code = 0;
_OVER:
diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
index bfc9e92293..7bc41559c3 100644
--- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
@@ -967,6 +967,7 @@ SArray *vmGetMsgHandles() {
if (dmSetMgmtHandle(pArray, TDMT_VND_STREAM_TASK_RESET, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_HEARTBEAT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_REQ_CHKPT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
+ if (dmSetMgmtHandle(pArray, TDMT_MND_STREAM_CHKPT_REPORT_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_VND_GET_STREAM_PROGRESS, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER;
if (dmSetMgmtHandle(pArray, TDMT_STREAM_TASK_UPDATE_CHKPT, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h
index 5c21e9b22b..46e606d3ea 100644
--- a/source/dnode/mnode/impl/inc/mndDef.h
+++ b/source/dnode/mnode/impl/inc/mndDef.h
@@ -77,6 +77,7 @@ typedef enum {
MND_OPER_CREATE_VIEW,
MND_OPER_DROP_VIEW,
MND_OPER_CONFIG_CLUSTER,
+ MND_OPER_BALANCE_VGROUP_LEADER,
} EOperType;
typedef enum {
@@ -102,8 +103,8 @@ typedef enum {
TRN_CONFLICT_GLOBAL = 1,
TRN_CONFLICT_DB = 2,
TRN_CONFLICT_DB_INSIDE = 3,
- TRN_CONFLICT_TOPIC = 4,
- TRN_CONFLICT_TOPIC_INSIDE = 5,
+// TRN_CONFLICT_TOPIC = 4,
+// TRN_CONFLICT_TOPIC_INSIDE = 5,
TRN_CONFLICT_ARBGROUP = 6,
} ETrnConflct;
@@ -322,15 +323,21 @@ typedef struct {
} SAcctObj;
typedef struct {
- char user[TSDB_USER_LEN];
- char pass[TSDB_PASSWORD_LEN];
- char acct[TSDB_USER_LEN];
- int64_t createdTime;
- int64_t updateTime;
- int8_t superUser;
- int8_t sysInfo;
- int8_t enable;
- int8_t reserve;
+ char user[TSDB_USER_LEN];
+ char pass[TSDB_PASSWORD_LEN];
+ char acct[TSDB_USER_LEN];
+ int64_t createdTime;
+ int64_t updateTime;
+ int8_t superUser;
+ int8_t sysInfo;
+ int8_t enable;
+ union {
+ uint8_t flag;
+ struct {
+ uint8_t createdb : 1;
+ uint8_t reserve : 7;
+ };
+ };
int32_t acctId;
int32_t authVersion;
int32_t passVersion;
diff --git a/source/dnode/mnode/impl/inc/mndStream.h b/source/dnode/mnode/impl/inc/mndStream.h
index 6aed50e508..dade7b4bdf 100644
--- a/source/dnode/mnode/impl/inc/mndStream.h
+++ b/source/dnode/mnode/impl/inc/mndStream.h
@@ -26,13 +26,14 @@ extern "C" {
#define MND_STREAM_RESERVE_SIZE 64
#define MND_STREAM_VER_NUMBER 5
-#define MND_STREAM_CREATE_NAME "stream-create"
-#define MND_STREAM_CHECKPOINT_NAME "stream-checkpoint"
-#define MND_STREAM_PAUSE_NAME "stream-pause"
-#define MND_STREAM_RESUME_NAME "stream-resume"
-#define MND_STREAM_DROP_NAME "stream-drop"
-#define MND_STREAM_TASK_RESET_NAME "stream-task-reset"
-#define MND_STREAM_TASK_UPDATE_NAME "stream-task-update"
+#define MND_STREAM_CREATE_NAME "stream-create"
+#define MND_STREAM_CHECKPOINT_NAME "stream-checkpoint"
+#define MND_STREAM_PAUSE_NAME "stream-pause"
+#define MND_STREAM_RESUME_NAME "stream-resume"
+#define MND_STREAM_DROP_NAME "stream-drop"
+#define MND_STREAM_TASK_RESET_NAME "stream-task-reset"
+#define MND_STREAM_TASK_UPDATE_NAME "stream-task-update"
+#define MND_STREAM_CHKPT_UPDATE_NAME "stream-chkpt-update"
typedef struct SStreamTransInfo {
int64_t startTime;
@@ -51,6 +52,7 @@ typedef struct SStreamTransMgmt {
} SStreamTransMgmt;
typedef struct SStreamExecInfo {
+ bool initTaskList;
SArray *pNodeList;
int64_t ts; // snapshot ts
SStreamTransMgmt transMgmt;
@@ -58,6 +60,7 @@ typedef struct SStreamExecInfo {
SArray *pTaskList;
TdThreadMutex lock;
SHashObj *pTransferStateStreams;
+ SHashObj *pChkptStreams;
} SStreamExecInfo;
extern SStreamExecInfo execInfo;
@@ -78,7 +81,18 @@ typedef struct SOrphanTask {
typedef struct {
SMsgHead head;
-} SMStreamHbRspMsg, SMStreamReqCheckpointRspMsg;
+} SMStreamHbRspMsg, SMStreamReqCheckpointRsp, SMStreamUpdateChkptRsp;
+
+typedef struct STaskChkptInfo {
+ int32_t nodeId;
+ int32_t taskId;
+ int64_t streamId;
+ int64_t checkpointId;
+ int64_t version;
+ int64_t ts;
+ int32_t transId;
+ int8_t dropHTask;
+}STaskChkptInfo;
int32_t mndInitStream(SMnode *pMnode);
void mndCleanupStream(SMnode *pMnode);
@@ -96,7 +110,7 @@ int32_t mndGetNumOfStreamTasks(const SStreamObj *pStream);
SArray *mndTakeVgroupSnapshot(SMnode *pMnode, bool *allReady);
void mndKillTransImpl(SMnode *pMnode, int32_t transId, const char *pDbName);
int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset,
- int32_t retryCode);
+ int32_t retryCode, int32_t acceptCode);
STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name, const char *pMsg);
int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status);
SSdbRaw *mndStreamActionEncode(SStreamObj *pStream);
@@ -114,14 +128,19 @@ int32_t mndStreamSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamObj *p
int32_t mndStreamSetDropActionFromList(SMnode *pMnode, STrans *pTrans, SArray *pList);
int32_t mndStreamSetResetTaskAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream);
int32_t mndCreateStreamResetStatusTrans(SMnode *pMnode, SStreamObj *pStream);
+int32_t mndStreamSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream);
+int32_t mndCreateStreamChkptInfoUpdateTrans(SMnode *pMnode, SStreamObj *pStream, SArray *pChkptInfoList);
+int32_t mndScanCheckpointReportInfo(SRpcMsg *pReq);
+void removeTasksInBuf(SArray *pTaskIds, SStreamExecInfo *pExecInfo);
SStreamTaskIter *createStreamTaskIter(SStreamObj *pStream);
void destroyStreamTaskIter(SStreamTaskIter *pIter);
bool streamTaskIterNextTask(SStreamTaskIter *pIter);
SStreamTask *streamTaskIterGetCurrent(SStreamTaskIter *pIter);
void mndInitExecInfo();
-void removeExpiredNodeInfo(const SArray *pNodeSnapshot);
-void removeTasksInBuf(SArray* pTaskIds, SStreamExecInfo* pExecInfo);
+void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo);
+int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot);
+void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode);
#ifdef __cplusplus
}
diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c
index 3eef2afcc1..9a7a8155ec 100644
--- a/source/dnode/mnode/impl/src/mndConsumer.c
+++ b/source/dnode/mnode/impl/src/mndConsumer.c
@@ -91,7 +91,7 @@ void mndSendConsumerMsg(SMnode *pMnode, int64_t consumerId, uint16_t msgType, SR
}
}
-static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *pMnode, const char *pUser,
+static int32_t validateTopics(const SArray *pTopicList, SMnode *pMnode, const char *pUser,
bool enableReplay) {
SMqTopicObj *pTopic = NULL;
int32_t code = 0;
@@ -135,11 +135,6 @@ static int32_t validateTopics(STrans *pTrans, const SArray *pTopicList, SMnode *
}
}
- mndTransSetDbName(pTrans, pOneTopic, NULL);
- if (mndTransCheckConflict(pMnode, pTrans) != 0) {
- code = -1;
- goto FAILED;
- }
mndReleaseTopic(pMnode, pTopic);
}
@@ -177,12 +172,12 @@ static int32_t mndProcessConsumerRecoverMsg(SRpcMsg *pMsg) {
goto END;
}
- pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC, pMsg, "recover-csm");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pMsg, "recover-csm");
if (pTrans == NULL) {
code = -1;
goto END;
}
- code = validateTopics(pTrans, pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false);
+ code = validateTopics(pConsumer->assignedTopics, pMnode, pMsg->info.conn.user, false);
if (code != 0) {
goto END;
}
@@ -675,13 +670,13 @@ int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) {
goto _over;
}
- pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "subscribe");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_NOTHING, pMsg, "subscribe");
if (pTrans == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _over;
}
- code = validateTopics(pTrans, subscribe.topicNames, pMnode, pMsg->info.conn.user, subscribe.enableReplay);
+ code = validateTopics(subscribe.topicNames, pMnode, pMsg->info.conn.user, subscribe.enableReplay);
if (code != TSDB_CODE_SUCCESS) {
goto _over;
}
diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c
index ad596289de..d12f73cee6 100644
--- a/source/dnode/mnode/impl/src/mndDb.c
+++ b/source/dnode/mnode/impl/src/mndDb.c
@@ -874,9 +874,6 @@ static int32_t mndProcessCreateDbReq(SRpcMsg *pReq) {
}
#endif
mInfo("db:%s, start to create, vgroups:%d", createReq.db, createReq.numOfVgroups);
- if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_DB, NULL) != 0) {
- goto _OVER;
- }
pDb = mndAcquireDb(pMnode, createReq.db);
if (pDb != NULL) {
@@ -901,6 +898,10 @@ static int32_t mndProcessCreateDbReq(SRpcMsg *pReq) {
}
}
+ if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_DB, NULL) != 0) {
+ goto _OVER;
+ }
+
if ((terrno = grantCheck(TSDB_GRANT_DB)) != 0) {
code = terrno;
goto _OVER;
diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c
index 57ddbb9beb..d02aec98ca 100644
--- a/source/dnode/mnode/impl/src/mndDnode.c
+++ b/source/dnode/mnode/impl/src/mndDnode.c
@@ -14,9 +14,8 @@
*/
#define _DEFAULT_SOURCE
-#include
-#include "tjson.h"
#include "mndDnode.h"
+#include
#include "audit.h"
#include "mndCluster.h"
#include "mndDb.h"
@@ -28,9 +27,10 @@
#include "mndTrans.h"
#include "mndUser.h"
#include "mndVgroup.h"
+#include "taos_monitor.h"
+#include "tjson.h"
#include "tmisce.h"
#include "tunit.h"
-#include "taos_monitor.h"
#define TSDB_DNODE_VER_NUMBER 2
#define TSDB_DNODE_RESERVE_SIZE 40
@@ -191,8 +191,8 @@ static SSdbRaw *mndDnodeActionEncode(SDnodeObj *pDnode) {
SDB_SET_BINARY(pRaw, dataPos, pDnode->fqdn, TSDB_FQDN_LEN, _OVER)
SDB_SET_BINARY(pRaw, dataPos, pDnode->machineId, TSDB_MACHINE_ID_LEN, _OVER)
SDB_SET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER)
- SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible
- SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible
+ SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible
+ SDB_SET_INT16(pRaw, dataPos, 0, _OVER) // forward/backward compatible
SDB_SET_DATALEN(pRaw, dataPos, _OVER);
terrno = 0;
@@ -536,49 +536,49 @@ static int32_t mndProcessStatisReq(SRpcMsg *pReq) {
int32_t code = -1;
char strClusterId[TSDB_CLUSTER_ID_LEN] = {0};
- sprintf(strClusterId, "%"PRId64, pMnode->clusterId);
+ sprintf(strClusterId, "%" PRId64, pMnode->clusterId);
if (tDeserializeSStatisReq(pReq->pCont, pReq->contLen, &statisReq) != 0) {
terrno = TSDB_CODE_INVALID_MSG;
return code;
}
- if(tsMonitorLogProtocol){
+ if (tsMonitorLogProtocol) {
mInfo("process statis req,\n %s", statisReq.pCont);
}
- SJson* pJson = tjsonParse(statisReq.pCont);
+ SJson *pJson = tjsonParse(statisReq.pCont);
int32_t ts_size = tjsonGetArraySize(pJson);
- for(int32_t i = 0; i < ts_size; i++){
- SJson* item = tjsonGetArrayItem(pJson, i);
+ for (int32_t i = 0; i < ts_size; i++) {
+ SJson *item = tjsonGetArrayItem(pJson, i);
- SJson* tables = tjsonGetObjectItem(item, "tables");
+ SJson *tables = tjsonGetObjectItem(item, "tables");
int32_t tableSize = tjsonGetArraySize(tables);
- for(int32_t i = 0; i < tableSize; i++){
- SJson* table = tjsonGetArrayItem(tables, i);
+ for (int32_t i = 0; i < tableSize; i++) {
+ SJson *table = tjsonGetArrayItem(tables, i);
char tableName[MONITOR_TABLENAME_LEN] = {0};
tjsonGetStringValue(table, "name", tableName);
- SJson* metricGroups = tjsonGetObjectItem(table, "metric_groups");
+ SJson *metricGroups = tjsonGetObjectItem(table, "metric_groups");
int32_t size = tjsonGetArraySize(metricGroups);
- for(int32_t i = 0; i < size; i++){
- SJson* item = tjsonGetArrayItem(metricGroups, i);
+ for (int32_t i = 0; i < size; i++) {
+ SJson *item = tjsonGetArrayItem(metricGroups, i);
- SJson* arrayTag = tjsonGetObjectItem(item, "tags");
+ SJson *arrayTag = tjsonGetObjectItem(item, "tags");
int32_t tagSize = tjsonGetArraySize(arrayTag);
- for(int32_t j = 0; j < tagSize; j++){
- SJson* item = tjsonGetArrayItem(arrayTag, j);
+ for (int32_t j = 0; j < tagSize; j++) {
+ SJson *item = tjsonGetArrayItem(arrayTag, j);
char tagName[MONITOR_TAG_NAME_LEN] = {0};
tjsonGetStringValue(item, "name", tagName);
- if(strncmp(tagName, "cluster_id", MONITOR_TAG_NAME_LEN) == 0) {
+ if (strncmp(tagName, "cluster_id", MONITOR_TAG_NAME_LEN) == 0) {
tjsonDeleteItemFromObject(item, "value");
tjsonAddStringToObject(item, "value", strClusterId);
}
@@ -590,12 +590,12 @@ static int32_t mndProcessStatisReq(SRpcMsg *pReq) {
char *pCont = tjsonToString(pJson);
monSendContent(pCont);
- if(pJson != NULL){
+ if (pJson != NULL) {
tjsonDelete(pJson);
pJson = NULL;
}
- if(pCont != NULL){
+ if (pCont != NULL) {
taosMemoryFree(pCont);
pCont = NULL;
}
@@ -603,132 +603,132 @@ static int32_t mndProcessStatisReq(SRpcMsg *pReq) {
tFreeSStatisReq(&statisReq);
return 0;
-/*
- SJson* pJson = tjsonParse(statisReq.pCont);
+ /*
+ SJson* pJson = tjsonParse(statisReq.pCont);
- int32_t ts_size = tjsonGetArraySize(pJson);
+ int32_t ts_size = tjsonGetArraySize(pJson);
- for(int32_t i = 0; i < ts_size; i++){
- SJson* item = tjsonGetArrayItem(pJson, i);
+ for(int32_t i = 0; i < ts_size; i++){
+ SJson* item = tjsonGetArrayItem(pJson, i);
- SJson* tables = tjsonGetObjectItem(item, "tables");
+ SJson* tables = tjsonGetObjectItem(item, "tables");
- int32_t tableSize = tjsonGetArraySize(tables);
- for(int32_t i = 0; i < tableSize; i++){
- SJson* table = tjsonGetArrayItem(tables, i);
+ int32_t tableSize = tjsonGetArraySize(tables);
+ for(int32_t i = 0; i < tableSize; i++){
+ SJson* table = tjsonGetArrayItem(tables, i);
- char tableName[MONITOR_TABLENAME_LEN] = {0};
- tjsonGetStringValue(table, "name", tableName);
+ char tableName[MONITOR_TABLENAME_LEN] = {0};
+ tjsonGetStringValue(table, "name", tableName);
- SJson* metricGroups = tjsonGetObjectItem(table, "metric_groups");
+ SJson* metricGroups = tjsonGetObjectItem(table, "metric_groups");
- int32_t size = tjsonGetArraySize(metricGroups);
- for(int32_t i = 0; i < size; i++){
- SJson* item = tjsonGetArrayItem(metricGroups, i);
+ int32_t size = tjsonGetArraySize(metricGroups);
+ for(int32_t i = 0; i < size; i++){
+ SJson* item = tjsonGetArrayItem(metricGroups, i);
- SJson* arrayTag = tjsonGetObjectItem(item, "tags");
+ SJson* arrayTag = tjsonGetObjectItem(item, "tags");
- int32_t tagSize = tjsonGetArraySize(arrayTag);
+ int32_t tagSize = tjsonGetArraySize(arrayTag);
- char** labels = taosMemoryMalloc(sizeof(char*) * tagSize);
- char** sample_labels = taosMemoryMalloc(sizeof(char*) * tagSize);
+ char** labels = taosMemoryMalloc(sizeof(char*) * tagSize);
+ char** sample_labels = taosMemoryMalloc(sizeof(char*) * tagSize);
- for(int32_t j = 0; j < tagSize; j++){
- SJson* item = tjsonGetArrayItem(arrayTag, j);
+ for(int32_t j = 0; j < tagSize; j++){
+ SJson* item = tjsonGetArrayItem(arrayTag, j);
- *(labels + j) = taosMemoryMalloc(MONITOR_TAG_NAME_LEN);
- tjsonGetStringValue(item, "name", *(labels + j));
+ *(labels + j) = taosMemoryMalloc(MONITOR_TAG_NAME_LEN);
+ tjsonGetStringValue(item, "name", *(labels + j));
- *(sample_labels + j) = taosMemoryMalloc(MONITOR_TAG_VALUE_LEN);
- tjsonGetStringValue(item, "value", *(sample_labels + j));
- if(strncmp(*(labels + j), "cluster_id", MONITOR_TAG_NAME_LEN) == 0) {
- strncpy(*(sample_labels + j), strClusterId, MONITOR_TAG_VALUE_LEN);
+ *(sample_labels + j) = taosMemoryMalloc(MONITOR_TAG_VALUE_LEN);
+ tjsonGetStringValue(item, "value", *(sample_labels + j));
+ if(strncmp(*(labels + j), "cluster_id", MONITOR_TAG_NAME_LEN) == 0) {
+ strncpy(*(sample_labels + j), strClusterId, MONITOR_TAG_VALUE_LEN);
+ }
}
- }
- SJson* metrics = tjsonGetObjectItem(item, "metrics");
+ SJson* metrics = tjsonGetObjectItem(item, "metrics");
- int32_t metricLen = tjsonGetArraySize(metrics);
- for(int32_t j = 0; j < metricLen; j++){
- SJson *item = tjsonGetArrayItem(metrics, j);
+ int32_t metricLen = tjsonGetArraySize(metrics);
+ for(int32_t j = 0; j < metricLen; j++){
+ SJson *item = tjsonGetArrayItem(metrics, j);
- char name[MONITOR_METRIC_NAME_LEN] = {0};
- tjsonGetStringValue(item, "name", name);
+ char name[MONITOR_METRIC_NAME_LEN] = {0};
+ tjsonGetStringValue(item, "name", name);
- double value = 0;
- tjsonGetDoubleValue(item, "value", &value);
+ double value = 0;
+ tjsonGetDoubleValue(item, "value", &value);
- double type = 0;
- tjsonGetDoubleValue(item, "type", &type);
+ double type = 0;
+ tjsonGetDoubleValue(item, "type", &type);
- int32_t metricNameLen = strlen(name) + strlen(tableName) + 2;
- char* metricName = taosMemoryMalloc(metricNameLen);
- memset(metricName, 0, metricNameLen);
- sprintf(metricName, "%s:%s", tableName, name);
+ int32_t metricNameLen = strlen(name) + strlen(tableName) + 2;
+ char* metricName = taosMemoryMalloc(metricNameLen);
+ memset(metricName, 0, metricNameLen);
+ sprintf(metricName, "%s:%s", tableName, name);
- taos_metric_t* metric = taos_collector_registry_get_metric(metricName);
- if(metric == NULL){
- if(type == 0){
- metric = taos_counter_new(metricName, "", tagSize, (const char**)labels);
- }
- if(type == 1){
- metric = taos_gauge_new(metricName, "", tagSize, (const char**)labels);
- }
- mTrace("fail to get metric from registry, new one metric:%p", metric);
-
- if(taos_collector_registry_register_metric(metric) == 1){
+ taos_metric_t* metric = taos_collector_registry_get_metric(metricName);
+ if(metric == NULL){
if(type == 0){
- taos_counter_destroy(metric);
+ metric = taos_counter_new(metricName, "", tagSize, (const char**)labels);
}
if(type == 1){
- taos_gauge_destroy(metric);
+ metric = taos_gauge_new(metricName, "", tagSize, (const char**)labels);
}
+ mTrace("fail to get metric from registry, new one metric:%p", metric);
- metric = taos_collector_registry_get_metric(metricName);
+ if(taos_collector_registry_register_metric(metric) == 1){
+ if(type == 0){
+ taos_counter_destroy(metric);
+ }
+ if(type == 1){
+ taos_gauge_destroy(metric);
+ }
- mTrace("fail to register metric, get metric from registry:%p", metric);
+ metric = taos_collector_registry_get_metric(metricName);
+
+ mTrace("fail to register metric, get metric from registry:%p", metric);
+ }
+ else{
+ mTrace("succeed to register metric:%p", metric);
+ }
}
else{
- mTrace("succeed to register metric:%p", metric);
+ mTrace("get metric from registry:%p", metric);
}
- }
- else{
- mTrace("get metric from registry:%p", metric);
+
+ if(type == 0){
+ taos_counter_add(metric, value, (const char**)sample_labels);
+ }
+ if(type == 1){
+ taos_gauge_set(metric, value, (const char**)sample_labels);
+ }
+
+ taosMemoryFreeClear(metricName);
}
- if(type == 0){
- taos_counter_add(metric, value, (const char**)sample_labels);
- }
- if(type == 1){
- taos_gauge_set(metric, value, (const char**)sample_labels);
+ for(int32_t j = 0; j < tagSize; j++){
+ taosMemoryFreeClear(*(labels + j));
+ taosMemoryFreeClear(*(sample_labels + j));
}
- taosMemoryFreeClear(metricName);
+ taosMemoryFreeClear(sample_labels);
+ taosMemoryFreeClear(labels);
}
-
- for(int32_t j = 0; j < tagSize; j++){
- taosMemoryFreeClear(*(labels + j));
- taosMemoryFreeClear(*(sample_labels + j));
- }
-
- taosMemoryFreeClear(sample_labels);
- taosMemoryFreeClear(labels);
}
+
}
- }
+ code = 0;
- code = 0;
+ _OVER:
+ if(pJson != NULL){
+ tjsonDelete(pJson);
+ pJson = NULL;
+ }
-_OVER:
- if(pJson != NULL){
- tjsonDelete(pJson);
- pJson = NULL;
- }
-
- tFreeSStatisReq(&statisReq);
- return code;
- */
+ tFreeSStatisReq(&statisReq);
+ return code;
+ */
}
static int32_t mndUpdateDnodeObj(SMnode *pMnode, SDnodeObj *pDnode) {
@@ -816,8 +816,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
bool reboot = (pDnode->rebootTime != statusReq.rebootTime);
bool supportVnodesChanged = pDnode->numOfSupportVnodes != statusReq.numOfSupportVnodes;
bool encryptKeyChanged = pDnode->encryptionKeyChksum != statusReq.clusterCfg.encryptionKeyChksum;
+ bool enableWhiteListChanged = statusReq.clusterCfg.enableWhiteList != (tsEnableWhiteList ? 1 : 0);
bool needCheck = !online || dnodeChanged || reboot || supportVnodesChanged ||
- pMnode->ipWhiteVer != statusReq.ipWhiteVer || encryptKeyChanged;
+ pMnode->ipWhiteVer != statusReq.ipWhiteVer || encryptKeyChanged || enableWhiteListChanged;
const STraceId *trace = &pReq->info.traceId;
mGTrace("dnode:%d, status received, accessTimes:%d check:%d online:%d reboot:%d changed:%d statusSeq:%d", pDnode->id,
@@ -1148,7 +1149,6 @@ _OVER:
}
tFreeSShowVariablesRsp(&rsp);
-
return code;
}
diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c
index 5fc6e465ad..c9598c4b38 100644
--- a/source/dnode/mnode/impl/src/mndStream.c
+++ b/source/dnode/mnode/impl/src/mndStream.c
@@ -56,13 +56,14 @@ static int32_t mndBuildStreamCheckpointSourceReq(void **pBuf, int32_t *pLen, int
int64_t streamId, int32_t taskId, int32_t transId, int8_t mndTrigger);
static int32_t mndProcessNodeCheck(SRpcMsg *pReq);
static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg);
-static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList);
+static int32_t extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList);
static int32_t mndProcessStreamReqCheckpoint(SRpcMsg *pReq);
+static int32_t mndProcessCheckpointReport(SRpcMsg *pReq);
static SVgroupChangeInfo mndFindChangedNodeInfo(SMnode *pMnode, const SArray *pPrevNodeList, const SArray *pNodeList);
-void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode);
-static int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot);
+static void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo *pExecInfo);
+static void removeExpiredNodeInfo(const SArray *pNodeSnapshot);
static int32_t doKillCheckpointTrans(SMnode *pMnode, const char *pDbName, size_t len);
static SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw);
@@ -103,6 +104,7 @@ int32_t mndInitStream(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_STOP_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_VND_STREAM_TASK_UPDATE_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_VND_STREAM_TASK_RESET_RSP, mndTransProcessRsp);
+ mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_UPDATE_CHKPT_RSP, mndTransProcessRsp);
// for msgs inside mnode
// TODO change the name
@@ -114,8 +116,10 @@ int32_t mndInitStream(SMnode *pMnode) {
mndSetMsgHandle(pMnode, TDMT_VND_STREAM_CHECK_POINT_SOURCE_RSP, mndTransProcessRsp);
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_BEGIN_CHECKPOINT, mndProcessStreamCheckpoint);
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_REQ_CHKPT, mndProcessStreamReqCheckpoint);
- mndSetMsgHandle(pMnode, TDMT_MND_STREAM_HEARTBEAT, mndProcessStreamHb);
+ mndSetMsgHandle(pMnode, TDMT_MND_STREAM_CHKPT_REPORT, mndProcessCheckpointReport);
+ mndSetMsgHandle(pMnode, TDMT_MND_STREAM_UPDATE_CHKPT_EVT, mndScanCheckpointReportInfo);
mndSetMsgHandle(pMnode, TDMT_STREAM_TASK_REPORT_CHECKPOINT, mndTransProcessRsp);
+ mndSetMsgHandle(pMnode, TDMT_MND_STREAM_HEARTBEAT, mndProcessStreamHb);
mndSetMsgHandle(pMnode, TDMT_MND_STREAM_NODECHANGE_CHECK, mndProcessNodeCheckReq);
mndSetMsgHandle(pMnode, TDMT_MND_PAUSE_STREAM, mndProcessPauseStreamReq);
@@ -131,9 +135,11 @@ int32_t mndInitStream(SMnode *pMnode) {
if (sdbSetTable(pMnode->pSdb, table) != 0) {
return -1;
}
+
if (sdbSetTable(pMnode->pSdb, tableSeq) != 0) {
return -1;
}
+
return 0;
}
@@ -143,6 +149,7 @@ void mndCleanupStream(SMnode *pMnode) {
taosHashCleanup(execInfo.pTaskMap);
taosHashCleanup(execInfo.transMgmt.pDBTrans);
taosHashCleanup(execInfo.pTransferStateStreams);
+ taosHashCleanup(execInfo.pChkptStreams);
taosThreadMutexDestroy(&execInfo.lock);
mDebug("mnd stream exec info cleanup");
}
@@ -508,7 +515,7 @@ int32_t mndPersistTaskDeployReq(STrans *pTrans, SStreamTask *pTask) {
tEncodeStreamTask(&encoder, pTask);
tEncoderClear(&encoder);
- int32_t code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0);
+ int32_t code = setTransAction(pTrans, buf, tlen, TDMT_STREAM_TASK_DEPLOY, &pTask->info.epSet, 0, 0);
if (code != 0) {
taosMemoryFree(buf);
return -1;
@@ -952,7 +959,7 @@ static int32_t doSetCheckpointAction(SMnode *pMnode, STrans *pTrans, SStreamTask
return -1;
}
- code = setTransAction(pTrans, buf, tlen, TDMT_VND_STREAM_CHECK_POINT_SOURCE, &epset, TSDB_CODE_SYN_PROPOSE_NOT_READY);
+ code = setTransAction(pTrans, buf, tlen, TDMT_VND_STREAM_CHECK_POINT_SOURCE, &epset, TSDB_CODE_SYN_PROPOSE_NOT_READY, 0);
if (code != 0) {
taosMemoryFree(buf);
}
@@ -1088,7 +1095,7 @@ static bool taskNodeIsUpdated(SMnode *pMnode) {
}
static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) {
- bool ready = true;
+ bool ready = true;
if (taskNodeIsUpdated(pMnode)) {
return -1;
}
@@ -1099,6 +1106,8 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) {
ASSERT(taosArrayGetSize(execInfo.pTaskList) == 0);
}
+ SArray* pInvalidList = taosArrayInit(4, sizeof(STaskId));
+
for (int32_t i = 0; i < taosArrayGetSize(execInfo.pTaskList); ++i) {
STaskId *p = taosArrayGet(execInfo.pTaskList, i);
STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, p, sizeof(*p));
@@ -1106,11 +1115,20 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) {
continue;
}
+ if (pEntry->status == TASK_STATUS__STOP) {
+ for(int32_t j = 0; j < taosArrayGetSize(pInvalidList); ++j) {
+ STaskId* pId = taosArrayGet(pInvalidList, j);
+ if (pEntry->id.streamId == pId->streamId) {
+ taosArrayPush(pInvalidList, &pEntry->id);
+ break;
+ }
+ }
+ }
+
if (pEntry->status != TASK_STATUS__READY) {
- mDebug("s-task:0x%" PRIx64 "-0x%x (nodeId:%d) status:%s not ready, checkpoint msg not issued",
+ mDebug("s-task:0x%" PRIx64 "-0x%x (nodeId:%d) status:%s, checkpoint not issued",
pEntry->id.streamId, (int32_t)pEntry->id.taskId, pEntry->nodeId, streamTaskGetStatusStr(pEntry->status));
ready = false;
- break;
}
if (pEntry->hTaskId != 0) {
@@ -1123,6 +1141,9 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) {
}
}
+ removeTasksInBuf(pInvalidList, &execInfo);
+ taosArrayDestroy(pInvalidList);
+
taosThreadMutexUnlock(&execInfo.lock);
return ready ? 0 : -1;
}
@@ -1151,7 +1172,8 @@ static int32_t mndProcessStreamCheckpoint(SRpcMsg *pReq) {
int32_t numOfCheckpointTrans = 0;
if ((code = mndCheckTaskAndNodeStatus(pMnode)) != 0) {
- return code;
+ terrno = TSDB_CODE_STREAM_TASK_IVLD_STATUS;
+ return -1;
}
SArray* pList = taosArrayInit(4, sizeof(SCheckpointInterval));
@@ -1798,6 +1820,10 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
int32_t numOfRows = 0;
SStreamObj *pStream = NULL;
+ taosThreadMutexLock(&execInfo.lock);
+ mndInitStreamExecInfo(pMnode, &execInfo);
+ taosThreadMutexUnlock(&execInfo.lock);
+
while (numOfRows < rowsCapacity) {
pShow->pIter = sdbFetch(pSdb, SDB_STREAM, pShow->pIter, (void **)&pStream);
if (pShow->pIter == NULL) {
@@ -2169,7 +2195,7 @@ static int32_t mndProcessVgroupChange(SMnode *pMnode, SVgroupChangeInfo *pChange
return 0;
}
-static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) {
+static int32_t extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) {
SSdb *pSdb = pMnode->pSdb;
SStreamObj *pStream = NULL;
void *pIter = NULL;
@@ -2215,48 +2241,6 @@ static SArray *extractNodeListFromStream(SMnode *pMnode, SArray* pNodeList) {
return TSDB_CODE_SUCCESS;
}
-static bool taskNodeExists(SArray *pList, int32_t nodeId) {
- size_t num = taosArrayGetSize(pList);
-
- for (int32_t i = 0; i < num; ++i) {
- SNodeEntry *pEntry = taosArrayGet(pList, i);
- if (pEntry->nodeId == nodeId) {
- return true;
- }
- }
-
- return false;
-}
-
-int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot) {
- SArray *pRemovedTasks = taosArrayInit(4, sizeof(STaskId));
-
- int32_t numOfTask = taosArrayGetSize(execInfo.pTaskList);
- for (int32_t i = 0; i < numOfTask; ++i) {
- STaskId *pId = taosArrayGet(execInfo.pTaskList, i);
-
- STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, pId, sizeof(*pId));
- if (pEntry->nodeId == SNODE_HANDLE) {
- continue;
- }
-
- bool existed = taskNodeExists(pNodeSnapshot, pEntry->nodeId);
- if (!existed) {
- taosArrayPush(pRemovedTasks, pId);
- }
- }
-
- removeTasksInBuf(pRemovedTasks, &execInfo);
-
- mDebug("remove invalid stream tasks:%d, remain:%d", (int32_t)taosArrayGetSize(pRemovedTasks),
- (int32_t)taosArrayGetSize(execInfo.pTaskList));
-
- removeExpiredNodeInfo(pNodeSnapshot);
-
- taosArrayDestroy(pRemovedTasks);
- return 0;
-}
-
// this function runs by only one thread, so it is not multi-thread safe
static int32_t mndProcessNodeCheckReq(SRpcMsg *pMsg) {
int32_t code = 0;
@@ -2476,13 +2460,137 @@ int32_t mndProcessStreamReqCheckpoint(SRpcMsg *pReq) {
taosThreadMutexUnlock(&execInfo.lock);
{
- SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamReqCheckpointRspMsg)};
+ SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamReqCheckpointRsp)};
rsp.pCont = rpcMallocCont(rsp.contLen);
SMsgHead *pHead = rsp.pCont;
pHead->vgId = htonl(req.nodeId);
tmsgSendRsp(&rsp);
+ pReq->info.handle = NULL; // disable auto rsp
+ }
+ return 0;
+}
+
+static void doAddTaskInfo(SArray* pList, SCheckpointReport* pReport) {
+ bool existed = false;
+ for(int32_t i = 0; i < taosArrayGetSize(pList); ++i) {
+ STaskChkptInfo* p = taosArrayGet(pList ,i);
+ if (p->taskId == pReport->taskId) {
+ existed = true;
+ break;
+ }
+ }
+
+ if (!existed) {
+ STaskChkptInfo info = {
+ .streamId = pReport->streamId,
+ .taskId = pReport->taskId,
+ .transId = pReport->transId,
+ .dropHTask = pReport->dropHTask,
+ .version = pReport->checkpointVer,
+ .ts = pReport->checkpointTs,
+ .checkpointId = pReport->checkpointId,
+ .nodeId = pReport->nodeId,
+ };
+ taosArrayPush(pList, &info);
+ }
+}
+
+int32_t mndProcessCheckpointReport(SRpcMsg *pReq) {
+ SMnode *pMnode = pReq->info.node;
+ SCheckpointReport req = {0};
+
+ SDecoder decoder = {0};
+ tDecoderInit(&decoder, pReq->pCont, pReq->contLen);
+
+ if (tDecodeStreamTaskChkptReport(&decoder, &req)) {
+ tDecoderClear(&decoder);
+ terrno = TSDB_CODE_INVALID_MSG;
+ mError("invalid task checkpoint-report msg received");
+ return -1;
+ }
+ tDecoderClear(&decoder);
+
+ mDebug("receive stream task checkpoint-report msg, vgId:%d, s-task:0x%x, checkpointId:%" PRId64
+ " checkpointVer:%" PRId64 " transId:%d",
+ req.nodeId, req.taskId, req.checkpointId, req.checkpointVer, req.transId);
+
+ // register to the stream task done map, if all tasks has sent this kinds of message, start the checkpoint trans.
+ taosThreadMutexLock(&execInfo.lock);
+
+ SStreamObj *pStream = mndGetStreamObj(pMnode, req.streamId);
+ if (pStream == NULL) {
+ mWarn("failed to find the stream:0x%" PRIx64 ", not handle checkpoint-report, try to acquire in buf",
+ req.streamId);
+
+ // not in meta-store yet, try to acquire the task in exec buffer
+ // the checkpoint req arrives too soon before the completion of the create stream trans.
+ STaskId id = {.streamId = req.streamId, .taskId = req.taskId};
+ void *p = taosHashGet(execInfo.pTaskMap, &id, sizeof(id));
+ if (p == NULL) {
+ mError("failed to find the stream:0x%" PRIx64 " in buf, not handle the checkpoint-report", req.streamId);
+ terrno = TSDB_CODE_MND_STREAM_NOT_EXIST;
+ taosThreadMutexUnlock(&execInfo.lock);
+ return -1;
+ } else {
+ mDebug("s-task:0x%" PRIx64 "-0x%x in buf not in mnode/meta, create stream trans may not complete yet",
+ req.streamId, req.taskId);
+ }
+ }
+
+ int32_t numOfTasks = (pStream == NULL) ? 0 : mndGetNumOfStreamTasks(pStream);
+
+ SArray **pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId));
+ if (pReqTaskList == NULL) {
+ SArray *pList = taosArrayInit(4, sizeof(STaskChkptInfo));
+ doAddTaskInfo(pList, &req);
+ taosHashPut(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId), &pList, POINTER_BYTES);
+
+ pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId));
+ } else {
+ doAddTaskInfo(*pReqTaskList, &req);
+ }
+
+ int32_t total = taosArrayGetSize(*pReqTaskList);
+ if (total == numOfTasks) { // all tasks has send the reqs
+ mInfo("stream:0x%" PRIx64 " %s all %d tasks send checkpoint-report, checkpoint meta-info for checkpointId:%" PRId64
+ " will be issued soon",
+ req.streamId, pStream->name, total, req.checkpointId);
+
+ // if (pStream != NULL) {
+ // bool conflict = mndStreamTransConflictCheck(pMnode, pStream->uid, MND_STREAM_CHKPT_UPDATE_NAME, false);
+ // if (conflict) {
+ // mDebug("stream:0x%"PRIx64" active checkpoint trans not finished yet, wait", req.streamId);
+ // } else {
+ // int32_t code = mndCreateStreamChkptInfoUpdateTrans(pMnode, pStream, *pReqTaskList);
+ // if (code == TSDB_CODE_SUCCESS) { // remove this entry
+ // taosHashRemove(execInfo.pChkptStreams, &req.streamId, sizeof(req.streamId));
+ //
+ // int32_t numOfStreams = taosHashGetSize(execInfo.pChkptStreams);
+ // mDebug("stream:0x%" PRIx64 " removed, remain streams:%d in checkpoint procedure", req.streamId,
+ // numOfStreams);
+ // } else {
+ // mDebug("stream:0x%" PRIx64 " not launch chkpt update trans, due to checkpoint not finished yet",
+ // req.streamId);
+ // }
+ // }
+ // }
+ }
+
+ if (pStream != NULL) {
+ mndReleaseStream(pMnode, pStream);
+ }
+
+ taosThreadMutexUnlock(&execInfo.lock);
+
+ {
+ SRpcMsg rsp = {.code = 0, .info = pReq->info, .contLen = sizeof(SMStreamUpdateChkptRsp)};
+ rsp.pCont = rpcMallocCont(rsp.contLen);
+ SMsgHead *pHead = rsp.pCont;
+ pHead->vgId = htonl(req.nodeId);
+
+ tmsgSendRsp(&rsp);
pReq->info.handle = NULL; // disable auto rsp
}
@@ -2510,3 +2618,63 @@ static int32_t mndProcessDropStreamReqFromMNode(SRpcMsg *pReq) {
}
return code;
}
+
+void mndInitStreamExecInfo(SMnode *pMnode, SStreamExecInfo *pExecInfo) {
+ if (pExecInfo->initTaskList || pMnode == NULL) {
+ return;
+ }
+
+ addAllStreamTasksIntoBuf(pMnode, pExecInfo);
+ extractNodeListFromStream(pMnode, pExecInfo->pNodeList);
+ pExecInfo->initTaskList = true;
+}
+
+void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo* pExecInfo) {
+ SSdb *pSdb = pMnode->pSdb;
+ SStreamObj *pStream = NULL;
+ void *pIter = NULL;
+
+ while (1) {
+ pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream);
+ if (pIter == NULL) {
+ break;
+ }
+
+ saveTaskAndNodeInfoIntoBuf(pStream, pExecInfo);
+ sdbRelease(pSdb, pStream);
+ }
+}
+
+int32_t mndCreateStreamChkptInfoUpdateTrans(SMnode *pMnode, SStreamObj *pStream, SArray* pChkptInfoList) {
+ STrans *pTrans = doCreateTrans(pMnode, pStream, NULL, TRN_CONFLICT_NOTHING, MND_STREAM_CHKPT_UPDATE_NAME, "update checkpoint-info");
+ if (pTrans == NULL) {
+ return terrno;
+ }
+
+ /*int32_t code = */mndStreamRegisterTrans(pTrans, MND_STREAM_CHKPT_UPDATE_NAME, pStream->uid);
+ int32_t code = mndStreamSetUpdateChkptAction(pMnode, pTrans, pStream);
+ if (code != 0) {
+ sdbRelease(pMnode->pSdb, pStream);
+ mndTransDrop(pTrans);
+ return code;
+ }
+
+ code = mndPersistTransLog(pStream, pTrans, SDB_STATUS_READY);
+ if (code != TSDB_CODE_SUCCESS) {
+ sdbRelease(pMnode->pSdb, pStream);
+ mndTransDrop(pTrans);
+ return -1;
+ }
+
+ if (mndTransPrepare(pMnode, pTrans) != 0) {
+ mError("trans:%d, failed to prepare update checkpoint-info meta trans since %s", pTrans->id, terrstr());
+ sdbRelease(pMnode->pSdb, pStream);
+ mndTransDrop(pTrans);
+ return -1;
+ }
+
+ sdbRelease(pMnode->pSdb, pStream);
+ mndTransDrop(pTrans);
+
+ return TSDB_CODE_ACTION_IN_PROGRESS;
+}
\ No newline at end of file
diff --git a/source/dnode/mnode/impl/src/mndStreamHb.c b/source/dnode/mnode/impl/src/mndStreamHb.c
index 42efb6589e..a79fe0cf0a 100644
--- a/source/dnode/mnode/impl/src/mndStreamHb.c
+++ b/source/dnode/mnode/impl/src/mndStreamHb.c
@@ -22,54 +22,7 @@ typedef struct SFailedCheckpointInfo {
int32_t transId;
} SFailedCheckpointInfo;
-static void addAllStreamTasksIntoBuf(SMnode *pMnode, SStreamExecInfo* pExecInfo) {
- SSdb *pSdb = pMnode->pSdb;
- SStreamObj *pStream = NULL;
- void *pIter = NULL;
-
- while (1) {
- pIter = sdbFetch(pSdb, SDB_STREAM, pIter, (void **)&pStream);
- if (pIter == NULL) {
- break;
- }
-
- saveTaskAndNodeInfoIntoBuf(pStream, pExecInfo);
- sdbRelease(pSdb, pStream);
- }
-}
-
-static void removeDroppedStreamTasksInBuf(SMnode *pMnode, SStreamExecInfo *pExecInfo) {
- if (pMnode == NULL) {
- return;
- }
-
- int32_t num = taosArrayGetSize(pExecInfo->pTaskList);
-
- SHashObj *pHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
- SArray *pIdList = taosArrayInit(4, sizeof(STaskId));
-
- for (int32_t i = 0; i < num; ++i) {
- STaskId* pId = taosArrayGet(pExecInfo->pTaskList, i);
-
- void* p = taosHashGet(pHash, &pId->streamId, sizeof(int64_t));
- if (p != NULL) {
- continue;
- }
-
- void* pObj = mndGetStreamObj(pMnode, pId->streamId);
- if (pObj != NULL) {
- mndReleaseStream(pMnode, pObj);
- taosHashPut(pHash, &pId->streamId, sizeof(int64_t), NULL, 0);
- } else {
- taosArrayPush(pIdList, pId);
- }
- }
-
- removeTasksInBuf(pIdList, &execInfo);
-
- taosArrayDestroy(pIdList);
- taosHashCleanup(pHash);
-}
+static void mndStreamStartUpdateCheckpointInfo(SMnode *pMnode);
static void updateStageInfo(STaskStatusEntry *pTaskEntry, int64_t stage) {
int32_t numOfNodes = taosArrayGetSize(execInfo.pNodeList);
@@ -290,16 +243,7 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) {
taosThreadMutexLock(&execInfo.lock);
- // extract stream task list
- if (taosHashGetSize(execInfo.pTaskMap) == 0) {
- addAllStreamTasksIntoBuf(pMnode, &execInfo);
- } else {
- // the already dropped tasks may be added by hb from vnode at the time when the pTaskMap happens to be empty.
- // let's drop them here.
- removeDroppedStreamTasksInBuf(pMnode, &execInfo);
- }
-
- extractStreamNodeList(pMnode);
+ mndInitStreamExecInfo(pMnode, &execInfo);
int32_t numOfUpdated = taosArrayGetSize(req.pUpdateNodes);
if (numOfUpdated > 0) {
@@ -326,18 +270,6 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) {
snodeChanged = true;
}
} else {
- // task is idle for more than 50 sec.
-// if (fabs(pTaskEntry->inputQUsed - p->inputQUsed) <= DBL_EPSILON) {
-// if (!pTaskEntry->inputQChanging) {
-// pTaskEntry->inputQUnchangeCounter++;
-// } else {
-// pTaskEntry->inputQChanging = false;
-// }
-// } else {
-// pTaskEntry->inputQChanging = true;
-// pTaskEntry->inputQUnchangeCounter = 0;
-// }
-
streamTaskStatusCopy(pTaskEntry, p);
STaskCkptInfo *pChkInfo = &p->checkpointInfo;
@@ -348,6 +280,9 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) {
SFailedCheckpointInfo info = {
.transId = pChkInfo->activeTransId, .checkpointId = pChkInfo->activeId, .streamUid = p->id.streamId};
addIntoCheckpointList(pFailedChkpt, &info);
+
+ // remove failed trans from pChkptStreams
+ taosHashRemove(execInfo.pChkptStreams, &p->id.streamId, sizeof(p->id.streamId));
}
}
@@ -393,6 +328,10 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) {
mndDropOrphanTasks(pMnode, pOrphanTasks);
}
+ if (pMnode != NULL) { // make sure that the unit test case can work
+ mndStreamStartUpdateCheckpointInfo(pMnode);
+ }
+
taosThreadMutexUnlock(&execInfo.lock);
tCleanupStreamHbMsg(&req);
@@ -411,3 +350,12 @@ int32_t mndProcessStreamHb(SRpcMsg *pReq) {
return TSDB_CODE_SUCCESS;
}
+
+void mndStreamStartUpdateCheckpointInfo(SMnode *pMnode) { // here reuse the doCheckpointmsg
+ SMStreamDoCheckpointMsg *pMsg = rpcMallocCont(sizeof(SMStreamDoCheckpointMsg));
+ if (pMsg != NULL) {
+ int32_t size = sizeof(SMStreamDoCheckpointMsg);
+ SRpcMsg rpcMsg = {.msgType = TDMT_MND_STREAM_UPDATE_CHKPT_EVT, .pCont = pMsg, .contLen = size};
+ tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg);
+ }
+}
\ No newline at end of file
diff --git a/source/dnode/mnode/impl/src/mndStreamTrans.c b/source/dnode/mnode/impl/src/mndStreamTrans.c
index ff31aa0f7d..0daa383d3e 100644
--- a/source/dnode/mnode/impl/src/mndStreamTrans.c
+++ b/source/dnode/mnode/impl/src/mndStreamTrans.c
@@ -127,7 +127,7 @@ bool mndStreamTransConflictCheck(SMnode* pMnode, int64_t streamId, const char* p
return false;
}
-int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamUid) {
+int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamId) {
taosThreadMutexLock(&execInfo.lock);
int32_t num = taosHashGetSize(execInfo.transMgmt.pDBTrans);
if (num <= 0) {
@@ -136,12 +136,13 @@ int32_t mndStreamGetRelTrans(SMnode* pMnode, int64_t streamUid) {
}
mndStreamClearFinishedTrans(pMnode, NULL);
- SStreamTransInfo* pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, &streamUid, sizeof(streamUid));
+ SStreamTransInfo* pEntry = taosHashGet(execInfo.transMgmt.pDBTrans, &streamId, sizeof(streamId));
if (pEntry != NULL) {
SStreamTransInfo tInfo = *pEntry;
taosThreadMutexUnlock(&execInfo.lock);
- if (strcmp(tInfo.name, MND_STREAM_CHECKPOINT_NAME) == 0 || strcmp(tInfo.name, MND_STREAM_TASK_UPDATE_NAME) == 0) {
+ if (strcmp(tInfo.name, MND_STREAM_CHECKPOINT_NAME) == 0 || strcmp(tInfo.name, MND_STREAM_TASK_UPDATE_NAME) == 0 ||
+ strcmp(tInfo.name, MND_STREAM_CHKPT_UPDATE_NAME) == 0) {
return tInfo.transId;
}
} else {
@@ -159,7 +160,7 @@ STrans *doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnCo
return NULL;
}
- mInfo("s-task:0x%" PRIx64 " start to build trans %s, transId:%d", pStream->uid, pMsg, pTrans->id);
+ mInfo("stream:0x%" PRIx64 " start to build trans %s, transId:%d", pStream->uid, pMsg, pTrans->id);
mndTransSetDbName(pTrans, pStream->sourceDb, pStream->targetSTbName);
if (mndTransCheckConflict(pMnode, pTrans) != 0) {
@@ -246,8 +247,9 @@ int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status)
}
int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset,
- int32_t retryCode) {
- STransAction action = {.epSet = *pEpset, .contLen = contLen, .pCont = pCont, .msgType = msgType, .retryCode = retryCode};
+ int32_t retryCode, int32_t acceptCode) {
+ STransAction action = {.epSet = *pEpset, .contLen = contLen, .pCont = pCont, .msgType = msgType, .retryCode = retryCode,
+ .acceptableCode = acceptCode};
return mndTransAppendRedoAction(pTrans, &action);
}
diff --git a/source/dnode/mnode/impl/src/mndStreamUtil.c b/source/dnode/mnode/impl/src/mndStreamUtil.c
index d138254afd..e47f28c309 100644
--- a/source/dnode/mnode/impl/src/mndStreamUtil.c
+++ b/source/dnode/mnode/impl/src/mndStreamUtil.c
@@ -230,7 +230,7 @@ static int32_t doSetResumeAction(STrans *pTrans, SMnode *pMnode, SStreamTask *pT
return -1;
}
- code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0);
+ code = setTransAction(pTrans, pReq, sizeof(SVResumeStreamTaskReq), TDMT_STREAM_TASK_RESUME, &epset, 0, 0);
if (code != 0) {
taosMemoryFree(pReq);
return -1;
@@ -308,7 +308,7 @@ static int32_t doSetPauseAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa
epsetToStr(&epset, buf, tListLen(buf));
mDebug("pause stream task in node:%d, epset:%s", pTask->info.nodeId, buf);
- code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0);
+ code = setTransAction(pTrans, pReq, sizeof(SVPauseStreamTaskReq), TDMT_STREAM_TASK_PAUSE, &epset, 0, 0);
if (code != 0) {
taosMemoryFree(pReq);
return -1;
@@ -356,7 +356,7 @@ static int32_t doSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTas
}
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
- code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0);
+ code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0);
if (code != 0) {
taosMemoryFree(pReq);
return -1;
@@ -400,7 +400,7 @@ static int32_t doSetDropActionFromId(SMnode *pMnode, STrans *pTrans, SOrphanTask
}
// The epset of nodeId of this task may have been expired now, let's use the newest epset from mnode.
- code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0);
+ code = setTransAction(pTrans, pReq, sizeof(SVDropStreamTaskReq), TDMT_STREAM_TASK_DROP, &epset, 0, 0);
if (code != 0) {
taosMemoryFree(pReq);
return -1;
@@ -484,7 +484,7 @@ static int32_t doSetUpdateTaskAction(SMnode *pMnode, STrans *pTrans, SStreamTask
return code;
}
- code = setTransAction(pTrans, pBuf, len, TDMT_VND_STREAM_TASK_UPDATE, &epset, TSDB_CODE_VND_INVALID_VGROUP_ID);
+ code = setTransAction(pTrans, pBuf, len, TDMT_VND_STREAM_TASK_UPDATE, &epset, TSDB_CODE_VND_INVALID_VGROUP_ID, 0);
if (code != TSDB_CODE_SUCCESS) {
taosMemoryFree(pBuf);
}
@@ -534,7 +534,7 @@ static int32_t doSetResetAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTa
return code;
}
- code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0);
+ code = setTransAction(pTrans, pReq, sizeof(SVResetStreamTaskReq), TDMT_VND_STREAM_TASK_RESET, &epset, 0, 0);
if (code != TSDB_CODE_SUCCESS) {
taosMemoryFree(pReq);
}
@@ -574,9 +574,11 @@ void mndInitExecInfo() {
execInfo.pTaskMap = taosHashInit(64, fn, true, HASH_NO_LOCK);
execInfo.transMgmt.pDBTrans = taosHashInit(32, fn, true, HASH_NO_LOCK);
execInfo.pTransferStateStreams = taosHashInit(32, fn, true, HASH_NO_LOCK);
+ execInfo.pChkptStreams = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
execInfo.pNodeList = taosArrayInit(4, sizeof(SNodeEntry));
taosHashSetFreeFp(execInfo.pTransferStateStreams, freeTaskList);
+ taosHashSetFreeFp(execInfo.pChkptStreams, freeTaskList);
}
void removeExpiredNodeInfo(const SArray *pNodeSnapshot) {
@@ -645,4 +647,174 @@ void removeStreamTasksInBuf(SStreamObj *pStream, SStreamExecInfo *pExecNode) {
taosThreadMutexUnlock(&pExecNode->lock);
destroyStreamTaskIter(pIter);
+}
+
+static bool taskNodeExists(SArray *pList, int32_t nodeId) {
+ size_t num = taosArrayGetSize(pList);
+
+ for (int32_t i = 0; i < num; ++i) {
+ SNodeEntry *pEntry = taosArrayGet(pList, i);
+ if (pEntry->nodeId == nodeId) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+int32_t removeExpiredNodeEntryAndTaskInBuf(SArray *pNodeSnapshot) {
+ SArray *pRemovedTasks = taosArrayInit(4, sizeof(STaskId));
+
+ int32_t numOfTask = taosArrayGetSize(execInfo.pTaskList);
+ for (int32_t i = 0; i < numOfTask; ++i) {
+ STaskId *pId = taosArrayGet(execInfo.pTaskList, i);
+
+ STaskStatusEntry *pEntry = taosHashGet(execInfo.pTaskMap, pId, sizeof(*pId));
+ if (pEntry->nodeId == SNODE_HANDLE) {
+ continue;
+ }
+
+ bool existed = taskNodeExists(pNodeSnapshot, pEntry->nodeId);
+ if (!existed) {
+ taosArrayPush(pRemovedTasks, pId);
+ }
+ }
+
+ removeTasksInBuf(pRemovedTasks, &execInfo);
+
+ mDebug("remove invalid stream tasks:%d, remain:%d", (int32_t)taosArrayGetSize(pRemovedTasks),
+ (int32_t)taosArrayGetSize(execInfo.pTaskList));
+
+ removeExpiredNodeInfo(pNodeSnapshot);
+
+ taosArrayDestroy(pRemovedTasks);
+ return 0;
+}
+
+static int32_t doSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamTask *pTask) {
+ SVUpdateCheckpointInfoReq *pReq = taosMemoryCalloc(1, sizeof(SVUpdateCheckpointInfoReq));
+ if (pReq == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ mError("failed to malloc in reset stream, size:%" PRIzu ", code:%s", sizeof(SVUpdateCheckpointInfoReq),
+ tstrerror(TSDB_CODE_OUT_OF_MEMORY));
+ return terrno;
+ }
+
+ pReq->head.vgId = htonl(pTask->info.nodeId);
+ pReq->taskId = pTask->id.taskId;
+ pReq->streamId = pTask->id.streamId;
+
+ SArray **pReqTaskList = (SArray **)taosHashGet(execInfo.pChkptStreams, &pTask->id.streamId, sizeof(pTask->id.streamId));
+ ASSERT(pReqTaskList);
+
+ int32_t size = taosArrayGetSize(*pReqTaskList);
+ for(int32_t i = 0; i < size; ++i) {
+ STaskChkptInfo* pInfo = taosArrayGet(*pReqTaskList, i);
+ if (pInfo->taskId == pTask->id.taskId) {
+ pReq->checkpointId = pInfo->checkpointId;
+ pReq->checkpointVer = pInfo->version;
+ pReq->checkpointTs = pInfo->ts;
+ pReq->dropRelHTask = pInfo->dropHTask;
+ pReq->transId = pInfo->transId;
+ pReq->hStreamId = pTask->hTaskInfo.id.streamId;
+ pReq->hTaskId = pTask->hTaskInfo.id.taskId;
+ }
+ }
+
+ SEpSet epset = {0};
+ bool hasEpset = false;
+ int32_t code = extractNodeEpset(pMnode, &epset, &hasEpset, pTask->id.taskId, pTask->info.nodeId);
+ if (code != TSDB_CODE_SUCCESS || !hasEpset) {
+ taosMemoryFree(pReq);
+ return code;
+ }
+
+ code = setTransAction(pTrans, pReq, sizeof(SVUpdateCheckpointInfoReq), TDMT_STREAM_TASK_UPDATE_CHKPT, &epset, 0, TSDB_CODE_VND_INVALID_VGROUP_ID);
+ if (code != TSDB_CODE_SUCCESS) {
+ taosMemoryFree(pReq);
+ }
+
+ return code;
+}
+
+int32_t mndStreamSetUpdateChkptAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream) {
+ taosWLockLatch(&pStream->lock);
+
+ SStreamTaskIter *pIter = createStreamTaskIter(pStream);
+ while (streamTaskIterNextTask(pIter)) {
+ SStreamTask *pTask = streamTaskIterGetCurrent(pIter);
+
+ int32_t code = doSetUpdateChkptAction(pMnode, pTrans, pTask);
+ if (code != TSDB_CODE_SUCCESS) {
+ destroyStreamTaskIter(pIter);
+ taosWUnLockLatch(&pStream->lock);
+ return -1;
+ }
+ }
+
+ destroyStreamTaskIter(pIter);
+ taosWUnLockLatch(&pStream->lock);
+ return 0;
+}
+
+int32_t mndScanCheckpointReportInfo(SRpcMsg *pReq) {
+ SMnode *pMnode = pReq->info.node;
+ void *pIter = NULL;
+ SArray *pDropped = taosArrayInit(4, sizeof(int64_t));
+
+ mDebug("start to scan checkpoint report info");
+
+ while ((pIter = taosHashIterate(execInfo.pChkptStreams, pIter)) != NULL) {
+ SArray *pList = *(SArray **)pIter;
+
+ STaskChkptInfo* pInfo = taosArrayGet(pList, 0);
+ SStreamObj* pStream = mndGetStreamObj(pMnode, pInfo->streamId);
+ if (pStream == NULL) {
+ mDebug("failed to acquire stream:0x%" PRIx64 " remove it from checkpoint-report list", pInfo->streamId);
+ taosArrayPush(pDropped, &pInfo->streamId);
+ continue;
+ }
+
+ int32_t total = mndGetNumOfStreamTasks(pStream);
+ int32_t existed = (int32_t) taosArrayGetSize(pList);
+
+ if (total == existed) {
+ mDebug("stream:0x%" PRIx64 " %s all %d tasks send checkpoint-report, start to update checkpoint-info",
+ pStream->uid, pStream->name, total);
+
+ bool conflict = mndStreamTransConflictCheck(pMnode, pStream->uid, MND_STREAM_CHKPT_UPDATE_NAME, false);
+ if (!conflict) {
+ int32_t code = mndCreateStreamChkptInfoUpdateTrans(pMnode, pStream, pList);
+ if (code == TSDB_CODE_SUCCESS || code == TSDB_CODE_ACTION_IN_PROGRESS) { // remove this entry
+ taosArrayPush(pDropped, &pInfo->streamId);
+ mDebug("stream:0x%" PRIx64 " removed", pInfo->streamId);
+ } else {
+ mDebug("stream:0x%" PRIx64 " not launch chkpt-meta update trans, due to checkpoint not finished yet",
+ pInfo->streamId);
+ }
+ break;
+ } else {
+ mDebug("stream:0x%"PRIx64" active checkpoint trans not finished yet, wait", pInfo->streamId);
+ }
+ } else {
+ mDebug("stream:0x%" PRIx64 " %s %d/%d tasks send checkpoint-report, %d not send", pInfo->streamId, pStream->name,
+ existed, total, total - existed);
+ }
+
+ sdbRelease(pMnode->pSdb, pStream);
+ }
+
+ int32_t size = taosArrayGetSize(pDropped);
+ if (size > 0) {
+ for (int32_t i = 0; i < size; ++i) {
+ int64_t streamId = *(int64_t *)taosArrayGet(pDropped, i);
+ taosHashRemove(execInfo.pChkptStreams, &streamId, sizeof(streamId));
+ }
+
+ int32_t numOfStreams = taosHashGetSize(execInfo.pChkptStreams);
+ mDebug("drop %d stream(s) in checkpoint-report list, remain:%d", size, numOfStreams);
+ }
+
+ taosArrayDestroy(pDropped);
+ return TSDB_CODE_SUCCESS;
}
\ No newline at end of file
diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c
index 0068b582cf..ffb723756c 100644
--- a/source/dnode/mnode/impl/src/mndSubscribe.c
+++ b/source/dnode/mnode/impl/src/mndSubscribe.c
@@ -618,13 +618,13 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
char cgroup[TSDB_CGROUP_LEN] = {0};
mndSplitSubscribeKey(pOutput->pSub->key, topic, cgroup, true);
- pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "tmq-reb");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pMsg, "tmq-reb");
if (pTrans == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto END;
}
- mndTransSetDbName(pTrans, topic, cgroup);
+ mndTransSetDbName(pTrans, pOutput->pSub->dbName, cgroup);
code = mndTransCheckConflict(pMnode, pTrans);
if (code != 0) {
goto END;
@@ -908,33 +908,37 @@ END:
}
static int32_t sendDeleteSubToVnode(SMnode *pMnode, SMqSubscribeObj *pSub, STrans *pTrans){
- // iter all vnode to delete handle
- int32_t sz = taosArrayGetSize(pSub->unassignedVgs);
- for (int32_t i = 0; i < sz; i++) {
- SMqVgEp *pVgEp = taosArrayGetP(pSub->unassignedVgs, i);
+ void* pIter = NULL;
+ SVgObj* pVgObj = NULL;
+ while (1) {
+ pIter = sdbFetch(pMnode->pSdb, SDB_VGROUP, pIter, (void**)&pVgObj);
+ if (pIter == NULL) {
+ break;
+ }
+
+ if (!mndVgroupInDb(pVgObj, pSub->dbUid)) {
+ sdbRelease(pMnode->pSdb, pVgObj);
+ continue;
+ }
SMqVDeleteReq *pReq = taosMemoryCalloc(1, sizeof(SMqVDeleteReq));
if(pReq == NULL){
terrno = TSDB_CODE_OUT_OF_MEMORY;
+ sdbRelease(pMnode->pSdb, pVgObj);
return -1;
}
- pReq->head.vgId = htonl(pVgEp->vgId);
- pReq->vgId = pVgEp->vgId;
+ pReq->head.vgId = htonl(pVgObj->vgId);
+ pReq->vgId = pVgObj->vgId;
pReq->consumerId = -1;
memcpy(pReq->subKey, pSub->key, TSDB_SUBSCRIBE_KEY_LEN);
- SVgObj *pVgObj = mndAcquireVgroup(pMnode, pVgEp->vgId);
- if (pVgObj == NULL) {
- taosMemoryFree(pReq);
- terrno = TSDB_CODE_MND_VGROUP_NOT_EXIST;
- return -1;
- }
STransAction action = {0};
action.epSet = mndGetVgroupEpset(pMnode, pVgObj);;
action.pCont = pReq;
action.contLen = sizeof(SMqVDeleteReq);
action.msgType = TDMT_VND_TMQ_DELETE_SUB;
+ action.acceptableCode = TSDB_CODE_MND_VGROUP_NOT_EXIST;
- mndReleaseVgroup(pMnode, pVgObj);
+ sdbRelease(pMnode->pSdb, pVgObj);
if (mndTransAppendRedoAction(pTrans, &action) != 0) {
taosMemoryFree(pReq);
return -1;
@@ -996,7 +1000,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
goto end;
}
- pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC_INSIDE, pMsg, "drop-cgroup");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB_INSIDE, pMsg, "drop-cgroup");
if (pTrans == NULL) {
mError("cgroup: %s on topic:%s, failed to drop since %s", dropReq.cgroup, dropReq.topic, terrstr());
code = -1;
@@ -1004,7 +1008,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
}
mInfo("trans:%d, used to drop cgroup:%s on topic %s", pTrans->id, dropReq.cgroup, dropReq.topic);
- mndTransSetDbName(pTrans, dropReq.topic, dropReq.cgroup);
+ mndTransSetDbName(pTrans, pSub->dbName, dropReq.cgroup);
code = mndTransCheckConflict(pMnode, pTrans);
if (code != 0) {
goto end;
diff --git a/source/dnode/mnode/impl/src/mndTopic.c b/source/dnode/mnode/impl/src/mndTopic.c
index 8a06b4a613..bcb38a3902 100644
--- a/source/dnode/mnode/impl/src/mndTopic.c
+++ b/source/dnode/mnode/impl/src/mndTopic.c
@@ -422,14 +422,14 @@ static int32_t mndCreateTopic(SMnode *pMnode, SRpcMsg *pReq, SCMCreateTopicReq *
SQueryPlan *pPlan = NULL;
SMqTopicObj topicObj = {0};
- pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC, pReq, "create-topic");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_DB, pReq, "create-topic");
if (pTrans == NULL) {
mError("topic:%s, failed to create since %s", pCreate->name, terrstr());
code = -1;
goto _OUT;
}
- mndTransSetDbName(pTrans, pCreate->name, NULL);
+ mndTransSetDbName(pTrans, pDb->name, NULL);
code = mndTransCheckConflict(pMnode, pTrans);
if (code != 0) {
goto _OUT;
@@ -779,14 +779,14 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
}
}
- pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_TOPIC, pReq, "drop-topic");
+ pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB, pReq, "drop-topic");
if (pTrans == NULL) {
mError("topic:%s, failed to drop since %s", pTopic->name, terrstr());
code = -1;
goto end;
}
- mndTransSetDbName(pTrans, pTopic->name, NULL);
+ mndTransSetDbName(pTrans, pTopic->db, NULL);
code = mndTransCheckConflict(pMnode, pTrans);
if (code != 0) {
goto end;
diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c
index 05f685ecb4..2176cf4e39 100644
--- a/source/dnode/mnode/impl/src/mndTrans.c
+++ b/source/dnode/mnode/impl/src/mndTrans.c
@@ -836,26 +836,26 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) {
}
}
- if (pNew->conflict == TRN_CONFLICT_TOPIC) {
- if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
- if (pTrans->conflict == TRN_CONFLICT_TOPIC || pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
- if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
- }
- }
- if (pNew->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
- if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
- if (pTrans->conflict == TRN_CONFLICT_TOPIC) {
- if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
- }
- if (pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
- if (strcasecmp(pNew->dbname, pTrans->dbname) == 0 && strcasecmp(pNew->stbname, pTrans->stbname) == 0)
- conflict = true;
- }
- }
+// if (pNew->conflict == TRN_CONFLICT_TOPIC) {
+// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
+// if (pTrans->conflict == TRN_CONFLICT_TOPIC || pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
+// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
+// }
+// }
+// if (pNew->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
+// if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
+// if (pTrans->conflict == TRN_CONFLICT_TOPIC) {
+// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0) conflict = true;
+// }
+// if (pTrans->conflict == TRN_CONFLICT_TOPIC_INSIDE) {
+// if (strcasecmp(pNew->dbname, pTrans->dbname) == 0 && strcasecmp(pNew->stbname, pTrans->stbname) == 0)
+// conflict = true;
+// }
+// }
if (pNew->conflict == TRN_CONFLICT_ARBGROUP) {
if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true;
if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) {
- void *pIter = taosHashIterate(pNew->arbGroupIds, NULL);
+ pIter = taosHashIterate(pNew->arbGroupIds, NULL);
while (pIter != NULL) {
int32_t groupId = *(int32_t *)pIter;
if (taosHashGet(pTrans->arbGroupIds, &groupId, sizeof(int32_t)) != NULL) {
diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c
index 8a2313370a..7cde8c5508 100644
--- a/source/dnode/mnode/impl/src/mndUser.c
+++ b/source/dnode/mnode/impl/src/mndUser.c
@@ -648,6 +648,7 @@ static int32_t mndCreateDefaultUser(SMnode *pMnode, char *acct, char *user, char
userObj.pIpWhiteList = createDefaultIpWhiteList();
if (strcmp(user, TSDB_DEFAULT_USER) == 0) {
userObj.superUser = 1;
+ userObj.createdb = 1;
}
SSdbRaw *pRaw = mndUserActionEncode(&userObj);
@@ -817,7 +818,7 @@ SSdbRaw *mndUserActionEncode(SUserObj *pUser) {
SDB_SET_INT8(pRaw, dataPos, pUser->superUser, _OVER)
SDB_SET_INT8(pRaw, dataPos, pUser->sysInfo, _OVER)
SDB_SET_INT8(pRaw, dataPos, pUser->enable, _OVER)
- SDB_SET_INT8(pRaw, dataPos, pUser->reserve, _OVER)
+ SDB_SET_UINT8(pRaw, dataPos, pUser->flag, _OVER)
SDB_SET_INT32(pRaw, dataPos, pUser->authVersion, _OVER)
SDB_SET_INT32(pRaw, dataPos, pUser->passVersion, _OVER)
SDB_SET_INT32(pRaw, dataPos, numOfReadDbs, _OVER)
@@ -1001,7 +1002,8 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT8(pRaw, dataPos, &pUser->superUser, _OVER)
SDB_GET_INT8(pRaw, dataPos, &pUser->sysInfo, _OVER)
SDB_GET_INT8(pRaw, dataPos, &pUser->enable, _OVER)
- SDB_GET_INT8(pRaw, dataPos, &pUser->reserve, _OVER)
+ SDB_GET_UINT8(pRaw, dataPos, &pUser->flag, _OVER)
+ if (pUser->superUser) pUser->createdb = 1;
SDB_GET_INT32(pRaw, dataPos, &pUser->authVersion, _OVER)
if (sver >= 4) {
SDB_GET_INT32(pRaw, dataPos, &pUser->passVersion, _OVER)
@@ -1395,6 +1397,7 @@ static int32_t mndUserActionUpdate(SSdb *pSdb, SUserObj *pOld, SUserObj *pNew) {
pOld->passVersion = pNew->passVersion;
pOld->sysInfo = pNew->sysInfo;
pOld->enable = pNew->enable;
+ pOld->flag = pNew->flag;
memcpy(pOld->pass, pNew->pass, TSDB_PASSWORD_LEN);
TSWAP(pOld->readDbs, pNew->readDbs);
TSWAP(pOld->writeDbs, pNew->writeDbs);
@@ -1445,6 +1448,7 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, SCreateUserReq *pCreate
userObj.superUser = 0; // pCreate->superUser;
userObj.sysInfo = pCreate->sysInfo;
userObj.enable = pCreate->enable;
+ userObj.createdb = 0;
if (pCreate->numIpRanges == 0) {
userObj.pIpWhiteList = createDefaultIpWhiteList();
@@ -1790,6 +1794,9 @@ static char *mndUserAuditTypeStr(int32_t type) {
if (type == TSDB_ALTER_USER_SYSINFO) {
return "userSysInfo";
}
+ if (type == TSDB_ALTER_USER_CREATEDB) {
+ return "userCreateDB";
+ }
return "error";
}
@@ -2009,6 +2016,10 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
newUser.sysInfo = alterReq.sysInfo;
}
+ if(alterReq.alterType == TSDB_ALTER_USER_CREATEDB) {
+ newUser.createdb = alterReq.createdb;
+ }
+
if (ALTER_USER_ADD_PRIVS(alterReq.alterType) || ALTER_USER_DEL_PRIVS(alterReq.alterType)) {
if (0 != mndProcessAlterUserPrivilegesReq(&alterReq, pMnode, &newUser)) goto _OVER;
}
@@ -2110,14 +2121,15 @@ static int32_t mndProcessAlterUserReq(SRpcMsg *pReq) {
if(alterReq.alterType == TSDB_ALTER_USER_PASSWD){
char detail[1000] = {0};
- sprintf(detail, "alterType:%s, enable:%d, superUser:%d, sysInfo:%d, tabName:%s, password:xxx",
+ sprintf(detail, "alterType:%s, enable:%d, superUser:%d, sysInfo:%d, createdb:%d, tabName:%s, password:xxx",
mndUserAuditTypeStr(alterReq.alterType), alterReq.enable, alterReq.superUser, alterReq.sysInfo,
- alterReq.tabName);
+ alterReq.createdb ? 1 : 0, alterReq.tabName);
auditRecord(pReq, pMnode->clusterId, "alterUser", "", alterReq.user, detail, strlen(detail));
}
else if(alterReq.alterType == TSDB_ALTER_USER_SUPERUSER ||
alterReq.alterType == TSDB_ALTER_USER_ENABLE ||
- alterReq.alterType == TSDB_ALTER_USER_SYSINFO){
+ alterReq.alterType == TSDB_ALTER_USER_SYSINFO ||
+ alterReq.alterType == TSDB_ALTER_USER_CREATEDB){
auditRecord(pReq, pMnode->clusterId, "alterUser", "", alterReq.user, alterReq.sql, alterReq.sqlLen);
}
else if(ALTER_USER_ADD_READ_DB_PRIV(alterReq.alterType, alterReq.privileges, alterReq.tabName)||
@@ -2290,6 +2302,7 @@ static int32_t mndRetrieveUsers(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
int32_t numOfRows = 0;
SUserObj *pUser = NULL;
int32_t cols = 0;
+ int8_t flag = 0;
char *pWrite;
while (numOfRows < rows) {
@@ -2314,6 +2327,11 @@ static int32_t mndRetrieveUsers(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
colDataSetVal(pColInfo, numOfRows, (const char *)&pUser->sysInfo, false);
+ cols++;
+ flag = pUser->createdb ? 1 : 0;
+ pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
+ colDataSetVal(pColInfo, numOfRows, (const char *)&flag, false);
+
cols++;
pColInfo = taosArrayGet(pBlock->pDataBlock, cols);
colDataSetVal(pColInfo, numOfRows, (const char *)&pUser->createdTime, false);
diff --git a/source/dnode/mnode/impl/test/func/func.cpp b/source/dnode/mnode/impl/test/func/func.cpp
index ee60556639..0fc903f5db 100644
--- a/source/dnode/mnode/impl/test/func/func.cpp
+++ b/source/dnode/mnode/impl/test/func/func.cpp
@@ -169,7 +169,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 1;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "f1");
+ char name[TSDB_FUNC_NAME_LEN] = "f1";
+ taosArrayPush(retrieveReq.pFuncNames, name);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
@@ -220,7 +221,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
retrieveReq.numOfFuncs = TSDB_FUNC_MAX_RETRIEVE + 1;
retrieveReq.pFuncNames = taosArrayInit(TSDB_FUNC_MAX_RETRIEVE + 1, TSDB_FUNC_NAME_LEN);
for (int32_t i = 0; i < TSDB_FUNC_MAX_RETRIEVE + 1; ++i) {
- taosArrayPush(retrieveReq.pFuncNames, "1");
+ char name[TSDB_FUNC_NAME_LEN] = "1";
+ taosArrayPush(retrieveReq.pFuncNames, name);
}
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
@@ -237,7 +239,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 1;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "f2");
+ char name[TSDB_FUNC_NAME_LEN] = "f2";
+ taosArrayPush(retrieveReq.pFuncNames, name);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
@@ -279,7 +282,8 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 1;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "f2");
+ char name[TSDB_FUNC_NAME_LEN] = "f2";
+ taosArrayPush(retrieveReq.pFuncNames, name);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
@@ -316,8 +320,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 2;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "f2");
- taosArrayPush(retrieveReq.pFuncNames, "f1");
+ char name1[TSDB_FUNC_NAME_LEN] = "f2";
+ taosArrayPush(retrieveReq.pFuncNames, name1);
+ char name2[TSDB_FUNC_NAME_LEN] = "f1";
+ taosArrayPush(retrieveReq.pFuncNames, name2);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
@@ -367,8 +373,10 @@ TEST_F(MndTestFunc, 03_Retrieve_Func) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 2;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "f2");
- taosArrayPush(retrieveReq.pFuncNames, "f3");
+ char name1[TSDB_FUNC_NAME_LEN] = "f2";
+ taosArrayPush(retrieveReq.pFuncNames, name1);
+ char name2[TSDB_FUNC_NAME_LEN] = "f3";
+ taosArrayPush(retrieveReq.pFuncNames, name2);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
@@ -483,7 +491,8 @@ TEST_F(MndTestFunc, 05_Actual_code) {
SRetrieveFuncReq retrieveReq = {0};
retrieveReq.numOfFuncs = 1;
retrieveReq.pFuncNames = taosArrayInit(1, TSDB_FUNC_NAME_LEN);
- taosArrayPush(retrieveReq.pFuncNames, "udf1");
+ char name[TSDB_FUNC_NAME_LEN] = "udf1";
+ taosArrayPush(retrieveReq.pFuncNames, name);
int32_t contLen = tSerializeSRetrieveFuncReq(NULL, 0, &retrieveReq);
void* pReq = rpcMallocCont(contLen);
diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h
index 0b2de2b151..fc9b89a141 100644
--- a/source/dnode/mnode/sdb/inc/sdb.h
+++ b/source/dnode/mnode/sdb/inc/sdb.h
@@ -57,6 +57,7 @@ extern "C" {
#define SDB_GET_INT32(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt32, int32_t)
#define SDB_GET_INT16(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt16, int16_t)
#define SDB_GET_INT8(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawInt8, int8_t)
+#define SDB_GET_UINT8(pData, dataPos, val, pos) SDB_GET_VAL(pData, dataPos, val, pos, sdbGetRawUInt8, uint8_t)
#define SDB_GET_RESERVE(pRaw, dataPos, valLen, pos) \
{ \
@@ -76,6 +77,7 @@ extern "C" {
#define SDB_SET_INT32(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt32, int32_t)
#define SDB_SET_INT16(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt16, int16_t)
#define SDB_SET_INT8(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawInt8, int8_t)
+#define SDB_SET_UINT8(pRaw, dataPos, val, pos) SDB_SET_VAL(pRaw, dataPos, val, pos, sdbSetRawUInt8, uint8_t)
#define SDB_SET_BINARY(pRaw, dataPos, val, valLen, pos) \
{ \
@@ -388,6 +390,7 @@ void sdbGetCommitInfo(SSdb *pSdb, int64_t *index, int64_t *term, int64_t *config
SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen);
void sdbFreeRaw(SSdbRaw *pRaw);
int32_t sdbSetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t val);
+int32_t sdbSetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t val);
int32_t sdbSetRawInt16(SSdbRaw *pRaw, int32_t dataPos, int16_t val);
int32_t sdbSetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t val);
int32_t sdbSetRawInt64(SSdbRaw *pRaw, int32_t dataPos, int64_t val);
@@ -395,6 +398,7 @@ int32_t sdbSetRawBinary(SSdbRaw *pRaw, int32_t dataPos, const char *pVal, int32
int32_t sdbSetRawDataLen(SSdbRaw *pRaw, int32_t dataLen);
int32_t sdbSetRawStatus(SSdbRaw *pRaw, ESdbStatus status);
int32_t sdbGetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t *val);
+int32_t sdbGetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t *val);
int32_t sdbGetRawInt16(SSdbRaw *pRaw, int32_t dataPos, int16_t *val);
int32_t sdbGetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t *val);
int32_t sdbGetRawInt64(SSdbRaw *pRaw, int32_t dataPos, int64_t *val);
diff --git a/source/dnode/mnode/sdb/src/sdbRaw.c b/source/dnode/mnode/sdb/src/sdbRaw.c
index 244e50b52e..4f68139155 100644
--- a/source/dnode/mnode/sdb/src/sdbRaw.c
+++ b/source/dnode/mnode/sdb/src/sdbRaw.c
@@ -67,6 +67,21 @@ int32_t sdbSetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t val) {
return 0;
}
+int32_t sdbSetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t val) {
+ if (pRaw == NULL) {
+ terrno = TSDB_CODE_INVALID_PTR;
+ return -1;
+ }
+
+ if (dataPos + sizeof(uint8_t) > pRaw->dataLen) {
+ terrno = TSDB_CODE_SDB_INVALID_DATA_LEN;
+ return -1;
+ }
+
+ *(uint8_t *)(pRaw->pData + dataPos) = val;
+ return 0;
+}
+
int32_t sdbSetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t val) {
if (pRaw == NULL) {
terrno = TSDB_CODE_INVALID_PTR;
@@ -174,6 +189,21 @@ int32_t sdbGetRawInt8(SSdbRaw *pRaw, int32_t dataPos, int8_t *val) {
return 0;
}
+int32_t sdbGetRawUInt8(SSdbRaw *pRaw, int32_t dataPos, uint8_t *val) {
+ if (pRaw == NULL) {
+ terrno = TSDB_CODE_INVALID_PTR;
+ return -1;
+ }
+
+ if (dataPos + sizeof(uint8_t) > pRaw->dataLen) {
+ terrno = TSDB_CODE_SDB_INVALID_DATA_LEN;
+ return -1;
+ }
+
+ *val = *(uint8_t *)(pRaw->pData + dataPos);
+ return 0;
+}
+
int32_t sdbGetRawInt32(SSdbRaw *pRaw, int32_t dataPos, int32_t *val) {
if (pRaw == NULL) {
terrno = TSDB_CODE_INVALID_PTR;
diff --git a/source/dnode/snode/src/snode.c b/source/dnode/snode/src/snode.c
index c61988574c..481033508b 100644
--- a/source/dnode/snode/src/snode.c
+++ b/source/dnode/snode/src/snode.c
@@ -25,20 +25,6 @@
#define sndDebug(...) do { if (sndDebugFlag & DEBUG_DEBUG) { taosPrintLog("SND ", DEBUG_DEBUG, sndDebugFlag, __VA_ARGS__);}} while (0)
// clang-format on
-static STaskId replaceStreamTaskId(SStreamTask *pTask) {
- ASSERT(pTask->info.fillHistory);
- STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId};
- pTask->id.streamId = pTask->streamTaskId.streamId;
- pTask->id.taskId = pTask->streamTaskId.taskId;
- return id;
-}
-
-static void restoreStreamTaskId(SStreamTask *pTask, STaskId *pId) {
- ASSERT(pTask->info.fillHistory);
- pTask->id.taskId = pId->taskId;
- pTask->id.streamId = pId->streamId;
-}
-
int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t nextProcessVer) {
ASSERT(pTask->info.taskLevel == TASK_LEVEL__AGG && taosArrayGetSize(pTask->upstreamInfo.pList) != 0);
int32_t code = streamTaskInit(pTask, pSnode->pMeta, &pSnode->msgCb, nextProcessVer);
@@ -85,7 +71,7 @@ SSnode *sndOpen(const char *path, const SSnodeOpt *pOption) {
startRsync();
pSnode->msgCb = pOption->msgCb;
- pSnode->pMeta = streamMetaOpen(path, pSnode, (FTaskExpand *)sndExpandTask, SNODE_HANDLE, taosGetTimestampMs(), tqStartTaskCompleteCallback);
+ pSnode->pMeta = streamMetaOpen(path, pSnode, (FTaskBuild *)sndExpandTask, tqExpandStreamTask, SNODE_HANDLE, taosGetTimestampMs(), tqStartTaskCompleteCallback);
if (pSnode->pMeta == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
goto FAIL;
@@ -136,6 +122,8 @@ int32_t sndProcessStreamMsg(SSnode *pSnode, SRpcMsg *pMsg) {
return tqStreamProcessReqCheckpointRsp(pSnode->pMeta, pMsg);
case TDMT_STREAM_TASK_CHECKPOINT_READY_RSP:
return tqStreamProcessCheckpointReadyRsp(pSnode->pMeta, pMsg);
+ case TDMT_MND_STREAM_CHKPT_REPORT_RSP:
+ return tqStreamProcessChkptReportRsp(pSnode->pMeta, pMsg);
case TDMT_STREAM_RETRIEVE_TRIGGER:
return tqStreamTaskProcessRetrieveTriggerReq(pSnode->pMeta, pMsg);
case TDMT_STREAM_RETRIEVE_TRIGGER_RSP:
diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h
index 8222af4d60..22b26498e4 100644
--- a/source/dnode/vnode/src/inc/vnodeInt.h
+++ b/source/dnode/vnode/src/inc/vnodeInt.h
@@ -261,9 +261,10 @@ int32_t tqProcessTaskUpdateReq(STQ* pTq, SRpcMsg* pMsg);
int32_t tqProcessTaskResetReq(STQ* pTq, SRpcMsg* pMsg);
int32_t tqProcessStreamHbRsp(STQ* pTq, SRpcMsg* pMsg);
int32_t tqProcessStreamReqCheckpointRsp(STQ* pTq, SRpcMsg* pMsg);
+int32_t tqProcessTaskChkptReportRsp(STQ* pTq, SRpcMsg* pMsg);
int32_t tqProcessTaskCheckpointReadyRsp(STQ* pTq, SRpcMsg* pMsg);
-int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver);
+int32_t tqBuildStreamTask(void* pTq, SStreamTask* pTask, int64_t ver);
int32_t tqScanWal(STQ* pTq);
int tqCommit(STQ*);
diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c
index 3cc7c6ec66..ac5463e492 100644
--- a/source/dnode/vnode/src/sma/smaRollup.c
+++ b/source/dnode/vnode/src/sma/smaRollup.c
@@ -299,7 +299,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
tdRSmaTaskInit(pStreamTask->pMeta, pItem, &pStreamTask->id);
pStreamTask->status.pSM = streamCreateStateMachine(pStreamTask);
pStreamTask->chkInfo.pActiveInfo = streamTaskCreateActiveChkptInfo();
- pStreamState = streamStateOpen(taskInfDir, pStreamTask, true, -1, -1);
+ pStreamState = streamStateOpen(taskInfDir, pStreamTask, pStreamTask->id.streamId, pStreamTask->id.taskId, true, -1, -1);
if (!pStreamState) {
terrno = TSDB_CODE_RSMA_STREAM_STATE_OPEN;
return TSDB_CODE_FAILED;
diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c
index 712cfbaa55..08fdda0e29 100644
--- a/source/dnode/vnode/src/tq/tq.c
+++ b/source/dnode/vnode/src/tq/tq.c
@@ -50,6 +50,9 @@ void tqDestroyTqHandle(void* data) {
if (pData->block != NULL) {
blockDataDestroy(pData->block);
}
+ if (pData->pRef) {
+ walCloseRef(pData->pRef->pWal, pData->pRef->refId);
+ }
}
static bool tqOffsetEqual(const STqOffset* pLeft, const STqOffset* pRight) {
@@ -87,7 +90,8 @@ STQ* tqOpen(const char* path, SVnode* pVnode) {
int32_t tqInitialize(STQ* pTq) {
int32_t vgId = TD_VID(pTq->pVnode);
- pTq->pStreamMeta = streamMetaOpen(pTq->path, pTq, (FTaskExpand*)tqExpandTask, vgId, -1, tqStartTaskCompleteCallback);
+ pTq->pStreamMeta =
+ streamMetaOpen(pTq->path, pTq, tqBuildStreamTask, tqExpandStreamTask, vgId, -1, tqStartTaskCompleteCallback);
if (pTq->pStreamMeta == NULL) {
return -1;
}
@@ -571,9 +575,6 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
taosMsleep(10);
continue;
}
- if (pHandle->pRef) {
- walCloseRef(pTq->pVnode->pWal, pHandle->pRef->refId);
- }
tqUnregisterPushHandle(pTq, pHandle);
@@ -658,12 +659,10 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
taosRLockLatch(&pTq->lock);
ret = tqMetaGetHandle(pTq, req.subKey);
taosRUnLockLatch(&pTq->lock);
-
if (ret < 0) {
break;
}
}
-
if (pHandle == NULL) {
if (req.oldConsumerId != -1) {
tqError("vgId:%d, build new consumer handle %s for consumer:0x%" PRIx64 ", but old consumerId:0x%" PRIx64,
@@ -708,14 +707,16 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
}
}
-end:
+ end:
tDecoderClear(&dc);
return ret;
}
static void freePtr(void* ptr) { taosMemoryFree(*(void**)ptr); }
-int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t nextProcessVer) {
+int32_t tqBuildStreamTask(void* pTqObj, SStreamTask* pTask, int64_t nextProcessVer) {
+ STQ* pTq = (STQ*) pTqObj;
+
int32_t vgId = TD_VID(pTq->pVnode);
tqDebug("s-task:0x%x start to build task", pTask->id.taskId);
@@ -1012,16 +1013,6 @@ int32_t tqProcessTaskDropReq(STQ* pTq, char* msg, int32_t msgLen) {
}
int32_t tqProcessTaskUpdateCheckpointReq(STQ* pTq, char* msg, int32_t msgLen) {
- int32_t vgId = TD_VID(pTq->pVnode);
- SVUpdateCheckpointInfoReq* pReq = (SVUpdateCheckpointInfoReq*)msg;
-
-// if (!pTq->pVnode->restored) {
-// tqDebug("vgId:%d update-checkpoint-info msg received during restoring, checkpointId:%" PRId64
-// ", transId:%d s-task:0x%x ignore it",
-// vgId, pReq->checkpointId, pReq->transId, pReq->taskId);
-// return TSDB_CODE_SUCCESS;
-// }
-
return tqStreamTaskProcessUpdateCheckpointReq(pTq->pStreamMeta, msg, msgLen);
}
@@ -1278,3 +1269,7 @@ int32_t tqProcessStreamReqCheckpointRsp(STQ* pTq, SRpcMsg* pMsg) {
int32_t tqProcessTaskCheckpointReadyRsp(STQ* pTq, SRpcMsg* pMsg) {
return tqStreamProcessCheckpointReadyRsp(pTq->pStreamMeta, pMsg);
}
+
+int32_t tqProcessTaskChkptReportRsp(STQ* pTq, SRpcMsg* pMsg) {
+ return tqStreamProcessChkptReportRsp(pTq->pStreamMeta, pMsg);
+}
diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c
index 404cbf26dd..02184f1d50 100644
--- a/source/dnode/vnode/src/tq/tqMeta.c
+++ b/source/dnode/vnode/src/tq/tqMeta.c
@@ -352,7 +352,6 @@ int32_t tqCreateHandle(STQ* pTq, SMqRebVgReq* req, STqHandle* handle){
memcpy(handle->subKey, req->subKey, TSDB_SUBSCRIBE_KEY_LEN);
handle->consumerId = req->newConsumerId;
- handle->epoch = -1;
handle->execHandle.subType = req->subType;
handle->fetchMeta = req->withMeta;
@@ -371,7 +370,7 @@ int32_t tqCreateHandle(STQ* pTq, SMqRebVgReq* req, STqHandle* handle){
if(buildHandle(pTq, handle) < 0){
return -1;
}
- tqInfo("tqCreateHandle %s consumer 0x%" PRIx64 " vgId:%d", handle->subKey, handle->consumerId, vgId);
+ tqInfo("tqCreateHandle %s consumer 0x%" PRIx64 " vgId:%d, snapshotVer:%" PRId64, handle->subKey, handle->consumerId, vgId, handle->snapshotVer);
return taosHashPut(pTq->pHandle, handle->subKey, strlen(handle->subKey), handle, sizeof(STqHandle));
}
diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c
index 71e6771370..7375478e61 100644
--- a/source/dnode/vnode/src/tq/tqPush.c
+++ b/source/dnode/vnode/src/tq/tqPush.c
@@ -87,7 +87,7 @@ int tqUnregisterPushHandle(STQ* pTq, void *handle) {
int32_t ret = taosHashRemove(pTq->pPushMgr, pHandle->subKey, strlen(pHandle->subKey));
tqInfo("vgId:%d remove pHandle:%p,ret:%d consumer Id:0x%" PRIx64, vgId, pHandle, ret, pHandle->consumerId);
- if(pHandle->msg != NULL) {
+ if(ret == 0 && pHandle->msg != NULL) {
// tqPushDataRsp(pHandle, vgId);
tqPushEmptyDataRsp(pHandle, vgId);
diff --git a/source/dnode/vnode/src/tq/tqUtil.c b/source/dnode/vnode/src/tq/tqUtil.c
index 33e3414a7d..5290c39d42 100644
--- a/source/dnode/vnode/src/tq/tqUtil.c
+++ b/source/dnode/vnode/src/tq/tqUtil.c
@@ -605,14 +605,15 @@ int32_t tqGetStreamExecInfo(SVnode* pVnode, int64_t streamId, int64_t* pDelay, b
numOfTasks = taosArrayGetSize(pMeta->pTaskList);
for (int32_t i = 0; i < numOfTasks; ++i) {
- STaskId* pId = taosArrayGet(pMeta->pTaskList, i);
+ SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i);
if (pId->streamId != streamId) {
continue;
}
- SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, pId, sizeof(*pId));
+ STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId};
+ SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
if (ppTask == NULL) {
- tqError("vgId:%d failed to acquire task:0x%" PRIx64 " in retrieving progress", pMeta->vgId, pId->taskId);
+ tqError("vgId:%d failed to acquire task:0x%x in retrieving progress", pMeta->vgId, pId->taskId);
continue;
}
diff --git a/source/dnode/vnode/src/tqCommon/tqCommon.c b/source/dnode/vnode/src/tqCommon/tqCommon.c
index c55745e5c5..963503c135 100644
--- a/source/dnode/vnode/src/tqCommon/tqCommon.c
+++ b/source/dnode/vnode/src/tqCommon/tqCommon.c
@@ -30,37 +30,26 @@ typedef struct SMStreamCheckpointReadyRspMsg {
static int32_t doProcessDummyRspMsg(SStreamMeta* pMeta, SRpcMsg* pMsg);
-static STaskId replaceStreamTaskId(SStreamTask* pTask) {
- ASSERT(pTask->info.fillHistory);
- STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId};
-
- pTask->id.streamId = pTask->streamTaskId.streamId;
- pTask->id.taskId = pTask->streamTaskId.taskId;
-
- return id;
-}
-
-static void restoreStreamTaskId(SStreamTask* pTask, STaskId* pId) {
- ASSERT(pTask->info.fillHistory);
- pTask->id.taskId = pId->taskId;
- pTask->id.streamId = pId->streamId;
-}
-
int32_t tqExpandStreamTask(SStreamTask* pTask) {
SStreamMeta* pMeta = pTask->pMeta;
int32_t vgId = pMeta->vgId;
- STaskId taskId = {0};
int64_t st = taosGetTimestampMs();
+ int64_t streamId = 0;
+ int32_t taskId = 0;
tqDebug("s-task:%s vgId:%d start to expand stream task", pTask->id.idStr, vgId);
if (pTask->info.fillHistory) {
- taskId = replaceStreamTaskId(pTask);
+ streamId = pTask->streamTaskId.streamId;
+ taskId = pTask->streamTaskId.taskId;
+ } else {
+ streamId = pTask->id.streamId;
+ taskId = pTask->id.taskId;
}
// sink task does not need the pState
if (pTask->info.taskLevel != TASK_LEVEL__SINK) {
- pTask->pState = streamStateOpen(pMeta->path, pTask, false, -1, -1);
+ pTask->pState = streamStateOpen(pMeta->path, pTask, false, streamId, taskId, -1, -1);
if (pTask->pState == NULL) {
tqError("s-task:%s (vgId:%d) failed to open state for task, expand task failed", pTask->id.idStr, vgId);
return -1;
@@ -69,10 +58,6 @@ int32_t tqExpandStreamTask(SStreamTask* pTask) {
}
}
- if (pTask->info.fillHistory) {
- restoreStreamTaskId(pTask, &taskId);
- }
-
SReadHandle handle = {
.checkpointId = pTask->chkInfo.checkpointId,
.pStateBackend = pTask->pState,
@@ -185,7 +170,7 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
SStreamTask* pTask = *ppTask;
const char* idstr = pTask->id.idStr;
- if (pMeta->updateInfo.transId != req.transId) {
+ if ((pMeta->updateInfo.transId != req.transId) && (pMeta->updateInfo.transId != -1)) {
if (req.transId < pMeta->updateInfo.transId) {
tqError("s-task:%s vgId:%d disorder update nodeEp msg recv, discarded, newest transId:%d, recv:%d", idstr, vgId,
pMeta->updateInfo.transId, req.transId);
@@ -197,10 +182,8 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
} else {
tqInfo("s-task:%s vgId:%d receive new trans to update nodeEp msg from mnode, transId:%d, prev transId:%d", idstr,
vgId, req.transId, pMeta->updateInfo.transId);
-
// info needs to be kept till the new trans to update the nodeEp arrived.
- taosHashClear(pMeta->updateInfo.pTasks);
- pMeta->updateInfo.transId = req.transId;
+ streamMetaInitUpdateTaskList(pMeta, req.transId);
}
} else {
tqDebug("s-task:%s vgId:%d recv trans to update nodeEp from mnode, transId:%d", idstr, vgId, req.transId);
@@ -280,6 +263,8 @@ int32_t tqStreamTaskProcessUpdateReq(SStreamMeta* pMeta, SMsgCb* cb, SRpcMsg* pM
// persist to disk
}
+ streamMetaClearUpdateTaskList(pMeta);
+
if (!restored) {
tqDebug("vgId:%d vnode restore not completed, not start the tasks, clear the start after nodeUpdate flag", vgId);
pMeta->startInfo.tasksWillRestart = 0;
@@ -362,6 +347,7 @@ int32_t tqStreamTaskProcessDispatchRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) {
SStreamDispatchRsp* pRsp = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead));
int32_t vgId = pMeta->vgId;
+ pRsp->upstreamNodeId = htonl(pRsp->upstreamNodeId);
pRsp->upstreamTaskId = htonl(pRsp->upstreamTaskId);
pRsp->streamId = htobe64(pRsp->streamId);
pRsp->downstreamTaskId = htonl(pRsp->downstreamTaskId);
@@ -369,6 +355,9 @@ int32_t tqStreamTaskProcessDispatchRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) {
pRsp->stage = htobe64(pRsp->stage);
pRsp->msgId = htonl(pRsp->msgId);
+ tqDebug("s-task:0x%x vgId:%d recv dispatch-rsp from 0x%x vgId:%d", pRsp->upstreamTaskId, pRsp->upstreamNodeId,
+ pRsp->downstreamTaskId, pRsp->downstreamNodeId);
+
SStreamTask* pTask = streamMetaAcquireTask(pMeta, pRsp->streamId, pRsp->upstreamTaskId);
if (pTask) {
streamProcessDispatchRsp(pTask, pRsp, pMsg->code);
@@ -414,7 +403,9 @@ int32_t tqStreamTaskProcessRetrieveReq(SStreamMeta* pMeta, SRpcMsg* pMsg) {
streamMetaReleaseTask(pMeta, pTask);
tCleanupStreamRetrieveReq(&req);
- return code;
+
+ // always return success, to disable the auto rsp
+ return TSDB_CODE_SUCCESS;
}
int32_t tqStreamTaskProcessCheckReq(SStreamMeta* pMeta, SRpcMsg* pMsg) {
@@ -629,8 +620,8 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen
// drop the related fill-history task firstly
if (hTaskId.taskId != 0 && hTaskId.streamId != 0) {
- streamMetaUnregisterTask(pMeta, hTaskId.streamId, hTaskId.taskId);
tqDebug("s-task:0x%x vgId:%d drop rel fill-history task:0x%x firstly", pReq->taskId, vgId, (int32_t)hTaskId.taskId);
+ streamMetaUnregisterTask(pMeta, hTaskId.streamId, hTaskId.taskId);
}
// drop the stream task now
@@ -646,8 +637,6 @@ int32_t tqStreamTaskProcessDropReq(SStreamMeta* pMeta, char* msg, int32_t msgLen
}
streamMetaWUnLock(pMeta);
-
-// tqStreamRemoveTaskBackend(pMeta, &id);
return 0;
}
@@ -1078,6 +1067,8 @@ int32_t tqStreamProcessStreamHbRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { return d
int32_t tqStreamProcessReqCheckpointRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) { return doProcessDummyRspMsg(pMeta, pMsg); }
+int32_t tqStreamProcessChkptReportRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) {return doProcessDummyRspMsg(pMeta, pMsg);}
+
int32_t tqStreamProcessCheckpointReadyRsp(SStreamMeta* pMeta, SRpcMsg* pMsg) {
SMStreamCheckpointReadyRspMsg* pRsp = pMsg->pCont;
diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c
index 42df7f111e..62b29db76e 100644
--- a/source/dnode/vnode/src/tsdb/tsdbCache.c
+++ b/source/dnode/vnode/src/tsdb/tsdbCache.c
@@ -1070,10 +1070,10 @@ static int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, SArray
rocksdb_writebatch_t *wb = pTsdb->rCache.writebatch;
for (int i = 0; i < num_keys; ++i) {
- SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[i];
+ SIdxKey *idxKey = &((SIdxKey *)TARRAY_DATA(remainCols))[i];
SLastUpdateCtx *updCtx = (SLastUpdateCtx *)taosArrayGet(updCtxArray, i);
- SRowKey *pRowKey = &updCtx->tsdbRowKey.key;
- SColVal *pColVal = &updCtx->colVal;
+ SRowKey *pRowKey = &updCtx->tsdbRowKey.key;
+ SColVal *pColVal = &updCtx->colVal;
SLastCol *pLastCol = tsdbCacheDeserialize(values_list[i], values_list_sizes[i]);
SLastCol *PToFree = pLastCol;
@@ -1156,9 +1156,9 @@ int32_t tsdbCacheRowFormatUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, int6
// 1. prepare last
TSDBROW lRow = {.type = TSDBROW_ROW_FMT, .pTSRow = aRow[nRow - 1], .version = version};
- STSchema *pTSchema = NULL;
- int32_t sver = TSDBROW_SVERSION(&lRow);
- SArray *ctxArray = NULL;
+ STSchema *pTSchema = NULL;
+ int32_t sver = TSDBROW_SVERSION(&lRow);
+ SArray *ctxArray = NULL;
SSHashObj *iColHash = NULL;
code = metaGetTbTSchemaEx(pTsdb->pVnode->pMeta, suid, uid, sver, &pTSchema);
@@ -1577,7 +1577,7 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
if (/*!pTmpColArray*/ lastTmpIndexArray && !lastTmpColArray) {
continue;
}
- if (/*!pTmpColArray*/ lastrowTmpIndexArray && lastrowTmpColArray) {
+ if (/*!pTmpColArray*/ lastrowTmpIndexArray && !lastrowTmpColArray) {
continue;
}
@@ -2772,7 +2772,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
}
state->state = SFSNEXTROW_INDEXLIST;
- state->iBrinIndex = indexSize;
+ state->iBrinIndex = 1;
}
_check_stt_data:
diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
index 2a49c1ba0a..57b8a99fb1 100644
--- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c
@@ -46,6 +46,12 @@ SSttBlockLoadInfo *tCreateSttBlockLoadInfo(STSchema *pSchema, int16_t *colList,
}
pLoadInfo->aSttBlk = taosArrayInit(4, sizeof(SSttBlk));
+ if (pLoadInfo->aSttBlk == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ taosMemoryFreeClear(pLoadInfo);
+ return NULL;
+ }
+
pLoadInfo->pSchema = pSchema;
pLoadInfo->colIds = colList;
pLoadInfo->numOfCols = numOfCols;
@@ -107,15 +113,21 @@ void *destroySttBlockReader(SArray *pLDataIterArray, SSttBlockLoadCostInfo *pLoa
SArray *pList = taosArrayGetP(pLDataIterArray, i);
for (int32_t j = 0; j < taosArrayGetSize(pList); ++j) {
SLDataIter *pIter = taosArrayGetP(pList, j);
+ if (pIter->pBlockLoadInfo == NULL) {
+ continue;
+ }
+
+ SSttBlockLoadCostInfo* pCost = &pIter->pBlockLoadInfo->cost;
if (pLoadCost != NULL) {
- pLoadCost->loadBlocks += pIter->pBlockLoadInfo->cost.loadBlocks;
- pLoadCost->loadStatisBlocks += pIter->pBlockLoadInfo->cost.loadStatisBlocks;
- pLoadCost->blockElapsedTime += pIter->pBlockLoadInfo->cost.blockElapsedTime;
- pLoadCost->statisElapsedTime += pIter->pBlockLoadInfo->cost.statisElapsedTime;
+ pLoadCost->loadBlocks += pCost->loadBlocks;
+ pLoadCost->loadStatisBlocks += pCost->loadStatisBlocks;
+ pLoadCost->blockElapsedTime += pCost->blockElapsedTime;
+ pLoadCost->statisElapsedTime += pCost->statisElapsedTime;
}
destroyLDataIter(pIter);
}
+
taosArrayDestroy(pList);
}
@@ -903,6 +915,10 @@ int32_t tMergeTreeOpen2(SMergeTree *pMTree, SMergeTreeConf *pConf, SSttDataInfoF
if (pLoadInfo == NULL) {
pLoadInfo = tCreateSttBlockLoadInfo(pConf->pSchema, pConf->pCols, pConf->numOfCols);
+ if (pLoadInfo == NULL) {
+ code = terrno;
+ goto _end;
+ }
}
memset(pIter, 0, sizeof(SLDataIter));
diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c
index d7c3eff571..c6f13bc0a8 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRead2.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c
@@ -2240,7 +2240,8 @@ static bool initSttBlockReader(SSttBlockReader* pSttBlockReader, STableBlockScan
};
SSttDataInfoForTable info = {.pKeyRangeList = taosArrayInit(4, sizeof(SSttKeyRange))};
- int32_t code = tMergeTreeOpen2(&pSttBlockReader->mergeTree, &conf, &info);
+
+ int32_t code = tMergeTreeOpen2(&pSttBlockReader->mergeTree, &conf, &info);
if (code != TSDB_CODE_SUCCESS) {
return false;
}
@@ -4257,9 +4258,6 @@ int32_t tsdbReaderOpen2(void* pVnode, SQueryTableDataCond* pCond, void* pTableLi
blockDataEnsureCapacity(pResBlock, capacity);
}
- // for debug purpose
-// capacity = 7;
-
int32_t code = tsdbReaderCreate(pVnode, pCond, ppReader, capacity, pResBlock, idstr);
if (code != TSDB_CODE_SUCCESS) {
goto _err;
@@ -4899,7 +4897,7 @@ static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_
}
int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock, bool* allHave, bool* hasNullSMA) {
- SColumnDataAgg*** pBlockSMA = &pDataBlock->pBlockAgg;
+ SColumnDataAgg** pBlockSMA = &pDataBlock->pBlockAgg;
int32_t code = 0;
*allHave = false;
@@ -4954,7 +4952,13 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock,
if (pResBlock->pBlockAgg == NULL) {
size_t num = taosArrayGetSize(pResBlock->pDataBlock);
- pResBlock->pBlockAgg = taosMemoryCalloc(num, POINTER_BYTES);
+ pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg));
+ if (pResBlock->pBlockAgg == NULL) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+ for(int i = 0; i < num; ++i) {
+ pResBlock->pBlockAgg[i].colId = -1;
+ }
}
// do fill all null column value SMA info
@@ -4966,13 +4970,12 @@ int32_t tsdbRetrieveDatablockSMA2(STsdbReader* pReader, SSDataBlock* pDataBlock,
while (j < numOfCols && i < size) {
SColumnDataAgg* pAgg = &pSup->colAggArray.data[i];
if (pAgg->colId == pSup->colId[j]) {
- pResBlock->pBlockAgg[pSup->slotId[j]] = pAgg;
+ pResBlock->pBlockAgg[pSup->slotId[j]] = *pAgg;
i += 1;
j += 1;
} else if (pAgg->colId < pSup->colId[j]) {
i += 1;
} else if (pSup->colId[j] < pAgg->colId) {
- pResBlock->pBlockAgg[pSup->slotId[j]] = NULL;
*allHave = false;
j += 1;
}
diff --git a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c
index 8ab7f7eeef..273ec6d797 100644
--- a/source/dnode/vnode/src/tsdb/tsdbReadUtil.c
+++ b/source/dnode/vnode/src/tsdb/tsdbReadUtil.c
@@ -985,6 +985,10 @@ int32_t tsdbGetRowsInSttFiles(STFileSet* pFileSet, SArray* pSttFileBlockIterArra
if (pIter->pBlockLoadInfo == NULL) {
pIter->pBlockLoadInfo = tCreateSttBlockLoadInfo(pConf->pSchema, pConf->pCols, pConf->numOfCols);
+ if (pIter->pBlockLoadInfo == NULL) {
+ tsdbError("failed to create block load info, code: out of memory, %s", pstr);
+ continue;
+ }
}
// load stt blocks statis for all stt-blocks, to decide if the data of queried table exists in current stt file
diff --git a/source/dnode/vnode/src/tsdb/tsdbRetention.c b/source/dnode/vnode/src/tsdb/tsdbRetention.c
index 3d53d1ada3..0d3994d78e 100644
--- a/source/dnode/vnode/src/tsdb/tsdbRetention.c
+++ b/source/dnode/vnode/src/tsdb/tsdbRetention.c
@@ -38,6 +38,34 @@ static int32_t tsdbDoRemoveFileObject(SRTNer *rtner, const STFileObj *fobj) {
return TARRAY2_APPEND(&rtner->fopArr, op);
}
+static int64_t tsdbCopyFileWithLimitedSpeed(TdFilePtr from, TdFilePtr to, int64_t size, uint32_t limitMB) {
+ int64_t total = 0;
+ int64_t interval = 1000; // 1s
+ int64_t limit = limitMB ? limitMB * 1024 * 1024 : INT64_MAX;
+ int64_t offset = 0;
+ int64_t remain = size;
+
+ while (remain > 0) {
+ int64_t n;
+ int64_t last = taosGetTimestampMs();
+ if ((n = taosFSendFile(to, from, &offset, TMIN(limit, remain))) < 0) {
+ return -1;
+ }
+
+ total += n;
+ remain -= n;
+
+ if (remain > 0) {
+ int64_t elapsed = taosGetTimestampMs() - last;
+ if (elapsed < interval) {
+ taosMsleep(interval - elapsed);
+ }
+ }
+ }
+
+ return total;
+}
+
static int32_t tsdbDoCopyFileLC(SRTNer *rtner, const STFileObj *from, const STFile *to) {
int32_t code = 0;
int32_t lino = 0;
@@ -98,7 +126,8 @@ static int32_t tsdbDoCopyFile(SRTNer *rtner, const STFileObj *from, const STFile
if (fdTo == NULL) code = terrno;
TSDB_CHECK_CODE(code, lino, _exit);
- int64_t n = taosFSendFile(fdTo, fdFrom, 0, tsdbLogicToFileSize(from->f->size, rtner->szPage));
+ int64_t n = tsdbCopyFileWithLimitedSpeed(fdFrom, fdTo, tsdbLogicToFileSize(from->f->size, rtner->szPage),
+ tsRetentionSpeedLimitMB);
if (n < 0) {
code = TAOS_SYSTEM_ERROR(errno);
TSDB_CHECK_CODE(code, lino, _exit);
diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c
index 19be7e7ebd..5b17e0f1da 100644
--- a/source/dnode/vnode/src/vnd/vnodeQuery.c
+++ b/source/dnode/vnode/src/vnd/vnodeQuery.c
@@ -120,7 +120,8 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
memcpy(metaRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
}
if (metaRsp.pSchemaExt) {
- code = fillTableColCmpr(&mer1, metaRsp.pSchemaExt, metaRsp.numOfColumns);
+ SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
+ code = fillTableColCmpr(pReader, metaRsp.pSchemaExt, metaRsp.numOfColumns);
if (code < 0) {
code = TSDB_CODE_INVALID_MSG;
goto _exit;
@@ -254,15 +255,18 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
memcpy(cfgRsp.pSchemas + schema.nCols, schemaTag.pSchema, sizeof(SSchema) * schemaTag.nCols);
}
- if (useCompress(cfgRsp.tableType)) {
- SColCmprWrapper *pColCmpr = &mer1.me.colCmpr;
- for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) {
- SColCmpr *pCmpr = &pColCmpr->pColCmpr[i];
- SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i;
- pSchExt->colId = pCmpr->id;
- pSchExt->compress = pCmpr->alg;
- }
+ // if (useCompress(cfgRsp.tableType)) {
+
+ SMetaReader *pReader = mer1.me.type == TSDB_CHILD_TABLE ? &mer2 : &mer1;
+ SColCmprWrapper *pColCmpr = &pReader->me.colCmpr;
+
+ for (int32_t i = 0; i < cfgRsp.numOfColumns; i++) {
+ SColCmpr *pCmpr = &pColCmpr->pColCmpr[i];
+ SSchemaExt *pSchExt = cfgRsp.pSchemaExt + i;
+ pSchExt->colId = pCmpr->id;
+ pSchExt->compress = pCmpr->alg;
}
+ //}
// encode and send response
rspLen = tSerializeSTableCfgRsp(NULL, 0, &cfgRsp);
@@ -752,13 +756,13 @@ int32_t vnodeGetTableSchema(void *pVnode, int64_t uid, STSchema **pSchema, int64
return tsdbGetTableSchema(((SVnode *)pVnode)->pMeta, uid, pSchema, suid);
}
-int32_t vnodeGetStreamProgress(SVnode* pVnode, SRpcMsg* pMsg, bool direct) {
- int32_t code = 0;
- SStreamProgressReq req;
- SStreamProgressRsp rsp = {0};
- SRpcMsg rpcMsg = {.info = pMsg->info, .code = 0};
- char * buf = NULL;
- int32_t rspLen = 0;
+int32_t vnodeGetStreamProgress(SVnode *pVnode, SRpcMsg *pMsg, bool direct) {
+ int32_t code = 0;
+ SStreamProgressReq req;
+ SStreamProgressRsp rsp = {0};
+ SRpcMsg rpcMsg = {.info = pMsg->info, .code = 0};
+ char *buf = NULL;
+ int32_t rspLen = 0;
code = tDeserializeStreamProgressReq(pMsg->pCont, pMsg->contLen, &req);
if (code == TSDB_CODE_SUCCESS) {
diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c
index 002f04b8a7..b1f353af81 100644
--- a/source/dnode/vnode/src/vnd/vnodeSvr.c
+++ b/source/dnode/vnode/src/vnd/vnodeSvr.c
@@ -854,6 +854,8 @@ int32_t vnodeProcessStreamMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo)
return tqProcessStreamReqCheckpointRsp(pVnode->pTq, pMsg);
case TDMT_VND_GET_STREAM_PROGRESS:
return tqStreamProgressRetrieveReq(pVnode->pTq, pMsg);
+ case TDMT_MND_STREAM_CHKPT_REPORT_RSP:
+ return tqProcessTaskChkptReportRsp(pVnode->pTq, pMsg);
default:
vError("unknown msg type:%d in stream queue", pMsg->msgType);
return TSDB_CODE_APP_ERROR;
diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c
index 9ab1348b9a..40e85e90d2 100644
--- a/source/libs/command/src/command.c
+++ b/source/libs/command/src/command.c
@@ -26,7 +26,7 @@
extern SConfig* tsCfg;
static int32_t buildRetrieveTableRsp(SSDataBlock* pBlock, int32_t numOfCols, SRetrieveTableRsp** pRsp) {
- size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
+ size_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
*pRsp = taosMemoryCalloc(1, rspSize);
if (NULL == *pRsp) {
return TSDB_CODE_OUT_OF_MEMORY;
@@ -36,11 +36,16 @@ static int32_t buildRetrieveTableRsp(SSDataBlock* pBlock, int32_t numOfCols, SRe
(*pRsp)->completed = 1;
(*pRsp)->precision = 0;
(*pRsp)->compressed = 0;
- (*pRsp)->compLen = 0;
+
(*pRsp)->numOfRows = htobe64((int64_t)pBlock->info.rows);
(*pRsp)->numOfCols = htonl(numOfCols);
- int32_t len = blockEncode(pBlock, (*pRsp)->data, numOfCols);
+ int32_t len = blockEncode(pBlock, (*pRsp)->data + PAYLOAD_PREFIX_LEN, numOfCols);
+ SET_PAYLOAD_LEN((*pRsp)->data, len, len);
+
+ int32_t payloadLen = len + PAYLOAD_PREFIX_LEN;
+ (*pRsp)->payloadLen = htonl(payloadLen);
+ (*pRsp)->compLen = htonl(payloadLen);
return TSDB_CODE_SUCCESS;
}
diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c
index 5afc629865..2ac7e6ae3b 100644
--- a/source/libs/command/src/explain.c
+++ b/source/libs/command/src/explain.c
@@ -70,7 +70,6 @@ char* qExplainGetTimerangeTargetStr(int32_t target) {
return targetName[target];
}
-
void qExplainFreeResNode(SExplainResNode *resNode) {
if (NULL == resNode) {
return;
@@ -1942,7 +1941,7 @@ int32_t qExplainGetRspFromCtx(void *ctx, SRetrieveTableRsp **pRsp) {
pBlock->info.rows = rowNum;
- int32_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
+ int32_t rspSize = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
SRetrieveTableRsp *rsp = (SRetrieveTableRsp *)taosMemoryCalloc(1, rspSize);
if (NULL == rsp) {
@@ -1954,9 +1953,13 @@ int32_t qExplainGetRspFromCtx(void *ctx, SRetrieveTableRsp **pRsp) {
rsp->completed = 1;
rsp->numOfRows = htobe64((int64_t)rowNum);
- int32_t len = blockEncode(pBlock, rsp->data, taosArrayGetSize(pBlock->pDataBlock));
+ int32_t len = blockEncode(pBlock, rsp->data + PAYLOAD_PREFIX_LEN, taosArrayGetSize(pBlock->pDataBlock));
rsp->compLen = htonl(len);
+ rsp->payloadLen = htonl(len);
+ rsp->compressed = 0;
+
+ SET_PAYLOAD_LEN(rsp->data, len, len);
blockDataDestroy(pBlock);
diff --git a/source/libs/executor/inc/dataSinkInt.h b/source/libs/executor/inc/dataSinkInt.h
index dcebd2c6fd..01bc762a1d 100644
--- a/source/libs/executor/inc/dataSinkInt.h
+++ b/source/libs/executor/inc/dataSinkInt.h
@@ -25,7 +25,6 @@ extern "C" {
#include "storageapi.h"
#include "tcommon.h"
-struct SDataSink;
struct SDataSinkHandle;
typedef struct SDataSinkManager {
@@ -36,7 +35,7 @@ typedef struct SDataSinkManager {
typedef int32_t (*FPutDataBlock)(struct SDataSinkHandle* pHandle, const SInputData* pInput, bool* pContinue);
typedef void (*FEndPut)(struct SDataSinkHandle* pHandle, uint64_t useconds);
typedef void (*FReset)(struct SDataSinkHandle* pHandle);
-typedef void (*FGetDataLength)(struct SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryEnd);
+typedef void (*FGetDataLength)(struct SDataSinkHandle* pHandle, int64_t* pLen, int64_t* pRowLen, bool* pQueryEnd);
typedef int32_t (*FGetDataBlock)(struct SDataSinkHandle* pHandle, SOutputData* pOutput);
typedef int32_t (*FDestroyDataSinker)(struct SDataSinkHandle* pHandle);
typedef int32_t (*FGetCacheSize)(struct SDataSinkHandle* pHandle, uint64_t* size);
diff --git a/source/libs/executor/inc/executorInt.h b/source/libs/executor/inc/executorInt.h
index 592231f043..c48c359fad 100644
--- a/source/libs/executor/inc/executorInt.h
+++ b/source/libs/executor/inc/executorInt.h
@@ -624,6 +624,8 @@ typedef struct SDataGroupInfo {
uint64_t groupId;
int64_t numOfRows;
SArray* pPageList;
+ SArray* blockForNotLoaded; // SSDataBlock that data is not loaded
+ int32_t offsetForNotLoaded; // read offset for SSDataBlock that data is not loaded
} SDataGroupInfo;
typedef struct SWindowRowsSup {
@@ -861,7 +863,7 @@ void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData,
void setVgIdColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, int32_t vgId);
void setVgVerColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, int64_t vgVer);
-void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset);
+int32_t setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset);
void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput);
SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pResultRowInfo, char* pData,
diff --git a/source/libs/executor/src/aggregateoperator.c b/source/libs/executor/src/aggregateoperator.c
index b5a49831c5..a7b4532bd0 100644
--- a/source/libs/executor/src/aggregateoperator.c
+++ b/source/libs/executor/src/aggregateoperator.c
@@ -406,7 +406,10 @@ void doSetTableGroupOutputBuf(SOperatorInfo* pOperator, int32_t numOfOutput, uin
}
}
- setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset);
+ int32_t ret = setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset);
+ if (ret != TSDB_CODE_SUCCESS) {
+ T_LONG_JMP(pTaskInfo->env, ret);
+ }
}
// a new buffer page for each table. Needs to opt this design
diff --git a/source/libs/executor/src/dataDeleter.c b/source/libs/executor/src/dataDeleter.c
index 960ae14fcf..15288c4406 100644
--- a/source/libs/executor/src/dataDeleter.c
+++ b/source/libs/executor/src/dataDeleter.c
@@ -154,7 +154,7 @@ static void endPut(struct SDataSinkHandle* pHandle, uint64_t useconds) {
taosThreadMutexUnlock(&pDeleter->mutex);
}
-static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryEnd) {
+static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, int64_t* pRawLen, bool* pQueryEnd) {
SDataDeleterHandle* pDeleter = (SDataDeleterHandle*)pHandle;
if (taosQueueEmpty(pDeleter->pDataBlocks)) {
*pQueryEnd = pDeleter->queryEnd;
@@ -171,6 +171,8 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
SDataCacheEntry* pEntry = (SDataCacheEntry*)pDeleter->nextOutput.pData;
*pLen = pEntry->dataLen;
+ *pRawLen = pEntry->dataLen;
+
*pQueryEnd = pDeleter->queryEnd;
qDebug("got data len %" PRId64 ", row num %d in sink", *pLen,
((SDataCacheEntry*)(pDeleter->nextOutput.pData))->numOfRows);
@@ -186,6 +188,7 @@ static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
pOutput->queryEnd = pDeleter->queryEnd;
return TSDB_CODE_SUCCESS;
}
+
SDataCacheEntry* pEntry = (SDataCacheEntry*)(pDeleter->nextOutput.pData);
memcpy(pOutput->pData, pEntry->data, pEntry->dataLen);
pDeleter->pParam->pUidList = NULL;
diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c
index abe566473f..297c87ab40 100644
--- a/source/libs/executor/src/dataDispatcher.c
+++ b/source/libs/executor/src/dataDispatcher.c
@@ -31,6 +31,7 @@ typedef struct SDataDispatchBuf {
} SDataDispatchBuf;
typedef struct SDataCacheEntry {
+ int32_t rawLen;
int32_t dataLen;
int32_t numOfRows;
int32_t numOfCols;
@@ -48,6 +49,8 @@ typedef struct SDataDispatchHandle {
bool queryEnd;
uint64_t useconds;
uint64_t cachedSize;
+ void* pCompressBuf;
+ int32_t bufSize;
TdThreadMutex mutex;
} SDataDispatchHandle;
@@ -63,22 +66,60 @@ typedef struct SDataDispatchHandle {
static void toDataCacheEntry(SDataDispatchHandle* pHandle, const SInputData* pInput, SDataDispatchBuf* pBuf) {
int32_t numOfCols = 0;
SNode* pNode;
+
FOREACH(pNode, pHandle->pSchema->pSlots) {
SSlotDescNode* pSlotDesc = (SSlotDescNode*)pNode;
if (pSlotDesc->output) {
++numOfCols;
}
}
+
SDataCacheEntry* pEntry = (SDataCacheEntry*)pBuf->pData;
pEntry->compressed = 0;
pEntry->numOfRows = pInput->pData->info.rows;
pEntry->numOfCols = numOfCols;
pEntry->dataLen = 0;
+ pEntry->rawLen = 0;
pBuf->useSize = sizeof(SDataCacheEntry);
- pEntry->dataLen = blockEncode(pInput->pData, pEntry->data, numOfCols);
- // ASSERT(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
- // ASSERT(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
+
+ {
+ if ((pBuf->allocSize > tsCompressMsgSize) && (tsCompressMsgSize > 0) && pHandle->pManager->cfg.compress) {
+ if (pHandle->pCompressBuf == NULL) {
+ // allocate additional 8 bytes to avoid invalid write if compress failed to reduce the size
+ pHandle->pCompressBuf = taosMemoryMalloc(pBuf->allocSize + 8);
+ pHandle->bufSize = pBuf->allocSize + 8;
+ } else {
+ if (pHandle->bufSize < pBuf->allocSize + 8) {
+ pHandle->bufSize = pBuf->allocSize + 8;
+ void* p = taosMemoryRealloc(pHandle->pCompressBuf, pHandle->bufSize);
+ if (p != NULL) {
+ pHandle->pCompressBuf = p;
+ } else {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ qError("failed to prepare compress buf:%d, code: out of memory", pHandle->bufSize);
+ return;
+ }
+ }
+ }
+
+ int32_t dataLen = blockEncode(pInput->pData, pHandle->pCompressBuf, numOfCols);
+ int32_t len = tsCompressString(pHandle->pCompressBuf, dataLen, 1, pEntry->data, pBuf->allocSize, ONE_STAGE_COMP, NULL, 0);
+ if (len < dataLen) {
+ pEntry->compressed = 1;
+ pEntry->dataLen = len;
+ pEntry->rawLen = dataLen;
+ } else { // no need to compress data
+ pEntry->compressed = 0;
+ pEntry->dataLen = dataLen;
+ pEntry->rawLen = dataLen;
+ memcpy(pEntry->data, pHandle->pCompressBuf, dataLen);
+ }
+ } else {
+ pEntry->dataLen = blockEncode(pInput->pData, pEntry->data, numOfCols);
+ pEntry->rawLen = pEntry->dataLen;
+ }
+ }
pBuf->useSize += pEntry->dataLen;
@@ -163,7 +204,7 @@ static void resetDispatcher(struct SDataSinkHandle* pHandle) {
taosThreadMutexUnlock(&pDispatcher->mutex);
}
-static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryEnd) {
+static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, int64_t* pRowLen, bool* pQueryEnd) {
SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle;
if (taosQueueEmpty(pDispatcher->pDataBlocks)) {
*pQueryEnd = pDispatcher->queryEnd;
@@ -180,9 +221,7 @@ static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryE
SDataCacheEntry* pEntry = (SDataCacheEntry*)pDispatcher->nextOutput.pData;
*pLen = pEntry->dataLen;
-
- // ASSERT(pEntry->numOfRows == *(int32_t*)(pEntry->data + 8));
- // ASSERT(pEntry->numOfCols == *(int32_t*)(pEntry->data + 8 + 4));
+ *pRowLen = pEntry->rawLen;
*pQueryEnd = pDispatcher->queryEnd;
qDebug("got data len %" PRId64 ", row num %d in sink", *pLen,
@@ -200,6 +239,7 @@ static int32_t getDataBlock(SDataSinkHandle* pHandle, SOutputData* pOutput) {
pOutput->queryEnd = pDispatcher->queryEnd;
return TSDB_CODE_SUCCESS;
}
+
SDataCacheEntry* pEntry = (SDataCacheEntry*)(pDispatcher->nextOutput.pData);
memcpy(pOutput->pData, pEntry->data, pEntry->dataLen);
pOutput->numOfRows = pEntry->numOfRows;
@@ -224,6 +264,7 @@ static int32_t destroyDataSinker(SDataSinkHandle* pHandle) {
SDataDispatchHandle* pDispatcher = (SDataDispatchHandle*)pHandle;
atomic_sub_fetch_64(&gDataSinkStat.cachedSize, pDispatcher->cachedSize);
taosMemoryFreeClear(pDispatcher->nextOutput.pData);
+
while (!taosQueueEmpty(pDispatcher->pDataBlocks)) {
SDataDispatchBuf* pBuf = NULL;
taosReadQitem(pDispatcher->pDataBlocks, (void**)&pBuf);
@@ -232,7 +273,11 @@ static int32_t destroyDataSinker(SDataSinkHandle* pHandle) {
taosFreeQitem(pBuf);
}
}
+
taosCloseQueue(pDispatcher->pDataBlocks);
+ taosMemoryFreeClear(pDispatcher->pCompressBuf);
+ pDispatcher->bufSize = 0;
+
taosThreadMutexDestroy(&pDispatcher->mutex);
taosMemoryFree(pDispatcher->pManager);
return TSDB_CODE_SUCCESS;
@@ -251,6 +296,7 @@ int32_t createDataDispatcher(SDataSinkManager* pManager, const SDataSinkNode* pD
terrno = TSDB_CODE_OUT_OF_MEMORY;
goto _return;
}
+
dispatcher->sink.fPut = putDataBlock;
dispatcher->sink.fEndPut = endPut;
dispatcher->sink.fReset = resetDispatcher;
@@ -258,22 +304,24 @@ int32_t createDataDispatcher(SDataSinkManager* pManager, const SDataSinkNode* pD
dispatcher->sink.fGetData = getDataBlock;
dispatcher->sink.fDestroy = destroyDataSinker;
dispatcher->sink.fGetCacheSize = getCacheSize;
+
dispatcher->pManager = pManager;
dispatcher->pSchema = pDataSink->pInputDataBlockDesc;
dispatcher->status = DS_BUF_EMPTY;
dispatcher->queryEnd = false;
dispatcher->pDataBlocks = taosOpenQueue();
taosThreadMutexInit(&dispatcher->mutex, NULL);
+
if (NULL == dispatcher->pDataBlocks) {
taosMemoryFree(dispatcher);
terrno = TSDB_CODE_OUT_OF_MEMORY;
goto _return;
}
+
*pHandle = dispatcher;
return TSDB_CODE_SUCCESS;
_return:
-
taosMemoryFree(pManager);
return terrno;
}
diff --git a/source/libs/executor/src/dataInserter.c b/source/libs/executor/src/dataInserter.c
index 39bbc1bc69..5ba2f8bf42 100644
--- a/source/libs/executor/src/dataInserter.c
+++ b/source/libs/executor/src/dataInserter.c
@@ -370,7 +370,7 @@ static void endPut(struct SDataSinkHandle* pHandle, uint64_t useconds) {
taosThreadMutexUnlock(&pInserter->mutex);
}
-static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, bool* pQueryEnd) {
+static void getDataLength(SDataSinkHandle* pHandle, int64_t* pLen, int64_t* pRawLen, bool* pQueryEnd) {
SDataInserterHandle* pDispatcher = (SDataInserterHandle*)pHandle;
*pLen = pDispatcher->submitRes.affectedRows;
qDebug("got total affectedRows %" PRId64, *pLen);
diff --git a/source/libs/executor/src/dataSinkMgt.c b/source/libs/executor/src/dataSinkMgt.c
index 2a59bbf1dc..e711ffdf5c 100644
--- a/source/libs/executor/src/dataSinkMgt.c
+++ b/source/libs/executor/src/dataSinkMgt.c
@@ -18,13 +18,14 @@
#include "planner.h"
#include "tarray.h"
-SDataSinkStat gDataSinkStat = {0};
+SDataSinkStat gDataSinkStat = {0};
int32_t dsDataSinkMgtInit(SDataSinkMgtCfg* cfg, SStorageAPI* pAPI, void** ppSinkManager) {
SDataSinkManager* pSinkManager = taosMemoryMalloc(sizeof(SDataSinkManager));
if (NULL == pSinkManager) {
return TSDB_CODE_OUT_OF_MEMORY;
}
+
pSinkManager->cfg = *cfg;
pSinkManager->pAPI = pAPI;
@@ -75,9 +76,9 @@ void dsReset(DataSinkHandle handle) {
}
}
-void dsGetDataLength(DataSinkHandle handle, int64_t* pLen, bool* pQueryEnd) {
+void dsGetDataLength(DataSinkHandle handle, int64_t* pLen, int64_t* pRawLen, bool* pQueryEnd) {
SDataSinkHandle* pHandleImpl = (SDataSinkHandle*)handle;
- pHandleImpl->fGetLen(pHandleImpl, pLen, pQueryEnd);
+ pHandleImpl->fGetLen(pHandleImpl, pLen, pRawLen, pQueryEnd);
}
int32_t dsGetDataBlock(DataSinkHandle handle, SOutputData* pOutput) {
diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c
index 29907e6f1f..d73274f85e 100644
--- a/source/libs/executor/src/eventwindowoperator.c
+++ b/source/libs/executor/src/eventwindowoperator.c
@@ -221,8 +221,7 @@ static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWi
(*pResult)->win = *win;
- setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
- return TSDB_CODE_SUCCESS;
+ return setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
}
static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSup, int32_t startIndex, int32_t endIndex,
diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c
index 631a92f1be..c527224438 100644
--- a/source/libs/executor/src/exchangeoperator.c
+++ b/source/libs/executor/src/exchangeoperator.c
@@ -41,6 +41,8 @@ typedef struct SSourceDataInfo {
SArray* pSrcUidList;
int32_t srcOpType;
bool tableSeq;
+ char* decompBuf;
+ int32_t decompBufSize;
} SSourceDataInfo;
static void destroyExchangeOperatorInfo(void* param);
@@ -371,7 +373,10 @@ void freeBlock(void* pParam) {
void freeSourceDataInfo(void* p) {
SSourceDataInfo* pInfo = (SSourceDataInfo*)p;
+ taosMemoryFreeClear(pInfo->decompBuf);
taosMemoryFreeClear(pInfo->pRsp);
+
+ pInfo->decompBufSize = 0;
}
void doDestroyExchangeOperatorInfo(void* param) {
@@ -411,6 +416,7 @@ int32_t loadRemoteDataCallback(void* param, SDataBuf* pMsg, int32_t code) {
SRetrieveTableRsp* pRsp = pSourceDataInfo->pRsp;
pRsp->numOfRows = htobe64(pRsp->numOfRows);
pRsp->compLen = htonl(pRsp->compLen);
+ pRsp->payloadLen = htonl(pRsp->payloadLen);
pRsp->numOfCols = htonl(pRsp->numOfCols);
pRsp->useconds = htobe64(pRsp->useconds);
pRsp->numOfBlocks = htonl(pRsp->numOfBlocks);
@@ -673,11 +679,32 @@ int32_t prepareConcurrentlyLoad(SOperatorInfo* pOperator) {
int32_t doExtractResultBlocks(SExchangeInfo* pExchangeInfo, SSourceDataInfo* pDataInfo) {
SRetrieveTableRsp* pRetrieveRsp = pDataInfo->pRsp;
- char* pStart = pRetrieveRsp->data;
+ char* pNextStart = pRetrieveRsp->data;
+ char* pStart = pNextStart;
+
int32_t index = 0;
int32_t code = 0;
+
+ if (pRetrieveRsp->compressed) { // decompress the data
+ if (pDataInfo->decompBuf == NULL) {
+ pDataInfo->decompBuf = taosMemoryMalloc(pRetrieveRsp->payloadLen);
+ pDataInfo->decompBufSize = pRetrieveRsp->payloadLen;
+ } else {
+ if (pDataInfo->decompBufSize < pRetrieveRsp->payloadLen) {
+ char* p = taosMemoryRealloc(pDataInfo->decompBuf, pRetrieveRsp->payloadLen);
+ if (p != NULL) {
+ pDataInfo->decompBuf = p;
+ pDataInfo->decompBufSize = pRetrieveRsp->payloadLen;
+ }
+ }
+ }
+ }
+
+
while (index++ < pRetrieveRsp->numOfBlocks) {
SSDataBlock* pb = NULL;
+ pStart = pNextStart;
+
if (taosArrayGetSize(pExchangeInfo->pRecycledBlocks) > 0) {
pb = *(SSDataBlock**)taosArrayPop(pExchangeInfo->pRecycledBlocks);
blockDataCleanup(pb);
@@ -685,6 +712,20 @@ int32_t doExtractResultBlocks(SExchangeInfo* pExchangeInfo, SSourceDataInfo* pDa
pb = createOneDataBlock(pExchangeInfo->pDummyBlock, false);
}
+ int32_t compLen = *(int32_t*) pStart;
+ pStart += sizeof(int32_t);
+
+ int32_t rawLen = *(int32_t*) pStart;
+ pStart += sizeof(int32_t);
+ ASSERT(compLen <= rawLen && compLen != 0);
+
+ pNextStart = pStart + compLen;
+ if (pRetrieveRsp->compressed && (compLen < rawLen)) {
+ int32_t t = tsDecompressString(pStart, compLen, 1, pDataInfo->decompBuf, rawLen, ONE_STAGE_COMP, NULL, 0);
+ ASSERT(t == rawLen);
+ pStart = pDataInfo->decompBuf;
+ }
+
code = extractDataBlockFromFetchRsp(pb, pStart, NULL, &pStart);
if (code != 0) {
taosMemoryFreeClear(pDataInfo->pRsp);
diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c
index d06beebd6b..cb2a75407a 100644
--- a/source/libs/executor/src/executil.c
+++ b/source/libs/executor/src/executil.c
@@ -2178,9 +2178,25 @@ int32_t buildGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle*
return code;
}
if (group == NULL || groupByTbname) {
- for (int32_t i = 0; i < numOfTables; i++) {
- STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i);
- info->groupId = groupByTbname ? info->uid : 0;
+ if (tsCountAlwaysReturnValue && QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN == nodeType(pScanNode) && ((STableScanPhysiNode*)pScanNode)->needCountEmptyTable) {
+ pTableListInfo->remainGroups =
+ taosHashInit(numOfTables, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
+ if (pTableListInfo->remainGroups == NULL) {
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ for (int i = 0; i < numOfTables; i++) {
+ STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i);
+ info->groupId = info->uid;
+
+ taosHashPut(pTableListInfo->remainGroups, &(info->groupId), sizeof(info->groupId), &(info->uid),
+ sizeof(info->uid));
+ }
+ } else {
+ for (int32_t i = 0; i < numOfTables; i++) {
+ STableKeyInfo* info = taosArrayGet(pTableListInfo->pTableList, i);
+ info->groupId = groupByTbname ? info->uid : 0;
+ }
}
pTableListInfo->oneTableForEachGroup = groupByTbname;
@@ -2193,8 +2209,6 @@ int32_t buildGroupIdMapForAllTables(STableListInfo* pTableListInfo, SReadHandle*
pTableListInfo->numOfOuputGroups = numOfTables;
} else if (groupByTbname && pScanNode->groupOrderScan) {
pTableListInfo->numOfOuputGroups = numOfTables;
- } else if (groupByTbname && tsCountAlwaysReturnValue && ((STableScanPhysiNode*)pScanNode)->needCountEmptyTable) {
- pTableListInfo->numOfOuputGroups = numOfTables;
} else {
pTableListInfo->numOfOuputGroups = 1;
}
@@ -2354,7 +2368,7 @@ int32_t compKeys(const SArray* pSortGroupCols, const char* oldkeyBuf, int32_t ol
for (int32_t i = 0; i < pSortGroupCols->size; ++i) {
const SColumn* pCol = (SColumn*)TARRAY_GET_ELEM(pSortGroupCols, i);
const SColumnInfoData* pColInfoData = TARRAY_GET_ELEM(pBlock->pDataBlock, pCol->slotId);
- if (pBlock->pBlockAgg) pColAgg = pBlock->pBlockAgg[pCol->slotId];
+ if (pBlock->pBlockAgg) pColAgg = &pBlock->pBlockAgg[pCol->slotId];
if (colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg)) {
if (isNull[i] != 1) return 1;
@@ -2389,7 +2403,7 @@ int32_t buildKeys(char* keyBuf, const SArray* pSortGroupCols, const SSDataBlock*
const SColumnInfoData* pColInfoData = TARRAY_GET_ELEM(pBlock->pDataBlock, pCol->slotId);
if (pCol->slotId > pBlock->pDataBlock->size) continue;
- if (pBlock->pBlockAgg) pColAgg = pBlock->pBlockAgg[pCol->slotId];
+ if (pBlock->pBlockAgg) pColAgg = &pBlock->pBlockAgg[pCol->slotId];
if (colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg)) {
isNull[i] = 1;
diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c
index 20bd1056f6..77a80d229e 100644
--- a/source/libs/executor/src/executor.c
+++ b/source/libs/executor/src/executor.c
@@ -286,7 +286,7 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int3
}
qTaskInfo_t pTaskInfo = NULL;
- code = qCreateExecTask(pReaderHandle, vgId, 0, pPlan, &pTaskInfo, NULL, NULL, OPTR_EXEC_MODEL_QUEUE);
+ code = qCreateExecTask(pReaderHandle, vgId, 0, pPlan, &pTaskInfo, NULL, 0, NULL, OPTR_EXEC_MODEL_QUEUE);
if (code != TSDB_CODE_SUCCESS) {
nodesDestroyNode((SNode*)pPlan);
qDestroyTask(pTaskInfo);
@@ -322,7 +322,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers, int32_t v
}
qTaskInfo_t pTaskInfo = NULL;
- code = qCreateExecTask(readers, vgId, taskId, pPlan, &pTaskInfo, NULL, NULL, OPTR_EXEC_MODEL_STREAM);
+ code = qCreateExecTask(readers, vgId, taskId, pPlan, &pTaskInfo, NULL, 0, NULL, OPTR_EXEC_MODEL_STREAM);
if (code != TSDB_CODE_SUCCESS) {
nodesDestroyNode((SNode*)pPlan);
qDestroyTask(pTaskInfo);
@@ -524,7 +524,8 @@ void qUpdateOperatorParam(qTaskInfo_t tinfo, void* pParam) {
}
int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, SSubplan* pSubplan,
- qTaskInfo_t* pTaskInfo, DataSinkHandle* handle, char* sql, EOPTR_EXEC_MODEL model) {
+ qTaskInfo_t* pTaskInfo, DataSinkHandle* handle, int8_t compressResult, char* sql,
+ EOPTR_EXEC_MODEL model) {
SExecTaskInfo** pTask = (SExecTaskInfo**)pTaskInfo;
taosThreadOnce(&initPoolOnce, initRefPool);
@@ -537,7 +538,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
}
if (handle) {
- SDataSinkMgtCfg cfg = {.maxDataBlockNum = 500, .maxDataBlockNumPerQuery = 50};
+ SDataSinkMgtCfg cfg = {.maxDataBlockNum = 500, .maxDataBlockNumPerQuery = 50, .compress = compressResult};
void* pSinkManager = NULL;
code = dsDataSinkMgtInit(&cfg, &(*pTask)->storageAPI, &pSinkManager);
if (code != TSDB_CODE_SUCCESS) {
diff --git a/source/libs/executor/src/executorInt.c b/source/libs/executor/src/executorInt.c
index 43c04ca8d9..3de8468bb8 100644
--- a/source/libs/executor/src/executorInt.c
+++ b/source/libs/executor/src/executorInt.c
@@ -434,8 +434,8 @@ void setBlockSMAInfo(SqlFunctionCtx* pCtx, SExprInfo* pExprInfo, SSDataBlock* pB
if (pFuncParam->type == FUNC_PARAM_TYPE_COLUMN) {
int32_t slotId = pFuncParam->pCol->slotId;
- pInput->pColumnDataAgg[j] = pBlock->pBlockAgg[slotId];
- if (pInput->pColumnDataAgg[j] == NULL) {
+ pInput->pColumnDataAgg[j] = &pBlock->pBlockAgg[slotId];
+ if (pInput->pColumnDataAgg[j]->colId == -1) {
pInput->colDataSMAIsSet = false;
}
@@ -468,7 +468,7 @@ STimeWindow getAlignQueryTimeWindow(const SInterval* pInterval, int64_t key) {
return win;
}
-void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) {
+int32_t setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset) {
bool init = false;
for (int32_t i = 0; i < numOfOutput; ++i) {
pCtx[i].resultInfo = getResultEntryInfo(pResult, i, rowEntryInfoOffset);
@@ -487,7 +487,11 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
if (!pResInfo->initialized) {
if (pCtx[i].functionId != -1) {
- pCtx[i].fpSet.init(&pCtx[i], pResInfo);
+ bool ini = pCtx[i].fpSet.init(&pCtx[i], pResInfo);
+ if (!ini && fmIsUserDefinedFunc(pCtx[i].functionId)){
+ pResInfo->initialized = false;
+ return TSDB_CODE_UDF_FUNC_EXEC_FAILURE;
+ }
} else {
pResInfo->initialized = true;
}
@@ -495,6 +499,7 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
init = true;
}
}
+ return TSDB_CODE_SUCCESS;
}
void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput) {
diff --git a/source/libs/executor/src/groupoperator.c b/source/libs/executor/src/groupoperator.c
index 9a31e993b2..8196a7ccde 100644
--- a/source/libs/executor/src/groupoperator.c
+++ b/source/libs/executor/src/groupoperator.c
@@ -131,7 +131,7 @@ static bool groupKeyCompare(SArray* pGroupCols, SArray* pGroupColVals, SSDataBlo
SColumn* pCol = taosArrayGet(pGroupCols, i);
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pCol->slotId);
if (pBlock->pBlockAgg != NULL) {
- pColAgg = pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched?
+ pColAgg = &pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched?
}
bool isNull = colDataIsNull(pColInfoData, pBlock->info.rows, rowIndex, pColAgg);
@@ -187,7 +187,7 @@ static void recordNewGroupKeys(SArray* pGroupCols, SArray* pGroupColVals, SSData
}
if (pBlock->pBlockAgg != NULL) {
- pColAgg = pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched?
+ pColAgg = &pBlock->pBlockAgg[pCol->slotId]; // TODO is agg data matched?
}
SGroupKeys* pkey = taosArrayGet(pGroupColVals, i);
@@ -319,7 +319,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf,
len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup);
if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code
- T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR);
+ T_LONG_JMP(pTaskInfo->env, ret);
}
int32_t rowIndex = j - num;
@@ -337,7 +337,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
int32_t ret = setGroupResultOutputBuf(pOperator, &(pInfo->binfo), pOperator->exprSupp.numOfExprs, pInfo->keyBuf,
len, pBlock->info.id.groupId, pInfo->aggSup.pResultBuf, &pInfo->aggSup);
if (ret != TSDB_CODE_SUCCESS) {
- T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR);
+ T_LONG_JMP(pTaskInfo->env, ret);
}
int32_t rowIndex = pBlock->info.rows - num;
@@ -563,6 +563,55 @@ _error:
return NULL;
}
+SSDataBlock* createBlockDataNotLoaded(const SOperatorInfo* pOperator, SSDataBlock* pDataBlock) {
+ if (pDataBlock == NULL) {
+ return NULL;
+ }
+
+ SSDataBlock* pDstBlock = createDataBlock();
+ pDstBlock->info = pDataBlock->info;
+ pDstBlock->info.id.blockId = pOperator->resultDataBlockId;
+ pDstBlock->info.capacity = 0;
+ pDstBlock->info.rowSize = 0;
+
+ size_t numOfCols = pOperator->exprSupp.numOfExprs;
+ if (pDataBlock->pBlockAgg) {
+ pDstBlock->pBlockAgg = taosMemoryCalloc(numOfCols, sizeof(SColumnDataAgg));
+ if (pDstBlock->pBlockAgg == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ blockDataDestroy(pDstBlock);
+ return NULL;
+ }
+ for(int i = 0; i < numOfCols; ++i) {
+ pDstBlock->pBlockAgg[i].colId = -1;
+ }
+ }
+
+ for (int32_t i = 0; i < pOperator->exprSupp.numOfExprs; ++i) {
+ SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i];
+ int32_t slotId = pExpr->base.pParam[0].pCol->slotId;
+ SColumnInfoData* pSrc = taosArrayGet(pDataBlock->pDataBlock, slotId);
+ SColumnInfoData colInfo = {.hasNull = true, .info = pSrc->info};
+ blockDataAppendColInfo(pDstBlock, &colInfo);
+
+ SColumnInfoData* pDst = taosArrayGet(pDstBlock->pDataBlock, i);
+ if (pDataBlock->pBlockAgg && pDataBlock->pBlockAgg[slotId].colId != -1) {
+ pDstBlock->pBlockAgg[i] = pDataBlock->pBlockAgg[slotId];
+ } else {
+ int32_t code = doEnsureCapacity(pDst, &pDstBlock->info, pDataBlock->info.rows, false);
+ if (code != TSDB_CODE_SUCCESS) {
+ terrno = code;
+ blockDataDestroy(pDstBlock);
+ return NULL;
+ }
+
+ colDataAssign(pDst, pSrc, pDataBlock->info.rows, &pDataBlock->info);
+ }
+ }
+
+ return pDstBlock;
+}
+
static void doHashPartition(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
SPartitionOperatorInfo* pInfo = pOperator->info;
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
@@ -584,71 +633,86 @@ static void doHashPartition(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
pGroupInfo->groupId = calcGroupId(pInfo->keyBuf, len);
}
- // number of rows
- int32_t* rows = (int32_t*)pPage;
+ if (pBlock->info.dataLoad) {
+ // number of rows
+ int32_t* rows = (int32_t*)pPage;
- size_t numOfCols = pOperator->exprSupp.numOfExprs;
- for (int32_t i = 0; i < numOfCols; ++i) {
- SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i];
- int32_t slotId = pExpr->base.pParam[0].pCol->slotId;
+ size_t numOfCols = pOperator->exprSupp.numOfExprs;
+ for (int32_t i = 0; i < numOfCols; ++i) {
+ SExprInfo* pExpr = &pOperator->exprSupp.pExprInfo[i];
+ int32_t slotId = pExpr->base.pParam[0].pCol->slotId;
- SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId);
+ SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, slotId);
- int32_t bytes = pColInfoData->info.bytes;
- int32_t startOffset = pInfo->columnOffset[i];
+ int32_t bytes = pColInfoData->info.bytes;
+ int32_t startOffset = pInfo->columnOffset[i];
- int32_t* columnLen = NULL;
- int32_t contentLen = 0;
+ int32_t* columnLen = NULL;
+ int32_t contentLen = 0;
- if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
- int32_t* offset = (int32_t*)((char*)pPage + startOffset);
- columnLen = (int32_t*)((char*)pPage + startOffset + sizeof(int32_t) * pInfo->rowCapacity);
- char* data = (char*)((char*)columnLen + sizeof(int32_t));
+ if (IS_VAR_DATA_TYPE(pColInfoData->info.type)) {
+ int32_t* offset = (int32_t*)((char*)pPage + startOffset);
+ columnLen = (int32_t*)((char*)pPage + startOffset + sizeof(int32_t) * pInfo->rowCapacity);
+ char* data = (char*)((char*)columnLen + sizeof(int32_t));
- if (colDataIsNull_s(pColInfoData, j)) {
- offset[(*rows)] = -1;
- contentLen = 0;
- } else if (pColInfoData->info.type == TSDB_DATA_TYPE_JSON) {
- offset[*rows] = (*columnLen);
- char* src = colDataGetData(pColInfoData, j);
- int32_t dataLen = getJsonValueLen(src);
+ if (colDataIsNull_s(pColInfoData, j)) {
+ offset[(*rows)] = -1;
+ contentLen = 0;
+ } else if (pColInfoData->info.type == TSDB_DATA_TYPE_JSON) {
+ offset[*rows] = (*columnLen);
+ char* src = colDataGetData(pColInfoData, j);
+ int32_t dataLen = getJsonValueLen(src);
- memcpy(data + (*columnLen), src, dataLen);
- int32_t v = (data + (*columnLen) + dataLen - (char*)pPage);
- ASSERT(v > 0);
+ memcpy(data + (*columnLen), src, dataLen);
+ int32_t v = (data + (*columnLen) + dataLen - (char*)pPage);
+ ASSERT(v > 0);
- contentLen = dataLen;
+ contentLen = dataLen;
+ } else {
+ offset[*rows] = (*columnLen);
+ char* src = colDataGetData(pColInfoData, j);
+ memcpy(data + (*columnLen), src, varDataTLen(src));
+ int32_t v = (data + (*columnLen) + varDataTLen(src) - (char*)pPage);
+ ASSERT(v > 0);
+
+ contentLen = varDataTLen(src);
+ }
} else {
- offset[*rows] = (*columnLen);
- char* src = colDataGetData(pColInfoData, j);
- memcpy(data + (*columnLen), src, varDataTLen(src));
- int32_t v = (data + (*columnLen) + varDataTLen(src) - (char*)pPage);
- ASSERT(v > 0);
+ char* bitmap = (char*)pPage + startOffset;
+ columnLen = (int32_t*)((char*)pPage + startOffset + BitmapLen(pInfo->rowCapacity));
+ char* data = (char*)columnLen + sizeof(int32_t);
- contentLen = varDataTLen(src);
+ bool isNull = colDataIsNull_f(pColInfoData->nullbitmap, j);
+ if (isNull) {
+ colDataSetNull_f(bitmap, (*rows));
+ } else {
+ memcpy(data + (*columnLen), colDataGetData(pColInfoData, j), bytes);
+ ASSERT((data + (*columnLen) + bytes - (char*)pPage) <= getBufPageSize(pInfo->pBuf));
+ }
+ contentLen = bytes;
}
- } else {
- char* bitmap = (char*)pPage + startOffset;
- columnLen = (int32_t*)((char*)pPage + startOffset + BitmapLen(pInfo->rowCapacity));
- char* data = (char*)columnLen + sizeof(int32_t);
- bool isNull = colDataIsNull_f(pColInfoData->nullbitmap, j);
- if (isNull) {
- colDataSetNull_f(bitmap, (*rows));
- } else {
- memcpy(data + (*columnLen), colDataGetData(pColInfoData, j), bytes);
- ASSERT((data + (*columnLen) + bytes - (char*)pPage) <= getBufPageSize(pInfo->pBuf));
- }
- contentLen = bytes;
+ (*columnLen) += contentLen;
}
- (*columnLen) += contentLen;
+ (*rows) += 1;
+
+ setBufPageDirty(pPage, true);
+ releaseBufPage(pInfo->pBuf, pPage);
+ } else {
+ SSDataBlock* dataNotLoadBlock = createBlockDataNotLoaded(pOperator, pBlock);
+ if (dataNotLoadBlock == NULL) {
+ T_LONG_JMP(pTaskInfo->env, terrno);
+ }
+ if (pGroupInfo->blockForNotLoaded == NULL) {
+ pGroupInfo->blockForNotLoaded = taosArrayInit(0, sizeof(SSDataBlock*));
+ pGroupInfo->offsetForNotLoaded = 0;
+ }
+ dataNotLoadBlock->info.id.groupId = pGroupInfo->groupId;
+ dataNotLoadBlock->info.dataLoad = 0;
+ taosArrayPush(pGroupInfo->blockForNotLoaded, &dataNotLoadBlock);
+ break;
}
-
- (*rows) += 1;
-
- setBufPageDirty(pPage, true);
- releaseBufPage(pInfo->pBuf, pPage);
}
}
@@ -730,6 +794,14 @@ static void clearPartitionOperator(SPartitionOperatorInfo* pInfo) {
int32_t size = taosArrayGetSize(pInfo->sortedGroupArray);
for (int32_t i = 0; i < size; i++) {
SDataGroupInfo* pGp = taosArrayGet(pInfo->sortedGroupArray, i);
+ if (pGp->blockForNotLoaded) {
+ for (int32_t i = 0; i < pGp->blockForNotLoaded->size; i++) {
+ SSDataBlock** pBlock = taosArrayGet(pGp->blockForNotLoaded, i);
+ blockDataDestroy(*pBlock);
+ }
+ taosArrayClear(pGp->blockForNotLoaded);
+ pGp->offsetForNotLoaded = 0;
+ }
taosArrayDestroy(pGp->pPageList);
}
taosArrayClear(pInfo->sortedGroupArray);
@@ -747,6 +819,15 @@ static int compareDataGroupInfo(const void* group1, const void* group2) {
return (pGroupInfo1->groupId < pGroupInfo2->groupId) ? -1 : 1;
}
+static SSDataBlock* buildPartitionResultForNotLoadBlock(SDataGroupInfo* pGroupInfo) {
+ if (pGroupInfo->blockForNotLoaded && pGroupInfo->offsetForNotLoaded < pGroupInfo->blockForNotLoaded->size) {
+ SSDataBlock** pBlock = taosArrayGet(pGroupInfo->blockForNotLoaded, pGroupInfo->offsetForNotLoaded);
+ pGroupInfo->offsetForNotLoaded++;
+ return *pBlock;
+ }
+ return NULL;
+}
+
static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
SPartitionOperatorInfo* pInfo = pOperator->info;
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
@@ -756,13 +837,17 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
SDataGroupInfo* pGroupInfo =
(pInfo->groupIndex != -1) ? taosArrayGet(pInfo->sortedGroupArray, pInfo->groupIndex) : NULL;
if (pInfo->groupIndex == -1 || pInfo->pageIndex >= taosArrayGetSize(pGroupInfo->pPageList)) {
+ if(pGroupInfo != NULL) {
+ SSDataBlock* ret = buildPartitionResultForNotLoadBlock(pGroupInfo);
+ if(ret != NULL) return ret;
+ }
// try next group data
- ++pInfo->groupIndex;
- if (pInfo->groupIndex >= taosArrayGetSize(pInfo->sortedGroupArray)) {
+ if (pInfo->groupIndex + 1 >= taosArrayGetSize(pInfo->sortedGroupArray)) {
setOperatorCompleted(pOperator);
clearPartitionOperator(pInfo);
return NULL;
}
+ ++pInfo->groupIndex;
pGroupInfo = taosArrayGet(pInfo->sortedGroupArray, pInfo->groupIndex);
pInfo->pageIndex = 0;
@@ -774,6 +859,20 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
qError("failed to get buffer, code:%s, %s", tstrerror(terrno), GET_TASKID(pTaskInfo));
T_LONG_JMP(pTaskInfo->env, terrno);
}
+ if (*(int32_t*)page == 0) {
+ releaseBufPage(pInfo->pBuf, page);
+ SSDataBlock* ret = buildPartitionResultForNotLoadBlock(pGroupInfo);
+ if (ret != NULL) return ret;
+ if (pInfo->groupIndex + 1 < taosArrayGetSize(pInfo->sortedGroupArray)) {
+ pInfo->groupIndex++;
+ pInfo->pageIndex = 0;
+ } else {
+ setOperatorCompleted(pOperator);
+ clearPartitionOperator(pInfo);
+ return NULL;
+ }
+ return buildPartitionResult(pOperator);
+ }
blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->rowCapacity);
blockDataFromBuf1(pInfo->binfo.pRes, page, pInfo->rowCapacity);
@@ -783,6 +882,8 @@ static SSDataBlock* buildPartitionResult(SOperatorInfo* pOperator) {
pInfo->binfo.pRes->info.id.groupId = pGroupInfo->groupId;
pInfo->binfo.pRes->info.dataLoad = 1;
pInfo->orderedRows = 0;
+ } else if (pInfo->pOrderInfoArr == NULL) {
+ qError("Exception, remainRows not zero, but pOrderInfoArr is NULL");
}
if (pInfo->pOrderInfoArr) {
@@ -1009,8 +1110,7 @@ int32_t setGroupResultOutputBuf(SOperatorInfo* pOperator, SOptrBasicInfo* binfo,
SResultRow* pResultRow =
doSetResultOutBufByKey(pBuf, pResultRowInfo, (char*)pData, bytes, true, groupId, pTaskInfo, false, pAggSup, false);
- setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset);
- return TSDB_CODE_SUCCESS;
+ return setResultRowInitCtx(pResultRow, pCtx, numOfCols, pOperator->exprSupp.rowEntryInfoOffset);
}
uint64_t calGroupIdByData(SPartitionBySupporter* pParSup, SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t rowId) {
diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c
index eef8b06ac5..1b90088605 100644
--- a/source/libs/executor/src/scanoperator.c
+++ b/source/libs/executor/src/scanoperator.c
@@ -220,7 +220,7 @@ static int32_t doDynamicPruneDataBlock(SOperatorInfo* pOperator, SDataBlockInfo*
return code;
}
-static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg** pColsAgg, int32_t numOfCols,
+static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg* pColsAgg, int32_t numOfCols,
int32_t numOfRows) {
if (pColsAgg == NULL || pFilterInfo == NULL) {
return true;
@@ -725,7 +725,7 @@ void markGroupProcessed(STableScanInfo* pInfo, uint64_t groupId) {
if (pInfo->countState == TABLE_COUNT_STATE_END) {
return;
}
- if (pInfo->base.pTableListInfo->oneTableForEachGroup || pInfo->base.pTableListInfo->groupOffset) {
+ if (pInfo->base.pTableListInfo->groupOffset) {
pInfo->countState = TABLE_COUNT_STATE_PROCESSED;
} else {
taosHashRemove(pInfo->base.pTableListInfo->remainGroups, &groupId, sizeof(groupId));
@@ -769,6 +769,7 @@ static SSDataBlock* doTableScanImpl(SOperatorInfo* pOperator) {
SSDataBlock* pBlock = pTableScanInfo->pResBlock;
bool hasNext = false;
int32_t code = TSDB_CODE_SUCCESS;
+ pBlock->info.dataLoad = false;
int64_t st = taosGetTimestampUs();
@@ -890,7 +891,7 @@ static SSDataBlock* doGroupedTableScan(SOperatorInfo* pOperator) {
if (pTableScanInfo->countState < TABLE_COUNT_STATE_END) {
STableListInfo* pTableListInfo = pTableScanInfo->base.pTableListInfo;
- if (pTableListInfo->oneTableForEachGroup || pTableListInfo->groupOffset) { // group by tbname, group by tag + sort
+ if (pTableListInfo->groupOffset) { // group by tbname, group by tag + sort
if (pTableScanInfo->countState < TABLE_COUNT_STATE_PROCESSED) {
pTableScanInfo->countState = TABLE_COUNT_STATE_PROCESSED;
STableKeyInfo* pStart =
diff --git a/source/libs/executor/src/streamtimewindowoperator.c b/source/libs/executor/src/streamtimewindowoperator.c
index 2224942893..2d73cf3cf6 100644
--- a/source/libs/executor/src/streamtimewindowoperator.c
+++ b/source/libs/executor/src/streamtimewindowoperator.c
@@ -1975,8 +1975,7 @@ static int32_t initSessionOutputBuf(SResultWindowInfo* pWinInfo, SResultRow** pR
*pResult = (SResultRow*)pWinInfo->pStatePos->pRowBuff;
// set time window for current result
(*pResult)->win = pWinInfo->sessionWin.win;
- setResultRowInitCtx(*pResult, pCtx, numOfOutput, rowEntryInfoOffset);
- return TSDB_CODE_SUCCESS;
+ return setResultRowInitCtx(*pResult, pCtx, numOfOutput, rowEntryInfoOffset);
}
int32_t doOneWindowAggImpl(SColumnInfoData* pTimeWindowData, SResultWindowInfo* pCurWin, SResultRow** pResult,
diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c
index b72811cdcc..8b151edb27 100644
--- a/source/libs/executor/src/timewindowoperator.c
+++ b/source/libs/executor/src/timewindowoperator.c
@@ -84,9 +84,7 @@ static int32_t setTimeWindowOutputBuf(SResultRowInfo* pResultRowInfo, STimeWindo
pResultRow->win = (*win);
*pResult = pResultRow;
- setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset);
-
- return TSDB_CODE_SUCCESS;
+ return setResultRowInitCtx(pResultRow, pCtx, numOfOutput, rowEntryInfoOffset);
}
static void doKeepTuple(SWindowRowsSup* pRowSup, int64_t ts, uint64_t groupId) {
@@ -911,7 +909,7 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI
struct SColumnDataAgg* pAgg = NULL;
for (int32_t j = 0; j < pBlock->info.rows; ++j) {
- pAgg = (pBlock->pBlockAgg != NULL) ? pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL;
+ pAgg = (pBlock->pBlockAgg != NULL) ? &pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL;
if (colDataIsNull(pStateColInfoData, pBlock->info.rows, j, pAgg)) {
continue;
}
@@ -1647,8 +1645,7 @@ static int32_t setSingleOutputTupleBuf(SResultRowInfo* pResultRowInfo, STimeWind
// set time window for current result
(*pResult)->win = (*win);
- setResultRowInitCtx((*pResult), pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
- return TSDB_CODE_SUCCESS;
+ return setResultRowInitCtx((*pResult), pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
}
static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResultRowInfo,
diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c
index 8ab388830f..d9bcc954a4 100644
--- a/source/libs/executor/src/tsort.c
+++ b/source/libs/executor/src/tsort.c
@@ -651,7 +651,7 @@ int32_t tsortComparBlockCell(SSDataBlock* pLeftBlock, SSDataBlock* pRightBlock,
leftNull = colDataIsNull_t(pLeftColInfoData, leftRowIndex, isVarType);
} else {
leftNull =
- colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, leftRowIndex, pLeftBlock->pBlockAgg[pOrder->slotId]);
+ colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, leftRowIndex, &pLeftBlock->pBlockAgg[pOrder->slotId]);
}
}
@@ -661,7 +661,7 @@ int32_t tsortComparBlockCell(SSDataBlock* pLeftBlock, SSDataBlock* pRightBlock,
rightNull = colDataIsNull_t(pRightColInfoData, rightRowIndex, isVarType);
} else {
rightNull = colDataIsNull(pRightColInfoData, pRightBlock->info.rows, rightRowIndex,
- pRightBlock->pBlockAgg[pOrder->slotId]);
+ &pRightBlock->pBlockAgg[pOrder->slotId]);
}
}
@@ -742,7 +742,7 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) {
leftNull = colDataIsNull_t(pLeftColInfoData, pLeftSource->src.rowIndex, isVarType);
} else {
leftNull = colDataIsNull(pLeftColInfoData, pLeftBlock->info.rows, pLeftSource->src.rowIndex,
- pLeftBlock->pBlockAgg[i]);
+ &pLeftBlock->pBlockAgg[i]);
}
}
@@ -752,7 +752,7 @@ int32_t msortComparFn(const void* pLeft, const void* pRight, void* param) {
rightNull = colDataIsNull_t(pRightColInfoData, pRightSource->src.rowIndex, isVarType);
} else {
rightNull = colDataIsNull(pRightColInfoData, pRightBlock->info.rows, pRightSource->src.rowIndex,
- pRightBlock->pBlockAgg[i]);
+ &pRightBlock->pBlockAgg[i]);
}
}
diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c
index 3fb298e1ea..1aa92479b9 100644
--- a/source/libs/function/src/builtinsimpl.c
+++ b/source/libs/function/src/builtinsimpl.c
@@ -2366,7 +2366,10 @@ EFuncDataRequired firstDynDataReq(void* pRes, SDataBlockInfo* pBlockInfo) {
}
if (pResult->ts < pBlockInfo->window.skey) {
return FUNC_DATA_REQUIRED_NOT_LOAD;
- } else if (pResult->ts == pBlockInfo->window.skey && pResult->pkData) {
+ } else if (pResult->ts == pBlockInfo->window.skey) {
+ if (NULL == pResult->pkData) {
+ return FUNC_DATA_REQUIRED_NOT_LOAD;
+ }
if (comparePkDataWithSValue(pResult->pkType, pResult->pkData, pBlockInfo->pks + 0, TSDB_ORDER_ASC) < 0) {
return FUNC_DATA_REQUIRED_NOT_LOAD;
}
@@ -3628,7 +3631,7 @@ int32_t saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock*
SColumnInfoData* pColInfo = taosArrayGet(pSrcBlock->pDataBlock, pCtx->saveHandle.pState->tsIndex);
ASSERT(pColInfo->info.type == TSDB_DATA_TYPE_TIMESTAMP);
key.groupId = pSrcBlock->info.id.groupId;
- key.ts = *(int64_t*)colDataGetData(pColInfo, rowIndex);;
+ key.ts = *(int64_t*)colDataGetData(pColInfo, rowIndex);
}
char* buf = serializeTupleData(pSrcBlock, rowIndex, &pCtx->subsidiaries, pCtx->subsidiaries.buf);
diff --git a/source/libs/function/src/detail/tminmax.c b/source/libs/function/src/detail/tminmax.c
index a6c91a57ce..653b8adad7 100644
--- a/source/libs/function/src/detail/tminmax.c
+++ b/source/libs/function/src/detail/tminmax.c
@@ -702,23 +702,16 @@ static void doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFunct
}
}
-static int32_t saveRelatedTuple(SqlFunctionCtx* pCtx, SInputColumnInfoData* pInput, int32_t index, void* tval) {
+static int32_t saveRelatedTupleTag(SqlFunctionCtx* pCtx, SInputColumnInfoData* pInput, void* tval) {
SColumnInfoData* pCol = pInput->pData[0];
SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx);
SMinmaxResInfo* pBuf = GET_ROWCELL_INTERBUF(pResInfo);
- int32_t code = 0;
+ int32_t code = TSDB_CODE_SUCCESS;
if (pCtx->subsidiaries.num > 0) {
- index = findRowIndex(pInput->startRowIndex, pInput->numOfRows, pCol, tval);
- if (index >= 0) {
- code = saveTupleData(pCtx, index, pCtx->pSrcBlock, &pBuf->tuplePos);
- if (code != TSDB_CODE_SUCCESS) {
- return code;
- }
- }
+ code = saveTupleData(pCtx, 0, pCtx->pSrcBlock, &pBuf->tuplePos);
}
-
return code;
}
@@ -758,7 +751,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems)
pBuf->v = GET_INT64_VAL(tval);
}
- code = saveRelatedTuple(pCtx, pInput, index, tval);
+ code = saveRelatedTupleTag(pCtx, pInput, tval);
} else {
if (IS_SIGNED_NUMERIC_TYPE(type)) {
int64_t prev = 0;
@@ -767,7 +760,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems)
int64_t val = GET_INT64_VAL(tval);
if ((prev < val) ^ isMinFunc) {
GET_INT64_VAL(&pBuf->v) = val;
- code = saveRelatedTuple(pCtx, pInput, index, tval);
+ code = saveRelatedTupleTag(pCtx, pInput, tval);
}
} else if (IS_UNSIGNED_NUMERIC_TYPE(type)) {
uint64_t prev = 0;
@@ -776,7 +769,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems)
uint64_t val = GET_UINT64_VAL(tval);
if ((prev < val) ^ isMinFunc) {
GET_UINT64_VAL(&pBuf->v) = val;
- code = saveRelatedTuple(pCtx, pInput, index, tval);
+ code = saveRelatedTupleTag(pCtx, pInput, tval);
}
} else if (type == TSDB_DATA_TYPE_DOUBLE) {
double prev = 0;
@@ -785,7 +778,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems)
double val = GET_DOUBLE_VAL(tval);
if ((prev < val) ^ isMinFunc) {
GET_DOUBLE_VAL(&pBuf->v) = val;
- code = saveRelatedTuple(pCtx, pInput, index, tval);
+ code = saveRelatedTupleTag(pCtx, pInput, tval);
}
} else if (type == TSDB_DATA_TYPE_FLOAT) {
float prev = 0;
@@ -794,7 +787,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc, int32_t* nElems)
float val = GET_DOUBLE_VAL(tval);
if ((prev < val) ^ isMinFunc) {
GET_FLOAT_VAL(&pBuf->v) = val;
- code = saveRelatedTuple(pCtx, pInput, index, tval);
+ code = saveRelatedTupleTag(pCtx, pInput, tval);
}
}
}
diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c
index c671e7717c..776a7fb95a 100644
--- a/source/libs/function/src/tpercentile.c
+++ b/source/libs/function/src/tpercentile.c
@@ -64,7 +64,7 @@ static SFilePage *loadDataFromFilePage(tMemBucket *pMemBucket, int32_t slotIdx)
static void resetBoundingBox(MinMaxEntry *range, int32_t type) {
if (IS_SIGNED_NUMERIC_TYPE(type)) {
range->dMaxVal = INT64_MIN;
- range->dMinVal = INT64_MAX;
+ range->dMinVal = (double)INT64_MAX;
} else if (IS_UNSIGNED_NUMERIC_TYPE(type)) {
range->u64MaxVal = 0;
range->u64MinVal = UINT64_MAX;
diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c
index 7e344866a5..5f7764f342 100644
--- a/source/libs/function/src/tudf.c
+++ b/source/libs/function/src/tudf.c
@@ -26,6 +26,10 @@
#include "tudf.h"
#include "tudfInt.h"
+#ifdef _TD_DARWIN_64
+#include
+#endif
+
typedef struct SUdfdData {
bool startCalled;
bool needCleanUp;
diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c
index 54745951cc..df97e873aa 100644
--- a/source/libs/function/src/udfd.c
+++ b/source/libs/function/src/udfd.c
@@ -691,7 +691,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
convertDataBlockToUdfDataBlock(&call->block, &input);
code = udf->scriptPlugin->udfScalarProcFunc(&input, &output, udf->scriptUdfCtx);
freeUdfDataDataBlock(&input);
- convertUdfColumnToDataBlock(&output, &response.callRsp.resultData);
+ if(code == 0) convertUdfColumnToDataBlock(&output, &response.callRsp.resultData);
freeUdfColumn(&output);
break;
}
diff --git a/source/libs/function/test/udf2.c b/source/libs/function/test/udf2.c
index faf4daa4e5..273b9c49c2 100644
--- a/source/libs/function/test/udf2.c
+++ b/source/libs/function/test/udf2.c
@@ -10,6 +10,7 @@ DLL_EXPORT int32_t udf2_init() { return 0; }
DLL_EXPORT int32_t udf2_destroy() { return 0; }
DLL_EXPORT int32_t udf2_start(SUdfInterBuf* buf) {
+ if(buf->buf == NULL || buf->bufLen < (sizeof(int64_t))) return TSDB_CODE_UDF_INVALID_BUFSIZE;
*(int64_t*)(buf->buf) = 0;
buf->bufLen = sizeof(double);
buf->numOfResult = 1;
@@ -17,6 +18,7 @@ DLL_EXPORT int32_t udf2_start(SUdfInterBuf* buf) {
}
DLL_EXPORT int32_t udf2(SUdfDataBlock* block, SUdfInterBuf* interBuf, SUdfInterBuf* newInterBuf) {
+ if(newInterBuf->buf == NULL || newInterBuf->bufLen < (sizeof(double))) return TSDB_CODE_UDF_INVALID_BUFSIZE;
double sumSquares = 0;
if (interBuf->numOfResult == 1) {
sumSquares = *(double*)interBuf->buf;
diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c
index f41b5525f3..d7e5d87e80 100644
--- a/source/libs/index/src/index.c
+++ b/source/libs/index/src/index.c
@@ -25,8 +25,10 @@
#include "tref.h"
#include "tsched.h"
-#define INDEX_NUM_OF_THREADS 5
-#define INDEX_QUEUE_SIZE 200
+#define INDEX_NUM_OF_THREADS 5
+#define INDEX_MAX_NUM_OF_THREADS 10
+
+#define INDEX_QUEUE_SIZE 200
#define INDEX_DATA_BOOL_NULL 0x02
#define INDEX_DATA_TINYINT_NULL 0x80
@@ -61,6 +63,7 @@ static void indexDestroy(void* sIdx);
void indexInit(int32_t threadNum) {
indexThreads = threadNum;
if (indexThreads <= 1) indexThreads = INDEX_NUM_OF_THREADS;
+ if (indexThreads >= INDEX_MAX_NUM_OF_THREADS) indexThreads = INDEX_MAX_NUM_OF_THREADS;
}
void indexEnvInit() {
// refactor later
diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c
index 84d3f734fe..f02fefd977 100644
--- a/source/libs/nodes/src/nodesCloneFuncs.c
+++ b/source/libs/nodes/src/nodesCloneFuncs.c
@@ -843,6 +843,7 @@ static int32_t selectStmtCopy(const SSelectStmt* pSrc, SSelectStmt* pDst) {
CLONE_NODE_FIELD_EX(pLimit, SLimitNode*);
COPY_CHAR_ARRAY_FIELD(stmtName);
COPY_SCALAR_FIELD(precision);
+ COPY_SCALAR_FIELD(isSubquery);
COPY_SCALAR_FIELD(isEmptyResult);
COPY_SCALAR_FIELD(timeLineResMode);
COPY_SCALAR_FIELD(timeLineFromOrderBy);
diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c
index 1aa30b854f..96eb664134 100644
--- a/source/libs/nodes/src/nodesCodeFuncs.c
+++ b/source/libs/nodes/src/nodesCodeFuncs.c
@@ -6168,6 +6168,7 @@ static const char* jkAlterUserStmtAlterType = "AlterType";
static const char* jkAlterUserStmtPassword = "Password";
static const char* jkAlterUserStmtEnable = "Enable";
static const char* jkAlterUserStmtSysinfo = "Sysinfo";
+static const char* jkAlterUserStmtCreatedb = "Createdb";
static int32_t alterUserStmtToJson(const void* pObj, SJson* pJson) {
const SAlterUserStmt* pNode = (const SAlterUserStmt*)pObj;
@@ -6185,6 +6186,9 @@ static int32_t alterUserStmtToJson(const void* pObj, SJson* pJson) {
if (TSDB_CODE_SUCCESS == code) {
code = tjsonAddIntegerToObject(pJson, jkAlterUserStmtSysinfo, pNode->sysinfo);
}
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonAddIntegerToObject(pJson, jkAlterUserStmtCreatedb, pNode->createdb);
+ }
return code;
}
@@ -6205,6 +6209,9 @@ static int32_t jsonToAlterUserStmt(const SJson* pJson, void* pObj) {
if (TSDB_CODE_SUCCESS == code) {
code = tjsonGetTinyIntValue(pJson, jkAlterUserStmtSysinfo, &pNode->sysinfo);
}
+ if (TSDB_CODE_SUCCESS == code) {
+ code = tjsonGetTinyIntValue(pJson, jkAlterUserStmtCreatedb, &pNode->createdb);
+ }
return code;
}
diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c
index 68ce33d596..5a7c2343e9 100644
--- a/source/libs/nodes/src/nodesUtilFuncs.c
+++ b/source/libs/nodes/src/nodesUtilFuncs.c
@@ -963,12 +963,14 @@ void nodesDestroyNode(SNode* pNode) {
break;
case QUERY_NODE_WHEN_THEN: {
SWhenThenNode* pWhenThen = (SWhenThenNode*)pNode;
+ destroyExprNode((SExprNode*)pNode);
nodesDestroyNode(pWhenThen->pWhen);
nodesDestroyNode(pWhenThen->pThen);
break;
}
case QUERY_NODE_CASE_WHEN: {
SCaseWhenNode* pCaseWhen = (SCaseWhenNode*)pNode;
+ destroyExprNode((SExprNode*)pNode);
nodesDestroyNode(pCaseWhen->pCase);
nodesDestroyNode(pCaseWhen->pElse);
nodesDestroyList(pCaseWhen->pWhenThenList);
diff --git a/source/libs/parser/inc/parInsertUtil.h b/source/libs/parser/inc/parInsertUtil.h
index 1988620539..4f2877fcf6 100644
--- a/source/libs/parser/inc/parInsertUtil.h
+++ b/source/libs/parser/inc/parInsertUtil.h
@@ -51,7 +51,8 @@ int32_t insGetTableDataCxt(SHashObj *pHash, void *id, int32_t idLen, STableMeta
SVCreateTbReq **pCreateTbReq, STableDataCxt **pTableCxt, bool colMode, bool ignoreColVals);
int32_t initTableColSubmitData(STableDataCxt *pTableCxt);
int32_t insMergeTableDataCxt(SHashObj *pTableHash, SArray **pVgDataBlocks, bool isRebuild);
-int32_t insBuildVgDataBlocks(SHashObj *pVgroupsHashObj, SArray *pVgDataBlocks, SArray **pDataBlocks);
+//int32_t insMergeStmtTableDataCxt(STableDataCxt* pTableCxt, SArray* pTableList, SArray** pVgDataBlocks, bool isRebuild, int32_t tbNum);
+int32_t insBuildVgDataBlocks(SHashObj *pVgroupsHashObj, SArray *pVgDataBlocks, SArray **pDataBlocks, bool append);
void insDestroyTableDataCxtHashMap(SHashObj *pTableCxtHash);
void insDestroyVgroupDataCxt(SVgroupDataCxt *pVgCxt);
void insDestroyVgroupDataCxtList(SArray *pVgCxtList);
diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y
index a5efdbdf91..170d51b1bf 100644
--- a/source/libs/parser/inc/sql.y
+++ b/source/libs/parser/inc/sql.y
@@ -104,6 +104,7 @@ cmd ::= CREATE USER user_name(A) PASS NK_STRING(B) sysinfo_opt(C)
cmd ::= ALTER USER user_name(A) PASS NK_STRING(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_PASSWD, &B); }
cmd ::= ALTER USER user_name(A) ENABLE NK_INTEGER(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_ENABLE, &B); }
cmd ::= ALTER USER user_name(A) SYSINFO NK_INTEGER(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_SYSINFO, &B); }
+cmd ::= ALTER USER user_name(A) CREATEDB NK_INTEGER(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_CREATEDB, &B); }
cmd ::= ALTER USER user_name(A) ADD white_list(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_ADD_WHITE_LIST, B); }
cmd ::= ALTER USER user_name(A) DROP white_list(B). { pCxt->pRootNode = createAlterUserStmt(pCxt, &A, TSDB_ALTER_USER_DROP_WHITE_LIST, B); }
cmd ::= DROP USER user_name(A). { pCxt->pRootNode = createDropUserStmt(pCxt, &A); }
diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c
index 0e31672b24..64d1260719 100644
--- a/source/libs/parser/src/parAstCreater.c
+++ b/source/libs/parser/src/parAstCreater.c
@@ -2294,6 +2294,11 @@ SNode* createAlterUserStmt(SAstCreateContext* pCxt, SToken* pUserName, int8_t al
pStmt->sysinfo = taosStr2Int8(pVal->z, NULL, 10);
break;
}
+ case TSDB_ALTER_USER_CREATEDB: {
+ SToken* pVal = pAlterInfo;
+ pStmt->createdb = taosStr2Int8(pVal->z, NULL, 10);
+ break;
+ }
case TSDB_ALTER_USER_ADD_WHITE_LIST:
case TSDB_ALTER_USER_DROP_WHITE_LIST: {
SNodeList* pIpRangesNodeList = pAlterInfo;
diff --git a/source/libs/parser/src/parInsertSml.c b/source/libs/parser/src/parInsertSml.c
index fcb5588717..db2d34b844 100644
--- a/source/libs/parser/src/parInsertSml.c
+++ b/source/libs/parser/src/parInsertSml.c
@@ -446,7 +446,7 @@ int32_t smlBuildOutput(SQuery* handle, SHashObj* pVgHash) {
uError("insMergeTableDataCxt failed");
return code;
}
- code = insBuildVgDataBlocks(pVgHash, pStmt->pVgDataBlocks, &pStmt->pDataBlocks);
+ code = insBuildVgDataBlocks(pVgHash, pStmt->pVgDataBlocks, &pStmt->pDataBlocks, false);
if (code != TSDB_CODE_SUCCESS) {
uError("insBuildVgDataBlocks failed");
return code;
diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c
index 22f274b21c..53b9805267 100644
--- a/source/libs/parser/src/parInsertSql.c
+++ b/source/libs/parser/src/parInsertSql.c
@@ -2474,7 +2474,7 @@ static int32_t parseInsertBodyBottom(SInsertParseContext* pCxt, SVnodeModifyOpSt
taosHashClear(pStmt->pTableCxtHashObj);
if (TSDB_CODE_SUCCESS == code) {
- code = insBuildVgDataBlocks(pStmt->pVgroupsHashObj, pStmt->pVgDataBlocks, &pStmt->pDataBlocks);
+ code = insBuildVgDataBlocks(pStmt->pVgroupsHashObj, pStmt->pVgDataBlocks, &pStmt->pDataBlocks, false);
}
return code;
@@ -2523,9 +2523,14 @@ static int32_t createVnodeModifOpStmt(SInsertParseContext* pCxt, bool reentry, S
pStmt->freeStbRowsCxtFunc = destroyStbRowsDataContext;
if (!reentry) {
- pStmt->pVgroupsHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK);
- pStmt->pTableBlockHashObj =
- taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
+ pStmt->pVgroupsHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
+ if (pCxt->pComCxt->pStmtCb) {
+ pStmt->pTableBlockHashObj =
+ taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
+ } else {
+ pStmt->pTableBlockHashObj =
+ taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_NO_LOCK);
+ }
}
pStmt->pSubTableHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK);
pStmt->pTableNameHashObj = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_VARCHAR), true, HASH_NO_LOCK);
diff --git a/source/libs/parser/src/parInsertStmt.c b/source/libs/parser/src/parInsertStmt.c
index bdeb548bd7..648a119712 100644
--- a/source/libs/parser/src/parInsertStmt.c
+++ b/source/libs/parser/src/parInsertStmt.c
@@ -51,6 +51,48 @@ int32_t qCloneCurrentTbData(STableDataCxt* pDataBlock, SSubmitTbData** pData) {
return TSDB_CODE_SUCCESS;
}
+int32_t qAppendStmtTableOutput(SQuery* pQuery, SHashObj* pAllVgHash, STableColsData* pTbData, STableDataCxt* pTbCtx, SStbInterlaceInfo* pBuildInfo) {
+ // merge according to vgId
+ return insAppendStmtTableDataCxt(pAllVgHash, pTbData, pTbCtx, pBuildInfo);
+}
+
+int32_t qBuildStmtFinOutput(SQuery* pQuery, SHashObj* pAllVgHash, SArray* pVgDataBlocks) {
+ int32_t code = TSDB_CODE_SUCCESS;
+ SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot;
+
+ if (TSDB_CODE_SUCCESS == code) {
+ code = insBuildVgDataBlocks(pAllVgHash, pVgDataBlocks, &pStmt->pDataBlocks, true);
+ }
+
+ if (pStmt->freeArrayFunc) {
+ pStmt->freeArrayFunc(pVgDataBlocks);
+ }
+ return code;
+}
+
+
+/*
+int32_t qBuildStmtOutputFromTbList(SQuery* pQuery, SHashObj* pVgHash, SArray* pBlockList, STableDataCxt* pTbCtx, int32_t tbNum) {
+ int32_t code = TSDB_CODE_SUCCESS;
+ SArray* pVgDataBlocks = NULL;
+ SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot;
+
+ // merge according to vgId
+ if (tbNum > 0) {
+ code = insMergeStmtTableDataCxt(pTbCtx, pBlockList, &pVgDataBlocks, true, tbNum);
+ }
+
+ if (TSDB_CODE_SUCCESS == code) {
+ code = insBuildVgDataBlocks(pVgHash, pVgDataBlocks, &pStmt->pDataBlocks);
+ }
+
+ if (pStmt->freeArrayFunc) {
+ pStmt->freeArrayFunc(pVgDataBlocks);
+ }
+ return code;
+}
+*/
+
int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash) {
int32_t code = TSDB_CODE_SUCCESS;
SArray* pVgDataBlocks = NULL;
@@ -60,8 +102,9 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash
if (taosHashGetSize(pBlockHash) > 0) {
code = insMergeTableDataCxt(pBlockHash, &pVgDataBlocks, true);
}
+
if (TSDB_CODE_SUCCESS == code) {
- code = insBuildVgDataBlocks(pVgHash, pVgDataBlocks, &pStmt->pDataBlocks);
+ code = insBuildVgDataBlocks(pVgHash, pVgDataBlocks, &pStmt->pDataBlocks, false);
}
if (pStmt->freeArrayFunc) {
@@ -233,7 +276,74 @@ int32_t convertStmtNcharCol(SMsgBuf* pMsgBuf, SSchema* pSchema, TAOS_MULTI_BIND*
return TSDB_CODE_SUCCESS;
}
-int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen) {
+int32_t qBindStmtStbColsValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, STSchema** pTSchema, SBindInfo* pBindInfos) {
+ STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
+ SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
+ SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo;
+ SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen};
+ int32_t rowNum = bind->num;
+ TAOS_MULTI_BIND ncharBind = {0};
+ TAOS_MULTI_BIND* pBind = NULL;
+ int32_t code = 0;
+ int16_t lastColId = -1;
+ bool colInOrder = true;
+
+ if (NULL == *pTSchema) {
+ *pTSchema = tBuildTSchema(pSchema, pDataBlock->pMeta->tableInfo.numOfColumns, pDataBlock->pMeta->sversion);
+ }
+
+ for (int c = 0; c < boundInfo->numOfBound; ++c) {
+ SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]];
+ if (pColSchema->colId <= lastColId) {
+ colInOrder = false;
+ } else {
+ lastColId = pColSchema->colId;
+ }
+ //SColData* pCol = taosArrayGet(pCols, c);
+
+ if (bind[c].num != rowNum) {
+ code = buildInvalidOperationMsg(&pBuf, "row number in each bind param should be the same");
+ goto _return;
+ }
+
+ if ((!(rowNum == 1 && bind[c].is_null && *bind[c].is_null)) && bind[c].buffer_type != pColSchema->type) { // for rowNum ==1 , connector may not set buffer_type
+ code = buildInvalidOperationMsg(&pBuf, "column type mis-match with buffer type");
+ goto _return;
+ }
+
+ if (TSDB_DATA_TYPE_NCHAR == pColSchema->type) {
+ code = convertStmtNcharCol(&pBuf, pColSchema, bind + c, &ncharBind);
+ if (code) {
+ goto _return;
+ }
+ pBind = &ncharBind;
+ } else {
+ pBind = bind + c;
+ }
+
+ pBindInfos[c].columnId = pColSchema->colId;
+ pBindInfos[c].bind = pBind;
+ pBindInfos[c].type = pColSchema->type;
+
+ //code = tColDataAddValueByBind(pCol, pBind, IS_VAR_DATA_TYPE(pColSchema->type) ? pColSchema->bytes - VARSTR_HEADER_SIZE: -1);
+ //if (code) {
+ // goto _return;
+ //}
+ }
+
+ code = tRowBuildFromBind(pBindInfos, boundInfo->numOfBound, colInOrder, *pTSchema, pCols);
+
+ qDebug("stmt all %d columns bind %d rows data", boundInfo->numOfBound, rowNum);
+
+_return:
+
+ taosMemoryFree(ncharBind.buffer);
+ taosMemoryFree(ncharBind.length);
+
+ return code;
+}
+
+int32_t qBindStmtColsValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen) {
STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo;
@@ -245,7 +355,7 @@ int32_t qBindStmtColsValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, in
for (int c = 0; c < boundInfo->numOfBound; ++c) {
SSchema* pColSchema = &pSchema[boundInfo->pColIndex[c]];
- SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, c);
+ SColData* pCol = taosArrayGet(pCols, c);
if (bind[c].num != rowNum) {
code = buildInvalidOperationMsg(&pBuf, "row number in each bind param should be the same");
@@ -283,14 +393,15 @@ _return:
return code;
}
-int32_t qBindStmtSingleColValue(void* pBlock, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, int32_t colIdx,
+
+int32_t qBindStmtSingleColValue(void* pBlock, SArray* pCols, TAOS_MULTI_BIND* bind, char* msgBuf, int32_t msgBufLen, int32_t colIdx,
int32_t rowNum) {
STableDataCxt* pDataBlock = (STableDataCxt*)pBlock;
SSchema* pSchema = getTableColumnSchema(pDataBlock->pMeta);
SBoundColInfo* boundInfo = &pDataBlock->boundColsInfo;
SMsgBuf pBuf = {.buf = msgBuf, .len = msgBufLen};
SSchema* pColSchema = &pSchema[boundInfo->pColIndex[colIdx]];
- SColData* pCol = taosArrayGet(pDataBlock->pData->aCol, colIdx);
+ SColData* pCol = taosArrayGet(pCols, colIdx);
TAOS_MULTI_BIND ncharBind = {0};
TAOS_MULTI_BIND* pBind = NULL;
int32_t code = 0;
@@ -393,6 +504,22 @@ int32_t qBuildStmtColFields(void* pBlock, int32_t* fieldNum, TAOS_FIELD_E** fiel
return TSDB_CODE_SUCCESS;
}
+int32_t qResetStmtColumns(SArray* pCols, bool deepClear) {
+ int32_t colNum = taosArrayGetSize(pCols);
+
+ for (int32_t i = 0; i < colNum; ++i) {
+ SColData* pCol = (SColData*)taosArrayGet(pCols, i);
+ if (deepClear) {
+ tColDataDeepClear(pCol);
+ } else {
+ tColDataClear(pCol);
+ }
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
+
int32_t qResetStmtDataBlock(STableDataCxt* block, bool deepClear) {
STableDataCxt* pBlock = (STableDataCxt*)block;
int32_t colNum = taosArrayGetSize(pBlock->pData->aCol);
diff --git a/source/libs/parser/src/parInsertUtil.c b/source/libs/parser/src/parInsertUtil.c
index 7c43113ad2..028866064d 100644
--- a/source/libs/parser/src/parInsertUtil.c
+++ b/source/libs/parser/src/parInsertUtil.c
@@ -21,6 +21,7 @@
#include "querynodes.h"
#include "tRealloc.h"
#include "tdatablock.h"
+#include "tmisce.h"
void qDestroyBoundColInfo(void* pInfo) {
if (NULL == pInfo) {
@@ -429,7 +430,7 @@ void insDestroyTableDataCxtHashMap(SHashObj* pTableCxtHash) {
taosHashCleanup(pTableCxtHash);
}
-static int32_t fillVgroupDataCxt(STableDataCxt* pTableCxt, SVgroupDataCxt* pVgCxt, bool isRebuild) {
+static int32_t fillVgroupDataCxt(STableDataCxt* pTableCxt, SVgroupDataCxt* pVgCxt, bool isRebuild, bool clear) {
if (NULL == pVgCxt->pData->aSubmitTbData) {
pVgCxt->pData->aSubmitTbData = taosArrayInit(128, sizeof(SSubmitTbData));
if (NULL == pVgCxt->pData->aSubmitTbData) {
@@ -441,7 +442,7 @@ static int32_t fillVgroupDataCxt(STableDataCxt* pTableCxt, SVgroupDataCxt* pVgCx
taosArrayPush(pVgCxt->pData->aSubmitTbData, pTableCxt->pData);
if (isRebuild) {
rebuildTableData(pTableCxt->pData, &pTableCxt->pData);
- } else {
+ } else if (clear) {
taosMemoryFreeClear(pTableCxt->pData);
}
@@ -486,6 +487,203 @@ int insColDataComp(const void* lp, const void* rp) {
return 0;
}
+
+int32_t insTryAddTableVgroupInfo(SHashObj* pAllVgHash, SStbInterlaceInfo* pBuildInfo, int32_t* vgId, STableColsData* pTbData, SName* sname) {
+ if (*vgId >= 0 && taosHashGet(pAllVgHash, (const char*)vgId, sizeof(*vgId))) {
+ return TSDB_CODE_SUCCESS;
+ }
+
+ SVgroupInfo vgInfo = {0};
+ SRequestConnInfo conn = {.pTrans = pBuildInfo->transport,
+ .requestId = pBuildInfo->requestId,
+ .requestObjRefId = pBuildInfo->requestSelf,
+ .mgmtEps = pBuildInfo->mgmtEpSet};
+
+ int32_t code = catalogGetTableHashVgroup((SCatalog*)pBuildInfo->pCatalog, &conn, sname, &vgInfo);
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ code = taosHashPut(pAllVgHash, (const char*)&vgInfo.vgId, sizeof(vgInfo.vgId), (char*)&vgInfo, sizeof(vgInfo));
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ return TSDB_CODE_SUCCESS;
+}
+
+
+int32_t insGetStmtTableVgUid(SHashObj* pAllVgHash, SStbInterlaceInfo* pBuildInfo, STableColsData* pTbData, uint64_t* uid, int32_t* vgId) {
+ STableVgUid* pTbInfo = NULL;
+ int32_t code = 0;
+
+ if (pTbData->getFromHash) {
+ pTbInfo = (STableVgUid*)tSimpleHashGet(pBuildInfo->pTableHash, pTbData->tbName, strlen(pTbData->tbName));
+ }
+
+ if (NULL == pTbInfo) {
+ SName sname;
+ qCreateSName(&sname, pTbData->tbName, pBuildInfo->acctId, pBuildInfo->dbname, NULL, 0);
+
+ STableMeta* pTableMeta = NULL;
+ SRequestConnInfo conn = {.pTrans = pBuildInfo->transport,
+ .requestId = pBuildInfo->requestId,
+ .requestObjRefId = pBuildInfo->requestSelf,
+ .mgmtEps = pBuildInfo->mgmtEpSet};
+ code = catalogGetTableMeta((SCatalog*)pBuildInfo->pCatalog, &conn, &sname, &pTableMeta);
+
+ if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code) {
+ parserDebug("tb %s.%s not exist", sname.dbname, sname.tname);
+ return code;
+ }
+
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ *uid = pTableMeta->uid;
+ *vgId = pTableMeta->vgId;
+
+ STableVgUid tbInfo = {.uid = *uid, .vgid = *vgId};
+ tSimpleHashPut(pBuildInfo->pTableHash, pTbData->tbName, strlen(pTbData->tbName), &tbInfo, sizeof(tbInfo));
+
+ code = insTryAddTableVgroupInfo(pAllVgHash, pBuildInfo, vgId, pTbData, &sname);
+
+ taosMemoryFree(pTableMeta);
+ } else {
+ *uid = pTbInfo->uid;
+ *vgId = pTbInfo->vgid;
+ }
+
+ return code;
+}
+
+
+int32_t qBuildStmtFinOutput1(SQuery* pQuery, SHashObj* pAllVgHash, SArray* pVgDataBlocks) {
+ int32_t code = TSDB_CODE_SUCCESS;
+ SVnodeModifyOpStmt* pStmt = (SVnodeModifyOpStmt*)pQuery->pRoot;
+
+ if (TSDB_CODE_SUCCESS == code) {
+ code = insBuildVgDataBlocks(pAllVgHash, pVgDataBlocks, &pStmt->pDataBlocks, true);
+ }
+
+ return code;
+}
+
+
+
+int32_t insAppendStmtTableDataCxt(SHashObj* pAllVgHash, STableColsData* pTbData, STableDataCxt* pTbCtx, SStbInterlaceInfo* pBuildInfo) {
+ int32_t code = TSDB_CODE_SUCCESS;
+ uint64_t uid;
+ int32_t vgId;
+
+ pTbCtx->pData->aRowP = pTbData->aCol;
+
+ code = insGetStmtTableVgUid(pAllVgHash, pBuildInfo, pTbData, &uid, &vgId);
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ pTbCtx->pMeta->vgId = vgId;
+ pTbCtx->pMeta->uid = uid;
+ pTbCtx->pData->uid = uid;
+
+ if (!pTbCtx->ordered) {
+ code = tRowSort(pTbCtx->pData->aRowP);
+ }
+ if (code == TSDB_CODE_SUCCESS && (!pTbCtx->ordered || pTbCtx->duplicateTs)) {
+ code = tRowMerge(pTbCtx->pData->aRowP, pTbCtx->pSchema, 0);
+ }
+
+ if (TSDB_CODE_SUCCESS != code) {
+ return code;
+ }
+
+ SVgroupDataCxt* pVgCxt = NULL;
+ void** pp = taosHashGet(pBuildInfo->pVgroupHash, &vgId, sizeof(vgId));
+ if (NULL == pp) {
+ pp = taosHashGet(pBuildInfo->pVgroupHash, &vgId, sizeof(vgId));
+ if (NULL == pp) {
+ code = createVgroupDataCxt(pTbCtx, pBuildInfo->pVgroupHash, pBuildInfo->pVgroupList, &pVgCxt);
+ } else {
+ pVgCxt = *(SVgroupDataCxt**)pp;
+ }
+ } else {
+ pVgCxt = *(SVgroupDataCxt**)pp;
+ }
+
+ if (TSDB_CODE_SUCCESS == code) {
+ code = fillVgroupDataCxt(pTbCtx, pVgCxt, false, false);
+ }
+
+ if (taosArrayGetSize(pVgCxt->pData->aSubmitTbData) >= 20000) {
+ code = qBuildStmtFinOutput1((SQuery*)pBuildInfo->pQuery, pAllVgHash, pBuildInfo->pVgroupList);
+ //taosArrayClear(pVgCxt->pData->aSubmitTbData);
+ tDestroySubmitReq(pVgCxt->pData, TSDB_MSG_FLG_ENCODE);
+ //insDestroyVgroupDataCxt(pVgCxt);
+ }
+
+ return code;
+}
+
+/*
+int32_t insMergeStmtTableDataCxt(STableDataCxt* pTableCxt, SArray* pTableList, SArray** pVgDataBlocks, bool isRebuild, int32_t tbNum) {
+ SHashObj* pVgroupHash = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, false);
+ SArray* pVgroupList = taosArrayInit(8, POINTER_BYTES);
+ if (NULL == pVgroupHash || NULL == pVgroupList) {
+ taosHashCleanup(pVgroupHash);
+ taosArrayDestroy(pVgroupList);
+ return TSDB_CODE_OUT_OF_MEMORY;
+ }
+
+ int32_t code = TSDB_CODE_SUCCESS;
+
+ for (int32_t i = 0; i < tbNum; ++i) {
+ STableColsData *pTableCols = (STableColsData*)taosArrayGet(pTableList, i);
+ pTableCxt->pMeta->vgId = pTableCols->vgId;
+ pTableCxt->pMeta->uid = pTableCols->uid;
+ pTableCxt->pData->uid = pTableCols->uid;
+ pTableCxt->pData->aCol = pTableCols->aCol;
+
+ SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, 0);
+ if (pCol->nVal <= 0) {
+ continue;
+ }
+
+ if (pTableCxt->pData->pCreateTbReq) {
+ pTableCxt->pData->flags |= SUBMIT_REQ_AUTO_CREATE_TABLE;
+ }
+
+ taosArraySort(pTableCxt->pData->aCol, insColDataComp);
+
+ tColDataSortMerge(pTableCxt->pData->aCol);
+
+ if (TSDB_CODE_SUCCESS == code) {
+ SVgroupDataCxt* pVgCxt = NULL;
+ int32_t vgId = pTableCxt->pMeta->vgId;
+ void** pp = taosHashGet(pVgroupHash, &vgId, sizeof(vgId));
+ if (NULL == pp) {
+ code = createVgroupDataCxt(pTableCxt, pVgroupHash, pVgroupList, &pVgCxt);
+ } else {
+ pVgCxt = *(SVgroupDataCxt**)pp;
+ }
+ if (TSDB_CODE_SUCCESS == code) {
+ code = fillVgroupDataCxt(pTableCxt, pVgCxt, false, false);
+ }
+ }
+ }
+
+ taosHashCleanup(pVgroupHash);
+ if (TSDB_CODE_SUCCESS == code) {
+ *pVgDataBlocks = pVgroupList;
+ } else {
+ insDestroyVgroupDataCxtList(pVgroupList);
+ }
+
+ return code;
+}
+*/
+
int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks, bool isRebuild) {
SHashObj* pVgroupHash = taosHashInit(128, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, false);
SArray* pVgroupList = taosArrayInit(8, POINTER_BYTES);
@@ -546,7 +744,7 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks, bool
pVgCxt = *(SVgroupDataCxt**)pp;
}
if (TSDB_CODE_SUCCESS == code) {
- code = fillVgroupDataCxt(pTableCxt, pVgCxt, isRebuild);
+ code = fillVgroupDataCxt(pTableCxt, pVgCxt, isRebuild, true);
}
}
if (TSDB_CODE_SUCCESS == code) {
@@ -599,9 +797,9 @@ static void destroyVgDataBlocks(void* p) {
taosMemoryFree(pVg);
}
-int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, SArray** pVgDataBlocks) {
+int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, SArray** pVgDataBlocks, bool append) {
size_t numOfVg = taosArrayGetSize(pVgDataCxtList);
- SArray* pDataBlocks = taosArrayInit(numOfVg, POINTER_BYTES);
+ SArray* pDataBlocks = (append && *pVgDataBlocks) ? *pVgDataBlocks : taosArrayInit(numOfVg, POINTER_BYTES);
if (NULL == pDataBlocks) {
return TSDB_CODE_OUT_OF_MEMORY;
}
@@ -609,6 +807,9 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
int32_t code = TSDB_CODE_SUCCESS;
for (size_t i = 0; TSDB_CODE_SUCCESS == code && i < numOfVg; ++i) {
SVgroupDataCxt* src = taosArrayGetP(pVgDataCxtList, i);
+ if (taosArrayGetSize(src->pData->aSubmitTbData) <= 0) {
+ continue;
+ }
SVgDataBlocks* dst = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
if (NULL == dst) {
code = TSDB_CODE_OUT_OF_MEMORY;
@@ -626,6 +827,13 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
}
}
+ if (append) {
+ if (NULL == *pVgDataBlocks) {
+ *pVgDataBlocks = pDataBlocks;
+ }
+ return code;
+ }
+
if (TSDB_CODE_SUCCESS == code) {
*pVgDataBlocks = pDataBlocks;
} else {
diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c
index 2d549a4180..326ec092a9 100644
--- a/source/libs/parser/src/parTokenizer.c
+++ b/source/libs/parser/src/parTokenizer.c
@@ -77,6 +77,7 @@ static SKeyword keywordTable[] = {
{"COUNT", TK_COUNT},
{"COUNT_WINDOW", TK_COUNT_WINDOW},
{"CREATE", TK_CREATE},
+ {"CREATEDB", TK_CREATEDB},
{"CURRENT_USER", TK_CURRENT_USER},
{"DATABASE", TK_DATABASE},
{"DATABASES", TK_DATABASES},
diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c
index 58a158bd97..0a4e5aebe4 100644
--- a/source/libs/parser/src/parTranslater.c
+++ b/source/libs/parser/src/parTranslater.c
@@ -3217,6 +3217,27 @@ static bool fromSingleTable(SNode* table) {
return false;
}
+static bool IsEqualTbNameFuncNode(SSelectStmt* pSelect, SNode* pFunc1, SNode* pFunc2) {
+ if (isTbnameFuction(pFunc1) && isTbnameFuction(pFunc2)) {
+ SValueNode* pVal1 = (SValueNode*)nodesListGetNode(((SFunctionNode*)pFunc1)->pParameterList, 0);
+ SValueNode* pVal2 = (SValueNode*)nodesListGetNode(((SFunctionNode*)pFunc1)->pParameterList, 0);
+ if (!pVal1 && !pVal2) {
+ return true;
+ } else if (pVal1 && pVal2) {
+ return strcmp(pVal1->literal, pVal2->literal) == 0;
+ }
+
+ if (pSelect->pFromTable &&
+ (pSelect->pFromTable->type == QUERY_NODE_REAL_TABLE || pSelect->pFromTable->type == QUERY_NODE_TEMP_TABLE)) {
+ STableNode* pTable = (STableNode*)pSelect->pFromTable;
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return false;
+}
+
static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) {
STranslateContext* pCxt = (STranslateContext*)pContext;
SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt;
@@ -3236,6 +3257,9 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) {
((SColumnNode*)*pNode)->colType == COLUMN_TYPE_TAG) {
return rewriteExprToGroupKeyFunc(pCxt, pNode);
}
+ if (IsEqualTbNameFuncNode(pSelect, pActualNode, *pNode)) {
+ return rewriteExprToGroupKeyFunc(pCxt, pNode);
+ }
}
SNode* pPartKey = NULL;
bool partionByTbname = hasTbnameFunction(pSelect->pPartitionByList);
@@ -3247,6 +3271,9 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) {
((SColumnNode*)*pNode)->colType == COLUMN_TYPE_TAG) {
return rewriteExprToGroupKeyFunc(pCxt, pNode);
}
+ if (IsEqualTbNameFuncNode(pSelect, pPartKey, *pNode)) {
+ return rewriteExprToGroupKeyFunc(pCxt, pNode);
+ }
}
if (NULL != pSelect->pWindow && QUERY_NODE_STATE_WINDOW == nodeType(pSelect->pWindow)) {
if (nodesEqualNode(((SStateWindowNode*)pSelect->pWindow)->pExpr, *pNode)) {
@@ -6592,23 +6619,23 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
}
static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int64_t val, int64_t minVal,
- int64_t maxVal) {
- if (val >= 0 && (val < minVal || val > maxVal)) {
+ int64_t maxVal, bool skipUndef) {
+ if (skipUndef ? ((val >= 0) && (val < minVal || val > maxVal)) : (val < minVal || val > maxVal)) {
return generateSyntaxErrMsgExt(&pCxt->msgBuf, code,
- "Invalid option %s: %" PRId64 " valid range: [%" PRId64 ", %" PRId64 "]", pName, val,
- minVal, maxVal);
+ "Invalid option %s: %" PRId64 ", valid range: [%" PRId64 ", %" PRId64 "]", pName,
+ val, minVal, maxVal);
}
return TSDB_CODE_SUCCESS;
}
static int32_t checkDbRangeOption(STranslateContext* pCxt, const char* pName, int32_t val, int32_t minVal,
int32_t maxVal) {
- return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal);
+ return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal, true);
}
static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int64_t val, int64_t minVal,
int64_t maxVal) {
- return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal);
+ return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_TABLE_OPTION, pName, val, minVal, maxVal, true);
}
static int32_t checkDbS3KeepLocalOption(STranslateContext* pCxt, SDatabaseOptions* pOptions) {
@@ -8470,7 +8497,11 @@ static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* p
}
static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pStmt) {
+ int32_t code = 0;
SCreateUserReq createReq = {0};
+ if ((code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1, false))) {
+ return code;
+ }
strcpy(createReq.user, pStmt->userName);
createReq.createType = 0;
createReq.superUser = 0;
@@ -8483,18 +8514,39 @@ static int32_t translateCreateUser(STranslateContext* pCxt, SCreateUserStmt* pSt
createReq.pIpRanges = taosMemoryMalloc(createReq.numIpRanges * sizeof(SIpV4Range));
memcpy(createReq.pIpRanges, pStmt->pIpRanges, sizeof(SIpV4Range) * createReq.numIpRanges);
}
- int32_t code = buildCmdMsg(pCxt, TDMT_MND_CREATE_USER, (FSerializeFunc)tSerializeSCreateUserReq, &createReq);
+ code = buildCmdMsg(pCxt, TDMT_MND_CREATE_USER, (FSerializeFunc)tSerializeSCreateUserReq, &createReq);
tFreeSCreateUserReq(&createReq);
return code;
}
+static int32_t checkAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt) {
+ int32_t code = 0;
+ switch (pStmt->alterType) {
+ case TSDB_ALTER_USER_ENABLE:
+ code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "enable", pStmt->enable, 0, 1, false);
+ break;
+ case TSDB_ALTER_USER_SYSINFO:
+ code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "sysinfo", pStmt->sysinfo, 0, 1, false);
+ break;
+ case TSDB_ALTER_USER_CREATEDB:
+ code = checkRangeOption(pCxt, TSDB_CODE_INVALID_OPTION, "createdb", pStmt->createdb, 0, 1, false);
+ break;
+ }
+ return code;
+}
+
static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt) {
+ int32_t code = 0;
SAlterUserReq alterReq = {0};
+ if ((code = checkAlterUser(pCxt, pStmt))) {
+ return code;
+ }
strcpy(alterReq.user, pStmt->userName);
alterReq.alterType = pStmt->alterType;
alterReq.superUser = 0;
alterReq.enable = pStmt->enable;
alterReq.sysInfo = pStmt->sysinfo;
+ alterReq.createdb = pStmt->createdb ? 1 : 0;
snprintf(alterReq.pass, sizeof(alterReq.pass), "%s", pStmt->password);
if (NULL != pCxt->pParseCxt->db) {
snprintf(alterReq.objname, sizeof(alterReq.objname), "%s", pCxt->pParseCxt->db);
@@ -8505,7 +8557,7 @@ static int32_t translateAlterUser(STranslateContext* pCxt, SAlterUserStmt* pStmt
alterReq.pIpRanges = taosMemoryMalloc(alterReq.numIpRanges * sizeof(SIpV4Range));
memcpy(alterReq.pIpRanges, pStmt->pIpRanges, sizeof(SIpV4Range) * alterReq.numIpRanges);
}
- int32_t code = buildCmdMsg(pCxt, TDMT_MND_ALTER_USER, (FSerializeFunc)tSerializeSAlterUserReq, &alterReq);
+ code = buildCmdMsg(pCxt, TDMT_MND_ALTER_USER, (FSerializeFunc)tSerializeSAlterUserReq, &alterReq);
tFreeSAlterUserReq(&alterReq);
return code;
}
diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c
index 226696532b..bc409dd6cf 100644
--- a/source/libs/parser/src/sql.c
+++ b/source/libs/parser/src/sql.c
@@ -1,5 +1,3 @@
-/* This file is automatically generated by Lemon from input grammar
-** source file "sql.y". */
/*
** 2000-05-29
**
@@ -24,8 +22,9 @@
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
+#include
+#include
/************ Begin %include sections from the grammar ************************/
-#line 11 "sql.y"
#include
#include
@@ -42,388 +41,12 @@
#include "parAst.h"
#define YYSTACKDEPTH 0
-#line 46 "sql.c"
/**************** End of %include directives **********************************/
-/* These constants specify the various numeric values for terminal symbols.
-***************** Begin token definitions *************************************/
-#ifndef TK_OR
-#define TK_OR 1
-#define TK_AND 2
-#define TK_UNION 3
-#define TK_ALL 4
-#define TK_MINUS 5
-#define TK_EXCEPT 6
-#define TK_INTERSECT 7
-#define TK_NK_BITAND 8
-#define TK_NK_BITOR 9
-#define TK_NK_LSHIFT 10
-#define TK_NK_RSHIFT 11
-#define TK_NK_PLUS 12
-#define TK_NK_MINUS 13
-#define TK_NK_STAR 14
-#define TK_NK_SLASH 15
-#define TK_NK_REM 16
-#define TK_NK_CONCAT 17
-#define TK_CREATE 18
-#define TK_ACCOUNT 19
-#define TK_NK_ID 20
-#define TK_PASS 21
-#define TK_NK_STRING 22
-#define TK_ALTER 23
-#define TK_PPS 24
-#define TK_TSERIES 25
-#define TK_STORAGE 26
-#define TK_STREAMS 27
-#define TK_QTIME 28
-#define TK_DBS 29
-#define TK_USERS 30
-#define TK_CONNS 31
-#define TK_STATE 32
-#define TK_NK_COMMA 33
-#define TK_HOST 34
-#define TK_USER 35
-#define TK_ENABLE 36
-#define TK_NK_INTEGER 37
-#define TK_SYSINFO 38
-#define TK_ADD 39
-#define TK_DROP 40
-#define TK_GRANT 41
-#define TK_ON 42
-#define TK_TO 43
-#define TK_REVOKE 44
-#define TK_FROM 45
-#define TK_SUBSCRIBE 46
-#define TK_READ 47
-#define TK_WRITE 48
-#define TK_NK_DOT 49
-#define TK_WITH 50
-#define TK_ENCRYPT_KEY 51
-#define TK_DNODE 52
-#define TK_PORT 53
-#define TK_DNODES 54
-#define TK_RESTORE 55
-#define TK_NK_IPTOKEN 56
-#define TK_FORCE 57
-#define TK_UNSAFE 58
-#define TK_CLUSTER 59
-#define TK_LOCAL 60
-#define TK_QNODE 61
-#define TK_BNODE 62
-#define TK_SNODE 63
-#define TK_MNODE 64
-#define TK_VNODE 65
-#define TK_DATABASE 66
-#define TK_USE 67
-#define TK_FLUSH 68
-#define TK_TRIM 69
-#define TK_S3MIGRATE 70
-#define TK_COMPACT 71
-#define TK_IF 72
-#define TK_NOT 73
-#define TK_EXISTS 74
-#define TK_BUFFER 75
-#define TK_CACHEMODEL 76
-#define TK_CACHESIZE 77
-#define TK_COMP 78
-#define TK_DURATION 79
-#define TK_NK_VARIABLE 80
-#define TK_MAXROWS 81
-#define TK_MINROWS 82
-#define TK_KEEP 83
-#define TK_PAGES 84
-#define TK_PAGESIZE 85
-#define TK_TSDB_PAGESIZE 86
-#define TK_PRECISION 87
-#define TK_REPLICA 88
-#define TK_VGROUPS 89
-#define TK_SINGLE_STABLE 90
-#define TK_RETENTIONS 91
-#define TK_SCHEMALESS 92
-#define TK_WAL_LEVEL 93
-#define TK_WAL_FSYNC_PERIOD 94
-#define TK_WAL_RETENTION_PERIOD 95
-#define TK_WAL_RETENTION_SIZE 96
-#define TK_WAL_ROLL_PERIOD 97
-#define TK_WAL_SEGMENT_SIZE 98
-#define TK_STT_TRIGGER 99
-#define TK_TABLE_PREFIX 100
-#define TK_TABLE_SUFFIX 101
-#define TK_S3_CHUNKSIZE 102
-#define TK_S3_KEEPLOCAL 103
-#define TK_S3_COMPACT 104
-#define TK_KEEP_TIME_OFFSET 105
-#define TK_ENCRYPT_ALGORITHM 106
-#define TK_NK_COLON 107
-#define TK_BWLIMIT 108
-#define TK_START 109
-#define TK_TIMESTAMP 110
-#define TK_END 111
-#define TK_TABLE 112
-#define TK_NK_LP 113
-#define TK_NK_RP 114
-#define TK_STABLE 115
-#define TK_COLUMN 116
-#define TK_MODIFY 117
-#define TK_RENAME 118
-#define TK_TAG 119
-#define TK_SET 120
-#define TK_NK_EQ 121
-#define TK_USING 122
-#define TK_TAGS 123
-#define TK_BOOL 124
-#define TK_TINYINT 125
-#define TK_SMALLINT 126
-#define TK_INT 127
-#define TK_INTEGER 128
-#define TK_BIGINT 129
-#define TK_FLOAT 130
-#define TK_DOUBLE 131
-#define TK_BINARY 132
-#define TK_NCHAR 133
-#define TK_UNSIGNED 134
-#define TK_JSON 135
-#define TK_VARCHAR 136
-#define TK_MEDIUMBLOB 137
-#define TK_BLOB 138
-#define TK_VARBINARY 139
-#define TK_GEOMETRY 140
-#define TK_DECIMAL 141
-#define TK_COMMENT 142
-#define TK_MAX_DELAY 143
-#define TK_WATERMARK 144
-#define TK_ROLLUP 145
-#define TK_TTL 146
-#define TK_SMA 147
-#define TK_DELETE_MARK 148
-#define TK_FIRST 149
-#define TK_LAST 150
-#define TK_SHOW 151
-#define TK_PRIVILEGES 152
-#define TK_DATABASES 153
-#define TK_TABLES 154
-#define TK_STABLES 155
-#define TK_MNODES 156
-#define TK_QNODES 157
-#define TK_ARBGROUPS 158
-#define TK_FUNCTIONS 159
-#define TK_INDEXES 160
-#define TK_ACCOUNTS 161
-#define TK_APPS 162
-#define TK_CONNECTIONS 163
-#define TK_LICENCES 164
-#define TK_GRANTS 165
-#define TK_FULL 166
-#define TK_LOGS 167
-#define TK_MACHINES 168
-#define TK_ENCRYPTIONS 169
-#define TK_QUERIES 170
-#define TK_SCORES 171
-#define TK_TOPICS 172
-#define TK_VARIABLES 173
-#define TK_BNODES 174
-#define TK_SNODES 175
-#define TK_TRANSACTIONS 176
-#define TK_DISTRIBUTED 177
-#define TK_CONSUMERS 178
-#define TK_SUBSCRIPTIONS 179
-#define TK_VNODES 180
-#define TK_ALIVE 181
-#define TK_VIEWS 182
-#define TK_VIEW 183
-#define TK_COMPACTS 184
-#define TK_NORMAL 185
-#define TK_CHILD 186
-#define TK_LIKE 187
-#define TK_TBNAME 188
-#define TK_QTAGS 189
-#define TK_AS 190
-#define TK_SYSTEM 191
-#define TK_TSMA 192
-#define TK_INTERVAL 193
-#define TK_RECURSIVE 194
-#define TK_TSMAS 195
-#define TK_FUNCTION 196
-#define TK_INDEX 197
-#define TK_COUNT 198
-#define TK_LAST_ROW 199
-#define TK_META 200
-#define TK_ONLY 201
-#define TK_TOPIC 202
-#define TK_CONSUMER 203
-#define TK_GROUP 204
-#define TK_DESC 205
-#define TK_DESCRIBE 206
-#define TK_RESET 207
-#define TK_QUERY 208
-#define TK_CACHE 209
-#define TK_EXPLAIN 210
-#define TK_ANALYZE 211
-#define TK_VERBOSE 212
-#define TK_NK_BOOL 213
-#define TK_RATIO 214
-#define TK_NK_FLOAT 215
-#define TK_OUTPUTTYPE 216
-#define TK_AGGREGATE 217
-#define TK_BUFSIZE 218
-#define TK_LANGUAGE 219
-#define TK_REPLACE 220
-#define TK_STREAM 221
-#define TK_INTO 222
-#define TK_PAUSE 223
-#define TK_RESUME 224
-#define TK_PRIMARY 225
-#define TK_KEY 226
-#define TK_TRIGGER 227
-#define TK_AT_ONCE 228
-#define TK_WINDOW_CLOSE 229
-#define TK_IGNORE 230
-#define TK_EXPIRED 231
-#define TK_FILL_HISTORY 232
-#define TK_UPDATE 233
-#define TK_SUBTABLE 234
-#define TK_UNTREATED 235
-#define TK_KILL 236
-#define TK_CONNECTION 237
-#define TK_TRANSACTION 238
-#define TK_BALANCE 239
-#define TK_VGROUP 240
-#define TK_LEADER 241
-#define TK_MERGE 242
-#define TK_REDISTRIBUTE 243
-#define TK_SPLIT 244
-#define TK_DELETE 245
-#define TK_INSERT 246
-#define TK_NK_BIN 247
-#define TK_NK_HEX 248
-#define TK_NULL 249
-#define TK_NK_QUESTION 250
-#define TK_NK_ALIAS 251
-#define TK_NK_ARROW 252
-#define TK_ROWTS 253
-#define TK_QSTART 254
-#define TK_QEND 255
-#define TK_QDURATION 256
-#define TK_WSTART 257
-#define TK_WEND 258
-#define TK_WDURATION 259
-#define TK_IROWTS 260
-#define TK_ISFILLED 261
-#define TK_CAST 262
-#define TK_NOW 263
-#define TK_TODAY 264
-#define TK_TIMEZONE 265
-#define TK_CLIENT_VERSION 266
-#define TK_SERVER_VERSION 267
-#define TK_SERVER_STATUS 268
-#define TK_CURRENT_USER 269
-#define TK_CASE 270
-#define TK_WHEN 271
-#define TK_THEN 272
-#define TK_ELSE 273
-#define TK_BETWEEN 274
-#define TK_IS 275
-#define TK_NK_LT 276
-#define TK_NK_GT 277
-#define TK_NK_LE 278
-#define TK_NK_GE 279
-#define TK_NK_NE 280
-#define TK_MATCH 281
-#define TK_NMATCH 282
-#define TK_CONTAINS 283
-#define TK_IN 284
-#define TK_JOIN 285
-#define TK_INNER 286
-#define TK_LEFT 287
-#define TK_RIGHT 288
-#define TK_OUTER 289
-#define TK_SEMI 290
-#define TK_ANTI 291
-#define TK_ASOF 292
-#define TK_WINDOW 293
-#define TK_WINDOW_OFFSET 294
-#define TK_JLIMIT 295
-#define TK_SELECT 296
-#define TK_NK_HINT 297
-#define TK_DISTINCT 298
-#define TK_WHERE 299
-#define TK_PARTITION 300
-#define TK_BY 301
-#define TK_SESSION 302
-#define TK_STATE_WINDOW 303
-#define TK_EVENT_WINDOW 304
-#define TK_COUNT_WINDOW 305
-#define TK_SLIDING 306
-#define TK_FILL 307
-#define TK_VALUE 308
-#define TK_VALUE_F 309
-#define TK_NONE 310
-#define TK_PREV 311
-#define TK_NULL_F 312
-#define TK_LINEAR 313
-#define TK_NEXT 314
-#define TK_HAVING 315
-#define TK_RANGE 316
-#define TK_EVERY 317
-#define TK_ORDER 318
-#define TK_SLIMIT 319
-#define TK_SOFFSET 320
-#define TK_LIMIT 321
-#define TK_OFFSET 322
-#define TK_ASC 323
-#define TK_NULLS 324
-#define TK_ABORT 325
-#define TK_AFTER 326
-#define TK_ATTACH 327
-#define TK_BEFORE 328
-#define TK_BEGIN 329
-#define TK_BITAND 330
-#define TK_BITNOT 331
-#define TK_BITOR 332
-#define TK_BLOCKS 333
-#define TK_CHANGE 334
-#define TK_COMMA 335
-#define TK_CONCAT 336
-#define TK_CONFLICT 337
-#define TK_COPY 338
-#define TK_DEFERRED 339
-#define TK_DELIMITERS 340
-#define TK_DETACH 341
-#define TK_DIVIDE 342
-#define TK_DOT 343
-#define TK_EACH 344
-#define TK_FAIL 345
-#define TK_FILE 346
-#define TK_FOR 347
-#define TK_GLOB 348
-#define TK_ID 349
-#define TK_IMMEDIATE 350
-#define TK_IMPORT 351
-#define TK_INITIALLY 352
-#define TK_INSTEAD 353
-#define TK_ISNULL 354
-#define TK_MODULES 355
-#define TK_NK_BITNOT 356
-#define TK_NK_SEMI 357
-#define TK_NOTNULL 358
-#define TK_OF 359
-#define TK_PLUS 360
-#define TK_PRIVILEGE 361
-#define TK_RAISE 362
-#define TK_RESTRICT 363
-#define TK_ROW 364
-#define TK_STAR 365
-#define TK_STATEMENT 366
-#define TK_STRICT 367
-#define TK_STRING 368
-#define TK_TIMES 369
-#define TK_VALUES 370
-#define TK_VARIABLE 371
-#define TK_WAL 372
-#define TK_ENCODE 373
-#define TK_COMPRESS 374
-#define TK_LEVEL 375
-#endif
-/**************** End token definitions ***************************************/
+/* These constants specify the various numeric values for terminal symbols
+** in a format understandable to "makeheaders". This section is blank unless
+** "lemon" is run with the "-m" command-line option.
+***************** Begin makeheaders token definitions *************************/
+/**************** End makeheaders token definitions ***************************/
/* The next sections is a series of control #defines.
** various aspects of the generated parser.
@@ -481,30 +104,30 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
-#define YYNOCODE 554
+#define YYNOCODE 555
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
- EFillMode yy6;
- SShowTablesOption yy125;
- SAlterOption yy145;
- EShowKind yy245;
- ENullOrder yy273;
- EOperatorType yy292;
- SDataType yy400;
- EJoinType yy564;
- SNode* yy600;
- SToken yy649;
- int8_t yy663;
- bool yy705;
- SNodeList* yy748;
- int32_t yy756;
- EJoinSubType yy758;
- STokenPair yy781;
- int64_t yy941;
- EOrder yy1010;
+ SNodeList* yy34;
+ EShowKind yy39;
+ int32_t yy100;
+ EJoinType yy162;
+ int8_t yy323;
+ SShowTablesOption yy397;
+ bool yy437;
+ EOperatorType yy440;
+ EJoinSubType yy444;
+ SNode* yy452;
+ SAlterOption yy455;
+ SToken yy479;
+ EOrder yy548;
+ int64_t yy579;
+ STokenPair yy687;
+ ENullOrder yy817;
+ SDataType yy874;
+ EFillMode yy984;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -520,18 +143,18 @@ typedef union {
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
-#define YYNSTATE 965
-#define YYNRULE 748
-#define YYNRULE_WITH_ACTION 748
-#define YYNTOKEN 376
-#define YY_MAX_SHIFT 964
-#define YY_MIN_SHIFTREDUCE 1432
-#define YY_MAX_SHIFTREDUCE 2179
-#define YY_ERROR_ACTION 2180
-#define YY_ACCEPT_ACTION 2181
-#define YY_NO_ACTION 2182
-#define YY_MIN_REDUCE 2183
-#define YY_MAX_REDUCE 2930
+#define YYNSTATE 967
+#define YYNRULE 749
+#define YYNRULE_WITH_ACTION 749
+#define YYNTOKEN 377
+#define YY_MAX_SHIFT 966
+#define YY_MIN_SHIFTREDUCE 1434
+#define YY_MAX_SHIFTREDUCE 2182
+#define YY_ERROR_ACTION 2183
+#define YY_ACCEPT_ACTION 2184
+#define YY_NO_ACTION 2185
+#define YY_MIN_REDUCE 2186
+#define YY_MAX_REDUCE 2934
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -598,939 +221,951 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (3228)
+#define YY_ACTTAB_COUNT (3285)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 37, 338, 2539, 2706, 641, 544, 2374, 642, 2226, 190,
- /* 10 */ 2681, 315, 47, 45, 2096, 2813, 805, 466, 496, 495,
- /* 20 */ 471, 2184, 1917, 2536, 847, 40, 39, 2706, 66, 46,
- /* 30 */ 44, 43, 42, 41, 1942, 2005, 1942, 1915, 2685, 2481,
- /* 40 */ 840, 2810, 136, 1924, 2724, 135, 134, 133, 132, 131,
- /* 50 */ 130, 129, 128, 127, 606, 604, 833, 410, 856, 372,
- /* 60 */ 2671, 230, 842, 2369, 418, 33, 2000, 832, 2724, 802,
- /* 70 */ 155, 40, 39, 19, 301, 46, 44, 43, 42, 41,
- /* 80 */ 1923, 2270, 802, 155, 2671, 210, 842, 726, 136, 2687,
- /* 90 */ 2690, 135, 134, 133, 132, 131, 130, 129, 128, 127,
- /* 100 */ 861, 2432, 724, 252, 722, 286, 285, 644, 2705, 2234,
- /* 110 */ 961, 2744, 2813, 15, 1943, 119, 2707, 846, 2709, 2710,
- /* 120 */ 841, 649, 861, 103, 642, 2226, 197, 199, 856, 2798,
- /* 130 */ 646, 2140, 2705, 467, 2794, 2744, 643, 62, 2809, 406,
- /* 140 */ 2707, 846, 2709, 2710, 841, 839, 861, 825, 2763, 2007,
- /* 150 */ 2008, 50, 439, 218, 2512, 755, 934, 933, 932, 931,
- /* 160 */ 499, 2845, 930, 929, 160, 924, 923, 922, 921, 920,
- /* 170 */ 919, 918, 159, 912, 911, 910, 498, 497, 907, 906,
- /* 180 */ 905, 196, 195, 904, 494, 903, 902, 901, 1978, 1988,
- /* 190 */ 804, 185, 2806, 2807, 780, 153, 2811, 290, 2006, 2009,
- /* 200 */ 802, 155, 1763, 1764, 192, 2806, 801, 581, 147, 800,
- /* 210 */ 790, 2664, 580, 1918, 487, 1916, 2896, 9, 2896, 2100,
- /* 220 */ 579, 1927, 40, 39, 739, 1942, 46, 44, 43, 42,
- /* 230 */ 41, 2361, 2706, 2206, 789, 217, 789, 217, 122, 2897,
- /* 240 */ 791, 2897, 791, 1690, 1691, 843, 2389, 489, 2387, 1921,
- /* 250 */ 1922, 1975, 779, 1977, 1980, 1981, 1982, 1983, 1984, 1985,
- /* 260 */ 1986, 1987, 838, 859, 858, 1999, 2001, 2002, 2003, 2004,
- /* 270 */ 2, 47, 45, 2724, 917, 476, 415, 2345, 1940, 471,
- /* 280 */ 2724, 1917, 1844, 1845, 2901, 588, 861, 431, 609, 2671,
- /* 290 */ 2671, 842, 2896, 608, 2005, 60, 1915, 40, 39, 455,
- /* 300 */ 2586, 46, 44, 43, 42, 41, 753, 2015, 736, 1946,
- /* 310 */ 567, 2900, 610, 1942, 197, 2897, 2899, 416, 569, 1499,
- /* 320 */ 322, 1498, 125, 2806, 2807, 2000, 153, 2811, 180, 547,
- /* 330 */ 857, 2385, 19, 664, 322, 2034, 151, 2705, 2388, 1923,
- /* 340 */ 2744, 2071, 2513, 775, 119, 2707, 846, 2709, 2710, 841,
- /* 350 */ 221, 861, 1472, 778, 157, 1500, 166, 2769, 2798, 2183,
- /* 360 */ 40, 39, 467, 2794, 46, 44, 43, 42, 41, 961,
- /* 370 */ 440, 1479, 15, 898, 172, 171, 895, 894, 893, 169,
- /* 380 */ 1946, 555, 1942, 145, 144, 143, 142, 141, 140, 139,
- /* 390 */ 138, 137, 657, 1979, 1474, 1477, 1478, 537, 62, 40,
- /* 400 */ 39, 2035, 536, 46, 44, 43, 42, 41, 2007, 2008,
- /* 410 */ 661, 2519, 2498, 660, 596, 595, 594, 593, 592, 587,
- /* 420 */ 586, 585, 584, 423, 29, 1975, 2071, 574, 573, 572,
- /* 430 */ 571, 570, 564, 563, 562, 254, 557, 556, 438, 644,
- /* 440 */ 856, 2234, 548, 1751, 1752, 329, 330, 1978, 1988, 1770,
- /* 450 */ 328, 756, 781, 776, 769, 765, 1976, 2006, 2009, 2896,
- /* 460 */ 2818, 2068, 2069, 2070, 2818, 2818, 2818, 2818, 2818, 2526,
- /* 470 */ 2376, 662, 1918, 521, 1916, 62, 900, 2902, 217, 213,
- /* 480 */ 740, 1979, 2897, 791, 857, 2385, 857, 2385, 36, 469,
- /* 490 */ 2029, 2030, 2031, 2032, 2033, 2037, 2038, 2039, 2040, 2073,
- /* 500 */ 2074, 2075, 2076, 2077, 146, 2141, 55, 377, 1921, 1922,
- /* 510 */ 1975, 687, 1977, 1980, 1981, 1982, 1983, 1984, 1985, 1986,
- /* 520 */ 1987, 838, 859, 858, 1999, 2001, 2002, 2003, 2004, 2,
- /* 530 */ 12, 47, 45, 50, 476, 1926, 2706, 2539, 181, 471,
- /* 540 */ 1947, 1917, 116, 390, 1976, 861, 2068, 2069, 2070, 805,
- /* 550 */ 208, 113, 473, 600, 2005, 1590, 1915, 2171, 2536, 847,
- /* 560 */ 388, 76, 651, 2578, 75, 2706, 40, 39, 454, 2586,
- /* 570 */ 46, 44, 43, 42, 41, 417, 737, 2724, 843, 2071,
- /* 580 */ 2236, 322, 1943, 1923, 2681, 2000, 2901, 250, 623, 621,
- /* 590 */ 618, 616, 19, 2671, 2896, 842, 40, 39, 1592, 1923,
- /* 600 */ 46, 44, 43, 42, 41, 2491, 2724, 708, 707, 706,
- /* 610 */ 525, 1947, 2685, 2900, 698, 152, 702, 2897, 2898, 241,
- /* 620 */ 701, 2539, 2671, 658, 842, 700, 705, 448, 447, 961,
- /* 630 */ 914, 699, 15, 62, 98, 446, 695, 694, 693, 527,
- /* 640 */ 523, 2705, 2537, 847, 2744, 599, 240, 551, 119, 2707,
- /* 650 */ 846, 2709, 2710, 841, 797, 861, 857, 2385, 322, 597,
- /* 660 */ 199, 2381, 2798, 2687, 2689, 468, 467, 2794, 2007, 2008,
- /* 670 */ 2705, 63, 2112, 2744, 861, 2170, 146, 119, 2707, 846,
- /* 680 */ 2709, 2710, 841, 692, 861, 12, 2129, 659, 2532, 2916,
- /* 690 */ 183, 2798, 2195, 51, 2846, 467, 2794, 916, 2818, 2068,
- /* 700 */ 2069, 2070, 2818, 2818, 2818, 2818, 2818, 1978, 1988, 35,
- /* 710 */ 1945, 1790, 1791, 1929, 2181, 40, 39, 2006, 2009, 46,
- /* 720 */ 44, 43, 42, 41, 2359, 86, 85, 540, 2439, 2440,
- /* 730 */ 229, 2093, 1918, 2445, 1916, 46, 44, 43, 42, 41,
- /* 740 */ 98, 437, 2624, 532, 530, 772, 771, 2127, 2128, 2130,
- /* 750 */ 2131, 2132, 2443, 12, 289, 10, 414, 441, 288, 519,
- /* 760 */ 1789, 1792, 515, 511, 507, 504, 533, 2380, 1921, 1922,
- /* 770 */ 1975, 1585, 1977, 1980, 1981, 1982, 1983, 1984, 1985, 1986,
- /* 780 */ 1987, 838, 859, 858, 1999, 2001, 2002, 2003, 2004, 2,
- /* 790 */ 47, 45, 2010, 1499, 2706, 1498, 756, 482, 471, 236,
- /* 800 */ 1917, 502, 180, 867, 2896, 891, 501, 843, 2901, 2853,
- /* 810 */ 2665, 489, 2387, 2005, 1586, 1915, 322, 491, 2706, 78,
- /* 820 */ 2438, 2440, 2902, 217, 1602, 1945, 2813, 2897, 791, 1500,
- /* 830 */ 790, 843, 101, 2866, 638, 2724, 1942, 426, 2896, 1601,
- /* 840 */ 453, 2445, 728, 636, 2000, 92, 632, 628, 91, 464,
- /* 850 */ 211, 2671, 2808, 842, 831, 756, 789, 217, 1923, 2724,
- /* 860 */ 2443, 2897, 791, 2896, 857, 2385, 898, 172, 171, 895,
- /* 870 */ 894, 893, 169, 89, 476, 2671, 322, 842, 445, 444,
- /* 880 */ 320, 2902, 217, 485, 541, 861, 2897, 791, 961, 2464,
- /* 890 */ 2372, 48, 898, 172, 171, 895, 894, 893, 169, 2705,
- /* 900 */ 1502, 1503, 2744, 3, 2706, 740, 119, 2707, 846, 2709,
- /* 910 */ 2710, 841, 611, 861, 1917, 53, 90, 843, 2916, 2164,
- /* 920 */ 2798, 857, 2385, 2705, 467, 2794, 2744, 2007, 2008, 1915,
- /* 930 */ 119, 2707, 846, 2709, 2710, 841, 826, 861, 2770, 553,
- /* 940 */ 2508, 542, 2916, 798, 2798, 2724, 559, 2508, 467, 2794,
- /* 950 */ 474, 866, 865, 864, 857, 2385, 443, 442, 179, 689,
- /* 960 */ 2445, 2671, 828, 842, 2770, 2706, 1978, 1988, 475, 2390,
- /* 970 */ 857, 2385, 1923, 1479, 663, 1886, 2006, 2009, 843, 2443,
- /* 980 */ 767, 691, 376, 857, 2385, 690, 2445, 742, 2578, 297,
- /* 990 */ 561, 1918, 232, 1916, 490, 320, 2121, 1477, 1478, 234,
- /* 1000 */ 590, 2508, 961, 575, 1979, 2443, 2724, 481, 480, 2705,
- /* 1010 */ 62, 2122, 2744, 1946, 683, 682, 187, 2707, 846, 2709,
- /* 1020 */ 2710, 841, 2671, 861, 842, 2092, 2205, 1921, 1922, 1975,
- /* 1030 */ 2026, 1977, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987,
- /* 1040 */ 838, 859, 858, 1999, 2001, 2002, 2003, 2004, 2, 47,
- /* 1050 */ 45, 2706, 492, 239, 2120, 583, 582, 471, 383, 1917,
- /* 1060 */ 179, 1885, 685, 684, 843, 102, 2889, 1976, 857, 2385,
- /* 1070 */ 2705, 2390, 2005, 2744, 1915, 792, 2917, 119, 2707, 846,
- /* 1080 */ 2709, 2710, 841, 2671, 861, 704, 703, 2706, 576, 2916,
- /* 1090 */ 182, 2798, 2724, 484, 483, 467, 2794, 1606, 2319, 1818,
- /* 1100 */ 843, 2204, 2830, 2000, 1651, 1918, 2389, 1916, 2671, 535,
- /* 1110 */ 842, 534, 1605, 111, 14, 13, 2203, 1923, 1642, 890,
- /* 1120 */ 889, 888, 1646, 887, 1648, 1649, 886, 883, 2724, 1657,
- /* 1130 */ 880, 1659, 1660, 877, 874, 871, 2196, 857, 2385, 2378,
- /* 1140 */ 2320, 1921, 1922, 533, 2671, 117, 842, 961, 2706, 2900,
- /* 1150 */ 48, 2036, 857, 2385, 857, 2385, 2705, 577, 2671, 2744,
- /* 1160 */ 2360, 843, 158, 119, 2707, 846, 2709, 2710, 841, 377,
- /* 1170 */ 861, 2377, 2382, 2671, 292, 2916, 2202, 2798, 857, 2385,
- /* 1180 */ 190, 467, 2794, 212, 148, 613, 2007, 2008, 1481, 2724,
- /* 1190 */ 857, 2385, 2705, 322, 1941, 2744, 88, 2201, 300, 119,
- /* 1200 */ 2707, 846, 2709, 2710, 841, 2671, 861, 842, 857, 2385,
- /* 1210 */ 808, 2916, 2200, 2798, 496, 495, 2199, 467, 2794, 2198,
- /* 1220 */ 857, 2385, 857, 2385, 1931, 1978, 1988, 2048, 333, 857,
- /* 1230 */ 2385, 2587, 900, 2671, 2859, 2006, 2009, 2005, 34, 1924,
- /* 1240 */ 822, 1946, 340, 1942, 1947, 43, 42, 41, 2041, 854,
- /* 1250 */ 1918, 2592, 1916, 2705, 2671, 2611, 2744, 857, 2385, 773,
- /* 1260 */ 119, 2707, 846, 2709, 2710, 841, 2197, 861, 2000, 2671,
- /* 1270 */ 928, 926, 2773, 2671, 2798, 2194, 2671, 855, 467, 2794,
- /* 1280 */ 156, 691, 1923, 2769, 2193, 690, 1921, 1922, 1975, 2273,
- /* 1290 */ 1977, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 838,
- /* 1300 */ 859, 858, 1999, 2001, 2002, 2003, 2004, 2, 47, 45,
- /* 1310 */ 2192, 2706, 830, 291, 857, 2385, 471, 2191, 1917, 857,
- /* 1320 */ 2385, 2190, 2189, 2671, 843, 308, 179, 2625, 1651, 784,
- /* 1330 */ 2188, 2005, 2671, 1915, 368, 892, 794, 2391, 2436, 493,
- /* 1340 */ 2187, 2671, 1642, 890, 889, 888, 1646, 887, 1648, 1649,
- /* 1350 */ 837, 836, 2724, 1657, 835, 1659, 1660, 834, 874, 871,
- /* 1360 */ 896, 2186, 2000, 2436, 708, 707, 706, 2671, 2671, 170,
- /* 1370 */ 842, 698, 152, 702, 2671, 316, 1923, 701, 2671, 2671,
- /* 1380 */ 2445, 756, 700, 705, 448, 447, 2445, 2671, 699, 2896,
- /* 1390 */ 2238, 2445, 446, 695, 694, 693, 2082, 2671, 516, 809,
- /* 1400 */ 897, 802, 155, 2436, 2615, 817, 961, 2902, 217, 15,
- /* 1410 */ 2444, 384, 2897, 791, 2422, 1932, 2705, 1927, 2671, 2744,
- /* 1420 */ 2211, 956, 223, 119, 2707, 846, 2709, 2710, 841, 277,
- /* 1430 */ 861, 279, 275, 281, 278, 2771, 280, 2798, 421, 420,
- /* 1440 */ 2362, 467, 2794, 952, 283, 2007, 2008, 282, 477, 162,
- /* 1450 */ 54, 1935, 1937, 162, 696, 697, 509, 730, 2692, 729,
- /* 1460 */ 272, 2005, 2706, 486, 793, 859, 858, 1999, 2001, 2002,
- /* 1470 */ 2003, 2004, 1947, 161, 1976, 843, 2257, 191, 1583, 1581,
- /* 1480 */ 2255, 2173, 2174, 1563, 1978, 1988, 681, 677, 673, 669,
- /* 1490 */ 2246, 271, 2000, 2244, 2006, 2009, 207, 803, 709, 150,
- /* 1500 */ 40, 39, 711, 2724, 46, 44, 43, 42, 41, 1918,
- /* 1510 */ 763, 1916, 713, 2725, 49, 716, 170, 908, 49, 2671,
- /* 1520 */ 200, 842, 2694, 186, 2806, 2807, 1564, 153, 2811, 327,
- /* 1530 */ 1834, 2312, 77, 2311, 1842, 64, 2517, 99, 347, 346,
- /* 1540 */ 269, 1555, 14, 13, 49, 1921, 1922, 1975, 2227, 1977,
- /* 1550 */ 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 838, 859,
- /* 1560 */ 858, 1999, 2001, 2002, 2003, 2004, 2, 2705, 49, 738,
- /* 1570 */ 2744, 77, 349, 348, 119, 2707, 846, 2709, 2710, 841,
- /* 1580 */ 167, 861, 733, 170, 351, 350, 827, 964, 2798, 353,
- /* 1590 */ 352, 2116, 467, 2794, 2706, 2126, 74, 807, 869, 2125,
- /* 1600 */ 168, 306, 2849, 374, 355, 354, 170, 843, 257, 770,
- /* 1610 */ 331, 460, 777, 814, 357, 356, 2042, 268, 456, 954,
- /* 1620 */ 206, 259, 266, 795, 149, 1989, 1925, 264, 655, 950,
- /* 1630 */ 946, 942, 938, 167, 371, 2724, 756, 811, 500, 1908,
- /* 1640 */ 518, 1884, 359, 358, 2896, 909, 256, 361, 360, 1787,
- /* 1650 */ 2518, 2671, 1777, 842, 363, 362, 365, 364, 1536, 367,
- /* 1660 */ 366, 343, 2902, 217, 1633, 2233, 749, 2897, 791, 1553,
- /* 1670 */ 2433, 2706, 785, 479, 478, 1909, 2850, 382, 2860, 1664,
- /* 1680 */ 118, 1672, 123, 344, 843, 786, 318, 1679, 715, 859,
- /* 1690 */ 858, 1999, 2001, 2002, 2003, 2004, 313, 321, 2346, 2705,
- /* 1700 */ 5, 1537, 2744, 727, 2706, 1677, 120, 2707, 846, 2709,
- /* 1710 */ 2710, 841, 2724, 861, 173, 818, 503, 843, 508, 287,
- /* 1720 */ 2798, 1940, 435, 1950, 2797, 2794, 517, 528, 2671, 529,
- /* 1730 */ 842, 224, 531, 225, 2706, 1811, 718, 227, 375, 545,
- /* 1740 */ 1941, 552, 238, 712, 710, 2724, 554, 843, 602, 558,
- /* 1750 */ 284, 2706, 560, 565, 589, 578, 2510, 591, 615, 614,
- /* 1760 */ 342, 2671, 824, 842, 843, 325, 598, 612, 601, 603,
- /* 1770 */ 324, 243, 244, 617, 247, 2724, 2705, 619, 620, 2744,
- /* 1780 */ 622, 639, 624, 120, 2707, 846, 2709, 2710, 841, 294,
- /* 1790 */ 861, 2671, 2724, 842, 1948, 4, 72, 2798, 640, 71,
- /* 1800 */ 648, 829, 2794, 647, 1928, 650, 255, 94, 2671, 844,
- /* 1810 */ 842, 1943, 2744, 652, 258, 1949, 120, 2707, 846, 2709,
- /* 1820 */ 2710, 841, 653, 861, 1951, 654, 741, 261, 2706, 806,
- /* 1830 */ 2798, 656, 263, 1952, 430, 2794, 2533, 95, 1953, 2705,
- /* 1840 */ 686, 843, 2744, 2527, 96, 2706, 184, 2707, 846, 2709,
- /* 1850 */ 2710, 841, 97, 861, 665, 270, 2705, 411, 843, 2744,
- /* 1860 */ 719, 720, 124, 120, 2707, 846, 2709, 2710, 841, 2724,
- /* 1870 */ 861, 688, 2601, 2375, 274, 2598, 100, 2798, 2371, 276,
- /* 1880 */ 756, 175, 2795, 756, 121, 2671, 2724, 842, 2896, 2373,
- /* 1890 */ 2368, 2896, 176, 757, 2856, 177, 2597, 732, 378, 163,
- /* 1900 */ 734, 293, 2671, 1944, 842, 2579, 2902, 217, 744, 2902,
- /* 1910 */ 217, 2897, 791, 743, 2897, 791, 298, 745, 296, 751,
- /* 1920 */ 748, 750, 760, 774, 812, 2706, 8, 458, 2865, 2864,
- /* 1930 */ 2837, 303, 783, 2705, 307, 189, 2744, 761, 843, 759,
- /* 1940 */ 184, 2707, 846, 2709, 2710, 841, 305, 861, 311, 309,
- /* 1950 */ 2705, 758, 312, 2744, 2706, 310, 788, 407, 2707, 846,
- /* 1960 */ 2709, 2710, 841, 461, 861, 787, 2724, 843, 2919, 796,
- /* 1970 */ 799, 2817, 314, 154, 1945, 2895, 317, 2090, 2088, 203,
- /* 1980 */ 323, 2814, 2671, 164, 842, 810, 379, 2547, 2857, 2546,
- /* 1990 */ 1, 219, 2545, 380, 465, 2724, 815, 816, 820, 165,
- /* 2000 */ 61, 336, 823, 2779, 848, 850, 852, 459, 341, 853,
- /* 2010 */ 381, 2671, 110, 842, 2386, 2706, 2663, 112, 1456, 2662,
- /* 2020 */ 2658, 955, 863, 2657, 2649, 385, 2648, 958, 843, 2640,
- /* 2030 */ 2705, 2639, 2655, 2744, 2654, 2646, 370, 407, 2707, 846,
- /* 2040 */ 2709, 2710, 841, 2645, 861, 2634, 52, 174, 2633, 2652,
- /* 2050 */ 419, 2706, 960, 2651, 736, 2643, 2724, 397, 387, 2705,
- /* 2060 */ 2642, 2631, 2744, 2630, 840, 2628, 400, 2707, 846, 2709,
- /* 2070 */ 2710, 841, 2671, 861, 842, 422, 2627, 2437, 408, 398,
- /* 2080 */ 409, 389, 2623, 2622, 427, 2621, 83, 2616, 505, 428,
- /* 2090 */ 506, 1868, 2724, 1869, 222, 510, 2614, 512, 513, 514,
- /* 2100 */ 1867, 2613, 2612, 436, 2610, 520, 2609, 522, 2671, 2608,
- /* 2110 */ 842, 524, 2607, 526, 1855, 2583, 226, 782, 2582, 228,
- /* 2120 */ 2705, 84, 1814, 2744, 1813, 2560, 2559, 187, 2707, 846,
- /* 2130 */ 2709, 2710, 841, 2558, 861, 538, 539, 2557, 2556, 2500,
- /* 2140 */ 2706, 543, 1750, 2497, 546, 2496, 2490, 549, 2487, 550,
- /* 2150 */ 2486, 2485, 231, 843, 233, 2488, 2705, 2484, 87, 2744,
- /* 2160 */ 2489, 2483, 2482, 406, 2707, 846, 2709, 2710, 841, 2706,
- /* 2170 */ 861, 2480, 2764, 2479, 2478, 235, 566, 2477, 568, 2475,
- /* 2180 */ 2474, 2724, 843, 2473, 2472, 2471, 2495, 2918, 2470, 2469,
- /* 2190 */ 2706, 237, 2457, 2456, 93, 2455, 2454, 2671, 2468, 842,
- /* 2200 */ 2493, 2476, 2467, 843, 2466, 2465, 2463, 2462, 2461, 2460,
- /* 2210 */ 2724, 2459, 2458, 2453, 2525, 2494, 2492, 2452, 2451, 2706,
- /* 2220 */ 2450, 1756, 470, 242, 2449, 605, 2671, 2448, 842, 607,
- /* 2230 */ 2447, 2724, 843, 2446, 2277, 245, 2276, 424, 246, 2275,
- /* 2240 */ 425, 1603, 248, 1607, 2274, 2705, 2272, 2671, 2744, 842,
- /* 2250 */ 2269, 472, 407, 2707, 846, 2709, 2710, 841, 2268, 861,
- /* 2260 */ 2724, 2261, 1599, 249, 627, 625, 629, 2248, 631, 633,
- /* 2270 */ 2222, 1480, 2221, 635, 2705, 626, 2671, 2744, 842, 637,
- /* 2280 */ 80, 407, 2707, 846, 2709, 2710, 841, 630, 861, 634,
- /* 2290 */ 251, 81, 198, 2581, 2577, 731, 2691, 209, 2744, 253,
- /* 2300 */ 645, 2567, 402, 2707, 846, 2709, 2710, 841, 2555, 861,
- /* 2310 */ 260, 2554, 262, 2706, 265, 2531, 2524, 2363, 267, 2271,
- /* 2320 */ 2267, 666, 668, 667, 2705, 2265, 843, 2744, 1529, 670,
- /* 2330 */ 2706, 392, 2707, 846, 2709, 2710, 841, 671, 861, 672,
- /* 2340 */ 2263, 674, 675, 843, 676, 2260, 678, 2706, 679, 680,
- /* 2350 */ 2243, 2241, 2242, 2240, 2724, 2218, 2365, 1683, 1684, 2364,
- /* 2360 */ 843, 73, 273, 1589, 1588, 1587, 1584, 1582, 1580, 1579,
- /* 2370 */ 2671, 2724, 842, 2258, 1578, 1577, 1576, 925, 2256, 927,
- /* 2380 */ 1573, 2247, 1571, 2245, 1572, 1570, 449, 2671, 2724, 842,
- /* 2390 */ 450, 451, 452, 2217, 717, 2216, 714, 2215, 2214, 721,
- /* 2400 */ 723, 2213, 725, 1849, 2671, 126, 842, 2580, 1851, 1848,
- /* 2410 */ 2706, 2576, 1853, 28, 295, 2566, 67, 2553, 2705, 1820,
- /* 2420 */ 1839, 2744, 1822, 843, 746, 391, 2707, 846, 2709, 2710,
- /* 2430 */ 841, 56, 861, 2552, 2901, 2705, 20, 17, 2744, 30,
- /* 2440 */ 6, 762, 393, 2707, 846, 2709, 2710, 841, 2143, 861,
- /* 2450 */ 57, 2724, 2705, 457, 747, 2744, 1799, 21, 299, 399,
- /* 2460 */ 2707, 846, 2709, 2710, 841, 766, 861, 2671, 1798, 842,
- /* 2470 */ 7, 302, 22, 752, 754, 1824, 214, 202, 735, 178,
- /* 2480 */ 32, 2117, 23, 2692, 768, 2083, 215, 764, 2085, 188,
- /* 2490 */ 2706, 304, 65, 2124, 24, 2158, 2157, 201, 319, 31,
- /* 2500 */ 462, 2111, 82, 843, 18, 2081, 2163, 2706, 2164, 216,
- /* 2510 */ 2162, 2161, 463, 2065, 59, 2705, 193, 2551, 2744, 2530,
- /* 2520 */ 843, 104, 403, 2707, 846, 2709, 2710, 841, 2064, 861,
- /* 2530 */ 105, 2724, 326, 2706, 2529, 2119, 204, 106, 332, 69,
- /* 2540 */ 2523, 335, 813, 819, 107, 25, 843, 2671, 2724, 842,
- /* 2550 */ 13, 2017, 2016, 11, 1933, 2027, 1992, 194, 205, 1991,
- /* 2560 */ 1990, 58, 1960, 876, 2671, 879, 842, 882, 885, 38,
- /* 2570 */ 2706, 1968, 2522, 16, 2724, 26, 845, 27, 70, 108,
- /* 2580 */ 849, 339, 109, 843, 345, 334, 1994, 868, 2179, 2749,
- /* 2590 */ 2671, 2748, 842, 113, 1665, 2705, 860, 68, 2744, 821,
- /* 2600 */ 862, 337, 394, 2707, 846, 2709, 2710, 841, 2178, 861,
- /* 2610 */ 488, 2724, 2705, 2177, 870, 2744, 872, 1662, 873, 404,
- /* 2620 */ 2707, 846, 2709, 2710, 841, 851, 861, 2671, 1661, 842,
- /* 2630 */ 875, 2706, 1658, 878, 1652, 881, 2176, 1650, 2705, 884,
- /* 2640 */ 1656, 2744, 114, 369, 843, 395, 2707, 846, 2709, 2710,
- /* 2650 */ 841, 115, 861, 1678, 2706, 1655, 1654, 79, 1653, 1674,
- /* 2660 */ 1567, 1527, 899, 1566, 1565, 1562, 1559, 843, 1558, 1557,
- /* 2670 */ 1556, 1554, 2724, 1552, 1597, 2705, 1551, 1550, 2744, 1596,
- /* 2680 */ 220, 913, 405, 2707, 846, 2709, 2710, 841, 2671, 861,
- /* 2690 */ 842, 1548, 915, 1547, 1546, 2724, 1545, 1544, 1543, 1542,
- /* 2700 */ 1593, 1591, 1539, 1538, 1535, 1534, 1533, 1532, 2266, 935,
- /* 2710 */ 936, 2671, 2264, 842, 939, 2706, 2262, 937, 941, 943,
- /* 2720 */ 945, 940, 2259, 944, 947, 948, 2239, 949, 843, 951,
- /* 2730 */ 2237, 953, 1469, 2212, 957, 1457, 2705, 373, 959, 2744,
- /* 2740 */ 2706, 1919, 386, 396, 2707, 846, 2709, 2710, 841, 962,
- /* 2750 */ 861, 963, 2182, 843, 2182, 2182, 2724, 2182, 2182, 2705,
- /* 2760 */ 2182, 2182, 2744, 2182, 2182, 2182, 412, 2707, 846, 2709,
- /* 2770 */ 2710, 841, 2671, 861, 842, 2182, 2182, 2182, 2182, 2182,
- /* 2780 */ 2182, 2724, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 2790 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2671, 2182, 842,
- /* 2800 */ 2182, 2706, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 2810 */ 2182, 2182, 2182, 2182, 843, 2182, 2182, 2182, 2182, 2182,
- /* 2820 */ 2705, 2182, 2706, 2744, 2182, 2182, 2182, 413, 2707, 846,
- /* 2830 */ 2709, 2710, 841, 2182, 861, 843, 2182, 2182, 2182, 2182,
- /* 2840 */ 2182, 2182, 2724, 2182, 2182, 2705, 2182, 2182, 2744, 2182,
- /* 2850 */ 2182, 2182, 2718, 2707, 846, 2709, 2710, 841, 2671, 861,
- /* 2860 */ 842, 2182, 2182, 2724, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 2870 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2671,
- /* 2880 */ 2182, 842, 2182, 2706, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 2890 */ 2182, 2182, 2182, 2182, 2182, 2182, 843, 2182, 2182, 2182,
- /* 2900 */ 2182, 2182, 2182, 2182, 2182, 2182, 2705, 2182, 2182, 2744,
- /* 2910 */ 2182, 2182, 2182, 2717, 2707, 846, 2709, 2710, 841, 2182,
- /* 2920 */ 861, 2182, 2182, 2182, 2724, 2182, 2182, 2705, 2182, 2182,
- /* 2930 */ 2744, 2182, 2182, 2182, 2716, 2707, 846, 2709, 2710, 841,
- /* 2940 */ 2671, 861, 842, 2182, 2706, 2182, 2182, 2182, 2182, 2182,
- /* 2950 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 843, 2182, 2182,
- /* 2960 */ 2182, 2182, 2182, 2706, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 2970 */ 2182, 2182, 2182, 2182, 2182, 2182, 843, 2182, 2182, 2182,
- /* 2980 */ 2182, 2182, 2182, 2182, 2182, 2724, 2182, 2182, 2705, 2182,
- /* 2990 */ 2182, 2744, 2182, 2182, 2182, 432, 2707, 846, 2709, 2710,
- /* 3000 */ 841, 2671, 861, 842, 2724, 2182, 2182, 2182, 2182, 2182,
- /* 3010 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3020 */ 2671, 2182, 842, 2182, 2706, 2182, 2182, 2182, 2182, 2182,
- /* 3030 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 843, 2182, 2182,
- /* 3040 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2705,
- /* 3050 */ 2182, 2182, 2744, 2182, 2182, 2182, 433, 2707, 846, 2709,
- /* 3060 */ 2710, 841, 2182, 861, 2182, 2724, 2182, 2182, 2705, 2182,
- /* 3070 */ 2182, 2744, 2182, 2182, 2182, 429, 2707, 846, 2709, 2710,
- /* 3080 */ 841, 2671, 861, 842, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3090 */ 2182, 2182, 2182, 2706, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3100 */ 2182, 2182, 2182, 2182, 2182, 2182, 843, 2182, 2706, 2182,
- /* 3110 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3120 */ 2182, 843, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2705,
- /* 3130 */ 2182, 2182, 2744, 2182, 2724, 2182, 434, 2707, 846, 2709,
- /* 3140 */ 2710, 841, 2182, 861, 2182, 2182, 2182, 2182, 2182, 2724,
- /* 3150 */ 2671, 2182, 842, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3160 */ 2182, 2182, 2182, 2182, 2182, 2671, 2182, 842, 2182, 2182,
- /* 3170 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3180 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182,
- /* 3190 */ 2182, 2182, 2182, 2182, 2182, 2182, 2182, 2182, 844, 2182,
- /* 3200 */ 2182, 2744, 2182, 2182, 2182, 402, 2707, 846, 2709, 2710,
- /* 3210 */ 841, 2182, 861, 2705, 2182, 2182, 2744, 2182, 2182, 2182,
- /* 3220 */ 401, 2707, 846, 2709, 2710, 841, 2182, 861,
+ /* 0 */ 792, 37, 338, 2543, 190, 2380, 315, 2905, 2900, 804,
+ /* 10 */ 155, 2449, 47, 45, 2099, 2900, 859, 2389, 2668, 464,
+ /* 20 */ 471, 487, 1920, 2186, 2541, 849, 791, 217, 661, 2710,
+ /* 30 */ 2447, 2901, 793, 182, 2904, 2008, 146, 1918, 2901, 2903,
+ /* 40 */ 197, 2323, 807, 687, 804, 155, 3, 145, 144, 143,
+ /* 50 */ 142, 141, 140, 139, 138, 137, 40, 39, 9, 53,
+ /* 60 */ 46, 44, 43, 42, 41, 1475, 439, 2003, 2516, 476,
+ /* 70 */ 2728, 40, 39, 781, 19, 46, 44, 43, 42, 41,
+ /* 80 */ 863, 1926, 476, 2449, 1482, 2543, 2675, 2530, 844, 662,
+ /* 90 */ 183, 437, 2198, 863, 496, 495, 804, 155, 859, 2389,
+ /* 100 */ 466, 2728, 2447, 122, 1934, 66, 2540, 849, 1477, 1480,
+ /* 110 */ 1481, 963, 489, 2391, 15, 2209, 2710, 2008, 221, 1927,
+ /* 120 */ 40, 39, 377, 2628, 46, 44, 43, 42, 41, 845,
+ /* 130 */ 806, 185, 2810, 2811, 2709, 153, 2815, 2748, 782, 553,
+ /* 140 */ 2512, 119, 2711, 848, 2713, 2714, 843, 1945, 863, 2003,
+ /* 150 */ 2010, 2011, 252, 199, 2124, 2802, 644, 2728, 2238, 467,
+ /* 160 */ 2798, 804, 155, 1926, 455, 2590, 192, 2810, 803, 2125,
+ /* 170 */ 147, 802, 2675, 2675, 780, 844, 858, 758, 2900, 218,
+ /* 180 */ 792, 516, 2074, 454, 2590, 2900, 431, 2849, 2900, 1981,
+ /* 190 */ 1991, 641, 232, 832, 642, 2230, 791, 217, 858, 2009,
+ /* 200 */ 2012, 2901, 793, 2906, 217, 223, 791, 217, 2901, 793,
+ /* 210 */ 658, 2901, 793, 2123, 1921, 62, 1919, 2905, 125, 2810,
+ /* 220 */ 2811, 2709, 153, 2815, 2748, 2900, 98, 777, 119, 2711,
+ /* 230 */ 848, 2713, 2714, 843, 2037, 863, 869, 2393, 157, 123,
+ /* 240 */ 166, 2773, 2802, 441, 2904, 62, 467, 2798, 2901, 2902,
+ /* 250 */ 1924, 1925, 1978, 2384, 1980, 1983, 1984, 1985, 1986, 1987,
+ /* 260 */ 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, 2006,
+ /* 270 */ 2007, 2, 47, 45, 659, 2536, 1502, 415, 1501, 1943,
+ /* 280 */ 471, 741, 1920, 186, 2810, 2811, 588, 153, 2815, 609,
+ /* 290 */ 496, 495, 50, 151, 608, 2008, 1935, 1918, 1930, 738,
+ /* 300 */ 2038, 2822, 2071, 2072, 2073, 2822, 2822, 2822, 2822, 2822,
+ /* 310 */ 646, 33, 567, 1503, 610, 1927, 643, 40, 39, 416,
+ /* 320 */ 569, 46, 44, 43, 42, 41, 649, 2003, 664, 642,
+ /* 330 */ 2230, 547, 1938, 1940, 19, 2187, 783, 778, 771, 767,
+ /* 340 */ 12, 1926, 10, 858, 742, 180, 861, 860, 2002, 2004,
+ /* 350 */ 2005, 2006, 2007, 236, 489, 2391, 136, 657, 2074, 135,
+ /* 360 */ 134, 133, 132, 131, 130, 129, 128, 127, 51, 289,
+ /* 370 */ 1978, 963, 440, 288, 15, 900, 172, 171, 897, 896,
+ /* 380 */ 895, 169, 98, 555, 868, 867, 866, 36, 469, 2032,
+ /* 390 */ 2033, 2034, 2035, 2036, 2040, 2041, 2042, 2043, 322, 92,
+ /* 400 */ 40, 39, 91, 660, 46, 44, 43, 42, 41, 2385,
+ /* 410 */ 2010, 2011, 1949, 2523, 2502, 739, 596, 595, 594, 593,
+ /* 420 */ 592, 587, 586, 585, 584, 423, 651, 2582, 322, 574,
+ /* 430 */ 573, 572, 571, 570, 564, 563, 562, 50, 557, 556,
+ /* 440 */ 438, 2074, 2373, 418, 548, 1754, 1755, 101, 181, 1981,
+ /* 450 */ 1991, 1773, 426, 390, 1945, 453, 62, 730, 136, 2009,
+ /* 460 */ 2012, 135, 134, 133, 132, 131, 130, 129, 128, 127,
+ /* 470 */ 90, 388, 76, 728, 1921, 75, 1919, 2822, 2071, 2072,
+ /* 480 */ 2073, 2822, 2822, 2822, 2822, 2822, 417, 828, 726, 2774,
+ /* 490 */ 724, 722, 286, 285, 1930, 2710, 1949, 210, 250, 623,
+ /* 500 */ 621, 618, 616, 2076, 2077, 2078, 2079, 2080, 807, 197,
+ /* 510 */ 1924, 1925, 1978, 2436, 1980, 1983, 1984, 1985, 1986, 1987,
+ /* 520 */ 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005, 2006,
+ /* 530 */ 2007, 2, 12, 47, 45, 1946, 2728, 2517, 1920, 2208,
+ /* 540 */ 1945, 471, 544, 1920, 62, 46, 44, 43, 42, 41,
+ /* 550 */ 1654, 322, 2675, 1918, 844, 535, 2008, 534, 1918, 521,
+ /* 560 */ 2485, 2071, 2072, 2073, 1645, 892, 891, 890, 1649, 889,
+ /* 570 */ 1651, 1652, 888, 885, 2710, 1660, 882, 1662, 1663, 879,
+ /* 580 */ 876, 873, 63, 213, 2543, 474, 2132, 845, 2003, 533,
+ /* 590 */ 835, 606, 604, 179, 411, 19, 2675, 1926, 230, 473,
+ /* 600 */ 2709, 834, 1926, 2748, 2394, 2540, 849, 119, 2711, 848,
+ /* 610 */ 2713, 2714, 843, 1946, 863, 2728, 445, 444, 691, 199,
+ /* 620 */ 322, 2802, 690, 1766, 1767, 467, 2798, 963, 559, 2512,
+ /* 630 */ 180, 2675, 963, 844, 62, 15, 86, 85, 540, 322,
+ /* 640 */ 2392, 229, 2669, 2817, 1950, 774, 773, 2130, 2131, 2133,
+ /* 650 */ 2134, 2135, 902, 2850, 532, 530, 40, 39, 859, 2389,
+ /* 660 */ 46, 44, 43, 42, 41, 1793, 1794, 414, 12, 2814,
+ /* 670 */ 519, 2010, 2011, 515, 511, 507, 504, 533, 146, 2709,
+ /* 680 */ 491, 234, 2748, 2442, 2444, 692, 119, 2711, 848, 2713,
+ /* 690 */ 2714, 843, 2905, 863, 443, 442, 525, 689, 2777, 1502,
+ /* 700 */ 2802, 1501, 859, 2389, 467, 2798, 476, 117, 2468, 1948,
+ /* 710 */ 1981, 1991, 2103, 1482, 1792, 1795, 1945, 863, 1945, 691,
+ /* 720 */ 2009, 2012, 55, 690, 158, 527, 523, 322, 1950, 581,
+ /* 730 */ 1921, 1654, 1919, 2381, 580, 1921, 1503, 1919, 1480, 1481,
+ /* 740 */ 600, 2685, 579, 1693, 1694, 1645, 892, 891, 890, 1649,
+ /* 750 */ 889, 1651, 1652, 839, 838, 2710, 1660, 837, 1662, 1663,
+ /* 760 */ 836, 876, 873, 2143, 1949, 757, 1924, 1925, 845, 2689,
+ /* 770 */ 2240, 1924, 1925, 1978, 377, 1980, 1983, 1984, 1985, 1986,
+ /* 780 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005,
+ /* 790 */ 2006, 2007, 2, 47, 45, 2013, 2728, 482, 2710, 590,
+ /* 800 */ 2512, 471, 148, 1920, 2167, 916, 241, 485, 43, 42,
+ /* 810 */ 41, 845, 2675, 2857, 844, 88, 2008, 322, 1918, 2365,
+ /* 820 */ 2691, 2694, 40, 39, 1926, 2710, 46, 44, 43, 42,
+ /* 830 */ 41, 863, 599, 240, 715, 1949, 2591, 2018, 845, 2728,
+ /* 840 */ 2870, 638, 830, 1945, 2774, 2207, 597, 2206, 2003, 729,
+ /* 850 */ 636, 2817, 239, 632, 628, 2675, 2363, 844, 859, 2389,
+ /* 860 */ 2709, 919, 1926, 2748, 2349, 287, 2728, 119, 2711, 848,
+ /* 870 */ 2713, 2714, 843, 918, 863, 583, 582, 2813, 541, 2920,
+ /* 880 */ 320, 2802, 2675, 718, 844, 467, 2798, 1982, 859, 2389,
+ /* 890 */ 712, 710, 963, 2685, 254, 48, 893, 284, 644, 2449,
+ /* 900 */ 2238, 2449, 2675, 2709, 2675, 60, 2748, 475, 542, 490,
+ /* 910 */ 119, 2711, 848, 2713, 2714, 843, 755, 863, 2447, 1484,
+ /* 920 */ 2447, 2689, 2920, 1948, 2802, 1944, 492, 2039, 467, 2798,
+ /* 930 */ 2709, 2010, 2011, 2748, 179, 208, 2629, 119, 2711, 848,
+ /* 940 */ 2713, 2714, 843, 72, 863, 2394, 71, 742, 1979, 2920,
+ /* 950 */ 1979, 2802, 1945, 40, 39, 467, 2798, 46, 44, 43,
+ /* 960 */ 42, 41, 900, 172, 171, 897, 896, 895, 169, 2710,
+ /* 970 */ 1981, 1991, 2691, 2693, 468, 2378, 1889, 2205, 29, 1593,
+ /* 980 */ 2009, 2012, 845, 863, 769, 2096, 1888, 859, 2389, 2364,
+ /* 990 */ 758, 859, 2389, 859, 2389, 1921, 1950, 1919, 2900, 900,
+ /* 1000 */ 172, 171, 897, 896, 895, 169, 212, 561, 481, 480,
+ /* 1010 */ 2728, 575, 1982, 576, 34, 2184, 2906, 217, 484, 483,
+ /* 1020 */ 2174, 2901, 793, 1595, 2044, 2596, 2675, 372, 844, 744,
+ /* 1030 */ 2582, 1924, 1925, 1978, 2675, 1980, 1983, 1984, 1985, 1986,
+ /* 1040 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005,
+ /* 1050 */ 2006, 2007, 2, 47, 45, 2710, 2443, 2444, 2204, 1588,
+ /* 1060 */ 2144, 471, 902, 1920, 1505, 1506, 156, 1950, 845, 2773,
+ /* 1070 */ 2893, 2904, 859, 2389, 2709, 1979, 2008, 2748, 1918, 2261,
+ /* 1080 */ 290, 119, 2711, 848, 2713, 2714, 843, 291, 863, 859,
+ /* 1090 */ 2389, 2710, 577, 2920, 320, 2802, 2728, 14, 13, 467,
+ /* 1100 */ 2798, 709, 502, 1589, 845, 2203, 2834, 501, 2003, 663,
+ /* 1110 */ 859, 2389, 2675, 1605, 844, 2675, 708, 707, 706, 859,
+ /* 1120 */ 2389, 1982, 1926, 698, 152, 702, 329, 330, 1604, 701,
+ /* 1130 */ 2386, 328, 2728, 2817, 700, 705, 448, 447, 2173, 292,
+ /* 1140 */ 699, 859, 2389, 2202, 446, 695, 694, 693, 2675, 2199,
+ /* 1150 */ 844, 786, 963, 859, 2389, 48, 758, 2201, 735, 2812,
+ /* 1160 */ 2709, 300, 2675, 2748, 2900, 1847, 1848, 119, 2711, 848,
+ /* 1170 */ 2713, 2714, 843, 810, 863, 859, 2389, 859, 2389, 2920,
+ /* 1180 */ 2200, 2802, 2906, 217, 1979, 467, 2798, 2901, 793, 859,
+ /* 1190 */ 2389, 2010, 2011, 859, 2389, 333, 2709, 824, 102, 2748,
+ /* 1200 */ 2675, 1609, 611, 119, 2711, 848, 2713, 2714, 843, 340,
+ /* 1210 */ 863, 2051, 758, 856, 2675, 2920, 1608, 2802, 2197, 2085,
+ /* 1220 */ 2900, 467, 2798, 421, 420, 859, 2389, 859, 2389, 2710,
+ /* 1230 */ 1981, 1991, 1821, 477, 859, 2389, 211, 2675, 2906, 217,
+ /* 1240 */ 2009, 2012, 845, 2901, 793, 857, 2008, 368, 486, 2376,
+ /* 1250 */ 683, 682, 685, 684, 493, 1921, 2615, 1919, 111, 2196,
+ /* 1260 */ 2449, 2195, 2194, 2193, 704, 703, 2449, 2192, 2191, 2190,
+ /* 1270 */ 2728, 2189, 930, 928, 170, 2675, 2710, 537, 2003, 811,
+ /* 1280 */ 2095, 2324, 536, 179, 2382, 819, 2675, 2619, 844, 845,
+ /* 1290 */ 613, 1924, 1925, 1978, 2395, 1980, 1983, 1984, 1985, 1986,
+ /* 1300 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005,
+ /* 1310 */ 2006, 2007, 2, 47, 45, 78, 2675, 2728, 2675, 2675,
+ /* 1320 */ 2675, 471, 2495, 1920, 2675, 2675, 2675, 894, 2675, 796,
+ /* 1330 */ 2440, 758, 2449, 2675, 2709, 844, 2008, 2748, 1918, 2900,
+ /* 1340 */ 509, 119, 2711, 848, 2713, 2714, 843, 384, 863, 743,
+ /* 1350 */ 2426, 2448, 2366, 2775, 2259, 2802, 54, 2906, 217, 467,
+ /* 1360 */ 2798, 898, 2901, 793, 2440, 551, 40, 39, 2003, 89,
+ /* 1370 */ 46, 44, 43, 42, 41, 899, 711, 808, 2440, 2214,
+ /* 1380 */ 958, 2709, 1926, 277, 2748, 161, 275, 795, 119, 2711,
+ /* 1390 */ 848, 2713, 2714, 843, 279, 863, 281, 278, 283, 280,
+ /* 1400 */ 829, 282, 2802, 758, 696, 162, 467, 2798, 697, 799,
+ /* 1410 */ 35, 2900, 963, 2710, 2250, 15, 40, 39, 2248, 376,
+ /* 1420 */ 46, 44, 43, 42, 41, 1911, 845, 1887, 1586, 2906,
+ /* 1430 */ 217, 758, 1584, 301, 2901, 793, 713, 162, 765, 2900,
+ /* 1440 */ 716, 732, 49, 731, 2176, 2177, 14, 13, 833, 49,
+ /* 1450 */ 2696, 2010, 2011, 297, 2728, 200, 170, 2906, 217, 479,
+ /* 1460 */ 478, 1912, 2901, 793, 327, 77, 64, 49, 49, 383,
+ /* 1470 */ 2675, 2393, 844, 2115, 1929, 861, 860, 2002, 2004, 2005,
+ /* 1480 */ 2006, 2007, 103, 347, 346, 349, 348, 1837, 351, 350,
+ /* 1490 */ 1981, 1991, 77, 167, 170, 353, 352, 190, 207, 316,
+ /* 1500 */ 2009, 2012, 2274, 355, 354, 357, 356, 359, 358, 361,
+ /* 1510 */ 360, 363, 362, 2863, 2698, 1921, 775, 1919, 2709, 1845,
+ /* 1520 */ 2119, 2748, 365, 364, 2129, 120, 2711, 848, 2713, 2714,
+ /* 1530 */ 843, 2128, 863, 367, 366, 308, 74, 306, 809, 2802,
+ /* 1540 */ 805, 871, 1928, 2801, 2798, 168, 331, 816, 2045, 1992,
+ /* 1550 */ 1790, 1924, 1925, 1978, 150, 1980, 1983, 1984, 1985, 1986,
+ /* 1560 */ 1987, 1988, 1989, 1990, 840, 861, 860, 2002, 2004, 2005,
+ /* 1570 */ 2006, 2007, 2, 170, 1780, 343, 1636, 149, 936, 935,
+ /* 1580 */ 934, 933, 499, 167, 932, 931, 160, 926, 925, 924,
+ /* 1590 */ 923, 922, 921, 920, 159, 914, 913, 912, 498, 497,
+ /* 1600 */ 909, 908, 907, 196, 195, 906, 494, 905, 904, 903,
+ /* 1610 */ 740, 2729, 1566, 910, 911, 2242, 1539, 797, 382, 2316,
+ /* 1620 */ 116, 2315, 2710, 1667, 2029, 2521, 2231, 1675, 966, 113,
+ /* 1630 */ 2853, 772, 456, 460, 779, 845, 813, 1558, 1556, 500,
+ /* 1640 */ 518, 2237, 2522, 2437, 374, 751, 2854, 2864, 787, 788,
+ /* 1650 */ 318, 2710, 313, 1932, 321, 1682, 1567, 2350, 503, 1680,
+ /* 1660 */ 1540, 956, 206, 2728, 845, 173, 508, 5, 435, 954,
+ /* 1670 */ 1943, 952, 948, 944, 940, 517, 371, 1953, 529, 2675,
+ /* 1680 */ 528, 844, 224, 225, 531, 227, 1814, 375, 1944, 545,
+ /* 1690 */ 238, 552, 2728, 554, 565, 558, 560, 602, 578, 800,
+ /* 1700 */ 589, 2514, 598, 591, 601, 603, 614, 612, 2675, 615,
+ /* 1710 */ 844, 244, 243, 617, 619, 620, 247, 622, 624, 1951,
+ /* 1720 */ 639, 1931, 118, 4, 647, 344, 640, 2709, 650, 648,
+ /* 1730 */ 2748, 255, 94, 1946, 120, 2711, 848, 2713, 2714, 843,
+ /* 1740 */ 2277, 863, 652, 258, 1952, 653, 1954, 261, 2802, 2710,
+ /* 1750 */ 656, 654, 831, 2798, 263, 1955, 846, 820, 95, 2748,
+ /* 1760 */ 96, 1956, 842, 120, 2711, 848, 2713, 2714, 843, 2531,
+ /* 1770 */ 863, 2537, 97, 2710, 665, 686, 270, 2802, 124, 719,
+ /* 1780 */ 720, 430, 2798, 688, 2379, 274, 845, 409, 734, 2375,
+ /* 1790 */ 2728, 276, 2605, 736, 175, 100, 378, 2602, 121, 2377,
+ /* 1800 */ 2372, 176, 342, 1947, 826, 177, 2675, 325, 844, 293,
+ /* 1810 */ 163, 2583, 324, 746, 2728, 745, 708, 707, 706, 296,
+ /* 1820 */ 2601, 747, 753, 698, 152, 702, 750, 298, 776, 701,
+ /* 1830 */ 2675, 294, 844, 2869, 700, 705, 448, 447, 762, 814,
+ /* 1840 */ 699, 8, 2710, 785, 446, 695, 694, 693, 2841, 2868,
+ /* 1850 */ 752, 763, 303, 307, 2709, 845, 305, 2748, 761, 2710,
+ /* 1860 */ 309, 406, 2711, 848, 2713, 2714, 843, 841, 863, 827,
+ /* 1870 */ 2767, 760, 845, 790, 311, 189, 310, 312, 2709, 789,
+ /* 1880 */ 461, 2748, 2923, 2728, 314, 184, 2711, 848, 2713, 2714,
+ /* 1890 */ 843, 801, 863, 2899, 798, 1948, 317, 154, 2818, 2675,
+ /* 1900 */ 2728, 844, 2093, 812, 2091, 2821, 323, 203, 272, 379,
+ /* 1910 */ 164, 380, 2551, 817, 2550, 2549, 2675, 1, 844, 219,
+ /* 1920 */ 818, 465, 165, 822, 61, 336, 191, 852, 2783, 850,
+ /* 1930 */ 341, 825, 759, 2860, 854, 681, 677, 673, 669, 2710,
+ /* 1940 */ 271, 381, 110, 855, 2390, 112, 1458, 2709, 865, 957,
+ /* 1950 */ 2748, 2667, 845, 2666, 187, 2711, 848, 2713, 2714, 843,
+ /* 1960 */ 370, 863, 960, 962, 2709, 2662, 2661, 2748, 385, 174,
+ /* 1970 */ 2627, 120, 2711, 848, 2713, 2714, 843, 410, 863, 2653,
+ /* 1980 */ 2728, 389, 2652, 2644, 2643, 2802, 99, 52, 2626, 269,
+ /* 1990 */ 2799, 2659, 387, 2658, 2650, 2649, 2675, 2638, 844, 2637,
+ /* 2000 */ 2656, 2655, 2647, 2646, 2635, 2634, 397, 427, 2632, 2631,
+ /* 2010 */ 2441, 419, 422, 794, 2921, 2625, 2620, 408, 738, 398,
+ /* 2020 */ 83, 505, 506, 1871, 1872, 510, 222, 2618, 512, 513,
+ /* 2030 */ 514, 1870, 2710, 436, 2614, 520, 2613, 522, 2612, 524,
+ /* 2040 */ 428, 2617, 2616, 2611, 2709, 845, 526, 2748, 1858, 2587,
+ /* 2050 */ 226, 184, 2711, 848, 2713, 2714, 843, 257, 863, 2586,
+ /* 2060 */ 228, 1817, 84, 1816, 2564, 2563, 268, 538, 539, 2561,
+ /* 2070 */ 259, 266, 2562, 2728, 2560, 2504, 264, 655, 543, 1753,
+ /* 2080 */ 2501, 546, 2500, 2494, 549, 550, 2491, 231, 2490, 2675,
+ /* 2090 */ 2489, 844, 87, 2488, 2493, 256, 235, 566, 233, 2861,
+ /* 2100 */ 2492, 2487, 2486, 2484, 2483, 2482, 2481, 568, 2479, 2478,
+ /* 2110 */ 2477, 2710, 2476, 2475, 458, 2499, 2474, 2473, 2472, 2497,
+ /* 2120 */ 2480, 2471, 2470, 2469, 845, 2467, 2466, 2465, 2464, 2463,
+ /* 2130 */ 2710, 2462, 2461, 93, 237, 2460, 2459, 2709, 2458, 2457,
+ /* 2140 */ 2748, 2529, 2498, 845, 407, 2711, 848, 2713, 2714, 843,
+ /* 2150 */ 2496, 863, 2728, 2456, 2710, 2455, 1759, 2454, 242, 2453,
+ /* 2160 */ 605, 2452, 2451, 607, 2450, 1606, 1610, 845, 2675, 2281,
+ /* 2170 */ 844, 2728, 2280, 2279, 245, 424, 2278, 1602, 246, 2276,
+ /* 2180 */ 2273, 425, 625, 2272, 2265, 2252, 629, 2675, 2226, 844,
+ /* 2190 */ 627, 633, 251, 459, 631, 2728, 1483, 2225, 2585, 2710,
+ /* 2200 */ 248, 626, 637, 635, 249, 630, 80, 198, 2695, 634,
+ /* 2210 */ 253, 2675, 842, 844, 81, 2581, 2709, 209, 645, 2748,
+ /* 2220 */ 2571, 2559, 2558, 407, 2711, 848, 2713, 2714, 843, 260,
+ /* 2230 */ 863, 262, 2535, 2528, 2367, 2709, 2275, 265, 2748, 267,
+ /* 2240 */ 2728, 2271, 400, 2711, 848, 2713, 2714, 843, 666, 863,
+ /* 2250 */ 1532, 2710, 667, 668, 2269, 670, 2675, 671, 844, 2709,
+ /* 2260 */ 672, 2267, 2748, 674, 845, 675, 187, 2711, 848, 2713,
+ /* 2270 */ 2714, 843, 2264, 863, 676, 678, 679, 2247, 680, 2245,
+ /* 2280 */ 2246, 2244, 2222, 2369, 1687, 1686, 2368, 1592, 1591, 2710,
+ /* 2290 */ 273, 2262, 2728, 784, 1590, 1587, 1574, 1585, 2260, 73,
+ /* 2300 */ 927, 1583, 845, 1582, 2709, 1581, 1580, 2748, 2675, 929,
+ /* 2310 */ 844, 406, 2711, 848, 2713, 2714, 843, 449, 863, 2710,
+ /* 2320 */ 2768, 1579, 1576, 450, 1575, 1573, 2922, 2251, 451, 2249,
+ /* 2330 */ 2728, 452, 845, 470, 717, 2221, 2710, 2220, 2219, 721,
+ /* 2340 */ 2218, 723, 2217, 2216, 714, 725, 2675, 727, 844, 845,
+ /* 2350 */ 126, 1852, 1854, 1851, 1856, 2584, 2709, 28, 67, 2748,
+ /* 2360 */ 2728, 2580, 295, 407, 2711, 848, 2713, 2714, 843, 56,
+ /* 2370 */ 863, 472, 1825, 1823, 2570, 748, 2675, 2728, 844, 2557,
+ /* 2380 */ 2556, 2905, 20, 57, 30, 302, 749, 1802, 2146, 764,
+ /* 2390 */ 2120, 1801, 766, 2675, 2709, 844, 457, 2748, 299, 17,
+ /* 2400 */ 770, 407, 2711, 848, 2713, 2714, 843, 737, 863, 754,
+ /* 2410 */ 756, 178, 768, 2710, 1827, 6, 7, 21, 1842, 22,
+ /* 2420 */ 304, 202, 2127, 214, 733, 2114, 845, 2748, 32, 2086,
+ /* 2430 */ 215, 402, 2711, 848, 2713, 2714, 843, 188, 863, 2696,
+ /* 2440 */ 201, 2709, 31, 2088, 2748, 82, 216, 2710, 392, 2711,
+ /* 2450 */ 848, 2713, 2714, 843, 2728, 863, 2084, 65, 24, 2166,
+ /* 2460 */ 845, 2167, 319, 2161, 2160, 462, 2165, 2164, 463, 2068,
+ /* 2470 */ 2675, 2067, 844, 59, 193, 2555, 2710, 2534, 105, 2533,
+ /* 2480 */ 104, 106, 326, 2122, 204, 332, 815, 2527, 2728, 845,
+ /* 2490 */ 69, 334, 58, 823, 107, 25, 821, 335, 11, 2020,
+ /* 2500 */ 13, 847, 2019, 1936, 2675, 23, 844, 18, 1995, 194,
+ /* 2510 */ 337, 1994, 2030, 878, 881, 884, 887, 2728, 2709, 38,
+ /* 2520 */ 205, 2748, 1993, 16, 26, 391, 2711, 848, 2713, 2714,
+ /* 2530 */ 843, 1963, 863, 2675, 1971, 844, 27, 70, 2526, 853,
+ /* 2540 */ 108, 113, 345, 864, 2182, 2181, 2180, 851, 339, 2179,
+ /* 2550 */ 109, 2753, 2709, 2752, 870, 2748, 1997, 862, 68, 393,
+ /* 2560 */ 2711, 848, 2713, 2714, 843, 1668, 863, 488, 1665, 872,
+ /* 2570 */ 2710, 875, 874, 1664, 877, 1661, 880, 883, 1655, 1653,
+ /* 2580 */ 886, 2709, 1659, 845, 2748, 369, 114, 1658, 399, 2711,
+ /* 2590 */ 848, 2713, 2714, 843, 2710, 863, 1657, 115, 1681, 79,
+ /* 2600 */ 1656, 1677, 1530, 901, 1570, 1569, 1568, 845, 1565, 2710,
+ /* 2610 */ 1562, 2728, 1561, 1560, 1559, 1557, 915, 1555, 1554, 917,
+ /* 2620 */ 1553, 220, 845, 1600, 1551, 1599, 1550, 2675, 1549, 844,
+ /* 2630 */ 1548, 1547, 1596, 1546, 1545, 2728, 1594, 1542, 1541, 2710,
+ /* 2640 */ 1538, 1537, 1536, 1535, 2270, 938, 937, 2268, 939, 941,
+ /* 2650 */ 2728, 2675, 845, 844, 943, 942, 2266, 947, 945, 2263,
+ /* 2660 */ 946, 949, 951, 950, 2243, 2241, 2675, 953, 844, 1472,
+ /* 2670 */ 955, 2215, 1459, 959, 373, 2709, 961, 2185, 2748, 1922,
+ /* 2680 */ 2728, 964, 403, 2711, 848, 2713, 2714, 843, 386, 863,
+ /* 2690 */ 965, 2710, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2709,
+ /* 2700 */ 2185, 2185, 2748, 2185, 845, 2185, 394, 2711, 848, 2713,
+ /* 2710 */ 2714, 843, 2185, 863, 2709, 2185, 2185, 2748, 2185, 2185,
+ /* 2720 */ 2185, 404, 2711, 848, 2713, 2714, 843, 2710, 863, 2185,
+ /* 2730 */ 2185, 2185, 2728, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 2740 */ 845, 2185, 2185, 2185, 2709, 2185, 2185, 2748, 2675, 2185,
+ /* 2750 */ 844, 395, 2711, 848, 2713, 2714, 843, 2710, 863, 2185,
+ /* 2760 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2728, 2185,
+ /* 2770 */ 845, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185,
+ /* 2780 */ 2185, 2185, 2185, 2185, 2675, 2185, 844, 845, 2185, 2185,
+ /* 2790 */ 2185, 2185, 2185, 2185, 2185, 2185, 2709, 2185, 2728, 2748,
+ /* 2800 */ 2185, 2185, 2185, 405, 2711, 848, 2713, 2714, 843, 2185,
+ /* 2810 */ 863, 2185, 2185, 2185, 2675, 2728, 844, 2185, 2185, 2185,
+ /* 2820 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 2830 */ 2185, 2675, 2709, 844, 2185, 2748, 2185, 2185, 2185, 396,
+ /* 2840 */ 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185, 2185,
+ /* 2850 */ 2185, 2710, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 2860 */ 2185, 2185, 2709, 2185, 845, 2748, 2185, 2185, 2185, 412,
+ /* 2870 */ 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185, 2709,
+ /* 2880 */ 2185, 2185, 2748, 2185, 2185, 2710, 413, 2711, 848, 2713,
+ /* 2890 */ 2714, 843, 2728, 863, 2185, 2185, 2185, 2185, 845, 2185,
+ /* 2900 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2675, 2185,
+ /* 2910 */ 844, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185,
+ /* 2920 */ 2185, 2185, 2185, 2185, 2185, 2185, 2728, 845, 2185, 2185,
+ /* 2930 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 2940 */ 2185, 2185, 2675, 2185, 844, 2185, 2185, 2185, 2185, 2185,
+ /* 2950 */ 2185, 2185, 2185, 2185, 2185, 2728, 2709, 2185, 2185, 2748,
+ /* 2960 */ 2185, 2185, 2185, 2722, 2711, 848, 2713, 2714, 843, 2185,
+ /* 2970 */ 863, 2675, 2185, 844, 2185, 2710, 2185, 2185, 2185, 2185,
+ /* 2980 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 845, 2185,
+ /* 2990 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 2721, 2711, 848,
+ /* 3000 */ 2713, 2714, 843, 2185, 863, 2185, 2185, 2185, 2710, 2185,
+ /* 3010 */ 2185, 2185, 2185, 2185, 2185, 2185, 2728, 2185, 2185, 2709,
+ /* 3020 */ 2185, 845, 2748, 2185, 2185, 2185, 2720, 2711, 848, 2713,
+ /* 3030 */ 2714, 843, 2675, 863, 844, 2185, 2185, 2185, 2185, 2185,
+ /* 3040 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2728,
+ /* 3050 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3060 */ 2185, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2185, 2185,
+ /* 3070 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3080 */ 2709, 2185, 2185, 2748, 2185, 2710, 2185, 432, 2711, 848,
+ /* 3090 */ 2713, 2714, 843, 2185, 863, 2185, 2185, 2185, 845, 2185,
+ /* 3100 */ 2185, 2185, 2710, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3110 */ 2185, 2185, 2185, 2709, 2185, 845, 2748, 2185, 2185, 2185,
+ /* 3120 */ 433, 2711, 848, 2713, 2714, 843, 2728, 863, 2710, 2185,
+ /* 3130 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3140 */ 2185, 845, 2675, 2728, 844, 2185, 2185, 2185, 2185, 2185,
+ /* 3150 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2675,
+ /* 3160 */ 2185, 844, 2185, 2185, 2185, 2710, 2185, 2185, 2185, 2728,
+ /* 3170 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 845, 2185,
+ /* 3180 */ 2185, 2185, 2185, 2185, 2185, 2675, 2185, 844, 2185, 2185,
+ /* 3190 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 429, 2711, 848,
+ /* 3200 */ 2713, 2714, 843, 2185, 863, 2185, 2728, 2709, 2185, 2185,
+ /* 3210 */ 2748, 2185, 2185, 2185, 434, 2711, 848, 2713, 2714, 843,
+ /* 3220 */ 2185, 863, 2675, 2185, 844, 2185, 2185, 2185, 2185, 2185,
+ /* 3230 */ 2185, 2185, 2185, 846, 2185, 2185, 2748, 2185, 2185, 2185,
+ /* 3240 */ 402, 2711, 848, 2713, 2714, 843, 2185, 863, 2185, 2185,
+ /* 3250 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3260 */ 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185, 2185,
+ /* 3270 */ 2709, 2185, 2185, 2748, 2185, 2185, 2185, 401, 2711, 848,
+ /* 3280 */ 2713, 2714, 843, 2185, 863,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 506, 507, 438, 379, 386, 391, 421, 389, 390, 519,
- /* 10 */ 408, 521, 12, 13, 14, 490, 392, 453, 12, 13,
- /* 20 */ 20, 0, 22, 459, 460, 8, 9, 379, 4, 12,
- /* 30 */ 13, 14, 15, 16, 20, 35, 20, 37, 436, 0,
- /* 40 */ 392, 516, 21, 37, 420, 24, 25, 26, 27, 28,
- /* 50 */ 29, 30, 31, 32, 440, 441, 421, 443, 20, 34,
- /* 60 */ 436, 447, 438, 421, 422, 2, 66, 432, 420, 391,
- /* 70 */ 392, 8, 9, 73, 66, 12, 13, 14, 15, 16,
- /* 80 */ 80, 0, 391, 392, 436, 419, 438, 21, 21, 487,
- /* 90 */ 488, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- /* 100 */ 498, 435, 36, 387, 38, 39, 40, 391, 484, 393,
- /* 110 */ 110, 487, 490, 113, 20, 491, 492, 493, 494, 495,
- /* 120 */ 496, 386, 498, 115, 389, 390, 420, 503, 20, 505,
- /* 130 */ 14, 114, 484, 509, 510, 487, 20, 113, 516, 491,
- /* 140 */ 492, 493, 494, 495, 496, 497, 498, 499, 500, 149,
- /* 150 */ 150, 113, 446, 529, 448, 50, 75, 76, 77, 78,
- /* 160 */ 79, 537, 81, 82, 83, 84, 85, 86, 87, 88,
- /* 170 */ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
- /* 180 */ 99, 100, 101, 102, 103, 104, 105, 106, 188, 189,
- /* 190 */ 512, 513, 514, 515, 20, 517, 518, 143, 198, 199,
- /* 200 */ 391, 392, 188, 189, 513, 514, 515, 168, 517, 518,
- /* 210 */ 517, 423, 173, 213, 426, 215, 525, 42, 525, 14,
- /* 220 */ 181, 215, 8, 9, 20, 20, 12, 13, 14, 15,
- /* 230 */ 16, 0, 379, 379, 543, 544, 543, 544, 420, 548,
- /* 240 */ 549, 548, 549, 149, 150, 392, 421, 429, 430, 249,
- /* 250 */ 250, 251, 392, 253, 254, 255, 256, 257, 258, 259,
+ /* 0 */ 518, 507, 508, 439, 520, 424, 522, 518, 526, 392,
+ /* 10 */ 393, 421, 12, 13, 14, 526, 392, 393, 424, 429,
+ /* 20 */ 20, 427, 22, 0, 460, 461, 544, 545, 392, 380,
+ /* 30 */ 440, 549, 550, 402, 545, 35, 412, 37, 549, 550,
+ /* 40 */ 421, 410, 393, 419, 392, 393, 33, 24, 25, 26,
+ /* 50 */ 27, 28, 29, 30, 31, 32, 8, 9, 43, 46,
+ /* 60 */ 12, 13, 14, 15, 16, 4, 447, 67, 449, 488,
+ /* 70 */ 421, 8, 9, 393, 74, 12, 13, 14, 15, 16,
+ /* 80 */ 499, 81, 488, 421, 23, 439, 437, 451, 439, 453,
+ /* 90 */ 379, 429, 381, 499, 12, 13, 392, 393, 392, 393,
+ /* 100 */ 454, 421, 440, 421, 22, 4, 460, 461, 47, 48,
+ /* 110 */ 49, 111, 430, 431, 114, 380, 380, 35, 412, 37,
+ /* 120 */ 8, 9, 421, 464, 12, 13, 14, 15, 16, 393,
+ /* 130 */ 513, 514, 515, 516, 485, 518, 519, 488, 20, 392,
+ /* 140 */ 393, 492, 493, 494, 495, 496, 497, 20, 499, 67,
+ /* 150 */ 150, 151, 388, 504, 22, 506, 392, 421, 394, 510,
+ /* 160 */ 511, 392, 393, 81, 482, 483, 514, 515, 516, 37,
+ /* 170 */ 518, 519, 437, 437, 494, 439, 20, 518, 526, 530,
+ /* 180 */ 518, 43, 167, 482, 483, 526, 74, 538, 526, 189,
+ /* 190 */ 190, 387, 445, 111, 390, 391, 544, 545, 20, 199,
+ /* 200 */ 200, 549, 550, 544, 545, 67, 544, 545, 549, 550,
+ /* 210 */ 392, 549, 550, 81, 214, 114, 216, 518, 514, 515,
+ /* 220 */ 516, 485, 518, 519, 488, 526, 401, 194, 492, 493,
+ /* 230 */ 494, 495, 496, 497, 122, 499, 226, 422, 502, 191,
+ /* 240 */ 504, 505, 506, 418, 545, 114, 510, 511, 549, 550,
+ /* 250 */ 250, 251, 252, 428, 254, 255, 256, 257, 258, 259,
/* 260 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
- /* 270 */ 270, 12, 13, 420, 407, 487, 18, 410, 20, 20,
- /* 280 */ 420, 22, 228, 229, 517, 27, 498, 73, 30, 436,
- /* 290 */ 436, 438, 525, 35, 35, 190, 37, 8, 9, 481,
- /* 300 */ 482, 12, 13, 14, 15, 16, 201, 14, 483, 20,
- /* 310 */ 52, 544, 54, 20, 420, 548, 549, 59, 60, 20,
- /* 320 */ 296, 22, 513, 514, 515, 66, 517, 518, 420, 71,
- /* 330 */ 391, 392, 73, 72, 296, 121, 37, 484, 430, 80,
- /* 340 */ 487, 166, 448, 193, 491, 492, 493, 494, 495, 496,
- /* 350 */ 411, 498, 4, 493, 501, 56, 503, 504, 505, 0,
- /* 360 */ 8, 9, 509, 510, 12, 13, 14, 15, 16, 110,
- /* 370 */ 112, 23, 113, 142, 143, 144, 145, 146, 147, 148,
- /* 380 */ 20, 123, 20, 24, 25, 26, 27, 28, 29, 30,
- /* 390 */ 31, 32, 20, 188, 46, 47, 48, 463, 113, 8,
- /* 400 */ 9, 187, 468, 12, 13, 14, 15, 16, 149, 150,
- /* 410 */ 391, 153, 154, 20, 156, 157, 158, 159, 160, 161,
- /* 420 */ 162, 163, 164, 165, 33, 251, 166, 169, 170, 171,
- /* 430 */ 172, 173, 174, 175, 176, 387, 178, 179, 180, 391,
- /* 440 */ 20, 393, 184, 185, 186, 143, 144, 188, 189, 191,
- /* 450 */ 148, 517, 302, 303, 304, 305, 251, 198, 199, 525,
- /* 460 */ 285, 286, 287, 288, 289, 290, 291, 292, 293, 450,
- /* 470 */ 423, 452, 213, 71, 215, 113, 72, 543, 544, 190,
- /* 480 */ 391, 188, 548, 549, 391, 392, 391, 392, 274, 275,
- /* 490 */ 276, 277, 278, 279, 280, 281, 282, 283, 284, 289,
- /* 500 */ 290, 291, 292, 293, 411, 114, 411, 420, 249, 250,
- /* 510 */ 251, 418, 253, 254, 255, 256, 257, 258, 259, 260,
- /* 520 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
- /* 530 */ 271, 12, 13, 113, 487, 37, 379, 438, 18, 20,
- /* 540 */ 251, 22, 113, 23, 251, 498, 286, 287, 288, 392,
- /* 550 */ 190, 122, 453, 89, 35, 37, 37, 205, 459, 460,
- /* 560 */ 40, 41, 473, 474, 44, 379, 8, 9, 481, 482,
- /* 570 */ 12, 13, 14, 15, 16, 55, 123, 420, 392, 166,
- /* 580 */ 394, 296, 20, 80, 408, 66, 517, 67, 68, 69,
- /* 590 */ 70, 71, 73, 436, 525, 438, 8, 9, 80, 80,
- /* 600 */ 12, 13, 14, 15, 16, 0, 420, 75, 76, 77,
- /* 610 */ 208, 251, 436, 544, 82, 83, 84, 548, 549, 155,
- /* 620 */ 88, 438, 436, 391, 438, 93, 94, 95, 96, 110,
- /* 630 */ 13, 99, 113, 113, 400, 103, 104, 105, 106, 237,
- /* 640 */ 238, 484, 459, 460, 487, 181, 182, 42, 491, 492,
- /* 650 */ 493, 494, 495, 496, 33, 498, 391, 392, 296, 195,
- /* 660 */ 503, 427, 505, 487, 488, 489, 509, 510, 149, 150,
- /* 670 */ 484, 151, 114, 487, 498, 323, 411, 491, 492, 493,
- /* 680 */ 494, 495, 496, 418, 498, 271, 249, 455, 456, 503,
- /* 690 */ 378, 505, 380, 113, 537, 509, 510, 80, 285, 286,
- /* 700 */ 287, 288, 289, 290, 291, 292, 293, 188, 189, 2,
- /* 710 */ 20, 149, 150, 215, 376, 8, 9, 198, 199, 12,
- /* 720 */ 13, 14, 15, 16, 0, 205, 206, 207, 437, 438,
- /* 730 */ 210, 4, 213, 420, 215, 12, 13, 14, 15, 16,
- /* 740 */ 400, 428, 463, 223, 224, 308, 309, 310, 311, 312,
- /* 750 */ 313, 314, 439, 271, 144, 273, 236, 417, 148, 239,
- /* 760 */ 198, 199, 242, 243, 244, 245, 246, 427, 249, 250,
- /* 770 */ 251, 37, 253, 254, 255, 256, 257, 258, 259, 260,
- /* 780 */ 261, 262, 263, 264, 265, 266, 267, 268, 269, 270,
- /* 790 */ 12, 13, 14, 20, 379, 22, 517, 37, 20, 66,
- /* 800 */ 22, 463, 420, 225, 525, 123, 468, 392, 3, 394,
- /* 810 */ 423, 429, 430, 35, 80, 37, 296, 434, 379, 123,
- /* 820 */ 437, 438, 543, 544, 22, 20, 490, 548, 549, 56,
- /* 830 */ 517, 392, 222, 394, 52, 420, 20, 227, 525, 37,
- /* 840 */ 230, 420, 232, 61, 66, 112, 64, 65, 115, 428,
- /* 850 */ 469, 436, 516, 438, 73, 517, 543, 544, 80, 420,
- /* 860 */ 439, 548, 549, 525, 391, 392, 142, 143, 144, 145,
- /* 870 */ 146, 147, 148, 177, 487, 436, 296, 438, 39, 40,
- /* 880 */ 190, 543, 544, 37, 411, 498, 548, 549, 110, 0,
- /* 890 */ 421, 113, 142, 143, 144, 145, 146, 147, 148, 484,
- /* 900 */ 57, 58, 487, 33, 379, 391, 491, 492, 493, 494,
- /* 910 */ 495, 496, 110, 498, 22, 45, 183, 392, 503, 114,
- /* 920 */ 505, 391, 392, 484, 509, 510, 487, 149, 150, 37,
- /* 930 */ 491, 492, 493, 494, 495, 496, 502, 498, 504, 391,
- /* 940 */ 392, 411, 503, 322, 505, 420, 391, 392, 509, 510,
- /* 950 */ 412, 373, 374, 375, 391, 392, 117, 118, 420, 120,
- /* 960 */ 420, 436, 502, 438, 504, 379, 188, 189, 428, 431,
- /* 970 */ 391, 392, 80, 23, 411, 215, 198, 199, 392, 439,
- /* 980 */ 394, 142, 421, 391, 392, 146, 420, 473, 474, 421,
- /* 990 */ 411, 213, 444, 215, 428, 190, 22, 47, 48, 444,
- /* 1000 */ 391, 392, 110, 411, 188, 439, 420, 247, 248, 484,
- /* 1010 */ 113, 37, 487, 20, 396, 397, 491, 492, 493, 494,
- /* 1020 */ 495, 496, 436, 498, 438, 298, 379, 249, 250, 251,
- /* 1030 */ 249, 253, 254, 255, 256, 257, 258, 259, 260, 261,
- /* 1040 */ 262, 263, 264, 265, 266, 267, 268, 269, 270, 12,
- /* 1050 */ 13, 379, 412, 444, 80, 166, 167, 20, 421, 22,
- /* 1060 */ 420, 215, 396, 397, 392, 183, 394, 251, 391, 392,
- /* 1070 */ 484, 431, 35, 487, 37, 550, 551, 491, 492, 493,
- /* 1080 */ 494, 495, 496, 436, 498, 405, 406, 379, 411, 503,
- /* 1090 */ 401, 505, 420, 247, 248, 509, 510, 22, 409, 217,
- /* 1100 */ 392, 379, 394, 66, 110, 213, 421, 215, 436, 212,
- /* 1110 */ 438, 214, 37, 398, 1, 2, 379, 80, 124, 125,
- /* 1120 */ 126, 127, 128, 129, 130, 131, 132, 133, 420, 135,
- /* 1130 */ 136, 137, 138, 139, 140, 141, 380, 391, 392, 424,
- /* 1140 */ 409, 249, 250, 246, 436, 398, 438, 110, 379, 3,
- /* 1150 */ 113, 187, 391, 392, 391, 392, 484, 411, 436, 487,
- /* 1160 */ 0, 392, 415, 491, 492, 493, 494, 495, 496, 420,
- /* 1170 */ 498, 424, 411, 436, 411, 503, 379, 505, 391, 392,
- /* 1180 */ 519, 509, 510, 190, 33, 110, 149, 150, 14, 420,
- /* 1190 */ 391, 392, 484, 296, 20, 487, 45, 379, 411, 491,
- /* 1200 */ 492, 493, 494, 495, 496, 436, 498, 438, 391, 392,
- /* 1210 */ 411, 503, 379, 505, 12, 13, 379, 509, 510, 379,
- /* 1220 */ 391, 392, 391, 392, 22, 188, 189, 114, 411, 391,
- /* 1230 */ 392, 482, 72, 436, 449, 198, 199, 35, 274, 37,
- /* 1240 */ 411, 20, 411, 20, 251, 14, 15, 16, 284, 411,
- /* 1250 */ 213, 416, 215, 484, 436, 0, 487, 391, 392, 541,
- /* 1260 */ 491, 492, 493, 494, 495, 496, 379, 498, 66, 436,
- /* 1270 */ 405, 406, 503, 436, 505, 379, 436, 411, 509, 510,
- /* 1280 */ 501, 142, 80, 504, 379, 146, 249, 250, 251, 0,
- /* 1290 */ 253, 254, 255, 256, 257, 258, 259, 260, 261, 262,
- /* 1300 */ 263, 264, 265, 266, 267, 268, 269, 270, 12, 13,
- /* 1310 */ 379, 379, 110, 478, 391, 392, 20, 379, 22, 391,
- /* 1320 */ 392, 379, 379, 436, 392, 534, 420, 463, 110, 13,
- /* 1330 */ 379, 35, 436, 37, 411, 433, 33, 431, 436, 411,
- /* 1340 */ 379, 436, 124, 125, 126, 127, 128, 129, 130, 131,
- /* 1350 */ 132, 133, 420, 135, 136, 137, 138, 139, 140, 141,
- /* 1360 */ 433, 379, 66, 436, 75, 76, 77, 436, 436, 33,
- /* 1370 */ 438, 82, 83, 84, 436, 552, 80, 88, 436, 436,
- /* 1380 */ 420, 517, 93, 94, 95, 96, 420, 436, 99, 525,
- /* 1390 */ 0, 420, 103, 104, 105, 106, 80, 436, 42, 439,
- /* 1400 */ 433, 391, 392, 436, 0, 439, 110, 543, 544, 113,
- /* 1410 */ 439, 413, 548, 549, 416, 213, 484, 215, 436, 487,
- /* 1420 */ 382, 383, 66, 491, 492, 493, 494, 495, 496, 116,
- /* 1430 */ 498, 116, 119, 116, 119, 503, 119, 505, 12, 13,
- /* 1440 */ 0, 509, 510, 53, 116, 149, 150, 119, 22, 33,
- /* 1450 */ 114, 249, 250, 33, 13, 13, 52, 231, 49, 233,
- /* 1460 */ 35, 35, 379, 37, 318, 263, 264, 265, 266, 267,
- /* 1470 */ 268, 269, 251, 33, 251, 392, 0, 52, 37, 37,
- /* 1480 */ 0, 149, 150, 37, 188, 189, 61, 62, 63, 64,
- /* 1490 */ 0, 66, 66, 0, 198, 199, 241, 520, 22, 395,
- /* 1500 */ 8, 9, 22, 420, 12, 13, 14, 15, 16, 213,
- /* 1510 */ 33, 215, 22, 420, 33, 22, 33, 13, 33, 436,
- /* 1520 */ 33, 438, 113, 513, 514, 515, 80, 517, 518, 33,
- /* 1530 */ 114, 408, 33, 408, 114, 33, 449, 112, 12, 13,
- /* 1540 */ 115, 37, 1, 2, 33, 249, 250, 251, 390, 253,
- /* 1550 */ 254, 255, 256, 257, 258, 259, 260, 261, 262, 263,
- /* 1560 */ 264, 265, 266, 267, 268, 269, 270, 484, 33, 1,
- /* 1570 */ 487, 33, 12, 13, 491, 492, 493, 494, 495, 496,
- /* 1580 */ 33, 498, 463, 33, 12, 13, 503, 19, 505, 12,
- /* 1590 */ 13, 114, 509, 510, 379, 114, 33, 114, 33, 114,
- /* 1600 */ 33, 114, 449, 35, 12, 13, 33, 392, 183, 540,
- /* 1610 */ 114, 540, 540, 114, 12, 13, 114, 192, 462, 51,
- /* 1620 */ 52, 196, 197, 320, 33, 114, 37, 202, 203, 61,
- /* 1630 */ 62, 63, 64, 33, 66, 420, 517, 540, 395, 213,
- /* 1640 */ 485, 215, 12, 13, 525, 13, 221, 12, 13, 114,
- /* 1650 */ 449, 436, 114, 438, 12, 13, 12, 13, 37, 12,
- /* 1660 */ 13, 114, 543, 544, 114, 392, 470, 548, 549, 37,
- /* 1670 */ 435, 379, 524, 247, 248, 249, 449, 114, 449, 114,
- /* 1680 */ 112, 114, 190, 115, 392, 524, 545, 114, 4, 263,
- /* 1690 */ 264, 265, 266, 267, 268, 269, 511, 527, 410, 484,
- /* 1700 */ 299, 80, 487, 19, 379, 114, 491, 492, 493, 494,
- /* 1710 */ 495, 496, 420, 498, 114, 147, 464, 392, 52, 35,
- /* 1720 */ 505, 20, 486, 20, 509, 510, 391, 230, 436, 475,
- /* 1730 */ 438, 480, 475, 400, 379, 211, 52, 400, 466, 391,
- /* 1740 */ 20, 392, 45, 59, 60, 420, 445, 392, 187, 392,
- /* 1750 */ 66, 379, 445, 442, 392, 391, 391, 445, 404, 111,
- /* 1760 */ 192, 436, 194, 438, 392, 197, 442, 109, 442, 442,
- /* 1770 */ 202, 403, 391, 391, 391, 420, 484, 108, 402, 487,
- /* 1780 */ 391, 384, 391, 491, 492, 493, 494, 495, 496, 221,
- /* 1790 */ 498, 436, 420, 438, 20, 50, 112, 505, 388, 115,
- /* 1800 */ 388, 509, 510, 384, 215, 475, 400, 400, 436, 484,
- /* 1810 */ 438, 20, 487, 438, 400, 20, 491, 492, 493, 494,
- /* 1820 */ 495, 496, 393, 498, 20, 465, 463, 400, 379, 463,
- /* 1830 */ 505, 393, 400, 20, 509, 510, 456, 400, 20, 484,
- /* 1840 */ 384, 392, 487, 450, 400, 379, 491, 492, 493, 494,
- /* 1850 */ 495, 496, 400, 498, 391, 400, 484, 384, 392, 487,
- /* 1860 */ 382, 382, 391, 491, 492, 493, 494, 495, 496, 420,
- /* 1870 */ 498, 420, 436, 420, 420, 436, 113, 505, 420, 420,
- /* 1880 */ 517, 420, 510, 517, 420, 436, 420, 438, 525, 420,
- /* 1890 */ 420, 525, 420, 538, 539, 420, 436, 234, 475, 477,
- /* 1900 */ 479, 398, 436, 20, 438, 474, 543, 544, 219, 543,
- /* 1910 */ 544, 548, 549, 218, 548, 549, 398, 472, 471, 391,
- /* 1920 */ 438, 464, 436, 307, 306, 379, 315, 461, 533, 533,
- /* 1930 */ 536, 457, 204, 484, 535, 533, 487, 317, 392, 316,
- /* 1940 */ 491, 492, 493, 494, 495, 496, 457, 498, 530, 532,
- /* 1950 */ 484, 300, 464, 487, 379, 531, 295, 491, 492, 493,
- /* 1960 */ 494, 495, 496, 324, 498, 294, 420, 392, 553, 319,
- /* 1970 */ 321, 523, 522, 392, 20, 547, 546, 123, 297, 393,
- /* 1980 */ 398, 490, 436, 398, 438, 436, 457, 436, 539, 436,
- /* 1990 */ 528, 526, 436, 457, 436, 420, 196, 454, 436, 398,
- /* 2000 */ 113, 398, 450, 508, 196, 436, 451, 461, 398, 450,
- /* 2010 */ 416, 436, 398, 438, 392, 379, 436, 113, 22, 436,
- /* 2020 */ 436, 38, 425, 436, 436, 391, 436, 381, 392, 436,
- /* 2030 */ 484, 436, 436, 487, 436, 436, 398, 491, 492, 493,
- /* 2040 */ 494, 495, 496, 436, 498, 436, 467, 385, 436, 436,
- /* 2050 */ 422, 379, 384, 436, 483, 436, 420, 414, 399, 484,
- /* 2060 */ 436, 436, 487, 436, 392, 436, 491, 492, 493, 494,
- /* 2070 */ 495, 496, 436, 498, 438, 422, 436, 436, 414, 414,
- /* 2080 */ 476, 377, 0, 0, 458, 0, 45, 0, 37, 458,
- /* 2090 */ 240, 37, 420, 37, 37, 240, 0, 37, 37, 240,
- /* 2100 */ 37, 0, 0, 240, 0, 37, 0, 37, 436, 0,
- /* 2110 */ 438, 22, 0, 37, 235, 0, 221, 542, 0, 221,
- /* 2120 */ 484, 222, 215, 487, 213, 0, 0, 491, 492, 493,
- /* 2130 */ 494, 495, 496, 0, 498, 209, 208, 0, 0, 154,
- /* 2140 */ 379, 49, 49, 0, 37, 0, 0, 37, 0, 52,
- /* 2150 */ 0, 0, 49, 392, 49, 0, 484, 0, 45, 487,
- /* 2160 */ 0, 0, 0, 491, 492, 493, 494, 495, 496, 379,
- /* 2170 */ 498, 0, 500, 0, 0, 173, 37, 0, 173, 0,
- /* 2180 */ 0, 420, 392, 0, 0, 0, 0, 551, 0, 0,
- /* 2190 */ 379, 49, 0, 0, 45, 0, 0, 436, 0, 438,
- /* 2200 */ 0, 0, 0, 392, 0, 0, 0, 0, 0, 0,
- /* 2210 */ 420, 0, 0, 0, 0, 0, 0, 0, 0, 379,
- /* 2220 */ 0, 22, 461, 154, 0, 153, 436, 0, 438, 152,
- /* 2230 */ 0, 420, 392, 0, 0, 66, 0, 50, 66, 0,
- /* 2240 */ 50, 22, 66, 22, 0, 484, 0, 436, 487, 438,
- /* 2250 */ 0, 461, 491, 492, 493, 494, 495, 496, 0, 498,
- /* 2260 */ 420, 0, 37, 66, 42, 37, 37, 0, 42, 37,
- /* 2270 */ 0, 14, 0, 42, 484, 52, 436, 487, 438, 37,
- /* 2280 */ 42, 491, 492, 493, 494, 495, 496, 52, 498, 52,
- /* 2290 */ 45, 42, 33, 0, 0, 484, 49, 49, 487, 43,
- /* 2300 */ 49, 0, 491, 492, 493, 494, 495, 496, 0, 498,
- /* 2310 */ 42, 0, 204, 379, 49, 0, 0, 0, 49, 0,
- /* 2320 */ 0, 37, 42, 52, 484, 0, 392, 487, 74, 37,
- /* 2330 */ 379, 491, 492, 493, 494, 495, 496, 52, 498, 42,
- /* 2340 */ 0, 37, 52, 392, 42, 0, 37, 379, 52, 42,
- /* 2350 */ 0, 0, 0, 0, 420, 0, 0, 22, 37, 0,
- /* 2360 */ 392, 121, 119, 22, 37, 37, 37, 37, 37, 37,
- /* 2370 */ 436, 420, 438, 0, 37, 37, 37, 33, 0, 33,
- /* 2380 */ 37, 0, 22, 0, 37, 37, 22, 436, 420, 438,
- /* 2390 */ 22, 22, 22, 0, 37, 0, 54, 0, 0, 37,
- /* 2400 */ 37, 0, 22, 37, 436, 20, 438, 0, 37, 37,
- /* 2410 */ 379, 0, 114, 113, 49, 0, 113, 0, 484, 37,
- /* 2420 */ 226, 487, 22, 392, 22, 491, 492, 493, 494, 495,
- /* 2430 */ 496, 190, 498, 0, 3, 484, 33, 301, 487, 113,
- /* 2440 */ 50, 37, 491, 492, 493, 494, 495, 496, 114, 498,
- /* 2450 */ 190, 420, 484, 37, 190, 487, 190, 33, 196, 491,
- /* 2460 */ 492, 493, 494, 495, 496, 111, 498, 436, 190, 438,
- /* 2470 */ 50, 113, 33, 200, 200, 220, 49, 33, 225, 216,
- /* 2480 */ 33, 114, 301, 49, 109, 80, 33, 113, 37, 113,
- /* 2490 */ 379, 114, 3, 114, 33, 37, 37, 113, 49, 113,
- /* 2500 */ 37, 114, 113, 392, 301, 114, 114, 379, 114, 113,
- /* 2510 */ 37, 37, 37, 114, 33, 484, 49, 0, 487, 0,
- /* 2520 */ 392, 113, 491, 492, 493, 494, 495, 496, 114, 498,
- /* 2530 */ 42, 420, 114, 379, 0, 114, 113, 42, 113, 113,
- /* 2540 */ 0, 113, 193, 114, 42, 33, 392, 436, 420, 438,
- /* 2550 */ 2, 111, 111, 272, 22, 249, 114, 49, 49, 114,
- /* 2560 */ 114, 285, 114, 113, 436, 113, 438, 113, 113, 113,
- /* 2570 */ 379, 22, 0, 113, 420, 113, 252, 113, 113, 42,
- /* 2580 */ 114, 113, 113, 392, 49, 197, 114, 37, 22, 113,
- /* 2590 */ 436, 113, 438, 122, 114, 484, 113, 113, 487, 193,
- /* 2600 */ 123, 192, 491, 492, 493, 494, 495, 496, 22, 498,
- /* 2610 */ 37, 420, 484, 22, 113, 487, 37, 114, 113, 491,
- /* 2620 */ 492, 493, 494, 495, 496, 193, 498, 436, 114, 438,
- /* 2630 */ 37, 379, 114, 37, 114, 37, 226, 114, 484, 37,
- /* 2640 */ 134, 487, 113, 33, 392, 491, 492, 493, 494, 495,
- /* 2650 */ 496, 113, 498, 37, 379, 134, 134, 113, 134, 22,
- /* 2660 */ 22, 74, 73, 37, 37, 37, 37, 392, 37, 37,
- /* 2670 */ 37, 37, 420, 37, 80, 484, 37, 37, 487, 80,
- /* 2680 */ 33, 107, 491, 492, 493, 494, 495, 496, 436, 498,
- /* 2690 */ 438, 37, 107, 37, 37, 420, 22, 37, 37, 37,
- /* 2700 */ 80, 37, 37, 37, 37, 37, 22, 37, 0, 37,
- /* 2710 */ 52, 436, 0, 438, 37, 379, 0, 42, 42, 37,
- /* 2720 */ 42, 52, 0, 52, 37, 52, 0, 42, 392, 37,
- /* 2730 */ 0, 22, 37, 0, 33, 22, 484, 22, 21, 487,
- /* 2740 */ 379, 22, 22, 491, 492, 493, 494, 495, 496, 21,
- /* 2750 */ 498, 20, 554, 392, 554, 554, 420, 554, 554, 484,
- /* 2760 */ 554, 554, 487, 554, 554, 554, 491, 492, 493, 494,
- /* 2770 */ 495, 496, 436, 498, 438, 554, 554, 554, 554, 554,
- /* 2780 */ 554, 420, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 2790 */ 554, 554, 554, 554, 554, 554, 554, 436, 554, 438,
- /* 2800 */ 554, 379, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 2810 */ 554, 554, 554, 554, 392, 554, 554, 554, 554, 554,
- /* 2820 */ 484, 554, 379, 487, 554, 554, 554, 491, 492, 493,
- /* 2830 */ 494, 495, 496, 554, 498, 392, 554, 554, 554, 554,
- /* 2840 */ 554, 554, 420, 554, 554, 484, 554, 554, 487, 554,
- /* 2850 */ 554, 554, 491, 492, 493, 494, 495, 496, 436, 498,
- /* 2860 */ 438, 554, 554, 420, 554, 554, 554, 554, 554, 554,
- /* 2870 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 436,
- /* 2880 */ 554, 438, 554, 379, 554, 554, 554, 554, 554, 554,
- /* 2890 */ 554, 554, 554, 554, 554, 554, 392, 554, 554, 554,
- /* 2900 */ 554, 554, 554, 554, 554, 554, 484, 554, 554, 487,
- /* 2910 */ 554, 554, 554, 491, 492, 493, 494, 495, 496, 554,
- /* 2920 */ 498, 554, 554, 554, 420, 554, 554, 484, 554, 554,
- /* 2930 */ 487, 554, 554, 554, 491, 492, 493, 494, 495, 496,
- /* 2940 */ 436, 498, 438, 554, 379, 554, 554, 554, 554, 554,
- /* 2950 */ 554, 554, 554, 554, 554, 554, 554, 392, 554, 554,
- /* 2960 */ 554, 554, 554, 379, 554, 554, 554, 554, 554, 554,
- /* 2970 */ 554, 554, 554, 554, 554, 554, 392, 554, 554, 554,
- /* 2980 */ 554, 554, 554, 554, 554, 420, 554, 554, 484, 554,
- /* 2990 */ 554, 487, 554, 554, 554, 491, 492, 493, 494, 495,
- /* 3000 */ 496, 436, 498, 438, 420, 554, 554, 554, 554, 554,
- /* 3010 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 3020 */ 436, 554, 438, 554, 379, 554, 554, 554, 554, 554,
- /* 3030 */ 554, 554, 554, 554, 554, 554, 554, 392, 554, 554,
- /* 3040 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 484,
- /* 3050 */ 554, 554, 487, 554, 554, 554, 491, 492, 493, 494,
- /* 3060 */ 495, 496, 554, 498, 554, 420, 554, 554, 484, 554,
- /* 3070 */ 554, 487, 554, 554, 554, 491, 492, 493, 494, 495,
- /* 3080 */ 496, 436, 498, 438, 554, 554, 554, 554, 554, 554,
- /* 3090 */ 554, 554, 554, 379, 554, 554, 554, 554, 554, 554,
- /* 3100 */ 554, 554, 554, 554, 554, 554, 392, 554, 379, 554,
- /* 3110 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 3120 */ 554, 392, 554, 554, 554, 554, 554, 554, 554, 484,
- /* 3130 */ 554, 554, 487, 554, 420, 554, 491, 492, 493, 494,
- /* 3140 */ 495, 496, 554, 498, 554, 554, 554, 554, 554, 420,
- /* 3150 */ 436, 554, 438, 554, 554, 554, 554, 554, 554, 554,
- /* 3160 */ 554, 554, 554, 554, 554, 436, 554, 438, 554, 554,
- /* 3170 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 3180 */ 554, 554, 554, 554, 554, 554, 554, 554, 554, 554,
- /* 3190 */ 554, 554, 554, 554, 554, 554, 554, 554, 484, 554,
- /* 3200 */ 554, 487, 554, 554, 554, 491, 492, 493, 494, 495,
- /* 3210 */ 496, 554, 498, 484, 554, 554, 487, 554, 554, 554,
- /* 3220 */ 491, 492, 493, 494, 495, 496, 554, 498, 376, 376,
- /* 3230 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3240 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3250 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3260 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3270 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3280 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3290 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3300 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3310 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3320 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3330 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3340 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3350 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3360 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3370 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3380 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3390 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3400 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3410 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3420 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3430 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3440 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3450 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3460 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3470 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3480 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3490 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3500 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3510 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3520 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3530 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3540 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3550 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3560 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3570 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3580 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3590 */ 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
- /* 3600 */ 376, 376, 376, 376,
+ /* 270 */ 270, 271, 12, 13, 456, 457, 20, 18, 22, 20,
+ /* 280 */ 20, 20, 22, 514, 515, 516, 27, 518, 519, 30,
+ /* 290 */ 12, 13, 114, 37, 35, 35, 214, 37, 216, 484,
+ /* 300 */ 188, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ /* 310 */ 14, 2, 53, 57, 55, 37, 20, 8, 9, 60,
+ /* 320 */ 61, 12, 13, 14, 15, 16, 387, 67, 73, 390,
+ /* 330 */ 391, 72, 250, 251, 74, 0, 303, 304, 305, 306,
+ /* 340 */ 272, 81, 274, 20, 392, 421, 264, 265, 266, 267,
+ /* 350 */ 268, 269, 270, 67, 430, 431, 21, 20, 167, 24,
+ /* 360 */ 25, 26, 27, 28, 29, 30, 31, 32, 114, 145,
+ /* 370 */ 252, 111, 113, 149, 114, 143, 144, 145, 146, 147,
+ /* 380 */ 148, 149, 401, 124, 374, 375, 376, 275, 276, 277,
+ /* 390 */ 278, 279, 280, 281, 282, 283, 284, 285, 297, 113,
+ /* 400 */ 8, 9, 116, 20, 12, 13, 14, 15, 16, 428,
+ /* 410 */ 150, 151, 20, 154, 155, 124, 157, 158, 159, 160,
+ /* 420 */ 161, 162, 163, 164, 165, 166, 474, 475, 297, 170,
+ /* 430 */ 171, 172, 173, 174, 175, 176, 177, 114, 179, 180,
+ /* 440 */ 181, 167, 422, 423, 185, 186, 187, 223, 18, 189,
+ /* 450 */ 190, 192, 228, 23, 20, 231, 114, 233, 21, 199,
+ /* 460 */ 200, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ /* 470 */ 184, 41, 42, 21, 214, 45, 216, 286, 287, 288,
+ /* 480 */ 289, 290, 291, 292, 293, 294, 56, 503, 36, 505,
+ /* 490 */ 38, 39, 40, 41, 216, 380, 20, 420, 68, 69,
+ /* 500 */ 70, 71, 72, 290, 291, 292, 293, 294, 393, 421,
+ /* 510 */ 250, 251, 252, 436, 254, 255, 256, 257, 258, 259,
+ /* 520 */ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
+ /* 530 */ 270, 271, 272, 12, 13, 20, 421, 449, 22, 380,
+ /* 540 */ 20, 20, 392, 22, 114, 12, 13, 14, 15, 16,
+ /* 550 */ 111, 297, 437, 37, 439, 213, 35, 215, 37, 72,
+ /* 560 */ 0, 287, 288, 289, 125, 126, 127, 128, 129, 130,
+ /* 570 */ 131, 132, 133, 134, 380, 136, 137, 138, 139, 140,
+ /* 580 */ 141, 142, 152, 191, 439, 413, 250, 393, 67, 247,
+ /* 590 */ 422, 441, 442, 421, 444, 74, 437, 81, 448, 454,
+ /* 600 */ 485, 433, 81, 488, 432, 460, 461, 492, 493, 494,
+ /* 610 */ 495, 496, 497, 20, 499, 421, 40, 41, 143, 504,
+ /* 620 */ 297, 506, 147, 189, 190, 510, 511, 111, 392, 393,
+ /* 630 */ 421, 437, 111, 439, 114, 114, 206, 207, 208, 297,
+ /* 640 */ 431, 211, 424, 491, 252, 309, 310, 311, 312, 313,
+ /* 650 */ 314, 315, 73, 538, 224, 225, 8, 9, 392, 393,
+ /* 660 */ 12, 13, 14, 15, 16, 150, 151, 237, 272, 517,
+ /* 670 */ 240, 150, 151, 243, 244, 245, 246, 247, 412, 485,
+ /* 680 */ 435, 445, 488, 438, 439, 419, 492, 493, 494, 495,
+ /* 690 */ 496, 497, 3, 499, 118, 119, 209, 121, 504, 20,
+ /* 700 */ 506, 22, 392, 393, 510, 511, 488, 399, 0, 20,
+ /* 710 */ 189, 190, 14, 23, 199, 200, 20, 499, 20, 143,
+ /* 720 */ 199, 200, 412, 147, 416, 238, 239, 297, 252, 169,
+ /* 730 */ 214, 111, 216, 425, 174, 214, 57, 216, 48, 49,
+ /* 740 */ 90, 409, 182, 150, 151, 125, 126, 127, 128, 129,
+ /* 750 */ 130, 131, 132, 133, 134, 380, 136, 137, 138, 139,
+ /* 760 */ 140, 141, 142, 115, 20, 51, 250, 251, 393, 437,
+ /* 770 */ 395, 250, 251, 252, 421, 254, 255, 256, 257, 258,
+ /* 780 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
+ /* 790 */ 269, 270, 271, 12, 13, 14, 421, 37, 380, 392,
+ /* 800 */ 393, 20, 33, 22, 115, 13, 156, 37, 14, 15,
+ /* 810 */ 16, 393, 437, 395, 439, 46, 35, 297, 37, 0,
+ /* 820 */ 488, 489, 8, 9, 81, 380, 12, 13, 14, 15,
+ /* 830 */ 16, 499, 182, 183, 4, 20, 483, 14, 393, 421,
+ /* 840 */ 395, 53, 503, 20, 505, 380, 196, 380, 67, 19,
+ /* 850 */ 62, 491, 445, 65, 66, 437, 0, 439, 392, 393,
+ /* 860 */ 485, 408, 81, 488, 411, 35, 421, 492, 493, 494,
+ /* 870 */ 495, 496, 497, 81, 499, 167, 168, 517, 412, 504,
+ /* 880 */ 191, 506, 437, 53, 439, 510, 511, 189, 392, 393,
+ /* 890 */ 60, 61, 111, 409, 388, 114, 124, 67, 392, 421,
+ /* 900 */ 394, 421, 437, 485, 437, 191, 488, 429, 412, 429,
+ /* 910 */ 492, 493, 494, 495, 496, 497, 202, 499, 440, 14,
+ /* 920 */ 440, 437, 504, 20, 506, 20, 413, 188, 510, 511,
+ /* 930 */ 485, 150, 151, 488, 421, 191, 464, 492, 493, 494,
+ /* 940 */ 495, 496, 497, 113, 499, 432, 116, 392, 252, 504,
+ /* 950 */ 252, 506, 20, 8, 9, 510, 511, 12, 13, 14,
+ /* 960 */ 15, 16, 143, 144, 145, 146, 147, 148, 149, 380,
+ /* 970 */ 189, 190, 488, 489, 490, 422, 216, 380, 33, 37,
+ /* 980 */ 199, 200, 393, 499, 395, 4, 216, 392, 393, 0,
+ /* 990 */ 518, 392, 393, 392, 393, 214, 252, 216, 526, 143,
+ /* 1000 */ 144, 145, 146, 147, 148, 149, 191, 412, 248, 249,
+ /* 1010 */ 421, 412, 189, 412, 275, 377, 544, 545, 248, 249,
+ /* 1020 */ 206, 549, 550, 81, 285, 417, 437, 34, 439, 474,
+ /* 1030 */ 475, 250, 251, 252, 437, 254, 255, 256, 257, 258,
+ /* 1040 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
+ /* 1050 */ 269, 270, 271, 12, 13, 380, 438, 439, 380, 37,
+ /* 1060 */ 115, 20, 73, 22, 58, 59, 502, 252, 393, 505,
+ /* 1070 */ 395, 3, 392, 393, 485, 252, 35, 488, 37, 0,
+ /* 1080 */ 144, 492, 493, 494, 495, 496, 497, 479, 499, 392,
+ /* 1090 */ 393, 380, 412, 504, 191, 506, 421, 1, 2, 510,
+ /* 1100 */ 511, 22, 464, 81, 393, 380, 395, 469, 67, 412,
+ /* 1110 */ 392, 393, 437, 22, 439, 437, 76, 77, 78, 392,
+ /* 1120 */ 393, 189, 81, 83, 84, 85, 144, 145, 37, 89,
+ /* 1130 */ 412, 149, 421, 491, 94, 95, 96, 97, 324, 412,
+ /* 1140 */ 100, 392, 393, 380, 104, 105, 106, 107, 437, 381,
+ /* 1150 */ 439, 13, 111, 392, 393, 114, 518, 380, 464, 517,
+ /* 1160 */ 485, 412, 437, 488, 526, 229, 230, 492, 493, 494,
+ /* 1170 */ 495, 496, 497, 412, 499, 392, 393, 392, 393, 504,
+ /* 1180 */ 380, 506, 544, 545, 252, 510, 511, 549, 550, 392,
+ /* 1190 */ 393, 150, 151, 392, 393, 412, 485, 412, 184, 488,
+ /* 1200 */ 437, 22, 111, 492, 493, 494, 495, 496, 497, 412,
+ /* 1210 */ 499, 115, 518, 412, 437, 504, 37, 506, 380, 81,
+ /* 1220 */ 526, 510, 511, 12, 13, 392, 393, 392, 393, 380,
+ /* 1230 */ 189, 190, 218, 22, 392, 393, 470, 437, 544, 545,
+ /* 1240 */ 199, 200, 393, 549, 550, 412, 35, 412, 37, 422,
+ /* 1250 */ 397, 398, 397, 398, 412, 214, 0, 216, 399, 380,
+ /* 1260 */ 421, 380, 380, 380, 406, 407, 421, 380, 380, 380,
+ /* 1270 */ 421, 380, 406, 407, 33, 437, 380, 464, 67, 440,
+ /* 1280 */ 299, 410, 469, 421, 425, 440, 437, 0, 439, 393,
+ /* 1290 */ 111, 250, 251, 252, 432, 254, 255, 256, 257, 258,
+ /* 1300 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
+ /* 1310 */ 269, 270, 271, 12, 13, 124, 437, 421, 437, 437,
+ /* 1320 */ 437, 20, 0, 22, 437, 437, 437, 434, 437, 33,
+ /* 1330 */ 437, 518, 421, 437, 485, 439, 35, 488, 37, 526,
+ /* 1340 */ 53, 492, 493, 494, 495, 496, 497, 414, 499, 464,
+ /* 1350 */ 417, 440, 0, 504, 0, 506, 115, 544, 545, 510,
+ /* 1360 */ 511, 434, 549, 550, 437, 43, 8, 9, 67, 178,
+ /* 1370 */ 12, 13, 14, 15, 16, 434, 22, 464, 437, 383,
+ /* 1380 */ 384, 485, 81, 117, 488, 33, 120, 319, 492, 493,
+ /* 1390 */ 494, 495, 496, 497, 117, 499, 117, 120, 117, 120,
+ /* 1400 */ 504, 120, 506, 518, 13, 33, 510, 511, 13, 33,
+ /* 1410 */ 2, 526, 111, 380, 0, 114, 8, 9, 0, 422,
+ /* 1420 */ 12, 13, 14, 15, 16, 214, 393, 216, 37, 544,
+ /* 1430 */ 545, 518, 37, 67, 549, 550, 22, 33, 33, 526,
+ /* 1440 */ 22, 232, 33, 234, 150, 151, 1, 2, 74, 33,
+ /* 1450 */ 50, 150, 151, 422, 421, 33, 33, 544, 545, 248,
+ /* 1460 */ 249, 250, 549, 550, 33, 33, 33, 33, 33, 422,
+ /* 1470 */ 437, 422, 439, 115, 37, 264, 265, 266, 267, 268,
+ /* 1480 */ 269, 270, 116, 12, 13, 12, 13, 115, 12, 13,
+ /* 1490 */ 189, 190, 33, 33, 33, 12, 13, 520, 242, 553,
+ /* 1500 */ 199, 200, 0, 12, 13, 12, 13, 12, 13, 12,
+ /* 1510 */ 13, 12, 13, 450, 114, 214, 542, 216, 485, 115,
+ /* 1520 */ 115, 488, 12, 13, 115, 492, 493, 494, 495, 496,
+ /* 1530 */ 497, 115, 499, 12, 13, 535, 33, 115, 115, 506,
+ /* 1540 */ 521, 33, 37, 510, 511, 33, 115, 115, 115, 115,
+ /* 1550 */ 115, 250, 251, 252, 396, 254, 255, 256, 257, 258,
+ /* 1560 */ 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
+ /* 1570 */ 269, 270, 271, 33, 115, 115, 115, 33, 76, 77,
+ /* 1580 */ 78, 79, 80, 33, 82, 83, 84, 85, 86, 87,
+ /* 1590 */ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ /* 1600 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ /* 1610 */ 1, 421, 37, 13, 13, 0, 37, 321, 115, 409,
+ /* 1620 */ 114, 409, 380, 115, 250, 450, 391, 115, 19, 123,
+ /* 1630 */ 450, 541, 463, 541, 541, 393, 541, 37, 37, 396,
+ /* 1640 */ 486, 393, 450, 436, 35, 471, 450, 450, 525, 525,
+ /* 1650 */ 546, 380, 512, 216, 528, 115, 81, 411, 465, 115,
+ /* 1660 */ 81, 52, 53, 421, 393, 115, 53, 300, 487, 54,
+ /* 1670 */ 20, 62, 63, 64, 65, 392, 67, 20, 476, 437,
+ /* 1680 */ 231, 439, 481, 401, 476, 401, 212, 467, 20, 392,
+ /* 1690 */ 46, 393, 421, 446, 443, 393, 446, 188, 392, 323,
+ /* 1700 */ 393, 392, 443, 446, 443, 443, 112, 110, 437, 405,
+ /* 1710 */ 439, 392, 404, 392, 109, 403, 392, 392, 392, 20,
+ /* 1720 */ 385, 216, 113, 51, 385, 116, 389, 485, 476, 389,
+ /* 1730 */ 488, 401, 401, 20, 492, 493, 494, 495, 496, 497,
+ /* 1740 */ 0, 499, 439, 401, 20, 394, 20, 401, 506, 380,
+ /* 1750 */ 394, 466, 510, 511, 401, 20, 485, 148, 401, 488,
+ /* 1760 */ 401, 20, 393, 492, 493, 494, 495, 496, 497, 451,
+ /* 1770 */ 499, 457, 401, 380, 392, 385, 401, 506, 392, 383,
+ /* 1780 */ 383, 510, 511, 421, 421, 421, 393, 385, 235, 421,
+ /* 1790 */ 421, 421, 437, 480, 421, 114, 476, 437, 421, 421,
+ /* 1800 */ 421, 421, 193, 20, 195, 421, 437, 198, 439, 399,
+ /* 1810 */ 478, 475, 203, 220, 421, 219, 76, 77, 78, 472,
+ /* 1820 */ 437, 473, 392, 83, 84, 85, 439, 399, 308, 89,
+ /* 1830 */ 437, 222, 439, 534, 94, 95, 96, 97, 437, 307,
+ /* 1840 */ 100, 316, 380, 205, 104, 105, 106, 107, 537, 534,
+ /* 1850 */ 465, 318, 458, 536, 485, 393, 458, 488, 317, 380,
+ /* 1860 */ 533, 492, 493, 494, 495, 496, 497, 498, 499, 500,
+ /* 1870 */ 501, 301, 393, 296, 531, 534, 532, 465, 485, 295,
+ /* 1880 */ 325, 488, 554, 421, 523, 492, 493, 494, 495, 496,
+ /* 1890 */ 497, 322, 499, 548, 320, 20, 547, 393, 491, 437,
+ /* 1900 */ 421, 439, 124, 437, 298, 524, 399, 394, 35, 458,
+ /* 1910 */ 399, 458, 437, 197, 437, 437, 437, 529, 439, 527,
+ /* 1920 */ 455, 437, 399, 437, 114, 399, 53, 437, 509, 197,
+ /* 1930 */ 399, 451, 539, 540, 452, 62, 63, 64, 65, 380,
+ /* 1940 */ 67, 417, 399, 451, 393, 114, 22, 485, 426, 38,
+ /* 1950 */ 488, 437, 393, 437, 492, 493, 494, 495, 496, 497,
+ /* 1960 */ 399, 499, 382, 385, 485, 437, 437, 488, 392, 386,
+ /* 1970 */ 0, 492, 493, 494, 495, 496, 497, 477, 499, 437,
+ /* 1980 */ 421, 378, 437, 437, 437, 506, 113, 468, 0, 116,
+ /* 1990 */ 511, 437, 400, 437, 437, 437, 437, 437, 439, 437,
+ /* 2000 */ 437, 437, 437, 437, 437, 437, 415, 459, 437, 437,
+ /* 2010 */ 437, 423, 423, 551, 552, 0, 0, 415, 484, 415,
+ /* 2020 */ 46, 37, 241, 37, 37, 241, 37, 0, 37, 37,
+ /* 2030 */ 241, 37, 380, 241, 0, 37, 0, 37, 0, 22,
+ /* 2040 */ 459, 0, 0, 0, 485, 393, 37, 488, 236, 0,
+ /* 2050 */ 222, 492, 493, 494, 495, 496, 497, 184, 499, 0,
+ /* 2060 */ 222, 216, 223, 214, 0, 0, 193, 210, 209, 0,
+ /* 2070 */ 197, 198, 0, 421, 0, 155, 203, 204, 50, 50,
+ /* 2080 */ 0, 37, 0, 0, 37, 53, 0, 50, 0, 437,
+ /* 2090 */ 0, 439, 46, 0, 0, 222, 174, 37, 50, 540,
+ /* 2100 */ 0, 0, 0, 0, 0, 0, 0, 174, 0, 0,
+ /* 2110 */ 0, 380, 0, 0, 462, 0, 0, 0, 0, 0,
+ /* 2120 */ 0, 0, 0, 0, 393, 0, 0, 0, 0, 0,
+ /* 2130 */ 380, 0, 0, 46, 50, 0, 0, 485, 0, 0,
+ /* 2140 */ 488, 0, 0, 393, 492, 493, 494, 495, 496, 497,
+ /* 2150 */ 0, 499, 421, 0, 380, 0, 22, 0, 155, 0,
+ /* 2160 */ 154, 0, 0, 153, 0, 22, 22, 393, 437, 0,
+ /* 2170 */ 439, 421, 0, 0, 67, 51, 0, 37, 67, 0,
+ /* 2180 */ 0, 51, 37, 0, 0, 0, 37, 437, 0, 439,
+ /* 2190 */ 43, 37, 46, 462, 43, 421, 14, 0, 0, 380,
+ /* 2200 */ 67, 53, 37, 43, 67, 53, 43, 33, 50, 53,
+ /* 2210 */ 44, 437, 393, 439, 43, 0, 485, 50, 50, 488,
+ /* 2220 */ 0, 0, 0, 492, 493, 494, 495, 496, 497, 43,
+ /* 2230 */ 499, 205, 0, 0, 0, 485, 0, 50, 488, 50,
+ /* 2240 */ 421, 0, 492, 493, 494, 495, 496, 497, 37, 499,
+ /* 2250 */ 75, 380, 53, 43, 0, 37, 437, 53, 439, 485,
+ /* 2260 */ 43, 0, 488, 37, 393, 53, 492, 493, 494, 495,
+ /* 2270 */ 496, 497, 0, 499, 43, 37, 53, 0, 43, 0,
+ /* 2280 */ 0, 0, 0, 0, 37, 22, 0, 22, 37, 380,
+ /* 2290 */ 120, 0, 421, 543, 37, 37, 22, 37, 0, 122,
+ /* 2300 */ 33, 37, 393, 37, 485, 37, 37, 488, 437, 33,
+ /* 2310 */ 439, 492, 493, 494, 495, 496, 497, 22, 499, 380,
+ /* 2320 */ 501, 37, 37, 22, 37, 37, 552, 0, 22, 0,
+ /* 2330 */ 421, 22, 393, 462, 37, 0, 380, 0, 0, 37,
+ /* 2340 */ 0, 37, 0, 0, 55, 37, 437, 22, 439, 393,
+ /* 2350 */ 20, 37, 37, 37, 115, 0, 485, 114, 114, 488,
+ /* 2360 */ 421, 0, 50, 492, 493, 494, 495, 496, 497, 191,
+ /* 2370 */ 499, 462, 22, 37, 0, 22, 437, 421, 439, 0,
+ /* 2380 */ 0, 3, 33, 191, 114, 114, 191, 191, 115, 37,
+ /* 2390 */ 115, 191, 114, 437, 485, 439, 37, 488, 197, 302,
+ /* 2400 */ 110, 492, 493, 494, 495, 496, 497, 226, 499, 201,
+ /* 2410 */ 201, 217, 112, 380, 221, 51, 51, 33, 227, 33,
+ /* 2420 */ 115, 33, 115, 50, 485, 115, 393, 488, 33, 81,
+ /* 2430 */ 33, 492, 493, 494, 495, 496, 497, 114, 499, 50,
+ /* 2440 */ 114, 485, 114, 37, 488, 114, 114, 380, 492, 493,
+ /* 2450 */ 494, 495, 496, 497, 421, 499, 115, 3, 33, 115,
+ /* 2460 */ 393, 115, 50, 37, 37, 37, 37, 37, 37, 115,
+ /* 2470 */ 437, 115, 439, 33, 50, 0, 380, 0, 43, 0,
+ /* 2480 */ 114, 43, 115, 115, 114, 114, 194, 0, 421, 393,
+ /* 2490 */ 114, 198, 286, 194, 43, 33, 115, 114, 273, 112,
+ /* 2500 */ 2, 253, 112, 22, 437, 302, 439, 302, 115, 50,
+ /* 2510 */ 193, 115, 250, 114, 114, 114, 114, 421, 485, 114,
+ /* 2520 */ 50, 488, 115, 114, 114, 492, 493, 494, 495, 496,
+ /* 2530 */ 497, 115, 499, 437, 22, 439, 114, 114, 0, 194,
+ /* 2540 */ 43, 123, 50, 124, 22, 22, 22, 115, 114, 227,
+ /* 2550 */ 114, 114, 485, 114, 37, 488, 115, 114, 114, 492,
+ /* 2560 */ 493, 494, 495, 496, 497, 115, 499, 37, 115, 114,
+ /* 2570 */ 380, 114, 37, 115, 37, 115, 37, 37, 115, 115,
+ /* 2580 */ 37, 485, 135, 393, 488, 33, 114, 135, 492, 493,
+ /* 2590 */ 494, 495, 496, 497, 380, 499, 135, 114, 37, 114,
+ /* 2600 */ 135, 22, 75, 74, 22, 37, 37, 393, 37, 380,
+ /* 2610 */ 37, 421, 37, 37, 37, 37, 108, 37, 37, 108,
+ /* 2620 */ 37, 33, 393, 81, 37, 81, 37, 437, 37, 439,
+ /* 2630 */ 22, 37, 81, 37, 37, 421, 37, 37, 37, 380,
+ /* 2640 */ 37, 37, 22, 37, 0, 53, 37, 0, 43, 37,
+ /* 2650 */ 421, 437, 393, 439, 43, 53, 0, 43, 37, 0,
+ /* 2660 */ 53, 37, 43, 53, 0, 0, 437, 37, 439, 37,
+ /* 2670 */ 22, 0, 22, 33, 22, 485, 21, 555, 488, 22,
+ /* 2680 */ 421, 21, 492, 493, 494, 495, 496, 497, 22, 499,
+ /* 2690 */ 20, 380, 555, 555, 555, 555, 437, 555, 439, 485,
+ /* 2700 */ 555, 555, 488, 555, 393, 555, 492, 493, 494, 495,
+ /* 2710 */ 496, 497, 555, 499, 485, 555, 555, 488, 555, 555,
+ /* 2720 */ 555, 492, 493, 494, 495, 496, 497, 380, 499, 555,
+ /* 2730 */ 555, 555, 421, 555, 555, 555, 555, 555, 555, 555,
+ /* 2740 */ 393, 555, 555, 555, 485, 555, 555, 488, 437, 555,
+ /* 2750 */ 439, 492, 493, 494, 495, 496, 497, 380, 499, 555,
+ /* 2760 */ 555, 555, 555, 555, 555, 555, 555, 555, 421, 555,
+ /* 2770 */ 393, 555, 555, 555, 380, 555, 555, 555, 555, 555,
+ /* 2780 */ 555, 555, 555, 555, 437, 555, 439, 393, 555, 555,
+ /* 2790 */ 555, 555, 555, 555, 555, 555, 485, 555, 421, 488,
+ /* 2800 */ 555, 555, 555, 492, 493, 494, 495, 496, 497, 555,
+ /* 2810 */ 499, 555, 555, 555, 437, 421, 439, 555, 555, 555,
+ /* 2820 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 2830 */ 555, 437, 485, 439, 555, 488, 555, 555, 555, 492,
+ /* 2840 */ 493, 494, 495, 496, 497, 555, 499, 555, 555, 555,
+ /* 2850 */ 555, 380, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 2860 */ 555, 555, 485, 555, 393, 488, 555, 555, 555, 492,
+ /* 2870 */ 493, 494, 495, 496, 497, 555, 499, 555, 555, 485,
+ /* 2880 */ 555, 555, 488, 555, 555, 380, 492, 493, 494, 495,
+ /* 2890 */ 496, 497, 421, 499, 555, 555, 555, 555, 393, 555,
+ /* 2900 */ 555, 555, 555, 555, 555, 555, 555, 555, 437, 555,
+ /* 2910 */ 439, 555, 555, 555, 380, 555, 555, 555, 555, 555,
+ /* 2920 */ 555, 555, 555, 555, 555, 555, 421, 393, 555, 555,
+ /* 2930 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 2940 */ 555, 555, 437, 555, 439, 555, 555, 555, 555, 555,
+ /* 2950 */ 555, 555, 555, 555, 555, 421, 485, 555, 555, 488,
+ /* 2960 */ 555, 555, 555, 492, 493, 494, 495, 496, 497, 555,
+ /* 2970 */ 499, 437, 555, 439, 555, 380, 555, 555, 555, 555,
+ /* 2980 */ 555, 555, 555, 555, 555, 555, 555, 555, 393, 555,
+ /* 2990 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494,
+ /* 3000 */ 495, 496, 497, 555, 499, 555, 555, 555, 380, 555,
+ /* 3010 */ 555, 555, 555, 555, 555, 555, 421, 555, 555, 485,
+ /* 3020 */ 555, 393, 488, 555, 555, 555, 492, 493, 494, 495,
+ /* 3030 */ 496, 497, 437, 499, 439, 555, 555, 555, 555, 555,
+ /* 3040 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 421,
+ /* 3050 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 3060 */ 555, 555, 555, 555, 555, 437, 555, 439, 555, 555,
+ /* 3070 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 3080 */ 485, 555, 555, 488, 555, 380, 555, 492, 493, 494,
+ /* 3090 */ 495, 496, 497, 555, 499, 555, 555, 555, 393, 555,
+ /* 3100 */ 555, 555, 380, 555, 555, 555, 555, 555, 555, 555,
+ /* 3110 */ 555, 555, 555, 485, 555, 393, 488, 555, 555, 555,
+ /* 3120 */ 492, 493, 494, 495, 496, 497, 421, 499, 380, 555,
+ /* 3130 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 3140 */ 555, 393, 437, 421, 439, 555, 555, 555, 555, 555,
+ /* 3150 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 437,
+ /* 3160 */ 555, 439, 555, 555, 555, 380, 555, 555, 555, 421,
+ /* 3170 */ 555, 555, 555, 555, 555, 555, 555, 555, 393, 555,
+ /* 3180 */ 555, 555, 555, 555, 555, 437, 555, 439, 555, 555,
+ /* 3190 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494,
+ /* 3200 */ 495, 496, 497, 555, 499, 555, 421, 485, 555, 555,
+ /* 3210 */ 488, 555, 555, 555, 492, 493, 494, 495, 496, 497,
+ /* 3220 */ 555, 499, 437, 555, 439, 555, 555, 555, 555, 555,
+ /* 3230 */ 555, 555, 555, 485, 555, 555, 488, 555, 555, 555,
+ /* 3240 */ 492, 493, 494, 495, 496, 497, 555, 499, 555, 555,
+ /* 3250 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 3260 */ 555, 555, 555, 555, 555, 555, 555, 555, 555, 555,
+ /* 3270 */ 485, 555, 555, 488, 555, 555, 555, 492, 493, 494,
+ /* 3280 */ 495, 496, 497, 555, 499, 377, 377, 377, 377, 377,
+ /* 3290 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3300 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3310 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3320 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3330 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3340 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3350 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3360 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3370 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3380 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3390 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3400 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3410 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3420 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3430 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3440 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3450 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3460 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3470 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3480 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3490 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3500 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3510 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3520 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3530 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3540 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3550 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3560 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3570 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3580 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3590 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3600 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3610 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3620 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3630 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3640 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3650 */ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
+ /* 3660 */ 377, 377,
};
-#define YY_SHIFT_COUNT (964)
+#define YY_SHIFT_COUNT (966)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (2733)
+#define YY_SHIFT_MAX (2671)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 520, 0, 259, 0, 519, 519, 519, 519, 519, 519,
- /* 10 */ 519, 519, 519, 519, 519, 519, 778, 1037, 1037, 1296,
- /* 20 */ 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
- /* 30 */ 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
- /* 40 */ 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037,
- /* 50 */ 38, 362, 897, 420, 285, 580, 285, 285, 420, 420,
- /* 60 */ 285, 1202, 285, 258, 1202, 24, 285, 16, 1426, 562,
- /* 70 */ 562, 108, 108, 1426, 1426, 348, 348, 562, 14, 94,
- /* 80 */ 116, 116, 174, 108, 108, 108, 108, 108, 108, 108,
- /* 90 */ 108, 108, 108, 108, 204, 372, 393, 108, 108, 261,
- /* 100 */ 16, 108, 204, 108, 16, 108, 108, 108, 108, 16,
- /* 110 */ 108, 108, 16, 108, 16, 16, 16, 108, 404, 214,
- /* 120 */ 214, 994, 994, 1218, 532, 175, 67, 892, 892, 892,
- /* 130 */ 892, 892, 892, 892, 892, 892, 892, 892, 892, 892,
- /* 140 */ 892, 892, 892, 892, 892, 892, 839, 805, 14, 94,
- /* 150 */ 843, 843, 518, 690, 690, 690, 482, 482, 1160, 617,
- /* 160 */ 518, 261, 16, 453, 16, 16, 414, 16, 16, 503,
- /* 170 */ 16, 503, 503, 682, 25, 994, 994, 994, 994, 994,
- /* 180 */ 994, 1568, 1289, 21, 289, 413, 413, 352, 437, 150,
- /* 190 */ 210, 299, 260, 205, 293, 6, 6, 360, 950, 993,
- /* 200 */ 974, 974, 974, 105, 974, 816, 773, 1356, 1221, 1174,
- /* 210 */ 1139, 882, 1221, 1221, 1223, 1316, 1316, 1146, 870, 727,
- /* 220 */ 617, 1401, 1666, 1701, 1703, 1497, 261, 1703, 261, 1524,
- /* 230 */ 1701, 1720, 1697, 1720, 1697, 1561, 1701, 1720, 1701, 1697,
- /* 240 */ 1561, 1561, 1561, 1648, 1658, 1701, 1701, 1669, 1701, 1701,
- /* 250 */ 1701, 1774, 1745, 1774, 1745, 1703, 261, 261, 1791, 261,
- /* 260 */ 1795, 1804, 261, 1795, 261, 1813, 261, 1818, 261, 261,
- /* 270 */ 1701, 261, 1774, 16, 16, 16, 16, 16, 16, 16,
- /* 280 */ 16, 16, 16, 16, 1701, 25, 25, 1774, 503, 503,
- /* 290 */ 503, 1663, 1763, 1703, 404, 1883, 1689, 1695, 1791, 404,
- /* 300 */ 1401, 1701, 503, 1616, 1618, 1616, 1618, 1611, 1728, 1616,
- /* 310 */ 1620, 1623, 1651, 1401, 1661, 1671, 1639, 1649, 1650, 1720,
- /* 320 */ 1954, 1854, 1681, 1795, 404, 404, 1618, 503, 503, 503,
- /* 330 */ 503, 1618, 503, 1800, 404, 503, 1818, 404, 1887, 503,
- /* 340 */ 1808, 1818, 404, 682, 404, 1720, 503, 503, 503, 503,
- /* 350 */ 503, 503, 503, 503, 503, 503, 503, 503, 503, 503,
- /* 360 */ 503, 503, 503, 503, 503, 503, 503, 503, 1904, 503,
- /* 370 */ 1701, 404, 1996, 1983, 1774, 3228, 3228, 3228, 3228, 3228,
- /* 380 */ 3228, 3228, 3228, 3228, 3228, 3228, 3228, 81, 1425, 359,
- /* 390 */ 1684, 391, 17, 558, 63, 707, 1492, 231, 724, 588,
- /* 400 */ 588, 588, 588, 588, 588, 588, 588, 588, 750, 610,
- /* 410 */ 464, 66, 723, 723, 402, 733, 39, 782, 578, 578,
- /* 420 */ 760, 846, 578, 889, 802, 1075, 54, 302, 302, 1231,
- /* 430 */ 1113, 964, 1231, 1231, 1231, 1404, 1255, 1336, 605, 1151,
- /* 440 */ 696, 1440, 1313, 1315, 1317, 1328, 734, 1441, 1442, 1476,
- /* 450 */ 1480, 1490, 1493, 1226, 1416, 1420, 8, 1477, 1481, 1485,
- /* 460 */ 1487, 1332, 1303, 621, 1483, 1496, 1499, 1541, 1502, 781,
- /* 470 */ 1511, 1409, 1535, 1538, 1547, 1550, 1526, 1560, 1572, 1577,
- /* 480 */ 1592, 1602, 1630, 1635, 1642, 1644, 1647, 1563, 1565, 1567,
- /* 490 */ 1573, 1591, 1600, 429, 1446, 498, 1589, 1504, 1632, 1621,
- /* 500 */ 1390, 2082, 2083, 2085, 2041, 2087, 2051, 1850, 2054, 2056,
- /* 510 */ 2057, 1855, 2096, 2060, 2061, 1859, 2063, 2101, 2102, 1863,
- /* 520 */ 2104, 2068, 2106, 2070, 2109, 2089, 2112, 2076, 1879, 2115,
- /* 530 */ 1895, 2118, 1898, 1899, 1907, 1911, 2125, 2126, 2133, 1926,
- /* 540 */ 1928, 2137, 2138, 1985, 2092, 2093, 2143, 2107, 2145, 2146,
- /* 550 */ 2110, 2097, 2148, 2103, 2150, 2113, 2151, 2157, 2160, 2105,
- /* 560 */ 2155, 2161, 2162, 2171, 2173, 2174, 2002, 2139, 2177, 2005,
- /* 570 */ 2179, 2180, 2183, 2184, 2185, 2186, 2188, 2189, 2198, 2200,
- /* 580 */ 2201, 2202, 2204, 2205, 2206, 2207, 2208, 2209, 2211, 2212,
- /* 590 */ 2142, 2192, 2149, 2193, 2195, 2196, 2213, 2214, 2215, 2216,
- /* 600 */ 2217, 2218, 2199, 2220, 2069, 2224, 2072, 2227, 2077, 2230,
- /* 610 */ 2233, 2219, 2187, 2221, 2190, 2234, 2169, 2236, 2172, 2225,
- /* 620 */ 2239, 2176, 2244, 2197, 2246, 2250, 2228, 2223, 2222, 2258,
- /* 630 */ 2229, 2235, 2226, 2261, 2232, 2237, 2231, 2267, 2242, 2270,
- /* 640 */ 2245, 2238, 2259, 2247, 2248, 2257, 2251, 2272, 2256, 2249,
- /* 650 */ 2293, 2294, 2301, 2308, 2268, 2108, 2311, 2247, 2265, 2315,
- /* 660 */ 2247, 2269, 2316, 2317, 2254, 2319, 2320, 2284, 2271, 2280,
- /* 670 */ 2325, 2292, 2285, 2297, 2340, 2304, 2290, 2302, 2345, 2309,
- /* 680 */ 2296, 2307, 2350, 2351, 2352, 2353, 2355, 2356, 2240, 2243,
- /* 690 */ 2321, 2335, 2359, 2341, 2327, 2328, 2329, 2330, 2331, 2332,
- /* 700 */ 2337, 2338, 2339, 2344, 2346, 2343, 2347, 2360, 2348, 2373,
- /* 710 */ 2364, 2378, 2368, 2381, 2369, 2342, 2383, 2370, 2357, 2393,
- /* 720 */ 2395, 2397, 2362, 2398, 2363, 2401, 2380, 2385, 2366, 2371,
- /* 730 */ 2372, 2298, 2300, 2407, 2241, 2194, 2253, 2303, 2255, 2247,
- /* 740 */ 2365, 2411, 2260, 2382, 2400, 2415, 2263, 2402, 2264, 2262,
- /* 750 */ 2417, 2433, 2266, 2273, 2278, 2274, 2431, 2403, 2136, 2326,
- /* 760 */ 2334, 2358, 2367, 2404, 2416, 2374, 2390, 2354, 2420, 2375,
- /* 770 */ 2377, 2424, 2439, 2379, 2376, 2384, 2386, 2387, 2444, 2427,
- /* 780 */ 2434, 2389, 2447, 2181, 2405, 2391, 2453, 2396, 2451, 2392,
- /* 790 */ 2394, 2489, 2461, 2203, 2458, 2459, 2463, 2473, 2474, 2475,
- /* 800 */ 2399, 2414, 2449, 2276, 2481, 2467, 2517, 2519, 2408, 2488,
- /* 810 */ 2418, 2421, 2423, 2425, 2349, 2426, 2534, 2495, 2388, 2540,
- /* 820 */ 2429, 2428, 2406, 2502, 2409, 2512, 2440, 2281, 2441, 2548,
- /* 830 */ 2532, 2306, 2442, 2445, 2450, 2452, 2454, 2455, 2456, 2446,
- /* 840 */ 2508, 2460, 2462, 2509, 2448, 2549, 2324, 2464, 2465, 2572,
- /* 850 */ 2466, 2468, 2432, 2537, 2469, 2471, 2247, 2535, 2476, 2478,
- /* 860 */ 2472, 2483, 2484, 2477, 2566, 2586, 2591, 2410, 2480, 2550,
- /* 870 */ 2573, 2501, 2503, 2579, 2505, 2514, 2593, 2450, 2518, 2596,
- /* 880 */ 2452, 2520, 2598, 2454, 2523, 2602, 2455, 2506, 2521, 2522,
- /* 890 */ 2524, 2529, 2610, 2538, 2616, 2544, 2610, 2610, 2637, 2587,
- /* 900 */ 2589, 2638, 2626, 2627, 2628, 2629, 2631, 2632, 2633, 2634,
- /* 910 */ 2636, 2639, 2640, 2594, 2574, 2599, 2585, 2647, 2654, 2656,
- /* 920 */ 2657, 2674, 2660, 2661, 2662, 2620, 2344, 2664, 2346, 2665,
- /* 930 */ 2666, 2667, 2668, 2684, 2670, 2708, 2672, 2658, 2675, 2712,
- /* 940 */ 2677, 2669, 2676, 2716, 2682, 2671, 2678, 2722, 2687, 2673,
- /* 950 */ 2685, 2726, 2692, 2730, 2709, 2695, 2733, 2713, 2701, 2715,
- /* 960 */ 2717, 2719, 2720, 2728, 2731,
+ /* 0 */ 430, 0, 260, 0, 521, 521, 521, 521, 521, 521,
+ /* 10 */ 521, 521, 521, 521, 521, 521, 781, 1041, 1041, 1301,
+ /* 20 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
+ /* 30 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
+ /* 40 */ 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041, 1041,
+ /* 50 */ 323, 520, 342, 178, 131, 254, 131, 131, 178, 178,
+ /* 60 */ 131, 82, 131, 259, 82, 101, 131, 127, 1211, 515,
+ /* 70 */ 515, 156, 156, 1211, 1211, 61, 61, 515, 434, 593,
+ /* 80 */ 296, 296, 118, 156, 156, 156, 156, 156, 156, 156,
+ /* 90 */ 156, 156, 156, 156, 261, 337, 383, 156, 156, 255,
+ /* 100 */ 127, 156, 261, 156, 127, 156, 156, 156, 156, 127,
+ /* 110 */ 156, 156, 127, 156, 127, 127, 127, 156, 579, 112,
+ /* 120 */ 112, 439, 439, 620, 1040, 15, 437, 516, 516, 516,
+ /* 130 */ 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
+ /* 140 */ 516, 516, 516, 516, 516, 516, 576, 689, 434, 593,
+ /* 150 */ 1006, 1006, 942, 903, 903, 903, 68, 68, 989, 792,
+ /* 160 */ 942, 255, 127, 291, 127, 127, 396, 127, 127, 743,
+ /* 170 */ 127, 743, 743, 772, 993, 439, 439, 439, 439, 439,
+ /* 180 */ 439, 1609, 1740, 335, 392, 191, 191, 814, 336, 33,
+ /* 190 */ 213, 256, 274, 698, 823, 278, 278, 744, 690, 815,
+ /* 200 */ 132, 132, 132, 714, 132, 932, 679, 138, 476, 905,
+ /* 210 */ 475, 1014, 476, 476, 696, 1138, 1138, 1068, 13, 981,
+ /* 220 */ 792, 1367, 1613, 1650, 1657, 1449, 255, 1657, 255, 1474,
+ /* 230 */ 1650, 1668, 1644, 1668, 1644, 1509, 1650, 1668, 1650, 1644,
+ /* 240 */ 1509, 1509, 1509, 1594, 1597, 1650, 1650, 1605, 1650, 1650,
+ /* 250 */ 1650, 1699, 1672, 1699, 1672, 1657, 255, 255, 1713, 255,
+ /* 260 */ 1724, 1726, 255, 1724, 255, 1735, 255, 1741, 255, 255,
+ /* 270 */ 1650, 255, 1699, 127, 127, 127, 127, 127, 127, 127,
+ /* 280 */ 127, 127, 127, 127, 1650, 993, 993, 1699, 743, 743,
+ /* 290 */ 743, 1553, 1681, 1657, 579, 1783, 1593, 1596, 1713, 579,
+ /* 300 */ 1367, 1650, 743, 1520, 1532, 1520, 1532, 1525, 1638, 1520,
+ /* 310 */ 1533, 1541, 1570, 1367, 1577, 1584, 1555, 1569, 1574, 1668,
+ /* 320 */ 1875, 1778, 1606, 1724, 579, 579, 1532, 743, 743, 743,
+ /* 330 */ 743, 1532, 743, 1716, 579, 743, 1741, 579, 1810, 743,
+ /* 340 */ 1732, 1741, 579, 772, 579, 1668, 743, 743, 743, 743,
+ /* 350 */ 743, 743, 743, 743, 743, 743, 743, 743, 743, 743,
+ /* 360 */ 743, 743, 743, 743, 743, 743, 743, 743, 1831, 743,
+ /* 370 */ 1650, 579, 1924, 1911, 1699, 3285, 3285, 3285, 3285, 3285,
+ /* 380 */ 3285, 3285, 3285, 3285, 3285, 3285, 3285, 1502, 1873, 23,
+ /* 390 */ 830, 945, 648, 1358, 309, 1408, 48, 819, 856, 63,
+ /* 400 */ 63, 63, 63, 63, 63, 63, 63, 63, 232, 452,
+ /* 410 */ 224, 650, 533, 533, 487, 286, 560, 788, 10, 10,
+ /* 420 */ 760, 770, 10, 708, 1091, 1179, 936, 982, 982, 794,
+ /* 430 */ 1096, 739, 794, 794, 794, 1287, 1256, 1241, 1322, 769,
+ /* 440 */ 1191, 1352, 1266, 1277, 1279, 1281, 1022, 1391, 1395, 1079,
+ /* 450 */ 1354, 1414, 1418, 1209, 1372, 1404, 1366, 1405, 1409, 1416,
+ /* 460 */ 1422, 1294, 1296, 1376, 1423, 1431, 1432, 1445, 1433, 1374,
+ /* 470 */ 1434, 1400, 1435, 1459, 1460, 1461, 1471, 1473, 1476, 1483,
+ /* 480 */ 1491, 1493, 1495, 1497, 1499, 1510, 1521, 1503, 1508, 1512,
+ /* 490 */ 1540, 1544, 1550, 1506, 1575, 1437, 1505, 1600, 1601, 1579,
+ /* 500 */ 1615, 1970, 1988, 2015, 1974, 2016, 1984, 1781, 1986, 1987,
+ /* 510 */ 1989, 1784, 2027, 1991, 1992, 1789, 1994, 2041, 2042, 1792,
+ /* 520 */ 2034, 1998, 2036, 2000, 2038, 2017, 2043, 2009, 1812, 2049,
+ /* 530 */ 1828, 2059, 1838, 1839, 1845, 1849, 2064, 2065, 2072, 1857,
+ /* 540 */ 1859, 2069, 2074, 1920, 2028, 2029, 2080, 2044, 2082, 2083,
+ /* 550 */ 2047, 2032, 2086, 2037, 2088, 2046, 2090, 2093, 2094, 2048,
+ /* 560 */ 2100, 2101, 2102, 2103, 2104, 2105, 1922, 2060, 2106, 1933,
+ /* 570 */ 2108, 2109, 2110, 2112, 2113, 2115, 2116, 2117, 2118, 2119,
+ /* 580 */ 2120, 2121, 2122, 2123, 2125, 2126, 2127, 2128, 2129, 2131,
+ /* 590 */ 2084, 2132, 2087, 2135, 2136, 2138, 2139, 2141, 2142, 2150,
+ /* 600 */ 2153, 2155, 2134, 2157, 2003, 2159, 2006, 2161, 2010, 2162,
+ /* 610 */ 2164, 2143, 2124, 2144, 2130, 2169, 2107, 2172, 2111, 2140,
+ /* 620 */ 2173, 2133, 2176, 2137, 2179, 2180, 2145, 2148, 2147, 2183,
+ /* 630 */ 2149, 2152, 2151, 2184, 2154, 2156, 2160, 2185, 2165, 2188,
+ /* 640 */ 2146, 2163, 2174, 2158, 2167, 2182, 2168, 2197, 2166, 2171,
+ /* 650 */ 2198, 2215, 2220, 2221, 2186, 2026, 2222, 2158, 2187, 2232,
+ /* 660 */ 2158, 2189, 2233, 2234, 2175, 2236, 2241, 2211, 2199, 2210,
+ /* 670 */ 2254, 2218, 2204, 2217, 2261, 2226, 2212, 2231, 2272, 2238,
+ /* 680 */ 2223, 2235, 2277, 2279, 2280, 2281, 2282, 2283, 2177, 2170,
+ /* 690 */ 2247, 2263, 2286, 2265, 2251, 2257, 2258, 2260, 2264, 2266,
+ /* 700 */ 2268, 2269, 2284, 2267, 2276, 2285, 2287, 2274, 2288, 2291,
+ /* 710 */ 2295, 2298, 2301, 2327, 2306, 2289, 2329, 2309, 2297, 2335,
+ /* 720 */ 2337, 2338, 2302, 2340, 2304, 2342, 2308, 2343, 2325, 2330,
+ /* 730 */ 2314, 2315, 2316, 2239, 2243, 2355, 2178, 2191, 2181, 2244,
+ /* 740 */ 2193, 2158, 2312, 2361, 2192, 2336, 2350, 2374, 2194, 2353,
+ /* 750 */ 2195, 2201, 2379, 2380, 2196, 2208, 2200, 2209, 2378, 2349,
+ /* 760 */ 2097, 2270, 2273, 2271, 2275, 2352, 2359, 2278, 2364, 2300,
+ /* 770 */ 2365, 2290, 2305, 2384, 2386, 2307, 2323, 2326, 2328, 2310,
+ /* 780 */ 2388, 2373, 2389, 2331, 2395, 2203, 2348, 2341, 2397, 2332,
+ /* 790 */ 2406, 2344, 2346, 2454, 2425, 2205, 2426, 2427, 2428, 2429,
+ /* 800 */ 2430, 2431, 2354, 2356, 2412, 2206, 2440, 2424, 2475, 2477,
+ /* 810 */ 2366, 2435, 2367, 2368, 2370, 2371, 2292, 2376, 2479, 2438,
+ /* 820 */ 2293, 2487, 2381, 2383, 2299, 2451, 2317, 2462, 2387, 2225,
+ /* 830 */ 2390, 2498, 2481, 2262, 2393, 2396, 2399, 2400, 2401, 2402,
+ /* 840 */ 2405, 2407, 2459, 2409, 2410, 2470, 2416, 2512, 2248, 2422,
+ /* 850 */ 2423, 2538, 2432, 2434, 2345, 2497, 2436, 2418, 2158, 2492,
+ /* 860 */ 2437, 2439, 2441, 2443, 2444, 2419, 2522, 2523, 2524, 2322,
+ /* 870 */ 2450, 2517, 2530, 2455, 2453, 2535, 2457, 2458, 2537, 2399,
+ /* 880 */ 2460, 2539, 2400, 2463, 2540, 2401, 2464, 2543, 2402, 2447,
+ /* 890 */ 2452, 2461, 2465, 2472, 2552, 2483, 2561, 2485, 2552, 2552,
+ /* 900 */ 2579, 2527, 2529, 2582, 2568, 2569, 2571, 2573, 2575, 2576,
+ /* 910 */ 2577, 2578, 2580, 2581, 2583, 2542, 2508, 2544, 2511, 2588,
+ /* 920 */ 2587, 2589, 2591, 2608, 2594, 2596, 2597, 2551, 2267, 2599,
+ /* 930 */ 2276, 2600, 2601, 2603, 2604, 2620, 2606, 2644, 2609, 2592,
+ /* 940 */ 2605, 2647, 2612, 2602, 2611, 2656, 2621, 2607, 2614, 2659,
+ /* 950 */ 2624, 2610, 2619, 2664, 2630, 2665, 2648, 2632, 2671, 2650,
+ /* 960 */ 2640, 2652, 2655, 2657, 2666, 2660, 2670,
};
#define YY_REDUCE_COUNT (386)
-#define YY_REDUCE_MIN (-510)
-#define YY_REDUCE_MAX (2729)
+#define YY_REDUCE_MIN (-518)
+#define YY_REDUCE_MAX (2785)
static const short yy_reduce_ofst[] = {
- /* 0 */ 338, -376, -147, 157, 186, 415, 439, 586, 672, 708,
- /* 10 */ 769, 932, 1083, 1215, 1292, 1325, -352, 1355, 525, 1372,
- /* 20 */ 1449, 1466, 1546, 1575, 1636, 1672, 1761, 1790, 1811, 1840,
- /* 30 */ 1934, 1951, 1968, 2031, 2111, 2128, 2154, 2191, 2252, 2275,
- /* 40 */ 2336, 2361, 2422, 2443, 2504, 2565, 2584, 2645, 2714, 2729,
- /* 50 */ -309, 313, -66, -322, 279, 864, 1119, 1363, -191, 1010,
- /* 60 */ 1366, 176, -307, -386, -398, -233, 69, -182, -212, -436,
- /* 70 */ 99, 93, 265, 47, 387, -382, -265, 183, -294, 383,
- /* 80 */ -284, 48, -140, -61, 95, 473, 530, 548, 555, 579,
- /* 90 */ 592, 677, 746, 609, 89, 232, 19, 563, 761, 340,
- /* 100 */ 87, 763, 514, 787, 421, 799, 817, 829, 831, 538,
- /* 110 */ 838, 866, 540, 923, 382, 566, 640, 928, 747, -506,
- /* 120 */ -506, -358, -175, -365, 689, -510, 312, -146, 647, 722,
- /* 130 */ 737, 797, 818, 833, 837, 840, 887, 896, 905, 931,
- /* 140 */ 938, 942, 943, 951, 961, 982, -334, -475, -106, 291,
- /* 150 */ 618, 666, 680, -475, -378, 336, 434, 460, 715, -133,
- /* 160 */ 865, 234, 749, 835, 960, 966, 779, 906, -92, 902,
- /* 170 */ 971, 927, 967, 998, 1038, -415, 469, 561, 568, 637,
- /* 180 */ 685, 381, 731, 756, 785, 661, 661, 823, 718, 791,
- /* 190 */ 977, 1104, 661, 1093, 1093, 1123, 1125, 1087, 1158, 1153,
- /* 200 */ 1069, 1071, 1072, 1156, 1097, 1093, 1243, 1155, 1201, 1273,
- /* 210 */ 1235, 1196, 1227, 1229, 1093, 1148, 1161, 1141, 1185, 1170,
- /* 220 */ 1288, 1252, 1236, 1335, 1254, 1251, 1333, 1257, 1337, 1272,
- /* 230 */ 1348, 1349, 1301, 1357, 1307, 1311, 1364, 1362, 1365, 1312,
- /* 240 */ 1324, 1326, 1327, 1354, 1368, 1381, 1382, 1376, 1383, 1389,
- /* 250 */ 1391, 1397, 1410, 1419, 1412, 1330, 1406, 1407, 1375, 1414,
- /* 260 */ 1429, 1360, 1427, 1438, 1432, 1380, 1437, 1393, 1444, 1452,
- /* 270 */ 1463, 1455, 1456, 1451, 1453, 1454, 1458, 1459, 1461, 1464,
- /* 280 */ 1469, 1470, 1472, 1475, 1471, 1478, 1479, 1473, 1436, 1439,
- /* 290 */ 1460, 1421, 1422, 1423, 1503, 1431, 1445, 1447, 1482, 1518,
- /* 300 */ 1457, 1528, 1486, 1395, 1474, 1396, 1489, 1394, 1399, 1402,
- /* 310 */ 1417, 1424, 1418, 1488, 1448, 1450, 1415, 1428, 1430, 1581,
- /* 320 */ 1491, 1462, 1465, 1586, 1582, 1585, 1529, 1549, 1551, 1553,
- /* 330 */ 1556, 1536, 1558, 1543, 1601, 1562, 1552, 1603, 1495, 1569,
- /* 340 */ 1555, 1559, 1610, 1594, 1614, 1622, 1580, 1583, 1584, 1587,
- /* 350 */ 1588, 1590, 1593, 1595, 1596, 1598, 1599, 1607, 1609, 1612,
- /* 360 */ 1613, 1617, 1619, 1624, 1625, 1627, 1629, 1640, 1597, 1641,
- /* 370 */ 1634, 1638, 1646, 1662, 1668, 1579, 1628, 1571, 1604, 1626,
- /* 380 */ 1631, 1643, 1664, 1653, 1665, 1659, 1704,
+ /* 0 */ 638, -351, -264, 115, 375, 418, 445, 589, 675, 711,
+ /* 10 */ 194, 849, 896, 1033, 1242, 1271, 1369, 1393, 1462, 1479,
+ /* 20 */ 1559, 1652, 1731, 1750, 1774, 1819, 1871, 1909, 1939, 1956,
+ /* 30 */ 2033, 2067, 2096, 2190, 2214, 2229, 2259, 2311, 2347, 2377,
+ /* 40 */ 2394, 2471, 2505, 2534, 2595, 2628, 2705, 2722, 2748, 2785,
+ /* 50 */ -348, -338, 813, -383, -341, 472, 694, 885, -296, -231,
+ /* 60 */ 913, 484, -518, 150, 332, -511, -301, -318, -406, -354,
+ /* 70 */ 145, -376, 266, -419, 218, -196, -61, -436, -381, 245,
+ /* 80 */ -236, 506, -320, -294, 310, 466, 496, -253, 236, 595,
+ /* 90 */ 599, 601, 680, 407, -48, -182, -364, 697, 718, -175,
+ /* 100 */ -299, 727, 555, 749, -410, 761, 783, 785, 797, 172,
+ /* 110 */ 801, 833, 478, 835, -76, 480, 513, 842, 308, -506,
+ /* 120 */ -506, 20, -185, 168, -369, -516, -289, -265, 159, 465,
+ /* 130 */ 467, 597, 678, 725, 763, 777, 800, 838, 879, 881,
+ /* 140 */ 882, 883, 887, 888, 889, 891, 77, 152, 88, 618,
+ /* 150 */ 853, 855, 858, 152, 360, 642, -16, 339, 859, 453,
+ /* 160 */ 866, -19, 353, 608, 839, 845, 564, 862, 209, 893,
+ /* 170 */ 911, 927, 941, 933, 996, 553, 827, 997, 1031, 1047,
+ /* 180 */ 1049, 766, 871, 768, 1063, 977, 977, 946, 974, 1000,
+ /* 190 */ 1019, 1158, 977, 1190, 1190, 1210, 1212, 1175, 1235, 1180,
+ /* 200 */ 1090, 1092, 1093, 1169, 1095, 1190, 1243, 1154, 1192, 1248,
+ /* 210 */ 1207, 1174, 1196, 1197, 1190, 1123, 1124, 1104, 1140, 1126,
+ /* 220 */ 1246, 1193, 1181, 1283, 1202, 1201, 1282, 1208, 1284, 1220,
+ /* 230 */ 1297, 1298, 1247, 1302, 1250, 1251, 1306, 1307, 1309, 1257,
+ /* 240 */ 1259, 1261, 1262, 1304, 1308, 1319, 1321, 1312, 1324, 1325,
+ /* 250 */ 1326, 1335, 1337, 1339, 1340, 1252, 1330, 1331, 1303, 1342,
+ /* 260 */ 1351, 1285, 1346, 1356, 1353, 1314, 1357, 1318, 1359, 1371,
+ /* 270 */ 1382, 1375, 1390, 1362, 1363, 1364, 1368, 1370, 1373, 1377,
+ /* 280 */ 1378, 1379, 1380, 1384, 1386, 1396, 1397, 1402, 1355, 1360,
+ /* 290 */ 1383, 1313, 1332, 1320, 1410, 1336, 1348, 1347, 1387, 1428,
+ /* 300 */ 1385, 1430, 1401, 1299, 1394, 1315, 1398, 1311, 1317, 1341,
+ /* 310 */ 1327, 1344, 1343, 1412, 1381, 1361, 1328, 1345, 1349, 1504,
+ /* 320 */ 1407, 1388, 1392, 1513, 1507, 1511, 1451, 1466, 1475, 1477,
+ /* 330 */ 1478, 1453, 1484, 1465, 1523, 1486, 1480, 1526, 1419, 1490,
+ /* 340 */ 1482, 1492, 1531, 1524, 1543, 1551, 1514, 1516, 1528, 1529,
+ /* 350 */ 1542, 1545, 1546, 1547, 1554, 1556, 1557, 1558, 1560, 1562,
+ /* 360 */ 1563, 1564, 1565, 1566, 1567, 1568, 1571, 1572, 1522, 1573,
+ /* 370 */ 1576, 1561, 1580, 1583, 1578, 1519, 1588, 1534, 1500, 1548,
+ /* 380 */ 1581, 1591, 1602, 1589, 1604, 1592, 1603,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 10 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 20 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 30 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 40 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 50 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 60 */ 2548, 2180, 2180, 2504, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 70 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2511, 2180,
- /* 80 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 90 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2281,
- /* 100 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 110 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2279, 2800,
- /* 120 */ 2180, 2926, 2589, 2180, 2180, 2829, 2180, 2180, 2180, 2180,
- /* 130 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 140 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2812, 2180, 2180,
- /* 150 */ 2252, 2252, 2180, 2812, 2812, 2812, 2772, 2772, 2279, 2180,
- /* 160 */ 2180, 2281, 2180, 2591, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 170 */ 2180, 2180, 2180, 2421, 2210, 2180, 2180, 2180, 2180, 2180,
- /* 180 */ 2180, 2574, 2180, 2180, 2858, 2804, 2805, 2920, 2180, 2861,
- /* 190 */ 2823, 2180, 2818, 2180, 2180, 2180, 2180, 2516, 2180, 2848,
- /* 200 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2617, 2180, 2180,
- /* 210 */ 2366, 2568, 2180, 2180, 2180, 2180, 2180, 2904, 2802, 2842,
- /* 220 */ 2180, 2852, 2180, 2180, 2180, 2605, 2281, 2180, 2281, 2561,
- /* 230 */ 2499, 2180, 2509, 2180, 2509, 2506, 2180, 2180, 2180, 2509,
- /* 240 */ 2506, 2506, 2506, 2355, 2351, 2180, 2180, 2349, 2180, 2180,
- /* 250 */ 2180, 2180, 2235, 2180, 2235, 2180, 2281, 2281, 2180, 2281,
- /* 260 */ 2180, 2180, 2281, 2180, 2281, 2180, 2281, 2180, 2281, 2281,
- /* 270 */ 2180, 2281, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 280 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 290 */ 2180, 2603, 2584, 2180, 2279, 2180, 2572, 2570, 2180, 2279,
- /* 300 */ 2852, 2180, 2180, 2874, 2869, 2874, 2869, 2888, 2884, 2874,
- /* 310 */ 2893, 2890, 2854, 2852, 2835, 2831, 2923, 2910, 2906, 2180,
- /* 320 */ 2180, 2840, 2838, 2180, 2279, 2279, 2869, 2180, 2180, 2180,
- /* 330 */ 2180, 2869, 2180, 2180, 2279, 2180, 2180, 2279, 2180, 2180,
- /* 340 */ 2180, 2180, 2279, 2180, 2279, 2180, 2180, 2180, 2180, 2180,
- /* 350 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 360 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2383, 2180,
- /* 370 */ 2180, 2279, 2180, 2219, 2180, 2563, 2926, 2589, 2594, 2544,
- /* 380 */ 2544, 2424, 2424, 2926, 2424, 2282, 2185, 2180, 2180, 2180,
- /* 390 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2887,
- /* 400 */ 2886, 2723, 2180, 2776, 2775, 2774, 2765, 2722, 2379, 2180,
- /* 410 */ 2180, 2180, 2721, 2720, 2180, 2180, 2180, 2180, 2370, 2367,
- /* 420 */ 2180, 2180, 2392, 2180, 2180, 2180, 2180, 2535, 2534, 2714,
- /* 430 */ 2180, 2180, 2715, 2713, 2712, 2180, 2180, 2180, 2180, 2180,
- /* 440 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 450 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 460 */ 2180, 2180, 2907, 2911, 2180, 2180, 2180, 2801, 2180, 2180,
- /* 470 */ 2180, 2693, 2180, 2180, 2180, 2180, 2661, 2656, 2647, 2638,
- /* 480 */ 2653, 2644, 2632, 2650, 2641, 2629, 2626, 2180, 2180, 2180,
- /* 490 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 500 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 510 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 520 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 530 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 540 */ 2180, 2180, 2180, 2505, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 550 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 560 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 570 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 580 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 590 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 600 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2520, 2180,
- /* 610 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 620 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 630 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 640 */ 2180, 2180, 2224, 2700, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 650 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2703, 2180, 2180,
- /* 660 */ 2704, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 670 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 680 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 690 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 700 */ 2180, 2180, 2180, 2326, 2325, 2180, 2180, 2180, 2180, 2180,
- /* 710 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 720 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 730 */ 2180, 2705, 2180, 2180, 2180, 2180, 2588, 2180, 2180, 2695,
- /* 740 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 750 */ 2180, 2180, 2180, 2180, 2180, 2180, 2903, 2855, 2180, 2180,
- /* 760 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 770 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 780 */ 2693, 2180, 2885, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 790 */ 2901, 2180, 2905, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 800 */ 2811, 2807, 2180, 2180, 2803, 2180, 2180, 2180, 2180, 2180,
- /* 810 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 820 */ 2180, 2180, 2180, 2180, 2180, 2762, 2180, 2180, 2180, 2796,
- /* 830 */ 2180, 2180, 2180, 2180, 2420, 2419, 2418, 2417, 2180, 2180,
- /* 840 */ 2180, 2180, 2180, 2180, 2705, 2180, 2708, 2180, 2180, 2180,
- /* 850 */ 2180, 2180, 2180, 2180, 2180, 2180, 2692, 2180, 2747, 2746,
- /* 860 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 870 */ 2180, 2414, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 880 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2398, 2396, 2395,
- /* 890 */ 2394, 2180, 2431, 2180, 2180, 2180, 2427, 2426, 2180, 2180,
- /* 900 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 910 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2300, 2180, 2180,
- /* 920 */ 2180, 2180, 2180, 2180, 2180, 2180, 2292, 2180, 2291, 2180,
- /* 930 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 940 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180,
- /* 950 */ 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2180, 2209, 2180,
- /* 960 */ 2180, 2180, 2180, 2180, 2180,
+ /* 0 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 10 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 20 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 30 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 40 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 50 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 60 */ 2552, 2183, 2183, 2508, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 70 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2515, 2183,
+ /* 80 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 90 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2285,
+ /* 100 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 110 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2283, 2804,
+ /* 120 */ 2183, 2930, 2593, 2183, 2183, 2833, 2183, 2183, 2183, 2183,
+ /* 130 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 140 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2816, 2183, 2183,
+ /* 150 */ 2256, 2256, 2183, 2816, 2816, 2816, 2776, 2776, 2283, 2183,
+ /* 160 */ 2183, 2285, 2183, 2595, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 170 */ 2183, 2183, 2183, 2425, 2213, 2183, 2183, 2183, 2183, 2183,
+ /* 180 */ 2183, 2578, 2183, 2183, 2862, 2808, 2809, 2924, 2183, 2865,
+ /* 190 */ 2827, 2183, 2822, 2183, 2183, 2183, 2183, 2520, 2183, 2852,
+ /* 200 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2621, 2183, 2183,
+ /* 210 */ 2370, 2572, 2183, 2183, 2183, 2183, 2183, 2908, 2806, 2846,
+ /* 220 */ 2183, 2856, 2183, 2183, 2183, 2609, 2285, 2183, 2285, 2565,
+ /* 230 */ 2503, 2183, 2513, 2183, 2513, 2510, 2183, 2183, 2183, 2513,
+ /* 240 */ 2510, 2510, 2510, 2359, 2355, 2183, 2183, 2353, 2183, 2183,
+ /* 250 */ 2183, 2183, 2239, 2183, 2239, 2183, 2285, 2285, 2183, 2285,
+ /* 260 */ 2183, 2183, 2285, 2183, 2285, 2183, 2285, 2183, 2285, 2285,
+ /* 270 */ 2183, 2285, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 280 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 290 */ 2183, 2607, 2588, 2183, 2283, 2183, 2576, 2574, 2183, 2283,
+ /* 300 */ 2856, 2183, 2183, 2878, 2873, 2878, 2873, 2892, 2888, 2878,
+ /* 310 */ 2897, 2894, 2858, 2856, 2839, 2835, 2927, 2914, 2910, 2183,
+ /* 320 */ 2183, 2844, 2842, 2183, 2283, 2283, 2873, 2183, 2183, 2183,
+ /* 330 */ 2183, 2873, 2183, 2183, 2283, 2183, 2183, 2283, 2183, 2183,
+ /* 340 */ 2183, 2183, 2283, 2183, 2283, 2183, 2183, 2183, 2183, 2183,
+ /* 350 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 360 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2387, 2183,
+ /* 370 */ 2183, 2283, 2183, 2223, 2183, 2567, 2930, 2593, 2598, 2548,
+ /* 380 */ 2548, 2428, 2428, 2930, 2428, 2286, 2188, 2183, 2183, 2183,
+ /* 390 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2891,
+ /* 400 */ 2890, 2727, 2183, 2780, 2779, 2778, 2769, 2726, 2383, 2183,
+ /* 410 */ 2183, 2183, 2725, 2724, 2183, 2183, 2183, 2183, 2374, 2371,
+ /* 420 */ 2183, 2183, 2396, 2183, 2183, 2183, 2183, 2539, 2538, 2718,
+ /* 430 */ 2183, 2183, 2719, 2717, 2716, 2183, 2183, 2183, 2183, 2183,
+ /* 440 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 450 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 460 */ 2183, 2183, 2911, 2915, 2183, 2183, 2183, 2805, 2183, 2183,
+ /* 470 */ 2183, 2697, 2183, 2183, 2183, 2183, 2665, 2660, 2651, 2642,
+ /* 480 */ 2657, 2648, 2636, 2654, 2645, 2633, 2630, 2183, 2183, 2183,
+ /* 490 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 500 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 510 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 520 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 530 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 540 */ 2183, 2183, 2183, 2509, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 550 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 560 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 570 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 580 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 590 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 600 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2524, 2183,
+ /* 610 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 620 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 630 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 640 */ 2183, 2183, 2228, 2704, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 650 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2707, 2183, 2183,
+ /* 660 */ 2708, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 670 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 680 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 690 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 700 */ 2183, 2183, 2183, 2330, 2329, 2183, 2183, 2183, 2183, 2183,
+ /* 710 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 720 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 730 */ 2183, 2183, 2183, 2709, 2183, 2183, 2183, 2183, 2592, 2183,
+ /* 740 */ 2183, 2699, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 750 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2907, 2859,
+ /* 760 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 770 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 780 */ 2183, 2183, 2697, 2183, 2889, 2183, 2183, 2183, 2183, 2183,
+ /* 790 */ 2183, 2183, 2905, 2183, 2909, 2183, 2183, 2183, 2183, 2183,
+ /* 800 */ 2183, 2183, 2815, 2811, 2183, 2183, 2807, 2183, 2183, 2183,
+ /* 810 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 820 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2766, 2183, 2183,
+ /* 830 */ 2183, 2800, 2183, 2183, 2183, 2183, 2424, 2423, 2422, 2421,
+ /* 840 */ 2183, 2183, 2183, 2183, 2183, 2183, 2709, 2183, 2712, 2183,
+ /* 850 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2696, 2183,
+ /* 860 */ 2751, 2750, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 870 */ 2183, 2183, 2183, 2418, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 880 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2402,
+ /* 890 */ 2400, 2399, 2398, 2183, 2435, 2183, 2183, 2183, 2431, 2430,
+ /* 900 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 910 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2304,
+ /* 920 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2296, 2183,
+ /* 930 */ 2295, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 940 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 950 */ 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183,
+ /* 960 */ 2212, 2183, 2183, 2183, 2183, 2183, 2183,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -1589,6 +1224,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* ENABLE => nothing */
0, /* NK_INTEGER => nothing */
0, /* SYSINFO => nothing */
+ 0, /* CREATEDB => nothing */
0, /* ADD => nothing */
0, /* DROP => nothing */
0, /* GRANT => nothing */
@@ -1661,7 +1297,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* BWLIMIT => nothing */
0, /* START => nothing */
0, /* TIMESTAMP => nothing */
- 325, /* END => ABORT */
+ 326, /* END => ABORT */
0, /* TABLE => nothing */
0, /* NK_LP => nothing */
0, /* NK_RP => nothing */
@@ -1733,7 +1369,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* VNODES => nothing */
0, /* ALIVE => nothing */
0, /* VIEWS => nothing */
- 325, /* VIEW => ABORT */
+ 326, /* VIEW => ABORT */
0, /* COMPACTS => nothing */
0, /* NORMAL => nothing */
0, /* CHILD => nothing */
@@ -1776,7 +1412,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* PAUSE => nothing */
0, /* RESUME => nothing */
0, /* PRIMARY => nothing */
- 325, /* KEY => ABORT */
+ 326, /* KEY => ABORT */
0, /* TRIGGER => nothing */
0, /* AT_ONCE => nothing */
0, /* WINDOW_CLOSE => nothing */
@@ -1840,7 +1476,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* LEFT => nothing */
0, /* RIGHT => nothing */
0, /* OUTER => nothing */
- 325, /* SEMI => ABORT */
+ 326, /* SEMI => ABORT */
0, /* ANTI => nothing */
0, /* ASOF => nothing */
0, /* WINDOW => nothing */
@@ -1876,53 +1512,53 @@ static const YYCODETYPE yyFallback[] = {
0, /* ASC => nothing */
0, /* NULLS => nothing */
0, /* ABORT => nothing */
- 325, /* AFTER => ABORT */
- 325, /* ATTACH => ABORT */
- 325, /* BEFORE => ABORT */
- 325, /* BEGIN => ABORT */
- 325, /* BITAND => ABORT */
- 325, /* BITNOT => ABORT */
- 325, /* BITOR => ABORT */
- 325, /* BLOCKS => ABORT */
- 325, /* CHANGE => ABORT */
- 325, /* COMMA => ABORT */
- 325, /* CONCAT => ABORT */
- 325, /* CONFLICT => ABORT */
- 325, /* COPY => ABORT */
- 325, /* DEFERRED => ABORT */
- 325, /* DELIMITERS => ABORT */
- 325, /* DETACH => ABORT */
- 325, /* DIVIDE => ABORT */
- 325, /* DOT => ABORT */
- 325, /* EACH => ABORT */
- 325, /* FAIL => ABORT */
- 325, /* FILE => ABORT */
- 325, /* FOR => ABORT */
- 325, /* GLOB => ABORT */
- 325, /* ID => ABORT */
- 325, /* IMMEDIATE => ABORT */
- 325, /* IMPORT => ABORT */
- 325, /* INITIALLY => ABORT */
- 325, /* INSTEAD => ABORT */
- 325, /* ISNULL => ABORT */
- 325, /* MODULES => ABORT */
- 325, /* NK_BITNOT => ABORT */
- 325, /* NK_SEMI => ABORT */
- 325, /* NOTNULL => ABORT */
- 325, /* OF => ABORT */
- 325, /* PLUS => ABORT */
- 325, /* PRIVILEGE => ABORT */
- 325, /* RAISE => ABORT */
- 325, /* RESTRICT => ABORT */
- 325, /* ROW => ABORT */
- 325, /* STAR => ABORT */
- 325, /* STATEMENT => ABORT */
- 325, /* STRICT => ABORT */
- 325, /* STRING => ABORT */
- 325, /* TIMES => ABORT */
- 325, /* VALUES => ABORT */
- 325, /* VARIABLE => ABORT */
- 325, /* WAL => ABORT */
+ 326, /* AFTER => ABORT */
+ 326, /* ATTACH => ABORT */
+ 326, /* BEFORE => ABORT */
+ 326, /* BEGIN => ABORT */
+ 326, /* BITAND => ABORT */
+ 326, /* BITNOT => ABORT */
+ 326, /* BITOR => ABORT */
+ 326, /* BLOCKS => ABORT */
+ 326, /* CHANGE => ABORT */
+ 326, /* COMMA => ABORT */
+ 326, /* CONCAT => ABORT */
+ 326, /* CONFLICT => ABORT */
+ 326, /* COPY => ABORT */
+ 326, /* DEFERRED => ABORT */
+ 326, /* DELIMITERS => ABORT */
+ 326, /* DETACH => ABORT */
+ 326, /* DIVIDE => ABORT */
+ 326, /* DOT => ABORT */
+ 326, /* EACH => ABORT */
+ 326, /* FAIL => ABORT */
+ 326, /* FILE => ABORT */
+ 326, /* FOR => ABORT */
+ 326, /* GLOB => ABORT */
+ 326, /* ID => ABORT */
+ 326, /* IMMEDIATE => ABORT */
+ 326, /* IMPORT => ABORT */
+ 326, /* INITIALLY => ABORT */
+ 326, /* INSTEAD => ABORT */
+ 326, /* ISNULL => ABORT */
+ 326, /* MODULES => ABORT */
+ 326, /* NK_BITNOT => ABORT */
+ 326, /* NK_SEMI => ABORT */
+ 326, /* NOTNULL => ABORT */
+ 326, /* OF => ABORT */
+ 326, /* PLUS => ABORT */
+ 326, /* PRIVILEGE => ABORT */
+ 326, /* RAISE => ABORT */
+ 326, /* RESTRICT => ABORT */
+ 326, /* ROW => ABORT */
+ 326, /* STAR => ABORT */
+ 326, /* STATEMENT => ABORT */
+ 326, /* STRICT => ABORT */
+ 326, /* STRING => ABORT */
+ 326, /* TIMES => ABORT */
+ 326, /* VALUES => ABORT */
+ 326, /* VARIABLE => ABORT */
+ 326, /* WAL => ABORT */
0, /* ENCODE => nothing */
0, /* COMPRESS => nothing */
0, /* LEVEL => nothing */
@@ -1977,7 +1613,6 @@ struct yyParser {
};
typedef struct yyParser yyParser;
-#include
#ifndef NDEBUG
#include
static FILE *yyTraceFILE = 0;
@@ -2053,521 +1688,522 @@ static const char *const yyTokenName[] = {
/* 36 */ "ENABLE",
/* 37 */ "NK_INTEGER",
/* 38 */ "SYSINFO",
- /* 39 */ "ADD",
- /* 40 */ "DROP",
- /* 41 */ "GRANT",
- /* 42 */ "ON",
- /* 43 */ "TO",
- /* 44 */ "REVOKE",
- /* 45 */ "FROM",
- /* 46 */ "SUBSCRIBE",
- /* 47 */ "READ",
- /* 48 */ "WRITE",
- /* 49 */ "NK_DOT",
- /* 50 */ "WITH",
- /* 51 */ "ENCRYPT_KEY",
- /* 52 */ "DNODE",
- /* 53 */ "PORT",
- /* 54 */ "DNODES",
- /* 55 */ "RESTORE",
- /* 56 */ "NK_IPTOKEN",
- /* 57 */ "FORCE",
- /* 58 */ "UNSAFE",
- /* 59 */ "CLUSTER",
- /* 60 */ "LOCAL",
- /* 61 */ "QNODE",
- /* 62 */ "BNODE",
- /* 63 */ "SNODE",
- /* 64 */ "MNODE",
- /* 65 */ "VNODE",
- /* 66 */ "DATABASE",
- /* 67 */ "USE",
- /* 68 */ "FLUSH",
- /* 69 */ "TRIM",
- /* 70 */ "S3MIGRATE",
- /* 71 */ "COMPACT",
- /* 72 */ "IF",
- /* 73 */ "NOT",
- /* 74 */ "EXISTS",
- /* 75 */ "BUFFER",
- /* 76 */ "CACHEMODEL",
- /* 77 */ "CACHESIZE",
- /* 78 */ "COMP",
- /* 79 */ "DURATION",
- /* 80 */ "NK_VARIABLE",
- /* 81 */ "MAXROWS",
- /* 82 */ "MINROWS",
- /* 83 */ "KEEP",
- /* 84 */ "PAGES",
- /* 85 */ "PAGESIZE",
- /* 86 */ "TSDB_PAGESIZE",
- /* 87 */ "PRECISION",
- /* 88 */ "REPLICA",
- /* 89 */ "VGROUPS",
- /* 90 */ "SINGLE_STABLE",
- /* 91 */ "RETENTIONS",
- /* 92 */ "SCHEMALESS",
- /* 93 */ "WAL_LEVEL",
- /* 94 */ "WAL_FSYNC_PERIOD",
- /* 95 */ "WAL_RETENTION_PERIOD",
- /* 96 */ "WAL_RETENTION_SIZE",
- /* 97 */ "WAL_ROLL_PERIOD",
- /* 98 */ "WAL_SEGMENT_SIZE",
- /* 99 */ "STT_TRIGGER",
- /* 100 */ "TABLE_PREFIX",
- /* 101 */ "TABLE_SUFFIX",
- /* 102 */ "S3_CHUNKSIZE",
- /* 103 */ "S3_KEEPLOCAL",
- /* 104 */ "S3_COMPACT",
- /* 105 */ "KEEP_TIME_OFFSET",
- /* 106 */ "ENCRYPT_ALGORITHM",
- /* 107 */ "NK_COLON",
- /* 108 */ "BWLIMIT",
- /* 109 */ "START",
- /* 110 */ "TIMESTAMP",
- /* 111 */ "END",
- /* 112 */ "TABLE",
- /* 113 */ "NK_LP",
- /* 114 */ "NK_RP",
- /* 115 */ "STABLE",
- /* 116 */ "COLUMN",
- /* 117 */ "MODIFY",
- /* 118 */ "RENAME",
- /* 119 */ "TAG",
- /* 120 */ "SET",
- /* 121 */ "NK_EQ",
- /* 122 */ "USING",
- /* 123 */ "TAGS",
- /* 124 */ "BOOL",
- /* 125 */ "TINYINT",
- /* 126 */ "SMALLINT",
- /* 127 */ "INT",
- /* 128 */ "INTEGER",
- /* 129 */ "BIGINT",
- /* 130 */ "FLOAT",
- /* 131 */ "DOUBLE",
- /* 132 */ "BINARY",
- /* 133 */ "NCHAR",
- /* 134 */ "UNSIGNED",
- /* 135 */ "JSON",
- /* 136 */ "VARCHAR",
- /* 137 */ "MEDIUMBLOB",
- /* 138 */ "BLOB",
- /* 139 */ "VARBINARY",
- /* 140 */ "GEOMETRY",
- /* 141 */ "DECIMAL",
- /* 142 */ "COMMENT",
- /* 143 */ "MAX_DELAY",
- /* 144 */ "WATERMARK",
- /* 145 */ "ROLLUP",
- /* 146 */ "TTL",
- /* 147 */ "SMA",
- /* 148 */ "DELETE_MARK",
- /* 149 */ "FIRST",
- /* 150 */ "LAST",
- /* 151 */ "SHOW",
- /* 152 */ "PRIVILEGES",
- /* 153 */ "DATABASES",
- /* 154 */ "TABLES",
- /* 155 */ "STABLES",
- /* 156 */ "MNODES",
- /* 157 */ "QNODES",
- /* 158 */ "ARBGROUPS",
- /* 159 */ "FUNCTIONS",
- /* 160 */ "INDEXES",
- /* 161 */ "ACCOUNTS",
- /* 162 */ "APPS",
- /* 163 */ "CONNECTIONS",
- /* 164 */ "LICENCES",
- /* 165 */ "GRANTS",
- /* 166 */ "FULL",
- /* 167 */ "LOGS",
- /* 168 */ "MACHINES",
- /* 169 */ "ENCRYPTIONS",
- /* 170 */ "QUERIES",
- /* 171 */ "SCORES",
- /* 172 */ "TOPICS",
- /* 173 */ "VARIABLES",
- /* 174 */ "BNODES",
- /* 175 */ "SNODES",
- /* 176 */ "TRANSACTIONS",
- /* 177 */ "DISTRIBUTED",
- /* 178 */ "CONSUMERS",
- /* 179 */ "SUBSCRIPTIONS",
- /* 180 */ "VNODES",
- /* 181 */ "ALIVE",
- /* 182 */ "VIEWS",
- /* 183 */ "VIEW",
- /* 184 */ "COMPACTS",
- /* 185 */ "NORMAL",
- /* 186 */ "CHILD",
- /* 187 */ "LIKE",
- /* 188 */ "TBNAME",
- /* 189 */ "QTAGS",
- /* 190 */ "AS",
- /* 191 */ "SYSTEM",
- /* 192 */ "TSMA",
- /* 193 */ "INTERVAL",
- /* 194 */ "RECURSIVE",
- /* 195 */ "TSMAS",
- /* 196 */ "FUNCTION",
- /* 197 */ "INDEX",
- /* 198 */ "COUNT",
- /* 199 */ "LAST_ROW",
- /* 200 */ "META",
- /* 201 */ "ONLY",
- /* 202 */ "TOPIC",
- /* 203 */ "CONSUMER",
- /* 204 */ "GROUP",
- /* 205 */ "DESC",
- /* 206 */ "DESCRIBE",
- /* 207 */ "RESET",
- /* 208 */ "QUERY",
- /* 209 */ "CACHE",
- /* 210 */ "EXPLAIN",
- /* 211 */ "ANALYZE",
- /* 212 */ "VERBOSE",
- /* 213 */ "NK_BOOL",
- /* 214 */ "RATIO",
- /* 215 */ "NK_FLOAT",
- /* 216 */ "OUTPUTTYPE",
- /* 217 */ "AGGREGATE",
- /* 218 */ "BUFSIZE",
- /* 219 */ "LANGUAGE",
- /* 220 */ "REPLACE",
- /* 221 */ "STREAM",
- /* 222 */ "INTO",
- /* 223 */ "PAUSE",
- /* 224 */ "RESUME",
- /* 225 */ "PRIMARY",
- /* 226 */ "KEY",
- /* 227 */ "TRIGGER",
- /* 228 */ "AT_ONCE",
- /* 229 */ "WINDOW_CLOSE",
- /* 230 */ "IGNORE",
- /* 231 */ "EXPIRED",
- /* 232 */ "FILL_HISTORY",
- /* 233 */ "UPDATE",
- /* 234 */ "SUBTABLE",
- /* 235 */ "UNTREATED",
- /* 236 */ "KILL",
- /* 237 */ "CONNECTION",
- /* 238 */ "TRANSACTION",
- /* 239 */ "BALANCE",
- /* 240 */ "VGROUP",
- /* 241 */ "LEADER",
- /* 242 */ "MERGE",
- /* 243 */ "REDISTRIBUTE",
- /* 244 */ "SPLIT",
- /* 245 */ "DELETE",
- /* 246 */ "INSERT",
- /* 247 */ "NK_BIN",
- /* 248 */ "NK_HEX",
- /* 249 */ "NULL",
- /* 250 */ "NK_QUESTION",
- /* 251 */ "NK_ALIAS",
- /* 252 */ "NK_ARROW",
- /* 253 */ "ROWTS",
- /* 254 */ "QSTART",
- /* 255 */ "QEND",
- /* 256 */ "QDURATION",
- /* 257 */ "WSTART",
- /* 258 */ "WEND",
- /* 259 */ "WDURATION",
- /* 260 */ "IROWTS",
- /* 261 */ "ISFILLED",
- /* 262 */ "CAST",
- /* 263 */ "NOW",
- /* 264 */ "TODAY",
- /* 265 */ "TIMEZONE",
- /* 266 */ "CLIENT_VERSION",
- /* 267 */ "SERVER_VERSION",
- /* 268 */ "SERVER_STATUS",
- /* 269 */ "CURRENT_USER",
- /* 270 */ "CASE",
- /* 271 */ "WHEN",
- /* 272 */ "THEN",
- /* 273 */ "ELSE",
- /* 274 */ "BETWEEN",
- /* 275 */ "IS",
- /* 276 */ "NK_LT",
- /* 277 */ "NK_GT",
- /* 278 */ "NK_LE",
- /* 279 */ "NK_GE",
- /* 280 */ "NK_NE",
- /* 281 */ "MATCH",
- /* 282 */ "NMATCH",
- /* 283 */ "CONTAINS",
- /* 284 */ "IN",
- /* 285 */ "JOIN",
- /* 286 */ "INNER",
- /* 287 */ "LEFT",
- /* 288 */ "RIGHT",
- /* 289 */ "OUTER",
- /* 290 */ "SEMI",
- /* 291 */ "ANTI",
- /* 292 */ "ASOF",
- /* 293 */ "WINDOW",
- /* 294 */ "WINDOW_OFFSET",
- /* 295 */ "JLIMIT",
- /* 296 */ "SELECT",
- /* 297 */ "NK_HINT",
- /* 298 */ "DISTINCT",
- /* 299 */ "WHERE",
- /* 300 */ "PARTITION",
- /* 301 */ "BY",
- /* 302 */ "SESSION",
- /* 303 */ "STATE_WINDOW",
- /* 304 */ "EVENT_WINDOW",
- /* 305 */ "COUNT_WINDOW",
- /* 306 */ "SLIDING",
- /* 307 */ "FILL",
- /* 308 */ "VALUE",
- /* 309 */ "VALUE_F",
- /* 310 */ "NONE",
- /* 311 */ "PREV",
- /* 312 */ "NULL_F",
- /* 313 */ "LINEAR",
- /* 314 */ "NEXT",
- /* 315 */ "HAVING",
- /* 316 */ "RANGE",
- /* 317 */ "EVERY",
- /* 318 */ "ORDER",
- /* 319 */ "SLIMIT",
- /* 320 */ "SOFFSET",
- /* 321 */ "LIMIT",
- /* 322 */ "OFFSET",
- /* 323 */ "ASC",
- /* 324 */ "NULLS",
- /* 325 */ "ABORT",
- /* 326 */ "AFTER",
- /* 327 */ "ATTACH",
- /* 328 */ "BEFORE",
- /* 329 */ "BEGIN",
- /* 330 */ "BITAND",
- /* 331 */ "BITNOT",
- /* 332 */ "BITOR",
- /* 333 */ "BLOCKS",
- /* 334 */ "CHANGE",
- /* 335 */ "COMMA",
- /* 336 */ "CONCAT",
- /* 337 */ "CONFLICT",
- /* 338 */ "COPY",
- /* 339 */ "DEFERRED",
- /* 340 */ "DELIMITERS",
- /* 341 */ "DETACH",
- /* 342 */ "DIVIDE",
- /* 343 */ "DOT",
- /* 344 */ "EACH",
- /* 345 */ "FAIL",
- /* 346 */ "FILE",
- /* 347 */ "FOR",
- /* 348 */ "GLOB",
- /* 349 */ "ID",
- /* 350 */ "IMMEDIATE",
- /* 351 */ "IMPORT",
- /* 352 */ "INITIALLY",
- /* 353 */ "INSTEAD",
- /* 354 */ "ISNULL",
- /* 355 */ "MODULES",
- /* 356 */ "NK_BITNOT",
- /* 357 */ "NK_SEMI",
- /* 358 */ "NOTNULL",
- /* 359 */ "OF",
- /* 360 */ "PLUS",
- /* 361 */ "PRIVILEGE",
- /* 362 */ "RAISE",
- /* 363 */ "RESTRICT",
- /* 364 */ "ROW",
- /* 365 */ "STAR",
- /* 366 */ "STATEMENT",
- /* 367 */ "STRICT",
- /* 368 */ "STRING",
- /* 369 */ "TIMES",
- /* 370 */ "VALUES",
- /* 371 */ "VARIABLE",
- /* 372 */ "WAL",
- /* 373 */ "ENCODE",
- /* 374 */ "COMPRESS",
- /* 375 */ "LEVEL",
- /* 376 */ "cmd",
- /* 377 */ "account_options",
- /* 378 */ "alter_account_options",
- /* 379 */ "literal",
- /* 380 */ "alter_account_option",
- /* 381 */ "ip_range_list",
- /* 382 */ "white_list",
- /* 383 */ "white_list_opt",
- /* 384 */ "user_name",
- /* 385 */ "sysinfo_opt",
- /* 386 */ "privileges",
- /* 387 */ "priv_level",
- /* 388 */ "with_opt",
- /* 389 */ "priv_type_list",
- /* 390 */ "priv_type",
- /* 391 */ "db_name",
- /* 392 */ "table_name",
- /* 393 */ "topic_name",
- /* 394 */ "search_condition",
- /* 395 */ "dnode_endpoint",
- /* 396 */ "force_opt",
- /* 397 */ "unsafe_opt",
- /* 398 */ "not_exists_opt",
- /* 399 */ "db_options",
- /* 400 */ "exists_opt",
- /* 401 */ "alter_db_options",
- /* 402 */ "speed_opt",
- /* 403 */ "start_opt",
- /* 404 */ "end_opt",
- /* 405 */ "integer_list",
- /* 406 */ "variable_list",
- /* 407 */ "retention_list",
- /* 408 */ "signed",
- /* 409 */ "alter_db_option",
- /* 410 */ "retention",
- /* 411 */ "full_table_name",
- /* 412 */ "column_def_list",
- /* 413 */ "tags_def_opt",
- /* 414 */ "table_options",
- /* 415 */ "multi_create_clause",
- /* 416 */ "tags_def",
- /* 417 */ "multi_drop_clause",
- /* 418 */ "alter_table_clause",
- /* 419 */ "alter_table_options",
- /* 420 */ "column_name",
- /* 421 */ "type_name",
- /* 422 */ "column_options",
- /* 423 */ "tags_literal",
- /* 424 */ "create_subtable_clause",
- /* 425 */ "specific_cols_opt",
- /* 426 */ "tags_literal_list",
- /* 427 */ "drop_table_clause",
- /* 428 */ "col_name_list",
- /* 429 */ "tag_def_list",
- /* 430 */ "tag_def",
- /* 431 */ "column_def",
- /* 432 */ "type_name_default_len",
- /* 433 */ "duration_list",
- /* 434 */ "rollup_func_list",
- /* 435 */ "alter_table_option",
- /* 436 */ "duration_literal",
- /* 437 */ "rollup_func_name",
- /* 438 */ "function_name",
- /* 439 */ "col_name",
- /* 440 */ "db_kind_opt",
- /* 441 */ "table_kind_db_name_cond_opt",
- /* 442 */ "like_pattern_opt",
- /* 443 */ "db_name_cond_opt",
- /* 444 */ "table_name_cond",
- /* 445 */ "from_db_opt",
- /* 446 */ "tag_list_opt",
- /* 447 */ "table_kind",
- /* 448 */ "tag_item",
- /* 449 */ "column_alias",
- /* 450 */ "tsma_name",
- /* 451 */ "tsma_func_list",
- /* 452 */ "full_tsma_name",
- /* 453 */ "func_list",
- /* 454 */ "index_options",
- /* 455 */ "full_index_name",
- /* 456 */ "index_name",
- /* 457 */ "sliding_opt",
- /* 458 */ "sma_stream_opt",
- /* 459 */ "func",
- /* 460 */ "sma_func_name",
- /* 461 */ "expression_list",
- /* 462 */ "with_meta",
- /* 463 */ "query_or_subquery",
- /* 464 */ "where_clause_opt",
- /* 465 */ "cgroup_name",
- /* 466 */ "analyze_opt",
- /* 467 */ "explain_options",
- /* 468 */ "insert_query",
- /* 469 */ "or_replace_opt",
- /* 470 */ "agg_func_opt",
- /* 471 */ "bufsize_opt",
- /* 472 */ "language_opt",
- /* 473 */ "full_view_name",
- /* 474 */ "view_name",
- /* 475 */ "stream_name",
- /* 476 */ "stream_options",
- /* 477 */ "col_list_opt",
- /* 478 */ "tag_def_or_ref_opt",
- /* 479 */ "subtable_opt",
- /* 480 */ "ignore_opt",
- /* 481 */ "column_stream_def_list",
- /* 482 */ "column_stream_def",
- /* 483 */ "stream_col_options",
- /* 484 */ "expression",
- /* 485 */ "on_vgroup_id",
- /* 486 */ "dnode_list",
- /* 487 */ "literal_func",
- /* 488 */ "signed_literal",
- /* 489 */ "literal_list",
- /* 490 */ "table_alias",
- /* 491 */ "expr_or_subquery",
- /* 492 */ "pseudo_column",
- /* 493 */ "column_reference",
- /* 494 */ "function_expression",
- /* 495 */ "case_when_expression",
- /* 496 */ "star_func",
- /* 497 */ "star_func_para_list",
- /* 498 */ "noarg_func",
- /* 499 */ "other_para_list",
- /* 500 */ "star_func_para",
- /* 501 */ "when_then_list",
- /* 502 */ "case_when_else_opt",
- /* 503 */ "common_expression",
- /* 504 */ "when_then_expr",
- /* 505 */ "predicate",
- /* 506 */ "compare_op",
- /* 507 */ "in_op",
- /* 508 */ "in_predicate_value",
- /* 509 */ "boolean_value_expression",
- /* 510 */ "boolean_primary",
- /* 511 */ "from_clause_opt",
- /* 512 */ "table_reference_list",
- /* 513 */ "table_reference",
- /* 514 */ "table_primary",
- /* 515 */ "joined_table",
- /* 516 */ "alias_opt",
- /* 517 */ "subquery",
- /* 518 */ "parenthesized_joined_table",
- /* 519 */ "join_type",
- /* 520 */ "join_subtype",
- /* 521 */ "join_on_clause_opt",
- /* 522 */ "window_offset_clause_opt",
- /* 523 */ "jlimit_clause_opt",
- /* 524 */ "window_offset_literal",
- /* 525 */ "query_specification",
- /* 526 */ "hint_list",
- /* 527 */ "set_quantifier_opt",
- /* 528 */ "tag_mode_opt",
- /* 529 */ "select_list",
- /* 530 */ "partition_by_clause_opt",
- /* 531 */ "range_opt",
- /* 532 */ "every_opt",
- /* 533 */ "fill_opt",
- /* 534 */ "twindow_clause_opt",
- /* 535 */ "group_by_clause_opt",
- /* 536 */ "having_clause_opt",
- /* 537 */ "select_item",
- /* 538 */ "partition_list",
- /* 539 */ "partition_item",
- /* 540 */ "interval_sliding_duration_literal",
- /* 541 */ "fill_mode",
- /* 542 */ "group_by_list",
- /* 543 */ "query_expression",
- /* 544 */ "query_simple",
- /* 545 */ "order_by_clause_opt",
- /* 546 */ "slimit_clause_opt",
- /* 547 */ "limit_clause_opt",
- /* 548 */ "union_query_expression",
- /* 549 */ "query_simple_or_subquery",
- /* 550 */ "sort_specification_list",
- /* 551 */ "sort_specification",
- /* 552 */ "ordering_specification_opt",
- /* 553 */ "null_ordering_opt",
+ /* 39 */ "CREATEDB",
+ /* 40 */ "ADD",
+ /* 41 */ "DROP",
+ /* 42 */ "GRANT",
+ /* 43 */ "ON",
+ /* 44 */ "TO",
+ /* 45 */ "REVOKE",
+ /* 46 */ "FROM",
+ /* 47 */ "SUBSCRIBE",
+ /* 48 */ "READ",
+ /* 49 */ "WRITE",
+ /* 50 */ "NK_DOT",
+ /* 51 */ "WITH",
+ /* 52 */ "ENCRYPT_KEY",
+ /* 53 */ "DNODE",
+ /* 54 */ "PORT",
+ /* 55 */ "DNODES",
+ /* 56 */ "RESTORE",
+ /* 57 */ "NK_IPTOKEN",
+ /* 58 */ "FORCE",
+ /* 59 */ "UNSAFE",
+ /* 60 */ "CLUSTER",
+ /* 61 */ "LOCAL",
+ /* 62 */ "QNODE",
+ /* 63 */ "BNODE",
+ /* 64 */ "SNODE",
+ /* 65 */ "MNODE",
+ /* 66 */ "VNODE",
+ /* 67 */ "DATABASE",
+ /* 68 */ "USE",
+ /* 69 */ "FLUSH",
+ /* 70 */ "TRIM",
+ /* 71 */ "S3MIGRATE",
+ /* 72 */ "COMPACT",
+ /* 73 */ "IF",
+ /* 74 */ "NOT",
+ /* 75 */ "EXISTS",
+ /* 76 */ "BUFFER",
+ /* 77 */ "CACHEMODEL",
+ /* 78 */ "CACHESIZE",
+ /* 79 */ "COMP",
+ /* 80 */ "DURATION",
+ /* 81 */ "NK_VARIABLE",
+ /* 82 */ "MAXROWS",
+ /* 83 */ "MINROWS",
+ /* 84 */ "KEEP",
+ /* 85 */ "PAGES",
+ /* 86 */ "PAGESIZE",
+ /* 87 */ "TSDB_PAGESIZE",
+ /* 88 */ "PRECISION",
+ /* 89 */ "REPLICA",
+ /* 90 */ "VGROUPS",
+ /* 91 */ "SINGLE_STABLE",
+ /* 92 */ "RETENTIONS",
+ /* 93 */ "SCHEMALESS",
+ /* 94 */ "WAL_LEVEL",
+ /* 95 */ "WAL_FSYNC_PERIOD",
+ /* 96 */ "WAL_RETENTION_PERIOD",
+ /* 97 */ "WAL_RETENTION_SIZE",
+ /* 98 */ "WAL_ROLL_PERIOD",
+ /* 99 */ "WAL_SEGMENT_SIZE",
+ /* 100 */ "STT_TRIGGER",
+ /* 101 */ "TABLE_PREFIX",
+ /* 102 */ "TABLE_SUFFIX",
+ /* 103 */ "S3_CHUNKSIZE",
+ /* 104 */ "S3_KEEPLOCAL",
+ /* 105 */ "S3_COMPACT",
+ /* 106 */ "KEEP_TIME_OFFSET",
+ /* 107 */ "ENCRYPT_ALGORITHM",
+ /* 108 */ "NK_COLON",
+ /* 109 */ "BWLIMIT",
+ /* 110 */ "START",
+ /* 111 */ "TIMESTAMP",
+ /* 112 */ "END",
+ /* 113 */ "TABLE",
+ /* 114 */ "NK_LP",
+ /* 115 */ "NK_RP",
+ /* 116 */ "STABLE",
+ /* 117 */ "COLUMN",
+ /* 118 */ "MODIFY",
+ /* 119 */ "RENAME",
+ /* 120 */ "TAG",
+ /* 121 */ "SET",
+ /* 122 */ "NK_EQ",
+ /* 123 */ "USING",
+ /* 124 */ "TAGS",
+ /* 125 */ "BOOL",
+ /* 126 */ "TINYINT",
+ /* 127 */ "SMALLINT",
+ /* 128 */ "INT",
+ /* 129 */ "INTEGER",
+ /* 130 */ "BIGINT",
+ /* 131 */ "FLOAT",
+ /* 132 */ "DOUBLE",
+ /* 133 */ "BINARY",
+ /* 134 */ "NCHAR",
+ /* 135 */ "UNSIGNED",
+ /* 136 */ "JSON",
+ /* 137 */ "VARCHAR",
+ /* 138 */ "MEDIUMBLOB",
+ /* 139 */ "BLOB",
+ /* 140 */ "VARBINARY",
+ /* 141 */ "GEOMETRY",
+ /* 142 */ "DECIMAL",
+ /* 143 */ "COMMENT",
+ /* 144 */ "MAX_DELAY",
+ /* 145 */ "WATERMARK",
+ /* 146 */ "ROLLUP",
+ /* 147 */ "TTL",
+ /* 148 */ "SMA",
+ /* 149 */ "DELETE_MARK",
+ /* 150 */ "FIRST",
+ /* 151 */ "LAST",
+ /* 152 */ "SHOW",
+ /* 153 */ "PRIVILEGES",
+ /* 154 */ "DATABASES",
+ /* 155 */ "TABLES",
+ /* 156 */ "STABLES",
+ /* 157 */ "MNODES",
+ /* 158 */ "QNODES",
+ /* 159 */ "ARBGROUPS",
+ /* 160 */ "FUNCTIONS",
+ /* 161 */ "INDEXES",
+ /* 162 */ "ACCOUNTS",
+ /* 163 */ "APPS",
+ /* 164 */ "CONNECTIONS",
+ /* 165 */ "LICENCES",
+ /* 166 */ "GRANTS",
+ /* 167 */ "FULL",
+ /* 168 */ "LOGS",
+ /* 169 */ "MACHINES",
+ /* 170 */ "ENCRYPTIONS",
+ /* 171 */ "QUERIES",
+ /* 172 */ "SCORES",
+ /* 173 */ "TOPICS",
+ /* 174 */ "VARIABLES",
+ /* 175 */ "BNODES",
+ /* 176 */ "SNODES",
+ /* 177 */ "TRANSACTIONS",
+ /* 178 */ "DISTRIBUTED",
+ /* 179 */ "CONSUMERS",
+ /* 180 */ "SUBSCRIPTIONS",
+ /* 181 */ "VNODES",
+ /* 182 */ "ALIVE",
+ /* 183 */ "VIEWS",
+ /* 184 */ "VIEW",
+ /* 185 */ "COMPACTS",
+ /* 186 */ "NORMAL",
+ /* 187 */ "CHILD",
+ /* 188 */ "LIKE",
+ /* 189 */ "TBNAME",
+ /* 190 */ "QTAGS",
+ /* 191 */ "AS",
+ /* 192 */ "SYSTEM",
+ /* 193 */ "TSMA",
+ /* 194 */ "INTERVAL",
+ /* 195 */ "RECURSIVE",
+ /* 196 */ "TSMAS",
+ /* 197 */ "FUNCTION",
+ /* 198 */ "INDEX",
+ /* 199 */ "COUNT",
+ /* 200 */ "LAST_ROW",
+ /* 201 */ "META",
+ /* 202 */ "ONLY",
+ /* 203 */ "TOPIC",
+ /* 204 */ "CONSUMER",
+ /* 205 */ "GROUP",
+ /* 206 */ "DESC",
+ /* 207 */ "DESCRIBE",
+ /* 208 */ "RESET",
+ /* 209 */ "QUERY",
+ /* 210 */ "CACHE",
+ /* 211 */ "EXPLAIN",
+ /* 212 */ "ANALYZE",
+ /* 213 */ "VERBOSE",
+ /* 214 */ "NK_BOOL",
+ /* 215 */ "RATIO",
+ /* 216 */ "NK_FLOAT",
+ /* 217 */ "OUTPUTTYPE",
+ /* 218 */ "AGGREGATE",
+ /* 219 */ "BUFSIZE",
+ /* 220 */ "LANGUAGE",
+ /* 221 */ "REPLACE",
+ /* 222 */ "STREAM",
+ /* 223 */ "INTO",
+ /* 224 */ "PAUSE",
+ /* 225 */ "RESUME",
+ /* 226 */ "PRIMARY",
+ /* 227 */ "KEY",
+ /* 228 */ "TRIGGER",
+ /* 229 */ "AT_ONCE",
+ /* 230 */ "WINDOW_CLOSE",
+ /* 231 */ "IGNORE",
+ /* 232 */ "EXPIRED",
+ /* 233 */ "FILL_HISTORY",
+ /* 234 */ "UPDATE",
+ /* 235 */ "SUBTABLE",
+ /* 236 */ "UNTREATED",
+ /* 237 */ "KILL",
+ /* 238 */ "CONNECTION",
+ /* 239 */ "TRANSACTION",
+ /* 240 */ "BALANCE",
+ /* 241 */ "VGROUP",
+ /* 242 */ "LEADER",
+ /* 243 */ "MERGE",
+ /* 244 */ "REDISTRIBUTE",
+ /* 245 */ "SPLIT",
+ /* 246 */ "DELETE",
+ /* 247 */ "INSERT",
+ /* 248 */ "NK_BIN",
+ /* 249 */ "NK_HEX",
+ /* 250 */ "NULL",
+ /* 251 */ "NK_QUESTION",
+ /* 252 */ "NK_ALIAS",
+ /* 253 */ "NK_ARROW",
+ /* 254 */ "ROWTS",
+ /* 255 */ "QSTART",
+ /* 256 */ "QEND",
+ /* 257 */ "QDURATION",
+ /* 258 */ "WSTART",
+ /* 259 */ "WEND",
+ /* 260 */ "WDURATION",
+ /* 261 */ "IROWTS",
+ /* 262 */ "ISFILLED",
+ /* 263 */ "CAST",
+ /* 264 */ "NOW",
+ /* 265 */ "TODAY",
+ /* 266 */ "TIMEZONE",
+ /* 267 */ "CLIENT_VERSION",
+ /* 268 */ "SERVER_VERSION",
+ /* 269 */ "SERVER_STATUS",
+ /* 270 */ "CURRENT_USER",
+ /* 271 */ "CASE",
+ /* 272 */ "WHEN",
+ /* 273 */ "THEN",
+ /* 274 */ "ELSE",
+ /* 275 */ "BETWEEN",
+ /* 276 */ "IS",
+ /* 277 */ "NK_LT",
+ /* 278 */ "NK_GT",
+ /* 279 */ "NK_LE",
+ /* 280 */ "NK_GE",
+ /* 281 */ "NK_NE",
+ /* 282 */ "MATCH",
+ /* 283 */ "NMATCH",
+ /* 284 */ "CONTAINS",
+ /* 285 */ "IN",
+ /* 286 */ "JOIN",
+ /* 287 */ "INNER",
+ /* 288 */ "LEFT",
+ /* 289 */ "RIGHT",
+ /* 290 */ "OUTER",
+ /* 291 */ "SEMI",
+ /* 292 */ "ANTI",
+ /* 293 */ "ASOF",
+ /* 294 */ "WINDOW",
+ /* 295 */ "WINDOW_OFFSET",
+ /* 296 */ "JLIMIT",
+ /* 297 */ "SELECT",
+ /* 298 */ "NK_HINT",
+ /* 299 */ "DISTINCT",
+ /* 300 */ "WHERE",
+ /* 301 */ "PARTITION",
+ /* 302 */ "BY",
+ /* 303 */ "SESSION",
+ /* 304 */ "STATE_WINDOW",
+ /* 305 */ "EVENT_WINDOW",
+ /* 306 */ "COUNT_WINDOW",
+ /* 307 */ "SLIDING",
+ /* 308 */ "FILL",
+ /* 309 */ "VALUE",
+ /* 310 */ "VALUE_F",
+ /* 311 */ "NONE",
+ /* 312 */ "PREV",
+ /* 313 */ "NULL_F",
+ /* 314 */ "LINEAR",
+ /* 315 */ "NEXT",
+ /* 316 */ "HAVING",
+ /* 317 */ "RANGE",
+ /* 318 */ "EVERY",
+ /* 319 */ "ORDER",
+ /* 320 */ "SLIMIT",
+ /* 321 */ "SOFFSET",
+ /* 322 */ "LIMIT",
+ /* 323 */ "OFFSET",
+ /* 324 */ "ASC",
+ /* 325 */ "NULLS",
+ /* 326 */ "ABORT",
+ /* 327 */ "AFTER",
+ /* 328 */ "ATTACH",
+ /* 329 */ "BEFORE",
+ /* 330 */ "BEGIN",
+ /* 331 */ "BITAND",
+ /* 332 */ "BITNOT",
+ /* 333 */ "BITOR",
+ /* 334 */ "BLOCKS",
+ /* 335 */ "CHANGE",
+ /* 336 */ "COMMA",
+ /* 337 */ "CONCAT",
+ /* 338 */ "CONFLICT",
+ /* 339 */ "COPY",
+ /* 340 */ "DEFERRED",
+ /* 341 */ "DELIMITERS",
+ /* 342 */ "DETACH",
+ /* 343 */ "DIVIDE",
+ /* 344 */ "DOT",
+ /* 345 */ "EACH",
+ /* 346 */ "FAIL",
+ /* 347 */ "FILE",
+ /* 348 */ "FOR",
+ /* 349 */ "GLOB",
+ /* 350 */ "ID",
+ /* 351 */ "IMMEDIATE",
+ /* 352 */ "IMPORT",
+ /* 353 */ "INITIALLY",
+ /* 354 */ "INSTEAD",
+ /* 355 */ "ISNULL",
+ /* 356 */ "MODULES",
+ /* 357 */ "NK_BITNOT",
+ /* 358 */ "NK_SEMI",
+ /* 359 */ "NOTNULL",
+ /* 360 */ "OF",
+ /* 361 */ "PLUS",
+ /* 362 */ "PRIVILEGE",
+ /* 363 */ "RAISE",
+ /* 364 */ "RESTRICT",
+ /* 365 */ "ROW",
+ /* 366 */ "STAR",
+ /* 367 */ "STATEMENT",
+ /* 368 */ "STRICT",
+ /* 369 */ "STRING",
+ /* 370 */ "TIMES",
+ /* 371 */ "VALUES",
+ /* 372 */ "VARIABLE",
+ /* 373 */ "WAL",
+ /* 374 */ "ENCODE",
+ /* 375 */ "COMPRESS",
+ /* 376 */ "LEVEL",
+ /* 377 */ "cmd",
+ /* 378 */ "account_options",
+ /* 379 */ "alter_account_options",
+ /* 380 */ "literal",
+ /* 381 */ "alter_account_option",
+ /* 382 */ "ip_range_list",
+ /* 383 */ "white_list",
+ /* 384 */ "white_list_opt",
+ /* 385 */ "user_name",
+ /* 386 */ "sysinfo_opt",
+ /* 387 */ "privileges",
+ /* 388 */ "priv_level",
+ /* 389 */ "with_opt",
+ /* 390 */ "priv_type_list",
+ /* 391 */ "priv_type",
+ /* 392 */ "db_name",
+ /* 393 */ "table_name",
+ /* 394 */ "topic_name",
+ /* 395 */ "search_condition",
+ /* 396 */ "dnode_endpoint",
+ /* 397 */ "force_opt",
+ /* 398 */ "unsafe_opt",
+ /* 399 */ "not_exists_opt",
+ /* 400 */ "db_options",
+ /* 401 */ "exists_opt",
+ /* 402 */ "alter_db_options",
+ /* 403 */ "speed_opt",
+ /* 404 */ "start_opt",
+ /* 405 */ "end_opt",
+ /* 406 */ "integer_list",
+ /* 407 */ "variable_list",
+ /* 408 */ "retention_list",
+ /* 409 */ "signed",
+ /* 410 */ "alter_db_option",
+ /* 411 */ "retention",
+ /* 412 */ "full_table_name",
+ /* 413 */ "column_def_list",
+ /* 414 */ "tags_def_opt",
+ /* 415 */ "table_options",
+ /* 416 */ "multi_create_clause",
+ /* 417 */ "tags_def",
+ /* 418 */ "multi_drop_clause",
+ /* 419 */ "alter_table_clause",
+ /* 420 */ "alter_table_options",
+ /* 421 */ "column_name",
+ /* 422 */ "type_name",
+ /* 423 */ "column_options",
+ /* 424 */ "tags_literal",
+ /* 425 */ "create_subtable_clause",
+ /* 426 */ "specific_cols_opt",
+ /* 427 */ "tags_literal_list",
+ /* 428 */ "drop_table_clause",
+ /* 429 */ "col_name_list",
+ /* 430 */ "tag_def_list",
+ /* 431 */ "tag_def",
+ /* 432 */ "column_def",
+ /* 433 */ "type_name_default_len",
+ /* 434 */ "duration_list",
+ /* 435 */ "rollup_func_list",
+ /* 436 */ "alter_table_option",
+ /* 437 */ "duration_literal",
+ /* 438 */ "rollup_func_name",
+ /* 439 */ "function_name",
+ /* 440 */ "col_name",
+ /* 441 */ "db_kind_opt",
+ /* 442 */ "table_kind_db_name_cond_opt",
+ /* 443 */ "like_pattern_opt",
+ /* 444 */ "db_name_cond_opt",
+ /* 445 */ "table_name_cond",
+ /* 446 */ "from_db_opt",
+ /* 447 */ "tag_list_opt",
+ /* 448 */ "table_kind",
+ /* 449 */ "tag_item",
+ /* 450 */ "column_alias",
+ /* 451 */ "tsma_name",
+ /* 452 */ "tsma_func_list",
+ /* 453 */ "full_tsma_name",
+ /* 454 */ "func_list",
+ /* 455 */ "index_options",
+ /* 456 */ "full_index_name",
+ /* 457 */ "index_name",
+ /* 458 */ "sliding_opt",
+ /* 459 */ "sma_stream_opt",
+ /* 460 */ "func",
+ /* 461 */ "sma_func_name",
+ /* 462 */ "expression_list",
+ /* 463 */ "with_meta",
+ /* 464 */ "query_or_subquery",
+ /* 465 */ "where_clause_opt",
+ /* 466 */ "cgroup_name",
+ /* 467 */ "analyze_opt",
+ /* 468 */ "explain_options",
+ /* 469 */ "insert_query",
+ /* 470 */ "or_replace_opt",
+ /* 471 */ "agg_func_opt",
+ /* 472 */ "bufsize_opt",
+ /* 473 */ "language_opt",
+ /* 474 */ "full_view_name",
+ /* 475 */ "view_name",
+ /* 476 */ "stream_name",
+ /* 477 */ "stream_options",
+ /* 478 */ "col_list_opt",
+ /* 479 */ "tag_def_or_ref_opt",
+ /* 480 */ "subtable_opt",
+ /* 481 */ "ignore_opt",
+ /* 482 */ "column_stream_def_list",
+ /* 483 */ "column_stream_def",
+ /* 484 */ "stream_col_options",
+ /* 485 */ "expression",
+ /* 486 */ "on_vgroup_id",
+ /* 487 */ "dnode_list",
+ /* 488 */ "literal_func",
+ /* 489 */ "signed_literal",
+ /* 490 */ "literal_list",
+ /* 491 */ "table_alias",
+ /* 492 */ "expr_or_subquery",
+ /* 493 */ "pseudo_column",
+ /* 494 */ "column_reference",
+ /* 495 */ "function_expression",
+ /* 496 */ "case_when_expression",
+ /* 497 */ "star_func",
+ /* 498 */ "star_func_para_list",
+ /* 499 */ "noarg_func",
+ /* 500 */ "other_para_list",
+ /* 501 */ "star_func_para",
+ /* 502 */ "when_then_list",
+ /* 503 */ "case_when_else_opt",
+ /* 504 */ "common_expression",
+ /* 505 */ "when_then_expr",
+ /* 506 */ "predicate",
+ /* 507 */ "compare_op",
+ /* 508 */ "in_op",
+ /* 509 */ "in_predicate_value",
+ /* 510 */ "boolean_value_expression",
+ /* 511 */ "boolean_primary",
+ /* 512 */ "from_clause_opt",
+ /* 513 */ "table_reference_list",
+ /* 514 */ "table_reference",
+ /* 515 */ "table_primary",
+ /* 516 */ "joined_table",
+ /* 517 */ "alias_opt",
+ /* 518 */ "subquery",
+ /* 519 */ "parenthesized_joined_table",
+ /* 520 */ "join_type",
+ /* 521 */ "join_subtype",
+ /* 522 */ "join_on_clause_opt",
+ /* 523 */ "window_offset_clause_opt",
+ /* 524 */ "jlimit_clause_opt",
+ /* 525 */ "window_offset_literal",
+ /* 526 */ "query_specification",
+ /* 527 */ "hint_list",
+ /* 528 */ "set_quantifier_opt",
+ /* 529 */ "tag_mode_opt",
+ /* 530 */ "select_list",
+ /* 531 */ "partition_by_clause_opt",
+ /* 532 */ "range_opt",
+ /* 533 */ "every_opt",
+ /* 534 */ "fill_opt",
+ /* 535 */ "twindow_clause_opt",
+ /* 536 */ "group_by_clause_opt",
+ /* 537 */ "having_clause_opt",
+ /* 538 */ "select_item",
+ /* 539 */ "partition_list",
+ /* 540 */ "partition_item",
+ /* 541 */ "interval_sliding_duration_literal",
+ /* 542 */ "fill_mode",
+ /* 543 */ "group_by_list",
+ /* 544 */ "query_expression",
+ /* 545 */ "query_simple",
+ /* 546 */ "order_by_clause_opt",
+ /* 547 */ "slimit_clause_opt",
+ /* 548 */ "limit_clause_opt",
+ /* 549 */ "union_query_expression",
+ /* 550 */ "query_simple_or_subquery",
+ /* 551 */ "sort_specification_list",
+ /* 552 */ "sort_specification",
+ /* 553 */ "ordering_specification_opt",
+ /* 554 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -2608,721 +2244,722 @@ static const char *const yyRuleName[] = {
/* 30 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
/* 31 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER",
/* 32 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER",
- /* 33 */ "cmd ::= ALTER USER user_name ADD white_list",
- /* 34 */ "cmd ::= ALTER USER user_name DROP white_list",
- /* 35 */ "cmd ::= DROP USER user_name",
- /* 36 */ "sysinfo_opt ::=",
- /* 37 */ "sysinfo_opt ::= SYSINFO NK_INTEGER",
- /* 38 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name",
- /* 39 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name",
- /* 40 */ "privileges ::= ALL",
- /* 41 */ "privileges ::= priv_type_list",
- /* 42 */ "privileges ::= SUBSCRIBE",
- /* 43 */ "priv_type_list ::= priv_type",
- /* 44 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type",
- /* 45 */ "priv_type ::= READ",
- /* 46 */ "priv_type ::= WRITE",
- /* 47 */ "priv_type ::= ALTER",
- /* 48 */ "priv_level ::= NK_STAR NK_DOT NK_STAR",
- /* 49 */ "priv_level ::= db_name NK_DOT NK_STAR",
- /* 50 */ "priv_level ::= db_name NK_DOT table_name",
- /* 51 */ "priv_level ::= topic_name",
- /* 52 */ "with_opt ::=",
- /* 53 */ "with_opt ::= WITH search_condition",
- /* 54 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING",
- /* 55 */ "cmd ::= CREATE DNODE dnode_endpoint",
- /* 56 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER",
- /* 57 */ "cmd ::= DROP DNODE NK_INTEGER force_opt",
- /* 58 */ "cmd ::= DROP DNODE dnode_endpoint force_opt",
- /* 59 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt",
- /* 60 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt",
- /* 61 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
- /* 62 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
- /* 63 */ "cmd ::= ALTER ALL DNODES NK_STRING",
- /* 64 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
- /* 65 */ "cmd ::= RESTORE DNODE NK_INTEGER",
- /* 66 */ "dnode_endpoint ::= NK_STRING",
- /* 67 */ "dnode_endpoint ::= NK_ID",
- /* 68 */ "dnode_endpoint ::= NK_IPTOKEN",
- /* 69 */ "force_opt ::=",
- /* 70 */ "force_opt ::= FORCE",
- /* 71 */ "unsafe_opt ::= UNSAFE",
- /* 72 */ "cmd ::= ALTER CLUSTER NK_STRING",
- /* 73 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING",
- /* 74 */ "cmd ::= ALTER LOCAL NK_STRING",
- /* 75 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
- /* 76 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
- /* 77 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
- /* 78 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER",
- /* 79 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
- /* 80 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
- /* 81 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
- /* 82 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
- /* 83 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
- /* 84 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
- /* 85 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER",
- /* 86 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER",
- /* 87 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
- /* 88 */ "cmd ::= DROP DATABASE exists_opt db_name",
- /* 89 */ "cmd ::= USE db_name",
- /* 90 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
- /* 91 */ "cmd ::= FLUSH DATABASE db_name",
- /* 92 */ "cmd ::= TRIM DATABASE db_name speed_opt",
- /* 93 */ "cmd ::= S3MIGRATE DATABASE db_name",
- /* 94 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt",
- /* 95 */ "not_exists_opt ::= IF NOT EXISTS",
- /* 96 */ "not_exists_opt ::=",
- /* 97 */ "exists_opt ::= IF EXISTS",
- /* 98 */ "exists_opt ::=",
- /* 99 */ "db_options ::=",
- /* 100 */ "db_options ::= db_options BUFFER NK_INTEGER",
- /* 101 */ "db_options ::= db_options CACHEMODEL NK_STRING",
- /* 102 */ "db_options ::= db_options CACHESIZE NK_INTEGER",
- /* 103 */ "db_options ::= db_options COMP NK_INTEGER",
- /* 104 */ "db_options ::= db_options DURATION NK_INTEGER",
- /* 105 */ "db_options ::= db_options DURATION NK_VARIABLE",
- /* 106 */ "db_options ::= db_options MAXROWS NK_INTEGER",
- /* 107 */ "db_options ::= db_options MINROWS NK_INTEGER",
- /* 108 */ "db_options ::= db_options KEEP integer_list",
- /* 109 */ "db_options ::= db_options KEEP variable_list",
- /* 110 */ "db_options ::= db_options PAGES NK_INTEGER",
- /* 111 */ "db_options ::= db_options PAGESIZE NK_INTEGER",
- /* 112 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER",
- /* 113 */ "db_options ::= db_options PRECISION NK_STRING",
- /* 114 */ "db_options ::= db_options REPLICA NK_INTEGER",
- /* 115 */ "db_options ::= db_options VGROUPS NK_INTEGER",
- /* 116 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
- /* 117 */ "db_options ::= db_options RETENTIONS retention_list",
- /* 118 */ "db_options ::= db_options SCHEMALESS NK_INTEGER",
- /* 119 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER",
- /* 120 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER",
- /* 121 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER",
- /* 122 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
- /* 123 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER",
- /* 124 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
- /* 125 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER",
- /* 126 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER",
- /* 127 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER",
- /* 128 */ "db_options ::= db_options TABLE_PREFIX signed",
- /* 129 */ "db_options ::= db_options TABLE_SUFFIX signed",
- /* 130 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER",
- /* 131 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER",
- /* 132 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE",
- /* 133 */ "db_options ::= db_options S3_COMPACT NK_INTEGER",
- /* 134 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER",
- /* 135 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING",
- /* 136 */ "alter_db_options ::= alter_db_option",
- /* 137 */ "alter_db_options ::= alter_db_options alter_db_option",
- /* 138 */ "alter_db_option ::= BUFFER NK_INTEGER",
- /* 139 */ "alter_db_option ::= CACHEMODEL NK_STRING",
- /* 140 */ "alter_db_option ::= CACHESIZE NK_INTEGER",
- /* 141 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER",
- /* 142 */ "alter_db_option ::= KEEP integer_list",
- /* 143 */ "alter_db_option ::= KEEP variable_list",
- /* 144 */ "alter_db_option ::= PAGES NK_INTEGER",
- /* 145 */ "alter_db_option ::= REPLICA NK_INTEGER",
- /* 146 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER",
- /* 147 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER",
- /* 148 */ "alter_db_option ::= MINROWS NK_INTEGER",
- /* 149 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER",
- /* 150 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
- /* 151 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER",
- /* 152 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
- /* 153 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER",
- /* 154 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE",
- /* 155 */ "alter_db_option ::= S3_COMPACT NK_INTEGER",
- /* 156 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER",
- /* 157 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING",
- /* 158 */ "integer_list ::= NK_INTEGER",
- /* 159 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
- /* 160 */ "variable_list ::= NK_VARIABLE",
- /* 161 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
- /* 162 */ "retention_list ::= retention",
- /* 163 */ "retention_list ::= retention_list NK_COMMA retention",
- /* 164 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
- /* 165 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE",
- /* 166 */ "speed_opt ::=",
- /* 167 */ "speed_opt ::= BWLIMIT NK_INTEGER",
- /* 168 */ "start_opt ::=",
- /* 169 */ "start_opt ::= START WITH NK_INTEGER",
- /* 170 */ "start_opt ::= START WITH NK_STRING",
- /* 171 */ "start_opt ::= START WITH TIMESTAMP NK_STRING",
- /* 172 */ "end_opt ::=",
- /* 173 */ "end_opt ::= END WITH NK_INTEGER",
- /* 174 */ "end_opt ::= END WITH NK_STRING",
- /* 175 */ "end_opt ::= END WITH TIMESTAMP NK_STRING",
- /* 176 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
- /* 177 */ "cmd ::= CREATE TABLE multi_create_clause",
- /* 178 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
- /* 179 */ "cmd ::= DROP TABLE multi_drop_clause",
- /* 180 */ "cmd ::= DROP STABLE exists_opt full_table_name",
- /* 181 */ "cmd ::= ALTER TABLE alter_table_clause",
- /* 182 */ "cmd ::= ALTER STABLE alter_table_clause",
- /* 183 */ "alter_table_clause ::= full_table_name alter_table_options",
- /* 184 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options",
- /* 185 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
- /* 186 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
- /* 187 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options",
- /* 188 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
- /* 189 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
- /* 190 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
- /* 191 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
- /* 192 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
- /* 193 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal",
- /* 194 */ "multi_create_clause ::= create_subtable_clause",
- /* 195 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
- /* 196 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options",
- /* 197 */ "multi_drop_clause ::= drop_table_clause",
- /* 198 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
- /* 199 */ "drop_table_clause ::= exists_opt full_table_name",
- /* 200 */ "specific_cols_opt ::=",
- /* 201 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
- /* 202 */ "full_table_name ::= table_name",
- /* 203 */ "full_table_name ::= db_name NK_DOT table_name",
- /* 204 */ "tag_def_list ::= tag_def",
- /* 205 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def",
- /* 206 */ "tag_def ::= column_name type_name",
- /* 207 */ "column_def_list ::= column_def",
- /* 208 */ "column_def_list ::= column_def_list NK_COMMA column_def",
- /* 209 */ "column_def ::= column_name type_name column_options",
- /* 210 */ "type_name ::= BOOL",
- /* 211 */ "type_name ::= TINYINT",
- /* 212 */ "type_name ::= SMALLINT",
- /* 213 */ "type_name ::= INT",
- /* 214 */ "type_name ::= INTEGER",
- /* 215 */ "type_name ::= BIGINT",
- /* 216 */ "type_name ::= FLOAT",
- /* 217 */ "type_name ::= DOUBLE",
- /* 218 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
- /* 219 */ "type_name ::= TIMESTAMP",
- /* 220 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
- /* 221 */ "type_name ::= TINYINT UNSIGNED",
- /* 222 */ "type_name ::= SMALLINT UNSIGNED",
- /* 223 */ "type_name ::= INT UNSIGNED",
- /* 224 */ "type_name ::= BIGINT UNSIGNED",
- /* 225 */ "type_name ::= JSON",
- /* 226 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
- /* 227 */ "type_name ::= MEDIUMBLOB",
- /* 228 */ "type_name ::= BLOB",
- /* 229 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
- /* 230 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP",
- /* 231 */ "type_name ::= DECIMAL",
- /* 232 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
- /* 233 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
- /* 234 */ "type_name_default_len ::= BINARY",
- /* 235 */ "type_name_default_len ::= NCHAR",
- /* 236 */ "type_name_default_len ::= VARCHAR",
- /* 237 */ "type_name_default_len ::= VARBINARY",
- /* 238 */ "tags_def_opt ::=",
- /* 239 */ "tags_def_opt ::= tags_def",
- /* 240 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP",
- /* 241 */ "table_options ::=",
- /* 242 */ "table_options ::= table_options COMMENT NK_STRING",
- /* 243 */ "table_options ::= table_options MAX_DELAY duration_list",
- /* 244 */ "table_options ::= table_options WATERMARK duration_list",
- /* 245 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
- /* 246 */ "table_options ::= table_options TTL NK_INTEGER",
- /* 247 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
- /* 248 */ "table_options ::= table_options DELETE_MARK duration_list",
- /* 249 */ "alter_table_options ::= alter_table_option",
- /* 250 */ "alter_table_options ::= alter_table_options alter_table_option",
- /* 251 */ "alter_table_option ::= COMMENT NK_STRING",
- /* 252 */ "alter_table_option ::= TTL NK_INTEGER",
- /* 253 */ "duration_list ::= duration_literal",
- /* 254 */ "duration_list ::= duration_list NK_COMMA duration_literal",
- /* 255 */ "rollup_func_list ::= rollup_func_name",
- /* 256 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
- /* 257 */ "rollup_func_name ::= function_name",
- /* 258 */ "rollup_func_name ::= FIRST",
- /* 259 */ "rollup_func_name ::= LAST",
- /* 260 */ "col_name_list ::= col_name",
- /* 261 */ "col_name_list ::= col_name_list NK_COMMA col_name",
- /* 262 */ "col_name ::= column_name",
- /* 263 */ "cmd ::= SHOW DNODES",
- /* 264 */ "cmd ::= SHOW USERS",
- /* 265 */ "cmd ::= SHOW USER PRIVILEGES",
- /* 266 */ "cmd ::= SHOW db_kind_opt DATABASES",
- /* 267 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt",
- /* 268 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
- /* 269 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
- /* 270 */ "cmd ::= SHOW MNODES",
- /* 271 */ "cmd ::= SHOW QNODES",
- /* 272 */ "cmd ::= SHOW ARBGROUPS",
- /* 273 */ "cmd ::= SHOW FUNCTIONS",
- /* 274 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
- /* 275 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name",
- /* 276 */ "cmd ::= SHOW STREAMS",
- /* 277 */ "cmd ::= SHOW ACCOUNTS",
- /* 278 */ "cmd ::= SHOW APPS",
- /* 279 */ "cmd ::= SHOW CONNECTIONS",
- /* 280 */ "cmd ::= SHOW LICENCES",
- /* 281 */ "cmd ::= SHOW GRANTS",
- /* 282 */ "cmd ::= SHOW GRANTS FULL",
- /* 283 */ "cmd ::= SHOW GRANTS LOGS",
- /* 284 */ "cmd ::= SHOW CLUSTER MACHINES",
- /* 285 */ "cmd ::= SHOW CREATE DATABASE db_name",
- /* 286 */ "cmd ::= SHOW CREATE TABLE full_table_name",
- /* 287 */ "cmd ::= SHOW CREATE STABLE full_table_name",
- /* 288 */ "cmd ::= SHOW ENCRYPTIONS",
- /* 289 */ "cmd ::= SHOW QUERIES",
- /* 290 */ "cmd ::= SHOW SCORES",
- /* 291 */ "cmd ::= SHOW TOPICS",
- /* 292 */ "cmd ::= SHOW VARIABLES",
- /* 293 */ "cmd ::= SHOW CLUSTER VARIABLES",
- /* 294 */ "cmd ::= SHOW LOCAL VARIABLES",
- /* 295 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
- /* 296 */ "cmd ::= SHOW BNODES",
- /* 297 */ "cmd ::= SHOW SNODES",
- /* 298 */ "cmd ::= SHOW CLUSTER",
- /* 299 */ "cmd ::= SHOW TRANSACTIONS",
- /* 300 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
- /* 301 */ "cmd ::= SHOW CONSUMERS",
- /* 302 */ "cmd ::= SHOW SUBSCRIPTIONS",
- /* 303 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
- /* 304 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name",
- /* 305 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
- /* 306 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name",
- /* 307 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER",
- /* 308 */ "cmd ::= SHOW VNODES",
- /* 309 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
- /* 310 */ "cmd ::= SHOW CLUSTER ALIVE",
- /* 311 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt",
- /* 312 */ "cmd ::= SHOW CREATE VIEW full_table_name",
- /* 313 */ "cmd ::= SHOW COMPACTS",
- /* 314 */ "cmd ::= SHOW COMPACT NK_INTEGER",
- /* 315 */ "table_kind_db_name_cond_opt ::=",
- /* 316 */ "table_kind_db_name_cond_opt ::= table_kind",
- /* 317 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT",
- /* 318 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT",
- /* 319 */ "table_kind ::= NORMAL",
- /* 320 */ "table_kind ::= CHILD",
- /* 321 */ "db_name_cond_opt ::=",
- /* 322 */ "db_name_cond_opt ::= db_name NK_DOT",
- /* 323 */ "like_pattern_opt ::=",
- /* 324 */ "like_pattern_opt ::= LIKE NK_STRING",
- /* 325 */ "table_name_cond ::= table_name",
- /* 326 */ "from_db_opt ::=",
- /* 327 */ "from_db_opt ::= FROM db_name",
- /* 328 */ "tag_list_opt ::=",
- /* 329 */ "tag_list_opt ::= tag_item",
- /* 330 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
- /* 331 */ "tag_item ::= TBNAME",
- /* 332 */ "tag_item ::= QTAGS",
- /* 333 */ "tag_item ::= column_name",
- /* 334 */ "tag_item ::= column_name column_alias",
- /* 335 */ "tag_item ::= column_name AS column_alias",
- /* 336 */ "db_kind_opt ::=",
- /* 337 */ "db_kind_opt ::= USER",
- /* 338 */ "db_kind_opt ::= SYSTEM",
- /* 339 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP",
- /* 340 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP",
- /* 341 */ "cmd ::= DROP TSMA exists_opt full_tsma_name",
- /* 342 */ "cmd ::= SHOW db_name_cond_opt TSMAS",
- /* 343 */ "full_tsma_name ::= tsma_name",
- /* 344 */ "full_tsma_name ::= db_name NK_DOT tsma_name",
- /* 345 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP",
- /* 346 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options",
- /* 347 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP",
- /* 348 */ "cmd ::= DROP INDEX exists_opt full_index_name",
- /* 349 */ "full_index_name ::= index_name",
- /* 350 */ "full_index_name ::= db_name NK_DOT index_name",
- /* 351 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
- /* 352 */ "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",
- /* 353 */ "func_list ::= func",
- /* 354 */ "func_list ::= func_list NK_COMMA func",
- /* 355 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
- /* 356 */ "sma_func_name ::= function_name",
- /* 357 */ "sma_func_name ::= COUNT",
- /* 358 */ "sma_func_name ::= FIRST",
- /* 359 */ "sma_func_name ::= LAST",
- /* 360 */ "sma_func_name ::= LAST_ROW",
- /* 361 */ "sma_stream_opt ::=",
- /* 362 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
- /* 363 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
- /* 364 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
- /* 365 */ "with_meta ::= AS",
- /* 366 */ "with_meta ::= WITH META AS",
- /* 367 */ "with_meta ::= ONLY META AS",
- /* 368 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
- /* 369 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name",
- /* 370 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt",
- /* 371 */ "cmd ::= DROP TOPIC exists_opt topic_name",
- /* 372 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
- /* 373 */ "cmd ::= DESC full_table_name",
- /* 374 */ "cmd ::= DESCRIBE full_table_name",
- /* 375 */ "cmd ::= RESET QUERY CACHE",
- /* 376 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
- /* 377 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
- /* 378 */ "analyze_opt ::=",
- /* 379 */ "analyze_opt ::= ANALYZE",
- /* 380 */ "explain_options ::=",
- /* 381 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
- /* 382 */ "explain_options ::= explain_options RATIO NK_FLOAT",
- /* 383 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt",
- /* 384 */ "cmd ::= DROP FUNCTION exists_opt function_name",
- /* 385 */ "agg_func_opt ::=",
- /* 386 */ "agg_func_opt ::= AGGREGATE",
- /* 387 */ "bufsize_opt ::=",
- /* 388 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
- /* 389 */ "language_opt ::=",
- /* 390 */ "language_opt ::= LANGUAGE NK_STRING",
- /* 391 */ "or_replace_opt ::=",
- /* 392 */ "or_replace_opt ::= OR REPLACE",
- /* 393 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery",
- /* 394 */ "cmd ::= DROP VIEW exists_opt full_view_name",
- /* 395 */ "full_view_name ::= view_name",
- /* 396 */ "full_view_name ::= db_name NK_DOT view_name",
- /* 397 */ "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",
- /* 398 */ "cmd ::= DROP STREAM exists_opt stream_name",
- /* 399 */ "cmd ::= PAUSE STREAM exists_opt stream_name",
- /* 400 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name",
- /* 401 */ "col_list_opt ::=",
- /* 402 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP",
- /* 403 */ "column_stream_def_list ::= column_stream_def",
- /* 404 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def",
- /* 405 */ "column_stream_def ::= column_name stream_col_options",
- /* 406 */ "stream_col_options ::=",
- /* 407 */ "stream_col_options ::= stream_col_options PRIMARY KEY",
- /* 408 */ "tag_def_or_ref_opt ::=",
- /* 409 */ "tag_def_or_ref_opt ::= tags_def",
- /* 410 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP",
- /* 411 */ "stream_options ::=",
- /* 412 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
- /* 413 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
- /* 414 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
- /* 415 */ "stream_options ::= stream_options WATERMARK duration_literal",
- /* 416 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
- /* 417 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
- /* 418 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
- /* 419 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
- /* 420 */ "subtable_opt ::=",
- /* 421 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
- /* 422 */ "ignore_opt ::=",
- /* 423 */ "ignore_opt ::= IGNORE UNTREATED",
- /* 424 */ "cmd ::= KILL CONNECTION NK_INTEGER",
- /* 425 */ "cmd ::= KILL QUERY NK_STRING",
- /* 426 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
- /* 427 */ "cmd ::= KILL COMPACT NK_INTEGER",
- /* 428 */ "cmd ::= BALANCE VGROUP",
- /* 429 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id",
- /* 430 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name",
- /* 431 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
- /* 432 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
- /* 433 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
- /* 434 */ "on_vgroup_id ::=",
- /* 435 */ "on_vgroup_id ::= ON NK_INTEGER",
- /* 436 */ "dnode_list ::= DNODE NK_INTEGER",
- /* 437 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
- /* 438 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
- /* 439 */ "cmd ::= query_or_subquery",
- /* 440 */ "cmd ::= insert_query",
- /* 441 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
- /* 442 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
- /* 443 */ "tags_literal ::= NK_INTEGER",
- /* 444 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal",
- /* 445 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal",
- /* 446 */ "tags_literal ::= NK_PLUS NK_INTEGER",
- /* 447 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal",
- /* 448 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal",
- /* 449 */ "tags_literal ::= NK_MINUS NK_INTEGER",
- /* 450 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal",
- /* 451 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal",
- /* 452 */ "tags_literal ::= NK_FLOAT",
- /* 453 */ "tags_literal ::= NK_PLUS NK_FLOAT",
- /* 454 */ "tags_literal ::= NK_MINUS NK_FLOAT",
- /* 455 */ "tags_literal ::= NK_BIN",
- /* 456 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal",
- /* 457 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal",
- /* 458 */ "tags_literal ::= NK_PLUS NK_BIN",
- /* 459 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal",
- /* 460 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal",
- /* 461 */ "tags_literal ::= NK_MINUS NK_BIN",
- /* 462 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal",
- /* 463 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal",
- /* 464 */ "tags_literal ::= NK_HEX",
- /* 465 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal",
- /* 466 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal",
- /* 467 */ "tags_literal ::= NK_PLUS NK_HEX",
- /* 468 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal",
- /* 469 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal",
- /* 470 */ "tags_literal ::= NK_MINUS NK_HEX",
- /* 471 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal",
- /* 472 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal",
- /* 473 */ "tags_literal ::= NK_STRING",
- /* 474 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal",
- /* 475 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal",
- /* 476 */ "tags_literal ::= NK_BOOL",
- /* 477 */ "tags_literal ::= NULL",
- /* 478 */ "tags_literal ::= literal_func",
- /* 479 */ "tags_literal ::= literal_func NK_PLUS duration_literal",
- /* 480 */ "tags_literal ::= literal_func NK_MINUS duration_literal",
- /* 481 */ "tags_literal_list ::= tags_literal",
- /* 482 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal",
- /* 483 */ "literal ::= NK_INTEGER",
- /* 484 */ "literal ::= NK_FLOAT",
- /* 485 */ "literal ::= NK_STRING",
- /* 486 */ "literal ::= NK_BOOL",
- /* 487 */ "literal ::= TIMESTAMP NK_STRING",
- /* 488 */ "literal ::= duration_literal",
- /* 489 */ "literal ::= NULL",
- /* 490 */ "literal ::= NK_QUESTION",
- /* 491 */ "duration_literal ::= NK_VARIABLE",
- /* 492 */ "signed ::= NK_INTEGER",
- /* 493 */ "signed ::= NK_PLUS NK_INTEGER",
- /* 494 */ "signed ::= NK_MINUS NK_INTEGER",
- /* 495 */ "signed ::= NK_FLOAT",
- /* 496 */ "signed ::= NK_PLUS NK_FLOAT",
- /* 497 */ "signed ::= NK_MINUS NK_FLOAT",
- /* 498 */ "signed_literal ::= signed",
- /* 499 */ "signed_literal ::= NK_STRING",
- /* 500 */ "signed_literal ::= NK_BOOL",
- /* 501 */ "signed_literal ::= TIMESTAMP NK_STRING",
- /* 502 */ "signed_literal ::= duration_literal",
- /* 503 */ "signed_literal ::= NULL",
- /* 504 */ "signed_literal ::= literal_func",
- /* 505 */ "signed_literal ::= NK_QUESTION",
- /* 506 */ "literal_list ::= signed_literal",
- /* 507 */ "literal_list ::= literal_list NK_COMMA signed_literal",
- /* 508 */ "db_name ::= NK_ID",
- /* 509 */ "table_name ::= NK_ID",
- /* 510 */ "column_name ::= NK_ID",
- /* 511 */ "function_name ::= NK_ID",
- /* 512 */ "view_name ::= NK_ID",
- /* 513 */ "table_alias ::= NK_ID",
- /* 514 */ "column_alias ::= NK_ID",
- /* 515 */ "column_alias ::= NK_ALIAS",
- /* 516 */ "user_name ::= NK_ID",
- /* 517 */ "topic_name ::= NK_ID",
- /* 518 */ "stream_name ::= NK_ID",
- /* 519 */ "cgroup_name ::= NK_ID",
- /* 520 */ "index_name ::= NK_ID",
- /* 521 */ "tsma_name ::= NK_ID",
- /* 522 */ "expr_or_subquery ::= expression",
- /* 523 */ "expression ::= literal",
- /* 524 */ "expression ::= pseudo_column",
- /* 525 */ "expression ::= column_reference",
- /* 526 */ "expression ::= function_expression",
- /* 527 */ "expression ::= case_when_expression",
- /* 528 */ "expression ::= NK_LP expression NK_RP",
- /* 529 */ "expression ::= NK_PLUS expr_or_subquery",
- /* 530 */ "expression ::= NK_MINUS expr_or_subquery",
- /* 531 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
- /* 532 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
- /* 533 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
- /* 534 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
- /* 535 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
- /* 536 */ "expression ::= column_reference NK_ARROW NK_STRING",
- /* 537 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
- /* 538 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
- /* 539 */ "expression_list ::= expr_or_subquery",
- /* 540 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
- /* 541 */ "column_reference ::= column_name",
- /* 542 */ "column_reference ::= table_name NK_DOT column_name",
- /* 543 */ "column_reference ::= NK_ALIAS",
- /* 544 */ "column_reference ::= table_name NK_DOT NK_ALIAS",
- /* 545 */ "pseudo_column ::= ROWTS",
- /* 546 */ "pseudo_column ::= TBNAME",
- /* 547 */ "pseudo_column ::= table_name NK_DOT TBNAME",
- /* 548 */ "pseudo_column ::= QSTART",
- /* 549 */ "pseudo_column ::= QEND",
- /* 550 */ "pseudo_column ::= QDURATION",
- /* 551 */ "pseudo_column ::= WSTART",
- /* 552 */ "pseudo_column ::= WEND",
- /* 553 */ "pseudo_column ::= WDURATION",
- /* 554 */ "pseudo_column ::= IROWTS",
- /* 555 */ "pseudo_column ::= ISFILLED",
- /* 556 */ "pseudo_column ::= QTAGS",
- /* 557 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
- /* 558 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
- /* 559 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
- /* 560 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP",
- /* 561 */ "function_expression ::= literal_func",
- /* 562 */ "literal_func ::= noarg_func NK_LP NK_RP",
- /* 563 */ "literal_func ::= NOW",
- /* 564 */ "literal_func ::= TODAY",
- /* 565 */ "noarg_func ::= NOW",
- /* 566 */ "noarg_func ::= TODAY",
- /* 567 */ "noarg_func ::= TIMEZONE",
- /* 568 */ "noarg_func ::= DATABASE",
- /* 569 */ "noarg_func ::= CLIENT_VERSION",
- /* 570 */ "noarg_func ::= SERVER_VERSION",
- /* 571 */ "noarg_func ::= SERVER_STATUS",
- /* 572 */ "noarg_func ::= CURRENT_USER",
- /* 573 */ "noarg_func ::= USER",
- /* 574 */ "star_func ::= COUNT",
- /* 575 */ "star_func ::= FIRST",
- /* 576 */ "star_func ::= LAST",
- /* 577 */ "star_func ::= LAST_ROW",
- /* 578 */ "star_func_para_list ::= NK_STAR",
- /* 579 */ "star_func_para_list ::= other_para_list",
- /* 580 */ "other_para_list ::= star_func_para",
- /* 581 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
- /* 582 */ "star_func_para ::= expr_or_subquery",
- /* 583 */ "star_func_para ::= table_name NK_DOT NK_STAR",
- /* 584 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
- /* 585 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
- /* 586 */ "when_then_list ::= when_then_expr",
- /* 587 */ "when_then_list ::= when_then_list when_then_expr",
- /* 588 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
- /* 589 */ "case_when_else_opt ::=",
- /* 590 */ "case_when_else_opt ::= ELSE common_expression",
- /* 591 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
- /* 592 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 593 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
- /* 594 */ "predicate ::= expr_or_subquery IS NULL",
- /* 595 */ "predicate ::= expr_or_subquery IS NOT NULL",
- /* 596 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
- /* 597 */ "compare_op ::= NK_LT",
- /* 598 */ "compare_op ::= NK_GT",
- /* 599 */ "compare_op ::= NK_LE",
- /* 600 */ "compare_op ::= NK_GE",
- /* 601 */ "compare_op ::= NK_NE",
- /* 602 */ "compare_op ::= NK_EQ",
- /* 603 */ "compare_op ::= LIKE",
- /* 604 */ "compare_op ::= NOT LIKE",
- /* 605 */ "compare_op ::= MATCH",
- /* 606 */ "compare_op ::= NMATCH",
- /* 607 */ "compare_op ::= CONTAINS",
- /* 608 */ "in_op ::= IN",
- /* 609 */ "in_op ::= NOT IN",
- /* 610 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
- /* 611 */ "boolean_value_expression ::= boolean_primary",
- /* 612 */ "boolean_value_expression ::= NOT boolean_primary",
- /* 613 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
- /* 614 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
- /* 615 */ "boolean_primary ::= predicate",
- /* 616 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
- /* 617 */ "common_expression ::= expr_or_subquery",
- /* 618 */ "common_expression ::= boolean_value_expression",
- /* 619 */ "from_clause_opt ::=",
- /* 620 */ "from_clause_opt ::= FROM table_reference_list",
- /* 621 */ "table_reference_list ::= table_reference",
- /* 622 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
- /* 623 */ "table_reference ::= table_primary",
- /* 624 */ "table_reference ::= joined_table",
- /* 625 */ "table_primary ::= table_name alias_opt",
- /* 626 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
- /* 627 */ "table_primary ::= subquery alias_opt",
- /* 628 */ "table_primary ::= parenthesized_joined_table",
- /* 629 */ "alias_opt ::=",
- /* 630 */ "alias_opt ::= table_alias",
- /* 631 */ "alias_opt ::= AS table_alias",
- /* 632 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
- /* 633 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
- /* 634 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt",
- /* 635 */ "join_type ::=",
- /* 636 */ "join_type ::= INNER",
- /* 637 */ "join_type ::= LEFT",
- /* 638 */ "join_type ::= RIGHT",
- /* 639 */ "join_type ::= FULL",
- /* 640 */ "join_subtype ::=",
- /* 641 */ "join_subtype ::= OUTER",
- /* 642 */ "join_subtype ::= SEMI",
- /* 643 */ "join_subtype ::= ANTI",
- /* 644 */ "join_subtype ::= ASOF",
- /* 645 */ "join_subtype ::= WINDOW",
- /* 646 */ "join_on_clause_opt ::=",
- /* 647 */ "join_on_clause_opt ::= ON search_condition",
- /* 648 */ "window_offset_clause_opt ::=",
- /* 649 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP",
- /* 650 */ "window_offset_literal ::= NK_VARIABLE",
- /* 651 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE",
- /* 652 */ "jlimit_clause_opt ::=",
- /* 653 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER",
- /* 654 */ "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",
- /* 655 */ "hint_list ::=",
- /* 656 */ "hint_list ::= NK_HINT",
- /* 657 */ "tag_mode_opt ::=",
- /* 658 */ "tag_mode_opt ::= TAGS",
- /* 659 */ "set_quantifier_opt ::=",
- /* 660 */ "set_quantifier_opt ::= DISTINCT",
- /* 661 */ "set_quantifier_opt ::= ALL",
- /* 662 */ "select_list ::= select_item",
- /* 663 */ "select_list ::= select_list NK_COMMA select_item",
- /* 664 */ "select_item ::= NK_STAR",
- /* 665 */ "select_item ::= common_expression",
- /* 666 */ "select_item ::= common_expression column_alias",
- /* 667 */ "select_item ::= common_expression AS column_alias",
- /* 668 */ "select_item ::= table_name NK_DOT NK_STAR",
- /* 669 */ "where_clause_opt ::=",
- /* 670 */ "where_clause_opt ::= WHERE search_condition",
- /* 671 */ "partition_by_clause_opt ::=",
- /* 672 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
- /* 673 */ "partition_list ::= partition_item",
- /* 674 */ "partition_list ::= partition_list NK_COMMA partition_item",
- /* 675 */ "partition_item ::= expr_or_subquery",
- /* 676 */ "partition_item ::= expr_or_subquery column_alias",
- /* 677 */ "partition_item ::= expr_or_subquery AS column_alias",
- /* 678 */ "twindow_clause_opt ::=",
- /* 679 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP",
- /* 680 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
- /* 681 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt",
- /* 682 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt",
- /* 683 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
- /* 684 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP",
- /* 685 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
- /* 686 */ "sliding_opt ::=",
- /* 687 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP",
- /* 688 */ "interval_sliding_duration_literal ::= NK_VARIABLE",
- /* 689 */ "interval_sliding_duration_literal ::= NK_STRING",
- /* 690 */ "interval_sliding_duration_literal ::= NK_INTEGER",
- /* 691 */ "fill_opt ::=",
- /* 692 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
- /* 693 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP",
- /* 694 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP",
- /* 695 */ "fill_mode ::= NONE",
- /* 696 */ "fill_mode ::= PREV",
- /* 697 */ "fill_mode ::= NULL",
- /* 698 */ "fill_mode ::= NULL_F",
- /* 699 */ "fill_mode ::= LINEAR",
- /* 700 */ "fill_mode ::= NEXT",
- /* 701 */ "group_by_clause_opt ::=",
- /* 702 */ "group_by_clause_opt ::= GROUP BY group_by_list",
- /* 703 */ "group_by_list ::= expr_or_subquery",
- /* 704 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
- /* 705 */ "having_clause_opt ::=",
- /* 706 */ "having_clause_opt ::= HAVING search_condition",
- /* 707 */ "range_opt ::=",
- /* 708 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
- /* 709 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP",
- /* 710 */ "every_opt ::=",
- /* 711 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
- /* 712 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
- /* 713 */ "query_simple ::= query_specification",
- /* 714 */ "query_simple ::= union_query_expression",
- /* 715 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
- /* 716 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
- /* 717 */ "query_simple_or_subquery ::= query_simple",
- /* 718 */ "query_simple_or_subquery ::= subquery",
- /* 719 */ "query_or_subquery ::= query_expression",
- /* 720 */ "query_or_subquery ::= subquery",
- /* 721 */ "order_by_clause_opt ::=",
- /* 722 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
- /* 723 */ "slimit_clause_opt ::=",
- /* 724 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
- /* 725 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
- /* 726 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 727 */ "limit_clause_opt ::=",
- /* 728 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
- /* 729 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
- /* 730 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
- /* 731 */ "subquery ::= NK_LP query_expression NK_RP",
- /* 732 */ "subquery ::= NK_LP subquery NK_RP",
- /* 733 */ "search_condition ::= common_expression",
- /* 734 */ "sort_specification_list ::= sort_specification",
- /* 735 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
- /* 736 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
- /* 737 */ "ordering_specification_opt ::=",
- /* 738 */ "ordering_specification_opt ::= ASC",
- /* 739 */ "ordering_specification_opt ::= DESC",
- /* 740 */ "null_ordering_opt ::=",
- /* 741 */ "null_ordering_opt ::= NULLS FIRST",
- /* 742 */ "null_ordering_opt ::= NULLS LAST",
- /* 743 */ "column_options ::=",
- /* 744 */ "column_options ::= column_options PRIMARY KEY",
- /* 745 */ "column_options ::= column_options ENCODE NK_STRING",
- /* 746 */ "column_options ::= column_options COMPRESS NK_STRING",
- /* 747 */ "column_options ::= column_options LEVEL NK_STRING",
+ /* 33 */ "cmd ::= ALTER USER user_name CREATEDB NK_INTEGER",
+ /* 34 */ "cmd ::= ALTER USER user_name ADD white_list",
+ /* 35 */ "cmd ::= ALTER USER user_name DROP white_list",
+ /* 36 */ "cmd ::= DROP USER user_name",
+ /* 37 */ "sysinfo_opt ::=",
+ /* 38 */ "sysinfo_opt ::= SYSINFO NK_INTEGER",
+ /* 39 */ "cmd ::= GRANT privileges ON priv_level with_opt TO user_name",
+ /* 40 */ "cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name",
+ /* 41 */ "privileges ::= ALL",
+ /* 42 */ "privileges ::= priv_type_list",
+ /* 43 */ "privileges ::= SUBSCRIBE",
+ /* 44 */ "priv_type_list ::= priv_type",
+ /* 45 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type",
+ /* 46 */ "priv_type ::= READ",
+ /* 47 */ "priv_type ::= WRITE",
+ /* 48 */ "priv_type ::= ALTER",
+ /* 49 */ "priv_level ::= NK_STAR NK_DOT NK_STAR",
+ /* 50 */ "priv_level ::= db_name NK_DOT NK_STAR",
+ /* 51 */ "priv_level ::= db_name NK_DOT table_name",
+ /* 52 */ "priv_level ::= topic_name",
+ /* 53 */ "with_opt ::=",
+ /* 54 */ "with_opt ::= WITH search_condition",
+ /* 55 */ "cmd ::= CREATE ENCRYPT_KEY NK_STRING",
+ /* 56 */ "cmd ::= CREATE DNODE dnode_endpoint",
+ /* 57 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER",
+ /* 58 */ "cmd ::= DROP DNODE NK_INTEGER force_opt",
+ /* 59 */ "cmd ::= DROP DNODE dnode_endpoint force_opt",
+ /* 60 */ "cmd ::= DROP DNODE NK_INTEGER unsafe_opt",
+ /* 61 */ "cmd ::= DROP DNODE dnode_endpoint unsafe_opt",
+ /* 62 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
+ /* 63 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
+ /* 64 */ "cmd ::= ALTER ALL DNODES NK_STRING",
+ /* 65 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
+ /* 66 */ "cmd ::= RESTORE DNODE NK_INTEGER",
+ /* 67 */ "dnode_endpoint ::= NK_STRING",
+ /* 68 */ "dnode_endpoint ::= NK_ID",
+ /* 69 */ "dnode_endpoint ::= NK_IPTOKEN",
+ /* 70 */ "force_opt ::=",
+ /* 71 */ "force_opt ::= FORCE",
+ /* 72 */ "unsafe_opt ::= UNSAFE",
+ /* 73 */ "cmd ::= ALTER CLUSTER NK_STRING",
+ /* 74 */ "cmd ::= ALTER CLUSTER NK_STRING NK_STRING",
+ /* 75 */ "cmd ::= ALTER LOCAL NK_STRING",
+ /* 76 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
+ /* 77 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
+ /* 78 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
+ /* 79 */ "cmd ::= RESTORE QNODE ON DNODE NK_INTEGER",
+ /* 80 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
+ /* 81 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
+ /* 82 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
+ /* 83 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
+ /* 84 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
+ /* 85 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
+ /* 86 */ "cmd ::= RESTORE MNODE ON DNODE NK_INTEGER",
+ /* 87 */ "cmd ::= RESTORE VNODE ON DNODE NK_INTEGER",
+ /* 88 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
+ /* 89 */ "cmd ::= DROP DATABASE exists_opt db_name",
+ /* 90 */ "cmd ::= USE db_name",
+ /* 91 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
+ /* 92 */ "cmd ::= FLUSH DATABASE db_name",
+ /* 93 */ "cmd ::= TRIM DATABASE db_name speed_opt",
+ /* 94 */ "cmd ::= S3MIGRATE DATABASE db_name",
+ /* 95 */ "cmd ::= COMPACT DATABASE db_name start_opt end_opt",
+ /* 96 */ "not_exists_opt ::= IF NOT EXISTS",
+ /* 97 */ "not_exists_opt ::=",
+ /* 98 */ "exists_opt ::= IF EXISTS",
+ /* 99 */ "exists_opt ::=",
+ /* 100 */ "db_options ::=",
+ /* 101 */ "db_options ::= db_options BUFFER NK_INTEGER",
+ /* 102 */ "db_options ::= db_options CACHEMODEL NK_STRING",
+ /* 103 */ "db_options ::= db_options CACHESIZE NK_INTEGER",
+ /* 104 */ "db_options ::= db_options COMP NK_INTEGER",
+ /* 105 */ "db_options ::= db_options DURATION NK_INTEGER",
+ /* 106 */ "db_options ::= db_options DURATION NK_VARIABLE",
+ /* 107 */ "db_options ::= db_options MAXROWS NK_INTEGER",
+ /* 108 */ "db_options ::= db_options MINROWS NK_INTEGER",
+ /* 109 */ "db_options ::= db_options KEEP integer_list",
+ /* 110 */ "db_options ::= db_options KEEP variable_list",
+ /* 111 */ "db_options ::= db_options PAGES NK_INTEGER",
+ /* 112 */ "db_options ::= db_options PAGESIZE NK_INTEGER",
+ /* 113 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER",
+ /* 114 */ "db_options ::= db_options PRECISION NK_STRING",
+ /* 115 */ "db_options ::= db_options REPLICA NK_INTEGER",
+ /* 116 */ "db_options ::= db_options VGROUPS NK_INTEGER",
+ /* 117 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
+ /* 118 */ "db_options ::= db_options RETENTIONS retention_list",
+ /* 119 */ "db_options ::= db_options SCHEMALESS NK_INTEGER",
+ /* 120 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER",
+ /* 121 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER",
+ /* 122 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER",
+ /* 123 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
+ /* 124 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER",
+ /* 125 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
+ /* 126 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER",
+ /* 127 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER",
+ /* 128 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER",
+ /* 129 */ "db_options ::= db_options TABLE_PREFIX signed",
+ /* 130 */ "db_options ::= db_options TABLE_SUFFIX signed",
+ /* 131 */ "db_options ::= db_options S3_CHUNKSIZE NK_INTEGER",
+ /* 132 */ "db_options ::= db_options S3_KEEPLOCAL NK_INTEGER",
+ /* 133 */ "db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE",
+ /* 134 */ "db_options ::= db_options S3_COMPACT NK_INTEGER",
+ /* 135 */ "db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER",
+ /* 136 */ "db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING",
+ /* 137 */ "alter_db_options ::= alter_db_option",
+ /* 138 */ "alter_db_options ::= alter_db_options alter_db_option",
+ /* 139 */ "alter_db_option ::= BUFFER NK_INTEGER",
+ /* 140 */ "alter_db_option ::= CACHEMODEL NK_STRING",
+ /* 141 */ "alter_db_option ::= CACHESIZE NK_INTEGER",
+ /* 142 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER",
+ /* 143 */ "alter_db_option ::= KEEP integer_list",
+ /* 144 */ "alter_db_option ::= KEEP variable_list",
+ /* 145 */ "alter_db_option ::= PAGES NK_INTEGER",
+ /* 146 */ "alter_db_option ::= REPLICA NK_INTEGER",
+ /* 147 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER",
+ /* 148 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER",
+ /* 149 */ "alter_db_option ::= MINROWS NK_INTEGER",
+ /* 150 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER",
+ /* 151 */ "alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
+ /* 152 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER",
+ /* 153 */ "alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
+ /* 154 */ "alter_db_option ::= S3_KEEPLOCAL NK_INTEGER",
+ /* 155 */ "alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE",
+ /* 156 */ "alter_db_option ::= S3_COMPACT NK_INTEGER",
+ /* 157 */ "alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER",
+ /* 158 */ "alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING",
+ /* 159 */ "integer_list ::= NK_INTEGER",
+ /* 160 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
+ /* 161 */ "variable_list ::= NK_VARIABLE",
+ /* 162 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
+ /* 163 */ "retention_list ::= retention",
+ /* 164 */ "retention_list ::= retention_list NK_COMMA retention",
+ /* 165 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
+ /* 166 */ "retention ::= NK_MINUS NK_COLON NK_VARIABLE",
+ /* 167 */ "speed_opt ::=",
+ /* 168 */ "speed_opt ::= BWLIMIT NK_INTEGER",
+ /* 169 */ "start_opt ::=",
+ /* 170 */ "start_opt ::= START WITH NK_INTEGER",
+ /* 171 */ "start_opt ::= START WITH NK_STRING",
+ /* 172 */ "start_opt ::= START WITH TIMESTAMP NK_STRING",
+ /* 173 */ "end_opt ::=",
+ /* 174 */ "end_opt ::= END WITH NK_INTEGER",
+ /* 175 */ "end_opt ::= END WITH NK_STRING",
+ /* 176 */ "end_opt ::= END WITH TIMESTAMP NK_STRING",
+ /* 177 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
+ /* 178 */ "cmd ::= CREATE TABLE multi_create_clause",
+ /* 179 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
+ /* 180 */ "cmd ::= DROP TABLE multi_drop_clause",
+ /* 181 */ "cmd ::= DROP STABLE exists_opt full_table_name",
+ /* 182 */ "cmd ::= ALTER TABLE alter_table_clause",
+ /* 183 */ "cmd ::= ALTER STABLE alter_table_clause",
+ /* 184 */ "alter_table_clause ::= full_table_name alter_table_options",
+ /* 185 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options",
+ /* 186 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
+ /* 187 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
+ /* 188 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options",
+ /* 189 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
+ /* 190 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
+ /* 191 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
+ /* 192 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
+ /* 193 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
+ /* 194 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal",
+ /* 195 */ "multi_create_clause ::= create_subtable_clause",
+ /* 196 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
+ /* 197 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options",
+ /* 198 */ "multi_drop_clause ::= drop_table_clause",
+ /* 199 */ "multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause",
+ /* 200 */ "drop_table_clause ::= exists_opt full_table_name",
+ /* 201 */ "specific_cols_opt ::=",
+ /* 202 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
+ /* 203 */ "full_table_name ::= table_name",
+ /* 204 */ "full_table_name ::= db_name NK_DOT table_name",
+ /* 205 */ "tag_def_list ::= tag_def",
+ /* 206 */ "tag_def_list ::= tag_def_list NK_COMMA tag_def",
+ /* 207 */ "tag_def ::= column_name type_name",
+ /* 208 */ "column_def_list ::= column_def",
+ /* 209 */ "column_def_list ::= column_def_list NK_COMMA column_def",
+ /* 210 */ "column_def ::= column_name type_name column_options",
+ /* 211 */ "type_name ::= BOOL",
+ /* 212 */ "type_name ::= TINYINT",
+ /* 213 */ "type_name ::= SMALLINT",
+ /* 214 */ "type_name ::= INT",
+ /* 215 */ "type_name ::= INTEGER",
+ /* 216 */ "type_name ::= BIGINT",
+ /* 217 */ "type_name ::= FLOAT",
+ /* 218 */ "type_name ::= DOUBLE",
+ /* 219 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
+ /* 220 */ "type_name ::= TIMESTAMP",
+ /* 221 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
+ /* 222 */ "type_name ::= TINYINT UNSIGNED",
+ /* 223 */ "type_name ::= SMALLINT UNSIGNED",
+ /* 224 */ "type_name ::= INT UNSIGNED",
+ /* 225 */ "type_name ::= BIGINT UNSIGNED",
+ /* 226 */ "type_name ::= JSON",
+ /* 227 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
+ /* 228 */ "type_name ::= MEDIUMBLOB",
+ /* 229 */ "type_name ::= BLOB",
+ /* 230 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
+ /* 231 */ "type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP",
+ /* 232 */ "type_name ::= DECIMAL",
+ /* 233 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
+ /* 234 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
+ /* 235 */ "type_name_default_len ::= BINARY",
+ /* 236 */ "type_name_default_len ::= NCHAR",
+ /* 237 */ "type_name_default_len ::= VARCHAR",
+ /* 238 */ "type_name_default_len ::= VARBINARY",
+ /* 239 */ "tags_def_opt ::=",
+ /* 240 */ "tags_def_opt ::= tags_def",
+ /* 241 */ "tags_def ::= TAGS NK_LP tag_def_list NK_RP",
+ /* 242 */ "table_options ::=",
+ /* 243 */ "table_options ::= table_options COMMENT NK_STRING",
+ /* 244 */ "table_options ::= table_options MAX_DELAY duration_list",
+ /* 245 */ "table_options ::= table_options WATERMARK duration_list",
+ /* 246 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
+ /* 247 */ "table_options ::= table_options TTL NK_INTEGER",
+ /* 248 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
+ /* 249 */ "table_options ::= table_options DELETE_MARK duration_list",
+ /* 250 */ "alter_table_options ::= alter_table_option",
+ /* 251 */ "alter_table_options ::= alter_table_options alter_table_option",
+ /* 252 */ "alter_table_option ::= COMMENT NK_STRING",
+ /* 253 */ "alter_table_option ::= TTL NK_INTEGER",
+ /* 254 */ "duration_list ::= duration_literal",
+ /* 255 */ "duration_list ::= duration_list NK_COMMA duration_literal",
+ /* 256 */ "rollup_func_list ::= rollup_func_name",
+ /* 257 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
+ /* 258 */ "rollup_func_name ::= function_name",
+ /* 259 */ "rollup_func_name ::= FIRST",
+ /* 260 */ "rollup_func_name ::= LAST",
+ /* 261 */ "col_name_list ::= col_name",
+ /* 262 */ "col_name_list ::= col_name_list NK_COMMA col_name",
+ /* 263 */ "col_name ::= column_name",
+ /* 264 */ "cmd ::= SHOW DNODES",
+ /* 265 */ "cmd ::= SHOW USERS",
+ /* 266 */ "cmd ::= SHOW USER PRIVILEGES",
+ /* 267 */ "cmd ::= SHOW db_kind_opt DATABASES",
+ /* 268 */ "cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt",
+ /* 269 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
+ /* 270 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
+ /* 271 */ "cmd ::= SHOW MNODES",
+ /* 272 */ "cmd ::= SHOW QNODES",
+ /* 273 */ "cmd ::= SHOW ARBGROUPS",
+ /* 274 */ "cmd ::= SHOW FUNCTIONS",
+ /* 275 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
+ /* 276 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name",
+ /* 277 */ "cmd ::= SHOW STREAMS",
+ /* 278 */ "cmd ::= SHOW ACCOUNTS",
+ /* 279 */ "cmd ::= SHOW APPS",
+ /* 280 */ "cmd ::= SHOW CONNECTIONS",
+ /* 281 */ "cmd ::= SHOW LICENCES",
+ /* 282 */ "cmd ::= SHOW GRANTS",
+ /* 283 */ "cmd ::= SHOW GRANTS FULL",
+ /* 284 */ "cmd ::= SHOW GRANTS LOGS",
+ /* 285 */ "cmd ::= SHOW CLUSTER MACHINES",
+ /* 286 */ "cmd ::= SHOW CREATE DATABASE db_name",
+ /* 287 */ "cmd ::= SHOW CREATE TABLE full_table_name",
+ /* 288 */ "cmd ::= SHOW CREATE STABLE full_table_name",
+ /* 289 */ "cmd ::= SHOW ENCRYPTIONS",
+ /* 290 */ "cmd ::= SHOW QUERIES",
+ /* 291 */ "cmd ::= SHOW SCORES",
+ /* 292 */ "cmd ::= SHOW TOPICS",
+ /* 293 */ "cmd ::= SHOW VARIABLES",
+ /* 294 */ "cmd ::= SHOW CLUSTER VARIABLES",
+ /* 295 */ "cmd ::= SHOW LOCAL VARIABLES",
+ /* 296 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
+ /* 297 */ "cmd ::= SHOW BNODES",
+ /* 298 */ "cmd ::= SHOW SNODES",
+ /* 299 */ "cmd ::= SHOW CLUSTER",
+ /* 300 */ "cmd ::= SHOW TRANSACTIONS",
+ /* 301 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
+ /* 302 */ "cmd ::= SHOW CONSUMERS",
+ /* 303 */ "cmd ::= SHOW SUBSCRIPTIONS",
+ /* 304 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
+ /* 305 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name",
+ /* 306 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
+ /* 307 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name",
+ /* 308 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER",
+ /* 309 */ "cmd ::= SHOW VNODES",
+ /* 310 */ "cmd ::= SHOW db_name_cond_opt ALIVE",
+ /* 311 */ "cmd ::= SHOW CLUSTER ALIVE",
+ /* 312 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt",
+ /* 313 */ "cmd ::= SHOW CREATE VIEW full_table_name",
+ /* 314 */ "cmd ::= SHOW COMPACTS",
+ /* 315 */ "cmd ::= SHOW COMPACT NK_INTEGER",
+ /* 316 */ "table_kind_db_name_cond_opt ::=",
+ /* 317 */ "table_kind_db_name_cond_opt ::= table_kind",
+ /* 318 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT",
+ /* 319 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT",
+ /* 320 */ "table_kind ::= NORMAL",
+ /* 321 */ "table_kind ::= CHILD",
+ /* 322 */ "db_name_cond_opt ::=",
+ /* 323 */ "db_name_cond_opt ::= db_name NK_DOT",
+ /* 324 */ "like_pattern_opt ::=",
+ /* 325 */ "like_pattern_opt ::= LIKE NK_STRING",
+ /* 326 */ "table_name_cond ::= table_name",
+ /* 327 */ "from_db_opt ::=",
+ /* 328 */ "from_db_opt ::= FROM db_name",
+ /* 329 */ "tag_list_opt ::=",
+ /* 330 */ "tag_list_opt ::= tag_item",
+ /* 331 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
+ /* 332 */ "tag_item ::= TBNAME",
+ /* 333 */ "tag_item ::= QTAGS",
+ /* 334 */ "tag_item ::= column_name",
+ /* 335 */ "tag_item ::= column_name column_alias",
+ /* 336 */ "tag_item ::= column_name AS column_alias",
+ /* 337 */ "db_kind_opt ::=",
+ /* 338 */ "db_kind_opt ::= USER",
+ /* 339 */ "db_kind_opt ::= SYSTEM",
+ /* 340 */ "cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP",
+ /* 341 */ "cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP",
+ /* 342 */ "cmd ::= DROP TSMA exists_opt full_tsma_name",
+ /* 343 */ "cmd ::= SHOW db_name_cond_opt TSMAS",
+ /* 344 */ "full_tsma_name ::= tsma_name",
+ /* 345 */ "full_tsma_name ::= db_name NK_DOT tsma_name",
+ /* 346 */ "tsma_func_list ::= FUNCTION NK_LP func_list NK_RP",
+ /* 347 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options",
+ /* 348 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP",
+ /* 349 */ "cmd ::= DROP INDEX exists_opt full_index_name",
+ /* 350 */ "full_index_name ::= index_name",
+ /* 351 */ "full_index_name ::= db_name NK_DOT index_name",
+ /* 352 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
+ /* 353 */ "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",
+ /* 354 */ "func_list ::= func",
+ /* 355 */ "func_list ::= func_list NK_COMMA func",
+ /* 356 */ "func ::= sma_func_name NK_LP expression_list NK_RP",
+ /* 357 */ "sma_func_name ::= function_name",
+ /* 358 */ "sma_func_name ::= COUNT",
+ /* 359 */ "sma_func_name ::= FIRST",
+ /* 360 */ "sma_func_name ::= LAST",
+ /* 361 */ "sma_func_name ::= LAST_ROW",
+ /* 362 */ "sma_stream_opt ::=",
+ /* 363 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
+ /* 364 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
+ /* 365 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
+ /* 366 */ "with_meta ::= AS",
+ /* 367 */ "with_meta ::= WITH META AS",
+ /* 368 */ "with_meta ::= ONLY META AS",
+ /* 369 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
+ /* 370 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name",
+ /* 371 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt",
+ /* 372 */ "cmd ::= DROP TOPIC exists_opt topic_name",
+ /* 373 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
+ /* 374 */ "cmd ::= DESC full_table_name",
+ /* 375 */ "cmd ::= DESCRIBE full_table_name",
+ /* 376 */ "cmd ::= RESET QUERY CACHE",
+ /* 377 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
+ /* 378 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query",
+ /* 379 */ "analyze_opt ::=",
+ /* 380 */ "analyze_opt ::= ANALYZE",
+ /* 381 */ "explain_options ::=",
+ /* 382 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
+ /* 383 */ "explain_options ::= explain_options RATIO NK_FLOAT",
+ /* 384 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt",
+ /* 385 */ "cmd ::= DROP FUNCTION exists_opt function_name",
+ /* 386 */ "agg_func_opt ::=",
+ /* 387 */ "agg_func_opt ::= AGGREGATE",
+ /* 388 */ "bufsize_opt ::=",
+ /* 389 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
+ /* 390 */ "language_opt ::=",
+ /* 391 */ "language_opt ::= LANGUAGE NK_STRING",
+ /* 392 */ "or_replace_opt ::=",
+ /* 393 */ "or_replace_opt ::= OR REPLACE",
+ /* 394 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery",
+ /* 395 */ "cmd ::= DROP VIEW exists_opt full_view_name",
+ /* 396 */ "full_view_name ::= view_name",
+ /* 397 */ "full_view_name ::= db_name NK_DOT view_name",
+ /* 398 */ "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",
+ /* 399 */ "cmd ::= DROP STREAM exists_opt stream_name",
+ /* 400 */ "cmd ::= PAUSE STREAM exists_opt stream_name",
+ /* 401 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name",
+ /* 402 */ "col_list_opt ::=",
+ /* 403 */ "col_list_opt ::= NK_LP column_stream_def_list NK_RP",
+ /* 404 */ "column_stream_def_list ::= column_stream_def",
+ /* 405 */ "column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def",
+ /* 406 */ "column_stream_def ::= column_name stream_col_options",
+ /* 407 */ "stream_col_options ::=",
+ /* 408 */ "stream_col_options ::= stream_col_options PRIMARY KEY",
+ /* 409 */ "tag_def_or_ref_opt ::=",
+ /* 410 */ "tag_def_or_ref_opt ::= tags_def",
+ /* 411 */ "tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP",
+ /* 412 */ "stream_options ::=",
+ /* 413 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
+ /* 414 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
+ /* 415 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
+ /* 416 */ "stream_options ::= stream_options WATERMARK duration_literal",
+ /* 417 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
+ /* 418 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
+ /* 419 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
+ /* 420 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER",
+ /* 421 */ "subtable_opt ::=",
+ /* 422 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
+ /* 423 */ "ignore_opt ::=",
+ /* 424 */ "ignore_opt ::= IGNORE UNTREATED",
+ /* 425 */ "cmd ::= KILL CONNECTION NK_INTEGER",
+ /* 426 */ "cmd ::= KILL QUERY NK_STRING",
+ /* 427 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
+ /* 428 */ "cmd ::= KILL COMPACT NK_INTEGER",
+ /* 429 */ "cmd ::= BALANCE VGROUP",
+ /* 430 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id",
+ /* 431 */ "cmd ::= BALANCE VGROUP LEADER DATABASE db_name",
+ /* 432 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
+ /* 433 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
+ /* 434 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
+ /* 435 */ "on_vgroup_id ::=",
+ /* 436 */ "on_vgroup_id ::= ON NK_INTEGER",
+ /* 437 */ "dnode_list ::= DNODE NK_INTEGER",
+ /* 438 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
+ /* 439 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
+ /* 440 */ "cmd ::= query_or_subquery",
+ /* 441 */ "cmd ::= insert_query",
+ /* 442 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
+ /* 443 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery",
+ /* 444 */ "tags_literal ::= NK_INTEGER",
+ /* 445 */ "tags_literal ::= NK_INTEGER NK_PLUS duration_literal",
+ /* 446 */ "tags_literal ::= NK_INTEGER NK_MINUS duration_literal",
+ /* 447 */ "tags_literal ::= NK_PLUS NK_INTEGER",
+ /* 448 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal",
+ /* 449 */ "tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal",
+ /* 450 */ "tags_literal ::= NK_MINUS NK_INTEGER",
+ /* 451 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal",
+ /* 452 */ "tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal",
+ /* 453 */ "tags_literal ::= NK_FLOAT",
+ /* 454 */ "tags_literal ::= NK_PLUS NK_FLOAT",
+ /* 455 */ "tags_literal ::= NK_MINUS NK_FLOAT",
+ /* 456 */ "tags_literal ::= NK_BIN",
+ /* 457 */ "tags_literal ::= NK_BIN NK_PLUS duration_literal",
+ /* 458 */ "tags_literal ::= NK_BIN NK_MINUS duration_literal",
+ /* 459 */ "tags_literal ::= NK_PLUS NK_BIN",
+ /* 460 */ "tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal",
+ /* 461 */ "tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal",
+ /* 462 */ "tags_literal ::= NK_MINUS NK_BIN",
+ /* 463 */ "tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal",
+ /* 464 */ "tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal",
+ /* 465 */ "tags_literal ::= NK_HEX",
+ /* 466 */ "tags_literal ::= NK_HEX NK_PLUS duration_literal",
+ /* 467 */ "tags_literal ::= NK_HEX NK_MINUS duration_literal",
+ /* 468 */ "tags_literal ::= NK_PLUS NK_HEX",
+ /* 469 */ "tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal",
+ /* 470 */ "tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal",
+ /* 471 */ "tags_literal ::= NK_MINUS NK_HEX",
+ /* 472 */ "tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal",
+ /* 473 */ "tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal",
+ /* 474 */ "tags_literal ::= NK_STRING",
+ /* 475 */ "tags_literal ::= NK_STRING NK_PLUS duration_literal",
+ /* 476 */ "tags_literal ::= NK_STRING NK_MINUS duration_literal",
+ /* 477 */ "tags_literal ::= NK_BOOL",
+ /* 478 */ "tags_literal ::= NULL",
+ /* 479 */ "tags_literal ::= literal_func",
+ /* 480 */ "tags_literal ::= literal_func NK_PLUS duration_literal",
+ /* 481 */ "tags_literal ::= literal_func NK_MINUS duration_literal",
+ /* 482 */ "tags_literal_list ::= tags_literal",
+ /* 483 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal",
+ /* 484 */ "literal ::= NK_INTEGER",
+ /* 485 */ "literal ::= NK_FLOAT",
+ /* 486 */ "literal ::= NK_STRING",
+ /* 487 */ "literal ::= NK_BOOL",
+ /* 488 */ "literal ::= TIMESTAMP NK_STRING",
+ /* 489 */ "literal ::= duration_literal",
+ /* 490 */ "literal ::= NULL",
+ /* 491 */ "literal ::= NK_QUESTION",
+ /* 492 */ "duration_literal ::= NK_VARIABLE",
+ /* 493 */ "signed ::= NK_INTEGER",
+ /* 494 */ "signed ::= NK_PLUS NK_INTEGER",
+ /* 495 */ "signed ::= NK_MINUS NK_INTEGER",
+ /* 496 */ "signed ::= NK_FLOAT",
+ /* 497 */ "signed ::= NK_PLUS NK_FLOAT",
+ /* 498 */ "signed ::= NK_MINUS NK_FLOAT",
+ /* 499 */ "signed_literal ::= signed",
+ /* 500 */ "signed_literal ::= NK_STRING",
+ /* 501 */ "signed_literal ::= NK_BOOL",
+ /* 502 */ "signed_literal ::= TIMESTAMP NK_STRING",
+ /* 503 */ "signed_literal ::= duration_literal",
+ /* 504 */ "signed_literal ::= NULL",
+ /* 505 */ "signed_literal ::= literal_func",
+ /* 506 */ "signed_literal ::= NK_QUESTION",
+ /* 507 */ "literal_list ::= signed_literal",
+ /* 508 */ "literal_list ::= literal_list NK_COMMA signed_literal",
+ /* 509 */ "db_name ::= NK_ID",
+ /* 510 */ "table_name ::= NK_ID",
+ /* 511 */ "column_name ::= NK_ID",
+ /* 512 */ "function_name ::= NK_ID",
+ /* 513 */ "view_name ::= NK_ID",
+ /* 514 */ "table_alias ::= NK_ID",
+ /* 515 */ "column_alias ::= NK_ID",
+ /* 516 */ "column_alias ::= NK_ALIAS",
+ /* 517 */ "user_name ::= NK_ID",
+ /* 518 */ "topic_name ::= NK_ID",
+ /* 519 */ "stream_name ::= NK_ID",
+ /* 520 */ "cgroup_name ::= NK_ID",
+ /* 521 */ "index_name ::= NK_ID",
+ /* 522 */ "tsma_name ::= NK_ID",
+ /* 523 */ "expr_or_subquery ::= expression",
+ /* 524 */ "expression ::= literal",
+ /* 525 */ "expression ::= pseudo_column",
+ /* 526 */ "expression ::= column_reference",
+ /* 527 */ "expression ::= function_expression",
+ /* 528 */ "expression ::= case_when_expression",
+ /* 529 */ "expression ::= NK_LP expression NK_RP",
+ /* 530 */ "expression ::= NK_PLUS expr_or_subquery",
+ /* 531 */ "expression ::= NK_MINUS expr_or_subquery",
+ /* 532 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
+ /* 533 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
+ /* 534 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
+ /* 535 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
+ /* 536 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
+ /* 537 */ "expression ::= column_reference NK_ARROW NK_STRING",
+ /* 538 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
+ /* 539 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
+ /* 540 */ "expression_list ::= expr_or_subquery",
+ /* 541 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
+ /* 542 */ "column_reference ::= column_name",
+ /* 543 */ "column_reference ::= table_name NK_DOT column_name",
+ /* 544 */ "column_reference ::= NK_ALIAS",
+ /* 545 */ "column_reference ::= table_name NK_DOT NK_ALIAS",
+ /* 546 */ "pseudo_column ::= ROWTS",
+ /* 547 */ "pseudo_column ::= TBNAME",
+ /* 548 */ "pseudo_column ::= table_name NK_DOT TBNAME",
+ /* 549 */ "pseudo_column ::= QSTART",
+ /* 550 */ "pseudo_column ::= QEND",
+ /* 551 */ "pseudo_column ::= QDURATION",
+ /* 552 */ "pseudo_column ::= WSTART",
+ /* 553 */ "pseudo_column ::= WEND",
+ /* 554 */ "pseudo_column ::= WDURATION",
+ /* 555 */ "pseudo_column ::= IROWTS",
+ /* 556 */ "pseudo_column ::= ISFILLED",
+ /* 557 */ "pseudo_column ::= QTAGS",
+ /* 558 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
+ /* 559 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
+ /* 560 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
+ /* 561 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP",
+ /* 562 */ "function_expression ::= literal_func",
+ /* 563 */ "literal_func ::= noarg_func NK_LP NK_RP",
+ /* 564 */ "literal_func ::= NOW",
+ /* 565 */ "literal_func ::= TODAY",
+ /* 566 */ "noarg_func ::= NOW",
+ /* 567 */ "noarg_func ::= TODAY",
+ /* 568 */ "noarg_func ::= TIMEZONE",
+ /* 569 */ "noarg_func ::= DATABASE",
+ /* 570 */ "noarg_func ::= CLIENT_VERSION",
+ /* 571 */ "noarg_func ::= SERVER_VERSION",
+ /* 572 */ "noarg_func ::= SERVER_STATUS",
+ /* 573 */ "noarg_func ::= CURRENT_USER",
+ /* 574 */ "noarg_func ::= USER",
+ /* 575 */ "star_func ::= COUNT",
+ /* 576 */ "star_func ::= FIRST",
+ /* 577 */ "star_func ::= LAST",
+ /* 578 */ "star_func ::= LAST_ROW",
+ /* 579 */ "star_func_para_list ::= NK_STAR",
+ /* 580 */ "star_func_para_list ::= other_para_list",
+ /* 581 */ "other_para_list ::= star_func_para",
+ /* 582 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
+ /* 583 */ "star_func_para ::= expr_or_subquery",
+ /* 584 */ "star_func_para ::= table_name NK_DOT NK_STAR",
+ /* 585 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
+ /* 586 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
+ /* 587 */ "when_then_list ::= when_then_expr",
+ /* 588 */ "when_then_list ::= when_then_list when_then_expr",
+ /* 589 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
+ /* 590 */ "case_when_else_opt ::=",
+ /* 591 */ "case_when_else_opt ::= ELSE common_expression",
+ /* 592 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
+ /* 593 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 594 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
+ /* 595 */ "predicate ::= expr_or_subquery IS NULL",
+ /* 596 */ "predicate ::= expr_or_subquery IS NOT NULL",
+ /* 597 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
+ /* 598 */ "compare_op ::= NK_LT",
+ /* 599 */ "compare_op ::= NK_GT",
+ /* 600 */ "compare_op ::= NK_LE",
+ /* 601 */ "compare_op ::= NK_GE",
+ /* 602 */ "compare_op ::= NK_NE",
+ /* 603 */ "compare_op ::= NK_EQ",
+ /* 604 */ "compare_op ::= LIKE",
+ /* 605 */ "compare_op ::= NOT LIKE",
+ /* 606 */ "compare_op ::= MATCH",
+ /* 607 */ "compare_op ::= NMATCH",
+ /* 608 */ "compare_op ::= CONTAINS",
+ /* 609 */ "in_op ::= IN",
+ /* 610 */ "in_op ::= NOT IN",
+ /* 611 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
+ /* 612 */ "boolean_value_expression ::= boolean_primary",
+ /* 613 */ "boolean_value_expression ::= NOT boolean_primary",
+ /* 614 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
+ /* 615 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
+ /* 616 */ "boolean_primary ::= predicate",
+ /* 617 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
+ /* 618 */ "common_expression ::= expr_or_subquery",
+ /* 619 */ "common_expression ::= boolean_value_expression",
+ /* 620 */ "from_clause_opt ::=",
+ /* 621 */ "from_clause_opt ::= FROM table_reference_list",
+ /* 622 */ "table_reference_list ::= table_reference",
+ /* 623 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
+ /* 624 */ "table_reference ::= table_primary",
+ /* 625 */ "table_reference ::= joined_table",
+ /* 626 */ "table_primary ::= table_name alias_opt",
+ /* 627 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
+ /* 628 */ "table_primary ::= subquery alias_opt",
+ /* 629 */ "table_primary ::= parenthesized_joined_table",
+ /* 630 */ "alias_opt ::=",
+ /* 631 */ "alias_opt ::= table_alias",
+ /* 632 */ "alias_opt ::= AS table_alias",
+ /* 633 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
+ /* 634 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
+ /* 635 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt",
+ /* 636 */ "join_type ::=",
+ /* 637 */ "join_type ::= INNER",
+ /* 638 */ "join_type ::= LEFT",
+ /* 639 */ "join_type ::= RIGHT",
+ /* 640 */ "join_type ::= FULL",
+ /* 641 */ "join_subtype ::=",
+ /* 642 */ "join_subtype ::= OUTER",
+ /* 643 */ "join_subtype ::= SEMI",
+ /* 644 */ "join_subtype ::= ANTI",
+ /* 645 */ "join_subtype ::= ASOF",
+ /* 646 */ "join_subtype ::= WINDOW",
+ /* 647 */ "join_on_clause_opt ::=",
+ /* 648 */ "join_on_clause_opt ::= ON search_condition",
+ /* 649 */ "window_offset_clause_opt ::=",
+ /* 650 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP",
+ /* 651 */ "window_offset_literal ::= NK_VARIABLE",
+ /* 652 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE",
+ /* 653 */ "jlimit_clause_opt ::=",
+ /* 654 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER",
+ /* 655 */ "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",
+ /* 656 */ "hint_list ::=",
+ /* 657 */ "hint_list ::= NK_HINT",
+ /* 658 */ "tag_mode_opt ::=",
+ /* 659 */ "tag_mode_opt ::= TAGS",
+ /* 660 */ "set_quantifier_opt ::=",
+ /* 661 */ "set_quantifier_opt ::= DISTINCT",
+ /* 662 */ "set_quantifier_opt ::= ALL",
+ /* 663 */ "select_list ::= select_item",
+ /* 664 */ "select_list ::= select_list NK_COMMA select_item",
+ /* 665 */ "select_item ::= NK_STAR",
+ /* 666 */ "select_item ::= common_expression",
+ /* 667 */ "select_item ::= common_expression column_alias",
+ /* 668 */ "select_item ::= common_expression AS column_alias",
+ /* 669 */ "select_item ::= table_name NK_DOT NK_STAR",
+ /* 670 */ "where_clause_opt ::=",
+ /* 671 */ "where_clause_opt ::= WHERE search_condition",
+ /* 672 */ "partition_by_clause_opt ::=",
+ /* 673 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
+ /* 674 */ "partition_list ::= partition_item",
+ /* 675 */ "partition_list ::= partition_list NK_COMMA partition_item",
+ /* 676 */ "partition_item ::= expr_or_subquery",
+ /* 677 */ "partition_item ::= expr_or_subquery column_alias",
+ /* 678 */ "partition_item ::= expr_or_subquery AS column_alias",
+ /* 679 */ "twindow_clause_opt ::=",
+ /* 680 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP",
+ /* 681 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
+ /* 682 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt",
+ /* 683 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt",
+ /* 684 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition",
+ /* 685 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP",
+ /* 686 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
+ /* 687 */ "sliding_opt ::=",
+ /* 688 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP",
+ /* 689 */ "interval_sliding_duration_literal ::= NK_VARIABLE",
+ /* 690 */ "interval_sliding_duration_literal ::= NK_STRING",
+ /* 691 */ "interval_sliding_duration_literal ::= NK_INTEGER",
+ /* 692 */ "fill_opt ::=",
+ /* 693 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
+ /* 694 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP",
+ /* 695 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP",
+ /* 696 */ "fill_mode ::= NONE",
+ /* 697 */ "fill_mode ::= PREV",
+ /* 698 */ "fill_mode ::= NULL",
+ /* 699 */ "fill_mode ::= NULL_F",
+ /* 700 */ "fill_mode ::= LINEAR",
+ /* 701 */ "fill_mode ::= NEXT",
+ /* 702 */ "group_by_clause_opt ::=",
+ /* 703 */ "group_by_clause_opt ::= GROUP BY group_by_list",
+ /* 704 */ "group_by_list ::= expr_or_subquery",
+ /* 705 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
+ /* 706 */ "having_clause_opt ::=",
+ /* 707 */ "having_clause_opt ::= HAVING search_condition",
+ /* 708 */ "range_opt ::=",
+ /* 709 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
+ /* 710 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP",
+ /* 711 */ "every_opt ::=",
+ /* 712 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
+ /* 713 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
+ /* 714 */ "query_simple ::= query_specification",
+ /* 715 */ "query_simple ::= union_query_expression",
+ /* 716 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
+ /* 717 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
+ /* 718 */ "query_simple_or_subquery ::= query_simple",
+ /* 719 */ "query_simple_or_subquery ::= subquery",
+ /* 720 */ "query_or_subquery ::= query_expression",
+ /* 721 */ "query_or_subquery ::= subquery",
+ /* 722 */ "order_by_clause_opt ::=",
+ /* 723 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
+ /* 724 */ "slimit_clause_opt ::=",
+ /* 725 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
+ /* 726 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
+ /* 727 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 728 */ "limit_clause_opt ::=",
+ /* 729 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
+ /* 730 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
+ /* 731 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
+ /* 732 */ "subquery ::= NK_LP query_expression NK_RP",
+ /* 733 */ "subquery ::= NK_LP subquery NK_RP",
+ /* 734 */ "search_condition ::= common_expression",
+ /* 735 */ "sort_specification_list ::= sort_specification",
+ /* 736 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
+ /* 737 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
+ /* 738 */ "ordering_specification_opt ::=",
+ /* 739 */ "ordering_specification_opt ::= ASC",
+ /* 740 */ "ordering_specification_opt ::= DESC",
+ /* 741 */ "null_ordering_opt ::=",
+ /* 742 */ "null_ordering_opt ::= NULLS FIRST",
+ /* 743 */ "null_ordering_opt ::= NULLS LAST",
+ /* 744 */ "column_options ::=",
+ /* 745 */ "column_options ::= column_options PRIMARY KEY",
+ /* 746 */ "column_options ::= column_options ENCODE NK_STRING",
+ /* 747 */ "column_options ::= column_options COMPRESS NK_STRING",
+ /* 748 */ "column_options ::= column_options LEVEL NK_STRING",
};
#endif /* NDEBUG */
@@ -3449,296 +3086,258 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
- case 376: /* cmd */
- case 379: /* literal */
- case 388: /* with_opt */
- case 394: /* search_condition */
- case 399: /* db_options */
- case 401: /* alter_db_options */
- case 403: /* start_opt */
- case 404: /* end_opt */
- case 408: /* signed */
- case 410: /* retention */
- case 411: /* full_table_name */
- case 414: /* table_options */
- case 418: /* alter_table_clause */
- case 419: /* alter_table_options */
- case 422: /* column_options */
- case 423: /* tags_literal */
- case 424: /* create_subtable_clause */
- case 427: /* drop_table_clause */
- case 430: /* tag_def */
- case 431: /* column_def */
- case 436: /* duration_literal */
- case 437: /* rollup_func_name */
- case 439: /* col_name */
- case 442: /* like_pattern_opt */
- case 443: /* db_name_cond_opt */
- case 444: /* table_name_cond */
- case 445: /* from_db_opt */
- case 448: /* tag_item */
- case 452: /* full_tsma_name */
- case 454: /* index_options */
- case 455: /* full_index_name */
- case 457: /* sliding_opt */
- case 458: /* sma_stream_opt */
- case 459: /* func */
- case 463: /* query_or_subquery */
- case 464: /* where_clause_opt */
- case 467: /* explain_options */
- case 468: /* insert_query */
- case 473: /* full_view_name */
- case 476: /* stream_options */
- case 479: /* subtable_opt */
- case 482: /* column_stream_def */
- case 483: /* stream_col_options */
- case 484: /* expression */
- case 487: /* literal_func */
- case 488: /* signed_literal */
- case 491: /* expr_or_subquery */
- case 492: /* pseudo_column */
- case 493: /* column_reference */
- case 494: /* function_expression */
- case 495: /* case_when_expression */
- case 500: /* star_func_para */
- case 502: /* case_when_else_opt */
- case 503: /* common_expression */
- case 504: /* when_then_expr */
- case 505: /* predicate */
- case 508: /* in_predicate_value */
- case 509: /* boolean_value_expression */
- case 510: /* boolean_primary */
- case 511: /* from_clause_opt */
- case 512: /* table_reference_list */
- case 513: /* table_reference */
- case 514: /* table_primary */
- case 515: /* joined_table */
- case 517: /* subquery */
- case 518: /* parenthesized_joined_table */
- case 521: /* join_on_clause_opt */
- case 522: /* window_offset_clause_opt */
- case 523: /* jlimit_clause_opt */
- case 524: /* window_offset_literal */
- case 525: /* query_specification */
- case 531: /* range_opt */
- case 532: /* every_opt */
- case 533: /* fill_opt */
- case 534: /* twindow_clause_opt */
- case 536: /* having_clause_opt */
- case 537: /* select_item */
- case 539: /* partition_item */
- case 540: /* interval_sliding_duration_literal */
- case 543: /* query_expression */
- case 544: /* query_simple */
- case 546: /* slimit_clause_opt */
- case 547: /* limit_clause_opt */
- case 548: /* union_query_expression */
- case 549: /* query_simple_or_subquery */
- case 551: /* sort_specification */
+ case 377: /* cmd */
+ case 380: /* literal */
+ case 389: /* with_opt */
+ case 395: /* search_condition */
+ case 400: /* db_options */
+ case 402: /* alter_db_options */
+ case 404: /* start_opt */
+ case 405: /* end_opt */
+ case 409: /* signed */
+ case 411: /* retention */
+ case 412: /* full_table_name */
+ case 415: /* table_options */
+ case 419: /* alter_table_clause */
+ case 420: /* alter_table_options */
+ case 423: /* column_options */
+ case 424: /* tags_literal */
+ case 425: /* create_subtable_clause */
+ case 428: /* drop_table_clause */
+ case 431: /* tag_def */
+ case 432: /* column_def */
+ case 437: /* duration_literal */
+ case 438: /* rollup_func_name */
+ case 440: /* col_name */
+ case 443: /* like_pattern_opt */
+ case 444: /* db_name_cond_opt */
+ case 445: /* table_name_cond */
+ case 446: /* from_db_opt */
+ case 449: /* tag_item */
+ case 453: /* full_tsma_name */
+ case 455: /* index_options */
+ case 456: /* full_index_name */
+ case 458: /* sliding_opt */
+ case 459: /* sma_stream_opt */
+ case 460: /* func */
+ case 464: /* query_or_subquery */
+ case 465: /* where_clause_opt */
+ case 468: /* explain_options */
+ case 469: /* insert_query */
+ case 474: /* full_view_name */
+ case 477: /* stream_options */
+ case 480: /* subtable_opt */
+ case 483: /* column_stream_def */
+ case 484: /* stream_col_options */
+ case 485: /* expression */
+ case 488: /* literal_func */
+ case 489: /* signed_literal */
+ case 492: /* expr_or_subquery */
+ case 493: /* pseudo_column */
+ case 494: /* column_reference */
+ case 495: /* function_expression */
+ case 496: /* case_when_expression */
+ case 501: /* star_func_para */
+ case 503: /* case_when_else_opt */
+ case 504: /* common_expression */
+ case 505: /* when_then_expr */
+ case 506: /* predicate */
+ case 509: /* in_predicate_value */
+ case 510: /* boolean_value_expression */
+ case 511: /* boolean_primary */
+ case 512: /* from_clause_opt */
+ case 513: /* table_reference_list */
+ case 514: /* table_reference */
+ case 515: /* table_primary */
+ case 516: /* joined_table */
+ case 518: /* subquery */
+ case 519: /* parenthesized_joined_table */
+ case 522: /* join_on_clause_opt */
+ case 523: /* window_offset_clause_opt */
+ case 524: /* jlimit_clause_opt */
+ case 525: /* window_offset_literal */
+ case 526: /* query_specification */
+ case 532: /* range_opt */
+ case 533: /* every_opt */
+ case 534: /* fill_opt */
+ case 535: /* twindow_clause_opt */
+ case 537: /* having_clause_opt */
+ case 538: /* select_item */
+ case 540: /* partition_item */
+ case 541: /* interval_sliding_duration_literal */
+ case 544: /* query_expression */
+ case 545: /* query_simple */
+ case 547: /* slimit_clause_opt */
+ case 548: /* limit_clause_opt */
+ case 549: /* union_query_expression */
+ case 550: /* query_simple_or_subquery */
+ case 552: /* sort_specification */
{
-#line 7 "sql.y"
- nodesDestroyNode((yypminor->yy600));
-#line 3541 "sql.c"
+ nodesDestroyNode((yypminor->yy452));
}
break;
- case 377: /* account_options */
- case 378: /* alter_account_options */
- case 380: /* alter_account_option */
- case 402: /* speed_opt */
- case 462: /* with_meta */
- case 471: /* bufsize_opt */
+ case 378: /* account_options */
+ case 379: /* alter_account_options */
+ case 381: /* alter_account_option */
+ case 403: /* speed_opt */
+ case 463: /* with_meta */
+ case 472: /* bufsize_opt */
{
-#line 54 "sql.y"
-#line 3553 "sql.c"
}
break;
- case 381: /* ip_range_list */
- case 382: /* white_list */
- case 383: /* white_list_opt */
- case 405: /* integer_list */
- case 406: /* variable_list */
- case 407: /* retention_list */
- case 412: /* column_def_list */
- case 413: /* tags_def_opt */
- case 415: /* multi_create_clause */
- case 416: /* tags_def */
- case 417: /* multi_drop_clause */
- case 425: /* specific_cols_opt */
- case 426: /* tags_literal_list */
- case 428: /* col_name_list */
- case 429: /* tag_def_list */
- case 433: /* duration_list */
- case 434: /* rollup_func_list */
- case 446: /* tag_list_opt */
- case 453: /* func_list */
- case 461: /* expression_list */
- case 477: /* col_list_opt */
- case 478: /* tag_def_or_ref_opt */
- case 481: /* column_stream_def_list */
- case 486: /* dnode_list */
- case 489: /* literal_list */
- case 497: /* star_func_para_list */
- case 499: /* other_para_list */
- case 501: /* when_then_list */
- case 526: /* hint_list */
- case 529: /* select_list */
- case 530: /* partition_by_clause_opt */
- case 535: /* group_by_clause_opt */
- case 538: /* partition_list */
- case 542: /* group_by_list */
- case 545: /* order_by_clause_opt */
- case 550: /* sort_specification_list */
+ case 382: /* ip_range_list */
+ case 383: /* white_list */
+ case 384: /* white_list_opt */
+ case 406: /* integer_list */
+ case 407: /* variable_list */
+ case 408: /* retention_list */
+ case 413: /* column_def_list */
+ case 414: /* tags_def_opt */
+ case 416: /* multi_create_clause */
+ case 417: /* tags_def */
+ case 418: /* multi_drop_clause */
+ case 426: /* specific_cols_opt */
+ case 427: /* tags_literal_list */
+ case 429: /* col_name_list */
+ case 430: /* tag_def_list */
+ case 434: /* duration_list */
+ case 435: /* rollup_func_list */
+ case 447: /* tag_list_opt */
+ case 454: /* func_list */
+ case 462: /* expression_list */
+ case 478: /* col_list_opt */
+ case 479: /* tag_def_or_ref_opt */
+ case 482: /* column_stream_def_list */
+ case 487: /* dnode_list */
+ case 490: /* literal_list */
+ case 498: /* star_func_para_list */
+ case 500: /* other_para_list */
+ case 502: /* when_then_list */
+ case 527: /* hint_list */
+ case 530: /* select_list */
+ case 531: /* partition_by_clause_opt */
+ case 536: /* group_by_clause_opt */
+ case 539: /* partition_list */
+ case 543: /* group_by_list */
+ case 546: /* order_by_clause_opt */
+ case 551: /* sort_specification_list */
{
-#line 85 "sql.y"
- nodesDestroyList((yypminor->yy748));
-#line 3595 "sql.c"
+ nodesDestroyList((yypminor->yy34));
}
break;
- case 384: /* user_name */
- case 391: /* db_name */
- case 392: /* table_name */
- case 393: /* topic_name */
- case 395: /* dnode_endpoint */
- case 420: /* column_name */
- case 438: /* function_name */
- case 449: /* column_alias */
- case 450: /* tsma_name */
- case 456: /* index_name */
- case 460: /* sma_func_name */
- case 465: /* cgroup_name */
- case 472: /* language_opt */
- case 474: /* view_name */
- case 475: /* stream_name */
- case 485: /* on_vgroup_id */
- case 490: /* table_alias */
- case 496: /* star_func */
- case 498: /* noarg_func */
- case 516: /* alias_opt */
+ case 385: /* user_name */
+ case 392: /* db_name */
+ case 393: /* table_name */
+ case 394: /* topic_name */
+ case 396: /* dnode_endpoint */
+ case 421: /* column_name */
+ case 439: /* function_name */
+ case 450: /* column_alias */
+ case 451: /* tsma_name */
+ case 457: /* index_name */
+ case 461: /* sma_func_name */
+ case 466: /* cgroup_name */
+ case 473: /* language_opt */
+ case 475: /* view_name */
+ case 476: /* stream_name */
+ case 486: /* on_vgroup_id */
+ case 491: /* table_alias */
+ case 497: /* star_func */
+ case 499: /* noarg_func */
+ case 517: /* alias_opt */
{
-#line 1069 "sql.y"
-#line 3621 "sql.c"
}
break;
- case 385: /* sysinfo_opt */
+ case 386: /* sysinfo_opt */
{
-#line 112 "sql.y"
-#line 3628 "sql.c"
}
break;
- case 386: /* privileges */
- case 389: /* priv_type_list */
- case 390: /* priv_type */
+ case 387: /* privileges */
+ case 390: /* priv_type_list */
+ case 391: /* priv_type */
{
-#line 121 "sql.y"
-#line 3637 "sql.c"
}
break;
- case 387: /* priv_level */
+ case 388: /* priv_level */
{
-#line 138 "sql.y"
-#line 3644 "sql.c"
}
break;
- case 396: /* force_opt */
- case 397: /* unsafe_opt */
- case 398: /* not_exists_opt */
- case 400: /* exists_opt */
- case 466: /* analyze_opt */
- case 469: /* or_replace_opt */
- case 470: /* agg_func_opt */
- case 480: /* ignore_opt */
- case 527: /* set_quantifier_opt */
- case 528: /* tag_mode_opt */
+ case 397: /* force_opt */
+ case 398: /* unsafe_opt */
+ case 399: /* not_exists_opt */
+ case 401: /* exists_opt */
+ case 467: /* analyze_opt */
+ case 470: /* or_replace_opt */
+ case 471: /* agg_func_opt */
+ case 481: /* ignore_opt */
+ case 528: /* set_quantifier_opt */
+ case 529: /* tag_mode_opt */
{
-#line 170 "sql.y"
-#line 3660 "sql.c"
}
break;
- case 409: /* alter_db_option */
- case 435: /* alter_table_option */
+ case 410: /* alter_db_option */
+ case 436: /* alter_table_option */
{
-#line 278 "sql.y"
-#line 3668 "sql.c"
}
break;
- case 421: /* type_name */
- case 432: /* type_name_default_len */
+ case 422: /* type_name */
+ case 433: /* type_name_default_len */
{
-#line 413 "sql.y"
-#line 3676 "sql.c"
}
break;
- case 440: /* db_kind_opt */
- case 447: /* table_kind */
+ case 441: /* db_kind_opt */
+ case 448: /* table_kind */
{
-#line 591 "sql.y"
-#line 3684 "sql.c"
}
break;
- case 441: /* table_kind_db_name_cond_opt */
+ case 442: /* table_kind_db_name_cond_opt */
{
-#line 556 "sql.y"
-#line 3691 "sql.c"
}
break;
- case 451: /* tsma_func_list */
+ case 452: /* tsma_func_list */
{
-#line 610 "sql.y"
- nodesDestroyNode((yypminor->yy600));
-#line 3698 "sql.c"
+ nodesDestroyNode((yypminor->yy452));
}
break;
- case 506: /* compare_op */
- case 507: /* in_op */
+ case 507: /* compare_op */
+ case 508: /* in_op */
{
-#line 1267 "sql.y"
-#line 3706 "sql.c"
}
break;
- case 519: /* join_type */
+ case 520: /* join_type */
{
-#line 1348 "sql.y"
-#line 3713 "sql.c"
}
break;
- case 520: /* join_subtype */
+ case 521: /* join_subtype */
{
-#line 1356 "sql.y"
-#line 3720 "sql.c"
}
break;
- case 541: /* fill_mode */
+ case 542: /* fill_mode */
{
-#line 1472 "sql.y"
-#line 3727 "sql.c"
}
break;
- case 552: /* ordering_specification_opt */
+ case 553: /* ordering_specification_opt */
{
-#line 1557 "sql.y"
-#line 3734 "sql.c"
}
break;
- case 553: /* null_ordering_opt */
+ case 554: /* null_ordering_opt */
{
-#line 1563 "sql.y"
-#line 3741 "sql.c"
}
break;
/********* End destructor definitions *****************************************/
@@ -3905,7 +3504,7 @@ static YYACTIONTYPE yy_find_shift_action(
#endif /* YYWILDCARD */
return yy_default[stateno];
}else{
- assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
+ assert( i>=0 && iyytos;
+#ifndef NDEBUG
+ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
+ yysize = yyRuleInfoNRhs[yyruleno];
+ if( yysize ){
+ fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
+ yyTracePrompt,
+ yyruleno, yyRuleName[yyruleno],
+ yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){
+ yypParser->yyhwm++;
+ assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
+ }
+#endif
+#if YYSTACKDEPTH>0
+ if( yypParser->yytos>=yypParser->yystackEnd ){
+ yyStackOverflow(yypParser);
+ /* The call to yyStackOverflow() above pops the stack until it is
+ ** empty, causing the main parser loop to exit. So the return value
+ ** is never used and does not matter. */
+ return 0;
+ }
+#else
+ if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
+ if( yyGrowStack(yypParser) ){
+ yyStackOverflow(yypParser);
+ /* The call to yyStackOverflow() above pops the stack until it is
+ ** empty, causing the main parser loop to exit. So the return value
+ ** is never used and does not matter. */
+ return 0;
+ }
+ yymsp = yypParser->yytos;
+ }
+#endif
+ }
switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example
@@ -5570,21 +5219,15 @@ static YYACTIONTYPE yy_reduce(
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
-#line 50 "sql.y"
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
-#line 5575 "sql.c"
- yy_destructor(yypParser,377,&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 5581 "sql.c"
yy_destructor(yypParser,378,&yymsp[0].minor);
break;
+ case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
+{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
+ yy_destructor(yypParser,379,&yymsp[0].minor);
+ break;
case 2: /* account_options ::= */
-#line 55 "sql.y"
{ }
-#line 5587 "sql.c"
break;
case 3: /* account_options ::= account_options PPS literal */
case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
@@ -5595,26 +5238,20 @@ static YYACTIONTYPE yy_reduce(
case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9);
case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
-{ yy_destructor(yypParser,377,&yymsp[-2].minor);
-#line 56 "sql.y"
+{ yy_destructor(yypParser,378,&yymsp[-2].minor);
{ }
-#line 5601 "sql.c"
- yy_destructor(yypParser,379,&yymsp[0].minor);
+ yy_destructor(yypParser,380,&yymsp[0].minor);
}
break;
case 12: /* alter_account_options ::= alter_account_option */
-{ yy_destructor(yypParser,380,&yymsp[0].minor);
-#line 68 "sql.y"
+{ yy_destructor(yypParser,381,&yymsp[0].minor);
{ }
-#line 5609 "sql.c"
}
break;
case 13: /* alter_account_options ::= alter_account_options alter_account_option */
-{ yy_destructor(yypParser,378,&yymsp[-1].minor);
-#line 69 "sql.y"
+{ yy_destructor(yypParser,379,&yymsp[-1].minor);
{ }
-#line 5616 "sql.c"
- yy_destructor(yypParser,380,&yymsp[0].minor);
+ yy_destructor(yypParser,381,&yymsp[0].minor);
}
break;
case 14: /* alter_account_option ::= PASS literal */
@@ -5627,3031 +5264,2054 @@ static YYACTIONTYPE yy_reduce(
case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21);
case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
-#line 73 "sql.y"
{ }
-#line 5632 "sql.c"
- yy_destructor(yypParser,379,&yymsp[0].minor);
+ yy_destructor(yypParser,380,&yymsp[0].minor);
break;
case 24: /* ip_range_list ::= NK_STRING */
-#line 86 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
-#line 5638 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
+{ yylhsminor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
break;
case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */
-#line 87 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
-#line 5644 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
break;
case 26: /* white_list ::= HOST ip_range_list */
-#line 91 "sql.y"
-{ yymsp[-1].minor.yy748 = yymsp[0].minor.yy748; }
-#line 5650 "sql.c"
+{ yymsp[-1].minor.yy34 = yymsp[0].minor.yy34; }
break;
case 27: /* white_list_opt ::= */
- case 200: /* specific_cols_opt ::= */ yytestcase(yyruleno==200);
- case 238: /* tags_def_opt ::= */ yytestcase(yyruleno==238);
- case 328: /* tag_list_opt ::= */ yytestcase(yyruleno==328);
- case 401: /* col_list_opt ::= */ yytestcase(yyruleno==401);
- case 408: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==408);
- case 671: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==671);
- case 701: /* group_by_clause_opt ::= */ yytestcase(yyruleno==701);
- case 721: /* order_by_clause_opt ::= */ yytestcase(yyruleno==721);
-#line 95 "sql.y"
-{ yymsp[1].minor.yy748 = NULL; }
-#line 5663 "sql.c"
+ case 201: /* specific_cols_opt ::= */ yytestcase(yyruleno==201);
+ case 239: /* tags_def_opt ::= */ yytestcase(yyruleno==239);
+ case 329: /* tag_list_opt ::= */ yytestcase(yyruleno==329);
+ case 402: /* col_list_opt ::= */ yytestcase(yyruleno==402);
+ case 409: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==409);
+ case 672: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==672);
+ case 702: /* group_by_clause_opt ::= */ yytestcase(yyruleno==702);
+ case 722: /* order_by_clause_opt ::= */ yytestcase(yyruleno==722);
+{ yymsp[1].minor.yy34 = NULL; }
break;
case 28: /* white_list_opt ::= white_list */
- case 239: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==239);
- case 409: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==409);
- case 579: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==579);
-#line 96 "sql.y"
-{ yylhsminor.yy748 = yymsp[0].minor.yy748; }
-#line 5671 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
+ case 240: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==240);
+ case 410: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==410);
+ case 580: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==580);
+{ yylhsminor.yy34 = yymsp[0].minor.yy34; }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
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.yy649, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy663);
- pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy748);
+ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy479, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy323);
+ pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy34);
}
-#line 5680 "sql.c"
break;
case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */
-#line 104 "sql.y"
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
-#line 5685 "sql.c"
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
break;
case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
-#line 105 "sql.y"
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
-#line 5690 "sql.c"
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
break;
case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
-#line 106 "sql.y"
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
-#line 5695 "sql.c"
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
break;
- case 33: /* cmd ::= ALTER USER user_name ADD white_list */
-#line 107 "sql.y"
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy748); }
-#line 5700 "sql.c"
+ case 33: /* cmd ::= ALTER USER user_name CREATEDB NK_INTEGER */
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_CREATEDB, &yymsp[0].minor.yy0); }
break;
- case 34: /* cmd ::= ALTER USER user_name DROP white_list */
-#line 108 "sql.y"
-{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy649, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy748); }
-#line 5705 "sql.c"
+ case 34: /* cmd ::= ALTER USER user_name ADD white_list */
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy34); }
break;
- case 35: /* cmd ::= DROP USER user_name */
-#line 109 "sql.y"
-{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 5710 "sql.c"
+ case 35: /* cmd ::= ALTER USER user_name DROP white_list */
+{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy479, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy34); }
break;
- case 36: /* sysinfo_opt ::= */
-#line 113 "sql.y"
-{ yymsp[1].minor.yy663 = 1; }
-#line 5715 "sql.c"
+ case 36: /* cmd ::= DROP USER user_name */
+{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
-#line 114 "sql.y"
-{ yymsp[-1].minor.yy663 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
-#line 5720 "sql.c"
+ case 37: /* sysinfo_opt ::= */
+{ yymsp[1].minor.yy323 = 1; }
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.yy941, &yymsp[-3].minor.yy781, &yymsp[0].minor.yy649, yymsp[-2].minor.yy600); }
-#line 5725 "sql.c"
+ case 38: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
+{ yymsp[-1].minor.yy323 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
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.yy941, &yymsp[-3].minor.yy781, &yymsp[0].minor.yy649, yymsp[-2].minor.yy600); }
-#line 5730 "sql.c"
+ case 39: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */
+{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy579, &yymsp[-3].minor.yy687, &yymsp[0].minor.yy479, yymsp[-2].minor.yy452); }
break;
- case 40: /* privileges ::= ALL */
-#line 122 "sql.y"
-{ yymsp[0].minor.yy941 = PRIVILEGE_TYPE_ALL; }
-#line 5735 "sql.c"
+ case 40: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */
+{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy579, &yymsp[-3].minor.yy687, &yymsp[0].minor.yy479, yymsp[-2].minor.yy452); }
break;
- case 41: /* privileges ::= priv_type_list */
- case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43);
-#line 123 "sql.y"
-{ yylhsminor.yy941 = yymsp[0].minor.yy941; }
-#line 5741 "sql.c"
- yymsp[0].minor.yy941 = yylhsminor.yy941;
+ case 41: /* privileges ::= ALL */
+{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_ALL; }
break;
- case 42: /* privileges ::= SUBSCRIBE */
-#line 124 "sql.y"
-{ yymsp[0].minor.yy941 = PRIVILEGE_TYPE_SUBSCRIBE; }
-#line 5747 "sql.c"
+ case 42: /* privileges ::= priv_type_list */
+ case 44: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==44);
+{ yylhsminor.yy579 = yymsp[0].minor.yy579; }
+ yymsp[0].minor.yy579 = yylhsminor.yy579;
break;
- case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
-#line 129 "sql.y"
-{ yylhsminor.yy941 = yymsp[-2].minor.yy941 | yymsp[0].minor.yy941; }
-#line 5752 "sql.c"
- yymsp[-2].minor.yy941 = yylhsminor.yy941;
+ case 43: /* privileges ::= SUBSCRIBE */
+{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_SUBSCRIBE; }
break;
- case 45: /* priv_type ::= READ */
-#line 133 "sql.y"
-{ yymsp[0].minor.yy941 = PRIVILEGE_TYPE_READ; }
-#line 5758 "sql.c"
+ case 45: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
+{ yylhsminor.yy579 = yymsp[-2].minor.yy579 | yymsp[0].minor.yy579; }
+ yymsp[-2].minor.yy579 = yylhsminor.yy579;
break;
- case 46: /* priv_type ::= WRITE */
-#line 134 "sql.y"
-{ yymsp[0].minor.yy941 = PRIVILEGE_TYPE_WRITE; }
-#line 5763 "sql.c"
+ case 46: /* priv_type ::= READ */
+{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_READ; }
break;
- case 47: /* priv_type ::= ALTER */
-#line 135 "sql.y"
-{ yymsp[0].minor.yy941 = PRIVILEGE_TYPE_ALTER; }
-#line 5768 "sql.c"
+ case 47: /* priv_type ::= WRITE */
+{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_WRITE; }
break;
- case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
-#line 139 "sql.y"
-{ yylhsminor.yy781.first = yymsp[-2].minor.yy0; yylhsminor.yy781.second = yymsp[0].minor.yy0; }
-#line 5773 "sql.c"
- yymsp[-2].minor.yy781 = yylhsminor.yy781;
+ case 48: /* priv_type ::= ALTER */
+{ yymsp[0].minor.yy579 = PRIVILEGE_TYPE_ALTER; }
break;
- case 49: /* priv_level ::= db_name NK_DOT NK_STAR */
-#line 140 "sql.y"
-{ yylhsminor.yy781.first = yymsp[-2].minor.yy649; yylhsminor.yy781.second = yymsp[0].minor.yy0; }
-#line 5779 "sql.c"
- yymsp[-2].minor.yy781 = yylhsminor.yy781;
+ case 49: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
+{ yylhsminor.yy687.first = yymsp[-2].minor.yy0; yylhsminor.yy687.second = yymsp[0].minor.yy0; }
+ yymsp[-2].minor.yy687 = yylhsminor.yy687;
break;
- case 50: /* priv_level ::= db_name NK_DOT table_name */
-#line 141 "sql.y"
-{ yylhsminor.yy781.first = yymsp[-2].minor.yy649; yylhsminor.yy781.second = yymsp[0].minor.yy649; }
-#line 5785 "sql.c"
- yymsp[-2].minor.yy781 = yylhsminor.yy781;
+ case 50: /* priv_level ::= db_name NK_DOT NK_STAR */
+{ yylhsminor.yy687.first = yymsp[-2].minor.yy479; yylhsminor.yy687.second = yymsp[0].minor.yy0; }
+ yymsp[-2].minor.yy687 = yylhsminor.yy687;
break;
- case 51: /* priv_level ::= topic_name */
-#line 142 "sql.y"
-{ yylhsminor.yy781.first = yymsp[0].minor.yy649; yylhsminor.yy781.second = nil_token; }
-#line 5791 "sql.c"
- yymsp[0].minor.yy781 = yylhsminor.yy781;
+ case 51: /* priv_level ::= db_name NK_DOT table_name */
+{ yylhsminor.yy687.first = yymsp[-2].minor.yy479; yylhsminor.yy687.second = yymsp[0].minor.yy479; }
+ yymsp[-2].minor.yy687 = yylhsminor.yy687;
break;
- case 52: /* with_opt ::= */
- case 168: /* start_opt ::= */ yytestcase(yyruleno==168);
- case 172: /* end_opt ::= */ yytestcase(yyruleno==172);
- case 323: /* like_pattern_opt ::= */ yytestcase(yyruleno==323);
- case 420: /* subtable_opt ::= */ yytestcase(yyruleno==420);
- case 589: /* case_when_else_opt ::= */ yytestcase(yyruleno==589);
- case 619: /* from_clause_opt ::= */ yytestcase(yyruleno==619);
- case 646: /* join_on_clause_opt ::= */ yytestcase(yyruleno==646);
- case 648: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==648);
- case 652: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==652);
- case 669: /* where_clause_opt ::= */ yytestcase(yyruleno==669);
- case 678: /* twindow_clause_opt ::= */ yytestcase(yyruleno==678);
- case 686: /* sliding_opt ::= */ yytestcase(yyruleno==686);
- case 691: /* fill_opt ::= */ yytestcase(yyruleno==691);
- case 705: /* having_clause_opt ::= */ yytestcase(yyruleno==705);
- case 707: /* range_opt ::= */ yytestcase(yyruleno==707);
- case 710: /* every_opt ::= */ yytestcase(yyruleno==710);
- case 723: /* slimit_clause_opt ::= */ yytestcase(yyruleno==723);
- case 727: /* limit_clause_opt ::= */ yytestcase(yyruleno==727);
-#line 144 "sql.y"
-{ yymsp[1].minor.yy600 = NULL; }
-#line 5815 "sql.c"
+ case 52: /* priv_level ::= topic_name */
+{ yylhsminor.yy687.first = yymsp[0].minor.yy479; yylhsminor.yy687.second = nil_token; }
+ yymsp[0].minor.yy687 = yylhsminor.yy687;
break;
- case 53: /* with_opt ::= WITH search_condition */
- case 620: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==620);
- case 647: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==647);
- case 670: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==670);
- case 706: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==706);
-#line 145 "sql.y"
-{ yymsp[-1].minor.yy600 = yymsp[0].minor.yy600; }
-#line 5824 "sql.c"
+ case 53: /* with_opt ::= */
+ case 169: /* start_opt ::= */ yytestcase(yyruleno==169);
+ case 173: /* end_opt ::= */ yytestcase(yyruleno==173);
+ case 324: /* like_pattern_opt ::= */ yytestcase(yyruleno==324);
+ case 421: /* subtable_opt ::= */ yytestcase(yyruleno==421);
+ case 590: /* case_when_else_opt ::= */ yytestcase(yyruleno==590);
+ case 620: /* from_clause_opt ::= */ yytestcase(yyruleno==620);
+ case 647: /* join_on_clause_opt ::= */ yytestcase(yyruleno==647);
+ case 649: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==649);
+ case 653: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==653);
+ case 670: /* where_clause_opt ::= */ yytestcase(yyruleno==670);
+ case 679: /* twindow_clause_opt ::= */ yytestcase(yyruleno==679);
+ case 687: /* sliding_opt ::= */ yytestcase(yyruleno==687);
+ case 692: /* fill_opt ::= */ yytestcase(yyruleno==692);
+ case 706: /* having_clause_opt ::= */ yytestcase(yyruleno==706);
+ case 708: /* range_opt ::= */ yytestcase(yyruleno==708);
+ case 711: /* every_opt ::= */ yytestcase(yyruleno==711);
+ case 724: /* slimit_clause_opt ::= */ yytestcase(yyruleno==724);
+ case 728: /* limit_clause_opt ::= */ yytestcase(yyruleno==728);
+{ yymsp[1].minor.yy452 = NULL; }
break;
- case 54: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */
-#line 148 "sql.y"
+ case 54: /* with_opt ::= WITH search_condition */
+ case 621: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==621);
+ case 648: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==648);
+ case 671: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==671);
+ case 707: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==707);
+{ yymsp[-1].minor.yy452 = yymsp[0].minor.yy452; }
+ break;
+ case 55: /* cmd ::= CREATE ENCRYPT_KEY NK_STRING */
{ pCxt->pRootNode = createEncryptKeyStmt(pCxt, &yymsp[0].minor.yy0); }
-#line 5829 "sql.c"
break;
- case 55: /* cmd ::= CREATE DNODE dnode_endpoint */
-#line 151 "sql.y"
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy649, NULL); }
-#line 5834 "sql.c"
+ case 56: /* cmd ::= CREATE DNODE dnode_endpoint */
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy479, NULL); }
break;
- case 56: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
-#line 152 "sql.y"
-{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0); }
-#line 5839 "sql.c"
+ case 57: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
+{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0); }
break;
- case 57: /* cmd ::= DROP DNODE NK_INTEGER force_opt */
-#line 153 "sql.y"
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy705, false); }
-#line 5844 "sql.c"
+ case 58: /* cmd ::= DROP DNODE NK_INTEGER force_opt */
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy437, false); }
break;
- case 58: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
-#line 154 "sql.y"
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy705, false); }
-#line 5849 "sql.c"
+ case 59: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy437, false); }
break;
- case 59: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */
-#line 155 "sql.y"
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy705); }
-#line 5854 "sql.c"
+ case 60: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy437); }
break;
- case 60: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */
-#line 156 "sql.y"
-{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy649, false, yymsp[0].minor.yy705); }
-#line 5859 "sql.c"
+ case 61: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */
+{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy479, false, yymsp[0].minor.yy437); }
break;
- case 61: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
-#line 157 "sql.y"
+ case 62: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
-#line 5864 "sql.c"
break;
- case 62: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
-#line 158 "sql.y"
+ case 63: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5869 "sql.c"
break;
- case 63: /* cmd ::= ALTER ALL DNODES NK_STRING */
-#line 159 "sql.y"
+ case 64: /* cmd ::= ALTER ALL DNODES NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
-#line 5874 "sql.c"
break;
- case 64: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
-#line 160 "sql.y"
+ case 65: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5879 "sql.c"
break;
- case 65: /* cmd ::= RESTORE DNODE NK_INTEGER */
-#line 161 "sql.y"
+ case 66: /* cmd ::= RESTORE DNODE NK_INTEGER */
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_DNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5884 "sql.c"
break;
- case 66: /* dnode_endpoint ::= NK_STRING */
- case 67: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==67);
- case 68: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==68);
- case 357: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==357);
- case 358: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==358);
- case 359: /* sma_func_name ::= LAST */ yytestcase(yyruleno==359);
- case 360: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==360);
- case 508: /* db_name ::= NK_ID */ yytestcase(yyruleno==508);
- case 509: /* table_name ::= NK_ID */ yytestcase(yyruleno==509);
- case 510: /* column_name ::= NK_ID */ yytestcase(yyruleno==510);
- case 511: /* function_name ::= NK_ID */ yytestcase(yyruleno==511);
- case 512: /* view_name ::= NK_ID */ yytestcase(yyruleno==512);
- case 513: /* table_alias ::= NK_ID */ yytestcase(yyruleno==513);
- case 514: /* column_alias ::= NK_ID */ yytestcase(yyruleno==514);
- case 515: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==515);
- case 516: /* user_name ::= NK_ID */ yytestcase(yyruleno==516);
- case 517: /* topic_name ::= NK_ID */ yytestcase(yyruleno==517);
- case 518: /* stream_name ::= NK_ID */ yytestcase(yyruleno==518);
- case 519: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==519);
- case 520: /* index_name ::= NK_ID */ yytestcase(yyruleno==520);
- case 521: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==521);
- case 565: /* noarg_func ::= NOW */ yytestcase(yyruleno==565);
- case 566: /* noarg_func ::= TODAY */ yytestcase(yyruleno==566);
- case 567: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==567);
- case 568: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==568);
- case 569: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==569);
- case 570: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==570);
- case 571: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==571);
- case 572: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==572);
- case 573: /* noarg_func ::= USER */ yytestcase(yyruleno==573);
- case 574: /* star_func ::= COUNT */ yytestcase(yyruleno==574);
- case 575: /* star_func ::= FIRST */ yytestcase(yyruleno==575);
- case 576: /* star_func ::= LAST */ yytestcase(yyruleno==576);
- case 577: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==577);
-#line 165 "sql.y"
-{ yylhsminor.yy649 = yymsp[0].minor.yy0; }
-#line 5922 "sql.c"
- yymsp[0].minor.yy649 = yylhsminor.yy649;
+ case 67: /* dnode_endpoint ::= NK_STRING */
+ case 68: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==68);
+ case 69: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==69);
+ case 358: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==358);
+ case 359: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==359);
+ case 360: /* sma_func_name ::= LAST */ yytestcase(yyruleno==360);
+ case 361: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==361);
+ case 509: /* db_name ::= NK_ID */ yytestcase(yyruleno==509);
+ case 510: /* table_name ::= NK_ID */ yytestcase(yyruleno==510);
+ case 511: /* column_name ::= NK_ID */ yytestcase(yyruleno==511);
+ case 512: /* function_name ::= NK_ID */ yytestcase(yyruleno==512);
+ case 513: /* view_name ::= NK_ID */ yytestcase(yyruleno==513);
+ case 514: /* table_alias ::= NK_ID */ yytestcase(yyruleno==514);
+ case 515: /* column_alias ::= NK_ID */ yytestcase(yyruleno==515);
+ case 516: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==516);
+ case 517: /* user_name ::= NK_ID */ yytestcase(yyruleno==517);
+ case 518: /* topic_name ::= NK_ID */ yytestcase(yyruleno==518);
+ case 519: /* stream_name ::= NK_ID */ yytestcase(yyruleno==519);
+ case 520: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==520);
+ case 521: /* index_name ::= NK_ID */ yytestcase(yyruleno==521);
+ case 522: /* tsma_name ::= NK_ID */ yytestcase(yyruleno==522);
+ case 566: /* noarg_func ::= NOW */ yytestcase(yyruleno==566);
+ case 567: /* noarg_func ::= TODAY */ yytestcase(yyruleno==567);
+ case 568: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==568);
+ case 569: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==569);
+ case 570: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==570);
+ case 571: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==571);
+ case 572: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==572);
+ case 573: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==573);
+ case 574: /* noarg_func ::= USER */ yytestcase(yyruleno==574);
+ case 575: /* star_func ::= COUNT */ yytestcase(yyruleno==575);
+ case 576: /* star_func ::= FIRST */ yytestcase(yyruleno==576);
+ case 577: /* star_func ::= LAST */ yytestcase(yyruleno==577);
+ case 578: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==578);
+{ yylhsminor.yy479 = yymsp[0].minor.yy0; }
+ yymsp[0].minor.yy479 = yylhsminor.yy479;
break;
- case 69: /* force_opt ::= */
- case 96: /* not_exists_opt ::= */ yytestcase(yyruleno==96);
- case 98: /* exists_opt ::= */ yytestcase(yyruleno==98);
- case 378: /* analyze_opt ::= */ yytestcase(yyruleno==378);
- case 385: /* agg_func_opt ::= */ yytestcase(yyruleno==385);
- case 391: /* or_replace_opt ::= */ yytestcase(yyruleno==391);
- case 422: /* ignore_opt ::= */ yytestcase(yyruleno==422);
- case 657: /* tag_mode_opt ::= */ yytestcase(yyruleno==657);
- case 659: /* set_quantifier_opt ::= */ yytestcase(yyruleno==659);
-#line 171 "sql.y"
-{ yymsp[1].minor.yy705 = false; }
-#line 5936 "sql.c"
+ case 70: /* force_opt ::= */
+ case 97: /* not_exists_opt ::= */ yytestcase(yyruleno==97);
+ case 99: /* exists_opt ::= */ yytestcase(yyruleno==99);
+ case 379: /* analyze_opt ::= */ yytestcase(yyruleno==379);
+ case 386: /* agg_func_opt ::= */ yytestcase(yyruleno==386);
+ case 392: /* or_replace_opt ::= */ yytestcase(yyruleno==392);
+ case 423: /* ignore_opt ::= */ yytestcase(yyruleno==423);
+ case 658: /* tag_mode_opt ::= */ yytestcase(yyruleno==658);
+ case 660: /* set_quantifier_opt ::= */ yytestcase(yyruleno==660);
+{ yymsp[1].minor.yy437 = false; }
break;
- case 70: /* force_opt ::= FORCE */
- case 71: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==71);
- case 379: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==379);
- case 386: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==386);
- case 658: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==658);
- case 660: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==660);
-#line 172 "sql.y"
-{ yymsp[0].minor.yy705 = true; }
-#line 5946 "sql.c"
+ case 71: /* force_opt ::= FORCE */
+ case 72: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==72);
+ case 380: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==380);
+ case 387: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==387);
+ case 659: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==659);
+ case 661: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==661);
+{ yymsp[0].minor.yy437 = true; }
break;
- case 72: /* cmd ::= ALTER CLUSTER NK_STRING */
-#line 179 "sql.y"
+ case 73: /* cmd ::= ALTER CLUSTER NK_STRING */
{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 5951 "sql.c"
break;
- case 73: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */
-#line 180 "sql.y"
+ case 74: /* cmd ::= ALTER CLUSTER NK_STRING NK_STRING */
{ pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5956 "sql.c"
break;
- case 74: /* cmd ::= ALTER LOCAL NK_STRING */
-#line 183 "sql.y"
+ case 75: /* cmd ::= ALTER LOCAL NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 5961 "sql.c"
break;
- case 75: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
-#line 184 "sql.y"
+ case 76: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 5966 "sql.c"
break;
- case 76: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
-#line 187 "sql.y"
+ case 77: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5971 "sql.c"
break;
- case 77: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
-#line 188 "sql.y"
+ case 78: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5976 "sql.c"
break;
- case 78: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */
-#line 189 "sql.y"
+ case 79: /* cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_QNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5981 "sql.c"
break;
- case 79: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
-#line 192 "sql.y"
+ case 80: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5986 "sql.c"
break;
- case 80: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
-#line 193 "sql.y"
+ case 81: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5991 "sql.c"
break;
- case 81: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
-#line 196 "sql.y"
+ case 82: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
-#line 5996 "sql.c"
break;
- case 82: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
-#line 197 "sql.y"
+ case 83: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
-#line 6001 "sql.c"
break;
- case 83: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
-#line 200 "sql.y"
+ case 84: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 6006 "sql.c"
break;
- case 84: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
-#line 201 "sql.y"
+ case 85: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 6011 "sql.c"
break;
- case 85: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */
-#line 202 "sql.y"
+ case 86: /* cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_MNODE_STMT, &yymsp[0].minor.yy0); }
-#line 6016 "sql.c"
break;
- case 86: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */
-#line 205 "sql.y"
+ case 87: /* cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); }
-#line 6021 "sql.c"
break;
- case 87: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
-#line 208 "sql.y"
-{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy705, &yymsp[-1].minor.yy649, yymsp[0].minor.yy600); }
-#line 6026 "sql.c"
+ case 88: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
+{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy437, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); }
break;
- case 88: /* cmd ::= DROP DATABASE exists_opt db_name */
-#line 209 "sql.y"
-{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 6031 "sql.c"
+ case 89: /* cmd ::= DROP DATABASE exists_opt db_name */
+{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 89: /* cmd ::= USE db_name */
-#line 210 "sql.y"
-{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 6036 "sql.c"
+ case 90: /* cmd ::= USE db_name */
+{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 90: /* cmd ::= ALTER DATABASE db_name alter_db_options */
-#line 211 "sql.y"
-{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy600); }
-#line 6041 "sql.c"
+ case 91: /* cmd ::= ALTER DATABASE db_name alter_db_options */
+{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); }
break;
- case 91: /* cmd ::= FLUSH DATABASE db_name */
-#line 212 "sql.y"
-{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 6046 "sql.c"
+ case 92: /* cmd ::= FLUSH DATABASE db_name */
+{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 92: /* cmd ::= TRIM DATABASE db_name speed_opt */
-#line 213 "sql.y"
-{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy756); }
-#line 6051 "sql.c"
+ case 93: /* cmd ::= TRIM DATABASE db_name speed_opt */
+{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy100); }
break;
- case 93: /* cmd ::= S3MIGRATE DATABASE db_name */
-#line 214 "sql.y"
-{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 6056 "sql.c"
+ case 94: /* cmd ::= S3MIGRATE DATABASE db_name */
+{ pCxt->pRootNode = createS3MigrateDatabaseStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 94: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
-#line 215 "sql.y"
-{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy649, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 6061 "sql.c"
+ case 95: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */
+{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 95: /* not_exists_opt ::= IF NOT EXISTS */
-#line 219 "sql.y"
-{ yymsp[-2].minor.yy705 = true; }
-#line 6066 "sql.c"
+ case 96: /* not_exists_opt ::= IF NOT EXISTS */
+{ yymsp[-2].minor.yy437 = true; }
break;
- case 97: /* exists_opt ::= IF EXISTS */
- case 392: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==392);
- case 423: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==423);
-#line 224 "sql.y"
-{ yymsp[-1].minor.yy705 = true; }
-#line 6073 "sql.c"
+ case 98: /* exists_opt ::= IF EXISTS */
+ case 393: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==393);
+ case 424: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==424);
+{ yymsp[-1].minor.yy437 = true; }
break;
- case 99: /* db_options ::= */
-#line 227 "sql.y"
-{ yymsp[1].minor.yy600 = createDefaultDatabaseOptions(pCxt); }
-#line 6078 "sql.c"
+ case 100: /* db_options ::= */
+{ yymsp[1].minor.yy452 = createDefaultDatabaseOptions(pCxt); }
break;
- case 100: /* db_options ::= db_options BUFFER NK_INTEGER */
-#line 228 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
-#line 6083 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 101: /* db_options ::= db_options BUFFER NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 101: /* db_options ::= db_options CACHEMODEL NK_STRING */
-#line 229 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
-#line 6089 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 102: /* db_options ::= db_options CACHEMODEL NK_STRING */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 102: /* db_options ::= db_options CACHESIZE NK_INTEGER */
-#line 230 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
-#line 6095 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 103: /* db_options ::= db_options CACHESIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 103: /* db_options ::= db_options COMP NK_INTEGER */
-#line 231 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
-#line 6101 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 104: /* db_options ::= db_options COMP NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 104: /* db_options ::= db_options DURATION NK_INTEGER */
- case 105: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==105);
-#line 232 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
-#line 6108 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 105: /* db_options ::= db_options DURATION NK_INTEGER */
+ case 106: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==106);
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 106: /* db_options ::= db_options MAXROWS NK_INTEGER */
-#line 234 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
-#line 6114 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 107: /* db_options ::= db_options MAXROWS NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 107: /* db_options ::= db_options MINROWS NK_INTEGER */
-#line 235 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
-#line 6120 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 108: /* db_options ::= db_options MINROWS NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 108: /* db_options ::= db_options KEEP integer_list */
- case 109: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==109);
-#line 236 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_KEEP, yymsp[0].minor.yy748); }
-#line 6127 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 109: /* db_options ::= db_options KEEP integer_list */
+ case 110: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==110);
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP, yymsp[0].minor.yy34); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 110: /* db_options ::= db_options PAGES NK_INTEGER */
-#line 238 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
-#line 6133 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 111: /* db_options ::= db_options PAGES NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 111: /* db_options ::= db_options PAGESIZE NK_INTEGER */
-#line 239 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
-#line 6139 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 112: /* db_options ::= db_options PAGESIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 112: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
-#line 240 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
-#line 6145 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 113: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 113: /* db_options ::= db_options PRECISION NK_STRING */
-#line 241 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
-#line 6151 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 114: /* db_options ::= db_options PRECISION NK_STRING */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 114: /* db_options ::= db_options REPLICA NK_INTEGER */
-#line 242 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
-#line 6157 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 115: /* db_options ::= db_options REPLICA NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 115: /* db_options ::= db_options VGROUPS NK_INTEGER */
-#line 244 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
-#line 6163 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 116: /* db_options ::= db_options VGROUPS NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 116: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
-#line 245 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
-#line 6169 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 117: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 117: /* db_options ::= db_options RETENTIONS retention_list */
-#line 246 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_RETENTIONS, yymsp[0].minor.yy748); }
-#line 6175 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 118: /* db_options ::= db_options RETENTIONS retention_list */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_RETENTIONS, yymsp[0].minor.yy34); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 118: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
-#line 247 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
-#line 6181 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 119: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 119: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
-#line 248 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
-#line 6187 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 120: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 120: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
-#line 249 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
-#line 6193 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 121: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 121: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
-#line 250 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
-#line 6199 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 122: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 122: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
-#line 251 "sql.y"
+ case 123: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-3].minor.yy600, DB_OPTION_WAL_RETENTION_PERIOD, &t);
+ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_PERIOD, &t);
}
-#line 6209 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 123: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
-#line 256 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
-#line 6215 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 124: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 124: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
-#line 257 "sql.y"
+ case 125: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-3].minor.yy600, DB_OPTION_WAL_RETENTION_SIZE, &t);
+ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-3].minor.yy452, DB_OPTION_WAL_RETENTION_SIZE, &t);
}
-#line 6225 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 125: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
-#line 262 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
-#line 6231 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 126: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 126: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
-#line 263 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
-#line 6237 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 127: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 127: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
-#line 264 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
-#line 6243 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 128: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 128: /* db_options ::= db_options TABLE_PREFIX signed */
-#line 265 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy600); }
-#line 6249 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 129: /* db_options ::= db_options TABLE_PREFIX signed */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy452); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 129: /* db_options ::= db_options TABLE_SUFFIX signed */
-#line 266 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy600); }
-#line 6255 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 130: /* db_options ::= db_options TABLE_SUFFIX signed */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy452); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 130: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */
-#line 267 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); }
-#line 6261 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 131: /* db_options ::= db_options S3_CHUNKSIZE NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_CHUNKSIZE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 131: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */
- case 132: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==132);
-#line 268 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); }
-#line 6268 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 132: /* db_options ::= db_options S3_KEEPLOCAL NK_INTEGER */
+ case 133: /* db_options ::= db_options S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==133);
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_KEEPLOCAL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 133: /* db_options ::= db_options S3_COMPACT NK_INTEGER */
-#line 270 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); }
-#line 6274 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 134: /* db_options ::= db_options S3_COMPACT NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_S3_COMPACT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 134: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */
-#line 271 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); }
-#line 6280 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 135: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 135: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */
-#line 272 "sql.y"
-{ yylhsminor.yy600 = setDatabaseOption(pCxt, yymsp[-2].minor.yy600, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); }
-#line 6286 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 136: /* db_options ::= db_options ENCRYPT_ALGORITHM NK_STRING */
+{ yylhsminor.yy452 = setDatabaseOption(pCxt, yymsp[-2].minor.yy452, DB_OPTION_ENCRYPT_ALGORITHM, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 136: /* alter_db_options ::= alter_db_option */
-#line 274 "sql.y"
-{ yylhsminor.yy600 = createAlterDatabaseOptions(pCxt); yylhsminor.yy600 = setAlterDatabaseOption(pCxt, yylhsminor.yy600, &yymsp[0].minor.yy145); }
-#line 6292 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 137: /* alter_db_options ::= alter_db_option */
+{ yylhsminor.yy452 = createAlterDatabaseOptions(pCxt); yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yylhsminor.yy452, &yymsp[0].minor.yy455); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 137: /* alter_db_options ::= alter_db_options alter_db_option */
-#line 275 "sql.y"
-{ yylhsminor.yy600 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy600, &yymsp[0].minor.yy145); }
-#line 6298 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 138: /* alter_db_options ::= alter_db_options alter_db_option */
+{ yylhsminor.yy452 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy452, &yymsp[0].minor.yy455); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 138: /* alter_db_option ::= BUFFER NK_INTEGER */
-#line 279 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6304 "sql.c"
+ case 139: /* alter_db_option ::= BUFFER NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 139: /* alter_db_option ::= CACHEMODEL NK_STRING */
-#line 280 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6309 "sql.c"
+ case 140: /* alter_db_option ::= CACHEMODEL NK_STRING */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 140: /* alter_db_option ::= CACHESIZE NK_INTEGER */
-#line 281 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6314 "sql.c"
+ case 141: /* alter_db_option ::= CACHESIZE NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 141: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
-#line 282 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6319 "sql.c"
+ case 142: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 142: /* alter_db_option ::= KEEP integer_list */
- case 143: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==143);
-#line 283 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_KEEP; yymsp[-1].minor.yy145.pList = yymsp[0].minor.yy748; }
-#line 6325 "sql.c"
+ case 143: /* alter_db_option ::= KEEP integer_list */
+ case 144: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==144);
+{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP; yymsp[-1].minor.yy455.pList = yymsp[0].minor.yy34; }
break;
- case 144: /* alter_db_option ::= PAGES NK_INTEGER */
-#line 285 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_PAGES; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6330 "sql.c"
+ case 145: /* alter_db_option ::= PAGES NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_PAGES; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 145: /* alter_db_option ::= REPLICA NK_INTEGER */
-#line 286 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6335 "sql.c"
+ case 146: /* alter_db_option ::= REPLICA NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 146: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
-#line 288 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_WAL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6340 "sql.c"
+ case 147: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 147: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
-#line 289 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6345 "sql.c"
+ case 148: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 148: /* alter_db_option ::= MINROWS NK_INTEGER */
-#line 290 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6350 "sql.c"
+ case 149: /* alter_db_option ::= MINROWS NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 149: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
-#line 291 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6355 "sql.c"
+ case 150: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 150: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
-#line 292 "sql.y"
+ case 151: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yymsp[-2].minor.yy145.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy145.val = t;
+ yymsp[-2].minor.yy455.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy455.val = t;
}
-#line 6364 "sql.c"
break;
- case 151: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
-#line 297 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6369 "sql.c"
+ case 152: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
break;
- case 152: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
-#line 298 "sql.y"
+ case 153: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yymsp[-2].minor.yy145.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy145.val = t;
+ yymsp[-2].minor.yy455.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy455.val = t;
}
-#line 6378 "sql.c"
- break;
- case 153: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */
- case 154: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==154);
-#line 303 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6384 "sql.c"
- break;
- case 155: /* alter_db_option ::= S3_COMPACT NK_INTEGER */
-#line 305 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6389 "sql.c"
- break;
- case 156: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */
-#line 306 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6394 "sql.c"
- break;
- case 157: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */
-#line 307 "sql.y"
-{ yymsp[-1].minor.yy145.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6399 "sql.c"
- break;
- case 158: /* integer_list ::= NK_INTEGER */
-#line 311 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 6404 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
- break;
- case 159: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
- case 437: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==437);
-#line 312 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 6411 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
- break;
- case 160: /* variable_list ::= NK_VARIABLE */
-#line 316 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 6417 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
- break;
- case 161: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
-#line 317 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 6423 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
- break;
- case 162: /* retention_list ::= retention */
- case 194: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==194);
- case 197: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==197);
- case 204: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==204);
- case 207: /* column_def_list ::= column_def */ yytestcase(yyruleno==207);
- case 255: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==255);
- case 260: /* col_name_list ::= col_name */ yytestcase(yyruleno==260);
- case 329: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==329);
- case 353: /* func_list ::= func */ yytestcase(yyruleno==353);
- case 403: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==403);
- case 481: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==481);
- case 506: /* literal_list ::= signed_literal */ yytestcase(yyruleno==506);
- case 580: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==580);
- case 586: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==586);
- case 662: /* select_list ::= select_item */ yytestcase(yyruleno==662);
- case 673: /* partition_list ::= partition_item */ yytestcase(yyruleno==673);
- case 734: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==734);
-#line 321 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, yymsp[0].minor.yy600); }
-#line 6445 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
- break;
- case 163: /* retention_list ::= retention_list NK_COMMA retention */
- case 198: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==198);
- case 205: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==205);
- case 208: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==208);
- case 256: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==256);
- case 261: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==261);
- case 330: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==330);
- case 354: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==354);
- case 404: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==404);
- case 482: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==482);
- case 507: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==507);
- case 581: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==581);
- case 663: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==663);
- case 674: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==674);
- case 735: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==735);
-#line 322 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, yymsp[0].minor.yy600); }
-#line 6465 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
- break;
- case 164: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
- case 165: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==165);
-#line 324 "sql.y"
-{ yylhsminor.yy600 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 6472 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 166: /* speed_opt ::= */
- case 387: /* bufsize_opt ::= */ yytestcase(yyruleno==387);
-#line 329 "sql.y"
-{ yymsp[1].minor.yy756 = 0; }
-#line 6479 "sql.c"
- break;
- case 167: /* speed_opt ::= BWLIMIT NK_INTEGER */
- case 388: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==388);
-#line 330 "sql.y"
-{ yymsp[-1].minor.yy756 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
-#line 6485 "sql.c"
- break;
- case 169: /* start_opt ::= START WITH NK_INTEGER */
- case 173: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==173);
-#line 333 "sql.y"
-{ yymsp[-2].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
-#line 6491 "sql.c"
- break;
- case 170: /* start_opt ::= START WITH NK_STRING */
- case 174: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==174);
-#line 334 "sql.y"
-{ yymsp[-2].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 6497 "sql.c"
- break;
- case 171: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
- case 175: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==175);
-#line 335 "sql.y"
-{ yymsp[-3].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 6503 "sql.c"
- break;
- case 176: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
- case 178: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==178);
-#line 344 "sql.y"
-{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy705, yymsp[-5].minor.yy600, yymsp[-3].minor.yy748, yymsp[-1].minor.yy748, yymsp[0].minor.yy600); }
-#line 6509 "sql.c"
- break;
- case 177: /* cmd ::= CREATE TABLE multi_create_clause */
-#line 345 "sql.y"
-{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy748); }
-#line 6514 "sql.c"
- break;
- case 179: /* cmd ::= DROP TABLE multi_drop_clause */
-#line 348 "sql.y"
-{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy748); }
-#line 6519 "sql.c"
- break;
- case 180: /* cmd ::= DROP STABLE exists_opt full_table_name */
-#line 349 "sql.y"
-{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy705, yymsp[0].minor.yy600); }
-#line 6524 "sql.c"
- break;
- case 181: /* cmd ::= ALTER TABLE alter_table_clause */
- case 439: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==439);
- case 440: /* cmd ::= insert_query */ yytestcase(yyruleno==440);
-#line 351 "sql.y"
-{ pCxt->pRootNode = yymsp[0].minor.yy600; }
-#line 6531 "sql.c"
- break;
- case 182: /* cmd ::= ALTER STABLE alter_table_clause */
-#line 352 "sql.y"
-{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy600); }
-#line 6536 "sql.c"
- break;
- case 183: /* alter_table_clause ::= full_table_name alter_table_options */
-#line 354 "sql.y"
-{ yylhsminor.yy600 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 6541 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
- break;
- case 184: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */
-#line 356 "sql.y"
-{ yylhsminor.yy600 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy600, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy649, yymsp[-1].minor.yy400, yymsp[0].minor.yy600); }
-#line 6547 "sql.c"
- yymsp[-5].minor.yy600 = yylhsminor.yy600;
- break;
- case 185: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
-#line 357 "sql.y"
-{ yylhsminor.yy600 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy600, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy649); }
-#line 6553 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
- break;
- case 186: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
-#line 359 "sql.y"
-{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy649, yymsp[0].minor.yy400); }
-#line 6559 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 187: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */
-#line 361 "sql.y"
-{ yylhsminor.yy600 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy649, yymsp[0].minor.yy600); }
-#line 6565 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 188: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
-#line 363 "sql.y"
-{ yylhsminor.yy600 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); }
-#line 6571 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 189: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
-#line 365 "sql.y"
-{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy649, yymsp[0].minor.yy400); }
-#line 6577 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 190: /* alter_table_clause ::= full_table_name DROP TAG column_name */
-#line 366 "sql.y"
-{ yylhsminor.yy600 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy600, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy649); }
-#line 6583 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
- break;
- case 191: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
-#line 368 "sql.y"
-{ yylhsminor.yy600 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy649, yymsp[0].minor.yy400); }
-#line 6589 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 192: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
-#line 370 "sql.y"
-{ yylhsminor.yy600 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy600, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); }
-#line 6595 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 193: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */
-#line 372 "sql.y"
-{ yylhsminor.yy600 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy600, &yymsp[-2].minor.yy649, yymsp[0].minor.yy600); }
-#line 6601 "sql.c"
- yymsp[-5].minor.yy600 = yylhsminor.yy600;
- break;
- case 195: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
- case 587: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==587);
-#line 377 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-1].minor.yy748, yymsp[0].minor.yy600); }
-#line 6608 "sql.c"
- yymsp[-1].minor.yy748 = yylhsminor.yy748;
- break;
- case 196: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */
-#line 381 "sql.y"
-{ yylhsminor.yy600 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy705, yymsp[-8].minor.yy600, yymsp[-6].minor.yy600, yymsp[-5].minor.yy748, yymsp[-2].minor.yy748, yymsp[0].minor.yy600); }
-#line 6614 "sql.c"
- yymsp[-9].minor.yy600 = yylhsminor.yy600;
- break;
- case 199: /* drop_table_clause ::= exists_opt full_table_name */
-#line 388 "sql.y"
-{ yylhsminor.yy600 = createDropTableClause(pCxt, yymsp[-1].minor.yy705, yymsp[0].minor.yy600); }
-#line 6620 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
- break;
- case 201: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
- case 402: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==402);
-#line 393 "sql.y"
-{ yymsp[-2].minor.yy748 = yymsp[-1].minor.yy748; }
-#line 6627 "sql.c"
- break;
- case 202: /* full_table_name ::= table_name */
- case 343: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==343);
-#line 395 "sql.y"
-{ yylhsminor.yy600 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy649, NULL); }
-#line 6633 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
- break;
- case 203: /* full_table_name ::= db_name NK_DOT table_name */
- case 344: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==344);
-#line 396 "sql.y"
-{ yylhsminor.yy600 = createRealTableNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649, NULL); }
-#line 6640 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 206: /* tag_def ::= column_name type_name */
-#line 402 "sql.y"
-{ yylhsminor.yy600 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy649, yymsp[0].minor.yy400, NULL); }
-#line 6646 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
- break;
- case 209: /* column_def ::= column_name type_name column_options */
-#line 410 "sql.y"
-{ yylhsminor.yy600 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy649, yymsp[-1].minor.yy400, yymsp[0].minor.yy600); }
-#line 6652 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 210: /* type_name ::= BOOL */
-#line 414 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BOOL); }
-#line 6658 "sql.c"
- break;
- case 211: /* type_name ::= TINYINT */
-#line 415 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TINYINT); }
-#line 6663 "sql.c"
- break;
- case 212: /* type_name ::= SMALLINT */
-#line 416 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
-#line 6668 "sql.c"
- break;
- case 213: /* type_name ::= INT */
- case 214: /* type_name ::= INTEGER */ yytestcase(yyruleno==214);
-#line 417 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_INT); }
-#line 6674 "sql.c"
- break;
- case 215: /* type_name ::= BIGINT */
-#line 419 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BIGINT); }
-#line 6679 "sql.c"
- break;
- case 216: /* type_name ::= FLOAT */
-#line 420 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_FLOAT); }
-#line 6684 "sql.c"
- break;
- case 217: /* type_name ::= DOUBLE */
-#line 421 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
-#line 6689 "sql.c"
- break;
- case 218: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
-#line 422 "sql.y"
-{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
-#line 6694 "sql.c"
- break;
- case 219: /* type_name ::= TIMESTAMP */
-#line 423 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
-#line 6699 "sql.c"
- break;
- case 220: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
-#line 424 "sql.y"
-{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
-#line 6704 "sql.c"
- break;
- case 221: /* type_name ::= TINYINT UNSIGNED */
-#line 425 "sql.y"
-{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
-#line 6709 "sql.c"
- break;
- case 222: /* type_name ::= SMALLINT UNSIGNED */
-#line 426 "sql.y"
-{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
-#line 6714 "sql.c"
- break;
- case 223: /* type_name ::= INT UNSIGNED */
-#line 427 "sql.y"
-{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UINT); }
-#line 6719 "sql.c"
- break;
- case 224: /* type_name ::= BIGINT UNSIGNED */
-#line 428 "sql.y"
-{ yymsp[-1].minor.yy400 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
-#line 6724 "sql.c"
- break;
- case 225: /* type_name ::= JSON */
-#line 429 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_JSON); }
-#line 6729 "sql.c"
- break;
- case 226: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
-#line 430 "sql.y"
-{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
-#line 6734 "sql.c"
- break;
- case 227: /* type_name ::= MEDIUMBLOB */
-#line 431 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
-#line 6739 "sql.c"
- break;
- case 228: /* type_name ::= BLOB */
-#line 432 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_BLOB); }
-#line 6744 "sql.c"
- break;
- case 229: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
-#line 433 "sql.y"
-{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
-#line 6749 "sql.c"
- break;
- case 230: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */
-#line 434 "sql.y"
-{ yymsp[-3].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); }
-#line 6754 "sql.c"
- break;
- case 231: /* type_name ::= DECIMAL */
-#line 435 "sql.y"
-{ yymsp[0].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 6759 "sql.c"
- break;
- case 232: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
-#line 436 "sql.y"
-{ yymsp[-3].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 6764 "sql.c"
- break;
- case 233: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-#line 437 "sql.y"
-{ yymsp[-5].minor.yy400 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
-#line 6769 "sql.c"
- break;
- case 234: /* type_name_default_len ::= BINARY */
-#line 441 "sql.y"
-{ yymsp[0].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); }
-#line 6774 "sql.c"
- break;
- case 235: /* type_name_default_len ::= NCHAR */
-#line 442 "sql.y"
-{ yymsp[0].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); }
-#line 6779 "sql.c"
- break;
- case 236: /* type_name_default_len ::= VARCHAR */
-#line 443 "sql.y"
-{ yymsp[0].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); }
-#line 6784 "sql.c"
- break;
- case 237: /* type_name_default_len ::= VARBINARY */
-#line 444 "sql.y"
-{ yymsp[0].minor.yy400 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); }
-#line 6789 "sql.c"
- break;
- case 240: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */
- case 410: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==410);
-#line 453 "sql.y"
-{ yymsp[-3].minor.yy748 = yymsp[-1].minor.yy748; }
-#line 6795 "sql.c"
- break;
- case 241: /* table_options ::= */
-#line 455 "sql.y"
-{ yymsp[1].minor.yy600 = createDefaultTableOptions(pCxt); }
-#line 6800 "sql.c"
- break;
- case 242: /* table_options ::= table_options COMMENT NK_STRING */
-#line 456 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
-#line 6805 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 243: /* table_options ::= table_options MAX_DELAY duration_list */
-#line 457 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy748); }
-#line 6811 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 244: /* table_options ::= table_options WATERMARK duration_list */
-#line 458 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy748); }
-#line 6817 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 245: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
-#line 459 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-4].minor.yy600, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy748); }
-#line 6823 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 246: /* table_options ::= table_options TTL NK_INTEGER */
-#line 460 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
-#line 6829 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 247: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
-#line 461 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-4].minor.yy600, TABLE_OPTION_SMA, yymsp[-1].minor.yy748); }
-#line 6835 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
- break;
- case 248: /* table_options ::= table_options DELETE_MARK duration_list */
-#line 462 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-2].minor.yy600, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy748); }
-#line 6841 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
- break;
- case 249: /* alter_table_options ::= alter_table_option */
-#line 464 "sql.y"
-{ yylhsminor.yy600 = createAlterTableOptions(pCxt); yylhsminor.yy600 = setTableOption(pCxt, yylhsminor.yy600, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
-#line 6847 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
- break;
- case 250: /* alter_table_options ::= alter_table_options alter_table_option */
-#line 465 "sql.y"
-{ yylhsminor.yy600 = setTableOption(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy145.type, &yymsp[0].minor.yy145.val); }
-#line 6853 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
- break;
- case 251: /* alter_table_option ::= COMMENT NK_STRING */
-#line 469 "sql.y"
-{ yymsp[-1].minor.yy145.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6859 "sql.c"
- break;
- case 252: /* alter_table_option ::= TTL NK_INTEGER */
-#line 470 "sql.y"
-{ yymsp[-1].minor.yy145.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy145.val = yymsp[0].minor.yy0; }
-#line 6864 "sql.c"
- break;
- case 253: /* duration_list ::= duration_literal */
- case 539: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==539);
-#line 474 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 6870 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
- break;
- case 254: /* duration_list ::= duration_list NK_COMMA duration_literal */
- case 540: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==540);
-#line 475 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 6877 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
- break;
- case 257: /* rollup_func_name ::= function_name */
-#line 482 "sql.y"
-{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[0].minor.yy649, NULL); }
-#line 6883 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
- break;
- case 258: /* rollup_func_name ::= FIRST */
- case 259: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==259);
- case 332: /* tag_item ::= QTAGS */ yytestcase(yyruleno==332);
-#line 483 "sql.y"
-{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 6891 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
- break;
- case 262: /* col_name ::= column_name */
- case 333: /* tag_item ::= column_name */ yytestcase(yyruleno==333);
-#line 491 "sql.y"
-{ yylhsminor.yy600 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy649); }
-#line 6898 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
- break;
- case 263: /* cmd ::= SHOW DNODES */
-#line 494 "sql.y"
+ break;
+ case 154: /* alter_db_option ::= S3_KEEPLOCAL NK_INTEGER */
+ case 155: /* alter_db_option ::= S3_KEEPLOCAL NK_VARIABLE */ yytestcase(yyruleno==155);
+{ yymsp[-1].minor.yy455.type = DB_OPTION_S3_KEEPLOCAL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 156: /* alter_db_option ::= S3_COMPACT NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_S3_COMPACT, yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 157: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 158: /* alter_db_option ::= ENCRYPT_ALGORITHM NK_STRING */
+{ yymsp[-1].minor.yy455.type = DB_OPTION_ENCRYPT_ALGORITHM; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 159: /* integer_list ::= NK_INTEGER */
+{ yylhsminor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 160: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
+ case 438: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==438);
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 161: /* variable_list ::= NK_VARIABLE */
+{ yylhsminor.yy34 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 162: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 163: /* retention_list ::= retention */
+ case 195: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==195);
+ case 198: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==198);
+ case 205: /* tag_def_list ::= tag_def */ yytestcase(yyruleno==205);
+ case 208: /* column_def_list ::= column_def */ yytestcase(yyruleno==208);
+ case 256: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==256);
+ case 261: /* col_name_list ::= col_name */ yytestcase(yyruleno==261);
+ case 330: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==330);
+ case 354: /* func_list ::= func */ yytestcase(yyruleno==354);
+ case 404: /* column_stream_def_list ::= column_stream_def */ yytestcase(yyruleno==404);
+ case 482: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==482);
+ case 507: /* literal_list ::= signed_literal */ yytestcase(yyruleno==507);
+ case 581: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==581);
+ case 587: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==587);
+ case 663: /* select_list ::= select_item */ yytestcase(yyruleno==663);
+ case 674: /* partition_list ::= partition_item */ yytestcase(yyruleno==674);
+ case 735: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==735);
+{ yylhsminor.yy34 = createNodeList(pCxt, yymsp[0].minor.yy452); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 164: /* retention_list ::= retention_list NK_COMMA retention */
+ case 199: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==199);
+ case 206: /* tag_def_list ::= tag_def_list NK_COMMA tag_def */ yytestcase(yyruleno==206);
+ case 209: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==209);
+ case 257: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==257);
+ case 262: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==262);
+ case 331: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==331);
+ case 355: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==355);
+ case 405: /* column_stream_def_list ::= column_stream_def_list NK_COMMA column_stream_def */ yytestcase(yyruleno==405);
+ case 483: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==483);
+ case 508: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==508);
+ case 582: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==582);
+ case 664: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==664);
+ case 675: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==675);
+ case 736: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==736);
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 165: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
+ case 166: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==166);
+{ yylhsminor.yy452 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 167: /* speed_opt ::= */
+ case 388: /* bufsize_opt ::= */ yytestcase(yyruleno==388);
+{ yymsp[1].minor.yy100 = 0; }
+ break;
+ case 168: /* speed_opt ::= BWLIMIT NK_INTEGER */
+ case 389: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==389);
+{ yymsp[-1].minor.yy100 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
+ break;
+ case 170: /* start_opt ::= START WITH NK_INTEGER */
+ case 174: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==174);
+{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
+ break;
+ case 171: /* start_opt ::= START WITH NK_STRING */
+ case 175: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==175);
+{ yymsp[-2].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 172: /* start_opt ::= START WITH TIMESTAMP NK_STRING */
+ case 176: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==176);
+{ yymsp[-3].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
+ break;
+ case 177: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
+ case 179: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==179);
+{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy437, yymsp[-5].minor.yy452, yymsp[-3].minor.yy34, yymsp[-1].minor.yy34, yymsp[0].minor.yy452); }
+ break;
+ case 178: /* cmd ::= CREATE TABLE multi_create_clause */
+{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy34); }
+ break;
+ case 180: /* cmd ::= DROP TABLE multi_drop_clause */
+{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy34); }
+ break;
+ case 181: /* cmd ::= DROP STABLE exists_opt full_table_name */
+{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); }
+ break;
+ case 182: /* cmd ::= ALTER TABLE alter_table_clause */
+ case 440: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==440);
+ case 441: /* cmd ::= insert_query */ yytestcase(yyruleno==441);
+{ pCxt->pRootNode = yymsp[0].minor.yy452; }
+ break;
+ case 183: /* cmd ::= ALTER STABLE alter_table_clause */
+{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy452); }
+ break;
+ case 184: /* alter_table_clause ::= full_table_name alter_table_options */
+{ yylhsminor.yy452 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 185: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name column_options */
+{ yylhsminor.yy452 = createAlterTableAddModifyColOptions2(pCxt, yymsp[-5].minor.yy452, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy874, yymsp[0].minor.yy452); }
+ yymsp[-5].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 186: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
+{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy479); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 187: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
+{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 188: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name column_options */
+{ yylhsminor.yy452 = createAlterTableAddModifyColOptions(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_COMPRESS, &yymsp[-1].minor.yy479, yymsp[0].minor.yy452); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 189: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
+{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 190: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
+{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 191: /* alter_table_clause ::= full_table_name DROP TAG column_name */
+{ yylhsminor.yy452 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy452, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy479); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 192: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
+{ yylhsminor.yy452 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 193: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
+{ yylhsminor.yy452 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy452, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 194: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */
+{ yylhsminor.yy452 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy452, &yymsp[-2].minor.yy479, yymsp[0].minor.yy452); }
+ yymsp[-5].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 196: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
+ case 588: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==588);
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-1].minor.yy34, yymsp[0].minor.yy452); }
+ yymsp[-1].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 197: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */
+{ yylhsminor.yy452 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy437, yymsp[-8].minor.yy452, yymsp[-6].minor.yy452, yymsp[-5].minor.yy34, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); }
+ yymsp[-9].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 200: /* drop_table_clause ::= exists_opt full_table_name */
+{ yylhsminor.yy452 = createDropTableClause(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 202: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
+ case 403: /* col_list_opt ::= NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==403);
+{ yymsp[-2].minor.yy34 = yymsp[-1].minor.yy34; }
+ break;
+ case 203: /* full_table_name ::= table_name */
+ case 344: /* full_tsma_name ::= tsma_name */ yytestcase(yyruleno==344);
+{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy479, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 204: /* full_table_name ::= db_name NK_DOT table_name */
+ case 345: /* full_tsma_name ::= db_name NK_DOT tsma_name */ yytestcase(yyruleno==345);
+{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479, NULL); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 207: /* tag_def ::= column_name type_name */
+{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy479, yymsp[0].minor.yy874, NULL); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 210: /* column_def ::= column_name type_name column_options */
+{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-2].minor.yy479, yymsp[-1].minor.yy874, yymsp[0].minor.yy452); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 211: /* type_name ::= BOOL */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BOOL); }
+ break;
+ case 212: /* type_name ::= TINYINT */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_TINYINT); }
+ break;
+ case 213: /* type_name ::= SMALLINT */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
+ break;
+ case 214: /* type_name ::= INT */
+ case 215: /* type_name ::= INTEGER */ yytestcase(yyruleno==215);
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_INT); }
+ break;
+ case 216: /* type_name ::= BIGINT */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BIGINT); }
+ break;
+ case 217: /* type_name ::= FLOAT */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_FLOAT); }
+ break;
+ case 218: /* type_name ::= DOUBLE */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
+ break;
+ case 219: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
+ break;
+ case 220: /* type_name ::= TIMESTAMP */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
+ break;
+ case 221: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
+ break;
+ case 222: /* type_name ::= TINYINT UNSIGNED */
+{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
+ break;
+ case 223: /* type_name ::= SMALLINT UNSIGNED */
+{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
+ break;
+ case 224: /* type_name ::= INT UNSIGNED */
+{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UINT); }
+ break;
+ case 225: /* type_name ::= BIGINT UNSIGNED */
+{ yymsp[-1].minor.yy874 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
+ break;
+ case 226: /* type_name ::= JSON */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_JSON); }
+ break;
+ case 227: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
+ break;
+ case 228: /* type_name ::= MEDIUMBLOB */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
+ break;
+ case 229: /* type_name ::= BLOB */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_BLOB); }
+ break;
+ case 230: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
+ break;
+ case 231: /* type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_GEOMETRY, &yymsp[-1].minor.yy0); }
+ break;
+ case 232: /* type_name ::= DECIMAL */
+{ yymsp[0].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ break;
+ case 233: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ break;
+ case 234: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy874 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
+ break;
+ case 235: /* type_name_default_len ::= BINARY */
+{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, NULL); }
+ break;
+ case 236: /* type_name_default_len ::= NCHAR */
+{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, NULL); }
+ break;
+ case 237: /* type_name_default_len ::= VARCHAR */
+{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, NULL); }
+ break;
+ case 238: /* type_name_default_len ::= VARBINARY */
+{ yymsp[0].minor.yy874 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, NULL); }
+ break;
+ case 241: /* tags_def ::= TAGS NK_LP tag_def_list NK_RP */
+ case 411: /* tag_def_or_ref_opt ::= TAGS NK_LP column_stream_def_list NK_RP */ yytestcase(yyruleno==411);
+{ yymsp[-3].minor.yy34 = yymsp[-1].minor.yy34; }
+ break;
+ case 242: /* table_options ::= */
+{ yymsp[1].minor.yy452 = createDefaultTableOptions(pCxt); }
+ break;
+ case 243: /* table_options ::= table_options COMMENT NK_STRING */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 244: /* table_options ::= table_options MAX_DELAY duration_list */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy34); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 245: /* table_options ::= table_options WATERMARK duration_list */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy34); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 246: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy34); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 247: /* table_options ::= table_options TTL NK_INTEGER */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 248: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-4].minor.yy452, TABLE_OPTION_SMA, yymsp[-1].minor.yy34); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 249: /* table_options ::= table_options DELETE_MARK duration_list */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-2].minor.yy452, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy34); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 250: /* alter_table_options ::= alter_table_option */
+{ yylhsminor.yy452 = createAlterTableOptions(pCxt); yylhsminor.yy452 = setTableOption(pCxt, yylhsminor.yy452, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 251: /* alter_table_options ::= alter_table_options alter_table_option */
+{ yylhsminor.yy452 = setTableOption(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy455.type, &yymsp[0].minor.yy455.val); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 252: /* alter_table_option ::= COMMENT NK_STRING */
+{ yymsp[-1].minor.yy455.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 253: /* alter_table_option ::= TTL NK_INTEGER */
+{ yymsp[-1].minor.yy455.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy455.val = yymsp[0].minor.yy0; }
+ break;
+ case 254: /* duration_list ::= duration_literal */
+ case 540: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==540);
+{ yylhsminor.yy34 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 255: /* duration_list ::= duration_list NK_COMMA duration_literal */
+ case 541: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==541);
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
+ break;
+ case 258: /* rollup_func_name ::= function_name */
+{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy479, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 259: /* rollup_func_name ::= FIRST */
+ case 260: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==260);
+ case 333: /* tag_item ::= QTAGS */ yytestcase(yyruleno==333);
+{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 263: /* col_name ::= column_name */
+ case 334: /* tag_item ::= column_name */ yytestcase(yyruleno==334);
+{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy479); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
+ break;
+ case 264: /* cmd ::= SHOW DNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
-#line 6904 "sql.c"
break;
- case 264: /* cmd ::= SHOW USERS */
-#line 495 "sql.y"
+ case 265: /* cmd ::= SHOW USERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
-#line 6909 "sql.c"
break;
- case 265: /* cmd ::= SHOW USER PRIVILEGES */
-#line 496 "sql.y"
+ case 266: /* cmd ::= SHOW USER PRIVILEGES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
-#line 6914 "sql.c"
break;
- case 266: /* cmd ::= SHOW db_kind_opt DATABASES */
-#line 497 "sql.y"
+ case 267: /* cmd ::= SHOW db_kind_opt DATABASES */
{
pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT);
- setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy245);
+ setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy39);
}
-#line 6922 "sql.c"
break;
- case 267: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */
-#line 501 "sql.y"
+ case 268: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */
{
- pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy125, yymsp[0].minor.yy600, OP_TYPE_LIKE);
+ pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy397, yymsp[0].minor.yy452, OP_TYPE_LIKE);
}
-#line 6929 "sql.c"
break;
- case 268: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
-#line 504 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, OP_TYPE_LIKE); }
-#line 6934 "sql.c"
+ case 269: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, OP_TYPE_LIKE); }
break;
- case 269: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
-#line 505 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy600, NULL, OP_TYPE_LIKE); }
-#line 6939 "sql.c"
+ case 270: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy452, NULL, OP_TYPE_LIKE); }
break;
- case 270: /* cmd ::= SHOW MNODES */
-#line 506 "sql.y"
+ case 271: /* cmd ::= SHOW MNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
-#line 6944 "sql.c"
break;
- case 271: /* cmd ::= SHOW QNODES */
-#line 508 "sql.y"
+ case 272: /* cmd ::= SHOW QNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
-#line 6949 "sql.c"
break;
- case 272: /* cmd ::= SHOW ARBGROUPS */
-#line 509 "sql.y"
+ case 273: /* cmd ::= SHOW ARBGROUPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); }
-#line 6954 "sql.c"
break;
- case 273: /* cmd ::= SHOW FUNCTIONS */
-#line 510 "sql.y"
+ case 274: /* cmd ::= SHOW FUNCTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
-#line 6959 "sql.c"
break;
- case 274: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
-#line 511 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy600, yymsp[-1].minor.yy600, OP_TYPE_EQUAL); }
-#line 6964 "sql.c"
+ case 275: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); }
break;
- case 275: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */
-#line 512 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy649), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649), OP_TYPE_EQUAL); }
-#line 6969 "sql.c"
+ case 276: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), OP_TYPE_EQUAL); }
break;
- case 276: /* cmd ::= SHOW STREAMS */
-#line 513 "sql.y"
+ case 277: /* cmd ::= SHOW STREAMS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
-#line 6974 "sql.c"
break;
- case 277: /* cmd ::= SHOW ACCOUNTS */
-#line 514 "sql.y"
+ case 278: /* cmd ::= SHOW ACCOUNTS */
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
-#line 6979 "sql.c"
break;
- case 278: /* cmd ::= SHOW APPS */
-#line 515 "sql.y"
+ case 279: /* cmd ::= SHOW APPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
-#line 6984 "sql.c"
break;
- case 279: /* cmd ::= SHOW CONNECTIONS */
-#line 516 "sql.y"
+ case 280: /* cmd ::= SHOW CONNECTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
-#line 6989 "sql.c"
break;
- case 280: /* cmd ::= SHOW LICENCES */
- case 281: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==281);
-#line 517 "sql.y"
+ case 281: /* cmd ::= SHOW LICENCES */
+ case 282: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==282);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
-#line 6995 "sql.c"
break;
- case 282: /* cmd ::= SHOW GRANTS FULL */
-#line 519 "sql.y"
+ case 283: /* cmd ::= SHOW GRANTS FULL */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); }
-#line 7000 "sql.c"
break;
- case 283: /* cmd ::= SHOW GRANTS LOGS */
-#line 520 "sql.y"
+ case 284: /* cmd ::= SHOW GRANTS LOGS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); }
-#line 7005 "sql.c"
break;
- case 284: /* cmd ::= SHOW CLUSTER MACHINES */
-#line 521 "sql.y"
+ case 285: /* cmd ::= SHOW CLUSTER MACHINES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); }
-#line 7010 "sql.c"
break;
- case 285: /* cmd ::= SHOW CREATE DATABASE db_name */
-#line 522 "sql.y"
-{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 7015 "sql.c"
+ case 286: /* cmd ::= SHOW CREATE DATABASE db_name */
+{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 286: /* cmd ::= SHOW CREATE TABLE full_table_name */
-#line 523 "sql.y"
-{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy600); }
-#line 7020 "sql.c"
+ case 287: /* cmd ::= SHOW CREATE TABLE full_table_name */
+{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy452); }
break;
- case 287: /* cmd ::= SHOW CREATE STABLE full_table_name */
-#line 524 "sql.y"
+ case 288: /* cmd ::= SHOW CREATE STABLE full_table_name */
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT,
-yymsp[0].minor.yy600); }
-#line 7026 "sql.c"
+yymsp[0].minor.yy452); }
break;
- case 288: /* cmd ::= SHOW ENCRYPTIONS */
-#line 526 "sql.y"
+ case 289: /* cmd ::= SHOW ENCRYPTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ENCRYPTIONS_STMT); }
-#line 7031 "sql.c"
break;
- case 289: /* cmd ::= SHOW QUERIES */
-#line 527 "sql.y"
+ case 290: /* cmd ::= SHOW QUERIES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
-#line 7036 "sql.c"
break;
- case 290: /* cmd ::= SHOW SCORES */
-#line 528 "sql.y"
+ case 291: /* cmd ::= SHOW SCORES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
-#line 7041 "sql.c"
break;
- case 291: /* cmd ::= SHOW TOPICS */
-#line 529 "sql.y"
+ case 292: /* cmd ::= SHOW TOPICS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
-#line 7046 "sql.c"
break;
- case 292: /* cmd ::= SHOW VARIABLES */
- case 293: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==293);
-#line 530 "sql.y"
+ case 293: /* cmd ::= SHOW VARIABLES */
+ case 294: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==294);
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
-#line 7052 "sql.c"
break;
- case 294: /* cmd ::= SHOW LOCAL VARIABLES */
-#line 532 "sql.y"
+ case 295: /* cmd ::= SHOW LOCAL VARIABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
-#line 7057 "sql.c"
break;
- case 295: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
-#line 533 "sql.y"
-{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy600); }
-#line 7062 "sql.c"
+ case 296: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
+{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy452); }
break;
- case 296: /* cmd ::= SHOW BNODES */
-#line 534 "sql.y"
+ case 297: /* cmd ::= SHOW BNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
-#line 7067 "sql.c"
break;
- case 297: /* cmd ::= SHOW SNODES */
-#line 535 "sql.y"
+ case 298: /* cmd ::= SHOW SNODES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
-#line 7072 "sql.c"
break;
- case 298: /* cmd ::= SHOW CLUSTER */
-#line 536 "sql.y"
+ case 299: /* cmd ::= SHOW CLUSTER */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
-#line 7077 "sql.c"
break;
- case 299: /* cmd ::= SHOW TRANSACTIONS */
-#line 537 "sql.y"
+ case 300: /* cmd ::= SHOW TRANSACTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
-#line 7082 "sql.c"
break;
- case 300: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
-#line 538 "sql.y"
-{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy600); }
-#line 7087 "sql.c"
+ case 301: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
+{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy452); }
break;
- case 301: /* cmd ::= SHOW CONSUMERS */
-#line 539 "sql.y"
+ case 302: /* cmd ::= SHOW CONSUMERS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
-#line 7092 "sql.c"
break;
- case 302: /* cmd ::= SHOW SUBSCRIPTIONS */
-#line 540 "sql.y"
+ case 303: /* cmd ::= SHOW SUBSCRIPTIONS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
-#line 7097 "sql.c"
break;
- case 303: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
-#line 541 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy600, yymsp[-1].minor.yy600, OP_TYPE_EQUAL); }
-#line 7102 "sql.c"
+ case 304: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy452, yymsp[-1].minor.yy452, OP_TYPE_EQUAL); }
break;
- case 304: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */
-#line 542 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy649), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649), OP_TYPE_EQUAL); }
-#line 7107 "sql.c"
+ case 305: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), OP_TYPE_EQUAL); }
break;
- case 305: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
-#line 543 "sql.y"
-{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600, yymsp[-3].minor.yy748); }
-#line 7112 "sql.c"
+ case 306: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
+{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452, yymsp[-3].minor.yy34); }
break;
- case 306: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */
-#line 544 "sql.y"
-{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy649), yymsp[-4].minor.yy748); }
-#line 7117 "sql.c"
+ case 307: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */
+{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy479), yymsp[-4].minor.yy34); }
break;
- case 307: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */
-#line 545 "sql.y"
+ case 308: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
-#line 7122 "sql.c"
break;
- case 308: /* cmd ::= SHOW VNODES */
-#line 546 "sql.y"
+ case 309: /* cmd ::= SHOW VNODES */
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); }
-#line 7127 "sql.c"
break;
- case 309: /* cmd ::= SHOW db_name_cond_opt ALIVE */
-#line 548 "sql.y"
-{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy600, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
-#line 7132 "sql.c"
+ case 310: /* cmd ::= SHOW db_name_cond_opt ALIVE */
+{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy452, QUERY_NODE_SHOW_DB_ALIVE_STMT); }
break;
- case 310: /* cmd ::= SHOW CLUSTER ALIVE */
-#line 549 "sql.y"
+ case 311: /* cmd ::= SHOW CLUSTER ALIVE */
{ pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); }
-#line 7137 "sql.c"
break;
- case 311: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */
-#line 550 "sql.y"
-{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, OP_TYPE_LIKE); }
-#line 7142 "sql.c"
+ case 312: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */
+{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, OP_TYPE_LIKE); }
break;
- case 312: /* cmd ::= SHOW CREATE VIEW full_table_name */
-#line 551 "sql.y"
-{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy600); }
-#line 7147 "sql.c"
+ case 313: /* cmd ::= SHOW CREATE VIEW full_table_name */
+{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy452); }
break;
- case 313: /* cmd ::= SHOW COMPACTS */
-#line 552 "sql.y"
+ case 314: /* cmd ::= SHOW COMPACTS */
{ pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); }
-#line 7152 "sql.c"
break;
- case 314: /* cmd ::= SHOW COMPACT NK_INTEGER */
-#line 553 "sql.y"
+ case 315: /* cmd ::= SHOW COMPACT NK_INTEGER */
{ pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 7157 "sql.c"
break;
- case 315: /* table_kind_db_name_cond_opt ::= */
-#line 557 "sql.y"
-{ yymsp[1].minor.yy125.kind = SHOW_KIND_ALL; yymsp[1].minor.yy125.dbName = nil_token; }
-#line 7162 "sql.c"
+ case 316: /* table_kind_db_name_cond_opt ::= */
+{ yymsp[1].minor.yy397.kind = SHOW_KIND_ALL; yymsp[1].minor.yy397.dbName = nil_token; }
break;
- case 316: /* table_kind_db_name_cond_opt ::= table_kind */
-#line 558 "sql.y"
-{ yylhsminor.yy125.kind = yymsp[0].minor.yy245; yylhsminor.yy125.dbName = nil_token; }
-#line 7167 "sql.c"
- yymsp[0].minor.yy125 = yylhsminor.yy125;
+ case 317: /* table_kind_db_name_cond_opt ::= table_kind */
+{ yylhsminor.yy397.kind = yymsp[0].minor.yy39; yylhsminor.yy397.dbName = nil_token; }
+ yymsp[0].minor.yy397 = yylhsminor.yy397;
break;
- case 317: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */
-#line 559 "sql.y"
-{ yylhsminor.yy125.kind = SHOW_KIND_ALL; yylhsminor.yy125.dbName = yymsp[-1].minor.yy649; }
-#line 7173 "sql.c"
- yymsp[-1].minor.yy125 = yylhsminor.yy125;
+ case 318: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */
+{ yylhsminor.yy397.kind = SHOW_KIND_ALL; yylhsminor.yy397.dbName = yymsp[-1].minor.yy479; }
+ yymsp[-1].minor.yy397 = yylhsminor.yy397;
break;
- case 318: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */
-#line 560 "sql.y"
-{ yylhsminor.yy125.kind = yymsp[-2].minor.yy245; yylhsminor.yy125.dbName = yymsp[-1].minor.yy649; }
-#line 7179 "sql.c"
- yymsp[-2].minor.yy125 = yylhsminor.yy125;
+ case 319: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */
+{ yylhsminor.yy397.kind = yymsp[-2].minor.yy39; yylhsminor.yy397.dbName = yymsp[-1].minor.yy479; }
+ yymsp[-2].minor.yy397 = yylhsminor.yy397;
break;
- case 319: /* table_kind ::= NORMAL */
-#line 564 "sql.y"
-{ yymsp[0].minor.yy245 = SHOW_KIND_TABLES_NORMAL; }
-#line 7185 "sql.c"
+ case 320: /* table_kind ::= NORMAL */
+{ yymsp[0].minor.yy39 = SHOW_KIND_TABLES_NORMAL; }
break;
- case 320: /* table_kind ::= CHILD */
-#line 565 "sql.y"
-{ yymsp[0].minor.yy245 = SHOW_KIND_TABLES_CHILD; }
-#line 7190 "sql.c"
+ case 321: /* table_kind ::= CHILD */
+{ yymsp[0].minor.yy39 = SHOW_KIND_TABLES_CHILD; }
break;
- case 321: /* db_name_cond_opt ::= */
- case 326: /* from_db_opt ::= */ yytestcase(yyruleno==326);
-#line 567 "sql.y"
-{ yymsp[1].minor.yy600 = createDefaultDatabaseCondValue(pCxt); }
-#line 7196 "sql.c"
+ case 322: /* db_name_cond_opt ::= */
+ case 327: /* from_db_opt ::= */ yytestcase(yyruleno==327);
+{ yymsp[1].minor.yy452 = createDefaultDatabaseCondValue(pCxt); }
break;
- case 322: /* db_name_cond_opt ::= db_name NK_DOT */
-#line 568 "sql.y"
-{ yylhsminor.yy600 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy649); }
-#line 7201 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 323: /* db_name_cond_opt ::= db_name NK_DOT */
+{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy479); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 324: /* like_pattern_opt ::= LIKE NK_STRING */
-#line 571 "sql.y"
-{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
-#line 7207 "sql.c"
+ case 325: /* like_pattern_opt ::= LIKE NK_STRING */
+{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
break;
- case 325: /* table_name_cond ::= table_name */
-#line 573 "sql.y"
-{ yylhsminor.yy600 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649); }
-#line 7212 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 326: /* table_name_cond ::= table_name */
+{ yylhsminor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 327: /* from_db_opt ::= FROM db_name */
-#line 576 "sql.y"
-{ yymsp[-1].minor.yy600 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy649); }
-#line 7218 "sql.c"
+ case 328: /* from_db_opt ::= FROM db_name */
+{ yymsp[-1].minor.yy452 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy479); }
break;
- case 331: /* tag_item ::= TBNAME */
-#line 584 "sql.y"
-{ yylhsminor.yy600 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
-#line 7223 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 332: /* tag_item ::= TBNAME */
+{ yylhsminor.yy452 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 334: /* tag_item ::= column_name column_alias */
-#line 587 "sql.y"
-{ yylhsminor.yy600 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy649), &yymsp[0].minor.yy649); }
-#line 7229 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 335: /* tag_item ::= column_name column_alias */
+{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy479), &yymsp[0].minor.yy479); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 335: /* tag_item ::= column_name AS column_alias */
-#line 588 "sql.y"
-{ yylhsminor.yy600 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy649), &yymsp[0].minor.yy649); }
-#line 7235 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 336: /* tag_item ::= column_name AS column_alias */
+{ yylhsminor.yy452 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy479), &yymsp[0].minor.yy479); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 336: /* db_kind_opt ::= */
-#line 592 "sql.y"
-{ yymsp[1].minor.yy245 = SHOW_KIND_ALL; }
-#line 7241 "sql.c"
+ case 337: /* db_kind_opt ::= */
+{ yymsp[1].minor.yy39 = SHOW_KIND_ALL; }
break;
- case 337: /* db_kind_opt ::= USER */
-#line 593 "sql.y"
-{ yymsp[0].minor.yy245 = SHOW_KIND_DATABASES_USER; }
-#line 7246 "sql.c"
+ case 338: /* db_kind_opt ::= USER */
+{ yymsp[0].minor.yy39 = SHOW_KIND_DATABASES_USER; }
break;
- case 338: /* db_kind_opt ::= SYSTEM */
-#line 594 "sql.y"
-{ yymsp[0].minor.yy245 = SHOW_KIND_DATABASES_SYSTEM; }
-#line 7251 "sql.c"
+ case 339: /* db_kind_opt ::= SYSTEM */
+{ yymsp[0].minor.yy39 = SHOW_KIND_DATABASES_SYSTEM; }
break;
- case 339: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */
-#line 600 "sql.y"
-{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy705, &yymsp[-7].minor.yy649, yymsp[-4].minor.yy600, yymsp[-5].minor.yy600, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 7256 "sql.c"
+ case 340: /* cmd ::= CREATE TSMA not_exists_opt tsma_name ON full_table_name tsma_func_list INTERVAL NK_LP duration_literal NK_RP */
+{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-8].minor.yy437, &yymsp[-7].minor.yy479, yymsp[-4].minor.yy452, yymsp[-5].minor.yy452, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 340: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */
-#line 602 "sql.y"
-{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy705, &yymsp[-6].minor.yy649, NULL, yymsp[-4].minor.yy600, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 7261 "sql.c"
+ case 341: /* cmd ::= CREATE RECURSIVE TSMA not_exists_opt tsma_name ON full_table_name INTERVAL NK_LP duration_literal NK_RP */
+{ pCxt->pRootNode = createCreateTSMAStmt(pCxt, yymsp[-7].minor.yy437, &yymsp[-6].minor.yy479, NULL, yymsp[-4].minor.yy452, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 341: /* cmd ::= DROP TSMA exists_opt full_tsma_name */
-#line 603 "sql.y"
-{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy705, yymsp[0].minor.yy600); }
-#line 7266 "sql.c"
+ case 342: /* cmd ::= DROP TSMA exists_opt full_tsma_name */
+{ pCxt->pRootNode = createDropTSMAStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); }
break;
- case 342: /* cmd ::= SHOW db_name_cond_opt TSMAS */
-#line 604 "sql.y"
-{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy600); }
-#line 7271 "sql.c"
+ case 343: /* cmd ::= SHOW db_name_cond_opt TSMAS */
+{ pCxt->pRootNode = createShowTSMASStmt(pCxt, yymsp[-1].minor.yy452); }
break;
- case 345: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */
-#line 611 "sql.y"
-{ yymsp[-3].minor.yy600 = createTSMAOptions(pCxt, yymsp[-1].minor.yy748); }
-#line 7276 "sql.c"
+ case 346: /* tsma_func_list ::= FUNCTION NK_LP func_list NK_RP */
+{ yymsp[-3].minor.yy452 = createTSMAOptions(pCxt, yymsp[-1].minor.yy34); }
break;
- case 346: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */
-#line 615 "sql.y"
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy705, yymsp[-3].minor.yy600, yymsp[-1].minor.yy600, NULL, yymsp[0].minor.yy600); }
-#line 7281 "sql.c"
+ case 347: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy437, yymsp[-3].minor.yy452, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); }
break;
- case 347: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */
-#line 617 "sql.y"
-{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy705, yymsp[-5].minor.yy600, yymsp[-3].minor.yy600, yymsp[-1].minor.yy748, NULL); }
-#line 7286 "sql.c"
+ case 348: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */
+{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy437, yymsp[-5].minor.yy452, yymsp[-3].minor.yy452, yymsp[-1].minor.yy34, NULL); }
break;
- case 348: /* cmd ::= DROP INDEX exists_opt full_index_name */
-#line 618 "sql.y"
-{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy705, yymsp[0].minor.yy600); }
-#line 7291 "sql.c"
+ case 349: /* cmd ::= DROP INDEX exists_opt full_index_name */
+{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); }
break;
- case 349: /* full_index_name ::= index_name */
-#line 620 "sql.y"
-{ yylhsminor.yy600 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy649); }
-#line 7296 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 350: /* full_index_name ::= index_name */
+{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy479); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 350: /* full_index_name ::= db_name NK_DOT index_name */
-#line 621 "sql.y"
-{ yylhsminor.yy600 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649); }
-#line 7302 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 351: /* full_index_name ::= db_name NK_DOT index_name */
+{ yylhsminor.yy452 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 351: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
-#line 624 "sql.y"
-{ yymsp[-9].minor.yy600 = createIndexOption(pCxt, yymsp[-7].minor.yy748, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 7308 "sql.c"
+ case 352: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
+{ yymsp[-9].minor.yy452 = createIndexOption(pCxt, yymsp[-7].minor.yy34, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 352: /* 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 627 "sql.y"
-{ yymsp[-11].minor.yy600 = createIndexOption(pCxt, yymsp[-9].minor.yy748, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 7313 "sql.c"
+ case 353: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */
+{ yymsp[-11].minor.yy452 = createIndexOption(pCxt, yymsp[-9].minor.yy34, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 355: /* func ::= sma_func_name NK_LP expression_list NK_RP */
-#line 634 "sql.y"
-{ yylhsminor.yy600 = createFunctionNode(pCxt, &yymsp[-3].minor.yy649, yymsp[-1].minor.yy748); }
-#line 7318 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 356: /* func ::= sma_func_name NK_LP expression_list NK_RP */
+{ yylhsminor.yy452 = createFunctionNode(pCxt, &yymsp[-3].minor.yy479, yymsp[-1].minor.yy34); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 356: /* sma_func_name ::= function_name */
- case 630: /* alias_opt ::= table_alias */ yytestcase(yyruleno==630);
-#line 638 "sql.y"
-{ yylhsminor.yy649 = yymsp[0].minor.yy649; }
-#line 7325 "sql.c"
- yymsp[0].minor.yy649 = yylhsminor.yy649;
+ case 357: /* sma_func_name ::= function_name */
+ case 631: /* alias_opt ::= table_alias */ yytestcase(yyruleno==631);
+{ yylhsminor.yy479 = yymsp[0].minor.yy479; }
+ yymsp[0].minor.yy479 = yylhsminor.yy479;
break;
- case 361: /* sma_stream_opt ::= */
- case 411: /* stream_options ::= */ yytestcase(yyruleno==411);
-#line 644 "sql.y"
-{ yymsp[1].minor.yy600 = createStreamOptions(pCxt); }
-#line 7332 "sql.c"
+ case 362: /* sma_stream_opt ::= */
+ case 412: /* stream_options ::= */ yytestcase(yyruleno==412);
+{ yymsp[1].minor.yy452 = createStreamOptions(pCxt); }
break;
- case 362: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
-#line 645 "sql.y"
-{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; }
-#line 7337 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 363: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 363: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
-#line 646 "sql.y"
-{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; }
-#line 7343 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 364: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 364: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
-#line 647 "sql.y"
-{ ((SStreamOptions*)yymsp[-2].minor.yy600)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); yylhsminor.yy600 = yymsp[-2].minor.yy600; }
-#line 7349 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 365: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
+{ ((SStreamOptions*)yymsp[-2].minor.yy452)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); yylhsminor.yy452 = yymsp[-2].minor.yy452; }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 365: /* with_meta ::= AS */
-#line 652 "sql.y"
-{ yymsp[0].minor.yy756 = 0; }
-#line 7355 "sql.c"
+ case 366: /* with_meta ::= AS */
+{ yymsp[0].minor.yy100 = 0; }
break;
- case 366: /* with_meta ::= WITH META AS */
-#line 653 "sql.y"
-{ yymsp[-2].minor.yy756 = 1; }
-#line 7360 "sql.c"
+ case 367: /* with_meta ::= WITH META AS */
+{ yymsp[-2].minor.yy100 = 1; }
break;
- case 367: /* with_meta ::= ONLY META AS */
-#line 654 "sql.y"
-{ yymsp[-2].minor.yy756 = 2; }
-#line 7365 "sql.c"
+ case 368: /* with_meta ::= ONLY META AS */
+{ yymsp[-2].minor.yy100 = 2; }
break;
- case 368: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
-#line 656 "sql.y"
-{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy705, &yymsp[-2].minor.yy649, yymsp[0].minor.yy600); }
-#line 7370 "sql.c"
+ case 369: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
+{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy437, &yymsp[-2].minor.yy479, yymsp[0].minor.yy452); }
break;
- case 369: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */
-#line 658 "sql.y"
-{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy705, &yymsp[-3].minor.yy649, &yymsp[0].minor.yy649, yymsp[-2].minor.yy756); }
-#line 7375 "sql.c"
+ case 370: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */
+{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy437, &yymsp[-3].minor.yy479, &yymsp[0].minor.yy479, yymsp[-2].minor.yy100); }
break;
- case 370: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */
-#line 660 "sql.y"
-{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy705, &yymsp[-4].minor.yy649, yymsp[-1].minor.yy600, yymsp[-3].minor.yy756, yymsp[0].minor.yy600); }
-#line 7380 "sql.c"
+ case 371: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */
+{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy437, &yymsp[-4].minor.yy479, yymsp[-1].minor.yy452, yymsp[-3].minor.yy100, yymsp[0].minor.yy452); }
break;
- case 371: /* cmd ::= DROP TOPIC exists_opt topic_name */
-#line 662 "sql.y"
-{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 7385 "sql.c"
+ case 372: /* cmd ::= DROP TOPIC exists_opt topic_name */
+{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 372: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
-#line 663 "sql.y"
-{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy705, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649); }
-#line 7390 "sql.c"
+ case 373: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
+{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy437, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); }
break;
- case 373: /* cmd ::= DESC full_table_name */
- case 374: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==374);
-#line 666 "sql.y"
-{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy600); }
-#line 7396 "sql.c"
+ case 374: /* cmd ::= DESC full_table_name */
+ case 375: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==375);
+{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy452); }
break;
- case 375: /* cmd ::= RESET QUERY CACHE */
-#line 670 "sql.y"
+ case 376: /* cmd ::= RESET QUERY CACHE */
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
-#line 7401 "sql.c"
break;
- case 376: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
- case 377: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==377);
-#line 673 "sql.y"
-{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy705, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 7407 "sql.c"
+ case 377: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
+ case 378: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==378);
+{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy437, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 380: /* explain_options ::= */
-#line 681 "sql.y"
-{ yymsp[1].minor.yy600 = createDefaultExplainOptions(pCxt); }
-#line 7412 "sql.c"
+ case 381: /* explain_options ::= */
+{ yymsp[1].minor.yy452 = createDefaultExplainOptions(pCxt); }
break;
- case 381: /* explain_options ::= explain_options VERBOSE NK_BOOL */
-#line 682 "sql.y"
-{ yylhsminor.yy600 = setExplainVerbose(pCxt, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); }
-#line 7417 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 382: /* explain_options ::= explain_options VERBOSE NK_BOOL */
+{ yylhsminor.yy452 = setExplainVerbose(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 382: /* explain_options ::= explain_options RATIO NK_FLOAT */
-#line 683 "sql.y"
-{ yylhsminor.yy600 = setExplainRatio(pCxt, yymsp[-2].minor.yy600, &yymsp[0].minor.yy0); }
-#line 7423 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 383: /* explain_options ::= explain_options RATIO NK_FLOAT */
+{ yylhsminor.yy452 = setExplainRatio(pCxt, yymsp[-2].minor.yy452, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 383: /* 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 688 "sql.y"
-{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy705, yymsp[-9].minor.yy705, &yymsp[-6].minor.yy649, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy400, yymsp[-1].minor.yy756, &yymsp[0].minor.yy649, yymsp[-10].minor.yy705); }
-#line 7429 "sql.c"
+ case 384: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */
+{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy437, yymsp[-9].minor.yy437, &yymsp[-6].minor.yy479, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy874, yymsp[-1].minor.yy100, &yymsp[0].minor.yy479, yymsp[-10].minor.yy437); }
break;
- case 384: /* cmd ::= DROP FUNCTION exists_opt function_name */
-#line 689 "sql.y"
-{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 7434 "sql.c"
+ case 385: /* cmd ::= DROP FUNCTION exists_opt function_name */
+{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 389: /* language_opt ::= */
- case 434: /* on_vgroup_id ::= */ yytestcase(yyruleno==434);
-#line 703 "sql.y"
-{ yymsp[1].minor.yy649 = nil_token; }
-#line 7440 "sql.c"
+ case 390: /* language_opt ::= */
+ case 435: /* on_vgroup_id ::= */ yytestcase(yyruleno==435);
+{ yymsp[1].minor.yy479 = nil_token; }
break;
- case 390: /* language_opt ::= LANGUAGE NK_STRING */
- case 435: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==435);
-#line 704 "sql.y"
-{ yymsp[-1].minor.yy649 = yymsp[0].minor.yy0; }
-#line 7446 "sql.c"
+ case 391: /* language_opt ::= LANGUAGE NK_STRING */
+ case 436: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==436);
+{ yymsp[-1].minor.yy479 = yymsp[0].minor.yy0; }
break;
- case 393: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */
-#line 713 "sql.y"
-{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy705, yymsp[-2].minor.yy600, &yymsp[-1].minor.yy0, yymsp[0].minor.yy600); }
-#line 7451 "sql.c"
+ case 394: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */
+{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy437, yymsp[-2].minor.yy452, &yymsp[-1].minor.yy0, yymsp[0].minor.yy452); }
break;
- case 394: /* cmd ::= DROP VIEW exists_opt full_view_name */
-#line 714 "sql.y"
-{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy705, yymsp[0].minor.yy600); }
-#line 7456 "sql.c"
+ case 395: /* cmd ::= DROP VIEW exists_opt full_view_name */
+{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy437, yymsp[0].minor.yy452); }
break;
- case 395: /* full_view_name ::= view_name */
-#line 716 "sql.y"
-{ yylhsminor.yy600 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy649); }
-#line 7461 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 396: /* full_view_name ::= view_name */
+{ yylhsminor.yy452 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy479); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 396: /* full_view_name ::= db_name NK_DOT view_name */
-#line 717 "sql.y"
-{ yylhsminor.yy600 = createViewNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649); }
-#line 7467 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 397: /* full_view_name ::= db_name NK_DOT view_name */
+{ yylhsminor.yy452 = createViewNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 397: /* 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 722 "sql.y"
-{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy705, &yymsp[-8].minor.yy649, yymsp[-5].minor.yy600, yymsp[-7].minor.yy600, yymsp[-3].minor.yy748, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, yymsp[-4].minor.yy748); }
-#line 7473 "sql.c"
+ case 398: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */
+{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy437, &yymsp[-8].minor.yy479, yymsp[-5].minor.yy452, yymsp[-7].minor.yy452, yymsp[-3].minor.yy34, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, yymsp[-4].minor.yy34); }
break;
- case 398: /* cmd ::= DROP STREAM exists_opt stream_name */
-#line 723 "sql.y"
-{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 7478 "sql.c"
+ case 399: /* cmd ::= DROP STREAM exists_opt stream_name */
+{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 399: /* cmd ::= PAUSE STREAM exists_opt stream_name */
-#line 724 "sql.y"
-{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 7483 "sql.c"
+ case 400: /* cmd ::= PAUSE STREAM exists_opt stream_name */
+{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 400: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */
-#line 725 "sql.y"
-{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy705, yymsp[-1].minor.yy705, &yymsp[0].minor.yy649); }
-#line 7488 "sql.c"
+ case 401: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */
+{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy437, yymsp[-1].minor.yy437, &yymsp[0].minor.yy479); }
break;
- case 405: /* column_stream_def ::= column_name stream_col_options */
-#line 738 "sql.y"
-{ yylhsminor.yy600 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy649, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy600); }
-#line 7493 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 406: /* column_stream_def ::= column_name stream_col_options */
+{ yylhsminor.yy452 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy479, createDataType(TSDB_DATA_TYPE_NULL), yymsp[0].minor.yy452); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 406: /* stream_col_options ::= */
- case 743: /* column_options ::= */ yytestcase(yyruleno==743);
-#line 739 "sql.y"
-{ yymsp[1].minor.yy600 = createDefaultColumnOptions(pCxt); }
-#line 7500 "sql.c"
+ case 407: /* stream_col_options ::= */
+ case 744: /* column_options ::= */ yytestcase(yyruleno==744);
+{ yymsp[1].minor.yy452 = createDefaultColumnOptions(pCxt); }
break;
- case 407: /* stream_col_options ::= stream_col_options PRIMARY KEY */
- case 744: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==744);
-#line 740 "sql.y"
-{ yylhsminor.yy600 = setColumnOptions(pCxt, yymsp[-2].minor.yy600, COLUMN_OPTION_PRIMARYKEY, NULL); }
-#line 7506 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 408: /* stream_col_options ::= stream_col_options PRIMARY KEY */
+ case 745: /* column_options ::= column_options PRIMARY KEY */ yytestcase(yyruleno==745);
+{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_PRIMARYKEY, NULL); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 412: /* stream_options ::= stream_options TRIGGER AT_ONCE */
- case 413: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==413);
-#line 750 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-2].minor.yy600, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
-#line 7513 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 413: /* stream_options ::= stream_options TRIGGER AT_ONCE */
+ case 414: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==414);
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 414: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
-#line 752 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-3].minor.yy600, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 7519 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 415: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 415: /* stream_options ::= stream_options WATERMARK duration_literal */
-#line 753 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-2].minor.yy600, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 7525 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 416: /* stream_options ::= stream_options WATERMARK duration_literal */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 416: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
-#line 754 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-3].minor.yy600, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
-#line 7531 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 417: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 417: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
-#line 755 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-2].minor.yy600, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
-#line 7537 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 418: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 418: /* stream_options ::= stream_options DELETE_MARK duration_literal */
-#line 756 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-2].minor.yy600, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 7543 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 419: /* stream_options ::= stream_options DELETE_MARK duration_literal */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-2].minor.yy452, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 419: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
-#line 757 "sql.y"
-{ yylhsminor.yy600 = setStreamOptions(pCxt, yymsp[-3].minor.yy600, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
-#line 7549 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 420: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */
+{ yylhsminor.yy452 = setStreamOptions(pCxt, yymsp[-3].minor.yy452, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 421: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
- case 687: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==687);
- case 711: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==711);
-#line 760 "sql.y"
-{ yymsp[-3].minor.yy600 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy600); }
-#line 7557 "sql.c"
+ case 422: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
+ case 688: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==688);
+ case 712: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==712);
+{ yymsp[-3].minor.yy452 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy452); }
break;
- case 424: /* cmd ::= KILL CONNECTION NK_INTEGER */
-#line 768 "sql.y"
+ case 425: /* cmd ::= KILL CONNECTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
-#line 7562 "sql.c"
break;
- case 425: /* cmd ::= KILL QUERY NK_STRING */
-#line 769 "sql.y"
+ case 426: /* cmd ::= KILL QUERY NK_STRING */
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
-#line 7567 "sql.c"
break;
- case 426: /* cmd ::= KILL TRANSACTION NK_INTEGER */
-#line 770 "sql.y"
+ case 427: /* cmd ::= KILL TRANSACTION NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
-#line 7572 "sql.c"
break;
- case 427: /* cmd ::= KILL COMPACT NK_INTEGER */
-#line 771 "sql.y"
+ case 428: /* cmd ::= KILL COMPACT NK_INTEGER */
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); }
-#line 7577 "sql.c"
break;
- case 428: /* cmd ::= BALANCE VGROUP */
-#line 774 "sql.y"
+ case 429: /* cmd ::= BALANCE VGROUP */
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
-#line 7582 "sql.c"
break;
- case 429: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */
-#line 775 "sql.y"
-{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 7587 "sql.c"
+ case 430: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */
+{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 430: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */
-#line 776 "sql.y"
-{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy649); }
-#line 7592 "sql.c"
+ case 431: /* cmd ::= BALANCE VGROUP LEADER DATABASE db_name */
+{ pCxt->pRootNode = createBalanceVgroupLeaderDBNameStmt(pCxt, &yymsp[0].minor.yy479); }
break;
- case 431: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
-#line 777 "sql.y"
+ case 432: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
-#line 7597 "sql.c"
break;
- case 432: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
-#line 778 "sql.y"
-{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy748); }
-#line 7602 "sql.c"
+ case 433: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
+{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy34); }
break;
- case 433: /* cmd ::= SPLIT VGROUP NK_INTEGER */
-#line 779 "sql.y"
+ case 434: /* cmd ::= SPLIT VGROUP NK_INTEGER */
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
-#line 7607 "sql.c"
break;
- case 436: /* dnode_list ::= DNODE NK_INTEGER */
-#line 788 "sql.y"
-{ yymsp[-1].minor.yy748 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
-#line 7612 "sql.c"
+ case 437: /* dnode_list ::= DNODE NK_INTEGER */
+{ yymsp[-1].minor.yy34 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
break;
- case 438: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
-#line 795 "sql.y"
-{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 7617 "sql.c"
+ case 439: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
+{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 441: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
-#line 804 "sql.y"
-{ yymsp[-6].minor.yy600 = createInsertStmt(pCxt, yymsp[-4].minor.yy600, yymsp[-2].minor.yy748, yymsp[0].minor.yy600); }
-#line 7622 "sql.c"
+ case 442: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
+{ yymsp[-6].minor.yy452 = createInsertStmt(pCxt, yymsp[-4].minor.yy452, yymsp[-2].minor.yy34, yymsp[0].minor.yy452); }
break;
- case 442: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
-#line 805 "sql.y"
-{ yymsp[-3].minor.yy600 = createInsertStmt(pCxt, yymsp[-1].minor.yy600, NULL, yymsp[0].minor.yy600); }
-#line 7627 "sql.c"
+ case 443: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */
+{ yymsp[-3].minor.yy452 = createInsertStmt(pCxt, yymsp[-1].minor.yy452, NULL, yymsp[0].minor.yy452); }
break;
- case 443: /* tags_literal ::= NK_INTEGER */
- case 455: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==455);
- case 464: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==464);
-#line 808 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); }
-#line 7634 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 444: /* tags_literal ::= NK_INTEGER */
+ case 456: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==456);
+ case 465: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==465);
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 444: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */
- case 445: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==445);
- case 456: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==456);
- case 457: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==457);
- case 465: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==465);
- case 466: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==466);
- case 474: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==474);
- case 475: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==475);
-#line 809 "sql.y"
+ case 445: /* tags_literal ::= NK_INTEGER NK_PLUS duration_literal */
+ case 446: /* tags_literal ::= NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==446);
+ case 457: /* tags_literal ::= NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==457);
+ case 458: /* tags_literal ::= NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==458);
+ case 466: /* tags_literal ::= NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==466);
+ case 467: /* tags_literal ::= NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==467);
+ case 475: /* tags_literal ::= NK_STRING NK_PLUS duration_literal */ yytestcase(yyruleno==475);
+ case 476: /* tags_literal ::= NK_STRING NK_MINUS duration_literal */ yytestcase(yyruleno==476);
{
SToken l = yymsp[-2].minor.yy0;
- SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
+ SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
l.n = (r.z + r.n) - l.z;
- yylhsminor.yy600 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy600);
+ yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy452);
}
-#line 7652 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 446: /* tags_literal ::= NK_PLUS NK_INTEGER */
- case 449: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==449);
- case 458: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==458);
- case 461: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==461);
- case 467: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==467);
- case 470: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==470);
-#line 821 "sql.y"
+ case 447: /* tags_literal ::= NK_PLUS NK_INTEGER */
+ case 450: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==450);
+ case 459: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==459);
+ case 462: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==462);
+ case 468: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==468);
+ case 471: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==471);
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
+ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL);
}
-#line 7667 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 447: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */
- case 448: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==448);
- case 450: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==450);
- case 451: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==451);
- case 459: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==459);
- case 460: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==460);
- case 462: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==462);
- case 463: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==463);
- case 468: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==468);
- case 469: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==469);
- case 471: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==471);
- case 472: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==472);
-#line 826 "sql.y"
+ case 448: /* tags_literal ::= NK_PLUS NK_INTEGER NK_PLUS duration_literal */
+ case 449: /* tags_literal ::= NK_PLUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==449);
+ case 451: /* tags_literal ::= NK_MINUS NK_INTEGER NK_PLUS duration_literal */ yytestcase(yyruleno==451);
+ case 452: /* tags_literal ::= NK_MINUS NK_INTEGER NK_MINUS duration_literal */ yytestcase(yyruleno==452);
+ case 460: /* tags_literal ::= NK_PLUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==460);
+ case 461: /* tags_literal ::= NK_PLUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==461);
+ case 463: /* tags_literal ::= NK_MINUS NK_BIN NK_PLUS duration_literal */ yytestcase(yyruleno==463);
+ case 464: /* tags_literal ::= NK_MINUS NK_BIN NK_MINUS duration_literal */ yytestcase(yyruleno==464);
+ case 469: /* tags_literal ::= NK_PLUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==469);
+ case 470: /* tags_literal ::= NK_PLUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==470);
+ case 472: /* tags_literal ::= NK_MINUS NK_HEX NK_PLUS duration_literal */ yytestcase(yyruleno==472);
+ case 473: /* tags_literal ::= NK_MINUS NK_HEX NK_MINUS duration_literal */ yytestcase(yyruleno==473);
{
SToken l = yymsp[-3].minor.yy0;
- SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
+ SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
l.n = (r.z + r.n) - l.z;
- yylhsminor.yy600 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy600);
+ yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, NULL, yymsp[0].minor.yy452);
}
-#line 7689 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 452: /* tags_literal ::= NK_FLOAT */
-#line 855 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); }
-#line 7695 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 453: /* tags_literal ::= NK_FLOAT */
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 453: /* tags_literal ::= NK_PLUS NK_FLOAT */
- case 454: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==454);
-#line 856 "sql.y"
+ case 454: /* tags_literal ::= NK_PLUS NK_FLOAT */
+ case 455: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==455);
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL);
+ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL);
}
-#line 7706 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 473: /* tags_literal ::= NK_STRING */
-#line 962 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); }
-#line 7712 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 474: /* tags_literal ::= NK_STRING */
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 476: /* tags_literal ::= NK_BOOL */
-#line 975 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); }
-#line 7718 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 477: /* tags_literal ::= NK_BOOL */
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 477: /* tags_literal ::= NULL */
-#line 976 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); }
-#line 7724 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 478: /* tags_literal ::= NULL */
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 478: /* tags_literal ::= literal_func */
-#line 978 "sql.y"
-{ yylhsminor.yy600 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy600); }
-#line 7730 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 479: /* tags_literal ::= literal_func */
+{ yylhsminor.yy452 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy452); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 479: /* tags_literal ::= literal_func NK_PLUS duration_literal */
- case 480: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==480);
-#line 979 "sql.y"
+ case 480: /* tags_literal ::= literal_func NK_PLUS duration_literal */
+ case 481: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==481);
{
- SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
+ SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
l.n = (r.z + r.n) - l.z;
- yylhsminor.yy600 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy600, yymsp[0].minor.yy600);
+ yylhsminor.yy452 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy452, yymsp[0].minor.yy452);
}
-#line 7742 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 483: /* literal ::= NK_INTEGER */
-#line 998 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
-#line 7748 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 484: /* literal ::= NK_INTEGER */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 484: /* literal ::= NK_FLOAT */
-#line 999 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
-#line 7754 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 485: /* literal ::= NK_FLOAT */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 485: /* literal ::= NK_STRING */
-#line 1000 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
-#line 7760 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 486: /* literal ::= NK_STRING */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 486: /* literal ::= NK_BOOL */
-#line 1001 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
-#line 7766 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 487: /* literal ::= NK_BOOL */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 487: /* literal ::= TIMESTAMP NK_STRING */
-#line 1002 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
-#line 7772 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 488: /* literal ::= TIMESTAMP NK_STRING */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 488: /* literal ::= duration_literal */
- case 498: /* signed_literal ::= signed */ yytestcase(yyruleno==498);
- case 522: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==522);
- case 523: /* expression ::= literal */ yytestcase(yyruleno==523);
- case 525: /* expression ::= column_reference */ yytestcase(yyruleno==525);
- case 526: /* expression ::= function_expression */ yytestcase(yyruleno==526);
- case 527: /* expression ::= case_when_expression */ yytestcase(yyruleno==527);
- case 561: /* function_expression ::= literal_func */ yytestcase(yyruleno==561);
- case 611: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==611);
- case 615: /* boolean_primary ::= predicate */ yytestcase(yyruleno==615);
- case 617: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==617);
- case 618: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==618);
- case 621: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==621);
- case 623: /* table_reference ::= table_primary */ yytestcase(yyruleno==623);
- case 624: /* table_reference ::= joined_table */ yytestcase(yyruleno==624);
- case 628: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==628);
- case 713: /* query_simple ::= query_specification */ yytestcase(yyruleno==713);
- case 714: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==714);
- case 717: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==717);
- case 719: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==719);
-#line 1003 "sql.y"
-{ yylhsminor.yy600 = yymsp[0].minor.yy600; }
-#line 7797 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 489: /* literal ::= duration_literal */
+ case 499: /* signed_literal ::= signed */ yytestcase(yyruleno==499);
+ case 523: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==523);
+ case 524: /* expression ::= literal */ yytestcase(yyruleno==524);
+ case 526: /* expression ::= column_reference */ yytestcase(yyruleno==526);
+ case 527: /* expression ::= function_expression */ yytestcase(yyruleno==527);
+ case 528: /* expression ::= case_when_expression */ yytestcase(yyruleno==528);
+ case 562: /* function_expression ::= literal_func */ yytestcase(yyruleno==562);
+ case 612: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==612);
+ case 616: /* boolean_primary ::= predicate */ yytestcase(yyruleno==616);
+ case 618: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==618);
+ case 619: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==619);
+ case 622: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==622);
+ case 624: /* table_reference ::= table_primary */ yytestcase(yyruleno==624);
+ case 625: /* table_reference ::= joined_table */ yytestcase(yyruleno==625);
+ case 629: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==629);
+ case 714: /* query_simple ::= query_specification */ yytestcase(yyruleno==714);
+ case 715: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==715);
+ case 718: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==718);
+ case 720: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==720);
+{ yylhsminor.yy452 = yymsp[0].minor.yy452; }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 489: /* literal ::= NULL */
-#line 1004 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
-#line 7803 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 490: /* literal ::= NULL */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 490: /* literal ::= NK_QUESTION */
-#line 1005 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 7809 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 491: /* literal ::= NK_QUESTION */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 491: /* duration_literal ::= NK_VARIABLE */
- case 688: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==688);
- case 689: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==689);
- case 690: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==690);
-#line 1007 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 7818 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 492: /* duration_literal ::= NK_VARIABLE */
+ case 689: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==689);
+ case 690: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==690);
+ case 691: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==691);
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 492: /* signed ::= NK_INTEGER */
-#line 1009 "sql.y"
-{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
-#line 7824 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 493: /* signed ::= NK_INTEGER */
+{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 493: /* signed ::= NK_PLUS NK_INTEGER */
-#line 1010 "sql.y"
-{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
-#line 7830 "sql.c"
+ case 494: /* signed ::= NK_PLUS NK_INTEGER */
+{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
break;
- case 494: /* signed ::= NK_MINUS NK_INTEGER */
-#line 1011 "sql.y"
+ case 495: /* signed ::= NK_MINUS NK_INTEGER */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
+ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
}
-#line 7839 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 495: /* signed ::= NK_FLOAT */
-#line 1016 "sql.y"
-{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
-#line 7845 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 496: /* signed ::= NK_FLOAT */
+{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 496: /* signed ::= NK_PLUS NK_FLOAT */
-#line 1017 "sql.y"
-{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
-#line 7851 "sql.c"
+ case 497: /* signed ::= NK_PLUS NK_FLOAT */
+{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
break;
- case 497: /* signed ::= NK_MINUS NK_FLOAT */
-#line 1018 "sql.y"
+ case 498: /* signed ::= NK_MINUS NK_FLOAT */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
+ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
}
-#line 7860 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 499: /* signed_literal ::= NK_STRING */
-#line 1025 "sql.y"
-{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
-#line 7866 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 500: /* signed_literal ::= NK_STRING */
+{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 500: /* signed_literal ::= NK_BOOL */
-#line 1026 "sql.y"
-{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
-#line 7872 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 501: /* signed_literal ::= NK_BOOL */
+{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 501: /* signed_literal ::= TIMESTAMP NK_STRING */
-#line 1027 "sql.y"
-{ yymsp[-1].minor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
-#line 7878 "sql.c"
+ case 502: /* signed_literal ::= TIMESTAMP NK_STRING */
+{ yymsp[-1].minor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
break;
- case 502: /* signed_literal ::= duration_literal */
- case 504: /* signed_literal ::= literal_func */ yytestcase(yyruleno==504);
- case 582: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==582);
- case 665: /* select_item ::= common_expression */ yytestcase(yyruleno==665);
- case 675: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==675);
- case 718: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==718);
- case 720: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==720);
- case 733: /* search_condition ::= common_expression */ yytestcase(yyruleno==733);
-#line 1028 "sql.y"
-{ yylhsminor.yy600 = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); }
-#line 7890 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 503: /* signed_literal ::= duration_literal */
+ case 505: /* signed_literal ::= literal_func */ yytestcase(yyruleno==505);
+ case 583: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==583);
+ case 666: /* select_item ::= common_expression */ yytestcase(yyruleno==666);
+ case 676: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==676);
+ case 719: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==719);
+ case 721: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==721);
+ case 734: /* search_condition ::= common_expression */ yytestcase(yyruleno==734);
+{ yylhsminor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 503: /* signed_literal ::= NULL */
-#line 1029 "sql.y"
-{ yylhsminor.yy600 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
-#line 7896 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 504: /* signed_literal ::= NULL */
+{ yylhsminor.yy452 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 505: /* signed_literal ::= NK_QUESTION */
-#line 1031 "sql.y"
-{ yylhsminor.yy600 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
-#line 7902 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 506: /* signed_literal ::= NK_QUESTION */
+{ yylhsminor.yy452 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 524: /* expression ::= pseudo_column */
-#line 1097 "sql.y"
-{ yylhsminor.yy600 = yymsp[0].minor.yy600; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy600, true); }
-#line 7908 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 525: /* expression ::= pseudo_column */
+{ yylhsminor.yy452 = yymsp[0].minor.yy452; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy452, true); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 528: /* expression ::= NK_LP expression NK_RP */
- case 616: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==616);
- case 732: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==732);
-#line 1101 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 7916 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 529: /* expression ::= NK_LP expression NK_RP */
+ case 617: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==617);
+ case 733: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==733);
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 529: /* expression ::= NK_PLUS expr_or_subquery */
-#line 1102 "sql.y"
+ case 530: /* expression ::= NK_PLUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy600));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy452));
}
-#line 7925 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 530: /* expression ::= NK_MINUS expr_or_subquery */
-#line 1106 "sql.y"
+ case 531: /* expression ::= NK_MINUS expr_or_subquery */
{
- SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy600), NULL));
+ SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL));
}
-#line 7934 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 531: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
-#line 1110 "sql.y"
+ case 532: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 7944 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 532: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
-#line 1115 "sql.y"
+ case 533: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 7954 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 533: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
-#line 1120 "sql.y"
+ case 534: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 7964 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 534: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
-#line 1125 "sql.y"
+ case 535: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 7974 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 535: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
-#line 1130 "sql.y"
+ case 536: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 7984 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 536: /* expression ::= column_reference NK_ARROW NK_STRING */
-#line 1135 "sql.y"
+ case 537: /* expression ::= column_reference NK_ARROW NK_STRING */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)));
}
-#line 7993 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 537: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
-#line 1139 "sql.y"
+ case 538: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8003 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 538: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
-#line 1144 "sql.y"
+ case 539: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8013 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 541: /* column_reference ::= column_name */
-#line 1155 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy649, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy649)); }
-#line 8019 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 542: /* column_reference ::= column_name */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy479, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy479)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 542: /* column_reference ::= table_name NK_DOT column_name */
-#line 1156 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649, createColumnNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy649)); }
-#line 8025 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 543: /* column_reference ::= table_name NK_DOT column_name */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479, createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy479)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 543: /* column_reference ::= NK_ALIAS */
-#line 1157 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
-#line 8031 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 544: /* column_reference ::= NK_ALIAS */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 544: /* column_reference ::= table_name NK_DOT NK_ALIAS */
-#line 1158 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0)); }
-#line 8037 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 545: /* column_reference ::= table_name NK_DOT NK_ALIAS */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 545: /* pseudo_column ::= ROWTS */
- case 546: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==546);
- case 548: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==548);
- case 549: /* pseudo_column ::= QEND */ yytestcase(yyruleno==549);
- case 550: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==550);
- case 551: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==551);
- case 552: /* pseudo_column ::= WEND */ yytestcase(yyruleno==552);
- case 553: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==553);
- case 554: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==554);
- case 555: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==555);
- case 556: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==556);
- case 563: /* literal_func ::= NOW */ yytestcase(yyruleno==563);
- case 564: /* literal_func ::= TODAY */ yytestcase(yyruleno==564);
-#line 1160 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
-#line 8055 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 546: /* pseudo_column ::= ROWTS */
+ case 547: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==547);
+ case 549: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==549);
+ case 550: /* pseudo_column ::= QEND */ yytestcase(yyruleno==550);
+ case 551: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==551);
+ case 552: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==552);
+ case 553: /* pseudo_column ::= WEND */ yytestcase(yyruleno==553);
+ case 554: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==554);
+ case 555: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==555);
+ case 556: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==556);
+ case 557: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==557);
+ case 564: /* literal_func ::= NOW */ yytestcase(yyruleno==564);
+ case 565: /* literal_func ::= TODAY */ yytestcase(yyruleno==565);
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 547: /* pseudo_column ::= table_name NK_DOT TBNAME */
-#line 1162 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy649)))); }
-#line 8061 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 548: /* pseudo_column ::= table_name NK_DOT TBNAME */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy479)))); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 557: /* function_expression ::= function_name NK_LP expression_list NK_RP */
- case 558: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==558);
-#line 1173 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy649, yymsp[-1].minor.yy748)); }
-#line 8068 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 558: /* function_expression ::= function_name NK_LP expression_list NK_RP */
+ case 559: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==559);
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy479, yymsp[-1].minor.yy34)); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 559: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
- case 560: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==560);
-#line 1176 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy400)); }
-#line 8075 "sql.c"
- yymsp[-5].minor.yy600 = yylhsminor.yy600;
+ case 560: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
+ case 561: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name_default_len NK_RP */ yytestcase(yyruleno==561);
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy874)); }
+ yymsp[-5].minor.yy452 = yylhsminor.yy452;
break;
- case 562: /* literal_func ::= noarg_func NK_LP NK_RP */
-#line 1182 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy649, NULL)); }
-#line 8081 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 563: /* literal_func ::= noarg_func NK_LP NK_RP */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy479, NULL)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 578: /* star_func_para_list ::= NK_STAR */
-#line 1207 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
-#line 8087 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
+ case 579: /* star_func_para_list ::= NK_STAR */
+{ yylhsminor.yy34 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
break;
- case 583: /* star_func_para ::= table_name NK_DOT NK_STAR */
- case 668: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==668);
-#line 1216 "sql.y"
-{ yylhsminor.yy600 = createColumnNode(pCxt, &yymsp[-2].minor.yy649, &yymsp[0].minor.yy0); }
-#line 8094 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 584: /* star_func_para ::= table_name NK_DOT NK_STAR */
+ case 669: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==669);
+{ yylhsminor.yy452 = createColumnNode(pCxt, &yymsp[-2].minor.yy479, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 584: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
-#line 1219 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy748, yymsp[-1].minor.yy600)); }
-#line 8100 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 585: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy34, yymsp[-1].minor.yy452)); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 585: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
-#line 1221 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-2].minor.yy748, yymsp[-1].minor.yy600)); }
-#line 8106 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
+ case 586: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-2].minor.yy34, yymsp[-1].minor.yy452)); }
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
break;
- case 588: /* when_then_expr ::= WHEN common_expression THEN common_expression */
-#line 1228 "sql.y"
-{ yymsp[-3].minor.yy600 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)); }
-#line 8112 "sql.c"
+ case 589: /* when_then_expr ::= WHEN common_expression THEN common_expression */
+{ yymsp[-3].minor.yy452 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)); }
break;
- case 590: /* case_when_else_opt ::= ELSE common_expression */
-#line 1231 "sql.y"
-{ yymsp[-1].minor.yy600 = releaseRawExprNode(pCxt, yymsp[0].minor.yy600); }
-#line 8117 "sql.c"
+ case 591: /* case_when_else_opt ::= ELSE common_expression */
+{ yymsp[-1].minor.yy452 = releaseRawExprNode(pCxt, yymsp[0].minor.yy452); }
break;
- case 591: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
- case 596: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==596);
-#line 1234 "sql.y"
+ case 592: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
+ case 597: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==597);
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy292, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy440, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8127 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 592: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
-#line 1241 "sql.y"
+ case 593: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy600), releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8137 "sql.c"
- yymsp[-4].minor.yy600 = yylhsminor.yy600;
+ yymsp[-4].minor.yy452 = yylhsminor.yy452;
break;
- case 593: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
-#line 1247 "sql.y"
+ case 594: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8147 "sql.c"
- yymsp[-5].minor.yy600 = yylhsminor.yy600;
+ yymsp[-5].minor.yy452 = yylhsminor.yy452;
break;
- case 594: /* predicate ::= expr_or_subquery IS NULL */
-#line 1252 "sql.y"
+ case 595: /* predicate ::= expr_or_subquery IS NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), NULL));
}
-#line 8156 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 595: /* predicate ::= expr_or_subquery IS NOT NULL */
-#line 1256 "sql.y"
+ case 596: /* predicate ::= expr_or_subquery IS NOT NULL */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL));
}
-#line 8165 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 597: /* compare_op ::= NK_LT */
-#line 1268 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_LOWER_THAN; }
-#line 8171 "sql.c"
+ case 598: /* compare_op ::= NK_LT */
+{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_THAN; }
break;
- case 598: /* compare_op ::= NK_GT */
-#line 1269 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_GREATER_THAN; }
-#line 8176 "sql.c"
+ case 599: /* compare_op ::= NK_GT */
+{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_THAN; }
break;
- case 599: /* compare_op ::= NK_LE */
-#line 1270 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_LOWER_EQUAL; }
-#line 8181 "sql.c"
+ case 600: /* compare_op ::= NK_LE */
+{ yymsp[0].minor.yy440 = OP_TYPE_LOWER_EQUAL; }
break;
- case 600: /* compare_op ::= NK_GE */
-#line 1271 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_GREATER_EQUAL; }
-#line 8186 "sql.c"
+ case 601: /* compare_op ::= NK_GE */
+{ yymsp[0].minor.yy440 = OP_TYPE_GREATER_EQUAL; }
break;
- case 601: /* compare_op ::= NK_NE */
-#line 1272 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_NOT_EQUAL; }
-#line 8191 "sql.c"
+ case 602: /* compare_op ::= NK_NE */
+{ yymsp[0].minor.yy440 = OP_TYPE_NOT_EQUAL; }
break;
- case 602: /* compare_op ::= NK_EQ */
-#line 1273 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_EQUAL; }
-#line 8196 "sql.c"
+ case 603: /* compare_op ::= NK_EQ */
+{ yymsp[0].minor.yy440 = OP_TYPE_EQUAL; }
break;
- case 603: /* compare_op ::= LIKE */
-#line 1274 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_LIKE; }
-#line 8201 "sql.c"
+ case 604: /* compare_op ::= LIKE */
+{ yymsp[0].minor.yy440 = OP_TYPE_LIKE; }
break;
- case 604: /* compare_op ::= NOT LIKE */
-#line 1275 "sql.y"
-{ yymsp[-1].minor.yy292 = OP_TYPE_NOT_LIKE; }
-#line 8206 "sql.c"
+ case 605: /* compare_op ::= NOT LIKE */
+{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_LIKE; }
break;
- case 605: /* compare_op ::= MATCH */
-#line 1276 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_MATCH; }
-#line 8211 "sql.c"
+ case 606: /* compare_op ::= MATCH */
+{ yymsp[0].minor.yy440 = OP_TYPE_MATCH; }
break;
- case 606: /* compare_op ::= NMATCH */
-#line 1277 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_NMATCH; }
-#line 8216 "sql.c"
+ case 607: /* compare_op ::= NMATCH */
+{ yymsp[0].minor.yy440 = OP_TYPE_NMATCH; }
break;
- case 607: /* compare_op ::= CONTAINS */
-#line 1278 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_JSON_CONTAINS; }
-#line 8221 "sql.c"
+ case 608: /* compare_op ::= CONTAINS */
+{ yymsp[0].minor.yy440 = OP_TYPE_JSON_CONTAINS; }
break;
- case 608: /* in_op ::= IN */
-#line 1282 "sql.y"
-{ yymsp[0].minor.yy292 = OP_TYPE_IN; }
-#line 8226 "sql.c"
+ case 609: /* in_op ::= IN */
+{ yymsp[0].minor.yy440 = OP_TYPE_IN; }
break;
- case 609: /* in_op ::= NOT IN */
-#line 1283 "sql.y"
-{ yymsp[-1].minor.yy292 = OP_TYPE_NOT_IN; }
-#line 8231 "sql.c"
+ case 610: /* in_op ::= NOT IN */
+{ yymsp[-1].minor.yy440 = OP_TYPE_NOT_IN; }
break;
- case 610: /* in_predicate_value ::= NK_LP literal_list NK_RP */
-#line 1285 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy748)); }
-#line 8236 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 611: /* in_predicate_value ::= NK_LP literal_list NK_RP */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 612: /* boolean_value_expression ::= NOT boolean_primary */
-#line 1289 "sql.y"
+ case 613: /* boolean_value_expression ::= NOT boolean_primary */
{
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy600), NULL));
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy452), NULL));
}
-#line 8245 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 613: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
-#line 1294 "sql.y"
+ case 614: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8255 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 614: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
-#line 1300 "sql.y"
+ case 615: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
- SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy600);
- SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy600);
- yylhsminor.yy600 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), releaseRawExprNode(pCxt, yymsp[0].minor.yy600)));
+ SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy452);
+ SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy452);
+ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), releaseRawExprNode(pCxt, yymsp[0].minor.yy452)));
}
-#line 8265 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 622: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
-#line 1318 "sql.y"
-{ yylhsminor.yy600 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy600, yymsp[0].minor.yy600, NULL); }
-#line 8271 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 623: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
+{ yylhsminor.yy452 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy452, yymsp[0].minor.yy452, NULL); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 625: /* table_primary ::= table_name alias_opt */
-#line 1324 "sql.y"
-{ yylhsminor.yy600 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); }
-#line 8277 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 626: /* table_primary ::= table_name alias_opt */
+{ yylhsminor.yy452 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 626: /* table_primary ::= db_name NK_DOT table_name alias_opt */
-#line 1325 "sql.y"
-{ yylhsminor.yy600 = createRealTableNode(pCxt, &yymsp[-3].minor.yy649, &yymsp[-1].minor.yy649, &yymsp[0].minor.yy649); }
-#line 8283 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 627: /* table_primary ::= db_name NK_DOT table_name alias_opt */
+{ yylhsminor.yy452 = createRealTableNode(pCxt, &yymsp[-3].minor.yy479, &yymsp[-1].minor.yy479, &yymsp[0].minor.yy479); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 627: /* table_primary ::= subquery alias_opt */
-#line 1326 "sql.y"
-{ yylhsminor.yy600 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600), &yymsp[0].minor.yy649); }
-#line 8289 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 628: /* table_primary ::= subquery alias_opt */
+{ yylhsminor.yy452 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy479); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 629: /* alias_opt ::= */
-#line 1331 "sql.y"
-{ yymsp[1].minor.yy649 = nil_token; }
-#line 8295 "sql.c"
+ case 630: /* alias_opt ::= */
+{ yymsp[1].minor.yy479 = nil_token; }
break;
- case 631: /* alias_opt ::= AS table_alias */
-#line 1333 "sql.y"
-{ yymsp[-1].minor.yy649 = yymsp[0].minor.yy649; }
-#line 8300 "sql.c"
+ case 632: /* alias_opt ::= AS table_alias */
+{ yymsp[-1].minor.yy479 = yymsp[0].minor.yy479; }
break;
- case 632: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
- case 633: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==633);
-#line 1335 "sql.y"
-{ yymsp[-2].minor.yy600 = yymsp[-1].minor.yy600; }
-#line 8306 "sql.c"
+ case 633: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
+ case 634: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==634);
+{ yymsp[-2].minor.yy452 = yymsp[-1].minor.yy452; }
break;
- case 634: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */
-#line 1341 "sql.y"
+ case 635: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */
{
- yylhsminor.yy600 = createJoinTableNode(pCxt, yymsp[-6].minor.yy564, yymsp[-5].minor.yy758, yymsp[-7].minor.yy600, yymsp[-3].minor.yy600, yymsp[-2].minor.yy600);
- yylhsminor.yy600 = addWindowOffsetClause(pCxt, yylhsminor.yy600, yymsp[-1].minor.yy600);
- yylhsminor.yy600 = addJLimitClause(pCxt, yylhsminor.yy600, yymsp[0].minor.yy600);
+ yylhsminor.yy452 = createJoinTableNode(pCxt, yymsp[-6].minor.yy162, yymsp[-5].minor.yy444, yymsp[-7].minor.yy452, yymsp[-3].minor.yy452, yymsp[-2].minor.yy452);
+ yylhsminor.yy452 = addWindowOffsetClause(pCxt, yylhsminor.yy452, yymsp[-1].minor.yy452);
+ yylhsminor.yy452 = addJLimitClause(pCxt, yylhsminor.yy452, yymsp[0].minor.yy452);
}
-#line 8315 "sql.c"
- yymsp[-7].minor.yy600 = yylhsminor.yy600;
+ yymsp[-7].minor.yy452 = yylhsminor.yy452;
break;
- case 635: /* join_type ::= */
-#line 1349 "sql.y"
-{ yymsp[1].minor.yy564 = JOIN_TYPE_INNER; }
-#line 8321 "sql.c"
+ case 636: /* join_type ::= */
+{ yymsp[1].minor.yy162 = JOIN_TYPE_INNER; }
break;
- case 636: /* join_type ::= INNER */
-#line 1350 "sql.y"
-{ yymsp[0].minor.yy564 = JOIN_TYPE_INNER; }
-#line 8326 "sql.c"
+ case 637: /* join_type ::= INNER */
+{ yymsp[0].minor.yy162 = JOIN_TYPE_INNER; }
break;
- case 637: /* join_type ::= LEFT */
-#line 1351 "sql.y"
-{ yymsp[0].minor.yy564 = JOIN_TYPE_LEFT; }
-#line 8331 "sql.c"
+ case 638: /* join_type ::= LEFT */
+{ yymsp[0].minor.yy162 = JOIN_TYPE_LEFT; }
break;
- case 638: /* join_type ::= RIGHT */
-#line 1352 "sql.y"
-{ yymsp[0].minor.yy564 = JOIN_TYPE_RIGHT; }
-#line 8336 "sql.c"
+ case 639: /* join_type ::= RIGHT */
+{ yymsp[0].minor.yy162 = JOIN_TYPE_RIGHT; }
break;
- case 639: /* join_type ::= FULL */
-#line 1353 "sql.y"
-{ yymsp[0].minor.yy564 = JOIN_TYPE_FULL; }
-#line 8341 "sql.c"
+ case 640: /* join_type ::= FULL */
+{ yymsp[0].minor.yy162 = JOIN_TYPE_FULL; }
break;
- case 640: /* join_subtype ::= */
-#line 1357 "sql.y"
-{ yymsp[1].minor.yy758 = JOIN_STYPE_NONE; }
-#line 8346 "sql.c"
+ case 641: /* join_subtype ::= */
+{ yymsp[1].minor.yy444 = JOIN_STYPE_NONE; }
break;
- case 641: /* join_subtype ::= OUTER */
-#line 1358 "sql.y"
-{ yymsp[0].minor.yy758 = JOIN_STYPE_OUTER; }
-#line 8351 "sql.c"
+ case 642: /* join_subtype ::= OUTER */
+{ yymsp[0].minor.yy444 = JOIN_STYPE_OUTER; }
break;
- case 642: /* join_subtype ::= SEMI */
-#line 1359 "sql.y"
-{ yymsp[0].minor.yy758 = JOIN_STYPE_SEMI; }
-#line 8356 "sql.c"
+ case 643: /* join_subtype ::= SEMI */
+{ yymsp[0].minor.yy444 = JOIN_STYPE_SEMI; }
break;
- case 643: /* join_subtype ::= ANTI */
-#line 1360 "sql.y"
-{ yymsp[0].minor.yy758 = JOIN_STYPE_ANTI; }
-#line 8361 "sql.c"
+ case 644: /* join_subtype ::= ANTI */
+{ yymsp[0].minor.yy444 = JOIN_STYPE_ANTI; }
break;
- case 644: /* join_subtype ::= ASOF */
-#line 1361 "sql.y"
-{ yymsp[0].minor.yy758 = JOIN_STYPE_ASOF; }
-#line 8366 "sql.c"
+ case 645: /* join_subtype ::= ASOF */
+{ yymsp[0].minor.yy444 = JOIN_STYPE_ASOF; }
break;
- case 645: /* join_subtype ::= WINDOW */
-#line 1362 "sql.y"
-{ yymsp[0].minor.yy758 = JOIN_STYPE_WIN; }
-#line 8371 "sql.c"
+ case 646: /* join_subtype ::= WINDOW */
+{ yymsp[0].minor.yy444 = JOIN_STYPE_WIN; }
break;
- case 649: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */
-#line 1369 "sql.y"
-{ yymsp[-5].minor.yy600 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 8376 "sql.c"
+ case 650: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */
+{ yymsp[-5].minor.yy452 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 650: /* window_offset_literal ::= NK_VARIABLE */
-#line 1371 "sql.y"
-{ yylhsminor.yy600 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); }
-#line 8381 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 651: /* window_offset_literal ::= NK_VARIABLE */
+{ yylhsminor.yy452 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 651: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */
-#line 1372 "sql.y"
+ case 652: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */
{
SToken t = yymsp[-1].minor.yy0;
t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
- yylhsminor.yy600 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t));
+ yylhsminor.yy452 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t));
}
-#line 8391 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 653: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */
- case 724: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==724);
- case 728: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==728);
-#line 1379 "sql.y"
-{ yymsp[-1].minor.yy600 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
-#line 8399 "sql.c"
+ case 654: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */
+ case 725: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==725);
+ case 729: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==729);
+{ yymsp[-1].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
- case 654: /* 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 1385 "sql.y"
+ case 655: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
- yymsp[-13].minor.yy600 = createSelectStmt(pCxt, yymsp[-11].minor.yy705, yymsp[-9].minor.yy748, yymsp[-8].minor.yy600, yymsp[-12].minor.yy748);
- yymsp[-13].minor.yy600 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy600, yymsp[-10].minor.yy705);
- yymsp[-13].minor.yy600 = addWhereClause(pCxt, yymsp[-13].minor.yy600, yymsp[-7].minor.yy600);
- yymsp[-13].minor.yy600 = addPartitionByClause(pCxt, yymsp[-13].minor.yy600, yymsp[-6].minor.yy748);
- yymsp[-13].minor.yy600 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy600, yymsp[-2].minor.yy600);
- yymsp[-13].minor.yy600 = addGroupByClause(pCxt, yymsp[-13].minor.yy600, yymsp[-1].minor.yy748);
- yymsp[-13].minor.yy600 = addHavingClause(pCxt, yymsp[-13].minor.yy600, yymsp[0].minor.yy600);
- yymsp[-13].minor.yy600 = addRangeClause(pCxt, yymsp[-13].minor.yy600, yymsp[-5].minor.yy600);
- yymsp[-13].minor.yy600 = addEveryClause(pCxt, yymsp[-13].minor.yy600, yymsp[-4].minor.yy600);
- yymsp[-13].minor.yy600 = addFillClause(pCxt, yymsp[-13].minor.yy600, yymsp[-3].minor.yy600);
+ yymsp[-13].minor.yy452 = createSelectStmt(pCxt, yymsp[-11].minor.yy437, yymsp[-9].minor.yy34, yymsp[-8].minor.yy452, yymsp[-12].minor.yy34);
+ yymsp[-13].minor.yy452 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy452, yymsp[-10].minor.yy437);
+ yymsp[-13].minor.yy452 = addWhereClause(pCxt, yymsp[-13].minor.yy452, yymsp[-7].minor.yy452);
+ yymsp[-13].minor.yy452 = addPartitionByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-6].minor.yy34);
+ yymsp[-13].minor.yy452 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy452, yymsp[-2].minor.yy452);
+ yymsp[-13].minor.yy452 = addGroupByClause(pCxt, yymsp[-13].minor.yy452, yymsp[-1].minor.yy34);
+ yymsp[-13].minor.yy452 = addHavingClause(pCxt, yymsp[-13].minor.yy452, yymsp[0].minor.yy452);
+ yymsp[-13].minor.yy452 = addRangeClause(pCxt, yymsp[-13].minor.yy452, yymsp[-5].minor.yy452);
+ yymsp[-13].minor.yy452 = addEveryClause(pCxt, yymsp[-13].minor.yy452, yymsp[-4].minor.yy452);
+ yymsp[-13].minor.yy452 = addFillClause(pCxt, yymsp[-13].minor.yy452, yymsp[-3].minor.yy452);
}
-#line 8415 "sql.c"
break;
- case 655: /* hint_list ::= */
-#line 1400 "sql.y"
-{ yymsp[1].minor.yy748 = createHintNodeList(pCxt, NULL); }
-#line 8420 "sql.c"
+ case 656: /* hint_list ::= */
+{ yymsp[1].minor.yy34 = createHintNodeList(pCxt, NULL); }
break;
- case 656: /* hint_list ::= NK_HINT */
-#line 1401 "sql.y"
-{ yylhsminor.yy748 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); }
-#line 8425 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
+ case 657: /* hint_list ::= NK_HINT */
+{ yylhsminor.yy34 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
break;
- case 661: /* set_quantifier_opt ::= ALL */
-#line 1412 "sql.y"
-{ yymsp[0].minor.yy705 = false; }
-#line 8431 "sql.c"
+ case 662: /* set_quantifier_opt ::= ALL */
+{ yymsp[0].minor.yy437 = false; }
break;
- case 664: /* select_item ::= NK_STAR */
-#line 1419 "sql.y"
-{ yylhsminor.yy600 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
-#line 8436 "sql.c"
- yymsp[0].minor.yy600 = yylhsminor.yy600;
+ case 665: /* select_item ::= NK_STAR */
+{ yylhsminor.yy452 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
+ yymsp[0].minor.yy452 = yylhsminor.yy452;
break;
- case 666: /* select_item ::= common_expression column_alias */
- case 676: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==676);
-#line 1421 "sql.y"
-{ yylhsminor.yy600 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600), &yymsp[0].minor.yy649); }
-#line 8443 "sql.c"
- yymsp[-1].minor.yy600 = yylhsminor.yy600;
+ case 667: /* select_item ::= common_expression column_alias */
+ case 677: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==677);
+{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452), &yymsp[0].minor.yy479); }
+ yymsp[-1].minor.yy452 = yylhsminor.yy452;
break;
- case 667: /* select_item ::= common_expression AS column_alias */
- case 677: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==677);
-#line 1422 "sql.y"
-{ yylhsminor.yy600 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), &yymsp[0].minor.yy649); }
-#line 8450 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 668: /* select_item ::= common_expression AS column_alias */
+ case 678: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==678);
+{ yylhsminor.yy452 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), &yymsp[0].minor.yy479); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 672: /* partition_by_clause_opt ::= PARTITION BY partition_list */
- case 702: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==702);
- case 722: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==722);
-#line 1431 "sql.y"
-{ yymsp[-2].minor.yy748 = yymsp[0].minor.yy748; }
-#line 8458 "sql.c"
+ case 673: /* partition_by_clause_opt ::= PARTITION BY partition_list */
+ case 703: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==703);
+ case 723: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==723);
+{ yymsp[-2].minor.yy34 = yymsp[0].minor.yy34; }
break;
- case 679: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */
-#line 1444 "sql.y"
-{ yymsp[-5].minor.yy600 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 8463 "sql.c"
+ case 680: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */
+{ yymsp[-5].minor.yy452 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 680: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
-#line 1445 "sql.y"
-{ yymsp[-3].minor.yy600 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 8468 "sql.c"
+ case 681: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
+{ yymsp[-3].minor.yy452 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 681: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
-#line 1447 "sql.y"
-{ yymsp[-5].minor.yy600 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), NULL, yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 8473 "sql.c"
+ case 682: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-5].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), NULL, yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 682: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
-#line 1451 "sql.y"
-{ yymsp[-7].minor.yy600 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy600), releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), yymsp[-1].minor.yy600, yymsp[0].minor.yy600); }
-#line 8478 "sql.c"
+ case 683: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */
+{ yymsp[-7].minor.yy452 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy452), releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), yymsp[-1].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 683: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
-#line 1453 "sql.y"
-{ yymsp[-6].minor.yy600 = createEventWindowNode(pCxt, yymsp[-3].minor.yy600, yymsp[0].minor.yy600); }
-#line 8483 "sql.c"
+ case 684: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */
+{ yymsp[-6].minor.yy452 = createEventWindowNode(pCxt, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); }
break;
- case 684: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */
-#line 1455 "sql.y"
-{ yymsp[-3].minor.yy600 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); }
-#line 8488 "sql.c"
+ case 685: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */
+{ yymsp[-3].minor.yy452 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); }
break;
- case 685: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
-#line 1457 "sql.y"
-{ yymsp[-5].minor.yy600 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); }
-#line 8493 "sql.c"
+ case 686: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
+{ yymsp[-5].minor.yy452 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); }
break;
- case 692: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
-#line 1467 "sql.y"
-{ yymsp[-3].minor.yy600 = createFillNode(pCxt, yymsp[-1].minor.yy6, NULL); }
-#line 8498 "sql.c"
+ case 693: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
+{ yymsp[-3].minor.yy452 = createFillNode(pCxt, yymsp[-1].minor.yy984, NULL); }
break;
- case 693: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */
-#line 1468 "sql.y"
-{ yymsp[-5].minor.yy600 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy748)); }
-#line 8503 "sql.c"
+ case 694: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */
+{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); }
break;
- case 694: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */
-#line 1469 "sql.y"
-{ yymsp[-5].minor.yy600 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy748)); }
-#line 8508 "sql.c"
+ case 695: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */
+{ yymsp[-5].minor.yy452 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy34)); }
break;
- case 695: /* fill_mode ::= NONE */
-#line 1473 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_NONE; }
-#line 8513 "sql.c"
+ case 696: /* fill_mode ::= NONE */
+{ yymsp[0].minor.yy984 = FILL_MODE_NONE; }
break;
- case 696: /* fill_mode ::= PREV */
-#line 1474 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_PREV; }
-#line 8518 "sql.c"
+ case 697: /* fill_mode ::= PREV */
+{ yymsp[0].minor.yy984 = FILL_MODE_PREV; }
break;
- case 697: /* fill_mode ::= NULL */
-#line 1475 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_NULL; }
-#line 8523 "sql.c"
+ case 698: /* fill_mode ::= NULL */
+{ yymsp[0].minor.yy984 = FILL_MODE_NULL; }
break;
- case 698: /* fill_mode ::= NULL_F */
-#line 1476 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_NULL_F; }
-#line 8528 "sql.c"
+ case 699: /* fill_mode ::= NULL_F */
+{ yymsp[0].minor.yy984 = FILL_MODE_NULL_F; }
break;
- case 699: /* fill_mode ::= LINEAR */
-#line 1477 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_LINEAR; }
-#line 8533 "sql.c"
+ case 700: /* fill_mode ::= LINEAR */
+{ yymsp[0].minor.yy984 = FILL_MODE_LINEAR; }
break;
- case 700: /* fill_mode ::= NEXT */
-#line 1478 "sql.y"
-{ yymsp[0].minor.yy6 = FILL_MODE_NEXT; }
-#line 8538 "sql.c"
+ case 701: /* fill_mode ::= NEXT */
+{ yymsp[0].minor.yy984 = FILL_MODE_NEXT; }
break;
- case 703: /* group_by_list ::= expr_or_subquery */
-#line 1487 "sql.y"
-{ yylhsminor.yy748 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); }
-#line 8543 "sql.c"
- yymsp[0].minor.yy748 = yylhsminor.yy748;
+ case 704: /* group_by_list ::= expr_or_subquery */
+{ yylhsminor.yy34 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); }
+ yymsp[0].minor.yy34 = yylhsminor.yy34;
break;
- case 704: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
-#line 1488 "sql.y"
-{ yylhsminor.yy748 = addNodeToList(pCxt, yymsp[-2].minor.yy748, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy600))); }
-#line 8549 "sql.c"
- yymsp[-2].minor.yy748 = yylhsminor.yy748;
+ case 705: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
+{ yylhsminor.yy34 = addNodeToList(pCxt, yymsp[-2].minor.yy34, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy452))); }
+ yymsp[-2].minor.yy34 = yylhsminor.yy34;
break;
- case 708: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
-#line 1495 "sql.y"
-{ yymsp[-5].minor.yy600 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy600), releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 8555 "sql.c"
+ case 709: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
+{ yymsp[-5].minor.yy452 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy452), releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 709: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */
-#line 1497 "sql.y"
-{ yymsp[-3].minor.yy600 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy600)); }
-#line 8560 "sql.c"
+ case 710: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */
+{ yymsp[-3].minor.yy452 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy452)); }
break;
- case 712: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
-#line 1504 "sql.y"
+ case 713: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
- yylhsminor.yy600 = addOrderByClause(pCxt, yymsp[-3].minor.yy600, yymsp[-2].minor.yy748);
- yylhsminor.yy600 = addSlimitClause(pCxt, yylhsminor.yy600, yymsp[-1].minor.yy600);
- yylhsminor.yy600 = addLimitClause(pCxt, yylhsminor.yy600, yymsp[0].minor.yy600);
+ yylhsminor.yy452 = addOrderByClause(pCxt, yymsp[-3].minor.yy452, yymsp[-2].minor.yy34);
+ yylhsminor.yy452 = addSlimitClause(pCxt, yylhsminor.yy452, yymsp[-1].minor.yy452);
+ yylhsminor.yy452 = addLimitClause(pCxt, yylhsminor.yy452, yymsp[0].minor.yy452);
}
-#line 8569 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 715: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
-#line 1514 "sql.y"
-{ yylhsminor.yy600 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy600, yymsp[0].minor.yy600); }
-#line 8575 "sql.c"
- yymsp[-3].minor.yy600 = yylhsminor.yy600;
+ case 716: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
+{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy452, yymsp[0].minor.yy452); }
+ yymsp[-3].minor.yy452 = yylhsminor.yy452;
break;
- case 716: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
-#line 1516 "sql.y"
-{ yylhsminor.yy600 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy600, yymsp[0].minor.yy600); }
-#line 8581 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 717: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
+{ yylhsminor.yy452 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy452, yymsp[0].minor.yy452); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 725: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
- case 729: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==729);
-#line 1531 "sql.y"
-{ yymsp[-3].minor.yy600 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
-#line 8588 "sql.c"
+ case 726: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
+ case 730: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==730);
+{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
- case 726: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
- case 730: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==730);
-#line 1532 "sql.y"
-{ yymsp[-3].minor.yy600 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
-#line 8594 "sql.c"
+ case 727: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
+ case 731: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==731);
+{ yymsp[-3].minor.yy452 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
- case 731: /* subquery ::= NK_LP query_expression NK_RP */
-#line 1540 "sql.y"
-{ yylhsminor.yy600 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy600); }
-#line 8599 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 732: /* subquery ::= NK_LP query_expression NK_RP */
+{ yylhsminor.yy452 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy452); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 736: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
-#line 1554 "sql.y"
-{ yylhsminor.yy600 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy600), yymsp[-1].minor.yy1010, yymsp[0].minor.yy273); }
-#line 8605 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 737: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
+{ yylhsminor.yy452 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy452), yymsp[-1].minor.yy548, yymsp[0].minor.yy817); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 737: /* ordering_specification_opt ::= */
-#line 1558 "sql.y"
-{ yymsp[1].minor.yy1010 = ORDER_ASC; }
-#line 8611 "sql.c"
+ case 738: /* ordering_specification_opt ::= */
+{ yymsp[1].minor.yy548 = ORDER_ASC; }
break;
- case 738: /* ordering_specification_opt ::= ASC */
-#line 1559 "sql.y"
-{ yymsp[0].minor.yy1010 = ORDER_ASC; }
-#line 8616 "sql.c"
+ case 739: /* ordering_specification_opt ::= ASC */
+{ yymsp[0].minor.yy548 = ORDER_ASC; }
break;
- case 739: /* ordering_specification_opt ::= DESC */
-#line 1560 "sql.y"
-{ yymsp[0].minor.yy1010 = ORDER_DESC; }
-#line 8621 "sql.c"
+ case 740: /* ordering_specification_opt ::= DESC */
+{ yymsp[0].minor.yy548 = ORDER_DESC; }
break;
- case 740: /* null_ordering_opt ::= */
-#line 1564 "sql.y"
-{ yymsp[1].minor.yy273 = NULL_ORDER_DEFAULT; }
-#line 8626 "sql.c"
+ case 741: /* null_ordering_opt ::= */
+{ yymsp[1].minor.yy817 = NULL_ORDER_DEFAULT; }
break;
- case 741: /* null_ordering_opt ::= NULLS FIRST */
-#line 1565 "sql.y"
-{ yymsp[-1].minor.yy273 = NULL_ORDER_FIRST; }
-#line 8631 "sql.c"
+ case 742: /* null_ordering_opt ::= NULLS FIRST */
+{ yymsp[-1].minor.yy817 = NULL_ORDER_FIRST; }
break;
- case 742: /* null_ordering_opt ::= NULLS LAST */
-#line 1566 "sql.y"
-{ yymsp[-1].minor.yy273 = NULL_ORDER_LAST; }
-#line 8636 "sql.c"
+ case 743: /* null_ordering_opt ::= NULLS LAST */
+{ yymsp[-1].minor.yy817 = NULL_ORDER_LAST; }
break;
- case 745: /* column_options ::= column_options ENCODE NK_STRING */
-#line 1574 "sql.y"
-{ yylhsminor.yy600 = setColumnOptions(pCxt, yymsp[-2].minor.yy600, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); }
-#line 8641 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 746: /* column_options ::= column_options ENCODE NK_STRING */
+{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_ENCODE, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 746: /* column_options ::= column_options COMPRESS NK_STRING */
-#line 1575 "sql.y"
-{ yylhsminor.yy600 = setColumnOptions(pCxt, yymsp[-2].minor.yy600, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); }
-#line 8647 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 747: /* column_options ::= column_options COMPRESS NK_STRING */
+{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_COMPRESS, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
- case 747: /* column_options ::= column_options LEVEL NK_STRING */
-#line 1576 "sql.y"
-{ yylhsminor.yy600 = setColumnOptions(pCxt, yymsp[-2].minor.yy600, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); }
-#line 8653 "sql.c"
- yymsp[-2].minor.yy600 = yylhsminor.yy600;
+ case 748: /* column_options ::= column_options LEVEL NK_STRING */
+{ yylhsminor.yy452 = setColumnOptions(pCxt, yymsp[-2].minor.yy452, COLUMN_OPTION_LEVEL, &yymsp[0].minor.yy0); }
+ yymsp[-2].minor.yy452 = yylhsminor.yy452;
break;
default:
break;
@@ -8713,7 +7373,6 @@ static void yy_syntax_error(
ParseCTX_FETCH
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
-#line 29 "sql.y"
if (TSDB_CODE_SUCCESS == pCxt->errCode) {
if(TOKEN.z) {
@@ -8724,7 +7383,6 @@ 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 8727 "sql.c"
/************ End %syntax_error code ******************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
@@ -8810,56 +7468,12 @@ void Parse(
}
#endif
- while(1){ /* Exit by "break" */
- assert( yypParser->yytos>=yypParser->yystack );
+ do{
assert( yyact==yypParser->yytos->stateno );
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){
- unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
-#ifndef NDEBUG
- assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
- if( yyTraceFILE ){
- int yysize = yyRuleInfoNRhs[yyruleno];
- if( yysize ){
- fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
- yyTracePrompt,
- yyruleno, yyRuleName[yyruleno],
- yyrulenoyytos[yysize].stateno);
- }else{
- fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
- yyTracePrompt, yyruleno, yyRuleName[yyruleno],
- yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){
- yypParser->yyhwm++;
- assert( yypParser->yyhwm ==
- (int)(yypParser->yytos - yypParser->yystack));
- }
-#endif
-#if YYSTACKDEPTH>0
- if( yypParser->yytos>=yypParser->yystackEnd ){
- yyStackOverflow(yypParser);
- break;
- }
-#else
- if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
- if( yyGrowStack(yypParser) ){
- yyStackOverflow(yypParser);
- break;
- }
- }
-#endif
- }
- yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM);
+ yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
+ yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
@@ -8915,13 +7529,14 @@ void Parse(
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
- while( yypParser->yytos > yypParser->yystack ){
- yyact = yy_find_reduce_action(yypParser->yytos->stateno,
- YYERRORSYMBOL);
- if( yyact<=YY_MAX_SHIFTREDUCE ) break;
+ while( yypParser->yytos >= yypParser->yystack
+ && (yyact = yy_find_reduce_action(
+ yypParser->yytos->stateno,
+ YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
+ ){
yy_pop_parser_stack(yypParser);
}
- if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
+ if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
@@ -8971,7 +7586,7 @@ void Parse(
break;
#endif
}
- }
+ }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c
index b271c83678..b00767b6b6 100644
--- a/source/libs/planner/src/planOptimizer.c
+++ b/source/libs/planner/src/planOptimizer.c
@@ -3011,7 +3011,9 @@ static SNode* partTagsCreateWrapperFunc(const char* pFuncName, SNode* pNode) {
}
snprintf(pFunc->functionName, sizeof(pFunc->functionName), "%s", pFuncName);
- if (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME != ((SColumnNode*)pNode)->colType) {
+ if ((QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME != ((SColumnNode*)pNode)->colType) ||
+ (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType &&
+ ((SColumnNode*)pNode)->tableAlias[0] != '\0')){
SColumnNode* pCol = (SColumnNode*)pNode;
partTagsSetAlias(pFunc->node.aliasName, pCol->tableAlias, pCol->colName);
} else {
diff --git a/source/libs/qworker/inc/qwInt.h b/source/libs/qworker/inc/qwInt.h
index b4bd1943c5..2222f9cb31 100644
--- a/source/libs/qworker/inc/qwInt.h
+++ b/source/libs/qworker/inc/qwInt.h
@@ -35,7 +35,7 @@ extern "C" {
#define QW_DEFAULT_SHORT_RUN_TIMES 2
#define QW_DEFAULT_HEARTBEAT_MSEC 5000
#define QW_SCH_TIMEOUT_MSEC 180000
-#define QW_MIN_RES_ROWS 4096
+#define QW_MIN_RES_ROWS 16384
enum {
QW_PHASE_PRE_QUERY = 1,
diff --git a/source/libs/qworker/inc/qwMsg.h b/source/libs/qworker/inc/qwMsg.h
index ae68f69802..6d57a3df46 100644
--- a/source/libs/qworker/inc/qwMsg.h
+++ b/source/libs/qworker/inc/qwMsg.h
@@ -38,7 +38,7 @@ int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code);
int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code);
int32_t qwBuildAndSendFetchRsp(int32_t rspType, SRpcHandleInfo *pConn, SRetrieveTableRsp *pRsp, int32_t dataLength,
int32_t code);
-void qwBuildFetchRsp(void *msg, SOutputData *input, int32_t len, bool qComplete);
+void qwBuildFetchRsp(void *msg, SOutputData *input, int32_t len, int32_t rawDataLen, bool qComplete);
int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn);
int32_t qwBuildAndSendQueryRsp(int32_t rspType, SRpcHandleInfo *pConn, int32_t code, SQWTaskCtx *ctx);
int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SArray *pExecList);
diff --git a/source/libs/qworker/src/qwMsg.c b/source/libs/qworker/src/qwMsg.c
index 11e9350e14..d30b100147 100644
--- a/source/libs/qworker/src/qwMsg.c
+++ b/source/libs/qworker/src/qwMsg.c
@@ -29,13 +29,14 @@ int32_t qwMallocFetchRsp(int8_t rpcMalloc, int32_t length, SRetrieveTableRsp **r
return TSDB_CODE_SUCCESS;
}
-void qwBuildFetchRsp(void *msg, SOutputData *input, int32_t len, bool qComplete) {
+void qwBuildFetchRsp(void *msg, SOutputData *input, int32_t len, int32_t rawDataLen, bool qComplete) {
SRetrieveTableRsp *rsp = (SRetrieveTableRsp *)msg;
rsp->useconds = htobe64(input->useconds);
rsp->completed = qComplete;
rsp->precision = input->precision;
rsp->compressed = input->compressed;
+ rsp->payloadLen = htonl(rawDataLen);
rsp->compLen = htonl(len);
rsp->numOfRows = htobe64(input->numOfRows);
rsp->numOfCols = htonl(input->numOfCols);
@@ -154,6 +155,7 @@ int32_t qwBuildAndSendFetchRsp(int32_t rspType, SRpcHandleInfo *pConn, SRetrieve
.info = *pConn,
};
+ rpcRsp.info.compressed = pRsp->compressed;
tmsgSendRsp(&rpcRsp);
return TSDB_CODE_SUCCESS;
@@ -452,13 +454,15 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, int
qwMsg.msgInfo.explain = msg.explain;
qwMsg.msgInfo.taskType = msg.taskType;
qwMsg.msgInfo.needFetch = msg.needFetch;
+ qwMsg.msgInfo.compressMsg = msg.compress;
+
+ QW_SCH_TASK_DLOG("processQuery start, node:%p, type:%s, compress:%d, handle:%p, SQL:%s", node, TMSG_INFO(pMsg->msgType),
+ msg.compress, pMsg->info.handle, msg.sql);
- QW_SCH_TASK_DLOG("processQuery start, node:%p, type:%s, handle:%p, SQL:%s", node, TMSG_INFO(pMsg->msgType),
- pMsg->info.handle, msg.sql);
code = qwProcessQuery(QW_FPARAMS(), &qwMsg, msg.sql);
msg.sql = NULL;
- QW_SCH_TASK_DLOG("processQuery end, node:%p, code:%x", node, code);
+ QW_SCH_TASK_DLOG("processQuery end, node:%p, code:%x", node, code);
tFreeSSubQueryMsg(&msg);
return TSDB_CODE_SUCCESS;
diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c
index 594bb205d8..c181997ad2 100644
--- a/source/libs/qworker/src/qworker.c
+++ b/source/libs/qworker/src/qworker.c
@@ -102,7 +102,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
}
if (!ctx->needFetch) {
- dsGetDataLength(ctx->sinkHandle, &ctx->affectedRows, NULL);
+ dsGetDataLength(ctx->sinkHandle, &ctx->affectedRows, NULL, NULL);
}
}
@@ -285,9 +285,11 @@ int32_t qwGenerateSchHbRsp(SQWorker *mgmt, SQWSchStatus *sch, SQWHbInfo *hbInfo)
return TSDB_CODE_SUCCESS;
}
-int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, void **rspMsg, SOutputData *pOutput) {
+int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen, int32_t *pRawDataLen, void **rspMsg,
+ SOutputData *pOutput) {
int64_t len = 0;
- SRetrieveTableRsp *rsp = NULL;
+ int64_t rawLen = 0;
+ SRetrieveTableRsp *pRsp = NULL;
bool queryEnd = false;
int32_t code = 0;
SOutputData output = {0};
@@ -298,9 +300,10 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen,
}
*dataLen = 0;
+ *pRawDataLen = 0;
while (true) {
- dsGetDataLength(ctx->sinkHandle, &len, &queryEnd);
+ dsGetDataLength(ctx->sinkHandle, &len, &rawLen, &queryEnd);
if (len < 0) {
QW_TASK_ELOG("invalid length from dsGetDataLength, length:%" PRId64 "", len);
@@ -322,31 +325,36 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen,
qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_SUCC, ctx->dynamicTask);
}
- if (NULL == rsp) {
- QW_ERR_RET(qwMallocFetchRsp(!ctx->localExec, len, &rsp));
+ if (NULL == pRsp) {
+ QW_ERR_RET(qwMallocFetchRsp(!ctx->localExec, len, &pRsp));
*pOutput = output;
} else {
pOutput->queryEnd = output.queryEnd;
pOutput->bufStatus = output.bufStatus;
pOutput->useconds = output.useconds;
}
-
break;
}
pOutput->bufStatus = DS_BUF_EMPTY;
-
break;
}
// Got data from sink
QW_TASK_DLOG("there are data in sink, dataLength:%" PRId64 "", len);
- *dataLen += len;
+ *dataLen += len + PAYLOAD_PREFIX_LEN;
+ *pRawDataLen += rawLen + PAYLOAD_PREFIX_LEN;
- QW_ERR_RET(qwMallocFetchRsp(!ctx->localExec, *dataLen, &rsp));
+ QW_ERR_RET(qwMallocFetchRsp(!ctx->localExec, *dataLen, &pRsp));
+
+ // set the serialize start position
+ output.pData = pRsp->data + *dataLen - (len + PAYLOAD_PREFIX_LEN);
+
+ ((int32_t*) output.pData)[0] = len;
+ ((int32_t*) output.pData)[1] = rawLen;
+ output.pData += sizeof(int32_t) * 2;
- output.pData = rsp->data + *dataLen - len;
code = dsGetDataBlock(ctx->sinkHandle, &output);
if (code) {
QW_TASK_ELOG("dsGetDataBlock failed, code:%x - %s", code, tstrerror(code));
@@ -357,7 +365,11 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen,
pOutput->precision = output.precision;
pOutput->bufStatus = output.bufStatus;
pOutput->useconds = output.useconds;
- pOutput->compressed = output.compressed;
+
+ if (output.compressed) {
+ pOutput->compressed = output.compressed;
+ }
+
pOutput->numOfCols = output.numOfCols;
pOutput->numOfRows += output.numOfRows;
pOutput->numOfBlocks++;
@@ -382,18 +394,18 @@ int32_t qwGetQueryResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, int32_t *dataLen,
}
}
- *rspMsg = rsp;
-
+ *rspMsg = pRsp;
return TSDB_CODE_SUCCESS;
}
int32_t qwGetDeleteResFromSink(QW_FPARAMS_DEF, SQWTaskCtx *ctx, SDeleteRes *pRes) {
int64_t len = 0;
+ int64_t rawLen = 0;
bool queryEnd = false;
int32_t code = 0;
SOutputData output = {0};
- dsGetDataLength(ctx->sinkHandle, &len, &queryEnd);
+ dsGetDataLength(ctx->sinkHandle, &len, &rawLen, &queryEnd);
if (len <= 0 || len != sizeof(SDeleterRes)) {
QW_TASK_ELOG("invalid length from dsGetDataLength, length:%" PRId64, len);
@@ -433,9 +445,10 @@ int32_t qwQuickRspFetchReq(QW_FPARAMS_DEF, SQWTaskCtx * ctx, SQWMsg *qwMsg, i
if (QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) {
void *rsp = NULL;
int32_t dataLen = 0;
+ int32_t rawLen = 0;
SOutputData sOutput = {0};
if (TSDB_CODE_SUCCESS == code) {
- code = qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput);
+ code = qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rawLen, &rsp, &sOutput);
}
if (NULL == rsp && TSDB_CODE_SUCCESS == code) {
@@ -445,7 +458,7 @@ int32_t qwQuickRspFetchReq(QW_FPARAMS_DEF, SQWTaskCtx * ctx, SQWMsg *qwMsg, i
if (NULL != rsp) {
bool qComplete = (DS_BUF_EMPTY == sOutput.bufStatus && sOutput.queryEnd);
- qwBuildFetchRsp(rsp, &sOutput, dataLen, qComplete);
+ qwBuildFetchRsp(rsp, &sOutput, dataLen, rawLen, qComplete);
if (qComplete) {
atomic_store_8((int8_t *)&ctx->queryEnd, true);
}
@@ -711,7 +724,6 @@ _return:
int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) {
int32_t code = 0;
- bool queryRsped = false;
SSubplan *plan = NULL;
SQWPhaseInput input = {0};
qTaskInfo_t pTaskInfo = NULL;
@@ -728,8 +740,6 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) {
ctx->queryMsgType = qwMsg->msgType;
ctx->localExec = false;
- // QW_TASK_DLOGL("subplan json string, len:%d, %s", qwMsg->msgLen, qwMsg->msg);
-
code = qMsgToSubplan(qwMsg->msg, qwMsg->msgLen, &plan);
if (TSDB_CODE_SUCCESS != code) {
code = TSDB_CODE_INVALID_MSG;
@@ -737,14 +747,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) {
QW_ERR_JRET(code);
}
-#if 0
- SReadHandle* pReadHandle = qwMsg->node;
- int64_t delay = 0;
- bool fhFinish = false;
- pReadHandle->api.tqReaderFn.tqGetStreamExecProgress(pReadHandle->vnode, 0, &delay, &fhFinish);
-#endif
-
- code = qCreateExecTask(qwMsg->node, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, sql, OPTR_EXEC_MODEL_BATCH);
+ code = qCreateExecTask(qwMsg->node, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, qwMsg->msgInfo.compressMsg, sql, OPTR_EXEC_MODEL_BATCH);
sql = NULL;
if (code) {
QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code));
@@ -756,8 +759,6 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, char *sql) {
QW_ERR_JRET(TSDB_CODE_APP_ERROR);
}
- //qwSendQueryRsp(QW_FPARAMS(), qwMsg->msgType + 1, ctx, code, true);
-
ctx->level = plan->level;
ctx->dynamicTask = qIsDynamicExecTask(pTaskInfo);
atomic_store_ptr(&ctx->taskHandle, pTaskInfo);
@@ -791,6 +792,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
SQWPhaseInput input = {0};
void *rsp = NULL;
int32_t dataLen = 0;
+ int32_t rawLen = 0;
bool queryStop = false;
bool qComplete = false;
@@ -810,7 +812,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
if (QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) {
SOutputData sOutput = {0};
- QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput));
+ QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rawLen, &rsp, &sOutput));
if ((!sOutput.queryEnd) && (DS_BUF_LOW == sOutput.bufStatus || DS_BUF_EMPTY == sOutput.bufStatus)) {
QW_TASK_DLOG("task not end and buf is %s, need to continue query", qwBufStatusStr(sOutput.bufStatus));
@@ -821,7 +823,7 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
if (rsp) {
qComplete = (DS_BUF_EMPTY == sOutput.bufStatus && sOutput.queryEnd);
- qwBuildFetchRsp(rsp, &sOutput, dataLen, qComplete);
+ qwBuildFetchRsp(rsp, &sOutput, dataLen, rawLen, qComplete);
if (qComplete) {
atomic_store_8((int8_t *)&ctx->queryEnd, true);
atomic_store_8((int8_t *)&ctx->queryContinue, 0);
@@ -878,6 +880,8 @@ int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
int32_t code = 0;
int32_t dataLen = 0;
+ int32_t rawDataLen = 0;
+
bool locked = false;
SQWTaskCtx *ctx = NULL;
void *rsp = NULL;
@@ -896,14 +900,14 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
}
SOutputData sOutput = {0};
- QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput));
+ QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rawDataLen, &rsp, &sOutput));
if (NULL == rsp) {
QW_SET_EVENT_RECEIVED(ctx, QW_EVENT_FETCH);
} else {
bool qComplete = (DS_BUF_EMPTY == sOutput.bufStatus && sOutput.queryEnd);
- qwBuildFetchRsp(rsp, &sOutput, dataLen, qComplete);
+ qwBuildFetchRsp(rsp, &sOutput, dataLen, rawDataLen, qComplete);
if (qComplete) {
atomic_store_8((int8_t *)&ctx->queryEnd, true);
}
@@ -922,7 +926,6 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
atomic_store_8((int8_t *)&ctx->queryContinue, 1);
} else if (0 == atomic_load_8((int8_t *)&ctx->queryInQueue)) {
qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_EXEC, ctx->dynamicTask);
-
atomic_store_8((int8_t *)&ctx->queryInQueue, 1);
QW_ERR_JRET(qwBuildAndSendCQueryMsg(QW_FPARAMS(), &qwMsg->connInfo));
@@ -950,6 +953,7 @@ _return:
qwDbgSimulateRedirect(qwMsg, ctx, &rsped);
qwDbgSimulateDead(QW_FPARAMS(), ctx, &rsped);
}
+
if (!rsped) {
qwBuildAndSendFetchRsp(qwMsg->msgType + 1, &qwMsg->connInfo, rsp, dataLen, code);
QW_TASK_DLOG("fetch rsp send, msgType:%s, handle:%p, code:%x - %s, dataLen:%d", TMSG_INFO(qwMsg->msgType + 1),
@@ -1098,7 +1102,6 @@ int32_t qwProcessHb(SQWorker *mgmt, SQWMsg *qwMsg, SSchedulerHbReq *req) {
_return:
memcpy(&rsp.epId, &req->epId, sizeof(req->epId));
-
qwBuildAndSendHbRsp(&qwMsg->connInfo, &rsp, code);
if (code) {
@@ -1125,7 +1128,6 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
}
SQWSchStatus *sch = NULL;
- int32_t taskNum = 0;
SQWHbInfo *rspList = NULL;
SArray *pExpiredSch = NULL;
int32_t code = 0;
@@ -1158,8 +1160,6 @@ void qwProcessHbTimerEvent(void *param, void *tmrId) {
return;
}
- void *key = NULL;
- size_t keyLen = 0;
int32_t i = 0;
int64_t currentMs = taosGetTimestampMs();
@@ -1225,7 +1225,7 @@ int32_t qwProcessDelete(QW_FPARAMS_DEF, SQWMsg *qwMsg, SDeleteRes *pRes) {
QW_ERR_JRET(code);
}
- code = qCreateExecTask(qwMsg->node, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, NULL, OPTR_EXEC_MODEL_BATCH);
+ code = qCreateExecTask(qwMsg->node, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, 0, NULL, OPTR_EXEC_MODEL_BATCH);
if (code) {
QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code));
QW_ERR_JRET(code);
@@ -1427,7 +1427,7 @@ int32_t qWorkerProcessLocalQuery(void *pMgmt, uint64_t sId, uint64_t qId, uint64
rHandle.pMsgCb = taosMemoryCalloc(1, sizeof(SMsgCb));
rHandle.pMsgCb->clientRpc = qwMsg->connInfo.handle;
- code = qCreateExecTask(&rHandle, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, NULL, OPTR_EXEC_MODEL_BATCH);
+ code = qCreateExecTask(&rHandle, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, 0, NULL, OPTR_EXEC_MODEL_BATCH);
if (code) {
QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code));
QW_ERR_JRET(code);
@@ -1465,6 +1465,7 @@ int32_t qWorkerProcessLocalFetch(void *pMgmt, uint64_t sId, uint64_t qId, uint64
SQWorker *mgmt = (SQWorker *)pMgmt;
int32_t code = 0;
int32_t dataLen = 0;
+ int32_t rawLen = 0;
SQWTaskCtx *ctx = NULL;
void *rsp = NULL;
bool queryStop = false;
@@ -1472,7 +1473,6 @@ int32_t qWorkerProcessLocalFetch(void *pMgmt, uint64_t sId, uint64_t qId, uint64
SQWPhaseInput input = {0};
QW_ERR_JRET(qwHandlePrePhaseEvents(QW_FPARAMS(), QW_PHASE_PRE_FETCH, &input, NULL));
-
QW_ERR_JRET(qwGetTaskCtx(QW_FPARAMS(), &ctx));
ctx->fetchMsgType = TDMT_SCH_MERGE_FETCH;
@@ -1481,7 +1481,7 @@ int32_t qWorkerProcessLocalFetch(void *pMgmt, uint64_t sId, uint64_t qId, uint64
SOutputData sOutput = {0};
while (true) {
- QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput));
+ QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rawLen, &rsp, &sOutput));
if (NULL == rsp) {
QW_ERR_JRET(qwExecTask(QW_FPARAMS(), ctx, &queryStop));
@@ -1490,7 +1490,7 @@ int32_t qWorkerProcessLocalFetch(void *pMgmt, uint64_t sId, uint64_t qId, uint64
} else {
bool qComplete = (DS_BUF_EMPTY == sOutput.bufStatus && sOutput.queryEnd);
- qwBuildFetchRsp(rsp, &sOutput, dataLen, qComplete);
+ qwBuildFetchRsp(rsp, &sOutput, dataLen, rawLen, qComplete);
if (qComplete) {
atomic_store_8((int8_t *)&ctx->queryEnd, true);
}
diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c
index 57f2543691..72e38c7a0d 100644
--- a/source/libs/scalar/src/filter.c
+++ b/source/libs/scalar/src/filter.c
@@ -177,7 +177,7 @@ __compar_fn_t gUint64SignCompare[] = {compareUint64Int8, compareUint64Int16, co
compareUint64Int64, compareUint64Float, compareUint64Double};
__compar_fn_t gUint64UsignCompare[] = {compareUint64Uint8, compareUint64Uint16, compareUint64Uint32, compareUint64Val};
-int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
+int8_t filterGetCompFuncIdx(int32_t type, int32_t optr, bool scalarMode) {
int8_t comparFn = 0;
if (optr == OP_TYPE_IN && (type != TSDB_DATA_TYPE_BINARY && type != TSDB_DATA_TYPE_VARBINARY &&
@@ -290,9 +290,9 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
case TSDB_DATA_TYPE_NCHAR: {
if (optr == OP_TYPE_MATCH) {
- comparFn = 28;
+ comparFn = scalarMode ? 28 : 19;
} else if (optr == OP_TYPE_NMATCH) {
- comparFn = 29;
+ comparFn = scalarMode ? 29 : 20;
} else if (optr == OP_TYPE_LIKE) {
comparFn = 9;
} else if (optr == OP_TYPE_NOT_LIKE) {
@@ -343,7 +343,7 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
return comparFn;
}
-__compar_fn_t filterGetCompFunc(int32_t type, int32_t optr) { return gDataCompare[filterGetCompFuncIdx(type, optr)]; }
+__compar_fn_t filterGetCompFunc(int32_t type, int32_t optr) { return gDataCompare[filterGetCompFuncIdx(type, optr, true)]; }
__compar_fn_t filterGetCompFuncEx(int32_t lType, int32_t rType, int32_t optr) {
if (TSDB_DATA_TYPE_NULL == rType || TSDB_DATA_TYPE_JSON == rType) {
@@ -2785,7 +2785,7 @@ int32_t filterGenerateComInfo(SFilterInfo *info) {
for (uint32_t i = 0; i < info->unitNum; ++i) {
SFilterUnit *unit = &info->units[i];
- info->cunits[i].func = filterGetCompFuncIdx(FILTER_UNIT_DATA_TYPE(unit), unit->compare.optr); // set terrno if err
+ info->cunits[i].func = filterGetCompFuncIdx(FILTER_UNIT_DATA_TYPE(unit), unit->compare.optr, false); // set terrno if err
info->cunits[i].rfunc = filterGetRangeCompFuncFromOptrs(unit->compare.optr, unit->compare.optr2);
info->cunits[i].optr = FILTER_UNIT_OPTR(unit);
info->cunits[i].colData = NULL;
@@ -3782,7 +3782,7 @@ int32_t fltSclBuildRangeFromBlockSma(SFltSclColumnRange *colRange, SColumnDataAg
return TSDB_CODE_SUCCESS;
}
-bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t numOfCols, int32_t numOfRows) {
+bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg *pDataStatis, int32_t numOfCols, int32_t numOfRows) {
if (info->scalarMode) {
SArray *colRanges = info->sclCtx.fltSclRange;
for (int32_t i = 0; i < taosArrayGetSize(colRanges); ++i) {
@@ -3790,13 +3790,13 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t
bool foundCol = false;
int32_t j = 0;
for (; j < numOfCols; ++j) {
- if (pDataStatis[j] != NULL && pDataStatis[j]->colId == colRange->colNode->colId) {
+ if (pDataStatis[j].colId == colRange->colNode->colId) {
foundCol = true;
break;
}
}
if (foundCol) {
- SColumnDataAgg *pAgg = pDataStatis[j];
+ SColumnDataAgg *pAgg = &pDataStatis[j];
SArray *points = taosArrayInit(2, sizeof(SFltSclPoint));
fltSclBuildRangeFromBlockSma(colRange, pAgg, numOfRows, points);
qDebug("column data agg: nulls %d, rows %d, max %" PRId64 " min %" PRId64, pAgg->numOfNull, numOfRows,
@@ -3833,7 +3833,7 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t
int32_t index = -1;
SFilterRangeCtx *ctx = info->colRange[k];
for (int32_t i = 0; i < numOfCols; ++i) {
- if (pDataStatis[i] != NULL && pDataStatis[i]->colId == ctx->colId) {
+ if (pDataStatis[i].colId == ctx->colId) {
index = i;
break;
}
@@ -3849,13 +3849,13 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t
break;
}
- if (pDataStatis[index]->numOfNull <= 0) {
+ if (pDataStatis[index].numOfNull <= 0) {
if (ctx->isnull && !ctx->notnull && !ctx->isrange) {
ret = false;
break;
}
- } else if (pDataStatis[index]->numOfNull > 0) {
- if (pDataStatis[index]->numOfNull == numOfRows) {
+ } else if (pDataStatis[index].numOfNull > 0) {
+ if (pDataStatis[index].numOfNull == numOfRows) {
if ((ctx->notnull || ctx->isrange) && (!ctx->isnull)) {
ret = false;
break;
@@ -3869,7 +3869,7 @@ bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pDataStatis, int32_t
}
}
- SColumnDataAgg *pDataBlockst = pDataStatis[index];
+ SColumnDataAgg *pDataBlockst = &pDataStatis[index];
SFilterRangeNode *r = ctx->rs;
float minv = 0;
diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c
index 4b8695e8ae..d0dc04d6b4 100644
--- a/source/libs/scheduler/src/schRemote.c
+++ b/source/libs/scheduler/src/schRemote.c
@@ -20,6 +20,9 @@
#include "tmsg.h"
#include "tref.h"
#include "trpc.h"
+#include "tglobal.h"
+#include "tmisce.h"
+
// clang-format off
int32_t schValidateRspMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgType) {
int32_t lastMsgType = pTask->lastMsgType;
@@ -1127,6 +1130,12 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
qMsg.msgLen = pTask->msgLen;
qMsg.msg = pTask->msg;
+ if (strcmp(tsLocalFqdn, GET_ACTIVE_EP(&addr->epSet)->fqdn) == 0) {
+ qMsg.compress = 0;
+ } else {
+ qMsg.compress = 1;
+ }
+
msgSize = tSerializeSSubQueryMsg(NULL, 0, &qMsg);
if (msgSize < 0) {
SCH_TASK_ELOG("tSerializeSSubQueryMsg get size, msgSize:%d", msgSize);
diff --git a/source/libs/stream/inc/streamInt.h b/source/libs/stream/inc/streamInt.h
index f3ec01cf7a..be3da64c6a 100644
--- a/source/libs/stream/inc/streamInt.h
+++ b/source/libs/stream/inc/streamInt.h
@@ -26,20 +26,16 @@
extern "C" {
#endif
-#define CHECK_RSP_CHECK_INTERVAL 300
-#define LAUNCH_HTASK_INTERVAL 100
-#define WAIT_FOR_MINIMAL_INTERVAL 100.00
-#define MAX_RETRY_LAUNCH_HISTORY_TASK 40
-#define RETRY_LAUNCH_INTERVAL_INC_RATE 1.2
-
-#define MAX_BLOCK_NAME_NUM 1024
-#define DISPATCH_RETRY_INTERVAL_MS 300
-#define MAX_CONTINUE_RETRY_COUNT 5
-
-#define META_HB_CHECK_INTERVAL 200
-#define META_HB_SEND_IDLE_COUNTER 25 // send hb every 5 sec
-#define STREAM_TASK_KEY_LEN ((sizeof(int64_t)) << 1)
-
+#define CHECK_RSP_CHECK_INTERVAL 300
+#define LAUNCH_HTASK_INTERVAL 100
+#define WAIT_FOR_MINIMAL_INTERVAL 100.00
+#define MAX_RETRY_LAUNCH_HISTORY_TASK 40
+#define RETRY_LAUNCH_INTERVAL_INC_RATE 1.2
+#define MAX_BLOCK_NAME_NUM 1024
+#define DISPATCH_RETRY_INTERVAL_MS 300
+#define META_HB_CHECK_INTERVAL 200
+#define META_HB_SEND_IDLE_COUNTER 25 // send hb every 5 sec
+#define STREAM_TASK_KEY_LEN ((sizeof(int64_t)) << 1)
#define STREAM_TASK_QUEUE_CAPACITY 20480
#define STREAM_TASK_QUEUE_CAPACITY_IN_SIZE (30)
@@ -118,6 +114,14 @@ typedef struct {
int32_t taskId;
} STaskTriggerSendInfo;
+typedef struct {
+ int32_t nodeId;
+ int32_t status;
+ int64_t sendTs;
+ int64_t rspTs;
+ int32_t retryCount;
+} SDispatchEntry;
+
typedef struct {
int64_t streamId;
int64_t recvTs;
@@ -143,6 +147,12 @@ typedef enum {
EXEC_AFTER_IDLE = 0x1,
} EExtractDataCode;
+typedef enum ECHECKPOINT_BACKUP_TYPE {
+ DATA_UPLOAD_DISABLE = -1,
+ DATA_UPLOAD_S3 = 0,
+ DATA_UPLOAD_RSYNC = 1,
+} ECHECKPOINT_BACKUP_TYPE;
+
extern void* streamTimer;
extern int32_t streamBackendId;
extern int32_t streamBackendCfWrapperId;
@@ -153,10 +163,9 @@ void streamTimerCleanUp();
void initRpcMsg(SRpcMsg* pMsg, int32_t msgType, void* pCont, int32_t contLen);
-void streamRetryDispatchData(SStreamTask* pTask, int64_t waitDuration);
+void streamStartMonitorDispatchData(SStreamTask* pTask, int64_t waitDuration);
int32_t streamDispatchStreamBlock(SStreamTask* pTask);
void destroyDispatchMsg(SStreamDispatchReq* pReq, int32_t numOfVgroups);
-int32_t getNumOfDispatchBranch(SStreamTask* pTask);
void clearBufferedDispatchMsg(SStreamTask* pTask);
int32_t streamProcessCheckpointTriggerBlock(SStreamTask* pTask, SStreamDataBlock* pBlock);
@@ -165,7 +174,7 @@ SStreamDataBlock* createStreamBlockFromResults(SStreamQueueItem* pItem, SStreamT
SArray* pRes);
void destroyStreamDataBlock(SStreamDataBlock* pBlock);
-int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData);
+int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData, const char* idstr);
int32_t streamBroadcastToUpTasks(SStreamTask* pTask, const SSDataBlock* pBlock);
int32_t streamSendCheckMsg(SStreamTask* pTask, const SStreamTaskCheckReq* pReq, int32_t nodeId, SEpSet* pEpSet);
@@ -204,12 +213,6 @@ int32_t streamQueueGetItemSize(const SStreamQueue* pQueue);
void streamMetaRemoveDB(void* arg, char* key);
-typedef enum ECHECKPOINT_BACKUP_TYPE {
- DATA_UPLOAD_DISABLE = -1,
- DATA_UPLOAD_S3 = 0,
- DATA_UPLOAD_RSYNC = 1,
-} ECHECKPOINT_BACKUP_TYPE;
-
ECHECKPOINT_BACKUP_TYPE streamGetCheckpointBackupType();
int32_t streamTaskDownloadCheckpointData(const char* id, char* path);
diff --git a/source/libs/stream/src/streamCheckStatus.c b/source/libs/stream/src/streamCheckStatus.c
index 11fecf7683..b577147171 100644
--- a/source/libs/stream/src/streamCheckStatus.c
+++ b/source/libs/stream/src/streamCheckStatus.c
@@ -509,7 +509,7 @@ void doSendCheckMsg(SStreamTask* pTask, SDownstreamStatusInfo* p) {
STaskOutputInfo* pOutputInfo = &pTask->outputInfo;
if (pOutputInfo->type == TASK_OUTPUT__FIXED_DISPATCH) {
STaskDispatcherFixed* pDispatch = &pOutputInfo->fixedDispatcher;
- setCheckDownstreamReqInfo(&req, p->reqId, pDispatch->taskId, pDispatch->taskId);
+ setCheckDownstreamReqInfo(&req, p->reqId, pDispatch->taskId, pDispatch->nodeId);
stDebug("s-task:%s (vgId:%d) stage:%" PRId64 " re-send check downstream task:0x%x(vgId:%d) reqId:0x%" PRIx64,
id, pTask->info.nodeId, req.stage, req.downstreamTaskId, req.downstreamNodeId, req.reqId);
diff --git a/source/libs/stream/src/streamCheckpoint.c b/source/libs/stream/src/streamCheckpoint.c
index ab3b5d6fa0..eedd8f20d6 100644
--- a/source/libs/stream/src/streamCheckpoint.c
+++ b/source/libs/stream/src/streamCheckpoint.c
@@ -40,26 +40,8 @@ static void checkpointTriggerMonitorFn(void* param, void* tmrId);
static SStreamDataBlock* createChkptTriggerBlock(SStreamTask* pTask, int32_t checkpointType, int64_t checkpointId, int32_t transId);
-bool streamTaskIsAllUpstreamSendTrigger(SStreamTask* pTask) {
- SActiveCheckpointInfo* pActiveInfo = pTask->chkInfo.pActiveInfo;
- int32_t numOfUpstreams = taosArrayGetSize(pTask->upstreamInfo.pList);
- bool allSend = true;
-
- taosThreadMutexLock(&pActiveInfo->lock);
- int32_t numOfRecv = taosArrayGetSize(pActiveInfo->pReadyMsgList);
-
- if (numOfRecv < numOfUpstreams) {
- stDebug("s-task:%s received checkpoint-trigger block, idx:%d, %d upstream tasks not send yet, total:%d",
- pTask->id.idStr, pTask->info.selfChildId, (numOfUpstreams - numOfRecv), numOfUpstreams);
- allSend = false;
- }
-
- taosThreadMutexUnlock(&pActiveInfo->lock);
- return allSend;
-}
-
SStreamDataBlock* createChkptTriggerBlock(SStreamTask* pTask, int32_t checkpointType, int64_t checkpointId,
- int32_t transId) {
+ int32_t transId) {
SStreamDataBlock* pChkpoint = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, sizeof(SSDataBlock));
if (pChkpoint == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -441,8 +423,10 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin
if (pReq->checkpointId <= pInfo->checkpointId) {
stDebug("s-task:%s vgId:%d latest checkpointId:%" PRId64 " checkpointVer:%" PRId64
- " no need to update the checkpoint info, updated checkpointId:%" PRId64 " checkpointVer:%" PRId64 " ignored",
- id, vgId, pInfo->checkpointId, pInfo->checkpointVer, pReq->checkpointId, pReq->checkpointVer);
+ " no need to update the checkpoint info, updated checkpointId:%" PRId64 " checkpointVer:%" PRId64
+ " transId:%d ignored",
+ id, vgId, pInfo->checkpointId, pInfo->checkpointVer, pReq->checkpointId, pReq->checkpointVer,
+ pReq->transId);
taosThreadMutexUnlock(&pTask->lock);
{ // destroy the related fill-history tasks
@@ -454,7 +438,6 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin
stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped in update checkpointInfo, remain tasks:%d",
id, vgId, pReq->taskId, numOfTasks);
}
-
streamMetaWLock(pMeta);
}
@@ -516,7 +499,8 @@ int32_t streamTaskUpdateTaskCheckpointInfo(SStreamTask* pTask, SVUpdateCheckpoin
if (pReq->dropRelHTask) {
streamMetaUnregisterTask(pMeta, pReq->hStreamId, pReq->hTaskId);
int32_t numOfTasks = streamMetaGetNumOfTasks(pMeta);
- stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped, remain tasks:%d", id, vgId, (int32_t) pReq->hTaskId, numOfTasks);
+ stDebug("s-task:%s vgId:%d related fill-history task:0x%x dropped, remain tasks:%d", id, vgId,
+ (int32_t)pReq->hTaskId, numOfTasks);
}
streamMetaWLock(pMeta);
@@ -703,9 +687,7 @@ int32_t streamTaskBuildCheckpoint(SStreamTask* pTask) {
// update the latest checkpoint info if all works are done successfully, for rsma, the pMsgCb is null.
if (code == TSDB_CODE_SUCCESS && (pTask->pMsgCb != NULL)) {
- STaskId* pHTaskId = &pTask->hTaskInfo.id;
- code = streamBuildAndSendCheckpointUpdateMsg(pTask->pMsgCb, pMeta->vgId, &pTask->id, pHTaskId, &pTask->chkInfo,
- dropRelHTask);
+ code = streamSendChkptReportMsg(pTask, &pTask->chkInfo, dropRelHTask);
if (code == TSDB_CODE_SUCCESS) {
code = streamTaskRemoteBackupCheckpoint(pTask, ckId, (char*)id);
if (code != TSDB_CODE_SUCCESS) {
@@ -770,6 +752,18 @@ void checkpointTriggerMonitorFn(void* param, void* tmrId) {
streamMetaReleaseTask(pTask->pMeta, pTask);
return;
}
+
+ // checkpoint-trigger recv flag is set, quit
+ if (pActiveInfo->allUpstreamTriggerRecv) {
+ int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
+ stDebug("s-task:%s vgId:%d all checkpoint-trigger recv, quit from monitor checkpoint-trigger, ref:%d",
+ pTask->id.idStr, vgId, ref);
+
+ taosThreadMutexUnlock(&pTask->lock);
+ streamMetaReleaseTask(pTask->pMeta, pTask);
+ return;
+ }
+
taosThreadMutexUnlock(&pTask->lock);
taosThreadMutexLock(&pActiveInfo->lock);
diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c
index bcda85e7a7..fae90f4db8 100644
--- a/source/libs/stream/src/streamData.c
+++ b/source/libs/stream/src/streamData.c
@@ -33,11 +33,26 @@ SStreamDataBlock* createStreamBlockFromDispatchMsg(const SStreamDispatchReq* pRe
}
ASSERT((pReq->blockNum == taosArrayGetSize(pReq->data)) && (pReq->blockNum == taosArrayGetSize(pReq->dataLen)));
-
for (int32_t i = 0; i < blockNum; i++) {
SRetrieveTableRsp* pRetrieve = (SRetrieveTableRsp*) taosArrayGetP(pReq->data, i);
SSDataBlock* pDataBlock = taosArrayGet(pArray, i);
- blockDecode(pDataBlock, pRetrieve->data);
+
+ int32_t compLen = *(int32_t*)pRetrieve->data;
+ int32_t fullLen = *(int32_t*)(pRetrieve->data + sizeof(int32_t));
+
+ char* pInput = pRetrieve->data + PAYLOAD_PREFIX_LEN;
+ if (pRetrieve->compressed && compLen < fullLen) {
+ char* p = taosMemoryMalloc(fullLen);
+ int32_t len = tsDecompressString(pInput, compLen, 1, p, fullLen, ONE_STAGE_COMP, NULL, 0);
+ ASSERT(len == fullLen);
+ pInput = p;
+ }
+
+ blockDecode(pDataBlock, pInput);
+
+ if (pRetrieve->compressed && compLen < fullLen) {
+ taosMemoryFree(pInput);
+ }
// TODO: refactor
pDataBlock->info.window.skey = be64toh(pRetrieve->skey);
@@ -89,16 +104,19 @@ void destroyStreamDataBlock(SStreamDataBlock* pBlock) {
taosFreeQitem(pBlock);
}
-int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData) {
+int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock* pData, const char* id) {
SArray* pArray = taosArrayInit(1, sizeof(SSDataBlock));
if (pArray == NULL) {
- return -1;
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ stError("failed to prepare retrieve block, %s", id);
+ return terrno;
}
taosArrayPush(pArray, &(SSDataBlock){0});
SRetrieveTableRsp* pRetrieve = pReq->pRetrieve;
SSDataBlock* pDataBlock = taosArrayGet(pArray, 0);
- blockDecode(pDataBlock, pRetrieve->data);
+
+ blockDecode(pDataBlock, pRetrieve->data + PAYLOAD_PREFIX_LEN);
// TODO: refactor
pDataBlock->info.window.skey = be64toh(pRetrieve->skey);
@@ -110,7 +128,7 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock
pData->reqId = pReq->reqId;
pData->blocks = pArray;
- return 0;
+ return TSDB_CODE_SUCCESS;
}
SStreamDataSubmit* streamDataSubmitNew(SPackedData* pData, int32_t type) {
diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c
index e100dac808..b17d0206f0 100644
--- a/source/libs/stream/src/streamDispatch.c
+++ b/source/libs/stream/src/streamDispatch.c
@@ -23,13 +23,16 @@ typedef struct SBlockName {
char parTbName[TSDB_TABLE_NAME_LEN];
} SBlockName;
-static void doRetryDispatchData(void* param, void* tmrId);
+static void doMonitorDispatchData(void* param, void* tmrId);
static int32_t doSendDispatchMsg(SStreamTask* pTask, const SStreamDispatchReq* pReq, int32_t vgId, SEpSet* pEpSet);
static int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatchReq* pReq);
static int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock,
- int32_t vgSz, int64_t groupId);
+ int64_t groupId, int64_t now);
static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTask* pTask, int32_t vgId,
int32_t numOfBlocks, int64_t dstTaskId, int32_t type);
+static int32_t getFailedDispatchInfo(SDispatchMsgInfo* pMsgInfo, int64_t now);
+static bool isDispatchRspTimeout(SDispatchEntry* pEntry, int64_t now);
+static void addDispatchEntry(SDispatchMsgInfo* pMsgInfo, int32_t nodeId, int64_t now, bool lock);
void initRpcMsg(SRpcMsg* pMsg, int32_t msgType, void* pCont, int32_t contLen) {
pMsg->msgType = msgType;
@@ -42,7 +45,7 @@ static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTas
pReq->streamId = pTask->id.streamId;
pReq->srcVgId = vgId;
pReq->stage = pTask->pMeta->stage;
- pReq->msgId = pTask->execInfo.dispatch;
+ pReq->msgId = pTask->msgInfo.msgId;
pReq->upstreamTaskId = pTask->id.taskId;
pReq->upstreamChildId = pTask->info.selfChildId;
pReq->upstreamNodeId = pTask->info.nodeId;
@@ -65,6 +68,7 @@ static int32_t tInitStreamDispatchReq(SStreamDispatchReq* pReq, const SStreamTas
void streamTaskSendRetrieveRsp(SStreamRetrieveReq *pReq, SRpcMsg* pRsp){
void* buf = rpcMallocCont(sizeof(SMsgHead) + sizeof(SStreamRetrieveRsp));
((SMsgHead*)buf)->vgId = htonl(pReq->srcNodeId);
+
SStreamRetrieveRsp* pCont = POINTER_SHIFT(buf, sizeof(SMsgHead));
pCont->streamId = pReq->streamId;
pCont->rspToTaskId = pReq->srcTaskId;
@@ -124,11 +128,12 @@ int32_t streamTaskBroadcastRetrieveReq(SStreamTask* pTask, SStreamRetrieveReq* r
}
static int32_t buildStreamRetrieveReq(SStreamTask* pTask, const SSDataBlock* pBlock, SStreamRetrieveReq* req){
- int32_t dataStrLen = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
- SRetrieveTableRsp* pRetrieve = taosMemoryCalloc(1, dataStrLen);
- if (pRetrieve == NULL) {
- return TSDB_CODE_OUT_OF_MEMORY;
- }
+ SRetrieveTableRsp* pRetrieve = NULL;
+
+ int32_t len = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
+
+ pRetrieve = taosMemoryCalloc(1, len);
+ if (pRetrieve == NULL) return TSDB_CODE_OUT_OF_MEMORY;
int32_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
pRetrieve->useconds = 0;
@@ -142,13 +147,19 @@ static int32_t buildStreamRetrieveReq(SStreamTask* pTask, const SSDataBlock* pBl
pRetrieve->ekey = htobe64(pBlock->info.window.ekey);
pRetrieve->version = htobe64(pBlock->info.version);
- int32_t actualLen = blockEncode(pBlock, pRetrieve->data, numOfCols);
+ int32_t actualLen = blockEncode(pBlock, pRetrieve->data+ PAYLOAD_PREFIX_LEN, numOfCols);
+ SET_PAYLOAD_LEN(pRetrieve->data, actualLen, actualLen);
+
+ int32_t payloadLen = actualLen + PAYLOAD_PREFIX_LEN;
+ pRetrieve->payloadLen = htonl(payloadLen);
+ pRetrieve->compLen = htonl(payloadLen);
+ pRetrieve->compressed = 0;
req->streamId = pTask->id.streamId;
req->srcNodeId = pTask->info.nodeId;
req->srcTaskId = pTask->id.taskId;
req->pRetrieve = pRetrieve;
- req->retrieveLen = dataStrLen;
+ req->retrieveLen = len;
return 0;
}
@@ -209,26 +220,66 @@ void destroyDispatchMsg(SStreamDispatchReq* pReq, int32_t numOfVgroups) {
taosMemoryFree(pReq);
}
-int32_t getNumOfDispatchBranch(SStreamTask* pTask) {
- return (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH)
- ? 1
- : taosArrayGetSize(pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos);
-}
-
void clearBufferedDispatchMsg(SStreamTask* pTask) {
SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo;
if (pMsgInfo->pData != NULL) {
- destroyDispatchMsg(pMsgInfo->pData, getNumOfDispatchBranch(pTask));
+ destroyDispatchMsg(pMsgInfo->pData, streamTaskGetNumOfDownstream(pTask));
}
pMsgInfo->checkpointId = -1;
pMsgInfo->transId = -1;
pMsgInfo->pData = NULL;
pMsgInfo->dispatchMsgType = 0;
+
+ taosThreadMutexLock(&pMsgInfo->lock);
+ taosArrayClear(pTask->msgInfo.pSendInfo);
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+}
+
+static SStreamDispatchReq* createDispatchDataReq(SStreamTask* pTask, const SStreamDataBlock* pData) {
+ int32_t code = 0;
+ int32_t type = pTask->outputInfo.type;
+ int32_t num = streamTaskGetNumOfDownstream(pTask);
+
+ ASSERT(type == TASK_OUTPUT__SHUFFLE_DISPATCH || type == TASK_OUTPUT__FIXED_DISPATCH);
+
+ SStreamDispatchReq* pReqs = taosMemoryCalloc(num, sizeof(SStreamDispatchReq));
+ if (pReqs == NULL) {
+ terrno = TSDB_CODE_OUT_OF_MEMORY;
+ return NULL;
+ }
+
+ if (type == TASK_OUTPUT__SHUFFLE_DISPATCH) {
+ SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
+ int32_t numOfVgroups = taosArrayGetSize(vgInfo);
+
+ for (int32_t i = 0; i < numOfVgroups; i++) {
+ SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, i);
+ code = tInitStreamDispatchReq(&pReqs[i], pTask, pData->srcVgId, 0, pVgInfo->taskId, pData->type);
+ if (code != TSDB_CODE_SUCCESS) {
+ destroyDispatchMsg(pReqs, numOfVgroups);
+ terrno = code;
+ return NULL;
+ }
+ }
+ } else {
+ int32_t numOfBlocks = taosArrayGetSize(pData->blocks);
+ int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId;
+
+ code = tInitStreamDispatchReq(pReqs, pTask, pData->srcVgId, numOfBlocks, downstreamTaskId, pData->type);
+ if (code != TSDB_CODE_SUCCESS) {
+ taosMemoryFree(pReqs);
+ terrno = code;
+ return NULL;
+ }
+ }
+
+ return pReqs;
}
static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pData) {
int32_t code = 0;
+ int64_t now = taosGetTimestampMs();
int32_t numOfBlocks = taosArrayGetSize(pData->blocks);
ASSERT(numOfBlocks != 0 && pTask->msgInfo.pData == NULL);
@@ -240,48 +291,29 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD
pTask->msgInfo.transId = p->info.window.ekey;
}
+ SStreamDispatchReq* pReqs = createDispatchDataReq(pTask, pData);
+ if (pReqs == NULL) {
+ stError("s-task:%s failed to create dispatch req", pTask->id.idStr);
+ return terrno;
+ }
+
if (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH) {
- SStreamDispatchReq* pReq = taosMemoryCalloc(1, sizeof(SStreamDispatchReq));
-
- int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId;
- code = tInitStreamDispatchReq(pReq, pTask, pData->srcVgId, numOfBlocks, downstreamTaskId, pData->type);
- if (code != TSDB_CODE_SUCCESS) {
- taosMemoryFree(pReq);
- return code;
- }
-
for (int32_t i = 0; i < numOfBlocks; i++) {
SSDataBlock* pDataBlock = taosArrayGet(pData->blocks, i);
- code = streamAddBlockIntoDispatchMsg(pDataBlock, pReq);
+ code = streamAddBlockIntoDispatchMsg(pDataBlock, pReqs);
if (code != TSDB_CODE_SUCCESS) {
- destroyDispatchMsg(pReq, 1);
+ destroyDispatchMsg(pReqs, 1);
return code;
}
}
- pTask->msgInfo.pData = pReq;
+ addDispatchEntry(&pTask->msgInfo, pTask->outputInfo.fixedDispatcher.nodeId, now, true);
+ pTask->msgInfo.pData = pReqs;
} else if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) {
- int32_t rspCnt = atomic_load_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt);
- ASSERT(rspCnt == 0);
SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
int32_t numOfVgroups = taosArrayGetSize(vgInfo);
- SStreamDispatchReq* pReqs = taosMemoryCalloc(numOfVgroups, sizeof(SStreamDispatchReq));
- if (pReqs == NULL) {
- terrno = TSDB_CODE_OUT_OF_MEMORY;
- return -1;
- }
-
- for (int32_t i = 0; i < numOfVgroups; i++) {
- SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, i);
- code = tInitStreamDispatchReq(&pReqs[i], pTask, pData->srcVgId, 0, pVgInfo->taskId, pData->type);
- if (code != TSDB_CODE_SUCCESS) {
- destroyDispatchMsg(pReqs, numOfVgroups);
- return code;
- }
- }
-
for (int32_t i = 0; i < numOfBlocks; i++) {
SSDataBlock* pDataBlock = taosArrayGet(pData->blocks, i);
@@ -297,7 +329,8 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD
// it's a new vnode to receive dispatch msg, so add one
if (pReqs[j].blockNum == 0) {
- atomic_add_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1);
+ SVgroupInfo* pDstVgroupInfo = taosArrayGet(vgInfo, j);
+ addDispatchEntry(&pTask->msgInfo, pDstVgroupInfo->vgId, now, true);
}
pReqs[j].blockNum++;
@@ -306,7 +339,7 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD
continue;
}
- code = streamSearchAndAddBlock(pTask, pReqs, pDataBlock, numOfVgroups, pDataBlock->info.id.groupId);
+ code = streamSearchAndAddBlock(pTask, pReqs, pDataBlock, pDataBlock->info.id.groupId, now);
if (code != 0) {
destroyDispatchMsg(pReqs, numOfVgroups);
return code;
@@ -320,9 +353,9 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD
stDebug("s-task:%s build dispatch msg success, msgId:%d, stage:%" PRId64 " %p", pTask->id.idStr,
pTask->execInfo.dispatch, pTask->pMeta->stage, pTask->msgInfo.pData);
} else {
+ int32_t numOfBranches = taosArrayGetSize(pTask->msgInfo.pSendInfo);
stDebug("s-task:%s build dispatch msg success, msgId:%d, stage:%" PRId64 " dstVgNum:%d %p", pTask->id.idStr,
- pTask->execInfo.dispatch, pTask->pMeta->stage, pTask->outputInfo.shuffleDispatcher.waitingRspCnt,
- pTask->msgInfo.pData);
+ pTask->execInfo.dispatch, pTask->pMeta->stage, numOfBranches, pTask->msgInfo.pData);
}
return code;
@@ -330,8 +363,8 @@ static int32_t doBuildDispatchMsg(SStreamTask* pTask, const SStreamDataBlock* pD
static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatchMsg) {
int32_t code = 0;
- int32_t msgId = pTask->execInfo.dispatch;
const char* id = pTask->id.idStr;
+ int32_t msgId = pTask->msgInfo.msgId;
if (pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH) {
int32_t vgId = pTask->outputInfo.fixedDispatcher.nodeId;
@@ -345,10 +378,10 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch
} else {
SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
int32_t numOfVgroups = taosArrayGetSize(vgInfo);
+ int32_t numOfBranches = taosArrayGetSize(pTask->msgInfo.pSendInfo);
- int32_t actualVgroups = pTask->outputInfo.shuffleDispatcher.waitingRspCnt;
stDebug("s-task:%s (child taskId:%d) start to shuffle-dispatch blocks to %d/%d vgroup(s), msgId:%d", id,
- pTask->info.selfChildId, actualVgroups, numOfVgroups, msgId);
+ pTask->info.selfChildId, numOfBranches, numOfVgroups, msgId);
int32_t numOfSend = 0;
for (int32_t i = 0; i < numOfVgroups; i++) {
@@ -363,7 +396,7 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch
}
// no need to try remain, all already send.
- if (++numOfSend == actualVgroups) {
+ if (++numOfSend == numOfBranches) {
break;
}
}
@@ -375,102 +408,168 @@ static int32_t sendDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pDispatch
return code;
}
-static void doRetryDispatchData(void* param, void* tmrId) {
- SStreamTask* pTask = param;
- const char* id = pTask->id.idStr;
- int32_t msgId = pTask->execInfo.dispatch;
+static void setNotInDispatchMonitor(SDispatchMsgInfo* pMsgInfo) {
+ taosThreadMutexLock(&pMsgInfo->lock);
+ pMsgInfo->inMonitor = 0;
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+}
+
+static void setResendInfo(SDispatchEntry* pEntry, int64_t now) {
+ pEntry->sendTs = now;
+ pEntry->rspTs = -1;
+ pEntry->retryCount += 1;
+}
+
+static void addDispatchEntry(SDispatchMsgInfo* pMsgInfo, int32_t nodeId, int64_t now, bool lock) {
+ SDispatchEntry entry = {.nodeId = nodeId, .rspTs = -1, .status = 0, .sendTs = now};
+
+ if (lock) {
+ taosThreadMutexLock(&pMsgInfo->lock);
+ }
+
+ taosArrayPush(pMsgInfo->pSendInfo, &entry);
+
+ if (lock) {
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+ }
+}
+
+static void doSendFailedDispatch(SStreamTask* pTask, SDispatchEntry* pEntry, int64_t now, const char* pMsg) {
+ SStreamDispatchReq* pReq = pTask->msgInfo.pData;
+
+ int32_t msgId = pTask->msgInfo.msgId;
+ SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
+ int32_t numOfVgroups = taosArrayGetSize(vgInfo);
+
+ setResendInfo(pEntry, now);
+ for (int32_t j = 0; j < numOfVgroups; ++j) {
+ SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j);
+ if (pVgInfo->vgId == pEntry->nodeId) {
+ int32_t code = doSendDispatchMsg(pTask, &pReq[j], pVgInfo->vgId, &pVgInfo->epSet);
+ stDebug("s-task:%s (child taskId:%d) shuffle-dispatch blocks:%d to vgId:%d for %s, msgId:%d, code:%s",
+ pTask->id.idStr, pTask->info.selfChildId, pReq[j].blockNum, pVgInfo->vgId, pMsg, msgId, tstrerror(code));
+ break;
+ }
+ }
+}
+
+static void doMonitorDispatchData(void* param, void* tmrId) {
+ SStreamTask* pTask = param;
+ const char* id = pTask->id.idStr;
+ int32_t vgId = pTask->pMeta->vgId;
+ SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo;
+ int32_t msgId = pMsgInfo->msgId;
+ int32_t code = 0;
+ int64_t now = taosGetTimestampMs();
+
+ stDebug("s-task:%s start monitor dispatch data", id);
if (streamTaskShouldStop(pTask)) {
int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref);
+ setNotInDispatchMonitor(pMsgInfo);
return;
}
- ASSERT(pTask->outputq.status == TASK_OUTPUT_STATUS__WAIT);
+ // slave task not handle the dispatch, downstream not ready will break the monitor timer
+ // follower not handle the dispatch rsp
+ if ((pTask->pMeta->role == NODE_ROLE_FOLLOWER) || (pTask->status.downstreamReady != 1)) {
+ int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
+ stError("s-task:%s vgId:%d follower or downstream not ready, jump out of monitor tmr, ref:%d", id, vgId, ref);
+ setNotInDispatchMonitor(pMsgInfo);
+ return;
+ }
- int32_t code = 0;
+ taosThreadMutexLock(&pMsgInfo->lock);
+ if (pTask->outputq.status == TASK_OUTPUT_STATUS__NORMAL) {
+ int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
+ stDebug("s-task:%s not in dispatch procedure, abort from timer, ref:%d", pTask->id.idStr, ref);
+
+ pTask->msgInfo.inMonitor = 0;
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+ return;
+ }
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+
+ int32_t numOfFailed = getFailedDispatchInfo(pMsgInfo, now);
+ if (numOfFailed == 0) {
+ stDebug("s-task:%s no error occurs, check again in %dms", id, DISPATCH_RETRY_INTERVAL_MS);
+ streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
+ return;
+ }
{
- SArray* pList = taosArrayDup(pTask->msgInfo.pRetryList, NULL);
- taosArrayClear(pTask->msgInfo.pRetryList);
-
SStreamDispatchReq* pReq = pTask->msgInfo.pData;
if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) {
- SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
- int32_t numOfVgroups = taosArrayGetSize(vgInfo);
+ stDebug("s-task:%s (child taskId:%d) retry shuffle-dispatch to down streams, msgId:%d", id,
+ pTask->info.selfChildId, msgId);
- int32_t numOfFailed = taosArrayGetSize(pList);
- stDebug("s-task:%s (child taskId:%d) retry shuffle-dispatch blocks to %d vgroup(s), msgId:%d", id,
- pTask->info.selfChildId, numOfFailed, msgId);
+ int32_t numOfRetry = 0;
+ for (int32_t i = 0; i < taosArrayGetSize(pTask->msgInfo.pSendInfo); ++i) {
+ SDispatchEntry* pEntry = taosArrayGet(pTask->msgInfo.pSendInfo, i);
+ if (pEntry->status == TSDB_CODE_SUCCESS && pEntry->rspTs > 0) {
+ continue;
+ }
- for (int32_t i = 0; i < numOfFailed; i++) {
- int32_t vgId = *(int32_t*)taosArrayGet(pList, i);
+ // downstream not rsp yet beyond threshold that is 10s
+ if (isDispatchRspTimeout(pEntry, now)) { // not respond yet beyonds 30s, re-send data
+ doSendFailedDispatch(pTask, pEntry, now, "timeout");
+ numOfRetry += 1;
+ continue;
+ }
- for (int32_t j = 0; j < numOfVgroups; ++j) {
- SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j);
- if (pVgInfo->vgId == vgId) {
- stDebug("s-task:%s (child taskId:%d) shuffle-dispatch blocks:%d to vgId:%d", pTask->id.idStr,
- pTask->info.selfChildId, pReq[j].blockNum, pVgInfo->vgId);
+ // downstream inputQ is closed
+ if (pEntry->status == TASK_INPUT_STATUS__BLOCKED) {
+ doSendFailedDispatch(pTask, pEntry, now, "downstream inputQ blocked");
+ numOfRetry += 1;
+ continue;
+ }
- code = doSendDispatchMsg(pTask, &pReq[j], pVgInfo->vgId, &pVgInfo->epSet);
- if (code < 0) {
- break;
- }
- }
+ // handle other errors
+ if (pEntry->status != TSDB_CODE_SUCCESS) {
+ doSendFailedDispatch(pTask, pEntry, now, "downstream error");
+ numOfRetry += 1;
}
}
stDebug("s-task:%s complete retry shuffle-dispatch blocks to all %d vnodes, msgId:%d", pTask->id.idStr,
- numOfFailed, msgId);
+ numOfRetry, msgId);
} else {
- int32_t vgId = pTask->outputInfo.fixedDispatcher.nodeId;
+ int32_t dstVgId = pTask->outputInfo.fixedDispatcher.nodeId;
SEpSet* pEpSet = &pTask->outputInfo.fixedDispatcher.epSet;
int32_t downstreamTaskId = pTask->outputInfo.fixedDispatcher.taskId;
- stDebug("s-task:%s (child taskId:%d) fix-dispatch %d block(s) to s-task:0x%x (vgId:%d), msgId:%d", id,
- pTask->info.selfChildId, 1, downstreamTaskId, vgId, msgId);
+ ASSERT(taosArrayGetSize(pTask->msgInfo.pSendInfo) == 1);
+ SDispatchEntry* pEntry = taosArrayGet(pTask->msgInfo.pSendInfo, 0);
- code = doSendDispatchMsg(pTask, pReq, vgId, pEpSet);
+ setResendInfo(pEntry, now);
+ code = doSendDispatchMsg(pTask, pReq, dstVgId, pEpSet);
+
+ stDebug("s-task:%s (child taskId:%d) fix-dispatch %d block(s) to s-task:0x%x (vgId:%d), msgId:%d, code:%s", id,
+ pTask->info.selfChildId, 1, downstreamTaskId, dstVgId, msgId, tstrerror(code));
}
-
- taosArrayDestroy(pList);
}
- if (code != TSDB_CODE_SUCCESS) {
- if (!streamTaskShouldStop(pTask)) {
- // stDebug("s-task:%s reset the waitRspCnt to be 0 before launch retry dispatch", pTask->id.idStr);
- // atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 0);
- if (streamTaskShouldPause(pTask)) {
- streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS * 10);
- } else {
- streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
- }
- } else {
- int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
- stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref);
- }
- } else {
+ if (streamTaskShouldStop(pTask)) {
int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
- stDebug("s-task:%s send success, jump out of timer, ref:%d", pTask->id.idStr, ref);
- }
-}
-
-void streamRetryDispatchData(SStreamTask* pTask, int64_t waitDuration) {
- pTask->msgInfo.retryCount++;
-
- stTrace("s-task:%s retry send dispatch data in %" PRId64 "ms, in timer msgId:%d, retryTimes:%d", pTask->id.idStr,
- waitDuration, pTask->execInfo.dispatch, pTask->msgInfo.retryCount);
-
- if (pTask->msgInfo.pRetryTmr != NULL) {
- taosTmrReset(doRetryDispatchData, waitDuration, pTask, streamTimer, &pTask->msgInfo.pRetryTmr);
+ stDebug("s-task:%s should stop, abort from timer, ref:%d", pTask->id.idStr, ref);
+ setNotInDispatchMonitor(pMsgInfo);
} else {
- pTask->msgInfo.pRetryTmr = taosTmrStart(doRetryDispatchData, waitDuration, pTask, streamTimer);
+ streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
}
}
-int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock, int32_t vgSz,
- int64_t groupId) {
+void streamStartMonitorDispatchData(SStreamTask* pTask, int64_t waitDuration) {
+ if (pTask->msgInfo.pRetryTmr != NULL) {
+ taosTmrReset(doMonitorDispatchData, waitDuration, pTask, streamTimer, &pTask->msgInfo.pRetryTmr);
+ } else {
+ pTask->msgInfo.pRetryTmr = taosTmrStart(doMonitorDispatchData, waitDuration, pTask, streamTimer);
+ }
+}
+
+int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, SSDataBlock* pDataBlock,
+ int64_t groupId, int64_t now) {
uint32_t hashValue = 0;
SArray* vgInfo = pTask->outputInfo.shuffleDispatcher.dbInfo.pVgroupInfos;
if (pTask->pNameMap == NULL) {
@@ -488,23 +587,24 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S
} else {
char ctbName[TSDB_TABLE_FNAME_LEN] = {0};
if (pDataBlock->info.parTbName[0]) {
- if(pTask->subtableWithoutMd5 != 1 &&
- !isAutoTableName(pDataBlock->info.parTbName) &&
- !alreadyAddGroupId(pDataBlock->info.parTbName, groupId) &&
- groupId != 0){
- if(pTask->ver == SSTREAM_TASK_SUBTABLE_CHANGED_VER){
+ if (pTask->subtableWithoutMd5 != 1 && !isAutoTableName(pDataBlock->info.parTbName) &&
+ !alreadyAddGroupId(pDataBlock->info.parTbName, groupId) && groupId != 0) {
+ if (pTask->ver == SSTREAM_TASK_SUBTABLE_CHANGED_VER) {
buildCtbNameAddGroupId(NULL, pDataBlock->info.parTbName, groupId);
- }else if(pTask->ver > SSTREAM_TASK_SUBTABLE_CHANGED_VER) {
+ } else if (pTask->ver > SSTREAM_TASK_SUBTABLE_CHANGED_VER) {
buildCtbNameAddGroupId(pTask->outputInfo.shuffleDispatcher.stbFullName, pDataBlock->info.parTbName, groupId);
}
}
} else {
buildCtbNameByGroupIdImpl(pTask->outputInfo.shuffleDispatcher.stbFullName, groupId, pDataBlock->info.parTbName);
}
- snprintf(ctbName, TSDB_TABLE_NAME_LEN, "%s.%s", pTask->outputInfo.shuffleDispatcher.dbInfo.db, pDataBlock->info.parTbName);
+
+ snprintf(ctbName, TSDB_TABLE_NAME_LEN, "%s.%s", pTask->outputInfo.shuffleDispatcher.dbInfo.db,
+ pDataBlock->info.parTbName);
/*uint32_t hashValue = MurmurHash3_32(ctbName, strlen(ctbName));*/
SUseDbRsp* pDbInfo = &pTask->outputInfo.shuffleDispatcher.dbInfo;
- hashValue = taosGetTbHashVal(ctbName, strlen(ctbName), pDbInfo->hashMethod, pDbInfo->hashPrefix, pDbInfo->hashSuffix);
+ hashValue =
+ taosGetTbHashVal(ctbName, strlen(ctbName), pDbInfo->hashMethod, pDbInfo->hashPrefix, pDbInfo->hashSuffix);
SBlockName bln = {0};
bln.hashValue = hashValue;
memcpy(bln.parTbName, pDataBlock->info.parTbName, strlen(pDataBlock->info.parTbName));
@@ -513,20 +613,24 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S
}
}
- bool found = false;
+ bool found = false;
+ int32_t numOfVgroups = taosArrayGetSize(vgInfo);
+
// TODO: optimize search
- int32_t j;
- for (j = 0; j < vgSz; j++) {
+ taosThreadMutexLock(&pTask->msgInfo.lock);
+
+ for (int32_t j = 0; j < numOfVgroups; j++) {
SVgroupInfo* pVgInfo = taosArrayGet(vgInfo, j);
- ASSERT(pVgInfo->vgId > 0);
if (hashValue >= pVgInfo->hashBegin && hashValue <= pVgInfo->hashEnd) {
if (streamAddBlockIntoDispatchMsg(pDataBlock, &pReqs[j]) < 0) {
+ taosThreadMutexUnlock(&pTask->msgInfo.lock);
return -1;
}
if (pReqs[j].blockNum == 0) {
- atomic_add_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1);
+ SVgroupInfo* pDstVgroupInfo = taosArrayGet(vgInfo, j);
+ addDispatchEntry(&pTask->msgInfo, pDstVgroupInfo->vgId, now, false);
}
pReqs[j].blockNum++;
@@ -534,10 +638,28 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S
break;
}
}
+
+ taosThreadMutexUnlock(&pTask->msgInfo.lock);
ASSERT(found);
return 0;
}
+static void initDispatchInfo(SDispatchMsgInfo* pInfo, int32_t msgId) {
+ pInfo->startTs = taosGetTimestampMs();
+ pInfo->rspTs = -1;
+ pInfo->msgId = msgId;
+}
+
+static void clearDispatchInfo(SDispatchMsgInfo* pInfo) {
+ pInfo->startTs = -1;
+ pInfo->msgId = -1;
+ pInfo->rspTs = -1;
+}
+
+static void updateDispatchInfo(SDispatchMsgInfo* pInfo, int64_t recvTs) {
+ pInfo->rspTs = recvTs;
+}
+
int32_t streamDispatchStreamBlock(SStreamTask* pTask) {
ASSERT((pTask->outputInfo.type == TASK_OUTPUT__FIXED_DISPATCH ||
pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH));
@@ -580,7 +702,7 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) {
type == STREAM_INPUT__TRANS_STATE);
pTask->execInfo.dispatch += 1;
- pTask->msgInfo.startTs = taosGetTimestampMs();
+ initDispatchInfo(&pTask->msgInfo, pTask->execInfo.dispatch);
int32_t code = doBuildDispatchMsg(pTask, pBlock);
if (code == 0) {
@@ -592,34 +714,21 @@ int32_t streamDispatchStreamBlock(SStreamTask* pTask) {
streamTaskInitTriggerDispatchInfo(pTask);
}
- int32_t retryCount = 0;
- while (1) {
- code = sendDispatchMsg(pTask, pTask->msgInfo.pData);
- if (code == TSDB_CODE_SUCCESS) {
- break;
- }
+ code = sendDispatchMsg(pTask, pTask->msgInfo.pData);
- stDebug("s-task:%s failed to dispatch msg:%d to downstream, code:%s, output status:%d, retry cnt:%d", id,
- pTask->execInfo.dispatch, tstrerror(terrno), pTask->outputq.status, retryCount);
-
- // todo deal with only partially success dispatch case
- atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 0);
- if (terrno == TSDB_CODE_APP_IS_STOPPING) { // in case of this error, do not retry anymore
- clearBufferedDispatchMsg(pTask);
- return code;
- }
-
- if (++retryCount > MAX_CONTINUE_RETRY_COUNT) { // add to timer to retry
- int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1);
- stDebug(
- "s-task:%s failed to dispatch msg to downstream for %d times, code:%s, add timer to retry in %dms, ref:%d",
- pTask->id.idStr, retryCount, tstrerror(terrno), DISPATCH_RETRY_INTERVAL_MS, ref);
-
- streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
- break;
- }
+ taosThreadMutexLock(&pTask->msgInfo.lock);
+ if (pTask->msgInfo.inMonitor == 0) {
+ int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1);
+ stDebug("s-task:%s start dispatch monitor tmr in %dms, ref:%d, dispatch code:%s", id, DISPATCH_RETRY_INTERVAL_MS, ref,
+ tstrerror(code));
+ streamStartMonitorDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
+ pTask->msgInfo.inMonitor = 1;
+ } else {
+ stDebug("s-task:%s already in dispatch monitor tmr", id);
}
+ taosThreadMutexUnlock(&pTask->msgInfo.lock);
+
// this block can not be deleted until it has been sent to downstream task successfully.
return TSDB_CODE_SUCCESS;
}
@@ -807,11 +916,13 @@ int32_t streamTaskSendCheckpointSourceRsp(SStreamTask* pTask) {
}
int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatchReq* pReq) {
- int32_t dataStrLen = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock);
+ int32_t dataStrLen = sizeof(SRetrieveTableRsp) + blockGetEncodeSize(pBlock) + PAYLOAD_PREFIX_LEN;
ASSERT(dataStrLen > 0);
- void* buf = taosMemoryCalloc(1, dataStrLen);
- if (buf == NULL) return -1;
+ void* buf = taosMemoryCalloc(1, dataStrLen);
+ if (buf == NULL) {
+ return -1;
+ }
SRetrieveTableRsp* pRetrieve = (SRetrieveTableRsp*)buf;
pRetrieve->useconds = 0;
@@ -829,10 +940,16 @@ int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatch
int32_t numOfCols = (int32_t)taosArrayGetSize(pBlock->pDataBlock);
pRetrieve->numOfCols = htonl(numOfCols);
- int32_t actualLen = blockEncode(pBlock, pRetrieve->data, numOfCols);
- actualLen += sizeof(SRetrieveTableRsp);
- ASSERT(actualLen <= dataStrLen);
- taosArrayPush(pReq->dataLen, &actualLen);
+ int32_t actualLen = blockEncode(pBlock, pRetrieve->data + PAYLOAD_PREFIX_LEN, numOfCols);
+ SET_PAYLOAD_LEN(pRetrieve->data, actualLen, actualLen);
+
+ int32_t payloadLen = actualLen + PAYLOAD_PREFIX_LEN;
+ pRetrieve->payloadLen = htonl(payloadLen);
+ pRetrieve->compLen = htonl(payloadLen);
+
+ payloadLen += sizeof(SRetrieveTableRsp);
+
+ taosArrayPush(pReq->dataLen, &payloadLen);
taosArrayPush(pReq->data, &buf);
pReq->totalLen += dataStrLen;
@@ -1018,23 +1135,6 @@ static int32_t handleDispatchSuccessRsp(SStreamTask* pTask, int32_t downstreamId
stDebug("s-task:%s destroy dispatch msg:%p", pTask->id.idStr, pTask->msgInfo.pData);
bool delayDispatch = (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER);
- if (delayDispatch) {
- taosThreadMutexLock(&pTask->lock);
- // we only set the dispatch msg info for current checkpoint trans
- if (streamTaskGetStatus(pTask)->state == TASK_STATUS__CK &&
- pTask->chkInfo.pActiveInfo->activeId == pTask->msgInfo.checkpointId) {
- ASSERT(pTask->chkInfo.pActiveInfo->transId == pTask->msgInfo.transId);
- stDebug("s-task:%s checkpoint-trigger msg to 0x%x rsp for checkpointId:%" PRId64 " transId:%d confirmed",
- pTask->id.idStr, downstreamId, pTask->msgInfo.checkpointId, pTask->msgInfo.transId);
-
- streamTaskSetTriggerDispatchConfirmed(pTask, downstreamNodeId);
- } else {
- stWarn("s-task:%s checkpoint-trigger msg rsp for checkpointId:%" PRId64 " transId:%d discard, since expired",
- pTask->id.idStr, pTask->msgInfo.checkpointId, pTask->msgInfo.transId);
- }
- taosThreadMutexUnlock(&pTask->lock);
- }
-
clearBufferedDispatchMsg(pTask);
int64_t el = taosGetTimestampMs() - pTask->msgInfo.startTs;
@@ -1061,17 +1161,59 @@ static int32_t handleDispatchSuccessRsp(SStreamTask* pTask, int32_t downstreamId
return 0;
}
-int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, int32_t code) {
- const char* id = pTask->id.idStr;
- int32_t vgId = pTask->pMeta->vgId;
- int32_t msgId = pTask->execInfo.dispatch;
+static int32_t setDispatchRspInfo(SDispatchMsgInfo* pMsgInfo, int32_t vgId, int32_t code, int64_t now, const char* id) {
+ int32_t numOfRsp = 0;
+ bool alreadySet = false;
+ bool updated = false;
-#if 0
- // for test purpose, build the failure case
- if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER) {
- pRsp->inputStatus = TASK_INPUT_STATUS__REFUSED;
+ taosThreadMutexLock(&pMsgInfo->lock);
+ for(int32_t j = 0; j < taosArrayGetSize(pMsgInfo->pSendInfo); ++j) {
+ SDispatchEntry* pEntry = taosArrayGet(pMsgInfo->pSendInfo, j);
+ if (pEntry->nodeId == vgId) {
+ ASSERT(!alreadySet);
+ pEntry->rspTs = now;
+ pEntry->status = code;
+ alreadySet = true;
+ updated = true;
+ stDebug("s-task:%s record the rsp recv, ts:%"PRId64" code:%d, idx:%d", id, now, code, j);
+ }
+
+ if (pEntry->rspTs != -1) {
+ numOfRsp += 1;
+ }
}
-#endif
+
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+ ASSERT(updated);
+
+ return numOfRsp;
+}
+
+bool isDispatchRspTimeout(SDispatchEntry* pEntry, int64_t now) {
+ return (pEntry->rspTs == -1) && (now - pEntry->sendTs) > 30 * 1000;
+}
+
+int32_t getFailedDispatchInfo(SDispatchMsgInfo* pMsgInfo, int64_t now) {
+ int32_t numOfFailed = 0;
+ taosThreadMutexLock(&pMsgInfo->lock);
+
+ for (int32_t j = 0; j < taosArrayGetSize(pMsgInfo->pSendInfo); ++j) {
+ SDispatchEntry* pEntry = taosArrayGet(pMsgInfo->pSendInfo, j);
+ if (pEntry->status != TSDB_CODE_SUCCESS || isDispatchRspTimeout(pEntry, now)) {
+ numOfFailed += 1;
+ }
+ }
+ taosThreadMutexUnlock(&pMsgInfo->lock);
+ return numOfFailed;
+}
+
+int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, int32_t code) {
+ const char* id = pTask->id.idStr;
+ int32_t vgId = pTask->pMeta->vgId;
+ SDispatchMsgInfo* pMsgInfo = &pTask->msgInfo;
+ int32_t msgId = pMsgInfo->msgId;
+ int64_t now = taosGetTimestampMs();
+ int32_t totalRsp = 0;
// follower not handle the dispatch rsp
if ((pTask->pMeta->role == NODE_ROLE_FOLLOWER) || (pTask->status.downstreamReady != 1)) {
@@ -1096,53 +1238,61 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
if (code == TSDB_CODE_STREAM_TASK_NOT_EXIST) { // destination task does not exist, not retry anymore
stError("s-task:%s failed to dispatch msg to task:0x%x(vgId:%d), msgId:%d no retry, since task destroyed already",
id, pRsp->downstreamTaskId, pRsp->downstreamNodeId, msgId);
+ totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, TSDB_CODE_SUCCESS, now, id);
} else {
stError("s-task:%s failed to dispatch msgId:%d to task:0x%x(vgId:%d), code:%s, add to retry list", id, msgId,
pRsp->downstreamTaskId, pRsp->downstreamNodeId, tstrerror(code));
- taosThreadMutexLock(&pTask->lock);
- taosArrayPush(pTask->msgInfo.pRetryList, &pRsp->downstreamNodeId);
- taosThreadMutexUnlock(&pTask->lock);
+ totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, code, now, id);
}
} else { // code == 0
if (pRsp->inputStatus == TASK_INPUT_STATUS__BLOCKED) {
pTask->inputq.status = TASK_INPUT_STATUS__BLOCKED;
// block the input of current task, to push pressure to upstream
- taosThreadMutexLock(&pTask->lock);
- taosArrayPush(pTask->msgInfo.pRetryList, &pRsp->downstreamNodeId);
- taosThreadMutexUnlock(&pTask->lock);
+ totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, pRsp->inputStatus, now, id);
+ stTrace("s-task:%s inputQ of downstream task:0x%x(vgId:%d) is full, wait for retry dispatch", id,
+ pRsp->downstreamTaskId, pRsp->downstreamNodeId);
+ } else {
+ if (pRsp->inputStatus == TASK_INPUT_STATUS__REFUSED) {
+ // todo handle the role-changed during checkpoint generation, add test case
+ stError(
+ "s-task:%s downstream task:0x%x(vgId:%d) refused the dispatch msg, downstream may become follower or "
+ "restart already, treat it as success",
+ id, pRsp->downstreamTaskId, pRsp->downstreamNodeId);
+ }
- stTrace("s-task:%s inputQ of downstream task:0x%x(vgId:%d) is full, wait for %dms and retry dispatch", id,
- pRsp->downstreamTaskId, pRsp->downstreamNodeId, DISPATCH_RETRY_INTERVAL_MS);
- } else if (pRsp->inputStatus == TASK_INPUT_STATUS__REFUSED) {
- // todo handle the agg task failure, add test case
- if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER &&
- pTask->info.taskLevel == TASK_LEVEL__SOURCE) {
- stError("s-task:%s failed to dispatch checkpoint-trigger msg, checkpointId:%" PRId64
- ", set the current checkpoint failed, and send rsp to mnode",
- id, pTask->chkInfo.pActiveInfo->activeId);
- { // send checkpoint failure msg to mnode directly
- pTask->chkInfo.pActiveInfo->failedId = pTask->chkInfo.pActiveInfo->activeId; // record the latest failed checkpoint id
- pTask->chkInfo.pActiveInfo->activeId = pTask->chkInfo.pActiveInfo->activeId;
- streamTaskSendCheckpointSourceRsp(pTask);
+ totalRsp = setDispatchRspInfo(pMsgInfo, pRsp->downstreamNodeId, TSDB_CODE_SUCCESS, now, id);
+
+ {
+ bool delayDispatch = (pMsgInfo->dispatchMsgType == STREAM_INPUT__CHECKPOINT_TRIGGER);
+ if (delayDispatch) {
+ taosThreadMutexLock(&pTask->lock);
+ // we only set the dispatch msg info for current checkpoint trans
+ if (streamTaskGetStatus(pTask)->state == TASK_STATUS__CK &&
+ pTask->chkInfo.pActiveInfo->activeId == pMsgInfo->checkpointId) {
+ ASSERT(pTask->chkInfo.pActiveInfo->transId == pMsgInfo->transId);
+ stDebug("s-task:%s checkpoint-trigger msg to 0x%x rsp for checkpointId:%" PRId64 " transId:%d confirmed",
+ pTask->id.idStr, pRsp->downstreamTaskId, pMsgInfo->checkpointId, pMsgInfo->transId);
+
+ streamTaskSetTriggerDispatchConfirmed(pTask, pRsp->downstreamNodeId);
+ } else {
+ stWarn("s-task:%s checkpoint-trigger msg rsp for checkpointId:%" PRId64
+ " transId:%d discard, since expired",
+ pTask->id.idStr, pMsgInfo->checkpointId, pMsgInfo->transId);
+ }
+ taosThreadMutexUnlock(&pTask->lock);
}
- } else {
- stError("s-task:%s downstream task:0x%x(vgId:%d) refused the dispatch msg, treat it as success", id,
- pRsp->downstreamTaskId, pRsp->downstreamNodeId);
}
}
}
- int32_t leftRsp = 0;
+ int32_t notRsp = taosArrayGetSize(pMsgInfo->pSendInfo) - totalRsp;
if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) {
- leftRsp = atomic_sub_fetch_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, 1);
- ASSERT(leftRsp >= 0);
-
- if (leftRsp > 0) {
+ if (notRsp > 0) {
stDebug(
"s-task:%s recv dispatch rsp, msgId:%d from 0x%x(vgId:%d), downstream task input status:%d code:%s, waiting "
"for %d rsp",
- id, msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code), leftRsp);
+ id, msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code), notRsp);
} else {
stDebug(
"s-task:%s recv dispatch rsp, msgId:%d from 0x%x(vgId:%d), downstream task input status:%d code:%s, all rsp",
@@ -1153,31 +1303,17 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
msgId, pRsp->downstreamTaskId, pRsp->downstreamNodeId, pRsp->inputStatus, tstrerror(code));
}
- ASSERT(leftRsp >= 0);
-
// all msg rsp already, continue
- if (leftRsp == 0) {
+ if (notRsp == 0) {
ASSERT(pTask->outputq.status == TASK_OUTPUT_STATUS__WAIT);
// we need to re-try send dispatch msg to downstream tasks
- int32_t numOfFailed = taosArrayGetSize(pTask->msgInfo.pRetryList);
- if (numOfFailed > 0) {
- if (pTask->outputInfo.type == TASK_OUTPUT__SHUFFLE_DISPATCH) {
- atomic_store_32(&pTask->outputInfo.shuffleDispatcher.waitingRspCnt, numOfFailed);
- stDebug("s-task:%s waiting rsp set to be %d", id, pTask->outputInfo.shuffleDispatcher.waitingRspCnt);
- }
-
- int32_t ref = atomic_add_fetch_32(&pTask->status.timerActive, 1);
- stDebug("s-task:%s failed to dispatch msg to downstream, add into timer to retry in %dms, ref:%d",
- pTask->id.idStr, DISPATCH_RETRY_INTERVAL_MS, ref);
-
- streamRetryDispatchData(pTask, DISPATCH_RETRY_INTERVAL_MS);
- } else { // this message has been sent successfully, let's try next one.
- pTask->msgInfo.retryCount = 0;
-
+ int32_t numOfFailed = getFailedDispatchInfo(pMsgInfo, now);
+ if (numOfFailed == 0) { // this message has been sent successfully, let's try next one.
// trans-state msg has been sent to downstream successfully. let's transfer the fill-history task state
- if (pTask->msgInfo.dispatchMsgType == STREAM_INPUT__TRANS_STATE) {
- stDebug("s-task:%s dispatch trans-state msgId:%d to downstream successfully, start to prepare transfer state", id, msgId);
+ if (pMsgInfo->dispatchMsgType == STREAM_INPUT__TRANS_STATE) {
+ stDebug("s-task:%s dispatch trans-state msgId:%d to downstream successfully, start to prepare transfer state",
+ id, msgId);
ASSERT(pTask->info.fillHistory == 1);
code = streamTransferStatePrepare(pTask);
@@ -1296,7 +1432,5 @@ int32_t streamProcessDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pReq, S
}
streamTrySchedExec(pTask);
-
return 0;
}
-
diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c
index 1828409f89..b0915640cc 100644
--- a/source/libs/stream/src/streamExec.c
+++ b/source/libs/stream/src/streamExec.c
@@ -541,14 +541,14 @@ int32_t streamProcessTransstateBlock(SStreamTask* pTask, SStreamDataBlock* pBloc
//static void streamTaskSetIdleInfo(SStreamTask* pTask, int32_t idleTime) { pTask->status.schedIdleTime = idleTime; }
static void setLastExecTs(SStreamTask* pTask, int64_t ts) { pTask->status.lastExecTs = ts; }
-static void doStreamTaskExecImpl(SStreamTask* pTask, SStreamQueueItem* pBlock) {
+static void doStreamTaskExecImpl(SStreamTask* pTask, SStreamQueueItem* pBlock, int32_t num) {
const char* id = pTask->id.idStr;
int32_t blockSize = 0;
int64_t st = taosGetTimestampMs();
SCheckpointInfo* pInfo = &pTask->chkInfo;
int64_t ver = pInfo->processedVer;
- stDebug("s-task:%s start to process batch of blocks, num:%d, type:%s", id, 1, "checkpoint-trigger");
+ stDebug("s-task:%s start to process batch blocks, num:%d, type:%s", id, num, streamQueueItemGetTypeStr(pBlock->type));
doSetStreamInputBlock(pTask, pBlock, &ver, id);
@@ -607,7 +607,7 @@ void flushStateDataInExecutor(SStreamTask* pTask, SStreamQueueItem* pCheckpointB
}
// 2. flush data in executor to K/V store, which should be completed before do checkpoint in the K/V.
- doStreamTaskExecImpl(pTask, pCheckpointBlock);
+ doStreamTaskExecImpl(pTask, pCheckpointBlock, 1);
}
/**
@@ -615,7 +615,7 @@ void flushStateDataInExecutor(SStreamTask* pTask, SStreamQueueItem* pCheckpointB
* appropriate batch of blocks should be handled in 5 to 10 sec.
*/
static int32_t doStreamExecTask(SStreamTask* pTask) {
- const char* id = pTask->id.idStr;
+ const char* id = pTask->id.idStr;
// merge multiple input data if possible in the input queue.
stDebug("s-task:%s start to extract data block from inputQ", id);
@@ -643,7 +643,7 @@ static int32_t doStreamExecTask(SStreamTask* pTask) {
}
if (taosGetTimestampMs() - pTask->status.lastExecTs < MIN_INVOKE_INTERVAL) {
- stDebug("s-task:%s invoke with high frequency, idle and retry exec in 50ms", id);
+ stDebug("s-task:%s invoke exec too fast, idle and retry in 50ms", id);
streamTaskSetIdleInfo(pTask, MIN_INVOKE_INTERVAL);
return 0;
}
@@ -698,21 +698,16 @@ static int32_t doStreamExecTask(SStreamTask* pTask) {
}
if (type != STREAM_INPUT__CHECKPOINT) {
- doStreamTaskExecImpl(pTask, pInput);
- }
-
- streamFreeQitem(pInput);
-
- // todo other thread may change the status
+ doStreamTaskExecImpl(pTask, pInput, numOfBlocks);
+ streamFreeQitem(pInput);
+ } else { // todo other thread may change the status
// do nothing after sync executor state to storage backend, untill the vnode-level checkpoint is completed.
- if (type == STREAM_INPUT__CHECKPOINT) {
- // todo add lock
+ taosThreadMutexLock(&pTask->lock);
SStreamTaskState* pState = streamTaskGetStatus(pTask);
if (pState->state == TASK_STATUS__CK) {
stDebug("s-task:%s checkpoint block received, set status:%s", id, pState->name);
streamTaskBuildCheckpoint(pTask);
- } else {
- // todo refactor
+ } else { // todo refactor
int32_t code = 0;
if (pTask->info.taskLevel == TASK_LEVEL__SOURCE) {
code = streamTaskSendCheckpointSourceRsp(pTask);
@@ -727,6 +722,8 @@ static int32_t doStreamExecTask(SStreamTask* pTask) {
}
}
+ taosThreadMutexUnlock(&pTask->lock);
+ streamFreeQitem(pInput);
return 0;
}
}
diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c
index f6449829a3..e8800c3370 100644
--- a/source/libs/stream/src/streamMeta.c
+++ b/source/libs/stream/src/streamMeta.c
@@ -299,8 +299,8 @@ void streamMetaRemoveDB(void* arg, char* key) {
taosThreadMutexUnlock(&pMeta->backendMutex);
}
-SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc, int32_t vgId, int64_t stage,
- startComplete_fn_t fn) {
+SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskBuild buildTaskFn, FTaskExpand expandTaskFn,
+ int32_t vgId, int64_t stage, startComplete_fn_t fn) {
SStreamMeta* pMeta = taosMemoryCalloc(1, sizeof(SStreamMeta));
if (pMeta == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@@ -369,9 +369,11 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
pMeta->scanInfo.scanCounter = 0;
pMeta->vgId = vgId;
pMeta->ahandle = ahandle;
- pMeta->expandFunc = expandFunc;
+ pMeta->buildTaskFn = buildTaskFn;
+ pMeta->expandTaskFn = expandTaskFn;
pMeta->stage = stage;
pMeta->role = (vgId == SNODE_HANDLE) ? NODE_ROLE_LEADER : NODE_ROLE_UNINIT;
+ pMeta->updateInfo.transId = -1;
pMeta->startInfo.completeFn = fn;
pMeta->pTaskDbUnique = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
@@ -601,11 +603,12 @@ int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTa
return 0;
}
- if (pMeta->expandFunc(pMeta->ahandle, pTask, ver) < 0) {
+ if (pMeta->buildTaskFn(pMeta->ahandle, pTask, ver) < 0) {
return -1;
}
taosArrayPush(pMeta->pTaskList, &pTask->id);
+ taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES);
if (streamMetaSaveTask(pMeta, pTask) < 0) {
return -1;
@@ -615,7 +618,6 @@ int32_t streamMetaRegisterTask(SStreamMeta* pMeta, int64_t ver, SStreamTask* pTa
return -1;
}
- taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES);
if (pTask->info.fillHistory == 0) {
atomic_add_fetch_32(&pMeta->numOfStreamTasks, 1);
}
@@ -670,14 +672,17 @@ void streamMetaReleaseTask(SStreamMeta* UNUSED_PARAM(pMeta), SStreamTask* pTask)
}
}
-static void doRemoveIdFromList(SStreamMeta* pMeta, int32_t num, SStreamTaskId* id) {
+static void doRemoveIdFromList(SArray* pTaskList, int32_t num, SStreamTaskId* id) {
+ bool remove = false;
for (int32_t i = 0; i < num; ++i) {
- SStreamTaskId* pTaskId = taosArrayGet(pMeta->pTaskList, i);
+ SStreamTaskId* pTaskId = taosArrayGet(pTaskList, i);
if (pTaskId->streamId == id->streamId && pTaskId->taskId == id->taskId) {
- taosArrayRemove(pMeta->pTaskList, i);
+ taosArrayRemove(pTaskList, i);
+ remove = true;
break;
}
}
+ ASSERT(remove);
}
static int32_t streamTaskSendTransSuccessMsg(SStreamTask* pTask, void* param) {
@@ -713,7 +718,7 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t
}
streamMetaWUnLock(pMeta);
- stDebug("s-task:0x%x set task status:dropping and start to unregister it", taskId);
+ stDebug("s-task:0x%x vgId:%d set task status:dropping and start to unregister it", taskId, pMeta->vgId);
while (1) {
streamMetaRLock(pMeta);
@@ -740,18 +745,19 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t
ppTask = (SStreamTask**)taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
if (ppTask) {
pTask = *ppTask;
-
// it is an fill-history task, remove the related stream task's id that points to it
- atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1);
+ if (pTask->info.fillHistory == 0) {
+ atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1);
+ }
taosHashRemove(pMeta->pTasksMap, &id, sizeof(id));
- doRemoveIdFromList(pMeta, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id);
+ doRemoveIdFromList(pMeta->pTaskList, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id);
streamMetaRemoveTask(pMeta, &id);
+ ASSERT(taosHashGetSize(pMeta->pTasksMap) == taosArrayGetSize(pMeta->pTaskList));
streamMetaWUnLock(pMeta);
ASSERT(pTask->status.timerActive == 0);
-
if (pTask->info.delaySchedParam != 0 && pTask->info.fillHistory == 0) {
stDebug("s-task:%s stop schedTimer, and (before) desc ref:%d", pTask->id.idStr, pTask->refCnt);
taosTmrStop(pTask->schedInfo.pDelayTimer);
@@ -900,7 +906,7 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta) {
STaskId id = {.streamId = pTask->id.streamId, .taskId = pTask->id.taskId};
void* p = taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
if (p == NULL) {
- code = pMeta->expandFunc(pMeta->ahandle, pTask, pTask->chkInfo.checkpointVer + 1);
+ code = pMeta->buildTaskFn(pMeta->ahandle, pTask, pTask->chkInfo.checkpointVer + 1);
if (code < 0) {
stError("failed to expand s-task:0x%"PRIx64", code:%s, continue", id.taskId, tstrerror(terrno));
tFreeStreamTask(pTask);
@@ -1005,9 +1011,10 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) {
hbMsg.pUpdateNodes = taosArrayInit(numOfTasks, sizeof(int32_t));
for (int32_t i = 0; i < numOfTasks; ++i) {
- STaskId* pId = taosArrayGet(pMeta->pTaskList, i);
+ SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i);
- SStreamTask** pTask = taosHashGet(pMeta->pTasksMap, pId, sizeof(*pId));
+ STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId};
+ SStreamTask** pTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
if (pTask == NULL) {
continue;
}
@@ -1018,7 +1025,7 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) {
}
STaskStatusEntry entry = {
- .id = *pId,
+ .id = id,
.status = streamTaskGetStatus(*pTask)->state,
.nodeId = hbMsg.vgId,
.stage = pMeta->stage,
@@ -1506,8 +1513,9 @@ int32_t streamMetaStopAllTasks(SStreamMeta* pMeta) {
bool streamMetaAllTasksReady(const SStreamMeta* pMeta) {
int32_t num = taosArrayGetSize(pMeta->pTaskList);
for (int32_t i = 0; i < num; ++i) {
- STaskId* pTaskId = taosArrayGet(pMeta->pTaskList, i);
- SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, pTaskId, sizeof(*pTaskId));
+ SStreamTaskId* pId = taosArrayGet(pMeta->pTaskList, i);
+ STaskId id = {.streamId = pId->streamId, .taskId = pId->taskId};
+ SStreamTask** ppTask = taosHashGet(pMeta->pTasksMap, &id, sizeof(id));
if (ppTask == NULL) {
continue;
}
@@ -1521,6 +1529,7 @@ bool streamMetaAllTasksReady(const SStreamMeta* pMeta) {
}
int32_t streamMetaStartOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t taskId, __stream_task_expand_fn expandFn) {
+ int32_t code = 0;
int32_t vgId = pMeta->vgId;
stInfo("vgId:%d start task:0x%x by checking it's downstream status", vgId, taskId);
@@ -1540,40 +1549,22 @@ int32_t streamMetaStartOneTask(SStreamMeta* pMeta, int64_t streamId, int32_t tas
ASSERT(pTask->status.downstreamReady == 0);
if (pTask->pBackend == NULL) {
- int32_t code = expandFn(pTask);
+ code = expandFn(pTask);
if (code != TSDB_CODE_SUCCESS) {
streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs);
- streamMetaReleaseTask(pMeta, pTask);
- return code;
- }
-
- if (HAS_RELATED_FILLHISTORY_TASK(pTask)) {
- SStreamTask* pHTask = streamMetaAcquireTask(pMeta, pTask->hTaskInfo.id.streamId, pTask->hTaskInfo.id.taskId);
- if (pHTask != NULL) {
- if (pHTask->pBackend == NULL) {
- code = expandFn(pHTask);
- if (code != TSDB_CODE_SUCCESS) {
- streamMetaAddFailedTaskSelf(pHTask, pInfo->readyTs);
-
- streamMetaReleaseTask(pMeta, pHTask);
- streamMetaReleaseTask(pMeta, pTask);
- return code;
- }
- }
-
- streamMetaReleaseTask(pMeta, pHTask);
- }
}
}
- int32_t ret = streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_INIT);
- if (ret != TSDB_CODE_SUCCESS) {
- stError("s-task:%s vgId:%d failed to handle event:%d", pTask->id.idStr, pMeta->vgId, TASK_EVENT_INIT);
- streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs);
+ if (code == TSDB_CODE_SUCCESS) {
+ code = streamTaskHandleEvent(pTask->status.pSM, TASK_EVENT_INIT);
+ if (code != TSDB_CODE_SUCCESS) {
+ stError("s-task:%s vgId:%d failed to handle event:%d", pTask->id.idStr, pMeta->vgId, TASK_EVENT_INIT);
+ streamMetaAddFailedTaskSelf(pTask, pInfo->readyTs);
+ }
}
streamMetaReleaseTask(pMeta, pTask);
- return ret;
+ return code;
}
static void displayStatusInfo(SStreamMeta* pMeta, SHashObj* pTaskSet, bool succ) {
@@ -1740,4 +1731,14 @@ void streamMetaAddIntoUpdateTaskList(SStreamMeta* pMeta, SStreamTask* pTask, SSt
stDebug("s-task:%s vgId:%d transId:%d task nodeEp update completed, streamTask closed, elapsed time:%" PRId64 "ms",
id, vgId, transId, el);
}
+}
+
+void streamMetaClearUpdateTaskList(SStreamMeta* pMeta) {
+ taosHashClear(pMeta->updateInfo.pTasks);
+ pMeta->updateInfo.transId = -1;
+}
+
+void streamMetaInitUpdateTaskList(SStreamMeta* pMeta, int32_t transId) {
+ taosHashClear(pMeta->updateInfo.pTasks);
+ pMeta->updateInfo.transId = transId;
}
\ No newline at end of file
diff --git a/source/libs/stream/src/streamSessionState.c b/source/libs/stream/src/streamSessionState.c
index 4c61e6da1d..005fd1603c 100644
--- a/source/libs/stream/src/streamSessionState.c
+++ b/source/libs/stream/src/streamSessionState.c
@@ -516,24 +516,25 @@ SStreamStateCur* countWinStateSeekKeyPrev(SStreamFileState* pFileState, const SS
return pBuffCur;
}
winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE))));
+ taosMemoryFreeClear(pVal);
+ streamStateFreeCur(pBuffCur);
if (sessionRangeKeyCmpr(pWinKey, &key) != 0 && winCount == count) {
- streamStateFreeCur(pCur);
- return pBuffCur;
+ streamStateCurNext(pFileStore, pCur);
+ return pCur;
}
streamStateCurPrev(pFileStore, pCur);
while (1) {
code = streamStateSessionGetKVByCur_rocksdb(pCur, &key, &pVal, &len);
if (code == TSDB_CODE_FAILED) {
streamStateCurNext(pFileStore, pCur);
- streamStateFreeCur(pBuffCur);
return pCur;
}
winCount = *((COUNT_TYPE*) ((char*)pVal + (resSize - sizeof(COUNT_TYPE))));
+ taosMemoryFreeClear(pVal);
if (sessionRangeKeyCmpr(pWinKey, &key) == 0 || winCount < count) {
streamStateCurPrev(pFileStore, pCur);
} else {
streamStateCurNext(pFileStore, pCur);
- streamStateFreeCur(pBuffCur);
return pCur;
}
}
@@ -568,7 +569,7 @@ int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void
void* pData = NULL;
code = streamStateSessionGetKVByCur_rocksdb(pCur, pKey, &pData, pVLen);
if (taosArrayGetSize(pWinStates) > 0 &&
- (code == TSDB_CODE_FAILED || sessionStateKeyCompare(pKey, pWinStates, 0) >= 0)) {
+ (code == TSDB_CODE_FAILED || sessionStateRangeKeyCompare(pKey, pWinStates, 0) >= 0)) {
transformCursor(pCur->pStreamFileState, pCur);
SRowBuffPos* pPos = taosArrayGetP(pWinStates, pCur->buffIndex);
if (pVal) {
@@ -590,6 +591,7 @@ int32_t sessionWinStateGetKVByCur(SStreamStateCur* pCur, SSessionKey* pKey, void
}
int32_t sessionWinStateMoveToNext(SStreamStateCur* pCur) {
+ qTrace("move cursor to next");
if (pCur && pCur->buffIndex >= 0) {
pCur->buffIndex++;
} else {
diff --git a/source/libs/stream/src/streamStartHistory.c b/source/libs/stream/src/streamStartHistory.c
index 7a864a60d2..050d88aaf1 100644
--- a/source/libs/stream/src/streamStartHistory.c
+++ b/source/libs/stream/src/streamStartHistory.c
@@ -197,6 +197,9 @@ int32_t streamLaunchFillHistoryTask(SStreamTask* pTask) {
const char* idStr = pTask->id.idStr;
int64_t hStreamId = pTask->hTaskInfo.id.streamId;
int32_t hTaskId = pTask->hTaskInfo.id.taskId;
+ int64_t now = taosGetTimestampMs();
+ int32_t code = 0;
+
ASSERT(hTaskId != 0);
// check stream task status in the first place.
@@ -226,7 +229,18 @@ int32_t streamLaunchFillHistoryTask(SStreamTask* pTask) {
stDebug("s-task:%s fill-history task is ready, no need to check downstream", pHisTask->id.idStr);
streamMetaAddTaskLaunchResult(pMeta, hStreamId, hTaskId, pExecInfo->checkTs, pExecInfo->readyTs, true);
} else { // exist, but not ready, continue check downstream task status
- checkFillhistoryTaskStatus(pTask, pHisTask);
+ if (pHisTask->pBackend == NULL) {
+ code = pMeta->expandTaskFn(pHisTask);
+ if (code != TSDB_CODE_SUCCESS) {
+ streamMetaAddFailedTaskSelf(pHisTask, now);
+ stError("s-task:%s failed to expand fill-history task, code:%s", pHisTask->id.idStr, tstrerror(code));
+ }
+ }
+
+ if (code == TSDB_CODE_SUCCESS) {
+ checkFillhistoryTaskStatus(pTask, pHisTask);
+ }
+
}
streamMetaReleaseTask(pMeta, pHisTask);
@@ -306,6 +320,7 @@ void tryLaunchHistoryTask(void* param, void* tmrId) {
SLaunchHTaskInfo* pInfo = param;
SStreamMeta* pMeta = pInfo->pMeta;
int64_t now = taosGetTimestampMs();
+ int32_t code = 0;
streamMetaWLock(pMeta);
@@ -362,13 +377,22 @@ void tryLaunchHistoryTask(void* param, void* tmrId) {
streamMetaReleaseTask(pMeta, pTask);
return;
} else {
- checkFillhistoryTaskStatus(pTask, pHTask);
- streamMetaReleaseTask(pMeta, pHTask);
+ if (pHTask->pBackend == NULL) {
+ code = pMeta->expandTaskFn(pHTask);
+ if (code != TSDB_CODE_SUCCESS) {
+ streamMetaAddFailedTaskSelf(pHTask, now);
+ stError("failed to expand fill-history task:%s, code:%s", pHTask->id.idStr, tstrerror(code));
+ }
+ }
- // not in timer anymore
- int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
- stDebug("s-task:0x%x fill-history task launch completed, retry times:%d, ref:%d", (int32_t)pInfo->id.taskId,
- pHTaskInfo->retryTimes, ref);
+ if (code == TSDB_CODE_SUCCESS) {
+ checkFillhistoryTaskStatus(pTask, pHTask);
+ // not in timer anymore
+ int32_t ref = atomic_sub_fetch_32(&pTask->status.timerActive, 1);
+ stDebug("s-task:0x%x fill-history task launch completed, retry times:%d, ref:%d", (int32_t)pInfo->id.taskId,
+ pHTaskInfo->retryTimes, ref);
+ }
+ streamMetaReleaseTask(pMeta, pHTask);
}
}
diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c
index 47324bd8c9..57bc7e2d2d 100644
--- a/source/libs/stream/src/streamState.c
+++ b/source/libs/stream/src/streamState.c
@@ -98,7 +98,8 @@ int stateKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2) {
return winKeyCmprImpl(&pWin1->key, &pWin2->key);
}
-SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int32_t szPage, int32_t pages) {
+SStreamState* streamStateOpen(const char* path, void* pTask, int64_t streamId, int32_t taskId, bool specPath,
+ int32_t szPage, int32_t pages) {
SStreamState* pState = taosMemoryCalloc(1, sizeof(SStreamState));
stDebug("open stream state %p, %s", pState, path);
if (pState == NULL) {
@@ -114,8 +115,8 @@ SStreamState* streamStateOpen(const char* path, void* pTask, bool specPath, int3
}
SStreamTask* pStreamTask = pTask;
- pState->taskId = pStreamTask->id.taskId;
- pState->streamId = pStreamTask->id.streamId;
+ pState->streamId = streamId;
+ pState->taskId = taskId;
sprintf(pState->pTdbState->idstr, "0x%" PRIx64 "-0x%x", pState->streamId, pState->taskId);
streamTaskSetDb(pStreamTask->pMeta, pTask, pState->pTdbState->idstr);
@@ -654,6 +655,7 @@ int32_t streamStateCurNext(SStreamState* pState, SStreamStateCur* pCur) {
int32_t streamStateCurPrev(SStreamState* pState, SStreamStateCur* pCur) {
#ifdef USE_ROCKSDB
+ qTrace("move cursor to next");
return streamStateCurPrev_rocksdb(pCur);
#else
if (!pCur) {
diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c
index dc9d2166e6..7d869ce538 100644
--- a/source/libs/stream/src/streamTask.c
+++ b/source/libs/stream/src/streamTask.c
@@ -283,10 +283,12 @@ void tFreeStreamTask(SStreamTask* pTask) {
pTask->status.pSM = streamDestroyStateMachine(pTask->status.pSM);
streamTaskDestroyUpstreamInfo(&pTask->upstreamInfo);
- pTask->msgInfo.pRetryList = taosArrayDestroy(pTask->msgInfo.pRetryList);
taosMemoryFree(pTask->outputInfo.pTokenBucket);
taosThreadMutexDestroy(&pTask->lock);
+ pTask->msgInfo.pSendInfo = taosArrayDestroy(pTask->msgInfo.pSendInfo);
+ taosThreadMutexDestroy(&pTask->msgInfo.lock);
+
pTask->outputInfo.pNodeEpsetUpdateList = taosArrayDestroy(pTask->outputInfo.pNodeEpsetUpdateList);
if ((pTask->status.removeBackendFiles) && (pTask->pMeta != NULL)) {
@@ -373,7 +375,13 @@ int32_t streamTaskInit(SStreamTask* pTask, SStreamMeta* pMeta, SMsgCb* pMsgCb, i
pTask->pMeta = pMeta;
pTask->pMsgCb = pMsgCb;
- pTask->msgInfo.pRetryList = taosArrayInit(4, sizeof(int32_t));
+ pTask->msgInfo.pSendInfo = taosArrayInit(4, sizeof(SDispatchEntry));
+ if (pTask->msgInfo.pSendInfo == NULL) {
+ stError("s-task:%s failed to create sendInfo struct for stream task, code:Out of memory", pTask->id.idStr);
+ return terrno;
+ }
+
+ taosThreadMutexInit(&pTask->msgInfo.lock, NULL);
TdThreadMutexAttr attr = {0};
@@ -731,35 +739,50 @@ int32_t streamBuildAndSendDropTaskMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskI
return code;
}
-int32_t streamBuildAndSendCheckpointUpdateMsg(SMsgCb* pMsgCb, int32_t vgId, SStreamTaskId* pTaskId, STaskId* pHTaskId,
- SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask) {
- SVUpdateCheckpointInfoReq* pReq = rpcMallocCont(sizeof(SVUpdateCheckpointInfoReq));
- if (pReq == NULL) {
- terrno = TSDB_CODE_OUT_OF_MEMORY;
+int32_t streamSendChkptReportMsg(SStreamTask* pTask, SCheckpointInfo* pCheckpointInfo, int8_t dropRelHTask) {
+ int32_t code;
+ int32_t tlen = 0;
+ int32_t vgId = pTask->pMeta->vgId;
+ const char* id = pTask->id.idStr;
+ SActiveCheckpointInfo* pActive = pCheckpointInfo->pActiveInfo;
+
+ SCheckpointReport req = {.streamId = pTask->id.streamId,
+ .taskId = pTask->id.taskId,
+ .nodeId = vgId,
+ .dropHTask = dropRelHTask,
+ .transId = pActive->transId,
+ .checkpointId = pActive->activeId,
+ .checkpointVer = pCheckpointInfo->processedVer,
+ .checkpointTs = pCheckpointInfo->startTs};
+
+ tEncodeSize(tEncodeStreamTaskChkptReport, &req, tlen, code);
+ if (code < 0) {
+ stError("s-task:%s vgId:%d encode stream task checkpoint-report failed, code:%s", id, vgId, tstrerror(code));
return -1;
}
- pReq->head.vgId = vgId;
- pReq->taskId = pTaskId->taskId;
- pReq->streamId = pTaskId->streamId;
- pReq->dropRelHTask = dropRelHTask;
- pReq->hStreamId = pHTaskId->streamId;
- pReq->hTaskId = pHTaskId->taskId;
- pReq->transId = pCheckpointInfo->pActiveInfo->transId;
-
- pReq->checkpointId = pCheckpointInfo->pActiveInfo->activeId;
- pReq->checkpointVer = pCheckpointInfo->processedVer;
- pReq->checkpointTs = pCheckpointInfo->startTs;
-
- SRpcMsg msg = {.msgType = TDMT_STREAM_TASK_UPDATE_CHKPT, .pCont = pReq, .contLen = sizeof(SVUpdateCheckpointInfoReq)};
- int32_t code = tmsgPutToQueue(pMsgCb, WRITE_QUEUE, &msg);
-
- if (code != TSDB_CODE_SUCCESS) {
- stError("vgId:%d task:0x%x failed to send update checkpoint info msg, code:%s", vgId, pTaskId->taskId, tstrerror(code));
- } else {
- stDebug("vgId:%d task:0x%x build and send update checkpoint info msg msg", vgId, pTaskId->taskId);
+ void* buf = rpcMallocCont(tlen);
+ if (buf == NULL) {
+ stError("s-task:%s vgId:%d encode stream task checkpoint-report msg failed, code:%s", id, vgId,
+ tstrerror(TSDB_CODE_OUT_OF_MEMORY));
+ return -1;
}
- return code;
+
+ SEncoder encoder;
+ tEncoderInit(&encoder, buf, tlen);
+ if ((code = tEncodeStreamTaskChkptReport(&encoder, &req)) < 0) {
+ rpcFreeCont(buf);
+ stError("s-task:%s vgId:%d encode stream task checkpoint-report msg failed, code:%s", id, vgId, tstrerror(code));
+ return -1;
+ }
+ tEncoderClear(&encoder);
+
+ SRpcMsg msg = {0};
+ initRpcMsg(&msg, TDMT_MND_STREAM_CHKPT_REPORT, buf, tlen);
+ stDebug("s-task:%s vgId:%d build and send task checkpoint-report to mnode", id, vgId);
+
+ tmsgSendReq(&pTask->info.mnodeEpset, &msg);
+ return 0;
}
STaskId streamTaskGetTaskId(const SStreamTask* pTask) {
@@ -921,32 +944,36 @@ char* createStreamTaskIdStr(int64_t streamId, int32_t taskId) {
static int32_t streamTaskEnqueueRetrieve(SStreamTask* pTask, SStreamRetrieveReq* pReq) {
SStreamDataBlock* pData = taosAllocateQitem(sizeof(SStreamDataBlock), DEF_QITEM, sizeof(SStreamDataBlock));
- int8_t status = TASK_INPUT_STATUS__NORMAL;
-
- // enqueue
- if (pData != NULL) {
- stDebug("s-task:%s (child %d) recv retrieve req from task:0x%x(vgId:%d), reqId:0x%" PRIx64, pTask->id.idStr,
- pTask->info.selfChildId, pReq->srcTaskId, pReq->srcNodeId, pReq->reqId);
-
- pData->type = STREAM_INPUT__DATA_RETRIEVE;
- pData->srcVgId = 0;
- streamRetrieveReqToData(pReq, pData);
- if (streamTaskPutDataIntoInputQ(pTask, (SStreamQueueItem*)pData) == 0) {
- status = TASK_INPUT_STATUS__NORMAL;
- } else {
- status = TASK_INPUT_STATUS__FAILED;
- }
- } else { // todo handle oom
- /*streamTaskInputFail(pTask);*/
- /*status = TASK_INPUT_STATUS__FAILED;*/
+ if (pData == NULL) {
+ stError("s-task:%s failed to allocated retrieve-block", pTask->id.idStr);
+ return terrno;
}
- return status == TASK_INPUT_STATUS__NORMAL ? 0 : -1;
+ // enqueue
+ stDebug("s-task:%s (vgId:%d level:%d) recv retrieve req from task:0x%x(vgId:%d), reqId:0x%" PRIx64, pTask->id.idStr,
+ pTask->pMeta->vgId, pTask->info.taskLevel, pReq->srcTaskId, pReq->srcNodeId, pReq->reqId);
+
+ pData->type = STREAM_INPUT__DATA_RETRIEVE;
+ pData->srcVgId = 0;
+
+ int32_t code = streamRetrieveReqToData(pReq, pData, pTask->id.idStr);
+ if (code != TSDB_CODE_SUCCESS) {
+ taosFreeQitem(pData);
+ return code;
+ }
+
+ code = streamTaskPutDataIntoInputQ(pTask, (SStreamQueueItem*)pData);
+ if (code != TSDB_CODE_SUCCESS) {
+ stError("s-task:%s failed to put retrieve-block into inputQ, inputQ is full, discard the retrieve msg",
+ pTask->id.idStr);
+ }
+
+ return code;
}
int32_t streamProcessRetrieveReq(SStreamTask* pTask, SStreamRetrieveReq* pReq) {
int32_t code = streamTaskEnqueueRetrieve(pTask, pReq);
- if(code != 0){
+ if (code != 0) {
return code;
}
return streamTrySchedExec(pTask);
diff --git a/source/libs/stream/src/streammsg.c b/source/libs/stream/src/streammsg.c
index 705406f044..a6ab6a60c2 100644
--- a/source/libs/stream/src/streammsg.c
+++ b/source/libs/stream/src/streammsg.c
@@ -594,6 +594,34 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
}
if (tDecodeCStrTo(pDecoder, pTask->reserve) < 0) return -1;
+ tEndDecode(pDecoder);
+ return 0;
+}
+
+int32_t tEncodeStreamTaskChkptReport(SEncoder* pEncoder, const SCheckpointReport* pReq) {
+ if (tStartEncode(pEncoder) < 0) return -1;
+ if (tEncodeI64(pEncoder, pReq->streamId) < 0) return -1;
+ if (tEncodeI32(pEncoder, pReq->taskId) < 0) return -1;
+ if (tEncodeI32(pEncoder, pReq->nodeId) < 0) return -1;
+ if (tEncodeI64(pEncoder, pReq->checkpointId) < 0) return -1;
+ if (tEncodeI64(pEncoder, pReq->checkpointVer) < 0) return -1;
+ if (tEncodeI64(pEncoder, pReq->checkpointTs) < 0) return -1;
+ if (tEncodeI32(pEncoder, pReq->transId) < 0) return -1;
+ if (tEncodeI8(pEncoder, pReq->dropHTask) < 0) return -1;
+ tEndEncode(pEncoder);
+ return 0;
+}
+
+int32_t tDecodeStreamTaskChkptReport(SDecoder* pDecoder, SCheckpointReport* pReq) {
+ if (tStartDecode(pDecoder) < 0) return -1;
+ if (tDecodeI64(pDecoder, &pReq->streamId) < 0) return -1;
+ if (tDecodeI32(pDecoder, &pReq->taskId) < 0) return -1;
+ if (tDecodeI32(pDecoder, &pReq->nodeId) < 0) return -1;
+ if (tDecodeI64(pDecoder, &pReq->checkpointId) < 0) return -1;
+ if (tDecodeI64(pDecoder, &pReq->checkpointVer) < 0) return -1;
+ if (tDecodeI64(pDecoder, &pReq->checkpointTs) < 0) return -1;
+ if (tDecodeI32(pDecoder, &pReq->transId) < 0) return -1;
+ if (tDecodeI8(pDecoder, &pReq->dropHTask) < 0) return -1;
tEndDecode(pDecoder);
return 0;
}
\ No newline at end of file
diff --git a/source/libs/stream/test/backendTest.cpp b/source/libs/stream/test/backendTest.cpp
index c9b981e5f9..e6a508f6f7 100644
--- a/source/libs/stream/test/backendTest.cpp
+++ b/source/libs/stream/test/backendTest.cpp
@@ -43,10 +43,10 @@ SStreamState *stateCreate(const char *path) {
pTask->ver = 1024;
pTask->id.streamId = 1023;
pTask->id.taskId = 1111111;
- SStreamMeta *pMeta = streamMetaOpen((path), NULL, NULL, 0, 0, NULL);
+ SStreamMeta *pMeta = streamMetaOpen((path), NULL, NULL, NULL, 0, 0, NULL);
pTask->pMeta = pMeta;
- SStreamState *p = streamStateOpen((char *)path, pTask, true, 32, 32 * 1024);
+ SStreamState *p = streamStateOpen((char *)path, pTask, 0, 0, true, 32, 32 * 1024);
ASSERT(p != NULL);
return p;
}
diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c
index d12061e824..7bd746837f 100644
--- a/source/libs/transport/src/transCli.c
+++ b/source/libs/transport/src/transCli.c
@@ -76,6 +76,9 @@ typedef struct SCliConn {
SDelayTask* task;
+ uint32_t clientIp;
+ uint32_t serverIp;
+
char* dstAddr;
char src[32];
char dst[32];
@@ -1093,7 +1096,7 @@ void cliSendBatch(SCliConn* pConn) {
}
pHead->timestamp = taosHton64(taosGetTimestampUs());
- if (pHead->comp == 0) {
+ if (pHead->comp == 0 && pMsg->info.compressed == 0 && pConn->clientIp != pConn->serverIp) {
if (pTransInst->compressSize != -1 && pTransInst->compressSize < pMsg->contLen) {
msgLen = transCompressMsg(pMsg->pCont, pMsg->contLen) + sizeof(STransMsgHead);
pHead->msgLen = (int32_t)htonl((uint32_t)msgLen);
@@ -1171,7 +1174,7 @@ void cliSend(SCliConn* pConn) {
uv_timer_start((uv_timer_t*)pConn->timer, cliReadTimeoutCb, TRANS_READ_TIMEOUT, 0);
}
- if (pHead->comp == 0) {
+ if (pHead->comp == 0 && pMsg->info.compressed == 0 && pConn->clientIp != pConn->serverIp) {
if (pTransInst->compressSize != -1 && pTransInst->compressSize < pMsg->contLen) {
msgLen = transCompressMsg(pMsg->pCont, pMsg->contLen) + sizeof(STransMsgHead);
pHead->msgLen = (int32_t)htonl((uint32_t)msgLen);
@@ -1403,6 +1406,12 @@ void cliConnCb(uv_connect_t* req, int status) {
uv_tcp_getsockname((uv_tcp_t*)pConn->stream, &sockname, &addrlen);
transSockInfo2Str(&sockname, pConn->src);
+ struct sockaddr_in addr = *(struct sockaddr_in*)&sockname;
+ struct sockaddr_in saddr = *(struct sockaddr_in*)&peername;
+
+ pConn->clientIp = addr.sin_addr.s_addr;
+ pConn->serverIp = saddr.sin_addr.s_addr;
+
tTrace("%s conn %p connect to server successfully", CONN_GET_INST_LABEL(pConn), pConn);
if (pConn->pBatch != NULL) {
cliSendBatch(pConn);
diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c
index 04f6ac8c95..c205c1412c 100644
--- a/source/libs/transport/src/transSvr.c
+++ b/source/libs/transport/src/transSvr.c
@@ -363,7 +363,7 @@ static bool uvHandleReq(SSvrConn* pConn) {
memcpy(pConn->user, pHead->user, strlen(pHead->user));
int8_t forbiddenIp = 0;
- if (pThrd->enableIpWhiteList) {
+ if (pThrd->enableIpWhiteList && tsEnableWhiteList) {
forbiddenIp = !uvWhiteListCheckConn(pThrd->pWhiteList, pConn) ? 1 : 0;
if (forbiddenIp == 0) {
uvWhiteListSetConnVer(pThrd->pWhiteList, pConn);
@@ -623,7 +623,8 @@ static int uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
int32_t len = transMsgLenFromCont(pMsg->contLen);
STrans* pTransInst = pConn->pTransInst;
- if (pTransInst->compressSize != -1 && pTransInst->compressSize < pMsg->contLen) {
+ if (pMsg->info.compressed == 0 && pConn->clientIp != pConn->serverIp && pTransInst->compressSize != -1 &&
+ pTransInst->compressSize < pMsg->contLen) {
len = transCompressMsg(pMsg->pCont, pMsg->contLen) + sizeof(STransMsgHead);
pHead->msgLen = (int32_t)htonl((uint32_t)len);
}
diff --git a/source/os/src/osThread.c b/source/os/src/osThread.c
index 0acd6f67f5..d2519d06c1 100644
--- a/source/os/src/osThread.c
+++ b/source/os/src/osThread.c
@@ -17,15 +17,6 @@
#include
#include "os.h"
-#ifdef WINDOWS
-#define THREAD_PTR_CHECK(p) \
- do { \
- if (!(p) || !(*(p))) return 0; \
- } while (0);
-#else
-#define THREAD_PTR_CHECK(p)
-#endif
-
int32_t taosThreadCreate(TdThread *tid, const TdThreadAttr *attr, void *(*start)(void *), void *arg) {
return pthread_create(tid, attr, start, arg);
}
@@ -126,7 +117,6 @@ int32_t taosThreadCondWait(TdThreadCond *cond, TdThreadMutex *mutex) {
}
return 0;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_cond_wait(cond, mutex);
#endif
}
@@ -140,7 +130,6 @@ int32_t taosThreadCondTimedWait(TdThreadCond *cond, TdThreadMutex *mutex, const
}
return EINVAL;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_cond_timedwait(cond, mutex, abstime);
#endif
}
@@ -211,7 +200,6 @@ int32_t taosThreadKeyDelete(TdThreadKey key) { return pthread_key_delete(key); }
int32_t taosThreadKill(TdThread thread, int32_t sig) { return pthread_kill(thread, sig); }
// int32_t taosThreadMutexConsistent(TdThreadMutex* mutex) {
-// THREAD_PTR_CHECK(mutex)
// return pthread_mutex_consistent(mutex);
// }
@@ -220,7 +208,6 @@ int32_t taosThreadMutexDestroy(TdThreadMutex *mutex) {
DeleteCriticalSection(mutex);
return 0;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_mutex_destroy(mutex);
#endif
}
@@ -244,7 +231,6 @@ int32_t taosThreadMutexLock(TdThreadMutex *mutex) {
EnterCriticalSection(mutex);
return 0;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_mutex_lock(mutex);
#endif
}
@@ -258,7 +244,6 @@ int32_t taosThreadMutexTryLock(TdThreadMutex *mutex) {
if (TryEnterCriticalSection(mutex)) return 0;
return EBUSY;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_mutex_trylock(mutex);
#endif
}
@@ -268,7 +253,6 @@ int32_t taosThreadMutexUnlock(TdThreadMutex *mutex) {
LeaveCriticalSection(mutex);
return 0;
#else
- THREAD_PTR_CHECK(mutex)
return pthread_mutex_unlock(mutex);
#endif
}
@@ -461,7 +445,6 @@ int32_t taosThreadSetSchedParam(TdThread thread, int32_t policy, const struct sc
int32_t taosThreadSetSpecific(TdThreadKey key, const void *value) { return pthread_setspecific(key, value); }
int32_t taosThreadSpinDestroy(TdThreadSpinlock *lock) {
- THREAD_PTR_CHECK(lock)
#ifdef TD_USE_SPINLOCK_AS_MUTEX
return pthread_mutex_destroy((pthread_mutex_t *)lock);
#else
@@ -480,7 +463,6 @@ int32_t taosThreadSpinInit(TdThreadSpinlock *lock, int32_t pshared) {
}
int32_t taosThreadSpinLock(TdThreadSpinlock *lock) {
- THREAD_PTR_CHECK(lock)
#ifdef TD_USE_SPINLOCK_AS_MUTEX
return pthread_mutex_lock((pthread_mutex_t *)lock);
#else
@@ -489,7 +471,6 @@ int32_t taosThreadSpinLock(TdThreadSpinlock *lock) {
}
int32_t taosThreadSpinTrylock(TdThreadSpinlock *lock) {
- THREAD_PTR_CHECK(lock)
#ifdef TD_USE_SPINLOCK_AS_MUTEX
return pthread_mutex_trylock((pthread_mutex_t *)lock);
#else
@@ -498,7 +479,6 @@ int32_t taosThreadSpinTrylock(TdThreadSpinlock *lock) {
}
int32_t taosThreadSpinUnlock(TdThreadSpinlock *lock) {
- THREAD_PTR_CHECK(lock)
#ifdef TD_USE_SPINLOCK_AS_MUTEX
return pthread_mutex_unlock((pthread_mutex_t *)lock);
#else
diff --git a/source/os/src/osTimer.c b/source/os/src/osTimer.c
index b8eb54e10e..36d364382a 100644
--- a/source/os/src/osTimer.c
+++ b/source/os/src/osTimer.c
@@ -86,8 +86,9 @@ static void taosDeleteTimer(void *tharg) {
static TdThread timerThread;
static timer_t timerId;
static volatile bool stopTimer = false;
-static void *taosProcessAlarmSignal(void *tharg) {
- // Block the signal
+
+static void *taosProcessAlarmSignal(void *tharg) {
+ // Block the signal
sigset_t sigset;
sigemptyset(&sigset);
sigaddset(&sigset, SIGALRM);
diff --git a/source/util/src/terror.c b/source/util/src/terror.c
index 0f594af0e9..239090b8f4 100644
--- a/source/util/src/terror.c
+++ b/source/util/src/terror.c
@@ -21,11 +21,6 @@
#define TAOS_ERROR_C
-typedef struct {
- int32_t val;
- const char* str;
-} STaosError;
-
static threadlocal int32_t tsErrno;
static threadlocal char tsErrMsgDetail[ERR_MSG_LEN] = {0};
static threadlocal char tsErrMsgReturn[ERR_MSG_LEN] = {0};
@@ -35,7 +30,7 @@ char* taosGetErrMsg() { return tsErrMsgDetail; }
char* taosGetErrMsgReturn() { return tsErrMsgReturn; }
#ifdef TAOS_ERROR_C
-#define TAOS_DEFINE_ERROR(name, msg) {.val = (name), .str = (msg)},
+#define TAOS_DEFINE_ERROR(name, msg) {.val = (name), .str = (msg), .macro = #name},
#else
#define TAOS_DEFINE_ERROR(name, mod, code, msg) static const int32_t name = TAOS_DEF_ERROR_CODE(mod, code);
#endif
@@ -46,7 +41,7 @@ char* taosGetErrMsgReturn() { return tsErrMsgReturn; }
#ifdef TAOS_ERROR_C
STaosError errors[] = {
- {.val = 0, .str = "success"},
+ TAOS_DEFINE_ERROR(TSDB_CODE_SUCCESS, "success")
#endif
// rpc
@@ -250,15 +245,14 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB, "Invalid database name
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_DATABASES, "Too many databases for account")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_DROPPING, "Database in dropping status")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_NOT_EXIST, "Database not exist")
-TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO, "WAL retention period is zero")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_ACCT, "Invalid database account")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_OPTION_UNCHANGED, "Database options not changed")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_INDEX_NOT_EXIST, "Index not exist")
-TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SYS_TABLENAME, "Invalid system table name")
-TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_CREATING, "Database in creating status")
-TAOS_DEFINE_ERROR(TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE, "Encryption is not allowed to be changed after database is created")
-TAOS_DEFINE_ERROR(TSDB_CODE_MND_INCONSIST_ENCRYPT_KEY, "Inconsistent encryption key")
+TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_RETENTION_PERIOD_ZERO, "WAL retention period is zero")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_ENCRYPT_KEY, "The cluster has not been set properly for database encryption")
+TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_CREATING, "Database in creating status")
+TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_SYS_TABLENAME, "Invalid system table name")
+TAOS_DEFINE_ERROR(TSDB_CODE_MND_ENCRYPT_NOT_ALLOW_CHANGE, "Encryption is not allowed to be changed after database is created")
// mnode-node
TAOS_DEFINE_ERROR(TSDB_CODE_MND_MNODE_ALREADY_EXIST, "Mnode already exists")
@@ -837,3 +831,5 @@ const char* tstrerror(int32_t err) {
}
const char* terrstr() { return tstrerror(terrno); }
+
+int32_t taosGetErrSize() { return sizeof(errors)/sizeof(errors[0]); }
diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c
index 0c09174970..b224eac8c2 100644
--- a/source/util/src/tlog.c
+++ b/source/util/src/tlog.c
@@ -66,6 +66,7 @@ typedef struct {
int32_t lines;
int32_t flag;
int32_t openInProgress;
+ int64_t lastKeepFileSec;
pid_t pid;
char logName[LOG_FILE_NAME_LEN];
SLogBuff *logHandle;
@@ -267,19 +268,33 @@ static void taosUnLockLogFile(TdFilePtr pFile) {
}
}
-static void taosKeepOldLog(char *oldName) {
- if (tsLogKeepDays == 0) return;
+static void taosReserveOldLog(char *oldName, char *keepName) {
+ if (tsLogKeepDays <= 0) {
+ keepName[0] = 0;
+ return;
+ }
+ int32_t code = 0;
int64_t fileSec = taosGetTimestampSec();
- char fileName[LOG_FILE_NAME_LEN + 20];
- snprintf(fileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64, tsLogObj.logName, fileSec);
+ if (tsLogObj.lastKeepFileSec < fileSec) {
+ tsLogObj.lastKeepFileSec = fileSec;
+ } else {
+ fileSec = ++tsLogObj.lastKeepFileSec;
+ }
+ snprintf(keepName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64, tsLogObj.logName, fileSec);
+ if ((code = taosRenameFile(oldName, keepName))) {
+ keepName[0] = 0;
+ uError("failed to rename file:%s to %s since %s", oldName, keepName, tstrerror(code));
+ }
+}
- (void)taosRenameFile(oldName, fileName);
-
- char compressFileName[LOG_FILE_NAME_LEN + 20];
- snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.%" PRId64 ".gz", tsLogObj.logName, fileSec);
- if (taosCompressFile(fileName, compressFileName) == 0) {
- (void)taosRemoveFile(fileName);
+static void taosKeepOldLog(char *oldName) {
+ if (oldName[0] != 0) {
+ char compressFileName[LOG_FILE_NAME_LEN + 20];
+ snprintf(compressFileName, LOG_FILE_NAME_LEN + 20, "%s.gz", oldName);
+ if (taosCompressFile(oldName, compressFileName) == 0) {
+ (void)taosRemoveFile(oldName);
+ }
}
if (tsLogKeepDays > 0) {
@@ -316,13 +331,13 @@ static OldFileKeeper *taosOpenNewFile() {
tsLogObj.logHandle->pFile = pFile;
tsLogObj.lines = 0;
tsLogObj.openInProgress = 0;
- OldFileKeeper* oldFileKeeper = taosMemoryMalloc(sizeof(OldFileKeeper));
+ OldFileKeeper *oldFileKeeper = taosMemoryMalloc(sizeof(OldFileKeeper));
if (oldFileKeeper == NULL) {
uError("create old log keep info faild! mem is not enough.");
return NULL;
}
oldFileKeeper->pOldFile = pOldFile;
- memcpy(oldFileKeeper->keepName, keepName, LOG_FILE_NAME_LEN + 20);
+ taosReserveOldLog(keepName, oldFileKeeper->keepName);
uInfo(" new log file:%d is opened", tsLogObj.flag);
uInfo("==================================");
diff --git a/source/util/src/tunit.c b/source/util/src/tunit.c
index 09f59f1e40..4ec9e39fde 100644
--- a/source/util/src/tunit.c
+++ b/source/util/src/tunit.c
@@ -24,7 +24,7 @@
#define UNIT_ONE_EXBIBYTE (UNIT_ONE_PEBIBYTE * UNIT_SIZE_CONVERT_FACTOR)
static int32_t parseCfgIntWithUnit(const char* str, double *res) {
- double val, temp = INT64_MAX;
+ double val, temp = (double)INT64_MAX;
char* endPtr;
errno = 0;
val = taosStr2Int64(str, &endPtr, 0);
diff --git a/source/util/test/CMakeLists.txt b/source/util/test/CMakeLists.txt
index e8e3348343..89978fd5aa 100644
--- a/source/util/test/CMakeLists.txt
+++ b/source/util/test/CMakeLists.txt
@@ -123,4 +123,12 @@ add_test(
#add_test(
# NAME decompressTest
# COMMAND decompressTest
-#)
\ No newline at end of file
+#)
+
+# terrorTest
+add_executable(terrorTest "terrorTest.cpp")
+target_link_libraries(terrorTest os util common gtest_main)
+add_test(
+ NAME terrorTest
+ COMMAND terrorTest
+)
\ No newline at end of file
diff --git a/source/util/test/terrorTest.cpp b/source/util/test/terrorTest.cpp
new file mode 100644
index 0000000000..fbb698f780
--- /dev/null
+++ b/source/util/test/terrorTest.cpp
@@ -0,0 +1,15 @@
+#include
+#include
+
+#include
+#include "taoserror.h"
+
+using namespace std;
+
+TEST(TAOS_ERROR_TEST, terror_test) {
+ int32_t errSize = taosGetErrSize();
+ for (int32_t i = 0; i < errSize; ++i) {
+ STaosError *pInfo = &errors[i];
+ std::cout << i + 1 << " " << pInfo->macro << " " << pInfo->val << std::endl;
+ }
+}
\ No newline at end of file
diff --git a/tests/army/test.py b/tests/army/test.py
index dda5d7d5b0..332d7f29c4 100644
--- a/tests/army/test.py
+++ b/tests/army/test.py
@@ -657,8 +657,10 @@ if __name__ == "__main__":
conn = taos.connect(host=f"{host}", config=tdDnodes.getSimCfgPath())
if fileName == "all":
+ tdLog.info("Procedures for testing runAllLinux")
tdCases.runAllLinux(conn)
else:
+ tdLog.info(f"Procedures for testing runOneLinux {fileName}")
tdCases.runOneLinux(conn, fileName, replicaVar)
# do restart option
diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task
index 1eaf17ccb1..6114a560dc 100644
--- a/tests/parallel_test/cases.task
+++ b/tests/parallel_test/cases.task
@@ -536,6 +536,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/mavg.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -R
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max.py
@@ -780,6 +782,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 2
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 2
@@ -875,6 +878,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 3
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 3
@@ -972,6 +976,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_null.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_partition.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_partition.py -Q 4
+,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_limit_interval.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/max_min_last_interval.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row_interval.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/last_row.py -Q 4
@@ -1485,6 +1490,7 @@
,,y,script,./test.sh -f tsim/view/view.sim
,,y,script,./test.sh -f tsim/query/cache_last.sim
,,y,script,./test.sh -f tsim/query/const.sim
+,,y,script,./test.sh -f tsim/query/nestedJoinView.sim
#develop test
diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c
index 0e3b50974a..eb959f2bd4 100644
--- a/tests/script/api/batchprepare.c
+++ b/tests/script/api/batchprepare.c
@@ -124,6 +124,7 @@ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos);
int queryMiscTest(TAOS_STMT *stmt, TAOS *taos);
int insertNonExistsTb(TAOS_STMT *stmt, TAOS *taos);
int insertVarLenErr(TAOS_STMT *stmt, TAOS *taos);
+int insertStbTest(TAOS_STMT *stmt, TAOS *taos);
enum {
TTYPE_INSERT = 1,
@@ -148,53 +149,56 @@ typedef struct {
int32_t bindNullNum;
int32_t runTimes;
int32_t preCaseIdx;
+ bool stbInsert;
} CaseCfg;
CaseCfg gCase[] = {
- {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1},
- {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1},
+ {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1, false},
+ {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1, false},
- {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest1, 10, 10, 2, 2, 0, 0, 1, -1, false},
- {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBSETest2, 10, 10, 2, 2, 0, 0, 1, -1, false},
- {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest1, 10, 10, 2, 2, 0, 0, 1, -1, false},
// 11
- {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest2, 10, 10, 2, 2, 0, 0, 1, -1, false},
- {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest3, 10, 10, 2, 2, 0, 0, 1, -1, false},
- {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1},
- {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1},
+ {"insert:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1, false},
+ {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMBMETest4, 10, 10, 2, 2, 0, 0, 1, -1, false},
- {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1},
+ {"insert:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1, false},
- // 22
- {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, false, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1},
- {"insert:AUTO2-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, false, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1},
-// {"insert:AUTO3-NTB", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, true, insertAUTOTest3, 10, 10, 2, 0, 0, 0, 1, -1},
+ {"insert:STBI-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, true, insertStbTest, 10, 10, 2, 0, 0, 0, 1, -1, true},
- {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2},
- {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2},
+ // 23
+ {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, false, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1, false},
+ {"insert:AUTO2-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, false, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1, false},
+// {"insert:AUTO3-NTB", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, true, insertAUTOTest3, 10, 10, 2, 0, 0, 0, 1, -1, false},
- {"query:NG-TBNEXISTS",tListLen(fullColList), fullColList, TTYPE_INSERT_NG,0, false, false, insertNonExistsTb, 10, 10, 1, 3, 0, 0, 1, -1},
- {"query:NG-VARLENERR",tListLen(fullColList), fullColList, TTYPE_INSERT_NG,0, false, true, insertVarLenErr, 10, 10, 1, 3, 0, 0, 1, -1},
+ {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2, false},
+ {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2, false},
-// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2},
-// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2},
+ {"query:NG-TBNEXISTS",tListLen(fullColList), fullColList, TTYPE_INSERT_NG,0, false, false, insertNonExistsTb, 10, 10, 1, 3, 0, 0, 1, -1, false},
+ {"query:NG-VARLENERR",tListLen(fullColList), fullColList, TTYPE_INSERT_NG,0, false, true, insertVarLenErr, 10, 10, 1, 3, 0, 0, 1, -1, false},
+
+// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2, false},
+// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2, false},
};
@@ -233,7 +237,7 @@ typedef struct {
#if 0
CaseCtrl gCaseCtrl = {
- .precision = TIME_PRECISION_MICRO,
+ .precision = TIME_PRECISION_MILLI,
.bindNullNum = 0,
.printCreateTblSql = true,
.printQuerySql = true,
@@ -256,7 +260,7 @@ CaseCtrl gCaseCtrl = {
.funcIdxList = NULL,
.checkParamNum = false,
.runTimes = 0,
- .caseIdx = 26,
+ .caseIdx = 20,
.caseNum = 1,
.caseRunIdx = -1,
.caseRunNum = -1,
@@ -268,7 +272,7 @@ CaseCtrl gCaseCtrl = {
CaseCtrl gCaseCtrl = { // default
.precision = TIME_PRECISION_MILLI,
.bindNullNum = 0,
- .printCreateTblSql = false,
+ .printCreateTblSql = true,
.printQuerySql = true,
.printStmtSql = true,
.printVerbose = false,
@@ -456,9 +460,6 @@ void generateInsertSQL(BindData *data) {
case TSDB_DATA_TYPE_UBIGINT:
len += sprintf(data->sql + len, "tubigdata");
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- len += sprintf(data->sql + len, "tgeometrydata");
- break;
default:
printf("!!!invalid tag type:%d", data->pTags[c].buffer_type);
exit(1);
@@ -527,9 +528,6 @@ void generateInsertSQL(BindData *data) {
case TSDB_DATA_TYPE_UBIGINT:
len += sprintf(data->sql + len, "ubigdata");
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- len += sprintf(data->sql + len, "tgeometrydata");
- break;
default:
printf("!!!invalid col type:%d", data->pBind[c].buffer_type);
exit(1);
@@ -560,7 +558,11 @@ void bpAppendOperatorParam(BindData *data, int32_t *len, int32_t dataType, int32
pInfo = &operInfo[gCaseCtrl.optrIdxList[idx]];
} else {
if (TSDB_DATA_TYPE_VARCHAR == dataType || TSDB_DATA_TYPE_NCHAR == dataType || TSDB_DATA_TYPE_GEOMETRY == dataType) {
+#if 1
pInfo = &operInfo[varoperatorList[rand() % tListLen(varoperatorList)]];
+#else
+ pInfo = &operInfo[11];
+#endif
} else {
pInfo = &operInfo[operatorList[rand() % tListLen(operatorList)]];
}
@@ -644,9 +646,6 @@ int32_t bpAppendColumnName(BindData *data, int32_t type, int32_t len) {
case TSDB_DATA_TYPE_UBIGINT:
return sprintf(data->sql + len, "ubigdata");
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- len += sprintf(data->sql + len, "tgeometrydata");
- break;
default:
printf("!!!invalid col type:%d", type);
exit(1);
@@ -751,7 +750,7 @@ void generateErrorSQL(BindData *data, int32_t tblIdx) {
}
}
-void generateColDataType(BindData *data, int32_t bindIdx, int32_t colIdx, int32_t *dataType) {
+void generateColDataType(bool isQuery, BindData *data, int32_t bindIdx, int32_t colIdx, int32_t *dataType) {
if (bindIdx < gCurCase->bindColNum) {
if (gCaseCtrl.bindColTypeNum) {
*dataType = gCaseCtrl.bindColTypeList[colIdx];
@@ -769,15 +768,23 @@ void generateColDataType(BindData *data, int32_t bindIdx, int32_t colIdx, int32_
break;
}
return;
- } else if (0 == colIdx) {
+ } else if (0 == colIdx && !isQuery) {
*dataType = TSDB_DATA_TYPE_TIMESTAMP;
return;
} else {
while (true) {
+#if 1
*dataType = rand() % (TSDB_DATA_TYPE_MAX - 1) + 1;
+#else
+ if (!colExists(data->pBind, TSDB_DATA_TYPE_NCHAR)) {
+ *dataType = TSDB_DATA_TYPE_NCHAR;
+ } else {
+ *dataType = rand() % (TSDB_DATA_TYPE_MAX - 1) + 1;
+ }
+#endif
if (*dataType == TSDB_DATA_TYPE_JSON || *dataType == TSDB_DATA_TYPE_DECIMAL
|| *dataType == TSDB_DATA_TYPE_BLOB || *dataType == TSDB_DATA_TYPE_MEDIUMBLOB
- || *dataType == TSDB_DATA_TYPE_VARBINARY) {
+ || *dataType == TSDB_DATA_TYPE_VARBINARY || *dataType == TSDB_DATA_TYPE_GEOMETRY) {
continue;
}
@@ -806,7 +813,7 @@ void generateTagDataType(BindData *data, int32_t bindIdx, int32_t colIdx, int32_
*dataType = rand() % (TSDB_DATA_TYPE_MAX - 1) + 1;
if (*dataType == TSDB_DATA_TYPE_JSON || *dataType == TSDB_DATA_TYPE_DECIMAL
|| *dataType == TSDB_DATA_TYPE_BLOB || *dataType == TSDB_DATA_TYPE_MEDIUMBLOB
- || *dataType == TSDB_DATA_TYPE_VARBINARY) {
+ || *dataType == TSDB_DATA_TYPE_VARBINARY || *dataType == TSDB_DATA_TYPE_GEOMETRY) {
continue;
}
@@ -823,7 +830,7 @@ void generateTagDataType(BindData *data, int32_t bindIdx, int32_t colIdx, int32_
}
-int32_t prepareColData(BP_BIND_TYPE bType, BindData *data, int32_t bindIdx, int32_t rowIdx, int32_t colIdx) {
+int32_t prepareColData(bool isQuery, BP_BIND_TYPE bType, BindData *data, int32_t bindIdx, int32_t rowIdx, int32_t colIdx) {
int32_t dataType = TSDB_DATA_TYPE_TIMESTAMP;
TAOS_MULTI_BIND *pBase = NULL;
@@ -832,7 +839,7 @@ int32_t prepareColData(BP_BIND_TYPE bType, BindData *data, int32_t bindIdx, int3
generateTagDataType(data, bindIdx, colIdx, &dataType);
} else {
pBase = data->pBind;
- generateColDataType(data, bindIdx, colIdx, &dataType);
+ generateColDataType(isQuery, data, bindIdx, colIdx, &dataType);
}
@@ -993,13 +1000,13 @@ int32_t prepareInsertData(BindData *data) {
for (int b = 0; b < (allRowNum/gCurCase->bindRowNum); b++) {
for (int c = 0; c < gCurCase->bindColNum; ++c) {
- prepareColData(BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
+ prepareColData(false, BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
}
}
for (int b = 0; b < gCurCase->tblNum; b++) {
for (int c = 0; c < gCurCase->bindTagNum; ++c) {
- prepareColData(BP_BIND_TAG, data, b*gCurCase->bindTagNum+c, b, c);
+ prepareColData(false, BP_BIND_TAG, data, b*gCurCase->bindTagNum+c, b, c);
}
}
@@ -1056,7 +1063,7 @@ int32_t prepareQueryCondData(BindData *data, int32_t tblIdx) {
for (int b = 0; b < bindNum; b++) {
for (int c = 0; c < gCurCase->bindColNum; ++c) {
- prepareColData(BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
+ prepareColData(true, BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
}
}
@@ -1116,10 +1123,10 @@ int32_t prepareQueryMiscData(BindData *data, int32_t tblIdx) {
} else {
gCaseCtrl.numericParam = false;
}
-
+
for (int b = 0; b < bindNum; b++) {
for (int c = 0; c < gCurCase->bindColNum; ++c) {
- prepareColData(BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
+ prepareColData(true, BP_BIND_COL, data, b*gCurCase->bindColNum+c, b*gCurCase->bindRowNum, c);
}
}
@@ -1462,7 +1469,7 @@ int32_t bpBindParam(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind, bool expectFail) {
}
if (gCurCase->bindRowNum > 1) {
- if (0 == (n++%2)) {
+ if (0 == (n++%2) || gCurCase->stbInsert) {
if (taos_stmt_bind_param_batch(stmt, bind)) {
if (expectFail) return 0;
printf("!!!taos_stmt_bind_param_batch error:%s\n", taos_stmt_errstr(stmt));
@@ -1473,7 +1480,7 @@ int32_t bpBindParam(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind, bool expectFail) {
for (int32_t i = 0; i < gCurCase->bindColNum; ++i) {
if (taos_stmt_bind_single_param_batch(stmt, bind+i, i)) {
if (expectFail) continue;
- printf("!!!taos_stmt_bind_single_param_batch %d error:%s\n", taos_stmt_errstr(stmt), i);
+ printf("!!!taos_stmt_bind_single_param_batch %d error:%s\n", i, taos_stmt_errstr(stmt));
bpShowBindParam(bind, gCurCase->bindColNum);
exit(1);
}
@@ -1925,6 +1932,62 @@ int insertMPMETest1(TAOS_STMT *stmt, TAOS *taos) {
return 0;
}
+/* prepare [settbname [bind] exec] */
+int insertStbTest(TAOS_STMT *stmt, TAOS *taos) {
+ BindData data = {0};
+ prepareInsertData(&data);
+
+ int code = taos_stmt_prepare(stmt, data.sql, 0);
+ if (code != 0){
+ printf("!!!failed to execute taos_stmt_prepare. error:%s\n", taos_stmt_errstr(stmt));
+ exit(1);
+ }
+
+ bpCheckIsInsert(stmt, 1);
+
+ int32_t bindTimes = gCurCase->rowNum/gCurCase->bindRowNum;
+ for (int32_t t = 0; t< gCurCase->tblNum; ++t) {
+ if (gCurCase->tblNum > 1) {
+ char buf[32];
+ sprintf(buf, "t%d", t);
+ code = bpSetTableNameTags(&data, t, buf, stmt);
+ if (code != 0){
+ printf("!!!taos_stmt_set_tbname error:%s\n", taos_stmt_errstr(stmt));
+ exit(1);
+ }
+ }
+
+ if (gCaseCtrl.checkParamNum) {
+ bpCheckParamNum(stmt);
+ }
+
+ for (int32_t b = 0; b bindColNum + b*gCurCase->bindColNum, false)) {
+ exit(1);
+ }
+ }
+
+ if (taos_stmt_add_batch(stmt)) {
+ printf("!!!taos_stmt_add_batch error:%s\n", taos_stmt_errstr(stmt));
+ exit(1);
+ }
+
+ if (taos_stmt_execute(stmt) != 0) {
+ printf("!!!taos_stmt_execute error:%s\n", taos_stmt_errstr(stmt));
+ exit(1);
+ }
+ }
+
+ bpCheckIsInsert(stmt, 1);
+
+ destroyData(&data);
+
+ bpCheckAffectedRows(stmt, 1);
+
+ return 0;
+}
+
+
/* [prepare [settbnametag [bind add] exec]] */
int insertAUTOTest1(TAOS_STMT *stmt, TAOS *taos) {
@@ -2556,9 +2619,6 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t *
case TSDB_DATA_TYPE_UBIGINT:
blen += sprintf(buf + blen, "ubigdata bigint unsigned");
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- blen += sprintf(buf + blen, "geometrydata geometry(%d)", gVarCharSize);
- break;
default:
printf("invalid col type:%d", colList[c]);
exit(1);
@@ -2617,9 +2677,6 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t *
case TSDB_DATA_TYPE_UBIGINT:
blen += sprintf(buf + blen, "tubigdata bigint unsigned");
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- blen += sprintf(buf + blen, "tgeometrydata geometry(%d)", gVarCharSize);
- break;
default:
printf("invalid col type:%d", colList[c]);
exit(1);
@@ -2678,9 +2735,6 @@ void generateCreateTableSQL(char *buf, int32_t tblIdx, int32_t colNum, int32_t *
case TSDB_DATA_TYPE_UBIGINT:
blen += sprintf(buf + blen, "%d", rand() % 128);
break;
- case TSDB_DATA_TYPE_GEOMETRY:
- blen += sprintf(buf + blen, "'geo%d'", rand() % 128);
- break;
default:
printf("invalid col type:%d", colList[c]);
exit(1);
@@ -2880,8 +2934,16 @@ int32_t runCase(TAOS *taos, int32_t caseIdx, int32_t caseRunIdx, bool silent) {
}
beginUs = taosGetTimestampUs();
-
- stmt = taos_stmt_init(taos);
+
+ if (gCurCase->stbInsert) {
+ TAOS_STMT_OPTIONS op;
+ op.reqId = 0;
+ op.singleStbInsert = true;
+ op.singleTableBindOnce = true;
+ stmt = taos_stmt_init_with_options(taos, &op);
+ } else {
+ stmt = taos_stmt_init(taos);
+ }
if (NULL == stmt) {
printf("!!!taos_stmt_init failed, error:%s\n", taos_stmt_errstr(stmt));
exit(1);
diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh
index 76d890b26a..b69f1eba4f 100755
--- a/tests/script/sh/deploy.sh
+++ b/tests/script/sh/deploy.sh
@@ -121,7 +121,7 @@ echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "uDebugFlag 131" >> $TAOS_CFG
echo "rpcDebugFlag 135" >> $TAOS_CFG
echo "jniDebugFlag 131" >> $TAOS_CFG
-echo "qDebugFlag 131" >> $TAOS_CFG
+echo "qDebugFlag 135" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG
echo "dDebugFlag 131" >> $TAOS_CFG
echo "vDebugFlag 131" >> $TAOS_CFG
@@ -136,7 +136,7 @@ echo "idxDebugFlag 135" >> $TAOS_CFG
echo "udfDebugFlag 135" >> $TAOS_CFG
echo "smaDebugFlag 135" >> $TAOS_CFG
echo "metaDebugFlag 135" >> $TAOS_CFG
-echo "stDebugFlag 135" >> $TAOS_CFG
+echo "stDebugFlag 143" >> $TAOS_CFG
echo "numOfLogLines 20000000" >> $TAOS_CFG
echo "asyncLog 0" >> $TAOS_CFG
echo "locale en_US.UTF-8" >> $TAOS_CFG
diff --git a/tests/script/tsim/query/nestedJoinView.sim b/tests/script/tsim/query/nestedJoinView.sim
new file mode 100644
index 0000000000..efdec9fcbc
--- /dev/null
+++ b/tests/script/tsim/query/nestedJoinView.sim
@@ -0,0 +1,19 @@
+system sh/stop_dnodes.sh
+system sh/deploy.sh -n dnode1 -i 1
+system sh/exec.sh -n dnode1 -s start
+sql connect
+
+sql create database test;
+sql use test;
+
+sql CREATE TABLE `resource_info` ( job_id_ts TIMESTAMP , role VARCHAR(20) primary key, start_time TIMESTAMP, ip VARCHAR(15), cpu FLOAT, memory FLOAT, io_write FLOAT, io_read FLOAT, net_write FLOAT, net_read FLOAT) TAGS ( end_time TIMESTAMP);
+
+sql CREATE STABLE `test_results` ( `job_id_ts` TIMESTAMP , `end_time` VARCHAR(40) PRIMARY KEY, `job_id` BIGINT, `time_cost` FLOAT, `write_speed` FLOAT, `qps` FLOAT, `min_delay` FLOAT, `p90_delay` FLOAT, `p95_delay` FLOAT, `p99_delay` FLOAT, `max_delay` FLOAT, `avg_delay` FLOAT, `hostname` VARCHAR(15), `tdengine_commit_id` VARCHAR(50), `tdinternal_commit_id` VARCHAR(50), `load_type` VARCHAR(50), `cpu` FLOAT, `memory` FLOAT, `io_write` FLOAT, `io_read` FLOAT) TAGS ( `branch` VARCHAR(50), `scenario` VARCHAR(50), `test_case` VARCHAR(1000), `env_id` INT, `type` VARCHAR(50));
+
+sql CREATE TABLE `job_info` ( `start_time` TIMESTAMP , `finish_time` TIMESTAMP , `job_id` INT, `job_status` VARCHAR(20), `test_type` VARCHAR(50), `environment` INT, `version` VARCHAR(20), `tdengine_commit_id` VARCHAR(50), `tdinternal_commit_id` VARCHAR(50), `type` VARCHAR(50), `scenario` VARCHAR(50), `note` VARCHAR(500), `version_number` VARCHAR(20));
+
+sql create view abc as select * from ( select a.job_id, a.start_time as job_start_time, a.finish_time as job_end_time, a.job_status, a.test_type, a.environment, case when a.version_number <> null then a.version else CONCAT(a.version,'_',a.version_number) end as version_info, a.tdengine_commit_id, a.tdinternal_commit_id, a.type, a.scenario, a.note, a.version_number, b.end_time as tc_end_time, b.time_cost, b.write_speed, b.qps, b.min_delay, b.p90_delay, b.p95_delay, b.p99_delay, b.`max_delay`, b.avg_delay, b.hostname, b.load_type, b.scenario, b.test_case, b.type from job_info a, test_results b where a.start_time=b.job_id_ts and a.job_status='finished') s1 inner join resource_info s2 on s1.job_start_time=s2.job_id_ts and s1.job_id=2 and s1.tc_end_time=s2.end_time;
+
+sql select * from abc;
+
+system sh/exec.sh -n dnode1 -s stop -x SIGINT
diff --git a/tests/script/tsim/stream/checkStreamSTable1.sim b/tests/script/tsim/stream/checkStreamSTable1.sim
index dd44f5c102..942a947feb 100644
--- a/tests/script/tsim/stream/checkStreamSTable1.sim
+++ b/tests/script/tsim/stream/checkStreamSTable1.sim
@@ -57,7 +57,7 @@ loop1:
sleep 1000
$loop_count = $loop_count + 1
-if $loop_count == 10 then
+if $loop_count == 100 then
return -1
endi
diff --git a/tests/script/tsim/user/basic.sim b/tests/script/tsim/user/basic.sim
index 8b91efd5df..0e1fbb5b40 100644
--- a/tests/script/tsim/user/basic.sim
+++ b/tests/script/tsim/user/basic.sim
@@ -14,6 +14,9 @@ endi
if $data(root)[3] != 1 then
return -1
endi
+if $data(root)[4] != 1 then
+ return -1
+endi
sql alter user root pass 'taosdata'
@@ -21,6 +24,8 @@ sql_error ALTER USER root SYSINFO 0
sql_error ALTER USER root SYSINFO 1
sql_error ALTER USER root enable 0
sql_error ALTER USER root enable 1
+sql_error ALTER USER root createdb 0
+sql_error ALTER USER root createdb 1
#sql_error create database db vgroups 1;
sql_error GRANT read ON db.* to root;
@@ -53,6 +58,9 @@ endi
if $data(u1)[3] != 0 then
return -1
endi
+if $data(u1)[4] != 0 then
+ return -1
+endi
sql CREATE USER u2 PASS 'taosdata' SYSINFO 1;
sql select * from information_schema.ins_users
@@ -68,6 +76,9 @@ endi
if $data(u2)[3] != 1 then
return -1
endi
+if $data(u2)[4] != 0 then
+ return -1
+endi
print =============== step2: sysinfo alter
sql ALTER USER u1 SYSINFO 1
@@ -81,6 +92,9 @@ endi
if $data(u1)[3] != 1 then
return -1
endi
+if $data(u1)[4] != 0 then
+ return -1
+endi
sql ALTER USER u1 SYSINFO 0
sql select * from information_schema.ins_users
@@ -93,6 +107,9 @@ endi
if $data(u1)[3] != 0 then
return -1
endi
+if $data(u1)[4] != 0 then
+ return -1
+endi
sql ALTER USER u1 SYSINFO 0
sql ALTER USER u1 SYSINFO 0
@@ -118,6 +135,9 @@ endi
if $data(u2)[3] != 1 then
return -1
endi
+if $data(u2)[4] != 0 then
+ return -1
+endi
sql ALTER USER u2 enable 1
sql select * from information_schema.ins_users
@@ -130,15 +150,53 @@ endi
if $data(u2)[3] != 1 then
return -1
endi
+if $data(u2)[4] != 0 then
+ return -1
+endi
sql ALTER USER u2 enable 1
sql ALTER USER u2 enable 1
+
+print =============== step4: createdb alter
+sql ALTER USER u2 createdb 1
+sql select * from information_schema.ins_users
+if $rows != 2 then
+ return -1
+endi
+if $data(u2)[1] != 0 then
+ return -1
+endi
+if $data(u2)[2] != 1 then
+ return -1
+endi
+if $data(u2)[3] != 1 then
+ return -1
+endi
+if $data(u2)[4] != 1 then
+ return -1
+endi
+
+sql ALTER USER u2 createdb 0
+sql select * from information_schema.ins_users
+if $data(u2)[1] != 0 then
+ return -1
+endi
+if $data(u2)[2] != 1 then
+ return -1
+endi
+if $data(u2)[3] != 1 then
+ return -1
+endi
+if $data(u2)[4] != 0 then
+ return -1
+endi
+
print =============== restart taosd
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode1 -s start
-print =============== step4: enable privilege
+print =============== step5: enable privilege
sql select * from information_schema.ins_users
if $rows != 2 then
return -1
@@ -152,6 +210,25 @@ endi
if $data(u2)[3] != 1 then
return -1
endi
+if $data(u2)[4] != 0 then
+ return -1
+endi
+sql_error CREATE USER u100 PASS 'taosdata' SYSINFO -1;
+sql_error CREATE USER u101 PASS 'taosdata' SYSINFO 2;
+sql_error CREATE USER u102 PASS 'taosdata' SYSINFO 20000;
+sql_error CREATE USER u103 PASS 'taosdata' SYSINFO 1000;
+sql_error ALTER USER u1 enable -1
+sql_error ALTER USER u1 enable 2
+sql_error ALTER USER u1 enable 1000
+sql_error ALTER USER u1 enable 10000
+sql_error ALTER USER u1 sysinfo -1
+sql_error ALTER USER u1 sysinfo 2
+sql_error ALTER USER u1 sysinfo 1000
+sql_error ALTER USER u1 sysinfo -20000
+sql_error ALTER USER u1 createdb -1
+sql_error ALTER USER u1 createdb 3
+sql_error ALTER USER u1 createdb 1000
+sql_error ALTER USER u1 createdb 100000
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
diff --git a/tests/script/tsim/user/privilege_create_db.sim b/tests/script/tsim/user/privilege_create_db.sim
index f199e2ee9c..42a527ef8b 100644
--- a/tests/script/tsim/user/privilege_create_db.sim
+++ b/tests/script/tsim/user/privilege_create_db.sim
@@ -6,6 +6,8 @@ sql connect
print ========================root user create user
sql create user u1 pass "taosdata"
sql create user u2 pass "taosdata"
+sql alter user u1 createdb 1
+sql alter user u2 createdb 1
sql create database test
sql select * from information_schema.ins_user_privileges where user_name == "root"
if $rows != 1 then
diff --git a/tests/script/tsim/user/privilege_sysinfo.sim b/tests/script/tsim/user/privilege_sysinfo.sim
index f193e375d9..a402c3f0f1 100644
--- a/tests/script/tsim/user/privilege_sysinfo.sim
+++ b/tests/script/tsim/user/privilege_sysinfo.sim
@@ -67,6 +67,7 @@ sql_error drop snode on dnode 1
sql_error redistribute vgroup 2 dnode 1 dnode 2
sql_error balance vgroup
+sql_error balance vgroup leader
sql_error kill transaction 1
sql_error kill connection 1
diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py
index 0d9f43424d..7a0d1b048a 100644
--- a/tests/system-test/0-others/information_schema.py
+++ b/tests/system-test/0-others/information_schema.py
@@ -222,7 +222,7 @@ class TDTestCase:
tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'")
tdLog.info(len(tdSql.queryResult))
- tdSql.checkEqual(True, len(tdSql.queryResult) in range(260, 261))
+ tdSql.checkEqual(True, len(tdSql.queryResult) in range(261, 262))
tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'")
tdSql.checkEqual(54, len(tdSql.queryResult))
diff --git a/tests/system-test/0-others/taosShell.py b/tests/system-test/0-others/taosShell.py
index 3b6f6c6fab..5158c3dfac 100644
--- a/tests/system-test/0-others/taosShell.py
+++ b/tests/system-test/0-others/taosShell.py
@@ -134,6 +134,7 @@ class TDTestCase:
tdSql.prepare()
# time.sleep(2)
tdSql.query("create user testpy pass 'testpy'")
+ tdSql.query("alter user testpy createdb 1")
#hostname = socket.gethostname()
#tdLog.info ("hostname: %s" % hostname)
diff --git a/tests/system-test/0-others/user_control.py b/tests/system-test/0-others/user_control.py
index 7b5578ba45..c4d24582e4 100644
--- a/tests/system-test/0-others/user_control.py
+++ b/tests/system-test/0-others/user_control.py
@@ -87,21 +87,29 @@ class TDconnect:
self.cursor = self._conn.cursor()
return self
- def error(self, sql):
+ def error(self, sql, expectErrInfo = None):
+ caller = inspect.getframeinfo(inspect.stack()[1][0])
expectErrNotOccured = True
try:
self.cursor.execute(sql)
- except BaseException:
+ except BaseException as e:
+ tdLog.info("err:%s" % (e))
expectErrNotOccured = False
+ self.errno = e.errno
+ error_info = repr(e)
+ self.error_info = ','.join(error_info[error_info.index('(')+1:-1].split(",")[:-1]).replace("'","")
if expectErrNotOccured:
- caller = inspect.getframeinfo(inspect.stack()[1][0])
tdLog.exit(f"{caller.filename}({caller.lineno}) failed: sql:{sql}, expect error not occured" )
else:
- self.queryRows = 0
- self.queryCols = 0
- self.queryResult = None
- tdLog.info(f"sql:{sql}, expect error occured")
+ if expectErrInfo != None:
+ if expectErrInfo == self.error_info:
+ self.queryRows = 0
+ self.queryCols = 0
+ self.queryResult = None
+ tdLog.info("sql:%s, expected ErrInfo '%s' occured" % (sql, expectErrInfo))
+ else:
+ tdLog.exit("%s(%d) failed: sql:%s, ErrInfo '%s' occured, but not expected ErrInfo '%s'" % (caller.filename, caller.lineno, sql, self.error_info, expectErrInfo))
def query(self, sql, row_tag=None):
# sourcery skip: raise-from-previous-error, raise-specific-error
@@ -504,6 +512,17 @@ class TDTestCase:
else:
tdLog.exit("connect successfully, except error not occrued!")
+ def test_alter_user(self):
+ options = ["enable", "sysinfo", "createdb"]
+ optionErrVals = [-10000, -128, -1, 2, 127, 1000, 10000]
+ for optionErrVal in optionErrVals:
+ tdSql.error("create user user_alter pass 'taosdata' sysinfo %d" % optionErrVal)
+ tdSql.execute("create user user_alter pass 'taosdata'")
+ for option in options:
+ for optionErrVal in optionErrVals:
+ tdSql.error("alter user user_alter %s %d" % (option, optionErrVal))
+ tdSql.execute("drop user user_alter")
+
def __drop_user(self, user):
return f"DROP USER {user}"
@@ -647,6 +666,16 @@ class TDTestCase:
user.error(f"drop user {self.__user_list[0]}")
user.error(f"drop user {self.__user_list[1]}")
user.error("drop user root")
+ # 普通用户默认不可创建 db
+ user.error("create database ordinary_user_db", expectErrInfo='Insufficient privilege for operation')
+ tdSql.execute(f'alter user {self.__user_list[0]} createdb 1')
+ tdSql.execute(f'alter user {self.__user_list[0]} createdb 0')
+ tdSql.execute(f'alter user {self.__user_list[0]} createdb 1')
+ tdSql.execute(f'alter user {self.__user_list[0]} createdb 1')
+ user.query("create database ordinary_user_db")
+ user.query("drop database ordinary_user_db")
+ tdSql.execute(f'alter user {self.__user_list[0]} createdb 0')
+ user.error("create database ordinary_user_db", expectErrInfo='Insufficient privilege for operation')
tdLog.printNoPrefix("==========step5: enable info")
taos1_conn = taos.connect(user=self.__user_list[1], password=f"new{self.__passwd_list[1]}")
@@ -702,8 +731,12 @@ class TDTestCase:
else:
tdLog.info("taos 4 query except error occured, sysinfo == 0, can not show dnode/vgroups")
+ # alter 用户测试
+ tdLog.printNoPrefix("==========step7: alter ordinary user")
+ self.test_alter_user()
+
# root删除用户测试
- tdLog.printNoPrefix("==========step7: super user drop normal user")
+ tdLog.printNoPrefix("==========step8: super user drop normal user")
self.test_drop_user()
tdSql.query("show users")
diff --git a/tests/system-test/0-others/view/non_marterial_view/test_view.py b/tests/system-test/0-others/view/non_marterial_view/test_view.py
index 4b829b4049..3b6f774788 100644
--- a/tests/system-test/0-others/view/non_marterial_view/test_view.py
+++ b/tests/system-test/0-others/view/non_marterial_view/test_view.py
@@ -80,6 +80,7 @@ class TDTestCase:
def create_user(self, username, password):
tdSql.execute(f"create user {username} pass '{password}';")
+ tdSql.execute(f"alter user {username} createdb 1;")
tdLog.debug("Create user {} with password {} successfully".format(username, password))
def check_permissions(self, username, db_name, permission_dict, view_name=None):
diff --git a/tests/system-test/2-query/agg_group_AlwaysReturnValue.py b/tests/system-test/2-query/agg_group_AlwaysReturnValue.py
index 9ed0e3fc4a..0cac9cb03b 100755
--- a/tests/system-test/2-query/agg_group_AlwaysReturnValue.py
+++ b/tests/system-test/2-query/agg_group_AlwaysReturnValue.py
@@ -640,6 +640,15 @@ class TDTestCase(TDTestCase):
sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname,count(*) "
self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+ sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a group by tbname order by a.tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
sql1 = f"select * from ({sql})"
self.data_check_tbname(sql1,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
@@ -647,7 +656,16 @@ class TDTestCase(TDTestCase):
self.data_check_tbname(sql2,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 where ts is null group by tbname order by tbname,count(*) "
- self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by a.tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by a.tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname,AGG(COLUMN) from {dbname}.stable_1 a where ts is null group by a.tbname order by tbname,count(*) "
+ self.data_check_tbname(sql,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
sql1 = f"select * from ({sql})"
self.data_check_tbname(sql1,'NULL','NULL',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
@@ -1011,7 +1029,19 @@ class TDTestCase(TDTestCase):
#union all
sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname,AGG(COLUMN),count(*)"
sql = f"({sql}) union all ({sql}) order by tb"
- self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+ self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by tbname,AGG(COLUMN),count(*)"
+ sql = f"({sql}) union all ({sql}) order by tb"
+ self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by a.tbname,AGG(COLUMN),count(*)"
+ sql = f"({sql}) union all ({sql}) order by tb"
+ self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by tbname order by a.tbname,AGG(COLUMN),count(*)"
+ sql = f"({sql}) union all ({sql}) order by tb"
+ self.data_check_tbname(sql,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
sql1 = f"select * from ({sql})"
self.data_check_tbname(sql1,'AGG24','AGG24',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
@@ -1572,16 +1602,79 @@ class TDTestCase(TDTestCase):
tdSql.execute('alter stable stable_1 drop column q_binary5;')
tdSql.execute('alter stable stable_1 drop column q_nchar4;')
tdSql.execute('alter stable stable_1 drop column q_binary4;')
-
+
+ def testTBNameUseJoin(self):
+ tdSql.execute('CREATE STABLE `meter1` (`ts` TIMESTAMP, `v1` INT) TAGS (`t1` INT)')
+ tdSql.execute('CREATE STABLE `meter2` (`ts` TIMESTAMP, `v1` INT) TAGS (`t1` INT)')
+
+ tdSql.execute('CREATE TABLE `d1` USING `meter1` (`t1`) TAGS (1)')
+ tdSql.execute('CREATE TABLE `d2` USING `meter1` (`t1`) TAGS (2)')
+ tdSql.execute('CREATE TABLE `d21` USING `meter2` (`t1`) TAGS (21)')
+ tdSql.execute('CREATE TABLE `d22` USING `meter2` (`t1`) TAGS (22)')
+
+ time.sleep(1)
+ tdSql.query('select tbname,count(*) from d2')
+ tdSql.checkData(0, 1, 0)
+
+ tdSql.execute('insert into `d1` VALUES (now, 1)')
+ tdSql.execute('insert into `d1` VALUES (now+1s, 2)')
+ tdSql.execute('insert into `d1` VALUES (now+2s, 3)')
+ tdSql.execute('insert into `d2` VALUES (now+3s, 11)')
+ tdSql.execute('insert into `d2` VALUES (now+4s, 22)')
+ tdSql.execute('insert into `d2` VALUES (now+5s, 33)')
+ tdSql.execute('insert into `d21` select * from `d1`')
+
+ # tdSql.query('select b.tbname, count(*) from d1 a, d2 b where a.ts = b.ts group by b.tbname')
+ # tdSql.checkData(0, 0, 'd2')
+
+ tdSql.query('select meter1.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname')
+ tdSql.checkData(0, 0, 'd1')
+ tdSql.checkData(0, 1, 3)
+ # tdSql.checkData(1, 0, 'd2')
+ tdSql.query('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter2.tbname order by meter2.tbname')
+ tdSql.checkData(0, 0, 'd21')
+ tdSql.checkData(0, 1, 3)
+ # tdSql.checkData(1, 0, 'd22')
+ tdSql.query('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by meter2.tbname order by meter2.tbname')
+ tdSql.checkData(0, 0, 'd21')
+ tdSql.checkData(0, 1, 3)
+ # tdSql.checkData(1, 0, 'd22')
+ tdSql.query('select m2.tbname, count(*) from meter1 m1, meter2 m2 where m1.ts = m2.ts partition by m2.tbname order by m2.tbname')
+ tdSql.checkData(0, 0, 'd21')
+ tdSql.checkData(0, 1, 3)
+ # tdSql.checkData(1, 0, 'd22')
+
+ tdSql.execute('insert into `d22` select * from `d1`')
+
+ tdSql.query('select meter1.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname')
+ tdSql.checkData(0, 0, 'd1')
+ tdSql.checkData(0, 1, 6)
+
+ tdSql.query('select m2.tbname, count(*) from meter1 m1, meter2 m2 where m1.ts = m2.ts partition by m2.tbname order by m2.tbname')
+ tdSql.checkData(0, 0, 'd21')
+ tdSql.checkData(0, 1, 3)
+ tdSql.checkData(1, 0, 'd22')
+ tdSql.checkData(1, 1, 3)
+
+ tdSql.error('select tbname, count(*) from d1 a, d2 b where a.ts = b.ts group by b.tbname')
+ # tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter1.tbname order by meter1.tbname')
+ tdSql.error('select tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts group by meter2.tbname order by meter2.tbname')
+ tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by meter2.tbname order by meter.tbname')
+ tdSql.error('select meter2.tbname, count(*) from meter1, meter2 where meter1.ts = meter2.ts partition by tbname order by meter2.tbname')
+ tdSql.error('select m2.tbname, count(*) from meter1 m1, meter2 m2 where meter1.ts = meter2.ts partition by m2.tbname order by meter2.tbname')
+
def run(self):
tdSql.prepare()
startTime = time.time()
# self.create_tables()
- # self.insert_data()
-
+ # self.insert_data()
+
+ #self.testTBNameUseJoin()
self.dropandcreateDB_random("nested", 1)
+ self.testTBNameUseJoin()
+
self.modify_tables()
for i in range(1):
@@ -1590,6 +1683,8 @@ class TDTestCase(TDTestCase):
self.tbname_agg_all()
+
+
endTime = time.time()
print("total time %ds" % (endTime - startTime))
diff --git a/tests/system-test/2-query/agg_group_NotReturnValue.py b/tests/system-test/2-query/agg_group_NotReturnValue.py
index 73a8fe04c3..83f0acd362 100755
--- a/tests/system-test/2-query/agg_group_NotReturnValue.py
+++ b/tests/system-test/2-query/agg_group_NotReturnValue.py
@@ -382,7 +382,11 @@ class TDTestCase(TDTestCase):
#union all
sql = f"select tbname tb,AGG(COLUMN) from {dbname}.stable_1 group by tbname order by tbname "
sql = f"({sql}) union all ({sql}) order by tb"
- self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+ self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
+
+ sql = f"select a.tbname tb,AGG(COLUMN) from {dbname}.stable_1 a group by a.tbname order by tbname "
+ sql = f"({sql}) union all ({sql}) order by tb"
+ self.data_check_tbname(sql,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
sql1 = f"select * from ({sql})"
self.data_check_tbname(sql1,'HAVING>04','HAVING>04',f'{base_fun}',f'{replace_fun}',f'{base_column}',f'{replace_column}')
diff --git a/tests/system-test/2-query/compa4096_tsma.json b/tests/system-test/2-query/compa4096_tsma.json
index 66d98ceebe..993eb8ae58 100644
--- a/tests/system-test/2-query/compa4096_tsma.json
+++ b/tests/system-test/2-query/compa4096_tsma.json
@@ -1,66 +1,80 @@
{
- "filetype": "insert",
- "cfgdir": "/etc/taos",
- "host": "localhost",
- "port": 6030,
- "rest_port": 6041,
- "user": "root",
- "password": "taosdata",
- "thread_count": 100,
- "create_table_thread_count": 24,
- "result_file": "taosBenchmark_result.log",
- "confirm_parameter_prompt": "no",
- "insert_interval": 0,
- "num_of_records_per_req": 1000000,
- "max_sql_len": 1024000,
- "databases": [
- {
- "dbinfo": {
- "name": "db4096",
- "drop": "yes",
- "replica": 1,
- "duration": 10,
- "precision": "ms",
- "keep": 3650,
- "comp": 2,
- "vgroups": 2,
- "buffer": 1000
- },
- "super_tables": [
+ "filetype": "insert",
+ "cfgdir": "/etc/taos",
+ "host": "localhost",
+ "port": 6030,
+ "rest_port": 6041,
+ "user": "root",
+ "password": "taosdata",
+ "thread_count": 100,
+ "create_table_thread_count": 24,
+ "result_file": "taosBenchmark_result.log",
+ "confirm_parameter_prompt": "no",
+ "insert_interval": 0,
+ "num_of_records_per_req": 1000000,
+ "max_sql_len": 1024000,
+ "databases": [
{
- "name": "stb0",
- "child_table_exists": "no",
- "childtable_count":2,
- "childtable_prefix": "ctb0",
- "escape_character": "no",
- "auto_create_table": "no",
- "batch_create_tbl_num": 500,
- "data_source": "rand",
- "insert_mode": "taosc",
- "rollup": null,
- "interlace_rows": 0,
- "line_protocol": null,
- "tcp_transfer": "no",
- "insert_rows": 10,
- "childtable_limit": 0,
- "childtable_offset": 0,
- "rows_per_tbl": 0,
- "max_sql_len": 1048576,
- "disorder_ratio": 0,
- "disorder_range": 1000,
- "timestamp_step": 1000,
- "start_timestamp": "2022-10-22 17:20:36",
- "sample_format": "csv",
- "sample_file": "./sample.csv",
- "tags_file": "",
- "columns": [{ "type": "INT","count": 4093}],
- "tags": [{"type": "TINYINT", "count": 1},{"type": "NCHAR","count": 1}]
+ "dbinfo": {
+ "name": "db4096",
+ "drop": "yes",
+ "replica": 1,
+ "duration": 10,
+ "precision": "ms",
+ "keep": 3650,
+ "comp": 2,
+ "vgroups": 2,
+ "buffer": 1000
+ },
+ "super_tables": [
+ {
+ "name": "stb0",
+ "child_table_exists": "no",
+ "childtable_count": 2,
+ "childtable_prefix": "ctb0",
+ "escape_character": "no",
+ "auto_create_table": "no",
+ "batch_create_tbl_num": 500,
+ "data_source": "rand",
+ "insert_mode": "taosc",
+ "rollup": null,
+ "interlace_rows": 0,
+ "line_protocol": null,
+ "tcp_transfer": "no",
+ "insert_rows": 10,
+ "childtable_limit": 0,
+ "childtable_offset": 0,
+ "rows_per_tbl": 0,
+ "max_sql_len": 1048576,
+ "disorder_ratio": 0,
+ "disorder_range": 1000,
+ "timestamp_step": 1000,
+ "start_timestamp": "2022-10-22 17:20:36",
+ "sample_format": "csv",
+ "sample_file": "./sample.csv",
+ "tags_file": "",
+ "columns": [
+ {
+ "type": "INT",
+ "count": 4093
+ }
+ ],
+ "tags": [
+ {
+ "type": "TINYINT",
+ "count": 1
+ },
+ {
+ "type": "NCHAR",
+ "count": 1
+ }
+ ]
+ }
+ ]
}
- ]
- }
- ],
- "prepare_rand": 10000,
- "chinese": "no",
- "streams": false,
- "test_log": "/root/testlog/"
-}
+ ],
+ "prepare_rand": 10000,
+ "chinese": "no",
+ "streams": false,
+ "test_log": "/root/testlog/"
+}
\ No newline at end of file
diff --git a/tests/system-test/2-query/partition_limit_interval.py b/tests/system-test/2-query/partition_limit_interval.py
new file mode 100755
index 0000000000..dc0aabbfdd
--- /dev/null
+++ b/tests/system-test/2-query/partition_limit_interval.py
@@ -0,0 +1,105 @@
+from util.log import *
+from util.sql import *
+from util.cases import *
+
+class TDTestCase:
+ def init(self, conn, logSql, replicaVar=1):
+ self.replicaVar = int(replicaVar)
+ tdLog.debug("start to execute %s" % __file__)
+ tdSql.init(conn.cursor(), True)
+
+ self.row_nums = 1000
+ self.tb_nums = 10
+ self.ts = 1537146000000
+ self.dbname = "db1"
+ self.stable = "meters"
+
+ def prepare_datas(self, stb_name , tb_nums , row_nums, dbname="db" ):
+ tdSql.execute(f'''create database {self.dbname} MAXROWS 4096 MINROWS 100''')
+ tdSql.execute(f'''use {self.dbname}''')
+ tdSql.execute(f'''CREATE STABLE {self.dbname}.{self.stable} (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT) TAGS (`groupid` TINYINT, `location` VARCHAR(16))''')
+
+ for i in range(self.tb_nums):
+ tbname = f"{self.dbname}.sub_{self.stable}_{i}"
+ ts = self.ts + i*10000
+ tdSql.execute(f"create table {tbname} using {self.dbname}.{self.stable} tags({i} ,'nchar_{i}')")
+ tdLog.info(f"create table {tbname} using {self.dbname}.{self.stable} tags({i} ,'nchar_{i}')")
+ if i < (self.tb_nums - 2):
+ for row in range(row_nums):
+ ts = self.ts + row*1000
+ tdSql.execute(f"insert into {tbname} values({ts} , {row/10}, {215 + (row % 100)})")
+
+ for null in range(5):
+ ts = self.ts + row_nums*1000 + null*1000
+ tdSql.execute(f"insert into {tbname} values({ts} , NULL , NULL)")
+
+ def basic_query(self):
+ tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by groupid interval(1d) limit 100")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 1, 1005)
+
+ tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by tbname interval(1d) order by groupid limit 100;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, 1005)
+ tdSql.checkData(7, 0, 7)
+ tdSql.checkData(7, 1, 1005)
+
+ tdSql.query(f"select groupid, count(*) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) order by groupid limit 10")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, 1005)
+ tdSql.checkData(7, 0, 7)
+ tdSql.checkData(7, 1, 1005)
+
+ tdSql.query(f"select groupid, count(*), min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) order by groupid limit 10;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 0, 0)
+ tdSql.checkData(0, 1, 1005)
+ tdSql.checkData(0, 2, 0)
+ tdSql.checkData(7, 0, 7)
+ tdSql.checkData(7, 1, 1005)
+ tdSql.checkData(7, 2, 0)
+
+ tdSql.query(f"select groupid, min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 100;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 1, 0)
+
+ tdSql.query(f"select groupid, avg(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 10000;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 1, tdSql.getData(7, 1))
+
+ tdSql.query(f"select current, avg(current) from {self.dbname}.{self.stable} partition by current interval(5d) limit 100;")
+ tdSql.checkData(0, 0, tdSql.getData(0, 1))
+
+ tdSql.query(f"select groupid, last(voltage), min(current) from {self.dbname}.{self.stable} partition by groupid interval(5d) limit 10")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 1, tdSql.getData(7, 1))
+ tdSql.checkData(0, 2, tdSql.getData(7, 2))
+
+ tdSql.query(f"select groupid, min(current), min(voltage) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) limit 100;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 1, 0)
+ tdSql.checkData(0, 2, 215)
+ tdSql.checkData(7, 1, 0)
+ tdSql.checkData(7, 2, 215)
+
+ tdSql.query(f"select groupid, min(voltage), min(current) from {self.dbname}.{self.stable} partition by tbname, groupid interval(5d) limit 100;")
+ tdSql.checkRows(8)
+ tdSql.checkData(0, 2, 0)
+ tdSql.checkData(0, 1, 215)
+ tdSql.checkData(7, 2, 0)
+ tdSql.checkData(7, 1, 215)
+
+ def run(self):
+ tdSql.prepare()
+ self.prepare_datas("stb",self.tb_nums,self.row_nums)
+ self.basic_query()
+
+ def stop(self):
+ tdSql.close()
+ tdLog.success("%s successfully executed" % __file__)
+
+
+tdCases.addWindows(__file__, TDTestCase())
+tdCases.addLinux(__file__, TDTestCase())
diff --git a/tests/system-test/2-query/tsma.py b/tests/system-test/2-query/tsma.py
index f80aab0e82..d7dc1d24f3 100644
--- a/tests/system-test/2-query/tsma.py
+++ b/tests/system-test/2-query/tsma.py
@@ -1270,15 +1270,14 @@ class TDTestCase:
def test_drop_tsma(self):
function_name = sys._getframe().f_code.co_name
tdLog.debug(f'-----{function_name}------')
- self.create_tsma('tsma1', 'test', 'meters', [
- 'avg(c1)', 'avg(c2)'], '5m')
+ self.create_tsma('tsma1', 'test', 'meters', ['avg(c1)', 'avg(c2)'], '5m')
self.create_recursive_tsma('tsma1', 'tsma2', 'test', '15m', 'meters')
# drop recursive tsma first
tdSql.error('drop tsma test.tsma1', -2147482491)
tdSql.execute('drop tsma test.tsma2', queryTimes=1)
tdSql.execute('drop tsma test.tsma1', queryTimes=1)
- self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
+ self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
tdSql.execute('drop database test', queryTimes=1)
self.init_data()
@@ -1319,7 +1318,7 @@ class TDTestCase:
'create tsma tsma1 on nsdb.meters function(avg(c1), avg(c2), avg(t3)) interval(5m)', -2147471096)
tdSql.execute('alter table nsdb.meters drop tag t3', queryTimes=1)
- self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
+ self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
tdSql.execute('drop database nsdb')
# drop norm table
@@ -1346,7 +1345,7 @@ class TDTestCase:
# test drop stream
tdSql.error('drop stream tsma1', -2147471088) ## TSMA must be dropped first
- self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
+ self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
tdSql.execute('drop database test', queryTimes=1)
self.init_data()
@@ -1449,7 +1448,7 @@ class TDTestCase:
tdSql.error(
'create tsma tsma1 on test.meters function(avg(c1), avg(c2)) interval(2h)', -2147471097)
- self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
+ self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
tdSql.execute('drop database nsdb')
def test_create_tsma_on_norm_table(self):
diff --git a/tests/system-test/6-cluster/clusterCommonCheck.py b/tests/system-test/6-cluster/clusterCommonCheck.py
index 694227cea7..be99d01a5c 100644
--- a/tests/system-test/6-cluster/clusterCommonCheck.py
+++ b/tests/system-test/6-cluster/clusterCommonCheck.py
@@ -237,21 +237,19 @@ class ClusterComCheck:
last_number=vgroup_numbers-1
while count < count_number:
time.sleep(1)
+ count+=1
+ print("check vgroup count :", count)
tdSql.query(f"show {db_name}.vgroups;")
- if count == 0 :
- if tdSql.checkRows(vgroup_numbers) :
- tdLog.success(f"{db_name} has {vgroup_numbers} vgroups" )
- else:
- tdLog.exit(f"vgroup number of {db_name} is not correct")
+ if tdSql.getRows() != vgroup_numbers :
+ continue
if self.db_replica == 1 :
if tdSql.queryResult[0][4] == 'leader' and tdSql.queryResult[last_number][4] == 'leader':
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")
print("db replica :",tdSql.queryResult[0][0])
if tdSql.queryResult[0][0] == db_replica:
- ready_time= (count + 1)
- tdLog.success(f"all vgroups with replica {self.db_replica} of {db_name} are leaders in {count + 1} s")
+ tdLog.success(f"all vgroups with replica {self.db_replica} of {db_name} are leaders in {count} s")
return True
- count+=1
+
elif self.db_replica == 3 :
vgroup_status_first=[tdSql.queryResult[0][4],tdSql.queryResult[0][6],tdSql.queryResult[0][8]]
@@ -261,10 +259,8 @@ class ClusterComCheck:
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")
print("db replica :",tdSql.queryResult[0][0])
if tdSql.queryResult[0][0] == db_replica:
- ready_time= (count + 1)
- tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {ready_time} s")
+ tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {count} s")
return True
- count+=1
else:
tdLog.debug(tdSql.queryResult)
tdLog.notice(f"elections of {db_name} all vgroups with replica {self.db_replica} are failed in {count} s ")
diff --git a/tests/system-test/7-tmq/subscribeDb3.py b/tests/system-test/7-tmq/subscribeDb3.py
index 37e3a17100..185d1b01cf 100644
--- a/tests/system-test/7-tmq/subscribeDb3.py
+++ b/tests/system-test/7-tmq/subscribeDb3.py
@@ -219,7 +219,7 @@ class TDTestCase:
expectrowcnt = parameterDict["rowsPerTbl"] * parameterDict["ctbNum"]
topicList = topicName1
ifcheckdata = 0
- ifManualCommit = 1
+ ifManualCommit = 0
keyList = 'group.id:cgrp1,\
enable.auto.commit:false,\
auto.commit.interval.ms:6000,\
diff --git a/tests/system-test/7-tmq/tmqDropStbCtb.py b/tests/system-test/7-tmq/tmqDropStbCtb.py
index eacacd913b..a1929237b7 100644
--- a/tests/system-test/7-tmq/tmqDropStbCtb.py
+++ b/tests/system-test/7-tmq/tmqDropStbCtb.py
@@ -157,7 +157,7 @@ class TDTestCase:
tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, expectrowcnt))
if self.snapshot == 0:
- if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows < expectrowcnt)):
+ if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows <= expectrowcnt)):
tdLog.exit("tmq consume rows error with snapshot = 0!")
tdLog.info("wait subscriptions exit ....")
@@ -249,7 +249,7 @@ class TDTestCase:
tdLog.info("act consume rows: %d, expect consume rows: %d"%(totalConsumeRows, expectrowcnt))
if self.snapshot == 0:
- if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows < expectrowcnt)):
+ if not ((totalConsumeRows > expectrowcnt / 2) and (totalConsumeRows <= expectrowcnt)):
tdLog.exit("tmq consume rows error with snapshot = 0!")
tdLog.info("wait subscriptions exit ....")
diff --git a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py
index f01bf2558c..a5e61adc8d 100644
--- a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py
+++ b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select-false.py
@@ -200,12 +200,11 @@ class TDTestCase:
# tmqCom.checkFileContent(consumerId, queryString)
- time.sleep(2)
for i in range(len(topicNameList)):
tdSql.query("drop topic %s"%topicNameList[i])
- if deleteWal == True:
- clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240)
+ clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240)
+
tdLog.printNoPrefix("======== test case 1 end ...... ")
def run(self):
diff --git a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py
index 5e11de04cb..eb35ebc718 100644
--- a/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py
+++ b/tests/system-test/7-tmq/tmqVnodeSplit-stb-select.py
@@ -199,13 +199,11 @@ class TDTestCase:
tdLog.exit("%d tmq consume rows error!"%consumerId)
# tmqCom.checkFileContent(consumerId, queryString)
+ clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240)
- time.sleep(2)
+ time.sleep(3)
for i in range(len(topicNameList)):
tdSql.query("drop topic %s"%topicNameList[i])
-
- if deleteWal == True:
- clusterComCheck.check_vgroups_status(vgroup_numbers=2,db_replica=self.replicaVar,db_name="dbt",count_number=240)
tdLog.printNoPrefix("======== test case 1 end ...... ")
def run(self):
diff --git a/tests/system-test/8-stream/stream_multi_agg.py b/tests/system-test/8-stream/stream_multi_agg.py
index acb80f528b..32c2648b46 100644
--- a/tests/system-test/8-stream/stream_multi_agg.py
+++ b/tests/system-test/8-stream/stream_multi_agg.py
@@ -42,7 +42,7 @@ class TDTestCase:
tdSql.execute("use test", queryTimes=100)
tdSql.query("create stream if not exists s1 trigger at_once ignore expired 0 ignore update 0 fill_history 1 into st1 as select _wstart,sum(voltage),groupid from meters partition by groupid interval(2s)")
tdLog.debug("========create stream and insert data ok========")
- time.sleep(15)
+ time.sleep(20)
tdSql.query("select _wstart,sum(voltage),groupid from meters partition by groupid interval(2s) order by groupid,_wstart")
rowCnt = tdSql.getRows()
@@ -68,7 +68,7 @@ class TDTestCase:
# create stream
tdSql.execute("use db", queryTimes=100)
tdSql.execute("create stream stream1 fill_history 1 into sta as select count(*) as cnt from meters interval(10a);",show=True)
- time.sleep(5)
+ time.sleep(10)
sql = "select count(*) from sta"
# loop wait max 60s to check count is ok
diff --git a/tests/system-test/runAllOne.sh b/tests/system-test/runAllOne.sh
index 099ae1bbd3..79fc2cd363 100644
--- a/tests/system-test/runAllOne.sh
+++ b/tests/system-test/runAllOne.sh
@@ -235,6 +235,8 @@ python3 ./test.py -f 2-query/mavg.py -P
python3 ./test.py -f 2-query/mavg.py -P -R
python3 ./test.py -f 2-query/max_partition.py -P
python3 ./test.py -f 2-query/max_partition.py -P -R
+python3 ./test.py -f 2-query/partition_limit_interval.py -P
+python3 ./test.py -f 2-query/partition_limit_interval.py -P -R
python3 ./test.py -f 2-query/max_min_last_interval.py -P
python3 ./test.py -f 2-query/last_row_interval.py -P
python3 ./test.py -f 2-query/max.py -P
@@ -481,6 +483,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 2
python3 ./test.py -f 2-query/function_null.py -P -Q 2
python3 ./test.py -f 2-query/count_partition.py -P -Q 2
python3 ./test.py -f 2-query/max_partition.py -P -Q 2
+python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 2
python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 2
python3 ./test.py -f 2-query/last_row_interval.py -P -Q 2
python3 ./test.py -f 2-query/last_row.py -P -Q 2
@@ -576,6 +579,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 3
python3 ./test.py -f 2-query/function_null.py -P -Q 3
python3 ./test.py -f 2-query/count_partition.py -P -Q 3
python3 ./test.py -f 2-query/max_partition.py -P -Q 3
+python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 3
python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 3
python3 ./test.py -f 2-query/last_row_interval.py -P -Q 3
python3 ./test.py -f 2-query/last_row.py -P -Q 3
@@ -673,6 +677,7 @@ python3 ./test.py -f 2-query/irate.py -P -Q 4
python3 ./test.py -f 2-query/function_null.py -P -Q 4
python3 ./test.py -f 2-query/count_partition.py -P -Q 4
python3 ./test.py -f 2-query/max_partition.py -P -Q 4
+python3 ./test.py -f 2-query/partition_limit_interval.py -P -Q 4
python3 ./test.py -f 2-query/max_min_last_interval.py -P -Q 4
python3 ./test.py -f 2-query/last_row_interval.py -P -Q 4
python3 ./test.py -f 2-query/last_row.py -P -Q 4