diff --git a/README-CN.md b/README-CN.md index 437d671bb9..a5d239a532 100644 --- a/README-CN.md +++ b/README-CN.md @@ -60,7 +60,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev 为了在 Ubuntu/Debian 系统上编译 [taos-tools](https://github.com/taosdata/taos-tools) 需要安装如下软件: ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config ``` ### CentOS 7.9 @@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel ``` -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` #### CentOS 8/Rocky Linux @@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` 注意:由于 snappy 缺乏 pkg-config 支持(参考 [链接](https://github.com/google/snappy/pull/86)),会导致 cmake 提示无法发现 libsnappy,实际上工作正常。 diff --git a/README.md b/README.md index 6aec756ec7..05c1c075f0 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ sudo apt-get install -y gcc cmake build-essential git libssl-dev To build the [taosTools](https://github.com/taosdata/taos-tools) on Ubuntu/Debian, the following packages need to be installed. ```bash -sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev pkg-config +sudo apt install build-essential libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config ``` ### CentOS 7.9 @@ -85,7 +85,7 @@ sudo dnf install -y gcc gcc-c++ make cmake epel-release git openssl-devel #### CentOS 7.9 ``` -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` #### CentOS 8/Rocky Linux @@ -94,7 +94,7 @@ sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgco sudo yum install -y epel-release sudo yum install -y dnf-plugins-core sudo yum config-manager --set-enabled powertools -sudo yum install -y zlib-devel xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libstdc++-static openssl-devel +sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson-devel pkgconfig libatomic libatomic-static libstdc++-static openssl-devel ``` Note: Since snappy lacks pkg-config support (refer to [link](https://github.com/google/snappy/pull/86)), it leads a cmake prompt libsnappy not found. But snappy still works well. diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 2d7bcf6592..7247200fe7 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 e62c5ea + GIT_TAG 4a4027c SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/include/client/taos.h b/include/client/taos.h index 69774b750f..379363c51d 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -149,7 +149,7 @@ DLL_EXPORT TAOS *taos_connect(const char *ip, const char *user, const char DLL_EXPORT TAOS *taos_connect_auth(const char *ip, const char *user, const char *auth, const char *db, uint16_t port); DLL_EXPORT void taos_close(TAOS *taos); -const char *taos_data_type(int type); +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); diff --git a/include/common/tmsg.h b/include/common/tmsg.h index fd53141659..3537ba687d 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -70,6 +70,11 @@ static inline bool vnodeIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || (type == TDMT_VND_UPDATE_TAG_VAL); } + +static inline bool syncUtilUserCommit(tmsg_t msgType) { + return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; +} + /* ------------------------ OTHER DEFINITIONS ------------------------ */ // IE type #define TSDB_IE_TYPE_SEC 1 @@ -502,6 +507,8 @@ typedef struct { char* pComment; char* pAst1; char* pAst2; + int64_t deleteMark1; + int64_t deleteMark2; } SMCreateStbReq; int32_t tSerializeSMCreateStbReq(void* buf, int32_t bufLen, SMCreateStbReq* pReq); @@ -2017,6 +2024,7 @@ typedef struct { typedef struct { int64_t maxdelay[2]; int64_t watermark[2]; + int64_t deleteMark[2]; int32_t qmsgLen[2]; char* qmsg[2]; // pAst:qmsg:SRetention => trigger aggr task1/2 } SRSmaParam; @@ -2743,6 +2751,7 @@ typedef struct { char* tagsFilter; char* sql; char* ast; + int64_t deleteMark; } SMCreateSmaReq; int32_t tSerializeSMCreateSmaReq(void* buf, int32_t bufLen, SMCreateSmaReq* pReq); @@ -3269,6 +3278,17 @@ void tDestroySSubmitRsp2(SSubmitRsp2* pRsp, int32_t flag); #define TSDB_MSG_FLG_ENCODE 0x1 #define TSDB_MSG_FLG_DECODE 0x2 +typedef struct { + union { + struct { + void* msgStr; + int32_t msgLen; + int64_t ver; + }; + void* pDataBlock; + }; +} SPackedData; + #pragma pack(pop) #ifdef __cplusplus diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index ccf91600db..fc630cfdc0 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -147,195 +147,196 @@ #define TK_ROLLUP 129 #define TK_TTL 130 #define TK_SMA 131 -#define TK_FIRST 132 -#define TK_LAST 133 -#define TK_SHOW 134 -#define TK_PRIVILEGES 135 -#define TK_DATABASES 136 -#define TK_TABLES 137 -#define TK_STABLES 138 -#define TK_MNODES 139 -#define TK_QNODES 140 -#define TK_FUNCTIONS 141 -#define TK_INDEXES 142 -#define TK_ACCOUNTS 143 -#define TK_APPS 144 -#define TK_CONNECTIONS 145 -#define TK_LICENCES 146 -#define TK_GRANTS 147 -#define TK_QUERIES 148 -#define TK_SCORES 149 -#define TK_TOPICS 150 -#define TK_VARIABLES 151 -#define TK_CLUSTER 152 -#define TK_BNODES 153 -#define TK_SNODES 154 -#define TK_TRANSACTIONS 155 -#define TK_DISTRIBUTED 156 -#define TK_CONSUMERS 157 -#define TK_SUBSCRIPTIONS 158 -#define TK_VNODES 159 -#define TK_LIKE 160 -#define TK_TBNAME 161 -#define TK_QTAGS 162 -#define TK_AS 163 -#define TK_INDEX 164 -#define TK_FUNCTION 165 -#define TK_INTERVAL 166 -#define TK_TOPIC 167 -#define TK_WITH 168 -#define TK_META 169 -#define TK_CONSUMER 170 -#define TK_GROUP 171 -#define TK_DESC 172 -#define TK_DESCRIBE 173 -#define TK_RESET 174 -#define TK_QUERY 175 -#define TK_CACHE 176 -#define TK_EXPLAIN 177 -#define TK_ANALYZE 178 -#define TK_VERBOSE 179 -#define TK_NK_BOOL 180 -#define TK_RATIO 181 -#define TK_NK_FLOAT 182 -#define TK_OUTPUTTYPE 183 -#define TK_AGGREGATE 184 -#define TK_BUFSIZE 185 -#define TK_STREAM 186 -#define TK_INTO 187 -#define TK_TRIGGER 188 -#define TK_AT_ONCE 189 -#define TK_WINDOW_CLOSE 190 -#define TK_IGNORE 191 -#define TK_EXPIRED 192 -#define TK_FILL_HISTORY 193 -#define TK_SUBTABLE 194 -#define TK_KILL 195 -#define TK_CONNECTION 196 -#define TK_TRANSACTION 197 -#define TK_BALANCE 198 -#define TK_VGROUP 199 -#define TK_MERGE 200 -#define TK_REDISTRIBUTE 201 -#define TK_SPLIT 202 -#define TK_DELETE 203 -#define TK_INSERT 204 -#define TK_NULL 205 -#define TK_NK_QUESTION 206 -#define TK_NK_ARROW 207 -#define TK_ROWTS 208 -#define TK_QSTART 209 -#define TK_QEND 210 -#define TK_QDURATION 211 -#define TK_WSTART 212 -#define TK_WEND 213 -#define TK_WDURATION 214 -#define TK_IROWTS 215 -#define TK_CAST 216 -#define TK_NOW 217 -#define TK_TODAY 218 -#define TK_TIMEZONE 219 -#define TK_CLIENT_VERSION 220 -#define TK_SERVER_VERSION 221 -#define TK_SERVER_STATUS 222 -#define TK_CURRENT_USER 223 -#define TK_COUNT 224 -#define TK_LAST_ROW 225 -#define TK_CASE 226 -#define TK_END 227 -#define TK_WHEN 228 -#define TK_THEN 229 -#define TK_ELSE 230 -#define TK_BETWEEN 231 -#define TK_IS 232 -#define TK_NK_LT 233 -#define TK_NK_GT 234 -#define TK_NK_LE 235 -#define TK_NK_GE 236 -#define TK_NK_NE 237 -#define TK_MATCH 238 -#define TK_NMATCH 239 -#define TK_CONTAINS 240 -#define TK_IN 241 -#define TK_JOIN 242 -#define TK_INNER 243 -#define TK_SELECT 244 -#define TK_DISTINCT 245 -#define TK_WHERE 246 -#define TK_PARTITION 247 -#define TK_BY 248 -#define TK_SESSION 249 -#define TK_STATE_WINDOW 250 -#define TK_SLIDING 251 -#define TK_FILL 252 -#define TK_VALUE 253 -#define TK_NONE 254 -#define TK_PREV 255 -#define TK_LINEAR 256 -#define TK_NEXT 257 -#define TK_HAVING 258 -#define TK_RANGE 259 -#define TK_EVERY 260 -#define TK_ORDER 261 -#define TK_SLIMIT 262 -#define TK_SOFFSET 263 -#define TK_LIMIT 264 -#define TK_OFFSET 265 -#define TK_ASC 266 -#define TK_NULLS 267 -#define TK_ABORT 268 -#define TK_AFTER 269 -#define TK_ATTACH 270 -#define TK_BEFORE 271 -#define TK_BEGIN 272 -#define TK_BITAND 273 -#define TK_BITNOT 274 -#define TK_BITOR 275 -#define TK_BLOCKS 276 -#define TK_CHANGE 277 -#define TK_COMMA 278 -#define TK_COMPACT 279 -#define TK_CONCAT 280 -#define TK_CONFLICT 281 -#define TK_COPY 282 -#define TK_DEFERRED 283 -#define TK_DELIMITERS 284 -#define TK_DETACH 285 -#define TK_DIVIDE 286 -#define TK_DOT 287 -#define TK_EACH 288 -#define TK_FAIL 289 -#define TK_FILE 290 -#define TK_FOR 291 -#define TK_GLOB 292 -#define TK_ID 293 -#define TK_IMMEDIATE 294 -#define TK_IMPORT 295 -#define TK_INITIALLY 296 -#define TK_INSTEAD 297 -#define TK_ISNULL 298 -#define TK_KEY 299 -#define TK_MODULES 300 -#define TK_NK_BITNOT 301 -#define TK_NK_SEMI 302 -#define TK_NOTNULL 303 -#define TK_OF 304 -#define TK_PLUS 305 -#define TK_PRIVILEGE 306 -#define TK_RAISE 307 -#define TK_REPLACE 308 -#define TK_RESTRICT 309 -#define TK_ROW 310 -#define TK_SEMI 311 -#define TK_STAR 312 -#define TK_STATEMENT 313 -#define TK_STRING 314 -#define TK_TIMES 315 -#define TK_UPDATE 316 -#define TK_VALUES 317 -#define TK_VARIABLE 318 -#define TK_VIEW 319 -#define TK_WAL 320 +#define TK_DELETE_MARK 132 +#define TK_FIRST 133 +#define TK_LAST 134 +#define TK_SHOW 135 +#define TK_PRIVILEGES 136 +#define TK_DATABASES 137 +#define TK_TABLES 138 +#define TK_STABLES 139 +#define TK_MNODES 140 +#define TK_QNODES 141 +#define TK_FUNCTIONS 142 +#define TK_INDEXES 143 +#define TK_ACCOUNTS 144 +#define TK_APPS 145 +#define TK_CONNECTIONS 146 +#define TK_LICENCES 147 +#define TK_GRANTS 148 +#define TK_QUERIES 149 +#define TK_SCORES 150 +#define TK_TOPICS 151 +#define TK_VARIABLES 152 +#define TK_CLUSTER 153 +#define TK_BNODES 154 +#define TK_SNODES 155 +#define TK_TRANSACTIONS 156 +#define TK_DISTRIBUTED 157 +#define TK_CONSUMERS 158 +#define TK_SUBSCRIPTIONS 159 +#define TK_VNODES 160 +#define TK_LIKE 161 +#define TK_TBNAME 162 +#define TK_QTAGS 163 +#define TK_AS 164 +#define TK_INDEX 165 +#define TK_FUNCTION 166 +#define TK_INTERVAL 167 +#define TK_TOPIC 168 +#define TK_WITH 169 +#define TK_META 170 +#define TK_CONSUMER 171 +#define TK_GROUP 172 +#define TK_DESC 173 +#define TK_DESCRIBE 174 +#define TK_RESET 175 +#define TK_QUERY 176 +#define TK_CACHE 177 +#define TK_EXPLAIN 178 +#define TK_ANALYZE 179 +#define TK_VERBOSE 180 +#define TK_NK_BOOL 181 +#define TK_RATIO 182 +#define TK_NK_FLOAT 183 +#define TK_OUTPUTTYPE 184 +#define TK_AGGREGATE 185 +#define TK_BUFSIZE 186 +#define TK_STREAM 187 +#define TK_INTO 188 +#define TK_TRIGGER 189 +#define TK_AT_ONCE 190 +#define TK_WINDOW_CLOSE 191 +#define TK_IGNORE 192 +#define TK_EXPIRED 193 +#define TK_FILL_HISTORY 194 +#define TK_SUBTABLE 195 +#define TK_KILL 196 +#define TK_CONNECTION 197 +#define TK_TRANSACTION 198 +#define TK_BALANCE 199 +#define TK_VGROUP 200 +#define TK_MERGE 201 +#define TK_REDISTRIBUTE 202 +#define TK_SPLIT 203 +#define TK_DELETE 204 +#define TK_INSERT 205 +#define TK_NULL 206 +#define TK_NK_QUESTION 207 +#define TK_NK_ARROW 208 +#define TK_ROWTS 209 +#define TK_QSTART 210 +#define TK_QEND 211 +#define TK_QDURATION 212 +#define TK_WSTART 213 +#define TK_WEND 214 +#define TK_WDURATION 215 +#define TK_IROWTS 216 +#define TK_CAST 217 +#define TK_NOW 218 +#define TK_TODAY 219 +#define TK_TIMEZONE 220 +#define TK_CLIENT_VERSION 221 +#define TK_SERVER_VERSION 222 +#define TK_SERVER_STATUS 223 +#define TK_CURRENT_USER 224 +#define TK_COUNT 225 +#define TK_LAST_ROW 226 +#define TK_CASE 227 +#define TK_END 228 +#define TK_WHEN 229 +#define TK_THEN 230 +#define TK_ELSE 231 +#define TK_BETWEEN 232 +#define TK_IS 233 +#define TK_NK_LT 234 +#define TK_NK_GT 235 +#define TK_NK_LE 236 +#define TK_NK_GE 237 +#define TK_NK_NE 238 +#define TK_MATCH 239 +#define TK_NMATCH 240 +#define TK_CONTAINS 241 +#define TK_IN 242 +#define TK_JOIN 243 +#define TK_INNER 244 +#define TK_SELECT 245 +#define TK_DISTINCT 246 +#define TK_WHERE 247 +#define TK_PARTITION 248 +#define TK_BY 249 +#define TK_SESSION 250 +#define TK_STATE_WINDOW 251 +#define TK_SLIDING 252 +#define TK_FILL 253 +#define TK_VALUE 254 +#define TK_NONE 255 +#define TK_PREV 256 +#define TK_LINEAR 257 +#define TK_NEXT 258 +#define TK_HAVING 259 +#define TK_RANGE 260 +#define TK_EVERY 261 +#define TK_ORDER 262 +#define TK_SLIMIT 263 +#define TK_SOFFSET 264 +#define TK_LIMIT 265 +#define TK_OFFSET 266 +#define TK_ASC 267 +#define TK_NULLS 268 +#define TK_ABORT 269 +#define TK_AFTER 270 +#define TK_ATTACH 271 +#define TK_BEFORE 272 +#define TK_BEGIN 273 +#define TK_BITAND 274 +#define TK_BITNOT 275 +#define TK_BITOR 276 +#define TK_BLOCKS 277 +#define TK_CHANGE 278 +#define TK_COMMA 279 +#define TK_COMPACT 280 +#define TK_CONCAT 281 +#define TK_CONFLICT 282 +#define TK_COPY 283 +#define TK_DEFERRED 284 +#define TK_DELIMITERS 285 +#define TK_DETACH 286 +#define TK_DIVIDE 287 +#define TK_DOT 288 +#define TK_EACH 289 +#define TK_FAIL 290 +#define TK_FILE 291 +#define TK_FOR 292 +#define TK_GLOB 293 +#define TK_ID 294 +#define TK_IMMEDIATE 295 +#define TK_IMPORT 296 +#define TK_INITIALLY 297 +#define TK_INSTEAD 298 +#define TK_ISNULL 299 +#define TK_KEY 300 +#define TK_MODULES 301 +#define TK_NK_BITNOT 302 +#define TK_NK_SEMI 303 +#define TK_NOTNULL 304 +#define TK_OF 305 +#define TK_PLUS 306 +#define TK_PRIVILEGE 307 +#define TK_RAISE 308 +#define TK_REPLACE 309 +#define TK_RESTRICT 310 +#define TK_ROW 311 +#define TK_SEMI 312 +#define TK_STAR 313 +#define TK_STATEMENT 314 +#define TK_STRING 315 +#define TK_TIMES 316 +#define TK_UPDATE 317 +#define TK_VALUES 318 +#define TK_VARIABLE 319 +#define TK_VIEW 320 +#define TK_WAL 321 #define TK_NK_SPACE 600 #define TK_NK_COMMENT 601 diff --git a/include/libs/executor/executor.h b/include/libs/executor/executor.h index c7db114b73..4d9c0866c3 100644 --- a/include/libs/executor/executor.h +++ b/include/libs/executor/executor.h @@ -190,7 +190,9 @@ int32_t qStreamPrepareTsdbScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType); -int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq, int64_t ver); +// int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq, int64_t ver); +// +int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedData submit); int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset); diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index e69c6e747d..b1054e7b85 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -133,6 +133,9 @@ typedef struct STableOptions { SNodeList* pWatermark; int64_t watermark1; int64_t watermark2; + SNodeList* pDeleteMark; + int64_t deleteMark1; + int64_t deleteMark2; SNodeList* pRollupFuncs; int32_t ttl; SNodeList* pSma; @@ -383,6 +386,7 @@ typedef struct SStreamOptions { int8_t triggerType; SNode* pDelay; SNode* pWatermark; + SNode* pDeleteMark; int8_t fillHistory; int8_t ignoreExpired; } SStreamOptions; diff --git a/include/libs/nodes/nodes.h b/include/libs/nodes/nodes.h index f94e0c98dc..412054b13e 100644 --- a/include/libs/nodes/nodes.h +++ b/include/libs/nodes/nodes.h @@ -234,7 +234,6 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN, QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN, QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN, - QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN, QUERY_NODE_PHYSICAL_PLAN_PROJECT, QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN, QUERY_NODE_PHYSICAL_PLAN_HASH_AGG, @@ -265,7 +264,8 @@ typedef enum ENodeType { QUERY_NODE_PHYSICAL_PLAN_QUERY_INSERT, QUERY_NODE_PHYSICAL_PLAN_DELETE, QUERY_NODE_PHYSICAL_SUBPLAN, - QUERY_NODE_PHYSICAL_PLAN + QUERY_NODE_PHYSICAL_PLAN, + QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN } ENodeType; /** diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 574d41db58..d62bdb93cf 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -91,6 +91,7 @@ typedef struct SScanLogicNode { SNode* pTagIndexCond; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; SArray* pSmaIndexes; SNodeList* pGroupTags; @@ -213,6 +214,7 @@ typedef struct SWindowLogicNode { SNode* pStateExpr; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EWindowAlgorithm windowAlgo; EOrder inputTsOrder; @@ -440,6 +442,7 @@ typedef struct SWinodwPhysiNode { SNode* pTsEnd; // window end timestamp int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; EOrder inputTsOrder; EOrder outputTsOrder; diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index 82f5c478c1..f7bd68393e 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -34,6 +34,7 @@ typedef struct SPlanContext { bool showRewrite; int8_t triggerType; int64_t watermark; + int64_t deleteMark; int8_t igExpired; char* pMsg; int32_t msgLen; diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index 16cf960724..a2a512fb07 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -103,6 +103,7 @@ typedef struct { int8_t type; } SStreamQueueItem; +#if 0 typedef struct { int8_t type; int64_t ver; @@ -116,6 +117,21 @@ typedef struct { SArray* dataRefs; // SArray SArray* reqs; // SArray } SStreamMergedSubmit; +#endif + +typedef struct { + int8_t type; + int64_t ver; + int32_t* dataRef; + SPackedData submit; +} SStreamDataSubmit2; + +typedef struct { + int8_t type; + int64_t ver; + SArray* dataRefs; // SArray + SArray* submits; // SArray +} SStreamMergedSubmit2; typedef struct { int8_t type; @@ -219,11 +235,11 @@ static FORCE_INLINE void* streamQueueNextItem(SStreamQueue* queue) { } } -SStreamDataSubmit* streamDataSubmitNew(SSubmitReq* pReq); +SStreamDataSubmit2* streamDataSubmitNew(SPackedData submit); -void streamDataSubmitRefDec(SStreamDataSubmit* pDataSubmit); +void streamDataSubmitRefDec(SStreamDataSubmit2* pDataSubmit); -SStreamDataSubmit* streamSubmitRefClone(SStreamDataSubmit* pSubmit); +SStreamDataSubmit2* streamSubmitRefClone(SStreamDataSubmit2* pSubmit); typedef struct { char* qmsg; @@ -355,14 +371,15 @@ void tFreeSStreamTask(SStreamTask* pTask); static FORCE_INLINE int32_t streamTaskInput(SStreamTask* pTask, SStreamQueueItem* pItem) { if (pItem->type == STREAM_INPUT__DATA_SUBMIT) { - SStreamDataSubmit* pSubmitClone = streamSubmitRefClone((SStreamDataSubmit*)pItem); + SStreamDataSubmit2* pSubmitClone = streamSubmitRefClone((SStreamDataSubmit2*)pItem); if (pSubmitClone == NULL) { qDebug("task %d %p submit enqueue failed since out of memory", pTask->taskId, pTask); terrno = TSDB_CODE_OUT_OF_MEMORY; atomic_store_8(&pTask->inputStatus, TASK_INPUT_STATUS__FAILED); return -1; } - qDebug("task %d %p submit enqueue %p %p %p", pTask->taskId, pTask, pItem, pSubmitClone, pSubmitClone->data); + qDebug("task %d %p submit enqueue %p %p %p %d %" PRId64, pTask->taskId, pTask, pItem, pSubmitClone, + pSubmitClone->submit.msgStr, pSubmitClone->submit.msgLen, pSubmitClone->submit.ver); taosWriteQitem(pTask->inputQueue->queue, pSubmitClone); // qStreamInput(pTask->exec.executor, pSubmitClone); } else if (pItem->type == STREAM_INPUT__DATA_BLOCK || pItem->type == STREAM_INPUT__DATA_RETRIEVE || diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index 7f9b240f63..4cf4800472 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -25,7 +25,7 @@ extern "C" { #include "tlrucache.h" #include "tmsgcb.h" -#define SYNC_RESP_TTL_MS 10000000 +#define SYNC_RESP_TTL_MS 30000 #define SYNC_SPEED_UP_HB_TIMER 400 #define SYNC_SPEED_UP_AFTER_MS (1000 * 20) #define SYNC_SLOW_DOWN_RANGE 100 @@ -47,6 +47,7 @@ extern "C" { #define SYNC_HEARTBEAT_SLOW_MS 1500 #define SYNC_HEARTBEAT_REPLY_SLOW_MS 1500 +#define SYNC_SNAP_RESEND_MS 1000 * 60 #define SYNC_MAX_BATCH_SIZE 1 #define SYNC_INDEX_BEGIN 0 diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index d761813db1..87f753e6aa 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -72,6 +72,7 @@ typedef struct SRpcMsg { typedef void (*RpcCfp)(void *parent, SRpcMsg *, SEpSet *epset); typedef bool (*RpcRfp)(int32_t code, tmsg_t msgType); typedef bool (*RpcTfp)(int32_t code, tmsg_t msgType); +typedef bool (*RpcFFfp)(tmsg_t msgType); typedef void (*RpcDfp)(void *ahandle); typedef struct SRpcInit { @@ -90,6 +91,9 @@ typedef struct SRpcInit { int32_t retryMaxInterval; // retry max interval int64_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + int32_t compressSize; // -1: no compress, 0 : all data compressed, size: compress data if larger than size int8_t encryption; // encrypt or not @@ -107,6 +111,8 @@ typedef struct SRpcInit { // destroy client ahandle; RpcDfp dfp; + // fail fast fp + RpcFFfp ffp; void *parent; } SRpcInit; diff --git a/include/os/os.h b/include/os/os.h index 0688eeb9ad..b27fa84406 100644 --- a/include/os/os.h +++ b/include/os/os.h @@ -27,6 +27,7 @@ extern "C" { #if !defined(WINDOWS) #include +#include #include #include #include diff --git a/include/os/osDef.h b/include/os/osDef.h index 0bf9c6184e..c18728c9a7 100644 --- a/include/os/osDef.h +++ b/include/os/osDef.h @@ -120,12 +120,6 @@ void syslog(int unused, const char *format, ...); #define POINTER_SHIFT(p, b) ((void *)((char *)(p) + (b))) #define POINTER_DISTANCE(p1, p2) ((char *)(p1) - (char *)(p2)) -#ifndef NDEBUG -#define ASSERT(x) assert(x) -#else -#define ASSERT(x) -#endif - #ifndef UNUSED #define UNUSED(x) ((void)(x)) #endif diff --git a/include/os/osDir.h b/include/os/osDir.h index 40012f8141..73871602c5 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -62,6 +62,7 @@ int32_t taosRealPath(char *dirname, char *realPath, int32_t maxlen); bool taosIsDir(const char *dirname); char *taosDirName(char *dirname); char *taosDirEntryBaseName(char *dirname); +void taosGetCwd(char *buf, int32_t len); TdDirPtr taosOpenDir(const char *dirname); TdDirEntryPtr taosReadDir(TdDirPtr pDir); diff --git a/include/os/osString.h b/include/os/osString.h index 4c3fbe46c3..b609c9d351 100644 --- a/include/os/osString.h +++ b/include/os/osString.h @@ -62,7 +62,7 @@ typedef int32_t TdUcs4; int32_t taosUcs4len(TdUcs4 *ucs4); int64_t taosStr2int64(const char *str); -void taosConvInit(void); +int32_t taosConvInit(void); void taosConvDestroy(); int32_t taosUcs4ToMbs(TdUcs4 *ucs4, int32_t ucs4_max_len, char *mbs); bool taosMbsToUcs4(const char *mbs, size_t mbs_len, TdUcs4 *ucs4, int32_t ucs4_max_len, int32_t *len); diff --git a/include/os/osSystem.h b/include/os/osSystem.h index eca984c41a..8f1f5c58d5 100644 --- a/include/os/osSystem.h +++ b/include/os/osSystem.h @@ -46,6 +46,29 @@ void taosSetTerminalMode(); int32_t taosGetOldTerminalMode(); void taosResetTerminalMode(); +#if !defined(WINDOWS) +#define taosPrintTrace(flags, level, dflag) \ + { \ + void* array[100]; \ + int32_t size = backtrace(array, 100); \ + char** strings = backtrace_symbols(array, size); \ + if (strings != NULL) { \ + taosPrintLog(flags, level, dflag, "obtained %d stack frames", size); \ + for (int32_t i = 0; i < size; i++) { \ + taosPrintLog(flags, level, dflag, "frame:%d, %s", i, strings[i]); \ + } \ + } \ + \ + taosMemoryFree(strings); \ + } +#else +#define taosPrintTrace(flags, level, dflag) \ + { \ + taosPrintLog(flags, level, dflag, \ + "backtrace not implemented on windows, so detailed stack information cannot be printed"); \ + } +#endif + #ifdef __cplusplus } #endif diff --git a/include/util/tcoding.h b/include/util/tcoding.h index 38eb0d8fc6..b1bd09e123 100644 --- a/include/util/tcoding.h +++ b/include/util/tcoding.h @@ -17,6 +17,7 @@ #define _TD_UTIL_CODING_H_ #include "os.h" +#include "tlog.h" #ifdef __cplusplus extern "C" { diff --git a/include/util/tdef.h b/include/util/tdef.h index 964a14f7c7..2bc8ef2788 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -308,8 +308,9 @@ typedef enum ELogicConditionType { #define TSDB_MIN_DURATION_PER_FILE 60 // unit minute #define TSDB_MAX_DURATION_PER_FILE (3650 * 1440) #define TSDB_DEFAULT_DURATION_PER_FILE (10 * 1440) -#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute -#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved. +#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute +#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved. +#define TSDB_MAX_KEEP_NS (365 * 292 * 1440) // data in db to be reserved. #define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years #define TSDB_MIN_MINROWS_FBLOCK 10 #define TSDB_MAX_MINROWS_FBLOCK 1000 @@ -382,13 +383,16 @@ typedef enum ELogicConditionType { #define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 #define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 -#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond -#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) -#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond -#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) -#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 -#define TSDB_MIN_TABLE_TTL 0 -#define TSDB_DEFAULT_TABLE_TTL 0 +#define TSDB_MIN_ROLLUP_MAX_DELAY 1 // unit millisecond +#define TSDB_MAX_ROLLUP_MAX_DELAY (15 * 60 * 1000) +#define TSDB_MIN_ROLLUP_WATERMARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_WATERMARK (15 * 60 * 1000) +#define TSDB_DEFAULT_ROLLUP_WATERMARK 5000 +#define TSDB_MIN_ROLLUP_DELETE_MARK 0 // unit millisecond +#define TSDB_MAX_ROLLUP_DELETE_MARK INT64_MAX +#define TSDB_DEFAULT_ROLLUP_DELETE_MARK 900000 // 900s +#define TSDB_MIN_TABLE_TTL 0 +#define TSDB_DEFAULT_TABLE_TTL 0 #define TSDB_MIN_EXPLAIN_RATIO 0 #define TSDB_MAX_EXPLAIN_RATIO 1 diff --git a/include/util/tlog.h b/include/util/tlog.h index 68b004cda7..e6ef7f388f 100644 --- a/include/util/tlog.h +++ b/include/util/tlog.h @@ -38,6 +38,7 @@ typedef void (*LogFp)(int64_t ts, ELogLevel level, const char *content); extern bool tsLogEmbedded; extern bool tsAsyncLog; +extern bool tsAssert; extern int32_t tsNumOfLogLines; extern int32_t tsLogKeepDays; extern LogFp tsLogFp; @@ -82,6 +83,10 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons #endif ; +bool taosAssert(bool condition, const char *file, int32_t line, const char *format, ...); +#define ASSERTS(condition, ...) taosAssert(condition, __FILE__, __LINE__, __VA_ARGS__) +#define ASSERT(condition) ASSERTS(condition, "assert info not provided") + // clang-format off #define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", DEBUG_FATAL, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }} #define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", DEBUG_ERROR, tsLogEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }} diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 9034fd85f5..6a82322a12 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -497,27 +497,27 @@ function install_service_on_systemd() { taosd_service_config="${service_config_dir}/${serverName}.service" - ${csudo}bash -c "echo '[Unit]' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'Description=${productName} server service' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'After=network-online.target' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'Wants=network-online.target' >> ${taosd_service_config}" + ${csudo}bash -c "echo [Unit] >> ${taosd_service_config}" + ${csudo}bash -c "echo Description=${productName} server service >> ${taosd_service_config}" + ${csudo}bash -c "echo After=network-online.target >> ${taosd_service_config}" + ${csudo}bash -c "echo Wants=network-online.target >> ${taosd_service_config}" ${csudo}bash -c "echo >> ${taosd_service_config}" - ${csudo}bash -c "echo '[Service]' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'Type=simple' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'ExecStart=/usr/bin/${serverName}' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'ExecStartPre=${installDir}/bin/startPre.sh' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'LimitCORE=infinity' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'StandardOutput=null' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'Restart=always' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'StartLimitBurst=3' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${taosd_service_config}" + ${csudo}bash -c "echo [Service] >> ${taosd_service_config}" + ${csudo}bash -c "echo Type=simple >> ${taosd_service_config}" + ${csudo}bash -c "echo ExecStart=/usr/bin/${serverName} >> ${taosd_service_config}" + ${csudo}bash -c "echo ExecStartPre=${installDir}/bin/startPre.sh >> ${taosd_service_config}" + ${csudo}bash -c "echo TimeoutStopSec=1000000s >> ${taosd_service_config}" + ${csudo}bash -c "echo LimitNOFILE=infinity >> ${taosd_service_config}" + ${csudo}bash -c "echo LimitNPROC=infinity >> ${taosd_service_config}" + ${csudo}bash -c "echo LimitCORE=infinity >> ${taosd_service_config}" + ${csudo}bash -c "echo TimeoutStartSec=0 >> ${taosd_service_config}" + ${csudo}bash -c "echo StandardOutput=null >> ${taosd_service_config}" + ${csudo}bash -c "echo Restart=always >> ${taosd_service_config}" + ${csudo}bash -c "echo StartLimitBurst=3 >> ${taosd_service_config}" + ${csudo}bash -c "echo StartLimitInterval=60s >> ${taosd_service_config}" ${csudo}bash -c "echo >> ${taosd_service_config}" - ${csudo}bash -c "echo '[Install]' >> ${taosd_service_config}" - ${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${taosd_service_config}" + ${csudo}bash -c "echo [Install] >> ${taosd_service_config}" + ${csudo}bash -c "echo WantedBy=multi-user.target >> ${taosd_service_config}" ${csudo}systemctl enable ${serverName} } diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 833b662f02..d3d713c643 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -238,10 +238,9 @@ void destroyTscObj(void *pObj) { tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj, pTscObj->pAppInfo->numOfConns); - int64_t connNum = atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); - if (0 == connNum) { - destroyAppInst(pTscObj->pAppInfo); - } + // In any cases, we should not free app inst here. Or an race condition rises. + /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj); @@ -414,7 +413,9 @@ void taos_init_imp(void) { initQueryModuleMsgHandle(); - taosConvInit(); + if (taosConvInit() != 0) { + ASSERTS(0, "failed to init conv"); + } rpcInit(); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index f3c8caecd7..9b2e97139b 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -796,9 +796,10 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c SQuery *pQuery = pRequest->pQuery; pRequest->metric.ctgEnd = taosGetTimestampUs(); - qDebug("0x%" PRIx64 " start to continue parse, reqId:0x%" PRIx64, pRequest->self, pRequest->requestId); + qDebug("0x%" PRIx64 " start to continue parse, reqId:0x%" PRIx64 ", code:%s", pRequest->self, pRequest->requestId, tstrerror(code)); if (code == TSDB_CODE_SUCCESS) { + pWrapper->pCatalogReq->forceUpdate = false; code = qContinueParseSql(pWrapper->pParseCtx, pWrapper->pCatalogReq, pResultMeta, pQuery); } diff --git a/source/client/src/clientTmq.c b/source/client/src/clientTmq.c index ade0c95227..766a94caf1 100644 --- a/source/client/src/clientTmq.c +++ b/source/client/src/clientTmq.c @@ -875,6 +875,7 @@ void tmqFreeImpl(void* handle) { tmq_t* tmq = (tmq_t*)handle; // TODO stop timer + tmqClearUnhandleMsg(tmq); if (tmq->mqueue) taosCloseQueue(tmq->mqueue); if (tmq->delayedTask) taosCloseQueue(tmq->delayedTask); if (tmq->qall) taosFreeQall(tmq->qall); @@ -884,8 +885,7 @@ void tmqFreeImpl(void* handle) { int32_t sz = taosArrayGetSize(tmq->clientTopics); for (int32_t i = 0; i < sz; i++) { SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i); - if (pTopic->schema.nCols) taosMemoryFreeClear(pTopic->schema.pSchema); - int32_t vgSz = taosArrayGetSize(pTopic->vgs); + taosMemoryFreeClear(pTopic->schema.pSchema); taosArrayDestroy(pTopic->vgs); } taosArrayDestroy(tmq->clientTopics); @@ -1304,7 +1304,6 @@ bool tmqUpdateEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp) { for (int32_t i = 0; i < sz; i++) { SMqClientTopic* pTopic = taosArrayGet(tmq->clientTopics, i); if (pTopic->schema.nCols) taosMemoryFreeClear(pTopic->schema.pSchema); - int32_t vgSz = taosArrayGetSize(pTopic->vgs); taosArrayDestroy(pTopic->vgs); } taosArrayDestroy(tmq->clientTopics); @@ -1410,7 +1409,7 @@ int32_t tmqAskEp(tmq_t* tmq, bool async) { return -1; } void* pReq = taosMemoryCalloc(1, tlen); - if (tlen < 0) { + if (pReq == NULL) { tscError("failed to malloc askEpReq msg, size:%d", tlen); return -1; } @@ -1738,7 +1737,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { taosFreeQitem(pollRspWrapper); return pRsp; } else { - tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d\n", + tscDebug("msg discard since epoch mismatch: msg epoch %d, consumer epoch %d", pollRspWrapper->taosxRsp.head.epoch, consumerEpoch); taosFreeQitem(pollRspWrapper); } diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index d6ab3cde28..00a4b50c39 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -2246,23 +2246,17 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat continue; } - SSubmitTbData* pTbData = (SSubmitTbData*)taosMemoryCalloc(1, sizeof(SSubmitTbData)); - if (!pTbData) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _end; - } + SSubmitTbData tbData = {0}; - if (!(pTbData->aRowP = taosArrayInit(rows, sizeof(SRow*)))) { - taosMemoryFree(pTbData); + if (!(tbData.aRowP = taosArrayInit(rows, sizeof(SRow*)))) { goto _end; } - pTbData->suid = suid; - pTbData->uid = pDataBlock->info.id.groupId; - pTbData->sver = pTSchema->version; + tbData.suid = suid; + tbData.uid = pDataBlock->info.id.groupId; + tbData.sver = pTSchema->version; if (!pVals && !(pVals = taosArrayInit(colNum, sizeof(SColVal)))) { - taosArrayDestroy(pTbData->aRowP); - taosMemoryFree(pTbData); + taosArrayDestroy(tbData.aRowP); goto _end; } @@ -2360,14 +2354,14 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat } SRow* pRow = NULL; if ((terrno = tRowBuild(pVals, pTSchema, &pRow)) < 0) { - tDestroySSubmitTbData(pTbData, TSDB_MSG_FLG_ENCODE); + tDestroySSubmitTbData(&tbData, TSDB_MSG_FLG_ENCODE); goto _end; } ASSERT(pRow); - taosArrayPush(pTbData->aRowP, &pRow); + taosArrayPush(tbData.aRowP, &pRow); } - taosArrayPush(pReq->aSubmitTbData, pTbData); + taosArrayPush(pReq->aSubmitTbData, &tbData); } _end: taosArrayDestroy(pVals); diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index c1f6ac57fc..f89159c40c 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -1030,17 +1030,22 @@ static int32_t tRowAppendKVToColData(SRow *pRow, STSchema *pTSchema, SColData *a } int16_t cid; - pData += tGetI16(pData, &cid); + pData += tGetI16v(pData, &cid); if (TABS(cid) == pTColumn->colId) { if (cid < 0) { code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_NULL](pColData, NULL, 0); if (code) goto _exit; } else { - uint32_t nData; - pData += tGetU32v(pData, &nData); - code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_VALUE](pColData, pData, nData); - if (code) goto _exit; + if (IS_VAR_DATA_TYPE(pTColumn->type)) { + uint32_t nData; + pData += tGetU32v(pData, &nData); + code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_VALUE](pColData, pData, nData); + if (code) goto _exit; + } else { + code = tColDataAppendValueImpl[pColData->flag][CV_FLAG_VALUE](pColData, pData, 0); + if (code) goto _exit; + } } iCol++; goto _continue; diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3bcfddb8b2..7e9b28939b 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -333,6 +333,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) { if (cfgAddTimezone(pCfg, "timezone", tsTimezoneStr) != 0) return -1; if (cfgAddLocale(pCfg, "locale", tsLocale) != 0) return -1; if (cfgAddCharset(pCfg, "charset", tsCharset) != 0) return -1; + if (cfgAddBool(pCfg, "assert", 1, 1) != 0) return -1; if (cfgAddBool(pCfg, "enableCoreFile", 1, 1) != 0) return -1; if (cfgAddFloat(pCfg, "numOfCores", tsNumOfCores, 1, 100000, 1) != 0) return -1; @@ -407,7 +408,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { tsNumOfQnodeQueryThreads = tsNumOfCores * 2; tsNumOfQnodeQueryThreads = TMAX(tsNumOfQnodeQueryThreads, 4); - if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 1, 1024, 0) != 0) return -1; + if (cfgAddInt32(pCfg, "numOfQnodeQueryThreads", tsNumOfQnodeQueryThreads, 4, 1024, 0) != 0) return -1; // tsNumOfQnodeFetchThreads = tsNumOfCores / 2; // tsNumOfQnodeFetchThreads = TMAX(tsNumOfQnodeFetchThreads, 4); @@ -693,6 +694,8 @@ static void taosSetSystemCfg(SConfig *pCfg) { bool enableCore = cfgGetItem(pCfg, "enableCoreFile")->bval; taosSetCoreDump(enableCore); + tsAssert = cfgGetItem(pCfg, "assert")->bval; + // todo tsVersion = 30000000; } @@ -788,6 +791,8 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { case 'a': { if (strcasecmp("asyncLog", name) == 0) { tsAsyncLog = cfgGetItem(pCfg, "asyncLog")->bval; + } else if (strcasecmp("assert", name) == 0) { + tsAssert = cfgGetItem(pCfg, "assert")->bval; } break; } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index e6d5990cf7..95a72843e8 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -28,6 +28,8 @@ #undef TD_MSG_SEG_CODE_ #include "tmsgdef.h" +#include "tlog.h" + int32_t tInitSubmitMsgIter(const SSubmitReq *pMsg, SSubmitMsgIter *pIter) { if (pMsg == NULL) { terrno = TSDB_CODE_TDB_SUBMIT_MSG_MSSED_UP; @@ -551,6 +553,8 @@ int32_t tSerializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pReq if (pReq->ast2Len > 0) { if (tEncodeBinary(&encoder, pReq->pAst2, pReq->ast2Len) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark1) < 0) return -1; + if (tEncodeI64(&encoder, pReq->deleteMark2) < 0) return -1; tEndEncode(&encoder); @@ -644,6 +648,9 @@ int32_t tDeserializeSMCreateStbReq(void *buf, int32_t bufLen, SMCreateStbReq *pR if (tDecodeCStrTo(&decoder, pReq->pAst2) < 0) return -1; } + if (tDecodeI64(&decoder, &pReq->deleteMark1) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->deleteMark2) < 0) return -1; + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; @@ -822,6 +829,7 @@ int32_t tSerializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pReq if (pReq->astLen > 0) { if (tEncodeBinary(&encoder, pReq->ast, pReq->astLen) < 0) return -1; } + if (tEncodeI64(&encoder, pReq->deleteMark) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -870,7 +878,7 @@ int32_t tDeserializeSMCreateSmaReq(void *buf, int32_t bufLen, SMCreateSmaReq *pR if (pReq->ast == NULL) return -1; if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1; } - + if (tDecodeI64(&decoder, &pReq->deleteMark) < 0) return -1; tEndDecode(&decoder); tDecoderClear(&decoder); return 0; diff --git a/source/common/src/trow.c b/source/common/src/trow.c index 52ebd7f879..ca2c056743 100644 --- a/source/common/src/trow.c +++ b/source/common/src/trow.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "trow.h" +#include "tlog.h" const uint8_t tdVTypeByte[2][3] = {{ // 2 bits diff --git a/source/common/src/ttime.c b/source/common/src/ttime.c index a106a09a69..ec05ef4c44 100644 --- a/source/common/src/ttime.c +++ b/source/common/src/ttime.c @@ -23,6 +23,8 @@ #define _DEFAULT_SOURCE #include "ttime.h" +#include "tlog.h" + /* * mktime64 - Converts date to seconds. * Converts Gregorian date to seconds since 1970-01-01 00:00:00. diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 188677656a..a8103351b4 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -17,6 +17,7 @@ #include "dmMgmt.h" #include "mnode.h" #include "tconfig.h" +#include "tglobal.h" // clang-format off #define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'." @@ -45,9 +46,30 @@ static struct { SArray *pArgs; // SConfigPair } global = {0}; -static void dmStopDnode(int signum, void *info, void *ctx) { dmStop(); } +static void dmSetDebugFlag(int32_t signum, void *sigInfo, void *context) { taosSetAllDebugFlag(143, true); } +static void dmSetAssert(int32_t signum, void *sigInfo, void *context) { tsAssert = 1; } + +static void dmStopDnode(int signum, void *sigInfo, void *context) { + // taosIgnSignal(SIGUSR1); + // taosIgnSignal(SIGUSR2); + taosIgnSignal(SIGTERM); + taosIgnSignal(SIGHUP); + taosIgnSignal(SIGINT); + taosIgnSignal(SIGABRT); + taosIgnSignal(SIGBREAK); + + dInfo("shut down signal is %d", signum); +#ifndef WINDOWS + dInfo("sender PID:%d cmdline:%s", ((siginfo_t *)sigInfo)->si_pid, + taosGetCmdlineByPID(((siginfo_t *)sigInfo)->si_pid)); +#endif + + dmStop(); +} static void dmSetSignalHandle() { + taosSetSignal(SIGUSR1, dmSetDebugFlag); + taosSetSignal(SIGUSR2, dmSetAssert); taosSetSignal(SIGTERM, dmStopDnode); taosSetSignal(SIGHUP, dmStopDnode); taosSetSignal(SIGINT, dmStopDnode); @@ -105,6 +127,19 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) { return 0; } +static void dmPrintArgs(int32_t argc, char const *argv[]) { + char path[1024] = {0}; + taosGetCwd(path, sizeof(path)); + + char args[1024] = {0}; + int32_t arglen = snprintf(args, sizeof(args), "%s", argv[0]); + for (int32_t i = 1; i < argc; ++i) { + arglen = arglen + snprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]); + } + + dInfo("startup path:%s args:%s", path, args); +} + static void dmGenerateGrant() { mndGenerateMachineCode(); } static void dmPrintVersion() { @@ -194,6 +229,8 @@ int mainWindows(int argc, char **argv) { return -1; } + dmPrintArgs(argc, argv); + if (taosInitCfg(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) { dError("failed to start since read config error"); taosCloseLog(); @@ -201,7 +238,12 @@ int mainWindows(int argc, char **argv) { return -1; } - taosConvInit(); + if (taosConvInit() != 0) { + dError("failed to init conv"); + taosCloseLog(); + taosCleanupArgs(); + return -1; + } if (global.dumpConfig) { dmDumpCfg(); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index a7ad983b0c..39eeeb32ea 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -103,7 +103,12 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { tSerializeSStatusReq(pHead, contLen, &req); tFreeSStatusReq(&req); - SRpcMsg rpcMsg = {.pCont = pHead, .contLen = contLen, .msgType = TDMT_MND_STATUS, .info.ahandle = (void *)0x9527}; + SRpcMsg rpcMsg = {.pCont = pHead, + .contLen = contLen, + .msgType = TDMT_MND_STATUS, + .info.ahandle = (void *)0x9527, + .info.refId = 0, + .info.noResp = 0}; SRpcMsg rpcRsp = {0}; dTrace("send status req to mnode, dnodeVer:%" PRId64 " statusSeq:%d", req.dnodeVer, req.statusSeq); @@ -150,7 +155,8 @@ static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) { SServerStatusRsp statusRsp = {0}; SMonMloadInfo minfo = {0}; (*pMgmt->getMnodeLoadsFp)(&minfo); - if (minfo.isMnode && (minfo.load.syncState == TAOS_SYNC_STATE_ERROR || minfo.load.syncState == TAOS_SYNC_STATE_OFFLINE)) { + if (minfo.isMnode && + (minfo.load.syncState == TAOS_SYNC_STATE_ERROR || minfo.load.syncState == TAOS_SYNC_STATE_OFFLINE)) { pStatus->statusCode = TSDB_SRV_STATUS_SERVICE_DEGRADED; snprintf(pStatus->details, sizeof(pStatus->details), "mnode sync state is %s", syncStr(minfo.load.syncState)); return; diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index 30ef7b9542..80c040a5e8 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -20,7 +20,9 @@ static void *dmStatusThreadFp(void *param) { SDnodeMgmt *pMgmt = param; int64_t lastTime = taosGetTimestampMs(); setThreadName("dnode-status"); - + + const static int16_t TRIM_FREQ = 30; + int32_t trimCount = 0; while (1) { taosMsleep(200); if (pMgmt->pData->dropped || pMgmt->pData->stopped) break; @@ -28,9 +30,13 @@ static void *dmStatusThreadFp(void *param) { int64_t curTime = taosGetTimestampMs(); float interval = (curTime - lastTime) / 1000.0f; if (interval >= tsStatusInterval) { - taosMemoryTrim(0); dmSendStatusReq(pMgmt); lastTime = curTime; + + trimCount = (trimCount + 1) % TRIM_FREQ; + if (trimCount == 0) { + taosMemoryTrim(0); + } } } diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index 2d2a121795..2e66aeae37 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -139,7 +139,7 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { SSnode *pSnode = pMgmt->pSnode; if (pSnode == NULL) { - dError("snode: msg:%p failed to put into vnode queue since %s, type:%s qtype:%d", pMsg, terrstr(), + dError("msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(), TMSG_INFO(pMsg->msgType), qtype); taosFreeQitem(pMsg); rpcFreeCont(pRpc->pCont); @@ -161,7 +161,8 @@ int32_t smPutMsgToQueue(SSnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { smPutNodeMsgToWriteQueue(pMgmt, pMsg); break; default: - ASSERT(0); + ASSERTS(0, "msg:%p failed to put into snode queue since %s, type:%s qtype:%d", pMsg, terrstr(), + TMSG_INFO(pMsg->msgType), qtype); } return 0; } diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 12aba130d5..99f8bd002a 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -48,6 +48,11 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) { return (*msgFp)(pWrapper->pMgmt, pMsg); } +static bool dmFailFastFp(tmsg_t msgType) { + // add more msg type later + return msgType == TDMT_SYNC_HEARTBEAT || msgType == TDMT_SYNC_APPEND_ENTRIES; +} + static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { SDnodeTrans *pTrans = &pDnode->trans; int32_t code = -1; @@ -260,6 +265,10 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.retryMaxInterval = tsRedirectMaxPeriod; rpcInit.retryMaxTimouet = tsMaxRetryWaitTime; + rpcInit.failFastInterval = 1000; // interval threshold(ms) + rpcInit.failFastThreshold = 3; // failed threshold + rpcInit.ffp = dmFailFastFp; + pTrans->clientRpc = rpcOpen(&rpcInit); if (pTrans->clientRpc == NULL) { dError("failed to init dnode rpc client"); @@ -292,6 +301,7 @@ int32_t dmInitServer(SDnode *pDnode) { rpcInit.connType = TAOS_CONN_SERVER; rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.parent = pDnode; + rpcInit.compressSize = tsCompressMsgSize; pTrans->serverRpc = rpcOpen(&rpcInit); if (pTrans->serverRpc == NULL) { diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 8fc7f29c02..3c42f7b832 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -645,6 +645,7 @@ typedef struct { // 3.0.20 int64_t checkpointFreq; // ms int64_t currentTick; // do not serialize + int64_t deleteMark; } SStreamObj; int32_t tEncodeSStreamObj(SEncoder* pEncoder, const SStreamObj* pObj); diff --git a/source/dnode/mnode/impl/inc/mndScheduler.h b/source/dnode/mnode/impl/inc/mndScheduler.h index db81d8843e..23085c53ee 100644 --- a/source/dnode/mnode/impl/inc/mndScheduler.h +++ b/source/dnode/mnode/impl/inc/mndScheduler.h @@ -28,7 +28,7 @@ void mndCleanupScheduler(SMnode* pMnode); int32_t mndSchedInitSubEp(SMnode* pMnode, const SMqTopicObj* pTopic, SMqSubscribeObj* pSub); int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark); + int64_t watermark, int64_t deleteMark); int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream); diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 972907cc95..4aaa96cb71 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -555,6 +555,12 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { } if (mndCheckDbPrivilegeByName(pMnode, pMsg->info.conn.user, MND_OPER_READ_DB, pTopic->db) != 0) { + mndReleaseTopic(pMnode, pTopic); + goto SUBSCRIBE_OVER; + } + + if (mndCheckTopicPrivilege(pMnode, pMsg->info.conn.user, MND_OPER_SUBSCRIBE, pTopic) != 0) { + mndReleaseTopic(pMnode, pTopic); goto SUBSCRIBE_OVER; } diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 5fa86dffe2..43155124c1 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -825,7 +825,13 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { dbObj.cfgVersion++; dbObj.updateTime = taosGetTimestampMs(); code = mndAlterDb(pMnode, pReq, pDb, &dbObj); - if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; + + if (dbObj.cfg.replications != pDb->cfg.replications) { + // return quickly, operation executed asynchronously + mInfo("db:%s, alter db replica from %d to %d", pDb->name, pDb->cfg.replications, dbObj.cfg.replications); + } else { + if (code == 0) code = TSDB_CODE_ACTION_IN_PROGRESS; + } _OVER: if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) { diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index df25e44bee..0538d70101 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -383,9 +383,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { pGid->syncCanRead != pVload->syncCanRead) { mInfo( "vgId:%d, state changed by status msg, old state:%s restored:%d canRead:%d new state:%s restored:%d " - "canRead:%d", + "canRead:%d, dnode:%d", pVgroup->vgId, syncStr(pGid->syncState), pGid->syncRestore, pGid->syncCanRead, - syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead); + syncStr(pVload->syncState), pVload->syncRestore, pVload->syncCanRead, pDnode->id); pGid->syncState = pVload->syncState; pGid->syncRestore = pVload->syncRestore; pGid->syncCanRead = pVload->syncCanRead; diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index f71bd1c626..af1a29def0 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -42,7 +42,7 @@ static int32_t mndAddTaskToTaskSet(SArray* pArray, SStreamTask* pTask) { } int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64_t uid, int8_t triggerType, - int64_t watermark) { + int64_t watermark, int64_t deleteMark) { SNode* pAst = NULL; SQueryPlan* pPlan = NULL; terrno = TSDB_CODE_SUCCESS; @@ -64,6 +64,7 @@ int32_t mndConvertRsmaTask(char** pDst, int32_t* pDstLen, const char* ast, int64 .rSmaQuery = true, .triggerType = triggerType, .watermark = watermark, + .deleteMark = deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index f9d0a9b9ba..e6a6e6ae5b 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -534,6 +534,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea streamObj.sql = strdup(pCreate->sql); streamObj.smaId = smaObj.uid; streamObj.watermark = pCreate->watermark; + streamObj.deleteMark = pCreate->deleteMark; streamObj.fillHistory = STREAM_FILL_HISTORY_ON; streamObj.trigger = STREAM_TRIGGER_WINDOW_CLOSE; streamObj.triggerParam = pCreate->maxDelay; @@ -574,6 +575,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea .streamQuery = true, .triggerType = streamObj.trigger, .watermark = streamObj.watermark, + .deleteMark = streamObj.deleteMark, }; if (qCreateQueryPlan(&cxt, &pPlan, NULL) < 0) { diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 2ed4fde509..c611cfb6e1 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -450,13 +450,15 @@ static void *mndBuildVCreateStbReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pSt req.rsmaParam.watermark[1] = pStb->watermark[1]; if (pStb->ast1Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[0], &req.rsmaParam.qmsgLen[0], pStb->pAst1, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[0], + req.rsmaParam.deleteMark[0]) < 0) { goto _err; } } if (pStb->ast2Len > 0) { if (mndConvertRsmaTask(&req.rsmaParam.qmsg[1], &req.rsmaParam.qmsgLen[1], pStb->pAst2, pStb->uid, - STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1]) < 0) { + STREAM_TRIGGER_WINDOW_CLOSE, req.rsmaParam.watermark[1], + req.rsmaParam.deleteMark[1]) < 0) { goto _err; } } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 895d7fedc4..10b1e36496 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -119,7 +119,13 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta } int32_t mndSyncCommitMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta *pMeta) { - int32_t code = mndProcessWriteMsg(pFsm, pMsg, pMeta); + int32_t code = 0; + if (!syncUtilUserCommit(pMsg->msgType)) { + goto _out; + } + code = mndProcessWriteMsg(pFsm, pMsg, pMeta); + +_out: rpcFreeCont(pMsg->pCont); pMsg->pCont = NULL; return code; @@ -143,9 +149,13 @@ void mndRestoreFinish(const SSyncFSM *pFsm) { SMnode *pMnode = pFsm->data; if (!pMnode->deploy) { - mInfo("vgId:1, sync restore finished, and will handle outstanding transactions"); - mndTransPullup(pMnode); - mndSetRestored(pMnode, true); + if (!pMnode->restored) { + mInfo("vgId:1, sync restore finished, and will handle outstanding transactions"); + mndTransPullup(pMnode); + mndSetRestored(pMnode, true); + } else { + mInfo("vgId:1, sync restore finished, repeat call"); + } } else { mInfo("vgId:1, sync restore finished"); } diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b4ea8ee125..a6e52caf1f 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1126,34 +1126,61 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, } if (!force) { - mInfo("vgId:%d, will add 1 vnode", pVgroup->vgId); - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; - for (int32_t i = 0; i < newVg.replica - 1; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; - } - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - - mInfo("vgId:%d, will remove 1 vnode", pVgroup->vgId); - newVg.replica--; - SVnodeGid del = newVg.vnodeGid[vnIndex]; - newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; - memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - { - SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); - if (pRaw == NULL) return -1; - if (mndTransAppendRedolog(pTrans, pRaw) != 0) { - sdbFreeRaw(pRaw); - return -1; + if (newVg.replica == 1) { + mInfo("vgId:%d, will add 1 vnode, replca:1", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + for (int32_t i = 0; i < newVg.replica - 1; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; } - (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); - } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; - for (int32_t i = 0; i < newVg.replica; ++i) { - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:2", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica; ++i) { + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; + } else { // new replica == 3 + mInfo("vgId:%d, will add 1 vnode, replca:3", pVgroup->vgId); + if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; + mInfo("vgId:%d, will remove 1 vnode, replca:4", pVgroup->vgId); + newVg.replica--; + SVnodeGid del = newVg.vnodeGid[vnIndex]; + newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; + memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); + { + SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); + if (pRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRaw) != 0) { + sdbFreeRaw(pRaw); + return -1; + } + (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); + } + + if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; + for (int32_t i = 0; i < newVg.replica; ++i) { + if (i == vnIndex) continue; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, newVg.vnodeGid[i].dnodeId) != 0) return -1; + } + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[vnIndex]) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; } else { mInfo("vgId:%d, will add 1 vnode and force remove 1 vnode", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, pTrans, &newVg, pArray) != 0) return -1; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 971ed7c51c..03069d5404 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -174,7 +174,7 @@ int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, void *pTableL void tsdbReaderClose(STsdbReader *pReader); bool tsdbNextDataBlock(STsdbReader *pReader); void tsdbRetrieveDataBlockInfo(const STsdbReader *pReader, int32_t *rows, uint64_t *uid, STimeWindow *pWindow); -int32_t tsdbRetrieveDatablockSMA(STsdbReader *pReader, SColumnDataAgg ***pBlockSMA, bool *allHave); +int32_t tsdbRetrieveDatablockSMA(STsdbReader *pReader, SSDataBlock* pDataBlock, bool *allHave); SSDataBlock *tsdbRetrieveDataBlock(STsdbReader *pTsdbReadHandle, SArray *pColumnIdList); int32_t tsdbReaderReset(STsdbReader *pReader, SQueryTableDataCond *pCond); int32_t tsdbGetFileBlocksDistInfo(STsdbReader *pReader, STableBlockDistInfo *pTableBlockInfo); @@ -220,22 +220,18 @@ typedef struct SSnapContext { bool queryMetaOrData; // true-get meta, false-get data } SSnapContext; -typedef struct { - void *msgStr; - int32_t msgLen; - int64_t ver; -} SPackedSubmit; - typedef struct STqReader { - const SSubmitReq *pMsg; - // SSubmitBlk *pBlock; - // SSubmitMsgIter msgIter; - // SSubmitBlkIter blkIter; + // const SSubmitReq *pMsg; + // SSubmitBlk *pBlock; + // SSubmitMsgIter msgIter; + // SSubmitBlkIter blkIter; - int64_t ver; - SPackedSubmit msg2; - SSubmitReq2 *pSubmit; - int32_t nextBlk; + int64_t ver; + SPackedData msg2; + + int8_t setMsg; + SSubmitReq2 submit; + int32_t nextBlk; int64_t lastBlkUid; diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h index 2b927ac3e2..0ef8e8bac5 100644 --- a/source/dnode/vnode/src/inc/tq.h +++ b/source/dnode/vnode/src/inc/tq.h @@ -153,7 +153,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs int64_t tqFetchLog(STQ* pTq, STqHandle* pHandle, int64_t* fetchOffset, SWalCkHead** pHeadWithCkSum); // tqExec -int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedSubmit submit, STaosxRsp* pRsp); +int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp); // int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SSubmitReq* pReq, STaosxRsp* pRsp); int32_t tqAddBlockDataToRsp(const SSDataBlock* pBlock, SMqDataRsp* pRsp, int32_t numOfCols, int8_t precision); int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, const SMqDataRsp* pRsp); @@ -182,7 +182,8 @@ int32_t tqOffsetCommitFile(STqOffsetStore* pStore); // tqSink // void tqSinkToTableMerge(SStreamTask* pTask, void* vnode, int64_t ver, void* data); -void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* data); +// void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* data); +void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* data); // tqOffset char* tqOffsetBuildFName(const char* path, int32_t fVer); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 79b4f227f5..5ccf011dfb 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -180,7 +180,7 @@ int32_t tqProcessTaskDeployReq(STQ* pTq, int64_t version, char* msg, int32_t msg int32_t tqProcessTaskDropReq(STQ* pTq, int64_t version, char* msg, int32_t msgLen); int32_t tqProcessStreamTaskCheckReq(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessStreamTaskCheckRsp(STQ* pTq, int64_t version, char* msg, int32_t msgLen); -int32_t tqProcessSubmitReq(STQ* pTq, SSubmitReq* data, int64_t ver); +int32_t tqProcessSubmitReq(STQ* pTq, SPackedData submit); int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver); int32_t tqProcessTaskRunReq(STQ* pTq, SRpcMsg* pMsg); int32_t tqProcessTaskDispatchReq(STQ* pTq, SRpcMsg* pMsg, bool exec); @@ -215,7 +215,7 @@ int32_t tdProcessTSmaCreate(SSma* pSma, int64_t version, const char* msg); int32_t tdProcessTSmaInsert(SSma* pSma, int64_t indexUid, const char* msg); int32_t tdProcessRSmaCreate(SSma* pSma, SVCreateStbReq* pReq); -int32_t tdProcessRSmaSubmit(SSma* pSma, void* pReq, void* pMsg, int32_t len, int32_t inputType); +int32_t tdProcessRSmaSubmit(SSma* pSma, int64_t version, void* pReq, void* pMsg, int32_t len, int32_t inputType); int32_t tdProcessRSmaDrop(SSma* pSma, SVDropStbReq* pReq); int32_t tdFetchTbUidList(SSma* pSma, STbUidStore** ppStore, tb_uid_t suid, tb_uid_t uid); int32_t tdUpdateTbUidList(SSma* pSma, STbUidStore* pUidStore, bool isAdd); diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 6a704d0425..0ed68dce95 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -454,7 +454,7 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK SListNode* pNode = NULL; while ((pNode = tdListNext(&iter)) != NULL) { - memcpy(pBuf + sizeof(suid), pNode->data, keyLen); + memcpy(&pBuf[1], pNode->data, keyLen); // check whether it is existed in LRU cache, and remove it from linked list if not. LRUHandle* pRes = taosLRUCacheLookup(pCache, pBuf, len); diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 0b00f036de..722a93137c 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -549,8 +549,8 @@ int metaTtlDropTable(SMeta *pMeta, int64_t ttl, SArray *tbUids) { } static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME) { - int64_t ttlDays; - int64_t ctime; + int64_t ttlDays = 0; + int64_t ctime = 0; if (pME->type == TSDB_CHILD_TABLE) { ctime = pME->ctbEntry.ctime; ttlDays = pME->ctbEntry.ttlDays; @@ -1353,6 +1353,10 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) { goto end; } + if (stbEntry.stbEntry.schemaTag.pSchema == NULL) { + goto end; + } + pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[0]; STagVal tagVal = {.cid = pTagColumn->colId}; diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index f08069c04c..bc8a3e8513 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -698,10 +698,10 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma #endif for (int32_t i = 0; i < taosArrayGetSize(pResList); ++i) { SSDataBlock *output = taosArrayGetP(pResList, i); - smaDebug("result block, uid:%" PRIu64 ", groupid:%" PRIu64 ", rows:%d", output->info.id.uid, output->info.id.groupId, - output->info.rows); + smaDebug("result block, uid:%" PRIu64 ", groupid:%" PRIu64 ", rows:%d", output->info.id.uid, + output->info.id.groupId, output->info.rows); - STsdb *sinkTsdb = (pItem->level == TSDB_RETENTION_L1 ? pSma->pRSmaTsdb[0] : pSma->pRSmaTsdb[1]); + STsdb *sinkTsdb = (pItem->level == TSDB_RETENTION_L1 ? pSma->pRSmaTsdb[0] : pSma->pRSmaTsdb[1]); SSubmitReq2 *pReq = NULL; // TODO: the schema update should be handled later(TD-17965) @@ -714,6 +714,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma if (pReq && tdProcessSubmitReq(sinkTsdb, output->info.version, pReq) < 0) { tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + taosMemoryFree(pReq); smaError("vgId:%d, process submit req for rsma suid:%" PRIu64 ", uid:%" PRIu64 " level %" PRIi8 " failed since %s", SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, terrstr()); @@ -723,7 +724,10 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma smaDebug("vgId:%d, process submit req for rsma suid:%" PRIu64 ",uid:%" PRIu64 ", level %" PRIi8 " ver %" PRIi64, SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, output->info.version); - if(pReq) tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + if (pReq) { + tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + taosMemoryFree(pReq); + } } } @@ -741,6 +745,7 @@ _err: * @brief Copy msg to rsmaQueueBuffer for batch process * * @param pSma + * @param version * @param pMsg * @param len * @param inputType @@ -748,14 +753,20 @@ _err: * @param suid * @return int32_t */ -static int32_t tdExecuteRSmaImplAsync(SSma *pSma, const void *pMsg, int32_t len, int32_t inputType, SRSmaInfo *pInfo, - tb_uid_t suid) { - void *qItem = taosAllocateQitem(len, DEF_QITEM); +static int32_t tdExecuteRSmaImplAsync(SSma *pSma, int64_t version, const void *pMsg, int32_t len, int32_t inputType, + SRSmaInfo *pInfo, tb_uid_t suid) { + int32_t size = sizeof(int32_t) + sizeof(int64_t) + len; + void *qItem = taosAllocateQitem(size, DEF_QITEM); if (!qItem) { return TSDB_CODE_FAILED; } - memcpy(qItem, pMsg, len); + void *pItem = qItem; + + *(int32_t *)pItem = len; + pItem = POINTER_SHIFT(pItem, sizeof(int32_t)); + *(int64_t *)pItem = version; + memcpy(POINTER_SHIFT(pItem, sizeof(int64_t)), pMsg, len); taosWriteQitem(pInfo->queue, qItem); @@ -997,12 +1008,14 @@ static FORCE_INLINE void tdReleaseRSmaInfo(SSma *pSma, SRSmaInfo *pInfo) { * @brief async mode * * @param pSma + * @param version * @param pMsg * @param inputType * @param suid * @return int32_t */ -static int32_t tdExecuteRSmaAsync(SSma *pSma, const void *pMsg, int32_t len, int32_t inputType, tb_uid_t suid) { +static int32_t tdExecuteRSmaAsync(SSma *pSma, int64_t version, const void *pMsg, int32_t len, int32_t inputType, + tb_uid_t suid) { SRSmaInfo *pRSmaInfo = tdAcquireRSmaInfoBySuid(pSma, suid); if (!pRSmaInfo) { smaDebug("vgId:%d, execute rsma, no rsma info for suid:%" PRIu64, SMA_VID(pSma), suid); @@ -1010,7 +1023,7 @@ static int32_t tdExecuteRSmaAsync(SSma *pSma, const void *pMsg, int32_t len, int } if (inputType == STREAM_INPUT__DATA_SUBMIT) { - if (tdExecuteRSmaImplAsync(pSma, pMsg, len, inputType, pRSmaInfo, suid) < 0) { + if (tdExecuteRSmaImplAsync(pSma, version, pMsg, len, inputType, pRSmaInfo, suid) < 0) { tdReleaseRSmaInfo(pSma, pRSmaInfo); return TSDB_CODE_FAILED; } @@ -1032,7 +1045,7 @@ static int32_t tdExecuteRSmaAsync(SSma *pSma, const void *pMsg, int32_t len, int return TSDB_CODE_SUCCESS; } -int32_t tdProcessRSmaSubmit(SSma *pSma, void *pReq, void* pMsg, int32_t len, int32_t inputType) { +int32_t tdProcessRSmaSubmit(SSma *pSma, int64_t version, void *pReq, void *pMsg, int32_t len, int32_t inputType) { SSmaEnv *pEnv = SMA_RSMA_ENV(pSma); if (!pEnv) { // only applicable when rsma env exists @@ -1052,7 +1065,7 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pReq, void* pMsg, int32_t len, int } if (uidStore.suid != 0) { - if (tdExecuteRSmaAsync(pSma, pMsg, len, inputType, uidStore.suid) < 0) { + if (tdExecuteRSmaAsync(pSma, version, pMsg, len, inputType, uidStore.suid) < 0) { smaError("vgId:%d, failed to process rsma submit exec 1 since: %s", SMA_VID(pSma), terrstr()); goto _err; } @@ -1060,7 +1073,7 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pReq, void* pMsg, int32_t len, int void *pIter = NULL; while ((pIter = taosHashIterate(uidStore.uidHash, pIter))) { tb_uid_t *pTbSuid = (tb_uid_t *)taosHashGetKey(pIter, NULL); - if (tdExecuteRSmaAsync(pSma, pMsg, len, inputType, *pTbSuid) < 0) { + if (tdExecuteRSmaAsync(pSma, version, pMsg, len, inputType, *pTbSuid) < 0) { smaError("vgId:%d, failed to process rsma submit exec 2 since: %s", SMA_VID(pSma), terrstr()); goto _err; } @@ -1367,7 +1380,8 @@ _end: static void tdFreeRSmaSubmitItems(SArray *pItems) { for (int32_t i = 0; i < taosArrayGetSize(pItems); ++i) { - taosFreeQitem(*(void **)taosArrayGet(pItems, i)); + SPackedData *packData = taosArrayGet(pItems, i); + taosFreeQitem(POINTER_SHIFT(packData->msgStr, -sizeof(int32_t) - sizeof(int64_t))); } taosArrayClear(pItems); } @@ -1436,7 +1450,11 @@ static int32_t tdRSmaBatchExec(SSma *pSma, SRSmaInfo *pInfo, STaosQall *qall, SA void *msg = NULL; taosGetQitem(qall, (void **)&msg); if (msg) { - if (!taosArrayPush(pSubmitArr, &msg)) { + SPackedData packData = {.msgLen = *(int32_t *)msg, + .ver = *(int64_t *)POINTER_SHIFT(msg, sizeof(int32_t)), + .msgStr = POINTER_SHIFT(msg, sizeof(int32_t) + sizeof(int64_t))}; + + if (!taosArrayPush(pSubmitArr, &packData)) { tdFreeRSmaSubmitItems(pSubmitArr); goto _err; } @@ -1491,7 +1509,7 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) { } if (!(pSubmitArr = - taosArrayInit(TMIN(RSMA_SUBMIT_BATCH_SIZE, atomic_load_64(&pRSmaStat->nBufItems)), POINTER_BYTES))) { + taosArrayInit(TMIN(RSMA_SUBMIT_BATCH_SIZE, atomic_load_64(&pRSmaStat->nBufItems)), sizeof(SPackedData)))) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto _err; } diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index b61f3084f0..cb1069d256 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -673,11 +673,9 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { req.epoch, TD_VID(pTq->pVnode), fetchVer, pHead->msgType); if (pHead->msgType == TDMT_VND_SUBMIT) { - SSubmitReq* pCont = (SSubmitReq*)&pHead->body; - - SPackedSubmit submit = { - .msgStr = pCont, - .msgLen = pHead->bodyLen, + SPackedData submit = { + .msgStr = POINTER_SHIFT(pHead->body, sizeof(SMsgHead)), + .msgLen = pHead->bodyLen - sizeof(SMsgHead), .ver = pHead->version, }; if (tqTaosxScanLog(pTq, pHandle, submit, &taosxRsp) < 0) { @@ -953,7 +951,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) { pTask->smaSink.smaSink = smaHandleRes; } else if (pTask->outputType == TASK_OUTPUT__TABLE) { pTask->tbSink.vnode = pTq->pVnode; - pTask->tbSink.tbSinkFunc = tqSinkToTablePipeline; + pTask->tbSink.tbSinkFunc = tqSinkToTablePipeline2; ASSERT(pTask->tbSink.pSchemaWrapper); ASSERT(pTask->tbSink.pSchemaWrapper->pSchema); @@ -1334,12 +1332,12 @@ int32_t tqProcessDelReq(STQ* pTq, void* pReq, int32_t len, int64_t ver) { return 0; } -int32_t tqProcessSubmitReq(STQ* pTq, SSubmitReq* pReq, int64_t ver) { - void* pIter = NULL; - bool failed = false; - SStreamDataSubmit* pSubmit = NULL; +int32_t tqProcessSubmitReq(STQ* pTq, SPackedData submit) { + void* pIter = NULL; + bool failed = false; + SStreamDataSubmit2* pSubmit = NULL; - pSubmit = streamDataSubmitNew(pReq); + pSubmit = streamDataSubmitNew(submit); if (pSubmit == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; tqError("failed to create data submit for stream since out of memory"); @@ -1356,7 +1354,7 @@ int32_t tqProcessSubmitReq(STQ* pTq, SSubmitReq* pReq, int64_t ver) { continue; } - tqDebug("data submit enqueue stream task: %d, ver: %" PRId64, pTask->taskId, ver); + tqDebug("data submit enqueue stream task: %d, ver: %" PRId64, pTask->taskId, submit.ver); if (!failed) { if (streamTaskInput(pTask, (SStreamQueueItem*)pSubmit) < 0) { diff --git a/source/dnode/vnode/src/tq/tqExec.c b/source/dnode/vnode/src/tq/tqExec.c index c0a13f47d0..1074e2f6d5 100644 --- a/source/dnode/vnode/src/tq/tqExec.c +++ b/source/dnode/vnode/src/tq/tqExec.c @@ -215,7 +215,7 @@ int32_t tqScanTaosx(STQ* pTq, const STqHandle* pHandle, STaosxRsp* pRsp, SMqMeta return 0; } -int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedSubmit submit, STaosxRsp* pRsp) { +int32_t tqTaosxScanLog(STQ* pTq, STqHandle* pHandle, SPackedData submit, STaosxRsp* pRsp) { STqExecHandle* pExec = &pHandle->execHandle; ASSERT(pExec->subType != TOPIC_SUB_TYPE__COLUMN); diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index 02da5d1a4b..948e037c97 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -213,7 +213,11 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_ #endif int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) { - tqDebug("vgId:%d, tq push msg ver %" PRId64 ", type: %s", pTq->pVnode->config.vgId, ver, TMSG_INFO(msgType)); + void* pReq = POINTER_SHIFT(msg, sizeof(SMsgHead)); + int32_t len = msgLen - sizeof(SMsgHead); + + tqDebug("vgId:%d, tq push msg ver %" PRId64 ", type: %s, p head %p, p body %p, len %d", pTq->pVnode->config.vgId, ver, + TMSG_INFO(msgType), msg, pReq, len); if (msgType == TDMT_VND_SUBMIT) { // lock push mgr to avoid potential msg lost @@ -222,7 +226,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) if (taosHashGetSize(pTq->pPushMgr) != 0) { SArray* cachedKeys = taosArrayInit(0, sizeof(void*)); SArray* cachedKeyLens = taosArrayInit(0, sizeof(size_t)); - void* data = taosMemoryMalloc(msgLen); + void* data = taosMemoryMalloc(len); if (data == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; tqError("failed to copy data for stream since out of memory"); @@ -230,9 +234,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) taosArrayDestroy(cachedKeyLens); return -1; } - memcpy(data, msg, msgLen); - SSubmitReq* pReq = (SSubmitReq*)data; - pReq->version = ver; + memcpy(data, pReq, len); void* pIter = NULL; while (1) { @@ -256,7 +258,12 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) SMqDataRsp* pRsp = &pPushEntry->dataRsp; // prepare scan mem data - qStreamScanMemData(task, pReq, ver); + SPackedData submit = { + .msgStr = data, + .msgLen = len, + .ver = ver, + }; + qStreamSetScanMemData(task, submit); // exec while (1) { @@ -310,17 +317,22 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) if (vnodeIsRoleLeader(pTq->pVnode)) { if (taosHashGetSize(pTq->pStreamMeta->pTasks) == 0) return 0; if (msgType == TDMT_VND_SUBMIT) { - void* data = taosMemoryMalloc(msgLen); + void* data = taosMemoryMalloc(len); if (data == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; tqError("failed to copy data for stream since out of memory"); return -1; } - memcpy(data, msg, msgLen); - SSubmitReq* pReq = (SSubmitReq*)data; - pReq->version = ver; + memcpy(data, pReq, len); + SPackedData submit = { + .msgStr = data, + .msgLen = len, + .ver = ver, + }; - tqProcessSubmitReq(pTq, data, ver); + tqDebug("tq copy write msg %p %d %" PRId64 " from %p", data, len, ver, pReq); + + tqProcessSubmitReq(pTq, submit); } if (msgType == TDMT_VND_DELETE) { tqProcessDelReq(pTq, POINTER_SHIFT(msg, sizeof(SMsgHead)), msgLen - sizeof(SMsgHead), ver); diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 5a23267827..ea60d0ccc6 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -252,7 +252,7 @@ END: } STqReader* tqOpenReader(SVnode* pVnode) { - STqReader* pReader = taosMemoryMalloc(sizeof(STqReader)); + STqReader* pReader = taosMemoryCalloc(1, sizeof(STqReader)); if (pReader == NULL) { return NULL; } @@ -306,7 +306,7 @@ int32_t tqSeekVer(STqReader* pReader, int64_t ver) { } int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { - bool fromProcessedMsg = pReader->pMsg != NULL; + bool fromProcessedMsg = pReader->msg2.msgStr != NULL; while (1) { if (!fromProcessedMsg) { @@ -320,8 +320,8 @@ int32_t tqNextBlock(STqReader* pReader, SFetchRet* ret) { ASSERT(ret->offset.version >= 0); return -1; } - void* body = pReader->pWalReader->pHead->head.body; - int32_t bodyLen = pReader->pWalReader->pHead->head.bodyLen; + void* body = POINTER_SHIFT(pReader->pWalReader->pHead->head.body, sizeof(SMsgHead)); + int32_t bodyLen = pReader->pWalReader->pHead->head.bodyLen - sizeof(SMsgHead); int64_t ver = pReader->pWalReader->pHead->head.version; #if 0 if (pReader->pWalReader->pHead->head.msgType != TDMT_VND_SUBMIT) { @@ -381,15 +381,24 @@ int32_t tqReaderSetDataMsg(STqReader* pReader, const SSubmitReq* pMsg, int64_t v int32_t tqReaderSetSubmitReq2(STqReader* pReader, void* msgStr, int32_t msgLen, int64_t ver) { ASSERT(pReader->msg2.msgStr == NULL); + ASSERT(msgStr); + ASSERT(msgLen); + ASSERT(ver >= 0); pReader->msg2.msgStr = msgStr; pReader->msg2.msgLen = msgLen; pReader->msg2.ver = ver; + pReader->ver = ver; - if (pReader->pSubmit == NULL) { + tqDebug("tq reader set msg %p %d", msgStr, msgLen); + + if (pReader->setMsg == 0) { SDecoder decoder; tDecoderInit(&decoder, pReader->msg2.msgStr, pReader->msg2.msgLen); - tDecodeSSubmitReq2(&decoder, pReader->pSubmit); + if (tDecodeSSubmitReq2(&decoder, &pReader->submit) < 0) { + ASSERT(0); + } tDecoderClear(&decoder); + pReader->setMsg = 1; } return 0; } @@ -422,21 +431,27 @@ bool tqNextDataBlock(STqReader* pReader) { bool tqNextDataBlock2(STqReader* pReader) { if (pReader->msg2.msgStr == NULL) return false; - ASSERT(pReader->pSubmit != NULL); + ASSERT(pReader->setMsg == 1); - int32_t blockSz = taosArrayGetSize(pReader->pSubmit->aSubmitTbData); + tqDebug("tq reader next data block %p, %d %" PRId64 " %d", pReader->msg2.msgStr, pReader->msg2.msgLen, + pReader->msg2.ver, pReader->nextBlk); + + int32_t blockSz = taosArrayGetSize(pReader->submit.aSubmitTbData); while (pReader->nextBlk < blockSz) { - SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->pSubmit->aSubmitTbData, pReader->nextBlk); + SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->submit.aSubmitTbData, pReader->nextBlk); + ASSERT(pSubmitTbData->uid); + if (pReader->tbIdHash == NULL) return true; void* ret = taosHashGet(pReader->tbIdHash, &pSubmitTbData->uid, sizeof(int64_t)); if (ret != NULL) { return true; } + pReader->nextBlk++; } - tDestroySSubmitReq2(pReader->pSubmit, TSDB_MSG_FLG_DECODE); - pReader->pSubmit = NULL; + tDestroySSubmitReq2(&pReader->submit, TSDB_MSG_FLG_DECODE); + pReader->setMsg = 0; pReader->nextBlk = 0; pReader->msg2.msgStr = NULL; @@ -445,11 +460,11 @@ bool tqNextDataBlock2(STqReader* pReader) { bool tqNextDataBlockFilterOut2(STqReader* pReader, SHashObj* filterOutUids) { if (pReader->msg2.msgStr == NULL) return false; - ASSERT(pReader->pSubmit != NULL); + ASSERT(pReader->setMsg == 1); - int32_t blockSz = taosArrayGetSize(pReader->pSubmit->aSubmitTbData); + int32_t blockSz = taosArrayGetSize(pReader->submit.aSubmitTbData); while (pReader->nextBlk < blockSz) { - SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->pSubmit->aSubmitTbData, pReader->nextBlk); + SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->submit.aSubmitTbData, pReader->nextBlk); if (pReader->tbIdHash == NULL) return true; void* ret = taosHashGet(pReader->tbIdHash, &pSubmitTbData->uid, sizeof(int64_t)); @@ -458,8 +473,8 @@ bool tqNextDataBlockFilterOut2(STqReader* pReader, SHashObj* filterOutUids) { } } - tDestroySSubmitReq2(pReader->pSubmit, TSDB_MSG_FLG_DECODE); - pReader->pSubmit = NULL; + tDestroySSubmitReq2(&pReader->submit, TSDB_MSG_FLG_DECODE); + pReader->setMsg = 0; pReader->nextBlk = 0; pReader->msg2.msgStr = NULL; @@ -548,10 +563,12 @@ int32_t tqScanSubmitSplit(SArray* pBlocks, SArray* schemas, STqReader* pReader) #endif int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) { - int32_t blockSz = taosArrayGetSize(pReader->pSubmit->aSubmitTbData); + int32_t blockSz = taosArrayGetSize(pReader->submit.aSubmitTbData); ASSERT(pReader->nextBlk < blockSz); - SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->pSubmit->aSubmitTbData, pReader->nextBlk); + tqDebug("tq reader retrieve data block %p, %d", pReader->msg2.msgStr, pReader->nextBlk); + + SSubmitTbData* pSubmitTbData = taosArrayGet(pReader->submit.aSubmitTbData, pReader->nextBlk); pReader->nextBlk++; int32_t sversion = pSubmitTbData->sver; @@ -666,15 +683,33 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) { } else if (pCol->cid == pColData->info.colId) { for (int32_t i = 0; i < pCol->nVal; i++) { tColDataGetValue(pCol, sourceIdx, &colVal); +#if 0 void* val = NULL; if (IS_STR_DATA_TYPE(colVal.type)) { val = colVal.value.pData; } else { val = &colVal.value.val; } - if (colDataAppend(pColData, i, val, colVal.type != TD_VTYPE_NORM) < 0) { + if (colDataAppend(pColData, i, val, !COL_VAL_IS_VALUE(&colVal)) < 0) { goto FAIL; } +#endif + if (IS_STR_DATA_TYPE(colVal.type)) { + if (colVal.value.pData != NULL) { + char val[65535 + 2]; + memcpy(varDataVal(val), colVal.value.pData, colVal.value.nData); + varDataSetLen(val, colVal.value.nData); + if (colDataAppend(pColData, i, val, !COL_VAL_IS_VALUE(&colVal)) < 0) { + goto FAIL; + } + } else { + colDataAppendNULL(pColData, i); + } + } else { + if (colDataAppend(pColData, i, (void*)&colVal.value.val, !COL_VAL_IS_VALUE(&colVal)) < 0) { + goto FAIL; + } + } } sourceIdx++; targetIdx++; @@ -686,14 +721,14 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) { SArray* pRows = pSubmitTbData->aRowP; for (int32_t i = 0; i < numOfRows; i++) { - SRow* pRow = taosArrayGet(pRows, i); + SRow* pRow = taosArrayGetP(pRows, i); int32_t targetIdx = 0; int32_t sourceIdx = 0; for (int32_t j = 0; j < colActual; j++) { SColumnInfoData* pColData = taosArrayGet(pBlock->pDataBlock, j); while (1) { - ASSERT(sourceIdx < numOfRows); + ASSERT(sourceIdx < pTschema->numOfCols); SColVal colVal; tRowGet(pRow, pTschema, sourceIdx, &colVal); @@ -701,14 +736,22 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) { sourceIdx++; continue; } else if (colVal.cid == pColData->info.colId) { - void* val = NULL; if (IS_STR_DATA_TYPE(colVal.type)) { - val = colVal.value.pData; + if (colVal.value.pData != NULL) { + char val[65535 + 2]; + memcpy(varDataVal(val), colVal.value.pData, colVal.value.nData); + varDataSetLen(val, colVal.value.nData); + if (colDataAppend(pColData, i, val, !COL_VAL_IS_VALUE(&colVal)) < 0) { + goto FAIL; + } + } else { + colDataAppendNULL(pColData, i); + } + /*val = colVal.value.pData;*/ } else { - val = &colVal.value.val; - } - if (colDataAppend(pColData, i, val, colVal.type != TD_VTYPE_NORM) < 0) { - goto FAIL; + if (colDataAppend(pColData, i, (void*)&colVal.value.val, !COL_VAL_IS_VALUE(&colVal)) < 0) { + goto FAIL; + } } sourceIdx++; diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index d34c35f6e7..a6393b6413 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -750,32 +750,26 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d } void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* data) { - const SArray* pBlocks = (const SArray*)data; - SVnode* pVnode = (SVnode*)vnode; - int64_t suid = pTask->tbSink.stbUid; - char* stbFullName = pTask->tbSink.stbFullName; - STSchema* pTSchema = pTask->tbSink.pTSchema; - SSchemaWrapper* pSchemaWrapper = pTask->tbSink.pSchemaWrapper; + const SArray* pBlocks = (const SArray*)data; + SVnode* pVnode = (SVnode*)vnode; + int64_t suid = pTask->tbSink.stbUid; + char* stbFullName = pTask->tbSink.stbFullName; + STSchema* pTSchema = pTask->tbSink.pTSchema; + /*SSchemaWrapper* pSchemaWrapper = pTask->tbSink.pSchemaWrapper;*/ int32_t blockSz = taosArrayGetSize(pBlocks); tqDebug("vgId:%d, task %d write into table, block num: %d", TD_VID(pVnode), pTask->taskId, blockSz); void* pBuf = NULL; - int32_t len = 0; SSubmitReq2* pReq = NULL; SArray* tagArray = NULL; - SArray* createTbArray = NULL; SArray* pVals = NULL; if (!(tagArray = taosArrayInit(1, sizeof(STagVal)))) { goto _end; } - if (!(createTbArray = taosArrayInit(blockSz, POINTER_BYTES))) { - goto _end; - } - if (!(pReq = taosMemoryCalloc(1, sizeof(SSubmitReq2)))) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto _end; @@ -786,7 +780,6 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* } for (int32_t i = 0; i < blockSz; i++) { - bool createTb = true; SSDataBlock* pDataBlock = taosArrayGet(pBlocks, i); if (pDataBlock->info.type == STREAM_DELETE_RESULT) { SBatchDeleteReq deleteReq = {0}; @@ -824,94 +817,103 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* tqDebug("failed to put delete req into write-queue since %s", terrstr()); } } else { - // create table req - if (createTb) { - for (int32_t i = 0; i < blockSz; ++i) { - SSDataBlock* pDataBlock = taosArrayGet(pBlocks, i); - SVCreateTbReq* pCreateTbReq = NULL; - if (pDataBlock->info.type == STREAM_DELETE_RESULT) { - taosArrayPush(createTbArray, &pCreateTbReq); - continue; - } - - if (!(pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateStbReq)))) { - goto _end; - }; - - // don't move to the end of loop as to destroy in the end of func when error occur - taosArrayPush(createTbArray, &pCreateTbReq); - - // set const - pCreateTbReq->flags = 0; - pCreateTbReq->type = TSDB_CHILD_TABLE; - pCreateTbReq->ctb.suid = suid; - - // set super table name - SName name = {0}; - tNameFromString(&name, stbFullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); - pCreateTbReq->ctb.stbName = strdup((char*)tNameGetTableName(&name)); // strdup(stbFullName); - - // set tag content - taosArrayClear(tagArray); - STagVal tagVal = { - .cid = taosArrayGetSize(pDataBlock->pDataBlock) + 1, - .type = TSDB_DATA_TYPE_UBIGINT, - .i64 = (int64_t)pDataBlock->info.id.groupId, - }; - taosArrayPush(tagArray, &tagVal); - pCreateTbReq->ctb.tagNum = taosArrayGetSize(tagArray); - - STag* pTag = NULL; - tTagNew(tagArray, 1, false, &pTag); - if (pTag == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _end; - } - pCreateTbReq->ctb.pTag = (uint8_t*)pTag; - - // set tag name - SArray* tagName = taosArrayInit(1, TSDB_COL_NAME_LEN); - char tagNameStr[TSDB_COL_NAME_LEN] = {0}; - strcpy(tagNameStr, "group_id"); - taosArrayPush(tagName, tagNameStr); - pCreateTbReq->ctb.tagName = tagName; - - // set table name - if (pDataBlock->info.parTbName[0]) { - pCreateTbReq->name = strdup(pDataBlock->info.parTbName); - } else { - pCreateTbReq->name = buildCtbNameByGroupId(stbFullName, pDataBlock->info.id.groupId); - } - } - } - - // SSubmitTbData req - int32_t rows = pDataBlock->info.rows; - - SSubmitTbData* pTbData = (SSubmitTbData*)taosMemoryCalloc(1, sizeof(SSubmitTbData)); - if (!pTbData) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _end; - } - - if (!(pTbData->aRowP = taosArrayInit(rows, sizeof(SRow*)))) { - taosMemoryFree(pTbData); - goto _end; - } - pTbData->suid = suid; - pTbData->uid = 0; // uid is assigned by vnode - pTbData->sver = pTSchema->version; - + SSubmitTbData tbData = {0}; + int32_t rows = pDataBlock->info.rows; tqDebug("tq sink, convert block1 %d, rows: %d", i, rows); - if (createTb) { - pTbData->pCreateTbReq = taosArrayGetP(createTbArray, i); - if (pTbData->pCreateTbReq) pTbData->flags = SUBMIT_REQ_AUTO_CREATE_TABLE; + if (!(tbData.aRowP = taosArrayInit(rows, sizeof(SRow*)))) { + goto _end; } + tbData.suid = suid; + tbData.uid = 0; // uid is assigned by vnode + tbData.sver = pTSchema->version; + + char* ctbName = NULL; + if (pDataBlock->info.parTbName[0]) { + ctbName = strdup(pDataBlock->info.parTbName); + } else { + ctbName = buildCtbNameByGroupId(stbFullName, pDataBlock->info.id.groupId); + } + + SMetaReader mr = {0}; + metaReaderInit(&mr, pVnode->pMeta, 0); + if (metaGetTableEntryByName(&mr, ctbName) < 0) { + metaReaderClear(&mr); + tqDebug("vgId:%d, stream write into %s, table auto created", TD_VID(pVnode), ctbName); + + SVCreateTbReq* pCreateTbReq = NULL; + + if (!(pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateStbReq)))) { + goto _end; + }; + + // set const + pCreateTbReq->flags = 0; + pCreateTbReq->type = TSDB_CHILD_TABLE; + pCreateTbReq->ctb.suid = suid; + + // set super table name + SName name = {0}; + tNameFromString(&name, stbFullName, T_NAME_ACCT | T_NAME_DB | T_NAME_TABLE); + pCreateTbReq->ctb.stbName = strdup((char*)tNameGetTableName(&name)); // strdup(stbFullName); + + // set tag content + taosArrayClear(tagArray); + STagVal tagVal = { + .cid = taosArrayGetSize(pDataBlock->pDataBlock) + 1, + .type = TSDB_DATA_TYPE_UBIGINT, + .i64 = (int64_t)pDataBlock->info.id.groupId, + }; + taosArrayPush(tagArray, &tagVal); + pCreateTbReq->ctb.tagNum = taosArrayGetSize(tagArray); + + STag* pTag = NULL; + tTagNew(tagArray, 1, false, &pTag); + if (pTag == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _end; + } + pCreateTbReq->ctb.pTag = (uint8_t*)pTag; + + // set tag name + SArray* tagName = taosArrayInit(1, TSDB_COL_NAME_LEN); + char tagNameStr[TSDB_COL_NAME_LEN] = {0}; + strcpy(tagNameStr, "group_id"); + taosArrayPush(tagName, tagNameStr); + pCreateTbReq->ctb.tagName = tagName; + + // set table name + pCreateTbReq->name = ctbName; + ctbName = NULL; + + tbData.pCreateTbReq = pCreateTbReq; + tbData.flags = SUBMIT_REQ_AUTO_CREATE_TABLE; + } else { + if (mr.me.type != TSDB_CHILD_TABLE) { + tqError("vgId:%d, failed to write into %s, since table type incorrect, type %d", TD_VID(pVnode), ctbName, + mr.me.type); + metaReaderClear(&mr); + taosMemoryFree(ctbName); + continue; + } + + if (mr.me.ctbEntry.suid != suid) { + tqError("vgId:%d, failed to write into %s, since suid mismatch, expect suid: %" PRId64 + ", actual suid %" PRId64 "", + TD_VID(pVnode), ctbName, suid, mr.me.ctbEntry.suid); + metaReaderClear(&mr); + taosMemoryFree(ctbName); + } + + tbData.uid = mr.me.uid; + metaReaderClear(&mr); + taosMemoryFreeClear(ctbName); + } + + // rows if (!pVals && !(pVals = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal)))) { - taosArrayDestroy(pTbData->aRowP); - taosMemoryFree(pTbData); + taosArrayDestroy(tbData.aRowP); goto _end; } @@ -924,14 +926,15 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type); taosArrayPush(pVals, &cv); } else { - void* data = colDataGetData(pColData, j); + void* colData = colDataGetData(pColData, j); if (IS_STR_DATA_TYPE(pCol->type)) { - SValue sv = (SValue){.nData = varDataLen(data), .pData = varDataVal(data)}; // address copy, no value + SValue sv = + (SValue){.nData = varDataLen(colData), .pData = varDataVal(colData)}; // address copy, no value SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); taosArrayPush(pVals, &cv); } else { SValue sv; - memcpy(&sv.val, data, tDataTypes[pCol->type].bytes); + memcpy(&sv.val, colData, tDataTypes[pCol->type].bytes); SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); taosArrayPush(pVals, &cv); } @@ -939,16 +942,17 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* } SRow* pRow = NULL; if ((terrno = tRowBuild(pVals, (STSchema*)pTSchema, &pRow)) < 0) { - tDestroySSubmitTbData(pTbData, TSDB_MSG_FLG_ENCODE); + tDestroySSubmitTbData(&tbData, TSDB_MSG_FLG_ENCODE); goto _end; } ASSERT(pRow); - taosArrayPush(pTbData->aRowP, &pRow); + taosArrayPush(tbData.aRowP, &pRow); } - taosArrayPush(pReq->aSubmitTbData, pTbData); + taosArrayPush(pReq->aSubmitTbData, &tbData); // encode + int32_t len; int32_t code; tEncodeSize(tEncodeSSubmitReq2, pReq, len, code); SEncoder encoder; @@ -957,19 +961,22 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* if (NULL == pBuf) { goto _end; } - ((SMsgHead*)pBuf)->vgId = htonl(TD_VID(pVnode)); + ((SMsgHead*)pBuf)->vgId = TD_VID(pVnode); ((SMsgHead*)pBuf)->contLen = htonl(len); tEncoderInit(&encoder, POINTER_SHIFT(pBuf, sizeof(SMsgHead)), len - sizeof(SMsgHead)); if (tEncodeSSubmitReq2(&encoder, pReq) < 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; tqError("failed to encode submit req since %s", terrstr()); + tEncoderClear(&encoder); + rpcFreeCont(pBuf); + continue; } tEncoderClear(&encoder); SRpcMsg msg = { .msgType = TDMT_VND_SUBMIT, .pCont = pBuf, - .contLen = ntohl(len), + .contLen = len, }; if (tmsgPutToQueue(&pVnode->msgCb, WRITE_QUEUE, &msg) != 0) { @@ -982,6 +989,7 @@ _end: taosArrayDestroy(pVals); // TODO: change tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + taosMemoryFree(pReq); } #if 0 diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 093dc8b57c..8aca60fbd9 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -91,12 +91,10 @@ int32_t tsdbCacheDeleteLastrow(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { } } + taosLRUCacheRelease(pCache, h, invalidate); if (invalidate) { - taosLRUCacheRelease(pCache, h, true); - } else { - taosLRUCacheRelease(pCache, h, false); + taosLRUCacheErase(pCache, key, keyLen); } - // void taosLRUCacheErase(SLRUCache * cache, const void *key, size_t keyLen); } return code; @@ -124,12 +122,10 @@ int32_t tsdbCacheDeleteLast(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { } } + taosLRUCacheRelease(pCache, h, invalidate); if (invalidate) { - taosLRUCacheRelease(pCache, h, true); - } else { - taosLRUCacheRelease(pCache, h, false); + taosLRUCacheErase(pCache, key, keyLen); } - // void taosLRUCacheErase(SLRUCache * cache, const void *key, size_t keyLen); } return code; @@ -208,6 +204,44 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, TS int16_t nCol = taosArrayGetSize(pLast); int16_t iCol = 0; + if (nCol <= 0) { + nCol = pTSchema->numOfCols; + + STColumn *pTColumn = &pTSchema->columns[0]; + SColVal tColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = keyTs}); + if (taosArrayPush(pLast, &(SLastCol){.ts = keyTs, .colVal = tColVal}) == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + + for (iCol = 1; iCol < nCol; ++iCol) { + SColVal colVal = {0}; + tsdbRowGetColVal(row, pTSchema, iCol, &colVal); + + SLastCol lastCol = {.ts = keyTs, .colVal = colVal}; + if (IS_VAR_DATA_TYPE(colVal.type) && colVal.value.nData > 0) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLast, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + memcpy(lastCol.colVal.value.pData, colVal.value.pData, colVal.value.nData); + } + + if (taosArrayPush(pLast, &lastCol) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + } + + goto _invalidate; + } + SLastCol *tTsVal = (SLastCol *)taosArrayGet(pLast, iCol); if (keyTs > tTsVal->ts) { STColumn *pTColumn = &pTSchema->columns[0]; @@ -279,6 +313,44 @@ int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, TSDBROW *row, STsdb int16_t nCol = taosArrayGetSize(pLast); int16_t iCol = 0; + if (nCol <= 0) { + nCol = pTSchema->numOfCols; + + STColumn *pTColumn = &pTSchema->columns[0]; + SColVal tColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = keyTs}); + if (taosArrayPush(pLast, &(SLastCol){.ts = keyTs, .colVal = tColVal}) == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + + for (iCol = 1; iCol < nCol; ++iCol) { + SColVal colVal = {0}; + tsdbRowGetColVal(row, pTSchema, iCol, &colVal); + + SLastCol lastCol = {.ts = keyTs, .colVal = colVal}; + if (IS_VAR_DATA_TYPE(colVal.type) && colVal.value.nData > 0) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLast, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + memcpy(lastCol.colVal.value.pData, colVal.value.pData, colVal.value.nData); + } + + if (taosArrayPush(pLast, &lastCol) == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _invalidate; + } + } + + goto _invalidate; + } + SLastCol *tTsVal = (SLastCol *)taosArrayGet(pLast, iCol); if (keyTs > tTsVal->ts) { STColumn *pTColumn = &pTSchema->columns[0]; @@ -953,7 +1025,10 @@ static int32_t nextRowIterOpen(CacheNextRowIter *pIter, tb_uid_t uid, STsdb *pTs SArray *pDelIdxArray = taosArrayInit(32, sizeof(SDelIdx)); code = tsdbReadDelIdx(pDelFReader, pDelIdxArray); - if (code) goto _err; + if (code) { + tsdbDelFReaderClose(&pDelFReader); + goto _err; + } SDelIdx *delIdx = taosArraySearch(pDelIdxArray, &(SDelIdx){.suid = suid, .uid = uid}, tCmprDelIdx, TD_EQ); @@ -1215,12 +1290,12 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo // build the result ts row here *dup = false; - if (taosArrayGetSize(pColArray) != nCol) { - *ppColArray = NULL; - taosArrayDestroy(pColArray); - } else { - *ppColArray = pColArray; - } + // if (taosArrayGetSize(pColArray) != nCol) { + //*ppColArray = NULL; + // taosArrayDestroy(pColArray); + //} else { + *ppColArray = pColArray; + //} nextRowIterClose(&iter); // taosMemoryFreeClear(pTSchema); @@ -1333,12 +1408,12 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray, SCach } } while (setNoneCol); - if (taosArrayGetSize(pColArray) <= 0) { - *ppLastArray = NULL; - taosArrayDestroy(pColArray); - } else { - *ppLastArray = pColArray; - } + // if (taosArrayGetSize(pColArray) <= 0) { + //*ppLastArray = NULL; + // taosArrayDestroy(pColArray); + //} else { + *ppLastArray = pColArray; + //} nextRowIterClose(&iter); // taosMemoryFreeClear(pTSchema); @@ -1369,8 +1444,8 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader * SArray *pArray = NULL; bool dup = false; // which is always false for now code = mergeLastRow(uid, pTsdb, &dup, &pArray, pr); - // if table's empty or error, return code of -1 - if (code < 0 || pArray == NULL) { + // if table's empty or error, set handle NULL and return + if (code < 0 /* || pArray == NULL*/) { if (!dup && pArray) { taosArrayDestroy(pArray); } @@ -1388,20 +1463,14 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader * if (status != TAOS_LRU_STATUS_OK) { code = -1; } - - // taosThreadMutexUnlock(&pTsdb->lruMutex); - - // h = taosLRUCacheLookup(pCache, key, keyLen); - } // else { + } taosThreadMutexUnlock(&pTsdb->lruMutex); - //} } *handle = h; return code; } - // int32_t tsdbCacheLastArray2Row(SArray *pLastArray, STSRow **ppRow, STSchema *pTSchema) { // int32_t code = 0; // int16_t nCol = taosArrayGetSize(pLastArray); @@ -1442,8 +1511,8 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader *pr, if (!h) { SArray *pLastArray = NULL; code = mergeLast(uid, pTsdb, &pLastArray, pr); - // if table's empty or error, return code of -1 - if (code < 0 || pLastArray == NULL) { + // if table's empty or error, set handle NULL and return + if (code < 0 /* || pLastArray == NULL*/) { taosThreadMutexUnlock(&pTsdb->lruMutex); *handle = NULL; @@ -1457,13 +1526,8 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, SCacheRowsReader *pr, if (status != TAOS_LRU_STATUS_OK) { code = -1; } - - // taosThreadMutexUnlock(&pTsdb->lruMutex); - - // h = taosLRUCacheLookup(pCache, key, keyLen); - } // else { + } taosThreadMutexUnlock(&pTsdb->lruMutex); - //} } *handle = h; diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index b87e5d5503..76e5897e53 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -253,6 +253,10 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 if (h == NULL) { continue; } + if (taosArrayGetSize(pRow) <= 0) { + tsdbCacheRelease(lruCache, h); + continue; + } { for (int32_t k = 0; k < pr->numOfCols; ++k) { @@ -322,6 +326,10 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 if (h == NULL) { continue; } + if (taosArrayGetSize(pRow) <= 0) { + tsdbCacheRelease(lruCache, h); + continue; + } saveOneRow(pRow, pResBlock, pr, slotIds, pRes); // TODO reset the pRes diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index 40932f077c..92451dcf58 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -53,6 +53,7 @@ typedef struct { // -------------- TSKEY nextKey; // reset by each table commit int32_t commitFid; + int32_t expLevel; TSKEY minKey; TSKEY maxKey; // commit file data @@ -503,6 +504,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) { // memory pCommitter->commitFid = tsdbKeyFid(pCommitter->nextKey, pCommitter->minutes, pCommitter->precision); + pCommitter->expLevel = tsdbFidLevel(pCommitter->commitFid, &pCommitter->pTsdb->keepCfg, taosGetTimestampSec()); tsdbFidKeyRange(pCommitter->commitFid, pCommitter->minutes, pCommitter->precision, &pCommitter->minKey, &pCommitter->maxKey); #if 0 @@ -556,7 +558,10 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) { } } else { SDiskID did = {0}; - tfsAllocDisk(pTsdb->pVnode->pTfs, 0, &did); + if (tfsAllocDisk(pTsdb->pVnode->pTfs, pCommitter->expLevel, &did) < 0) { + code = terrno; + TSDB_CHECK_CODE(code, lino, _exit); + } tfsMkdirRecurAt(pTsdb->pVnode->pTfs, pTsdb->path, did); wSet.diskId = did; wSet.nSttF = 1; diff --git a/source/dnode/vnode/src/tsdb/tsdbFS.c b/source/dnode/vnode/src/tsdb/tsdbFS.c index 72d9c4f69e..7dc839773f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS.c @@ -962,6 +962,7 @@ int32_t tsdbFSUpsertFSet(STsdbFS *pFS, SDFileSet *pSet) { } } + pDFileSet->diskId = pSet->diskId; goto _exit; } } diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 4e6ec617ad..007ae871a0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -695,7 +695,7 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData, } while (iRow < nRow) { - tRow.pTSRow = aRow[iRow++]; + tRow.pTSRow = aRow[iRow]; key.ts = tRow.pTSRow->ts; if (SL_NODE_FORWARD(pos[0], 0) != pTbData->sl.pTail) { diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 9e07ce0b0e..d6931e1b01 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -214,6 +214,7 @@ static bool hasDataInLastBlock(SLastBlockReader* pLastBlockReader); static int32_t doBuildDataBlock(STsdbReader* pReader); static TSDBKEY getCurrentKeyInBuf(STableBlockScanInfo* pScanInfo, STsdbReader* pReader); static bool hasDataInFileBlock(const SBlockData* pBlockData, const SFileBlockDumpInfo* pDumpInfo); +static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter); static bool outOfTimeWindow(int64_t ts, STimeWindow* pWindow) { return (ts > pWindow->ekey) || (ts < pWindow->skey); } @@ -2477,8 +2478,39 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) { SDataBlk* pBlock = getCurrentBlock(&pReader->status.blockIter); if (pDumpInfo->rowIndex >= pBlock->nRow || pDumpInfo->rowIndex < 0) { - setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); - break; + int32_t nextIndex = -1; + SBlockIndex bIndex = {0}; + bool hasNeighbor = + getNeighborBlockOfSameTable(pBlockInfo, pBlockScanInfo, &nextIndex, pReader->order, &bIndex); + if (!hasNeighbor) { // do nothing + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } + + if (overlapWithNeighborBlock(pBlock, &bIndex, pReader->order)) { // load next block + SReaderStatus* pStatus = &pReader->status; + SDataBlockIter* pBlockIter = &pStatus->blockIter; + + // 1. find the next neighbor block in the scan block list + SFileDataBlockInfo fb = {.uid = pBlockInfo->uid, .tbBlockIdx = nextIndex}; + int32_t neighborIndex = findFileBlockInfoIndex(pBlockIter, &fb); + + // 2. remove it from the scan block list + setFileBlockActiveInBlockIter(pBlockIter, neighborIndex, step); + + // 3. load the neighbor block, and set it to be the currently accessed file data block + code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pBlockInfo->uid); + if (code != TSDB_CODE_SUCCESS) { + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } + + // 4. check the data values + initBlockDumpInfo(pReader, pBlockIter); + } else { + setBlockAllDumped(pDumpInfo, pBlock->maxKey.ts, pReader->order); + break; + } } } } @@ -2887,7 +2919,7 @@ static int32_t buildBlockFromBufferSequentially(STsdbReader* pReader) { } // set the correct start position in case of the first/last file block, according to the query time window -static void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { +void initBlockDumpInfo(STsdbReader* pReader, SDataBlockIter* pBlockIter) { SDataBlk* pBlock = getCurrentBlock(pBlockIter); SReaderStatus* pStatus = &pReader->status; @@ -3096,7 +3128,7 @@ bool hasBeenDropped(const SArray* pDelList, int32_t* index, TSDBKEY* pKey, int32 return false; } else if (pKey->ts == last->ts) { TSDBKEY* prev = taosArrayGet(pDelList, num - 2); - return (prev->version >= pKey->version); + return (prev->version >= pKey->version && prev->version <= pVerRange->maxVer && prev->version >= pVerRange->minVer); } } else { TSDBKEY* pCurrent = taosArrayGet(pDelList, *index); @@ -3240,12 +3272,16 @@ int32_t doMergeRowsInBuf(SIterInfo* pIter, uint64_t uid, int64_t ts, SArray* pDe break; } - STSchema* pTSchema = doGetSchemaForTSRow(TSDBROW_SVERSION(pRow), pReader, uid); - if (pTSchema == NULL) { - return terrno; - } + if (pRow->type == TSDBROW_ROW_FMT) { + STSchema* pTSchema = doGetSchemaForTSRow(TSDBROW_SVERSION(pRow), pReader, uid); + if (pTSchema == NULL) { + return terrno; + } - tsdbRowMergerAdd(pMerger, pRow, pTSchema); + tsdbRowMergerAdd(pMerger, pRow, pTSchema); + } else { // column format + tsdbRowMerge(pMerger, pRow); + } } return TSDB_CODE_SUCCESS; @@ -3394,46 +3430,55 @@ int32_t doMergeMemTableMultiRows(TSDBROW* pRow, uint64_t uid, SIterInfo* pIter, } } -#if 0 - // todo handle the data block merge SRowMerger merge = {0}; - - // get the correct schema for data in memory terrno = 0; - STSchema* pTSchema = doGetSchemaForTSRow(TSDBROW_SVERSION(¤t), pReader, uid); - if (pTSchema == NULL) { - return terrno; - } + int32_t code = 0; - if (pReader->pSchema == NULL) { - pReader->pSchema = pTSchema; - } + // start to merge duplicated rows + if (current.type == TSDBROW_ROW_FMT) { + // get the correct schema for data in memory + STSchema* pTSchema = doGetSchemaForTSRow(TSDBROW_SVERSION(¤t), pReader, uid); + if (pTSchema == NULL) { + return terrno; + } - int32_t code = tsdbRowMergerInit2(&merge, pReader->pSchema, ¤t, pTSchema); - if (code != TSDB_CODE_SUCCESS) { - return code; - } + if (pReader->pSchema == NULL) { + pReader->pSchema = pTSchema; + } - STSchema* pTSchema1 = doGetSchemaForTSRow(TSDBROW_SVERSION(pNextRow), pReader, uid); - if (pTSchema1 == NULL) { - return terrno; - } + code = tsdbRowMergerInit2(&merge, pReader->pSchema, ¤t, pTSchema); + if (code != TSDB_CODE_SUCCESS) { + return code; + } - tsdbRowMergerAdd(&merge, pNextRow, pTSchema1); + STSchema* pTSchema1 = doGetSchemaForTSRow(TSDBROW_SVERSION(pNextRow), pReader, uid); + if (pTSchema1 == NULL) { + return terrno; + } + + tsdbRowMergerAdd(&merge, pNextRow, pTSchema1); + } else { // let's merge rows in file block + code = tsdbRowMergerInit(&merge, ¤t, pReader->pSchema); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + tsdbRowMerge(&merge, pNextRow); + } code = doMergeRowsInBuf(pIter, uid, current.pTSRow->ts, pDelList, &merge, pReader); if (code != TSDB_CODE_SUCCESS) { return code; } - code = tsdbRowMergerGetRow(&merge, pTSRow); + code = tsdbRowMergerGetRow(&merge, &pResRow->pTSRow); if (code != TSDB_CODE_SUCCESS) { return code; } + pResRow->type = current.type; tsdbRowMergerClear(&merge); *freeTSRow = true; -#endif return TSDB_CODE_SUCCESS; } @@ -3910,7 +3955,6 @@ void tsdbReaderClose(STsdbReader* pReader) { if (pReader->freeBlock) { pReader->pResBlock = blockDataDestroy(pReader->pResBlock); } - tBlockDataDestroy(&pReader->status.fileBlockData); taosMemoryFree(pSupInfo->colId); tBlockDataDestroy(&pReader->status.fileBlockData); @@ -4067,8 +4111,32 @@ void tsdbRetrieveDataBlockInfo(const STsdbReader* pReader, int32_t* rows, uint64 } } -int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockSMA, bool* allHave) { +static void doFillNullColSMA(SBlockLoadSuppInfo* pSup, int32_t numOfRows, int32_t numOfCols, SColumnDataAgg* pTsAgg) { + // do fill all null column value SMA info + int32_t i = 0, j = 0; + int32_t size = (int32_t)taosArrayGetSize(pSup->pColAgg); + taosArrayInsert(pSup->pColAgg, 0, pTsAgg); + + while (j < numOfCols && i < size) { + SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); + if (pAgg->colId == pSup->colId[j]) { + i += 1; + j += 1; + } else if (pAgg->colId < pSup->colId[j]) { + i += 1; + } else if (pSup->colId[j] < pAgg->colId) { + if (pSup->colId[j] != PRIMARYKEY_TIMESTAMP_COL_ID) { + SColumnDataAgg nullColAgg = {.colId = pSup->colId[j], .numOfNull = numOfRows}; + taosArrayInsert(pSup->pColAgg, i, &nullColAgg); + } + j += 1; + } + } +} + +int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SSDataBlock* pDataBlock, bool* allHave) { int32_t code = 0; + SColumnDataAgg ***pBlockSMA = &pDataBlock->pBlockAgg; *allHave = false; if (pReader->type == TIMEWINDOW_RANGE_EXTERNAL) { @@ -4116,12 +4184,22 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS int32_t i = 0, j = 0; size_t size = taosArrayGetSize(pSup->pColAgg); + // ensure capacity + if(pDataBlock->pDataBlock) { + size_t colsNum = taosArrayGetSize(pDataBlock->pDataBlock); + taosArrayEnsureCap(pSup->pColAgg, colsNum); + } + SSDataBlock* pResBlock = pReader->pResBlock; if (pResBlock->pBlockAgg == NULL) { size_t num = taosArrayGetSize(pResBlock->pDataBlock); pResBlock->pBlockAgg = taosMemoryCalloc(num, sizeof(SColumnDataAgg)); } + // do fill all null column value SMA info + doFillNullColSMA(pSup, pBlock->nRow, numOfCols, pTsAgg); + + i = 0, j = 0; while (j < numOfCols && i < size) { SColumnDataAgg* pAgg = taosArrayGet(pSup->pColAgg, i); if (pAgg->colId == pSup->colId[j]) { diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index 048d3cc22b..bd17a2593b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -155,7 +155,7 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) { if (rowVer >= pReader->sver && rowVer <= pReader->ever) { pIter->rInfo.suid = pIter->bData.suid; - pIter->rInfo.uid = pIter->bData.uid; + pIter->rInfo.uid = pIter->bData.uid ? pIter->bData.uid : pIter->bData.aUid[pIter->iRow]; pIter->rInfo.row = tsdbRowFromBlockData(&pIter->bData, pIter->iRow); goto _add_iter; } @@ -179,16 +179,14 @@ _err: return code; } -static SRowInfo* tsdbSnapGetRow(STsdbSnapReader* pReader) { return pReader->pIter ? &pReader->pIter->rInfo : NULL; } - static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { int32_t code = 0; if (pReader->pIter) { - SFDataIter* pIter = pReader->pIter; - + SFDataIter* pIter = NULL; while (true) { _find_row: + pIter = pReader->pIter; for (pIter->iRow++; pIter->iRow < pIter->bData.nRow; pIter->iRow++) { int64_t rowVer = pIter->bData.aVersion[pIter->iRow]; @@ -224,6 +222,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { } pReader->pIter = NULL; + break; } else if (pIter->type == SNAP_STT_FILE_ITER) { for (pIter->iSttBlk++; pIter->iSttBlk < taosArrayGetSize(pIter->aSttBlk); pIter->iSttBlk++) { SSttBlk* pSttBlk = (SSttBlk*)taosArrayGet(pIter->aSttBlk, pIter->iSttBlk); @@ -238,6 +237,7 @@ static int32_t tsdbSnapNextRow(STsdbSnapReader* pReader) { } pReader->pIter = NULL; + break; } else { ASSERT(0); } @@ -269,6 +269,20 @@ _err: return code; } +static SRowInfo* tsdbSnapGetRow(STsdbSnapReader* pReader) { + if (pReader->pIter) { + return &pReader->pIter->rInfo; + } else { + tsdbSnapNextRow(pReader); + + if (pReader->pIter) { + return &pReader->pIter->rInfo; + } else { + return NULL; + } + } +} + static int32_t tsdbSnapCmprData(STsdbSnapReader* pReader, uint8_t** ppData) { int32_t code = 0; @@ -1356,7 +1370,7 @@ _exit: taosMemoryFree(pWriter); } } else { - tsdbDebug("vgId:%d, tsdb snapshot writer open for %s succeed", TD_VID(pTsdb->pVnode), pTsdb->path); + tsdbInfo("vgId:%d %s done", TD_VID(pTsdb->pVnode), __func__); *ppWriter = pWriter; } return code; @@ -1421,7 +1435,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** ppWriter, int8_t rollback) { for (int32_t iBuf = 0; iBuf < sizeof(pWriter->aBuf) / sizeof(uint8_t*); iBuf++) { tFree(pWriter->aBuf[iBuf]); } - tsdbInfo("vgId:%d, vnode snapshot tsdb writer close for %s", TD_VID(pWriter->pTsdb->pVnode), pWriter->pTsdb->path); + tsdbInfo("vgId:%d %s done", TD_VID(pWriter->pTsdb->pVnode), __func__); taosMemoryFree(pWriter); *ppWriter = NULL; return code; diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 79007a49a0..1c92e922b0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -637,6 +637,7 @@ SColVal *tsdbRowIterNext(STSDBRowIter *pIter) { } } else { ASSERT(0); + return NULL; // suppress error report by compiler } } @@ -1105,13 +1106,7 @@ void tBlockDataGetColData(SBlockData *pBlockData, int16_t cid, SColData **ppColD int32_t ridx = pBlockData->nColData - 1; while (lidx <= ridx) { - int32_t midx; - if (lidx == ridx) { - midx = lidx; - } else { - midx = lidx + (ridx - lidx) * (cid - pBlockData->aColData[lidx].cid) / - (pBlockData->aColData[ridx].cid - pBlockData->aColData[lidx].cid); - } + int32_t midx = (lidx + ridx) >> 1; SColData *pColData = tBlockDataGetColDataByIdx(pBlockData, midx); int32_t c = (pColData->cid == cid) ? 0 : ((pColData->cid > cid) ? 1 : -1); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 0ad86e43a5..bb5063cfea 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -101,6 +101,7 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { } if (flags & SUBMIT_REQ_AUTO_CREATE_TABLE) { + // SVCreateTbReq if (tStartDecode(&dc) < 0) { code = TSDB_CODE_INVALID_MSG; goto _err; @@ -126,6 +127,15 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { *(int64_t *)(dc.data + dc.pos + 8) = ctime; tEndDecode(&dc); + + // SSubmitTbData + int64_t suid; + if (tDecodeI64(&dc, &suid) < 0) { + code = TSDB_CODE_INVALID_MSG; + goto _err; + } + + *(int64_t *)(dc.data + dc.pos) = uid; } tEndDecode(&dc); @@ -200,9 +210,13 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp version); ASSERT(pVnode->state.applyTerm <= pMsg->info.conn.applyTerm); + ASSERT(pVnode->state.applied + 1 == version); + pVnode->state.applied = version; pVnode->state.applyTerm = pMsg->info.conn.applyTerm; + if (!syncUtilUserCommit(pMsg->msgType)) goto _exit; + // skip header pReq = POINTER_SHIFT(pMsg->pCont, sizeof(SMsgHead)); len = pMsg->contLen - sizeof(SMsgHead); @@ -1016,7 +1030,7 @@ _exit: atomic_add_fetch_64(&pVnode->statis.nBatchInsert, 1); if (code == 0) { atomic_add_fetch_64(&pVnode->statis.nBatchInsertSuccess, 1); - tdProcessRSmaSubmit(pVnode->pSma, pSubmitReq, pReq, len, STREAM_INPUT__DATA_SUBMIT); + tdProcessRSmaSubmit(pVnode->pSma, version, pSubmitReq, pReq, len, STREAM_INPUT__DATA_SUBMIT); } // clear diff --git a/source/libs/catalog/inc/catalogInt.h b/source/libs/catalog/inc/catalogInt.h index ba99906589..c435c46d46 100644 --- a/source/libs/catalog/inc/catalogInt.h +++ b/source/libs/catalog/inc/catalogInt.h @@ -547,6 +547,14 @@ typedef struct SCtgOperation { #define ctgDebug(param, ...) qDebug("CTG:%p " param, pCtg, __VA_ARGS__) #define ctgTrace(param, ...) qTrace("CTG:%p " param, pCtg, __VA_ARGS__) +#define ctgTaskFatal(param, ...) qFatal("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskError(param, ...) qError("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskWarn(param, ...) qWarn("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskInfo(param, ...) qInfo("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskDebug(param, ...) qDebug("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) +#define ctgTaskTrace(param, ...) qTrace("QID:%" PRIx64 " CTG:%p " param, pTask->pJob->queryId, pCtg, __VA_ARGS__) + + #define CTG_LOCK_DEBUG(...) \ do { \ if (gCTGDebug.lockEnable) { \ diff --git a/source/libs/catalog/src/ctgAsync.c b/source/libs/catalog/src/ctgAsync.c index 7138e0ce16..5b01ac1fb9 100644 --- a/source/libs/catalog/src/ctgAsync.c +++ b/source/libs/catalog/src/ctgAsync.c @@ -1094,6 +1094,9 @@ _return: ctgReleaseVgInfoToCache(pCtg, dbCache); } + if (code) { + ctgTaskError("Get table %d.%s.%s meta failed with error %s", pName->acctId, pName->dbname, pName->tname, tstrerror(code)); + } if (pTask->res || code) { ctgHandleTaskEnd(pTask, code); } @@ -1124,7 +1127,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu SVgroupInfo vgInfo = {0}; CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, pOut->dbVgroup, pName, &vgInfo)); - ctgDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); + ctgTaskDebug("will refresh tbmeta, not supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); *vgId = vgInfo.vgId; CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, pName, &vgInfo, NULL, tReq)); @@ -1144,7 +1147,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu SVgroupInfo vgInfo = {0}; CTG_ERR_JRET(ctgGetVgInfoFromHashValue(pCtg, dbCache->vgCache.vgInfo, pName, &vgInfo)); - ctgDebug("will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); + ctgTaskDebug("will refresh tbmeta, supposed to be stb, tbName:%s, flag:%d", tNameGetTableName(pName), flag); *vgId = vgInfo.vgId; CTG_ERR_JRET(ctgGetTbMetaFromVnode(pCtg, pConn, pName, &vgInfo, NULL, tReq)); @@ -1162,7 +1165,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu return TSDB_CODE_SUCCESS; } - ctgError("no tbmeta got, tbName:%s", tNameGetTableName(pName)); + ctgTaskError("no tbmeta got, tbName:%s", tNameGetTableName(pName)); ctgRemoveTbMetaFromCache(pCtg, pName, false); CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST); @@ -1180,7 +1183,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu STableMetaOutput* pOut = (STableMetaOutput*)pMsgCtx->out; if (CTG_IS_META_NULL(pOut->metaType)) { - ctgError("no tbmeta got, tbNmae:%s", tNameGetTableName(pName)); + ctgTaskError("no tbmeta got, tbNmae:%s", tNameGetTableName(pName)); ctgRemoveTbMetaFromCache(pCtg, pName, false); CTG_ERR_JRET(CTG_ERR_CODE_TABLE_NOT_EXIST); } @@ -1190,7 +1193,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu } if (CTG_IS_META_TABLE(pOut->metaType) && TSDB_SUPER_TABLE == pOut->tbMeta->tableType) { - ctgDebug("will continue to refresh tbmeta since got stb, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("will continue to refresh tbmeta since got stb, tbName:%s", tNameGetTableName(pName)); taosMemoryFreeClear(pOut->tbMeta); @@ -1207,11 +1210,11 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu STableMeta* stbMeta = NULL; (void)ctgReadTbMetaFromCache(pCtg, &stbCtx, &stbMeta); if (stbMeta && stbMeta->sversion >= pOut->tbMeta->sversion) { - ctgDebug("use cached stb meta, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("use cached stb meta, tbName:%s", tNameGetTableName(pName)); exist = 1; taosMemoryFreeClear(stbMeta); } else { - ctgDebug("need to get/update stb meta, tbName:%s", tNameGetTableName(pName)); + ctgTaskDebug("need to get/update stb meta, tbName:%s", tNameGetTableName(pName)); taosMemoryFreeClear(pOut->tbMeta); taosMemoryFreeClear(stbMeta); } @@ -1225,7 +1228,7 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu break; } default: - ctgError("invalid reqType %d", reqType); + ctgTaskError("invalid reqType %d", reqType); CTG_ERR_JRET(TSDB_CODE_INVALID_MSG); } @@ -1280,6 +1283,7 @@ _return: TSWAP(pTask->res, ctx->pResList); taskDone = true; } + ctgTaskError("Get table %d.%s.%s meta failed with error %s", pName->acctId, pName->dbname, pName->tname, tstrerror(code)); } if (pTask->res && taskDone) { diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 03a31764ba..3d3a08c8d0 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -126,15 +126,14 @@ enum { typedef struct { // TODO remove prepareStatus - STqOffsetVal prepareStatus; // for tmq - STqOffsetVal lastStatus; // for tmq - SMqMetaRsp metaRsp; // for tmq fetching meta - int8_t returned; - int64_t snapshotVer; - const SSubmitReq* pReq; - int64_t scanVer; + STqOffsetVal prepareStatus; // for tmq + STqOffsetVal lastStatus; // for tmq + SMqMetaRsp metaRsp; // for tmq fetching meta + int8_t returned; + int64_t snapshotVer; + // const SSubmitReq* pReq; - SPackedSubmit submit; + SPackedData submit; SSchemaWrapper* schema; char tbName[TSDB_TABLE_NAME_LEN]; @@ -202,7 +201,7 @@ typedef struct SOperatorFpSet { __optr_fn_t getNextFn; __optr_fn_t cleanupFn; // call this function to release the allocated resources ASAP __optr_close_fn_t closeFn; - __optr_reqBuf_fn_t reqBufFn; // total used buffer for blocking operator + __optr_reqBuf_fn_t reqBufFn; // total used buffer for blocking operator __optr_encode_fn_t encodeResultRow; __optr_decode_fn_t decodeResultRow; __optr_explain_fn_t getExplainFn; @@ -503,8 +502,8 @@ typedef struct STableCountScanOperatorInfo { STableCountScanSupp supp; - int32_t currGrpIdx; - SArray* stbUidList; // when group by db_name and/or stable_name + int32_t currGrpIdx; + SArray* stbUidList; // when group by db_name and/or stable_name } STableCountScanOperatorInfo; typedef struct SOptrBasicInfo { diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2032cb9fce..fc3cfbd0f6 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -439,7 +439,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } } - removeInvalidTable(uidList, tags); + if (suid != 0) { + removeInvalidTable(uidList, tags); + } int32_t rows = taosArrayGetSize(uidList); if (rows == 0) { @@ -1604,7 +1606,7 @@ int32_t initQueryTableDataCond(SQueryTableDataCond* pCond, const STableScanPhysi pCond->numOfCols = LIST_LENGTH(pTableScanNode->scan.pScanCols); pCond->colList = taosMemoryCalloc(pCond->numOfCols, sizeof(SColumnInfo)); - pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t)*pCond->numOfCols); + pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t) * pCond->numOfCols); if (pCond->colList == NULL || pCond->pSlotList == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; taosMemoryFreeClear(pCond->colList); diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 0d6b2977a8..3e0c5a9901 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -51,8 +51,8 @@ static int32_t doSetSMABlock(SOperatorInfo* pOperator, void* input, size_t numOf if (type == STREAM_INPUT__MERGED_SUBMIT) { for (int32_t i = 0; i < numOfBlocks; i++) { - SSubmitReq* pReq = *(void**)POINTER_SHIFT(input, i * sizeof(void*)); - taosArrayPush(pInfo->pBlockLists, &pReq); + SPackedData* pReq = POINTER_SHIFT(input, i * sizeof(SPackedData)); + taosArrayPush(pInfo->pBlockLists, pReq); } pInfo->blockType = STREAM_INPUT__DATA_SUBMIT; } else if (type == STREAM_INPUT__DATA_SUBMIT) { @@ -61,7 +61,10 @@ static int32_t doSetSMABlock(SOperatorInfo* pOperator, void* input, size_t numOf } else if (type == STREAM_INPUT__DATA_BLOCK) { for (int32_t i = 0; i < numOfBlocks; ++i) { SSDataBlock* pDataBlock = &((SSDataBlock*)input)[i]; - taosArrayPush(pInfo->pBlockLists, &pDataBlock); + SPackedData tmp = { + .pDataBlock = pDataBlock, + }; + taosArrayPush(pInfo->pBlockLists, &tmp); } pInfo->blockType = STREAM_INPUT__DATA_BLOCK; } @@ -115,18 +118,21 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu if (type == STREAM_INPUT__MERGED_SUBMIT) { // ASSERT(numOfBlocks > 1); for (int32_t i = 0; i < numOfBlocks; i++) { - SSubmitReq* pReq = *(void**)POINTER_SHIFT(input, i * sizeof(void*)); - taosArrayPush(pInfo->pBlockLists, &pReq); + SPackedData* pReq = POINTER_SHIFT(input, i * sizeof(SPackedData)); + taosArrayPush(pInfo->pBlockLists, pReq); } pInfo->blockType = STREAM_INPUT__DATA_SUBMIT; } else if (type == STREAM_INPUT__DATA_SUBMIT) { ASSERT(numOfBlocks == 1); - taosArrayPush(pInfo->pBlockLists, &input); + taosArrayPush(pInfo->pBlockLists, input); pInfo->blockType = STREAM_INPUT__DATA_SUBMIT; } else if (type == STREAM_INPUT__DATA_BLOCK) { for (int32_t i = 0; i < numOfBlocks; ++i) { SSDataBlock* pDataBlock = &((SSDataBlock*)input)[i]; - taosArrayPush(pInfo->pBlockLists, &pDataBlock); + SPackedData tmp = { + .pDataBlock = pDataBlock, + }; + taosArrayPush(pInfo->pBlockLists, &tmp); } pInfo->blockType = STREAM_INPUT__DATA_BLOCK; } else { @@ -1002,6 +1008,7 @@ int32_t initQueryTableDataCondForTmq(SQueryTableDataCond* pCond, SSnapContext* s return TSDB_CODE_SUCCESS; } +#if 0 int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq, int64_t scanVer) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE); @@ -1010,8 +1017,9 @@ int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq, int64_t sc pTaskInfo->streamInfo.scanVer = scanVer; return 0; } +#endif -int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedSubmit submit) { +int32_t qStreamSetScanMemData(qTaskInfo_t tinfo, SPackedData submit) { SExecTaskInfo* pTaskInfo = (SExecTaskInfo*)tinfo; ASSERT(pTaskInfo->execModel == OPTR_EXEC_MODEL_QUEUE); ASSERT(pTaskInfo->streamInfo.submit.msgStr == NULL); diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index bd22e864cd..043cc396b5 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1580,6 +1580,7 @@ void destroyOperatorInfo(SOperatorInfo* pOperator) { int32_t optrDefaultBufFn(SOperatorInfo* pOperator) { if (pOperator->blocking) { ASSERT(0); + return 0; } else { return 0; } diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 65bb40b195..2be6508272 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#include "filter.h" #include "executorimpl.h" +#include "filter.h" #include "functionMgt.h" typedef struct SProjectOperatorInfo { @@ -90,7 +90,7 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys pInfo->binfo.pRes = pResBlock; pInfo->pFinalRes = createOneDataBlock(pResBlock, false); - pInfo->mergeDataBlocks = (pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM)? false:pProjPhyNode->mergeDataBlock; + pInfo->mergeDataBlocks = (pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM) ? false : pProjPhyNode->mergeDataBlock; int32_t numOfRows = 4096; size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; @@ -117,9 +117,10 @@ SOperatorInfo* createProjectOperatorInfo(SOperatorInfo* downstream, SProjectPhys pInfo->pPseudoColInfo = setRowTsColumnOutputInfo(pOperator->exprSupp.pCtx, numOfCols); - setOperatorInfo(pOperator, "ProjectOperator", QUERY_NODE_PHYSICAL_PLAN_PROJECT, false, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doProjectOperation, NULL, - destroyProjectOperatorInfo, optrDefaultBufFn, NULL); + setOperatorInfo(pOperator, "ProjectOperator", QUERY_NODE_PHYSICAL_PLAN_PROJECT, false, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doProjectOperation, NULL, destroyProjectOperatorInfo, + optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { @@ -220,7 +221,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { blockDataCleanup(pFinalRes); SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - if (pTaskInfo->streamInfo.pReq) { + if (pTaskInfo->streamInfo.submit.msgStr) { pOperator->status = OP_OPENED; } @@ -414,8 +415,10 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy pInfo->binfo.pRes = pResBlock; pInfo->pPseudoColInfo = setRowTsColumnOutputInfo(pSup->pCtx, numOfExpr); - setOperatorInfo(pOperator, "IndefinitOperator", QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC, false, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doApplyIndefinitFunction, NULL, destroyIndefinitOperatorInfo, optrDefaultBufFn, NULL); + setOperatorInfo(pOperator, "IndefinitOperator", QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC, false, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doApplyIndefinitFunction, NULL, destroyIndefinitOperatorInfo, + optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); if (code != TSDB_CODE_SUCCESS) { diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 07de908aea..1fcee1992e 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -224,7 +224,7 @@ static bool doFilterByBlockSMA(SFilterInfo* pFilterInfo, SColumnDataAgg** pColsA static bool doLoadBlockSMA(STableScanBase* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo) { bool allColumnsHaveAgg = true; - int32_t code = tsdbRetrieveDatablockSMA(pTableScanInfo->dataReader, &pBlock->pBlockAgg, &allColumnsHaveAgg); + int32_t code = tsdbRetrieveDatablockSMA(pTableScanInfo->dataReader, pBlock, &allColumnsHaveAgg); if (code != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, code); } @@ -768,8 +768,8 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { tableListGetGroupList(pTaskInfo->pTableInfoList, pInfo->currentGroupId, &pList, &num); ASSERT(pInfo->base.dataReader == NULL); - int32_t code = tsdbReaderOpen(pInfo->base.readHandle.vnode, &pInfo->base.cond, pList, num, - pInfo->pResBlock, (STsdbReader**)&pInfo->base.dataReader, GET_TASKID(pTaskInfo)); + int32_t code = tsdbReaderOpen(pInfo->base.readHandle.vnode, &pInfo->base.cond, pList, num, pInfo->pResBlock, + (STsdbReader**)&pInfo->base.dataReader, GET_TASKID(pTaskInfo)); if (code != TSDB_CODE_SUCCESS) { T_LONG_JMP(pTaskInfo->env, code); } @@ -986,8 +986,8 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU SSDataBlock* pBlock = pTableScanInfo->pResBlock; STsdbReader* pReader = NULL; - int32_t code = tsdbReaderOpen(pTableScanInfo->base.readHandle.vnode, &cond, &tblInfo, 1, pBlock, (STsdbReader**)&pReader, - GET_TASKID(pTaskInfo)); + int32_t code = tsdbReaderOpen(pTableScanInfo->base.readHandle.vnode, &cond, &tblInfo, 1, pBlock, + (STsdbReader**)&pReader, GET_TASKID(pTaskInfo)); if (code != TSDB_CODE_SUCCESS) { terrno = code; T_LONG_JMP(pTaskInfo->env, code); @@ -995,7 +995,7 @@ static SSDataBlock* readPreVersionData(SOperatorInfo* pTableScanOp, uint64_t tbU } if (tsdbNextDataBlock(pReader)) { - /*SSDataBlock* p = */tsdbRetrieveDataBlock(pReader, NULL); + /*SSDataBlock* p = */ tsdbRetrieveDataBlock(pReader, NULL); doSetTagColumnData(&pTableScanInfo->base, pBlock, pTaskInfo, pBlock->info.rows); pBlock->info.id.groupId = getTableGroupId(pTaskInfo->pTableInfoList, pBlock->info.id.uid); } @@ -1218,27 +1218,56 @@ static int32_t generateIntervalScanRange(SStreamScanInfo* pInfo, SSDataBlock* pS if (rows == 0) { return TSDB_CODE_SUCCESS; } + + SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); + SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); + SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); + SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); + + uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; + ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); + TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + int64_t version = pSrcBlock->info.version - 1; + + if (pInfo->partitionSup.needCalc && srcStartTsCol[0] != srcEndTsCol[0]) { + uint64_t srcUid = srcUidData[0]; + TSKEY startTs = srcStartTsCol[0]; + TSKEY endTs = srcEndTsCol[0]; + SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, srcUid, startTs, endTs, version); + printDataBlock(pPreRes, "pre res"); + blockDataCleanup(pSrcBlock); + int32_t code = blockDataEnsureCapacity(pSrcBlock, pPreRes->info.rows); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + SColumnInfoData* pTsCol = (SColumnInfoData*)taosArrayGet(pPreRes->pDataBlock, pInfo->primaryTsIndex); + rows = pPreRes->info.rows; + + for (int32_t i = 0; i < rows; i++) { + uint64_t groupId = calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, i); + appendOneRowToStreamSpecialBlock(pSrcBlock, ((TSKEY*)pTsCol->pData) + i, ((TSKEY*)pTsCol->pData) + i, &srcUid, + &groupId, NULL); + } + printDataBlock(pSrcBlock, "new delete"); + } + uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; + srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; + srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; + srcUidData = (uint64_t*)pSrcUidCol->pData; + int32_t code = blockDataEnsureCapacity(pDestBlock, rows); if (code != TSDB_CODE_SUCCESS) { return code; } - SColumnInfoData* pSrcStartTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, START_TS_COLUMN_INDEX); - SColumnInfoData* pSrcEndTsCol = (SColumnInfoData*)taosArrayGet(pSrcBlock->pDataBlock, END_TS_COLUMN_INDEX); - SColumnInfoData* pSrcUidCol = taosArrayGet(pSrcBlock->pDataBlock, UID_COLUMN_INDEX); - uint64_t* srcUidData = (uint64_t*)pSrcUidCol->pData; - SColumnInfoData* pSrcGpCol = taosArrayGet(pSrcBlock->pDataBlock, GROUPID_COLUMN_INDEX); - uint64_t* srcGp = (uint64_t*)pSrcGpCol->pData; - ASSERT(pSrcStartTsCol->info.type == TSDB_DATA_TYPE_TIMESTAMP); - TSKEY* srcStartTsCol = (TSKEY*)pSrcStartTsCol->pData; - TSKEY* srcEndTsCol = (TSKEY*)pSrcEndTsCol->pData; SColumnInfoData* pStartTsCol = taosArrayGet(pDestBlock->pDataBlock, START_TS_COLUMN_INDEX); SColumnInfoData* pEndTsCol = taosArrayGet(pDestBlock->pDataBlock, END_TS_COLUMN_INDEX); SColumnInfoData* pDeUidCol = taosArrayGet(pDestBlock->pDataBlock, UID_COLUMN_INDEX); SColumnInfoData* pGpCol = taosArrayGet(pDestBlock->pDataBlock, GROUPID_COLUMN_INDEX); SColumnInfoData* pCalStartTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_START_TS_COLUMN_INDEX); SColumnInfoData* pCalEndTsCol = taosArrayGet(pDestBlock->pDataBlock, CALCULATE_END_TS_COLUMN_INDEX); - int64_t version = pSrcBlock->info.version - 1; for (int32_t i = 0; i < rows;) { uint64_t srcUid = srcUidData[i]; uint64_t groupId = srcGp[i]; @@ -1496,19 +1525,18 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { qDebug("queue scan called"); - if (pTaskInfo->streamInfo.pReq != NULL) { - if (pInfo->tqReader->pMsg == NULL) { - pInfo->tqReader->pMsg = pTaskInfo->streamInfo.pReq; - pInfo->tqReader->ver = pTaskInfo->streamInfo.scanVer; + if (pTaskInfo->streamInfo.submit.msgStr != NULL) { + if (pInfo->tqReader->msg2.msgStr == NULL) { + /*pInfo->tqReader->pMsg = pTaskInfo->streamInfo.pReq;*/ - const SSubmitReq* pSubmit = pInfo->tqReader->pMsg; + /*const SSubmitReq* pSubmit = pInfo->tqReader->pMsg;*/ /*if (tqReaderSetDataMsg(pInfo->tqReader, pSubmit, 0) < 0) {*/ /*void* msgStr = pTaskInfo->streamInfo.*/ - SPackedSubmit submit = pTaskInfo->streamInfo.submit; + SPackedData submit = pTaskInfo->streamInfo.submit; if (tqReaderSetSubmitReq2(pInfo->tqReader, submit.msgStr, submit.msgLen, submit.ver) < 0) { - qError("submit msg messed up when initing stream submit block %p", pSubmit); - pInfo->tqReader->pMsg = NULL; - pTaskInfo->streamInfo.pReq = NULL; + qError("submit msg messed up when initing stream submit block %p", submit.msgStr); + pInfo->tqReader->msg2 = (SPackedData){0}; + pInfo->tqReader->setMsg = 0; ASSERT(0); } } @@ -1532,8 +1560,9 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) { } } - pInfo->tqReader->pMsg = NULL; - pTaskInfo->streamInfo.pReq = NULL; + pInfo->tqReader->msg2 = (SPackedData){0}; + pInfo->tqReader->setMsg = 0; + pTaskInfo->streamInfo.submit = (SPackedData){0}; return NULL; } @@ -1658,13 +1687,6 @@ static void setBlockGroupIdByUid(SStreamScanInfo* pInfo, SSDataBlock* pBlock) { uint64_t groupId = getGroupIdByUid(pInfo, uidCol[i]); colDataAppend(pGpCol, i, (const char*)&groupId, false); } - } else { - // SSDataBlock* pPreRes = readPreVersionData(pInfo->pTableScanOp, uidCol[i], startTsCol, ts, maxVersion); - // if (!pPreRes || pPreRes->info.rows == 0) { - // return 0; - // } - // ASSERT(pPreRes->info.rows == 1); - // return calGroupIdByData(&pInfo->partitionSup, pInfo->pPartScalarSup, pPreRes, 0); } } @@ -1769,7 +1791,8 @@ FETCH_NEXT_BLOCK: } int32_t current = pInfo->validBlockIndex++; - SSDataBlock* pBlock = taosArrayGetP(pInfo->pBlockLists, current); + SPackedData* pPacked = taosArrayGet(pInfo->pBlockLists, current); + SSDataBlock* pBlock = pPacked->pDataBlock; if (pBlock->info.id.groupId && pBlock->info.parTbName[0]) { streamStatePutParName(pTaskInfo->streamInfo.pState, pBlock->info.id.groupId, pBlock->info.parTbName); } @@ -1898,7 +1921,7 @@ FETCH_NEXT_BLOCK: NEXT_SUBMIT_BLK: while (1) { - if (pInfo->tqReader->pMsg == NULL) { + if (pInfo->tqReader->msg2.msgStr == NULL) { if (pInfo->validBlockIndex >= totBlockNum) { updateInfoDestoryColseWinSBF(pInfo->pUpdateInfo); doClearBufferedBlocks(pInfo); @@ -1906,13 +1929,12 @@ FETCH_NEXT_BLOCK: return NULL; } - int32_t current = pInfo->validBlockIndex++; - SSubmitReq* pSubmit = taosArrayGetP(pInfo->pBlockLists, current); + int32_t current = pInfo->validBlockIndex++; + SPackedData* pSubmit = taosArrayGet(pInfo->pBlockLists, current); /*if (tqReaderSetDataMsg(pInfo->tqReader, pSubmit, 0) < 0) {*/ - if (tqReaderSetSubmitReq2(pInfo->tqReader, pSubmit, 0, 0) < 0) { + if (tqReaderSetSubmitReq2(pInfo->tqReader, pSubmit->msgStr, pSubmit->msgLen, pSubmit->ver) < 0) { qError("submit msg messed up when initing stream submit block %p, current %d, total %d", pSubmit, current, totBlockNum); - pInfo->tqReader->pMsg = NULL; continue; } } @@ -1963,7 +1985,6 @@ FETCH_NEXT_BLOCK: if (pBlockInfo->rows > 0 || pInfo->pUpdateDataRes->info.rows > 0) { break; } else { - pInfo->tqReader->pMsg = NULL; continue; } /*blockDataCleanup(pInfo->pRes);*/ @@ -2244,7 +2265,7 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys } } - pInfo->pBlockLists = taosArrayInit(4, POINTER_BYTES); + pInfo->pBlockLists = taosArrayInit(4, sizeof(SPackedData)); if (pInfo->pBlockLists == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; goto _error; @@ -2264,7 +2285,8 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys if (pHandle->initTableReader) { pTSInfo->scanMode = TABLE_SCAN__TABLE_ORDER; pTSInfo->base.dataReader = NULL; - code = tsdbReaderOpen(pHandle->vnode, &pTSInfo->base.cond, pList, num, pTSInfo->pResBlock, &pTSInfo->base.dataReader, NULL); + code = tsdbReaderOpen(pHandle->vnode, &pTSInfo->base.cond, pList, num, pTSInfo->pResBlock, + &pTSInfo->base.dataReader, NULL); if (code != 0) { terrno = code; destroyTableScanOperatorInfo(pTableScanOp); @@ -2334,7 +2356,8 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys pOperator->exprSupp.numOfExprs = taosArrayGetSize(pInfo->pRes->pDataBlock); __optr_fn_t nextFn = pTaskInfo->execModel == OPTR_EXEC_MODEL_STREAM ? doStreamScan : doQueueScan; - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, nextFn, NULL, destroyStreamScanOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = + createOperatorFpSet(optrDummyOpenFn, nextFn, NULL, destroyStreamScanOperatorInfo, optrDefaultBufFn, NULL); return pOperator; @@ -2471,7 +2494,8 @@ SOperatorInfo* createTagScanOperatorInfo(SReadHandle* pReadHandle, STagScanPhysi initResultSizeInfo(&pOperator->resultInfo, 4096); blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); - pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doTagScan, NULL, destroyTagScanOperatorInfo, optrDefaultBufFn, NULL); + pOperator->fpSet = + createOperatorFpSet(optrDummyOpenFn, doTagScan, NULL, destroyTagScanOperatorInfo, optrDefaultBufFn, NULL); return pOperator; @@ -2492,11 +2516,12 @@ static SSDataBlock* getTableDataBlockImpl(void* param) { SQueryTableDataCond* pQueryCond = taosArrayGet(pInfo->queryConds, readIdx); - int64_t st = taosGetTimestampUs(); - void* p = tableListGetInfo(pTaskInfo->pTableInfoList, readIdx + pInfo->tableStartIndex); + int64_t st = taosGetTimestampUs(); + void* p = tableListGetInfo(pTaskInfo->pTableInfoList, readIdx + pInfo->tableStartIndex); SReadHandle* pHandle = &pInfo->base.readHandle; - int32_t code = tsdbReaderOpen(pHandle->vnode, pQueryCond, p, 1, pBlock, &pInfo->base.dataReader, GET_TASKID(pTaskInfo)); + int32_t code = + tsdbReaderOpen(pHandle->vnode, pQueryCond, p, 1, pBlock, &pInfo->base.dataReader, GET_TASKID(pTaskInfo)); if (code != 0) { T_LONG_JMP(pTaskInfo->env, code); } @@ -2894,8 +2919,8 @@ static void buildVnodeGroupedNtbTableCount(STableCountScanOperatorInfo* SSDataBlock* pRes, char* dbName); static void buildVnodeFilteredTbCount(SOperatorInfo* pOperator, STableCountScanOperatorInfo* pInfo, STableCountScanSupp* pSupp, SSDataBlock* pRes, char* dbName); -static void buildVnodeGroupedTableCount(SOperatorInfo* pOperator, STableCountScanOperatorInfo* pInfo, - STableCountScanSupp* pSupp, SSDataBlock* pRes, int32_t vgId, char* dbName); +static void buildVnodeGroupedTableCount(SOperatorInfo* pOperator, STableCountScanOperatorInfo* pInfo, + STableCountScanSupp* pSupp, SSDataBlock* pRes, int32_t vgId, char* dbName); static SSDataBlock* buildVnodeDbTableCount(SOperatorInfo* pOperator, STableCountScanOperatorInfo* pInfo, STableCountScanSupp* pSupp, SSDataBlock* pRes); static void buildSysDbGroupedTableCount(SOperatorInfo* pOperator, STableCountScanOperatorInfo* pInfo, @@ -3020,8 +3045,8 @@ SOperatorInfo* createTableCountScanOperatorInfo(SReadHandle* readHandle, STableC setOperatorInfo(pOperator, "TableCountScanOperator", QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN, false, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = - createOperatorFpSet(optrDummyOpenFn, doTableCountScan, NULL, destoryTableCountScanOperator, optrDefaultBufFn, NULL); + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, doTableCountScan, NULL, destoryTableCountScanOperator, + optrDefaultBufFn, NULL); return pOperator; _error: @@ -3038,8 +3063,10 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* if (pSupp->dbNameSlotId != -1) { ASSERT(strlen(dbName)); SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->dbNameSlotId); - char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varDbName), dbName, strlen(dbName)); + + char varDbName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + tstrncpy(varDataVal(varDbName), dbName, TSDB_DB_NAME_LEN); + varDataSetLen(varDbName, strlen(dbName)); colDataAppend(colInfoData, 0, varDbName, false); } @@ -3048,7 +3075,7 @@ void fillTableCountScanDataBlock(STableCountScanSupp* pSupp, char* dbName, char* SColumnInfoData* colInfoData = taosArrayGet(pRes->pDataBlock, pSupp->stbNameSlotId); if (strlen(stbName) != 0) { char varStbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - strncpy(varDataVal(varStbName), stbName, strlen(stbName)); + strncpy(varDataVal(varStbName), stbName, TSDB_TABLE_NAME_LEN); varDataSetLen(varStbName, strlen(stbName)); colDataAppend(colInfoData, 0, varStbName, false); } else { diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 2374d80bbf..072a96fa83 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -95,6 +95,8 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo // TODO: optimize to ignore null values for linear interpolation. if (!pLinearInfo->isStartSet) { if (!colDataIsNull_s(pColInfoData, rowIndex)) { + ASSERT(IS_MATHABLE_TYPE(pColInfoData->info.type)); + pLinearInfo->start.key = *(int64_t*)colDataGetData(pTsCol, rowIndex); memcpy(pLinearInfo->start.val, colDataGetData(pColInfoData, rowIndex), pLinearInfo->bytes); } diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index d9a011a892..6f1ab8ca65 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -863,19 +863,20 @@ static void removeResults(SArray* pWins, SHashObj* pUpdatedMap) { int32_t compareWinRes(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; - SWinKey* pos = taosArrayGet(res, index); - SResKeyPos* pData = (SResKeyPos*)pKey; - if (*(int64_t*)pData->key == pos->ts) { - if (pData->groupId > pos->groupId) { - return 1; - } else if (pData->groupId < pos->groupId) { - return -1; - } - return 0; - } else if (*(int64_t*)pData->key > pos->ts) { + SWinKey* pDataPos = taosArrayGet(res, index); + SResKeyPos* pRKey = (SResKeyPos*)pKey; + if (pRKey->groupId > pDataPos->groupId) { return 1; + } else if (pRKey->groupId < pDataPos->groupId) { + return -1; } - return -1; + + if (*(int64_t*)pRKey->key > pDataPos->ts) { + return 1; + } else if (*(int64_t*)pRKey->key < pDataPos->ts){ + return -1; + } + return 0; } static void removeDeleteResults(SHashObj* pUpdatedMap, SArray* pDelWins) { @@ -1400,19 +1401,21 @@ static int32_t getAllIntervalWindow(SSHashObj* pHashMap, SHashObj* resWins) { int32_t compareWinKey(void* pKey, void* data, int32_t index) { SArray* res = (SArray*)data; - SWinKey* pos = taosArrayGet(res, index); - SWinKey* pData = (SWinKey*)pKey; - if (pData->ts == pos->ts) { - if (pData->groupId > pos->groupId) { - return 1; - } else if (pData->groupId < pos->groupId) { - return -1; - } - return 0; - } else if (pData->ts > pos->ts) { + SWinKey* pDataPos = taosArrayGet(res, index); + SWinKey* pWKey = (SWinKey*)pKey; + + if (pWKey->groupId > pDataPos->groupId) { return 1; + } else if (pWKey->groupId < pDataPos->groupId) { + return -1; } - return -1; + + if (pWKey->ts > pDataPos->ts) { + return 1; + } else if (pWKey->ts < pDataPos->ts) { + return -1; + } + return 0; } static int32_t closeStreamIntervalWindow(SSHashObj* pHashMap, STimeWindowAggSupp* pTwSup, SInterval* pInterval, diff --git a/source/libs/executor/src/tlinearhash.c b/source/libs/executor/src/tlinearhash.c index 4204692514..d97f81c994 100644 --- a/source/libs/executor/src/tlinearhash.c +++ b/source/libs/executor/src/tlinearhash.c @@ -17,6 +17,7 @@ #include "taoserror.h" #include "tdef.h" #include "tpagedbuf.h" +#include "tlog.h" #define LHASH_CAP_RATIO 0.85 diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index a9145ac69d..111da6d6ba 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -504,7 +504,7 @@ static int32_t getNumOfElems(SqlFunctionCtx* pCtx) { */ SInputColumnInfoData* pInput = &pCtx->input; SColumnInfoData* pInputCol = pInput->pData[0]; - if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows) { + if (pInput->colDataSMAIsSet && pInput->totalRows == pInput->numOfRows && !IS_VAR_DATA_TYPE(pInputCol->info.type)) { numOfElem = pInput->numOfRows - pInput->pColumnDataAgg[0]->numOfNull; ASSERT(numOfElem >= 0); } else { diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index e5727f1472..9c3e1f5604 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -22,6 +22,7 @@ #include "tpagedbuf.h" #include "tpercentile.h" #include "ttypes.h" +#include "tlog.h" #define DEFAULT_NUM_OF_SLOT 1024 @@ -367,11 +368,13 @@ int32_t tMemBucketPut(tMemBucket *pBucket, const void *data, size_t size) { pSlot->info.data = NULL; } - SArray *pPageIdList = (SArray *)taosHashGet(pBucket->groupPagesMap, &groupId, sizeof(groupId)); - if (pPageIdList == NULL) { - SArray *pList = taosArrayInit(4, sizeof(int32_t)); - taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pList, POINTER_BYTES); - pPageIdList = pList; + SArray *pPageIdList; + void *p = taosHashGet(pBucket->groupPagesMap, &groupId, sizeof(groupId)); + if (p == NULL) { + pPageIdList = taosArrayInit(4, sizeof(int32_t)); + taosHashPut(pBucket->groupPagesMap, &groupId, sizeof(groupId), &pPageIdList, POINTER_BYTES); + } else { + pPageIdList = *(SArray **)p; } pSlot->info.data = getNewBufPage(pBucket->pBuffer, &pageId); diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index c78ec5b999..32e57565d4 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -88,11 +88,13 @@ static int32_t udfSpawnUdfd(SUdfdData *pData) { } #ifdef WINDOWS if (strlen(path) == 0) { - strcat(path, "udfd.exe"); - } else { - strcat(path, "\\udfd.exe"); + strcat(path, "C:\\TDengine"); } + strcat(path, "\\udfd.exe"); #else + if (strlen(path) == 0) { + strcat(path, "/usr/bin"); + } strcat(path, "/udfd"); #endif char *argsUdfd[] = {path, "-c", configDir, NULL}; diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 5b3e8ce5a9..5d20dbd764 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -378,6 +378,7 @@ static int32_t logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { CLONE_NODE_FIELD(pTagIndexCond); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); + COPY_SCALAR_FIELD(deleteMark); COPY_SCALAR_FIELD(igExpired); CLONE_NODE_LIST_FIELD(pGroupTags); COPY_SCALAR_FIELD(groupSort); @@ -463,6 +464,7 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p CLONE_NODE_FIELD(pStateExpr); COPY_SCALAR_FIELD(triggerType); COPY_SCALAR_FIELD(watermark); + COPY_SCALAR_FIELD(deleteMark); COPY_SCALAR_FIELD(igExpired); COPY_SCALAR_FIELD(windowAlgo); COPY_SCALAR_FIELD(inputTsOrder); diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index 352e78c2fc..d062ed34c4 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -819,6 +819,7 @@ static const char* jkWindowLogicPlanTspk = "Tspk"; static const char* jkWindowLogicPlanStateExpr = "StateExpr"; static const char* jkWindowLogicPlanTriggerType = "TriggerType"; static const char* jkWindowLogicPlanWatermark = "Watermark"; +static const char* jkWindowLogicPlanDeleteMark = "DeleteMark"; static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { const SWindowLogicNode* pNode = (const SWindowLogicNode*)pObj; @@ -860,6 +861,9 @@ static int32_t logicWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowLogicPlanDeleteMark, pNode->deleteMark); + } return code; } @@ -904,6 +908,9 @@ static int32_t jsonToLogicWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowLogicPlanDeleteMark, &pNode->deleteMark); + } return code; } @@ -2004,6 +2011,7 @@ static const char* jkWindowPhysiPlanTsPk = "TsPk"; static const char* jkWindowPhysiPlanTsEnd = "TsEnd"; static const char* jkWindowPhysiPlanTriggerType = "TriggerType"; static const char* jkWindowPhysiPlanWatermark = "Watermark"; +static const char* jkWindowPhysiPlanDeleteMark = "DeleteMark"; static const char* jkWindowPhysiPlanIgnoreExpired = "IgnoreExpired"; static const char* jkWindowPhysiPlanInputTsOrder = "InputTsOrder"; static const char* jkWindowPhysiPlanOutputTsOrder = "outputTsOrder"; @@ -2031,6 +2039,9 @@ static int32_t physiWindowNodeToJson(const void* pObj, SJson* pJson) { if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanWatermark, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanDeleteMark, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddIntegerToObject(pJson, jkWindowPhysiPlanIgnoreExpired, pNode->igExpired); } @@ -2069,6 +2080,9 @@ static int32_t jsonToPhysiWindowNode(const SJson* pJson, void* pObj) { if (TSDB_CODE_SUCCESS == code) { code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanWatermark, &pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tjsonGetBigIntValue(pJson, jkWindowPhysiPlanDeleteMark, &pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tjsonGetTinyIntValue(pJson, jkWindowPhysiPlanIgnoreExpired, &pNode->igExpired); } @@ -3532,6 +3546,18 @@ static int32_t groupingSetNodeToJson(const void* pObj, SJson* pJson) { return code; } +static int32_t jsonToGroupingSetNode(const SJson* pJson, void* pObj) { + SGroupingSetNode* pNode = (SGroupingSetNode*)pObj; + + int32_t code = TSDB_CODE_SUCCESS; + tjsonGetNumberValue(pJson, jkGroupingSetType, pNode->groupingSetType, code); + if (TSDB_CODE_SUCCESS == code) { + code = jsonToNodeList(pJson, jkGroupingSetParameter, &pNode->pParameterList); + } + + return code; +} + static const char* jkOrderByExprExpr = "Expr"; static const char* jkOrderByExprOrder = "Order"; static const char* jkOrderByExprNullOrder = "NullOrder"; @@ -4729,6 +4755,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRealTableNode(pJson, pObj); case QUERY_NODE_TEMP_TABLE: return jsonToTempTableNode(pJson, pObj); + case QUERY_NODE_GROUPING_SET: + return jsonToGroupingSetNode(pJson, pObj); case QUERY_NODE_ORDER_BY_EXPR: return jsonToOrderByExprNode(pJson, pObj); case QUERY_NODE_LIMIT: diff --git a/source/libs/nodes/src/nodesMsgFuncs.c b/source/libs/nodes/src/nodesMsgFuncs.c index bf6cd33af7..cc9cb31d18 100644 --- a/source/libs/nodes/src/nodesMsgFuncs.c +++ b/source/libs/nodes/src/nodesMsgFuncs.c @@ -2607,6 +2607,7 @@ enum { PHY_WINDOW_CODE_TS_END, PHY_WINDOW_CODE_TRIGGER_TYPE, PHY_WINDOW_CODE_WATERMARK, + PHY_WINDOW_CODE_DELETE_MARK, PHY_WINDOW_CODE_IG_EXPIRED, PHY_WINDOW_CODE_INPUT_TS_ORDER, PHY_WINDOW_CODE_OUTPUT_TS_ORDER, @@ -2635,6 +2636,9 @@ static int32_t physiWindowNodeToMsg(const void* pObj, STlvEncoder* pEncoder) { if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_WATERMARK, pNode->watermark); } + if (TSDB_CODE_SUCCESS == code) { + code = tlvEncodeI64(pEncoder, PHY_WINDOW_CODE_DELETE_MARK, pNode->deleteMark); + } if (TSDB_CODE_SUCCESS == code) { code = tlvEncodeI8(pEncoder, PHY_WINDOW_CODE_IG_EXPIRED, pNode->igExpired); } @@ -2679,6 +2683,9 @@ static int32_t msgToPhysiWindowNode(STlvDecoder* pDecoder, void* pObj) { case PHY_WINDOW_CODE_WATERMARK: code = tlvDecodeI64(pTlv, &pNode->watermark); break; + case PHY_WINDOW_CODE_DELETE_MARK: + code = tlvDecodeI64(pTlv, &pNode->deleteMark); + break; case PHY_WINDOW_CODE_IG_EXPIRED: code = tlvDecodeI8(pTlv, &pNode->igExpired); break; diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index 36f0acf21c..0254ceddd0 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -596,6 +596,13 @@ static void destroyWinodwPhysiNode(SWinodwPhysiNode* pNode) { nodesDestroyNode(pNode->pTsEnd); } +static void destroyPartitionPhysiNode(SPartitionPhysiNode* pNode) { + destroyPhysiNode((SPhysiNode*)pNode); + nodesDestroyList(pNode->pExprs); + nodesDestroyList(pNode->pPartitionKeys); + nodesDestroyList(pNode->pTargets); +} + static void destroyScanPhysiNode(SScanPhysiNode* pNode) { destroyPhysiNode((SPhysiNode*)pNode); nodesDestroyList(pNode->pScanCols); @@ -733,6 +740,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pOptions->pWatermark); nodesDestroyList(pOptions->pRollupFuncs); nodesDestroyList(pOptions->pSma); + nodesDestroyList(pOptions->pDeleteMark); break; } case QUERY_NODE_INDEX_OPTIONS: { @@ -750,6 +758,7 @@ void nodesDestroyNode(SNode* pNode) { SStreamOptions* pOptions = (SStreamOptions*)pNode; nodesDestroyNode(pOptions->pDelay); nodesDestroyNode(pOptions->pWatermark); + nodesDestroyNode(pOptions->pDeleteMark); break; } case QUERY_NODE_LEFT_VALUE: // no pointer field @@ -906,6 +915,8 @@ void nodesDestroyNode(SNode* pNode) { SCreateStreamStmt* pStmt = (SCreateStreamStmt*)pNode; nodesDestroyNode((SNode*)pStmt->pOptions); nodesDestroyNode(pStmt->pQuery); + nodesDestroyList(pStmt->pTags); + nodesDestroyNode(pStmt->pSubtable); break; } case QUERY_NODE_DROP_STREAM_STMT: // no pointer field @@ -1021,6 +1032,8 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pLogicNode->pTagIndexCond); taosArrayDestroyEx(pLogicNode->pSmaIndexes, destroySmaIndex); nodesDestroyList(pLogicNode->pGroupTags); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_JOIN: { @@ -1093,6 +1106,8 @@ void nodesDestroyNode(SNode* pNode) { SPartitionLogicNode* pLogicNode = (SPartitionLogicNode*)pNode; destroyLogicNode((SLogicNode*)pLogicNode); nodesDestroyList(pLogicNode->pPartitionKeys); + nodesDestroyList(pLogicNode->pTags); + nodesDestroyNode(pLogicNode->pSubtable); break; } case QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC: { @@ -1123,10 +1138,10 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: - case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: destroyScanPhysiNode((SScanPhysiNode*)pNode); break; - case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: { + case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: + case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: { SLastRowScanPhysiNode* pPhyNode = (SLastRowScanPhysiNode*)pNode; destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pGroupTags); @@ -1140,6 +1155,8 @@ void nodesDestroyNode(SNode* pNode) { destroyScanPhysiNode((SScanPhysiNode*)pNode); nodesDestroyList(pPhyNode->pDynamicScanFuncs); nodesDestroyList(pPhyNode->pGroupTags); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_PROJECT: { @@ -1216,13 +1233,15 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyNode(pPhyNode->pStateKey); break; } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: + case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { + destroyPartitionPhysiNode((SPartitionPhysiNode*)pNode); + break; + } case QUERY_NODE_PHYSICAL_PLAN_STREAM_PARTITION: { - SPartitionPhysiNode* pPhyNode = (SPartitionPhysiNode*)pNode; - destroyPhysiNode((SPhysiNode*)pPhyNode); - nodesDestroyList(pPhyNode->pExprs); - nodesDestroyList(pPhyNode->pPartitionKeys); - nodesDestroyList(pPhyNode->pTargets); + SStreamPartitionPhysiNode* pPhyNode = (SStreamPartitionPhysiNode*)pNode; + destroyPartitionPhysiNode((SPartitionPhysiNode*)pPhyNode); + nodesDestroyList(pPhyNode->pTags); + nodesDestroyNode(pPhyNode->pSubtable); break; } case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: { diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index a6c56f3ae4..ef67c7536f 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -72,7 +72,8 @@ typedef enum ETableOptionType { TABLE_OPTION_WATERMARK, TABLE_OPTION_ROLLUP, TABLE_OPTION_TTL, - TABLE_OPTION_SMA + TABLE_OPTION_SMA, + TABLE_OPTION_DELETE_MARK } ETableOptionType; typedef struct SAlterOption { diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 6521161244..b060f7fc83 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -362,6 +362,7 @@ table_options(A) ::= table_options(B) WATERMARK duration_list(C). table_options(A) ::= table_options(B) ROLLUP NK_LP rollup_func_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_ROLLUP, C); } table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); } table_options(A) ::= table_options(B) SMA NK_LP col_name_list(C) NK_RP. { A = setTableOption(pCxt, B, TABLE_OPTION_SMA, C); } +table_options(A) ::= table_options(B) DELETE_MARK duration_list(C). { A = setTableOption(pCxt, B, TABLE_OPTION_DELETE_MARK, C); } alter_table_options(A) ::= alter_table_option(B). { A = createAlterTableOptions(pCxt); A = setTableOption(pCxt, A, B.type, &B.val); } alter_table_options(A) ::= alter_table_options(B) alter_table_option(C). { A = setTableOption(pCxt, B, C.type, &C.val); } @@ -475,8 +476,9 @@ func_list(A) ::= func_list(B) NK_COMMA func(C). func(A) ::= function_name(B) NK_LP expression_list(C) NK_RP. { A = createFunctionNode(pCxt, &B, C); } sma_stream_opt(A) ::= . { A = createStreamOptions(pCxt); } -sma_stream_opt(A) ::= stream_options(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } -sma_stream_opt(A) ::= stream_options(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) WATERMARK duration_literal(C). { ((SStreamOptions*)B)->pWatermark = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) MAX_DELAY duration_literal(C). { ((SStreamOptions*)B)->pDelay = releaseRawExprNode(pCxt, C); A = B; } +sma_stream_opt(A) ::= sma_stream_opt(B) DELETE_MARK duration_literal(C). { ((SStreamOptions*)B)->pDeleteMark = releaseRawExprNode(pCxt, C); A = B; } /************************************************ create/drop topic ***************************************************/ cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS query_or_subquery(C). { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, A, &B, C); } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 40fb422c49..b23adaabb5 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -1124,6 +1124,9 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType case TABLE_OPTION_SMA: ((STableOptions*)pOptions)->pSma = pVal; break; + case TABLE_OPTION_DELETE_MARK: + ((STableOptions*)pOptions)->pDeleteMark = pVal; + break; default: break; } diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index fa5fcacf06..6f8e08f06a 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -44,6 +44,7 @@ typedef struct SInsertParseContext { SBoundColInfo tags; // for stmt bool missCache; bool usingDuplicateTable; + bool forceUpdate; } SInsertParseContext; typedef int32_t (*_row_append_fn_t)(SMsgBuf* pMsgBuf, const void* value, int32_t len, void* param); @@ -798,6 +799,11 @@ static int32_t getTableVgroup(SParseContext* pCxt, SVnodeModifOpStmt* pStmt, boo } static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { + if (pCxt->forceUpdate) { + pCxt->missCache = true; + return TSDB_CODE_SUCCESS; + } + int32_t code = checkAuth(pCxt->pComCxt, &pStmt->targetTableName, &pCxt->missCache); if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableMeta(pCxt, &pStmt->targetTableName, false, &pStmt->pTableMeta, &pCxt->missCache); @@ -813,6 +819,11 @@ static int32_t preParseUsingTableName(SInsertParseContext* pCxt, SVnodeModifOpSt } static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt) { + if (pCxt->forceUpdate) { + pCxt->missCache = true; + return TSDB_CODE_SUCCESS; + } + int32_t code = checkAuth(pCxt->pComCxt, &pStmt->targetTableName, &pCxt->missCache); if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) { code = getTableMeta(pCxt, &pStmt->usingTableName, true, &pStmt->pTableMeta, &pCxt->missCache); @@ -1086,7 +1097,11 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, if (pToken->n + VARSTR_HEADER_SIZE > pSchema->bytes) { return generateSyntaxErrMsg(&pCxt->msg, TSDB_CODE_PAR_VALUE_TOO_LONG, pSchema->name); } - pVal->value.pData = pToken->z; + pVal->value.pData = taosMemoryMalloc(pToken->n); + if (NULL == pVal->value.pData) { + return TSDB_CODE_OUT_OF_MEMORY; + } + memcpy(pVal->value.pData, pToken->z, pToken->n); pVal->value.nData = pToken->n; break; } @@ -1113,7 +1128,11 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql, if (pToken->n > (TSDB_MAX_JSON_TAG_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) { return buildSyntaxErrMsg(&pCxt->msg, "json string too long than 4095", pToken->z); } - pVal->value.pData = pToken->z; + pVal->value.pData = taosMemoryMalloc(pToken->n); + if (NULL == pVal->value.pData) { + return TSDB_CODE_OUT_OF_MEMORY; + } + memcpy(pVal->value.pData, pToken->z, pToken->n); pVal->value.nData = pToken->n; break; } @@ -1157,7 +1176,7 @@ static void clearColValArray(SArray* pCols) { int32_t num = taosArrayGetSize(pCols); for (int32_t i = 0; i < num; ++i) { SColVal* pCol = taosArrayGet(pCols, i); - if (TSDB_DATA_TYPE_NCHAR == pCol->type) { + if (IS_VAR_DATA_TYPE(pCol->type)) { taosMemoryFreeClear(pCol->value.pData); } } @@ -1827,12 +1846,11 @@ static int32_t setNextStageInfo(SInsertParseContext* pCxt, SQuery* pQuery, SCata } int32_t parseInsertSql(SParseContext* pCxt, SQuery** pQuery, SCatalogReq* pCatalogReq, const SMetaData* pMetaData) { - SInsertParseContext context = { - .pComCxt = pCxt, - .msg = {.buf = pCxt->pMsg, .len = pCxt->msgLen}, - .missCache = false, - .usingDuplicateTable = false, - }; + SInsertParseContext context = {.pComCxt = pCxt, + .msg = {.buf = pCxt->pMsg, .len = pCxt->msgLen}, + .missCache = false, + .usingDuplicateTable = false, + .forceUpdate = (NULL != pCatalogReq ? pCatalogReq->forceUpdate : false)}; int32_t code = initInsertQuery(&context, pCatalogReq, pMetaData, pQuery); if (TSDB_CODE_SUCCESS == code) { diff --git a/source/libs/parser/src/parInsertUtil.c b/source/libs/parser/src/parInsertUtil.c index 2a9651f3c1..9507a546d7 100644 --- a/source/libs/parser/src/parInsertUtil.c +++ b/source/libs/parser/src/parInsertUtil.c @@ -1082,11 +1082,20 @@ static int32_t createTableDataCxt(STableMeta* pTableMeta, SVCreateTbReq** pCreat return code; } +static void resetColValues(SArray* pValues) { + int32_t num = taosArrayGetSize(pValues); + for (int32_t i = 0; i < num; ++i) { + SColVal* pVal = taosArrayGet(pValues, i); + pVal->flag = CV_FLAG_NONE; + } +} + int32_t insGetTableDataCxt(SHashObj* pHash, void* id, int32_t idLen, STableMeta* pTableMeta, SVCreateTbReq** pCreateTbReq, STableDataCxt** pTableCxt, bool colMode) { STableDataCxt** tmp = (STableDataCxt**)taosHashGet(pHash, id, idLen); if (NULL != tmp) { *pTableCxt = *tmp; + resetColValues((*pTableCxt)->pValues); return TSDB_CODE_SUCCESS; } int32_t code = createTableDataCxt(pTableMeta, pCreateTbReq, pTableCxt, colMode); diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 7123173161..e62b2f0f5a 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -74,6 +74,7 @@ static SKeyword keywordTable[] = { {"DATABASES", TK_DATABASES}, {"DBS", TK_DBS}, {"DELETE", TK_DELETE}, + {"DELETE_MARK", TK_DELETE_MARK}, {"DESC", TK_DESC}, {"DESCRIBE", TK_DESCRIBE}, {"DISTINCT", TK_DISTINCT}, diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 049d18e20a..10e45901e5 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -3804,10 +3804,11 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } -static int32_t checkRangeOption(STranslateContext* pCxt, int32_t code, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +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)) { - return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, "Invalid option %s: %d valid range: [%d, %d]", pName, val, + return generateSyntaxErrMsgExt(&pCxt->msgBuf, code, + "Invalid option %s: %" PRId64 " valid range: [%" PRId64 ", %" PRId64 "]", pName, val, minVal, maxVal); } return TSDB_CODE_SUCCESS; @@ -3818,8 +3819,8 @@ static int32_t checkDbRangeOption(STranslateContext* pCxt, const char* pName, in return checkRangeOption(pCxt, TSDB_CODE_PAR_INVALID_DB_OPTION, pName, val, minVal, maxVal); } -static int32_t checkTableRangeOption(STranslateContext* pCxt, const char* pName, int32_t val, int32_t minVal, - int32_t maxVal) { +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); } @@ -3878,12 +3879,17 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt pOptions->keep[2] = getBigintFromValueNode((SValueNode*)nodesListGetNode(pOptions->pKeep, 2)); } + int64_t tsdbMaxKeep = TSDB_MAX_KEEP; + if (pOptions->precision == TSDB_TIME_PRECISION_NANO) { + tsdbMaxKeep = TSDB_MAX_KEEP_NS; + } + if (pOptions->keep[0] < TSDB_MIN_KEEP || pOptions->keep[1] < TSDB_MIN_KEEP || pOptions->keep[2] < TSDB_MIN_KEEP || - pOptions->keep[0] > TSDB_MAX_KEEP || pOptions->keep[1] > TSDB_MAX_KEEP || pOptions->keep[2] > TSDB_MAX_KEEP) { + pOptions->keep[0] > tsdbMaxKeep || pOptions->keep[1] > tsdbMaxKeep || pOptions->keep[2] > tsdbMaxKeep) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option keep: %" PRId64 ", %" PRId64 ", %" PRId64 " valid range: [%dm, %dm]", pOptions->keep[0], pOptions->keep[1], pOptions->keep[2], TSDB_MIN_KEEP, - TSDB_MAX_KEEP); + tsdbMaxKeep); } if (!((pOptions->keep[0] <= pOptions->keep[1]) && (pOptions->keep[1] <= pOptions->keep[2]))) { @@ -4035,7 +4041,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName TSDB_MAX_MINROWS_FBLOCK); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbKeepOption(pCxt, pOptions); + code = checkDbPrecisionOption(pCxt, pOptions); + } + if (TSDB_CODE_SUCCESS == code) { + code = checkDbKeepOption(pCxt, pOptions); // use precision } if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "pages", pOptions->pages, TSDB_MIN_PAGES_PER_VNODE, TSDB_MAX_PAGES_PER_VNODE); @@ -4048,9 +4057,6 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName code = checkDbRangeOption(pCxt, "tsdbPagesize", pOptions->tsdbPageSize, TSDB_MIN_TSDB_PAGESIZE, TSDB_MAX_TSDB_PAGESIZE); } - if (TSDB_CODE_SUCCESS == code) { - code = checkDbPrecisionOption(pCxt, pOptions); - } if (TSDB_CODE_SUCCESS == code) { code = checkDbEnumOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); } @@ -4463,6 +4469,37 @@ static int32_t checkTableWatermarkOption(STranslateContext* pCxt, STableOptions* return code; } +static int32_t getTableDeleteMarkOption(STranslateContext* pCxt, SValueNode* pVal, int64_t* pMaxDelay) { + return getTableDelayOrWatermarkOption(pCxt, "delete_mark", TSDB_MIN_ROLLUP_DELETE_MARK, TSDB_MAX_ROLLUP_DELETE_MARK, + pVal, pMaxDelay); +} + +static int32_t checkTableDeleteMarkOption(STranslateContext* pCxt, STableOptions* pOptions, bool createStable, + SDbCfgInfo* pDbCfg) { + if (NULL == pOptions->pDeleteMark) { + return TSDB_CODE_SUCCESS; + } + + if (!createStable || NULL == pDbCfg->pRetensions) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, + "Invalid option delete_mark: Only supported for create super table in databases " + "configured with the 'RETENTIONS' option"); + } + + if (LIST_LENGTH(pOptions->pDeleteMark) > 2) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TABLE_OPTION, "Invalid option delete_mark"); + } + + int32_t code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 0), &pOptions->deleteMark1); + if (TSDB_CODE_SUCCESS == code && 2 == LIST_LENGTH(pOptions->pDeleteMark)) { + code = + getTableDeleteMarkOption(pCxt, (SValueNode*)nodesListGetNode(pOptions->pDeleteMark, 1), &pOptions->deleteMark2); + } + + return code; +} + static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt, bool createStable) { if (NULL != strchr(pStmt->tableName, '.')) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, @@ -4482,6 +4519,9 @@ static int32_t checkCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt if (TSDB_CODE_SUCCESS == code) { code = checkTableWatermarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); } + if (TSDB_CODE_SUCCESS == code) { + code = checkTableDeleteMarkOption(pCxt, pStmt->pOptions, createStable, &dbCfg); + } if (TSDB_CODE_SUCCESS == code) { code = checkTableRollupOption(pCxt, pStmt->pOptions->pRollupFuncs, createStable, &dbCfg); } @@ -4749,6 +4789,8 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm pReq->delay2 = pStmt->pOptions->maxDelay2; pReq->watermark1 = pStmt->pOptions->watermark1; pReq->watermark2 = pStmt->pOptions->watermark2; + pReq->deleteMark1 = pStmt->pOptions->deleteMark1; + pReq->deleteMark2 = pStmt->pOptions->deleteMark2; pReq->colVer = 1; pReq->tagVer = 1; pReq->source = TD_REQ_FROM_APP; @@ -5144,20 +5186,34 @@ static int32_t buildCreateSmaReq(STranslateContext* pCxt, SCreateIndexStmt* pStm (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->datum.i : pReq->interval); pReq->slidingUnit = (NULL != pStmt->pOptions->pSliding ? ((SValueNode*)pStmt->pOptions->pSliding)->unit : pReq->intervalUnit); + + int32_t code = TSDB_CODE_SUCCESS; if (NULL != pStmt->pOptions->pStreamOptions) { SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - pReq->maxDelay = (NULL != pStreamOpt->pDelay ? ((SValueNode*)pStreamOpt->pDelay)->datum.i : -1); - pReq->watermark = (NULL != pStreamOpt->pWatermark ? ((SValueNode*)pStreamOpt->pWatermark)->datum.i - : TSDB_DEFAULT_ROLLUP_WATERMARK); - if (pReq->watermark < TSDB_MIN_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MIN_ROLLUP_WATERMARK; + if (NULL != pStreamOpt->pDelay) { + code = getTableMaxDelayOption(pCxt, (SValueNode*)pStreamOpt->pDelay, &pReq->maxDelay); + } else { + pReq->maxDelay = -1; } - if (pReq->watermark > TSDB_MAX_ROLLUP_WATERMARK) { - pReq->watermark = TSDB_MAX_ROLLUP_WATERMARK; + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pWatermark) { + code = getTableWatermarkOption(pCxt, (SValueNode*)pStreamOpt->pWatermark, &pReq->watermark); + } else { + pReq->watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + } + } + if (TSDB_CODE_SUCCESS == code) { + if (NULL != pStreamOpt->pDeleteMark) { + code = getTableDeleteMarkOption(pCxt, (SValueNode*)pStreamOpt->pDeleteMark, &pReq->deleteMark); + } else { + pReq->deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + } } } - int32_t code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + if (TSDB_CODE_SUCCESS == code) { + code = getSmaIndexDstVgId(pCxt, pStmt->dbName, pStmt->tableName, &pReq->dstVgId); + } if (TSDB_CODE_SUCCESS == code) { code = getSmaIndexSql(pCxt, &pReq->sql, &pReq->sqlLen); } @@ -5185,16 +5241,6 @@ static int32_t checkCreateSmaIndex(STranslateContext* pCxt, SCreateIndexStmt* pS code = doTranslateValue(pCxt, (SValueNode*)pStmt->pOptions->pSliding); } - if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pOptions->pStreamOptions) { - SStreamOptions* pStreamOpt = (SStreamOptions*)pStmt->pOptions->pStreamOptions; - if (NULL != pStreamOpt->pWatermark) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pWatermark); - } - if (TSDB_CODE_SUCCESS == code && NULL != pStreamOpt->pDelay) { - code = doTranslateValue(pCxt, (SValueNode*)pStreamOpt->pDelay); - } - } - return code; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 616793e897..b4d4a3457e 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 456 +#define YYNOCODE 457 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOrder yy50; - int64_t yy93; - SNode* yy104; - bool yy185; - int32_t yy196; - EJoinType yy228; - EFillMode yy246; - SAlterOption yy557; - SNodeList* yy616; - SDataType yy640; - EOperatorType yy668; - int8_t yy695; - SToken yy737; - ENullOrder yy793; + EOperatorType yy20; + int8_t yy33; + SAlterOption yy123; + SNode* yy148; + SToken yy199; + EFillMode yy334; + bool yy397; + SNodeList* yy404; + EJoinType yy470; + ENullOrder yy499; + int64_t yy525; + SDataType yy530; + int32_t yy706; + EOrder yy898; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 707 -#define YYNRULE 538 -#define YYNTOKEN 321 -#define YY_MAX_SHIFT 706 -#define YY_MIN_SHIFTREDUCE 1049 -#define YY_MAX_SHIFTREDUCE 1586 -#define YY_ERROR_ACTION 1587 -#define YY_ACCEPT_ACTION 1588 -#define YY_NO_ACTION 1589 -#define YY_MIN_REDUCE 1590 -#define YY_MAX_REDUCE 2127 +#define YYNSTATE 710 +#define YYNRULE 540 +#define YYNTOKEN 322 +#define YY_MAX_SHIFT 709 +#define YY_MIN_SHIFTREDUCE 1052 +#define YY_MAX_SHIFTREDUCE 1591 +#define YY_ERROR_ACTION 1592 +#define YY_ACCEPT_ACTION 1593 +#define YY_NO_ACTION 1594 +#define YY_MIN_REDUCE 1595 +#define YY_MAX_REDUCE 2134 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,703 +216,694 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2544) +#define YY_ACTTAB_COUNT (2410) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 396, 2103, 349, 1858, 455, 2098, 456, 1626, 33, 274, - /* 10 */ 156, 578, 43, 41, 1517, 464, 168, 456, 1626, 1747, - /* 20 */ 357, 2102, 1368, 36, 35, 2099, 2101, 42, 40, 39, - /* 30 */ 38, 37, 595, 1447, 158, 1366, 1943, 329, 1844, 1698, - /* 40 */ 524, 540, 36, 35, 579, 2098, 42, 40, 39, 38, - /* 50 */ 37, 1394, 540, 522, 348, 520, 2098, 1855, 1442, 25, - /* 60 */ 2104, 174, 370, 16, 156, 2099, 561, 1961, 1791, 1792, - /* 70 */ 1374, 2104, 174, 1748, 2103, 575, 2099, 561, 2098, 572, - /* 80 */ 1912, 595, 612, 43, 41, 42, 40, 39, 38, 37, - /* 90 */ 159, 357, 1602, 1368, 2102, 1797, 12, 322, 2099, 2100, - /* 100 */ 11, 10, 350, 540, 1447, 1942, 1366, 2098, 62, 1977, - /* 110 */ 131, 1795, 100, 1944, 616, 1946, 1947, 611, 703, 606, - /* 120 */ 258, 603, 2104, 174, 171, 212, 2030, 2099, 561, 1442, - /* 130 */ 351, 2026, 1449, 1450, 16, 39, 38, 37, 473, 1476, - /* 140 */ 163, 1374, 2045, 402, 176, 1930, 490, 486, 482, 478, - /* 150 */ 209, 362, 2056, 80, 1790, 1792, 1926, 46, 58, 1797, - /* 160 */ 85, 1423, 1432, 1252, 1253, 1797, 326, 12, 2042, 255, - /* 170 */ 2038, 571, 361, 124, 570, 1795, 1741, 2098, 1393, 226, - /* 180 */ 1369, 1795, 1367, 317, 1922, 1928, 340, 81, 555, 703, - /* 190 */ 207, 1840, 559, 174, 1477, 606, 1490, 2099, 561, 1613, - /* 200 */ 58, 461, 182, 1449, 1450, 1372, 1373, 457, 1422, 1425, - /* 210 */ 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, - /* 220 */ 1443, 1444, 1445, 1446, 1448, 1451, 2, 510, 509, 508, - /* 230 */ 560, 595, 1423, 1432, 2098, 128, 504, 1395, 82, 319, - /* 240 */ 503, 502, 585, 1912, 583, 1588, 501, 507, 1514, 559, - /* 250 */ 174, 1369, 500, 1367, 2099, 561, 206, 200, 1612, 205, - /* 260 */ 438, 550, 469, 1468, 1543, 32, 355, 1471, 1472, 1473, - /* 270 */ 1474, 1475, 1479, 1480, 1481, 1482, 1372, 1373, 198, 1422, - /* 280 */ 1425, 1426, 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, - /* 290 */ 1441, 1443, 1444, 1445, 1446, 1448, 1451, 2, 170, 9, - /* 300 */ 43, 41, 1912, 506, 505, 177, 177, 46, 357, 372, - /* 310 */ 1368, 1784, 547, 1541, 1542, 1544, 1545, 190, 189, 1305, - /* 320 */ 1306, 1447, 1943, 1366, 1210, 638, 637, 636, 1214, 635, - /* 330 */ 1216, 1217, 634, 1219, 631, 1393, 1225, 628, 1227, 1228, - /* 340 */ 625, 622, 391, 97, 556, 551, 1442, 1101, 177, 1100, - /* 350 */ 540, 16, 454, 1961, 2098, 459, 1632, 132, 1374, 674, - /* 360 */ 672, 613, 211, 393, 389, 1737, 1912, 567, 612, 2104, - /* 370 */ 174, 43, 41, 1452, 2099, 561, 29, 1961, 1102, 357, - /* 380 */ 257, 1368, 36, 35, 12, 554, 42, 40, 39, 38, - /* 390 */ 37, 1942, 1447, 463, 1366, 1977, 459, 1632, 160, 1944, - /* 400 */ 616, 1946, 1947, 611, 596, 606, 703, 1943, 36, 35, - /* 410 */ 2045, 58, 42, 40, 39, 38, 37, 1442, 123, 264, - /* 420 */ 1449, 1450, 647, 50, 553, 494, 36, 35, 539, 1374, - /* 430 */ 42, 40, 39, 38, 37, 1745, 2041, 1170, 1961, 541, - /* 440 */ 2067, 147, 146, 644, 643, 642, 613, 91, 579, 1423, - /* 450 */ 1432, 1912, 58, 612, 560, 44, 2050, 1510, 2098, 36, - /* 460 */ 35, 1856, 1394, 42, 40, 39, 38, 37, 1369, 1738, - /* 470 */ 1367, 1396, 1172, 559, 174, 1611, 1942, 703, 2099, 561, - /* 480 */ 1977, 1345, 1346, 161, 1944, 616, 1946, 1947, 611, 1513, - /* 490 */ 606, 1449, 1450, 1372, 1373, 47, 1422, 1425, 1426, 1427, - /* 500 */ 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, 1444, - /* 510 */ 1445, 1446, 1448, 1451, 2, 1553, 1082, 1610, 1609, 1912, - /* 520 */ 1423, 1432, 1591, 113, 1087, 1088, 112, 111, 110, 109, - /* 530 */ 108, 107, 106, 105, 104, 562, 2119, 265, 266, 1369, - /* 540 */ 9, 1367, 7, 113, 1722, 1608, 112, 111, 110, 109, - /* 550 */ 108, 107, 106, 105, 104, 1084, 1393, 1087, 1088, 177, - /* 560 */ 649, 1912, 1912, 155, 1372, 1373, 1478, 1422, 1425, 1426, - /* 570 */ 1427, 1428, 1429, 1430, 1431, 608, 604, 1440, 1441, 1443, - /* 580 */ 1444, 1445, 1446, 1448, 1451, 2, 43, 41, 568, 1912, - /* 590 */ 706, 515, 1392, 1101, 357, 1100, 1368, 1840, 319, 596, - /* 600 */ 177, 585, 596, 583, 281, 1521, 525, 1447, 184, 1366, - /* 610 */ 1943, 1393, 58, 52, 235, 641, 123, 596, 1607, 167, - /* 620 */ 225, 9, 572, 499, 1102, 696, 692, 688, 684, 279, - /* 630 */ 1745, 179, 1442, 1745, 360, 518, 80, 30, 168, 1374, - /* 640 */ 512, 1961, 156, 177, 1374, 224, 661, 1483, 1745, 613, - /* 650 */ 127, 1747, 647, 131, 1912, 1659, 612, 43, 41, 1740, - /* 660 */ 1845, 1723, 1912, 596, 1606, 357, 98, 1368, 1721, 272, - /* 670 */ 44, 147, 146, 644, 643, 642, 1734, 400, 1447, 1942, - /* 680 */ 1366, 1605, 64, 1977, 1730, 63, 100, 1944, 616, 1946, - /* 690 */ 1947, 611, 703, 606, 1745, 395, 134, 394, 143, 2001, - /* 700 */ 2030, 363, 592, 1442, 351, 2026, 1449, 1450, 1912, 156, - /* 710 */ 535, 574, 172, 2038, 2039, 1374, 129, 2043, 1747, 1732, - /* 720 */ 510, 509, 508, 473, 186, 1912, 1457, 572, 128, 504, - /* 730 */ 649, 1604, 1393, 503, 502, 1423, 1432, 1601, 260, 501, - /* 740 */ 507, 12, 1590, 36, 35, 500, 1396, 42, 40, 39, - /* 750 */ 38, 37, 1424, 1396, 1369, 1339, 1367, 229, 131, 227, - /* 760 */ 177, 77, 1775, 703, 76, 1736, 122, 121, 120, 119, - /* 770 */ 118, 117, 116, 115, 114, 1912, 1926, 1449, 1450, 1372, - /* 780 */ 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, 1431, - /* 790 */ 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, 1451, - /* 800 */ 2, 316, 498, 1391, 1922, 1928, 1423, 1432, 1600, 1840, - /* 810 */ 432, 2045, 598, 445, 2002, 606, 444, 173, 2038, 2039, - /* 820 */ 188, 129, 2043, 1797, 497, 1369, 1656, 1367, 1599, 1899, - /* 830 */ 1598, 416, 1533, 446, 31, 133, 418, 2040, 2001, 1796, - /* 840 */ 36, 35, 1597, 1596, 42, 40, 39, 38, 37, 1728, - /* 850 */ 1372, 1373, 1912, 1422, 1425, 1426, 1427, 1428, 1429, 1430, - /* 860 */ 1431, 608, 604, 1440, 1441, 1443, 1444, 1445, 1446, 1448, - /* 870 */ 1451, 2, 1912, 1424, 1912, 36, 35, 379, 330, 42, - /* 880 */ 40, 39, 38, 37, 1393, 645, 1912, 1912, 1788, 183, - /* 890 */ 406, 680, 679, 678, 677, 367, 234, 676, 675, 135, - /* 900 */ 670, 669, 668, 667, 666, 665, 664, 663, 149, 659, - /* 910 */ 658, 657, 366, 365, 654, 653, 652, 651, 650, 442, - /* 920 */ 1595, 1943, 437, 436, 435, 434, 431, 430, 429, 428, - /* 930 */ 427, 423, 422, 421, 420, 331, 413, 412, 411, 2102, - /* 940 */ 408, 407, 328, 157, 600, 596, 2002, 596, 292, 36, - /* 950 */ 35, 564, 1961, 42, 40, 39, 38, 37, 596, 401, - /* 960 */ 575, 410, 290, 66, 1912, 1912, 65, 612, 1854, 369, - /* 970 */ 312, 2103, 424, 145, 1943, 1594, 1745, 1853, 1745, 312, - /* 980 */ 1593, 596, 11, 10, 194, 451, 449, 1720, 1395, 1745, - /* 990 */ 1942, 572, 596, 646, 1977, 425, 1788, 100, 1944, 616, - /* 1000 */ 1946, 1947, 611, 6, 606, 1961, 139, 1827, 230, 171, - /* 1010 */ 540, 2030, 1745, 613, 2098, 351, 2026, 1699, 1912, 1912, - /* 1020 */ 612, 58, 131, 1745, 1912, 1424, 51, 596, 286, 2104, - /* 1030 */ 174, 1775, 596, 217, 2099, 561, 215, 2057, 1931, 1583, - /* 1040 */ 607, 471, 596, 1942, 233, 219, 472, 1977, 218, 1926, - /* 1050 */ 100, 1944, 616, 1946, 1947, 611, 364, 606, 1745, 99, - /* 1060 */ 596, 1943, 2118, 1745, 2030, 1576, 354, 353, 351, 2026, - /* 1070 */ 662, 640, 1715, 1745, 1742, 1377, 1382, 1922, 1928, 2064, - /* 1080 */ 596, 175, 2038, 2039, 83, 129, 2043, 1447, 606, 1375, - /* 1090 */ 1603, 1745, 1961, 403, 536, 647, 67, 74, 73, 399, - /* 1100 */ 613, 48, 181, 3, 1943, 1912, 404, 612, 137, 2070, - /* 1110 */ 125, 1745, 1442, 548, 147, 146, 644, 643, 642, 1376, - /* 1120 */ 315, 1930, 596, 387, 1374, 385, 381, 377, 374, 371, - /* 1130 */ 1942, 257, 1926, 1582, 1977, 1961, 576, 100, 1944, 616, - /* 1140 */ 1946, 1947, 611, 613, 606, 75, 1646, 96, 1912, 2118, - /* 1150 */ 612, 2030, 252, 1745, 1639, 351, 2026, 93, 419, 210, - /* 1160 */ 1922, 1928, 352, 528, 221, 596, 2092, 220, 511, 177, - /* 1170 */ 565, 606, 602, 1942, 596, 1943, 513, 1977, 60, 269, - /* 1180 */ 100, 1944, 616, 1946, 1947, 611, 596, 606, 591, 596, - /* 1190 */ 1637, 1933, 2118, 246, 2030, 1962, 1745, 563, 351, 2026, - /* 1200 */ 593, 596, 368, 594, 540, 1745, 1961, 1510, 2098, 2049, - /* 1210 */ 1585, 1586, 516, 223, 613, 275, 222, 1745, 1943, 1912, - /* 1220 */ 1745, 612, 1380, 2104, 174, 239, 45, 262, 2099, 561, - /* 1230 */ 140, 1540, 1745, 144, 1383, 145, 1378, 60, 1849, 1627, - /* 1240 */ 1935, 1785, 573, 2060, 1942, 254, 1130, 251, 1977, 1961, - /* 1250 */ 45, 100, 1944, 616, 1946, 1947, 611, 613, 606, 1386, - /* 1260 */ 1388, 1943, 1912, 2005, 612, 2030, 1379, 45, 620, 351, - /* 1270 */ 2026, 604, 1440, 1441, 1443, 1444, 1445, 1446, 241, 1316, - /* 1280 */ 267, 1131, 4, 588, 1633, 1943, 271, 1942, 1203, 655, - /* 1290 */ 1484, 1977, 1961, 144, 100, 1944, 616, 1946, 1947, 611, - /* 1300 */ 613, 606, 1, 1433, 145, 1912, 2003, 612, 2030, 373, - /* 1310 */ 378, 1150, 351, 2026, 656, 327, 1961, 126, 144, 1368, - /* 1320 */ 285, 1231, 282, 1332, 613, 187, 405, 1396, 1850, 1912, - /* 1330 */ 1942, 612, 1366, 698, 1977, 334, 1148, 100, 1944, 616, - /* 1340 */ 1946, 1947, 611, 1943, 606, 409, 1235, 440, 414, 599, - /* 1350 */ 1391, 2030, 426, 1842, 1942, 351, 2026, 1242, 1977, 433, - /* 1360 */ 447, 101, 1944, 616, 1946, 1947, 611, 1374, 606, 439, - /* 1370 */ 1240, 148, 441, 448, 1961, 2030, 191, 450, 452, 2029, - /* 1380 */ 2026, 1397, 613, 453, 462, 1399, 1943, 1912, 465, 612, - /* 1390 */ 197, 199, 466, 1398, 467, 1400, 468, 335, 202, 333, - /* 1400 */ 332, 470, 496, 204, 474, 78, 498, 79, 208, 1104, - /* 1410 */ 491, 492, 1942, 493, 1943, 703, 1977, 1961, 495, 101, - /* 1420 */ 1944, 616, 1946, 1947, 611, 613, 606, 102, 497, 1735, - /* 1430 */ 1912, 318, 612, 2030, 214, 1731, 216, 601, 2026, 527, - /* 1440 */ 150, 151, 529, 1733, 1729, 1961, 152, 153, 228, 530, - /* 1450 */ 1889, 231, 537, 610, 549, 614, 582, 5, 1912, 1977, - /* 1460 */ 612, 2061, 101, 1944, 616, 1946, 1947, 611, 283, 606, - /* 1470 */ 534, 2071, 544, 1943, 2076, 546, 2030, 1369, 237, 1367, - /* 1480 */ 321, 2026, 240, 1942, 531, 2075, 341, 1977, 558, 552, - /* 1490 */ 307, 1944, 616, 1946, 1947, 611, 609, 606, 597, 1995, - /* 1500 */ 545, 543, 1372, 1373, 1961, 542, 250, 569, 342, 566, - /* 1510 */ 2121, 245, 613, 1510, 130, 1395, 2046, 1912, 345, 612, - /* 1520 */ 577, 141, 142, 580, 581, 1888, 1860, 586, 259, 347, - /* 1530 */ 88, 1943, 589, 248, 164, 2052, 249, 247, 1746, 590, - /* 1540 */ 90, 57, 1942, 2011, 92, 1789, 1977, 284, 1716, 101, - /* 1550 */ 1944, 616, 1946, 1947, 611, 2097, 606, 253, 287, 1943, - /* 1560 */ 618, 278, 1961, 2030, 699, 700, 49, 301, 2027, 310, - /* 1570 */ 613, 309, 702, 289, 291, 1912, 1906, 612, 1905, 311, - /* 1580 */ 71, 1904, 1903, 72, 1900, 1943, 375, 376, 1360, 1361, - /* 1590 */ 1961, 180, 1898, 380, 382, 383, 384, 1897, 613, 386, - /* 1600 */ 1942, 1896, 388, 1912, 1977, 612, 1895, 160, 1944, 616, - /* 1610 */ 1946, 1947, 611, 1894, 606, 390, 1961, 1335, 392, 1334, - /* 1620 */ 1871, 1870, 397, 1869, 613, 398, 1868, 1296, 1942, 1912, - /* 1630 */ 1835, 612, 1977, 1834, 1832, 300, 1944, 616, 1946, 1947, - /* 1640 */ 611, 136, 606, 1831, 1830, 1833, 1829, 1828, 1826, 2068, - /* 1650 */ 1825, 1824, 185, 415, 1942, 1943, 1823, 417, 1977, 1822, - /* 1660 */ 1821, 161, 1944, 616, 1946, 1947, 611, 1820, 606, 1819, - /* 1670 */ 1818, 1817, 1816, 1815, 1943, 1298, 1802, 138, 1807, 557, - /* 1680 */ 1814, 1813, 1812, 1811, 1810, 1809, 1961, 1808, 1806, 1805, - /* 1690 */ 1804, 346, 443, 1799, 613, 1803, 1801, 1800, 1798, 1912, - /* 1700 */ 1178, 612, 1661, 1660, 1658, 1961, 1622, 192, 195, 1932, - /* 1710 */ 193, 458, 169, 610, 2120, 1090, 69, 1621, 1912, 1089, - /* 1720 */ 612, 460, 1884, 1878, 1942, 1867, 196, 1866, 1977, 203, - /* 1730 */ 70, 308, 1944, 616, 1946, 1947, 611, 1943, 606, 201, - /* 1740 */ 1852, 1724, 1657, 1942, 1655, 475, 477, 1977, 1653, 479, - /* 1750 */ 307, 1944, 616, 1946, 1947, 611, 476, 606, 1943, 1996, - /* 1760 */ 480, 1651, 1649, 1123, 483, 481, 484, 485, 1961, 487, - /* 1770 */ 489, 1636, 488, 356, 1635, 1618, 613, 1726, 1246, 1245, - /* 1780 */ 1943, 1912, 1725, 612, 59, 1169, 1168, 1167, 1166, 1961, - /* 1790 */ 1165, 671, 1160, 673, 358, 1162, 1647, 613, 1161, 1159, - /* 1800 */ 336, 1943, 1912, 1640, 612, 337, 1942, 1638, 514, 338, - /* 1810 */ 1977, 1961, 213, 308, 1944, 616, 1946, 1947, 611, 613, - /* 1820 */ 606, 517, 1617, 1943, 1912, 519, 612, 1942, 1616, 521, - /* 1830 */ 1615, 1977, 1961, 523, 308, 1944, 616, 1946, 1947, 611, - /* 1840 */ 613, 606, 1352, 103, 1943, 1912, 1883, 612, 24, 526, - /* 1850 */ 1341, 1877, 1865, 1977, 1961, 532, 303, 1944, 616, 1946, - /* 1860 */ 1947, 611, 613, 606, 1863, 17, 2103, 1912, 26, 612, - /* 1870 */ 1942, 56, 14, 1555, 1977, 1961, 53, 293, 1944, 616, - /* 1880 */ 1946, 1947, 611, 613, 606, 232, 238, 1943, 1912, 236, - /* 1890 */ 612, 162, 1942, 533, 154, 339, 1977, 1539, 1532, 294, - /* 1900 */ 1944, 616, 1946, 1947, 611, 538, 606, 244, 242, 27, - /* 1910 */ 243, 28, 1933, 1942, 84, 1943, 61, 1977, 1961, 19, - /* 1920 */ 295, 1944, 616, 1946, 1947, 611, 613, 606, 1575, 1576, - /* 1930 */ 1570, 1912, 1569, 612, 343, 1574, 1573, 344, 1507, 1506, - /* 1940 */ 256, 1943, 18, 165, 1864, 1862, 1961, 55, 1861, 20, - /* 1950 */ 1350, 261, 1537, 263, 613, 1349, 1942, 54, 584, 1912, - /* 1960 */ 1977, 612, 1859, 299, 1944, 616, 1946, 1947, 611, 15, - /* 1970 */ 606, 587, 1961, 268, 86, 1851, 87, 89, 270, 93, - /* 1980 */ 613, 273, 21, 1459, 1942, 1912, 10, 612, 1977, 1384, - /* 1990 */ 1469, 304, 1944, 616, 1946, 1947, 611, 8, 606, 1943, - /* 2000 */ 1458, 1437, 1980, 605, 166, 1435, 34, 178, 1434, 1407, - /* 2010 */ 1942, 615, 13, 22, 1977, 1415, 1943, 296, 1944, 616, - /* 2020 */ 1946, 1947, 611, 1232, 606, 23, 617, 619, 621, 359, - /* 2030 */ 1961, 623, 1229, 1226, 626, 624, 627, 629, 613, 1220, - /* 2040 */ 1218, 632, 630, 1912, 1224, 612, 633, 1961, 1223, 1209, - /* 2050 */ 1222, 1221, 94, 1241, 95, 613, 276, 639, 1237, 1943, - /* 2060 */ 1912, 68, 612, 1156, 1121, 1155, 648, 1154, 1942, 1153, - /* 2070 */ 1152, 1176, 1977, 1151, 1149, 305, 1944, 616, 1946, 1947, - /* 2080 */ 611, 1147, 606, 1943, 1146, 1942, 1145, 277, 660, 1977, - /* 2090 */ 1961, 1143, 297, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2100 */ 1142, 1141, 1140, 1912, 1139, 612, 1138, 1137, 1127, 1136, - /* 2110 */ 1173, 1171, 1133, 1132, 1961, 1129, 1128, 1654, 1126, 681, - /* 2120 */ 1652, 1650, 613, 682, 683, 685, 1943, 1912, 1942, 612, - /* 2130 */ 687, 691, 1977, 689, 1648, 306, 1944, 616, 1946, 1947, - /* 2140 */ 611, 693, 606, 1943, 686, 690, 695, 694, 1634, 697, - /* 2150 */ 1079, 1614, 1942, 280, 701, 705, 1977, 1961, 704, 298, - /* 2160 */ 1944, 616, 1946, 1947, 611, 613, 606, 1370, 288, 1943, - /* 2170 */ 1912, 1589, 612, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2180 */ 1589, 1589, 613, 1589, 1589, 1589, 1943, 1912, 1589, 612, - /* 2190 */ 1589, 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2200 */ 1961, 1589, 313, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2210 */ 1589, 1589, 1942, 1912, 1589, 612, 1977, 1961, 1589, 314, - /* 2220 */ 1944, 616, 1946, 1947, 611, 613, 606, 1589, 1589, 1943, - /* 2230 */ 1912, 1589, 612, 1589, 1589, 1589, 1589, 1589, 1942, 1589, - /* 2240 */ 1589, 1589, 1977, 1589, 1589, 1955, 1944, 616, 1946, 1947, - /* 2250 */ 611, 1943, 606, 1589, 1589, 1942, 1589, 1589, 1589, 1977, - /* 2260 */ 1961, 1589, 1954, 1944, 616, 1946, 1947, 611, 613, 606, - /* 2270 */ 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, - /* 2280 */ 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2290 */ 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, 1942, 1589, - /* 2300 */ 1589, 1589, 1977, 1589, 1589, 1953, 1944, 616, 1946, 1947, - /* 2310 */ 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2320 */ 1942, 1589, 1589, 1589, 1977, 1589, 1589, 323, 1944, 616, - /* 2330 */ 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, 1589, 1589, - /* 2340 */ 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, 1589, 1589, - /* 2350 */ 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, 1589, 612, - /* 2360 */ 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, 1589, 1589, - /* 2370 */ 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, 1589, 1912, - /* 2380 */ 1589, 612, 1942, 1589, 1589, 1589, 1977, 1589, 1589, 324, - /* 2390 */ 1944, 616, 1946, 1947, 611, 1589, 606, 1943, 1589, 1589, - /* 2400 */ 1589, 1589, 1589, 1589, 1942, 1589, 1589, 1589, 1977, 1589, - /* 2410 */ 1589, 320, 1944, 616, 1946, 1947, 611, 1943, 606, 1589, - /* 2420 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2430 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2440 */ 1589, 1912, 1589, 612, 1589, 1589, 1589, 1589, 1961, 1589, - /* 2450 */ 1589, 1589, 1589, 1589, 1589, 1589, 613, 1589, 1589, 1589, - /* 2460 */ 1943, 1912, 1589, 612, 1589, 1589, 1942, 1589, 1589, 1589, - /* 2470 */ 1977, 1589, 1589, 325, 1944, 616, 1946, 1947, 611, 1589, - /* 2480 */ 606, 1589, 1589, 1589, 1589, 1589, 614, 1589, 1589, 1589, - /* 2490 */ 1977, 1961, 1589, 303, 1944, 616, 1946, 1947, 611, 613, - /* 2500 */ 606, 1589, 1589, 1589, 1912, 1589, 612, 1589, 1589, 1589, - /* 2510 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, - /* 2520 */ 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1942, - /* 2530 */ 1589, 1589, 1589, 1977, 1589, 1589, 302, 1944, 616, 1946, - /* 2540 */ 1947, 611, 1589, 606, + /* 0 */ 1950, 458, 157, 459, 1631, 566, 167, 1703, 467, 2105, + /* 10 */ 459, 1631, 43, 41, 1522, 365, 1651, 2110, 1796, 1798, + /* 20 */ 360, 2105, 1373, 1595, 565, 173, 598, 332, 1850, 2106, + /* 30 */ 567, 1968, 1741, 1452, 405, 1371, 1664, 2109, 514, 581, + /* 40 */ 52, 2106, 2108, 1933, 1919, 399, 614, 122, 121, 120, + /* 50 */ 119, 118, 117, 116, 115, 114, 464, 1750, 1447, 597, + /* 60 */ 36, 35, 460, 16, 42, 40, 39, 38, 37, 1949, + /* 70 */ 1379, 1929, 1935, 1984, 318, 597, 100, 1951, 618, 1953, + /* 80 */ 1954, 613, 608, 608, 258, 597, 1526, 546, 170, 1938, + /* 90 */ 2037, 2105, 1398, 476, 354, 2033, 12, 2052, 1462, 1950, + /* 100 */ 1933, 513, 512, 511, 1398, 1968, 2111, 173, 175, 128, + /* 110 */ 507, 2106, 567, 560, 506, 505, 2063, 158, 706, 1607, + /* 120 */ 504, 510, 58, 2049, 85, 561, 503, 598, 1929, 1935, + /* 130 */ 1968, 1398, 1085, 1454, 1455, 1104, 1593, 1103, 615, 608, + /* 140 */ 2110, 123, 1846, 1919, 2105, 614, 43, 41, 497, 1558, + /* 150 */ 210, 46, 559, 181, 360, 1727, 1373, 1399, 1750, 1950, + /* 160 */ 2109, 46, 1428, 1437, 2106, 2107, 1105, 1452, 1949, 1371, + /* 170 */ 598, 1087, 1984, 1090, 1091, 100, 1951, 618, 1953, 1954, + /* 180 */ 613, 1374, 608, 1372, 123, 134, 62, 141, 2008, 2037, + /* 190 */ 1968, 502, 1447, 354, 2033, 33, 274, 16, 581, 375, + /* 200 */ 1398, 1750, 652, 1919, 1379, 614, 1377, 1378, 1398, 1427, + /* 210 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, + /* 220 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1949, 97, + /* 230 */ 12, 2110, 1984, 1950, 1429, 100, 1951, 618, 1953, 1954, + /* 240 */ 613, 546, 608, 132, 1397, 2105, 1429, 170, 1400, 2037, + /* 250 */ 556, 1742, 706, 354, 2033, 42, 40, 39, 38, 37, + /* 260 */ 2111, 173, 9, 650, 1968, 2106, 567, 1454, 1455, 1797, + /* 270 */ 1798, 176, 615, 1309, 1310, 2064, 58, 1919, 58, 614, + /* 280 */ 43, 41, 146, 145, 647, 646, 645, 143, 360, 1400, + /* 290 */ 1373, 58, 1399, 1950, 509, 508, 1428, 1437, 1618, 578, + /* 300 */ 176, 1452, 1949, 1371, 457, 598, 1984, 462, 1637, 100, + /* 310 */ 1951, 618, 1953, 1954, 613, 1374, 608, 1372, 225, 178, + /* 320 */ 643, 2012, 169, 2037, 1968, 1581, 1447, 354, 2033, 1483, + /* 330 */ 131, 16, 615, 562, 557, 1790, 1750, 1919, 1379, 614, + /* 340 */ 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, 1434, 1435, + /* 350 */ 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, + /* 360 */ 1456, 2, 1949, 9, 12, 1950, 1984, 677, 675, 100, + /* 370 */ 1951, 618, 1953, 1954, 613, 398, 608, 397, 82, 320, + /* 380 */ 58, 2125, 531, 2037, 529, 80, 706, 354, 2033, 255, + /* 390 */ 2045, 577, 257, 124, 576, 441, 1968, 2105, 2071, 127, + /* 400 */ 30, 1454, 1455, 541, 612, 1256, 1257, 406, 1745, 1919, + /* 410 */ 1488, 614, 565, 173, 43, 41, 1457, 2106, 567, 585, + /* 420 */ 407, 1379, 360, 1725, 1373, 176, 47, 176, 1846, 351, + /* 430 */ 1428, 1437, 1861, 257, 1949, 1452, 185, 1371, 1984, 183, + /* 440 */ 176, 310, 1951, 618, 1953, 1954, 613, 650, 608, 1374, + /* 450 */ 2003, 1372, 466, 189, 188, 462, 1637, 36, 35, 664, + /* 460 */ 1447, 42, 40, 39, 38, 37, 146, 145, 647, 646, + /* 470 */ 645, 143, 1379, 77, 1377, 1378, 76, 1427, 1430, 1431, + /* 480 */ 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, + /* 490 */ 1449, 1450, 1451, 1453, 1456, 2, 598, 1617, 44, 598, + /* 500 */ 1739, 1950, 1803, 513, 512, 511, 1398, 598, 1803, 353, + /* 510 */ 403, 128, 507, 404, 1735, 364, 506, 505, 1801, 1616, + /* 520 */ 706, 413, 504, 510, 1801, 352, 363, 1750, 503, 176, + /* 530 */ 1750, 650, 1968, 155, 155, 1454, 1455, 1104, 1750, 1103, + /* 540 */ 615, 1919, 1752, 1752, 527, 1919, 1538, 614, 43, 41, + /* 550 */ 146, 145, 647, 646, 645, 143, 360, 525, 1373, 523, + /* 560 */ 1737, 1950, 598, 1919, 1428, 1437, 394, 1173, 1105, 1452, + /* 570 */ 1949, 1371, 598, 578, 1984, 176, 427, 100, 1951, 618, + /* 580 */ 1953, 1954, 613, 1374, 608, 1372, 428, 396, 392, 2010, + /* 590 */ 1733, 2037, 1968, 1750, 1447, 354, 2033, 226, 230, 9, + /* 600 */ 615, 7, 1175, 1750, 131, 1919, 1379, 614, 1377, 1378, + /* 610 */ 80, 1427, 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, + /* 620 */ 606, 1445, 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, + /* 630 */ 1949, 167, 44, 1746, 1984, 366, 605, 100, 1951, 618, + /* 640 */ 1953, 1954, 613, 155, 608, 265, 266, 1615, 1429, 2125, + /* 650 */ 264, 2037, 1752, 1851, 706, 354, 2033, 1614, 1950, 1728, + /* 660 */ 1350, 1351, 580, 171, 2045, 2046, 2099, 129, 2050, 1454, + /* 670 */ 1455, 36, 35, 6, 29, 42, 40, 39, 38, 37, + /* 680 */ 36, 35, 43, 41, 42, 40, 39, 38, 37, 1968, + /* 690 */ 360, 1919, 1373, 91, 598, 598, 2077, 615, 1428, 1437, + /* 700 */ 1613, 1919, 1919, 1452, 614, 1371, 1803, 25, 474, 475, + /* 710 */ 39, 38, 37, 329, 600, 1743, 2009, 1374, 602, 1372, + /* 720 */ 2009, 476, 1801, 609, 155, 1750, 1750, 1949, 1447, 227, + /* 730 */ 1612, 1984, 1780, 1753, 159, 1951, 618, 1953, 1954, 613, + /* 740 */ 1379, 608, 1377, 1378, 1919, 1427, 1430, 1431, 1432, 1433, + /* 750 */ 1434, 1435, 1436, 610, 606, 1445, 1446, 1448, 1449, 1450, + /* 760 */ 1451, 1453, 1456, 2, 36, 35, 12, 1950, 42, 40, + /* 770 */ 39, 38, 37, 1846, 1919, 547, 2074, 566, 1548, 1473, + /* 780 */ 317, 2105, 1396, 2052, 187, 598, 642, 1611, 706, 435, + /* 790 */ 1610, 1609, 448, 1596, 1606, 447, 565, 173, 1968, 1747, + /* 800 */ 1726, 2106, 567, 1454, 1455, 1605, 615, 1608, 1604, 2048, + /* 810 */ 419, 1919, 449, 614, 113, 421, 1750, 112, 111, 110, + /* 820 */ 109, 108, 107, 106, 105, 104, 553, 1546, 1547, 1549, + /* 830 */ 1550, 1919, 1428, 1437, 1919, 1919, 532, 665, 1919, 1720, + /* 840 */ 1984, 598, 598, 306, 1951, 618, 1953, 1954, 613, 1919, + /* 850 */ 608, 1374, 1919, 1372, 1603, 139, 367, 333, 1661, 36, + /* 860 */ 35, 1519, 652, 42, 40, 39, 38, 37, 2109, 409, + /* 870 */ 1401, 1401, 1750, 1750, 2052, 1602, 1377, 1378, 1515, 1427, + /* 880 */ 1430, 1431, 1432, 1433, 1434, 1435, 1436, 610, 606, 1445, + /* 890 */ 1446, 1448, 1449, 1450, 1451, 1453, 1456, 2, 1919, 445, + /* 900 */ 2047, 1704, 440, 439, 438, 437, 434, 433, 432, 431, + /* 910 */ 430, 426, 425, 424, 423, 334, 416, 415, 414, 1919, + /* 920 */ 411, 410, 331, 683, 682, 681, 680, 370, 144, 679, + /* 930 */ 678, 135, 673, 672, 671, 670, 669, 668, 667, 666, + /* 940 */ 148, 662, 661, 660, 369, 368, 657, 656, 655, 654, + /* 950 */ 653, 156, 1601, 1600, 598, 1599, 294, 36, 35, 357, + /* 960 */ 356, 42, 40, 39, 38, 37, 1598, 1950, 542, 1387, + /* 970 */ 292, 66, 598, 133, 65, 644, 2008, 252, 1794, 1401, + /* 980 */ 1452, 51, 1380, 36, 35, 1750, 582, 42, 40, 39, + /* 990 */ 38, 37, 193, 454, 452, 585, 1919, 1919, 1968, 1919, + /* 1000 */ 11, 10, 337, 1750, 648, 1447, 615, 1794, 1862, 554, + /* 1010 */ 1919, 1919, 325, 614, 182, 235, 573, 1379, 1213, 640, + /* 1020 */ 639, 638, 1217, 637, 1219, 1220, 636, 1222, 633, 58, + /* 1030 */ 1228, 630, 1230, 1231, 627, 624, 1949, 209, 288, 598, + /* 1040 */ 1984, 1780, 1803, 100, 1951, 618, 1953, 1954, 613, 649, + /* 1050 */ 608, 584, 1794, 269, 1481, 2125, 216, 2037, 1802, 214, + /* 1060 */ 211, 354, 2033, 709, 338, 604, 336, 335, 99, 499, + /* 1070 */ 1750, 246, 2056, 501, 598, 162, 1906, 281, 1373, 1090, + /* 1080 */ 1091, 493, 489, 485, 481, 208, 2057, 1515, 593, 1833, + /* 1090 */ 598, 1371, 166, 546, 501, 500, 1495, 2105, 699, 695, + /* 1100 */ 691, 687, 279, 1518, 595, 1750, 74, 73, 402, 578, + /* 1110 */ 1482, 180, 2111, 173, 67, 570, 500, 2106, 567, 598, + /* 1120 */ 1382, 1750, 81, 234, 382, 206, 1379, 569, 1388, 316, + /* 1130 */ 1383, 1969, 390, 596, 388, 384, 380, 377, 374, 98, + /* 1140 */ 131, 48, 272, 3, 137, 1381, 125, 371, 1588, 60, + /* 1150 */ 1750, 1855, 113, 1391, 1393, 112, 111, 110, 109, 108, + /* 1160 */ 107, 106, 105, 104, 75, 606, 1445, 1446, 1448, 1449, + /* 1170 */ 1450, 1451, 239, 218, 706, 594, 217, 1950, 176, 45, + /* 1180 */ 598, 32, 358, 1476, 1477, 1478, 1479, 1480, 1484, 1485, + /* 1190 */ 1486, 1487, 205, 199, 275, 204, 1644, 1642, 472, 172, + /* 1200 */ 2045, 2046, 1545, 129, 2050, 1950, 220, 222, 1968, 219, + /* 1210 */ 221, 1750, 260, 262, 197, 50, 615, 140, 516, 519, + /* 1220 */ 545, 1919, 142, 614, 233, 241, 1590, 1591, 1940, 1344, + /* 1230 */ 96, 229, 1320, 11, 10, 1632, 1968, 1374, 574, 1372, + /* 1240 */ 93, 422, 1587, 144, 615, 1133, 1949, 658, 1950, 1919, + /* 1250 */ 1984, 614, 2067, 100, 1951, 618, 1953, 1954, 613, 60, + /* 1260 */ 608, 45, 1377, 1378, 83, 601, 267, 2037, 1385, 1153, + /* 1270 */ 590, 354, 2033, 1791, 1949, 271, 1950, 1942, 1984, 1968, + /* 1280 */ 1134, 101, 1951, 618, 1953, 1954, 613, 615, 608, 579, + /* 1290 */ 254, 31, 1919, 1384, 614, 2037, 1206, 36, 35, 2036, + /* 1300 */ 2033, 42, 40, 39, 38, 37, 251, 1968, 45, 622, + /* 1310 */ 1, 142, 1489, 4, 1438, 615, 144, 1949, 659, 1950, + /* 1320 */ 1919, 1984, 614, 1638, 101, 1951, 618, 1953, 1954, 613, + /* 1330 */ 376, 608, 126, 381, 330, 571, 142, 1950, 2037, 1337, + /* 1340 */ 1151, 282, 603, 2033, 186, 616, 408, 1401, 1856, 1984, + /* 1350 */ 1968, 443, 101, 1951, 618, 1953, 1954, 613, 612, 608, + /* 1360 */ 412, 287, 1234, 1919, 1238, 614, 2037, 417, 1968, 1245, + /* 1370 */ 324, 2033, 701, 1396, 429, 1848, 615, 436, 442, 444, + /* 1380 */ 1950, 1919, 190, 614, 450, 1243, 451, 453, 1949, 147, + /* 1390 */ 455, 1402, 1984, 518, 456, 310, 1951, 618, 1953, 1954, + /* 1400 */ 613, 611, 608, 599, 2002, 465, 1949, 1404, 528, 468, + /* 1410 */ 1984, 1968, 1403, 160, 1951, 618, 1953, 1954, 613, 615, + /* 1420 */ 608, 196, 224, 469, 1919, 198, 614, 1405, 1937, 470, + /* 1430 */ 201, 473, 471, 1950, 1107, 203, 477, 521, 1896, 1933, + /* 1440 */ 78, 1937, 515, 79, 496, 533, 498, 223, 494, 1949, + /* 1450 */ 207, 495, 1933, 1984, 1950, 102, 101, 1951, 618, 1953, + /* 1460 */ 1954, 613, 228, 608, 1968, 568, 2126, 1929, 1935, 343, + /* 1470 */ 2037, 319, 615, 535, 1740, 2034, 213, 1919, 608, 614, + /* 1480 */ 1929, 1935, 355, 373, 64, 1968, 1736, 63, 215, 149, + /* 1490 */ 1895, 608, 150, 615, 372, 1738, 1734, 151, 1919, 152, + /* 1500 */ 614, 536, 1949, 543, 283, 231, 1984, 550, 1950, 159, + /* 1510 */ 1951, 618, 1953, 1954, 613, 555, 608, 537, 540, 237, + /* 1520 */ 588, 2068, 578, 1949, 2078, 546, 552, 1984, 344, 2105, + /* 1530 */ 304, 1951, 618, 1953, 1954, 613, 546, 608, 240, 1968, + /* 1540 */ 2105, 558, 5, 551, 2111, 173, 564, 615, 548, 2106, + /* 1550 */ 567, 2075, 1919, 131, 614, 2111, 173, 549, 248, 2059, + /* 1560 */ 2106, 567, 1950, 36, 35, 245, 345, 42, 40, 39, + /* 1570 */ 38, 37, 250, 1515, 563, 575, 572, 1949, 130, 1950, + /* 1580 */ 2128, 1984, 249, 2083, 160, 1951, 618, 1953, 1954, 613, + /* 1590 */ 2082, 608, 163, 1968, 247, 1400, 583, 259, 349, 2104, + /* 1600 */ 253, 615, 2053, 348, 284, 1950, 1919, 586, 614, 587, + /* 1610 */ 1968, 1867, 174, 2045, 2046, 359, 129, 2050, 615, 591, + /* 1620 */ 1866, 1865, 350, 1919, 88, 614, 285, 592, 286, 57, + /* 1630 */ 90, 1949, 92, 1950, 1751, 1984, 1968, 2127, 311, 1951, + /* 1640 */ 618, 1953, 1954, 613, 615, 608, 2018, 1795, 1949, 1919, + /* 1650 */ 1721, 614, 1984, 289, 620, 311, 1951, 618, 1953, 1954, + /* 1660 */ 613, 278, 608, 702, 1968, 703, 705, 49, 298, 361, + /* 1670 */ 291, 312, 615, 313, 1949, 302, 1950, 1919, 1984, 614, + /* 1680 */ 293, 295, 1951, 618, 1953, 1954, 613, 1913, 608, 321, + /* 1690 */ 322, 1912, 1950, 71, 1911, 1910, 72, 1907, 378, 379, + /* 1700 */ 1365, 1366, 1949, 179, 383, 1905, 1984, 1968, 385, 311, + /* 1710 */ 1951, 618, 1953, 1954, 613, 615, 608, 386, 387, 154, + /* 1720 */ 1919, 1904, 614, 1968, 389, 1903, 1902, 391, 393, 1901, + /* 1730 */ 1340, 615, 1339, 395, 1878, 534, 1919, 1877, 614, 400, + /* 1740 */ 401, 1876, 1875, 1950, 1841, 1949, 1300, 1840, 1838, 1984, + /* 1750 */ 136, 1837, 296, 1951, 618, 1953, 1954, 613, 1836, 608, + /* 1760 */ 1839, 1949, 1835, 1834, 1832, 1984, 1831, 1830, 297, 1951, + /* 1770 */ 618, 1953, 1954, 613, 1968, 608, 184, 546, 418, 1829, + /* 1780 */ 420, 2105, 615, 1828, 1827, 1826, 1950, 1919, 1825, 614, + /* 1790 */ 1824, 1823, 1822, 1821, 1820, 1819, 2111, 173, 1818, 1817, + /* 1800 */ 1816, 2106, 567, 1950, 1815, 1814, 1813, 138, 1812, 1811, + /* 1810 */ 1810, 1809, 1949, 1808, 1807, 1806, 1984, 1968, 1302, 303, + /* 1820 */ 1951, 618, 1953, 1954, 613, 615, 608, 1805, 1804, 446, + /* 1830 */ 1919, 1666, 614, 191, 1968, 1665, 1181, 1663, 192, 1627, + /* 1840 */ 1093, 168, 615, 1092, 194, 1626, 69, 1919, 1891, 614, + /* 1850 */ 1939, 1885, 195, 1874, 1873, 1949, 1950, 70, 200, 1984, + /* 1860 */ 202, 1858, 307, 1951, 618, 1953, 1954, 613, 461, 608, + /* 1870 */ 463, 1729, 1949, 1950, 1662, 1660, 1984, 478, 479, 299, + /* 1880 */ 1951, 618, 1953, 1954, 613, 480, 608, 1968, 1126, 1658, + /* 1890 */ 482, 483, 1656, 486, 1654, 615, 484, 487, 488, 490, + /* 1900 */ 1919, 492, 614, 1641, 1968, 1640, 1623, 1731, 491, 1249, + /* 1910 */ 1730, 1250, 615, 1172, 1171, 1170, 1169, 1919, 1168, 614, + /* 1920 */ 212, 59, 1163, 1165, 1950, 1949, 674, 1652, 676, 1984, + /* 1930 */ 1164, 1162, 308, 1951, 618, 1953, 1954, 613, 339, 608, + /* 1940 */ 1645, 1950, 1949, 340, 1643, 341, 1984, 517, 520, 300, + /* 1950 */ 1951, 618, 1953, 1954, 613, 1968, 608, 1622, 1621, 522, + /* 1960 */ 524, 1620, 1357, 615, 526, 103, 1355, 1950, 1919, 1354, + /* 1970 */ 614, 530, 1968, 24, 1890, 1884, 1346, 538, 1872, 1870, + /* 1980 */ 615, 17, 14, 2110, 1950, 1919, 53, 614, 1560, 18, + /* 1990 */ 56, 243, 28, 1949, 26, 236, 539, 1984, 1968, 232, + /* 2000 */ 309, 1951, 618, 1953, 1954, 613, 615, 608, 342, 153, + /* 2010 */ 1949, 1919, 238, 614, 1984, 1968, 1544, 301, 1951, 618, + /* 2020 */ 1953, 1954, 613, 615, 608, 161, 544, 1537, 1919, 244, + /* 2030 */ 614, 242, 27, 1940, 84, 1950, 1949, 61, 19, 1575, + /* 2040 */ 1984, 1574, 346, 314, 1951, 618, 1953, 1954, 613, 1580, + /* 2050 */ 608, 1581, 1579, 1949, 1578, 347, 1512, 1984, 256, 1511, + /* 2060 */ 315, 1951, 618, 1953, 1954, 613, 1968, 608, 55, 164, + /* 2070 */ 1871, 1869, 1868, 20, 615, 589, 1857, 263, 1950, 1919, + /* 2080 */ 261, 614, 1542, 15, 54, 268, 86, 87, 89, 273, + /* 2090 */ 93, 270, 10, 21, 1950, 1464, 8, 1463, 1987, 1389, + /* 2100 */ 1442, 607, 165, 177, 1949, 1440, 34, 1474, 1984, 1968, + /* 2110 */ 1439, 1962, 1951, 618, 1953, 1954, 613, 615, 608, 13, + /* 2120 */ 1420, 22, 1919, 1412, 614, 1968, 617, 23, 619, 1235, + /* 2130 */ 621, 362, 623, 615, 1232, 625, 626, 628, 1919, 629, + /* 2140 */ 614, 1229, 1223, 631, 1221, 1950, 632, 1949, 634, 635, + /* 2150 */ 1227, 1984, 1212, 1226, 1961, 1951, 618, 1953, 1954, 613, + /* 2160 */ 641, 608, 94, 1949, 276, 95, 1225, 1984, 1244, 68, + /* 2170 */ 1960, 1951, 618, 1953, 1954, 613, 1968, 608, 1224, 1240, + /* 2180 */ 1124, 651, 1159, 1158, 615, 1157, 1156, 1155, 1950, 1919, + /* 2190 */ 1154, 614, 1179, 1152, 1150, 1149, 1148, 663, 277, 1146, + /* 2200 */ 1145, 1144, 1143, 1142, 1141, 1950, 1140, 1139, 1176, 1174, + /* 2210 */ 1136, 1135, 1132, 1131, 1949, 1130, 1659, 1129, 1984, 1968, + /* 2220 */ 684, 326, 1951, 618, 1953, 1954, 613, 615, 608, 686, + /* 2230 */ 1657, 685, 1919, 688, 614, 689, 1968, 1655, 690, 692, + /* 2240 */ 693, 694, 1653, 696, 615, 697, 698, 1639, 700, 1919, + /* 2250 */ 1082, 614, 1619, 280, 704, 708, 1375, 1949, 1950, 1594, + /* 2260 */ 290, 1984, 707, 1594, 327, 1951, 618, 1953, 1954, 613, + /* 2270 */ 1594, 608, 1594, 1594, 1949, 1950, 1594, 1594, 1984, 1594, + /* 2280 */ 1594, 323, 1951, 618, 1953, 1954, 613, 1594, 608, 1968, + /* 2290 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, + /* 2300 */ 1594, 1594, 1919, 1594, 614, 1594, 1968, 1594, 1594, 1594, + /* 2310 */ 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, 1919, + /* 2320 */ 1594, 614, 1594, 1594, 1594, 1594, 1950, 1949, 1594, 1594, + /* 2330 */ 1594, 1984, 1594, 1594, 328, 1951, 618, 1953, 1954, 613, + /* 2340 */ 1594, 608, 1594, 1594, 616, 1594, 1594, 1594, 1984, 1594, + /* 2350 */ 1594, 306, 1951, 618, 1953, 1954, 613, 1968, 608, 1594, + /* 2360 */ 1594, 1594, 1594, 1594, 1594, 615, 1594, 1594, 1594, 1594, + /* 2370 */ 1919, 1594, 614, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 2380 */ 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, + /* 2390 */ 1594, 1594, 1594, 1594, 1594, 1949, 1594, 1594, 1594, 1984, + /* 2400 */ 1594, 1594, 305, 1951, 618, 1953, 1954, 613, 1594, 608, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 385, 426, 347, 0, 328, 430, 330, 331, 415, 416, - /* 10 */ 355, 385, 12, 13, 14, 328, 355, 330, 331, 364, - /* 20 */ 20, 446, 22, 8, 9, 450, 451, 12, 13, 14, - /* 30 */ 15, 16, 20, 33, 339, 35, 324, 376, 377, 344, - /* 40 */ 21, 426, 8, 9, 370, 430, 12, 13, 14, 15, - /* 50 */ 16, 20, 426, 34, 380, 36, 430, 383, 58, 44, - /* 60 */ 445, 446, 385, 63, 355, 450, 451, 355, 369, 370, - /* 70 */ 70, 445, 446, 364, 426, 363, 450, 451, 430, 332, - /* 80 */ 368, 20, 370, 12, 13, 12, 13, 14, 15, 16, - /* 90 */ 323, 20, 325, 22, 446, 355, 96, 63, 450, 451, - /* 100 */ 1, 2, 362, 426, 33, 393, 35, 430, 4, 397, - /* 110 */ 363, 371, 400, 401, 402, 403, 404, 405, 118, 407, - /* 120 */ 58, 63, 445, 446, 412, 33, 414, 450, 451, 58, - /* 130 */ 418, 419, 132, 133, 63, 14, 15, 16, 62, 105, - /* 140 */ 48, 70, 399, 332, 432, 357, 54, 55, 56, 57, - /* 150 */ 58, 366, 440, 338, 369, 370, 368, 96, 96, 355, - /* 160 */ 98, 161, 162, 132, 133, 355, 362, 96, 425, 422, - /* 170 */ 423, 424, 362, 426, 427, 371, 361, 430, 20, 128, - /* 180 */ 180, 371, 182, 372, 396, 397, 398, 95, 20, 118, - /* 190 */ 98, 363, 445, 446, 160, 407, 97, 450, 451, 324, - /* 200 */ 96, 14, 374, 132, 133, 205, 206, 20, 208, 209, + /* 0 */ 325, 329, 340, 331, 332, 427, 356, 345, 329, 431, + /* 10 */ 331, 332, 12, 13, 14, 367, 0, 427, 370, 371, + /* 20 */ 20, 431, 22, 0, 446, 447, 333, 377, 378, 451, + /* 30 */ 452, 356, 358, 33, 333, 35, 0, 447, 22, 364, + /* 40 */ 347, 451, 452, 369, 369, 385, 371, 24, 25, 26, + /* 50 */ 27, 28, 29, 30, 31, 32, 14, 364, 58, 20, + /* 60 */ 8, 9, 20, 63, 12, 13, 14, 15, 16, 394, + /* 70 */ 70, 397, 398, 398, 373, 20, 401, 402, 403, 404, + /* 80 */ 405, 406, 408, 408, 58, 20, 14, 427, 413, 358, + /* 90 */ 415, 431, 20, 62, 419, 420, 96, 400, 14, 325, + /* 100 */ 369, 65, 66, 67, 20, 356, 446, 447, 433, 73, + /* 110 */ 74, 451, 452, 364, 78, 79, 441, 324, 118, 326, + /* 120 */ 84, 85, 96, 426, 98, 20, 90, 333, 397, 398, + /* 130 */ 356, 20, 4, 133, 134, 20, 322, 22, 364, 408, + /* 140 */ 427, 347, 364, 369, 431, 371, 12, 13, 354, 97, + /* 150 */ 35, 96, 403, 375, 20, 0, 22, 20, 364, 325, + /* 160 */ 447, 96, 162, 163, 451, 452, 51, 33, 394, 35, + /* 170 */ 333, 43, 398, 45, 46, 401, 402, 403, 404, 405, + /* 180 */ 406, 181, 408, 183, 347, 411, 4, 413, 414, 415, + /* 190 */ 356, 354, 58, 419, 420, 416, 417, 63, 364, 385, + /* 200 */ 20, 364, 62, 369, 70, 371, 206, 207, 20, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 65, 66, 67, - /* 230 */ 426, 20, 161, 162, 430, 73, 74, 20, 187, 188, - /* 240 */ 78, 79, 191, 368, 193, 321, 84, 85, 4, 445, - /* 250 */ 446, 180, 90, 182, 450, 451, 164, 165, 324, 167, - /* 260 */ 80, 166, 170, 205, 205, 231, 232, 233, 234, 235, - /* 270 */ 236, 237, 238, 239, 240, 241, 205, 206, 186, 208, - /* 280 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 354, 228, - /* 300 */ 12, 13, 368, 341, 342, 244, 244, 96, 20, 385, - /* 310 */ 22, 367, 253, 254, 255, 256, 257, 137, 138, 161, - /* 320 */ 162, 33, 324, 35, 109, 110, 111, 112, 113, 114, - /* 330 */ 115, 116, 117, 118, 119, 20, 121, 122, 123, 124, - /* 340 */ 125, 126, 175, 336, 249, 250, 58, 20, 244, 22, - /* 350 */ 426, 63, 329, 355, 430, 332, 333, 350, 70, 341, - /* 360 */ 342, 363, 35, 196, 197, 358, 368, 44, 370, 445, - /* 370 */ 446, 12, 13, 14, 450, 451, 2, 355, 51, 20, - /* 380 */ 163, 22, 8, 9, 96, 363, 12, 13, 14, 15, - /* 390 */ 16, 393, 33, 329, 35, 397, 332, 333, 400, 401, - /* 400 */ 402, 403, 404, 405, 332, 407, 118, 324, 8, 9, - /* 410 */ 399, 96, 12, 13, 14, 15, 16, 58, 346, 127, - /* 420 */ 132, 133, 108, 163, 402, 353, 8, 9, 168, 70, - /* 430 */ 12, 13, 14, 15, 16, 363, 425, 35, 355, 441, - /* 440 */ 442, 127, 128, 129, 130, 131, 363, 336, 370, 161, - /* 450 */ 162, 368, 96, 370, 426, 96, 242, 243, 430, 8, - /* 460 */ 9, 383, 20, 12, 13, 14, 15, 16, 180, 358, - /* 470 */ 182, 20, 70, 445, 446, 324, 393, 118, 450, 451, - /* 480 */ 397, 189, 190, 400, 401, 402, 403, 404, 405, 245, - /* 490 */ 407, 132, 133, 205, 206, 96, 208, 209, 210, 211, - /* 500 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 510 */ 222, 223, 224, 225, 226, 97, 4, 324, 324, 368, - /* 520 */ 161, 162, 0, 21, 45, 46, 24, 25, 26, 27, - /* 530 */ 28, 29, 30, 31, 32, 452, 453, 127, 128, 180, - /* 540 */ 228, 182, 230, 21, 0, 324, 24, 25, 26, 27, - /* 550 */ 28, 29, 30, 31, 32, 43, 20, 45, 46, 244, - /* 560 */ 62, 368, 368, 163, 205, 206, 160, 208, 209, 210, - /* 570 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - /* 580 */ 221, 222, 223, 224, 225, 226, 12, 13, 265, 368, - /* 590 */ 19, 4, 20, 20, 20, 22, 22, 363, 188, 332, - /* 600 */ 244, 191, 332, 193, 33, 14, 19, 33, 374, 35, - /* 610 */ 324, 20, 96, 346, 163, 107, 346, 332, 324, 48, - /* 620 */ 33, 228, 332, 353, 51, 54, 55, 56, 57, 58, - /* 630 */ 363, 346, 58, 363, 347, 48, 338, 231, 355, 70, - /* 640 */ 53, 355, 355, 244, 70, 58, 70, 241, 363, 363, - /* 650 */ 352, 364, 108, 363, 368, 0, 370, 12, 13, 361, - /* 660 */ 377, 0, 368, 332, 324, 20, 95, 22, 0, 98, - /* 670 */ 96, 127, 128, 129, 130, 131, 356, 346, 33, 393, - /* 680 */ 35, 324, 95, 397, 356, 98, 400, 401, 402, 403, - /* 690 */ 404, 405, 118, 407, 363, 179, 410, 181, 412, 413, - /* 700 */ 414, 347, 131, 58, 418, 419, 132, 133, 368, 355, - /* 710 */ 389, 421, 422, 423, 424, 70, 426, 427, 364, 356, - /* 720 */ 65, 66, 67, 62, 58, 368, 14, 332, 73, 74, - /* 730 */ 62, 324, 20, 78, 79, 161, 162, 324, 167, 84, - /* 740 */ 85, 96, 0, 8, 9, 90, 20, 12, 13, 14, - /* 750 */ 15, 16, 161, 20, 180, 184, 182, 186, 363, 348, - /* 760 */ 244, 95, 351, 118, 98, 357, 24, 25, 26, 27, - /* 770 */ 28, 29, 30, 31, 32, 368, 368, 132, 133, 205, - /* 780 */ 206, 368, 208, 209, 210, 211, 212, 213, 214, 215, - /* 790 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - /* 800 */ 226, 18, 108, 20, 396, 397, 161, 162, 324, 363, - /* 810 */ 27, 399, 411, 30, 413, 407, 33, 422, 423, 424, - /* 820 */ 374, 426, 427, 355, 130, 180, 0, 182, 324, 0, - /* 830 */ 324, 48, 97, 50, 2, 410, 53, 425, 413, 371, - /* 840 */ 8, 9, 324, 324, 12, 13, 14, 15, 16, 356, - /* 850 */ 205, 206, 368, 208, 209, 210, 211, 212, 213, 214, - /* 860 */ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - /* 870 */ 225, 226, 368, 161, 368, 8, 9, 48, 95, 12, - /* 880 */ 13, 14, 15, 16, 20, 365, 368, 368, 368, 163, - /* 890 */ 107, 65, 66, 67, 68, 69, 163, 71, 72, 73, - /* 900 */ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - /* 910 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 136, - /* 920 */ 324, 324, 139, 140, 141, 142, 143, 144, 145, 146, - /* 930 */ 147, 148, 149, 150, 151, 152, 153, 154, 155, 3, - /* 940 */ 157, 158, 159, 18, 411, 332, 413, 332, 23, 8, - /* 950 */ 9, 44, 355, 12, 13, 14, 15, 16, 332, 346, - /* 960 */ 363, 346, 37, 38, 368, 368, 41, 370, 382, 385, - /* 970 */ 384, 3, 346, 44, 324, 324, 363, 382, 363, 384, - /* 980 */ 324, 332, 1, 2, 59, 60, 61, 0, 20, 363, - /* 990 */ 393, 332, 332, 365, 397, 346, 368, 400, 401, 402, - /* 1000 */ 403, 404, 405, 39, 407, 355, 346, 0, 356, 412, - /* 1010 */ 426, 414, 363, 363, 430, 418, 419, 344, 368, 368, - /* 1020 */ 370, 96, 363, 363, 368, 161, 97, 332, 348, 445, - /* 1030 */ 446, 351, 332, 100, 450, 451, 103, 440, 357, 172, - /* 1040 */ 356, 346, 332, 393, 58, 100, 346, 397, 103, 368, - /* 1050 */ 400, 401, 402, 403, 404, 405, 346, 407, 363, 134, - /* 1060 */ 332, 324, 412, 363, 414, 97, 12, 13, 418, 419, - /* 1070 */ 343, 356, 345, 363, 346, 35, 22, 396, 397, 429, - /* 1080 */ 332, 422, 423, 424, 98, 426, 427, 33, 407, 35, - /* 1090 */ 325, 363, 355, 22, 346, 108, 107, 172, 173, 174, - /* 1100 */ 363, 42, 177, 44, 324, 368, 35, 370, 42, 378, - /* 1110 */ 44, 363, 58, 443, 127, 128, 129, 130, 131, 35, - /* 1120 */ 195, 357, 332, 198, 70, 200, 201, 202, 203, 204, - /* 1130 */ 393, 163, 368, 266, 397, 355, 346, 400, 401, 402, - /* 1140 */ 403, 404, 405, 363, 407, 156, 0, 96, 368, 412, - /* 1150 */ 370, 414, 454, 363, 0, 418, 419, 106, 151, 334, - /* 1160 */ 396, 397, 398, 385, 100, 332, 429, 103, 22, 244, - /* 1170 */ 263, 407, 118, 393, 332, 324, 22, 397, 44, 346, - /* 1180 */ 400, 401, 402, 403, 404, 405, 332, 407, 346, 332, - /* 1190 */ 0, 47, 412, 437, 414, 355, 363, 261, 418, 419, - /* 1200 */ 346, 332, 334, 346, 426, 363, 355, 243, 430, 429, - /* 1210 */ 132, 133, 22, 100, 363, 346, 103, 363, 324, 368, - /* 1220 */ 363, 370, 182, 445, 446, 44, 44, 44, 450, 451, - /* 1230 */ 44, 97, 363, 44, 180, 44, 182, 44, 378, 331, - /* 1240 */ 96, 367, 428, 378, 393, 447, 35, 420, 397, 355, - /* 1250 */ 44, 400, 401, 402, 403, 404, 405, 363, 407, 205, - /* 1260 */ 206, 324, 368, 412, 370, 414, 182, 44, 44, 418, - /* 1270 */ 419, 217, 218, 219, 220, 221, 222, 223, 97, 97, - /* 1280 */ 97, 70, 246, 97, 0, 324, 97, 393, 97, 13, - /* 1290 */ 97, 397, 355, 44, 400, 401, 402, 403, 404, 405, - /* 1300 */ 363, 407, 431, 97, 44, 368, 412, 370, 414, 395, - /* 1310 */ 48, 35, 418, 419, 13, 394, 355, 44, 44, 22, - /* 1320 */ 97, 97, 387, 178, 363, 42, 375, 20, 378, 368, - /* 1330 */ 393, 370, 35, 49, 397, 37, 35, 400, 401, 402, - /* 1340 */ 403, 404, 405, 324, 407, 375, 97, 160, 373, 412, - /* 1350 */ 20, 414, 332, 332, 393, 418, 419, 97, 397, 375, - /* 1360 */ 94, 400, 401, 402, 403, 404, 405, 70, 407, 373, - /* 1370 */ 97, 97, 373, 340, 355, 414, 332, 332, 332, 418, - /* 1380 */ 419, 20, 363, 326, 326, 20, 324, 368, 391, 370, - /* 1390 */ 338, 338, 370, 20, 333, 20, 386, 99, 338, 101, - /* 1400 */ 102, 333, 104, 338, 332, 338, 108, 338, 338, 52, - /* 1410 */ 335, 335, 393, 326, 324, 118, 397, 355, 355, 400, - /* 1420 */ 401, 402, 403, 404, 405, 363, 407, 332, 130, 355, - /* 1430 */ 368, 326, 370, 414, 355, 355, 355, 418, 419, 194, - /* 1440 */ 355, 355, 392, 355, 355, 355, 355, 355, 336, 185, - /* 1450 */ 368, 336, 332, 363, 252, 393, 251, 258, 368, 397, - /* 1460 */ 370, 378, 400, 401, 402, 403, 404, 405, 391, 407, - /* 1470 */ 370, 378, 368, 324, 436, 368, 414, 180, 381, 182, - /* 1480 */ 418, 419, 381, 393, 390, 436, 368, 397, 171, 368, - /* 1490 */ 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - /* 1500 */ 260, 259, 205, 206, 355, 247, 395, 264, 267, 262, - /* 1510 */ 455, 438, 363, 243, 363, 20, 399, 368, 333, 370, - /* 1520 */ 332, 381, 381, 368, 368, 368, 368, 368, 336, 368, - /* 1530 */ 336, 324, 165, 434, 436, 439, 433, 435, 363, 379, - /* 1540 */ 336, 96, 393, 417, 96, 368, 397, 351, 345, 400, - /* 1550 */ 401, 402, 403, 404, 405, 449, 407, 448, 332, 324, - /* 1560 */ 359, 336, 355, 414, 36, 327, 388, 349, 419, 349, - /* 1570 */ 363, 349, 326, 337, 322, 368, 0, 370, 0, 384, - /* 1580 */ 187, 0, 0, 42, 0, 324, 35, 199, 35, 35, - /* 1590 */ 355, 35, 0, 199, 35, 35, 199, 0, 363, 199, - /* 1600 */ 393, 0, 35, 368, 397, 370, 0, 400, 401, 402, - /* 1610 */ 403, 404, 405, 0, 407, 22, 355, 182, 35, 180, - /* 1620 */ 0, 0, 176, 0, 363, 175, 0, 47, 393, 368, - /* 1630 */ 0, 370, 397, 0, 0, 400, 401, 402, 403, 404, - /* 1640 */ 405, 42, 407, 0, 0, 0, 0, 0, 0, 442, - /* 1650 */ 0, 0, 151, 35, 393, 324, 0, 151, 397, 0, - /* 1660 */ 0, 400, 401, 402, 403, 404, 405, 0, 407, 0, - /* 1670 */ 0, 0, 0, 0, 324, 22, 0, 42, 0, 444, - /* 1680 */ 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, - /* 1690 */ 0, 360, 135, 0, 363, 0, 0, 0, 0, 368, - /* 1700 */ 35, 370, 0, 0, 0, 355, 0, 58, 42, 47, - /* 1710 */ 58, 47, 44, 363, 453, 14, 39, 0, 368, 14, - /* 1720 */ 370, 47, 0, 0, 393, 0, 40, 0, 397, 171, - /* 1730 */ 39, 400, 401, 402, 403, 404, 405, 324, 407, 39, - /* 1740 */ 0, 0, 0, 393, 0, 35, 39, 397, 0, 35, - /* 1750 */ 400, 401, 402, 403, 404, 405, 48, 407, 324, 409, - /* 1760 */ 48, 0, 0, 64, 35, 39, 48, 39, 355, 35, - /* 1770 */ 39, 0, 48, 360, 0, 0, 363, 0, 35, 22, - /* 1780 */ 324, 368, 0, 370, 105, 35, 35, 22, 35, 355, - /* 1790 */ 35, 44, 22, 44, 360, 35, 0, 363, 35, 35, - /* 1800 */ 22, 324, 368, 0, 370, 22, 393, 0, 50, 22, - /* 1810 */ 397, 355, 103, 400, 401, 402, 403, 404, 405, 363, - /* 1820 */ 407, 35, 0, 324, 368, 35, 370, 393, 0, 35, - /* 1830 */ 0, 397, 355, 22, 400, 401, 402, 403, 404, 405, - /* 1840 */ 363, 407, 97, 20, 324, 368, 0, 370, 96, 393, - /* 1850 */ 35, 0, 0, 397, 355, 22, 400, 401, 402, 403, - /* 1860 */ 404, 405, 363, 407, 0, 44, 3, 368, 96, 370, - /* 1870 */ 393, 44, 248, 97, 397, 355, 163, 400, 401, 402, - /* 1880 */ 403, 404, 405, 363, 407, 165, 97, 324, 368, 96, - /* 1890 */ 370, 96, 393, 163, 183, 163, 397, 97, 97, 400, - /* 1900 */ 401, 402, 403, 404, 405, 169, 407, 47, 96, 96, - /* 1910 */ 44, 44, 47, 393, 96, 324, 3, 397, 355, 44, - /* 1920 */ 400, 401, 402, 403, 404, 405, 363, 407, 97, 97, - /* 1930 */ 35, 368, 35, 370, 35, 35, 35, 35, 97, 97, - /* 1940 */ 47, 324, 248, 47, 0, 0, 355, 44, 0, 96, - /* 1950 */ 35, 97, 97, 96, 363, 35, 393, 242, 192, 368, - /* 1960 */ 397, 370, 0, 400, 401, 402, 403, 404, 405, 248, - /* 1970 */ 407, 166, 355, 96, 96, 0, 39, 96, 164, 106, - /* 1980 */ 363, 47, 44, 227, 393, 368, 2, 370, 397, 22, - /* 1990 */ 205, 400, 401, 402, 403, 404, 405, 229, 407, 324, - /* 2000 */ 227, 97, 96, 96, 47, 97, 96, 47, 97, 97, - /* 2010 */ 393, 207, 96, 96, 397, 22, 324, 400, 401, 402, - /* 2020 */ 403, 404, 405, 97, 407, 96, 107, 35, 96, 35, - /* 2030 */ 355, 35, 97, 97, 35, 96, 96, 35, 363, 97, - /* 2040 */ 97, 35, 96, 368, 120, 370, 96, 355, 120, 22, - /* 2050 */ 120, 120, 96, 35, 96, 363, 44, 108, 22, 324, - /* 2060 */ 368, 96, 370, 35, 64, 35, 63, 35, 393, 35, - /* 2070 */ 35, 70, 397, 35, 35, 400, 401, 402, 403, 404, - /* 2080 */ 405, 35, 407, 324, 35, 393, 35, 44, 93, 397, - /* 2090 */ 355, 35, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2100 */ 35, 22, 35, 368, 22, 370, 35, 35, 22, 35, - /* 2110 */ 70, 35, 35, 35, 355, 35, 35, 0, 35, 35, - /* 2120 */ 0, 0, 363, 48, 39, 35, 324, 368, 393, 370, - /* 2130 */ 39, 39, 397, 35, 0, 400, 401, 402, 403, 404, - /* 2140 */ 405, 35, 407, 324, 48, 48, 39, 48, 0, 35, - /* 2150 */ 35, 0, 393, 22, 21, 20, 397, 355, 21, 400, - /* 2160 */ 401, 402, 403, 404, 405, 363, 407, 22, 22, 324, - /* 2170 */ 368, 456, 370, 456, 355, 456, 456, 456, 456, 456, - /* 2180 */ 456, 456, 363, 456, 456, 456, 324, 368, 456, 370, - /* 2190 */ 456, 456, 456, 456, 456, 393, 456, 456, 456, 397, - /* 2200 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2210 */ 456, 456, 393, 368, 456, 370, 397, 355, 456, 400, - /* 2220 */ 401, 402, 403, 404, 405, 363, 407, 456, 456, 324, - /* 2230 */ 368, 456, 370, 456, 456, 456, 456, 456, 393, 456, - /* 2240 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2250 */ 405, 324, 407, 456, 456, 393, 456, 456, 456, 397, - /* 2260 */ 355, 456, 400, 401, 402, 403, 404, 405, 363, 407, - /* 2270 */ 456, 456, 456, 368, 456, 370, 456, 456, 456, 456, - /* 2280 */ 456, 456, 355, 456, 456, 456, 456, 456, 456, 456, - /* 2290 */ 363, 456, 456, 456, 456, 368, 456, 370, 393, 456, - /* 2300 */ 456, 456, 397, 456, 456, 400, 401, 402, 403, 404, - /* 2310 */ 405, 456, 407, 324, 456, 456, 456, 456, 456, 456, - /* 2320 */ 393, 456, 456, 456, 397, 456, 456, 400, 401, 402, - /* 2330 */ 403, 404, 405, 456, 407, 324, 456, 456, 456, 456, - /* 2340 */ 456, 456, 456, 456, 355, 456, 456, 456, 456, 456, - /* 2350 */ 456, 456, 363, 456, 456, 456, 456, 368, 456, 370, - /* 2360 */ 456, 456, 456, 456, 456, 456, 355, 456, 456, 456, - /* 2370 */ 456, 456, 456, 456, 363, 456, 456, 456, 456, 368, - /* 2380 */ 456, 370, 393, 456, 456, 456, 397, 456, 456, 400, - /* 2390 */ 401, 402, 403, 404, 405, 456, 407, 324, 456, 456, - /* 2400 */ 456, 456, 456, 456, 393, 456, 456, 456, 397, 456, - /* 2410 */ 456, 400, 401, 402, 403, 404, 405, 324, 407, 456, - /* 2420 */ 456, 456, 456, 456, 456, 456, 456, 456, 355, 456, - /* 2430 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2440 */ 456, 368, 456, 370, 456, 456, 456, 456, 355, 456, - /* 2450 */ 456, 456, 456, 456, 456, 456, 363, 456, 456, 456, - /* 2460 */ 324, 368, 456, 370, 456, 456, 393, 456, 456, 456, - /* 2470 */ 397, 456, 456, 400, 401, 402, 403, 404, 405, 456, - /* 2480 */ 407, 456, 456, 456, 456, 456, 393, 456, 456, 456, - /* 2490 */ 397, 355, 456, 400, 401, 402, 403, 404, 405, 363, - /* 2500 */ 407, 456, 456, 456, 368, 456, 370, 456, 456, 456, - /* 2510 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, - /* 2520 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 393, - /* 2530 */ 456, 456, 456, 397, 456, 456, 400, 401, 402, 403, - /* 2540 */ 404, 405, 456, 407, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 394, 337, + /* 230 */ 96, 3, 398, 325, 162, 401, 402, 403, 404, 405, + /* 240 */ 406, 427, 408, 351, 20, 431, 162, 413, 20, 415, + /* 250 */ 167, 359, 118, 419, 420, 12, 13, 14, 15, 16, + /* 260 */ 446, 447, 229, 108, 356, 451, 452, 133, 134, 370, + /* 270 */ 371, 245, 364, 162, 163, 441, 96, 369, 96, 371, + /* 280 */ 12, 13, 127, 128, 129, 130, 131, 132, 20, 20, + /* 290 */ 22, 96, 20, 325, 342, 343, 162, 163, 325, 333, + /* 300 */ 245, 33, 394, 35, 330, 333, 398, 333, 334, 401, + /* 310 */ 402, 403, 404, 405, 406, 181, 408, 183, 128, 347, + /* 320 */ 107, 413, 355, 415, 356, 97, 58, 419, 420, 161, + /* 330 */ 364, 63, 364, 250, 251, 368, 364, 369, 70, 371, + /* 340 */ 206, 207, 369, 209, 210, 211, 212, 213, 214, 215, + /* 350 */ 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + /* 360 */ 226, 227, 394, 229, 96, 325, 398, 342, 343, 401, + /* 370 */ 402, 403, 404, 405, 406, 180, 408, 182, 188, 189, + /* 380 */ 96, 413, 192, 415, 194, 339, 118, 419, 420, 423, + /* 390 */ 424, 425, 164, 427, 428, 80, 356, 431, 430, 353, + /* 400 */ 232, 133, 134, 389, 364, 133, 134, 22, 362, 369, + /* 410 */ 242, 371, 446, 447, 12, 13, 14, 451, 452, 371, + /* 420 */ 35, 70, 20, 0, 22, 245, 96, 245, 364, 381, + /* 430 */ 162, 163, 384, 164, 394, 33, 58, 35, 398, 375, + /* 440 */ 245, 401, 402, 403, 404, 405, 406, 108, 408, 181, + /* 450 */ 410, 183, 330, 138, 139, 333, 334, 8, 9, 70, + /* 460 */ 58, 12, 13, 14, 15, 16, 127, 128, 129, 130, + /* 470 */ 131, 132, 70, 95, 206, 207, 98, 209, 210, 211, + /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + /* 490 */ 222, 223, 224, 225, 226, 227, 333, 325, 96, 333, + /* 500 */ 357, 325, 356, 65, 66, 67, 20, 333, 356, 363, + /* 510 */ 347, 73, 74, 347, 357, 363, 78, 79, 372, 325, + /* 520 */ 118, 347, 84, 85, 372, 348, 348, 364, 90, 245, + /* 530 */ 364, 108, 356, 356, 356, 133, 134, 20, 364, 22, + /* 540 */ 364, 369, 365, 365, 21, 369, 97, 371, 12, 13, + /* 550 */ 127, 128, 129, 130, 131, 132, 20, 34, 22, 36, + /* 560 */ 357, 325, 333, 369, 162, 163, 176, 35, 51, 33, + /* 570 */ 394, 35, 333, 333, 398, 245, 347, 401, 402, 403, + /* 580 */ 404, 405, 406, 181, 408, 183, 347, 197, 198, 413, + /* 590 */ 357, 415, 356, 364, 58, 419, 420, 127, 357, 229, + /* 600 */ 364, 231, 70, 364, 364, 369, 70, 371, 206, 207, + /* 610 */ 339, 209, 210, 211, 212, 213, 214, 215, 216, 217, + /* 620 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + /* 630 */ 394, 356, 96, 362, 398, 348, 63, 401, 402, 403, + /* 640 */ 404, 405, 406, 356, 408, 127, 128, 325, 162, 413, + /* 650 */ 132, 415, 365, 378, 118, 419, 420, 325, 325, 0, + /* 660 */ 190, 191, 422, 423, 424, 425, 430, 427, 428, 133, + /* 670 */ 134, 8, 9, 39, 2, 12, 13, 14, 15, 16, + /* 680 */ 8, 9, 12, 13, 12, 13, 14, 15, 16, 356, + /* 690 */ 20, 369, 22, 337, 333, 333, 379, 364, 162, 163, + /* 700 */ 325, 369, 369, 33, 371, 35, 356, 44, 347, 347, + /* 710 */ 14, 15, 16, 363, 412, 359, 414, 181, 412, 183, + /* 720 */ 414, 62, 372, 357, 356, 364, 364, 394, 58, 349, + /* 730 */ 325, 398, 352, 365, 401, 402, 403, 404, 405, 406, + /* 740 */ 70, 408, 206, 207, 369, 209, 210, 211, 212, 213, + /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + /* 760 */ 224, 225, 226, 227, 8, 9, 96, 325, 12, 13, + /* 770 */ 14, 15, 16, 364, 369, 442, 443, 427, 206, 206, + /* 780 */ 18, 431, 20, 400, 375, 333, 357, 325, 118, 27, + /* 790 */ 325, 325, 30, 0, 325, 33, 446, 447, 356, 347, + /* 800 */ 0, 451, 452, 133, 134, 325, 364, 326, 325, 426, + /* 810 */ 48, 369, 50, 371, 21, 53, 364, 24, 25, 26, + /* 820 */ 27, 28, 29, 30, 31, 32, 254, 255, 256, 257, + /* 830 */ 258, 369, 162, 163, 369, 369, 394, 344, 369, 346, + /* 840 */ 398, 333, 333, 401, 402, 403, 404, 405, 406, 369, + /* 850 */ 408, 181, 369, 183, 325, 347, 347, 95, 0, 8, + /* 860 */ 9, 4, 62, 12, 13, 14, 15, 16, 3, 107, + /* 870 */ 20, 20, 364, 364, 400, 325, 206, 207, 244, 209, + /* 880 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 890 */ 220, 221, 222, 223, 224, 225, 226, 227, 369, 137, + /* 900 */ 426, 345, 140, 141, 142, 143, 144, 145, 146, 147, + /* 910 */ 148, 149, 150, 151, 152, 153, 154, 155, 156, 369, + /* 920 */ 158, 159, 160, 65, 66, 67, 68, 69, 44, 71, + /* 930 */ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + /* 940 */ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + /* 950 */ 92, 18, 325, 325, 333, 325, 23, 8, 9, 12, + /* 960 */ 13, 12, 13, 14, 15, 16, 325, 325, 347, 22, + /* 970 */ 37, 38, 333, 411, 41, 366, 414, 455, 369, 20, + /* 980 */ 33, 97, 35, 8, 9, 364, 347, 12, 13, 14, + /* 990 */ 15, 16, 59, 60, 61, 371, 369, 369, 356, 369, + /* 1000 */ 1, 2, 37, 364, 366, 58, 364, 369, 384, 444, + /* 1010 */ 369, 369, 63, 371, 164, 164, 44, 70, 109, 110, + /* 1020 */ 111, 112, 113, 114, 115, 116, 117, 118, 119, 96, + /* 1030 */ 121, 122, 123, 124, 125, 126, 394, 335, 349, 333, + /* 1040 */ 398, 352, 356, 401, 402, 403, 404, 405, 406, 366, + /* 1050 */ 408, 385, 369, 347, 105, 413, 100, 415, 372, 103, + /* 1060 */ 33, 419, 420, 19, 99, 118, 101, 102, 135, 104, + /* 1070 */ 364, 438, 430, 108, 333, 48, 0, 33, 22, 45, + /* 1080 */ 46, 54, 55, 56, 57, 58, 243, 244, 347, 0, + /* 1090 */ 333, 35, 48, 427, 108, 130, 97, 431, 54, 55, + /* 1100 */ 56, 57, 58, 246, 347, 364, 173, 174, 175, 333, + /* 1110 */ 161, 178, 446, 447, 107, 44, 130, 451, 452, 333, + /* 1120 */ 35, 364, 95, 164, 48, 98, 70, 262, 181, 196, + /* 1130 */ 183, 356, 199, 347, 201, 202, 203, 204, 205, 95, + /* 1140 */ 364, 42, 98, 44, 42, 35, 44, 335, 173, 44, + /* 1150 */ 364, 379, 21, 206, 207, 24, 25, 26, 27, 28, + /* 1160 */ 29, 30, 31, 32, 157, 218, 219, 220, 221, 222, + /* 1170 */ 223, 224, 44, 100, 118, 131, 103, 325, 245, 44, + /* 1180 */ 333, 232, 233, 234, 235, 236, 237, 238, 239, 240, + /* 1190 */ 241, 242, 165, 166, 347, 168, 0, 0, 171, 423, + /* 1200 */ 424, 425, 97, 427, 428, 325, 100, 100, 356, 103, + /* 1210 */ 103, 364, 168, 44, 187, 164, 364, 44, 22, 22, + /* 1220 */ 169, 369, 44, 371, 58, 97, 133, 134, 47, 185, + /* 1230 */ 96, 187, 97, 1, 2, 332, 356, 181, 266, 183, + /* 1240 */ 106, 152, 267, 44, 364, 35, 394, 13, 325, 369, + /* 1250 */ 398, 371, 379, 401, 402, 403, 404, 405, 406, 44, + /* 1260 */ 408, 44, 206, 207, 98, 413, 97, 415, 183, 35, + /* 1270 */ 97, 419, 420, 368, 394, 97, 325, 96, 398, 356, + /* 1280 */ 70, 401, 402, 403, 404, 405, 406, 364, 408, 429, + /* 1290 */ 448, 2, 369, 183, 371, 415, 97, 8, 9, 419, + /* 1300 */ 420, 12, 13, 14, 15, 16, 421, 356, 44, 44, + /* 1310 */ 432, 44, 97, 247, 97, 364, 44, 394, 13, 325, + /* 1320 */ 369, 398, 371, 0, 401, 402, 403, 404, 405, 406, + /* 1330 */ 396, 408, 44, 48, 395, 264, 44, 325, 415, 179, + /* 1340 */ 35, 387, 419, 420, 42, 394, 376, 20, 379, 398, + /* 1350 */ 356, 161, 401, 402, 403, 404, 405, 406, 364, 408, + /* 1360 */ 376, 97, 97, 369, 97, 371, 415, 374, 356, 97, + /* 1370 */ 419, 420, 49, 20, 333, 333, 364, 376, 374, 374, + /* 1380 */ 325, 369, 333, 371, 94, 97, 341, 333, 394, 97, + /* 1390 */ 333, 20, 398, 4, 327, 401, 402, 403, 404, 405, + /* 1400 */ 406, 407, 408, 409, 410, 327, 394, 20, 19, 391, + /* 1410 */ 398, 356, 20, 401, 402, 403, 404, 405, 406, 364, + /* 1420 */ 408, 339, 33, 371, 369, 339, 371, 20, 358, 334, + /* 1430 */ 339, 334, 386, 325, 52, 339, 333, 48, 369, 369, + /* 1440 */ 339, 358, 53, 339, 327, 195, 356, 58, 336, 394, + /* 1450 */ 339, 336, 369, 398, 325, 333, 401, 402, 403, 404, + /* 1460 */ 405, 406, 337, 408, 356, 453, 454, 397, 398, 399, + /* 1470 */ 415, 327, 364, 393, 356, 420, 356, 369, 408, 371, + /* 1480 */ 397, 398, 399, 385, 95, 356, 356, 98, 356, 356, + /* 1490 */ 369, 408, 356, 364, 385, 356, 356, 356, 369, 356, + /* 1500 */ 371, 186, 394, 333, 391, 337, 398, 369, 325, 401, + /* 1510 */ 402, 403, 404, 405, 406, 253, 408, 390, 371, 382, + /* 1520 */ 252, 379, 333, 394, 379, 427, 369, 398, 369, 431, + /* 1530 */ 401, 402, 403, 404, 405, 406, 427, 408, 382, 356, + /* 1540 */ 431, 369, 259, 261, 446, 447, 172, 364, 248, 451, + /* 1550 */ 452, 443, 369, 364, 371, 446, 447, 260, 435, 440, + /* 1560 */ 451, 452, 325, 8, 9, 439, 268, 12, 13, 14, + /* 1570 */ 15, 16, 396, 244, 445, 265, 263, 394, 364, 325, + /* 1580 */ 456, 398, 434, 437, 401, 402, 403, 404, 405, 406, + /* 1590 */ 437, 408, 437, 356, 436, 20, 333, 337, 361, 450, + /* 1600 */ 449, 364, 400, 334, 382, 325, 369, 369, 371, 369, + /* 1610 */ 356, 369, 423, 424, 425, 361, 427, 428, 364, 166, + /* 1620 */ 369, 369, 369, 369, 337, 371, 382, 380, 352, 96, + /* 1630 */ 337, 394, 96, 325, 364, 398, 356, 454, 401, 402, + /* 1640 */ 403, 404, 405, 406, 364, 408, 418, 369, 394, 369, + /* 1650 */ 346, 371, 398, 333, 360, 401, 402, 403, 404, 405, + /* 1660 */ 406, 337, 408, 36, 356, 328, 327, 388, 350, 361, + /* 1670 */ 338, 350, 364, 392, 394, 350, 325, 369, 398, 371, + /* 1680 */ 323, 401, 402, 403, 404, 405, 406, 0, 408, 383, + /* 1690 */ 383, 0, 325, 188, 0, 0, 42, 0, 35, 200, + /* 1700 */ 35, 35, 394, 35, 200, 0, 398, 356, 35, 401, + /* 1710 */ 402, 403, 404, 405, 406, 364, 408, 35, 200, 164, + /* 1720 */ 369, 0, 371, 356, 200, 0, 0, 35, 22, 0, + /* 1730 */ 183, 364, 181, 35, 0, 385, 369, 0, 371, 177, + /* 1740 */ 176, 0, 0, 325, 0, 394, 47, 0, 0, 398, + /* 1750 */ 42, 0, 401, 402, 403, 404, 405, 406, 0, 408, + /* 1760 */ 0, 394, 0, 0, 0, 398, 0, 0, 401, 402, + /* 1770 */ 403, 404, 405, 406, 356, 408, 152, 427, 35, 0, + /* 1780 */ 152, 431, 364, 0, 0, 0, 325, 369, 0, 371, + /* 1790 */ 0, 0, 0, 0, 0, 0, 446, 447, 0, 0, + /* 1800 */ 0, 451, 452, 325, 0, 0, 0, 42, 0, 0, + /* 1810 */ 0, 0, 394, 0, 0, 0, 398, 356, 22, 401, + /* 1820 */ 402, 403, 404, 405, 406, 364, 408, 0, 0, 136, + /* 1830 */ 369, 0, 371, 58, 356, 0, 35, 0, 58, 0, + /* 1840 */ 14, 44, 364, 14, 42, 0, 39, 369, 0, 371, + /* 1850 */ 47, 0, 40, 0, 0, 394, 325, 39, 39, 398, + /* 1860 */ 172, 0, 401, 402, 403, 404, 405, 406, 47, 408, + /* 1870 */ 47, 0, 394, 325, 0, 0, 398, 35, 48, 401, + /* 1880 */ 402, 403, 404, 405, 406, 39, 408, 356, 64, 0, + /* 1890 */ 35, 48, 0, 35, 0, 364, 39, 48, 39, 35, + /* 1900 */ 369, 39, 371, 0, 356, 0, 0, 0, 48, 22, + /* 1910 */ 0, 35, 364, 35, 35, 22, 35, 369, 35, 371, + /* 1920 */ 103, 105, 22, 35, 325, 394, 44, 0, 44, 398, + /* 1930 */ 35, 35, 401, 402, 403, 404, 405, 406, 22, 408, + /* 1940 */ 0, 325, 394, 22, 0, 22, 398, 50, 35, 401, + /* 1950 */ 402, 403, 404, 405, 406, 356, 408, 0, 0, 35, + /* 1960 */ 35, 0, 97, 364, 22, 20, 35, 325, 369, 35, + /* 1970 */ 371, 193, 356, 96, 0, 0, 35, 22, 0, 0, + /* 1980 */ 364, 44, 249, 3, 325, 369, 164, 371, 97, 249, + /* 1990 */ 44, 44, 44, 394, 96, 96, 164, 398, 356, 166, + /* 2000 */ 401, 402, 403, 404, 405, 406, 364, 408, 164, 184, + /* 2010 */ 394, 369, 97, 371, 398, 356, 97, 401, 402, 403, + /* 2020 */ 404, 405, 406, 364, 408, 96, 170, 97, 369, 47, + /* 2030 */ 371, 96, 96, 47, 96, 325, 394, 3, 44, 35, + /* 2040 */ 398, 35, 35, 401, 402, 403, 404, 405, 406, 97, + /* 2050 */ 408, 97, 35, 394, 35, 35, 97, 398, 47, 97, + /* 2060 */ 401, 402, 403, 404, 405, 406, 356, 408, 44, 47, + /* 2070 */ 0, 0, 0, 96, 364, 167, 0, 96, 325, 369, + /* 2080 */ 97, 371, 97, 249, 243, 96, 96, 39, 96, 47, + /* 2090 */ 106, 165, 2, 44, 325, 228, 230, 228, 96, 22, + /* 2100 */ 97, 96, 47, 47, 394, 97, 96, 206, 398, 356, + /* 2110 */ 97, 401, 402, 403, 404, 405, 406, 364, 408, 96, + /* 2120 */ 22, 96, 369, 97, 371, 356, 208, 96, 107, 97, + /* 2130 */ 35, 35, 96, 364, 97, 35, 96, 35, 369, 96, + /* 2140 */ 371, 97, 97, 35, 97, 325, 96, 394, 35, 96, + /* 2150 */ 120, 398, 22, 120, 401, 402, 403, 404, 405, 406, + /* 2160 */ 108, 408, 96, 394, 44, 96, 120, 398, 35, 96, + /* 2170 */ 401, 402, 403, 404, 405, 406, 356, 408, 120, 22, + /* 2180 */ 64, 63, 35, 35, 364, 35, 35, 35, 325, 369, + /* 2190 */ 35, 371, 70, 35, 35, 35, 35, 93, 44, 35, + /* 2200 */ 35, 22, 35, 22, 35, 325, 35, 35, 70, 35, + /* 2210 */ 35, 35, 35, 35, 394, 22, 0, 35, 398, 356, + /* 2220 */ 35, 401, 402, 403, 404, 405, 406, 364, 408, 39, + /* 2230 */ 0, 48, 369, 35, 371, 48, 356, 0, 39, 35, + /* 2240 */ 48, 39, 0, 35, 364, 48, 39, 0, 35, 369, + /* 2250 */ 35, 371, 0, 22, 21, 20, 22, 394, 325, 457, + /* 2260 */ 22, 398, 21, 457, 401, 402, 403, 404, 405, 406, + /* 2270 */ 457, 408, 457, 457, 394, 325, 457, 457, 398, 457, + /* 2280 */ 457, 401, 402, 403, 404, 405, 406, 457, 408, 356, + /* 2290 */ 457, 457, 457, 457, 457, 457, 457, 364, 457, 457, + /* 2300 */ 457, 457, 369, 457, 371, 457, 356, 457, 457, 457, + /* 2310 */ 457, 457, 457, 457, 364, 457, 457, 457, 457, 369, + /* 2320 */ 457, 371, 457, 457, 457, 457, 325, 394, 457, 457, + /* 2330 */ 457, 398, 457, 457, 401, 402, 403, 404, 405, 406, + /* 2340 */ 457, 408, 457, 457, 394, 457, 457, 457, 398, 457, + /* 2350 */ 457, 401, 402, 403, 404, 405, 406, 356, 408, 457, + /* 2360 */ 457, 457, 457, 457, 457, 364, 457, 457, 457, 457, + /* 2370 */ 369, 457, 371, 457, 457, 457, 457, 457, 457, 457, + /* 2380 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2390 */ 457, 457, 457, 457, 457, 394, 457, 457, 457, 398, + /* 2400 */ 457, 457, 401, 402, 403, 404, 405, 406, 457, 408, + /* 2410 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2420 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2430 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2440 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2450 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2460 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2470 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2480 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2490 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2500 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2510 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2520 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2530 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2540 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2550 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2560 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2570 */ 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, + /* 2580 */ 457, 457, 457, 457, 457, }; -#define YY_SHIFT_COUNT (706) +#define YY_SHIFT_COUNT (709) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2151) +#define YY_SHIFT_MAX (2252) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 925, 0, 71, 0, 288, 288, 288, 288, 288, 288, - /* 10 */ 288, 288, 288, 359, 574, 574, 645, 574, 574, 574, - /* 20 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 30 */ 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, - /* 40 */ 574, 574, 574, 574, 574, 574, 61, 315, 211, 516, - /* 50 */ 62, 356, 399, 356, 211, 211, 1054, 1054, 356, 1054, - /* 60 */ 1054, 104, 356, 12, 12, 512, 512, 158, 31, 187, - /* 70 */ 187, 12, 12, 12, 12, 12, 12, 12, 12, 12, - /* 80 */ 12, 76, 12, 12, 168, 12, 442, 12, 12, 536, - /* 90 */ 12, 12, 536, 12, 536, 536, 536, 12, 498, 783, - /* 100 */ 34, 34, 162, 502, 1297, 1297, 1297, 1297, 1297, 1297, - /* 110 */ 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, - /* 120 */ 1297, 1297, 1297, 1298, 968, 158, 31, 661, 402, 217, - /* 130 */ 217, 217, 668, 312, 312, 402, 572, 572, 572, 508, - /* 140 */ 442, 3, 3, 393, 536, 536, 569, 569, 508, 576, - /* 150 */ 215, 215, 215, 215, 215, 215, 215, 571, 655, 522, - /* 160 */ 451, 867, 59, 327, 95, 591, 712, 573, 726, 479, - /* 170 */ 694, 733, 214, 964, 936, 214, 1059, 244, 864, 1036, - /* 180 */ 1262, 1145, 1283, 1307, 1283, 1187, 1330, 1330, 1283, 1187, - /* 190 */ 1187, 1266, 1330, 1330, 1330, 1361, 1361, 1365, 76, 442, - /* 200 */ 76, 1373, 1375, 76, 1373, 76, 76, 76, 1330, 76, - /* 210 */ 1357, 1357, 1361, 536, 536, 536, 536, 536, 536, 536, - /* 220 */ 536, 536, 536, 536, 1330, 1361, 569, 1245, 1365, 498, - /* 230 */ 1264, 442, 498, 1330, 1307, 1307, 569, 1202, 1205, 569, - /* 240 */ 1202, 1205, 569, 569, 536, 1199, 1317, 1202, 1240, 1242, - /* 250 */ 1258, 1036, 1241, 1243, 1247, 1270, 572, 1495, 1330, 1373, - /* 260 */ 498, 1205, 569, 569, 569, 569, 569, 1205, 569, 1367, - /* 270 */ 498, 508, 498, 572, 1445, 1448, 569, 576, 1330, 498, - /* 280 */ 1528, 1361, 2544, 2544, 2544, 2544, 2544, 2544, 2544, 826, - /* 290 */ 92, 742, 587, 418, 15, 735, 374, 832, 400, 941, - /* 300 */ 941, 544, 941, 941, 941, 941, 941, 941, 941, 987, - /* 310 */ 314, 51, 410, 73, 73, 167, 666, 180, 19, 292, - /* 320 */ 121, 99, 406, 121, 121, 121, 929, 829, 1071, 1066, - /* 330 */ 989, 1007, 933, 945, 1064, 1113, 1146, 1154, 1190, 986, - /* 340 */ 1134, 1181, 1078, 907, 323, 260, 1182, 1183, 1186, 1189, - /* 350 */ 1191, 981, 1193, 1040, 1084, 58, 1206, 1144, 1223, 1224, - /* 360 */ 1249, 1260, 1273, 1274, 1051, 1276, 1301, 1211, 1284, 1576, - /* 370 */ 1578, 1393, 1581, 1582, 1541, 1584, 1551, 1388, 1553, 1554, - /* 380 */ 1556, 1394, 1592, 1559, 1560, 1397, 1597, 1400, 1601, 1567, - /* 390 */ 1606, 1593, 1613, 1583, 1435, 1439, 1620, 1621, 1446, 1450, - /* 400 */ 1623, 1626, 1580, 1630, 1633, 1634, 1599, 1643, 1644, 1645, - /* 410 */ 1646, 1647, 1648, 1650, 1651, 1501, 1618, 1656, 1506, 1659, - /* 420 */ 1660, 1667, 1669, 1670, 1671, 1672, 1673, 1680, 1681, 1682, - /* 430 */ 1683, 1684, 1685, 1687, 1635, 1678, 1688, 1689, 1690, 1695, - /* 440 */ 1653, 1676, 1696, 1697, 1557, 1693, 1698, 1665, 1702, 1649, - /* 450 */ 1703, 1652, 1704, 1706, 1666, 1677, 1668, 1662, 1701, 1664, - /* 460 */ 1705, 1674, 1717, 1686, 1691, 1722, 1723, 1725, 1700, 1558, - /* 470 */ 1727, 1740, 1741, 1699, 1742, 1744, 1710, 1708, 1707, 1748, - /* 480 */ 1714, 1712, 1726, 1761, 1729, 1718, 1728, 1762, 1734, 1724, - /* 490 */ 1731, 1771, 1774, 1775, 1777, 1679, 1709, 1743, 1757, 1782, - /* 500 */ 1750, 1751, 1765, 1753, 1755, 1747, 1749, 1760, 1763, 1770, - /* 510 */ 1764, 1796, 1778, 1803, 1783, 1758, 1807, 1787, 1786, 1822, - /* 520 */ 1790, 1828, 1794, 1830, 1811, 1823, 1745, 1752, 1846, 1713, - /* 530 */ 1815, 1851, 1711, 1833, 1730, 1720, 1852, 1864, 1732, 1736, - /* 540 */ 1863, 1821, 1624, 1772, 1776, 1793, 1789, 1827, 1800, 1795, - /* 550 */ 1812, 1813, 1801, 1866, 1860, 1865, 1818, 1867, 1694, 1831, - /* 560 */ 1832, 1913, 1875, 1721, 1895, 1897, 1899, 1900, 1901, 1902, - /* 570 */ 1841, 1842, 1893, 1715, 1903, 1896, 1944, 1945, 1948, 1853, - /* 580 */ 1854, 1855, 1857, 1915, 1920, 1766, 1962, 1877, 1805, 1878, - /* 590 */ 1975, 1937, 1814, 1881, 1873, 1662, 1934, 1938, 1756, 1768, - /* 600 */ 1773, 1984, 1967, 1785, 1906, 1904, 1907, 1908, 1910, 1911, - /* 610 */ 1957, 1916, 1917, 1960, 1912, 1993, 1804, 1929, 1919, 1926, - /* 620 */ 1992, 1994, 1932, 1935, 1996, 1939, 1936, 1999, 1940, 1942, - /* 630 */ 2002, 1946, 1943, 2006, 1950, 1924, 1928, 1930, 1931, 2027, - /* 640 */ 1949, 1956, 1958, 2018, 1965, 2012, 2012, 2036, 2000, 2003, - /* 650 */ 2028, 2030, 2032, 2034, 2035, 2038, 2039, 2046, 2049, 2051, - /* 660 */ 2001, 1995, 2043, 2056, 2065, 2079, 2067, 2082, 2071, 2072, - /* 670 */ 2074, 2040, 1747, 2076, 1749, 2077, 2078, 2080, 2081, 2086, - /* 680 */ 2083, 2117, 2084, 2075, 2085, 2120, 2090, 2096, 2091, 2121, - /* 690 */ 2098, 2097, 2092, 2134, 2106, 2099, 2107, 2148, 2114, 2115, - /* 700 */ 2151, 2131, 2133, 2145, 2146, 2137, 2135, + /* 0 */ 933, 0, 134, 0, 268, 268, 268, 268, 268, 268, + /* 10 */ 268, 268, 268, 402, 536, 536, 670, 536, 536, 536, + /* 20 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 30 */ 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + /* 40 */ 536, 536, 536, 536, 536, 536, 55, 180, 65, 195, + /* 50 */ 26, 284, 330, 284, 65, 65, 947, 947, 284, 947, + /* 60 */ 947, 182, 284, 39, 39, 128, 128, 111, 272, 42, + /* 70 */ 42, 39, 39, 39, 39, 39, 39, 39, 39, 39, + /* 80 */ 39, 31, 39, 39, 105, 39, 137, 39, 39, 188, + /* 90 */ 39, 39, 188, 39, 188, 188, 188, 39, 140, 762, + /* 100 */ 949, 949, 438, 1131, 1056, 1056, 1056, 1056, 1056, 1056, + /* 110 */ 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1056, + /* 120 */ 1056, 1056, 1056, 965, 228, 111, 272, 659, 532, 269, + /* 130 */ 269, 269, 800, 370, 370, 532, 224, 224, 224, 213, + /* 140 */ 137, 33, 188, 351, 188, 351, 351, 213, 389, 909, + /* 150 */ 909, 909, 909, 909, 909, 909, 1044, 36, 793, 851, + /* 160 */ 975, 572, 115, 83, 72, 84, 517, 850, 1034, 986, + /* 170 */ 959, 843, 634, 865, 843, 1099, 857, 486, 1066, 1285, + /* 180 */ 1160, 1302, 1327, 1302, 1190, 1353, 1353, 1302, 1190, 1190, + /* 190 */ 1290, 1353, 1353, 1353, 1371, 1371, 1387, 31, 137, 31, + /* 200 */ 1392, 1407, 31, 1392, 31, 31, 31, 1353, 31, 1382, + /* 210 */ 1382, 1371, 188, 188, 188, 188, 188, 188, 188, 188, + /* 220 */ 188, 188, 188, 1353, 1371, 351, 351, 1250, 1387, 140, + /* 230 */ 1315, 137, 140, 1353, 1327, 1327, 351, 1262, 1268, 351, + /* 240 */ 1262, 1268, 351, 351, 188, 1283, 1374, 1262, 1282, 1297, + /* 250 */ 1300, 1066, 1298, 1310, 1313, 1329, 224, 1575, 1353, 1392, + /* 260 */ 140, 1268, 351, 351, 351, 351, 351, 1268, 351, 1453, + /* 270 */ 140, 213, 140, 224, 1533, 1536, 351, 389, 1353, 140, + /* 280 */ 1627, 1371, 2410, 2410, 2410, 2410, 2410, 2410, 2410, 2410, + /* 290 */ 2410, 858, 1027, 23, 1389, 52, 663, 449, 155, 672, + /* 300 */ 1289, 1555, 423, 756, 756, 756, 756, 756, 756, 756, + /* 310 */ 756, 756, 339, 190, 243, 243, 390, 378, 315, 523, + /* 320 */ 470, 518, 518, 696, 999, 168, 696, 696, 696, 884, + /* 330 */ 1076, 385, 1102, 1007, 1089, 956, 1073, 1106, 1107, 16, + /* 340 */ 1196, 1197, 1166, 1105, 1128, 1093, 1071, 972, 1051, 1135, + /* 350 */ 1169, 1173, 1178, 1199, 1232, 1215, 1085, 1110, 573, 1217, + /* 360 */ 1181, 1264, 1265, 1267, 1272, 1288, 1292, 1134, 1234, 1305, + /* 370 */ 1210, 1323, 1687, 1691, 1505, 1694, 1695, 1654, 1697, 1663, + /* 380 */ 1499, 1665, 1666, 1668, 1504, 1705, 1673, 1682, 1518, 1721, + /* 390 */ 1524, 1725, 1692, 1726, 1706, 1729, 1698, 1547, 1551, 1734, + /* 400 */ 1737, 1562, 1564, 1741, 1742, 1699, 1744, 1747, 1748, 1708, + /* 410 */ 1751, 1758, 1760, 1762, 1763, 1764, 1766, 1767, 1624, 1743, + /* 420 */ 1779, 1628, 1783, 1784, 1785, 1788, 1790, 1791, 1792, 1793, + /* 430 */ 1794, 1795, 1798, 1799, 1800, 1804, 1805, 1765, 1806, 1808, + /* 440 */ 1809, 1810, 1811, 1796, 1813, 1814, 1815, 1693, 1827, 1828, + /* 450 */ 1801, 1831, 1775, 1835, 1780, 1837, 1839, 1802, 1807, 1797, + /* 460 */ 1803, 1826, 1821, 1829, 1823, 1845, 1812, 1818, 1848, 1851, + /* 470 */ 1853, 1819, 1688, 1854, 1861, 1871, 1824, 1874, 1875, 1842, + /* 480 */ 1830, 1846, 1889, 1855, 1843, 1857, 1892, 1858, 1849, 1859, + /* 490 */ 1894, 1864, 1860, 1862, 1903, 1905, 1906, 1907, 1816, 1817, + /* 500 */ 1876, 1887, 1910, 1878, 1879, 1893, 1881, 1883, 1882, 1884, + /* 510 */ 1888, 1895, 1900, 1896, 1927, 1916, 1940, 1921, 1897, 1944, + /* 520 */ 1923, 1913, 1957, 1924, 1958, 1925, 1961, 1942, 1945, 1931, + /* 530 */ 1934, 1778, 1865, 1877, 1974, 1822, 1941, 1975, 1825, 1955, + /* 540 */ 1832, 1833, 1978, 1979, 1844, 1856, 1980, 1937, 1733, 1898, + /* 550 */ 1891, 1899, 1915, 1946, 1919, 1929, 1935, 1936, 1930, 1947, + /* 560 */ 1982, 1986, 1938, 1948, 1740, 1952, 1954, 2034, 1994, 1834, + /* 570 */ 2004, 2006, 2007, 2017, 2019, 2020, 1959, 1962, 2011, 1841, + /* 580 */ 2024, 2022, 2070, 2071, 2072, 1977, 1983, 1985, 1981, 1989, + /* 590 */ 1908, 1990, 2076, 2048, 1926, 1992, 1984, 1803, 2042, 2049, + /* 600 */ 1867, 1866, 1869, 2090, 2077, 1901, 2002, 2003, 2005, 2008, + /* 610 */ 2010, 2013, 2055, 2023, 2025, 2056, 2026, 2098, 1918, 2031, + /* 620 */ 2021, 2032, 2095, 2096, 2036, 2037, 2100, 2040, 2044, 2102, + /* 630 */ 2043, 2045, 2108, 2050, 2047, 2113, 2053, 2030, 2033, 2046, + /* 640 */ 2058, 2130, 2052, 2066, 2120, 2069, 2133, 2073, 2120, 2120, + /* 650 */ 2157, 2116, 2118, 2147, 2148, 2150, 2151, 2152, 2155, 2158, + /* 660 */ 2159, 2160, 2161, 2122, 2104, 2154, 2164, 2165, 2179, 2167, + /* 670 */ 2181, 2169, 2171, 2172, 2138, 1882, 2174, 1884, 2175, 2176, + /* 680 */ 2177, 2178, 2193, 2182, 2216, 2185, 2183, 2190, 2230, 2198, + /* 690 */ 2187, 2199, 2237, 2204, 2192, 2202, 2242, 2208, 2197, 2207, + /* 700 */ 2247, 2213, 2215, 2252, 2231, 2233, 2234, 2238, 2241, 2235, }; -#define YY_REDUCE_COUNT (288) -#define YY_REDUCE_MIN (-425) -#define YY_REDUCE_MAX (2136) +#define YY_REDUCE_COUNT (290) +#define YY_REDUCE_MIN (-422) +#define YY_REDUCE_MAX (2001) static const short yy_reduce_ofst[] = { - /* 0 */ -76, -288, 286, 597, 650, 737, 780, 851, 894, 937, - /* 10 */ 961, 1019, 1062, 1090, -2, 83, 1149, 1207, 1235, 1261, - /* 20 */ 1331, 1350, 1413, 1434, 1456, 1477, 1499, 1520, 1563, 1591, - /* 30 */ 1617, 1675, 1692, 1735, 1759, 1802, 1819, 1845, 1862, 1905, - /* 40 */ 1927, 1989, 2011, 2073, 2093, 2136, -253, -196, 290, -385, - /* 50 */ -374, -323, 584, 778, 395, 659, -212, 764, 28, 408, - /* 60 */ 681, -425, -352, 72, 270, -324, -313, -339, -215, 23, - /* 70 */ 64, 267, 285, 331, 613, 615, 626, 649, 695, 700, - /* 80 */ 728, 298, 660, 748, 22, 790, -326, 833, 842, -345, - /* 90 */ 854, 857, -260, 869, 287, -190, 354, 710, 7, -189, - /* 100 */ -407, -407, -305, -233, -125, -66, 151, 193, 194, 221, - /* 110 */ 294, 340, 357, 407, 413, 484, 504, 506, 518, 519, - /* 120 */ 596, 651, 656, -56, -257, 283, -301, -185, -38, -257, - /* 130 */ 11, 412, 111, 401, 533, 18, -172, 234, 446, 411, - /* 140 */ 78, 586, 595, 425, -291, 468, 520, 628, 680, 727, - /* 150 */ 320, 328, 363, 493, 652, 684, 715, 321, 673, 765, - /* 160 */ 731, 698, 670, 825, 756, 840, 840, 868, 860, 908, - /* 170 */ 874, 865, 814, 814, 798, 814, 827, 871, 840, 914, - /* 180 */ 921, 935, 951, 950, 970, 975, 1020, 1021, 984, 996, - /* 190 */ 999, 1033, 1044, 1045, 1046, 1057, 1058, 997, 1052, 1022, - /* 200 */ 1053, 1061, 1010, 1060, 1068, 1065, 1067, 1069, 1072, 1070, - /* 210 */ 1075, 1076, 1087, 1063, 1074, 1079, 1080, 1081, 1085, 1086, - /* 220 */ 1088, 1089, 1091, 1092, 1095, 1105, 1082, 1050, 1077, 1112, - /* 230 */ 1094, 1100, 1115, 1120, 1083, 1093, 1104, 1038, 1097, 1107, - /* 240 */ 1049, 1101, 1118, 1121, 840, 1096, 1073, 1098, 1102, 1099, - /* 250 */ 1103, 1111, 1055, 1106, 1109, 814, 1151, 1117, 1188, 1185, - /* 260 */ 1192, 1140, 1155, 1156, 1157, 1158, 1159, 1141, 1161, 1160, - /* 270 */ 1194, 1196, 1204, 1175, 1126, 1201, 1177, 1203, 1226, 1225, - /* 280 */ 1238, 1246, 1178, 1195, 1218, 1220, 1222, 1236, 1252, + /* 0 */ -186, -325, -226, -166, -32, 236, 642, -92, 176, 852, + /* 10 */ 880, 923, 951, 994, 333, 1012, 1055, 1108, 1129, 1183, + /* 20 */ 1237, 40, 1254, 1308, 442, 1280, 1351, 1367, 1418, 1461, + /* 30 */ 1478, 1531, 1548, 1599, 1616, 1642, 1659, 1710, 1753, 1769, + /* 40 */ 1820, 1863, 1880, 1933, 1950, 2001, -34, 350, 240, -340, + /* 50 */ 666, 1098, 1109, 1350, 776, 1189, 1070, 1083, -422, -326, + /* 60 */ -269, -410, -287, -206, -163, -328, -321, -350, -352, -26, + /* 70 */ 122, -307, -28, 163, 166, 174, 229, 239, 361, 362, + /* 80 */ 452, 46, 508, 621, -251, 639, 48, 706, 741, 177, + /* 90 */ 757, 786, 146, 847, 178, 152, 287, 509, -108, -299, + /* 100 */ -221, -221, -338, -207, -27, 172, 194, 322, 332, 375, + /* 110 */ 405, 462, 465, 466, 469, 480, 483, 529, 550, 627, + /* 120 */ 628, 630, 641, -33, -303, 275, -101, 271, -48, -303, + /* 130 */ 383, 474, 356, 302, 306, 25, -222, 64, 409, 380, + /* 140 */ 624, 562, 368, 609, 686, 638, 683, 689, 493, 143, + /* 150 */ 157, 203, 233, 241, 366, 429, 14, 556, 481, 317, + /* 160 */ 522, 565, 702, 633, 775, 775, 812, 772, 903, 905, + /* 170 */ 873, 860, 860, 842, 860, 885, 878, 775, 934, 939, + /* 180 */ 954, 970, 969, 984, 993, 1041, 1042, 1001, 1004, 1005, + /* 190 */ 1045, 1049, 1054, 1057, 1067, 1078, 1018, 1082, 1052, 1086, + /* 200 */ 1095, 1046, 1091, 1097, 1096, 1101, 1104, 1103, 1111, 1112, + /* 210 */ 1115, 1117, 1090, 1118, 1120, 1130, 1132, 1133, 1136, 1139, + /* 220 */ 1140, 1141, 1143, 1122, 1144, 1069, 1121, 1080, 1113, 1125, + /* 230 */ 1127, 1147, 1168, 1170, 1142, 1145, 1138, 1146, 1137, 1157, + /* 240 */ 1153, 1156, 1159, 1172, 775, 1119, 1126, 1155, 1158, 1123, + /* 250 */ 1148, 1176, 1124, 1149, 1151, 860, 1214, 1202, 1263, 1269, + /* 260 */ 1260, 1222, 1238, 1240, 1242, 1251, 1252, 1244, 1253, 1247, + /* 270 */ 1287, 1276, 1293, 1270, 1228, 1294, 1278, 1304, 1320, 1324, + /* 280 */ 1337, 1339, 1279, 1281, 1306, 1307, 1318, 1321, 1325, 1332, + /* 290 */ 1357, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 10 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 20 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 30 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 40 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 50 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 60 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1843, 1587, 1587, - /* 70 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 80 */ 1587, 1665, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 90 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1663, 1836, - /* 100 */ 2032, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 110 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 120 */ 1587, 1587, 1587, 1587, 2044, 1587, 1587, 1665, 1587, 2044, - /* 130 */ 2044, 2044, 1663, 2004, 2004, 1587, 1587, 1587, 1587, 1774, - /* 140 */ 1587, 1885, 1885, 1587, 1587, 1587, 1587, 1587, 1774, 1587, - /* 150 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1879, 1587, 1587, - /* 160 */ 2069, 2122, 1587, 1587, 2072, 1587, 1587, 1587, 1848, 1587, - /* 170 */ 1727, 2059, 2036, 2050, 2106, 2037, 2034, 2053, 1587, 2063, - /* 180 */ 1587, 1872, 1841, 1587, 1841, 1838, 1587, 1587, 1841, 1838, - /* 190 */ 1838, 1718, 1587, 1587, 1587, 1587, 1587, 1587, 1665, 1587, - /* 200 */ 1665, 1587, 1587, 1665, 1587, 1665, 1665, 1665, 1587, 1665, - /* 210 */ 1644, 1644, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 220 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1892, 1587, 1663, - /* 230 */ 1881, 1587, 1663, 1587, 1587, 1587, 1587, 2079, 2077, 1587, - /* 240 */ 2079, 2077, 1587, 1587, 1587, 2091, 2087, 2079, 2095, 2093, - /* 250 */ 2065, 2063, 2125, 2112, 2108, 2050, 1587, 1587, 1587, 1587, - /* 260 */ 1663, 2077, 1587, 1587, 1587, 1587, 1587, 2077, 1587, 1587, - /* 270 */ 1663, 1587, 1663, 1587, 1587, 1743, 1587, 1587, 1587, 1663, - /* 280 */ 1619, 1587, 1874, 1885, 1777, 1777, 1777, 1666, 1592, 1587, - /* 290 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 2090, - /* 300 */ 2089, 1587, 1960, 1587, 2008, 2007, 2006, 1997, 1959, 1587, - /* 310 */ 1739, 1587, 1587, 1958, 1957, 1587, 1587, 1587, 1587, 1587, - /* 320 */ 1951, 1587, 1587, 1952, 1950, 1949, 1587, 1587, 1587, 1587, - /* 330 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 340 */ 1587, 1587, 1587, 2109, 2113, 1587, 1587, 1587, 1587, 1587, - /* 350 */ 1587, 2033, 1587, 1587, 1587, 1587, 1587, 1934, 1587, 1587, - /* 360 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 370 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 380 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 390 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 400 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 410 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 420 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 430 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 440 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 450 */ 1587, 1587, 1587, 1587, 1587, 1587, 1624, 1939, 1587, 1587, - /* 460 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 470 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 480 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 490 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 500 */ 1587, 1587, 1587, 1587, 1587, 1705, 1704, 1587, 1587, 1587, - /* 510 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 520 */ 1587, 1587, 1587, 1587, 1587, 1587, 1942, 1587, 1587, 1587, - /* 530 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 540 */ 2105, 2066, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 550 */ 1587, 1587, 1587, 1587, 1587, 1934, 1587, 2088, 1587, 1587, - /* 560 */ 2103, 1587, 2107, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 570 */ 2043, 2039, 1587, 1587, 2035, 1587, 1587, 1587, 1587, 1587, - /* 580 */ 1587, 1587, 1587, 1587, 1587, 1587, 1889, 1587, 1587, 1587, - /* 590 */ 1587, 1587, 1587, 1587, 1587, 1933, 1587, 1994, 1587, 1587, - /* 600 */ 1587, 2028, 1587, 1587, 1979, 1587, 1587, 1587, 1587, 1587, - /* 610 */ 1587, 1587, 1587, 1587, 1942, 1587, 1945, 1587, 1587, 1587, - /* 620 */ 1587, 1587, 1771, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 630 */ 1587, 1587, 1587, 1587, 1587, 1756, 1754, 1753, 1752, 1587, - /* 640 */ 1749, 1587, 1587, 1587, 1587, 1780, 1779, 1587, 1587, 1587, - /* 650 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 660 */ 1587, 1587, 1685, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 670 */ 1587, 1587, 1676, 1587, 1675, 1587, 1587, 1587, 1587, 1587, - /* 680 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 690 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, - /* 700 */ 1587, 1587, 1587, 1587, 1587, 1587, 1587, + /* 0 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 10 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 20 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 30 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 40 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 50 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 60 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1849, 1592, 1592, + /* 70 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 80 */ 1592, 1670, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 90 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1668, 1842, + /* 100 */ 2039, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 110 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 120 */ 1592, 1592, 1592, 1592, 2051, 1592, 1592, 1670, 1592, 2051, + /* 130 */ 2051, 2051, 1668, 2011, 2011, 1592, 1592, 1592, 1592, 1779, + /* 140 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1779, 1592, 1592, + /* 150 */ 1592, 1592, 1592, 1592, 1592, 1592, 1886, 1592, 1592, 2076, + /* 160 */ 2129, 1592, 1592, 2079, 1592, 1592, 1592, 1854, 1592, 1732, + /* 170 */ 2066, 2043, 2057, 2113, 2044, 2041, 2060, 1592, 2070, 1592, + /* 180 */ 1879, 1847, 1592, 1847, 1844, 1592, 1592, 1847, 1844, 1844, + /* 190 */ 1723, 1592, 1592, 1592, 1592, 1592, 1592, 1670, 1592, 1670, + /* 200 */ 1592, 1592, 1670, 1592, 1670, 1670, 1670, 1592, 1670, 1649, + /* 210 */ 1649, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 220 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1899, 1592, 1668, + /* 230 */ 1888, 1592, 1668, 1592, 1592, 1592, 1592, 2086, 2084, 1592, + /* 240 */ 2086, 2084, 1592, 1592, 1592, 2098, 2094, 2086, 2102, 2100, + /* 250 */ 2072, 2070, 2132, 2119, 2115, 2057, 1592, 1592, 1592, 1592, + /* 260 */ 1668, 2084, 1592, 1592, 1592, 1592, 1592, 2084, 1592, 1592, + /* 270 */ 1668, 1592, 1668, 1592, 1592, 1748, 1592, 1592, 1592, 1668, + /* 280 */ 1624, 1592, 1881, 1892, 1864, 1864, 1782, 1782, 1782, 1671, + /* 290 */ 1597, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 300 */ 1592, 1592, 1592, 2097, 2096, 1967, 1592, 2015, 2014, 2013, + /* 310 */ 2004, 1966, 1744, 1592, 1965, 1964, 1592, 1592, 1592, 1592, + /* 320 */ 1592, 1860, 1859, 1958, 1592, 1592, 1959, 1957, 1956, 1592, + /* 330 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 340 */ 1592, 1592, 1592, 1592, 1592, 1592, 2116, 2120, 1592, 1592, + /* 350 */ 1592, 1592, 1592, 1592, 2040, 1592, 1592, 1592, 1592, 1592, + /* 360 */ 1941, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 370 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 380 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 390 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 400 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 410 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 420 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 430 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 440 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 450 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1629, + /* 460 */ 1946, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 470 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 480 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 490 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 500 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1710, 1709, + /* 510 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 520 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 530 */ 1592, 1592, 1949, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 540 */ 1592, 1592, 1592, 1592, 1592, 1592, 2112, 2073, 1592, 1592, + /* 550 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 560 */ 1592, 1941, 1592, 2095, 1592, 1592, 2110, 1592, 2114, 1592, + /* 570 */ 1592, 1592, 1592, 1592, 1592, 1592, 2050, 2046, 1592, 1592, + /* 580 */ 2042, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 590 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1940, 1592, 2001, + /* 600 */ 1592, 1592, 1592, 2035, 1592, 1592, 1986, 1592, 1592, 1592, + /* 610 */ 1592, 1592, 1592, 1592, 1592, 1592, 1949, 1592, 1952, 1592, + /* 620 */ 1592, 1592, 1592, 1592, 1776, 1592, 1592, 1592, 1592, 1592, + /* 630 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1761, 1759, 1758, + /* 640 */ 1757, 1592, 1754, 1592, 1789, 1592, 1592, 1592, 1785, 1784, + /* 650 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 660 */ 1592, 1592, 1592, 1592, 1592, 1690, 1592, 1592, 1592, 1592, + /* 670 */ 1592, 1592, 1592, 1592, 1592, 1681, 1592, 1680, 1592, 1592, + /* 680 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 690 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, + /* 700 */ 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1064,6 +1055,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* ROLLUP => nothing */ 0, /* TTL => nothing */ 0, /* SMA => nothing */ + 0, /* DELETE_MARK => nothing */ 0, /* FIRST => nothing */ 0, /* LAST => nothing */ 0, /* SHOW => nothing */ @@ -1159,7 +1151,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* COUNT => nothing */ 0, /* LAST_ROW => nothing */ 0, /* CASE => nothing */ - 268, /* END => ABORT */ + 269, /* END => ABORT */ 0, /* WHEN => nothing */ 0, /* THEN => nothing */ 0, /* ELSE => nothing */ @@ -1201,58 +1193,58 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 268, /* AFTER => ABORT */ - 268, /* ATTACH => ABORT */ - 268, /* BEFORE => ABORT */ - 268, /* BEGIN => ABORT */ - 268, /* BITAND => ABORT */ - 268, /* BITNOT => ABORT */ - 268, /* BITOR => ABORT */ - 268, /* BLOCKS => ABORT */ - 268, /* CHANGE => ABORT */ - 268, /* COMMA => ABORT */ - 268, /* COMPACT => ABORT */ - 268, /* CONCAT => ABORT */ - 268, /* CONFLICT => ABORT */ - 268, /* COPY => ABORT */ - 268, /* DEFERRED => ABORT */ - 268, /* DELIMITERS => ABORT */ - 268, /* DETACH => ABORT */ - 268, /* DIVIDE => ABORT */ - 268, /* DOT => ABORT */ - 268, /* EACH => ABORT */ - 268, /* FAIL => ABORT */ - 268, /* FILE => ABORT */ - 268, /* FOR => ABORT */ - 268, /* GLOB => ABORT */ - 268, /* ID => ABORT */ - 268, /* IMMEDIATE => ABORT */ - 268, /* IMPORT => ABORT */ - 268, /* INITIALLY => ABORT */ - 268, /* INSTEAD => ABORT */ - 268, /* ISNULL => ABORT */ - 268, /* KEY => ABORT */ - 268, /* MODULES => ABORT */ - 268, /* NK_BITNOT => ABORT */ - 268, /* NK_SEMI => ABORT */ - 268, /* NOTNULL => ABORT */ - 268, /* OF => ABORT */ - 268, /* PLUS => ABORT */ - 268, /* PRIVILEGE => ABORT */ - 268, /* RAISE => ABORT */ - 268, /* REPLACE => ABORT */ - 268, /* RESTRICT => ABORT */ - 268, /* ROW => ABORT */ - 268, /* SEMI => ABORT */ - 268, /* STAR => ABORT */ - 268, /* STATEMENT => ABORT */ - 268, /* STRING => ABORT */ - 268, /* TIMES => ABORT */ - 268, /* UPDATE => ABORT */ - 268, /* VALUES => ABORT */ - 268, /* VARIABLE => ABORT */ - 268, /* VIEW => ABORT */ - 268, /* WAL => ABORT */ + 269, /* AFTER => ABORT */ + 269, /* ATTACH => ABORT */ + 269, /* BEFORE => ABORT */ + 269, /* BEGIN => ABORT */ + 269, /* BITAND => ABORT */ + 269, /* BITNOT => ABORT */ + 269, /* BITOR => ABORT */ + 269, /* BLOCKS => ABORT */ + 269, /* CHANGE => ABORT */ + 269, /* COMMA => ABORT */ + 269, /* COMPACT => ABORT */ + 269, /* CONCAT => ABORT */ + 269, /* CONFLICT => ABORT */ + 269, /* COPY => ABORT */ + 269, /* DEFERRED => ABORT */ + 269, /* DELIMITERS => ABORT */ + 269, /* DETACH => ABORT */ + 269, /* DIVIDE => ABORT */ + 269, /* DOT => ABORT */ + 269, /* EACH => ABORT */ + 269, /* FAIL => ABORT */ + 269, /* FILE => ABORT */ + 269, /* FOR => ABORT */ + 269, /* GLOB => ABORT */ + 269, /* ID => ABORT */ + 269, /* IMMEDIATE => ABORT */ + 269, /* IMPORT => ABORT */ + 269, /* INITIALLY => ABORT */ + 269, /* INSTEAD => ABORT */ + 269, /* ISNULL => ABORT */ + 269, /* KEY => ABORT */ + 269, /* MODULES => ABORT */ + 269, /* NK_BITNOT => ABORT */ + 269, /* NK_SEMI => ABORT */ + 269, /* NOTNULL => ABORT */ + 269, /* OF => ABORT */ + 269, /* PLUS => ABORT */ + 269, /* PRIVILEGE => ABORT */ + 269, /* RAISE => ABORT */ + 269, /* REPLACE => ABORT */ + 269, /* RESTRICT => ABORT */ + 269, /* ROW => ABORT */ + 269, /* SEMI => ABORT */ + 269, /* STAR => ABORT */ + 269, /* STATEMENT => ABORT */ + 269, /* STRING => ABORT */ + 269, /* TIMES => ABORT */ + 269, /* UPDATE => ABORT */ + 269, /* VALUES => ABORT */ + 269, /* VARIABLE => ABORT */ + 269, /* VIEW => ABORT */ + 269, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1472,259 +1464,259 @@ static const char *const yyTokenName[] = { /* 129 */ "ROLLUP", /* 130 */ "TTL", /* 131 */ "SMA", - /* 132 */ "FIRST", - /* 133 */ "LAST", - /* 134 */ "SHOW", - /* 135 */ "PRIVILEGES", - /* 136 */ "DATABASES", - /* 137 */ "TABLES", - /* 138 */ "STABLES", - /* 139 */ "MNODES", - /* 140 */ "QNODES", - /* 141 */ "FUNCTIONS", - /* 142 */ "INDEXES", - /* 143 */ "ACCOUNTS", - /* 144 */ "APPS", - /* 145 */ "CONNECTIONS", - /* 146 */ "LICENCES", - /* 147 */ "GRANTS", - /* 148 */ "QUERIES", - /* 149 */ "SCORES", - /* 150 */ "TOPICS", - /* 151 */ "VARIABLES", - /* 152 */ "CLUSTER", - /* 153 */ "BNODES", - /* 154 */ "SNODES", - /* 155 */ "TRANSACTIONS", - /* 156 */ "DISTRIBUTED", - /* 157 */ "CONSUMERS", - /* 158 */ "SUBSCRIPTIONS", - /* 159 */ "VNODES", - /* 160 */ "LIKE", - /* 161 */ "TBNAME", - /* 162 */ "QTAGS", - /* 163 */ "AS", - /* 164 */ "INDEX", - /* 165 */ "FUNCTION", - /* 166 */ "INTERVAL", - /* 167 */ "TOPIC", - /* 168 */ "WITH", - /* 169 */ "META", - /* 170 */ "CONSUMER", - /* 171 */ "GROUP", - /* 172 */ "DESC", - /* 173 */ "DESCRIBE", - /* 174 */ "RESET", - /* 175 */ "QUERY", - /* 176 */ "CACHE", - /* 177 */ "EXPLAIN", - /* 178 */ "ANALYZE", - /* 179 */ "VERBOSE", - /* 180 */ "NK_BOOL", - /* 181 */ "RATIO", - /* 182 */ "NK_FLOAT", - /* 183 */ "OUTPUTTYPE", - /* 184 */ "AGGREGATE", - /* 185 */ "BUFSIZE", - /* 186 */ "STREAM", - /* 187 */ "INTO", - /* 188 */ "TRIGGER", - /* 189 */ "AT_ONCE", - /* 190 */ "WINDOW_CLOSE", - /* 191 */ "IGNORE", - /* 192 */ "EXPIRED", - /* 193 */ "FILL_HISTORY", - /* 194 */ "SUBTABLE", - /* 195 */ "KILL", - /* 196 */ "CONNECTION", - /* 197 */ "TRANSACTION", - /* 198 */ "BALANCE", - /* 199 */ "VGROUP", - /* 200 */ "MERGE", - /* 201 */ "REDISTRIBUTE", - /* 202 */ "SPLIT", - /* 203 */ "DELETE", - /* 204 */ "INSERT", - /* 205 */ "NULL", - /* 206 */ "NK_QUESTION", - /* 207 */ "NK_ARROW", - /* 208 */ "ROWTS", - /* 209 */ "QSTART", - /* 210 */ "QEND", - /* 211 */ "QDURATION", - /* 212 */ "WSTART", - /* 213 */ "WEND", - /* 214 */ "WDURATION", - /* 215 */ "IROWTS", - /* 216 */ "CAST", - /* 217 */ "NOW", - /* 218 */ "TODAY", - /* 219 */ "TIMEZONE", - /* 220 */ "CLIENT_VERSION", - /* 221 */ "SERVER_VERSION", - /* 222 */ "SERVER_STATUS", - /* 223 */ "CURRENT_USER", - /* 224 */ "COUNT", - /* 225 */ "LAST_ROW", - /* 226 */ "CASE", - /* 227 */ "END", - /* 228 */ "WHEN", - /* 229 */ "THEN", - /* 230 */ "ELSE", - /* 231 */ "BETWEEN", - /* 232 */ "IS", - /* 233 */ "NK_LT", - /* 234 */ "NK_GT", - /* 235 */ "NK_LE", - /* 236 */ "NK_GE", - /* 237 */ "NK_NE", - /* 238 */ "MATCH", - /* 239 */ "NMATCH", - /* 240 */ "CONTAINS", - /* 241 */ "IN", - /* 242 */ "JOIN", - /* 243 */ "INNER", - /* 244 */ "SELECT", - /* 245 */ "DISTINCT", - /* 246 */ "WHERE", - /* 247 */ "PARTITION", - /* 248 */ "BY", - /* 249 */ "SESSION", - /* 250 */ "STATE_WINDOW", - /* 251 */ "SLIDING", - /* 252 */ "FILL", - /* 253 */ "VALUE", - /* 254 */ "NONE", - /* 255 */ "PREV", - /* 256 */ "LINEAR", - /* 257 */ "NEXT", - /* 258 */ "HAVING", - /* 259 */ "RANGE", - /* 260 */ "EVERY", - /* 261 */ "ORDER", - /* 262 */ "SLIMIT", - /* 263 */ "SOFFSET", - /* 264 */ "LIMIT", - /* 265 */ "OFFSET", - /* 266 */ "ASC", - /* 267 */ "NULLS", - /* 268 */ "ABORT", - /* 269 */ "AFTER", - /* 270 */ "ATTACH", - /* 271 */ "BEFORE", - /* 272 */ "BEGIN", - /* 273 */ "BITAND", - /* 274 */ "BITNOT", - /* 275 */ "BITOR", - /* 276 */ "BLOCKS", - /* 277 */ "CHANGE", - /* 278 */ "COMMA", - /* 279 */ "COMPACT", - /* 280 */ "CONCAT", - /* 281 */ "CONFLICT", - /* 282 */ "COPY", - /* 283 */ "DEFERRED", - /* 284 */ "DELIMITERS", - /* 285 */ "DETACH", - /* 286 */ "DIVIDE", - /* 287 */ "DOT", - /* 288 */ "EACH", - /* 289 */ "FAIL", - /* 290 */ "FILE", - /* 291 */ "FOR", - /* 292 */ "GLOB", - /* 293 */ "ID", - /* 294 */ "IMMEDIATE", - /* 295 */ "IMPORT", - /* 296 */ "INITIALLY", - /* 297 */ "INSTEAD", - /* 298 */ "ISNULL", - /* 299 */ "KEY", - /* 300 */ "MODULES", - /* 301 */ "NK_BITNOT", - /* 302 */ "NK_SEMI", - /* 303 */ "NOTNULL", - /* 304 */ "OF", - /* 305 */ "PLUS", - /* 306 */ "PRIVILEGE", - /* 307 */ "RAISE", - /* 308 */ "REPLACE", - /* 309 */ "RESTRICT", - /* 310 */ "ROW", - /* 311 */ "SEMI", - /* 312 */ "STAR", - /* 313 */ "STATEMENT", - /* 314 */ "STRING", - /* 315 */ "TIMES", - /* 316 */ "UPDATE", - /* 317 */ "VALUES", - /* 318 */ "VARIABLE", - /* 319 */ "VIEW", - /* 320 */ "WAL", - /* 321 */ "cmd", - /* 322 */ "account_options", - /* 323 */ "alter_account_options", - /* 324 */ "literal", - /* 325 */ "alter_account_option", - /* 326 */ "user_name", - /* 327 */ "sysinfo_opt", - /* 328 */ "privileges", - /* 329 */ "priv_level", - /* 330 */ "priv_type_list", - /* 331 */ "priv_type", - /* 332 */ "db_name", - /* 333 */ "topic_name", - /* 334 */ "dnode_endpoint", - /* 335 */ "force_opt", - /* 336 */ "not_exists_opt", - /* 337 */ "db_options", - /* 338 */ "exists_opt", - /* 339 */ "alter_db_options", - /* 340 */ "speed_opt", - /* 341 */ "integer_list", - /* 342 */ "variable_list", - /* 343 */ "retention_list", - /* 344 */ "alter_db_option", - /* 345 */ "retention", - /* 346 */ "full_table_name", - /* 347 */ "column_def_list", - /* 348 */ "tags_def_opt", - /* 349 */ "table_options", - /* 350 */ "multi_create_clause", - /* 351 */ "tags_def", - /* 352 */ "multi_drop_clause", - /* 353 */ "alter_table_clause", - /* 354 */ "alter_table_options", - /* 355 */ "column_name", - /* 356 */ "type_name", - /* 357 */ "signed_literal", - /* 358 */ "create_subtable_clause", - /* 359 */ "specific_cols_opt", - /* 360 */ "expression_list", - /* 361 */ "drop_table_clause", - /* 362 */ "col_name_list", - /* 363 */ "table_name", - /* 364 */ "column_def", - /* 365 */ "duration_list", - /* 366 */ "rollup_func_list", - /* 367 */ "alter_table_option", - /* 368 */ "duration_literal", - /* 369 */ "rollup_func_name", - /* 370 */ "function_name", - /* 371 */ "col_name", - /* 372 */ "db_name_cond_opt", - /* 373 */ "like_pattern_opt", - /* 374 */ "table_name_cond", - /* 375 */ "from_db_opt", - /* 376 */ "tag_list_opt", - /* 377 */ "tag_item", - /* 378 */ "column_alias", - /* 379 */ "index_options", - /* 380 */ "func_list", - /* 381 */ "sliding_opt", - /* 382 */ "sma_stream_opt", - /* 383 */ "func", - /* 384 */ "stream_options", + /* 132 */ "DELETE_MARK", + /* 133 */ "FIRST", + /* 134 */ "LAST", + /* 135 */ "SHOW", + /* 136 */ "PRIVILEGES", + /* 137 */ "DATABASES", + /* 138 */ "TABLES", + /* 139 */ "STABLES", + /* 140 */ "MNODES", + /* 141 */ "QNODES", + /* 142 */ "FUNCTIONS", + /* 143 */ "INDEXES", + /* 144 */ "ACCOUNTS", + /* 145 */ "APPS", + /* 146 */ "CONNECTIONS", + /* 147 */ "LICENCES", + /* 148 */ "GRANTS", + /* 149 */ "QUERIES", + /* 150 */ "SCORES", + /* 151 */ "TOPICS", + /* 152 */ "VARIABLES", + /* 153 */ "CLUSTER", + /* 154 */ "BNODES", + /* 155 */ "SNODES", + /* 156 */ "TRANSACTIONS", + /* 157 */ "DISTRIBUTED", + /* 158 */ "CONSUMERS", + /* 159 */ "SUBSCRIPTIONS", + /* 160 */ "VNODES", + /* 161 */ "LIKE", + /* 162 */ "TBNAME", + /* 163 */ "QTAGS", + /* 164 */ "AS", + /* 165 */ "INDEX", + /* 166 */ "FUNCTION", + /* 167 */ "INTERVAL", + /* 168 */ "TOPIC", + /* 169 */ "WITH", + /* 170 */ "META", + /* 171 */ "CONSUMER", + /* 172 */ "GROUP", + /* 173 */ "DESC", + /* 174 */ "DESCRIBE", + /* 175 */ "RESET", + /* 176 */ "QUERY", + /* 177 */ "CACHE", + /* 178 */ "EXPLAIN", + /* 179 */ "ANALYZE", + /* 180 */ "VERBOSE", + /* 181 */ "NK_BOOL", + /* 182 */ "RATIO", + /* 183 */ "NK_FLOAT", + /* 184 */ "OUTPUTTYPE", + /* 185 */ "AGGREGATE", + /* 186 */ "BUFSIZE", + /* 187 */ "STREAM", + /* 188 */ "INTO", + /* 189 */ "TRIGGER", + /* 190 */ "AT_ONCE", + /* 191 */ "WINDOW_CLOSE", + /* 192 */ "IGNORE", + /* 193 */ "EXPIRED", + /* 194 */ "FILL_HISTORY", + /* 195 */ "SUBTABLE", + /* 196 */ "KILL", + /* 197 */ "CONNECTION", + /* 198 */ "TRANSACTION", + /* 199 */ "BALANCE", + /* 200 */ "VGROUP", + /* 201 */ "MERGE", + /* 202 */ "REDISTRIBUTE", + /* 203 */ "SPLIT", + /* 204 */ "DELETE", + /* 205 */ "INSERT", + /* 206 */ "NULL", + /* 207 */ "NK_QUESTION", + /* 208 */ "NK_ARROW", + /* 209 */ "ROWTS", + /* 210 */ "QSTART", + /* 211 */ "QEND", + /* 212 */ "QDURATION", + /* 213 */ "WSTART", + /* 214 */ "WEND", + /* 215 */ "WDURATION", + /* 216 */ "IROWTS", + /* 217 */ "CAST", + /* 218 */ "NOW", + /* 219 */ "TODAY", + /* 220 */ "TIMEZONE", + /* 221 */ "CLIENT_VERSION", + /* 222 */ "SERVER_VERSION", + /* 223 */ "SERVER_STATUS", + /* 224 */ "CURRENT_USER", + /* 225 */ "COUNT", + /* 226 */ "LAST_ROW", + /* 227 */ "CASE", + /* 228 */ "END", + /* 229 */ "WHEN", + /* 230 */ "THEN", + /* 231 */ "ELSE", + /* 232 */ "BETWEEN", + /* 233 */ "IS", + /* 234 */ "NK_LT", + /* 235 */ "NK_GT", + /* 236 */ "NK_LE", + /* 237 */ "NK_GE", + /* 238 */ "NK_NE", + /* 239 */ "MATCH", + /* 240 */ "NMATCH", + /* 241 */ "CONTAINS", + /* 242 */ "IN", + /* 243 */ "JOIN", + /* 244 */ "INNER", + /* 245 */ "SELECT", + /* 246 */ "DISTINCT", + /* 247 */ "WHERE", + /* 248 */ "PARTITION", + /* 249 */ "BY", + /* 250 */ "SESSION", + /* 251 */ "STATE_WINDOW", + /* 252 */ "SLIDING", + /* 253 */ "FILL", + /* 254 */ "VALUE", + /* 255 */ "NONE", + /* 256 */ "PREV", + /* 257 */ "LINEAR", + /* 258 */ "NEXT", + /* 259 */ "HAVING", + /* 260 */ "RANGE", + /* 261 */ "EVERY", + /* 262 */ "ORDER", + /* 263 */ "SLIMIT", + /* 264 */ "SOFFSET", + /* 265 */ "LIMIT", + /* 266 */ "OFFSET", + /* 267 */ "ASC", + /* 268 */ "NULLS", + /* 269 */ "ABORT", + /* 270 */ "AFTER", + /* 271 */ "ATTACH", + /* 272 */ "BEFORE", + /* 273 */ "BEGIN", + /* 274 */ "BITAND", + /* 275 */ "BITNOT", + /* 276 */ "BITOR", + /* 277 */ "BLOCKS", + /* 278 */ "CHANGE", + /* 279 */ "COMMA", + /* 280 */ "COMPACT", + /* 281 */ "CONCAT", + /* 282 */ "CONFLICT", + /* 283 */ "COPY", + /* 284 */ "DEFERRED", + /* 285 */ "DELIMITERS", + /* 286 */ "DETACH", + /* 287 */ "DIVIDE", + /* 288 */ "DOT", + /* 289 */ "EACH", + /* 290 */ "FAIL", + /* 291 */ "FILE", + /* 292 */ "FOR", + /* 293 */ "GLOB", + /* 294 */ "ID", + /* 295 */ "IMMEDIATE", + /* 296 */ "IMPORT", + /* 297 */ "INITIALLY", + /* 298 */ "INSTEAD", + /* 299 */ "ISNULL", + /* 300 */ "KEY", + /* 301 */ "MODULES", + /* 302 */ "NK_BITNOT", + /* 303 */ "NK_SEMI", + /* 304 */ "NOTNULL", + /* 305 */ "OF", + /* 306 */ "PLUS", + /* 307 */ "PRIVILEGE", + /* 308 */ "RAISE", + /* 309 */ "REPLACE", + /* 310 */ "RESTRICT", + /* 311 */ "ROW", + /* 312 */ "SEMI", + /* 313 */ "STAR", + /* 314 */ "STATEMENT", + /* 315 */ "STRING", + /* 316 */ "TIMES", + /* 317 */ "UPDATE", + /* 318 */ "VALUES", + /* 319 */ "VARIABLE", + /* 320 */ "VIEW", + /* 321 */ "WAL", + /* 322 */ "cmd", + /* 323 */ "account_options", + /* 324 */ "alter_account_options", + /* 325 */ "literal", + /* 326 */ "alter_account_option", + /* 327 */ "user_name", + /* 328 */ "sysinfo_opt", + /* 329 */ "privileges", + /* 330 */ "priv_level", + /* 331 */ "priv_type_list", + /* 332 */ "priv_type", + /* 333 */ "db_name", + /* 334 */ "topic_name", + /* 335 */ "dnode_endpoint", + /* 336 */ "force_opt", + /* 337 */ "not_exists_opt", + /* 338 */ "db_options", + /* 339 */ "exists_opt", + /* 340 */ "alter_db_options", + /* 341 */ "speed_opt", + /* 342 */ "integer_list", + /* 343 */ "variable_list", + /* 344 */ "retention_list", + /* 345 */ "alter_db_option", + /* 346 */ "retention", + /* 347 */ "full_table_name", + /* 348 */ "column_def_list", + /* 349 */ "tags_def_opt", + /* 350 */ "table_options", + /* 351 */ "multi_create_clause", + /* 352 */ "tags_def", + /* 353 */ "multi_drop_clause", + /* 354 */ "alter_table_clause", + /* 355 */ "alter_table_options", + /* 356 */ "column_name", + /* 357 */ "type_name", + /* 358 */ "signed_literal", + /* 359 */ "create_subtable_clause", + /* 360 */ "specific_cols_opt", + /* 361 */ "expression_list", + /* 362 */ "drop_table_clause", + /* 363 */ "col_name_list", + /* 364 */ "table_name", + /* 365 */ "column_def", + /* 366 */ "duration_list", + /* 367 */ "rollup_func_list", + /* 368 */ "alter_table_option", + /* 369 */ "duration_literal", + /* 370 */ "rollup_func_name", + /* 371 */ "function_name", + /* 372 */ "col_name", + /* 373 */ "db_name_cond_opt", + /* 374 */ "like_pattern_opt", + /* 375 */ "table_name_cond", + /* 376 */ "from_db_opt", + /* 377 */ "tag_list_opt", + /* 378 */ "tag_item", + /* 379 */ "column_alias", + /* 380 */ "index_options", + /* 381 */ "func_list", + /* 382 */ "sliding_opt", + /* 383 */ "sma_stream_opt", + /* 384 */ "func", /* 385 */ "query_or_subquery", /* 386 */ "cgroup_name", /* 387 */ "analyze_opt", @@ -1732,70 +1724,71 @@ static const char *const yyTokenName[] = { /* 389 */ "agg_func_opt", /* 390 */ "bufsize_opt", /* 391 */ "stream_name", - /* 392 */ "subtable_opt", - /* 393 */ "expression", - /* 394 */ "dnode_list", - /* 395 */ "where_clause_opt", - /* 396 */ "signed", - /* 397 */ "literal_func", - /* 398 */ "literal_list", - /* 399 */ "table_alias", - /* 400 */ "expr_or_subquery", - /* 401 */ "pseudo_column", - /* 402 */ "column_reference", - /* 403 */ "function_expression", - /* 404 */ "case_when_expression", - /* 405 */ "star_func", - /* 406 */ "star_func_para_list", - /* 407 */ "noarg_func", - /* 408 */ "other_para_list", - /* 409 */ "star_func_para", - /* 410 */ "when_then_list", - /* 411 */ "case_when_else_opt", - /* 412 */ "common_expression", - /* 413 */ "when_then_expr", - /* 414 */ "predicate", - /* 415 */ "compare_op", - /* 416 */ "in_op", - /* 417 */ "in_predicate_value", - /* 418 */ "boolean_value_expression", - /* 419 */ "boolean_primary", - /* 420 */ "from_clause_opt", - /* 421 */ "table_reference_list", - /* 422 */ "table_reference", - /* 423 */ "table_primary", - /* 424 */ "joined_table", - /* 425 */ "alias_opt", - /* 426 */ "subquery", - /* 427 */ "parenthesized_joined_table", - /* 428 */ "join_type", - /* 429 */ "search_condition", - /* 430 */ "query_specification", - /* 431 */ "set_quantifier_opt", - /* 432 */ "select_list", - /* 433 */ "partition_by_clause_opt", - /* 434 */ "range_opt", - /* 435 */ "every_opt", - /* 436 */ "fill_opt", - /* 437 */ "twindow_clause_opt", - /* 438 */ "group_by_clause_opt", - /* 439 */ "having_clause_opt", - /* 440 */ "select_item", - /* 441 */ "partition_list", - /* 442 */ "partition_item", - /* 443 */ "fill_mode", - /* 444 */ "group_by_list", - /* 445 */ "query_expression", - /* 446 */ "query_simple", - /* 447 */ "order_by_clause_opt", - /* 448 */ "slimit_clause_opt", - /* 449 */ "limit_clause_opt", - /* 450 */ "union_query_expression", - /* 451 */ "query_simple_or_subquery", - /* 452 */ "sort_specification_list", - /* 453 */ "sort_specification", - /* 454 */ "ordering_specification_opt", - /* 455 */ "null_ordering_opt", + /* 392 */ "stream_options", + /* 393 */ "subtable_opt", + /* 394 */ "expression", + /* 395 */ "dnode_list", + /* 396 */ "where_clause_opt", + /* 397 */ "signed", + /* 398 */ "literal_func", + /* 399 */ "literal_list", + /* 400 */ "table_alias", + /* 401 */ "expr_or_subquery", + /* 402 */ "pseudo_column", + /* 403 */ "column_reference", + /* 404 */ "function_expression", + /* 405 */ "case_when_expression", + /* 406 */ "star_func", + /* 407 */ "star_func_para_list", + /* 408 */ "noarg_func", + /* 409 */ "other_para_list", + /* 410 */ "star_func_para", + /* 411 */ "when_then_list", + /* 412 */ "case_when_else_opt", + /* 413 */ "common_expression", + /* 414 */ "when_then_expr", + /* 415 */ "predicate", + /* 416 */ "compare_op", + /* 417 */ "in_op", + /* 418 */ "in_predicate_value", + /* 419 */ "boolean_value_expression", + /* 420 */ "boolean_primary", + /* 421 */ "from_clause_opt", + /* 422 */ "table_reference_list", + /* 423 */ "table_reference", + /* 424 */ "table_primary", + /* 425 */ "joined_table", + /* 426 */ "alias_opt", + /* 427 */ "subquery", + /* 428 */ "parenthesized_joined_table", + /* 429 */ "join_type", + /* 430 */ "search_condition", + /* 431 */ "query_specification", + /* 432 */ "set_quantifier_opt", + /* 433 */ "select_list", + /* 434 */ "partition_by_clause_opt", + /* 435 */ "range_opt", + /* 436 */ "every_opt", + /* 437 */ "fill_opt", + /* 438 */ "twindow_clause_opt", + /* 439 */ "group_by_clause_opt", + /* 440 */ "having_clause_opt", + /* 441 */ "select_item", + /* 442 */ "partition_list", + /* 443 */ "partition_item", + /* 444 */ "fill_mode", + /* 445 */ "group_by_list", + /* 446 */ "query_expression", + /* 447 */ "query_simple", + /* 448 */ "order_by_clause_opt", + /* 449 */ "slimit_clause_opt", + /* 450 */ "limit_clause_opt", + /* 451 */ "union_query_expression", + /* 452 */ "query_simple_or_subquery", + /* 453 */ "sort_specification_list", + /* 454 */ "sort_specification", + /* 455 */ "ordering_specification_opt", + /* 456 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1997,350 +1990,352 @@ static const char *const yyRuleName[] = { /* 191 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", /* 192 */ "table_options ::= table_options TTL NK_INTEGER", /* 193 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 194 */ "alter_table_options ::= alter_table_option", - /* 195 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 196 */ "alter_table_option ::= COMMENT NK_STRING", - /* 197 */ "alter_table_option ::= TTL NK_INTEGER", - /* 198 */ "duration_list ::= duration_literal", - /* 199 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 200 */ "rollup_func_list ::= rollup_func_name", - /* 201 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 202 */ "rollup_func_name ::= function_name", - /* 203 */ "rollup_func_name ::= FIRST", - /* 204 */ "rollup_func_name ::= LAST", - /* 205 */ "col_name_list ::= col_name", - /* 206 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 207 */ "col_name ::= column_name", - /* 208 */ "cmd ::= SHOW DNODES", - /* 209 */ "cmd ::= SHOW USERS", - /* 210 */ "cmd ::= SHOW USER PRIVILEGES", - /* 211 */ "cmd ::= SHOW DATABASES", - /* 212 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 213 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 214 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 215 */ "cmd ::= SHOW MNODES", - /* 216 */ "cmd ::= SHOW QNODES", - /* 217 */ "cmd ::= SHOW FUNCTIONS", - /* 218 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 219 */ "cmd ::= SHOW STREAMS", - /* 220 */ "cmd ::= SHOW ACCOUNTS", - /* 221 */ "cmd ::= SHOW APPS", - /* 222 */ "cmd ::= SHOW CONNECTIONS", - /* 223 */ "cmd ::= SHOW LICENCES", - /* 224 */ "cmd ::= SHOW GRANTS", - /* 225 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 226 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 227 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 228 */ "cmd ::= SHOW QUERIES", - /* 229 */ "cmd ::= SHOW SCORES", - /* 230 */ "cmd ::= SHOW TOPICS", - /* 231 */ "cmd ::= SHOW VARIABLES", - /* 232 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 233 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 234 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 235 */ "cmd ::= SHOW BNODES", - /* 236 */ "cmd ::= SHOW SNODES", - /* 237 */ "cmd ::= SHOW CLUSTER", - /* 238 */ "cmd ::= SHOW TRANSACTIONS", - /* 239 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 240 */ "cmd ::= SHOW CONSUMERS", - /* 241 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 242 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 243 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 244 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 245 */ "cmd ::= SHOW VNODES NK_STRING", - /* 246 */ "db_name_cond_opt ::=", - /* 247 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 248 */ "like_pattern_opt ::=", - /* 249 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 250 */ "table_name_cond ::= table_name", - /* 251 */ "from_db_opt ::=", - /* 252 */ "from_db_opt ::= FROM db_name", - /* 253 */ "tag_list_opt ::=", - /* 254 */ "tag_list_opt ::= tag_item", - /* 255 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 256 */ "tag_item ::= TBNAME", - /* 257 */ "tag_item ::= QTAGS", - /* 258 */ "tag_item ::= column_name", - /* 259 */ "tag_item ::= column_name column_alias", - /* 260 */ "tag_item ::= column_name AS column_alias", - /* 261 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 262 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 263 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 265 */ "func_list ::= func", - /* 266 */ "func_list ::= func_list NK_COMMA func", - /* 267 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 268 */ "sma_stream_opt ::=", - /* 269 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 270 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 271 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 272 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 276 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 277 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 278 */ "cmd ::= DESC full_table_name", - /* 279 */ "cmd ::= DESCRIBE full_table_name", - /* 280 */ "cmd ::= RESET QUERY CACHE", - /* 281 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 282 */ "analyze_opt ::=", - /* 283 */ "analyze_opt ::= ANALYZE", - /* 284 */ "explain_options ::=", - /* 285 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 286 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 287 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 288 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 289 */ "agg_func_opt ::=", - /* 290 */ "agg_func_opt ::= AGGREGATE", - /* 291 */ "bufsize_opt ::=", - /* 292 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 293 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 294 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 295 */ "stream_options ::=", - /* 296 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 297 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 298 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 299 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 300 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 301 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 302 */ "subtable_opt ::=", - /* 303 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 304 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 305 */ "cmd ::= KILL QUERY NK_STRING", - /* 306 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 307 */ "cmd ::= BALANCE VGROUP", - /* 308 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 309 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 310 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 311 */ "dnode_list ::= DNODE NK_INTEGER", - /* 312 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 313 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 314 */ "cmd ::= query_or_subquery", - /* 315 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 316 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 317 */ "literal ::= NK_INTEGER", - /* 318 */ "literal ::= NK_FLOAT", - /* 319 */ "literal ::= NK_STRING", - /* 320 */ "literal ::= NK_BOOL", - /* 321 */ "literal ::= TIMESTAMP NK_STRING", - /* 322 */ "literal ::= duration_literal", - /* 323 */ "literal ::= NULL", - /* 324 */ "literal ::= NK_QUESTION", - /* 325 */ "duration_literal ::= NK_VARIABLE", - /* 326 */ "signed ::= NK_INTEGER", - /* 327 */ "signed ::= NK_PLUS NK_INTEGER", - /* 328 */ "signed ::= NK_MINUS NK_INTEGER", - /* 329 */ "signed ::= NK_FLOAT", - /* 330 */ "signed ::= NK_PLUS NK_FLOAT", - /* 331 */ "signed ::= NK_MINUS NK_FLOAT", - /* 332 */ "signed_literal ::= signed", - /* 333 */ "signed_literal ::= NK_STRING", - /* 334 */ "signed_literal ::= NK_BOOL", - /* 335 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 336 */ "signed_literal ::= duration_literal", - /* 337 */ "signed_literal ::= NULL", - /* 338 */ "signed_literal ::= literal_func", - /* 339 */ "signed_literal ::= NK_QUESTION", - /* 340 */ "literal_list ::= signed_literal", - /* 341 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 342 */ "db_name ::= NK_ID", - /* 343 */ "table_name ::= NK_ID", - /* 344 */ "column_name ::= NK_ID", - /* 345 */ "function_name ::= NK_ID", - /* 346 */ "table_alias ::= NK_ID", - /* 347 */ "column_alias ::= NK_ID", - /* 348 */ "user_name ::= NK_ID", - /* 349 */ "topic_name ::= NK_ID", - /* 350 */ "stream_name ::= NK_ID", - /* 351 */ "cgroup_name ::= NK_ID", - /* 352 */ "expr_or_subquery ::= expression", - /* 353 */ "expression ::= literal", - /* 354 */ "expression ::= pseudo_column", - /* 355 */ "expression ::= column_reference", - /* 356 */ "expression ::= function_expression", - /* 357 */ "expression ::= case_when_expression", - /* 358 */ "expression ::= NK_LP expression NK_RP", - /* 359 */ "expression ::= NK_PLUS expr_or_subquery", - /* 360 */ "expression ::= NK_MINUS expr_or_subquery", - /* 361 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 362 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 363 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 364 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 365 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 366 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 367 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 368 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 369 */ "expression_list ::= expr_or_subquery", - /* 370 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 371 */ "column_reference ::= column_name", - /* 372 */ "column_reference ::= table_name NK_DOT column_name", - /* 373 */ "pseudo_column ::= ROWTS", - /* 374 */ "pseudo_column ::= TBNAME", - /* 375 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 376 */ "pseudo_column ::= QSTART", - /* 377 */ "pseudo_column ::= QEND", - /* 378 */ "pseudo_column ::= QDURATION", - /* 379 */ "pseudo_column ::= WSTART", - /* 380 */ "pseudo_column ::= WEND", - /* 381 */ "pseudo_column ::= WDURATION", - /* 382 */ "pseudo_column ::= IROWTS", - /* 383 */ "pseudo_column ::= QTAGS", - /* 384 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 385 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 386 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 387 */ "function_expression ::= literal_func", - /* 388 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 389 */ "literal_func ::= NOW", - /* 390 */ "noarg_func ::= NOW", - /* 391 */ "noarg_func ::= TODAY", - /* 392 */ "noarg_func ::= TIMEZONE", - /* 393 */ "noarg_func ::= DATABASE", - /* 394 */ "noarg_func ::= CLIENT_VERSION", - /* 395 */ "noarg_func ::= SERVER_VERSION", - /* 396 */ "noarg_func ::= SERVER_STATUS", - /* 397 */ "noarg_func ::= CURRENT_USER", - /* 398 */ "noarg_func ::= USER", - /* 399 */ "star_func ::= COUNT", - /* 400 */ "star_func ::= FIRST", - /* 401 */ "star_func ::= LAST", - /* 402 */ "star_func ::= LAST_ROW", - /* 403 */ "star_func_para_list ::= NK_STAR", - /* 404 */ "star_func_para_list ::= other_para_list", - /* 405 */ "other_para_list ::= star_func_para", - /* 406 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 407 */ "star_func_para ::= expr_or_subquery", - /* 408 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 409 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 410 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 411 */ "when_then_list ::= when_then_expr", - /* 412 */ "when_then_list ::= when_then_list when_then_expr", - /* 413 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 414 */ "case_when_else_opt ::=", - /* 415 */ "case_when_else_opt ::= ELSE common_expression", - /* 416 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 417 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 418 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 419 */ "predicate ::= expr_or_subquery IS NULL", - /* 420 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 421 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 422 */ "compare_op ::= NK_LT", - /* 423 */ "compare_op ::= NK_GT", - /* 424 */ "compare_op ::= NK_LE", - /* 425 */ "compare_op ::= NK_GE", - /* 426 */ "compare_op ::= NK_NE", - /* 427 */ "compare_op ::= NK_EQ", - /* 428 */ "compare_op ::= LIKE", - /* 429 */ "compare_op ::= NOT LIKE", - /* 430 */ "compare_op ::= MATCH", - /* 431 */ "compare_op ::= NMATCH", - /* 432 */ "compare_op ::= CONTAINS", - /* 433 */ "in_op ::= IN", - /* 434 */ "in_op ::= NOT IN", - /* 435 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 436 */ "boolean_value_expression ::= boolean_primary", - /* 437 */ "boolean_value_expression ::= NOT boolean_primary", - /* 438 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 439 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 440 */ "boolean_primary ::= predicate", - /* 441 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 442 */ "common_expression ::= expr_or_subquery", - /* 443 */ "common_expression ::= boolean_value_expression", - /* 444 */ "from_clause_opt ::=", - /* 445 */ "from_clause_opt ::= FROM table_reference_list", - /* 446 */ "table_reference_list ::= table_reference", - /* 447 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 448 */ "table_reference ::= table_primary", - /* 449 */ "table_reference ::= joined_table", - /* 450 */ "table_primary ::= table_name alias_opt", - /* 451 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 452 */ "table_primary ::= subquery alias_opt", - /* 453 */ "table_primary ::= parenthesized_joined_table", - /* 454 */ "alias_opt ::=", - /* 455 */ "alias_opt ::= table_alias", - /* 456 */ "alias_opt ::= AS table_alias", - /* 457 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 458 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 459 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 460 */ "join_type ::=", - /* 461 */ "join_type ::= INNER", - /* 462 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 463 */ "set_quantifier_opt ::=", - /* 464 */ "set_quantifier_opt ::= DISTINCT", - /* 465 */ "set_quantifier_opt ::= ALL", - /* 466 */ "select_list ::= select_item", - /* 467 */ "select_list ::= select_list NK_COMMA select_item", - /* 468 */ "select_item ::= NK_STAR", - /* 469 */ "select_item ::= common_expression", - /* 470 */ "select_item ::= common_expression column_alias", - /* 471 */ "select_item ::= common_expression AS column_alias", - /* 472 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 473 */ "where_clause_opt ::=", - /* 474 */ "where_clause_opt ::= WHERE search_condition", - /* 475 */ "partition_by_clause_opt ::=", - /* 476 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 477 */ "partition_list ::= partition_item", - /* 478 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 479 */ "partition_item ::= expr_or_subquery", - /* 480 */ "partition_item ::= expr_or_subquery column_alias", - /* 481 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 482 */ "twindow_clause_opt ::=", - /* 483 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 484 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 485 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 486 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 487 */ "sliding_opt ::=", - /* 488 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 489 */ "fill_opt ::=", - /* 490 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 491 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 492 */ "fill_mode ::= NONE", - /* 493 */ "fill_mode ::= PREV", - /* 494 */ "fill_mode ::= NULL", - /* 495 */ "fill_mode ::= LINEAR", - /* 496 */ "fill_mode ::= NEXT", - /* 497 */ "group_by_clause_opt ::=", - /* 498 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 499 */ "group_by_list ::= expr_or_subquery", - /* 500 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 501 */ "having_clause_opt ::=", - /* 502 */ "having_clause_opt ::= HAVING search_condition", - /* 503 */ "range_opt ::=", - /* 504 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 505 */ "every_opt ::=", - /* 506 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 507 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 508 */ "query_simple ::= query_specification", - /* 509 */ "query_simple ::= union_query_expression", - /* 510 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 511 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 512 */ "query_simple_or_subquery ::= query_simple", - /* 513 */ "query_simple_or_subquery ::= subquery", - /* 514 */ "query_or_subquery ::= query_expression", - /* 515 */ "query_or_subquery ::= subquery", - /* 516 */ "order_by_clause_opt ::=", - /* 517 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 518 */ "slimit_clause_opt ::=", - /* 519 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 520 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 522 */ "limit_clause_opt ::=", - /* 523 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 524 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 526 */ "subquery ::= NK_LP query_expression NK_RP", - /* 527 */ "subquery ::= NK_LP subquery NK_RP", - /* 528 */ "search_condition ::= common_expression", - /* 529 */ "sort_specification_list ::= sort_specification", - /* 530 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 531 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 532 */ "ordering_specification_opt ::=", - /* 533 */ "ordering_specification_opt ::= ASC", - /* 534 */ "ordering_specification_opt ::= DESC", - /* 535 */ "null_ordering_opt ::=", - /* 536 */ "null_ordering_opt ::= NULLS FIRST", - /* 537 */ "null_ordering_opt ::= NULLS LAST", + /* 194 */ "table_options ::= table_options DELETE_MARK duration_list", + /* 195 */ "alter_table_options ::= alter_table_option", + /* 196 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 197 */ "alter_table_option ::= COMMENT NK_STRING", + /* 198 */ "alter_table_option ::= TTL NK_INTEGER", + /* 199 */ "duration_list ::= duration_literal", + /* 200 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 201 */ "rollup_func_list ::= rollup_func_name", + /* 202 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 203 */ "rollup_func_name ::= function_name", + /* 204 */ "rollup_func_name ::= FIRST", + /* 205 */ "rollup_func_name ::= LAST", + /* 206 */ "col_name_list ::= col_name", + /* 207 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 208 */ "col_name ::= column_name", + /* 209 */ "cmd ::= SHOW DNODES", + /* 210 */ "cmd ::= SHOW USERS", + /* 211 */ "cmd ::= SHOW USER PRIVILEGES", + /* 212 */ "cmd ::= SHOW DATABASES", + /* 213 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 214 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 215 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 216 */ "cmd ::= SHOW MNODES", + /* 217 */ "cmd ::= SHOW QNODES", + /* 218 */ "cmd ::= SHOW FUNCTIONS", + /* 219 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 220 */ "cmd ::= SHOW STREAMS", + /* 221 */ "cmd ::= SHOW ACCOUNTS", + /* 222 */ "cmd ::= SHOW APPS", + /* 223 */ "cmd ::= SHOW CONNECTIONS", + /* 224 */ "cmd ::= SHOW LICENCES", + /* 225 */ "cmd ::= SHOW GRANTS", + /* 226 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 227 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 228 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 229 */ "cmd ::= SHOW QUERIES", + /* 230 */ "cmd ::= SHOW SCORES", + /* 231 */ "cmd ::= SHOW TOPICS", + /* 232 */ "cmd ::= SHOW VARIABLES", + /* 233 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 234 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 235 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 236 */ "cmd ::= SHOW BNODES", + /* 237 */ "cmd ::= SHOW SNODES", + /* 238 */ "cmd ::= SHOW CLUSTER", + /* 239 */ "cmd ::= SHOW TRANSACTIONS", + /* 240 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 241 */ "cmd ::= SHOW CONSUMERS", + /* 242 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 243 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 244 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 245 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 246 */ "cmd ::= SHOW VNODES NK_STRING", + /* 247 */ "db_name_cond_opt ::=", + /* 248 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 249 */ "like_pattern_opt ::=", + /* 250 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 251 */ "table_name_cond ::= table_name", + /* 252 */ "from_db_opt ::=", + /* 253 */ "from_db_opt ::= FROM db_name", + /* 254 */ "tag_list_opt ::=", + /* 255 */ "tag_list_opt ::= tag_item", + /* 256 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 257 */ "tag_item ::= TBNAME", + /* 258 */ "tag_item ::= QTAGS", + /* 259 */ "tag_item ::= column_name", + /* 260 */ "tag_item ::= column_name column_alias", + /* 261 */ "tag_item ::= column_name AS column_alias", + /* 262 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 263 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 265 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 266 */ "func_list ::= func", + /* 267 */ "func_list ::= func_list NK_COMMA func", + /* 268 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 269 */ "sma_stream_opt ::=", + /* 270 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 271 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 272 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 278 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 279 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 280 */ "cmd ::= DESC full_table_name", + /* 281 */ "cmd ::= DESCRIBE full_table_name", + /* 282 */ "cmd ::= RESET QUERY CACHE", + /* 283 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 284 */ "analyze_opt ::=", + /* 285 */ "analyze_opt ::= ANALYZE", + /* 286 */ "explain_options ::=", + /* 287 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 288 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 289 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 290 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 291 */ "agg_func_opt ::=", + /* 292 */ "agg_func_opt ::= AGGREGATE", + /* 293 */ "bufsize_opt ::=", + /* 294 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 295 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 296 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 297 */ "stream_options ::=", + /* 298 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 299 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 300 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 301 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 302 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 303 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 304 */ "subtable_opt ::=", + /* 305 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 306 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 307 */ "cmd ::= KILL QUERY NK_STRING", + /* 308 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 309 */ "cmd ::= BALANCE VGROUP", + /* 310 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 311 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 312 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 313 */ "dnode_list ::= DNODE NK_INTEGER", + /* 314 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 315 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 316 */ "cmd ::= query_or_subquery", + /* 317 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 318 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 319 */ "literal ::= NK_INTEGER", + /* 320 */ "literal ::= NK_FLOAT", + /* 321 */ "literal ::= NK_STRING", + /* 322 */ "literal ::= NK_BOOL", + /* 323 */ "literal ::= TIMESTAMP NK_STRING", + /* 324 */ "literal ::= duration_literal", + /* 325 */ "literal ::= NULL", + /* 326 */ "literal ::= NK_QUESTION", + /* 327 */ "duration_literal ::= NK_VARIABLE", + /* 328 */ "signed ::= NK_INTEGER", + /* 329 */ "signed ::= NK_PLUS NK_INTEGER", + /* 330 */ "signed ::= NK_MINUS NK_INTEGER", + /* 331 */ "signed ::= NK_FLOAT", + /* 332 */ "signed ::= NK_PLUS NK_FLOAT", + /* 333 */ "signed ::= NK_MINUS NK_FLOAT", + /* 334 */ "signed_literal ::= signed", + /* 335 */ "signed_literal ::= NK_STRING", + /* 336 */ "signed_literal ::= NK_BOOL", + /* 337 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 338 */ "signed_literal ::= duration_literal", + /* 339 */ "signed_literal ::= NULL", + /* 340 */ "signed_literal ::= literal_func", + /* 341 */ "signed_literal ::= NK_QUESTION", + /* 342 */ "literal_list ::= signed_literal", + /* 343 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 344 */ "db_name ::= NK_ID", + /* 345 */ "table_name ::= NK_ID", + /* 346 */ "column_name ::= NK_ID", + /* 347 */ "function_name ::= NK_ID", + /* 348 */ "table_alias ::= NK_ID", + /* 349 */ "column_alias ::= NK_ID", + /* 350 */ "user_name ::= NK_ID", + /* 351 */ "topic_name ::= NK_ID", + /* 352 */ "stream_name ::= NK_ID", + /* 353 */ "cgroup_name ::= NK_ID", + /* 354 */ "expr_or_subquery ::= expression", + /* 355 */ "expression ::= literal", + /* 356 */ "expression ::= pseudo_column", + /* 357 */ "expression ::= column_reference", + /* 358 */ "expression ::= function_expression", + /* 359 */ "expression ::= case_when_expression", + /* 360 */ "expression ::= NK_LP expression NK_RP", + /* 361 */ "expression ::= NK_PLUS expr_or_subquery", + /* 362 */ "expression ::= NK_MINUS expr_or_subquery", + /* 363 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 364 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 365 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 366 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 367 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 368 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 369 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 370 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 371 */ "expression_list ::= expr_or_subquery", + /* 372 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 373 */ "column_reference ::= column_name", + /* 374 */ "column_reference ::= table_name NK_DOT column_name", + /* 375 */ "pseudo_column ::= ROWTS", + /* 376 */ "pseudo_column ::= TBNAME", + /* 377 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 378 */ "pseudo_column ::= QSTART", + /* 379 */ "pseudo_column ::= QEND", + /* 380 */ "pseudo_column ::= QDURATION", + /* 381 */ "pseudo_column ::= WSTART", + /* 382 */ "pseudo_column ::= WEND", + /* 383 */ "pseudo_column ::= WDURATION", + /* 384 */ "pseudo_column ::= IROWTS", + /* 385 */ "pseudo_column ::= QTAGS", + /* 386 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 387 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 388 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 389 */ "function_expression ::= literal_func", + /* 390 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 391 */ "literal_func ::= NOW", + /* 392 */ "noarg_func ::= NOW", + /* 393 */ "noarg_func ::= TODAY", + /* 394 */ "noarg_func ::= TIMEZONE", + /* 395 */ "noarg_func ::= DATABASE", + /* 396 */ "noarg_func ::= CLIENT_VERSION", + /* 397 */ "noarg_func ::= SERVER_VERSION", + /* 398 */ "noarg_func ::= SERVER_STATUS", + /* 399 */ "noarg_func ::= CURRENT_USER", + /* 400 */ "noarg_func ::= USER", + /* 401 */ "star_func ::= COUNT", + /* 402 */ "star_func ::= FIRST", + /* 403 */ "star_func ::= LAST", + /* 404 */ "star_func ::= LAST_ROW", + /* 405 */ "star_func_para_list ::= NK_STAR", + /* 406 */ "star_func_para_list ::= other_para_list", + /* 407 */ "other_para_list ::= star_func_para", + /* 408 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 409 */ "star_func_para ::= expr_or_subquery", + /* 410 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 411 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 412 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 413 */ "when_then_list ::= when_then_expr", + /* 414 */ "when_then_list ::= when_then_list when_then_expr", + /* 415 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 416 */ "case_when_else_opt ::=", + /* 417 */ "case_when_else_opt ::= ELSE common_expression", + /* 418 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 419 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 420 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 421 */ "predicate ::= expr_or_subquery IS NULL", + /* 422 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 423 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 424 */ "compare_op ::= NK_LT", + /* 425 */ "compare_op ::= NK_GT", + /* 426 */ "compare_op ::= NK_LE", + /* 427 */ "compare_op ::= NK_GE", + /* 428 */ "compare_op ::= NK_NE", + /* 429 */ "compare_op ::= NK_EQ", + /* 430 */ "compare_op ::= LIKE", + /* 431 */ "compare_op ::= NOT LIKE", + /* 432 */ "compare_op ::= MATCH", + /* 433 */ "compare_op ::= NMATCH", + /* 434 */ "compare_op ::= CONTAINS", + /* 435 */ "in_op ::= IN", + /* 436 */ "in_op ::= NOT IN", + /* 437 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 438 */ "boolean_value_expression ::= boolean_primary", + /* 439 */ "boolean_value_expression ::= NOT boolean_primary", + /* 440 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 441 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 442 */ "boolean_primary ::= predicate", + /* 443 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 444 */ "common_expression ::= expr_or_subquery", + /* 445 */ "common_expression ::= boolean_value_expression", + /* 446 */ "from_clause_opt ::=", + /* 447 */ "from_clause_opt ::= FROM table_reference_list", + /* 448 */ "table_reference_list ::= table_reference", + /* 449 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 450 */ "table_reference ::= table_primary", + /* 451 */ "table_reference ::= joined_table", + /* 452 */ "table_primary ::= table_name alias_opt", + /* 453 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 454 */ "table_primary ::= subquery alias_opt", + /* 455 */ "table_primary ::= parenthesized_joined_table", + /* 456 */ "alias_opt ::=", + /* 457 */ "alias_opt ::= table_alias", + /* 458 */ "alias_opt ::= AS table_alias", + /* 459 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 460 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 461 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 462 */ "join_type ::=", + /* 463 */ "join_type ::= INNER", + /* 464 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 465 */ "set_quantifier_opt ::=", + /* 466 */ "set_quantifier_opt ::= DISTINCT", + /* 467 */ "set_quantifier_opt ::= ALL", + /* 468 */ "select_list ::= select_item", + /* 469 */ "select_list ::= select_list NK_COMMA select_item", + /* 470 */ "select_item ::= NK_STAR", + /* 471 */ "select_item ::= common_expression", + /* 472 */ "select_item ::= common_expression column_alias", + /* 473 */ "select_item ::= common_expression AS column_alias", + /* 474 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 475 */ "where_clause_opt ::=", + /* 476 */ "where_clause_opt ::= WHERE search_condition", + /* 477 */ "partition_by_clause_opt ::=", + /* 478 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 479 */ "partition_list ::= partition_item", + /* 480 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 481 */ "partition_item ::= expr_or_subquery", + /* 482 */ "partition_item ::= expr_or_subquery column_alias", + /* 483 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 484 */ "twindow_clause_opt ::=", + /* 485 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 486 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 487 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 488 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 489 */ "sliding_opt ::=", + /* 490 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 491 */ "fill_opt ::=", + /* 492 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 493 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 494 */ "fill_mode ::= NONE", + /* 495 */ "fill_mode ::= PREV", + /* 496 */ "fill_mode ::= NULL", + /* 497 */ "fill_mode ::= LINEAR", + /* 498 */ "fill_mode ::= NEXT", + /* 499 */ "group_by_clause_opt ::=", + /* 500 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 501 */ "group_by_list ::= expr_or_subquery", + /* 502 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 503 */ "having_clause_opt ::=", + /* 504 */ "having_clause_opt ::= HAVING search_condition", + /* 505 */ "range_opt ::=", + /* 506 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 507 */ "every_opt ::=", + /* 508 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 509 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 510 */ "query_simple ::= query_specification", + /* 511 */ "query_simple ::= union_query_expression", + /* 512 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 513 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 514 */ "query_simple_or_subquery ::= query_simple", + /* 515 */ "query_simple_or_subquery ::= subquery", + /* 516 */ "query_or_subquery ::= query_expression", + /* 517 */ "query_or_subquery ::= subquery", + /* 518 */ "order_by_clause_opt ::=", + /* 519 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 520 */ "slimit_clause_opt ::=", + /* 521 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 522 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 524 */ "limit_clause_opt ::=", + /* 525 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 526 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 528 */ "subquery ::= NK_LP query_expression NK_RP", + /* 529 */ "subquery ::= NK_LP subquery NK_RP", + /* 530 */ "search_condition ::= common_expression", + /* 531 */ "sort_specification_list ::= sort_specification", + /* 532 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 533 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 534 */ "ordering_specification_opt ::=", + /* 535 */ "ordering_specification_opt ::= ASC", + /* 536 */ "ordering_specification_opt ::= DESC", + /* 537 */ "null_ordering_opt ::=", + /* 538 */ "null_ordering_opt ::= NULLS FIRST", + /* 539 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2467,193 +2462,193 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 321: /* cmd */ - case 324: /* literal */ - case 337: /* db_options */ - case 339: /* alter_db_options */ - case 345: /* retention */ - case 346: /* full_table_name */ - case 349: /* table_options */ - case 353: /* alter_table_clause */ - case 354: /* alter_table_options */ - case 357: /* signed_literal */ - case 358: /* create_subtable_clause */ - case 361: /* drop_table_clause */ - case 364: /* column_def */ - case 368: /* duration_literal */ - case 369: /* rollup_func_name */ - case 371: /* col_name */ - case 372: /* db_name_cond_opt */ - case 373: /* like_pattern_opt */ - case 374: /* table_name_cond */ - case 375: /* from_db_opt */ - case 377: /* tag_item */ - case 379: /* index_options */ - case 381: /* sliding_opt */ - case 382: /* sma_stream_opt */ - case 383: /* func */ - case 384: /* stream_options */ + case 322: /* cmd */ + case 325: /* literal */ + case 338: /* db_options */ + case 340: /* alter_db_options */ + case 346: /* retention */ + case 347: /* full_table_name */ + case 350: /* table_options */ + case 354: /* alter_table_clause */ + case 355: /* alter_table_options */ + case 358: /* signed_literal */ + case 359: /* create_subtable_clause */ + case 362: /* drop_table_clause */ + case 365: /* column_def */ + case 369: /* duration_literal */ + case 370: /* rollup_func_name */ + case 372: /* col_name */ + case 373: /* db_name_cond_opt */ + case 374: /* like_pattern_opt */ + case 375: /* table_name_cond */ + case 376: /* from_db_opt */ + case 378: /* tag_item */ + case 380: /* index_options */ + case 382: /* sliding_opt */ + case 383: /* sma_stream_opt */ + case 384: /* func */ case 385: /* query_or_subquery */ case 388: /* explain_options */ - case 392: /* subtable_opt */ - case 393: /* expression */ - case 395: /* where_clause_opt */ - case 396: /* signed */ - case 397: /* literal_func */ - case 400: /* expr_or_subquery */ - case 401: /* pseudo_column */ - case 402: /* column_reference */ - case 403: /* function_expression */ - case 404: /* case_when_expression */ - case 409: /* star_func_para */ - case 411: /* case_when_else_opt */ - case 412: /* common_expression */ - case 413: /* when_then_expr */ - case 414: /* predicate */ - case 417: /* in_predicate_value */ - case 418: /* boolean_value_expression */ - case 419: /* boolean_primary */ - case 420: /* from_clause_opt */ - case 421: /* table_reference_list */ - case 422: /* table_reference */ - case 423: /* table_primary */ - case 424: /* joined_table */ - case 426: /* subquery */ - case 427: /* parenthesized_joined_table */ - case 429: /* search_condition */ - case 430: /* query_specification */ - case 434: /* range_opt */ - case 435: /* every_opt */ - case 436: /* fill_opt */ - case 437: /* twindow_clause_opt */ - case 439: /* having_clause_opt */ - case 440: /* select_item */ - case 442: /* partition_item */ - case 445: /* query_expression */ - case 446: /* query_simple */ - case 448: /* slimit_clause_opt */ - case 449: /* limit_clause_opt */ - case 450: /* union_query_expression */ - case 451: /* query_simple_or_subquery */ - case 453: /* sort_specification */ + case 392: /* stream_options */ + case 393: /* subtable_opt */ + case 394: /* expression */ + case 396: /* where_clause_opt */ + case 397: /* signed */ + case 398: /* literal_func */ + case 401: /* expr_or_subquery */ + case 402: /* pseudo_column */ + case 403: /* column_reference */ + case 404: /* function_expression */ + case 405: /* case_when_expression */ + case 410: /* star_func_para */ + case 412: /* case_when_else_opt */ + case 413: /* common_expression */ + case 414: /* when_then_expr */ + case 415: /* predicate */ + case 418: /* in_predicate_value */ + case 419: /* boolean_value_expression */ + case 420: /* boolean_primary */ + case 421: /* from_clause_opt */ + case 422: /* table_reference_list */ + case 423: /* table_reference */ + case 424: /* table_primary */ + case 425: /* joined_table */ + case 427: /* subquery */ + case 428: /* parenthesized_joined_table */ + case 430: /* search_condition */ + case 431: /* query_specification */ + case 435: /* range_opt */ + case 436: /* every_opt */ + case 437: /* fill_opt */ + case 438: /* twindow_clause_opt */ + case 440: /* having_clause_opt */ + case 441: /* select_item */ + case 443: /* partition_item */ + case 446: /* query_expression */ + case 447: /* query_simple */ + case 449: /* slimit_clause_opt */ + case 450: /* limit_clause_opt */ + case 451: /* union_query_expression */ + case 452: /* query_simple_or_subquery */ + case 454: /* sort_specification */ { - nodesDestroyNode((yypminor->yy104)); + nodesDestroyNode((yypminor->yy148)); } break; - case 322: /* account_options */ - case 323: /* alter_account_options */ - case 325: /* alter_account_option */ - case 340: /* speed_opt */ + case 323: /* account_options */ + case 324: /* alter_account_options */ + case 326: /* alter_account_option */ + case 341: /* speed_opt */ case 390: /* bufsize_opt */ { } break; - case 326: /* user_name */ - case 329: /* priv_level */ - case 332: /* db_name */ - case 333: /* topic_name */ - case 334: /* dnode_endpoint */ - case 355: /* column_name */ - case 363: /* table_name */ - case 370: /* function_name */ - case 378: /* column_alias */ + case 327: /* user_name */ + case 330: /* priv_level */ + case 333: /* db_name */ + case 334: /* topic_name */ + case 335: /* dnode_endpoint */ + case 356: /* column_name */ + case 364: /* table_name */ + case 371: /* function_name */ + case 379: /* column_alias */ case 386: /* cgroup_name */ case 391: /* stream_name */ - case 399: /* table_alias */ - case 405: /* star_func */ - case 407: /* noarg_func */ - case 425: /* alias_opt */ + case 400: /* table_alias */ + case 406: /* star_func */ + case 408: /* noarg_func */ + case 426: /* alias_opt */ { } break; - case 327: /* sysinfo_opt */ + case 328: /* sysinfo_opt */ { } break; - case 328: /* privileges */ - case 330: /* priv_type_list */ - case 331: /* priv_type */ + case 329: /* privileges */ + case 331: /* priv_type_list */ + case 332: /* priv_type */ { } break; - case 335: /* force_opt */ - case 336: /* not_exists_opt */ - case 338: /* exists_opt */ + case 336: /* force_opt */ + case 337: /* not_exists_opt */ + case 339: /* exists_opt */ case 387: /* analyze_opt */ case 389: /* agg_func_opt */ - case 431: /* set_quantifier_opt */ + case 432: /* set_quantifier_opt */ { } break; - case 341: /* integer_list */ - case 342: /* variable_list */ - case 343: /* retention_list */ - case 347: /* column_def_list */ - case 348: /* tags_def_opt */ - case 350: /* multi_create_clause */ - case 351: /* tags_def */ - case 352: /* multi_drop_clause */ - case 359: /* specific_cols_opt */ - case 360: /* expression_list */ - case 362: /* col_name_list */ - case 365: /* duration_list */ - case 366: /* rollup_func_list */ - case 376: /* tag_list_opt */ - case 380: /* func_list */ - case 394: /* dnode_list */ - case 398: /* literal_list */ - case 406: /* star_func_para_list */ - case 408: /* other_para_list */ - case 410: /* when_then_list */ - case 432: /* select_list */ - case 433: /* partition_by_clause_opt */ - case 438: /* group_by_clause_opt */ - case 441: /* partition_list */ - case 444: /* group_by_list */ - case 447: /* order_by_clause_opt */ - case 452: /* sort_specification_list */ + case 342: /* integer_list */ + case 343: /* variable_list */ + case 344: /* retention_list */ + case 348: /* column_def_list */ + case 349: /* tags_def_opt */ + case 351: /* multi_create_clause */ + case 352: /* tags_def */ + case 353: /* multi_drop_clause */ + case 360: /* specific_cols_opt */ + case 361: /* expression_list */ + case 363: /* col_name_list */ + case 366: /* duration_list */ + case 367: /* rollup_func_list */ + case 377: /* tag_list_opt */ + case 381: /* func_list */ + case 395: /* dnode_list */ + case 399: /* literal_list */ + case 407: /* star_func_para_list */ + case 409: /* other_para_list */ + case 411: /* when_then_list */ + case 433: /* select_list */ + case 434: /* partition_by_clause_opt */ + case 439: /* group_by_clause_opt */ + case 442: /* partition_list */ + case 445: /* group_by_list */ + case 448: /* order_by_clause_opt */ + case 453: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy616)); + nodesDestroyList((yypminor->yy404)); } break; - case 344: /* alter_db_option */ - case 367: /* alter_table_option */ + case 345: /* alter_db_option */ + case 368: /* alter_table_option */ { } break; - case 356: /* type_name */ + case 357: /* type_name */ { } break; - case 415: /* compare_op */ - case 416: /* in_op */ + case 416: /* compare_op */ + case 417: /* in_op */ { } break; - case 428: /* join_type */ + case 429: /* join_type */ { } break; - case 443: /* fill_mode */ + case 444: /* fill_mode */ { } break; - case 454: /* ordering_specification_opt */ + case 455: /* ordering_specification_opt */ { } break; - case 455: /* null_ordering_opt */ + case 456: /* null_ordering_opt */ { } @@ -2952,544 +2947,546 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 321, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - { 321, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - { 322, 0 }, /* (2) account_options ::= */ - { 322, -3 }, /* (3) account_options ::= account_options PPS literal */ - { 322, -3 }, /* (4) account_options ::= account_options TSERIES literal */ - { 322, -3 }, /* (5) account_options ::= account_options STORAGE literal */ - { 322, -3 }, /* (6) account_options ::= account_options STREAMS literal */ - { 322, -3 }, /* (7) account_options ::= account_options QTIME literal */ - { 322, -3 }, /* (8) account_options ::= account_options DBS literal */ - { 322, -3 }, /* (9) account_options ::= account_options USERS literal */ - { 322, -3 }, /* (10) account_options ::= account_options CONNS literal */ - { 322, -3 }, /* (11) account_options ::= account_options STATE literal */ - { 323, -1 }, /* (12) alter_account_options ::= alter_account_option */ - { 323, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - { 325, -2 }, /* (14) alter_account_option ::= PASS literal */ - { 325, -2 }, /* (15) alter_account_option ::= PPS literal */ - { 325, -2 }, /* (16) alter_account_option ::= TSERIES literal */ - { 325, -2 }, /* (17) alter_account_option ::= STORAGE literal */ - { 325, -2 }, /* (18) alter_account_option ::= STREAMS literal */ - { 325, -2 }, /* (19) alter_account_option ::= QTIME literal */ - { 325, -2 }, /* (20) alter_account_option ::= DBS literal */ - { 325, -2 }, /* (21) alter_account_option ::= USERS literal */ - { 325, -2 }, /* (22) alter_account_option ::= CONNS literal */ - { 325, -2 }, /* (23) alter_account_option ::= STATE literal */ - { 321, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ - { 321, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ - { 321, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - { 321, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - { 321, -3 }, /* (28) cmd ::= DROP USER user_name */ - { 327, 0 }, /* (29) sysinfo_opt ::= */ - { 327, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ - { 321, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ - { 321, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ - { 328, -1 }, /* (33) privileges ::= ALL */ - { 328, -1 }, /* (34) privileges ::= priv_type_list */ - { 328, -1 }, /* (35) privileges ::= SUBSCRIBE */ - { 330, -1 }, /* (36) priv_type_list ::= priv_type */ - { 330, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - { 331, -1 }, /* (38) priv_type ::= READ */ - { 331, -1 }, /* (39) priv_type ::= WRITE */ - { 329, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ - { 329, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ - { 329, -1 }, /* (42) priv_level ::= topic_name */ - { 321, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ - { 321, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - { 321, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ - { 321, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ - { 321, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - { 321, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - { 321, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ - { 321, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - { 334, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ - { 334, -1 }, /* (52) dnode_endpoint ::= NK_ID */ - { 334, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ - { 335, 0 }, /* (54) force_opt ::= */ - { 335, -1 }, /* (55) force_opt ::= FORCE */ - { 321, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ - { 321, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - { 321, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - { 321, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - { 321, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ - { 321, -2 }, /* (68) cmd ::= USE db_name */ - { 321, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ - { 321, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ - { 321, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ - { 336, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ - { 336, 0 }, /* (73) not_exists_opt ::= */ - { 338, -2 }, /* (74) exists_opt ::= IF EXISTS */ - { 338, 0 }, /* (75) exists_opt ::= */ - { 337, 0 }, /* (76) db_options ::= */ - { 337, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ - { 337, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ - { 337, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ - { 337, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ - { 337, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ - { 337, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ - { 337, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ - { 337, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ - { 337, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ - { 337, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ - { 337, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ - { 337, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - { 337, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ - { 337, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ - { 337, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ - { 337, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ - { 337, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - { 337, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ - { 337, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ - { 337, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - { 337, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - { 337, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - { 337, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - { 337, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - { 337, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - { 337, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - { 337, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - { 337, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ - { 337, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ - { 339, -1 }, /* (108) alter_db_options ::= alter_db_option */ - { 339, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ - { 344, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ - { 344, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ - { 344, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ - { 344, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - { 344, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ - { 344, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ - { 344, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ - { 344, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ - { 344, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ - { 344, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 344, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 341, -1 }, /* (121) integer_list ::= NK_INTEGER */ - { 341, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 342, -1 }, /* (123) variable_list ::= NK_VARIABLE */ - { 342, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 343, -1 }, /* (125) retention_list ::= retention */ - { 343, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ - { 345, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 340, 0 }, /* (128) speed_opt ::= */ - { 340, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 321, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 321, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ - { 321, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 321, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ - { 321, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ - { 321, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ - { 321, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ - { 353, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ - { 353, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 353, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 353, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 353, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 353, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 353, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 353, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 353, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 353, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 350, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ - { 350, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 358, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 352, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ - { 352, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 361, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ - { 359, 0 }, /* (153) specific_cols_opt ::= */ - { 359, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 346, -1 }, /* (155) full_table_name ::= table_name */ - { 346, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ - { 347, -1 }, /* (157) column_def_list ::= column_def */ - { 347, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ - { 364, -2 }, /* (159) column_def ::= column_name type_name */ - { 364, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ - { 356, -1 }, /* (161) type_name ::= BOOL */ - { 356, -1 }, /* (162) type_name ::= TINYINT */ - { 356, -1 }, /* (163) type_name ::= SMALLINT */ - { 356, -1 }, /* (164) type_name ::= INT */ - { 356, -1 }, /* (165) type_name ::= INTEGER */ - { 356, -1 }, /* (166) type_name ::= BIGINT */ - { 356, -1 }, /* (167) type_name ::= FLOAT */ - { 356, -1 }, /* (168) type_name ::= DOUBLE */ - { 356, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (170) type_name ::= TIMESTAMP */ - { 356, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ - { 356, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ - { 356, -2 }, /* (174) type_name ::= INT UNSIGNED */ - { 356, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ - { 356, -1 }, /* (176) type_name ::= JSON */ - { 356, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (178) type_name ::= MEDIUMBLOB */ - { 356, -1 }, /* (179) type_name ::= BLOB */ - { 356, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 356, -1 }, /* (181) type_name ::= DECIMAL */ - { 356, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 356, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 348, 0 }, /* (184) tags_def_opt ::= */ - { 348, -1 }, /* (185) tags_def_opt ::= tags_def */ - { 351, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 349, 0 }, /* (187) table_options ::= */ - { 349, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ - { 349, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ - { 349, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ - { 349, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 349, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ - { 349, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 354, -1 }, /* (194) alter_table_options ::= alter_table_option */ - { 354, -2 }, /* (195) alter_table_options ::= alter_table_options alter_table_option */ - { 367, -2 }, /* (196) alter_table_option ::= COMMENT NK_STRING */ - { 367, -2 }, /* (197) alter_table_option ::= TTL NK_INTEGER */ - { 365, -1 }, /* (198) duration_list ::= duration_literal */ - { 365, -3 }, /* (199) duration_list ::= duration_list NK_COMMA duration_literal */ - { 366, -1 }, /* (200) rollup_func_list ::= rollup_func_name */ - { 366, -3 }, /* (201) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 369, -1 }, /* (202) rollup_func_name ::= function_name */ - { 369, -1 }, /* (203) rollup_func_name ::= FIRST */ - { 369, -1 }, /* (204) rollup_func_name ::= LAST */ - { 362, -1 }, /* (205) col_name_list ::= col_name */ - { 362, -3 }, /* (206) col_name_list ::= col_name_list NK_COMMA col_name */ - { 371, -1 }, /* (207) col_name ::= column_name */ - { 321, -2 }, /* (208) cmd ::= SHOW DNODES */ - { 321, -2 }, /* (209) cmd ::= SHOW USERS */ - { 321, -3 }, /* (210) cmd ::= SHOW USER PRIVILEGES */ - { 321, -2 }, /* (211) cmd ::= SHOW DATABASES */ - { 321, -4 }, /* (212) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 321, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 321, -3 }, /* (214) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 321, -2 }, /* (215) cmd ::= SHOW MNODES */ - { 321, -2 }, /* (216) cmd ::= SHOW QNODES */ - { 321, -2 }, /* (217) cmd ::= SHOW FUNCTIONS */ - { 321, -5 }, /* (218) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 321, -2 }, /* (219) cmd ::= SHOW STREAMS */ - { 321, -2 }, /* (220) cmd ::= SHOW ACCOUNTS */ - { 321, -2 }, /* (221) cmd ::= SHOW APPS */ - { 321, -2 }, /* (222) cmd ::= SHOW CONNECTIONS */ - { 321, -2 }, /* (223) cmd ::= SHOW LICENCES */ - { 321, -2 }, /* (224) cmd ::= SHOW GRANTS */ - { 321, -4 }, /* (225) cmd ::= SHOW CREATE DATABASE db_name */ - { 321, -4 }, /* (226) cmd ::= SHOW CREATE TABLE full_table_name */ - { 321, -4 }, /* (227) cmd ::= SHOW CREATE STABLE full_table_name */ - { 321, -2 }, /* (228) cmd ::= SHOW QUERIES */ - { 321, -2 }, /* (229) cmd ::= SHOW SCORES */ - { 321, -2 }, /* (230) cmd ::= SHOW TOPICS */ - { 321, -2 }, /* (231) cmd ::= SHOW VARIABLES */ - { 321, -3 }, /* (232) cmd ::= SHOW CLUSTER VARIABLES */ - { 321, -3 }, /* (233) cmd ::= SHOW LOCAL VARIABLES */ - { 321, -5 }, /* (234) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - { 321, -2 }, /* (235) cmd ::= SHOW BNODES */ - { 321, -2 }, /* (236) cmd ::= SHOW SNODES */ - { 321, -2 }, /* (237) cmd ::= SHOW CLUSTER */ - { 321, -2 }, /* (238) cmd ::= SHOW TRANSACTIONS */ - { 321, -4 }, /* (239) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 321, -2 }, /* (240) cmd ::= SHOW CONSUMERS */ - { 321, -2 }, /* (241) cmd ::= SHOW SUBSCRIPTIONS */ - { 321, -5 }, /* (242) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 321, -7 }, /* (243) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - { 321, -3 }, /* (244) cmd ::= SHOW VNODES NK_INTEGER */ - { 321, -3 }, /* (245) cmd ::= SHOW VNODES NK_STRING */ - { 372, 0 }, /* (246) db_name_cond_opt ::= */ - { 372, -2 }, /* (247) db_name_cond_opt ::= db_name NK_DOT */ - { 373, 0 }, /* (248) like_pattern_opt ::= */ - { 373, -2 }, /* (249) like_pattern_opt ::= LIKE NK_STRING */ - { 374, -1 }, /* (250) table_name_cond ::= table_name */ - { 375, 0 }, /* (251) from_db_opt ::= */ - { 375, -2 }, /* (252) from_db_opt ::= FROM db_name */ - { 376, 0 }, /* (253) tag_list_opt ::= */ - { 376, -1 }, /* (254) tag_list_opt ::= tag_item */ - { 376, -3 }, /* (255) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - { 377, -1 }, /* (256) tag_item ::= TBNAME */ - { 377, -1 }, /* (257) tag_item ::= QTAGS */ - { 377, -1 }, /* (258) tag_item ::= column_name */ - { 377, -2 }, /* (259) tag_item ::= column_name column_alias */ - { 377, -3 }, /* (260) tag_item ::= column_name AS column_alias */ - { 321, -8 }, /* (261) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 321, -4 }, /* (262) cmd ::= DROP INDEX exists_opt full_table_name */ - { 379, -10 }, /* (263) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 379, -12 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - { 380, -1 }, /* (265) func_list ::= func */ - { 380, -3 }, /* (266) func_list ::= func_list NK_COMMA func */ - { 383, -4 }, /* (267) func ::= function_name NK_LP expression_list NK_RP */ - { 382, 0 }, /* (268) sma_stream_opt ::= */ - { 382, -3 }, /* (269) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 382, -3 }, /* (270) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 321, -6 }, /* (271) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 321, -7 }, /* (272) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 321, -9 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 321, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 321, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 321, -4 }, /* (276) cmd ::= DROP TOPIC exists_opt topic_name */ - { 321, -7 }, /* (277) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 321, -2 }, /* (278) cmd ::= DESC full_table_name */ - { 321, -2 }, /* (279) cmd ::= DESCRIBE full_table_name */ - { 321, -3 }, /* (280) cmd ::= RESET QUERY CACHE */ - { 321, -4 }, /* (281) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 387, 0 }, /* (282) analyze_opt ::= */ - { 387, -1 }, /* (283) analyze_opt ::= ANALYZE */ - { 388, 0 }, /* (284) explain_options ::= */ - { 388, -3 }, /* (285) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 388, -3 }, /* (286) explain_options ::= explain_options RATIO NK_FLOAT */ - { 321, -10 }, /* (287) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 321, -4 }, /* (288) cmd ::= DROP FUNCTION exists_opt function_name */ - { 389, 0 }, /* (289) agg_func_opt ::= */ - { 389, -1 }, /* (290) agg_func_opt ::= AGGREGATE */ - { 390, 0 }, /* (291) bufsize_opt ::= */ - { 390, -2 }, /* (292) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 321, -11 }, /* (293) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 321, -4 }, /* (294) cmd ::= DROP STREAM exists_opt stream_name */ - { 384, 0 }, /* (295) stream_options ::= */ - { 384, -3 }, /* (296) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 384, -3 }, /* (297) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 384, -4 }, /* (298) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 384, -3 }, /* (299) stream_options ::= stream_options WATERMARK duration_literal */ - { 384, -4 }, /* (300) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 384, -3 }, /* (301) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 392, 0 }, /* (302) subtable_opt ::= */ - { 392, -4 }, /* (303) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 321, -3 }, /* (304) cmd ::= KILL CONNECTION NK_INTEGER */ - { 321, -3 }, /* (305) cmd ::= KILL QUERY NK_STRING */ - { 321, -3 }, /* (306) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 321, -2 }, /* (307) cmd ::= BALANCE VGROUP */ - { 321, -4 }, /* (308) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 321, -4 }, /* (309) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 321, -3 }, /* (310) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 394, -2 }, /* (311) dnode_list ::= DNODE NK_INTEGER */ - { 394, -3 }, /* (312) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 321, -4 }, /* (313) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 321, -1 }, /* (314) cmd ::= query_or_subquery */ - { 321, -7 }, /* (315) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 321, -4 }, /* (316) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 324, -1 }, /* (317) literal ::= NK_INTEGER */ - { 324, -1 }, /* (318) literal ::= NK_FLOAT */ - { 324, -1 }, /* (319) literal ::= NK_STRING */ - { 324, -1 }, /* (320) literal ::= NK_BOOL */ - { 324, -2 }, /* (321) literal ::= TIMESTAMP NK_STRING */ - { 324, -1 }, /* (322) literal ::= duration_literal */ - { 324, -1 }, /* (323) literal ::= NULL */ - { 324, -1 }, /* (324) literal ::= NK_QUESTION */ - { 368, -1 }, /* (325) duration_literal ::= NK_VARIABLE */ - { 396, -1 }, /* (326) signed ::= NK_INTEGER */ - { 396, -2 }, /* (327) signed ::= NK_PLUS NK_INTEGER */ - { 396, -2 }, /* (328) signed ::= NK_MINUS NK_INTEGER */ - { 396, -1 }, /* (329) signed ::= NK_FLOAT */ - { 396, -2 }, /* (330) signed ::= NK_PLUS NK_FLOAT */ - { 396, -2 }, /* (331) signed ::= NK_MINUS NK_FLOAT */ - { 357, -1 }, /* (332) signed_literal ::= signed */ - { 357, -1 }, /* (333) signed_literal ::= NK_STRING */ - { 357, -1 }, /* (334) signed_literal ::= NK_BOOL */ - { 357, -2 }, /* (335) signed_literal ::= TIMESTAMP NK_STRING */ - { 357, -1 }, /* (336) signed_literal ::= duration_literal */ - { 357, -1 }, /* (337) signed_literal ::= NULL */ - { 357, -1 }, /* (338) signed_literal ::= literal_func */ - { 357, -1 }, /* (339) signed_literal ::= NK_QUESTION */ - { 398, -1 }, /* (340) literal_list ::= signed_literal */ - { 398, -3 }, /* (341) literal_list ::= literal_list NK_COMMA signed_literal */ - { 332, -1 }, /* (342) db_name ::= NK_ID */ - { 363, -1 }, /* (343) table_name ::= NK_ID */ - { 355, -1 }, /* (344) column_name ::= NK_ID */ - { 370, -1 }, /* (345) function_name ::= NK_ID */ - { 399, -1 }, /* (346) table_alias ::= NK_ID */ - { 378, -1 }, /* (347) column_alias ::= NK_ID */ - { 326, -1 }, /* (348) user_name ::= NK_ID */ - { 333, -1 }, /* (349) topic_name ::= NK_ID */ - { 391, -1 }, /* (350) stream_name ::= NK_ID */ - { 386, -1 }, /* (351) cgroup_name ::= NK_ID */ - { 400, -1 }, /* (352) expr_or_subquery ::= expression */ - { 393, -1 }, /* (353) expression ::= literal */ - { 393, -1 }, /* (354) expression ::= pseudo_column */ - { 393, -1 }, /* (355) expression ::= column_reference */ - { 393, -1 }, /* (356) expression ::= function_expression */ - { 393, -1 }, /* (357) expression ::= case_when_expression */ - { 393, -3 }, /* (358) expression ::= NK_LP expression NK_RP */ - { 393, -2 }, /* (359) expression ::= NK_PLUS expr_or_subquery */ - { 393, -2 }, /* (360) expression ::= NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (361) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 393, -3 }, /* (362) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 393, -3 }, /* (363) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 393, -3 }, /* (364) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 393, -3 }, /* (365) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 393, -3 }, /* (366) expression ::= column_reference NK_ARROW NK_STRING */ - { 393, -3 }, /* (367) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 393, -3 }, /* (368) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 360, -1 }, /* (369) expression_list ::= expr_or_subquery */ - { 360, -3 }, /* (370) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 402, -1 }, /* (371) column_reference ::= column_name */ - { 402, -3 }, /* (372) column_reference ::= table_name NK_DOT column_name */ - { 401, -1 }, /* (373) pseudo_column ::= ROWTS */ - { 401, -1 }, /* (374) pseudo_column ::= TBNAME */ - { 401, -3 }, /* (375) pseudo_column ::= table_name NK_DOT TBNAME */ - { 401, -1 }, /* (376) pseudo_column ::= QSTART */ - { 401, -1 }, /* (377) pseudo_column ::= QEND */ - { 401, -1 }, /* (378) pseudo_column ::= QDURATION */ - { 401, -1 }, /* (379) pseudo_column ::= WSTART */ - { 401, -1 }, /* (380) pseudo_column ::= WEND */ - { 401, -1 }, /* (381) pseudo_column ::= WDURATION */ - { 401, -1 }, /* (382) pseudo_column ::= IROWTS */ - { 401, -1 }, /* (383) pseudo_column ::= QTAGS */ - { 403, -4 }, /* (384) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 403, -4 }, /* (385) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 403, -6 }, /* (386) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 403, -1 }, /* (387) function_expression ::= literal_func */ - { 397, -3 }, /* (388) literal_func ::= noarg_func NK_LP NK_RP */ - { 397, -1 }, /* (389) literal_func ::= NOW */ - { 407, -1 }, /* (390) noarg_func ::= NOW */ - { 407, -1 }, /* (391) noarg_func ::= TODAY */ - { 407, -1 }, /* (392) noarg_func ::= TIMEZONE */ - { 407, -1 }, /* (393) noarg_func ::= DATABASE */ - { 407, -1 }, /* (394) noarg_func ::= CLIENT_VERSION */ - { 407, -1 }, /* (395) noarg_func ::= SERVER_VERSION */ - { 407, -1 }, /* (396) noarg_func ::= SERVER_STATUS */ - { 407, -1 }, /* (397) noarg_func ::= CURRENT_USER */ - { 407, -1 }, /* (398) noarg_func ::= USER */ - { 405, -1 }, /* (399) star_func ::= COUNT */ - { 405, -1 }, /* (400) star_func ::= FIRST */ - { 405, -1 }, /* (401) star_func ::= LAST */ - { 405, -1 }, /* (402) star_func ::= LAST_ROW */ - { 406, -1 }, /* (403) star_func_para_list ::= NK_STAR */ - { 406, -1 }, /* (404) star_func_para_list ::= other_para_list */ - { 408, -1 }, /* (405) other_para_list ::= star_func_para */ - { 408, -3 }, /* (406) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 409, -1 }, /* (407) star_func_para ::= expr_or_subquery */ - { 409, -3 }, /* (408) star_func_para ::= table_name NK_DOT NK_STAR */ - { 404, -4 }, /* (409) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 404, -5 }, /* (410) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 410, -1 }, /* (411) when_then_list ::= when_then_expr */ - { 410, -2 }, /* (412) when_then_list ::= when_then_list when_then_expr */ - { 413, -4 }, /* (413) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 411, 0 }, /* (414) case_when_else_opt ::= */ - { 411, -2 }, /* (415) case_when_else_opt ::= ELSE common_expression */ - { 414, -3 }, /* (416) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 414, -5 }, /* (417) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -6 }, /* (418) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 414, -3 }, /* (419) predicate ::= expr_or_subquery IS NULL */ - { 414, -4 }, /* (420) predicate ::= expr_or_subquery IS NOT NULL */ - { 414, -3 }, /* (421) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 415, -1 }, /* (422) compare_op ::= NK_LT */ - { 415, -1 }, /* (423) compare_op ::= NK_GT */ - { 415, -1 }, /* (424) compare_op ::= NK_LE */ - { 415, -1 }, /* (425) compare_op ::= NK_GE */ - { 415, -1 }, /* (426) compare_op ::= NK_NE */ - { 415, -1 }, /* (427) compare_op ::= NK_EQ */ - { 415, -1 }, /* (428) compare_op ::= LIKE */ - { 415, -2 }, /* (429) compare_op ::= NOT LIKE */ - { 415, -1 }, /* (430) compare_op ::= MATCH */ - { 415, -1 }, /* (431) compare_op ::= NMATCH */ - { 415, -1 }, /* (432) compare_op ::= CONTAINS */ - { 416, -1 }, /* (433) in_op ::= IN */ - { 416, -2 }, /* (434) in_op ::= NOT IN */ - { 417, -3 }, /* (435) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 418, -1 }, /* (436) boolean_value_expression ::= boolean_primary */ - { 418, -2 }, /* (437) boolean_value_expression ::= NOT boolean_primary */ - { 418, -3 }, /* (438) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 418, -3 }, /* (439) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 419, -1 }, /* (440) boolean_primary ::= predicate */ - { 419, -3 }, /* (441) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 412, -1 }, /* (442) common_expression ::= expr_or_subquery */ - { 412, -1 }, /* (443) common_expression ::= boolean_value_expression */ - { 420, 0 }, /* (444) from_clause_opt ::= */ - { 420, -2 }, /* (445) from_clause_opt ::= FROM table_reference_list */ - { 421, -1 }, /* (446) table_reference_list ::= table_reference */ - { 421, -3 }, /* (447) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 422, -1 }, /* (448) table_reference ::= table_primary */ - { 422, -1 }, /* (449) table_reference ::= joined_table */ - { 423, -2 }, /* (450) table_primary ::= table_name alias_opt */ - { 423, -4 }, /* (451) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 423, -2 }, /* (452) table_primary ::= subquery alias_opt */ - { 423, -1 }, /* (453) table_primary ::= parenthesized_joined_table */ - { 425, 0 }, /* (454) alias_opt ::= */ - { 425, -1 }, /* (455) alias_opt ::= table_alias */ - { 425, -2 }, /* (456) alias_opt ::= AS table_alias */ - { 427, -3 }, /* (457) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 427, -3 }, /* (458) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 424, -6 }, /* (459) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 428, 0 }, /* (460) join_type ::= */ - { 428, -1 }, /* (461) join_type ::= INNER */ - { 430, -12 }, /* (462) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 431, 0 }, /* (463) set_quantifier_opt ::= */ - { 431, -1 }, /* (464) set_quantifier_opt ::= DISTINCT */ - { 431, -1 }, /* (465) set_quantifier_opt ::= ALL */ - { 432, -1 }, /* (466) select_list ::= select_item */ - { 432, -3 }, /* (467) select_list ::= select_list NK_COMMA select_item */ - { 440, -1 }, /* (468) select_item ::= NK_STAR */ - { 440, -1 }, /* (469) select_item ::= common_expression */ - { 440, -2 }, /* (470) select_item ::= common_expression column_alias */ - { 440, -3 }, /* (471) select_item ::= common_expression AS column_alias */ - { 440, -3 }, /* (472) select_item ::= table_name NK_DOT NK_STAR */ - { 395, 0 }, /* (473) where_clause_opt ::= */ - { 395, -2 }, /* (474) where_clause_opt ::= WHERE search_condition */ - { 433, 0 }, /* (475) partition_by_clause_opt ::= */ - { 433, -3 }, /* (476) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 441, -1 }, /* (477) partition_list ::= partition_item */ - { 441, -3 }, /* (478) partition_list ::= partition_list NK_COMMA partition_item */ - { 442, -1 }, /* (479) partition_item ::= expr_or_subquery */ - { 442, -2 }, /* (480) partition_item ::= expr_or_subquery column_alias */ - { 442, -3 }, /* (481) partition_item ::= expr_or_subquery AS column_alias */ - { 437, 0 }, /* (482) twindow_clause_opt ::= */ - { 437, -6 }, /* (483) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 437, -4 }, /* (484) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 437, -6 }, /* (485) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 437, -8 }, /* (486) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 381, 0 }, /* (487) sliding_opt ::= */ - { 381, -4 }, /* (488) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 436, 0 }, /* (489) fill_opt ::= */ - { 436, -4 }, /* (490) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 436, -6 }, /* (491) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 443, -1 }, /* (492) fill_mode ::= NONE */ - { 443, -1 }, /* (493) fill_mode ::= PREV */ - { 443, -1 }, /* (494) fill_mode ::= NULL */ - { 443, -1 }, /* (495) fill_mode ::= LINEAR */ - { 443, -1 }, /* (496) fill_mode ::= NEXT */ - { 438, 0 }, /* (497) group_by_clause_opt ::= */ - { 438, -3 }, /* (498) group_by_clause_opt ::= GROUP BY group_by_list */ - { 444, -1 }, /* (499) group_by_list ::= expr_or_subquery */ - { 444, -3 }, /* (500) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 439, 0 }, /* (501) having_clause_opt ::= */ - { 439, -2 }, /* (502) having_clause_opt ::= HAVING search_condition */ - { 434, 0 }, /* (503) range_opt ::= */ - { 434, -6 }, /* (504) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 435, 0 }, /* (505) every_opt ::= */ - { 435, -4 }, /* (506) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 445, -4 }, /* (507) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 446, -1 }, /* (508) query_simple ::= query_specification */ - { 446, -1 }, /* (509) query_simple ::= union_query_expression */ - { 450, -4 }, /* (510) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 450, -3 }, /* (511) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 451, -1 }, /* (512) query_simple_or_subquery ::= query_simple */ - { 451, -1 }, /* (513) query_simple_or_subquery ::= subquery */ - { 385, -1 }, /* (514) query_or_subquery ::= query_expression */ - { 385, -1 }, /* (515) query_or_subquery ::= subquery */ - { 447, 0 }, /* (516) order_by_clause_opt ::= */ - { 447, -3 }, /* (517) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 448, 0 }, /* (518) slimit_clause_opt ::= */ - { 448, -2 }, /* (519) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 448, -4 }, /* (520) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 448, -4 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 449, 0 }, /* (522) limit_clause_opt ::= */ - { 449, -2 }, /* (523) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 449, -4 }, /* (524) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 449, -4 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 426, -3 }, /* (526) subquery ::= NK_LP query_expression NK_RP */ - { 426, -3 }, /* (527) subquery ::= NK_LP subquery NK_RP */ - { 429, -1 }, /* (528) search_condition ::= common_expression */ - { 452, -1 }, /* (529) sort_specification_list ::= sort_specification */ - { 452, -3 }, /* (530) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 453, -3 }, /* (531) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 454, 0 }, /* (532) ordering_specification_opt ::= */ - { 454, -1 }, /* (533) ordering_specification_opt ::= ASC */ - { 454, -1 }, /* (534) ordering_specification_opt ::= DESC */ - { 455, 0 }, /* (535) null_ordering_opt ::= */ - { 455, -2 }, /* (536) null_ordering_opt ::= NULLS FIRST */ - { 455, -2 }, /* (537) null_ordering_opt ::= NULLS LAST */ + { 322, -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + { 322, -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + { 323, 0 }, /* (2) account_options ::= */ + { 323, -3 }, /* (3) account_options ::= account_options PPS literal */ + { 323, -3 }, /* (4) account_options ::= account_options TSERIES literal */ + { 323, -3 }, /* (5) account_options ::= account_options STORAGE literal */ + { 323, -3 }, /* (6) account_options ::= account_options STREAMS literal */ + { 323, -3 }, /* (7) account_options ::= account_options QTIME literal */ + { 323, -3 }, /* (8) account_options ::= account_options DBS literal */ + { 323, -3 }, /* (9) account_options ::= account_options USERS literal */ + { 323, -3 }, /* (10) account_options ::= account_options CONNS literal */ + { 323, -3 }, /* (11) account_options ::= account_options STATE literal */ + { 324, -1 }, /* (12) alter_account_options ::= alter_account_option */ + { 324, -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + { 326, -2 }, /* (14) alter_account_option ::= PASS literal */ + { 326, -2 }, /* (15) alter_account_option ::= PPS literal */ + { 326, -2 }, /* (16) alter_account_option ::= TSERIES literal */ + { 326, -2 }, /* (17) alter_account_option ::= STORAGE literal */ + { 326, -2 }, /* (18) alter_account_option ::= STREAMS literal */ + { 326, -2 }, /* (19) alter_account_option ::= QTIME literal */ + { 326, -2 }, /* (20) alter_account_option ::= DBS literal */ + { 326, -2 }, /* (21) alter_account_option ::= USERS literal */ + { 326, -2 }, /* (22) alter_account_option ::= CONNS literal */ + { 326, -2 }, /* (23) alter_account_option ::= STATE literal */ + { 322, -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ + { 322, -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */ + { 322, -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + { 322, -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + { 322, -3 }, /* (28) cmd ::= DROP USER user_name */ + { 328, 0 }, /* (29) sysinfo_opt ::= */ + { 328, -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */ + { 322, -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */ + { 322, -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */ + { 329, -1 }, /* (33) privileges ::= ALL */ + { 329, -1 }, /* (34) privileges ::= priv_type_list */ + { 329, -1 }, /* (35) privileges ::= SUBSCRIBE */ + { 331, -1 }, /* (36) priv_type_list ::= priv_type */ + { 331, -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + { 332, -1 }, /* (38) priv_type ::= READ */ + { 332, -1 }, /* (39) priv_type ::= WRITE */ + { 330, -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */ + { 330, -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */ + { 330, -1 }, /* (42) priv_level ::= topic_name */ + { 322, -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */ + { 322, -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + { 322, -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */ + { 322, -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */ + { 322, -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + { 322, -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + { 322, -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */ + { 322, -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + { 335, -1 }, /* (51) dnode_endpoint ::= NK_STRING */ + { 335, -1 }, /* (52) dnode_endpoint ::= NK_ID */ + { 335, -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */ + { 336, 0 }, /* (54) force_opt ::= */ + { 336, -1 }, /* (55) force_opt ::= FORCE */ + { 322, -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */ + { 322, -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + { 322, -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + { 322, -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + { 322, -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */ + { 322, -2 }, /* (68) cmd ::= USE db_name */ + { 322, -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */ + { 322, -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */ + { 322, -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */ + { 337, -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */ + { 337, 0 }, /* (73) not_exists_opt ::= */ + { 339, -2 }, /* (74) exists_opt ::= IF EXISTS */ + { 339, 0 }, /* (75) exists_opt ::= */ + { 338, 0 }, /* (76) db_options ::= */ + { 338, -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */ + { 338, -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */ + { 338, -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */ + { 338, -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */ + { 338, -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */ + { 338, -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */ + { 338, -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */ + { 338, -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */ + { 338, -3 }, /* (85) db_options ::= db_options KEEP integer_list */ + { 338, -3 }, /* (86) db_options ::= db_options KEEP variable_list */ + { 338, -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */ + { 338, -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */ + { 338, -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + { 338, -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */ + { 338, -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */ + { 338, -3 }, /* (92) db_options ::= db_options STRICT NK_STRING */ + { 338, -3 }, /* (93) db_options ::= db_options VGROUPS NK_INTEGER */ + { 338, -3 }, /* (94) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + { 338, -3 }, /* (95) db_options ::= db_options RETENTIONS retention_list */ + { 338, -3 }, /* (96) db_options ::= db_options SCHEMALESS NK_INTEGER */ + { 338, -3 }, /* (97) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + { 338, -3 }, /* (98) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + { 338, -3 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + { 338, -4 }, /* (100) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + { 338, -4 }, /* (102) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + { 338, -3 }, /* (103) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + { 338, -3 }, /* (104) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + { 338, -3 }, /* (105) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + { 338, -3 }, /* (106) db_options ::= db_options TABLE_PREFIX NK_INTEGER */ + { 338, -3 }, /* (107) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ + { 340, -1 }, /* (108) alter_db_options ::= alter_db_option */ + { 340, -2 }, /* (109) alter_db_options ::= alter_db_options alter_db_option */ + { 345, -2 }, /* (110) alter_db_option ::= BUFFER NK_INTEGER */ + { 345, -2 }, /* (111) alter_db_option ::= CACHEMODEL NK_STRING */ + { 345, -2 }, /* (112) alter_db_option ::= CACHESIZE NK_INTEGER */ + { 345, -2 }, /* (113) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + { 345, -2 }, /* (114) alter_db_option ::= KEEP integer_list */ + { 345, -2 }, /* (115) alter_db_option ::= KEEP variable_list */ + { 345, -2 }, /* (116) alter_db_option ::= PAGES NK_INTEGER */ + { 345, -2 }, /* (117) alter_db_option ::= REPLICA NK_INTEGER */ + { 345, -2 }, /* (118) alter_db_option ::= STRICT NK_STRING */ + { 345, -2 }, /* (119) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 345, -2 }, /* (120) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 342, -1 }, /* (121) integer_list ::= NK_INTEGER */ + { 342, -3 }, /* (122) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 343, -1 }, /* (123) variable_list ::= NK_VARIABLE */ + { 343, -3 }, /* (124) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 344, -1 }, /* (125) retention_list ::= retention */ + { 344, -3 }, /* (126) retention_list ::= retention_list NK_COMMA retention */ + { 346, -3 }, /* (127) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 341, 0 }, /* (128) speed_opt ::= */ + { 341, -2 }, /* (129) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 322, -9 }, /* (130) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 322, -3 }, /* (131) cmd ::= CREATE TABLE multi_create_clause */ + { 322, -9 }, /* (132) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 322, -3 }, /* (133) cmd ::= DROP TABLE multi_drop_clause */ + { 322, -4 }, /* (134) cmd ::= DROP STABLE exists_opt full_table_name */ + { 322, -3 }, /* (135) cmd ::= ALTER TABLE alter_table_clause */ + { 322, -3 }, /* (136) cmd ::= ALTER STABLE alter_table_clause */ + { 354, -2 }, /* (137) alter_table_clause ::= full_table_name alter_table_options */ + { 354, -5 }, /* (138) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 354, -4 }, /* (139) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 354, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 354, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 354, -5 }, /* (142) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 354, -4 }, /* (143) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 354, -5 }, /* (144) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 354, -5 }, /* (145) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 354, -6 }, /* (146) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 351, -1 }, /* (147) multi_create_clause ::= create_subtable_clause */ + { 351, -2 }, /* (148) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 359, -10 }, /* (149) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 353, -1 }, /* (150) multi_drop_clause ::= drop_table_clause */ + { 353, -2 }, /* (151) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 362, -2 }, /* (152) drop_table_clause ::= exists_opt full_table_name */ + { 360, 0 }, /* (153) specific_cols_opt ::= */ + { 360, -3 }, /* (154) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 347, -1 }, /* (155) full_table_name ::= table_name */ + { 347, -3 }, /* (156) full_table_name ::= db_name NK_DOT table_name */ + { 348, -1 }, /* (157) column_def_list ::= column_def */ + { 348, -3 }, /* (158) column_def_list ::= column_def_list NK_COMMA column_def */ + { 365, -2 }, /* (159) column_def ::= column_name type_name */ + { 365, -4 }, /* (160) column_def ::= column_name type_name COMMENT NK_STRING */ + { 357, -1 }, /* (161) type_name ::= BOOL */ + { 357, -1 }, /* (162) type_name ::= TINYINT */ + { 357, -1 }, /* (163) type_name ::= SMALLINT */ + { 357, -1 }, /* (164) type_name ::= INT */ + { 357, -1 }, /* (165) type_name ::= INTEGER */ + { 357, -1 }, /* (166) type_name ::= BIGINT */ + { 357, -1 }, /* (167) type_name ::= FLOAT */ + { 357, -1 }, /* (168) type_name ::= DOUBLE */ + { 357, -4 }, /* (169) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (170) type_name ::= TIMESTAMP */ + { 357, -4 }, /* (171) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -2 }, /* (172) type_name ::= TINYINT UNSIGNED */ + { 357, -2 }, /* (173) type_name ::= SMALLINT UNSIGNED */ + { 357, -2 }, /* (174) type_name ::= INT UNSIGNED */ + { 357, -2 }, /* (175) type_name ::= BIGINT UNSIGNED */ + { 357, -1 }, /* (176) type_name ::= JSON */ + { 357, -4 }, /* (177) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (178) type_name ::= MEDIUMBLOB */ + { 357, -1 }, /* (179) type_name ::= BLOB */ + { 357, -4 }, /* (180) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 357, -1 }, /* (181) type_name ::= DECIMAL */ + { 357, -4 }, /* (182) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 357, -6 }, /* (183) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 349, 0 }, /* (184) tags_def_opt ::= */ + { 349, -1 }, /* (185) tags_def_opt ::= tags_def */ + { 352, -4 }, /* (186) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 350, 0 }, /* (187) table_options ::= */ + { 350, -3 }, /* (188) table_options ::= table_options COMMENT NK_STRING */ + { 350, -3 }, /* (189) table_options ::= table_options MAX_DELAY duration_list */ + { 350, -3 }, /* (190) table_options ::= table_options WATERMARK duration_list */ + { 350, -5 }, /* (191) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 350, -3 }, /* (192) table_options ::= table_options TTL NK_INTEGER */ + { 350, -5 }, /* (193) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 350, -3 }, /* (194) table_options ::= table_options DELETE_MARK duration_list */ + { 355, -1 }, /* (195) alter_table_options ::= alter_table_option */ + { 355, -2 }, /* (196) alter_table_options ::= alter_table_options alter_table_option */ + { 368, -2 }, /* (197) alter_table_option ::= COMMENT NK_STRING */ + { 368, -2 }, /* (198) alter_table_option ::= TTL NK_INTEGER */ + { 366, -1 }, /* (199) duration_list ::= duration_literal */ + { 366, -3 }, /* (200) duration_list ::= duration_list NK_COMMA duration_literal */ + { 367, -1 }, /* (201) rollup_func_list ::= rollup_func_name */ + { 367, -3 }, /* (202) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 370, -1 }, /* (203) rollup_func_name ::= function_name */ + { 370, -1 }, /* (204) rollup_func_name ::= FIRST */ + { 370, -1 }, /* (205) rollup_func_name ::= LAST */ + { 363, -1 }, /* (206) col_name_list ::= col_name */ + { 363, -3 }, /* (207) col_name_list ::= col_name_list NK_COMMA col_name */ + { 372, -1 }, /* (208) col_name ::= column_name */ + { 322, -2 }, /* (209) cmd ::= SHOW DNODES */ + { 322, -2 }, /* (210) cmd ::= SHOW USERS */ + { 322, -3 }, /* (211) cmd ::= SHOW USER PRIVILEGES */ + { 322, -2 }, /* (212) cmd ::= SHOW DATABASES */ + { 322, -4 }, /* (213) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 322, -4 }, /* (214) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 322, -3 }, /* (215) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 322, -2 }, /* (216) cmd ::= SHOW MNODES */ + { 322, -2 }, /* (217) cmd ::= SHOW QNODES */ + { 322, -2 }, /* (218) cmd ::= SHOW FUNCTIONS */ + { 322, -5 }, /* (219) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 322, -2 }, /* (220) cmd ::= SHOW STREAMS */ + { 322, -2 }, /* (221) cmd ::= SHOW ACCOUNTS */ + { 322, -2 }, /* (222) cmd ::= SHOW APPS */ + { 322, -2 }, /* (223) cmd ::= SHOW CONNECTIONS */ + { 322, -2 }, /* (224) cmd ::= SHOW LICENCES */ + { 322, -2 }, /* (225) cmd ::= SHOW GRANTS */ + { 322, -4 }, /* (226) cmd ::= SHOW CREATE DATABASE db_name */ + { 322, -4 }, /* (227) cmd ::= SHOW CREATE TABLE full_table_name */ + { 322, -4 }, /* (228) cmd ::= SHOW CREATE STABLE full_table_name */ + { 322, -2 }, /* (229) cmd ::= SHOW QUERIES */ + { 322, -2 }, /* (230) cmd ::= SHOW SCORES */ + { 322, -2 }, /* (231) cmd ::= SHOW TOPICS */ + { 322, -2 }, /* (232) cmd ::= SHOW VARIABLES */ + { 322, -3 }, /* (233) cmd ::= SHOW CLUSTER VARIABLES */ + { 322, -3 }, /* (234) cmd ::= SHOW LOCAL VARIABLES */ + { 322, -5 }, /* (235) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + { 322, -2 }, /* (236) cmd ::= SHOW BNODES */ + { 322, -2 }, /* (237) cmd ::= SHOW SNODES */ + { 322, -2 }, /* (238) cmd ::= SHOW CLUSTER */ + { 322, -2 }, /* (239) cmd ::= SHOW TRANSACTIONS */ + { 322, -4 }, /* (240) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 322, -2 }, /* (241) cmd ::= SHOW CONSUMERS */ + { 322, -2 }, /* (242) cmd ::= SHOW SUBSCRIPTIONS */ + { 322, -5 }, /* (243) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 322, -7 }, /* (244) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + { 322, -3 }, /* (245) cmd ::= SHOW VNODES NK_INTEGER */ + { 322, -3 }, /* (246) cmd ::= SHOW VNODES NK_STRING */ + { 373, 0 }, /* (247) db_name_cond_opt ::= */ + { 373, -2 }, /* (248) db_name_cond_opt ::= db_name NK_DOT */ + { 374, 0 }, /* (249) like_pattern_opt ::= */ + { 374, -2 }, /* (250) like_pattern_opt ::= LIKE NK_STRING */ + { 375, -1 }, /* (251) table_name_cond ::= table_name */ + { 376, 0 }, /* (252) from_db_opt ::= */ + { 376, -2 }, /* (253) from_db_opt ::= FROM db_name */ + { 377, 0 }, /* (254) tag_list_opt ::= */ + { 377, -1 }, /* (255) tag_list_opt ::= tag_item */ + { 377, -3 }, /* (256) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + { 378, -1 }, /* (257) tag_item ::= TBNAME */ + { 378, -1 }, /* (258) tag_item ::= QTAGS */ + { 378, -1 }, /* (259) tag_item ::= column_name */ + { 378, -2 }, /* (260) tag_item ::= column_name column_alias */ + { 378, -3 }, /* (261) tag_item ::= column_name AS column_alias */ + { 322, -8 }, /* (262) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 322, -4 }, /* (263) cmd ::= DROP INDEX exists_opt full_table_name */ + { 380, -10 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 380, -12 }, /* (265) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + { 381, -1 }, /* (266) func_list ::= func */ + { 381, -3 }, /* (267) func_list ::= func_list NK_COMMA func */ + { 384, -4 }, /* (268) func ::= function_name NK_LP expression_list NK_RP */ + { 383, 0 }, /* (269) sma_stream_opt ::= */ + { 383, -3 }, /* (270) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + { 383, -3 }, /* (271) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + { 383, -3 }, /* (272) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + { 322, -6 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 322, -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 322, -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 322, -7 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 322, -9 }, /* (277) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 322, -4 }, /* (278) cmd ::= DROP TOPIC exists_opt topic_name */ + { 322, -7 }, /* (279) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 322, -2 }, /* (280) cmd ::= DESC full_table_name */ + { 322, -2 }, /* (281) cmd ::= DESCRIBE full_table_name */ + { 322, -3 }, /* (282) cmd ::= RESET QUERY CACHE */ + { 322, -4 }, /* (283) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 387, 0 }, /* (284) analyze_opt ::= */ + { 387, -1 }, /* (285) analyze_opt ::= ANALYZE */ + { 388, 0 }, /* (286) explain_options ::= */ + { 388, -3 }, /* (287) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 388, -3 }, /* (288) explain_options ::= explain_options RATIO NK_FLOAT */ + { 322, -10 }, /* (289) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 322, -4 }, /* (290) cmd ::= DROP FUNCTION exists_opt function_name */ + { 389, 0 }, /* (291) agg_func_opt ::= */ + { 389, -1 }, /* (292) agg_func_opt ::= AGGREGATE */ + { 390, 0 }, /* (293) bufsize_opt ::= */ + { 390, -2 }, /* (294) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 322, -11 }, /* (295) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 322, -4 }, /* (296) cmd ::= DROP STREAM exists_opt stream_name */ + { 392, 0 }, /* (297) stream_options ::= */ + { 392, -3 }, /* (298) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 392, -3 }, /* (299) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 392, -4 }, /* (300) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 392, -3 }, /* (301) stream_options ::= stream_options WATERMARK duration_literal */ + { 392, -4 }, /* (302) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 392, -3 }, /* (303) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 393, 0 }, /* (304) subtable_opt ::= */ + { 393, -4 }, /* (305) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 322, -3 }, /* (306) cmd ::= KILL CONNECTION NK_INTEGER */ + { 322, -3 }, /* (307) cmd ::= KILL QUERY NK_STRING */ + { 322, -3 }, /* (308) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 322, -2 }, /* (309) cmd ::= BALANCE VGROUP */ + { 322, -4 }, /* (310) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 322, -4 }, /* (311) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 322, -3 }, /* (312) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 395, -2 }, /* (313) dnode_list ::= DNODE NK_INTEGER */ + { 395, -3 }, /* (314) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 322, -4 }, /* (315) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 322, -1 }, /* (316) cmd ::= query_or_subquery */ + { 322, -7 }, /* (317) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 322, -4 }, /* (318) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 325, -1 }, /* (319) literal ::= NK_INTEGER */ + { 325, -1 }, /* (320) literal ::= NK_FLOAT */ + { 325, -1 }, /* (321) literal ::= NK_STRING */ + { 325, -1 }, /* (322) literal ::= NK_BOOL */ + { 325, -2 }, /* (323) literal ::= TIMESTAMP NK_STRING */ + { 325, -1 }, /* (324) literal ::= duration_literal */ + { 325, -1 }, /* (325) literal ::= NULL */ + { 325, -1 }, /* (326) literal ::= NK_QUESTION */ + { 369, -1 }, /* (327) duration_literal ::= NK_VARIABLE */ + { 397, -1 }, /* (328) signed ::= NK_INTEGER */ + { 397, -2 }, /* (329) signed ::= NK_PLUS NK_INTEGER */ + { 397, -2 }, /* (330) signed ::= NK_MINUS NK_INTEGER */ + { 397, -1 }, /* (331) signed ::= NK_FLOAT */ + { 397, -2 }, /* (332) signed ::= NK_PLUS NK_FLOAT */ + { 397, -2 }, /* (333) signed ::= NK_MINUS NK_FLOAT */ + { 358, -1 }, /* (334) signed_literal ::= signed */ + { 358, -1 }, /* (335) signed_literal ::= NK_STRING */ + { 358, -1 }, /* (336) signed_literal ::= NK_BOOL */ + { 358, -2 }, /* (337) signed_literal ::= TIMESTAMP NK_STRING */ + { 358, -1 }, /* (338) signed_literal ::= duration_literal */ + { 358, -1 }, /* (339) signed_literal ::= NULL */ + { 358, -1 }, /* (340) signed_literal ::= literal_func */ + { 358, -1 }, /* (341) signed_literal ::= NK_QUESTION */ + { 399, -1 }, /* (342) literal_list ::= signed_literal */ + { 399, -3 }, /* (343) literal_list ::= literal_list NK_COMMA signed_literal */ + { 333, -1 }, /* (344) db_name ::= NK_ID */ + { 364, -1 }, /* (345) table_name ::= NK_ID */ + { 356, -1 }, /* (346) column_name ::= NK_ID */ + { 371, -1 }, /* (347) function_name ::= NK_ID */ + { 400, -1 }, /* (348) table_alias ::= NK_ID */ + { 379, -1 }, /* (349) column_alias ::= NK_ID */ + { 327, -1 }, /* (350) user_name ::= NK_ID */ + { 334, -1 }, /* (351) topic_name ::= NK_ID */ + { 391, -1 }, /* (352) stream_name ::= NK_ID */ + { 386, -1 }, /* (353) cgroup_name ::= NK_ID */ + { 401, -1 }, /* (354) expr_or_subquery ::= expression */ + { 394, -1 }, /* (355) expression ::= literal */ + { 394, -1 }, /* (356) expression ::= pseudo_column */ + { 394, -1 }, /* (357) expression ::= column_reference */ + { 394, -1 }, /* (358) expression ::= function_expression */ + { 394, -1 }, /* (359) expression ::= case_when_expression */ + { 394, -3 }, /* (360) expression ::= NK_LP expression NK_RP */ + { 394, -2 }, /* (361) expression ::= NK_PLUS expr_or_subquery */ + { 394, -2 }, /* (362) expression ::= NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (363) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 394, -3 }, /* (364) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 394, -3 }, /* (365) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 394, -3 }, /* (366) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 394, -3 }, /* (367) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 394, -3 }, /* (368) expression ::= column_reference NK_ARROW NK_STRING */ + { 394, -3 }, /* (369) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 394, -3 }, /* (370) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 361, -1 }, /* (371) expression_list ::= expr_or_subquery */ + { 361, -3 }, /* (372) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 403, -1 }, /* (373) column_reference ::= column_name */ + { 403, -3 }, /* (374) column_reference ::= table_name NK_DOT column_name */ + { 402, -1 }, /* (375) pseudo_column ::= ROWTS */ + { 402, -1 }, /* (376) pseudo_column ::= TBNAME */ + { 402, -3 }, /* (377) pseudo_column ::= table_name NK_DOT TBNAME */ + { 402, -1 }, /* (378) pseudo_column ::= QSTART */ + { 402, -1 }, /* (379) pseudo_column ::= QEND */ + { 402, -1 }, /* (380) pseudo_column ::= QDURATION */ + { 402, -1 }, /* (381) pseudo_column ::= WSTART */ + { 402, -1 }, /* (382) pseudo_column ::= WEND */ + { 402, -1 }, /* (383) pseudo_column ::= WDURATION */ + { 402, -1 }, /* (384) pseudo_column ::= IROWTS */ + { 402, -1 }, /* (385) pseudo_column ::= QTAGS */ + { 404, -4 }, /* (386) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 404, -4 }, /* (387) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 404, -6 }, /* (388) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 404, -1 }, /* (389) function_expression ::= literal_func */ + { 398, -3 }, /* (390) literal_func ::= noarg_func NK_LP NK_RP */ + { 398, -1 }, /* (391) literal_func ::= NOW */ + { 408, -1 }, /* (392) noarg_func ::= NOW */ + { 408, -1 }, /* (393) noarg_func ::= TODAY */ + { 408, -1 }, /* (394) noarg_func ::= TIMEZONE */ + { 408, -1 }, /* (395) noarg_func ::= DATABASE */ + { 408, -1 }, /* (396) noarg_func ::= CLIENT_VERSION */ + { 408, -1 }, /* (397) noarg_func ::= SERVER_VERSION */ + { 408, -1 }, /* (398) noarg_func ::= SERVER_STATUS */ + { 408, -1 }, /* (399) noarg_func ::= CURRENT_USER */ + { 408, -1 }, /* (400) noarg_func ::= USER */ + { 406, -1 }, /* (401) star_func ::= COUNT */ + { 406, -1 }, /* (402) star_func ::= FIRST */ + { 406, -1 }, /* (403) star_func ::= LAST */ + { 406, -1 }, /* (404) star_func ::= LAST_ROW */ + { 407, -1 }, /* (405) star_func_para_list ::= NK_STAR */ + { 407, -1 }, /* (406) star_func_para_list ::= other_para_list */ + { 409, -1 }, /* (407) other_para_list ::= star_func_para */ + { 409, -3 }, /* (408) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 410, -1 }, /* (409) star_func_para ::= expr_or_subquery */ + { 410, -3 }, /* (410) star_func_para ::= table_name NK_DOT NK_STAR */ + { 405, -4 }, /* (411) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 405, -5 }, /* (412) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 411, -1 }, /* (413) when_then_list ::= when_then_expr */ + { 411, -2 }, /* (414) when_then_list ::= when_then_list when_then_expr */ + { 414, -4 }, /* (415) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 412, 0 }, /* (416) case_when_else_opt ::= */ + { 412, -2 }, /* (417) case_when_else_opt ::= ELSE common_expression */ + { 415, -3 }, /* (418) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 415, -5 }, /* (419) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -6 }, /* (420) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 415, -3 }, /* (421) predicate ::= expr_or_subquery IS NULL */ + { 415, -4 }, /* (422) predicate ::= expr_or_subquery IS NOT NULL */ + { 415, -3 }, /* (423) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 416, -1 }, /* (424) compare_op ::= NK_LT */ + { 416, -1 }, /* (425) compare_op ::= NK_GT */ + { 416, -1 }, /* (426) compare_op ::= NK_LE */ + { 416, -1 }, /* (427) compare_op ::= NK_GE */ + { 416, -1 }, /* (428) compare_op ::= NK_NE */ + { 416, -1 }, /* (429) compare_op ::= NK_EQ */ + { 416, -1 }, /* (430) compare_op ::= LIKE */ + { 416, -2 }, /* (431) compare_op ::= NOT LIKE */ + { 416, -1 }, /* (432) compare_op ::= MATCH */ + { 416, -1 }, /* (433) compare_op ::= NMATCH */ + { 416, -1 }, /* (434) compare_op ::= CONTAINS */ + { 417, -1 }, /* (435) in_op ::= IN */ + { 417, -2 }, /* (436) in_op ::= NOT IN */ + { 418, -3 }, /* (437) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 419, -1 }, /* (438) boolean_value_expression ::= boolean_primary */ + { 419, -2 }, /* (439) boolean_value_expression ::= NOT boolean_primary */ + { 419, -3 }, /* (440) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 419, -3 }, /* (441) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 420, -1 }, /* (442) boolean_primary ::= predicate */ + { 420, -3 }, /* (443) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 413, -1 }, /* (444) common_expression ::= expr_or_subquery */ + { 413, -1 }, /* (445) common_expression ::= boolean_value_expression */ + { 421, 0 }, /* (446) from_clause_opt ::= */ + { 421, -2 }, /* (447) from_clause_opt ::= FROM table_reference_list */ + { 422, -1 }, /* (448) table_reference_list ::= table_reference */ + { 422, -3 }, /* (449) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 423, -1 }, /* (450) table_reference ::= table_primary */ + { 423, -1 }, /* (451) table_reference ::= joined_table */ + { 424, -2 }, /* (452) table_primary ::= table_name alias_opt */ + { 424, -4 }, /* (453) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 424, -2 }, /* (454) table_primary ::= subquery alias_opt */ + { 424, -1 }, /* (455) table_primary ::= parenthesized_joined_table */ + { 426, 0 }, /* (456) alias_opt ::= */ + { 426, -1 }, /* (457) alias_opt ::= table_alias */ + { 426, -2 }, /* (458) alias_opt ::= AS table_alias */ + { 428, -3 }, /* (459) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 428, -3 }, /* (460) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 425, -6 }, /* (461) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 429, 0 }, /* (462) join_type ::= */ + { 429, -1 }, /* (463) join_type ::= INNER */ + { 431, -12 }, /* (464) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 432, 0 }, /* (465) set_quantifier_opt ::= */ + { 432, -1 }, /* (466) set_quantifier_opt ::= DISTINCT */ + { 432, -1 }, /* (467) set_quantifier_opt ::= ALL */ + { 433, -1 }, /* (468) select_list ::= select_item */ + { 433, -3 }, /* (469) select_list ::= select_list NK_COMMA select_item */ + { 441, -1 }, /* (470) select_item ::= NK_STAR */ + { 441, -1 }, /* (471) select_item ::= common_expression */ + { 441, -2 }, /* (472) select_item ::= common_expression column_alias */ + { 441, -3 }, /* (473) select_item ::= common_expression AS column_alias */ + { 441, -3 }, /* (474) select_item ::= table_name NK_DOT NK_STAR */ + { 396, 0 }, /* (475) where_clause_opt ::= */ + { 396, -2 }, /* (476) where_clause_opt ::= WHERE search_condition */ + { 434, 0 }, /* (477) partition_by_clause_opt ::= */ + { 434, -3 }, /* (478) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 442, -1 }, /* (479) partition_list ::= partition_item */ + { 442, -3 }, /* (480) partition_list ::= partition_list NK_COMMA partition_item */ + { 443, -1 }, /* (481) partition_item ::= expr_or_subquery */ + { 443, -2 }, /* (482) partition_item ::= expr_or_subquery column_alias */ + { 443, -3 }, /* (483) partition_item ::= expr_or_subquery AS column_alias */ + { 438, 0 }, /* (484) twindow_clause_opt ::= */ + { 438, -6 }, /* (485) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 438, -4 }, /* (486) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 438, -6 }, /* (487) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 438, -8 }, /* (488) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 382, 0 }, /* (489) sliding_opt ::= */ + { 382, -4 }, /* (490) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 437, 0 }, /* (491) fill_opt ::= */ + { 437, -4 }, /* (492) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 437, -6 }, /* (493) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 444, -1 }, /* (494) fill_mode ::= NONE */ + { 444, -1 }, /* (495) fill_mode ::= PREV */ + { 444, -1 }, /* (496) fill_mode ::= NULL */ + { 444, -1 }, /* (497) fill_mode ::= LINEAR */ + { 444, -1 }, /* (498) fill_mode ::= NEXT */ + { 439, 0 }, /* (499) group_by_clause_opt ::= */ + { 439, -3 }, /* (500) group_by_clause_opt ::= GROUP BY group_by_list */ + { 445, -1 }, /* (501) group_by_list ::= expr_or_subquery */ + { 445, -3 }, /* (502) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 440, 0 }, /* (503) having_clause_opt ::= */ + { 440, -2 }, /* (504) having_clause_opt ::= HAVING search_condition */ + { 435, 0 }, /* (505) range_opt ::= */ + { 435, -6 }, /* (506) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 436, 0 }, /* (507) every_opt ::= */ + { 436, -4 }, /* (508) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 446, -4 }, /* (509) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 447, -1 }, /* (510) query_simple ::= query_specification */ + { 447, -1 }, /* (511) query_simple ::= union_query_expression */ + { 451, -4 }, /* (512) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 451, -3 }, /* (513) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 452, -1 }, /* (514) query_simple_or_subquery ::= query_simple */ + { 452, -1 }, /* (515) query_simple_or_subquery ::= subquery */ + { 385, -1 }, /* (516) query_or_subquery ::= query_expression */ + { 385, -1 }, /* (517) query_or_subquery ::= subquery */ + { 448, 0 }, /* (518) order_by_clause_opt ::= */ + { 448, -3 }, /* (519) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 449, 0 }, /* (520) slimit_clause_opt ::= */ + { 449, -2 }, /* (521) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 449, -4 }, /* (522) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 449, -4 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 450, 0 }, /* (524) limit_clause_opt ::= */ + { 450, -2 }, /* (525) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 450, -4 }, /* (526) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 450, -4 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 427, -3 }, /* (528) subquery ::= NK_LP query_expression NK_RP */ + { 427, -3 }, /* (529) subquery ::= NK_LP subquery NK_RP */ + { 430, -1 }, /* (530) search_condition ::= common_expression */ + { 453, -1 }, /* (531) sort_specification_list ::= sort_specification */ + { 453, -3 }, /* (532) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 454, -3 }, /* (533) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 455, 0 }, /* (534) ordering_specification_opt ::= */ + { 455, -1 }, /* (535) ordering_specification_opt ::= ASC */ + { 455, -1 }, /* (536) ordering_specification_opt ::= DESC */ + { 456, 0 }, /* (537) null_ordering_opt ::= */ + { 456, -2 }, /* (538) null_ordering_opt ::= NULLS FIRST */ + { 456, -2 }, /* (539) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3578,11 +3575,11 @@ static YYACTIONTYPE yy_reduce( YYMINORTYPE yylhsminor; case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } - yy_destructor(yypParser,322,&yymsp[0].minor); + yy_destructor(yypParser,323,&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,323,&yymsp[0].minor); + yy_destructor(yypParser,324,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -3596,20 +3593,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,322,&yymsp[-2].minor); +{ yy_destructor(yypParser,323,&yymsp[-2].minor); { } - yy_destructor(yypParser,324,&yymsp[0].minor); + yy_destructor(yypParser,325,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,325,&yymsp[0].minor); +{ yy_destructor(yypParser,326,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,323,&yymsp[-1].minor); +{ yy_destructor(yypParser,324,&yymsp[-1].minor); { } - yy_destructor(yypParser,325,&yymsp[0].minor); + yy_destructor(yypParser,326,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -3623,80 +3620,80 @@ static YYACTIONTYPE yy_reduce( case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22); case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23); { } - yy_destructor(yypParser,324,&yymsp[0].minor); + yy_destructor(yypParser,325,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy0, yymsp[0].minor.yy695); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy0, yymsp[0].minor.yy33); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy737, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy199, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy199); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy695 = 1; } +{ yymsp[1].minor.yy33 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy695 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy33 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy93, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy525, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy93 = yymsp[0].minor.yy93; } - yymsp[0].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy525 = yymsp[0].minor.yy525; } + yymsp[0].minor.yy525 = yylhsminor.yy525; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy93 = yymsp[-2].minor.yy93 | yymsp[0].minor.yy93; } - yymsp[-2].minor.yy93 = yylhsminor.yy93; +{ yylhsminor.yy525 = yymsp[-2].minor.yy525 | yymsp[0].minor.yy525; } + yymsp[-2].minor.yy525 = yylhsminor.yy525; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy93 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy525 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy199 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy737 = yymsp[-2].minor.yy737; } - yymsp[-2].minor.yy737 = yylhsminor.yy737; +{ yylhsminor.yy199 = yymsp[-2].minor.yy199; } + yymsp[-2].minor.yy199 = yylhsminor.yy199; break; case 42: /* priv_level ::= topic_name */ - case 455: /* alias_opt ::= table_alias */ yytestcase(yyruleno==455); -{ yylhsminor.yy737 = yymsp[0].minor.yy737; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 457: /* alias_opt ::= table_alias */ yytestcase(yyruleno==457); +{ yylhsminor.yy199 = yymsp[0].minor.yy199; } + yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy737, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy199, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy397); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy185); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy397); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3713,45 +3710,45 @@ static YYACTIONTYPE yy_reduce( case 51: /* dnode_endpoint ::= NK_STRING */ case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52); case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53); - case 342: /* db_name ::= NK_ID */ yytestcase(yyruleno==342); - case 343: /* table_name ::= NK_ID */ yytestcase(yyruleno==343); - case 344: /* column_name ::= NK_ID */ yytestcase(yyruleno==344); - case 345: /* function_name ::= NK_ID */ yytestcase(yyruleno==345); - case 346: /* table_alias ::= NK_ID */ yytestcase(yyruleno==346); - case 347: /* column_alias ::= NK_ID */ yytestcase(yyruleno==347); - case 348: /* user_name ::= NK_ID */ yytestcase(yyruleno==348); - case 349: /* topic_name ::= NK_ID */ yytestcase(yyruleno==349); - case 350: /* stream_name ::= NK_ID */ yytestcase(yyruleno==350); - case 351: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==351); - case 390: /* noarg_func ::= NOW */ yytestcase(yyruleno==390); - case 391: /* noarg_func ::= TODAY */ yytestcase(yyruleno==391); - case 392: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==392); - case 393: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==393); - case 394: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==394); - case 395: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==395); - case 396: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==396); - case 397: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==397); - case 398: /* noarg_func ::= USER */ yytestcase(yyruleno==398); - case 399: /* star_func ::= COUNT */ yytestcase(yyruleno==399); - case 400: /* star_func ::= FIRST */ yytestcase(yyruleno==400); - case 401: /* star_func ::= LAST */ yytestcase(yyruleno==401); - case 402: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==402); -{ yylhsminor.yy737 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy737 = yylhsminor.yy737; + case 344: /* db_name ::= NK_ID */ yytestcase(yyruleno==344); + case 345: /* table_name ::= NK_ID */ yytestcase(yyruleno==345); + case 346: /* column_name ::= NK_ID */ yytestcase(yyruleno==346); + case 347: /* function_name ::= NK_ID */ yytestcase(yyruleno==347); + case 348: /* table_alias ::= NK_ID */ yytestcase(yyruleno==348); + case 349: /* column_alias ::= NK_ID */ yytestcase(yyruleno==349); + case 350: /* user_name ::= NK_ID */ yytestcase(yyruleno==350); + case 351: /* topic_name ::= NK_ID */ yytestcase(yyruleno==351); + case 352: /* stream_name ::= NK_ID */ yytestcase(yyruleno==352); + case 353: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==353); + case 392: /* noarg_func ::= NOW */ yytestcase(yyruleno==392); + case 393: /* noarg_func ::= TODAY */ yytestcase(yyruleno==393); + case 394: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==394); + case 395: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==395); + case 396: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==396); + case 397: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==397); + case 398: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==398); + case 399: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==399); + case 400: /* noarg_func ::= USER */ yytestcase(yyruleno==400); + case 401: /* star_func ::= COUNT */ yytestcase(yyruleno==401); + case 402: /* star_func ::= FIRST */ yytestcase(yyruleno==402); + case 403: /* star_func ::= LAST */ yytestcase(yyruleno==403); + case 404: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==404); +{ yylhsminor.yy199 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy199 = yylhsminor.yy199; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); - case 282: /* analyze_opt ::= */ yytestcase(yyruleno==282); - case 289: /* agg_func_opt ::= */ yytestcase(yyruleno==289); - case 463: /* set_quantifier_opt ::= */ yytestcase(yyruleno==463); -{ yymsp[1].minor.yy185 = false; } + case 284: /* analyze_opt ::= */ yytestcase(yyruleno==284); + case 291: /* agg_func_opt ::= */ yytestcase(yyruleno==291); + case 465: /* set_quantifier_opt ::= */ yytestcase(yyruleno==465); +{ yymsp[1].minor.yy397 = false; } break; case 55: /* force_opt ::= FORCE */ - case 283: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==283); - case 290: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==290); - case 464: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==464); -{ yymsp[0].minor.yy185 = true; } + case 285: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==285); + case 292: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==292); + case 466: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==466); +{ yymsp[0].minor.yy397 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3784,1334 +3781,1342 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy185, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy397, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy148); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy196); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy706); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy185 = true; } +{ yymsp[-2].minor.yy397 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy185 = true; } +{ yymsp[-1].minor.yy397 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy148 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_KEEP, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_KEEP, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 92: /* db_options ::= db_options STRICT NK_STRING */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STRICT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 93: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 94: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 95: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_RETENTIONS, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_RETENTIONS, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 96: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 97: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 98: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 100: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 102: /* 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.yy104 = setDatabaseOption(pCxt, yymsp[-3].minor.yy104, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-3].minor.yy148, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 103: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 104: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 105: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 106: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 107: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy104 = setDatabaseOption(pCxt, yymsp[-2].minor.yy104, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setDatabaseOption(pCxt, yymsp[-2].minor.yy148, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 108: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy104 = createAlterDatabaseOptions(pCxt); yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yylhsminor.yy104, &yymsp[0].minor.yy557); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterDatabaseOptions(pCxt); yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yylhsminor.yy148, &yymsp[0].minor.yy123); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; case 109: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy104 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy104, &yymsp[0].minor.yy557); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy148, &yymsp[0].minor.yy123); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 110: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 111: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 113: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 114: /* alter_db_option ::= KEEP integer_list */ case 115: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==115); -{ yymsp[-1].minor.yy557.type = DB_OPTION_KEEP; yymsp[-1].minor.yy557.pList = yymsp[0].minor.yy616; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_KEEP; yymsp[-1].minor.yy123.pList = yymsp[0].minor.yy404; } break; case 116: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_PAGES; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_PAGES; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 117: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 118: /* alter_db_option ::= STRICT NK_STRING */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STRICT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_STRICT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 119: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_WAL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_WAL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 120: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy123.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; case 121: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 122: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 312: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==312); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 314: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==314); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 123: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy616 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 124: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 125: /* retention_list ::= retention */ case 147: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==147); case 150: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==150); case 157: /* column_def_list ::= column_def */ yytestcase(yyruleno==157); - case 200: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==200); - case 205: /* col_name_list ::= col_name */ yytestcase(yyruleno==205); - case 254: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==254); - case 265: /* func_list ::= func */ yytestcase(yyruleno==265); - case 340: /* literal_list ::= signed_literal */ yytestcase(yyruleno==340); - case 405: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==405); - case 411: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==411); - case 466: /* select_list ::= select_item */ yytestcase(yyruleno==466); - case 477: /* partition_list ::= partition_item */ yytestcase(yyruleno==477); - case 529: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==529); -{ yylhsminor.yy616 = createNodeList(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 201: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==201); + case 206: /* col_name_list ::= col_name */ yytestcase(yyruleno==206); + case 255: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==255); + case 266: /* func_list ::= func */ yytestcase(yyruleno==266); + case 342: /* literal_list ::= signed_literal */ yytestcase(yyruleno==342); + case 407: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==407); + case 413: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==413); + case 468: /* select_list ::= select_item */ yytestcase(yyruleno==468); + case 479: /* partition_list ::= partition_item */ yytestcase(yyruleno==479); + case 531: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==531); +{ yylhsminor.yy404 = createNodeList(pCxt, yymsp[0].minor.yy148); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 126: /* retention_list ::= retention_list NK_COMMA retention */ case 158: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==158); - case 201: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==201); - case 206: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==206); - case 255: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==255); - case 266: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==266); - case 341: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==341); - case 406: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==406); - case 467: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==467); - case 478: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==478); - case 530: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==530); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 202: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==202); + case 207: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==207); + case 256: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==256); + case 267: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==267); + case 343: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==343); + case 408: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==408); + case 469: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==469); + case 480: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==480); + case 532: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==532); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; case 127: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy104 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 128: /* speed_opt ::= */ - case 291: /* bufsize_opt ::= */ yytestcase(yyruleno==291); -{ yymsp[1].minor.yy196 = 0; } + case 293: /* bufsize_opt ::= */ yytestcase(yyruleno==293); +{ yymsp[1].minor.yy706 = 0; } break; case 129: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 292: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==292); -{ yymsp[-1].minor.yy196 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 294: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==294); +{ yymsp[-1].minor.yy706 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 130: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 132: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==132); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-5].minor.yy104, yymsp[-3].minor.yy616, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy148, yymsp[-3].minor.yy404, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } break; case 131: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy616); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 133: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy616); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy404); } break; case 134: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; case 135: /* cmd ::= ALTER TABLE alter_table_clause */ - case 314: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==314); -{ pCxt->pRootNode = yymsp[0].minor.yy104; } + case 316: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==316); +{ pCxt->pRootNode = yymsp[0].minor.yy148; } break; case 136: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy104); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy148); } break; case 137: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy104 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 138: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 139: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 140: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 141: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 142: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 143: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy104 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy104, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy148, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 144: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy104 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 145: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy104 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy104, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy148, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 146: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy104 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy104, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy148, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; case 148: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 151: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==151); - case 412: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==412); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-1].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy616 = yylhsminor.yy616; + case 414: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==414); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-1].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy404 = yylhsminor.yy404; break; case 149: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy104 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy185, yymsp[-8].minor.yy104, yymsp[-6].minor.yy104, yymsp[-5].minor.yy616, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } - yymsp[-9].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy148, yymsp[-6].minor.yy148, yymsp[-5].minor.yy404, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } + yymsp[-9].minor.yy148 = yylhsminor.yy148; break; case 152: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy104 = createDropTableClause(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 153: /* specific_cols_opt ::= */ case 184: /* tags_def_opt ::= */ yytestcase(yyruleno==184); - case 253: /* tag_list_opt ::= */ yytestcase(yyruleno==253); - case 475: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==475); - case 497: /* group_by_clause_opt ::= */ yytestcase(yyruleno==497); - case 516: /* order_by_clause_opt ::= */ yytestcase(yyruleno==516); -{ yymsp[1].minor.yy616 = NULL; } + case 254: /* tag_list_opt ::= */ yytestcase(yyruleno==254); + case 477: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==477); + case 499: /* group_by_clause_opt ::= */ yytestcase(yyruleno==499); + case 518: /* order_by_clause_opt ::= */ yytestcase(yyruleno==518); +{ yymsp[1].minor.yy404 = NULL; } break; case 154: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ -{ yymsp[-2].minor.yy616 = yymsp[-1].minor.yy616; } +{ yymsp[-2].minor.yy404 = yymsp[-1].minor.yy404; } break; case 155: /* full_table_name ::= table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy199, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; case 156: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, NULL); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 159: /* column_def ::= column_name type_name */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy737, yymsp[0].minor.yy640, NULL); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy199, yymsp[0].minor.yy530, NULL); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; case 160: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy104 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-2].minor.yy640, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-2].minor.yy530, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; case 161: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 162: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 163: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 164: /* type_name ::= INT */ case 165: /* type_name ::= INTEGER */ yytestcase(yyruleno==165); -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_INT); } break; case 166: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 167: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 168: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 169: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 170: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 171: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 172: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 173: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 174: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 175: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy640 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy530 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 176: /* type_name ::= JSON */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 177: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 178: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 179: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 180: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy530 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 181: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 182: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 183: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy640 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy530 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 185: /* tags_def_opt ::= tags_def */ - case 404: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==404); -{ yylhsminor.yy616 = yymsp[0].minor.yy616; } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 406: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==406); +{ yylhsminor.yy404 = yymsp[0].minor.yy404; } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; case 186: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy616 = yymsp[-1].minor.yy616; } +{ yymsp[-3].minor.yy404 = yymsp[-1].minor.yy404; } break; case 187: /* table_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy148 = createDefaultTableOptions(pCxt); } break; case 188: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 189: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 190: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy616); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 191: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; case 192: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-2].minor.yy104, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; case 193: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-4].minor.yy104, TABLE_OPTION_SMA, yymsp[-1].minor.yy616); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-4].minor.yy148, TABLE_OPTION_SMA, yymsp[-1].minor.yy404); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 194: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy104 = createAlterTableOptions(pCxt); yylhsminor.yy104 = setTableOption(pCxt, yylhsminor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 194: /* table_options ::= table_options DELETE_MARK duration_list */ +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-2].minor.yy148, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy404); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 195: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy104 = setTableOption(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy557.type, &yymsp[0].minor.yy557.val); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 195: /* alter_table_options ::= alter_table_option */ +{ yylhsminor.yy148 = createAlterTableOptions(pCxt); yylhsminor.yy148 = setTableOption(pCxt, yylhsminor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 196: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 196: /* alter_table_options ::= alter_table_options alter_table_option */ +{ yylhsminor.yy148 = setTableOption(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy123.type, &yymsp[0].minor.yy123.val); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 197: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy557.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy557.val = yymsp[0].minor.yy0; } + case 197: /* alter_table_option ::= COMMENT NK_STRING */ +{ yymsp[-1].minor.yy123.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 198: /* duration_list ::= duration_literal */ - case 369: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==369); -{ yylhsminor.yy616 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 198: /* alter_table_option ::= TTL NK_INTEGER */ +{ yymsp[-1].minor.yy123.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy123.val = yymsp[0].minor.yy0; } break; - case 199: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 370: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==370); -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 199: /* duration_list ::= duration_literal */ + case 371: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==371); +{ yylhsminor.yy404 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 202: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy737, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 200: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 372: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==372); +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 203: /* rollup_func_name ::= FIRST */ - case 204: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==204); - case 257: /* tag_item ::= QTAGS */ yytestcase(yyruleno==257); -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 203: /* rollup_func_name ::= function_name */ +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy199, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 207: /* col_name ::= column_name */ - case 258: /* tag_item ::= column_name */ yytestcase(yyruleno==258); -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 204: /* rollup_func_name ::= FIRST */ + case 205: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==205); + case 258: /* tag_item ::= QTAGS */ yytestcase(yyruleno==258); +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 208: /* cmd ::= SHOW DNODES */ + case 208: /* col_name ::= column_name */ + case 259: /* tag_item ::= column_name */ yytestcase(yyruleno==259); +{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199); } + yymsp[0].minor.yy148 = yylhsminor.yy148; + break; + case 209: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 209: /* cmd ::= SHOW USERS */ + case 210: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 210: /* cmd ::= SHOW USER PRIVILEGES */ + case 211: /* cmd ::= SHOW USER PRIVILEGES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); } break; - case 211: /* cmd ::= SHOW DATABASES */ + case 212: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 212: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } + case 213: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 213: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, OP_TYPE_LIKE); } + case 214: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, OP_TYPE_LIKE); } break; - case 214: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy104, NULL, OP_TYPE_LIKE); } + case 215: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy148, NULL, OP_TYPE_LIKE); } break; - case 215: /* cmd ::= SHOW MNODES */ + case 216: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 216: /* cmd ::= SHOW QNODES */ + case 217: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 217: /* cmd ::= SHOW FUNCTIONS */ + case 218: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 218: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } + case 219: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 219: /* cmd ::= SHOW STREAMS */ + case 220: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 220: /* cmd ::= SHOW ACCOUNTS */ + case 221: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 221: /* cmd ::= SHOW APPS */ + case 222: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 222: /* cmd ::= SHOW CONNECTIONS */ + case 223: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 223: /* cmd ::= SHOW LICENCES */ - case 224: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==224); + case 224: /* cmd ::= SHOW LICENCES */ + case 225: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==225); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 225: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy737); } + case 226: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy199); } break; - case 226: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy104); } + case 227: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy148); } break; - case 227: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy104); } + case 228: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy148); } break; - case 228: /* cmd ::= SHOW QUERIES */ + case 229: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 229: /* cmd ::= SHOW SCORES */ + case 230: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 230: /* cmd ::= SHOW TOPICS */ + case 231: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 231: /* cmd ::= SHOW VARIABLES */ - case 232: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==232); + case 232: /* cmd ::= SHOW VARIABLES */ + case 233: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==233); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 233: /* cmd ::= SHOW LOCAL VARIABLES */ + case 234: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 234: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy104); } + case 235: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy148); } break; - case 235: /* cmd ::= SHOW BNODES */ + case 236: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 236: /* cmd ::= SHOW SNODES */ + case 237: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 237: /* cmd ::= SHOW CLUSTER */ + case 238: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 238: /* cmd ::= SHOW TRANSACTIONS */ + case 239: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 239: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy104); } + case 240: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy148); } break; - case 240: /* cmd ::= SHOW CONSUMERS */ + case 241: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 241: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 242: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 242: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy104, yymsp[-1].minor.yy104, OP_TYPE_EQUAL); } + case 243: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy148, yymsp[-1].minor.yy148, OP_TYPE_EQUAL); } break; - case 243: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104, yymsp[-3].minor.yy616); } + case 244: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148, yymsp[-3].minor.yy404); } break; - case 244: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 245: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 245: /* cmd ::= SHOW VNODES NK_STRING */ + case 246: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 246: /* db_name_cond_opt ::= */ - case 251: /* from_db_opt ::= */ yytestcase(yyruleno==251); -{ yymsp[1].minor.yy104 = createDefaultDatabaseCondValue(pCxt); } + case 247: /* db_name_cond_opt ::= */ + case 252: /* from_db_opt ::= */ yytestcase(yyruleno==252); +{ yymsp[1].minor.yy148 = createDefaultDatabaseCondValue(pCxt); } break; - case 247: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 248: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 248: /* like_pattern_opt ::= */ - case 302: /* subtable_opt ::= */ yytestcase(yyruleno==302); - case 414: /* case_when_else_opt ::= */ yytestcase(yyruleno==414); - case 444: /* from_clause_opt ::= */ yytestcase(yyruleno==444); - case 473: /* where_clause_opt ::= */ yytestcase(yyruleno==473); - case 482: /* twindow_clause_opt ::= */ yytestcase(yyruleno==482); - case 487: /* sliding_opt ::= */ yytestcase(yyruleno==487); - case 489: /* fill_opt ::= */ yytestcase(yyruleno==489); - case 501: /* having_clause_opt ::= */ yytestcase(yyruleno==501); - case 503: /* range_opt ::= */ yytestcase(yyruleno==503); - case 505: /* every_opt ::= */ yytestcase(yyruleno==505); - case 518: /* slimit_clause_opt ::= */ yytestcase(yyruleno==518); - case 522: /* limit_clause_opt ::= */ yytestcase(yyruleno==522); -{ yymsp[1].minor.yy104 = NULL; } + case 249: /* like_pattern_opt ::= */ + case 304: /* subtable_opt ::= */ yytestcase(yyruleno==304); + case 416: /* case_when_else_opt ::= */ yytestcase(yyruleno==416); + case 446: /* from_clause_opt ::= */ yytestcase(yyruleno==446); + case 475: /* where_clause_opt ::= */ yytestcase(yyruleno==475); + case 484: /* twindow_clause_opt ::= */ yytestcase(yyruleno==484); + case 489: /* sliding_opt ::= */ yytestcase(yyruleno==489); + case 491: /* fill_opt ::= */ yytestcase(yyruleno==491); + case 503: /* having_clause_opt ::= */ yytestcase(yyruleno==503); + case 505: /* range_opt ::= */ yytestcase(yyruleno==505); + case 507: /* every_opt ::= */ yytestcase(yyruleno==507); + case 520: /* slimit_clause_opt ::= */ yytestcase(yyruleno==520); + case 524: /* limit_clause_opt ::= */ yytestcase(yyruleno==524); +{ yymsp[1].minor.yy148 = NULL; } break; - case 249: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 250: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 250: /* table_name_cond ::= table_name */ -{ yylhsminor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 251: /* table_name_cond ::= table_name */ +{ yylhsminor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 252: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy104 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy737); } + case 253: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy148 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy199); } break; - case 256: /* tag_item ::= TBNAME */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 257: /* tag_item ::= TBNAME */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 259: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 260: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy199), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 260: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy104 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy737), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 261: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy148 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy199), &yymsp[0].minor.yy199); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 261: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy185, yymsp[-3].minor.yy104, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } + case 262: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy148, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 262: /* cmd ::= DROP INDEX exists_opt full_table_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy185, yymsp[0].minor.yy104); } + case 263: /* cmd ::= DROP INDEX exists_opt full_table_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy148); } break; - case 263: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy104 = createIndexOption(pCxt, yymsp[-7].minor.yy616, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy148 = createIndexOption(pCxt, yymsp[-7].minor.yy404, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy104 = createIndexOption(pCxt, yymsp[-9].minor.yy616, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 265: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-11].minor.yy148 = createIndexOption(pCxt, yymsp[-9].minor.yy404, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 267: /* func ::= function_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy104 = createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 268: /* func ::= function_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy148 = createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 268: /* sma_stream_opt ::= */ - case 295: /* stream_options ::= */ yytestcase(yyruleno==295); -{ yymsp[1].minor.yy104 = createStreamOptions(pCxt); } + case 269: /* sma_stream_opt ::= */ + case 297: /* stream_options ::= */ yytestcase(yyruleno==297); +{ yymsp[1].minor.yy148 = createStreamOptions(pCxt); } break; - case 269: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 299: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==299); -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 270: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + case 301: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==301); +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 270: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 271: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 271: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, yymsp[0].minor.yy104); } + case 272: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 272: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy737, false); } + case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, yymsp[0].minor.yy148); } break; - case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[0].minor.yy737, true); } + case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy199, false); } break; - case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy737, yymsp[0].minor.yy104, false); } + case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[0].minor.yy199, true); } break; - case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy185, &yymsp[-5].minor.yy737, yymsp[0].minor.yy104, true); } + case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy199, yymsp[0].minor.yy148, false); } break; - case 276: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy199, yymsp[0].minor.yy148, true); } break; - case 277: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy185, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737); } + case 278: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 278: /* cmd ::= DESC full_table_name */ - case 279: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==279); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy104); } + case 279: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199); } break; - case 280: /* cmd ::= RESET QUERY CACHE */ + case 280: /* cmd ::= DESC full_table_name */ + case 281: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==281); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy148); } + break; + case 282: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 281: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy185, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 283: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 284: /* explain_options ::= */ -{ yymsp[1].minor.yy104 = createDefaultExplainOptions(pCxt); } + case 286: /* explain_options ::= */ +{ yymsp[1].minor.yy148 = createDefaultExplainOptions(pCxt); } break; - case 285: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy104 = setExplainVerbose(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 287: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy148 = setExplainVerbose(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 286: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy104 = setExplainRatio(pCxt, yymsp[-2].minor.yy104, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 288: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy148 = setExplainRatio(pCxt, yymsp[-2].minor.yy148, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 287: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy185, yymsp[-8].minor.yy185, &yymsp[-5].minor.yy737, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy640, yymsp[0].minor.yy196); } + case 289: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy199, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy530, yymsp[0].minor.yy706); } break; - case 288: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 290: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 293: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy185, &yymsp[-7].minor.yy737, yymsp[-4].minor.yy104, yymsp[-6].minor.yy104, yymsp[-3].minor.yy616, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } + case 295: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy397, &yymsp[-7].minor.yy199, yymsp[-4].minor.yy148, yymsp[-6].minor.yy148, yymsp[-3].minor.yy404, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } break; - case 294: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy185, &yymsp[0].minor.yy737); } + case 296: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy199); } break; - case 296: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 298: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 297: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 299: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 298: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy104)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 300: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy148)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy148)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); yylhsminor.yy148 = yymsp[-3].minor.yy148; } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 300: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy104)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-3].minor.yy104; } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 302: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy148)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-3].minor.yy148; } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 301: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-2].minor.yy104)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy104 = yymsp[-2].minor.yy104; } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 303: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy148)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy148 = yymsp[-2].minor.yy148; } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 303: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 488: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==488); - case 506: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==506); -{ yymsp[-3].minor.yy104 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy104); } + case 305: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 490: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); + case 508: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==508); +{ yymsp[-3].minor.yy148 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy148); } break; - case 304: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 306: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 305: /* cmd ::= KILL QUERY NK_STRING */ + case 307: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 306: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 308: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 307: /* cmd ::= BALANCE VGROUP */ + case 309: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 308: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 310: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 309: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy616); } + case 311: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy404); } break; - case 310: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 312: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 311: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy616 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 313: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy404 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 313: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 315: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 315: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy104, yymsp[-2].minor.yy616, yymsp[0].minor.yy104); } + case 317: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy148, yymsp[-2].minor.yy404, yymsp[0].minor.yy148); } break; - case 316: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy104, NULL, yymsp[0].minor.yy104); } + case 318: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy148, NULL, yymsp[0].minor.yy148); } break; - case 317: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 319: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 318: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 320: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 319: /* literal ::= NK_STRING */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 321: /* literal ::= NK_STRING */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 320: /* literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 322: /* literal ::= NK_BOOL */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 321: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 323: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 322: /* literal ::= duration_literal */ - case 332: /* signed_literal ::= signed */ yytestcase(yyruleno==332); - case 352: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==352); - case 353: /* expression ::= literal */ yytestcase(yyruleno==353); - case 354: /* expression ::= pseudo_column */ yytestcase(yyruleno==354); - case 355: /* expression ::= column_reference */ yytestcase(yyruleno==355); - case 356: /* expression ::= function_expression */ yytestcase(yyruleno==356); - case 357: /* expression ::= case_when_expression */ yytestcase(yyruleno==357); - case 387: /* function_expression ::= literal_func */ yytestcase(yyruleno==387); - case 436: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==436); - case 440: /* boolean_primary ::= predicate */ yytestcase(yyruleno==440); - case 442: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==442); - case 443: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==443); - case 446: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==446); - case 448: /* table_reference ::= table_primary */ yytestcase(yyruleno==448); - case 449: /* table_reference ::= joined_table */ yytestcase(yyruleno==449); - case 453: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==453); - case 508: /* query_simple ::= query_specification */ yytestcase(yyruleno==508); - case 509: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==509); - case 512: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==512); - case 514: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==514); -{ yylhsminor.yy104 = yymsp[0].minor.yy104; } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 324: /* literal ::= duration_literal */ + case 334: /* signed_literal ::= signed */ yytestcase(yyruleno==334); + case 354: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==354); + case 355: /* expression ::= literal */ yytestcase(yyruleno==355); + case 356: /* expression ::= pseudo_column */ yytestcase(yyruleno==356); + case 357: /* expression ::= column_reference */ yytestcase(yyruleno==357); + case 358: /* expression ::= function_expression */ yytestcase(yyruleno==358); + case 359: /* expression ::= case_when_expression */ yytestcase(yyruleno==359); + case 389: /* function_expression ::= literal_func */ yytestcase(yyruleno==389); + case 438: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==438); + case 442: /* boolean_primary ::= predicate */ yytestcase(yyruleno==442); + case 444: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==444); + case 445: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==445); + case 448: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==448); + case 450: /* table_reference ::= table_primary */ yytestcase(yyruleno==450); + case 451: /* table_reference ::= joined_table */ yytestcase(yyruleno==451); + case 455: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==455); + case 510: /* query_simple ::= query_specification */ yytestcase(yyruleno==510); + case 511: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==511); + case 514: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==514); + case 516: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==516); +{ yylhsminor.yy148 = yymsp[0].minor.yy148; } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 323: /* literal ::= NULL */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 325: /* literal ::= NULL */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 324: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 326: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 325: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 327: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 326: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 328: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 327: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 329: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 328: /* signed ::= NK_MINUS NK_INTEGER */ + case 330: /* 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.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 329: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 331: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 330: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 332: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 331: /* signed ::= NK_MINUS NK_FLOAT */ + case 333: /* 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.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 333: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 335: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 334: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 336: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 335: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 337: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 336: /* signed_literal ::= duration_literal */ - case 338: /* signed_literal ::= literal_func */ yytestcase(yyruleno==338); - case 407: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==407); - case 469: /* select_item ::= common_expression */ yytestcase(yyruleno==469); - case 479: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==479); - case 513: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==513); - case 515: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==515); - case 528: /* search_condition ::= common_expression */ yytestcase(yyruleno==528); -{ yylhsminor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 338: /* signed_literal ::= duration_literal */ + case 340: /* signed_literal ::= literal_func */ yytestcase(yyruleno==340); + case 409: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==409); + case 471: /* select_item ::= common_expression */ yytestcase(yyruleno==471); + case 481: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==481); + case 515: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==515); + case 517: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==517); + case 530: /* search_condition ::= common_expression */ yytestcase(yyruleno==530); +{ yylhsminor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 337: /* signed_literal ::= NULL */ -{ yylhsminor.yy104 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 339: /* signed_literal ::= NULL */ +{ yylhsminor.yy148 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 339: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy104 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 341: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy148 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 358: /* expression ::= NK_LP expression NK_RP */ - case 441: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==441); - case 527: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==527); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 360: /* expression ::= NK_LP expression NK_RP */ + case 443: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==443); + case 529: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==529); +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 359: /* expression ::= NK_PLUS expr_or_subquery */ + case 361: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 360: /* expression ::= NK_MINUS expr_or_subquery */ + case 362: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 361: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 363: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 362: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 364: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 363: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 365: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 364: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 366: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 365: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 367: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 366: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 368: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 367: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 369: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 368: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 370: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 371: /* column_reference ::= column_name */ -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy737, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy737)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 373: /* column_reference ::= column_name */ +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy199, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy199)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 372: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737, createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy737)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 374: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199, createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy199)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 373: /* pseudo_column ::= ROWTS */ - case 374: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==374); - case 376: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==376); - case 377: /* pseudo_column ::= QEND */ yytestcase(yyruleno==377); - case 378: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==378); - case 379: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==379); - case 380: /* pseudo_column ::= WEND */ yytestcase(yyruleno==380); - case 381: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==381); - case 382: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==382); - case 383: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==383); - case 389: /* literal_func ::= NOW */ yytestcase(yyruleno==389); -{ yylhsminor.yy104 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 375: /* pseudo_column ::= ROWTS */ + case 376: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==376); + case 378: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==378); + case 379: /* pseudo_column ::= QEND */ yytestcase(yyruleno==379); + case 380: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==380); + case 381: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==381); + case 382: /* pseudo_column ::= WEND */ yytestcase(yyruleno==382); + case 383: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==383); + case 384: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==384); + case 385: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==385); + case 391: /* literal_func ::= NOW */ yytestcase(yyruleno==391); +{ yylhsminor.yy148 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 375: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy737)))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 377: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy199)))); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 384: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 385: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==385); -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy737, yymsp[-1].minor.yy616)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 386: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 387: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==387); +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy199, yymsp[-1].minor.yy404)); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 386: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy640)); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 388: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy530)); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 388: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy737, NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 390: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy199, NULL)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 403: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy616 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 405: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy404 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 408: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 472: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==472); -{ yylhsminor.yy104 = createColumnNode(pCxt, &yymsp[-2].minor.yy737, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 410: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 474: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==474); +{ yylhsminor.yy148 = createColumnNode(pCxt, &yymsp[-2].minor.yy199, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 409: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 411: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 410: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-2].minor.yy616, yymsp[-1].minor.yy104)); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + case 412: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-2].minor.yy404, yymsp[-1].minor.yy148)); } + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 413: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy104 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104)); } + case 415: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy148 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148)); } break; - case 415: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy104 = releaseRawExprNode(pCxt, yymsp[0].minor.yy104); } + case 417: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy148 = releaseRawExprNode(pCxt, yymsp[0].minor.yy148); } break; - case 416: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 421: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==421); + case 418: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 423: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==423); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy668, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 417: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 419: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-4].minor.yy104 = yylhsminor.yy104; + yymsp[-4].minor.yy148 = yylhsminor.yy148; break; - case 418: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 420: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 419: /* predicate ::= expr_or_subquery IS NULL */ + case 421: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), NULL)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 420: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 422: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL)); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 422: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_THAN; } + case 424: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; } break; - case 423: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_THAN; } + case 425: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; } break; - case 424: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LOWER_EQUAL; } + case 426: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; } break; - case 425: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy668 = OP_TYPE_GREATER_EQUAL; } + case 427: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; } break; - case 426: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy668 = OP_TYPE_NOT_EQUAL; } + case 428: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; } break; - case 427: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy668 = OP_TYPE_EQUAL; } + case 429: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy20 = OP_TYPE_EQUAL; } break; - case 428: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy668 = OP_TYPE_LIKE; } + case 430: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy20 = OP_TYPE_LIKE; } break; - case 429: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_LIKE; } + case 431: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; } break; - case 430: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_MATCH; } + case 432: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_MATCH; } break; - case 431: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy668 = OP_TYPE_NMATCH; } + case 433: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy20 = OP_TYPE_NMATCH; } break; - case 432: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy668 = OP_TYPE_JSON_CONTAINS; } + case 434: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; } break; - case 433: /* in_op ::= IN */ -{ yymsp[0].minor.yy668 = OP_TYPE_IN; } + case 435: /* in_op ::= IN */ +{ yymsp[0].minor.yy20 = OP_TYPE_IN; } break; - case 434: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy668 = OP_TYPE_NOT_IN; } + case 436: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; } break; - case 435: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 437: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 437: /* boolean_value_expression ::= NOT boolean_primary */ + case 439: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy104), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy148), NULL)); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 438: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 440: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 439: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 441: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy104); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy104); - yylhsminor.yy104 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy148); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy148); + yylhsminor.yy148 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 445: /* from_clause_opt ::= FROM table_reference_list */ - case 474: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==474); - case 502: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==502); -{ yymsp[-1].minor.yy104 = yymsp[0].minor.yy104; } + case 447: /* from_clause_opt ::= FROM table_reference_list */ + case 476: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==476); + case 504: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==504); +{ yymsp[-1].minor.yy148 = yymsp[0].minor.yy148; } break; - case 447: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy104, yymsp[0].minor.yy104, NULL); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 449: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy148 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy148, yymsp[0].minor.yy148, NULL); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 450: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 452: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy148 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 451: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy104 = createRealTableNode(pCxt, &yymsp[-3].minor.yy737, &yymsp[-1].minor.yy737, &yymsp[0].minor.yy737); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 453: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy148 = createRealTableNode(pCxt, &yymsp[-3].minor.yy199, &yymsp[-1].minor.yy199, &yymsp[0].minor.yy199); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 452: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy104 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 454: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy148 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 454: /* alias_opt ::= */ -{ yymsp[1].minor.yy737 = nil_token; } + case 456: /* alias_opt ::= */ +{ yymsp[1].minor.yy199 = nil_token; } break; - case 456: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy737 = yymsp[0].minor.yy737; } + case 458: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy199 = yymsp[0].minor.yy199; } break; - case 457: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 458: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==458); -{ yymsp[-2].minor.yy104 = yymsp[-1].minor.yy104; } + case 459: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 460: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==460); +{ yymsp[-2].minor.yy148 = yymsp[-1].minor.yy148; } break; - case 459: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy104 = createJoinTableNode(pCxt, yymsp[-4].minor.yy228, yymsp[-5].minor.yy104, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-5].minor.yy104 = yylhsminor.yy104; + case 461: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy148 = createJoinTableNode(pCxt, yymsp[-4].minor.yy470, yymsp[-5].minor.yy148, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-5].minor.yy148 = yylhsminor.yy148; break; - case 460: /* join_type ::= */ -{ yymsp[1].minor.yy228 = JOIN_TYPE_INNER; } + case 462: /* join_type ::= */ +{ yymsp[1].minor.yy470 = JOIN_TYPE_INNER; } break; - case 461: /* join_type ::= INNER */ -{ yymsp[0].minor.yy228 = JOIN_TYPE_INNER; } + case 463: /* join_type ::= INNER */ +{ yymsp[0].minor.yy470 = JOIN_TYPE_INNER; } break; - case 462: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 464: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy104 = createSelectStmt(pCxt, yymsp[-10].minor.yy185, yymsp[-9].minor.yy616, yymsp[-8].minor.yy104); - yymsp[-11].minor.yy104 = addWhereClause(pCxt, yymsp[-11].minor.yy104, yymsp[-7].minor.yy104); - yymsp[-11].minor.yy104 = addPartitionByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-6].minor.yy616); - yymsp[-11].minor.yy104 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy104, yymsp[-2].minor.yy104); - yymsp[-11].minor.yy104 = addGroupByClause(pCxt, yymsp[-11].minor.yy104, yymsp[-1].minor.yy616); - yymsp[-11].minor.yy104 = addHavingClause(pCxt, yymsp[-11].minor.yy104, yymsp[0].minor.yy104); - yymsp[-11].minor.yy104 = addRangeClause(pCxt, yymsp[-11].minor.yy104, yymsp[-5].minor.yy104); - yymsp[-11].minor.yy104 = addEveryClause(pCxt, yymsp[-11].minor.yy104, yymsp[-4].minor.yy104); - yymsp[-11].minor.yy104 = addFillClause(pCxt, yymsp[-11].minor.yy104, yymsp[-3].minor.yy104); + yymsp[-11].minor.yy148 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy404, yymsp[-8].minor.yy148); + yymsp[-11].minor.yy148 = addWhereClause(pCxt, yymsp[-11].minor.yy148, yymsp[-7].minor.yy148); + yymsp[-11].minor.yy148 = addPartitionByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-6].minor.yy404); + yymsp[-11].minor.yy148 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy148, yymsp[-2].minor.yy148); + yymsp[-11].minor.yy148 = addGroupByClause(pCxt, yymsp[-11].minor.yy148, yymsp[-1].minor.yy404); + yymsp[-11].minor.yy148 = addHavingClause(pCxt, yymsp[-11].minor.yy148, yymsp[0].minor.yy148); + yymsp[-11].minor.yy148 = addRangeClause(pCxt, yymsp[-11].minor.yy148, yymsp[-5].minor.yy148); + yymsp[-11].minor.yy148 = addEveryClause(pCxt, yymsp[-11].minor.yy148, yymsp[-4].minor.yy148); + yymsp[-11].minor.yy148 = addFillClause(pCxt, yymsp[-11].minor.yy148, yymsp[-3].minor.yy148); } break; - case 465: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy185 = false; } + case 467: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy397 = false; } break; - case 468: /* select_item ::= NK_STAR */ -{ yylhsminor.yy104 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy104 = yylhsminor.yy104; + case 470: /* select_item ::= NK_STAR */ +{ yylhsminor.yy148 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy148 = yylhsminor.yy148; break; - case 470: /* select_item ::= common_expression column_alias */ - case 480: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==480); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-1].minor.yy104 = yylhsminor.yy104; + case 472: /* select_item ::= common_expression column_alias */ + case 482: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==482); +{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-1].minor.yy148 = yylhsminor.yy148; break; - case 471: /* select_item ::= common_expression AS column_alias */ - case 481: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==481); -{ yylhsminor.yy104 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), &yymsp[0].minor.yy737); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 473: /* select_item ::= common_expression AS column_alias */ + case 483: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==483); +{ yylhsminor.yy148 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), &yymsp[0].minor.yy199); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 476: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 498: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==498); - case 517: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==517); -{ yymsp[-2].minor.yy616 = yymsp[0].minor.yy616; } + case 478: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 500: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==500); + case 519: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==519); +{ yymsp[-2].minor.yy404 = yymsp[0].minor.yy404; } break; - case 483: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy104 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 485: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy148 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 484: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy104 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 486: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy148 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 485: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), NULL, yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 487: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), NULL, yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 486: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy104 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy104), releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), yymsp[-1].minor.yy104, yymsp[0].minor.yy104); } + case 488: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy148 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy148), releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), yymsp[-1].minor.yy148, yymsp[0].minor.yy148); } break; - case 490: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy104 = createFillNode(pCxt, yymsp[-1].minor.yy246, NULL); } + case 492: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy148 = createFillNode(pCxt, yymsp[-1].minor.yy334, NULL); } break; - case 491: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy104 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy616)); } + case 493: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy148 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy404)); } break; - case 492: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy246 = FILL_MODE_NONE; } + case 494: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy334 = FILL_MODE_NONE; } break; - case 493: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy246 = FILL_MODE_PREV; } + case 495: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy334 = FILL_MODE_PREV; } break; - case 494: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy246 = FILL_MODE_NULL; } + case 496: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy334 = FILL_MODE_NULL; } break; - case 495: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy246 = FILL_MODE_LINEAR; } + case 497: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy334 = FILL_MODE_LINEAR; } break; - case 496: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy246 = FILL_MODE_NEXT; } + case 498: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy334 = FILL_MODE_NEXT; } break; - case 499: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy616 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[0].minor.yy616 = yylhsminor.yy616; + case 501: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy404 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } + yymsp[0].minor.yy404 = yylhsminor.yy404; break; - case 500: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy616 = addNodeToList(pCxt, yymsp[-2].minor.yy616, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy104))); } - yymsp[-2].minor.yy616 = yylhsminor.yy616; + case 502: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy404 = addNodeToList(pCxt, yymsp[-2].minor.yy404, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy148))); } + yymsp[-2].minor.yy404 = yylhsminor.yy404; break; - case 504: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy104 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy104), releaseRawExprNode(pCxt, yymsp[-1].minor.yy104)); } + case 506: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy148 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy148), releaseRawExprNode(pCxt, yymsp[-1].minor.yy148)); } break; - case 507: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 509: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy104 = addOrderByClause(pCxt, yymsp[-3].minor.yy104, yymsp[-2].minor.yy616); - yylhsminor.yy104 = addSlimitClause(pCxt, yylhsminor.yy104, yymsp[-1].minor.yy104); - yylhsminor.yy104 = addLimitClause(pCxt, yylhsminor.yy104, yymsp[0].minor.yy104); + yylhsminor.yy148 = addOrderByClause(pCxt, yymsp[-3].minor.yy148, yymsp[-2].minor.yy404); + yylhsminor.yy148 = addSlimitClause(pCxt, yylhsminor.yy148, yymsp[-1].minor.yy148); + yylhsminor.yy148 = addLimitClause(pCxt, yylhsminor.yy148, yymsp[0].minor.yy148); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 510: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-3].minor.yy104 = yylhsminor.yy104; + case 512: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-3].minor.yy148 = yylhsminor.yy148; break; - case 511: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy104 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy104, yymsp[0].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 513: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy148 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy148, yymsp[0].minor.yy148); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 519: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 523: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==523); -{ yymsp[-1].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==525); +{ yymsp[-1].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 520: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 524: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==524); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 522: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 526: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==526); +{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 521: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 525: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==525); -{ yymsp[-3].minor.yy104 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==527); +{ yymsp[-3].minor.yy148 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 526: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy104 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy104); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 528: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy148 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy148); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 531: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy104 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy104), yymsp[-1].minor.yy50, yymsp[0].minor.yy793); } - yymsp[-2].minor.yy104 = yylhsminor.yy104; + case 533: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy148 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy148), yymsp[-1].minor.yy898, yymsp[0].minor.yy499); } + yymsp[-2].minor.yy148 = yylhsminor.yy148; break; - case 532: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy50 = ORDER_ASC; } + case 534: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy898 = ORDER_ASC; } break; - case 533: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy50 = ORDER_ASC; } + case 535: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy898 = ORDER_ASC; } break; - case 534: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy50 = ORDER_DESC; } + case 536: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy898 = ORDER_DESC; } break; - case 535: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy793 = NULL_ORDER_DEFAULT; } + case 537: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy499 = NULL_ORDER_DEFAULT; } break; - case 536: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_FIRST; } + case 538: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy499 = NULL_ORDER_FIRST; } break; - case 537: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy793 = NULL_ORDER_LAST; } + case 539: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy499 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 634fd3e127..334d12b95f 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -375,9 +375,68 @@ TEST_F(ParserInitialCTest, createFunction) { TEST_F(ParserInitialCTest, createSmaIndex) { useDb("root", "test"); + SMCreateSmaReq expect = {0}; + + auto setCreateSmacReq = [&](const char* pIndexName, const char* pStbName, int64_t interval, int8_t intervalUnit, + int64_t offset = 0, int64_t sliding = -1, int8_t slidingUnit = -1, int8_t igExists = 0) { + memset(&expect, 0, sizeof(SMCreateSmaReq)); + strcpy(expect.name, pIndexName); + strcpy(expect.stb, pStbName); + expect.igExists = igExists; + expect.intervalUnit = intervalUnit; + expect.slidingUnit = slidingUnit < 0 ? intervalUnit : slidingUnit; + expect.timezone = 0; + expect.dstVgId = 1; + expect.interval = interval; + expect.offset = offset; + expect.sliding = sliding < 0 ? interval : sliding; + expect.maxDelay = -1; + expect.watermark = TSDB_DEFAULT_ROLLUP_WATERMARK; + expect.deleteMark = TSDB_DEFAULT_ROLLUP_DELETE_MARK; + }; + + auto setOptionsForCreateSmacReq = [&](int64_t maxDelay, int64_t watermark, int64_t deleteMark) { + expect.maxDelay = maxDelay; + expect.watermark = watermark; + expect.deleteMark = deleteMark; + }; + + setCheckDdlFunc([&](const SQuery* pQuery, ParserStage stage) { + ASSERT_EQ(nodeType(pQuery->pRoot), QUERY_NODE_CREATE_INDEX_STMT); + SMCreateSmaReq req = {0}; + ASSERT_TRUE(TSDB_CODE_SUCCESS == tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req)); + + ASSERT_EQ(std::string(req.name), std::string(expect.name)); + ASSERT_EQ(std::string(req.stb), std::string(expect.stb)); + ASSERT_EQ(req.igExists, expect.igExists); + ASSERT_EQ(req.intervalUnit, expect.intervalUnit); + ASSERT_EQ(req.slidingUnit, expect.slidingUnit); + ASSERT_EQ(req.timezone, expect.timezone); + ASSERT_EQ(req.dstVgId, expect.dstVgId); + ASSERT_EQ(req.interval, expect.interval); + ASSERT_EQ(req.offset, expect.offset); + ASSERT_EQ(req.sliding, expect.sliding); + ASSERT_EQ(req.maxDelay, expect.maxDelay); + ASSERT_EQ(req.watermark, expect.watermark); + ASSERT_EQ(req.deleteMark, expect.deleteMark); + ASSERT_GT(req.exprLen, 0); + ASSERT_EQ(req.tagsFilterLen, 0); + ASSERT_GT(req.sqlLen, 0); + ASSERT_GT(req.astLen, 0); + ASSERT_NE(req.expr, nullptr); + ASSERT_EQ(req.tagsFilter, nullptr); + ASSERT_NE(req.sql, nullptr); + ASSERT_NE(req.ast, nullptr); + tFreeSMCreateSmaReq(&req); + }); + + setCreateSmacReq("0.test.index1", "0.test.t1", 10 * MILLISECOND_PER_SECOND, 's'); run("CREATE SMA INDEX index1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); - run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(10s)"); + setCreateSmacReq("0.test.index2", "0.test.st1", 5 * MILLISECOND_PER_SECOND, 's'); + setOptionsForCreateSmacReq(10 * MILLISECOND_PER_SECOND, 20 * MILLISECOND_PER_SECOND, 1000 * MILLISECOND_PER_SECOND); + run("CREATE SMA INDEX index2 ON st1 FUNCTION(MAX(c1), MIN(tag1)) INTERVAL(5s) WATERMARK 20s MAX_DELAY 10s " + "DELETE_MARK 1000s"); } TEST_F(ParserInitialCTest, createMnode) { @@ -408,23 +467,26 @@ TEST_F(ParserInitialCTest, createStable) { memset(&expect, 0, sizeof(SMCreateStbReq)); }; - auto setCreateStbReqFunc = [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, - int64_t delay2 = -1, int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, - int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { - int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); - expect.name[len] = '\0'; - expect.igExists = igExists; - expect.delay1 = delay1; - expect.delay2 = delay2; - expect.watermark1 = watermark1; - expect.watermark2 = watermark2; - // expect.ttl = ttl; - if (nullptr != pComment) { - expect.pComment = strdup(pComment); - expect.commentLen = strlen(pComment); - } - }; + auto setCreateStbReqFunc = + [&](const char* pDbName, const char* pTbName, int8_t igExists = 0, int64_t delay1 = -1, int64_t delay2 = -1, + int64_t watermark1 = TSDB_DEFAULT_ROLLUP_WATERMARK, int64_t watermark2 = TSDB_DEFAULT_ROLLUP_WATERMARK, + int64_t deleteMark1 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, int64_t deleteMark2 = TSDB_DEFAULT_ROLLUP_DELETE_MARK, + int32_t ttl = TSDB_DEFAULT_TABLE_TTL, const char* pComment = nullptr) { + int32_t len = snprintf(expect.name, sizeof(expect.name), "0.%s.%s", pDbName, pTbName); + expect.name[len] = '\0'; + expect.igExists = igExists; + expect.delay1 = delay1; + expect.delay2 = delay2; + expect.watermark1 = watermark1; + expect.watermark2 = watermark2; + expect.deleteMark1 = deleteMark1; + expect.deleteMark2 = deleteMark2; + // expect.ttl = ttl; + if (nullptr != pComment) { + expect.pComment = strdup(pComment); + expect.commentLen = strlen(pComment); + } + }; auto addFieldToCreateStbReqFunc = [&](bool col, const char* pFieldName, uint8_t type, int32_t bytes = 0, int8_t flags = COL_SMA_ON) { @@ -511,7 +573,8 @@ TEST_F(ParserInitialCTest, createStable) { clearCreateStbReq(); setCreateStbReqFunc("rollup_db", "t1", 1, 100 * MILLISECOND_PER_SECOND, 10 * MILLISECOND_PER_MINUTE, 10, - 1 * MILLISECOND_PER_MINUTE, 100, "test create table"); + 1 * MILLISECOND_PER_MINUTE, 1000 * MILLISECOND_PER_SECOND, 200 * MILLISECOND_PER_MINUTE, 100, + "test create table"); addFieldToCreateStbReqFunc(true, "ts", TSDB_DATA_TYPE_TIMESTAMP, 0, 0); addFieldToCreateStbReqFunc(true, "c1", TSDB_DATA_TYPE_INT); addFieldToCreateStbReqFunc(true, "c2", TSDB_DATA_TYPE_UINT); @@ -549,7 +612,8 @@ TEST_F(ParserInitialCTest, createStable) { "TAGS (a1 TIMESTAMP, a2 INT, a3 INT UNSIGNED, a4 BIGINT, a5 BIGINT UNSIGNED, a6 FLOAT, a7 DOUBLE, " "a8 BINARY(20), a9 SMALLINT, a10 SMALLINT UNSIGNED COMMENT 'test column comment', a11 TINYINT, " "a12 TINYINT UNSIGNED, a13 BOOL, a14 NCHAR(30), a15 VARCHAR(50)) " - "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m"); + "TTL 100 COMMENT 'test create table' SMA(c1, c2, c3) ROLLUP (MIN) MAX_DELAY 100s,10m WATERMARK 10a,1m " + "DELETE_MARK 1000s,200m"); clearCreateStbReq(); } diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index dd5e283a55..b05c35452b 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -702,6 +702,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm if (pCxt->pPlanCxt->streamQuery) { pWindow->triggerType = pCxt->pPlanCxt->triggerType; pWindow->watermark = pCxt->pPlanCxt->watermark; + pWindow->deleteMark = pCxt->pPlanCxt->deleteMark; pWindow->igExpired = pCxt->pPlanCxt->igExpired; } pWindow->inputTsOrder = ORDER_ASC; diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index c370e2c84b..e1687fc3a5 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -330,6 +330,7 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) { pScan->slidingUnit = ((SWindowLogicNode*)pParent)->slidingUnit; pScan->triggerType = ((SWindowLogicNode*)pParent)->triggerType; pScan->watermark = ((SWindowLogicNode*)pParent)->watermark; + pScan->deleteMark = ((SWindowLogicNode*)pParent)->deleteMark; pScan->igExpired = ((SWindowLogicNode*)pParent)->igExpired; } } diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 53c1d24df9..e5675310b5 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -1139,6 +1139,7 @@ static int32_t createWindowPhysiNodeFinalize(SPhysiPlanContext* pCxt, SNodeList* SWindowLogicNode* pWindowLogicNode) { pWindow->triggerType = pWindowLogicNode->triggerType; pWindow->watermark = pWindowLogicNode->watermark; + pWindow->deleteMark = pWindowLogicNode->deleteMark; pWindow->igExpired = pWindowLogicNode->igExpired; pWindow->inputTsOrder = pWindowLogicNode->inputTsOrder; pWindow->outputTsOrder = pWindowLogicNode->outputTsOrder; diff --git a/source/libs/planner/test/planOtherTest.cpp b/source/libs/planner/test/planOtherTest.cpp index 3ed23d6cb2..4741d241b5 100644 --- a/source/libs/planner/test/planOtherTest.cpp +++ b/source/libs/planner/test/planOtherTest.cpp @@ -51,7 +51,7 @@ TEST_F(PlanOtherTest, createStreamUseSTable) { TEST_F(PlanOtherTest, createSmaIndex) { useDb("root", "test"); - run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s)"); + run("CREATE SMA INDEX idx1 ON t1 FUNCTION(MAX(c1), MIN(c3 + 10), SUM(c4)) INTERVAL(10s) DELETE_MARK 1000s"); run("SELECT SUM(c4) FROM t1 INTERVAL(10s)"); diff --git a/source/libs/planner/test/planTestUtil.cpp b/source/libs/planner/test/planTestUtil.cpp index b3620cedfb..d89e669a90 100644 --- a/source/libs/planner/test/planTestUtil.cpp +++ b/source/libs/planner/test/planTestUtil.cpp @@ -444,6 +444,7 @@ class PlannerTestBaseImpl { tDeserializeSMCreateSmaReq(pQuery->pCmdMsg->pMsg, pQuery->pCmdMsg->msgLen, &req); g_mockCatalogService->createSmaIndex(&req); nodesStringToNode(req.ast, &pCxt->pAstRoot); + pCxt->deleteMark = req.deleteMark; tFreeSMCreateSmaReq(&req); nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = pCxt->pAstRoot; diff --git a/source/libs/scheduler/inc/schInt.h b/source/libs/scheduler/inc/schInt.h index 39118910f1..48df7e36a3 100644 --- a/source/libs/scheduler/inc/schInt.h +++ b/source/libs/scheduler/inc/schInt.h @@ -377,7 +377,7 @@ extern SSchedulerMgmt schMgmt; #define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode) #define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL) #define SCH_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \ - (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)))) + (SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)) || (_task)->redirectCtx.inRedirect)) #define SCH_REDIRECT_MSGTYPE(_msgType) \ ((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \ (_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH) diff --git a/source/libs/scheduler/src/schRemote.c b/source/libs/scheduler/src/schRemote.c index 86e64666c0..f3ef8c4afc 100644 --- a/source/libs/scheduler/src/schRemote.c +++ b/source/libs/scheduler/src/schRemote.c @@ -156,6 +156,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa SCH_RET(schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode)); } + pTask->redirectCtx.inRedirect = false; + switch (msgType) { case TDMT_VND_COMMIT_RSP: { SCH_ERR_JRET(rspCode); diff --git a/source/libs/scheduler/src/schTask.c b/source/libs/scheduler/src/schTask.c index cd69834924..8e60222ca6 100644 --- a/source/libs/scheduler/src/schTask.c +++ b/source/libs/scheduler/src/schTask.c @@ -362,17 +362,12 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet, } pCtx->totalTimes++; + pCtx->roundTimes++; if (SCH_IS_DATA_BIND_TASK(pTask) && pEpSet) { pCtx->roundTotal = pEpSet->numOfEps; - pCtx->roundTimes = 0; - - pTask->delayExecMs = 0; - - goto _return; } - pCtx->roundTimes++; if (pCtx->roundTimes >= pCtx->roundTotal) { int64_t nowTs = taosGetTimestampMs(); diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c index 2fea5b9eca..8321235605 100644 --- a/source/libs/stream/src/streamData.c +++ b/source/libs/stream/src/streamData.c @@ -66,12 +66,12 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock return 0; } -SStreamDataSubmit* streamDataSubmitNew(SSubmitReq* pReq) { - SStreamDataSubmit* pDataSubmit = (SStreamDataSubmit*)taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); +SStreamDataSubmit2* streamDataSubmitNew(SPackedData submit) { + SStreamDataSubmit2* pDataSubmit = (SStreamDataSubmit2*)taosAllocateQitem(sizeof(SStreamDataSubmit2), DEF_QITEM); if (pDataSubmit == NULL) return NULL; pDataSubmit->dataRef = (int32_t*)taosMemoryMalloc(sizeof(int32_t)); if (pDataSubmit->dataRef == NULL) goto FAIL; - pDataSubmit->data = pReq; + pDataSubmit->submit = submit; *pDataSubmit->dataRef = 1; pDataSubmit->type = STREAM_INPUT__DATA_SUBMIT; return pDataSubmit; @@ -80,47 +80,47 @@ FAIL: return NULL; } -SStreamMergedSubmit* streamMergedSubmitNew() { - SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)taosAllocateQitem(sizeof(SStreamMergedSubmit), DEF_QITEM); +SStreamMergedSubmit2* streamMergedSubmitNew() { + SStreamMergedSubmit2* pMerged = (SStreamMergedSubmit2*)taosAllocateQitem(sizeof(SStreamMergedSubmit2), DEF_QITEM); if (pMerged == NULL) return NULL; - pMerged->reqs = taosArrayInit(0, sizeof(void*)); + pMerged->submits = taosArrayInit(0, sizeof(SPackedData)); pMerged->dataRefs = taosArrayInit(0, sizeof(void*)); - if (pMerged->dataRefs == NULL || pMerged->reqs == NULL) goto FAIL; + if (pMerged->dataRefs == NULL || pMerged->submits == NULL) goto FAIL; pMerged->type = STREAM_INPUT__MERGED_SUBMIT; return pMerged; FAIL: - if (pMerged->reqs) taosArrayDestroy(pMerged->reqs); + if (pMerged->submits) taosArrayDestroy(pMerged->submits); if (pMerged->dataRefs) taosArrayDestroy(pMerged->dataRefs); taosFreeQitem(pMerged); return NULL; } -int32_t streamMergeSubmit(SStreamMergedSubmit* pMerged, SStreamDataSubmit* pSubmit) { +int32_t streamMergeSubmit(SStreamMergedSubmit2* pMerged, SStreamDataSubmit2* pSubmit) { taosArrayPush(pMerged->dataRefs, &pSubmit->dataRef); - taosArrayPush(pMerged->reqs, &pSubmit->data); + taosArrayPush(pMerged->submits, &pSubmit->submit); pMerged->ver = pSubmit->ver; return 0; } -static FORCE_INLINE void streamDataSubmitRefInc(SStreamDataSubmit* pDataSubmit) { +static FORCE_INLINE void streamDataSubmitRefInc(SStreamDataSubmit2* pDataSubmit) { atomic_add_fetch_32(pDataSubmit->dataRef, 1); } -SStreamDataSubmit* streamSubmitRefClone(SStreamDataSubmit* pSubmit) { - SStreamDataSubmit* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit), DEF_QITEM); +SStreamDataSubmit2* streamSubmitRefClone(SStreamDataSubmit2* pSubmit) { + SStreamDataSubmit2* pSubmitClone = taosAllocateQitem(sizeof(SStreamDataSubmit2), DEF_QITEM); if (pSubmitClone == NULL) { return NULL; } streamDataSubmitRefInc(pSubmit); - memcpy(pSubmitClone, pSubmit, sizeof(SStreamDataSubmit)); + memcpy(pSubmitClone, pSubmit, sizeof(SStreamDataSubmit2)); return pSubmitClone; } -void streamDataSubmitRefDec(SStreamDataSubmit* pDataSubmit) { +void streamDataSubmitRefDec(SStreamDataSubmit2* pDataSubmit) { int32_t ref = atomic_sub_fetch_32(pDataSubmit->dataRef, 1); ASSERT(ref >= 0); if (ref == 0) { - taosMemoryFree(pDataSubmit->data); + taosMemoryFree(pDataSubmit->submit.msgStr); taosMemoryFree(pDataSubmit->dataRef); } } @@ -135,16 +135,16 @@ SStreamQueueItem* streamMergeQueueItem(SStreamQueueItem* dst, SStreamQueueItem* taosFreeQitem(elem); return dst; } else if (dst->type == STREAM_INPUT__MERGED_SUBMIT && elem->type == STREAM_INPUT__DATA_SUBMIT) { - SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)dst; - SStreamDataSubmit* pBlockSrc = (SStreamDataSubmit*)elem; + SStreamMergedSubmit2* pMerged = (SStreamMergedSubmit2*)dst; + SStreamDataSubmit2* pBlockSrc = (SStreamDataSubmit2*)elem; streamMergeSubmit(pMerged, pBlockSrc); taosFreeQitem(elem); return dst; } else if (dst->type == STREAM_INPUT__DATA_SUBMIT && elem->type == STREAM_INPUT__DATA_SUBMIT) { - SStreamMergedSubmit* pMerged = streamMergedSubmitNew(); + SStreamMergedSubmit2* pMerged = streamMergedSubmitNew(); ASSERT(pMerged); - streamMergeSubmit(pMerged, (SStreamDataSubmit*)dst); - streamMergeSubmit(pMerged, (SStreamDataSubmit*)elem); + streamMergeSubmit(pMerged, (SStreamDataSubmit2*)dst); + streamMergeSubmit(pMerged, (SStreamDataSubmit2*)elem); taosFreeQitem(dst); taosFreeQitem(elem); return (SStreamQueueItem*)pMerged; @@ -162,22 +162,22 @@ void streamFreeQitem(SStreamQueueItem* data) { taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)blockDataFreeRes); taosFreeQitem(data); } else if (type == STREAM_INPUT__DATA_SUBMIT) { - streamDataSubmitRefDec((SStreamDataSubmit*)data); + streamDataSubmitRefDec((SStreamDataSubmit2*)data); taosFreeQitem(data); } else if (type == STREAM_INPUT__MERGED_SUBMIT) { - SStreamMergedSubmit* pMerge = (SStreamMergedSubmit*)data; - int32_t sz = taosArrayGetSize(pMerge->reqs); + SStreamMergedSubmit2* pMerge = (SStreamMergedSubmit2*)data; + int32_t sz = taosArrayGetSize(pMerge->submits); for (int32_t i = 0; i < sz; i++) { int32_t* pRef = taosArrayGetP(pMerge->dataRefs, i); int32_t ref = atomic_sub_fetch_32(pRef, 1); ASSERT(ref >= 0); if (ref == 0) { - void* dataStr = taosArrayGetP(pMerge->reqs, i); - taosMemoryFree(dataStr); + SPackedData* pSubmit = (SPackedData*)taosArrayGet(pMerge->submits, i); + taosMemoryFree(pSubmit->msgStr); taosMemoryFree(pRef); } } - taosArrayDestroy(pMerge->reqs); + taosArrayDestroy(pMerge->submits); taosArrayDestroy(pMerge->dataRefs); taosFreeQitem(pMerge); } else if (type == STREAM_INPUT__REF_DATA_BLOCK) { diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index 6a83a9a4da..3d6495b1a9 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -26,17 +26,18 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, const void* data, SArray* qSetMultiStreamInput(exec, pTrigger->pBlock, 1, STREAM_INPUT__DATA_BLOCK); } else if (pItem->type == STREAM_INPUT__DATA_SUBMIT) { ASSERT(pTask->taskLevel == TASK_LEVEL__SOURCE); - const SStreamDataSubmit* pSubmit = (const SStreamDataSubmit*)data; - qDebug("task %d %p set submit input %p %p %d 1", pTask->taskId, pTask, pSubmit, pSubmit->data, *pSubmit->dataRef); - qSetMultiStreamInput(exec, pSubmit->data, 1, STREAM_INPUT__DATA_SUBMIT); + const SStreamDataSubmit2* pSubmit = (const SStreamDataSubmit2*)data; + qDebug("task %d %p set submit input %p %p %d %" PRId64, pTask->taskId, pTask, pSubmit, pSubmit->submit.msgStr, + pSubmit->submit.msgLen, pSubmit->submit.ver); + qSetMultiStreamInput(exec, &pSubmit->submit, 1, STREAM_INPUT__DATA_SUBMIT); } else if (pItem->type == STREAM_INPUT__DATA_BLOCK || pItem->type == STREAM_INPUT__DATA_RETRIEVE) { const SStreamDataBlock* pBlock = (const SStreamDataBlock*)data; SArray* blocks = pBlock->blocks; qDebug("task %d %p set ssdata input", pTask->taskId, pTask); qSetMultiStreamInput(exec, blocks->pData, blocks->size, STREAM_INPUT__DATA_BLOCK); } else if (pItem->type == STREAM_INPUT__MERGED_SUBMIT) { - const SStreamMergedSubmit* pMerged = (const SStreamMergedSubmit*)data; - SArray* blocks = pMerged->reqs; + const SStreamMergedSubmit2* pMerged = (const SStreamMergedSubmit2*)data; + SArray* blocks = pMerged->submits; qDebug("task %d %p set submit input (merged), batch num: %d", pTask->taskId, pTask, (int32_t)blocks->size); qSetMultiStreamInput(exec, blocks->pData, blocks->size, STREAM_INPUT__MERGED_SUBMIT); } else if (pItem->type == STREAM_INPUT__REF_DATA_BLOCK) { @@ -244,11 +245,11 @@ int32_t streamExecForAll(SStreamTask* pTask) { qRes->blocks = pRes; if (((SStreamQueueItem*)input)->type == STREAM_INPUT__DATA_SUBMIT) { - SStreamDataSubmit* pSubmit = (SStreamDataSubmit*)input; + SStreamDataSubmit2* pSubmit = (SStreamDataSubmit2*)input; qRes->childId = pTask->selfChildId; qRes->sourceVer = pSubmit->ver; } else if (((SStreamQueueItem*)input)->type == STREAM_INPUT__MERGED_SUBMIT) { - SStreamMergedSubmit* pMerged = (SStreamMergedSubmit*)input; + SStreamMergedSubmit2* pMerged = (SStreamMergedSubmit2*)input; qRes->childId = pTask->selfChildId; qRes->sourceVer = pMerged->ver; } diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index cf63df371d..3bd94dbab5 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -46,6 +46,7 @@ typedef struct SyncClientRequest { uint32_t originalRpcType; // origin RpcMsg msgType uint64_t seqNum; bool isWeak; + int16_t reserved; uint32_t dataLen; // origin RpcMsg.contLen char data[]; // origin RpcMsg.pCont } SyncClientRequest; @@ -56,6 +57,7 @@ typedef struct SyncClientRequestReply { uint32_t msgType; int32_t errCode; SRaftId leaderHint; + int16_t reserved; } SyncClientRequestReply; typedef struct SyncRequestVote { @@ -68,6 +70,7 @@ typedef struct SyncRequestVote { SyncTerm term; SyncIndex lastLogIndex; SyncTerm lastLogTerm; + int16_t reserved; } SyncRequestVote; typedef struct SyncRequestVoteReply { @@ -79,6 +82,7 @@ typedef struct SyncRequestVoteReply { // private data SyncTerm term; bool voteGranted; + int16_t reserved; } SyncRequestVoteReply; typedef struct SyncAppendEntries { @@ -94,6 +98,7 @@ typedef struct SyncAppendEntries { SyncTerm prevLogTerm; SyncIndex commitIndex; SyncTerm privateTerm; + int16_t reserved; uint32_t dataLen; char data[]; } SyncAppendEntries; @@ -111,6 +116,7 @@ typedef struct SyncAppendEntriesReply { SyncIndex matchIndex; SyncIndex lastSendIndex; int64_t startTime; + int16_t reserved; } SyncAppendEntriesReply; typedef struct SyncHeartbeat { @@ -126,6 +132,7 @@ typedef struct SyncHeartbeat { SyncTerm privateTerm; SyncTerm minMatchIndex; int64_t timeStamp; + int16_t reserved; } SyncHeartbeat; typedef struct SyncHeartbeatReply { @@ -140,6 +147,7 @@ typedef struct SyncHeartbeatReply { SyncTerm privateTerm; int64_t startTime; int64_t timeStamp; + int16_t reserved; } SyncHeartbeatReply; typedef struct SyncPreSnapshot { @@ -151,6 +159,7 @@ typedef struct SyncPreSnapshot { // private data SyncTerm term; + int16_t reserved; } SyncPreSnapshot; typedef struct SyncPreSnapshotReply { @@ -163,6 +172,7 @@ typedef struct SyncPreSnapshotReply { // private data SyncTerm term; SyncIndex snapStart; + int16_t reserved; } SyncPreSnapshotReply; typedef struct SyncApplyMsg { @@ -190,6 +200,7 @@ typedef struct SyncSnapshotSend { SSyncCfg lastConfig; int64_t startTime; int32_t seq; + int16_t reserved; uint32_t dataLen; char data[]; } SyncSnapshotSend; @@ -208,6 +219,7 @@ typedef struct SyncSnapshotRsp { int32_t ack; int32_t code; SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid + int16_t reserved; } SyncSnapshotRsp; typedef struct SyncLeaderTransfer { diff --git a/source/libs/sync/inc/syncSnapshot.h b/source/libs/sync/inc/syncSnapshot.h index 1f9675a3cd..ee83636192 100644 --- a/source/libs/sync/inc/syncSnapshot.h +++ b/source/libs/sync/inc/syncSnapshot.h @@ -44,6 +44,7 @@ typedef struct SSyncSnapshotSender { SyncTerm term; int64_t startTime; int64_t endTime; + int64_t lastSendTime; bool finish; // init when create diff --git a/source/libs/sync/inc/syncUtil.h b/source/libs/sync/inc/syncUtil.h index f198f3809d..be14ef91a4 100644 --- a/source/libs/sync/inc/syncUtil.h +++ b/source/libs/sync/inc/syncUtil.h @@ -79,7 +79,6 @@ char* syncUtilPrintBin2(char* ptr, uint32_t len); void syncUtilMsgHtoN(void* msg); void syncUtilMsgNtoH(void* msg); bool syncUtilUserPreCommit(tmsg_t msgType); -bool syncUtilUserCommit(tmsg_t msgType); bool syncUtilUserRollback(tmsg_t msgType); void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...); diff --git a/source/libs/sync/src/syncCommit.c b/source/libs/sync/src/syncCommit.c index 07b1101256..5fdcbeb91c 100644 --- a/source/libs/sync/src/syncCommit.c +++ b/source/libs/sync/src/syncCommit.c @@ -84,7 +84,7 @@ void syncOneReplicaAdvance(SSyncNode* pSyncNode) { } void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) { - ASSERT(false && "deprecated"); + ASSERTS(false, "deprecated"); if (pSyncNode == NULL) { sError("pSyncNode is NULL"); return; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 59e5e968e7..6fabab18cb 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -151,7 +151,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { } syncNodeStartHeartbeatTimer(pSyncNode); - syncNodeReplicate(pSyncNode); + //syncNodeReplicate(pSyncNode); } syncNodeRelease(pSyncNode); @@ -791,9 +791,9 @@ static int32_t syncHbTimerStop(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer) { } int32_t syncNodeLogStoreRestoreOnNeed(SSyncNode* pNode) { - ASSERT(pNode->pLogStore != NULL && "log store not created"); - ASSERT(pNode->pFsm != NULL && "pFsm not registered"); - ASSERT(pNode->pFsm->FpGetSnapshotInfo != NULL && "FpGetSnapshotInfo not registered"); + ASSERTS(pNode->pLogStore != NULL, "log store not created"); + ASSERTS(pNode->pFsm != NULL, "pFsm not registered"); + ASSERTS(pNode->pFsm->FpGetSnapshotInfo != NULL, "FpGetSnapshotInfo not registered"); SSnapshot snapshot; if (pNode->pFsm->FpGetSnapshotInfo(pNode->pFsm, &snapshot) < 0) { sError("vgId:%d, failed to get snapshot info since %s", pNode->vgId, terrstr()); @@ -1144,8 +1144,8 @@ void syncNodeMaybeUpdateCommitBySnapshot(SSyncNode* pSyncNode) { } int32_t syncNodeRestore(SSyncNode* pSyncNode) { - ASSERT(pSyncNode->pLogStore != NULL && "log store not created"); - ASSERT(pSyncNode->pLogBuf != NULL && "ring log buffer not created"); + ASSERTS(pSyncNode->pLogStore != NULL, "log store not created"); + ASSERTS(pSyncNode->pLogBuf != NULL, "ring log buffer not created"); SyncIndex lastVer = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); SyncIndex commitIndex = pSyncNode->pLogStore->syncLogCommitIndex(pSyncNode->pLogStore); @@ -1839,7 +1839,8 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { #endif // close receiver - if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + if (pSyncNode != NULL && pSyncNode->pNewNodeReceiver != NULL && + snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver); } @@ -2663,7 +2664,7 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn int32_t code = syncNodeAppend(ths, pEntry); if (code < 0 && ths->vgId != 1 && vnodeIsMsgBlock(pEntry->originalRpcType)) { - ASSERT(false && "failed to append blocking msg"); + ASSERTS(false, "failed to append blocking msg"); } return code; } diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 5d6905f99e..7bd8d75dd1 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -50,7 +50,7 @@ int32_t syncLogBufferAppend(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt // initial log buffer with at least one item, e.g. commitIndex SSyncRaftEntry* pMatch = pBuf->entries[(index - 1 + pBuf->size) % pBuf->size].pItem; - ASSERT(pMatch != NULL && "no matched log entry"); + ASSERTS(pMatch != NULL, "no matched log entry"); ASSERT(pMatch->index + 1 == index); SSyncLogBufEntry tmp = {.pItem = pEntry, .prevLogIndex = pMatch->index, .prevLogTerm = pMatch->term}; @@ -86,14 +86,14 @@ SyncTerm syncLogReplMgrGetPrevLogTerm(SSyncLogReplMgr* pMgr, SSyncNode* pNode, S if (prevIndex >= pBuf->startIndex) { pEntry = pBuf->entries[(prevIndex + pBuf->size) % pBuf->size].pItem; - ASSERT(pEntry != NULL && "no log entry found"); + ASSERTS(pEntry != NULL, "no log entry found"); prevLogTerm = pEntry->term; return prevLogTerm; } if (pMgr && pMgr->startIndex <= prevIndex && prevIndex < pMgr->endIndex) { int64_t timeMs = pMgr->states[(prevIndex + pMgr->size) % pMgr->size].timeMs; - ASSERT(timeMs != 0 && "no log entry found"); + ASSERTS(timeMs != 0, "no log entry found"); prevLogTerm = pMgr->states[(prevIndex + pMgr->size) % pMgr->size].term; ASSERT(prevIndex == 0 || prevLogTerm != 0); return prevLogTerm; @@ -141,9 +141,9 @@ int32_t syncLogValidateAlignmentOfCommit(SSyncNode* pNode, SyncIndex commitIndex } int32_t syncLogBufferInitWithoutLock(SSyncLogBuffer* pBuf, SSyncNode* pNode) { - ASSERT(pNode->pLogStore != NULL && "log store not created"); - ASSERT(pNode->pFsm != NULL && "pFsm not registered"); - ASSERT(pNode->pFsm->FpGetSnapshotInfo != NULL && "FpGetSnapshotInfo not registered"); + ASSERTS(pNode->pLogStore != NULL, "log store not created"); + ASSERTS(pNode->pFsm != NULL, "pFsm not registered"); + ASSERTS(pNode->pFsm->FpGetSnapshotInfo != NULL, "FpGetSnapshotInfo not registered"); SSnapshot snapshot; if (pNode->pFsm->FpGetSnapshotInfo(pNode->pFsm, &snapshot) < 0) { @@ -437,7 +437,7 @@ _out: } int32_t syncLogFsmExecute(SSyncNode* pNode, SSyncFSM* pFsm, ESyncState role, SyncTerm term, SSyncRaftEntry* pEntry) { - ASSERT(pFsm->FpCommitCb != NULL && "No commit cb registered for the FSM"); + ASSERTS(pFsm->FpCommitCb != NULL, "No commit cb registered for the FSM"); if ((pNode->replicaNum == 1) && pNode->restoreFinish && pNode->vgId != 1) { return 0; @@ -513,13 +513,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm if (!syncUtilUserCommit(pEntry->originalRpcType)) { sInfo("vgId:%d, commit sync barrier. index: %" PRId64 ", term:%" PRId64 ", type: %s", vgId, pEntry->index, pEntry->term, TMSG_INFO(pEntry->originalRpcType)); - pBuf->commitIndex = index; - if (!inBuf) { - syncEntryDestroy(pEntry); - pEntry = NULL; - } - continue; } + if (syncLogFsmExecute(pNode, pFsm, role, term, pEntry) != 0) { sError("vgId:%d, failed to execute sync log entry. index:%" PRId64 ", term:%" PRId64 ", role: %d, current term: %" PRId64, @@ -905,7 +900,7 @@ int32_t syncNodeLogReplMgrInit(SSyncNode* pNode) { ASSERT(pNode->logReplMgrs[i] == NULL); pNode->logReplMgrs[i] = syncLogReplMgrCreate(); pNode->logReplMgrs[i]->peerId = i; - ASSERT(pNode->logReplMgrs[i] != NULL && "Out of memory."); + ASSERTS(pNode->logReplMgrs[i] != NULL, "Out of memory."); } return 0; } diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index b8ecbe7515..540f40a4c0 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -103,6 +103,7 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { pSender->sendingMS = 0; pSender->term = pSender->pSyncNode->pRaftStore->currentTerm; pSender->startTime = taosGetTimestampMs(); + pSender->lastSendTime = pSender->startTime; pSender->finish = false; // build begin msg @@ -201,6 +202,8 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) { syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); + pSender->lastSendTime = taosGetTimestampMs(); + // event log if (pSender->seq == SYNC_SNAPSHOT_SEQ_END) { sSTrace(pSender, "snapshot sender finish"); @@ -213,33 +216,36 @@ int32_t snapshotSend(SSyncSnapshotSender *pSender) { // send snapshot data from cache int32_t snapshotReSend(SSyncSnapshotSender *pSender) { // send current block data + + // build msg + SRpcMsg rpcMsg = {0}; + (void)syncBuildSnapshotSend(&rpcMsg, pSender->blockLen, pSender->pSyncNode->vgId); + + SyncSnapshotSend *pMsg = rpcMsg.pCont; + pMsg->srcId = pSender->pSyncNode->myRaftId; + pMsg->destId = (pSender->pSyncNode->replicasId)[pSender->replicaIndex]; + pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pMsg->beginIndex = pSender->snapshotParam.start; + pMsg->lastIndex = pSender->snapshot.lastApplyIndex; + pMsg->lastTerm = pSender->snapshot.lastApplyTerm; + pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; + pMsg->lastConfig = pSender->lastConfig; + pMsg->seq = pSender->seq; + if (pSender->pCurrentBlock != NULL && pSender->blockLen > 0) { - // build msg - SRpcMsg rpcMsg = {0}; - (void)syncBuildSnapshotSend(&rpcMsg, pSender->blockLen, pSender->pSyncNode->vgId); - - SyncSnapshotSend *pMsg = rpcMsg.pCont; - pMsg->srcId = pSender->pSyncNode->myRaftId; - pMsg->destId = (pSender->pSyncNode->replicasId)[pSender->replicaIndex]; - pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; - pMsg->beginIndex = pSender->snapshotParam.start; - pMsg->lastIndex = pSender->snapshot.lastApplyIndex; - pMsg->lastTerm = pSender->snapshot.lastApplyTerm; - pMsg->lastConfigIndex = pSender->snapshot.lastConfigIndex; - pMsg->lastConfig = pSender->lastConfig; - pMsg->seq = pSender->seq; - // pMsg->privateTerm = pSender->privateTerm; memcpy(pMsg->data, pSender->pCurrentBlock, pSender->blockLen); - - // send msg - syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); - syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); - - // event log - sSTrace(pSender, "snapshot sender resend"); } + // send msg + syncNodeSendMsgById(&pMsg->destId, pSender->pSyncNode, &rpcMsg); + syncLogSendSyncSnapshotSend(pSender->pSyncNode, pMsg, ""); + + pSender->lastSendTime = taosGetTimestampMs(); + + // event log + sSTrace(pSender, "snapshot sender resend"); + return 0; } @@ -339,6 +345,8 @@ bool snapshotReceiverIsStart(SSyncSnapshotReceiver *pReceiver) { return pReceive void snapshotReceiverForceStop(SSyncSnapshotReceiver *pReceiver) { // force close, abandon incomplete data if (pReceiver->pWriter != NULL) { + // event log + sRTrace(pReceiver, "snapshot receiver force stop"); int32_t ret = pReceiver->pSyncNode->pFsm->FpSnapshotStopWrite(pReceiver->pSyncNode->pFsm, pReceiver->pWriter, false, &(pReceiver->snapshot)); ASSERT(ret == 0); @@ -348,7 +356,7 @@ void snapshotReceiverForceStop(SSyncSnapshotReceiver *pReceiver) { pReceiver->start = false; // event log - sRTrace(pReceiver, "snapshot receiver force stop"); + // sRTrace(pReceiver, "snapshot receiver force stop"); } int32_t snapshotReceiverStartWriter(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *pBeginMsg) { @@ -669,6 +677,7 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs sNTrace(pSyncNode, "snapshot receiver finish waitting for true time, now:%" PRId64 ", stime:%" PRId64, timeNow, pMsg->startTime); taosMsleep(10); + timeNow = taosGetTimestampMs(); } int32_t code = snapshotReceiverFinish(pReceiver, pMsg); diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index cf933d98b2..16e593d0e4 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -19,6 +19,8 @@ #include "syncRaftCfg.h" #include "syncRaftLog.h" #include "syncReplication.h" +#include "syncRespMgr.h" +#include "syncSnapshot.h" #include "syncUtil.h" static void syncNodeCleanConfigIndex(SSyncNode* ths) { @@ -69,6 +71,20 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { } int64_t timeNow = taosGetTimestampMs(); + + for (int i = 0; i < ths->peersNum; ++i) { + SSyncSnapshotSender* pSender = syncNodeGetSnapshotSender(ths, &(ths->peersId[i])); + if (pSender != NULL) { + if (ths->isStart && ths->state == TAOS_SYNC_STATE_LEADER && pSender->start && + timeNow - pSender->lastSendTime > SYNC_SNAP_RESEND_MS) { + snapshotReSend(pSender); + } else { + sTrace("vgId:%d, do not resend: nstart%d, now:%" PRId64 ", lstsend:%" PRId64 ", diff:%" PRId64, ths->vgId, + ths->isStart, timeNow, pSender->lastSendTime, timeNow - pSender->lastSendTime); + } + } + } + if (atomic_load_64(&ths->snapshottingIndex) != SYNC_INDEX_INVALID) { // end timeout wal snapshot if (timeNow - ths->snapshottingTime > SYNC_DEL_WAL_MS && @@ -85,11 +101,9 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { } } -#if 0 if (!syncNodeIsMnode(ths)) { syncRespClean(ths->pSyncRespMgr); } -#endif return 0; } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 7787438dfe..a034e6ad83 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -160,8 +160,6 @@ void syncUtilMsgNtoH(void* msg) { bool syncUtilUserPreCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } -bool syncUtilUserCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } - bool syncUtilUserRollback(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } void syncCfg2SimpleStr(const SSyncCfg* pCfg, char* buf, int32_t bufLen) { @@ -568,7 +566,7 @@ void syncLogSendSyncSnapshotSend(SSyncNode* pSyncNode, const SyncSnapshotSend* p syncUtilU642Addr(pMsg->destId.addr, host, sizeof(host), &port); sNTrace(pSyncNode, - "send sync-snapshot-send from %s:%d {term:%" PRId64 ", begin:%" PRId64 ", end:%" PRId64 ", lterm:%" PRId64 + "send sync-snapshot-send to %s:%d {term:%" PRId64 ", begin:%" PRId64 ", end:%" PRId64 ", lterm:%" PRId64 ", stime:%" PRId64 ", seq:%d}, %s", host, port, pMsg->term, pMsg->beginIndex, pMsg->lastIndex, pMsg->lastTerm, pMsg->startTime, pMsg->seq, s); } @@ -595,7 +593,7 @@ void syncLogSendSyncSnapshotRsp(SSyncNode* pSyncNode, const SyncSnapshotRsp* pMs syncUtilU642Addr(pMsg->destId.addr, host, sizeof(host), &port); sNTrace(pSyncNode, - "send sync-snapshot-rsp from %s:%d {term:%" PRId64 ", begin:%" PRId64 ", lst:%" PRId64 ", lterm:%" PRId64 + "send sync-snapshot-rsp to %s:%d {term:%" PRId64 ", begin:%" PRId64 ", lst:%" PRId64 ", lterm:%" PRId64 ", stime:%" PRId64 ", ack:%d}, %s", host, port, pMsg->term, pMsg->snapBeginIndex, pMsg->lastIndex, pMsg->lastTerm, pMsg->startTime, pMsg->ack, s); } diff --git a/source/libs/sync/test/syncAppendEntriesReplyTest.cpp b/source/libs/sync/test/syncAppendEntriesReplyTest.cpp index 1eb803e846..e1a8a5c832 100644 --- a/source/libs/sync/test/syncAppendEntriesReplyTest.cpp +++ b/source/libs/sync/test/syncAppendEntriesReplyTest.cpp @@ -19,7 +19,7 @@ SyncAppendEntriesReply *createMsg() { pMsg->success = true; pMsg->matchIndex = 77; pMsg->term = 33; - pMsg->privateTerm = 44; + // pMsg->privateTerm = 44; pMsg->startTime = taosGetTimestampMs(); return pMsg; } diff --git a/source/libs/sync/test/syncTest.cpp b/source/libs/sync/test/syncTest.cpp index 9ae79e11fb..7b636085f2 100644 --- a/source/libs/sync/test/syncTest.cpp +++ b/source/libs/sync/test/syncTest.cpp @@ -1,5 +1,5 @@ #include "syncTest.h" -#include +// #include /* typedef enum { diff --git a/source/libs/sync/test/sync_test_lib/inc/syncIO.h b/source/libs/sync/test/sync_test_lib/inc/syncIO.h index 19f896182e..98b013b46d 100644 --- a/source/libs/sync/test/sync_test_lib/inc/syncIO.h +++ b/source/libs/sync/test/sync_test_lib/inc/syncIO.h @@ -81,6 +81,8 @@ int32_t syncIOQTimerStop(); int32_t syncIOPingTimerStart(); int32_t syncIOPingTimerStop(); +void syncEntryDestory(SSyncRaftEntry* pEntry); + #ifdef __cplusplus } #endif diff --git a/source/libs/sync/test/sync_test_lib/src/syncIO.c b/source/libs/sync/test/sync_test_lib/src/syncIO.c index 2c24451713..415fecd9f2 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncIO.c +++ b/source/libs/sync/test/sync_test_lib/src/syncIO.c @@ -469,3 +469,5 @@ static void syncIOTickPing(void *param, void *tmrId) { taosTmrReset(syncIOTickPing, io->pingTimerMS, io, io->timerMgr, &io->pingTimer); } + +void syncEntryDestory(SSyncRaftEntry* pEntry) {} \ No newline at end of file diff --git a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c index 1ea7629601..3b6007df6b 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c @@ -1583,8 +1583,8 @@ cJSON* syncAppendEntriesReply2Json(const SyncAppendEntriesReply* pMsg) { cJSON_AddNumberToObject(pDestId, "vgId", pMsg->destId.vgId); cJSON_AddItemToObject(pRoot, "destId", pDestId); - snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm); - cJSON_AddStringToObject(pRoot, "privateTerm", u64buf); + // snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->privateTerm); + // cJSON_AddStringToObject(pRoot, "privateTerm", u64buf); snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->term); cJSON_AddStringToObject(pRoot, "term", u64buf); diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index c728e29641..10a99bb1fa 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -81,6 +81,8 @@ void tdbFree(void *); typedef struct hashset_st *hashset_t; +void hashset_destroy(hashset_t set); + struct STxn { int flags; int64_t txnId; diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 8c62f89b64..5c1f264460 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -110,6 +110,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbBegin(pEnv, &txn, tdbDefaultMalloc, tdbDefaultFree, NULL, TDB_TXN_WRITE | TDB_TXN_READ_UNCOMMITTED); if (ret < 0) { + tdbOsFree(pBt); return -1; } @@ -119,6 +120,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbPagerFetchPage(pPager, &pgno, &pPage, tdbBtreeInitPage, &zArg, txn); if (ret < 0) { tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } @@ -126,6 +128,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg if (ret < 0) { tdbError("failed to write page since %s", terrstr()); tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } @@ -138,6 +141,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, char const *tbname, SPg ret = tdbTbInsert(pPager->pEnv->pMainDb, tbname, strlen(tbname) + 1, &pBt->info, sizeof(pBt->info), txn); if (ret < 0) { tdbAbort(pEnv, txn); + tdbOsFree(pBt); return -1; } } diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index f638ec25a3..e3d886b046 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -379,9 +379,6 @@ int tdbPagerPostCommit(SPager *pPager, TXN *pTxn) { return -1; } - if (pTxn->jPageSet) { - hashset_destroy(pTxn->jPageSet); - } // pPager->inTran = 0; return 0; @@ -549,8 +546,6 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) { return -1; } - hashset_destroy(pTxn->jPageSet); - // pPager->inTran = 0; return 0; @@ -922,6 +917,8 @@ int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) { char *name = tdbDirEntryBaseName(tdbGetDirEntryName(pDirEntry)); if (strncmp(TDB_MAINDB_NAME "-journal", name, 16) == 0) { if (tdbPagerRestore(pPager, pBt, name) < 0) { + tdbCloseDir(&pDir); + tdbError("failed to restore file due to %s. jFileName:%s", strerror(errno), name); return -1; } @@ -946,6 +943,8 @@ int tdbPagerRollback(SPager *pPager) { if (strncmp(TDB_MAINDB_NAME "-journal", name, 16) == 0) { if (tdbOsRemove(name) < 0 && errno != ENOENT) { + tdbCloseDir(&pDir); + tdbError("failed to remove file due to %s. jFileName:%s", strerror(errno), name); terrno = TAOS_SYSTEM_ERROR(errno); return -1; diff --git a/source/libs/tdb/src/db/tdbTxn.c b/source/libs/tdb/src/db/tdbTxn.c index 77c87d18f2..055d9c7f98 100644 --- a/source/libs/tdb/src/db/tdbTxn.c +++ b/source/libs/tdb/src/db/tdbTxn.c @@ -30,6 +30,11 @@ int tdbTxnOpen(TXN *pTxn, int64_t txnid, void *(*xMalloc)(void *, size_t), void int tdbTxnClose(TXN *pTxn) { if (pTxn) { + if (pTxn->jPageSet) { + hashset_destroy(pTxn->jPageSet); + pTxn->jPageSet = NULL; + } + tdbOsFree(pTxn); } diff --git a/source/libs/tdb/test/tdbExOVFLTest.cpp b/source/libs/tdb/test/tdbExOVFLTest.cpp index f4f09b20b8..b16bc643d3 100644 --- a/source/libs/tdb/test/tdbExOVFLTest.cpp +++ b/source/libs/tdb/test/tdbExOVFLTest.cpp @@ -8,6 +8,7 @@ #include #include #include +#include "tlog.h" typedef struct SPoolMem { int64_t size; diff --git a/source/libs/tdb/test/tdbTest.cpp b/source/libs/tdb/test/tdbTest.cpp index 54e80a0009..cd02eb8d5e 100644 --- a/source/libs/tdb/test/tdbTest.cpp +++ b/source/libs/tdb/test/tdbTest.cpp @@ -8,6 +8,7 @@ #include #include #include +#include "tlog.h" typedef struct SPoolMem { int64_t size; diff --git a/source/libs/transport/inc/transportInt.h b/source/libs/transport/inc/transportInt.h index 833937aa41..57aba67b1d 100644 --- a/source/libs/transport/inc/transportInt.h +++ b/source/libs/transport/inc/transportInt.h @@ -57,10 +57,14 @@ typedef struct { int32_t retryMaxInterval; // retry max interval int32_t retryMaxTimouet; + int32_t failFastThreshold; + int32_t failFastInterval; + void (*cfp)(void* parent, SRpcMsg*, SEpSet*); bool (*retry)(int32_t code, tmsg_t msgType); bool (*startTimer)(int32_t code, tmsg_t msgType); void (*destroyFp)(void* ahandle); + bool (*failFastFp)(tmsg_t msgType); int index; void* parent; diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index c6a5cfdc95..0eac12f7c5 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -56,11 +56,15 @@ void* rpcOpen(const SRpcInit* pInit) { pRpc->retryMaxInterval = pInit->retryMaxInterval; pRpc->retryMaxTimouet = pInit->retryMaxTimouet; + pRpc->failFastThreshold = pInit->failFastThreshold; + pRpc->failFastInterval = pInit->failFastInterval; + // register callback handle pRpc->cfp = pInit->cfp; pRpc->retry = pInit->rfp; pRpc->startTimer = pInit->tfp; pRpc->destroyFp = pInit->dfp; + pRpc->failFastFp = pInit->ffp; pRpc->numOfThreads = pInit->numOfThreads > TSDB_MAX_RPC_THREADS ? TSDB_MAX_RPC_THREADS : pInit->numOfThreads; if (pRpc->numOfThreads <= 0) { diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 7339d487d1..060d1d3a98 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -84,6 +84,8 @@ typedef struct SCliThrd { SHashObj* fqdn2ipCache; SCvtAddr cvtAddr; + SHashObj* failFastCache; + SCliMsg* stopMsg; bool quit; @@ -96,6 +98,13 @@ typedef struct SCliObj { SCliThrd** pThreadObj; } SCliObj; +typedef struct { + int32_t reinit; + int64_t timestamp; + int32_t count; + int32_t threshold; + int64_t interval; +} SFailFastItem; // conn pool // add expire timeout and capacity limit static void* createConnPool(int size); @@ -853,7 +862,7 @@ void cliSend(SCliConn* pConn) { int status = uv_write(req, (uv_stream_t*)pConn->stream, &wb, 1, cliSendCb); if (status != 0) { - tGError("%s conn %p failed to sent msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), + tGError("%s conn %p failed to send msg:%s, errmsg:%s", CONN_GET_INST_LABEL(pConn), pConn, TMSG_INFO(pMsg->msgType), uv_err_name(status)); cliHandleExcept(pConn); } @@ -863,7 +872,6 @@ _RETURN: } void cliConnCb(uv_connect_t* req, int status) { - // impl later SCliConn* pConn = req->data; SCliThrd* pThrd = pConn->hostThrd; @@ -875,7 +883,33 @@ void cliConnCb(uv_connect_t* req, int status) { } if (status != 0) { - tError("%s conn %p failed to connect server:%s", CONN_GET_INST_LABEL(pConn), pConn, uv_strerror(status)); + SCliMsg* pMsg = transQueueGet(&pConn->cliMsgs, 0); + STrans* pTransInst = pThrd->pTransInst; + + tError("%s msg %s failed to send, conn %p failed to connect to %s:%d, reason: %s", CONN_GET_INST_LABEL(pConn), + pMsg ? TMSG_INFO(pMsg->msg.msgType) : 0, pConn, pConn->ip, pConn->port, uv_strerror(status)); + if (pMsg != NULL && REQUEST_NO_RESP(&pMsg->msg) && + (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { + char* ip = pConn->ip; + uint32_t port = pConn->port; + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + int64_t cTimestamp = taosGetTimestampMs(); + if (item != NULL) { + int32_t elapse = cTimestamp - item->timestamp; + if (elapse >= 0 && elapse <= pTransInst->failFastInterval) { + item->count++; + } else { + item->count = 1; + item->timestamp = cTimestamp; + } + } else { + SFailFastItem item = {.count = 1, .timestamp = cTimestamp}; + taosHashPut(pThrd->failFastCache, key, strlen(key), &item, sizeof(SFailFastItem)); + } + } cliHandleExcept(pConn); return; } @@ -1018,15 +1052,31 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) { cliMayCvtFqdnToIp(&pCtx->epSet, &pThrd->cvtAddr); - char tbuf[256] = {0}; - EPSET_DEBUG_STR(&pCtx->epSet, tbuf); - if (!EPSET_IS_VALID(&pCtx->epSet)) { tError("invalid epset"); destroyCmsg(pMsg); return; } + if (REQUEST_NO_RESP(&pMsg->msg) && (pTransInst->failFastFp != NULL && pTransInst->failFastFp(pMsg->msg.msgType))) { + char* ip = EPSET_GET_INUSE_IP(&pCtx->epSet); + uint32_t port = EPSET_GET_INUSE_PORT(&pCtx->epSet); + char key[TSDB_FQDN_LEN + 64] = {0}; + CONN_CONSTRUCT_HASH_KEY(key, ip, port); + + SFailFastItem* item = taosHashGet(pThrd->failFastCache, key, strlen(key)); + if (item != NULL) { + int32_t elapse = (int32_t)(taosGetTimestampMs() - item->timestamp); + if (item->count >= pTransInst->failFastThreshold && (elapse >= 0 && elapse <= pTransInst->failFastInterval)) { + STraceId* trace = &(pMsg->msg.info.traceId); + tGTrace("%s, msg %s cancel to send, reason: failed to connect %s:%d: count: %d, at %d", pTransInst->label, + TMSG_INFO(pMsg->msg.msgType), ip, port, item->count, elapse); + destroyCmsg(pMsg); + return; + } + } + } + bool ignore = false; SCliConn* conn = cliGetConn(pMsg, pThrd, &ignore); if (ignore == true) { @@ -1299,6 +1349,8 @@ static SCliThrd* createThrdObj(void* trans) { pThrd->destroyAhandleFp = pTransInst->destroyFp; pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK); + pThrd->quit = false; return pThrd; } @@ -1325,6 +1377,7 @@ static void destroyThrdObj(SCliThrd* pThrd) { taosMemoryFree(pThrd->prepare); taosMemoryFree(pThrd->loop); taosHashCleanup(pThrd->fqdn2ipCache); + taosHashCleanup(pThrd->failFastCache); taosMemoryFree(pThrd); } @@ -1437,18 +1490,35 @@ FORCE_INLINE bool cliTryExtractEpSet(STransMsg* pResp, SEpSet* dst) { bool cliResetEpset(STransConnCtx* pCtx, STransMsg* pResp, bool hasEpSet) { bool noDelay = true; if (hasEpSet == false) { - // assert(pResp->contLen == 0); if (pResp->contLen == 0) { if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { noDelay = false; } else { EPSET_FORWARD_INUSE(&pCtx->epSet); } - } else { - if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { - noDelay = false; + } else if (pResp->contLen != 0) { + SEpSet epSet; + int32_t valid = tDeserializeSEpSet(pResp->pCont, pResp->contLen, &epSet); + if (valid < 0) { + tDebug("get invalid epset, epset equal, continue"); + if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { + noDelay = false; + } else { + EPSET_FORWARD_INUSE(&pCtx->epSet); + } } else { - EPSET_FORWARD_INUSE(&pCtx->epSet); + if (!transEpSetIsEqual(&pCtx->epSet, &epSet)) { + tDebug("epset not equal, retry new epset"); + pCtx->epSet = epSet; + noDelay = false; + } else { + if (pCtx->epsetRetryCnt >= pCtx->epSet.numOfEps) { + noDelay = false; + } else { + tDebug("epset equal, continue"); + EPSET_FORWARD_INUSE(&pCtx->epSet); + } + } } } } else { @@ -1528,7 +1598,7 @@ bool cliGenRetryRule(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) { addConnToPool(pThrd->pool, pConn); } else if (code == TSDB_CODE_SYN_RESTORING) { tTrace("code str %s, contlen:%d 0", tstrerror(code), pResp->contLen); - noDelay = cliResetEpset(pCtx, pResp, false); + noDelay = cliResetEpset(pCtx, pResp, true); addConnToPool(pThrd->pool, pConn); transFreeMsg(pResp->pCont); } else { diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 73c6dc4011..2b1f68d5f6 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -1195,6 +1195,8 @@ void transCloseServer(void* arg) { sendQuitToWorkThrd(srv->pThreadObj[i]); destroyWorkThrd(srv->pThreadObj[i]); } + } else { + uv_loop_close(srv->loop); } taosMemoryFree(srv->pThreadObj); diff --git a/source/libs/wal/src/walRead.c b/source/libs/wal/src/walRead.c index ed02d29e3b..4c3fb3c0ba 100644 --- a/source/libs/wal/src/walRead.c +++ b/source/libs/wal/src/walRead.c @@ -271,57 +271,58 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) { return 0; } -static int32_t walFetchBodyNew(SWalReader *pRead) { - SWalCont *pReadHead = &pRead->pHead->head; +static int32_t walFetchBodyNew(SWalReader *pReader) { + SWalCont *pReadHead = &pReader->pHead->head; int64_t ver = pReadHead->version; - wDebug("vgId:%d, wal starts to fetch body, index:%" PRId64, pRead->pWal->cfg.vgId, ver); + wDebug("vgId:%d, wal starts to fetch body, ver:%" PRId64 " ,len:%d", pReader->pWal->cfg.vgId, ver, + pReadHead->bodyLen); - if (pRead->capacity < pReadHead->bodyLen) { - SWalCkHead *ptr = (SWalCkHead *)taosMemoryRealloc(pRead->pHead, sizeof(SWalCkHead) + pReadHead->bodyLen); + if (pReader->capacity < pReadHead->bodyLen) { + SWalCkHead *ptr = (SWalCkHead *)taosMemoryRealloc(pReader->pHead, sizeof(SWalCkHead) + pReadHead->bodyLen); if (ptr == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } - pRead->pHead = ptr; - pReadHead = &pRead->pHead->head; - pRead->capacity = pReadHead->bodyLen; + pReader->pHead = ptr; + pReadHead = &pReader->pHead->head; + pReader->capacity = pReadHead->bodyLen; } - if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) { + if (pReadHead->bodyLen != taosReadFile(pReader->pLogFile, pReadHead->body, pReadHead->bodyLen)) { if (pReadHead->bodyLen < 0) { terrno = TAOS_SYSTEM_ERROR(errno); wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s", - pRead->pWal->cfg.vgId, pRead->pHead->head.version, ver, tstrerror(terrno)); + pReader->pWal->cfg.vgId, pReader->pHead->head.version, ver, tstrerror(terrno)); } else { wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since file corrupted", - pRead->pWal->cfg.vgId, pRead->pHead->head.version, ver); + pReader->pWal->cfg.vgId, pReader->pHead->head.version, ver); terrno = TSDB_CODE_WAL_FILE_CORRUPTED; } - pRead->curInvalid = 1; + pReader->curInvalid = 1; ASSERT(0); return -1; } if (pReadHead->version != ver) { - wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId, - pRead->pHead->head.version, ver); - pRead->curInvalid = 1; + wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64, pReader->pWal->cfg.vgId, + pReader->pHead->head.version, ver); + pReader->curInvalid = 1; terrno = TSDB_CODE_WAL_FILE_CORRUPTED; ASSERT(0); return -1; } - if (walValidBodyCksum(pRead->pHead) != 0) { - wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver); - pRead->curInvalid = 1; + if (walValidBodyCksum(pReader->pHead) != 0) { + wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pReader->pWal->cfg.vgId, ver); + pReader->curInvalid = 1; terrno = TSDB_CODE_WAL_FILE_CORRUPTED; ASSERT(0); return -1; } - wDebug("vgId:%d, index:%" PRId64 " is fetched, cursor advance", pRead->pWal->cfg.vgId, ver); - pRead->curVersion = ver + 1; + wDebug("vgId:%d, index:%" PRId64 " is fetched, cursor advance", pReader->pWal->cfg.vgId, ver); + pReader->curVersion = ver + 1; return 0; } diff --git a/source/os/src/osDir.c b/source/os/src/osDir.c index 421901184b..9175067568 100644 --- a/source/os/src/osDir.c +++ b/source/os/src/osDir.c @@ -163,7 +163,7 @@ int32_t taosMulMkDir(const char *dirname) { code = mkdir(temp, 0755); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } *pos = TD_DIRSEP[0]; @@ -179,7 +179,7 @@ int32_t taosMulMkDir(const char *dirname) { code = mkdir(temp, 0755); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } } @@ -225,7 +225,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) { code = mkdir(temp, mode); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } *pos = TD_DIRSEP[0]; @@ -241,7 +241,7 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) { code = mkdir(temp, mode); #endif if (code < 0 && errno != EEXIST) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return code; } } @@ -497,3 +497,11 @@ int32_t taosCloseDir(TdDirPtr *ppDir) { return 0; #endif } + +void taosGetCwd(char *buf, int32_t len) { +#if !defined(WINDOWS) + (void)getcwd(buf, len - 1); +#else + strncpy(buf, "not implemented on windows", len -1); +#endif +} diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index 68365be481..8c2170239f 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -313,7 +313,7 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) { assert(!(tdFileOptions & TD_FILE_EXCL)); fp = fopen(path, mode); if (fp == NULL) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return NULL; } } else { @@ -336,14 +336,14 @@ TdFilePtr taosOpenFile(const char *path, int32_t tdFileOptions) { fd = open(path, access, S_IRWXU | S_IRWXG | S_IRWXO); #endif if (fd == -1) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return NULL; } } TdFilePtr pFile = (TdFilePtr)taosMemoryMalloc(sizeof(TdFile)); if (pFile == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; + // terrno = TSDB_CODE_OUT_OF_MEMORY; if (fd >= 0) close(fd); if (fp != NULL) fclose(fp); return NULL; diff --git a/source/os/src/osMemory.c b/source/os/src/osMemory.c index 230ca5b968..2e68bd5ccd 100644 --- a/source/os/src/osMemory.c +++ b/source/os/src/osMemory.c @@ -348,7 +348,7 @@ void taosMemoryTrim(int32_t size) { void* taosMemoryMallocAlign(uint32_t alignment, int64_t size) { #ifdef USE_TD_MEMORY - ASSERT(0); + assert(0); #else #if defined(LINUX) void* p = memalign(alignment, size); diff --git a/source/os/src/osString.c b/source/os/src/osString.c index e2d8ce95db..f03778de2f 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -143,15 +143,17 @@ SConv *gConv = NULL; int32_t convUsed = 0; int32_t gConvMaxNum = 0; -void taosConvInit(void) { +int32_t taosConvInit(void) { gConvMaxNum = 512; gConv = taosMemoryCalloc(gConvMaxNum, sizeof(SConv)); for (int32_t i = 0; i < gConvMaxNum; ++i) { gConv[i].conv = iconv_open(DEFAULT_UNICODE_ENCODEC, tsCharset); if ((iconv_t)-1 == gConv[i].conv || (iconv_t)0 == gConv[i].conv) { - ASSERT(0); + return -1; } } + + return 0; } void taosConvDestroy() { diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 7ec1da0530..89b84ad395 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -97,6 +97,7 @@ LONG WINAPI exceptionHandler(LPEXCEPTION_POINTERS exception); #include #include +#include #else @@ -275,34 +276,34 @@ int32_t taosGetEmail(char *email, int32_t maxLen) { #endif } + + int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen) { #ifdef WINDOWS snprintf(releaseName, maxLen, "Windows"); return 0; #elif defined(_TD_DARWIN_64) - char line[1024]; - size_t size = 0; - int32_t code = -1; + char osversion[32]; + size_t osversion_len = sizeof(osversion) - 1; + int osversion_name[] = { CTL_KERN, KERN_OSRELEASE }; - TdFilePtr pFile = taosOpenFile("/etc/os-release", TD_FILE_READ | TD_FILE_STREAM); - if (pFile == NULL) return false; - - while ((size = taosGetsFile(pFile, sizeof(line), line)) != -1) { - line[size - 1] = '\0'; - if (strncmp(line, "PRETTY_NAME", 11) == 0) { - const char *p = strchr(line, '=') + 1; - if (*p == '"') { - p++; - line[size - 2] = 0; - } - tstrncpy(releaseName, p, maxLen); - code = 0; - break; - } + if (sysctl(osversion_name, 2, osversion, &osversion_len, NULL, 0) == -1) { + return -1; } - taosCloseFile(&pFile); - return code; + uint32_t major, minor; + if (sscanf(osversion, "%u.%u", &major, &minor) != 2) { + return -1; + } + if (major >= 20) { + major -= 9; // macOS 11 and newer + sprintf(releaseName, "macOS %u.%u", major, minor); + } else { + major -= 4; // macOS 10.1.1 and newer + sprintf(releaseName, "macOS 10.%d.%d", major, minor); + } + + return 0; #else char line[1024]; size_t size = 0; @@ -617,14 +618,14 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) { return 0; } else { // printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } #elif defined(_TD_DARWIN_64) struct statvfs info; if (statvfs(dataDir, &info)) { // printf("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } else { diskSize->total = info.f_blocks * info.f_frsize; @@ -635,7 +636,7 @@ int32_t taosGetDiskSize(char *dataDir, SDiskSize *diskSize) { #else struct statvfs info; if (statvfs(dataDir, &info)) { - terrno = TAOS_SYSTEM_ERROR(errno); + // terrno = TAOS_SYSTEM_ERROR(errno); return -1; } else { diskSize->total = info.f_blocks * info.f_frsize; diff --git a/source/os/src/osTime.c b/source/os/src/osTime.c index 68dfba14e9..cd4324a592 100644 --- a/source/os/src/osTime.c +++ b/source/os/src/osTime.c @@ -572,7 +572,7 @@ int32_t taosClockGetTime(int clock_id, struct timespec *pTS) { offsetInitFinished = true; } else { while (!offsetInitFinished) - ; // Ensure initialization is completed. + ; // Ensure initialization is completed. } GetSystemTimeAsFileTime(&f); diff --git a/source/util/src/talgo.c b/source/util/src/talgo.c index 4d6875d263..057d3a620c 100644 --- a/source/util/src/talgo.c +++ b/source/util/src/talgo.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "talgo.h" +#include "tlog.h" #define doswap(__left, __right, __size, __buf) \ do { \ diff --git a/source/util/src/tjson.c b/source/util/src/tjson.c index cc823decf4..48638af8d5 100644 --- a/source/util/src/tjson.c +++ b/source/util/src/tjson.c @@ -181,7 +181,7 @@ int32_t tjsonGetObjectValueString(const SJson* pJson, char** pValueString) { int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } strcpy(pVal, p); return TSDB_CODE_SUCCESS; @@ -190,7 +190,7 @@ int32_t tjsonGetStringValue(const SJson* pJson, const char* pName, char* pVal) { int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } *pVal = strdup(p); return TSDB_CODE_SUCCESS; @@ -199,7 +199,7 @@ int32_t tjsonDupStringValue(const SJson* pJson, const char* pName, char** pVal) int32_t tjsonGetBigIntValue(const SJson* pJson, const char* pName, int64_t* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } #ifdef WINDOWS sscanf(p, "%" PRId64, pVal); @@ -233,7 +233,7 @@ int32_t tjsonGetTinyIntValue(const SJson* pJson, const char* pName, int8_t* pVal int32_t tjsonGetUBigIntValue(const SJson* pJson, const char* pName, uint64_t* pVal) { char* p = cJSON_GetStringValue(tjsonGetObjectItem((cJSON*)pJson, pName)); if (NULL == p) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } #ifdef WINDOWS sscanf(p, "%" PRIu64, pVal); @@ -259,6 +259,9 @@ int32_t tjsonGetUTinyIntValue(const SJson* pJson, const char* pName, uint8_t* pV int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal) { const SJson* pObject = tjsonGetObjectItem(pJson, pName); + if (NULL == pObject) { + return TSDB_CODE_SUCCESS; + } if (!cJSON_IsBool(pObject)) { return TSDB_CODE_FAILED; } @@ -268,6 +271,9 @@ int32_t tjsonGetBoolValue(const SJson* pJson, const char* pName, bool* pVal) { int32_t tjsonGetDoubleValue(const SJson* pJson, const char* pName, double* pVal) { const SJson* pObject = tjsonGetObjectItem(pJson, pName); + if (NULL == pObject) { + return TSDB_CODE_SUCCESS; + } if (!cJSON_IsNumber(pObject)) { return TSDB_CODE_FAILED; } @@ -282,7 +288,7 @@ SJson* tjsonGetArrayItem(const SJson* pJson, int32_t index) { return cJSON_GetAr int32_t tjsonToObject(const SJson* pJson, const char* pName, FToObject func, void* pObj) { SJson* pJsonObj = tjsonGetObjectItem(pJson, pName); if (NULL == pJsonObj) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } return func(pJsonObj, pObj); } @@ -294,7 +300,7 @@ int32_t tjsonMakeObject(const SJson* pJson, const char* pName, FToObject func, v SJson* pJsonObj = tjsonGetObjectItem(pJson, pName); if (NULL == pJsonObj) { - return TSDB_CODE_FAILED; + return TSDB_CODE_SUCCESS; } *pObj = taosMemoryCalloc(1, objSize); if (NULL == *pObj) { diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index fc9d90c985..3825b91c6d 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -72,6 +72,7 @@ static int32_t tsDaylightActive; /* Currently in daylight saving time. */ bool tsLogEmbedded = 0; bool tsAsyncLog = true; +bool tsAssert = true; int32_t tsNumOfLogLines = 10000000; int32_t tsLogKeepDays = 0; LogFp tsLogFp = NULL; @@ -496,7 +497,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons if (!osLogSpaceAvailable()) return; if (!(dflag & DEBUG_FILE) && !(dflag & DEBUG_SCREEN)) return; - char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); + char *buffer = taosMemoryMalloc(LOG_MAX_LINE_DUMP_BUFFER_SIZE); int32_t len = taosBuildLogHead(buffer, flags); va_list argpointer; @@ -778,3 +779,37 @@ cmp_end: return ret; } + +bool taosAssert(bool condition, const char *file, int32_t line, const char *format, ...) { + if (condition) return false; + + const char *flags = "UTL FATAL "; + ELogLevel level = DEBUG_FATAL; + int32_t dflag = 255; // tsLogEmbedded ? 255 : uDebugFlag + char buffer[LOG_MAX_LINE_BUFFER_SIZE]; + int32_t len = taosBuildLogHead(buffer, flags); + + va_list argpointer; + va_start(argpointer, format); + len = len + vsnprintf(buffer + len, LOG_MAX_LINE_BUFFER_SIZE - len, format, argpointer); + va_end(argpointer); + buffer[len++] = '\n'; + buffer[len] = 0; + taosPrintLogImp(1, 255, buffer, len); + + taosPrintLog(flags, level, dflag, "tAssert at file %s:%d exit:%d", file, line, tsAssert); + taosPrintTrace(flags, level, dflag); + + if (tsAssert) { + taosCloseLog(); + taosMsleep(300); + +#ifdef NDEBUG + abort(); +#else + assert(0); +#endif + } + + return true; +} \ No newline at end of file diff --git a/source/util/test/hashTest.cpp b/source/util/test/hashTest.cpp index 76fb9c7067..00379a755b 100644 --- a/source/util/test/hashTest.cpp +++ b/source/util/test/hashTest.cpp @@ -6,6 +6,7 @@ #include "taos.h" #include "taosdef.h" #include "thash.h" +#include "tlog.h" namespace { diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c90b2499a4..28ba7ea60f 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1022,9 +1022,9 @@ ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py -#,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py -#,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index 8b0f2b4966..88dada44ac 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -79,6 +79,9 @@ int64_t bpTs; #define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t))) typedef struct { + bool singleTbInsert; + int32_t singleTbIdx; + int64_t* tsData; bool* boolData; int8_t* tinyData; @@ -116,6 +119,7 @@ int insertMBMETest4(TAOS_STMT *stmt, TAOS *taos); int insertMPMETest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest1(TAOS_STMT *stmt, TAOS *taos); int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos); +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos); int queryColumnTest(TAOS_STMT *stmt, TAOS *taos); int queryMiscTest(TAOS_STMT *stmt, TAOS *taos); @@ -130,6 +134,7 @@ typedef struct { int32_t *colList; // full table column list int32_t testType; int32_t autoCreateTbl; + bool duplicateValue; bool fullCol; int32_t (*runFn)(TAOS_STMT*, TAOS*); int32_t tblNum; @@ -143,46 +148,47 @@ typedef struct { } CaseCfg; CaseCfg gCase[] = { - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, true, insertMBSETest1, 1, 10, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, 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}, + {"insert:MBSE0-FULL", tListLen(shortColList), shortColList, TTYPE_INSERT, 0, false, true, insertMBSETest1, 10, 100, 10, 0, 0, 0, 1, -1}, - {"insert:MBSE1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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:MBSE2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBSETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBSE2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBSETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBSE2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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:MBME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME1-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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}, // 11 - {"insert:MBME2-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest2, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME2-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest2, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME2-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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:MBME3-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest3, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME3-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest3, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME3-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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:MBME4-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMBMETest4, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MBME4-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, insertMBMETest4, 10, 10, 2, 12, 0, 0, 1, -1}, - {"insert:MBME4-C002", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"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:MPME1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, true, insertMPMETest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, 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}, + {"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, 0, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 0, 1, -1}, // 22 - {"insert:AUTO1-FULL", tListLen(fullColList), fullColList, TTYPE_INSERT, 1, true, insertAUTOTest1, 10, 10, 2, 0, 0, 0, 1, -1}, - {"insert:AUTO1-TBEXISTS", tListLen(fullColList), fullColList, TTYPE_INSERT, 3, true, insertAUTOTest2, 10, 10, 2, 0, 0, 0, 1, -1}, + {"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}, - {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 10, 10, 1, 3, 0, 0, 1, 2}, - {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 10, 10, 1, 3, 0, 0, 1, 2}, + {"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}, -// {"query:SUBT-COLUMN", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryColumnTest, 1, 10, 1, 1, 0, 0, 1, 2}, -// {"query:SUBT-MISC", tListLen(fullColList), fullColList, TTYPE_QUERY, 0, false, queryMiscTest, 2, 10, 1, 1, 0, 0, 1, 2}, +// {"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}, }; @@ -244,7 +250,7 @@ CaseCtrl gCaseCtrl = { .funcIdxList = NULL, .checkParamNum = false, .runTimes = 0, - .caseIdx = 22, + .caseIdx = 24, .caseNum = 1, .caseRunIdx = -1, .caseRunNum = -1, @@ -382,7 +388,11 @@ bool colExists(TAOS_MULTI_BIND* pBind, int32_t dataType) { void generateInsertSQL(BindData *data) { int32_t len = 0; if (gCurCase->tblNum > 1) { - len = sprintf(data->sql, "insert into ? "); + if (data->singleTbInsert) { + len = sprintf(data->sql, "insert into %s%d ", bpTbPrefix, data->singleTbIdx); + } else { + len = sprintf(data->sql, "insert into ? "); + } } else { len = sprintf(data->sql, "insert into %s0 ", bpTbPrefix); } @@ -938,7 +948,14 @@ int32_t prepareInsertData(BindData *data) { } for (int32_t i = 0; i < allRowNum; ++i) { - data->tsData[i] = bpTs++; + if (gCurCase->duplicateValue) { + data->tsData[i] = bpTs; + if (i % 2 == 1) { + bpTs++; + } + } else { + data->tsData[i] = bpTs++; + } data->boolData[i] = (bool)(i % 2); data->tinyData[i] = (int8_t)i; data->utinyData[i] = (uint8_t)(i+1); @@ -1251,6 +1268,9 @@ void bpCheckParamNum(TAOS_STMT *stmt) { void bpCheckAffectedRows(TAOS_STMT *stmt, int32_t times) { int32_t rows = taos_stmt_affected_rows(stmt); int32_t insertNum = gCurCase->rowNum * gCurCase->tblNum * times; + if (gCurCase->duplicateValue) { + insertNum /= 2; + } if (insertNum != rows) { printf("!!!affected rows %d mis-match with insert num %d\n", rows, insertNum); exit(1); @@ -2014,6 +2034,65 @@ int insertAUTOTest2(TAOS_STMT *stmt, TAOS *taos) { return 0; } +/* normal table [prepare [bind add exec]] */ +int insertAUTOTest3(TAOS_STMT *stmt, TAOS *taos) { + int32_t loop = 0; + + while (gCurCase->bindColNum > 0) { + BindData data = {0}; + data.singleTbInsert = true; + prepareInsertData(&data); + + int32_t bindTimes = gCurCase->rowNum/gCurCase->bindRowNum; + for (int32_t t = 0; t< gCurCase->tblNum; ++t) { + data.singleTbIdx = t; + generateInsertSQL(&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); + } + + for (int32_t b = 0; b bindColNum + b*gCurCase->bindColNum)) { + 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); + + gCurCase->bindColNum -= 2; + gCurCase->fullCol = false; + loop++; + } + + bpCheckAffectedRows(stmt, loop); + + gExecLoopTimes = loop; + + return 0; +} + /* select * from table */ int queryColumnTest(TAOS_STMT *stmt, TAOS *taos) { @@ -2160,7 +2239,7 @@ void prepareCheckResult(TAOS *taos, bool silent) { sprintf(buf, "%s%d", bpTbPrefix, 0); } - prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->rowNum * gExecLoopTimes, silent); + prepareCheckResultImpl(taos, buf, gCaseCtrl.printRes, gCurCase->duplicateValue ? (gCurCase->rowNum * gExecLoopTimes / 2) : (gCurCase->rowNum * gExecLoopTimes), silent); } gExecLoopTimes = 1; @@ -2749,6 +2828,7 @@ void runAll(TAOS *taos) { printf("%s Begin\n", gCaseCtrl.caseCatalog); runCaseList(taos); +#if 0 strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); gCaseCtrl.precision = TIME_PRECISION_MICRO; @@ -2805,6 +2885,8 @@ void runAll(TAOS *taos) { runCaseList(taos); gCaseCtrl.bindColNum = 0; +#endif + /* strcpy(gCaseCtrl.caseCatalog, "Bind Col Type Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); diff --git a/tests/script/tsim/db/alter_replica_13.sim b/tests/script/tsim/db/alter_replica_13.sim index 4eafb86198..d75acb50ad 100644 --- a/tests/script/tsim/db/alter_replica_13.sim +++ b/tests/script/tsim/db/alter_replica_13.sim @@ -116,6 +116,25 @@ endi print ============= step4: alter database sql alter database db replica 3 +$wt = 0 +stepwt1: + $wt = $wt + 1 + sleep 1000 + if $wt == 200 then + print ====> dnode not ready! + return -1 + endi +sql show transactions +if $rows != 0 then + print wait 1 seconds to alter + goto stepwt1 +endi + +sql show db.vgroups +print ---> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data27 $data28 $data29 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data26 $data37 $data38 $data39 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data36 $data47 $data48 $data49 $leaderIndex = 0 diff --git a/tests/script/tsim/db/alter_replica_31.sim b/tests/script/tsim/db/alter_replica_31.sim index 47e1fda79f..74e8007791 100644 --- a/tests/script/tsim/db/alter_replica_31.sim +++ b/tests/script/tsim/db/alter_replica_31.sim @@ -148,6 +148,26 @@ endi print ============= step3: alter database sql alter database db replica 1 +$wt = 0 + stepwt1: + $wt = $wt + 1 + sleep 1000 + if $wt == 200 then + print ====> dnode not ready! + return -1 + endi +sql show transactions +if $rows != 0 then + print wait 1 seconds to alter + goto stepwt1 +endi + +sql show db.vgroups +print ---> $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data16 $data27 $data28 $data29 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data26 $data37 $data38 $data39 +print ---> $data10 $data11 $data12 $data13 $data14 $data15 $data36 $data47 $data48 $data49 + $hasleader = 0 $x = 0 diff --git a/tests/script/tsim/user/privilege_db.sim b/tests/script/tsim/user/privilege_db.sim index ab77326e69..b708fdab64 100644 --- a/tests/script/tsim/user/privilege_db.sim +++ b/tests/script/tsim/user/privilege_db.sim @@ -6,8 +6,8 @@ sql connect print =============== create db sql create database d1 vgroups 1; sql use d1 -sql create table stb (ts timestamp, i int) tags (j int) -# sql create topic topic_1 as select ts, i from stb +sql create table d1_stb (ts timestamp, i int) tags (j int) +sql create topic d1_topic_1 as select ts, i from d1_stb sql create database d2 vgroups 1; sql create database d3 vgroups 1; @@ -72,7 +72,6 @@ sql REVOKE read,write ON d1.* from user1; sql REVOKE read,write ON d2.* from user1; sql REVOKE read,write ON *.* from user1; - print =============== create users sql create user u1 PASS 'taosdata' sql select * from information_schema.ins_users @@ -92,7 +91,17 @@ sql_error drop database d1; sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) -sql create stable d2.st (ts timestamp, i int) tags (j int) -#sql create topic topic_2 as select ts, i from stb +sql use d2 +sql create table d2_stb (ts timestamp, i int) tags (j int) + +# Insufficient privilege for operation +sql_error create topic d2_topic_1 as select ts, i from d2_stb + +sql use d1 +# Insufficient privilege for operation +sql_error drop topic d1_topic_1 +sql create topic d1_topic_2 as select ts, i from d1_stb + +sql drop topic d1_topic_2 system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/vnode/replica3_repeat.sim b/tests/script/tsim/vnode/replica3_repeat.sim index 8efba515ae..10e18d01d0 100644 --- a/tests/script/tsim/vnode/replica3_repeat.sim +++ b/tests/script/tsim/vnode/replica3_repeat.sim @@ -85,6 +85,7 @@ print ======== step3 system sh/exec.sh -n dnode2 -s stop sleep 3000 +$t = 0 $x = 0 loop: @@ -126,8 +127,8 @@ print ======== step8 $lastRows = $data00 print ======== loop Times $x -if $x < 2 then - $x = $x + 1 +if $t < 2 then + $t = $t + 1 goto loop endi @@ -138,4 +139,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT system sh/exec.sh -n dnode5 -s stop -x SIGINT system sh/exec.sh -n dnode6 -s stop -x SIGINT system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode8 -s stop -x SIGINT diff --git a/tools/shell/src/shellWebsocket.c b/tools/shell/src/shellWebsocket.c index 94bb909e29..add3ccc51f 100644 --- a/tools/shell/src/shellWebsocket.c +++ b/tools/shell/src/shellWebsocket.c @@ -223,7 +223,7 @@ void shellRunSingleCommandWebsocketImp(char *command) { if (code == TSDB_CODE_WS_SEND_TIMEOUT || code == TSDB_CODE_WS_RECV_TIMEOUT) { fprintf(stderr, "Hint: use -t to increase the timeout in seconds\n"); } else if (code == TSDB_CODE_WS_INTERNAL_ERRO || code == TSDB_CODE_WS_CLOSED) { - fprintf(stderr, "TDengine server is down, will try to reconnect\n"); + fprintf(stderr, "TDengine server is disconnected, will try to reconnect\n"); shell.ws_conn = NULL; } ws_free_result(res); diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 2f6950c96f..18960f037d 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -20,6 +20,7 @@ #include #include "taos.h" #include "types.h" +#include "tlog.h" int smlProcess_influx_Test() { TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);