diff --git a/include/common/systable.h b/include/common/systable.h index f0f8ac8cf6..77fd18da39 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -29,6 +29,7 @@ extern "C" { #define TSDB_INS_TABLE_QNODES "ins_qnodes" #define TSDB_INS_TABLE_BNODES "ins_bnodes" // no longer used #define TSDB_INS_TABLE_SNODES "ins_snodes" +#define TSDB_INS_TABLE_ARBGROUPS "ins_arbgroups" #define TSDB_INS_TABLE_CLUSTER "ins_cluster" #define TSDB_INS_TABLE_DATABASES "ins_databases" #define TSDB_INS_TABLE_FUNCTIONS "ins_functions" diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 93f17fa887..7a7f19c3af 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -76,6 +76,11 @@ extern int32_t tsHeartbeatInterval; extern int32_t tsHeartbeatTimeout; extern int32_t tsSnapReplMaxWaitN; +// arbitrator +extern int32_t tsArbHeartBeatIntervalSec; +extern int32_t tsArbCheckSyncIntervalSec; +extern int32_t tsArbSetAssignedTimeoutSec; + // vnode extern int64_t tsVndCommitMaxIntervalMs; diff --git a/include/common/tmsg.h b/include/common/tmsg.h index a410ad390e..98ae192a9a 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -150,6 +150,7 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_GRANTS_FULL, TSDB_MGMT_TABLE_GRANTS_LOGS, TSDB_MGMT_TABLE_MACHINES, + TSDB_MGMT_TABLE_ARBGROUP, TSDB_MGMT_TABLE_MAX, } EShowType; @@ -337,6 +338,7 @@ typedef enum ENodeType { QUERY_NODE_SHOW_QNODES_STMT, QUERY_NODE_SHOW_SNODES_STMT, QUERY_NODE_SHOW_BNODES_STMT, + QUERY_NODE_SHOW_ARBGROUPS_STMT, QUERY_NODE_SHOW_CLUSTER_STMT, QUERY_NODE_SHOW_DATABASES_STMT, QUERY_NODE_SHOW_FUNCTIONS_STMT, @@ -1153,6 +1155,7 @@ typedef struct { int32_t tsdbPageSize; int32_t sqlLen; char* sql; + int8_t withArbitrator; } SCreateDbReq; int32_t tSerializeSCreateDbReq(void* buf, int32_t bufLen, SCreateDbReq* pReq); @@ -1181,6 +1184,7 @@ typedef struct { int32_t walRetentionSize; int32_t sqlLen; char* sql; + int8_t withArbitrator; } SAlterDbReq; int32_t tSerializeSAlterDbReq(void* buf, int32_t bufLen, SAlterDbReq* pReq); @@ -1303,6 +1307,7 @@ typedef struct { SArray* pRetensions; int8_t schemaless; int16_t sstTrigger; + int8_t withArbitrator; } SDbCfgRsp; typedef SDbCfgRsp SDbCfgInfo; @@ -2146,6 +2151,99 @@ typedef struct { int32_t tSerializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); int32_t tDeserializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); +typedef struct { + int32_t vgId; + int32_t hbSeq; +} SVArbHbReqMember; + +typedef struct { + int32_t dnodeId; + char* arbToken; + int64_t arbTerm; + SArray* hbMembers; // SVArbHbReqMember +} SVArbHeartBeatReq; + +int32_t tSerializeSVArbHeartBeatReq(void* buf, int32_t bufLen, SVArbHeartBeatReq* pReq); +int32_t tDeserializeSVArbHeartBeatReq(void* buf, int32_t bufLen, SVArbHeartBeatReq* pReq); +void tFreeSVArbHeartBeatReq(SVArbHeartBeatReq* pReq); + +typedef struct { + int32_t vgId; + char memberToken[TSDB_ARB_TOKEN_SIZE]; + int32_t hbSeq; +} SVArbHbRspMember; + +typedef struct { + char arbToken[TSDB_ARB_TOKEN_SIZE]; + int32_t dnodeId; + SArray* hbMembers; // SVArbHbRspMember +} SVArbHeartBeatRsp; + +int32_t tSerializeSVArbHeartBeatRsp(void* buf, int32_t bufLen, SVArbHeartBeatRsp* pRsp); +int32_t tDeserializeSVArbHeartBeatRsp(void* buf, int32_t bufLen, SVArbHeartBeatRsp* pRsp); +void tFreeSVArbHeartBeatRsp(SVArbHeartBeatRsp* pRsp); + +typedef struct { + char* arbToken; + int64_t arbTerm; + char* member0Token; + char* member1Token; +} SVArbCheckSyncReq; + +int32_t tSerializeSVArbCheckSyncReq(void* buf, int32_t bufLen, SVArbCheckSyncReq* pReq); +int32_t tDeserializeSVArbCheckSyncReq(void* buf, int32_t bufLen, SVArbCheckSyncReq* pReq); +void tFreeSVArbCheckSyncReq(SVArbCheckSyncReq* pRsp); + +typedef struct { + char* arbToken; + char* member0Token; + char* member1Token; + int32_t vgId; + int32_t errCode; +} SVArbCheckSyncRsp; + +int32_t tSerializeSVArbCheckSyncRsp(void* buf, int32_t bufLen, SVArbCheckSyncRsp* pRsp); +int32_t tDeserializeSVArbCheckSyncRsp(void* buf, int32_t bufLen, SVArbCheckSyncRsp* pRsp); +void tFreeSVArbCheckSyncRsp(SVArbCheckSyncRsp* pRsp); + +typedef struct { + char* arbToken; + int64_t arbTerm; + char* memberToken; +} SVArbSetAssignedLeaderReq; + +int32_t tSerializeSVArbSetAssignedLeaderReq(void* buf, int32_t bufLen, SVArbSetAssignedLeaderReq* pReq); +int32_t tDeserializeSVArbSetAssignedLeaderReq(void* buf, int32_t bufLen, SVArbSetAssignedLeaderReq* pReq); +void tFreeSVArbSetAssignedLeaderReq(SVArbSetAssignedLeaderReq* pReq); + +typedef struct { + char* arbToken; + char* memberToken; + int32_t vgId; +} SVArbSetAssignedLeaderRsp; + +int32_t tSerializeSVArbSetAssignedLeaderRsp(void* buf, int32_t bufLen, SVArbSetAssignedLeaderRsp* pRsp); +int32_t tDeserializeSVArbSetAssignedLeaderRsp(void* buf, int32_t bufLen, SVArbSetAssignedLeaderRsp* pRsp); +void tFreeSVArbSetAssignedLeaderRsp(SVArbSetAssignedLeaderRsp* pRsp); + +typedef struct { + int32_t dnodeId; + char* token; +} SMArbUpdateGroupReqMember; + +typedef struct { + int32_t vgId; + int64_t dbUid; + SMArbUpdateGroupReqMember members[2]; + int8_t isSync; + SMArbUpdateGroupReqMember assignedLeader; + int64_t version; +} SMArbUpdateGroupReq; + +int32_t tSerializeSMArbUpdateGroupReq(void* buf, int32_t bufLen, SMArbUpdateGroupReq* pReq); +int32_t tDeserializeSMArbUpdateGroupReq(void* buf, int32_t bufLen, SMArbUpdateGroupReq* pReq); +void tFreeSMArbUpdateGroupReq(SMArbUpdateGroupReq* pReq); + typedef struct { char queryStrId[TSDB_QUERY_ID_LEN]; } SKillQueryReq; diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h index dd1e54318e..03bf8da707 100644 --- a/include/common/tmsgcb.h +++ b/include/common/tmsgcb.h @@ -36,9 +36,11 @@ typedef enum { SYNC_QUEUE, SYNC_RD_QUEUE, STREAM_QUEUE, + ARB_QUEUE, QUEUE_MAX, } EQueueType; +typedef void (*GetDnodeEp)(void* pData, int32_t dnodeId, char* pEp, char* pFqdn, uint16_t* pPort); typedef bool (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); typedef int32_t (*PutToQueueFp)(void* pMgmt, EQueueType qtype, SRpcMsg* pMsg); typedef int32_t (*GetQueueSizeFp)(void* pMgmt, int32_t vgId, EQueueType qtype); @@ -64,6 +66,7 @@ typedef struct { ReleaseHandleFp releaseHandleFp; ReportStartup reportStartupFp; UpdateDnodeInfoFp updateDnodeInfoFp; + GetDnodeEp getDnodeEpFp; } SMsgCb; void tmsgSetDefault(const SMsgCb* msgcb); diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 62392a9caa..532a54e9f1 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -272,6 +272,8 @@ TD_DEF_MSG_TYPE(TDMT_VND_DISABLE_WRITE, "vnode-disable-write", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_QUERY_COMPACT_PROGRESS, "vnode-query-compact-progress", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_KILL_COMPACT, "kill-compact", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_ARB_HEARTBEAT, "vnode-arb-hb", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_ARB_CHECK_SYNC, "vnode-arb-check-sync", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_MAX_MSG, "vnd-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_VND_MSG) @@ -341,6 +343,7 @@ TD_DEF_MSG_TYPE(TDMT_SYNC_PREP_SNAPSHOT_REPLY, "sync-prep-snapshot-reply", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_UNUSED_CODE, "sync-unused", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_FORCE_FOLLOWER, "sync-force-become-follower", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SYNC_SET_ASSIGNED_LEADER, "sync-set-assigned-leader", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_SYNC_MSG) @@ -367,6 +370,13 @@ TD_DEF_MSG_TYPE(TDMT_VND_TMQ_MAX_MSG, "vnd-tmq-max", NULL, NULL) TD_CLOSE_MSG_SEG(TDMT_END_TMQ_MSG) + TD_NEW_MSG_SEG(TDMT_MND_ARB_MSG) //9 << 8 + TD_DEF_MSG_TYPE(TDMT_MND_ARB_HEARTBEAT_TIMER, "mnd-arb-hb-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_CHECK_SYNC_TIMER, "mnd-arb-check-sync-tmr", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_UPDATE_GROUP, "mnd-arb-update-group", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_MND_ARB_MAX_MSG, "mnd-arb-max", NULL, NULL) + TD_CLOSE_MSG_SEG(TDMT_END_ARB_MSG) + TD_NEW_MSG_SEG(TDMT_MAX_MSG) // msg end mark TD_CLOSE_MSG_SEG(TDMT_END_MAX_MSG) diff --git a/include/common/ttokendef.h b/include/common/ttokendef.h index 6aab52c9dc..8591b057a1 100644 --- a/include/common/ttokendef.h +++ b/include/common/ttokendef.h @@ -167,215 +167,222 @@ #define TK_STABLES 149 #define TK_MNODES 150 #define TK_QNODES 151 -#define TK_FUNCTIONS 152 -#define TK_INDEXES 153 -#define TK_ACCOUNTS 154 -#define TK_APPS 155 -#define TK_CONNECTIONS 156 -#define TK_LICENCES 157 -#define TK_GRANTS 158 -#define TK_FULL 159 -#define TK_LOGS 160 -#define TK_MACHINES 161 -#define TK_QUERIES 162 -#define TK_SCORES 163 -#define TK_TOPICS 164 -#define TK_VARIABLES 165 -#define TK_BNODES 166 -#define TK_SNODES 167 -#define TK_TRANSACTIONS 168 -#define TK_DISTRIBUTED 169 -#define TK_CONSUMERS 170 -#define TK_SUBSCRIPTIONS 171 -#define TK_VNODES 172 -#define TK_ALIVE 173 -#define TK_VIEWS 174 -#define TK_VIEW 175 -#define TK_COMPACTS 176 -#define TK_NORMAL 177 -#define TK_CHILD 178 -#define TK_LIKE 179 -#define TK_TBNAME 180 -#define TK_QTAGS 181 -#define TK_AS 182 -#define TK_SYSTEM 183 -#define TK_INDEX 184 -#define TK_FUNCTION 185 -#define TK_INTERVAL 186 -#define TK_COUNT 187 -#define TK_LAST_ROW 188 -#define TK_META 189 -#define TK_ONLY 190 -#define TK_TOPIC 191 -#define TK_CONSUMER 192 -#define TK_GROUP 193 -#define TK_DESC 194 -#define TK_DESCRIBE 195 -#define TK_RESET 196 -#define TK_QUERY 197 -#define TK_CACHE 198 -#define TK_EXPLAIN 199 -#define TK_ANALYZE 200 -#define TK_VERBOSE 201 -#define TK_NK_BOOL 202 -#define TK_RATIO 203 -#define TK_NK_FLOAT 204 -#define TK_OUTPUTTYPE 205 -#define TK_AGGREGATE 206 -#define TK_BUFSIZE 207 -#define TK_LANGUAGE 208 -#define TK_REPLACE 209 -#define TK_STREAM 210 -#define TK_INTO 211 -#define TK_PAUSE 212 -#define TK_RESUME 213 -#define TK_TRIGGER 214 -#define TK_AT_ONCE 215 -#define TK_WINDOW_CLOSE 216 -#define TK_IGNORE 217 -#define TK_EXPIRED 218 -#define TK_FILL_HISTORY 219 -#define TK_UPDATE 220 -#define TK_SUBTABLE 221 -#define TK_UNTREATED 222 -#define TK_KILL 223 -#define TK_CONNECTION 224 -#define TK_TRANSACTION 225 -#define TK_BALANCE 226 -#define TK_VGROUP 227 -#define TK_LEADER 228 -#define TK_MERGE 229 -#define TK_REDISTRIBUTE 230 -#define TK_SPLIT 231 -#define TK_DELETE 232 -#define TK_INSERT 233 -#define TK_NK_BIN 234 -#define TK_NK_HEX 235 -#define TK_NULL 236 -#define TK_NK_QUESTION 237 -#define TK_NK_ALIAS 238 -#define TK_NK_ARROW 239 -#define TK_ROWTS 240 -#define TK_QSTART 241 -#define TK_QEND 242 -#define TK_QDURATION 243 -#define TK_WSTART 244 -#define TK_WEND 245 -#define TK_WDURATION 246 -#define TK_IROWTS 247 -#define TK_ISFILLED 248 -#define TK_CAST 249 -#define TK_NOW 250 -#define TK_TODAY 251 -#define TK_TIMEZONE 252 -#define TK_CLIENT_VERSION 253 -#define TK_SERVER_VERSION 254 -#define TK_SERVER_STATUS 255 -#define TK_CURRENT_USER 256 -#define TK_CASE 257 -#define TK_WHEN 258 -#define TK_THEN 259 -#define TK_ELSE 260 -#define TK_BETWEEN 261 -#define TK_IS 262 -#define TK_NK_LT 263 -#define TK_NK_GT 264 -#define TK_NK_LE 265 -#define TK_NK_GE 266 -#define TK_NK_NE 267 -#define TK_MATCH 268 -#define TK_NMATCH 269 -#define TK_CONTAINS 270 -#define TK_IN 271 -#define TK_JOIN 272 -#define TK_INNER 273 -#define TK_LEFT 274 -#define TK_RIGHT 275 -#define TK_OUTER 276 -#define TK_SEMI 277 -#define TK_ANTI 278 -#define TK_ASOF 279 -#define TK_WINDOW 280 -#define TK_WINDOW_OFFSET 281 -#define TK_JLIMIT 282 -#define TK_SELECT 283 -#define TK_NK_HINT 284 -#define TK_DISTINCT 285 -#define TK_WHERE 286 -#define TK_PARTITION 287 -#define TK_BY 288 -#define TK_SESSION 289 -#define TK_STATE_WINDOW 290 -#define TK_EVENT_WINDOW 291 -#define TK_COUNT_WINDOW 292 -#define TK_SLIDING 293 -#define TK_FILL 294 -#define TK_VALUE 295 -#define TK_VALUE_F 296 -#define TK_NONE 297 -#define TK_PREV 298 -#define TK_NULL_F 299 -#define TK_LINEAR 300 -#define TK_NEXT 301 -#define TK_HAVING 302 -#define TK_RANGE 303 -#define TK_EVERY 304 -#define TK_ORDER 305 -#define TK_SLIMIT 306 -#define TK_SOFFSET 307 -#define TK_LIMIT 308 -#define TK_OFFSET 309 -#define TK_ASC 310 -#define TK_NULLS 311 -#define TK_ABORT 312 -#define TK_AFTER 313 -#define TK_ATTACH 314 -#define TK_BEFORE 315 -#define TK_BEGIN 316 -#define TK_BITAND 317 -#define TK_BITNOT 318 -#define TK_BITOR 319 -#define TK_BLOCKS 320 -#define TK_CHANGE 321 -#define TK_COMMA 322 -#define TK_CONCAT 323 -#define TK_CONFLICT 324 -#define TK_COPY 325 -#define TK_DEFERRED 326 -#define TK_DELIMITERS 327 -#define TK_DETACH 328 -#define TK_DIVIDE 329 -#define TK_DOT 330 -#define TK_EACH 331 -#define TK_FAIL 332 -#define TK_FILE 333 -#define TK_FOR 334 -#define TK_GLOB 335 -#define TK_ID 336 -#define TK_IMMEDIATE 337 -#define TK_IMPORT 338 -#define TK_INITIALLY 339 -#define TK_INSTEAD 340 -#define TK_ISNULL 341 -#define TK_KEY 342 -#define TK_MODULES 343 -#define TK_NK_BITNOT 344 -#define TK_NK_SEMI 345 -#define TK_NOTNULL 346 -#define TK_OF 347 -#define TK_PLUS 348 -#define TK_PRIVILEGE 349 -#define TK_RAISE 350 -#define TK_RESTRICT 351 -#define TK_ROW 352 -#define TK_STAR 353 -#define TK_STATEMENT 354 -#define TK_STRICT 355 -#define TK_STRING 356 -#define TK_TIMES 357 -#define TK_VALUES 358 -#define TK_VARIABLE 359 -#define TK_WAL 360 +#define TK_ARBGROUPS 152 +#define TK_FUNCTIONS 153 +#define TK_INDEXES 154 +#define TK_ACCOUNTS 155 +#define TK_APPS 156 +#define TK_CONNECTIONS 157 +#define TK_LICENCES 158 +#define TK_GRANTS 159 +#define TK_FULL 160 +#define TK_LOGS 161 +#define TK_MACHINES 162 +#define TK_QUERIES 163 +#define TK_SCORES 164 +#define TK_TOPICS 165 +#define TK_VARIABLES 166 +#define TK_BNODES 167 +#define TK_SNODES 168 +#define TK_TRANSACTIONS 169 +#define TK_DISTRIBUTED 170 +#define TK_CONSUMERS 171 +#define TK_SUBSCRIPTIONS 172 +#define TK_VNODES 173 +#define TK_ALIVE 174 +#define TK_VIEWS 175 +#define TK_VIEW 176 +#define TK_COMPACTS 177 +#define TK_NORMAL 178 +#define TK_CHILD 179 +#define TK_LIKE 180 +#define TK_TBNAME 181 +#define TK_QTAGS 182 +#define TK_AS 183 +#define TK_SYSTEM 184 +#define TK_INDEX 185 +#define TK_FUNCTION 186 +#define TK_INTERVAL 187 +#define TK_COUNT 188 +#define TK_LAST_ROW 189 +#define TK_META 190 +#define TK_ONLY 191 +#define TK_TOPIC 192 +#define TK_CONSUMER 193 +#define TK_GROUP 194 +#define TK_DESC 195 +#define TK_DESCRIBE 196 +#define TK_RESET 197 +#define TK_QUERY 198 +#define TK_CACHE 199 +#define TK_EXPLAIN 200 +#define TK_ANALYZE 201 +#define TK_VERBOSE 202 +#define TK_NK_BOOL 203 +#define TK_RATIO 204 +#define TK_NK_FLOAT 205 +#define TK_OUTPUTTYPE 206 +#define TK_AGGREGATE 207 +#define TK_BUFSIZE 208 +#define TK_LANGUAGE 209 +#define TK_REPLACE 210 +#define TK_STREAM 211 +#define TK_INTO 212 +#define TK_PAUSE 213 +#define TK_RESUME 214 +#define TK_TRIGGER 215 +#define TK_AT_ONCE 216 +#define TK_WINDOW_CLOSE 217 +#define TK_IGNORE 218 +#define TK_EXPIRED 219 +#define TK_FILL_HISTORY 220 +#define TK_UPDATE 221 +#define TK_SUBTABLE 222 +#define TK_UNTREATED 223 +#define TK_KILL 224 +#define TK_CONNECTION 225 +#define TK_TRANSACTION 226 +#define TK_BALANCE 227 +#define TK_VGROUP 228 +#define TK_LEADER 229 +#define TK_MERGE 230 +#define TK_REDISTRIBUTE 231 +#define TK_SPLIT 232 +#define TK_DELETE 233 +#define TK_INSERT 234 +#define TK_NK_BIN 235 +#define TK_NK_HEX 236 +#define TK_NULL 237 +#define TK_NK_QUESTION 238 +#define TK_NK_ALIAS 239 +#define TK_NK_ARROW 240 +#define TK_ROWTS 241 +#define TK_QSTART 242 +#define TK_QEND 243 +#define TK_QDURATION 244 +#define TK_WSTART 245 +#define TK_WEND 246 +#define TK_WDURATION 247 +#define TK_IROWTS 248 +#define TK_ISFILLED 249 +#define TK_CAST 250 +#define TK_NOW 251 +#define TK_TODAY 252 +#define TK_TIMEZONE 253 +#define TK_CLIENT_VERSION 254 +#define TK_SERVER_VERSION 255 +#define TK_SERVER_STATUS 256 +#define TK_CURRENT_USER 257 +#define TK_CASE 258 +#define TK_WHEN 259 +#define TK_THEN 260 +#define TK_ELSE 261 +#define TK_BETWEEN 262 +#define TK_IS 263 +#define TK_NK_LT 264 +#define TK_NK_GT 265 +#define TK_NK_LE 266 +#define TK_NK_GE 267 +#define TK_NK_NE 268 +#define TK_MATCH 269 +#define TK_NMATCH 270 +#define TK_CONTAINS 271 +#define TK_IN 272 +#define TK_JOIN 273 +#define TK_INNER 274 +#define TK_LEFT 275 +#define TK_RIGHT 276 +#define TK_OUTER 277 +#define TK_SEMI 278 +#define TK_ANTI 279 +#define TK_ASOF 280 +#define TK_WINDOW 281 +#define TK_WINDOW_OFFSET 282 +#define TK_JLIMIT 283 +#define TK_SELECT 284 +#define TK_NK_HINT 285 +#define TK_DISTINCT 286 +#define TK_WHERE 287 +#define TK_PARTITION 288 +#define TK_BY 289 +#define TK_SESSION 290 +#define TK_STATE_WINDOW 291 +#define TK_EVENT_WINDOW 292 +#define TK_COUNT_WINDOW 293 +#define TK_SLIDING 294 +#define TK_FILL 295 +#define TK_VALUE 296 +#define TK_VALUE_F 297 +#define TK_NONE 298 +#define TK_PREV 299 +#define TK_NULL_F 300 +#define TK_LINEAR 301 +#define TK_NEXT 302 +#define TK_HAVING 303 +#define TK_RANGE 304 +#define TK_EVERY 305 +#define TK_ORDER 306 +#define TK_SLIMIT 307 +#define TK_SOFFSET 308 +#define TK_LIMIT 309 +#define TK_OFFSET 310 +#define TK_ASC 311 +#define TK_NULLS 312 +#define TK_ABORT 313 +#define TK_AFTER 314 +#define TK_ATTACH 315 +#define TK_BEFORE 316 +#define TK_BEGIN 317 +#define TK_BITAND 318 +#define TK_BITNOT 319 +#define TK_BITOR 320 +#define TK_BLOCKS 321 +#define TK_CHANGE 322 +#define TK_COMMA 323 +#define TK_CONCAT 324 +#define TK_CONFLICT 325 +#define TK_COPY 326 +#define TK_DEFERRED 327 +#define TK_DELIMITERS 328 +#define TK_DETACH 329 +#define TK_DIVIDE 330 +#define TK_DOT 331 +#define TK_EACH 332 +#define TK_FAIL 333 +#define TK_FILE 334 +#define TK_FOR 335 +#define TK_GLOB 336 +#define TK_ID 337 +#define TK_IMMEDIATE 338 +#define TK_IMPORT 339 +#define TK_INITIALLY 340 +#define TK_INSTEAD 341 +#define TK_ISNULL 342 +#define TK_KEY 343 +#define TK_MODULES 344 +#define TK_NK_BITNOT 345 +#define TK_NK_SEMI 346 +#define TK_NOTNULL 347 +#define TK_OF 348 +#define TK_PLUS 349 +#define TK_PRIVILEGE 350 +#define TK_RAISE 351 +#define TK_RESTRICT 352 +#define TK_ROW 353 +#define TK_STAR 354 +#define TK_STATEMENT 355 +#define TK_STRICT 356 +#define TK_STRING 357 +#define TK_TIMES 358 +#define TK_VALUES 359 +#define TK_VARIABLE 360 +#define TK_WAL 361 + + + + + + diff --git a/include/dnode/mnode/mnode.h b/include/dnode/mnode/mnode.h index 6c3c7497b1..108e6f18a6 100644 --- a/include/dnode/mnode/mnode.h +++ b/include/dnode/mnode/mnode.h @@ -75,6 +75,9 @@ void mndStop(SMnode *pMnode); int32_t mndIsCatchUp(SMnode *pMnode); ESyncRole mndGetRole(SMnode *pMnode); +int64_t mndGetTerm(SMnode *pMnode); + +int32_t mndGetArbToken(SMnode *pMnode, char *outToken); /** * @brief Get mnode monitor info. diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 9a12d7b98f..f238d138d2 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -100,6 +100,7 @@ typedef struct SDatabaseOptions { int32_t sstTrigger; int32_t tablePrefix; int32_t tableSuffix; + int8_t withArbitrator; } SDatabaseOptions; typedef struct SCreateDatabaseStmt { diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index cb053d2548..0be03b82f3 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -80,6 +80,7 @@ typedef enum { TAOS_SYNC_STATE_LEADER = 102, TAOS_SYNC_STATE_ERROR = 103, TAOS_SYNC_STATE_LEARNER = 104, + TAOS_SYNC_STATE_ASSIGNED_LEADER = 105, } ESyncState; typedef enum { @@ -184,6 +185,7 @@ typedef struct SSyncFSM { void (*FpBecomeLeaderCb)(const struct SSyncFSM* pFsm); void (*FpBecomeFollowerCb)(const struct SSyncFSM* pFsm); void (*FpBecomeLearnerCb)(const struct SSyncFSM* pFsm); + void (*FpBecomeAssignedLeaderCb)(const struct SSyncFSM* pFsm); int32_t (*FpGetSnapshot)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot, void* pReaderParam, void** ppReader); int32_t (*FpGetSnapshotInfo)(const struct SSyncFSM* pFsm, SSnapshot* pSnapshot); @@ -273,6 +275,7 @@ int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak, int64_t* seq); int32_t syncCheckMember(int64_t rid); int32_t syncIsCatchUp(int64_t rid); ESyncRole syncGetRole(int64_t rid); +int64_t syncGetTerm(int64_t rid); int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg); int32_t syncReconfig(int64_t rid, SSyncCfg* pCfg); int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex); @@ -284,8 +287,13 @@ bool syncSnapshotSending(int64_t rid); bool syncSnapshotRecving(int64_t rid); int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq); int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg); +int32_t syncBecomeAssignedLeader(SSyncNode* ths, SRpcMsg* pRpcMsg); + +int32_t syncUpdateArbTerm(int64_t rid, SyncTerm arbTerm); SSyncState syncGetState(int64_t rid); +int32_t syncGetArbToken(int64_t rid, char* outToken); +int32_t syncGetAssignedLogSynced(int64_t rid); void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet); const char* syncStr(ESyncState state); diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 0adf0f062d..5cfb920041 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -323,6 +323,9 @@ int32_t* taosGetErrno(); #define TSDB_CODE_MND_BNODE_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A7) #define TSDB_CODE_MND_TOO_FEW_MNODES TAOS_DEF_ERROR_CODE(0, 0x03A8) #define TSDB_CODE_MND_TOO_MANY_MNODES TAOS_DEF_ERROR_CODE(0, 0x03A9) +#define TSDB_CODE_MND_ARBGROUP_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AA) +#define TSDB_CODE_MND_ARBGROUP_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AB) +#define TSDB_CODE_MND_ARB_TOKEN_MISMATCH TAOS_DEF_ERROR_CODE(0, 0x03AC) // mnode-dnode-part2 #define TSDB_CODE_MND_TOO_MANY_DNODES TAOS_DEF_ERROR_CODE(0, 0x03B0) @@ -472,6 +475,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_VND_ALREADY_IS_VOTER TAOS_DEF_ERROR_CODE(0, 0x0533) // internal #define TSDB_CODE_VND_DIR_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0534) #define TSDB_CODE_VND_META_DATA_UNSAFE_DELETE TAOS_DEF_ERROR_CODE(0, 0x0535) +#define TSDB_CODE_VND_ARB_NOT_SYNCED TAOS_DEF_ERROR_CODE(0, 0x0536) // internal // tsdb #define TSDB_CODE_TDB_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0600) diff --git a/include/util/tdef.h b/include/util/tdef.h index 4fd06d6068..be51f4e65b 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -280,6 +280,9 @@ typedef enum ELogicConditionType { #define TSDB_SHOW_SUBQUERY_LEN 1000 #define TSDB_LOG_VAR_LEN 32 +#define TSDB_ARB_GROUP_MEMBER_NUM 2 +#define TSDB_ARB_TOKEN_SIZE 32 + #define TSDB_TRANS_STAGE_LEN 12 #define TSDB_TRANS_TYPE_LEN 16 #define TSDB_TRANS_ERROR_LEN 512 @@ -426,6 +429,10 @@ typedef enum ELogicConditionType { #define TSDB_DB_MIN_WAL_SEGMENT_SIZE 0 #define TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE 0 +#define TSDB_DEFAULT_DB_WITH_ARBITRATOR 0 +#define TSDB_MIN_DB_WITH_ARBITRATOR 0 +#define TSDB_MAX_DB_WITH_ARBITRATOR 1 + #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 @@ -524,12 +531,12 @@ enum { SND_WORKER_TYPE__UNIQUE, }; -#define DEFAULT_HANDLE 0 -#define MNODE_HANDLE 1 -#define QNODE_HANDLE -1 -#define SNODE_HANDLE -2 -#define VNODE_HANDLE -3 -#define CLIENT_HANDLE -5 +#define DEFAULT_HANDLE 0 +#define MNODE_HANDLE 1 +#define QNODE_HANDLE -1 +#define SNODE_HANDLE -2 +#define VNODE_HANDLE -3 +#define CLIENT_HANDLE -5 #define TSDB_CONFIG_OPTION_LEN 32 #define TSDB_CONFIG_VALUE_LEN 64 @@ -549,8 +556,8 @@ enum { // sort page size by default #define DEFAULT_PAGESIZE 4096 -#define VNODE_TIMEOUT_SEC 60 -#define MNODE_TIMEOUT_SEC 60 +#define VNODE_TIMEOUT_SEC 60 +#define MNODE_TIMEOUT_SEC 60 #define MONITOR_TABLENAME_LEN 200 #define MONITOR_TAG_NAME_LEN 100 diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 25cc5d7c79..50e08defb8 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -68,6 +68,16 @@ static const SSysDbTableSchema snodesSchema[] = { {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, }; +static const SSysDbTableSchema arbGroupsSchema[] = { + {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "vgroup_id", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, + {.name = "v1_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "v2_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "is_sync", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "assigned_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, + {.name = "assigned_token", .bytes = TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, +}; + static const SSysDbTableSchema clusterSchema[] = { {.name = "id", .bytes = 8, .type = TSDB_DATA_TYPE_BIGINT, .sysInfo = true}, {.name = "name", .bytes = TSDB_CLUSTER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, @@ -107,6 +117,7 @@ static const SSysDbTableSchema userDBSchema[] = { {.name = "table_suffix", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true}, {.name = "tsdb_pagesize", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, {.name = "keep_time_offset", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "with_arbitrator", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true}, }; static const SSysDbTableSchema userFuncSchema[] = { @@ -398,6 +409,7 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_GRANTS_FULL, useGrantsFullSchema, tListLen(useGrantsFullSchema), true}, {TSDB_INS_TABLE_GRANTS_LOGS, useGrantsLogsSchema, tListLen(useGrantsLogsSchema), true}, {TSDB_INS_TABLE_MACHINES, useMachinesSchema, tListLen(useMachinesSchema), true}, + {TSDB_INS_TABLE_ARBGROUPS, arbGroupsSchema, tListLen(arbGroupsSchema), true}, }; static const SSysDbTableSchema connectionsSchema[] = { diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 7a5a7d1afc..3381d52050 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -82,6 +82,11 @@ int32_t tsMndGrantMode = 0; bool tsMndSkipGrant = false; bool tsEnableWhiteList = false; // ip white list cfg +// arbitrator +int32_t tsArbHeartBeatIntervalSec = 5; +int32_t tsArbCheckSyncIntervalSec = 10; +int32_t tsArbSetAssignedTimeoutSec = 30; + // dnode int64_t tsDndStart = 0; int64_t tsDndStartOsUptime = 0; @@ -672,6 +677,16 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { (TSDB_SYNC_SNAP_BUFFER_SIZE >> 2), CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) return -1; + if (cfgAddInt32(pCfg, "arbHeartBeatIntervalSec", tsArbHeartBeatIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt32(pCfg, "arbCheckSyncIntervalSec", tsArbCheckSyncIntervalSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt32(pCfg, "arbSetAssignedTimeoutSec", tsArbSetAssignedTimeoutSec, 1, 60 * 24 * 2, CFG_SCOPE_SERVER, + CFG_DYN_NONE) != 0) + return -1; + if (cfgAddInt64(pCfg, "mndSdbWriteDelta", tsMndSdbWriteDelta, 20, 10000, CFG_SCOPE_SERVER, CFG_DYN_ENT_SERVER) != 0) return -1; if (cfgAddInt64(pCfg, "mndLogRetention", tsMndLogRetention, 500, 10000, CFG_SCOPE_SERVER, CFG_DYN_NONE) != 0) @@ -1187,6 +1202,10 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsHeartbeatTimeout = cfgGetItem(pCfg, "syncHeartbeatTimeout")->i32; tsSnapReplMaxWaitN = cfgGetItem(pCfg, "syncSnapReplMaxWaitN")->i32; + tsArbHeartBeatIntervalSec = cfgGetItem(pCfg, "arbHeartBeatIntervalSec")->i32; + tsArbCheckSyncIntervalSec = cfgGetItem(pCfg, "arbCheckSyncIntervalSec")->i32; + tsArbSetAssignedTimeoutSec = cfgGetItem(pCfg, "arbSetAssignedTimeoutSec")->i32; + tsMndSdbWriteDelta = cfgGetItem(pCfg, "mndSdbWriteDelta")->i64; tsMndLogRetention = cfgGetItem(pCfg, "mndLogRetention")->i64; tsMndSkipGrant = cfgGetItem(pCfg, "skipGrant")->bval; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 5b154df8a3..ff424ee558 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3024,6 +3024,9 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) { if (tEncodeI32(&encoder, pReq->keepTimeOffset) < 0) return -1; ENCODESQL(); + + if (tEncodeI32(&encoder, pReq->withArbitrator) < 0) return -1; + tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3093,8 +3096,12 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) DECODESQL(); - tEndDecode(&decoder); + pReq->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pReq->withArbitrator) < 0) return -1; + } + tEndDecode(&decoder); tDecoderClear(&decoder); return 0; } @@ -3133,6 +3140,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tEncodeI32(&encoder, pReq->walRetentionSize) < 0) return -1; if (tEncodeI32(&encoder, pReq->keepTimeOffset) < 0) return -1; ENCODESQL(); + if (tEncodeI32(&encoder, pReq->withArbitrator) < 0) return -1; tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3182,6 +3190,10 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { } DECODESQL(); + pReq->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(&decoder)) { + if (tDecodeI8(&decoder, &pReq->withArbitrator) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -3969,6 +3981,7 @@ int32_t tSerializeSDbCfgRspImpl(SEncoder *encoder, const SDbCfgRsp *pRsp) { if (tEncodeI8(encoder, pRsp->schemaless) < 0) return -1; if (tEncodeI16(encoder, pRsp->sstTrigger) < 0) return -1; if (tEncodeI32(encoder, pRsp->keepTimeOffset) < 0) return -1; + if (tEncodeI8(encoder, pRsp->withArbitrator) < 0) return -1; return 0; } @@ -4041,6 +4054,10 @@ int32_t tDeserializeSDbCfgRspImpl(SDecoder *decoder, SDbCfgRsp *pRsp) { if (!tDecodeIsEnd(decoder)) { if (tDecodeI32(decoder, &pRsp->keepTimeOffset) < 0) return -1; } + pRsp->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; + if (!tDecodeIsEnd(decoder)) { + if (tDecodeI8(decoder, &pRsp->withArbitrator) < 0) return -1; + } return 0; } @@ -5916,6 +5933,345 @@ int32_t tDeserializeSDCreateMnodeReq(void *buf, int32_t bufLen, SDCreateMnodeReq return 0; } +int32_t tSerializeSVArbHeartBeatReq(void *buf, int32_t bufLen, SVArbHeartBeatReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + + int32_t size = taosArrayGetSize(pReq->hbMembers); + if (tEncodeI32(&encoder, size) < 0) return -1; + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember *pMember = taosArrayGet(pReq->hbMembers, i); + if (tEncodeI32(&encoder, pMember->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pMember->hbSeq) < 0) return -1; + } + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbHeartBeatReq(void *buf, int32_t bufLen, SVArbHeartBeatReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + + pReq->hbMembers = taosArrayInit(16, sizeof(SVArbHbReqMember)); + int32_t size = 0; + if (tDecodeI32(&decoder, &size) < 0) return -1; + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember member = {0}; + if (tDecodeI32(&decoder, &member.vgId) < 0) return -1; + if (tDecodeI32(&decoder, &member.hbSeq) < 0) return -1; + taosArrayPush(pReq->hbMembers, &member); + } + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbHeartBeatReq(SVArbHeartBeatReq *pReq) { + if (!pReq) return; + taosMemoryFree(pReq->arbToken); + taosArrayDestroy(pReq->hbMembers); +} + +int32_t tSerializeSVArbHeartBeatRsp(void *buf, int32_t bufLen, SVArbHeartBeatRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->dnodeId) < 0) return -1; + int32_t sz = taosArrayGetSize(pRsp->hbMembers); + if (tEncodeI32(&encoder, sz) < 0) return -1; + for (int32_t i = 0; i < sz; i++) { + SVArbHbRspMember *pMember = taosArrayGet(pRsp->hbMembers, i); + if (tEncodeI32(&encoder, pMember->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pMember->hbSeq) < 0) return -1; + if (tEncodeCStr(&encoder, pMember->memberToken) < 0) return -1; + } + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbHeartBeatRsp(void *buf, int32_t bufLen, SVArbHeartBeatRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->dnodeId) < 0) return -1; + int32_t sz = 0; + if (tDecodeI32(&decoder, &sz) < 0) return -1; + pRsp->hbMembers = taosArrayInit(sz, sizeof(SVArbHbRspMember)); + for (int32_t i = 0; i < sz; i++) { + SVArbHbRspMember hbMember = {0}; + if (tDecodeI32(&decoder, &hbMember.vgId) < 0) return -1; + if (tDecodeI32(&decoder, &hbMember.hbSeq) < 0) return -1; + if (tDecodeCStrTo(&decoder, hbMember.memberToken) < 0) return -1; + taosArrayPush(pRsp->hbMembers, &hbMember); + } + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbHeartBeatRsp(SVArbHeartBeatRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosArrayDestroy(pRsp->hbMembers); +} + +int32_t tSerializeSVArbCheckSyncReq(void *buf, int32_t bufLen, SVArbCheckSyncReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->member0Token) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->member1Token) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbCheckSyncReq(void *buf, int32_t bufLen, SVArbCheckSyncReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + pReq->member0Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->member0Token) < 0) return -1; + pReq->member1Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->member1Token) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbCheckSyncReq(SVArbCheckSyncReq *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->member0Token); + taosMemoryFreeClear(pRsp->member1Token); +} + +int32_t tSerializeSVArbCheckSyncRsp(void *buf, int32_t bufLen, SVArbCheckSyncRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->member0Token) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->member1Token) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->vgId) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->errCode) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbCheckSyncRsp(void *buf, int32_t bufLen, SVArbCheckSyncRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pRsp->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + pRsp->member0Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->member0Token) < 0) return -1; + pRsp->member1Token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->member1Token) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->vgId) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->errCode) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbCheckSyncRsp(SVArbCheckSyncRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->member0Token); + taosMemoryFreeClear(pRsp->member1Token); +} + +int32_t tSerializeSVArbSetAssignedLeaderReq(void *buf, int32_t bufLen, SVArbSetAssignedLeaderReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->arbToken) < 0) return -1; + if (tEncodeI64(&encoder, pReq->arbTerm) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->memberToken) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbSetAssignedLeaderReq(void *buf, int32_t bufLen, SVArbSetAssignedLeaderReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pReq->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->arbToken) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->arbTerm) < 0) return -1; + pReq->memberToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->memberToken) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbSetAssignedLeaderReq(SVArbSetAssignedLeaderReq *pReq) { + if (NULL == pReq) { + return; + } + taosMemoryFreeClear(pReq->arbToken); + taosMemoryFreeClear(pReq->memberToken); +} + +int32_t tSerializeSVArbSetAssignedLeaderRsp(void *buf, int32_t bufLen, SVArbSetAssignedLeaderRsp *pRsp) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->arbToken) < 0) return -1; + if (tEncodeCStr(&encoder, pRsp->memberToken) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->vgId) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSVArbSetAssignedLeaderRsp(void *buf, int32_t bufLen, SVArbSetAssignedLeaderRsp *pRsp) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + pRsp->arbToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->arbToken) < 0) return -1; + pRsp->memberToken = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pRsp->memberToken) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->vgId) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSVArbSetAssignedLeaderRsp(SVArbSetAssignedLeaderRsp *pRsp) { + if (NULL == pRsp) { + return; + } + taosMemoryFreeClear(pRsp->arbToken); + taosMemoryFreeClear(pRsp->memberToken); +} + +int32_t tSerializeSMArbUpdateGroupReq(void *buf, int32_t bufLen, SMArbUpdateGroupReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI64(&encoder, pReq->dbUid) < 0) return -1; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + if (tEncodeI32(&encoder, pReq->members[i].dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->members[i].token) < 0) return -1; + } + if (tEncodeI8(&encoder, pReq->isSync) < 0) return -1; + if (tEncodeI32(&encoder, pReq->assignedLeader.dnodeId) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->assignedLeader.token) < 0) return -1; + if (tEncodeI64(&encoder, pReq->version) < 0) return -1; + + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSMArbUpdateGroupReq(void *buf, int32_t bufLen, SMArbUpdateGroupReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->dbUid) < 0) return -1; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + if (tDecodeI32(&decoder, &pReq->members[i].dnodeId) < 0) return -1; + pReq->members[i].token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->members[i].token) < 0) return -1; + } + if (tDecodeI8(&decoder, &pReq->isSync) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->assignedLeader.dnodeId) < 0) return -1; + pReq->assignedLeader.token = taosMemoryMalloc(TSDB_ARB_TOKEN_SIZE); + if (tDecodeCStrTo(&decoder, pReq->assignedLeader.token) < 0) return -1; + if (tDecodeI64(&decoder, &pReq->version) < 0) return -1; + + tEndDecode(&decoder); + + tDecoderClear(&decoder); + return 0; +} + +void tFreeSMArbUpdateGroupReq(SMArbUpdateGroupReq *pReq) { + if (NULL == pReq) { + return; + } + for (int i = 0; i < 2; i++) { + taosMemoryFreeClear(pReq->members[i].token); + } + taosMemoryFreeClear(pReq->assignedLeader.token); +} + // int32_t tSerializeSAuthReq(void *buf, int32_t bufLen, SAuthReq *pReq) { // SEncoder encoder = {0}; // tEncoderInit(&encoder, buf, bufLen); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c index aa5e87e8b1..393db84e18 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmHandle.c @@ -90,16 +90,6 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) { rpcFreeCont(pRsp->pCont); } -void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) { - int32_t n = 0; - n += snprintf(buf + n, len - n, "%s", "{"); - for (int i = 0; i < epSet->numOfEps; i++) { - n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, - (i + 1 < epSet->numOfEps ? ", " : "")); - } - n += snprintf(buf + n, len - n, "%s", "}"); -} - void dmSendStatusReq(SDnodeMgmt *pMgmt) { SStatusReq req = {0}; diff --git a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h index 24f75e3c8b..bc2977fe31 100644 --- a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h +++ b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h @@ -33,6 +33,7 @@ typedef struct SMnodeMgmt { SSingleWorker fetchWorker; SSingleWorker readWorker; SSingleWorker writeWorker; + SSingleWorker arbWorker; SSingleWorker syncWorker; SSingleWorker syncRdWorker; bool stopped; @@ -53,6 +54,7 @@ int32_t mmProcessDropReq(const SMgmtInputOpt *pInput, SRpcMsg *pMsg); int32_t mmStartWorker(SMnodeMgmt *pMgmt); void mmStopWorker(SMnodeMgmt *pMgmt); int32_t mmPutMsgToWriteQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); +int32_t mmPutMsgToArbQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToSyncRdQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t mmPutMsgToReadQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index a3a5f1d971..7e38b994df 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -235,6 +235,9 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_VND_CREATE_INDEX_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DROP_INDEX_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_DISABLE_WRITE_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_HEARTBEAT_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_CHECK_SYNC_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_ASSIGNED_LEADER_RSP, mmPutMsgToArbQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_TIMEOUT_ELECTION, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_CLIENT_REQUEST, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index bbd77c0828..75d5669824 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -107,6 +107,10 @@ int32_t mmPutMsgToWriteQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { return mmPutMsgToWorker(pMgmt, &pMgmt->writeWorker, pMsg); } +int32_t mmPutMsgToArbQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { + return mmPutMsgToWorker(pMgmt, &pMgmt->arbWorker, pMsg); +} + int32_t mmPutMsgToSyncQueue(SMnodeMgmt *pMgmt, SRpcMsg *pMsg) { return mmPutMsgToWorker(pMgmt, &pMgmt->syncWorker, pMsg); } @@ -153,6 +157,9 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { case READ_QUEUE: pWorker = &pMgmt->readWorker; break; + case ARB_QUEUE: + pWorker = &pMgmt->arbWorker; + break; case SYNC_QUEUE: pWorker = &pMgmt->syncWorker; break; @@ -252,6 +259,18 @@ int32_t mmStartWorker(SMnodeMgmt *pMgmt) { return -1; } + SSingleWorkerCfg arbCfg = { + .min = 1, + .max = 1, + .name = "mnode-arb", + .fp = (FItem)mmProcessRpcMsg, + .param = pMgmt, + }; + if (tSingleWorkerInit(&pMgmt->arbWorker, &arbCfg) != 0) { + dError("failed to start mnode mnode-arb worker since %s", terrstr()); + return -1; + } + dDebug("mnode workers are initialized"); return 0; } @@ -263,6 +282,7 @@ void mmStopWorker(SMnodeMgmt *pMgmt) { tSingleWorkerCleanup(&pMgmt->fetchWorker); tSingleWorkerCleanup(&pMgmt->readWorker); tSingleWorkerCleanup(&pMgmt->writeWorker); + tSingleWorkerCleanup(&pMgmt->arbWorker); tSingleWorkerCleanup(&pMgmt->syncWorker); tSingleWorkerCleanup(&pMgmt->syncRdWorker); dDebug("mnode workers are closed"); diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index d9c368b582..375a34c04f 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -101,6 +101,7 @@ int32_t vmProcessDisableVnodeWriteReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessAlterHashRangeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessAlterVnodeTypeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessCheckLearnCatchupReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); +int32_t vmProcessArbHeartBeatReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); // vmFile.c int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index bfac0bab9d..722eaf1fd3 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -88,7 +88,9 @@ void vmGetMonitorInfo(SVnodeMgmt *pMgmt, SMonVmInfo *pInfo) { numOfInsertSuccessReqs += pLoad->numOfInsertSuccessReqs; numOfBatchInsertReqs += pLoad->numOfBatchInsertReqs; numOfBatchInsertSuccessReqs += pLoad->numOfBatchInsertSuccessReqs; - if (pLoad->syncState == TAOS_SYNC_STATE_LEADER) masterNum++; + if (pLoad->syncState == TAOS_SYNC_STATE_LEADER || pLoad->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + masterNum++; + } totalVnodes++; } @@ -770,6 +772,89 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { return 0; } +int32_t vmProcessArbHeartBeatReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { + SVArbHeartBeatReq arbHbReq = {0}; + SVArbHeartBeatRsp arbHbRsp = {0}; + if (tDeserializeSVArbHeartBeatReq(pMsg->pCont, pMsg->contLen, &arbHbReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + if (arbHbReq.dnodeId != pMgmt->pData->dnodeId) { + terrno = TSDB_CODE_INVALID_MSG; + dError("dnodeId:%d not matched with local dnode", arbHbReq.dnodeId); + goto _OVER; + } + + if (strlen(arbHbReq.arbToken) == 0) { + terrno = TSDB_CODE_INVALID_MSG; + dError("dnodeId:%d arbToken is empty", arbHbReq.dnodeId); + goto _OVER; + } + + size_t size = taosArrayGetSize(arbHbReq.hbMembers); + + arbHbRsp.dnodeId = pMgmt->pData->dnodeId; + strncpy(arbHbRsp.arbToken, arbHbReq.arbToken, TSDB_ARB_TOKEN_SIZE); + arbHbRsp.hbMembers = taosArrayInit(size, sizeof(SVArbHbRspMember)); + + for (int32_t i = 0; i < size; i++) { + SVArbHbReqMember *pReqMember = taosArrayGet(arbHbReq.hbMembers, i); + SVnodeObj *pVnode = vmAcquireVnode(pMgmt, pReqMember->vgId); + if (pVnode == NULL) { + dError("dnodeId:%d vgId:%d not found failed to process arb hb req", arbHbReq.dnodeId, pReqMember->vgId); + continue; + } + + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = pReqMember->vgId; + rspMember.hbSeq = pReqMember->hbSeq; + if (vnodeGetArbToken(pVnode->pImpl, rspMember.memberToken) != 0) { + dError("dnodeId:%d vgId:%d failed to get arb token", arbHbReq.dnodeId, pReqMember->vgId); + vmReleaseVnode(pMgmt, pVnode); + continue; + } + + if (vnodeUpdateArbTerm(pVnode->pImpl, arbHbReq.arbTerm) != 0) { + dError("dnodeId:%d vgId:%d failed to update arb term", arbHbReq.dnodeId, pReqMember->vgId); + vmReleaseVnode(pMgmt, pVnode); + continue; + } + + taosArrayPush(arbHbRsp.hbMembers, &rspMember); + + vmReleaseVnode(pMgmt, pVnode); + } + + SRpcMsg rspMsg = {.info = pMsg->info}; + int32_t rspLen = tSerializeSVArbHeartBeatRsp(NULL, 0, &arbHbRsp); + if (rspLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + void *pRsp = rpcMallocCont(rspLen); + if (pRsp == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + if (tSerializeSVArbHeartBeatRsp(pRsp, rspLen, &arbHbRsp) <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pRsp); + goto _OVER; + } + pMsg->info.rsp = pRsp; + pMsg->info.rspLen = rspLen; + + terrno = TSDB_CODE_SUCCESS; + +_OVER: + tFreeSVArbHeartBeatReq(&arbHbReq); + tFreeSVArbHeartBeatRsp(&arbHbRsp); + return terrno == TSDB_CODE_SUCCESS ? 0 : -1; +} + SArray *vmGetMsgHandles() { int32_t code = -1; SArray *pArray = taosArrayInit(32, sizeof(SMgmtHandle)); @@ -873,6 +958,10 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_PREP_SNAPSHOT_REPLY, vmPutMsgToSyncRdQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_HEARTBEAT, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ARB_CHECK_SYNC, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_ASSIGNED_LEADER, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; + code = 0; _OVER: diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index a6abe5ab4d..e4adfdb6b1 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -56,6 +56,9 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { case TDMT_DND_CHECK_VNODE_LEARNER_CATCHUP: code = vmProcessCheckLearnCatchupReq(pMgmt, pMsg); break; + case TDMT_VND_ARB_HEARTBEAT: + code = vmProcessArbHeartBeatReq(pMgmt, pMsg); + break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; dGError("msg:%p, not processed in vnode-mgmt queue", pMsg); diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 77760b16f4..754c42b82e 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -538,6 +538,7 @@ SMsgCb dmGetMsgcb(SDnode *pDnode) { .releaseHandleFp = dmReleaseHandle, .reportStartupFp = dmReportStartup, .updateDnodeInfoFp = dmUpdateDnodeInfo, + .getDnodeEpFp = dmGetDnodeEp, .data = &pDnode->data, }; return msgCb; diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 2175824acd..0dcb77d9df 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -184,11 +184,13 @@ int32_t dmReadEps(SDnodeData *pData); int32_t dmWriteEps(SDnodeData *pData); void dmUpdateEps(SDnodeData *pData, SArray *pDnodeEps); void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); +void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet); void dmRotateMnodeEpSet(SDnodeData *pData); void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet); void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); bool dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); void dmRemoveDnodePairs(SDnodeData *pData); +void dmGetDnodeEp(void *pData, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 20245c806b..2c341fbd4d 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -31,7 +31,8 @@ static bool dmIsEpChanged(SDnodeData *pData, int32_t dnodeId, const char *ep) static void dmResetEps(SDnodeData *pData, SArray *dnodeEps); static int32_t dmReadDnodePairs(SDnodeData *pData); -static void dmGetDnodeEp(SDnodeData *pData, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) { +void dmGetDnodeEp(void *data, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) { + SDnodeData *pData = data; taosThreadRwlockRdlock(&pData->lock); SDnodeEp *pDnodeEp = taosHashGet(pData->dnodeHash, &dnodeId, sizeof(int32_t)); @@ -335,6 +336,16 @@ void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { taosThreadRwlockUnlock(&pData->lock); } +void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) { + int32_t n = 0; + n += snprintf(buf + n, len - n, "%s", "{"); + for (int i = 0; i < epSet->numOfEps; i++) { + n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port, + (i + 1 < epSet->numOfEps ? ", " : "")); + } + n += snprintf(buf + n, len - n, "%s", "}"); +} + static FORCE_INLINE void dmSwapEps(SEp *epLhs, SEp *epRhs) { SEp epTmp; diff --git a/source/dnode/mnode/impl/inc/mndArbGroup.h b/source/dnode/mnode/impl/inc/mndArbGroup.h new file mode 100644 index 0000000000..ed852cf581 --- /dev/null +++ b/source/dnode/mnode/impl/inc/mndArbGroup.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_MND_ARBGROUP_H_ +#define _TD_MND_ARBGROUP_H_ + +#include "mndInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t mndInitArbGroup(SMnode *pMnode); +void mndCleanupArbGroup(SMnode *pMnode); +SArbGroup *mndAcquireArbGroup(SMnode *pMnode, int32_t vgId); +void mndReleaseArbGroup(SMnode *pMnode, SArbGroup *pObj); +SSdbRaw *mndArbGroupActionEncode(SArbGroup *pGroup); +SSdbRow *mndArbGroupActionDecode(SSdbRaw *pRaw); + +void mndArbGroupInitFromVgObj(SVgObj *pVgObj, SArbGroup *outGroup); + +int32_t mndSetCreateArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup); +int32_t mndSetCreateArbGroupUndoLogs(STrans *pTrans, SArbGroup *pGroup); +int32_t mndSetCreateArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup); + +int32_t mndSetDropArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup); + +bool mndUpdateArbGroupByHeartBeat(SArbGroup *pGroup, SVArbHbRspMember *pRspMember, int64_t nowMs, int32_t dnodeId, + SArbGroup *pNewGroup); +bool mndUpdateArbGroupByCheckSync(SArbGroup *pGroup, int32_t vgId, char *member0Token, char *member1Token, + bool newIsSync, SArbGroup *pNewGroup); +bool mndUpdateArbGroupBySetAssignedLeader(SArbGroup *pGroup, int32_t vgId, char *memberToken, int32_t errcode, + SArbGroup *pNewGroup); + +int32_t mndGetArbGroupSize(SMnode *pMnode); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_ARBGROUP_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index b98ef31d75..eeb3e6fead 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -104,6 +104,7 @@ typedef enum { TRN_CONFLICT_DB_INSIDE = 3, TRN_CONFLICT_TOPIC = 4, TRN_CONFLICT_TOPIC_INSIDE = 5, + TRN_CONFLICT_ARBGROUP = 6, } ETrnConflct; typedef enum { @@ -177,6 +178,7 @@ typedef struct { tmsg_t originRpcType; char dbname[TSDB_TABLE_FNAME_LEN]; char stbname[TSDB_TABLE_FNAME_LEN]; + int32_t arbGroupId; int32_t startFunc; int32_t stopFunc; int32_t paramLen; @@ -248,6 +250,40 @@ typedef struct { SDnodeObj* pDnode; } SSnodeObj; +typedef struct { + int32_t dnodeId; + char token[TSDB_ARB_TOKEN_SIZE]; +} SArbAssignedLeader; + +typedef struct { + int32_t dnodeId; +} SArbMemberInfo; + +typedef struct { + int32_t nextHbSeq; + int32_t responsedHbSeq; + char token[TSDB_ARB_TOKEN_SIZE]; + int64_t lastHbMs; +} SArbMemberState; + +typedef struct { + SArbMemberInfo info; + SArbMemberState state; +} SArbGroupMember; + +typedef struct { + int32_t vgId; + int64_t dbUid; + SArbGroupMember members[TSDB_ARB_GROUP_MEMBER_NUM]; + int8_t isSync; + SArbAssignedLeader assignedLeader; + int64_t version; + + // following fields will not be duplicated + bool mutexInited; + TdThreadMutex mutex; +} SArbGroup; + typedef struct { int32_t maxUsers; int32_t maxDbs; @@ -344,6 +380,7 @@ typedef struct { int32_t walRollPeriod; int64_t walRetentionSize; int64_t walSegmentSize; + int8_t withArbitrator; } SDbCfg; typedef struct { diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index 83c2277612..ab104e316e 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -27,6 +27,7 @@ void mndCleanupDnode(SMnode *pMnode); SDnodeObj *mndAcquireDnode(SMnode *pMnode, int32_t dnodeId); void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode); SEpSet mndGetDnodeEpset(SDnodeObj *pDnode); +SEpSet mndGetDnodeEpsetById(SMnode *pMnode, int32_t dnodeId); int32_t mndGetDnodeSize(SMnode *pMnode); bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs); void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeInfo); diff --git a/source/dnode/mnode/impl/inc/mndTrans.h b/source/dnode/mnode/impl/inc/mndTrans.h index 59eaa915bc..8689df98af 100644 --- a/source/dnode/mnode/impl/inc/mndTrans.h +++ b/source/dnode/mnode/impl/inc/mndTrans.h @@ -78,6 +78,7 @@ int32_t mndTransAppendUndoAction(STrans *pTrans, STransAction *pAction); void mndTransSetRpcRsp(STrans *pTrans, void *pCont, int32_t contLen); void mndTransSetCb(STrans *pTrans, ETrnFunc startFunc, ETrnFunc stopFunc, void *param, int32_t paramLen); void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname); +void mndTransSetArbGroupId(STrans *pTrans, int32_t groupId); void mndTransSetSerial(STrans *pTrans); void mndTransSetParallel(STrans *pTrans); void mndTransSetOper(STrans *pTrans, EOperType oper); diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index b7f6769d12..444c16083c 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -29,6 +29,7 @@ void mndReleaseVgroup(SMnode *pMnode, SVgObj *pVgroup); SSdbRaw *mndVgroupActionEncode(SVgObj *pVgroup); SSdbRow *mndVgroupActionDecode(SSdbRaw *pRaw); SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup); +SEpSet mndGetVgroupEpsetById(SMnode *pMnode, int32_t vgId); int32_t mndGetVnodesNum(SMnode *pMnode, int32_t dnodeId); void mndSortVnodeGid(SVgObj *pVgroup); int64_t mndGetVnodesMemory(SMnode *pMnode, int32_t dnodeId); @@ -44,7 +45,7 @@ int32_t mndAddAlterVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pV int32_t mndAddDropVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, bool isRedo); int32_t mndSetMoveVgroupsInfoToTrans(SMnode *, STrans *pTrans, int32_t dropDnodeId, bool force, bool unsafe); int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, - SArray *pArray); + SArray *pArray, SVgObj* pNewVgroup); int32_t mndBuildCompactVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int64_t compactTs, STimeWindow tw); int32_t mndBuildRaftAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, @@ -54,8 +55,8 @@ void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *p void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid); bool mndVgroupInDnode(SVgObj *pVgroup, int32_t dnodeId); -int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, - SDnodeObj *pDnode); +int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *db, SVgObj *pVgroup, + SDnodeObj *pDnode); int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgroup); diff --git a/source/dnode/mnode/impl/src/mndArbGroup.c b/source/dnode/mnode/impl/src/mndArbGroup.c new file mode 100644 index 0000000000..7193058e80 --- /dev/null +++ b/source/dnode/mnode/impl/src/mndArbGroup.c @@ -0,0 +1,1086 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#define _DEFAULT_SOURCE +#include "mndArbGroup.h" +#include "audit.h" +#include "mndDb.h" +#include "mndDnode.h" +#include "mndPrivilege.h" +#include "mndShow.h" +#include "mndTrans.h" +#include "mndUser.h" +#include "mndVgroup.h" + +#define ARBGROUP_VER_NUMBER 1 +#define ARBGROUP_RESERVE_SIZE 64 + +static int32_t mndArbGroupActionInsert(SSdb *pSdb, SArbGroup *pGroup); +static int32_t mndArbGroupActionUpdate(SSdb *pSdb, SArbGroup *pOld, SArbGroup *pNew); +static int32_t mndArbGroupActionDelete(SSdb *pSdb, SArbGroup *pGroup); + +static void mndArbGroupDupObj(SArbGroup *pGroup, SArbGroup *pNew); +static void mndArbGroupSetAssignedLeader(SArbGroup *pGroup, int32_t index); +static void mndArbGroupResetAssignedLeader(SArbGroup *pGroup); + +static int32_t mndArbGroupUpdateTrans(SMnode *pMnode, SArbGroup *pNew); +static int32_t mndPullupArbUpdateGroup(SMnode *pMnode, SArbGroup *pNewGroup); + +static int32_t mndProcessArbHbTimer(SRpcMsg *pReq); +static int32_t mndProcessArbCheckSyncTimer(SRpcMsg *pReq); +static int32_t mndProcessArbUpdateGroupReq(SRpcMsg *pReq); +static int32_t mndProcessArbHbRsp(SRpcMsg *pRsp); +static int32_t mndProcessArbCheckSyncRsp(SRpcMsg *pRsp); +static int32_t mndProcessArbSetAssignedLeaderRsp(SRpcMsg *pRsp); +static int32_t mndRetrieveArbGroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); +static void mndCancelGetNextArbGroup(SMnode *pMnode, void *pIter); + +static int32_t mndArbCheckToken(const char *token1, const char *token2) { + if (token1 == NULL || token2 == NULL) return -1; + if (strlen(token1) == 0 || strlen(token2) == 0) return -1; + return strncmp(token1, token2, TSDB_ARB_TOKEN_SIZE); +} + +int32_t mndInitArbGroup(SMnode *pMnode) { + SSdbTable table = { + .sdbType = SDB_ARBGROUP, + .keyType = SDB_KEY_INT32, + .encodeFp = (SdbEncodeFp)mndArbGroupActionEncode, + .decodeFp = (SdbDecodeFp)mndArbGroupActionDecode, + .insertFp = (SdbInsertFp)mndArbGroupActionInsert, + .updateFp = (SdbUpdateFp)mndArbGroupActionUpdate, + .deleteFp = (SdbDeleteFp)mndArbGroupActionDelete, + }; + + mndSetMsgHandle(pMnode, TDMT_MND_ARB_HEARTBEAT_TIMER, mndProcessArbHbTimer); + mndSetMsgHandle(pMnode, TDMT_MND_ARB_CHECK_SYNC_TIMER, mndProcessArbCheckSyncTimer); + mndSetMsgHandle(pMnode, TDMT_MND_ARB_UPDATE_GROUP, mndProcessArbUpdateGroupReq); + mndSetMsgHandle(pMnode, TDMT_VND_ARB_HEARTBEAT_RSP, mndProcessArbHbRsp); + mndSetMsgHandle(pMnode, TDMT_VND_ARB_CHECK_SYNC_RSP, mndProcessArbCheckSyncRsp); + mndSetMsgHandle(pMnode, TDMT_SYNC_SET_ASSIGNED_LEADER_RSP, mndProcessArbSetAssignedLeaderRsp); + + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_ARBGROUP, mndRetrieveArbGroups); + mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_ARBGROUP, mndCancelGetNextArbGroup); + + return sdbSetTable(pMnode->pSdb, table); +} + +void mndCleanupArbGroup(SMnode *pMnode) {} + +SArbGroup *mndAcquireArbGroup(SMnode *pMnode, int32_t vgId) { + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &vgId); + if (pGroup == NULL && terrno == TSDB_CODE_SDB_OBJ_NOT_THERE) { + terrno = TSDB_CODE_MND_ARBGROUP_NOT_EXIST; + } + return pGroup; +} + +void mndReleaseArbGroup(SMnode *pMnode, SArbGroup *pGroup) { + SSdb *pSdb = pMnode->pSdb; + sdbRelease(pSdb, pGroup); +} + +void mndArbGroupInitFromVgObj(SVgObj *pVgObj, SArbGroup *outGroup) { + ASSERT(pVgObj->replica == 2); + memset(outGroup, 0, sizeof(SArbGroup)); + outGroup->dbUid = pVgObj->dbUid; + outGroup->vgId = pVgObj->vgId; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &outGroup->members[i]; + pMember->info.dnodeId = pVgObj->vnodeGid[i].dnodeId; + } +} + +SSdbRaw *mndArbGroupActionEncode(SArbGroup *pGroup) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + + int32_t size = sizeof(SArbGroup) + ARBGROUP_RESERVE_SIZE; + SSdbRaw *pRaw = sdbAllocRaw(SDB_ARBGROUP, ARBGROUP_VER_NUMBER, size); + if (pRaw == NULL) goto _OVER; + + int32_t dataPos = 0; + SDB_SET_INT32(pRaw, dataPos, pGroup->vgId, _OVER) + SDB_SET_INT64(pRaw, dataPos, pGroup->dbUid, _OVER) + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + SDB_SET_INT32(pRaw, dataPos, pMember->info.dnodeId, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pMember->state.token, TSDB_ARB_TOKEN_SIZE, _OVER) + } + SDB_SET_INT8(pRaw, dataPos, pGroup->isSync, _OVER) + + SArbAssignedLeader *pLeader = &pGroup->assignedLeader; + SDB_SET_INT32(pRaw, dataPos, pLeader->dnodeId, _OVER) + SDB_SET_BINARY(pRaw, dataPos, pLeader->token, TSDB_ARB_TOKEN_SIZE, _OVER) + SDB_SET_INT64(pRaw, dataPos, pGroup->version, _OVER) + + SDB_SET_RESERVE(pRaw, dataPos, ARBGROUP_RESERVE_SIZE, _OVER) + + terrno = 0; + +_OVER: + if (terrno != 0) { + mError("arbgroup:%d, failed to encode to raw:%p since %s", pGroup->vgId, pRaw, terrstr()); + sdbFreeRaw(pRaw); + return NULL; + } + + mTrace("arbgroup:%d, encode to raw:%p, row:%p", pGroup->vgId, pRaw, pGroup); + return pRaw; +} + +SSdbRow *mndArbGroupActionDecode(SSdbRaw *pRaw) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + SSdbRow *pRow = NULL; + SArbGroup *pGroup = NULL; + + int8_t sver = 0; + if (sdbGetRawSoftVer(pRaw, &sver) != 0) goto _OVER; + + if (sver != ARBGROUP_VER_NUMBER) { + terrno = TSDB_CODE_SDB_INVALID_DATA_VER; + goto _OVER; + } + + pRow = sdbAllocRow(sizeof(SArbGroup)); + if (pRow == NULL) goto _OVER; + + pGroup = sdbGetRowObj(pRow); + if (pGroup == NULL) goto _OVER; + + int32_t dataPos = 0; + SDB_GET_INT32(pRaw, dataPos, &pGroup->vgId, _OVER) + SDB_GET_INT64(pRaw, dataPos, &pGroup->dbUid, _OVER) + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + SDB_GET_INT32(pRaw, dataPos, &pMember->info.dnodeId, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pMember->state.token, TSDB_ARB_TOKEN_SIZE, _OVER) + + pMember->state.nextHbSeq = 0; + pMember->state.responsedHbSeq = -1; + pMember->state.lastHbMs = 0; + } + SDB_GET_INT8(pRaw, dataPos, &pGroup->isSync, _OVER) + + SArbAssignedLeader *pLeader = &pGroup->assignedLeader; + SDB_GET_INT32(pRaw, dataPos, &pLeader->dnodeId, _OVER) + SDB_GET_BINARY(pRaw, dataPos, pLeader->token, TSDB_ARB_TOKEN_SIZE, _OVER) + SDB_GET_INT64(pRaw, dataPos, &pGroup->version, _OVER) + + pGroup->mutexInited = false; + + SDB_GET_RESERVE(pRaw, dataPos, ARBGROUP_RESERVE_SIZE, _OVER) + + terrno = 0; + +_OVER: + if (terrno != 0) { + mError("arbgroup:%d, failed to decode from raw:%p since %s", pGroup == NULL ? 0 : pGroup->vgId, pRaw, terrstr()); + taosMemoryFreeClear(pRow); + return NULL; + } + + mTrace("arbgroup:%d, decode from raw:%p, row:%p", pGroup->vgId, pRaw, pGroup); + return pRow; +} + +static int32_t mndArbGroupActionInsert(SSdb *pSdb, SArbGroup *pGroup) { + mTrace("arbgroup:%d, perform insert action, row:%p", pGroup->vgId, pGroup); + if (!pGroup->mutexInited && (taosThreadMutexInit(&pGroup->mutex, NULL) == 0)) { + pGroup->mutexInited = true; + } + + return pGroup->mutexInited ? 0 : -1; +} + +static int32_t mndArbGroupActionDelete(SSdb *pSdb, SArbGroup *pGroup) { + mTrace("arbgroup:%d, perform delete action, row:%p", pGroup->vgId, pGroup); + if (pGroup->mutexInited) { + taosThreadMutexDestroy(&pGroup->mutex); + pGroup->mutexInited = false; + } + return 0; +} + +static int32_t mndArbGroupActionUpdate(SSdb *pSdb, SArbGroup *pOld, SArbGroup *pNew) { + mTrace("arbgroup:%d, perform update action, old row:%p new row:%p", pOld->vgId, pOld, pNew); + taosThreadMutexLock(&pOld->mutex); + + if (pOld->version != pNew->version) { + mInfo("arbgroup:%d, skip to perform update action, old row:%p new row:%p, old version:%" PRId64 + " new version:%" PRId64, + pOld->vgId, pOld, pNew, pOld->version, pNew->version); + taosThreadMutexUnlock(&pOld->mutex); + return 0; + } + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + memcpy(pOld->members[i].state.token, pNew->members[i].state.token, TSDB_ARB_TOKEN_SIZE); + } + pOld->isSync = pNew->isSync; + pOld->assignedLeader.dnodeId = pNew->assignedLeader.dnodeId; + memcpy(pOld->assignedLeader.token, pNew->assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + pOld->version++; + taosThreadMutexUnlock(&pOld->mutex); + return 0; +} + +int32_t mndSetCreateArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pRedoRaw = mndArbGroupActionEncode(pGroup); + if (pRedoRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; + if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_CREATING) != 0) return -1; + return 0; +} + +int32_t mndSetCreateArbGroupUndoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pUndoRaw = mndArbGroupActionEncode(pGroup); + if (pUndoRaw == NULL) return -1; + if (mndTransAppendUndolog(pTrans, pUndoRaw) != 0) return -1; + if (sdbSetRawStatus(pUndoRaw, SDB_STATUS_DROPPED) != 0) return -1; + return 0; +} + +int32_t mndSetCreateArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pCommitRaw = mndArbGroupActionEncode(pGroup); + if (pCommitRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; + if (sdbSetRawStatus(pCommitRaw, SDB_STATUS_READY) != 0) return -1; + return 0; +} + +static int32_t mndSetDropArbGroupRedoLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pRedoRaw = mndArbGroupActionEncode(pGroup); + if (pRedoRaw == NULL) return -1; + if (mndTransAppendRedolog(pTrans, pRedoRaw) != 0) return -1; + if (sdbSetRawStatus(pRedoRaw, SDB_STATUS_DROPPING) != 0) return -1; + return 0; +} + +int32_t mndSetDropArbGroupCommitLogs(STrans *pTrans, SArbGroup *pGroup) { + SSdbRaw *pCommitRaw = mndArbGroupActionEncode(pGroup); + if (pCommitRaw == NULL) return -1; + if (mndTransAppendCommitlog(pTrans, pCommitRaw) != 0) return -1; + if (sdbSetRawStatus(pCommitRaw, SDB_STATUS_DROPPED) != 0) return -1; + return 0; +} + +static void *mndBuildArbHeartBeatReq(int32_t *pContLen, char *arbToken, int32_t dnodeId, int64_t arbTerm, + SArray *hbMembers) { + SVArbHeartBeatReq req = {0}; + req.dnodeId = dnodeId; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.hbMembers = hbMembers; + + int32_t contLen = tSerializeSVArbHeartBeatReq(NULL, 0, &req); + if (contLen <= 0) return NULL; + + void *pReq = rpcMallocCont(contLen); + if (pReq == NULL) return NULL; + + if (tSerializeSVArbHeartBeatReq(pReq, contLen, &req) <= 0) { + rpcFreeCont(pReq); + return NULL; + } + *pContLen = contLen; + return pReq; +} + +static int32_t mndSendArbHeartBeatReq(SDnodeObj *pDnode, char *arbToken, int64_t arbTerm, SArray *hbMembers) { + int32_t contLen = 0; + void *pHead = mndBuildArbHeartBeatReq(&contLen, arbToken, pDnode->id, arbTerm, hbMembers); + if (pHead == NULL) { + mError("dnodeId:%d, failed to build arb-hb request", pDnode->id); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_VND_ARB_HEARTBEAT, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetDnodeEpset(pDnode); + if (epSet.numOfEps == 0) { + mError("dnodeId:%d, failed to send arb-hb request to dnode since no epSet found", pDnode->id); + rpcFreeCont(pHead); + return -1; + } + + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("dnodeId:%d, failed to send arb-hb request to dnode since 0x%x", pDnode->id, code); + } else { + mTrace("dnodeId:%d, send arb-hb request to dnode", pDnode->id); + } + return code; +} + +static int32_t mndProcessArbHbTimer(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SArbGroup *pArbGroup = NULL; + void *pIter = NULL; + + SHashObj *pDnodeHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), false, HASH_NO_LOCK); + + // collect member of same dnode + while (1) { + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + taosThreadMutexLock(&pArbGroup->mutex); + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pArbGroup->members[i]; + int32_t dnodeId = pMember->info.dnodeId; + void *pObj = taosHashGet(pDnodeHash, &dnodeId, sizeof(int32_t)); + SArray *hbMembers = NULL; + if (pObj) { + hbMembers = *(SArray **)pObj; + } else { + hbMembers = taosArrayInit(16, sizeof(SVArbHbReqMember)); + taosHashPut(pDnodeHash, &dnodeId, sizeof(int32_t), &hbMembers, POINTER_BYTES); + } + SVArbHbReqMember reqMember = {.vgId = pArbGroup->vgId, .hbSeq = pMember->state.nextHbSeq++}; + taosArrayPush(hbMembers, &reqMember); + } + + taosThreadMutexUnlock(&pArbGroup->mutex); + sdbRelease(pSdb, pArbGroup); + } + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-hb timer"); + pIter = taosHashIterate(pDnodeHash, NULL); + while (pIter) { + SArray *hbMembers = *(SArray **)pIter; + taosArrayDestroy(hbMembers); + pIter = taosHashIterate(pDnodeHash, pIter); + } + taosHashCleanup(pDnodeHash); + return -1; + } + + int64_t nowMs = taosGetTimestampMs(); + + pIter = NULL; + while (1) { + pIter = taosHashIterate(pDnodeHash, pIter); + if (pIter == NULL) break; + + int32_t dnodeId = *(int32_t *)taosHashGetKey(pIter, NULL); + SArray *hbMembers = *(SArray **)pIter; + + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (pDnode == NULL) { + mError("dnodeId:%d, timer failed to send arb-hb request, failed find dnode", dnodeId); + taosArrayDestroy(hbMembers); + continue; + } + + int64_t mndTerm = mndGetTerm(pMnode); + + if (mndIsDnodeOnline(pDnode, nowMs)) { + (void)mndSendArbHeartBeatReq(pDnode, arbToken, mndTerm, hbMembers); + } + + mndReleaseDnode(pMnode, pDnode); + taosArrayDestroy(hbMembers); + } + taosHashCleanup(pDnodeHash); + + return 0; +} + +static void *mndBuildArbCheckSyncReq(int32_t *pContLen, int32_t vgId, char *arbToken, int64_t arbTerm, + char *member0Token, char *member1Token) { + SVArbCheckSyncReq req = {0}; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.member0Token = member0Token; + req.member1Token = member1Token; + + int32_t reqLen = tSerializeSVArbCheckSyncReq(NULL, 0, &req); + int32_t contLen = reqLen + sizeof(SMsgHead); + + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(vgId); + if (tSerializeSVArbCheckSyncReq((char *)pHead + sizeof(SMsgHead), contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndSendArbCheckSyncReq(SMnode *pMnode, int32_t vgId, char *arbToken, int64_t term, char *member0Token, + char *member1Token) { + int32_t contLen = 0; + void *pHead = mndBuildArbCheckSyncReq(&contLen, vgId, arbToken, term, member0Token, member1Token); + if (!pHead) { + mError("vgId:%d, failed to build check-sync request", vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_VND_ARB_CHECK_SYNC, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetVgroupEpsetById(pMnode, vgId); + if (epSet.numOfEps == 0) { + mError("vgId:%d, failed to send check-sync request since no epSet found", vgId); + rpcFreeCont(pHead); + return -1; + } + + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("vgId:%d, failed to send check-sync request since 0x%x", vgId, code); + } else { + mDebug("vgId:%d, send check-sync request", vgId); + } + return code; +} + +static bool mndCheckArbMemberHbTimeout(SArbGroup *pArbGroup, int32_t index, int64_t nowMs) { + SArbGroupMember *pArbMember = &pArbGroup->members[index]; + return pArbMember->state.lastHbMs < (nowMs - tsArbSetAssignedTimeoutSec * 1000); +} + +static void *mndBuildArbSetAssignedLeaderReq(int32_t *pContLen, int32_t vgId, char *arbToken, int64_t arbTerm, + char *memberToken) { + SVArbSetAssignedLeaderReq req = {0}; + req.arbToken = arbToken; + req.arbTerm = arbTerm; + req.memberToken = memberToken; + + int32_t reqLen = tSerializeSVArbSetAssignedLeaderReq(NULL, 0, &req); + int32_t contLen = reqLen + sizeof(SMsgHead); + + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(vgId); + if (tSerializeSVArbSetAssignedLeaderReq((char *)pHead + sizeof(SMsgHead), contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndSendArbSetAssignedLeaderReq(SMnode *pMnode, int32_t dnodeId, int32_t vgId, char *arbToken, + int64_t term, char *memberToken) { + int32_t contLen = 0; + void *pHead = mndBuildArbSetAssignedLeaderReq(&contLen, vgId, arbToken, term, memberToken); + if (!pHead) { + mError("vgId:%d, failed to build set-assigned request", vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_SYNC_SET_ASSIGNED_LEADER, .pCont = pHead, .contLen = contLen}; + + SEpSet epSet = mndGetDnodeEpsetById(pMnode, dnodeId); + if (epSet.numOfEps == 0) { + mError("dnodeId:%d vgId:%d, failed to send arb-set-assigned request to dnode since no epSet found", dnodeId, vgId); + rpcFreeCont(pHead); + return -1; + } + int32_t code = tmsgSendReq(&epSet, &rpcMsg); + if (code != 0) { + mError("dnodeId:%d vgId:%d, failed to send arb-set-assigned request to dnode since 0x%x", dnodeId, vgId, code); + } else { + mInfo("dnodeId:%d vgId:%d, send arb-set-assigned request to dnode", dnodeId, vgId); + } + return code; +} + +static int32_t mndProcessArbCheckSyncTimer(SRpcMsg *pReq) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SArbGroup *pArbGroup = NULL; + SArbGroup arbGroupDup = {0}; + void *pIter = NULL; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-check-sync timer"); + return -1; + } + int64_t term = mndGetTerm(pMnode); + if (term < 0) { + mError("arb failed to get term since %s", terrstr()); + return -1; + } + + while (1) { + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + taosThreadMutexLock(&pArbGroup->mutex); + mndArbGroupDupObj(pArbGroup, &arbGroupDup); + taosThreadMutexUnlock(&pArbGroup->mutex); + + int32_t vgId = arbGroupDup.vgId; + int64_t nowMs = taosGetTimestampMs(); + + bool member0IsTimeout = mndCheckArbMemberHbTimeout(&arbGroupDup, 0, nowMs); + bool member1IsTimeout = mndCheckArbMemberHbTimeout(&arbGroupDup, 1, nowMs); + int32_t currentAssignedDnodeId = arbGroupDup.assignedLeader.dnodeId; + + // 1. both of the two members are timeout => skip + if (member0IsTimeout && member1IsTimeout) { + sdbRelease(pSdb, pArbGroup); + continue; + } + + // 2. no member is timeout => check sync + if (member0IsTimeout == false && member1IsTimeout == false) { + // no assigned leader and not sync + if (currentAssignedDnodeId == 0 && !arbGroupDup.isSync) { + (void)mndSendArbCheckSyncReq(pMnode, arbGroupDup.vgId, arbToken, term, arbGroupDup.members[0].state.token, + arbGroupDup.members[1].state.token); + } + sdbRelease(pSdb, pArbGroup); + continue; + } + + // 3. one of the members is timeout => set assigned leader + int32_t candidateIndex = member0IsTimeout ? 1 : 0; + SArbGroupMember *pMember = &arbGroupDup.members[candidateIndex]; + + // has assigned leader and dnodeId not match => skip + if (currentAssignedDnodeId != 0 && currentAssignedDnodeId != pMember->info.dnodeId) { + mInfo("arb skip to set assigned leader to vgId:%d dnodeId:%d, assigned leader has been set to dnodeId:%d", vgId, + pMember->info.dnodeId, currentAssignedDnodeId); + sdbRelease(pSdb, pArbGroup); + continue; + } + + // not sync => skip + if (arbGroupDup.isSync == false) { + if (currentAssignedDnodeId == pMember->info.dnodeId) { + mDebug("arb skip to set assigned leader to vgId:%d dnodeId:%d, arb group is not sync", vgId, + pMember->info.dnodeId); + } else { + mInfo("arb skip to set assigned leader to vgId:%d dnodeId:%d, arb group is not sync", vgId, + pMember->info.dnodeId); + } + sdbRelease(pSdb, pArbGroup); + continue; + } + + // no assigned leader => write to sdb + if (currentAssignedDnodeId == 0) { + SArbGroup newGroup = {0}; + mndArbGroupDupObj(&arbGroupDup, &newGroup); + mndArbGroupSetAssignedLeader(&newGroup, candidateIndex); + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mError("vgId:%d, arb failed to pullup set assigned leader to dnodeId:%d, since %s", vgId, pMember->info.dnodeId, + terrstr()); + sdbRelease(pSdb, pArbGroup); + return -1; + } + + mInfo("vgId:%d, arb pull up set assigned leader to dnodeId:%d", vgId, pMember->info.dnodeId); + sdbRelease(pSdb, pArbGroup); + continue; + } + + // isSync == true && dnodeId match => send request to dnode + (void)mndSendArbSetAssignedLeaderReq(pMnode, pMember->info.dnodeId, vgId, arbToken, term, pMember->state.token); + mInfo("vgId:%d, arb send set assigned leader to dnodeId:%d", vgId, pMember->info.dnodeId); + + sdbRelease(pSdb, pArbGroup); + } + + return 0; +} + +static void *mndBuildArbUpdateGroupReq(int32_t *pContLen, SArbGroup *pNewGroup) { + SMArbUpdateGroupReq req = {0}; + req.vgId = pNewGroup->vgId; + req.dbUid = pNewGroup->dbUid; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + req.members[i].dnodeId = pNewGroup->members[i].info.dnodeId; + req.members[i].token = pNewGroup->members[i].state.token; + } + req.isSync = pNewGroup->isSync; + req.assignedLeader.dnodeId = pNewGroup->assignedLeader.dnodeId; + req.assignedLeader.token = pNewGroup->assignedLeader.token; + req.version = pNewGroup->version; + + int32_t contLen = tSerializeSMArbUpdateGroupReq(NULL, 0, &req); + if (contLen <= 0) return NULL; + SMsgHead *pHead = rpcMallocCont(contLen); + if (pHead == NULL) return NULL; + + if (tSerializeSMArbUpdateGroupReq(pHead, contLen, &req) <= 0) { + rpcFreeCont(pHead); + return NULL; + } + *pContLen = contLen; + return pHead; +} + +static int32_t mndPullupArbUpdateGroup(SMnode *pMnode, SArbGroup *pNewGroup) { + int32_t contLen = 0; + void *pHead = mndBuildArbUpdateGroupReq(&contLen, pNewGroup); + if (!pHead) { + mError("vgId:%d, failed to build arb-update-group request", pNewGroup->vgId); + return -1; + } + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_UPDATE_GROUP, .pCont = pHead, .contLen = contLen, .info.noResp = true}; + + return tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); +} + +static int32_t mndProcessArbUpdateGroupReq(SRpcMsg *pReq) { + int ret = 0; + + SMArbUpdateGroupReq req = {0}; + tDeserializeSMArbUpdateGroupReq(pReq->pCont, pReq->contLen, &req); + + SArbGroup newGroup = {0}; + newGroup.vgId = req.vgId; + newGroup.dbUid = req.dbUid; + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + newGroup.members[i].info.dnodeId = req.members[i].dnodeId; + memcpy(newGroup.members[i].state.token, req.members[i].token, TSDB_ARB_TOKEN_SIZE); + } + + newGroup.isSync = req.isSync; + newGroup.assignedLeader.dnodeId = req.assignedLeader.dnodeId; + memcpy(newGroup.assignedLeader.token, req.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + newGroup.version = req.version; + + SMnode *pMnode = pReq->info.node; + if (mndArbGroupUpdateTrans(pMnode, &newGroup) != 0) { + mError("vgId:%d, arb failed to update arbgroup, since %s", req.vgId, terrstr()); + ret = -1; + } + + tFreeSMArbUpdateGroupReq(&req); + return ret; +} + +static void mndArbGroupDupObj(SArbGroup *pGroup, SArbGroup *pNew) { + memcpy(pNew, pGroup, offsetof(SArbGroup, mutexInited)); +} + +static void mndArbGroupSetAssignedLeader(SArbGroup *pGroup, int32_t index) { + SArbGroupMember *pMember = &pGroup->members[index]; + + pGroup->assignedLeader.dnodeId = pMember->info.dnodeId; + strncpy(pGroup->assignedLeader.token, pMember->state.token, TSDB_ARB_TOKEN_SIZE); +} + +static void mndArbGroupResetAssignedLeader(SArbGroup *pGroup) { + pGroup->assignedLeader.dnodeId = 0; + memset(pGroup->assignedLeader.token, 0, TSDB_ARB_TOKEN_SIZE); +} + +static int32_t mndArbGroupUpdateTrans(SMnode *pMnode, SArbGroup *pNew) { + int32_t ret = -1; + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, TRN_CONFLICT_ARBGROUP, NULL, "update-arbgroup"); + if (pTrans == NULL) { + mError("failed to update arbgroup in create trans, vgId:%d, since %s", pNew->vgId, terrstr()); + goto _OVER; + } + + mInfo("trans:%d, used to update arbgroup:%d, member0:[%d][%s] member1:[%d][%s] isSync:%d assigned:[%d][%s]", + pTrans->id, pNew->vgId, pNew->members[0].info.dnodeId, pNew->members[0].state.token, + pNew->members[1].info.dnodeId, pNew->members[1].state.token, pNew->isSync, pNew->assignedLeader.dnodeId, + pNew->assignedLeader.token); + + mndTransSetArbGroupId(pTrans, pNew->vgId); + if (mndTransCheckConflict(pMnode, pTrans) != 0) { + ret = -1; + goto _OVER; + } + + if (mndSetCreateArbGroupCommitLogs(pTrans, pNew) != 0) { + mError("failed to update arbgroup in set commit log, vgId:%d, since %s", pNew->vgId, terrstr()); + goto _OVER; + } + + if (mndTransPrepare(pMnode, pTrans) != 0) goto _OVER; + + ret = 0; + +_OVER: + mndTransDrop(pTrans); + return ret; +} + +bool mndUpdateArbGroupByHeartBeat(SArbGroup *pGroup, SVArbHbRspMember *pRspMember, int64_t nowMs, int32_t dnodeId, + SArbGroup *pNewGroup) { + bool updateToken = false; + SArbGroupMember *pMember = NULL; + + taosThreadMutexLock(&pGroup->mutex); + + int index = 0; + for (; index < TSDB_ARB_GROUP_MEMBER_NUM; index++) { + pMember = &pGroup->members[index]; + if (pMember->info.dnodeId == dnodeId) { + break; + } + pMember = NULL; + } + + if (pMember == NULL) { + mInfo("dnodeId:%d vgId:%d, arb token update check failed, no obj found", dnodeId, pRspMember->vgId); + goto _OVER; + } + + if (pMember->state.responsedHbSeq >= pRspMember->hbSeq) { + // skip + mInfo("dnodeId:%d vgId:%d, skip arb token update, heart beat seq expired, local:%d msg:%d", dnodeId, + pRspMember->vgId, pMember->state.responsedHbSeq, pRspMember->hbSeq); + goto _OVER; + } + + // update hb state + pMember->state.responsedHbSeq = pRspMember->hbSeq; + pMember->state.lastHbMs = nowMs; + if (mndArbCheckToken(pMember->state.token, pRspMember->memberToken) == 0) { + // skip + mDebug("dnodeId:%d vgId:%d, skip arb token update, token matched", dnodeId, pRspMember->vgId); + goto _OVER; + } + + // update token + mndArbGroupDupObj(pGroup, pNewGroup); + memcpy(pNewGroup->members[index].state.token, pRspMember->memberToken, TSDB_ARB_TOKEN_SIZE); + pNewGroup->isSync = false; + + bool resetAssigned = false; + if (pMember->info.dnodeId == pGroup->assignedLeader.dnodeId) { + mndArbGroupResetAssignedLeader(pNewGroup); + resetAssigned = true; + } + + updateToken = true; + mInfo("dnodeId:%d vgId:%d, arb token updating, resetAssigned:%d", dnodeId, pRspMember->vgId, resetAssigned); + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateToken; +} + +static int32_t mndUpdateArbHeartBeat(SMnode *pMnode, int32_t dnodeId, SArray *memberArray) { + int ret = 0; + int64_t nowMs = taosGetTimestampMs(); + + size_t size = taosArrayGetSize(memberArray); + for (size_t i = 0; i < size; i++) { + SVArbHbRspMember *pRspMember = taosArrayGet(memberArray, i); + + SArbGroup newGroup = {0}; + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &pRspMember->vgId); + if (pGroup == NULL) { + mInfo("failed to update arb token, vgId:%d not found", pRspMember->vgId); + continue; + } + + bool updateToken = mndUpdateArbGroupByHeartBeat(pGroup, pRspMember, nowMs, dnodeId, &newGroup); + if (updateToken) { + ret = mndPullupArbUpdateGroup(pMnode, &newGroup); + if (ret != 0) { + mInfo("failed to pullup update arb token, vgId:%d, since %s", pRspMember->vgId, terrstr()); + } + } + + sdbRelease(pMnode->pSdb, pGroup); + if (ret != 0) break; + } + + return ret; +} + +bool mndUpdateArbGroupByCheckSync(SArbGroup *pGroup, int32_t vgId, char *member0Token, char *member1Token, + bool newIsSync, SArbGroup *pNewGroup) { + bool updateIsSync = false; + + taosThreadMutexLock(&pGroup->mutex); + + if (pGroup->assignedLeader.dnodeId != 0) { + terrno = TSDB_CODE_SUCCESS; + mInfo("skip to update arb sync, vgId:%d has assigned leader:%d", vgId, pGroup->assignedLeader.dnodeId); + goto _OVER; + } + + char *local0Token = pGroup->members[0].state.token; + char *local1Token = pGroup->members[1].state.token; + if (mndArbCheckToken(local0Token, member0Token) != 0 || mndArbCheckToken(local1Token, member1Token) != 0) { + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + mInfo("skip to update arb sync, memberToken mismatch local:[%s][%s], msg:[%s][%s]", local0Token, local1Token, + member0Token, member1Token); + goto _OVER; + } + + if (pGroup->isSync != newIsSync) { + mndArbGroupDupObj(pGroup, pNewGroup); + pNewGroup->isSync = newIsSync; + + mInfo("vgId:%d, arb isSync updating, new isSync:%d", vgId, newIsSync); + updateIsSync = true; + } + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateIsSync; +} + +static int32_t mndUpdateArbSync(SMnode *pMnode, int32_t vgId, char *member0Token, char *member1Token, bool newIsSync) { + SArbGroup *pGroup = sdbAcquire(pMnode->pSdb, SDB_ARBGROUP, &vgId); + if (pGroup == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + mInfo("failed to update arb sync, vgId:%d not found", vgId); + return -1; + } + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(pGroup, vgId, member0Token, member1Token, newIsSync, &newGroup); + if (updateIsSync) { + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mInfo("failed to pullup update arb sync, vgId:%d, since %s", vgId, terrstr()); + } + } + + sdbRelease(pMnode->pSdb, pGroup); + return 0; +} + +static int32_t mndProcessArbHbRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-hb response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbHeartBeatRsp arbHbRsp = {0}; + if (tDeserializeSVArbHeartBeatRsp(pRsp->pCont, pRsp->contLen, &arbHbRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + if (mndArbCheckToken(arbToken, arbHbRsp.arbToken) != 0) { + mInfo("arb hearbeat skip update for dnodeId:%d, arb token mismatch, local:[%s] msg:[%s]", arbHbRsp.dnodeId, + arbToken, arbHbRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + (void)mndUpdateArbHeartBeat(pMnode, arbHbRsp.dnodeId, arbHbRsp.hbMembers); + ret = 0; + +_OVER: + tFreeSVArbHeartBeatRsp(&arbHbRsp); + return ret; +} + +static int32_t mndProcessArbCheckSyncRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-check-sync response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbCheckSyncRsp syncRsp = {0}; + if (tDeserializeSVArbCheckSyncRsp(pRsp->pCont, pRsp->contLen, &syncRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + mInfo("arb sync check failed, since:%s", tstrerror(pRsp->code)); + return -1; + } + + if (mndArbCheckToken(arbToken, syncRsp.arbToken) != 0) { + mInfo("skip update arb sync for vgId:%d, arb token mismatch, local:[%s] msg:[%s]", syncRsp.vgId, arbToken, + syncRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + bool newIsSync = (syncRsp.errCode == TSDB_CODE_SUCCESS); + if (mndUpdateArbSync(pMnode, syncRsp.vgId, syncRsp.member0Token, syncRsp.member1Token, newIsSync) != 0) { + mInfo("failed to update arb sync for vgId:%d, since:%s", syncRsp.vgId, terrstr()); + goto _OVER; + } + + ret = 0; + +_OVER: + tFreeSVArbCheckSyncRsp(&syncRsp); + return ret; +} + +bool mndUpdateArbGroupBySetAssignedLeader(SArbGroup *pGroup, int32_t vgId, char *memberToken, int32_t errcode, + SArbGroup *pNewGroup) { + bool updateAssigned = false; + + taosThreadMutexLock(&pGroup->mutex); + if (mndArbCheckToken(pGroup->assignedLeader.token, memberToken) != 0) { + mInfo("skip update arb assigned for vgId:%d, member token mismatch, local:[%s] msg:[%s]", vgId, + pGroup->assignedLeader.token, memberToken); + goto _OVER; + } + + if (errcode != TSDB_CODE_SUCCESS) { + mInfo("skip update arb assigned for vgId:%d, since:%s", vgId, tstrerror(errcode)); + goto _OVER; + } + + if (pGroup->isSync) { + mndArbGroupDupObj(pGroup, pNewGroup); + pNewGroup->isSync = false; + + mInfo("vgId:%d, arb isSync is setting to false", vgId); + updateAssigned = true; + goto _OVER; + } + +_OVER: + taosThreadMutexUnlock(&pGroup->mutex); + return updateAssigned; +} + +static int32_t mndProcessArbSetAssignedLeaderRsp(SRpcMsg *pRsp) { + int32_t ret = -1; + + SMnode *pMnode = pRsp->info.node; + SSdb *pSdb = pMnode->pSdb; + + char arbToken[TSDB_ARB_TOKEN_SIZE]; + if (mndGetArbToken(pMnode, arbToken) != 0) { + mError("failed to get arb token for arb-set-assigned response"); + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + SVArbSetAssignedLeaderRsp setAssignedRsp = {0}; + if (tDeserializeSVArbSetAssignedLeaderRsp(pRsp->pCont, pRsp->contLen, &setAssignedRsp) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + mInfo("arb set assigned failed, des failed since:%s", tstrerror(pRsp->code)); + return -1; + } + + if (mndArbCheckToken(arbToken, setAssignedRsp.arbToken) != 0) { + mInfo("skip update arb assigned for vgId:%d, arb token mismatch, local:[%s] msg:[%s]", setAssignedRsp.vgId, + arbToken, setAssignedRsp.arbToken); + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + goto _OVER; + } + + SArbGroup *pGroup = mndAcquireArbGroup(pMnode, setAssignedRsp.vgId); + if (!pGroup) { + mError("failed to set arb assigned for vgId:%d, since:%s", setAssignedRsp.vgId, terrstr()); + goto _OVER; + } + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(pGroup, setAssignedRsp.vgId, setAssignedRsp.memberToken, + pRsp->code, &newGroup); + if (updateAssigned) { + if (mndPullupArbUpdateGroup(pMnode, &newGroup) != 0) { + mInfo("failed to pullup update arb assigned for vgId:%d, since:%s", setAssignedRsp.vgId, terrstr()); + goto _OVER; + } + } + + ret = 0; + +_OVER: + tFreeSVArbSetAssignedLeaderRsp(&setAssignedRsp); + return ret; +} + +static int32_t mndRetrieveArbGroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + int32_t cols = 0; + SArbGroup *pGroup = NULL; + + while (numOfRows < rows) { + pShow->pIter = sdbFetch(pSdb, SDB_ARBGROUP, pShow->pIter, (void **)&pGroup); + if (pShow->pIter == NULL) break; + + taosThreadMutexLock(&pGroup->mutex); + + cols = 0; + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + SVgObj *pVgObj = sdbAcquire(pSdb, SDB_VGROUP, &pGroup->vgId); + if (!pVgObj) { + taosThreadMutexUnlock(&pGroup->mutex); + sdbRelease(pSdb, pGroup); + continue; + } + char dbname[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(dbname, mndGetDbStr(pVgObj->dbName), TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE); + colDataSetVal(pColInfo, numOfRows, (const char *)dbname, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->vgId, false); + + for (int i = 0; i < TSDB_ARB_GROUP_MEMBER_NUM; i++) { + SArbGroupMember *pMember = &pGroup->members[i]; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pMember->info.dnodeId, false); + } + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->isSync, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)&pGroup->assignedLeader.dnodeId, false); + + char token[TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(token, pGroup->assignedLeader.token, TSDB_ARB_TOKEN_SIZE + VARSTR_HEADER_SIZE); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, numOfRows, (const char *)token, false); + + taosThreadMutexUnlock(&pGroup->mutex); + + numOfRows++; + sdbRelease(pSdb, pVgObj); + sdbRelease(pSdb, pGroup); + } + + pShow->numOfRows += numOfRows; + + return numOfRows; +} + +static void mndCancelGetNextArbGroup(SMnode *pMnode, void *pIter) { + SSdb *pSdb = pMnode->pSdb; + sdbCancelFetch(pSdb, pIter); +} + +int32_t mndGetArbGroupSize(SMnode *pMnode) { + SSdb *pSdb = pMnode->pSdb; + return sdbGetSize(pSdb, SDB_ARBGROUP); +} diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 37c2d19bd4..93f9f0eab8 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -15,6 +15,8 @@ #define _DEFAULT_SOURCE #include "mndDb.h" +#include "audit.h" +#include "mndArbGroup.h" #include "mndCluster.h" #include "mndDnode.h" #include "mndIndex.h" @@ -30,12 +32,11 @@ #include "mndVgroup.h" #include "mndView.h" #include "systable.h" -#include "tjson.h" #include "thttp.h" -#include "audit.h" +#include "tjson.h" #define DB_VER_NUMBER 1 -#define DB_RESERVE_SIZE 42 +#define DB_RESERVE_SIZE 41 static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw); static int32_t mndDbActionInsert(SSdb *pSdb, SDbObj *pDb); @@ -43,14 +44,14 @@ static int32_t mndDbActionDelete(SSdb *pSdb, SDbObj *pDb); static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew); static int32_t mndNewDbActionValidate(SMnode *pMnode, STrans *pTrans, SSdbRaw *pRaw); -static int32_t mndProcessCreateDbReq(SRpcMsg *pReq); -static int32_t mndProcessAlterDbReq(SRpcMsg *pReq); -static int32_t mndProcessDropDbReq(SRpcMsg *pReq); -static int32_t mndProcessUseDbReq(SRpcMsg *pReq); -static int32_t mndProcessTrimDbReq(SRpcMsg *pReq); -static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity); -static void mndCancelGetNextDb(SMnode *pMnode, void *pIter); -static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq); +static int32_t mndProcessCreateDbReq(SRpcMsg *pReq); +static int32_t mndProcessAlterDbReq(SRpcMsg *pReq); +static int32_t mndProcessDropDbReq(SRpcMsg *pReq); +static int32_t mndProcessUseDbReq(SRpcMsg *pReq); +static int32_t mndProcessTrimDbReq(SRpcMsg *pReq); +static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity); +static void mndCancelGetNextDb(SMnode *pMnode, void *pIter); +static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq); #ifndef TD_ENTERPRISE int32_t mndProcessCompactDbReq(SRpcMsg *pReq) { return TSDB_CODE_OPS_NOT_SUPPORT; } @@ -139,6 +140,7 @@ SSdbRaw *mndDbActionEncode(SDbObj *pDb) { SDB_SET_INT32(pRaw, dataPos, pDb->cfg.tsdbPageSize, _OVER) SDB_SET_INT64(pRaw, dataPos, pDb->compactStartTime, _OVER) SDB_SET_INT32(pRaw, dataPos, pDb->cfg.keepTimeOffset, _OVER) + SDB_SET_INT8(pRaw, dataPos, pDb->cfg.withArbitrator, _OVER) SDB_SET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) SDB_SET_DATALEN(pRaw, dataPos, _OVER) @@ -230,6 +232,7 @@ static SSdbRow *mndDbActionDecode(SSdbRaw *pRaw) { SDB_GET_INT32(pRaw, dataPos, &pDb->cfg.tsdbPageSize, _OVER) SDB_GET_INT64(pRaw, dataPos, &pDb->compactStartTime, _OVER) SDB_GET_INT32(pRaw, dataPos, &pDb->cfg.keepTimeOffset, _OVER) + SDB_GET_INT8(pRaw, dataPos, &pDb->cfg.withArbitrator, _OVER) SDB_GET_RESERVE(pRaw, dataPos, DB_RESERVE_SIZE, _OVER) taosInitRWLatch(&pDb->lock); @@ -319,6 +322,7 @@ static int32_t mndDbActionUpdate(SSdb *pSdb, SDbObj *pOld, SDbObj *pNew) { pOld->cfg.minRows = pNew->cfg.minRows; pOld->cfg.maxRows = pNew->cfg.maxRows; pOld->cfg.tsdbPageSize = pNew->cfg.tsdbPageSize; + pOld->cfg.withArbitrator = pNew->cfg.withArbitrator; pOld->compactStartTime = pNew->compactStartTime; taosWUnLockLatch(&pOld->lock); return 0; @@ -393,7 +397,11 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) { if (pCfg->precision < TSDB_MIN_PRECISION && pCfg->precision > TSDB_MAX_PRECISION) return -1; if (pCfg->compression < TSDB_MIN_COMP_LEVEL || pCfg->compression > TSDB_MAX_COMP_LEVEL) return -1; if (pCfg->replications < TSDB_MIN_DB_REPLICA || pCfg->replications > TSDB_MAX_DB_REPLICA) return -1; + #ifdef TD_ENTERPRISE + if ((pCfg->replications == 2) ^ (pCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) return -1; + #else if (pCfg->replications != 1 && pCfg->replications != 3) return -1; + #endif if (pCfg->strict < TSDB_DB_STRICT_OFF || pCfg->strict > TSDB_DB_STRICT_ON) return -1; if (pCfg->schemaless < TSDB_DB_SCHEMALESS_OFF || pCfg->schemaless > TSDB_DB_SCHEMALESS_ON) return -1; if (pCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; @@ -418,33 +426,43 @@ static int32_t mndCheckDbCfg(SMnode *pMnode, SDbCfg *pCfg) { return terrno; } -static int32_t mndCheckInChangeDbCfg(SMnode *pMnode, SDbCfg *pCfg) { +static int32_t mndCheckInChangeDbCfg(SMnode *pMnode, SDbCfg *pOldCfg, SDbCfg *pNewCfg) { terrno = TSDB_CODE_MND_INVALID_DB_OPTION; - if (pCfg->buffer < TSDB_MIN_BUFFER_PER_VNODE || pCfg->buffer > TSDB_MAX_BUFFER_PER_VNODE) return -1; - if (pCfg->pages < TSDB_MIN_PAGES_PER_VNODE || pCfg->pages > TSDB_MAX_PAGES_PER_VNODE) return -1; - if (pCfg->pageSize < TSDB_MIN_PAGESIZE_PER_VNODE || pCfg->pageSize > TSDB_MAX_PAGESIZE_PER_VNODE) return -1; - if (pCfg->daysPerFile < TSDB_MIN_DAYS_PER_FILE || pCfg->daysPerFile > TSDB_MAX_DAYS_PER_FILE) return -1; - if (pCfg->daysToKeep0 < TSDB_MIN_KEEP || pCfg->daysToKeep0 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep1 < TSDB_MIN_KEEP || pCfg->daysToKeep1 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep2 < TSDB_MIN_KEEP || pCfg->daysToKeep2 > TSDB_MAX_KEEP) return -1; - if (pCfg->daysToKeep0 < pCfg->daysPerFile) return -1; - if (pCfg->daysToKeep0 > pCfg->daysToKeep1) return -1; - if (pCfg->daysToKeep1 > pCfg->daysToKeep2) return -1; - if (pCfg->keepTimeOffset < TSDB_MIN_KEEP_TIME_OFFSET || pCfg->keepTimeOffset > TSDB_MAX_KEEP_TIME_OFFSET) return -1; - if (pCfg->walFsyncPeriod < TSDB_MIN_FSYNC_PERIOD || pCfg->walFsyncPeriod > TSDB_MAX_FSYNC_PERIOD) return -1; - if (pCfg->walLevel < TSDB_MIN_WAL_LEVEL || pCfg->walLevel > TSDB_MAX_WAL_LEVEL) return -1; - if (pCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; - if (pCfg->cacheLastSize < TSDB_MIN_DB_CACHE_SIZE || pCfg->cacheLastSize > TSDB_MAX_DB_CACHE_SIZE) return -1; - if (pCfg->replications < TSDB_MIN_DB_REPLICA || pCfg->replications > TSDB_MAX_DB_REPLICA) return -1; - if (pCfg->replications != 1 && pCfg->replications != 3) return -1; - if (pCfg->sstTrigger < TSDB_MIN_STT_TRIGGER || pCfg->sstTrigger > TSDB_MAX_STT_TRIGGER) return -1; - if (pCfg->minRows < TSDB_MIN_MINROWS_FBLOCK || pCfg->minRows > TSDB_MAX_MINROWS_FBLOCK) return -1; - if (pCfg->maxRows < TSDB_MIN_MAXROWS_FBLOCK || pCfg->maxRows > TSDB_MAX_MAXROWS_FBLOCK) return -1; - if (pCfg->minRows > pCfg->maxRows) return -1; - if (pCfg->walRetentionPeriod < TSDB_DB_MIN_WAL_RETENTION_PERIOD) return -1; - if (pCfg->walRetentionSize < TSDB_DB_MIN_WAL_RETENTION_SIZE) return -1; - if (pCfg->strict < TSDB_DB_STRICT_OFF || pCfg->strict > TSDB_DB_STRICT_ON) return -1; - if (pCfg->replications > mndGetDnodeSize(pMnode)) { + if (pNewCfg->buffer < TSDB_MIN_BUFFER_PER_VNODE || pNewCfg->buffer > TSDB_MAX_BUFFER_PER_VNODE) return -1; + if (pNewCfg->pages < TSDB_MIN_PAGES_PER_VNODE || pNewCfg->pages > TSDB_MAX_PAGES_PER_VNODE) return -1; + if (pNewCfg->pageSize < TSDB_MIN_PAGESIZE_PER_VNODE || pNewCfg->pageSize > TSDB_MAX_PAGESIZE_PER_VNODE) return -1; + if (pNewCfg->daysPerFile < TSDB_MIN_DAYS_PER_FILE || pNewCfg->daysPerFile > TSDB_MAX_DAYS_PER_FILE) return -1; + if (pNewCfg->daysToKeep0 < TSDB_MIN_KEEP || pNewCfg->daysToKeep0 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep1 < TSDB_MIN_KEEP || pNewCfg->daysToKeep1 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep2 < TSDB_MIN_KEEP || pNewCfg->daysToKeep2 > TSDB_MAX_KEEP) return -1; + if (pNewCfg->daysToKeep0 < pNewCfg->daysPerFile) return -1; + if (pNewCfg->daysToKeep0 > pNewCfg->daysToKeep1) return -1; + if (pNewCfg->daysToKeep1 > pNewCfg->daysToKeep2) return -1; + if (pNewCfg->keepTimeOffset < TSDB_MIN_KEEP_TIME_OFFSET || pNewCfg->keepTimeOffset > TSDB_MAX_KEEP_TIME_OFFSET) return -1; + if (pNewCfg->walFsyncPeriod < TSDB_MIN_FSYNC_PERIOD || pNewCfg->walFsyncPeriod > TSDB_MAX_FSYNC_PERIOD) return -1; + if (pNewCfg->walLevel < TSDB_MIN_WAL_LEVEL || pNewCfg->walLevel > TSDB_MAX_WAL_LEVEL) return -1; + if (pNewCfg->cacheLast < TSDB_CACHE_MODEL_NONE || pNewCfg->cacheLast > TSDB_CACHE_MODEL_BOTH) return -1; + if (pNewCfg->cacheLastSize < TSDB_MIN_DB_CACHE_SIZE || pNewCfg->cacheLastSize > TSDB_MAX_DB_CACHE_SIZE) return -1; + if (pNewCfg->replications < TSDB_MIN_DB_REPLICA || pNewCfg->replications > TSDB_MAX_DB_REPLICA) return -1; + #ifdef TD_ENTERPRISE + if ((pNewCfg->replications == 2) ^ (pNewCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) return -1; + if (pNewCfg->replications == 2 && pNewCfg->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR) { + if (pOldCfg->replications != 1 && pOldCfg->replications != 2) { + terrno = TSDB_CODE_OPS_NOT_SUPPORT; + return -1; + } + } + #else + if (pNewCfg->replications != 1 && pNewCfg->replications != 3) return -1; + #endif + if (pNewCfg->sstTrigger < TSDB_MIN_STT_TRIGGER || pNewCfg->sstTrigger > TSDB_MAX_STT_TRIGGER) return -1; + if (pNewCfg->minRows < TSDB_MIN_MINROWS_FBLOCK || pNewCfg->minRows > TSDB_MAX_MINROWS_FBLOCK) return -1; + if (pNewCfg->maxRows < TSDB_MIN_MAXROWS_FBLOCK || pNewCfg->maxRows > TSDB_MAX_MAXROWS_FBLOCK) return -1; + if (pNewCfg->minRows > pNewCfg->maxRows) return -1; + if (pNewCfg->walRetentionPeriod < TSDB_DB_MIN_WAL_RETENTION_PERIOD) return -1; + if (pNewCfg->walRetentionSize < TSDB_DB_MIN_WAL_RETENTION_SIZE) return -1; + if (pNewCfg->strict < TSDB_DB_STRICT_OFF || pNewCfg->strict > TSDB_DB_STRICT_ON) return -1; + if (pNewCfg->replications > mndGetDnodeSize(pMnode)) { terrno = TSDB_CODE_MND_NO_ENOUGH_DNODES; return -1; } @@ -484,6 +502,7 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) { if (pCfg->walSegmentSize < 0) pCfg->walSegmentSize = TSDB_DEFAULT_DB_WAL_SEGMENT_SIZE; if (pCfg->sstTrigger <= 0) pCfg->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; if (pCfg->tsdbPageSize <= 0) pCfg->tsdbPageSize = TSDB_DEFAULT_TSDB_PAGESIZE; + if (pCfg->withArbitrator < 0) pCfg->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; } static int32_t mndSetCreateDbPrepareAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) { @@ -515,6 +534,15 @@ static int32_t mndSetCreateDbRedoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD if (sdbSetRawStatus(pVgRaw, SDB_STATUS_UPDATE) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupRedoLogs(pTrans, &arbGroup) != 0) return -1; + } + } + return 0; } @@ -531,6 +559,15 @@ static int32_t mndSetCreateDbUndoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD if (sdbSetRawStatus(pVgRaw, SDB_STATUS_DROPPED) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupUndoLogs(pTrans, &arbGroup) != 0) return -1; + } + } + return 0; } @@ -548,6 +585,15 @@ static int32_t mndSetCreateDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj * if (sdbSetRawStatus(pVgRaw, SDB_STATUS_READY) != 0) return -1; } + if (pDb->cfg.withArbitrator) { + for (int32_t v = 0; v < pDb->cfg.numOfVgroups; ++v) { + SVgObj *pVgObj = pVgroups + v; + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgObj, &arbGroup); + if (mndSetCreateArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } + } + if (pUserDuped) { SSdbRaw *pUserRaw = mndUserActionEncode(pUserDuped); if (pUserRaw == NULL) return -1; @@ -629,6 +675,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate, .hashPrefix = pCreate->hashPrefix, .hashSuffix = pCreate->hashSuffix, .tsdbPageSize = pCreate->tsdbPageSize, + .withArbitrator = pCreate->withArbitrator, }; dbObj.cfg.numOfRetensions = pCreate->numOfRetensions; @@ -698,17 +745,17 @@ _OVER: return code; } -static void mndBuildAuditDetailInt32(char* detail, char* tmp, char* format, int32_t para){ - if(para > 0){ - if(strlen(detail) > 0) strcat(detail, ", "); +static void mndBuildAuditDetailInt32(char *detail, char *tmp, char *format, int32_t para) { + if (para > 0) { + if (strlen(detail) > 0) strcat(detail, ", "); sprintf(tmp, format, para); strcat(detail, tmp); } } -static void mndBuildAuditDetailInt64(char* detail, char* tmp, char* format, int64_t para){ - if(para > 0){ - if(strlen(detail) > 0) strcat(detail, ", "); +static void mndBuildAuditDetailInt64(char *detail, char *tmp, char *format, int64_t para) { + if (para > 0) { + if (strlen(detail) > 0) strcat(detail, ", "); sprintf(tmp, format, para); strcat(detail, tmp); } @@ -893,6 +940,12 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) { terrno = 0; } + if (pAlter->withArbitrator != pDb->cfg.withArbitrator) { + pDb->cfg.withArbitrator = pAlter->withArbitrator; + pDb->vgVersion++; + terrno = 0; + } + return terrno; } @@ -931,12 +984,24 @@ static int32_t mndSetAlterDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj * if (pIter == NULL) break; if (mndVgroupInDb(pVgroup, pNewDb->uid)) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pOldDb, pNewDb, pVgroup, pArray) != 0) { + SVgObj newVgroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pOldDb, pNewDb, pVgroup, pArray, &newVgroup) != 0) { sdbCancelFetch(pSdb, pIter); sdbRelease(pSdb, pVgroup); taosArrayDestroy(pArray); return -1; } + if (pNewDb->cfg.withArbitrator != pOldDb->cfg.withArbitrator) { + if (pNewDb->cfg.withArbitrator) { + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(&newVgroup, &arbGroup); + if (mndSetCreateArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } else { + SArbGroup arbGroup = {0}; + mndArbGroupInitFromVgObj(pVgroup, &arbGroup); + if (mndSetDropArbGroupCommitLogs(pTrans, &arbGroup) != 0) return -1; + } + } } sdbRelease(pSdb, pVgroup); @@ -1013,7 +1078,7 @@ static int32_t mndProcessAlterDbReq(SRpcMsg *pReq) { goto _OVER; } - code = mndCheckInChangeDbCfg(pMnode, &dbObj.cfg); + code = mndCheckInChangeDbCfg(pMnode, &pDb->cfg, &dbObj.cfg); if (code != 0) goto _OVER; dbObj.cfgVersion++; @@ -1081,6 +1146,7 @@ static void mndDumpDbCfgInfo(SDbCfgRsp *cfgRsp, SDbObj *pDb) { cfgRsp->pRetensions = taosArrayDup(pDb->cfg.pRetensions, NULL); cfgRsp->schemaless = pDb->cfg.schemaless; cfgRsp->sstTrigger = pDb->cfg.sstTrigger; + cfgRsp->withArbitrator = pDb->cfg.withArbitrator; } static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) { @@ -1150,6 +1216,22 @@ static int32_t mndSetDropDbCommitLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pD SSdb *pSdb = pMnode->pSdb; void *pIter = NULL; + while (1) { + SArbGroup *pArbGroup = NULL; + pIter = sdbFetch(pSdb, SDB_ARBGROUP, pIter, (void **)&pArbGroup); + if (pIter == NULL) break; + + if (pArbGroup->dbUid == pDb->uid) { + if (mndSetDropArbGroupCommitLogs(pTrans,pArbGroup) != 0) { + sdbCancelFetch(pSdb, pIter); + sdbRelease(pSdb, pArbGroup); + return -1; + } + } + + sdbRelease(pSdb, pArbGroup); + } + while (1) { SVgObj *pVgroup = NULL; pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); @@ -1277,7 +1359,7 @@ static int32_t mndDropDb(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb) { if (mndDropStreamByDb(pMnode, pTrans, pDb) != 0) goto _OVER; #ifdef TD_ENTERPRISE if (mndDropViewByDb(pMnode, pTrans, pDb) != 0) goto _OVER; -#endif +#endif if (mndDropSmasByDb(pMnode, pTrans, pDb) != 0) goto _OVER; if (mndDropIdxsByDb(pMnode, pTrans, pDb) != 0) goto _OVER; if (mndSetDropDbRedoActions(pMnode, pTrans, pDb) != 0) goto _OVER; @@ -1390,7 +1472,7 @@ static void mndBuildDBVgroupInfo(SDbObj *pDb, SMnode *pMnode, SArray *pVgList) { pEp->port = pDnode->port; } mndReleaseDnode(pMnode, pDnode); - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { vgInfo.epSet.inUse = gid; } } @@ -1562,21 +1644,19 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs, int32_t numOfTable = mndGetDBTableNum(pDb, pMnode); - if (pDbCacheInfo->vgVersion >= pDb->vgVersion && - pDbCacheInfo->cfgVersion >= pDb->cfgVersion && - numOfTable == pDbCacheInfo->numOfTable && - pDbCacheInfo->stateTs == pDb->stateTs) { + if (pDbCacheInfo->vgVersion >= pDb->vgVersion && pDbCacheInfo->cfgVersion >= pDb->cfgVersion && + numOfTable == pDbCacheInfo->numOfTable && pDbCacheInfo->stateTs == pDb->stateTs) { mTrace("db:%s, valid dbinfo, vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d, not changed vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d", - pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, pDbCacheInfo->numOfTable, - pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); + pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, + pDbCacheInfo->numOfTable, pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); mndReleaseDb(pMnode, pDb); continue; } else { mInfo("db:%s, valid dbinfo, vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d, changed to vgVersion:%d cfgVersion:%d stateTs:%" PRId64 " numOfTables:%d", - pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, pDbCacheInfo->numOfTable, - pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); + pDbCacheInfo->dbFName, pDbCacheInfo->vgVersion, pDbCacheInfo->cfgVersion, pDbCacheInfo->stateTs, + pDbCacheInfo->numOfTable, pDb->vgVersion, pDb->cfgVersion, pDb->stateTs, numOfTable); } if (pDbCacheInfo->cfgVersion < pDb->cfgVersion) { @@ -1584,8 +1664,7 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs, mndDumpDbCfgInfo(rsp.cfgRsp, pDb); } - if (pDbCacheInfo->vgVersion < pDb->vgVersion || - numOfTable != pDbCacheInfo->numOfTable || + if (pDbCacheInfo->vgVersion < pDb->vgVersion || numOfTable != pDbCacheInfo->numOfTable || pDbCacheInfo->stateTs != pDb->stateTs) { rsp.useDbRsp = taosMemoryCalloc(1, sizeof(SUseDbRsp)); rsp.useDbRsp->pVgroupInfos = taosArrayInit(pDb->cfg.numOfVgroups, sizeof(SVgroupInfo)); @@ -1801,7 +1880,8 @@ bool mndIsDbReady(SMnode *pMnode, SDbObj *pDb) { if (pVgroup->dbUid == pDb->uid && pVgroup->replica > 1) { bool hasLeader = false; for (int32_t i = 0; i < pVgroup->replica; ++i) { - if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER || + pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { hasLeader = true; } } @@ -1991,6 +2071,9 @@ static void mndDumpDbInfoData(SMnode *pMnode, SSDataBlock *pBlock, SDbObj *pDb, pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataSetVal(pColInfo, rows, (const char *)&pDb->cfg.keepTimeOffset, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataSetVal(pColInfo, rows, (const char *)&pDb->cfg.withArbitrator, false); } taosMemoryFree(buf); diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index befb6d3521..c1dafecf92 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -311,6 +311,17 @@ SEpSet mndGetDnodeEpset(SDnodeObj *pDnode) { return epSet; } +SEpSet mndGetDnodeEpsetById(SMnode *pMnode, int32_t dnodeId) { + SEpSet epSet = {0}; + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (!pDnode) return epSet; + + epSet = mndGetDnodeEpset(pDnode); + + mndReleaseDnode(pMnode, pDnode); + return epSet; +} + static SDnodeObj *mndAcquireDnodeByEp(SMnode *pMnode, char *pEpStr) { SSdb *pSdb = pMnode->pSdb; @@ -776,7 +787,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { SVgObj *pVgroup = mndAcquireVgroup(pMnode, pVload->vgId); if (pVgroup != NULL) { - if (pVload->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVload->syncState == TAOS_SYNC_STATE_LEADER || pVload->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { pVgroup->cacheUsage = pVload->cacheUsage; pVgroup->numOfCachedTables = pVload->numOfCachedTables; pVgroup->numOfTables = pVload->numOfTables; diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index 69a0bd477d..ee7cd83a8c 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "mndAcct.h" +#include "mndArbGroup.h" #include "mndCluster.h" #include "mndCompact.h" #include "mndCompactDetail.h" @@ -140,6 +141,22 @@ static void mndPullupTrimDb(SMnode *pMnode) { tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); } +static int32_t mndPullupArbHeartbeat(SMnode *pMnode) { + mTrace("pullup arb hb"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_HEARTBEAT_TIMER, .pCont = pReq, .contLen = contLen, .info.noResp = 1}; + return tmsgPutToQueue(&pMnode->msgCb, ARB_QUEUE, &rpcMsg); +} + +static int32_t mndPullupArbCheckSync(SMnode *pMnode) { + mTrace("pullup arb sync"); + int32_t contLen = 0; + void *pReq = mndBuildTimerMsg(&contLen); + SRpcMsg rpcMsg = {.msgType = TDMT_MND_ARB_CHECK_SYNC_TIMER, .pCont = pReq, .contLen = contLen, .info.noResp = 1}; + return tmsgPutToQueue(&pMnode->msgCb, ARB_QUEUE, &rpcMsg); +} + static void mndCalMqRebalance(SMnode *pMnode) { int32_t contLen = 0; void *pReq = mndBuildTimerMsg(&contLen); @@ -391,6 +408,18 @@ static void *mndThreadFp(void *param) { continue; } mndDoTimerPullupTask(pMnode, sec); + + if (sec % (tsArbHeartBeatIntervalSec) == 0) { + if (mndPullupArbHeartbeat(pMnode) != 0) { + mError("failed to pullup arb heartbeat, since:%s", terrstr()); + } + } + + if (sec % (tsArbCheckSyncIntervalSec) == 0) { + if (mndPullupArbCheckSync(pMnode) != 0) { + mError("failed to pullup arb check sync, since:%s", terrstr()); + } + } } return NULL; @@ -513,6 +542,7 @@ static int32_t mndInitSteps(SMnode *pMnode) { if (mndAllocStep(pMnode, "mnode-mnode", mndInitMnode, mndCleanupMnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-qnode", mndInitQnode, mndCleanupQnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-snode", mndInitSnode, mndCleanupSnode) != 0) return -1; + if (mndAllocStep(pMnode, "mnode-arbgroup", mndInitArbGroup, mndCleanupArbGroup) != 0) return -1; if (mndAllocStep(pMnode, "mnode-dnode", mndInitDnode, mndCleanupDnode) != 0) return -1; if (mndAllocStep(pMnode, "mnode-user", mndInitUser, mndCleanupUser) != 0) return -1; if (mndAllocStep(pMnode, "mnode-grant", mndInitGrant, mndCleanupGrant) != 0) return -1; @@ -694,6 +724,13 @@ ESyncRole mndGetRole(SMnode *pMnode) { return syncGetRole(rid); } +int64_t mndGetTerm(SMnode *pMnode) { + int64_t rid = pMnode->syncMgmt.sync; + return syncGetTerm(rid); +} + +int32_t mndGetArbToken(SMnode *pMnode, char *outToken) { return syncGetArbToken(pMnode->syncMgmt.sync, outToken); } + void mndStop(SMnode *pMnode) { mndSetStop(pMnode); mndSyncStop(pMnode); @@ -768,7 +805,8 @@ _OVER: pMsg->msgType == TDMT_MND_TRIM_DB_TIMER || pMsg->msgType == TDMT_MND_UPTIME_TIMER || pMsg->msgType == TDMT_MND_COMPACT_TIMER || pMsg->msgType == TDMT_MND_NODECHECK_TIMER || pMsg->msgType == TDMT_MND_GRANT_HB_TIMER || pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_CANDIDITATE || - pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_TIMER || pMsg->msgType == TDMT_MND_STREAM_REQ_CHKPT) { + pMsg->msgType == TDMT_MND_STREAM_CHECKPOINT_TIMER || pMsg->msgType == TDMT_MND_STREAM_REQ_CHKPT || + pMsg->msgType == TDMT_MND_ARB_HEARTBEAT_TIMER || pMsg->msgType == TDMT_MND_ARB_CHECK_SYNC_TIMER) { mTrace("timer not process since mnode restored:%d stopped:%d, sync restored:%d role:%s ", pMnode->restored, pMnode->stopped, state.restored, syncStr(state.state)); return -1; @@ -951,7 +989,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr pVnDesc->dnode_id = pVgid->dnodeId; tstrncpy(pVnDesc->vnode_role, syncStr(pVgid->syncState), sizeof(pVnDesc->vnode_role)); pVnDesc->syncState = pVgid->syncState; - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { tstrncpy(desc.status, "ready", sizeof(desc.status)); pClusterInfo->vgroups_alive++; } diff --git a/source/dnode/mnode/impl/src/mndQnode.c b/source/dnode/mnode/impl/src/mndQnode.c index 2f4ad69e2a..b86f14e698 100644 --- a/source/dnode/mnode/impl/src/mndQnode.c +++ b/source/dnode/mnode/impl/src/mndQnode.c @@ -189,7 +189,7 @@ int32_t mndSetCreateQnodeCommitLogs(STrans *pTrans, SQnodeObj *pObj) { return 0; } -bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId) { +bool mndQnodeInDnode(SQnodeObj *pQnode, int32_t dnodeId) { return pQnode->pDnode->id == dnodeId; } @@ -434,7 +434,7 @@ _OVER: } mndReleaseQnode(pMnode, pObj); - tFreeSMCreateQnodeReq(&dropReq); + tFreeSDDropQnodeReq(&dropReq); return code; } diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index f887d05d37..b3124fa99f 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -67,6 +67,8 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_QNODE; } else if (strncasecmp(name, TSDB_INS_TABLE_SNODES, len) == 0) { type = TSDB_MGMT_TABLE_SNODE; + } else if (strncasecmp(name, TSDB_INS_TABLE_ARBGROUPS, len) == 0) { + type = TSDB_MGMT_TABLE_ARBGROUP; } else if (strncasecmp(name, TSDB_INS_TABLE_CLUSTER, len) == 0) { type = TSDB_MGMT_TABLE_CLUSTER; } else if (strncasecmp(name, TSDB_INS_TABLE_DATABASES, len) == 0) { diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index a1490a3813..28c857319f 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -409,6 +409,7 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { pFsm->FpApplyQueueItems = mndApplyQueueItems; pFsm->FpReConfigCb = NULL; pFsm->FpBecomeLeaderCb = mndBecomeLeader; + pFsm->FpBecomeAssignedLeaderCb = NULL; pFsm->FpBecomeFollowerCb = mndBecomeFollower; pFsm->FpBecomeLearnerCb = mndBecomeLearner; pFsm->FpGetSnapshot = mndSyncGetSnapshot; diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index f7db0d7b15..3af372a432 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -733,6 +733,8 @@ void mndTransSetDbName(STrans *pTrans, const char *dbname, const char *stbname) } } +void mndTransSetArbGroupId(STrans *pTrans, int32_t groupId) { pTrans->arbGroupId = groupId; } + void mndTransSetSerial(STrans *pTrans) { pTrans->exec = TRN_EXEC_SERIAL; } void mndTransSetParallel(STrans *pTrans) { pTrans->exec = TRN_EXEC_PARALLEL; } @@ -814,6 +816,12 @@ static bool mndCheckTransConflict(SMnode *pMnode, STrans *pNew) { conflict = true; } } + if (pNew->conflict == TRN_CONFLICT_ARBGROUP) { + if (pTrans->conflict == TRN_CONFLICT_GLOBAL) conflict = true; + if (pTrans->conflict == TRN_CONFLICT_ARBGROUP) { + if (pNew->arbGroupId == pTrans->arbGroupId) conflict = true; + } + } if (conflict) { mError("trans:%d, db:%s stb:%s type:%d, can't execute since conflict with trans:%d db:%s stb:%s type:%d", @@ -1255,9 +1263,9 @@ static int32_t mndTransExecuteActions(SMnode *pMnode, STrans *pTrans, SArray *pA for (int32_t action = 0; action < numOfActions; ++action) { STransAction *pAction = taosArrayGet(pArray, action); - mDebug("trans:%d, %s:%d Sent:%d, Received:%d, errCode:0x%x, acceptableCode:0x%x, retryCode:0x%x", pTrans->id, - mndTransStr(pAction->stage), pAction->id, pAction->msgSent, pAction->msgReceived, pAction->errCode, - pAction->acceptableCode, pAction->retryCode); + mDebug("trans:%d, %s:%d Sent:%d, Received:%d, errCode:0x%x, acceptableCode:0x%x, retryCode:0x%x", + pTrans->id, mndTransStr(pAction->stage), pAction->id, pAction->msgSent, pAction->msgReceived, + pAction->errCode, pAction->acceptableCode, pAction->retryCode); if (pAction->msgSent) { if (pAction->msgReceived) { if (pAction->errCode != 0 && pAction->errCode != pAction->acceptableCode) { diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index b0290191bc..571f17fab6 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "mndVgroup.h" #include "audit.h" +#include "mndArbGroup.h" #include "mndDb.h" #include "mndDnode.h" #include "mndMnode.h" @@ -351,7 +352,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg mInfo( "vgId:%d, build create vnode req, replica:%d selfIndex:%d learnerReplica:%d learnerSelfIndex:%d strict:%d " "changeVersion:%d", - createReq.vgId, createReq.replica, createReq.selfIndex, createReq.learnerReplica, createReq.learnerReplica, + createReq.vgId, createReq.replica, createReq.selfIndex, createReq.learnerReplica, createReq.learnerSelfIndex, createReq.strict, createReq.changeVersion); for (int32_t i = 0; i < createReq.replica; ++i) { mInfo("vgId:%d, replica:%d ep:%s:%u", createReq.vgId, i, createReq.replicas[i].fqdn, createReq.replicas[i].port); @@ -738,10 +739,6 @@ void mndSortVnodeGid(SVgObj *pVgroup) { } static int32_t mndGetAvailableDnode(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, SArray *pArray) { - SSdb *pSdb = pMnode->pSdb; - int32_t allocedVnodes = 0; - void *pIter = NULL; - mDebug("start to sort %d dnodes", (int32_t)taosArrayGetSize(pArray)); taosArraySort(pArray, (__compar_fn_t)mndCompareDnodeVnodes); for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pArray); ++i) { @@ -883,7 +880,7 @@ SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup) { SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); if (pDnode == NULL) continue; - if (pVgid->syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { epset.inUse = epset.numOfEps; } @@ -895,6 +892,29 @@ SEpSet mndGetVgroupEpset(SMnode *pMnode, const SVgObj *pVgroup) { return epset; } +SEpSet mndGetVgroupEpsetById(SMnode *pMnode, int32_t vgId) { + SEpSet epset = {0}; + + SVgObj * pVgroup = mndAcquireVgroup(pMnode, vgId); + if (!pVgroup) return epset; + + for (int32_t v = 0; v < pVgroup->replica; ++v) { + const SVnodeGid *pVgid = &pVgroup->vnodeGid[v]; + SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); + if (pDnode == NULL) continue; + + if (pVgid->syncState == TAOS_SYNC_STATE_LEADER || pVgid->syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + epset.inUse = epset.numOfEps; + } + + addEpIntoEpSet(&epset, pDnode->fqdn, pDnode->port); + mndReleaseDnode(pMnode, pDnode); + } + + mndReleaseVgroup(pMnode, pVgroup); + return epset; +} + static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { SMnode *pMnode = pReq->info.node; SSdb *pSdb = pMnode->pSdb; @@ -958,7 +978,8 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p strcpy(role, "dropping"); } else if (online) { char *star = ""; - if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { + if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER || + pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (!pVgroup->vnodeGid[i].syncRestore && !pVgroup->vnodeGid[i].syncCanRead) { star = "**"; } else if (!pVgroup->vnodeGid[i].syncRestore && pVgroup->vnodeGid[i].syncCanRead) { @@ -2288,7 +2309,7 @@ int32_t mndAddVgroupBalanceToTrans(SMnode *pMnode, SVgObj *pVgroup, STrans *pTra return -1; } - int32_t dnodeId = pVgroup->vnodeGid[0].dnodeId; + int32_t dnodeId = 0; for (int i = 0; i < replica; i++) { if (pVgroup->vnodeGid[i].syncState == TAOS_SYNC_STATE_LEADER) { @@ -2389,81 +2410,102 @@ static int32_t mndCheckDnodeMemory(SMnode *pMnode, SDbObj *pOldDb, SDbObj *pNewD } int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, - SArray *pArray) { - SVgObj newVgroup = {0}; - memcpy(&newVgroup, pVgroup, sizeof(SVgObj)); + SArray *pArray, SVgObj *pNewVgroup) { + memcpy(pNewVgroup, pVgroup, sizeof(SVgObj)); if (pVgroup->replica <= 0 || pVgroup->replica == pNewDb->cfg.replications) { if (mndAddAlterVnodeConfigAction(pMnode, pTrans, pNewDb, pVgroup) != 0) return -1; - if (mndCheckDnodeMemory(pMnode, pOldDb, pNewDb, &newVgroup, pVgroup, pArray) != 0) return -1; + if (mndCheckDnodeMemory(pMnode, pOldDb, pNewDb, pNewVgroup, pVgroup, pArray) != 0) return -1; return 0; } mndTransSetSerial(pTrans); - if (newVgroup.replica == 1 && pNewDb->cfg.replications == 3) { + if (pNewVgroup->replica == 1 && pNewDb->cfg.replications == 3) { mInfo("db:%s, vgId:%d, will add 2 vnodes, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId); // add second - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; // learner stage - newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[1]) != 0) return -1; // follower stage - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; - if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; // add third - if (mndAddVnodeToVgroup(pMnode, pTrans, &newVgroup, pArray) != 0) return -1; + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; - newVgroup.vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; - newVgroup.vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[2].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[2]) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - } else if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; + } else if (pNewVgroup->replica == 3 && pNewDb->cfg.replications == 1) { mInfo("db:%s, vgId:%d, will remove 2 vnodes, vn:0 dnode:%d vn:1 dnode:%d vn:2 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId, pVgroup->vnodeGid[1].dnodeId, pVgroup->vnodeGid[2].dnodeId); SVnodeGid del1 = {0}; SVnodeGid del2 = {0}; - if (mndRemoveVnodeFromVgroup(pMnode, pTrans, &newVgroup, pArray, &del1) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + if (mndRemoveVnodeFromVgroup(pMnode, pTrans, pNewVgroup, pArray, &del1) != 0) return -1; + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &del1, true) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[1].dnodeId) != 0) + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; - if (mndRemoveVnodeFromVgroup(pMnode, pTrans, &newVgroup, pArray, &del2) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; - if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + if (mndRemoveVnodeFromVgroup(pMnode, pTrans, pNewVgroup, pArray, &del2) != 0) return -1; + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &del2, true) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; + } else if (pNewVgroup->replica == 1 && pNewDb->cfg.replications == 2) { + mInfo("db:%s, vgId:%d, will add 1 vnode, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, + pVgroup->vnodeGid[0].dnodeId); + + // add second + if (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray) != 0) return -1; + + // learner stage + pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER; + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_LEARNER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) + return -1; + + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &pNewVgroup->vnodeGid[1]) != 0) return -1; + + // follower stage + pNewVgroup->vnodeGid[1].nodeRole = TAOS_SYNC_ROLE_VOTER; + if (mndAddAlterVnodeTypeAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[1].dnodeId) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId) != 0) + return -1; + + if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup) != 0) return -1; } else { return -1; } - mndSortVnodeGid(&newVgroup); + mndSortVnodeGid(pNewVgroup); { - SSdbRaw *pVgRaw = mndVgroupActionEncode(&newVgroup); + SSdbRaw *pVgRaw = mndVgroupActionEncode(pNewVgroup); if (pVgRaw == NULL) return -1; if (mndTransAppendCommitlog(pTrans, pVgRaw) != 0) { sdbFreeRaw(pVgRaw); @@ -2622,7 +2664,7 @@ int32_t mndBuildRestoreAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj } } if (mndAddCreateVnodeAction(pMnode, pTrans, db, &newVgroup, &newVgroup.vnodeGid[selected]) != 0) return -1; - } else if (newVgroup.replica == 3) { + } else if (newVgroup.replica == 2 || newVgroup.replica == 3) { for (int i = 0; i < newVgroup.replica; i++) { if (newVgroup.vnodeGid[i].dnodeId == pDnode->id) { newVgroup.vnodeGid[i].nodeRole = TAOS_SYNC_ROLE_LEARNER; @@ -2716,6 +2758,12 @@ int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgro } #endif + if (pDb->cfg.withArbitrator) { + code = TSDB_CODE_OPS_NOT_SUPPORT; + mError("vgId:%d, db:%s, with arbitrator, split vgroup not allowed", pVgroup->vgId, pVgroup->dbName); + goto _OVER; + } + pTrans = mndTransCreate(pMnode, TRN_POLICY_RETRY, TRN_CONFLICT_DB, pReq, "split-vgroup"); if (pTrans == NULL) goto _OVER; mndTransSetSerial(pTrans); @@ -2813,13 +2861,15 @@ int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj *pVgro // adjust vgroup replica if (pDb->cfg.replications != newVg1.replica) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray) != 0) goto _OVER; + SVgObj tmpGroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray, &tmpGroup) != 0) goto _OVER; } else { if (mndAddVgStatusAction(pTrans, &newVg1, SDB_STATUS_READY, TRN_STAGE_COMMIT_ACTION) < 0) goto _OVER; } if (pDb->cfg.replications != newVg2.replica) { - if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg2, pArray) != 0) goto _OVER; + SVgObj tmpGroup = {0}; + if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg2, pArray, &tmpGroup) != 0) goto _OVER; } else { if (mndAddVgStatusAction(pTrans, &newVg2, SDB_STATUS_READY, TRN_STAGE_COMMIT_ACTION) < 0) goto _OVER; } @@ -2907,10 +2957,22 @@ static int32_t mndBalanceVgroupBetweenDnode(SMnode *pMnode, STrans *pTrans, SDno } SDbObj *pDb = mndAcquireDb(pMnode, pVgroup->dbName); + if (pDb == NULL) { + mError("vgId:%d, balance vgroup can't find db obj dbName:%s", pVgroup->vgId, pVgroup->dbName); + goto _OUT; + } + + if (pDb->cfg.withArbitrator) { + mInfo("vgId:%d, db:%s, with arbitrator, balance vgroup not allowed", pVgroup->vgId, pVgroup->dbName); + goto _OUT; + } + code = mndSetBalanceVgroupInfoToTrans(pMnode, pTrans, pDb, pVgroup, pSrc, pDst); if (code == 0) { code = taosHashPut(pBalancedVgroups, &pVgroup->vgId, sizeof(int32_t), &pVgroup->vgId, sizeof(int32_t)); } + + _OUT: mndReleaseDb(pMnode, pDb); sdbRelease(pSdb, pVgroup); sdbCancelFetch(pSdb, pIter); diff --git a/source/dnode/mnode/impl/test/CMakeLists.txt b/source/dnode/mnode/impl/test/CMakeLists.txt index bc5b5125f1..471f0535b8 100644 --- a/source/dnode/mnode/impl/test/CMakeLists.txt +++ b/source/dnode/mnode/impl/test/CMakeLists.txt @@ -1,6 +1,7 @@ enable_testing() add_subdirectory(acct) +add_subdirectory(arbgroup) #add_subdirectory(db) #add_subdirectory(dnode) add_subdirectory(func) diff --git a/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt b/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt new file mode 100644 index 0000000000..44ac305498 --- /dev/null +++ b/source/dnode/mnode/impl/test/arbgroup/CMakeLists.txt @@ -0,0 +1,13 @@ +SET(CMAKE_CXX_STANDARD 11) + +aux_source_directory(. MNODE_ARBGROUP_TEST_SRC) +add_executable(arbgroupTest ${MNODE_ARBGROUP_TEST_SRC}) +target_link_libraries( + arbgroupTest + PRIVATE dnode nodes planner gtest qcom +) + +add_test( + NAME arbgroupTest + COMMAND arbgroupTest +) diff --git a/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp b/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp new file mode 100644 index 0000000000..fdfc560d54 --- /dev/null +++ b/source/dnode/mnode/impl/test/arbgroup/arbgroup.cpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +// #include +#include +#include +// #include "nodes.h" +// #include "planner.h" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wwrite-strings" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wsign-compare" + +// #include +#include "../../inc/mndArbGroup.h" + +namespace { + +void generateArbToken(int32_t nodeId, int32_t vgId, char* buf) { + memset(buf, 0, TSDB_ARB_TOKEN_SIZE); + int32_t randVal = taosSafeRand() % 1000; + int64_t currentMs = taosGetTimestampMs(); + snprintf(buf, TSDB_ARB_TOKEN_SIZE, "d%d#g%d#%" PRId64 "#%d", nodeId, vgId, currentMs, randVal); +} + +} // namespace + +class ArbgroupTest : public testing::Test { + protected: + static void SetUpTestSuite() { + std::cout << "setup env for arbgroupTest suite" << std::endl; + } + + static void TearDownTestSuite() { std::cout << "tearDown env for arbgroupTest suite" << std::endl; } + + virtual void SetUp() override {} + + virtual void TearDown() override {} + +}; + +int main(int argc, char** argv) { + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +TEST_F(ArbgroupTest, 01_encode_decode_sdb) { + SArbGroup group = {0}; + group.vgId = 5; + group.dbUid = 1234; + group.members[0].info.dnodeId = 1; + generateArbToken(1, 5, group.members[0].state.token); + group.members[1].info.dnodeId = 2; + generateArbToken(2, 5, group.members[1].state.token); + group.isSync = 1; + group.assignedLeader.dnodeId = 1; + generateArbToken(1, 5, group.assignedLeader.token); + group.version = 2234; + + // -------------------------------------------------------------------------------- + SSdbRaw* pRaw = mndArbGroupActionEncode(&group); + ASSERT_NE(pRaw, nullptr); + + SSdbRow* pRow = mndArbGroupActionDecode(pRaw); + ASSERT_NE(pRow, nullptr); + + SArbGroup* pNewGroup = (SArbGroup*)sdbGetRowObj(pRow); + + EXPECT_EQ(group.vgId, pNewGroup->vgId); + EXPECT_EQ(group.dbUid, pNewGroup->dbUid); + EXPECT_EQ(group.members[0].info.dnodeId, pNewGroup->members[0].info.dnodeId); + EXPECT_EQ(group.members[1].info.dnodeId, pNewGroup->members[1].info.dnodeId); + EXPECT_EQ(group.isSync, pNewGroup->isSync); + EXPECT_EQ(group.assignedLeader.dnodeId, pNewGroup->assignedLeader.dnodeId); + + EXPECT_EQ(std::string(group.members[0].state.token), std::string(pNewGroup->members[0].state.token)); + EXPECT_EQ(std::string(group.members[1].state.token), std::string(pNewGroup->members[1].state.token)); + EXPECT_EQ(std::string(group.assignedLeader.token), std::string(pNewGroup->assignedLeader.token)); + EXPECT_EQ(group.version, pNewGroup->version); + + taosMemoryFree(pRow); + taosMemoryFree(pRaw); +} + +TEST_F(ArbgroupTest, 02_process_heart_beat_rsp) { + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 1; + group.assignedLeader.dnodeId = dnodeId; + strncpy(group.assignedLeader.token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // expired hb => skip + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq - 1; + strncpy(rspMember.memberToken, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_FALSE(updateToken); + EXPECT_NE(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_NE(group.members[0].state.lastHbMs, nowMs); + } + + { // old token + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq + 1; + strncpy(rspMember.memberToken, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_FALSE(updateToken); + EXPECT_EQ(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_EQ(group.members[0].state.lastHbMs, nowMs); + } + + { // new token + SVArbHbRspMember rspMember = {0}; + rspMember.vgId = vgId; + rspMember.hbSeq = group.members[0].state.responsedHbSeq + 1; + generateArbToken(dnodeId, vgId, rspMember.memberToken); + int32_t nowMs = group.members[0].state.lastHbMs + 10; + + SArbGroup newGroup = {0}; + bool updateToken = mndUpdateArbGroupByHeartBeat(&group, &rspMember, nowMs, dnodeId, &newGroup); + + EXPECT_TRUE(updateToken); + EXPECT_EQ(group.members[0].state.responsedHbSeq, rspMember.hbSeq); + EXPECT_EQ(group.members[0].state.lastHbMs, nowMs); + + EXPECT_EQ(std::string(newGroup.members[0].state.token), std::string(rspMember.memberToken)); + EXPECT_FALSE(newGroup.isSync); + EXPECT_EQ(newGroup.assignedLeader.dnodeId, 0); + EXPECT_EQ(std::string(newGroup.assignedLeader.token).size(), 0); + } + + taosThreadMutexDestroy(&group.mutex); +} + +TEST_F(ArbgroupTest, 03_process_check_sync_rsp) { + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 0; + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // token mismatch => skip + char member0Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member0Token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + char member1Token[TSDB_ARB_TOKEN_SIZE] = {0}; + generateArbToken(2, 5, member1Token); + bool newIsSync = false; + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(&group, vgId, member0Token, member1Token, newIsSync, &newGroup); + + EXPECT_FALSE(updateIsSync); + } + + { // newIsSync + char member0Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member0Token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + char member1Token[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(member1Token, group.members[1].state.token, TSDB_ARB_TOKEN_SIZE); + bool newIsSync = true; + + SArbGroup newGroup = {0}; + bool updateIsSync = mndUpdateArbGroupByCheckSync(&group, vgId, member0Token, member1Token, newIsSync, &newGroup); + + EXPECT_TRUE(updateIsSync); + EXPECT_TRUE(newGroup.isSync); + } + + taosThreadMutexDestroy(&group.mutex); +} + +TEST_F(ArbgroupTest, 04_process_set_assigned_leader){ + const int32_t dnodeId = 1; + const int32_t vgId = 5; + + SArbGroup group = {0}; + group.vgId = vgId; + group.dbUid = 1234; + group.members[0].info.dnodeId = dnodeId; + generateArbToken(dnodeId, vgId, group.members[0].state.token); + group.members[0].state.lastHbMs = 1000; + group.members[0].state.responsedHbSeq = 100; + group.members[0].state.nextHbSeq = 102; + + group.members[1].info.dnodeId = 2; + generateArbToken(2, vgId, group.members[1].state.token); + + group.isSync = 1; + group.assignedLeader.dnodeId = dnodeId; + strncpy(group.assignedLeader.token, group.members[0].state.token, TSDB_ARB_TOKEN_SIZE); + + taosThreadMutexInit(&group.mutex, NULL); + + // -------------------------------------------------------------------------------- + { // token mismatch => skip + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + generateArbToken(dnodeId, vgId, memberToken); + int32_t errcode = TSDB_CODE_SUCCESS; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_FALSE(updateAssigned); + } + + { // errcode != TSDB_CODE_SUCCESS + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(memberToken, group.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + int32_t errcode = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_FALSE(updateAssigned); + } + + { // errcode == TSDB_CODE_SUCCESS + char memberToken[TSDB_ARB_TOKEN_SIZE] = {0}; + strncpy(memberToken, group.assignedLeader.token, TSDB_ARB_TOKEN_SIZE); + int32_t errcode = TSDB_CODE_SUCCESS; + + SArbGroup newGroup = {0}; + bool updateAssigned = mndUpdateArbGroupBySetAssignedLeader(&group, vgId, memberToken, errcode, &newGroup); + + EXPECT_TRUE(updateAssigned); + EXPECT_FALSE(newGroup.isSync); + } + + taosThreadMutexDestroy(&group.mutex); +} + +#pragma GCC diagnostic pop diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index e2d4a1f6fc..12a34b0305 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -153,7 +153,8 @@ typedef enum { SDB_COMPACT = 24, SDB_COMPACT_DETAIL = 25, SDB_GRANT = 26, // grant log - SDB_MAX = 27 + SDB_ARBGROUP = 27, + SDB_MAX = 28 } ESdbType; typedef struct SSdbRaw { diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index df228c1fcc..05231f8359 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -70,7 +70,9 @@ const char *sdbTableName(ESdbType type) { return "compact"; case SDB_COMPACT_DETAIL: return "compact_detail"; - default: + case SDB_ARBGROUP: + return "arb_group"; + default: return "undefine"; } } diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 294e75602e..8ae7e9706d 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -76,6 +76,9 @@ int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList); int32_t vnodeGetAllTableList(SVnode *pVnode, uint64_t uid, SArray *list); int32_t vnodeIsCatchUp(SVnode *pVnode); ESyncRole vnodeGetRole(SVnode *pVnode); +int32_t vnodeGetArbToken(SVnode *pVnode, char *outToken); + +int32_t vnodeUpdateArbTerm(SVnode *pVnode, int64_t arbTerm); int32_t vnodeGetCtbIdList(void *pVnode, int64_t suid, SArray *list); int32_t vnodeGetCtbIdListByFilter(SVnode *pVnode, int64_t suid, SArray *list, bool (*filter)(void *arg), void *arg); diff --git a/source/dnode/vnode/src/meta/metaOpen.c b/source/dnode/vnode/src/meta/metaOpen.c index 8055d6e139..4a3dcd0e51 100644 --- a/source/dnode/vnode/src/meta/metaOpen.c +++ b/source/dnode/vnode/src/meta/metaOpen.c @@ -246,32 +246,20 @@ int metaAlterCache(SMeta *pMeta, int32_t nPage) { } int32_t metaRLock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta rlock %p", &pMeta->lock); - - ret = taosThreadRwlockRdlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockRdlock(&pMeta->lock); return ret; } int32_t metaWLock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta wlock %p", &pMeta->lock); - - ret = taosThreadRwlockWrlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockWrlock(&pMeta->lock); return ret; } int32_t metaULock(SMeta *pMeta) { - int32_t ret = 0; - metaTrace("meta ulock %p", &pMeta->lock); - - ret = taosThreadRwlockUnlock(&pMeta->lock); - + int32_t ret = taosThreadRwlockUnlock(&pMeta->lock); return ret; } diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 0b86cae1be..ba0c5697c0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -429,7 +429,7 @@ static int32_t doLoadSttFilesBlk(SSttBlockLoadInfo *pBlockLoadInfo, SLDataIter * code = loadTombFn(pReader1, pIter->pReader, pIter->pBlockLoadInfo); double el = (taosGetTimestampUs() - st) / 1000.0; - tsdbDebug("load the stt file info completed, elapsed time:%.2fms, %s", el, idStr); + tsdbDebug("load the stt file blk info completed, elapsed time:%.2fms, %s", el, idStr); return code; } @@ -806,7 +806,7 @@ int32_t tMergeTreeOpen2(SMergeTree *pMTree, SMergeTreeConf *pConf, SSttDataInfoF tMergeTreeAddIter(pMTree, pIter); // let's record the time window for current table of uid in the stt files - if (pSttDataInfo != NULL) { + if (pSttDataInfo != NULL && numOfRows > 0) { taosArrayPush(pSttDataInfo->pTimeWindowList, &w); pSttDataInfo->numOfRows += numOfRows; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead2.c b/source/dnode/vnode/src/tsdb/tsdbRead2.c index c0ad32d269..69f4f82459 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead2.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead2.c @@ -2093,7 +2093,7 @@ static bool initSttBlockReader(SSttBlockReader* pSttBlockReader, STableBlockScan pScanInfo->sttKeyInfo.status = taosArrayGetSize(info.pTimeWindowList) ? STT_FILE_HAS_DATA : STT_FILE_NO_DATA; pScanInfo->sttKeyInfo.nextProcKey = ASCENDING_TRAVERSE(pReader->info.order) ? pScanInfo->sttWindow.skey : pScanInfo->sttWindow.ekey; - hasData = true; + hasData = (pScanInfo->sttKeyInfo.status == STT_FILE_HAS_DATA); } else { // not clean stt blocks INIT_TIMEWINDOW(&pScanInfo->sttWindow); //reset the time window pScanInfo->sttBlockReturned = false; diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 63ca7251f5..daee8966f9 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -493,7 +493,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC VNODE_METRIC_TAG_NAME_DNODE_ID, VNODE_METRIC_TAG_NAME_DNODE_EP, VNODE_METRIC_TAG_NAME_VGROUP_ID, VNODE_METRIC_TAG_NAME_USERNAME, VNODE_METRIC_TAG_NAME_RESULT}; - counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", + counter = taos_counter_new(VNODE_METRIC_SQL_COUNT, "counter for insert sql", label_count, sample_labels); vInfo("vgId:%d, new metric:%p",TD_VID(pVnode), counter); if(taos_collector_registry_register_metric(counter) == 1){ @@ -503,7 +503,7 @@ SVnode *vnodeOpen(const char *path, int32_t diskPrimary, STfs *pTfs, SMsgCb msgC } } pVnode->monitor.insertCounter = counter; - vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter); + vInfo("vgId:%d, succeed to set metric:%p",TD_VID(pVnode), counter); } return pVnode; @@ -560,6 +560,9 @@ int32_t vnodeIsCatchUp(SVnode *pVnode) { return syncIsCatchUp(pVnode->sync); } ESyncRole vnodeGetRole(SVnode *pVnode) { return syncGetRole(pVnode->sync); } +int32_t vnodeUpdateArbTerm(SVnode *pVnode, int64_t arbTerm) { return syncUpdateArbTerm(pVnode->sync, arbTerm); } +int32_t vnodeGetArbToken(SVnode *pVnode, char *outToken) { return syncGetArbToken(pVnode->sync, outToken); } + void vnodeStop(SVnode *pVnode) {} int64_t vnodeGetSyncHandle(SVnode *pVnode) { return pVnode->sync; } diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index d244d5b6bf..a85192546f 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -406,7 +406,7 @@ int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { int32_t vnodeGetLoadLite(SVnode *pVnode, SVnodeLoadLite *pLoad) { SSyncState syncState = syncGetState(pVnode->sync); - if (syncState.state == TAOS_SYNC_STATE_LEADER) { + if (syncState.state == TAOS_SYNC_STATE_LEADER || syncState.state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { pLoad->vgId = TD_VID(pVnode); pLoad->nTimeSeries = metaGetTimeSeriesNum(pVnode->pMeta, 1); return 0; diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index e32d4b70e0..a03adb164b 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -31,20 +31,24 @@ static int32_t vnodeProcessCreateTbReq(SVnode *pVnode, int64_t ver, void *pReq, static int32_t vnodeProcessAlterTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginRpc); -static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg); static int32_t vnodeProcessCreateTSmaReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterConfirmReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropTtlTbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessTrimReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); -static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg); static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCreateIndexReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropIndexReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); +static int32_t vnodeProcessArbCheckSyncReq(SVnode *pVnode, void *pReq, int32_t len, SRpcMsg *pRsp); + +static int32_t vnodePreCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token); +static int32_t vnodeCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token); extern int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); extern int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg); @@ -451,6 +455,21 @@ static int32_t vnodePreProcessBatchDeleteMsg(SVnode *pVnode, SRpcMsg *pMsg) { return code; } +static int32_t vnodePreProcessArbCheckSyncMsg(SVnode *pVnode, SRpcMsg *pMsg) { + SVArbCheckSyncReq syncReq = {0}; + + if (tDeserializeSVArbCheckSyncReq((char *)pMsg->pCont + sizeof(SMsgHead), pMsg->contLen - sizeof(SMsgHead), + &syncReq) != 0) { + return TSDB_CODE_INVALID_MSG; + } + + (void)vnodePreCheckAssignedLogSyncd(pVnode, syncReq.member0Token, syncReq.member1Token); + int32_t code = terrno; + tFreeSVArbCheckSyncReq(&syncReq); + + return code; +} + int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { int32_t code = 0; @@ -473,6 +492,9 @@ int32_t vnodePreProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg) { case TDMT_VND_BATCH_DEL: { code = vnodePreProcessBatchDeleteMsg(pVnode, pMsg); } break; + case TDMT_VND_ARB_CHECK_SYNC: { + code = vnodePreProcessArbCheckSyncMsg(pVnode, pMsg); + } break; default: break; } @@ -643,6 +665,10 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg vnodeProcessKillCompactReq(pVnode, ver, pReq, len, pRsp); break; #endif + /* ARB */ + case TDMT_VND_ARB_CHECK_SYNC: + vnodeProcessArbCheckSyncReq(pVnode, pReq, len, pRsp); + break; default: vError("vgId:%d, unprocessed msg, %d", TD_VID(pVnode), pMsg->msgType); return -1; @@ -1489,7 +1515,7 @@ static int32_t vnodeRebuildSubmitReqMsg(SSubmitReq2 *pSubmitReq, void **ppMsg) { return code; } -static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg) { int32_t code = 0; terrno = 0; @@ -1710,8 +1736,8 @@ _exit: atomic_add_fetch_64(&pVnode->statis.nBatchInsert, 1); if(tsEnableMonitor && pSubmitRsp->affectedRows > 0 && strlen(pOriginalMsg->info.conn.user) > 0){ - const char *sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT_AFFECTED_ROWS, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT_AFFECTED_ROWS, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_add(pVnode->monitor.insertCounter, pSubmitRsp->affectedRows, sample_labels); } @@ -1725,14 +1751,14 @@ _exit: atomic_add_fetch_64(&pVnode->statis.nBatchInsertSuccess, 1); code = tdProcessRSmaSubmit(pVnode->pSma, ver, pSubmitReq, pReq, len); - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } else{ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_INSERT, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Failed"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } @@ -1992,7 +2018,7 @@ static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t ver, void *pRe return 0; } -static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, +static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp, SRpcMsg *pOriginalMsg) { int32_t code = 0; SDecoder *pCoder = &(SDecoder){0}; @@ -2038,14 +2064,14 @@ static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t ver, void *pReq, in _err: /* if(code == TSDB_CODE_SUCCESS){ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Success"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } else{ - const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, - pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, + const char *batch_sample_labels[] = {VNODE_METRIC_TAG_VALUE_DELETE, pVnode->monitor.strClusterId, + pVnode->monitor.strDnodeId, tsLocalEp, pVnode->monitor.strVgId, pOriginalMsg->info.conn.user, "Failed"}; taos_counter_inc(pVnode->monitor.insertCounter, batch_sample_labels); } @@ -2119,6 +2145,98 @@ static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pR return 0; } +static int32_t vnodePreCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token) { + SSyncState syncState = syncGetState(pVnode->sync); + if (syncState.state != TAOS_SYNC_STATE_LEADER) { + terrno = TSDB_CODE_SYN_NOT_LEADER; + return -1; + } + + char token[TSDB_ARB_TOKEN_SIZE] = {0}; + if (vnodeGetArbToken(pVnode, token) != 0) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + if (strncmp(token, member0Token, TSDB_ARB_TOKEN_SIZE) != 0 && + strncmp(token, member1Token, TSDB_ARB_TOKEN_SIZE) != 0) { + terrno = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + return -1; + } + + terrno = TSDB_CODE_SUCCESS; + return 0; +} + +static int32_t vnodeCheckAssignedLogSyncd(SVnode *pVnode, char *member0Token, char *member1Token) { + int32_t code = vnodePreCheckAssignedLogSyncd(pVnode, member0Token, member1Token); + if (code != 0) { + return code; + } + + return syncGetAssignedLogSynced(pVnode->sync); +} + +static int32_t vnodeProcessArbCheckSyncReq(SVnode *pVnode, void *pReq, int32_t len, SRpcMsg *pRsp) { + int32_t code = 0; + + SVArbCheckSyncReq syncReq = {0}; + + if (tDeserializeSVArbCheckSyncReq(pReq, len, &syncReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + pRsp->msgType = TDMT_VND_ARB_CHECK_SYNC_RSP; + pRsp->code = TSDB_CODE_SUCCESS; + pRsp->pCont = NULL; + pRsp->contLen = 0; + + SVArbCheckSyncRsp syncRsp = {0}; + syncRsp.arbToken = syncReq.arbToken; + syncRsp.member0Token = syncReq.member0Token; + syncRsp.member1Token = syncReq.member1Token; + syncRsp.vgId = TD_VID(pVnode); + + (void)vnodeCheckAssignedLogSyncd(pVnode, syncReq.member0Token, syncReq.member1Token); + syncRsp.errCode = terrno; + + if (vnodeUpdateArbTerm(pVnode, syncReq.arbTerm) != 0) { + vError("vgId:%d, failed to update arb term", TD_VID(pVnode)); + code = -1; + goto _OVER; + } + + int32_t contLen = tSerializeSVArbCheckSyncRsp(NULL, 0, &syncRsp); + if (contLen <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = -1; + goto _OVER; + } + void *pHead = rpcMallocCont(contLen); + if (!pHead) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = -1; + goto _OVER; + } + + if (tSerializeSVArbCheckSyncRsp(pHead, contLen, &syncRsp) <= 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pHead); + code = -1; + goto _OVER; + } + + pRsp->pCont = pHead; + pRsp->contLen = contLen; + + terrno = TSDB_CODE_SUCCESS; + +_OVER: + tFreeSVArbCheckSyncReq(&syncReq); + return code; +} + #ifndef TD_ENTERPRISE int32_t vnodeProcessCompactVnodeReqImpl(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { return 0; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index f9f2ae6b21..63494a17b9 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -638,6 +638,14 @@ static void vnodeBecomeLeader(const SSyncFSM *pFsm) { } } +static void vnodeBecomeAssignedLeader(const SSyncFSM* pFsm) { + SVnode *pVnode = pFsm->data; + vDebug("vgId:%d, become assigned leader", pVnode->config.vgId); + if (pVnode->pTq) { + tqUpdateNodeStage(pVnode->pTq, true); + } +} + static bool vnodeApplyQueueEmpty(const SSyncFSM *pFsm) { SVnode *pVnode = pFsm->data; @@ -674,6 +682,7 @@ static SSyncFSM *vnodeSyncMakeFsm(SVnode *pVnode) { pFsm->FpApplyQueueEmptyCb = vnodeApplyQueueEmpty; pFsm->FpApplyQueueItems = vnodeApplyQueueItems; pFsm->FpBecomeLeaderCb = vnodeBecomeLeader; + pFsm->FpBecomeAssignedLeaderCb = vnodeBecomeAssignedLeader; pFsm->FpBecomeFollowerCb = vnodeBecomeFollower; pFsm->FpBecomeLearnerCb = vnodeBecomeLearner; pFsm->FpReConfigCb = NULL; diff --git a/source/libs/nodes/src/nodesCodeFuncs.c b/source/libs/nodes/src/nodesCodeFuncs.c index dc74a3f18b..74f952938b 100644 --- a/source/libs/nodes/src/nodesCodeFuncs.c +++ b/source/libs/nodes/src/nodesCodeFuncs.c @@ -211,6 +211,8 @@ const char* nodesNodeName(ENodeType type) { return "ShowSnodesStmt"; case QUERY_NODE_SHOW_BNODES_STMT: return "ShowBnodesStmt"; + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return "ShowArbGroupsStmt"; case QUERY_NODE_SHOW_CLUSTER_STMT: return "ShowClusterStmt"; case QUERY_NODE_SHOW_DATABASES_STMT: @@ -268,7 +270,7 @@ const char* nodesNodeName(ENodeType type) { case QUERY_NODE_SHOW_COMPACTS_STMT: return "ShowCompactsStmt"; case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT: - return "ShowCompactDetailsStmt"; + return "ShowCompactDetailsStmt"; case QUERY_NODE_SHOW_GRANTS_FULL_STMT: return "ShowGrantsFullStmt"; case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: @@ -3286,16 +3288,16 @@ static int32_t physiGroupCacheNodeToJson(const void* pObj, SJson* pJson) { int32_t code = physicPlanNodeToJson(pObj, pJson); if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGrpColsMayBeNull, pNode->grpColsMayBeNull); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGroupByUid, pNode->grpByUid); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanGlobalGroup, pNode->globalGrp); - } + } if (TSDB_CODE_SUCCESS == code) { code = tjsonAddBoolToObject(pJson, jkGroupCachePhysiPlanBatchFetch, pNode->batchFetch); - } + } if (TSDB_CODE_SUCCESS == code) { code = nodeListToJson(pJson, jkGroupCachePhysiPlanGroupCols, pNode->pGroupCols); } @@ -6792,6 +6794,10 @@ static int32_t showQnodesStmtToJson(const void* pObj, SJson* pJson) { return sho static int32_t jsonToShowQnodesStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } +static int32_t showArbGroupsStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } + +static int32_t jsonToShowArbGroupsStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } + static int32_t showClusterStmtToJson(const void* pObj, SJson* pJson) { return showStmtToJson(pObj, pJson); } static int32_t jsonToShowClusterStmt(const SJson* pJson, void* pObj) { return jsonToShowStmt(pJson, pObj); } @@ -7319,6 +7325,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) { return showMnodesStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_QNODES_STMT: return showQnodesStmtToJson(pObj, pJson); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return showArbGroupsStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_CLUSTER_STMT: return showClusterStmtToJson(pObj, pJson); case QUERY_NODE_SHOW_DATABASES_STMT: @@ -7658,6 +7666,8 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToShowMnodesStmt(pJson, pObj); case QUERY_NODE_SHOW_QNODES_STMT: return jsonToShowQnodesStmt(pJson, pObj); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return jsonToShowArbGroupsStmt(pJson, pObj); case QUERY_NODE_SHOW_CLUSTER_STMT: return jsonToShowClusterStmt(pJson, pObj); case QUERY_NODE_SHOW_DATABASES_STMT: @@ -7722,7 +7732,7 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) { return jsonToRestoreQnodeStmt(pJson, pObj); case QUERY_NODE_RESTORE_MNODE_STMT: return jsonToRestoreMnodeStmt(pJson, pObj); - case QUERY_NODE_RESTORE_VNODE_STMT: + case QUERY_NODE_RESTORE_VNODE_STMT: return jsonToRestoreVnodeStmt(pJson, pObj); case QUERY_NODE_LOGIC_PLAN_SCAN: return jsonToLogicScanNode(pJson, pObj); diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index efeb0ae30a..8d4990b228 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -489,6 +489,7 @@ SNode* nodesMakeNode(ENodeType type) { case QUERY_NODE_SHOW_QNODES_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: @@ -1151,6 +1152,7 @@ void nodesDestroyNode(SNode* pNode) { case QUERY_NODE_SHOW_QNODES_STMT: case QUERY_NODE_SHOW_SNODES_STMT: case QUERY_NODE_SHOW_BNODES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: case QUERY_NODE_SHOW_CLUSTER_STMT: case QUERY_NODE_SHOW_DATABASES_STMT: case QUERY_NODE_SHOW_FUNCTIONS_STMT: @@ -1457,7 +1459,7 @@ void nodesDestroyNode(SNode* pNode) { nodesDestroyList(pPhyNode->pOnRight); nodesDestroyNode(pPhyNode->pFilterConditions); nodesDestroyList(pPhyNode->pTargets); - + nodesDestroyNode(pPhyNode->pPrimKeyCond); nodesDestroyNode(pPhyNode->pColEqCond); nodesDestroyNode(pPhyNode->pTagEqCond); @@ -1797,9 +1799,9 @@ void nodesListInsertListAfterPos(SNodeList* pTarget, SListCell* pPos, SNodeList* pSrc->pTail->pNext = pPos->pNext; pPos->pNext = pSrc->pHead; - + pTarget->length += pSrc->length; - nodesFree(pSrc); + nodesFree(pSrc); } SNode* nodesListGetNode(SNodeList* pList, int32_t index) { diff --git a/source/libs/parser/inc/parAst.h b/source/libs/parser/inc/parAst.h index 925c6e0578..c912ffa955 100644 --- a/source/libs/parser/inc/parAst.h +++ b/source/libs/parser/inc/parAst.h @@ -200,7 +200,7 @@ SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind); SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type); SNode* createShowStmtWithCond(SAstCreateContext* pCxt, ENodeType type, SNode* pDbName, SNode* pTbName, EOperatorType tableCondType); -SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName, EOperatorType tableCondType); +SNode* createShowTablesStmt(SAstCreateContext* pCxt, SShowTablesOption option, SNode* pTbName, EOperatorType tableCondType); SNode* createShowCreateDatabaseStmt(SAstCreateContext* pCxt, SToken* pDbName); SNode* createShowAliveStmt(SAstCreateContext* pCxt, SNode* pDbName, ENodeType type); SNode* createShowCreateTableStmt(SAstCreateContext* pCxt, ENodeType type, SNode* pRealTable); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 3c0671e9cc..09963138ba 100755 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -478,6 +478,7 @@ cmd ::= SHOW db_name_cond_opt(A) VGROUPS. cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } //cmd ::= SHOW MODULES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT); } cmd ::= SHOW QNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } +cmd ::= SHOW ARBGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } cmd ::= SHOW FUNCTIONS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } cmd ::= SHOW INDEXES FROM table_name_cond(A) from_db_opt(B). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, B, A, OP_TYPE_EQUAL); } cmd ::= SHOW INDEXES FROM db_name(B) NK_DOT table_name(A). { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &B), createIdentifierValueNode(pCxt, &A), OP_TYPE_EQUAL); } @@ -529,7 +530,7 @@ table_kind_db_name_cond_opt(A) ::= db_name(C) NK_DOT. table_kind_db_name_cond_opt(A) ::= table_kind(B) db_name(C) NK_DOT. { A.kind = B; A.dbName = C; } %type table_kind { EShowKind } -%destructor table_kind { } +%destructor table_kind { } table_kind(A) ::= NORMAL. { A = SHOW_KIND_TABLES_NORMAL; } table_kind(A) ::= CHILD. { A = SHOW_KIND_TABLES_CHILD; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index 5e4b4f1f3d..81da7a48c4 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -288,7 +288,7 @@ SNode* releaseRawExprNode(SAstCreateContext* pCxt, SNode* pNode) { } else if (pRawExpr->isPseudoColumn) { // all pseudo column are translate to function with same name strcpy(pExpr->userAlias, ((SFunctionNode*)pExpr)->functionName); - strcpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName); + strcpy(pExpr->aliasName, ((SFunctionNode*)pExpr)->functionName); } else { int32_t len = TMIN(sizeof(pExpr->aliasName) - 1, pRawExpr->n); @@ -1269,11 +1269,11 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr return select; } -SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags) { +SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags) { if (pStmt && QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { if (pCxt->pQueryCxt->biMode) { ((SSelectStmt*)pStmt)->tagScan = true; - } else { + } else { ((SSelectStmt*)pStmt)->tagScan = bSelectTags; } } @@ -1343,6 +1343,7 @@ SNode* createDefaultDatabaseOptions(SAstCreateContext* pCxt) { pOptions->sstTrigger = TSDB_DEFAULT_SST_TRIGGER; pOptions->tablePrefix = TSDB_DEFAULT_HASH_PREFIX; pOptions->tableSuffix = TSDB_DEFAULT_HASH_SUFFIX; + pOptions->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; return (SNode*)pOptions; } @@ -1378,6 +1379,7 @@ SNode* createAlterDatabaseOptions(SAstCreateContext* pCxt) { pOptions->sstTrigger = -1; pOptions->tablePrefix = -1; pOptions->tableSuffix = -1; + pOptions->withArbitrator = TSDB_DEFAULT_DB_WITH_ARBITRATOR; return (SNode*)pOptions; } @@ -1433,6 +1435,7 @@ static SNode* setDatabaseOptionImpl(SAstCreateContext* pCxt, SNode* pOptions, ED break; case DB_OPTION_REPLICA: pDbOptions->replica = taosStr2Int8(((SToken*)pVal)->z, NULL, 10); + pDbOptions->withArbitrator = (pDbOptions->replica == 2); if (!alter) { updateWalOptionsDefault(pDbOptions); } @@ -1862,7 +1865,7 @@ SNode* createShowCompactsStmt(SAstCreateContext* pCxt, ENodeType type) { SNode* setShowKind(SAstCreateContext* pCxt, SNode* pStmt, EShowKind showKind) { if (pStmt == NULL) { return NULL; - } + } SShowStmt* pShow = (SShowStmt*)pStmt; pShow->showKind = showKind; return pStmt; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 5d268f7bda..f746304730 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -170,7 +170,7 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pEffectiveUser, pDb, pTable, authType, pCxt->pMetaCache); } -#endif +#endif if (TSDB_CODE_SUCCESS == code) { code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, pDb, pCxt->pMetaCache); } @@ -459,6 +459,14 @@ static int32_t collectMetaKeyFromShowBnodes(SCollectMetaKeyCxt* pCxt, SShowStmt* return TSDB_CODE_SUCCESS; } +static int32_t collectMetaKeyFromShowArbGroups(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + if (pCxt->pParseCxt->enableSysInfo) { + return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_ARBGROUPS, + pCxt->pMetaCache); + } + return TSDB_CODE_SUCCESS; +} + static int32_t collectMetaKeyFromShowCluster(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { if (pCxt->pParseCxt->enableSysInfo) { return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_CLUSTER, @@ -668,7 +676,7 @@ static int32_t collectMetaKeyFromShowCreateView(SCollectMetaKeyCxt* pCxt, SShowC if (TSDB_CODE_SUCCESS == code) { code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache); } - + return code; } @@ -806,6 +814,8 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) { return collectMetaKeyFromShowSnodes(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_BNODES_STMT: return collectMetaKeyFromShowBnodes(pCxt, (SShowStmt*)pStmt); + case QUERY_NODE_SHOW_ARBGROUPS_STMT: + return collectMetaKeyFromShowArbGroups(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_CLUSTER_STMT: return collectMetaKeyFromShowCluster(pCxt, (SShowStmt*)pStmt); case QUERY_NODE_SHOW_DATABASES_STMT: diff --git a/source/libs/parser/src/parAuthenticator.c b/source/libs/parser/src/parAuthenticator.c index 4f523bf4f2..dd04a5c36c 100644 --- a/source/libs/parser/src/parAuthenticator.c +++ b/source/libs/parser/src/parAuthenticator.c @@ -41,7 +41,7 @@ static void setUserAuthInfo(SParseContext* pCxt, const char* pDbName, const char } else { snprintf(pAuth->user, sizeof(pAuth->user), "%s", pCxt->pUser); } - + if (NULL == pTabName) { tNameSetDbName(&pAuth->tbName, pCxt->acctId, pDbName, strlen(pDbName)); } else { @@ -173,7 +173,7 @@ static EDealRes authSelectImpl(SNode* pNode, void* pContext) { isView = true; } taosMemoryFree(pTableMeta); -#endif +#endif if (!isView) { pAuthCxt->errCode = checkAuth(pAuthCxt, pTable->dbName, pTable->tableName, AUTH_TYPE_READ, &pTagCond); if (TSDB_CODE_SUCCESS != pAuthCxt->errCode && NULL != pAuthCxt->pParseCxt->pEffectiveUser) { @@ -355,6 +355,7 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) { case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: return !pCxt->pParseCxt->enableSysInfo ? TSDB_CODE_PAR_PERMISSION_DENIED : TSDB_CODE_SUCCESS; case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_STABLES_STMT: diff --git a/source/libs/parser/src/parTokenizer.c b/source/libs/parser/src/parTokenizer.c index 2e71b0f49b..4c9c9d0ea5 100644 --- a/source/libs/parser/src/parTokenizer.c +++ b/source/libs/parser/src/parTokenizer.c @@ -315,6 +315,7 @@ static SKeyword keywordTable[] = { {"ALIVE", TK_ALIVE}, {"VARBINARY", TK_VARBINARY}, {"KEEP_TIME_OFFSET", TK_KEEP_TIME_OFFSET}, + {"ARBGROUPS", TK_ARBGROUPS}, }; // clang-format on diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 9ff0b2bb16..a2fbe8db6e 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -113,6 +113,13 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { + .showType = QUERY_NODE_SHOW_ARBGROUPS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_ARBGROUPS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, { .showType = QUERY_NODE_SHOW_CLUSTER_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, @@ -276,7 +283,7 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .pTableName = TSDB_INS_TABLE_COMPACTS, .numOfShowCols = 1, .pShowCols = {"*"} - }, + }, { .showType = QUERY_NODE_SHOW_COMPACT_DETAILS_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, .pTableName = TSDB_INS_TABLE_COMPACT_DETAILS, @@ -397,7 +404,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac #endif int32_t code = TSDB_CODE_SUCCESS; - + if (pParCxt->async) { code = getViewMetaFromCache(pMetaCache, pName, pMeta); } else { @@ -407,7 +414,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac .mgmtEps = pParCxt->mgmtEpSet}; code = catalogGetViewMeta(pParCxt->pCatalog, &conn, pName, pMeta); } - + if (TSDB_CODE_SUCCESS != code && TSDB_CODE_PAR_TABLE_NOT_EXIST != code) { parserError("0x%" PRIx64 " catalogGetViewMeta error, code:%s, dbName:%s, viewName:%s", pParCxt->requestId, tstrerror(code), pName->dbname, pName->tname); @@ -418,7 +425,7 @@ static int32_t getViewMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCac int32_t getTargetMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCache, const SName* pName, STableMeta** pMeta, bool couldBeView) { int32_t code = TSDB_CODE_SUCCESS; - + if (pParCxt->async) { code = getTableMetaFromCache(pMetaCache, pName, pMeta); #ifdef TD_ENTERPRISE @@ -437,7 +444,7 @@ int32_t getTargetMetaImpl(SParseContext* pParCxt, SParseMetaCache* pMetaCache, c .mgmtEps = pParCxt->mgmtEpSet}; code = catalogGetTableMeta(pParCxt->pCatalog, &conn, pName, pMeta); } - + if (TSDB_CODE_SUCCESS != code && TSDB_CODE_PAR_TABLE_NOT_EXIST != code) { parserError("0x%" PRIx64 " catalogGetTableMeta error, code:%s, dbName:%s, tbName:%s", pParCxt->requestId, tstrerror(code), pName->dbname, pName->tname); @@ -992,7 +999,7 @@ static void setColumnInfoByExpr(STempTableNode* pTable, SExprNode* pExpr, SColum assNode.pPlace = (SNode**)pColRef; assNode.pAssociationNode = (SNode*)*pColRef; taosArrayPush(pExpr->pAssociation, &assNode); - + strcpy(pCol->tableAlias, pTable->table.tableAlias); pCol->isPrimTs = isPrimaryKeyImpl((SNode*)pExpr); pCol->colId = pCol->isPrimTs ? PRIMARYKEY_TIMESTAMP_COL_ID : 0; @@ -1278,8 +1285,8 @@ static SNode* biMakeTbnameProjectAstNode(char* funcName, char* tableAlias) { if (valNode != NULL) { nodesListMakeAppend(&tbNameFunc->pParameterList, (SNode*)valNode); } - snprintf(tbNameFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), - (tableAlias)? "%s.tbname" : "%stbname", + snprintf(tbNameFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), + (tableAlias)? "%s.tbname" : "%stbname", (tableAlias)? tableAlias : ""); strncpy(tbNameFunc->node.aliasName, tbNameFunc->functionName, TSDB_COL_NAME_LEN); @@ -1291,13 +1298,13 @@ static SNode* biMakeTbnameProjectAstNode(char* funcName, char* tableAlias) { nodesListMakeAppend(&multiResFunc->pParameterList, (SNode*)tbNameFunc); if (tsKeepColumnName) { - snprintf(multiResFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), - (tableAlias)? "%s.tbname" : "%stbname", + snprintf(multiResFunc->node.userAlias, sizeof(tbNameFunc->node.userAlias), + (tableAlias)? "%s.tbname" : "%stbname", (tableAlias)? tableAlias : ""); strcpy(multiResFunc->node.aliasName, tbNameFunc->functionName); } else { - snprintf(multiResFunc->node.userAlias, sizeof(multiResFunc->node.userAlias), - tableAlias? "%s(%s.tbname)" : "%s(%stbname)", funcName, + snprintf(multiResFunc->node.userAlias, sizeof(multiResFunc->node.userAlias), + tableAlias? "%s(%s.tbname)" : "%s(%stbname)", funcName, tableAlias? tableAlias: ""); biMakeAliasNameInMD5(multiResFunc->node.userAlias, strlen(multiResFunc->node.userAlias), multiResFunc->node.aliasName); } @@ -1310,7 +1317,7 @@ static int32_t biRewriteSelectFuncParamStar(STranslateContext* pCxt, SSelectStmt SNodeList* pTbnameNodeList = nodesMakeList(); SFunctionNode* pFunc = (SFunctionNode*)pNode; - if (strcasecmp(pFunc->functionName, "last") == 0 || + if (strcasecmp(pFunc->functionName, "last") == 0 || strcasecmp(pFunc->functionName, "last_row") == 0 || strcasecmp(pFunc->functionName, "first") == 0) { SNodeList* pParams = pFunc->pParameterList; @@ -1360,8 +1367,8 @@ int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { size_t n = taosArrayGetSize(pTables); for (int32_t i = 0; i < n; ++i) { STableNode* pTable = taosArrayGetP(pTables, i); - if (nodeType(pTable) == QUERY_NODE_REAL_TABLE && - ((SRealTableNode*)pTable)->pMeta != NULL && + if (nodeType(pTable) == QUERY_NODE_REAL_TABLE && + ((SRealTableNode*)pTable)->pMeta != NULL && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { SNode* pTbnameNode = biMakeTbnameProjectAstNode(NULL, NULL); nodesListAppend(pTbnameNodeList, pTbnameNode); @@ -1374,9 +1381,9 @@ int32_t biRewriteSelectStar(STranslateContext* pCxt, SSelectStmt* pSelect) { char* pTableAlias = ((SColumnNode*)pNode)->tableAlias; STableNode* pTable = NULL; int32_t code = findTable(pCxt, pTableAlias, &pTable); - if (TSDB_CODE_SUCCESS == code && + if (TSDB_CODE_SUCCESS == code && nodeType(pTable) == QUERY_NODE_REAL_TABLE && - ((SRealTableNode*)pTable)->pMeta != NULL && + ((SRealTableNode*)pTable)->pMeta != NULL && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { SNode* pTbnameNode = biMakeTbnameProjectAstNode(NULL, pTableAlias); nodesListAppend(pTbnameNodeList, pTbnameNode); @@ -2080,7 +2087,7 @@ static int32_t translateInterpPseudoColumnFunc(STranslateContext* pCxt, SNode** return code; } translateColumn(pCxt, (SColumnNode**)ppNode); - return pCxt->errCode; + return pCxt->errCode; } return TSDB_CODE_SUCCESS; } @@ -2390,7 +2397,7 @@ static int32_t replacePsedudoColumnFuncWithColumn(STranslateContext* pCxt, SNode nodesDestroyNode(*ppNode); *ppNode = (SNode*)pCol; - return TSDB_CODE_SUCCESS; + return TSDB_CODE_SUCCESS; } } pCol->node.resType = pOldExpr->resType; @@ -2414,14 +2421,14 @@ static int32_t rewriteToColumnAndRetranslate(STranslateContext* pCxt, SNode** pp return generateSyntaxErrMsg(&pCxt->msgBuf, errCode); } else { return TSDB_CODE_SUCCESS; - } + } } static int32_t translateWindowPseudoColumnFunc(STranslateContext* pCxt, SNode** ppNode, bool* pRewriteToColumn) { SFunctionNode* pFunc = (SFunctionNode*)(*ppNode); if (!fmIsWindowPseudoColumnFunc(pFunc->funcId)) { return TSDB_CODE_SUCCESS; - } + } if (!isSelectStmt(pCxt->pCurrStmt)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_WINDOW_PC); } @@ -2455,7 +2462,7 @@ static int32_t translateScanPseudoColumnFunc(STranslateContext* pCxt, SNode** pp pCxt->errCode = findTable(pCxt, pVal->literal, &pTable); if (TSDB_CODE_SUCCESS != pCxt->errCode || (NULL == pTable)) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TBNAME); - } + } if (nodeType(pTable) != QUERY_NODE_REAL_TABLE) { *pRewriteToColumn = true; return rewriteToColumnAndRetranslate(pCxt, ppNode, TSDB_CODE_PAR_INVALID_TBNAME); @@ -3013,7 +3020,7 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) if (!pSelect->isDistinct) { nodesRewriteExprs(pSelect->pOrderByList, doCheckAggColCoexist, &cxt); } - if (((!cxt.existCol && 0 < pSelect->selectFuncNum) || (cxt.existCol && 1 == pSelect->selectFuncNum) ) + if (((!cxt.existCol && 0 < pSelect->selectFuncNum) || (cxt.existCol && 1 == pSelect->selectFuncNum) ) && !pSelect->hasOtherVectorFunc) { return rewriteColsToSelectValFunc(pCxt, pSelect); } @@ -5092,7 +5099,7 @@ static bool findEqCondTbNameInOperatorNode(STranslateContext* pCxt, SNode* pWher } else { code = findTable(pCxt, pTableAlias, &pTable); } - if (code == TSDB_CODE_SUCCESS && nodeType(pTable) == QUERY_NODE_REAL_TABLE && + if (code == TSDB_CODE_SUCCESS && nodeType(pTable) == QUERY_NODE_REAL_TABLE && ((SRealTableNode*)pTable)->pMeta && ((SRealTableNode*)pTable)->pMeta->tableType == TSDB_SUPER_TABLE) { pInfo->pRealTable = (SRealTableNode*)pTable; return true; @@ -5128,7 +5135,7 @@ static void findEqualCondTbnameInLogicCondAnd(STranslateContext* pCxt, SNode* pW } } } - //TODO: logic cond + //TODO: logic cond } } @@ -5248,7 +5255,7 @@ static int32_t setEqualTbnameTableVgroups(STranslateContext* pCxt, SSelectStmt* pInfo->pRealTable->pVgroupList = vgsInfo; } else { taosMemoryFree(vgsInfo); - } + } } return TSDB_CODE_SUCCESS; } @@ -5804,7 +5811,7 @@ static int32_t translateInsertTable(STranslateContext* pCxt, SNode** pTable) { if (TSDB_CODE_SUCCESS == code && TSDB_CHILD_TABLE != ((SRealTableNode*)*pTable)->pMeta->tableType && TSDB_NORMAL_TABLE != ((SRealTableNode*)*pTable)->pMeta->tableType) { code = buildInvalidOperationMsg(&pCxt->msgBuf, "insert data into super table is not supported"); - + } return code; } @@ -5901,6 +5908,7 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS pReq->tsdbPageSize = pStmt->pOptions->tsdbPageSize; pReq->keepTimeOffset = pStmt->pOptions->keepTimeOffset; pReq->ignoreExist = pStmt->ignoreExists; + pReq->withArbitrator = pStmt->pOptions->withArbitrator; return buildCreateDbRetentions(pStmt->pOptions->pRetentions, pReq); } @@ -6138,7 +6146,7 @@ static int32_t checkDbRetentionsOption(STranslateContext* pCxt, SNodeList* pRete "Invalid option retentions(freq/keep): %s should larger than %s", pKeep->literal, pFreq->literal); } - + if (NULL != pPrevFreq && pPrevFreq->datum.i >= pFreq->datum.i) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid option retentions(freq): %s should larger than %s", pFreq->literal, @@ -6202,6 +6210,12 @@ static int32_t checkOptionsDependency(STranslateContext* pCxt, const char* pDbNa return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, "Invalid duration value, should be keep2 >= keep1 >= keep0 >= 3 * duration"); } + + if ((pOptions->replica == 2) ^ (pOptions->withArbitrator == TSDB_MAX_DB_WITH_ARBITRATOR)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_DB_OPTION, + "Invalid database option, with_arbitrator should be used with replica 2"); + } + return TSDB_CODE_SUCCESS; } @@ -6254,7 +6268,7 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName TSDB_MAX_TSDB_PAGESIZE); } if (TSDB_CODE_SUCCESS == code) { - code = checkDbEnumOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); + code = checkDbRangeOption(pCxt, "replications", pOptions->replica, TSDB_MIN_DB_REPLICA, TSDB_MAX_DB_REPLICA); } if (TSDB_CODE_SUCCESS == code) { code = checkDbStrictOption(pCxt, pOptions); @@ -6293,6 +6307,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, const char* pDbName if (TSDB_CODE_SUCCESS == code) { code = checkDbRangeOption(pCxt, "sstTrigger", pOptions->sstTrigger, TSDB_MIN_STT_TRIGGER, TSDB_MAX_STT_TRIGGER); } + if (TSDB_CODE_SUCCESS == code) { + code = checkDbEnumOption(pCxt, "withArbitrator", pOptions->withArbitrator, TSDB_MIN_DB_WITH_ARBITRATOR, + TSDB_MAX_DB_WITH_ARBITRATOR); + } if (TSDB_CODE_SUCCESS == code) { code = checkDbTbPrefixSuffixOptions(pCxt, pOptions->tablePrefix, pOptions->tableSuffix); } @@ -6505,6 +6523,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt, pReq->minRows = pStmt->pOptions->minRowsPerBlock; pReq->walRetentionPeriod = pStmt->pOptions->walRetentionPeriod; pReq->walRetentionSize = pStmt->pOptions->walRetentionSize; + pReq->withArbitrator = pStmt->pOptions->withArbitrator; return; } @@ -8239,7 +8258,7 @@ static int32_t translateDescribe(STranslateContext* pCxt, SDescribeStmt* pStmt) taosMemoryFree(res.schemaRes.pSchema); } } -#endif +#endif return code; } @@ -8340,8 +8359,8 @@ static int32_t checkCreateStream(STranslateContext* pCxt, SCreateStreamStmt* pSt if (TSDB_VIEW_TABLE == tableType) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, "Unsupported stream query"); } -#endif - +#endif + return TSDB_CODE_SUCCESS; } @@ -9344,7 +9363,7 @@ static int32_t translateCreateView(STranslateContext* pCxt, SCreateViewStmt* pSt tNameGetFullDbName(&name, dbFName); int32_t code = validateCreateView(pCxt, pStmt); - if (TSDB_CODE_SUCCESS == code) { + if (TSDB_CODE_SUCCESS == code) { code = (*pCxt->pParseCxt->parseSqlFp)(pCxt->pParseCxt->parseSqlParam, pStmt->dbName, pStmt->pQuerySql, false, NULL, &res); } if (TSDB_CODE_SUCCESS == code) { @@ -9367,7 +9386,7 @@ static int32_t translateCreateView(STranslateContext* pCxt, SCreateViewStmt* pSt if (TSDB_CODE_SUCCESS == code) { code = buildCmdMsg(pCxt, TDMT_MND_CREATE_VIEW, (FSerializeFunc)tSerializeSCMCreateViewReq, &pStmt->createReq); } - + tFreeSCMCreateViewReq(&pStmt->createReq); return code; } @@ -9395,7 +9414,7 @@ static int32_t translateDropView(STranslateContext* pCxt, SDropViewStmt* pStmt) if (TSDB_CODE_SUCCESS != code) { return code; } - + return buildCmdMsg(pCxt, TDMT_MND_DROP_VIEW, (FSerializeFunc)tSerializeSCMDropViewReq, &dropReq); } @@ -9588,7 +9607,7 @@ static int32_t translateRevoke(STranslateContext* pCxt, SRevokeStmt* pStmt) { taosMemoryFree(pTableMeta); } #endif - + strcpy(req.user, pStmt->userName); sprintf(req.objname, "%d.%s", pCxt->pParseCxt->acctId, pStmt->objName); sprintf(req.tabName, "%s", pStmt->tabName); @@ -9697,7 +9716,7 @@ static int32_t translateShowCreateTable(STranslateContext* pCxt, SShowCreateTabl static int32_t translateShowCreateView(STranslateContext* pCxt, SShowCreateViewStmt* pStmt) { #ifndef TD_ENTERPRISE return TSDB_CODE_OPS_NOT_SUPPORT; -#else +#else SName name; toName(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, &name); return getViewMetaFromMetaCache(pCxt, &name, (SViewMeta**)&pStmt->pViewMeta); @@ -10112,7 +10131,7 @@ int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pS case QUERY_NODE_SHOW_VARIABLES_STMT: return extractShowVariablesResultSchema(numOfCols, pSchema); case QUERY_NODE_COMPACT_DATABASE_STMT: - return extractCompactDbResultSchema(numOfCols, pSchema); + return extractCompactDbResultSchema(numOfCols, pSchema); default: break; } @@ -11599,7 +11618,7 @@ static int32_t rewriteShowCompactDetailsStmt(STranslateContext* pCxt, SQuery* pQ nodesDestroyNode(pQuery->pRoot); pQuery->pRoot = (SNode*)pStmt; } - return code; + return code; } static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { @@ -11633,6 +11652,7 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_GRANTS_FULL_STMT: case QUERY_NODE_SHOW_GRANTS_LOGS_STMT: case QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT: + case QUERY_NODE_SHOW_ARBGROUPS_STMT: code = rewriteShow(pCxt, pQuery); break; case QUERY_NODE_SHOW_VGROUPS_STMT: diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 3f1dca8958..d87dbdc00d 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,30 +104,30 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 529 +#define YYNOCODE 530 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EOrder yy32; - SShowTablesOption yy131; - EJoinType yy148; - STokenPair yy187; - int32_t yy294; - int8_t yy337; + int32_t yy20; + STokenPair yy97; + EJoinSubType yy134; + EShowKind yy329; SDataType yy384; - SAlterOption yy511; - bool yy517; - SNodeList* yy608; - SNode* yy614; - ENullOrder yy685; - EFillMode yy720; - EShowKind yy769; - int64_t yy777; - SToken yy803; - EJoinSubType yy832; - EOperatorType yy1034; + SNodeList* yy444; + EOrder yy478; + SAlterOption yy505; + EFillMode yy574; + ENullOrder yy617; + SShowTablesOption yy677; + int64_t yy709; + SToken yy729; + int8_t yy863; + EOperatorType yy900; + bool yy957; + EJoinType yy992; + SNode* yy1032; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -143,18 +143,18 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 869 -#define YYNRULE 687 -#define YYNRULE_WITH_ACTION 687 -#define YYNTOKEN 361 -#define YY_MAX_SHIFT 868 -#define YY_MIN_SHIFTREDUCE 1304 -#define YY_MAX_SHIFTREDUCE 1990 -#define YY_ERROR_ACTION 1991 -#define YY_ACCEPT_ACTION 1992 -#define YY_NO_ACTION 1993 -#define YY_MIN_REDUCE 1994 -#define YY_MAX_REDUCE 2680 +#define YYNSTATE 870 +#define YYNRULE 688 +#define YYNRULE_WITH_ACTION 688 +#define YYNTOKEN 362 +#define YY_MAX_SHIFT 869 +#define YY_MIN_SHIFTREDUCE 1305 +#define YY_MAX_SHIFTREDUCE 1992 +#define YY_ERROR_ACTION 1993 +#define YY_ACCEPT_ACTION 1994 +#define YY_NO_ACTION 1995 +#define YY_MIN_REDUCE 1996 +#define YY_MAX_REDUCE 2683 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -221,919 +221,893 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (3259) +#define YY_ACTTAB_COUNT (3127) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 578, 107, 433, 579, 2037, 586, 2173, 720, 579, 2037, - /* 10 */ 170, 175, 47, 45, 1912, 2651, 595, 410, 2186, 2123, - /* 20 */ 424, 2017, 1735, 40, 39, 2235, 2177, 46, 44, 43, - /* 30 */ 42, 41, 2322, 719, 209, 1821, 2080, 1733, 2652, 721, - /* 40 */ 40, 39, 658, 2462, 46, 44, 43, 42, 41, 486, - /* 50 */ 2320, 757, 583, 732, 148, 9, 735, 656, 580, 654, - /* 60 */ 275, 274, 40, 39, 769, 1816, 46, 44, 43, 42, - /* 70 */ 41, 19, 596, 2315, 2428, 40, 39, 1764, 1741, 46, - /* 80 */ 44, 43, 42, 41, 2480, 40, 39, 29, 1760, 46, - /* 90 */ 44, 43, 42, 41, 545, 543, 2428, 375, 752, 769, - /* 100 */ 1760, 222, 37, 315, 865, 2421, 669, 15, 431, 840, - /* 110 */ 839, 838, 837, 442, 709, 836, 835, 153, 830, 829, - /* 120 */ 828, 827, 826, 825, 824, 152, 818, 817, 816, 441, - /* 130 */ 440, 813, 812, 811, 189, 188, 810, 183, 2461, 304, - /* 140 */ 1956, 2499, 2480, 1823, 1824, 115, 2463, 756, 2465, 2466, - /* 150 */ 751, 50, 774, 1761, 2438, 1344, 176, 192, 2006, 2553, - /* 160 */ 430, 1764, 1957, 420, 2549, 185, 2561, 731, 66, 140, - /* 170 */ 730, 774, 1887, 2656, 1351, 1928, 2656, 2651, 2442, 100, - /* 180 */ 1795, 1805, 435, 210, 2651, 2230, 2232, 1822, 1825, 113, - /* 190 */ 1763, 2600, 62, 770, 2184, 719, 209, 1346, 1349, 1350, - /* 200 */ 2652, 721, 1736, 2655, 1734, 708, 151, 2652, 2654, 1987, - /* 210 */ 1662, 40, 39, 139, 2176, 46, 44, 43, 42, 41, - /* 220 */ 621, 77, 129, 2444, 2447, 128, 127, 126, 125, 124, - /* 230 */ 123, 122, 121, 120, 774, 769, 1739, 1740, 1792, 200, - /* 240 */ 1794, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 748, - /* 250 */ 772, 771, 1815, 1817, 1818, 1819, 1820, 2, 47, 45, - /* 260 */ 1614, 1615, 1370, 373, 1369, 1758, 424, 710, 1735, 439, - /* 270 */ 438, 62, 529, 88, 385, 548, 1634, 1635, 1980, 144, - /* 280 */ 547, 1821, 705, 1733, 2083, 2573, 1884, 1885, 1886, 2573, - /* 290 */ 2573, 2573, 2573, 2573, 1742, 1765, 509, 1371, 549, 770, - /* 300 */ 2184, 40, 39, 374, 511, 46, 44, 43, 42, 41, - /* 310 */ 2016, 1816, 594, 1764, 489, 1451, 1508, 19, 1850, 139, - /* 320 */ 1633, 1636, 50, 204, 1741, 1986, 626, 311, 2175, 2389, - /* 330 */ 1499, 799, 798, 797, 1503, 796, 1505, 1506, 795, 792, - /* 340 */ 2656, 1514, 789, 1516, 1517, 786, 783, 780, 2651, 2438, - /* 350 */ 865, 396, 309, 15, 770, 2184, 1453, 640, 639, 638, - /* 360 */ 770, 2184, 497, 2428, 630, 145, 634, 2655, 311, 2422, - /* 370 */ 633, 2652, 2653, 2442, 213, 632, 637, 403, 402, 1765, - /* 380 */ 55, 631, 1851, 430, 627, 711, 706, 699, 695, 1823, - /* 390 */ 1824, 598, 2309, 2288, 774, 536, 535, 534, 533, 528, - /* 400 */ 527, 526, 525, 379, 1370, 1715, 1369, 515, 514, 513, - /* 410 */ 512, 506, 505, 504, 809, 499, 498, 394, 2444, 2446, - /* 420 */ 421, 490, 1602, 1603, 430, 1937, 1795, 1805, 1621, 774, - /* 430 */ 2655, 770, 2184, 1822, 1825, 774, 640, 639, 638, 1371, - /* 440 */ 1938, 202, 1760, 630, 145, 634, 1760, 311, 1736, 633, - /* 450 */ 1734, 483, 1353, 2224, 632, 637, 403, 402, 1759, 1945, - /* 460 */ 631, 1745, 667, 627, 36, 422, 1845, 1846, 1847, 1848, - /* 470 */ 1849, 1853, 1854, 1855, 1856, 205, 1889, 1890, 1891, 1892, - /* 480 */ 1893, 1936, 1739, 1740, 1792, 1792, 1794, 1797, 1798, 1799, - /* 490 */ 1800, 1801, 1802, 1803, 1804, 748, 772, 771, 1815, 1817, - /* 500 */ 1818, 1819, 1820, 2, 12, 47, 45, 46, 44, 43, - /* 510 */ 42, 41, 174, 424, 2462, 1735, 12, 349, 702, 701, - /* 520 */ 1943, 1944, 1946, 1947, 1948, 3, 1887, 753, 1821, 62, - /* 530 */ 1733, 1765, 190, 33, 347, 75, 1916, 53, 74, 40, - /* 540 */ 39, 2160, 1760, 46, 44, 43, 42, 41, 376, 1995, - /* 550 */ 1764, 685, 2462, 1992, 395, 2480, 2302, 215, 1816, 1994, - /* 560 */ 241, 560, 558, 555, 19, 750, 12, 2428, 10, 752, - /* 570 */ 129, 1741, 1718, 128, 127, 126, 125, 124, 123, 122, - /* 580 */ 121, 120, 2162, 138, 137, 136, 135, 134, 133, 132, - /* 590 */ 131, 130, 243, 2480, 479, 2322, 581, 865, 2045, 478, - /* 600 */ 15, 62, 1721, 1724, 1763, 2428, 1796, 752, 228, 2461, - /* 610 */ 427, 809, 2499, 2319, 757, 154, 115, 2463, 756, 2465, - /* 620 */ 2466, 751, 2568, 774, 770, 2184, 150, 51, 157, 2524, - /* 630 */ 2553, 770, 2184, 445, 420, 2549, 1823, 1824, 444, 63, - /* 640 */ 1884, 1885, 1886, 2015, 484, 686, 190, 2461, 2565, 91, - /* 650 */ 2499, 503, 90, 2651, 365, 2463, 756, 2465, 2466, 751, - /* 660 */ 749, 774, 740, 2518, 1793, 1887, 575, 647, 62, 2271, - /* 670 */ 2303, 2657, 209, 1795, 1805, 573, 2652, 721, 569, 565, - /* 680 */ 1822, 1825, 659, 60, 686, 732, 148, 1761, 85, 84, - /* 690 */ 482, 683, 2651, 221, 1741, 1736, 2428, 1734, 276, 2161, - /* 700 */ 800, 539, 1796, 2231, 2232, 311, 474, 472, 495, 2298, - /* 710 */ 2657, 209, 732, 148, 650, 2652, 721, 372, 89, 2169, - /* 720 */ 461, 644, 642, 458, 454, 450, 447, 475, 273, 1739, - /* 730 */ 1740, 1792, 723, 1794, 1797, 1798, 1799, 1800, 1801, 1802, - /* 740 */ 1803, 1804, 748, 772, 771, 1815, 1817, 1818, 1819, 1820, - /* 750 */ 2, 47, 45, 1826, 2462, 770, 2184, 224, 2237, 424, - /* 760 */ 1793, 1735, 477, 233, 476, 409, 309, 735, 1765, 71, - /* 770 */ 770, 2184, 70, 2235, 1821, 516, 1733, 311, 2573, 1884, - /* 780 */ 1885, 1886, 2573, 2573, 2573, 2573, 2573, 538, 232, 1852, - /* 790 */ 517, 741, 2462, 2525, 475, 2480, 734, 178, 2561, 2562, - /* 800 */ 2370, 146, 2566, 311, 1816, 753, 334, 2428, 35, 752, - /* 810 */ 1543, 1544, 770, 2184, 40, 39, 2237, 1741, 46, 44, - /* 820 */ 43, 42, 41, 393, 118, 2561, 2562, 2568, 146, 2566, - /* 830 */ 522, 2235, 518, 2480, 521, 807, 163, 162, 804, 803, - /* 840 */ 802, 160, 520, 865, 311, 2428, 48, 752, 2048, 2461, - /* 850 */ 2255, 2462, 2499, 2564, 1735, 280, 115, 2463, 756, 2465, - /* 860 */ 2466, 751, 2171, 774, 753, 2568, 2047, 96, 192, 1733, - /* 870 */ 2553, 34, 40, 39, 420, 2549, 46, 44, 43, 42, - /* 880 */ 41, 1857, 1823, 1824, 501, 2298, 2401, 2461, 2159, 463, - /* 890 */ 2499, 2563, 2480, 2180, 116, 2463, 756, 2465, 2466, 751, - /* 900 */ 858, 774, 2601, 720, 2428, 820, 752, 743, 2553, 2525, - /* 910 */ 1741, 2651, 2552, 2549, 43, 42, 41, 245, 628, 1795, - /* 920 */ 1805, 581, 96, 2045, 531, 2298, 1822, 1825, 1714, 719, - /* 930 */ 209, 770, 2184, 226, 2652, 721, 865, 686, 2167, 397, - /* 940 */ 278, 1736, 1448, 1734, 277, 2651, 2461, 149, 2179, 2499, - /* 950 */ 2524, 597, 2188, 115, 2463, 756, 2465, 2466, 751, 2237, - /* 960 */ 774, 732, 148, 2657, 209, 2671, 670, 2553, 2652, 721, - /* 970 */ 822, 420, 2549, 231, 739, 1739, 1740, 1792, 286, 1794, - /* 980 */ 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, 748, 772, - /* 990 */ 771, 1815, 1817, 1818, 1819, 1820, 2, 47, 45, 2462, - /* 1000 */ 2237, 1373, 1374, 770, 2184, 424, 2014, 1735, 2013, 524, - /* 1010 */ 523, 1909, 753, 99, 2608, 765, 382, 467, 1463, 408, - /* 1020 */ 1821, 660, 1733, 2181, 807, 163, 162, 804, 803, 802, - /* 1030 */ 160, 1831, 823, 1462, 1736, 2145, 1734, 1760, 2462, 2402, - /* 1040 */ 2480, 588, 2361, 2237, 469, 465, 172, 1351, 670, 747, - /* 1050 */ 1816, 753, 2428, 2621, 752, 2237, 770, 2184, 2236, 2428, - /* 1060 */ 279, 2428, 419, 1741, 14, 13, 617, 616, 1739, 1740, - /* 1070 */ 2235, 1349, 1350, 179, 2561, 2562, 281, 146, 2566, 2480, - /* 1080 */ 807, 163, 162, 804, 803, 802, 160, 770, 2184, 865, - /* 1090 */ 686, 2428, 48, 752, 2461, 1717, 2462, 2499, 2651, 1467, - /* 1100 */ 550, 115, 2463, 756, 2465, 2466, 751, 289, 774, 753, - /* 1110 */ 173, 697, 1760, 2671, 1466, 2553, 2657, 209, 2187, 420, - /* 1120 */ 2549, 2652, 721, 672, 2361, 1720, 1723, 801, 1823, 1824, - /* 1130 */ 2228, 665, 161, 2461, 724, 2012, 2499, 2480, 1683, 1684, - /* 1140 */ 115, 2463, 756, 2465, 2466, 751, 625, 774, 203, 2428, - /* 1150 */ 624, 752, 2671, 2011, 2553, 770, 2184, 2067, 420, 2549, - /* 1160 */ 770, 2184, 428, 770, 2184, 1795, 1805, 2010, 636, 635, - /* 1170 */ 173, 1864, 1822, 1825, 141, 738, 770, 2184, 2186, 641, - /* 1180 */ 323, 552, 686, 767, 401, 400, 87, 1736, 2428, 1734, - /* 1190 */ 2651, 2461, 619, 618, 2499, 671, 768, 1796, 115, 2463, - /* 1200 */ 756, 2465, 2466, 751, 2237, 774, 2428, 54, 2657, 209, - /* 1210 */ 2671, 429, 2553, 2652, 721, 805, 420, 2549, 2228, 2235, - /* 1220 */ 2428, 1739, 1740, 1792, 714, 1794, 1797, 1798, 1799, 1800, - /* 1230 */ 1801, 1802, 1803, 1804, 748, 772, 771, 1815, 1817, 1818, - /* 1240 */ 1819, 1820, 2, 47, 45, 2009, 686, 2462, 2008, 770, - /* 1250 */ 2184, 424, 727, 1735, 2651, 1793, 399, 398, 806, 623, - /* 1260 */ 753, 2228, 2644, 2005, 2237, 746, 1821, 433, 1733, 330, - /* 1270 */ 2392, 434, 2657, 209, 436, 173, 2004, 2652, 721, 2235, - /* 1280 */ 2003, 625, 173, 2186, 2462, 624, 834, 832, 2480, 1898, - /* 1290 */ 2186, 2002, 1908, 2001, 770, 2184, 1816, 753, 2428, 2585, - /* 1300 */ 2428, 2428, 752, 319, 320, 2000, 2281, 343, 318, 1741, - /* 1310 */ 2214, 1999, 266, 1998, 437, 264, 2428, 268, 2462, 736, - /* 1320 */ 267, 452, 662, 1997, 661, 2480, 2124, 2022, 860, 2428, - /* 1330 */ 1793, 753, 161, 2428, 161, 865, 290, 2428, 15, 752, - /* 1340 */ 270, 629, 2461, 269, 2428, 2499, 2428, 2065, 493, 115, - /* 1350 */ 2463, 756, 2465, 2466, 751, 2056, 774, 272, 2428, 2480, - /* 1360 */ 271, 2671, 2054, 2553, 2428, 1446, 2428, 420, 2549, 643, - /* 1370 */ 686, 2428, 693, 752, 1823, 1824, 2428, 645, 2651, 2461, - /* 1380 */ 101, 49, 2499, 49, 648, 193, 115, 2463, 756, 2465, - /* 1390 */ 2466, 751, 2449, 774, 1989, 1990, 2657, 209, 2671, 2007, - /* 1400 */ 2553, 2652, 721, 1406, 420, 2549, 1744, 1678, 725, 1681, - /* 1410 */ 1743, 1795, 1805, 2461, 14, 13, 2499, 161, 1822, 1825, - /* 1420 */ 115, 2463, 756, 2465, 2466, 751, 49, 774, 64, 49, - /* 1430 */ 1842, 112, 2528, 1736, 2553, 1734, 317, 183, 420, 2549, - /* 1440 */ 109, 76, 2614, 159, 1407, 329, 328, 1932, 161, 73, - /* 1450 */ 2451, 778, 305, 703, 159, 297, 1942, 161, 1941, 733, - /* 1460 */ 295, 142, 159, 143, 2481, 2121, 2120, 1739, 1740, 1792, - /* 1470 */ 814, 1794, 1797, 1798, 1799, 1800, 1801, 1802, 1803, 1804, - /* 1480 */ 748, 772, 771, 1815, 1817, 1818, 1819, 1820, 2, 439, - /* 1490 */ 438, 815, 737, 2462, 1425, 2307, 2038, 378, 377, 1749, - /* 1500 */ 2604, 1631, 700, 1858, 1806, 415, 753, 1725, 707, 411, - /* 1510 */ 759, 321, 1821, 443, 1742, 1423, 762, 2462, 325, 2308, - /* 1520 */ 1821, 2044, 1713, 1493, 342, 2225, 1521, 679, 728, 1525, - /* 1530 */ 753, 715, 1532, 2605, 2480, 2615, 1530, 164, 716, 307, - /* 1540 */ 302, 2146, 1816, 310, 5, 451, 2428, 391, 752, 446, - /* 1550 */ 1816, 459, 1768, 460, 470, 1741, 216, 217, 2480, 471, - /* 1560 */ 219, 473, 337, 2462, 1655, 1758, 487, 1759, 494, 230, - /* 1570 */ 2428, 541, 752, 1747, 496, 500, 753, 1746, 502, 507, - /* 1580 */ 519, 745, 530, 537, 2300, 532, 540, 542, 2461, 553, - /* 1590 */ 554, 2499, 551, 236, 235, 115, 2463, 756, 2465, 2466, - /* 1600 */ 751, 556, 774, 557, 2480, 238, 1766, 2526, 559, 2553, - /* 1610 */ 561, 576, 2461, 420, 2549, 2499, 2428, 4, 752, 115, - /* 1620 */ 2463, 756, 2465, 2466, 751, 577, 774, 585, 584, 587, - /* 1630 */ 246, 742, 1761, 2553, 93, 249, 1767, 420, 2549, 589, - /* 1640 */ 590, 1769, 252, 591, 593, 254, 1770, 2316, 94, 2462, - /* 1650 */ 95, 599, 259, 620, 2379, 651, 652, 2376, 2461, 369, - /* 1660 */ 622, 2499, 753, 117, 664, 180, 2463, 756, 2465, 2466, - /* 1670 */ 751, 98, 774, 2174, 263, 666, 155, 2170, 265, 1750, - /* 1680 */ 338, 1745, 166, 167, 2172, 2168, 168, 1726, 169, 1716, - /* 1690 */ 2480, 2375, 282, 1762, 674, 2362, 675, 673, 287, 681, - /* 1700 */ 704, 678, 2428, 680, 752, 285, 8, 760, 690, 713, - /* 1710 */ 689, 2620, 688, 1753, 1755, 691, 717, 2619, 182, 1719, - /* 1720 */ 1722, 1727, 298, 2592, 722, 2672, 718, 772, 771, 1815, - /* 1730 */ 1817, 1818, 1819, 1820, 296, 772, 771, 1815, 1817, 1818, - /* 1740 */ 1819, 1820, 292, 294, 2461, 299, 300, 2499, 416, 729, - /* 1750 */ 303, 116, 2463, 756, 2465, 2466, 751, 2650, 774, 301, - /* 1760 */ 726, 2674, 2572, 2462, 147, 2553, 1763, 2569, 1906, 744, - /* 1770 */ 2549, 1904, 196, 312, 156, 61, 753, 2534, 758, 339, - /* 1780 */ 2330, 340, 2329, 2462, 2328, 426, 763, 764, 158, 1, - /* 1790 */ 341, 2420, 106, 211, 2185, 2419, 753, 306, 2462, 108, - /* 1800 */ 2229, 1328, 344, 332, 2480, 862, 776, 859, 165, 864, - /* 1810 */ 348, 753, 368, 389, 346, 52, 2428, 390, 752, 2400, - /* 1820 */ 2399, 356, 367, 2398, 2480, 82, 357, 2393, 448, 449, - /* 1830 */ 1706, 1707, 214, 453, 2391, 455, 2428, 456, 752, 2480, - /* 1840 */ 457, 1705, 2390, 2388, 392, 462, 2387, 464, 2386, 2385, - /* 1850 */ 466, 2428, 468, 752, 2366, 1694, 218, 2365, 754, 220, - /* 1860 */ 1658, 2499, 1657, 83, 2343, 116, 2463, 756, 2465, 2466, - /* 1870 */ 751, 2342, 774, 2341, 480, 481, 2340, 2339, 2461, 2553, - /* 1880 */ 2290, 2499, 2462, 384, 2549, 177, 2463, 756, 2465, 2466, - /* 1890 */ 751, 2287, 774, 2461, 485, 753, 2499, 488, 2286, 2462, - /* 1900 */ 116, 2463, 756, 2465, 2466, 751, 2280, 774, 1601, 491, - /* 1910 */ 2277, 2276, 753, 492, 2553, 2462, 223, 2275, 2274, 2550, - /* 1920 */ 86, 2279, 2278, 2480, 2273, 2272, 2270, 225, 753, 2269, - /* 1930 */ 2268, 508, 687, 2611, 2267, 2428, 227, 752, 510, 2265, - /* 1940 */ 2480, 2264, 2263, 2262, 2285, 2261, 2260, 2259, 2283, 2266, - /* 1950 */ 2258, 2257, 2428, 2256, 752, 2254, 2480, 2253, 2252, 2251, - /* 1960 */ 2250, 2249, 229, 2248, 92, 2247, 2246, 2245, 2428, 234, - /* 1970 */ 752, 2284, 2282, 2244, 413, 2243, 1607, 2461, 2242, 2241, - /* 1980 */ 2499, 2240, 544, 546, 177, 2463, 756, 2465, 2466, 751, - /* 1990 */ 414, 774, 2239, 2238, 2461, 2086, 2462, 2499, 1464, 1468, - /* 2000 */ 237, 366, 2463, 756, 2465, 2466, 751, 1460, 774, 753, - /* 2010 */ 2461, 2085, 380, 2499, 2462, 2084, 2082, 366, 2463, 756, - /* 2020 */ 2465, 2466, 751, 2079, 774, 562, 564, 753, 566, 239, - /* 2030 */ 2462, 563, 2612, 381, 2078, 2071, 567, 2480, 568, 240, - /* 2040 */ 570, 571, 572, 750, 2058, 574, 2033, 242, 79, 2428, - /* 2050 */ 191, 752, 1352, 2032, 2448, 2480, 201, 244, 582, 2364, - /* 2060 */ 80, 2360, 2350, 2338, 251, 2337, 2314, 2428, 256, 752, - /* 2070 */ 2163, 2480, 253, 1399, 2081, 2077, 600, 601, 602, 2075, - /* 2080 */ 604, 605, 606, 2428, 2073, 752, 608, 610, 609, 2070, - /* 2090 */ 614, 2461, 612, 613, 2499, 2053, 2051, 2462, 359, 2463, - /* 2100 */ 756, 2465, 2466, 751, 2052, 774, 2050, 2029, 2165, 2461, - /* 2110 */ 753, 2164, 2499, 72, 1537, 1536, 180, 2463, 756, 2465, - /* 2120 */ 2466, 751, 1450, 774, 1449, 2461, 262, 1447, 2499, 1445, - /* 2130 */ 2462, 1444, 365, 2463, 756, 2465, 2466, 751, 2480, 774, - /* 2140 */ 1443, 2519, 1442, 753, 1436, 831, 1441, 833, 2068, 712, - /* 2150 */ 2428, 2066, 752, 1438, 1437, 1435, 404, 405, 2057, 406, - /* 2160 */ 2055, 407, 649, 646, 2028, 2027, 2026, 653, 2025, 655, - /* 2170 */ 2024, 2480, 423, 119, 657, 1688, 2673, 1690, 1687, 1692, - /* 2180 */ 28, 2363, 284, 2428, 2359, 752, 1664, 67, 2349, 1666, - /* 2190 */ 2336, 1668, 2461, 676, 56, 2499, 2656, 668, 2335, 366, - /* 2200 */ 2463, 756, 2465, 2466, 751, 425, 774, 57, 20, 677, - /* 2210 */ 1959, 17, 6, 1643, 288, 868, 692, 412, 698, 7, - /* 2220 */ 30, 682, 684, 1642, 696, 2461, 171, 291, 2499, 1933, - /* 2230 */ 694, 336, 366, 2463, 756, 2465, 2466, 751, 21, 774, - /* 2240 */ 22, 195, 32, 206, 293, 207, 2449, 199, 1901, 65, - /* 2250 */ 1940, 261, 181, 2462, 194, 1899, 856, 852, 848, 844, - /* 2260 */ 24, 333, 31, 1974, 1927, 1897, 753, 184, 81, 1973, - /* 2270 */ 208, 417, 1978, 1977, 23, 18, 615, 611, 607, 603, - /* 2280 */ 1979, 260, 1980, 59, 418, 2334, 1881, 308, 186, 2313, - /* 2290 */ 1880, 103, 58, 102, 2480, 25, 1833, 1832, 13, 1751, - /* 2300 */ 1843, 187, 114, 1808, 197, 326, 2428, 38, 752, 1807, - /* 2310 */ 11, 16, 1785, 26, 761, 755, 2312, 104, 1777, 109, - /* 2320 */ 27, 198, 97, 316, 322, 258, 1935, 69, 324, 105, - /* 2330 */ 327, 2504, 2503, 2462, 777, 432, 1810, 766, 773, 781, - /* 2340 */ 68, 784, 787, 790, 793, 1522, 753, 775, 663, 779, - /* 2350 */ 782, 2499, 1519, 1518, 331, 361, 2463, 756, 2465, 2466, - /* 2360 */ 751, 785, 774, 1531, 1515, 788, 1527, 1509, 2462, 1507, - /* 2370 */ 791, 794, 1397, 110, 2480, 111, 1513, 78, 1432, 1512, - /* 2380 */ 314, 753, 808, 1429, 1428, 1511, 2428, 313, 752, 1427, - /* 2390 */ 1426, 248, 2462, 1510, 1424, 1422, 1421, 1420, 1458, 212, - /* 2400 */ 257, 250, 819, 1457, 821, 753, 283, 255, 592, 2480, - /* 2410 */ 1418, 1417, 1416, 1415, 2462, 1414, 1413, 1412, 1454, 1452, - /* 2420 */ 1409, 2428, 1408, 752, 1405, 1404, 247, 753, 2461, 2076, - /* 2430 */ 1403, 2499, 1402, 2480, 841, 351, 2463, 756, 2465, 2466, - /* 2440 */ 751, 842, 774, 843, 2074, 2428, 845, 752, 847, 846, - /* 2450 */ 2072, 849, 851, 850, 2069, 2480, 853, 855, 2049, 2023, - /* 2460 */ 857, 1341, 854, 2461, 1329, 861, 2499, 2428, 335, 752, - /* 2470 */ 350, 2463, 756, 2465, 2466, 751, 863, 774, 1737, 345, - /* 2480 */ 1993, 866, 867, 1993, 1993, 1993, 1993, 2461, 1993, 1993, - /* 2490 */ 2499, 1993, 1993, 2462, 352, 2463, 756, 2465, 2466, 751, - /* 2500 */ 1993, 774, 1993, 1993, 1993, 1993, 753, 1993, 1993, 2461, - /* 2510 */ 1993, 1993, 2499, 1993, 2462, 1993, 358, 2463, 756, 2465, - /* 2520 */ 2466, 751, 1993, 774, 1993, 1993, 1993, 753, 1993, 1993, - /* 2530 */ 1993, 1993, 1993, 1993, 2480, 1993, 1993, 2462, 1993, 1993, - /* 2540 */ 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, - /* 2550 */ 753, 1993, 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, - /* 2560 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, - /* 2570 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, - /* 2580 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2461, 1993, - /* 2590 */ 2428, 2499, 752, 1993, 1993, 362, 2463, 756, 2465, 2466, - /* 2600 */ 751, 1993, 774, 1993, 1993, 1993, 1993, 1993, 1993, 2461, - /* 2610 */ 1993, 1993, 2499, 1993, 1993, 1993, 353, 2463, 756, 2465, - /* 2620 */ 2466, 751, 1993, 774, 2462, 1993, 1993, 1993, 1993, 1993, - /* 2630 */ 1993, 1993, 2461, 1993, 1993, 2499, 1993, 753, 1993, 363, - /* 2640 */ 2463, 756, 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, - /* 2650 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, - /* 2660 */ 1993, 1993, 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, - /* 2670 */ 1993, 1993, 753, 1993, 1993, 1993, 1993, 2428, 1993, 752, - /* 2680 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2690 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, 1993, - /* 2700 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2710 */ 1993, 753, 2428, 1993, 752, 1993, 1993, 1993, 1993, 2461, - /* 2720 */ 1993, 1993, 2499, 1993, 1993, 1993, 354, 2463, 756, 2465, - /* 2730 */ 2466, 751, 1993, 774, 1993, 1993, 1993, 1993, 1993, 2480, - /* 2740 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2750 */ 1993, 2428, 1993, 752, 2461, 1993, 2462, 2499, 1993, 1993, - /* 2760 */ 1993, 364, 2463, 756, 2465, 2466, 751, 1993, 774, 753, - /* 2770 */ 1993, 2462, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2780 */ 1993, 1993, 1993, 1993, 753, 1993, 2462, 1993, 1993, 1993, - /* 2790 */ 1993, 1993, 1993, 2461, 1993, 1993, 2499, 2480, 1993, 753, - /* 2800 */ 355, 2463, 756, 2465, 2466, 751, 1993, 774, 1993, 2428, - /* 2810 */ 1993, 752, 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2820 */ 1993, 1993, 1993, 1993, 2428, 1993, 752, 2480, 1993, 1993, - /* 2830 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, - /* 2840 */ 1993, 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2850 */ 1993, 2461, 1993, 1993, 2499, 2462, 1993, 1993, 370, 2463, - /* 2860 */ 756, 2465, 2466, 751, 1993, 774, 2461, 1993, 753, 2499, - /* 2870 */ 1993, 1993, 1993, 371, 2463, 756, 2465, 2466, 751, 1993, - /* 2880 */ 774, 2461, 1993, 1993, 2499, 2462, 1993, 1993, 2474, 2463, - /* 2890 */ 756, 2465, 2466, 751, 1993, 774, 2480, 1993, 753, 1993, - /* 2900 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, - /* 2910 */ 752, 1993, 1993, 1993, 1993, 2462, 1993, 1993, 1993, 1993, - /* 2920 */ 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, 753, 1993, - /* 2930 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2428, 1993, - /* 2940 */ 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2950 */ 2461, 1993, 1993, 2499, 1993, 1993, 2480, 2473, 2463, 756, - /* 2960 */ 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, 2428, 1993, - /* 2970 */ 752, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 2980 */ 2461, 1993, 2462, 2499, 1993, 1993, 1993, 2472, 2463, 756, - /* 2990 */ 2465, 2466, 751, 1993, 774, 753, 1993, 1993, 1993, 1993, - /* 3000 */ 1993, 1993, 2462, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 3010 */ 2461, 1993, 1993, 2499, 1993, 753, 1993, 386, 2463, 756, - /* 3020 */ 2465, 2466, 751, 2480, 774, 1993, 1993, 1993, 1993, 1993, - /* 3030 */ 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, 1993, - /* 3040 */ 1993, 1993, 1993, 2480, 1993, 1993, 1993, 1993, 1993, 1993, - /* 3050 */ 1993, 1993, 1993, 1993, 1993, 2428, 1993, 752, 1993, 1993, - /* 3060 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 3070 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2461, 1993, 2462, - /* 3080 */ 2499, 1993, 1993, 1993, 387, 2463, 756, 2465, 2466, 751, - /* 3090 */ 1993, 774, 753, 1993, 1993, 1993, 1993, 2461, 1993, 1993, - /* 3100 */ 2499, 1993, 1993, 1993, 383, 2463, 756, 2465, 2466, 751, - /* 3110 */ 1993, 774, 1993, 1993, 1993, 1993, 2462, 1993, 1993, 1993, - /* 3120 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 753, - /* 3130 */ 1993, 1993, 2428, 1993, 752, 1993, 1993, 1993, 1993, 1993, - /* 3140 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2462, - /* 3150 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2480, 1993, 1993, - /* 3160 */ 1993, 1993, 753, 1993, 1993, 1993, 1993, 1993, 1993, 2428, - /* 3170 */ 1993, 752, 1993, 1993, 2461, 1993, 1993, 2499, 1993, 1993, - /* 3180 */ 1993, 388, 2463, 756, 2465, 2466, 751, 1993, 774, 1993, - /* 3190 */ 2480, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 3200 */ 1993, 1993, 2428, 1993, 752, 1993, 1993, 1993, 1993, 1993, - /* 3210 */ 1993, 754, 1993, 1993, 2499, 1993, 1993, 1993, 361, 2463, - /* 3220 */ 756, 2465, 2466, 751, 1993, 774, 1993, 1993, 1993, 1993, - /* 3230 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, - /* 3240 */ 1993, 1993, 1993, 1993, 2461, 1993, 1993, 2499, 1993, 1993, - /* 3250 */ 1993, 360, 2463, 756, 2465, 2466, 751, 1993, 774, + /* 0 */ 2175, 771, 2186, 433, 2171, 771, 2186, 183, 2404, 304, + /* 10 */ 479, 170, 47, 45, 1914, 478, 96, 2405, 410, 2188, + /* 20 */ 424, 213, 1737, 40, 39, 139, 2237, 46, 44, 43, + /* 30 */ 42, 41, 622, 397, 1762, 1823, 2082, 1735, 107, 2325, + /* 40 */ 40, 39, 2181, 2465, 46, 44, 43, 42, 41, 770, + /* 50 */ 771, 2186, 175, 733, 148, 9, 736, 2323, 758, 687, + /* 60 */ 2125, 687, 1371, 2179, 1370, 1818, 2239, 2654, 687, 2654, + /* 70 */ 139, 19, 670, 393, 2659, 66, 2654, 627, 1743, 144, + /* 80 */ 710, 2237, 2654, 595, 2483, 2660, 209, 2660, 209, 770, + /* 90 */ 2655, 722, 2655, 722, 2660, 209, 2431, 1372, 753, 2655, + /* 100 */ 722, 2658, 495, 2301, 866, 2655, 2657, 15, 2483, 841, + /* 110 */ 840, 839, 838, 442, 228, 837, 836, 153, 831, 830, + /* 120 */ 829, 828, 827, 826, 825, 152, 819, 818, 817, 441, + /* 130 */ 440, 814, 813, 812, 189, 188, 811, 770, 2464, 463, + /* 140 */ 1958, 2502, 596, 1825, 1826, 115, 2466, 757, 2468, 2469, + /* 150 */ 752, 224, 775, 721, 1763, 91, 2177, 192, 90, 2556, + /* 160 */ 671, 2654, 1918, 420, 2552, 185, 2564, 732, 1762, 140, + /* 170 */ 731, 709, 1371, 1889, 1370, 659, 50, 2654, 62, 720, + /* 180 */ 209, 1797, 1807, 210, 2655, 722, 599, 1762, 1824, 1827, + /* 190 */ 657, 2603, 655, 275, 274, 720, 209, 1763, 597, 2318, + /* 200 */ 2655, 722, 1997, 1738, 668, 1736, 2424, 1372, 1833, 431, + /* 210 */ 1989, 430, 40, 39, 1762, 62, 46, 44, 43, 42, + /* 220 */ 41, 1743, 775, 129, 50, 89, 128, 127, 126, 125, + /* 230 */ 124, 123, 122, 121, 120, 589, 2364, 1741, 1742, 1794, + /* 240 */ 810, 1796, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, + /* 250 */ 749, 773, 772, 1817, 1819, 1820, 1821, 1822, 2, 47, + /* 260 */ 45, 430, 501, 2301, 373, 1762, 1760, 424, 467, 1737, + /* 270 */ 801, 51, 775, 529, 62, 385, 549, 1636, 1637, 531, + /* 280 */ 2301, 548, 1823, 2239, 1735, 2085, 2576, 1886, 1887, 1888, + /* 290 */ 2576, 2576, 2576, 2576, 2576, 469, 465, 509, 740, 550, + /* 300 */ 2441, 202, 40, 39, 374, 511, 46, 44, 43, 42, + /* 310 */ 41, 226, 1818, 2226, 1766, 489, 486, 1509, 19, 1852, + /* 320 */ 1544, 1545, 1635, 1638, 2445, 1743, 1988, 12, 231, 1798, + /* 330 */ 1345, 1500, 800, 799, 798, 1504, 797, 1506, 1507, 796, + /* 340 */ 793, 112, 1515, 790, 1517, 1518, 787, 784, 781, 1352, + /* 350 */ 109, 866, 396, 311, 15, 311, 439, 438, 641, 640, + /* 360 */ 639, 546, 544, 497, 375, 631, 145, 635, 222, 2447, + /* 370 */ 2450, 634, 1347, 1350, 1351, 1798, 633, 638, 403, 402, + /* 380 */ 775, 1744, 632, 3, 1853, 628, 2163, 1795, 771, 2186, + /* 390 */ 1825, 1826, 311, 2312, 2291, 53, 537, 536, 535, 534, + /* 400 */ 533, 528, 527, 526, 525, 379, 706, 1766, 55, 515, + /* 410 */ 514, 513, 512, 506, 505, 504, 584, 499, 498, 394, + /* 420 */ 37, 315, 581, 490, 1604, 1605, 1616, 1617, 1797, 1807, + /* 430 */ 1623, 733, 148, 1795, 129, 1824, 1827, 128, 127, 126, + /* 440 */ 125, 124, 123, 122, 121, 120, 1452, 2659, 311, 1765, + /* 450 */ 1738, 311, 1736, 40, 39, 835, 833, 46, 44, 43, + /* 460 */ 42, 41, 334, 1889, 1765, 2019, 36, 422, 1847, 1848, + /* 470 */ 1849, 1850, 1851, 1855, 1856, 1857, 1858, 205, 29, 46, + /* 480 */ 44, 43, 42, 41, 1741, 1742, 1794, 1454, 1796, 1799, + /* 490 */ 1800, 1801, 1802, 1803, 1804, 1805, 1806, 749, 773, 772, + /* 500 */ 1817, 1819, 1820, 1821, 1822, 2, 12, 47, 45, 712, + /* 510 */ 707, 700, 696, 62, 174, 424, 2465, 1737, 2431, 349, + /* 520 */ 2274, 671, 808, 163, 162, 805, 804, 803, 160, 754, + /* 530 */ 1823, 2239, 1735, 1767, 190, 2441, 347, 75, 409, 1889, + /* 540 */ 74, 1766, 735, 178, 2564, 2565, 2237, 146, 2569, 1747, + /* 550 */ 376, 626, 1982, 1959, 2465, 625, 395, 2483, 2305, 2445, + /* 560 */ 1818, 1996, 241, 561, 559, 556, 19, 736, 243, 2431, + /* 570 */ 200, 753, 582, 1743, 2047, 2571, 2576, 1886, 1887, 1888, + /* 580 */ 2576, 2576, 2576, 2576, 2576, 138, 137, 136, 135, 134, + /* 590 */ 133, 132, 131, 130, 711, 2483, 673, 2364, 2325, 866, + /* 600 */ 540, 2568, 15, 62, 2447, 2449, 421, 2431, 477, 753, + /* 610 */ 476, 2464, 309, 427, 2502, 775, 2322, 758, 115, 2466, + /* 620 */ 757, 2468, 2469, 752, 1911, 775, 1767, 309, 150, 245, + /* 630 */ 157, 2527, 2556, 582, 821, 2047, 420, 2552, 1825, 1826, + /* 640 */ 475, 63, 808, 163, 162, 805, 804, 803, 160, 2464, + /* 650 */ 2233, 2234, 2502, 1886, 1887, 1888, 115, 2466, 757, 2468, + /* 660 */ 2469, 752, 233, 775, 648, 771, 2186, 1407, 192, 2425, + /* 670 */ 2556, 1374, 1375, 428, 420, 2552, 1797, 1807, 686, 660, + /* 680 */ 113, 173, 522, 1824, 1827, 483, 521, 539, 232, 2188, + /* 690 */ 311, 85, 84, 482, 520, 276, 221, 151, 1738, 823, + /* 700 */ 1736, 1717, 2604, 579, 204, 2178, 580, 2039, 1408, 474, + /* 710 */ 472, 651, 1891, 1892, 1893, 1894, 1895, 278, 645, 643, + /* 720 */ 372, 277, 1947, 461, 430, 273, 458, 454, 450, 447, + /* 730 */ 475, 161, 1741, 1742, 1794, 775, 1796, 1799, 1800, 1801, + /* 740 */ 1802, 1803, 1804, 1805, 1806, 749, 773, 772, 1817, 1819, + /* 750 */ 1820, 1821, 1822, 2, 47, 45, 1828, 2465, 771, 2186, + /* 760 */ 1767, 176, 424, 2008, 1737, 2258, 71, 2571, 1716, 70, + /* 770 */ 754, 587, 2049, 2018, 580, 2039, 1352, 1823, 484, 1735, + /* 780 */ 311, 703, 702, 1945, 1946, 1948, 1949, 1950, 2239, 2465, + /* 790 */ 2173, 99, 2017, 2567, 382, 419, 576, 408, 2483, 661, + /* 800 */ 1350, 1351, 754, 2237, 2611, 574, 54, 1818, 570, 566, + /* 810 */ 2431, 60, 753, 1794, 641, 640, 639, 771, 2186, 684, + /* 820 */ 1743, 631, 145, 635, 2239, 1737, 2431, 634, 2169, 1854, + /* 830 */ 2483, 429, 633, 638, 403, 402, 2239, 503, 632, 2237, + /* 840 */ 1735, 628, 2431, 434, 753, 2431, 866, 733, 148, 48, + /* 850 */ 435, 2237, 2464, 2232, 2234, 2502, 771, 2186, 2190, 115, + /* 860 */ 2466, 757, 2468, 2469, 752, 2016, 775, 2465, 12, 1720, + /* 870 */ 10, 2674, 742, 2556, 2528, 1464, 516, 420, 2552, 715, + /* 880 */ 751, 1743, 771, 2186, 2464, 1825, 1826, 2502, 637, 636, + /* 890 */ 1463, 115, 2466, 757, 2468, 2469, 752, 728, 775, 1723, + /* 900 */ 1726, 824, 517, 2674, 2147, 2556, 1910, 866, 2483, 420, + /* 910 */ 2552, 34, 771, 2186, 149, 733, 148, 2527, 2431, 2659, + /* 920 */ 2431, 1859, 753, 1797, 1807, 524, 523, 2654, 1468, 1762, + /* 930 */ 1824, 1827, 518, 40, 39, 286, 1719, 46, 44, 43, + /* 940 */ 42, 41, 33, 1467, 1900, 1738, 2658, 1736, 40, 39, + /* 950 */ 2655, 2656, 46, 44, 43, 42, 41, 551, 203, 118, + /* 960 */ 2564, 2565, 2464, 146, 2569, 2502, 1722, 1725, 279, 365, + /* 970 */ 2466, 757, 2468, 2469, 752, 750, 775, 741, 2521, 1741, + /* 980 */ 1742, 1794, 2015, 1796, 1799, 1800, 1801, 1802, 1803, 1804, + /* 990 */ 1805, 1806, 749, 773, 772, 1817, 1819, 1820, 1821, 1822, + /* 1000 */ 2, 47, 45, 2465, 2014, 433, 1738, 2658, 1736, 424, + /* 1010 */ 553, 1737, 748, 173, 771, 2186, 754, 2571, 2624, 771, + /* 1020 */ 2186, 2188, 771, 2186, 1823, 2162, 1735, 179, 2564, 2565, + /* 1030 */ 436, 146, 2569, 1930, 598, 2431, 2465, 2617, 173, 2183, + /* 1040 */ 1741, 1742, 281, 2566, 2483, 2161, 2188, 1685, 1686, 754, + /* 1050 */ 2392, 698, 190, 744, 1818, 2528, 2431, 2431, 753, 35, + /* 1060 */ 771, 2186, 43, 42, 41, 40, 39, 1743, 2013, 46, + /* 1070 */ 44, 43, 42, 41, 771, 2186, 2306, 2483, 40, 39, + /* 1080 */ 289, 2373, 46, 44, 43, 42, 41, 319, 320, 2431, + /* 1090 */ 1798, 753, 318, 866, 739, 810, 48, 2126, 2464, 96, + /* 1100 */ 2012, 2502, 771, 2186, 305, 115, 2466, 757, 2468, 2469, + /* 1110 */ 752, 2011, 775, 2465, 2010, 771, 2186, 2674, 183, 2556, + /* 1120 */ 1994, 2431, 323, 420, 2552, 2182, 754, 771, 2186, 771, + /* 1130 */ 2186, 2464, 1825, 1826, 2502, 768, 280, 2007, 115, 2466, + /* 1140 */ 757, 2468, 2469, 752, 725, 775, 1939, 769, 1795, 330, + /* 1150 */ 2674, 2006, 2556, 2431, 2483, 802, 420, 2552, 2230, 771, + /* 1160 */ 2186, 1940, 618, 617, 2431, 2239, 2431, 2431, 753, 1354, + /* 1170 */ 1797, 1807, 620, 619, 729, 1761, 2239, 1824, 1827, 437, + /* 1180 */ 766, 808, 163, 162, 805, 804, 803, 160, 14, 13, + /* 1190 */ 2431, 2238, 1738, 806, 1736, 173, 2230, 401, 400, 2005, + /* 1200 */ 445, 2004, 1938, 2189, 2431, 444, 2395, 2003, 2464, 2002, + /* 1210 */ 1766, 2502, 747, 2001, 2000, 180, 2466, 757, 2468, 2469, + /* 1220 */ 752, 807, 775, 1999, 2230, 1762, 1741, 1742, 1794, 666, + /* 1230 */ 1796, 1799, 1800, 1801, 1802, 1803, 1804, 1805, 1806, 749, + /* 1240 */ 773, 772, 1817, 1819, 1820, 1821, 1822, 2, 47, 45, + /* 1250 */ 2465, 687, 2431, 172, 2431, 100, 424, 452, 1737, 2654, + /* 1260 */ 2431, 343, 2431, 754, 2216, 2647, 2431, 2431, 77, 399, + /* 1270 */ 398, 1823, 624, 1735, 723, 2675, 2431, 2660, 209, 215, + /* 1280 */ 687, 141, 2655, 722, 2024, 861, 1664, 2284, 2654, 2465, + /* 1290 */ 704, 2483, 721, 87, 626, 1866, 629, 161, 625, 2164, + /* 1300 */ 2654, 1818, 754, 2431, 2588, 753, 2660, 209, 161, 630, + /* 1310 */ 724, 2655, 722, 2069, 1743, 694, 439, 438, 720, 209, + /* 1320 */ 1449, 88, 266, 2655, 722, 264, 1751, 2067, 268, 493, + /* 1330 */ 2483, 267, 154, 1447, 270, 642, 2058, 269, 672, 1823, + /* 1340 */ 866, 1744, 2431, 15, 753, 2464, 2056, 2465, 2502, 644, + /* 1350 */ 1991, 1992, 115, 2466, 757, 2468, 2469, 752, 646, 775, + /* 1360 */ 754, 663, 272, 662, 2674, 271, 2556, 290, 649, 1818, + /* 1370 */ 420, 2552, 1680, 49, 14, 13, 2009, 2452, 1844, 1825, + /* 1380 */ 1826, 297, 1743, 1683, 2464, 161, 734, 2502, 2483, 687, + /* 1390 */ 1934, 115, 2466, 757, 2468, 2469, 752, 2654, 775, 1746, + /* 1400 */ 2431, 49, 753, 2674, 1745, 2556, 329, 328, 746, 420, + /* 1410 */ 2552, 101, 143, 815, 816, 2660, 209, 1797, 1807, 726, + /* 1420 */ 2655, 722, 2484, 193, 1824, 1827, 40, 39, 64, 1767, + /* 1430 */ 46, 44, 43, 42, 41, 2454, 49, 1426, 1424, 1738, + /* 1440 */ 73, 1736, 2464, 2123, 1795, 2502, 2122, 2040, 1944, 115, + /* 1450 */ 2466, 757, 2468, 2469, 752, 49, 775, 317, 76, 2310, + /* 1460 */ 738, 2531, 159, 2556, 161, 779, 2607, 420, 2552, 159, + /* 1470 */ 161, 2050, 701, 1741, 1742, 1794, 1943, 1796, 1799, 1800, + /* 1480 */ 1801, 1802, 1803, 1804, 1805, 1806, 749, 773, 772, 1817, + /* 1490 */ 1819, 1820, 1821, 1822, 2, 378, 377, 2465, 295, 142, + /* 1500 */ 415, 159, 708, 1860, 411, 1727, 760, 1752, 443, 1747, + /* 1510 */ 754, 1808, 2311, 2046, 2227, 342, 680, 2608, 1823, 2618, + /* 1520 */ 1715, 716, 717, 859, 307, 302, 310, 2148, 5, 451, + /* 1530 */ 1633, 391, 321, 763, 446, 459, 2465, 325, 2483, 1494, + /* 1540 */ 1522, 1755, 1757, 460, 1526, 1533, 1770, 471, 1818, 754, + /* 1550 */ 2431, 470, 753, 216, 261, 773, 772, 1817, 1819, 1820, + /* 1560 */ 1821, 1822, 217, 473, 219, 1657, 337, 1749, 1760, 487, + /* 1570 */ 184, 1761, 1748, 494, 1531, 230, 164, 2483, 500, 616, + /* 1580 */ 612, 608, 604, 496, 260, 542, 502, 507, 519, 2431, + /* 1590 */ 2303, 753, 2464, 530, 2465, 2502, 532, 538, 541, 115, + /* 1600 */ 2466, 757, 2468, 2469, 752, 543, 775, 754, 554, 555, + /* 1610 */ 552, 2529, 236, 2556, 235, 557, 558, 420, 2552, 238, + /* 1620 */ 560, 562, 1768, 577, 4, 97, 585, 1763, 258, 578, + /* 1630 */ 590, 2464, 586, 588, 2502, 2483, 246, 93, 115, 2466, + /* 1640 */ 757, 2468, 2469, 752, 1769, 775, 249, 2431, 591, 753, + /* 1650 */ 743, 1771, 2556, 592, 252, 594, 420, 2552, 254, 1772, + /* 1660 */ 2319, 600, 621, 94, 95, 737, 259, 623, 2465, 2176, + /* 1670 */ 117, 263, 2172, 265, 652, 653, 166, 167, 369, 2174, + /* 1680 */ 2170, 754, 665, 98, 338, 168, 1728, 169, 1718, 2464, + /* 1690 */ 667, 1764, 2502, 155, 282, 248, 116, 2466, 757, 2468, + /* 1700 */ 2469, 752, 2365, 775, 257, 250, 2382, 2379, 2378, 2483, + /* 1710 */ 2556, 255, 593, 675, 2555, 2552, 687, 674, 1721, 1724, + /* 1720 */ 1729, 2431, 287, 753, 2654, 679, 682, 691, 681, 705, + /* 1730 */ 247, 2623, 761, 292, 773, 772, 1817, 1819, 1820, 1821, + /* 1740 */ 1822, 285, 2660, 209, 8, 2465, 676, 2655, 722, 2622, + /* 1750 */ 294, 2595, 714, 692, 690, 182, 296, 689, 754, 301, + /* 1760 */ 719, 2575, 298, 2464, 299, 300, 2502, 718, 416, 2465, + /* 1770 */ 116, 2466, 757, 2468, 2469, 752, 2677, 775, 1765, 730, + /* 1780 */ 727, 2572, 754, 1908, 2556, 1906, 2483, 147, 745, 2552, + /* 1790 */ 196, 2465, 303, 61, 312, 2537, 156, 339, 2431, 759, + /* 1800 */ 753, 2333, 211, 2332, 754, 1, 2331, 340, 764, 2653, + /* 1810 */ 2483, 426, 158, 2187, 765, 341, 2423, 106, 108, 344, + /* 1820 */ 306, 1329, 2431, 332, 753, 777, 2422, 860, 863, 2465, + /* 1830 */ 165, 368, 2483, 865, 2231, 52, 389, 346, 348, 390, + /* 1840 */ 755, 2403, 754, 2502, 2431, 356, 753, 116, 2466, 757, + /* 1850 */ 2468, 2469, 752, 367, 775, 357, 2402, 2401, 82, 2396, + /* 1860 */ 448, 2556, 449, 1708, 2464, 384, 2552, 2502, 1709, 214, + /* 1870 */ 2483, 177, 2466, 757, 2468, 2469, 752, 453, 775, 2394, + /* 1880 */ 455, 456, 2431, 457, 753, 1707, 2464, 392, 2391, 2502, + /* 1890 */ 2393, 462, 2390, 116, 2466, 757, 2468, 2469, 752, 464, + /* 1900 */ 775, 2389, 2465, 466, 2388, 468, 1696, 2556, 2369, 218, + /* 1910 */ 2368, 220, 2553, 83, 1660, 754, 1659, 2346, 688, 2614, + /* 1920 */ 2345, 2344, 480, 481, 2464, 2343, 2342, 2502, 2293, 485, + /* 1930 */ 2290, 177, 2466, 757, 2468, 2469, 752, 488, 775, 2289, + /* 1940 */ 1603, 2283, 491, 2483, 492, 2280, 223, 2279, 86, 2278, + /* 1950 */ 2277, 2282, 2281, 2276, 2275, 2431, 225, 753, 2273, 2272, + /* 1960 */ 2465, 2271, 227, 2270, 508, 2268, 510, 2267, 2266, 2265, + /* 1970 */ 2288, 2264, 2263, 754, 2262, 2286, 2269, 413, 2261, 2615, + /* 1980 */ 2260, 2259, 2257, 2465, 2256, 2255, 2254, 2253, 2252, 229, + /* 1990 */ 2251, 92, 2250, 2249, 2248, 2247, 754, 2464, 2287, 2285, + /* 2000 */ 2502, 2483, 2246, 2245, 366, 2466, 757, 2468, 2469, 752, + /* 2010 */ 2244, 775, 234, 2431, 2243, 753, 545, 2242, 2465, 1609, + /* 2020 */ 547, 2241, 2240, 1465, 2483, 2088, 1469, 380, 1461, 381, + /* 2030 */ 2087, 754, 1353, 253, 2340, 414, 2431, 2086, 753, 2084, + /* 2040 */ 2081, 2080, 2073, 563, 2060, 567, 2035, 2034, 237, 565, + /* 2050 */ 571, 564, 2367, 569, 239, 2464, 191, 573, 2502, 2483, + /* 2060 */ 568, 240, 366, 2466, 757, 2468, 2469, 752, 575, 775, + /* 2070 */ 572, 2431, 242, 753, 2363, 2451, 2353, 201, 2464, 244, + /* 2080 */ 79, 2502, 583, 2341, 256, 359, 2466, 757, 2468, 2469, + /* 2090 */ 752, 80, 775, 251, 2317, 2165, 1400, 2083, 2079, 601, + /* 2100 */ 603, 2465, 605, 607, 602, 2077, 606, 2075, 609, 611, + /* 2110 */ 610, 2072, 613, 2464, 751, 614, 2502, 2055, 2053, 615, + /* 2120 */ 180, 2466, 757, 2468, 2469, 752, 2054, 775, 2052, 2031, + /* 2130 */ 2167, 72, 1537, 262, 2166, 2070, 713, 1538, 2465, 647, + /* 2140 */ 1451, 1450, 2483, 1448, 2068, 1446, 1445, 832, 2059, 1444, + /* 2150 */ 1443, 754, 1442, 834, 2431, 1437, 753, 2057, 1439, 1438, + /* 2160 */ 1436, 404, 407, 405, 406, 2030, 2029, 2028, 650, 654, + /* 2170 */ 2027, 2026, 658, 656, 119, 1690, 2465, 1694, 2366, 2483, + /* 2180 */ 2676, 2362, 1692, 1689, 1666, 28, 67, 2352, 2339, 754, + /* 2190 */ 1668, 2431, 284, 753, 677, 56, 2464, 2659, 669, 2502, + /* 2200 */ 2338, 17, 20, 365, 2466, 757, 2468, 2469, 752, 1961, + /* 2210 */ 775, 693, 2522, 423, 2465, 1901, 869, 2483, 21, 412, + /* 2220 */ 23, 65, 22, 30, 697, 6, 57, 754, 678, 2431, + /* 2230 */ 7, 753, 336, 2464, 291, 195, 2502, 1645, 32, 1670, + /* 2240 */ 366, 2466, 757, 2468, 2469, 752, 288, 775, 199, 207, + /* 2250 */ 206, 425, 2465, 1644, 171, 2483, 683, 857, 853, 849, + /* 2260 */ 845, 1935, 333, 685, 699, 754, 695, 2431, 293, 753, + /* 2270 */ 1942, 2464, 1929, 2452, 2502, 1903, 24, 1976, 366, 2466, + /* 2280 */ 757, 2468, 2469, 752, 1899, 775, 181, 1975, 417, 1980, + /* 2290 */ 194, 31, 1979, 2483, 1981, 308, 418, 81, 2465, 208, + /* 2300 */ 59, 1982, 186, 114, 1883, 2431, 326, 753, 2337, 664, + /* 2310 */ 2316, 754, 2502, 103, 1882, 102, 361, 2466, 757, 2468, + /* 2320 */ 2469, 752, 25, 775, 1835, 1834, 13, 1753, 11, 1845, + /* 2330 */ 58, 1810, 38, 187, 1809, 16, 26, 197, 767, 2483, + /* 2340 */ 1779, 1787, 27, 762, 316, 18, 198, 2464, 2315, 1937, + /* 2350 */ 2502, 2431, 322, 753, 351, 2466, 757, 2468, 2469, 752, + /* 2360 */ 104, 775, 327, 69, 756, 109, 778, 105, 2507, 2506, + /* 2370 */ 2465, 1812, 774, 68, 776, 432, 324, 1523, 1520, 780, + /* 2380 */ 782, 783, 314, 754, 1519, 786, 785, 1516, 788, 313, + /* 2390 */ 789, 791, 792, 2464, 1510, 1508, 2502, 2465, 794, 795, + /* 2400 */ 350, 2466, 757, 2468, 2469, 752, 110, 775, 283, 1514, + /* 2410 */ 754, 2483, 331, 111, 1532, 1528, 78, 1398, 1513, 1512, + /* 2420 */ 1433, 1511, 1430, 2431, 809, 753, 1429, 820, 2465, 1428, + /* 2430 */ 1459, 1427, 1425, 1423, 1422, 1421, 1458, 822, 2483, 212, + /* 2440 */ 1419, 754, 1418, 1416, 1417, 1415, 1414, 1413, 1455, 1453, + /* 2450 */ 2431, 1410, 753, 1409, 1406, 1405, 1404, 1403, 2078, 842, + /* 2460 */ 2076, 844, 843, 846, 847, 2464, 848, 2465, 2502, 2483, + /* 2470 */ 2074, 2071, 352, 2466, 757, 2468, 2469, 752, 850, 775, + /* 2480 */ 754, 2431, 851, 753, 852, 854, 855, 856, 2051, 858, + /* 2490 */ 1342, 2025, 2464, 868, 1330, 2502, 862, 335, 864, 358, + /* 2500 */ 2466, 757, 2468, 2469, 752, 1739, 775, 345, 2483, 1995, + /* 2510 */ 867, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, + /* 2520 */ 2431, 1995, 753, 2464, 1995, 1995, 2502, 1995, 1995, 1995, + /* 2530 */ 362, 2466, 757, 2468, 2469, 752, 1995, 775, 1995, 1995, + /* 2540 */ 1995, 1995, 2465, 1995, 1995, 1995, 1995, 1995, 1995, 1995, + /* 2550 */ 1995, 1995, 1995, 1995, 1995, 754, 1995, 1995, 1995, 1995, + /* 2560 */ 1995, 1995, 2464, 1995, 2465, 2502, 1995, 1995, 1995, 353, + /* 2570 */ 2466, 757, 2468, 2469, 752, 1995, 775, 754, 1995, 2465, + /* 2580 */ 1995, 1995, 1995, 2483, 1995, 1995, 1995, 1995, 1995, 1995, + /* 2590 */ 1995, 1995, 754, 1995, 1995, 2431, 1995, 753, 1995, 1995, + /* 2600 */ 1995, 1995, 2465, 1995, 1995, 2483, 1995, 1995, 1995, 1995, + /* 2610 */ 1995, 1995, 1995, 1995, 1995, 754, 1995, 2431, 1995, 753, + /* 2620 */ 2483, 1995, 1995, 2465, 1995, 1995, 1995, 1995, 1995, 1995, + /* 2630 */ 1995, 1995, 2431, 1995, 753, 1995, 754, 2464, 1995, 1995, + /* 2640 */ 2502, 1995, 1995, 2483, 363, 2466, 757, 2468, 2469, 752, + /* 2650 */ 1995, 775, 1995, 1995, 1995, 2431, 1995, 753, 1995, 2464, + /* 2660 */ 1995, 1995, 2502, 1995, 2483, 1995, 354, 2466, 757, 2468, + /* 2670 */ 2469, 752, 1995, 775, 2464, 1995, 2431, 2502, 753, 1995, + /* 2680 */ 1995, 364, 2466, 757, 2468, 2469, 752, 1995, 775, 1995, + /* 2690 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 2464, 1995, 1995, + /* 2700 */ 2502, 1995, 1995, 1995, 355, 2466, 757, 2468, 2469, 752, + /* 2710 */ 1995, 775, 1995, 1995, 1995, 1995, 1995, 1995, 2464, 1995, + /* 2720 */ 2465, 2502, 1995, 1995, 1995, 370, 2466, 757, 2468, 2469, + /* 2730 */ 752, 1995, 775, 754, 1995, 1995, 2465, 1995, 1995, 1995, + /* 2740 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 754, + /* 2750 */ 1995, 1995, 1995, 1995, 1995, 2465, 1995, 1995, 1995, 1995, + /* 2760 */ 1995, 2483, 1995, 1995, 1995, 1995, 1995, 1995, 754, 1995, + /* 2770 */ 1995, 1995, 1995, 2431, 1995, 753, 1995, 2483, 1995, 1995, + /* 2780 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 2431, + /* 2790 */ 1995, 753, 1995, 1995, 2465, 1995, 2483, 1995, 1995, 1995, + /* 2800 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 754, 2431, 1995, + /* 2810 */ 753, 1995, 1995, 1995, 1995, 2464, 1995, 1995, 2502, 1995, + /* 2820 */ 1995, 1995, 371, 2466, 757, 2468, 2469, 752, 1995, 775, + /* 2830 */ 1995, 2464, 1995, 2465, 2502, 2483, 1995, 1995, 2477, 2466, + /* 2840 */ 757, 2468, 2469, 752, 1995, 775, 754, 2431, 1995, 753, + /* 2850 */ 2464, 1995, 1995, 2502, 1995, 1995, 1995, 2476, 2466, 757, + /* 2860 */ 2468, 2469, 752, 1995, 775, 2465, 1995, 1995, 1995, 1995, + /* 2870 */ 1995, 1995, 1995, 1995, 2483, 1995, 1995, 1995, 754, 1995, + /* 2880 */ 1995, 1995, 1995, 1995, 1995, 1995, 2431, 1995, 753, 2464, + /* 2890 */ 1995, 1995, 2502, 1995, 1995, 1995, 2475, 2466, 757, 2468, + /* 2900 */ 2469, 752, 1995, 775, 1995, 1995, 2483, 1995, 1995, 1995, + /* 2910 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 2431, 1995, + /* 2920 */ 753, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 2464, 1995, + /* 2930 */ 1995, 2502, 1995, 1995, 1995, 386, 2466, 757, 2468, 2469, + /* 2940 */ 752, 1995, 775, 2465, 1995, 1995, 1995, 1995, 1995, 1995, + /* 2950 */ 1995, 1995, 1995, 1995, 1995, 1995, 754, 1995, 1995, 1995, + /* 2960 */ 2464, 1995, 1995, 2502, 1995, 1995, 1995, 387, 2466, 757, + /* 2970 */ 2468, 2469, 752, 1995, 775, 1995, 1995, 1995, 1995, 1995, + /* 2980 */ 1995, 2465, 1995, 1995, 2483, 1995, 1995, 1995, 1995, 1995, + /* 2990 */ 1995, 1995, 1995, 1995, 754, 1995, 2431, 1995, 753, 1995, + /* 3000 */ 1995, 1995, 2465, 1995, 1995, 1995, 1995, 1995, 1995, 1995, + /* 3010 */ 1995, 1995, 1995, 1995, 1995, 754, 1995, 2465, 1995, 1995, + /* 3020 */ 1995, 1995, 2483, 1995, 1995, 1995, 1995, 1995, 1995, 1995, + /* 3030 */ 754, 1995, 1995, 1995, 2431, 1995, 753, 1995, 2464, 1995, + /* 3040 */ 1995, 2502, 1995, 2483, 1995, 383, 2466, 757, 2468, 2469, + /* 3050 */ 752, 1995, 775, 1995, 1995, 2431, 1995, 753, 2483, 1995, + /* 3060 */ 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, + /* 3070 */ 2431, 1995, 753, 1995, 1995, 1995, 2464, 1995, 1995, 2502, + /* 3080 */ 1995, 1995, 1995, 388, 2466, 757, 2468, 2469, 752, 1995, + /* 3090 */ 775, 1995, 1995, 1995, 1995, 1995, 1995, 755, 1995, 1995, + /* 3100 */ 2502, 1995, 1995, 1995, 361, 2466, 757, 2468, 2469, 752, + /* 3110 */ 1995, 775, 2464, 1995, 1995, 2502, 1995, 1995, 1995, 360, + /* 3120 */ 2466, 757, 2468, 2469, 752, 1995, 775, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 371, 383, 397, 374, 375, 371, 406, 492, 374, 375, - /* 10 */ 405, 386, 12, 13, 14, 500, 376, 412, 413, 394, - /* 20 */ 20, 364, 22, 8, 9, 420, 408, 12, 13, 14, - /* 30 */ 15, 16, 419, 518, 519, 35, 0, 37, 523, 524, - /* 40 */ 8, 9, 21, 364, 12, 13, 14, 15, 16, 376, - /* 50 */ 437, 438, 14, 376, 377, 42, 377, 36, 20, 38, - /* 60 */ 39, 40, 8, 9, 20, 65, 12, 13, 14, 15, - /* 70 */ 16, 71, 432, 433, 417, 8, 9, 20, 78, 12, - /* 80 */ 13, 14, 15, 16, 405, 8, 9, 33, 20, 12, - /* 90 */ 13, 14, 15, 16, 421, 422, 417, 424, 419, 20, - /* 100 */ 20, 428, 481, 482, 104, 407, 20, 107, 410, 73, - /* 110 */ 74, 75, 76, 77, 377, 79, 80, 81, 82, 83, + /* 0 */ 407, 377, 378, 398, 407, 377, 378, 495, 442, 497, + /* 10 */ 442, 406, 12, 13, 14, 447, 386, 442, 413, 414, + /* 20 */ 20, 397, 22, 8, 9, 397, 421, 12, 13, 14, + /* 30 */ 15, 16, 404, 403, 20, 35, 0, 37, 384, 420, + /* 40 */ 8, 9, 412, 365, 12, 13, 14, 15, 16, 20, + /* 50 */ 377, 378, 387, 377, 378, 42, 378, 438, 439, 493, + /* 60 */ 395, 493, 20, 409, 22, 65, 406, 501, 493, 501, + /* 70 */ 397, 71, 20, 413, 493, 4, 501, 404, 78, 37, + /* 80 */ 378, 421, 501, 20, 406, 519, 520, 519, 520, 20, + /* 90 */ 524, 525, 524, 525, 519, 520, 418, 55, 420, 524, + /* 100 */ 525, 520, 377, 378, 104, 524, 525, 107, 406, 73, + /* 110 */ 74, 75, 76, 77, 65, 79, 80, 81, 82, 83, /* 120 */ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - /* 130 */ 94, 95, 96, 97, 98, 99, 100, 494, 459, 496, - /* 140 */ 108, 462, 405, 143, 144, 466, 467, 468, 469, 470, - /* 150 */ 471, 107, 473, 20, 393, 4, 363, 478, 365, 480, - /* 160 */ 462, 20, 108, 484, 485, 488, 489, 490, 4, 492, - /* 170 */ 493, 473, 159, 3, 23, 108, 492, 500, 417, 175, - /* 180 */ 180, 181, 415, 504, 500, 418, 419, 187, 188, 383, - /* 190 */ 20, 512, 107, 376, 377, 518, 519, 46, 47, 48, - /* 200 */ 523, 524, 202, 519, 204, 468, 400, 523, 524, 194, - /* 210 */ 206, 8, 9, 396, 408, 12, 13, 14, 15, 16, - /* 220 */ 403, 117, 21, 462, 463, 24, 25, 26, 27, 28, - /* 230 */ 29, 30, 31, 32, 473, 20, 236, 237, 238, 182, - /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 12, 13, - /* 260 */ 180, 181, 20, 18, 22, 20, 20, 20, 22, 12, - /* 270 */ 13, 107, 27, 169, 71, 30, 143, 144, 108, 37, - /* 280 */ 35, 35, 186, 37, 0, 272, 273, 274, 275, 276, - /* 290 */ 277, 278, 279, 280, 37, 238, 51, 55, 53, 376, - /* 300 */ 377, 8, 9, 58, 59, 12, 13, 14, 15, 16, - /* 310 */ 364, 65, 20, 20, 69, 37, 104, 71, 115, 396, - /* 320 */ 187, 188, 107, 182, 78, 310, 403, 283, 407, 0, - /* 330 */ 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - /* 340 */ 492, 129, 130, 131, 132, 133, 134, 135, 500, 393, - /* 350 */ 104, 106, 182, 107, 376, 377, 78, 73, 74, 75, - /* 360 */ 376, 377, 117, 417, 80, 81, 82, 519, 283, 407, - /* 370 */ 86, 523, 524, 417, 396, 91, 92, 93, 94, 238, - /* 380 */ 396, 97, 179, 462, 100, 289, 290, 291, 292, 143, - /* 390 */ 144, 70, 147, 148, 473, 150, 151, 152, 153, 154, - /* 400 */ 155, 156, 157, 158, 20, 37, 22, 162, 163, 164, - /* 410 */ 165, 166, 167, 168, 70, 170, 171, 172, 462, 463, - /* 420 */ 464, 176, 177, 178, 462, 22, 180, 181, 183, 473, - /* 430 */ 3, 376, 377, 187, 188, 473, 73, 74, 75, 55, - /* 440 */ 37, 404, 20, 80, 81, 82, 20, 283, 202, 86, - /* 450 */ 204, 396, 14, 416, 91, 92, 93, 94, 20, 236, - /* 460 */ 97, 204, 117, 100, 261, 262, 263, 264, 265, 266, - /* 470 */ 267, 268, 269, 270, 271, 182, 276, 277, 278, 279, - /* 480 */ 280, 78, 236, 237, 238, 238, 240, 241, 242, 243, - /* 490 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - /* 500 */ 254, 255, 256, 257, 258, 12, 13, 12, 13, 14, - /* 510 */ 15, 16, 18, 20, 364, 22, 258, 23, 295, 296, - /* 520 */ 297, 298, 299, 300, 301, 33, 159, 377, 35, 107, - /* 530 */ 37, 238, 405, 2, 40, 41, 14, 45, 44, 8, - /* 540 */ 9, 0, 20, 12, 13, 14, 15, 16, 54, 0, - /* 550 */ 20, 50, 364, 361, 427, 405, 429, 228, 65, 0, - /* 560 */ 66, 67, 68, 69, 71, 377, 258, 417, 260, 419, - /* 570 */ 21, 78, 204, 24, 25, 26, 27, 28, 29, 30, - /* 580 */ 31, 32, 0, 24, 25, 26, 27, 28, 29, 30, - /* 590 */ 31, 32, 372, 405, 441, 419, 376, 104, 378, 446, - /* 600 */ 107, 107, 234, 235, 20, 417, 180, 419, 65, 459, - /* 610 */ 434, 70, 462, 437, 438, 33, 466, 467, 468, 469, - /* 620 */ 470, 471, 465, 473, 376, 377, 476, 107, 478, 479, - /* 630 */ 480, 376, 377, 441, 484, 485, 143, 144, 446, 145, - /* 640 */ 273, 274, 275, 364, 396, 492, 405, 459, 491, 106, - /* 650 */ 462, 396, 109, 500, 466, 467, 468, 469, 470, 471, - /* 660 */ 472, 473, 474, 475, 238, 159, 51, 4, 107, 0, - /* 670 */ 429, 518, 519, 180, 181, 60, 523, 524, 63, 64, - /* 680 */ 187, 188, 19, 182, 492, 376, 377, 20, 194, 195, - /* 690 */ 196, 190, 500, 199, 78, 202, 417, 204, 35, 0, - /* 700 */ 117, 87, 180, 418, 419, 283, 212, 213, 376, 377, - /* 710 */ 518, 519, 376, 377, 51, 523, 524, 223, 175, 406, - /* 720 */ 226, 58, 59, 229, 230, 231, 232, 233, 65, 236, - /* 730 */ 237, 238, 305, 240, 241, 242, 243, 244, 245, 246, - /* 740 */ 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - /* 750 */ 257, 12, 13, 14, 364, 376, 377, 425, 405, 20, - /* 760 */ 238, 22, 201, 149, 203, 412, 182, 377, 238, 106, - /* 770 */ 376, 377, 109, 420, 35, 396, 37, 283, 272, 273, - /* 780 */ 274, 275, 276, 277, 278, 279, 280, 173, 174, 179, - /* 790 */ 396, 477, 364, 479, 233, 405, 487, 488, 489, 490, - /* 800 */ 401, 492, 493, 283, 65, 377, 34, 417, 2, 419, - /* 810 */ 143, 144, 376, 377, 8, 9, 405, 78, 12, 13, - /* 820 */ 14, 15, 16, 412, 488, 489, 490, 465, 492, 493, - /* 830 */ 161, 420, 396, 405, 165, 136, 137, 138, 139, 140, - /* 840 */ 141, 142, 173, 104, 283, 417, 107, 419, 0, 459, - /* 850 */ 0, 364, 462, 491, 22, 456, 466, 467, 468, 469, - /* 860 */ 470, 471, 406, 473, 377, 465, 379, 385, 478, 37, - /* 870 */ 480, 261, 8, 9, 484, 485, 12, 13, 14, 15, - /* 880 */ 16, 271, 143, 144, 376, 377, 441, 459, 0, 69, - /* 890 */ 462, 491, 405, 411, 466, 467, 468, 469, 470, 471, - /* 900 */ 52, 473, 512, 492, 417, 13, 419, 477, 480, 479, - /* 910 */ 78, 500, 484, 485, 14, 15, 16, 372, 13, 180, - /* 920 */ 181, 376, 385, 378, 376, 377, 187, 188, 37, 518, - /* 930 */ 519, 376, 377, 425, 523, 524, 104, 492, 406, 402, - /* 940 */ 138, 202, 37, 204, 142, 500, 459, 476, 411, 462, - /* 950 */ 479, 396, 406, 466, 467, 468, 469, 470, 471, 405, - /* 960 */ 473, 376, 377, 518, 519, 478, 376, 480, 523, 524, - /* 970 */ 78, 484, 485, 425, 420, 236, 237, 238, 406, 240, - /* 980 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - /* 990 */ 251, 252, 253, 254, 255, 256, 257, 12, 13, 364, - /* 1000 */ 405, 56, 57, 376, 377, 20, 364, 22, 364, 159, - /* 1010 */ 160, 4, 377, 211, 379, 420, 214, 197, 22, 217, - /* 1020 */ 35, 219, 37, 396, 136, 137, 138, 139, 140, 141, - /* 1030 */ 142, 14, 392, 37, 202, 395, 204, 20, 364, 441, - /* 1040 */ 405, 451, 452, 405, 224, 225, 182, 23, 376, 406, - /* 1050 */ 65, 377, 417, 379, 419, 405, 376, 377, 420, 417, - /* 1060 */ 137, 417, 412, 78, 1, 2, 381, 382, 236, 237, - /* 1070 */ 420, 47, 48, 488, 489, 490, 396, 492, 493, 405, - /* 1080 */ 136, 137, 138, 139, 140, 141, 142, 376, 377, 104, - /* 1090 */ 492, 417, 107, 419, 459, 204, 364, 462, 500, 22, - /* 1100 */ 104, 466, 467, 468, 469, 470, 471, 396, 473, 377, - /* 1110 */ 405, 379, 20, 478, 37, 480, 518, 519, 413, 484, - /* 1120 */ 485, 523, 524, 451, 452, 234, 235, 414, 143, 144, - /* 1130 */ 417, 441, 33, 459, 33, 364, 462, 405, 215, 216, - /* 1140 */ 466, 467, 468, 469, 470, 471, 136, 473, 447, 417, - /* 1150 */ 140, 419, 478, 364, 480, 376, 377, 0, 484, 485, - /* 1160 */ 376, 377, 397, 376, 377, 180, 181, 364, 390, 391, - /* 1170 */ 405, 108, 187, 188, 33, 396, 376, 377, 413, 22, - /* 1180 */ 396, 104, 492, 396, 39, 40, 45, 202, 417, 204, - /* 1190 */ 500, 459, 381, 382, 462, 441, 396, 180, 466, 467, - /* 1200 */ 468, 469, 470, 471, 405, 473, 417, 108, 518, 519, - /* 1210 */ 478, 412, 480, 523, 524, 414, 484, 485, 417, 420, - /* 1220 */ 417, 236, 237, 238, 13, 240, 241, 242, 243, 244, - /* 1230 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - /* 1240 */ 255, 256, 257, 12, 13, 364, 492, 364, 364, 376, - /* 1250 */ 377, 20, 33, 22, 500, 238, 111, 112, 414, 114, - /* 1260 */ 377, 417, 379, 364, 405, 71, 35, 397, 37, 396, - /* 1270 */ 0, 412, 518, 519, 397, 405, 364, 523, 524, 420, - /* 1280 */ 364, 136, 405, 413, 364, 140, 390, 391, 405, 78, - /* 1290 */ 413, 364, 285, 364, 376, 377, 65, 377, 417, 379, - /* 1300 */ 417, 417, 419, 137, 138, 364, 0, 398, 142, 78, - /* 1310 */ 401, 364, 110, 364, 396, 113, 417, 110, 364, 441, - /* 1320 */ 113, 51, 218, 364, 220, 405, 394, 367, 368, 417, - /* 1330 */ 238, 377, 33, 417, 33, 104, 65, 417, 107, 419, - /* 1340 */ 110, 13, 459, 113, 417, 462, 417, 0, 42, 466, - /* 1350 */ 467, 468, 469, 470, 471, 0, 473, 110, 417, 405, - /* 1360 */ 113, 478, 0, 480, 417, 37, 417, 484, 485, 22, - /* 1370 */ 492, 417, 33, 419, 143, 144, 417, 22, 500, 459, - /* 1380 */ 109, 33, 462, 33, 22, 33, 466, 467, 468, 469, - /* 1390 */ 470, 471, 49, 473, 143, 144, 518, 519, 478, 365, - /* 1400 */ 480, 523, 524, 37, 484, 485, 37, 108, 307, 108, - /* 1410 */ 37, 180, 181, 459, 1, 2, 462, 33, 187, 188, - /* 1420 */ 466, 467, 468, 469, 470, 471, 33, 473, 33, 33, - /* 1430 */ 236, 107, 478, 202, 480, 204, 33, 494, 484, 485, - /* 1440 */ 116, 33, 430, 33, 78, 12, 13, 108, 33, 33, - /* 1450 */ 107, 33, 527, 516, 33, 509, 108, 33, 108, 495, - /* 1460 */ 108, 33, 33, 380, 405, 393, 393, 236, 237, 238, - /* 1470 */ 13, 240, 241, 242, 243, 244, 245, 246, 247, 248, - /* 1480 */ 249, 250, 251, 252, 253, 254, 255, 256, 257, 12, - /* 1490 */ 13, 13, 108, 364, 37, 430, 375, 12, 13, 22, - /* 1500 */ 430, 108, 515, 108, 108, 515, 377, 22, 515, 440, - /* 1510 */ 515, 108, 35, 380, 37, 37, 108, 364, 108, 430, - /* 1520 */ 35, 377, 37, 108, 108, 416, 108, 448, 309, 108, - /* 1530 */ 377, 499, 108, 430, 405, 430, 108, 108, 499, 520, - /* 1540 */ 486, 395, 65, 502, 286, 51, 417, 461, 419, 442, - /* 1550 */ 65, 42, 20, 460, 217, 78, 458, 385, 405, 453, - /* 1560 */ 385, 453, 444, 364, 200, 20, 376, 20, 377, 45, - /* 1570 */ 417, 179, 419, 204, 426, 377, 377, 204, 426, 423, - /* 1580 */ 376, 104, 377, 423, 376, 426, 423, 423, 459, 105, - /* 1590 */ 389, 462, 103, 376, 388, 466, 467, 468, 469, 470, - /* 1600 */ 471, 102, 473, 387, 405, 376, 20, 478, 376, 480, - /* 1610 */ 376, 369, 459, 484, 485, 462, 417, 50, 419, 466, - /* 1620 */ 467, 468, 469, 470, 471, 373, 473, 373, 369, 453, - /* 1630 */ 385, 478, 20, 480, 385, 385, 20, 484, 485, 419, - /* 1640 */ 378, 20, 385, 443, 378, 385, 20, 433, 385, 364, - /* 1650 */ 385, 376, 385, 369, 417, 367, 367, 417, 459, 369, - /* 1660 */ 405, 462, 377, 376, 221, 466, 467, 468, 469, 470, - /* 1670 */ 471, 107, 473, 405, 405, 457, 455, 405, 405, 202, - /* 1680 */ 453, 204, 405, 405, 405, 405, 405, 202, 405, 204, - /* 1690 */ 405, 417, 383, 20, 208, 452, 450, 207, 383, 376, - /* 1700 */ 294, 419, 417, 442, 419, 449, 302, 293, 417, 193, - /* 1710 */ 303, 508, 287, 236, 237, 304, 281, 508, 508, 234, - /* 1720 */ 235, 236, 507, 511, 525, 526, 282, 250, 251, 252, - /* 1730 */ 253, 254, 255, 256, 510, 250, 251, 252, 253, 254, - /* 1740 */ 255, 256, 435, 435, 459, 506, 505, 462, 311, 308, - /* 1750 */ 497, 466, 467, 468, 469, 470, 471, 522, 473, 442, - /* 1760 */ 306, 528, 498, 364, 377, 480, 20, 465, 117, 484, - /* 1770 */ 485, 284, 378, 383, 383, 107, 377, 483, 417, 435, - /* 1780 */ 417, 435, 417, 364, 417, 417, 185, 431, 383, 503, - /* 1790 */ 401, 417, 383, 501, 377, 417, 377, 521, 364, 107, - /* 1800 */ 417, 22, 376, 383, 405, 366, 409, 38, 370, 369, - /* 1810 */ 362, 377, 454, 436, 384, 445, 417, 436, 419, 0, - /* 1820 */ 0, 399, 399, 0, 405, 45, 399, 0, 37, 227, - /* 1830 */ 37, 37, 37, 227, 0, 37, 417, 37, 419, 405, - /* 1840 */ 227, 37, 0, 0, 227, 37, 0, 37, 0, 0, - /* 1850 */ 22, 417, 37, 419, 0, 222, 210, 0, 459, 210, - /* 1860 */ 204, 462, 202, 211, 0, 466, 467, 468, 469, 470, - /* 1870 */ 471, 0, 473, 0, 198, 197, 0, 0, 459, 480, - /* 1880 */ 148, 462, 364, 484, 485, 466, 467, 468, 469, 470, - /* 1890 */ 471, 0, 473, 459, 49, 377, 462, 37, 0, 364, - /* 1900 */ 466, 467, 468, 469, 470, 471, 0, 473, 49, 37, - /* 1910 */ 0, 0, 377, 51, 480, 364, 49, 0, 0, 485, - /* 1920 */ 45, 0, 0, 405, 0, 0, 0, 49, 377, 0, - /* 1930 */ 0, 37, 513, 514, 0, 417, 165, 419, 165, 0, - /* 1940 */ 405, 0, 0, 0, 0, 0, 0, 0, 0, 0, - /* 1950 */ 0, 0, 417, 0, 419, 0, 405, 0, 0, 0, - /* 1960 */ 0, 0, 49, 0, 45, 0, 0, 0, 417, 148, - /* 1970 */ 419, 0, 0, 0, 439, 0, 22, 459, 0, 0, - /* 1980 */ 462, 0, 147, 146, 466, 467, 468, 469, 470, 471, - /* 1990 */ 439, 473, 0, 0, 459, 0, 364, 462, 22, 22, - /* 2000 */ 65, 466, 467, 468, 469, 470, 471, 37, 473, 377, - /* 2010 */ 459, 0, 50, 462, 364, 0, 0, 466, 467, 468, - /* 2020 */ 469, 470, 471, 0, 473, 37, 42, 377, 37, 65, - /* 2030 */ 364, 51, 514, 50, 0, 0, 51, 405, 42, 65, - /* 2040 */ 37, 51, 42, 377, 0, 37, 0, 45, 42, 417, - /* 2050 */ 33, 419, 14, 0, 49, 405, 49, 43, 49, 0, - /* 2060 */ 42, 0, 0, 0, 42, 0, 0, 417, 49, 419, - /* 2070 */ 0, 405, 193, 72, 0, 0, 37, 51, 42, 0, - /* 2080 */ 37, 51, 42, 417, 0, 419, 37, 42, 51, 0, - /* 2090 */ 42, 459, 37, 51, 462, 0, 0, 364, 466, 467, - /* 2100 */ 468, 469, 470, 471, 0, 473, 0, 0, 0, 459, - /* 2110 */ 377, 0, 462, 115, 37, 22, 466, 467, 468, 469, - /* 2120 */ 470, 471, 37, 473, 37, 459, 113, 37, 462, 37, - /* 2130 */ 364, 37, 466, 467, 468, 469, 470, 471, 405, 473, - /* 2140 */ 37, 475, 37, 377, 22, 33, 37, 33, 0, 517, - /* 2150 */ 417, 0, 419, 37, 37, 37, 22, 22, 0, 22, - /* 2160 */ 0, 22, 37, 53, 0, 0, 0, 37, 0, 37, - /* 2170 */ 0, 405, 439, 20, 22, 37, 526, 37, 37, 108, - /* 2180 */ 107, 0, 49, 417, 0, 419, 37, 107, 0, 22, - /* 2190 */ 0, 209, 459, 22, 182, 462, 3, 1, 0, 466, - /* 2200 */ 467, 468, 469, 470, 471, 439, 473, 182, 33, 182, - /* 2210 */ 108, 288, 50, 182, 185, 19, 37, 37, 103, 50, - /* 2220 */ 107, 189, 189, 182, 105, 459, 205, 107, 462, 108, - /* 2230 */ 107, 35, 466, 467, 468, 469, 470, 471, 33, 473, - /* 2240 */ 33, 33, 33, 49, 108, 33, 49, 51, 37, 3, - /* 2250 */ 108, 35, 107, 364, 107, 78, 60, 61, 62, 63, - /* 2260 */ 33, 65, 107, 37, 108, 108, 377, 51, 107, 37, - /* 2270 */ 107, 37, 37, 37, 288, 288, 60, 61, 62, 63, - /* 2280 */ 108, 65, 108, 33, 37, 0, 108, 49, 49, 0, - /* 2290 */ 108, 42, 272, 107, 405, 33, 105, 105, 2, 22, - /* 2300 */ 236, 49, 106, 108, 49, 109, 417, 107, 419, 108, - /* 2310 */ 259, 107, 22, 107, 186, 239, 0, 42, 108, 116, - /* 2320 */ 107, 107, 106, 108, 107, 109, 108, 107, 184, 107, - /* 2330 */ 49, 107, 107, 364, 37, 37, 108, 141, 107, 37, - /* 2340 */ 107, 37, 37, 37, 37, 108, 377, 117, 459, 107, - /* 2350 */ 107, 462, 108, 108, 33, 466, 467, 468, 469, 470, - /* 2360 */ 471, 107, 473, 37, 108, 107, 22, 108, 364, 108, - /* 2370 */ 107, 107, 72, 107, 405, 107, 128, 107, 37, 128, - /* 2380 */ 184, 377, 71, 37, 37, 128, 417, 191, 419, 37, - /* 2390 */ 37, 175, 364, 128, 37, 37, 37, 37, 78, 33, - /* 2400 */ 184, 185, 101, 78, 101, 377, 210, 191, 192, 405, - /* 2410 */ 37, 37, 37, 22, 364, 37, 37, 37, 78, 37, - /* 2420 */ 37, 417, 37, 419, 37, 37, 210, 377, 459, 0, - /* 2430 */ 22, 462, 37, 405, 37, 466, 467, 468, 469, 470, - /* 2440 */ 471, 51, 473, 42, 0, 417, 37, 419, 42, 51, - /* 2450 */ 0, 37, 42, 51, 0, 405, 37, 42, 0, 0, - /* 2460 */ 37, 37, 51, 459, 22, 33, 462, 417, 22, 419, - /* 2470 */ 466, 467, 468, 469, 470, 471, 21, 473, 22, 22, - /* 2480 */ 529, 21, 20, 529, 529, 529, 529, 459, 529, 529, - /* 2490 */ 462, 529, 529, 364, 466, 467, 468, 469, 470, 471, - /* 2500 */ 529, 473, 529, 529, 529, 529, 377, 529, 529, 459, - /* 2510 */ 529, 529, 462, 529, 364, 529, 466, 467, 468, 469, - /* 2520 */ 470, 471, 529, 473, 529, 529, 529, 377, 529, 529, - /* 2530 */ 529, 529, 529, 529, 405, 529, 529, 364, 529, 529, - /* 2540 */ 529, 529, 529, 529, 529, 529, 417, 529, 419, 529, - /* 2550 */ 377, 529, 529, 529, 529, 405, 529, 529, 529, 529, - /* 2560 */ 529, 529, 529, 529, 529, 529, 529, 417, 529, 419, - /* 2570 */ 529, 529, 529, 529, 529, 529, 529, 529, 405, 529, - /* 2580 */ 529, 529, 529, 529, 529, 529, 529, 529, 459, 529, - /* 2590 */ 417, 462, 419, 529, 529, 466, 467, 468, 469, 470, - /* 2600 */ 471, 529, 473, 529, 529, 529, 529, 529, 529, 459, - /* 2610 */ 529, 529, 462, 529, 529, 529, 466, 467, 468, 469, - /* 2620 */ 470, 471, 529, 473, 364, 529, 529, 529, 529, 529, - /* 2630 */ 529, 529, 459, 529, 529, 462, 529, 377, 529, 466, - /* 2640 */ 467, 468, 469, 470, 471, 529, 473, 529, 529, 529, - /* 2650 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 364, - /* 2660 */ 529, 529, 529, 529, 529, 405, 529, 529, 529, 529, - /* 2670 */ 529, 529, 377, 529, 529, 529, 529, 417, 529, 419, - /* 2680 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2690 */ 529, 529, 529, 529, 529, 529, 529, 529, 364, 529, - /* 2700 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2710 */ 529, 377, 417, 529, 419, 529, 529, 529, 529, 459, - /* 2720 */ 529, 529, 462, 529, 529, 529, 466, 467, 468, 469, - /* 2730 */ 470, 471, 529, 473, 529, 529, 529, 529, 529, 405, - /* 2740 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2750 */ 529, 417, 529, 419, 459, 529, 364, 462, 529, 529, - /* 2760 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 377, - /* 2770 */ 529, 364, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2780 */ 529, 529, 529, 529, 377, 529, 364, 529, 529, 529, - /* 2790 */ 529, 529, 529, 459, 529, 529, 462, 405, 529, 377, - /* 2800 */ 466, 467, 468, 469, 470, 471, 529, 473, 529, 417, - /* 2810 */ 529, 419, 405, 529, 529, 529, 529, 529, 529, 529, - /* 2820 */ 529, 529, 529, 529, 417, 529, 419, 405, 529, 529, - /* 2830 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 417, - /* 2840 */ 529, 419, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2850 */ 529, 459, 529, 529, 462, 364, 529, 529, 466, 467, - /* 2860 */ 468, 469, 470, 471, 529, 473, 459, 529, 377, 462, - /* 2870 */ 529, 529, 529, 466, 467, 468, 469, 470, 471, 529, - /* 2880 */ 473, 459, 529, 529, 462, 364, 529, 529, 466, 467, - /* 2890 */ 468, 469, 470, 471, 529, 473, 405, 529, 377, 529, - /* 2900 */ 529, 529, 529, 529, 529, 529, 529, 529, 417, 529, - /* 2910 */ 419, 529, 529, 529, 529, 364, 529, 529, 529, 529, - /* 2920 */ 529, 529, 529, 529, 529, 529, 405, 529, 377, 529, - /* 2930 */ 529, 529, 529, 529, 529, 529, 529, 529, 417, 529, - /* 2940 */ 419, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2950 */ 459, 529, 529, 462, 529, 529, 405, 466, 467, 468, - /* 2960 */ 469, 470, 471, 529, 473, 529, 529, 529, 417, 529, - /* 2970 */ 419, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 2980 */ 459, 529, 364, 462, 529, 529, 529, 466, 467, 468, - /* 2990 */ 469, 470, 471, 529, 473, 377, 529, 529, 529, 529, - /* 3000 */ 529, 529, 364, 529, 529, 529, 529, 529, 529, 529, - /* 3010 */ 459, 529, 529, 462, 529, 377, 529, 466, 467, 468, - /* 3020 */ 469, 470, 471, 405, 473, 529, 529, 529, 529, 529, - /* 3030 */ 529, 529, 529, 529, 529, 417, 529, 419, 529, 529, - /* 3040 */ 529, 529, 529, 405, 529, 529, 529, 529, 529, 529, - /* 3050 */ 529, 529, 529, 529, 529, 417, 529, 419, 529, 529, - /* 3060 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 3070 */ 529, 529, 529, 529, 529, 529, 529, 459, 529, 364, - /* 3080 */ 462, 529, 529, 529, 466, 467, 468, 469, 470, 471, - /* 3090 */ 529, 473, 377, 529, 529, 529, 529, 459, 529, 529, - /* 3100 */ 462, 529, 529, 529, 466, 467, 468, 469, 470, 471, - /* 3110 */ 529, 473, 529, 529, 529, 529, 364, 529, 529, 529, - /* 3120 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 377, - /* 3130 */ 529, 529, 417, 529, 419, 529, 529, 529, 529, 529, - /* 3140 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 364, - /* 3150 */ 529, 529, 529, 529, 529, 529, 529, 405, 529, 529, - /* 3160 */ 529, 529, 377, 529, 529, 529, 529, 529, 529, 417, - /* 3170 */ 529, 419, 529, 529, 459, 529, 529, 462, 529, 529, - /* 3180 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 529, - /* 3190 */ 405, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 3200 */ 529, 529, 417, 529, 419, 529, 529, 529, 529, 529, - /* 3210 */ 529, 459, 529, 529, 462, 529, 529, 529, 466, 467, - /* 3220 */ 468, 469, 470, 471, 529, 473, 529, 529, 529, 529, - /* 3230 */ 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, - /* 3240 */ 529, 529, 529, 529, 459, 529, 529, 462, 529, 529, - /* 3250 */ 529, 466, 467, 468, 469, 470, 471, 529, 473, 361, - /* 3260 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3270 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3280 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3290 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3300 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3310 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3320 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3330 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3340 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3350 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3360 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3370 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3380 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3390 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3400 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3410 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3420 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3430 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3440 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3450 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3460 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3470 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3480 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3490 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3500 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3510 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3520 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3530 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3540 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3550 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3560 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3570 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3580 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3590 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3600 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, - /* 3610 */ 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, + /* 130 */ 94, 95, 96, 97, 98, 99, 100, 20, 460, 69, + /* 140 */ 108, 463, 377, 143, 144, 467, 468, 469, 470, 471, + /* 150 */ 472, 426, 474, 493, 20, 106, 408, 479, 109, 481, + /* 160 */ 377, 501, 14, 485, 486, 489, 490, 491, 20, 493, + /* 170 */ 494, 469, 20, 160, 22, 21, 107, 501, 107, 519, + /* 180 */ 520, 181, 182, 505, 524, 525, 70, 20, 188, 189, + /* 190 */ 36, 513, 38, 39, 40, 519, 520, 20, 433, 434, + /* 200 */ 524, 525, 0, 203, 117, 205, 408, 55, 14, 411, + /* 210 */ 195, 463, 8, 9, 20, 107, 12, 13, 14, 15, + /* 220 */ 16, 78, 474, 21, 107, 176, 24, 25, 26, 27, + /* 230 */ 28, 29, 30, 31, 32, 452, 453, 237, 238, 239, + /* 240 */ 70, 241, 242, 243, 244, 245, 246, 247, 248, 249, + /* 250 */ 250, 251, 252, 253, 254, 255, 256, 257, 258, 12, + /* 260 */ 13, 463, 377, 378, 18, 20, 20, 20, 198, 22, + /* 270 */ 117, 107, 474, 27, 107, 71, 30, 143, 144, 377, + /* 280 */ 378, 35, 35, 406, 37, 0, 273, 274, 275, 276, + /* 290 */ 277, 278, 279, 280, 281, 225, 226, 51, 421, 53, + /* 300 */ 394, 405, 8, 9, 58, 59, 12, 13, 14, 15, + /* 310 */ 16, 426, 65, 417, 20, 69, 377, 104, 71, 115, + /* 320 */ 143, 144, 188, 189, 418, 78, 311, 259, 426, 181, + /* 330 */ 4, 118, 119, 120, 121, 122, 123, 124, 125, 126, + /* 340 */ 127, 107, 129, 130, 131, 132, 133, 134, 135, 23, + /* 350 */ 116, 104, 106, 284, 107, 284, 12, 13, 73, 74, + /* 360 */ 75, 422, 423, 117, 425, 80, 81, 82, 429, 463, + /* 370 */ 464, 86, 46, 47, 48, 181, 91, 92, 93, 94, + /* 380 */ 474, 37, 97, 33, 180, 100, 0, 239, 377, 378, + /* 390 */ 143, 144, 284, 147, 148, 45, 150, 151, 152, 153, + /* 400 */ 154, 155, 156, 157, 158, 159, 187, 20, 397, 163, + /* 410 */ 164, 165, 166, 167, 168, 169, 14, 171, 172, 173, + /* 420 */ 482, 483, 20, 177, 178, 179, 181, 182, 181, 182, + /* 430 */ 184, 377, 378, 239, 21, 188, 189, 24, 25, 26, + /* 440 */ 27, 28, 29, 30, 31, 32, 37, 3, 284, 20, + /* 450 */ 203, 284, 205, 8, 9, 391, 392, 12, 13, 14, + /* 460 */ 15, 16, 34, 160, 20, 365, 262, 263, 264, 265, + /* 470 */ 266, 267, 268, 269, 270, 271, 272, 183, 33, 12, + /* 480 */ 13, 14, 15, 16, 237, 238, 239, 78, 241, 242, + /* 490 */ 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + /* 500 */ 253, 254, 255, 256, 257, 258, 259, 12, 13, 290, + /* 510 */ 291, 292, 293, 107, 18, 20, 365, 22, 418, 23, + /* 520 */ 0, 377, 136, 137, 138, 139, 140, 141, 142, 378, + /* 530 */ 35, 406, 37, 239, 406, 394, 40, 41, 413, 160, + /* 540 */ 44, 20, 488, 489, 490, 491, 421, 493, 494, 205, + /* 550 */ 54, 136, 108, 108, 365, 140, 428, 406, 430, 418, + /* 560 */ 65, 0, 66, 67, 68, 69, 71, 378, 373, 418, + /* 570 */ 183, 420, 377, 78, 379, 466, 273, 274, 275, 276, + /* 580 */ 277, 278, 279, 280, 281, 24, 25, 26, 27, 28, + /* 590 */ 29, 30, 31, 32, 20, 406, 452, 453, 420, 104, + /* 600 */ 87, 492, 107, 107, 463, 464, 465, 418, 202, 420, + /* 610 */ 204, 460, 183, 435, 463, 474, 438, 439, 467, 468, + /* 620 */ 469, 470, 471, 472, 4, 474, 239, 183, 477, 373, + /* 630 */ 479, 480, 481, 377, 13, 379, 485, 486, 143, 144, + /* 640 */ 234, 145, 136, 137, 138, 139, 140, 141, 142, 460, + /* 650 */ 419, 420, 463, 274, 275, 276, 467, 468, 469, 470, + /* 660 */ 471, 472, 149, 474, 4, 377, 378, 37, 479, 408, + /* 670 */ 481, 56, 57, 398, 485, 486, 181, 182, 50, 19, + /* 680 */ 384, 406, 162, 188, 189, 397, 166, 174, 175, 414, + /* 690 */ 284, 195, 196, 197, 174, 35, 200, 401, 203, 78, + /* 700 */ 205, 37, 513, 372, 183, 409, 375, 376, 78, 213, + /* 710 */ 214, 51, 277, 278, 279, 280, 281, 138, 58, 59, + /* 720 */ 224, 142, 237, 227, 463, 65, 230, 231, 232, 233, + /* 730 */ 234, 33, 237, 238, 239, 474, 241, 242, 243, 244, + /* 740 */ 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + /* 750 */ 255, 256, 257, 258, 12, 13, 14, 365, 377, 378, + /* 760 */ 239, 364, 20, 366, 22, 0, 106, 466, 37, 109, + /* 770 */ 378, 372, 380, 365, 375, 376, 23, 35, 397, 37, + /* 780 */ 284, 296, 297, 298, 299, 300, 301, 302, 406, 365, + /* 790 */ 407, 212, 365, 492, 215, 413, 51, 218, 406, 220, + /* 800 */ 47, 48, 378, 421, 380, 60, 108, 65, 63, 64, + /* 810 */ 418, 183, 420, 239, 73, 74, 75, 377, 378, 191, + /* 820 */ 78, 80, 81, 82, 406, 22, 418, 86, 407, 180, + /* 830 */ 406, 413, 91, 92, 93, 94, 406, 397, 97, 421, + /* 840 */ 37, 100, 418, 413, 420, 418, 104, 377, 378, 107, + /* 850 */ 416, 421, 460, 419, 420, 463, 377, 378, 407, 467, + /* 860 */ 468, 469, 470, 471, 472, 365, 474, 365, 259, 205, + /* 870 */ 261, 479, 478, 481, 480, 22, 397, 485, 486, 13, + /* 880 */ 378, 78, 377, 378, 460, 143, 144, 463, 391, 392, + /* 890 */ 37, 467, 468, 469, 470, 471, 472, 33, 474, 235, + /* 900 */ 236, 393, 397, 479, 396, 481, 286, 104, 406, 485, + /* 910 */ 486, 262, 377, 378, 477, 377, 378, 480, 418, 493, + /* 920 */ 418, 272, 420, 181, 182, 160, 161, 501, 22, 20, + /* 930 */ 188, 189, 397, 8, 9, 407, 205, 12, 13, 14, + /* 940 */ 15, 16, 2, 37, 78, 203, 520, 205, 8, 9, + /* 950 */ 524, 525, 12, 13, 14, 15, 16, 104, 448, 489, + /* 960 */ 490, 491, 460, 493, 494, 463, 235, 236, 137, 467, + /* 970 */ 468, 469, 470, 471, 472, 473, 474, 475, 476, 237, + /* 980 */ 238, 239, 365, 241, 242, 243, 244, 245, 246, 247, + /* 990 */ 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + /* 1000 */ 258, 12, 13, 365, 365, 398, 203, 3, 205, 20, + /* 1010 */ 104, 22, 407, 406, 377, 378, 378, 466, 380, 377, + /* 1020 */ 378, 414, 377, 378, 35, 0, 37, 489, 490, 491, + /* 1030 */ 398, 493, 494, 108, 397, 418, 365, 431, 406, 397, + /* 1040 */ 237, 238, 397, 492, 406, 0, 414, 216, 217, 378, + /* 1050 */ 0, 380, 406, 478, 65, 480, 418, 418, 420, 2, + /* 1060 */ 377, 378, 14, 15, 16, 8, 9, 78, 365, 12, + /* 1070 */ 13, 14, 15, 16, 377, 378, 430, 406, 8, 9, + /* 1080 */ 397, 402, 12, 13, 14, 15, 16, 137, 138, 418, + /* 1090 */ 181, 420, 142, 104, 397, 70, 107, 395, 460, 386, + /* 1100 */ 365, 463, 377, 378, 528, 467, 468, 469, 470, 471, + /* 1110 */ 472, 365, 474, 365, 365, 377, 378, 479, 495, 481, + /* 1120 */ 362, 418, 397, 485, 486, 412, 378, 377, 378, 377, + /* 1130 */ 378, 460, 143, 144, 463, 397, 457, 365, 467, 468, + /* 1140 */ 469, 470, 471, 472, 33, 474, 22, 397, 239, 397, + /* 1150 */ 479, 365, 481, 418, 406, 415, 485, 486, 418, 377, + /* 1160 */ 378, 37, 382, 383, 418, 406, 418, 418, 420, 14, + /* 1170 */ 181, 182, 382, 383, 310, 20, 406, 188, 189, 397, + /* 1180 */ 421, 136, 137, 138, 139, 140, 141, 142, 1, 2, + /* 1190 */ 418, 421, 203, 415, 205, 406, 418, 39, 40, 365, + /* 1200 */ 442, 365, 78, 414, 418, 447, 0, 365, 460, 365, + /* 1210 */ 20, 463, 71, 365, 365, 467, 468, 469, 470, 471, + /* 1220 */ 472, 415, 474, 365, 418, 20, 237, 238, 239, 442, + /* 1230 */ 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + /* 1240 */ 251, 252, 253, 254, 255, 256, 257, 258, 12, 13, + /* 1250 */ 365, 493, 418, 183, 418, 176, 20, 51, 22, 501, + /* 1260 */ 418, 399, 418, 378, 402, 380, 418, 418, 117, 111, + /* 1270 */ 112, 35, 114, 37, 526, 527, 418, 519, 520, 229, + /* 1280 */ 493, 33, 524, 525, 368, 369, 207, 0, 501, 365, + /* 1290 */ 517, 406, 493, 45, 136, 108, 13, 33, 140, 0, + /* 1300 */ 501, 65, 378, 418, 380, 420, 519, 520, 33, 13, + /* 1310 */ 306, 524, 525, 0, 78, 33, 12, 13, 519, 520, + /* 1320 */ 37, 170, 110, 524, 525, 113, 22, 0, 110, 42, + /* 1330 */ 406, 113, 33, 37, 110, 22, 0, 113, 442, 35, + /* 1340 */ 104, 37, 418, 107, 420, 460, 0, 365, 463, 22, + /* 1350 */ 143, 144, 467, 468, 469, 470, 471, 472, 22, 474, + /* 1360 */ 378, 219, 110, 221, 479, 113, 481, 65, 22, 65, + /* 1370 */ 485, 486, 108, 33, 1, 2, 366, 49, 237, 143, + /* 1380 */ 144, 510, 78, 108, 460, 33, 496, 463, 406, 493, + /* 1390 */ 108, 467, 468, 469, 470, 471, 472, 501, 474, 37, + /* 1400 */ 418, 33, 420, 479, 37, 481, 12, 13, 104, 485, + /* 1410 */ 486, 109, 381, 13, 13, 519, 520, 181, 182, 308, + /* 1420 */ 524, 525, 406, 33, 188, 189, 8, 9, 33, 239, + /* 1430 */ 12, 13, 14, 15, 16, 107, 33, 37, 37, 203, + /* 1440 */ 33, 205, 460, 394, 239, 463, 394, 376, 108, 467, + /* 1450 */ 468, 469, 470, 471, 472, 33, 474, 33, 33, 431, + /* 1460 */ 108, 479, 33, 481, 33, 33, 431, 485, 486, 33, + /* 1470 */ 33, 0, 516, 237, 238, 239, 108, 241, 242, 243, + /* 1480 */ 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + /* 1490 */ 254, 255, 256, 257, 258, 12, 13, 365, 108, 33, + /* 1500 */ 516, 33, 516, 108, 441, 22, 516, 203, 381, 205, + /* 1510 */ 378, 108, 431, 378, 417, 108, 449, 431, 35, 431, + /* 1520 */ 37, 500, 500, 52, 521, 487, 503, 396, 287, 51, + /* 1530 */ 108, 462, 108, 108, 443, 42, 365, 108, 406, 108, + /* 1540 */ 108, 237, 238, 461, 108, 108, 20, 454, 65, 378, + /* 1550 */ 418, 218, 420, 459, 35, 251, 252, 253, 254, 255, + /* 1560 */ 256, 257, 386, 454, 386, 201, 445, 205, 20, 377, + /* 1570 */ 51, 20, 205, 378, 108, 45, 108, 406, 378, 60, + /* 1580 */ 61, 62, 63, 427, 65, 180, 427, 424, 377, 418, + /* 1590 */ 377, 420, 460, 378, 365, 463, 427, 424, 424, 467, + /* 1600 */ 468, 469, 470, 471, 472, 424, 474, 378, 105, 390, + /* 1610 */ 103, 479, 377, 481, 389, 102, 388, 485, 486, 377, + /* 1620 */ 377, 377, 20, 370, 50, 106, 370, 20, 109, 374, + /* 1630 */ 420, 460, 374, 454, 463, 406, 386, 386, 467, 468, + /* 1640 */ 469, 470, 471, 472, 20, 474, 386, 418, 379, 420, + /* 1650 */ 479, 20, 481, 444, 386, 379, 485, 486, 386, 20, + /* 1660 */ 434, 377, 370, 386, 386, 442, 386, 406, 365, 406, + /* 1670 */ 377, 406, 406, 406, 368, 368, 406, 406, 370, 406, + /* 1680 */ 406, 378, 222, 107, 454, 406, 203, 406, 205, 460, + /* 1690 */ 458, 20, 463, 456, 384, 176, 467, 468, 469, 470, + /* 1700 */ 471, 472, 453, 474, 185, 186, 418, 418, 418, 406, + /* 1710 */ 481, 192, 193, 209, 485, 486, 493, 208, 235, 236, + /* 1720 */ 237, 418, 384, 420, 501, 420, 377, 418, 443, 295, + /* 1730 */ 211, 509, 294, 436, 251, 252, 253, 254, 255, 256, + /* 1740 */ 257, 450, 519, 520, 303, 365, 451, 524, 525, 509, + /* 1750 */ 436, 512, 194, 305, 304, 509, 511, 288, 378, 443, + /* 1760 */ 283, 499, 508, 460, 507, 506, 463, 282, 312, 365, + /* 1770 */ 467, 468, 469, 470, 471, 472, 529, 474, 20, 309, + /* 1780 */ 307, 466, 378, 117, 481, 285, 406, 378, 485, 486, + /* 1790 */ 379, 365, 498, 107, 384, 484, 384, 436, 418, 418, + /* 1800 */ 420, 418, 502, 418, 378, 504, 418, 436, 186, 523, + /* 1810 */ 406, 418, 384, 378, 432, 402, 418, 384, 107, 377, + /* 1820 */ 522, 22, 418, 384, 420, 410, 418, 38, 367, 365, + /* 1830 */ 371, 455, 406, 370, 418, 446, 437, 385, 363, 437, + /* 1840 */ 460, 0, 378, 463, 418, 400, 420, 467, 468, 469, + /* 1850 */ 470, 471, 472, 400, 474, 400, 0, 0, 45, 0, + /* 1860 */ 37, 481, 228, 37, 460, 485, 486, 463, 37, 37, + /* 1870 */ 406, 467, 468, 469, 470, 471, 472, 228, 474, 0, + /* 1880 */ 37, 37, 418, 228, 420, 37, 460, 228, 0, 463, + /* 1890 */ 0, 37, 0, 467, 468, 469, 470, 471, 472, 37, + /* 1900 */ 474, 0, 365, 22, 0, 37, 223, 481, 0, 211, + /* 1910 */ 0, 211, 486, 212, 205, 378, 203, 0, 514, 515, + /* 1920 */ 0, 0, 199, 198, 460, 0, 0, 463, 148, 49, + /* 1930 */ 0, 467, 468, 469, 470, 471, 472, 37, 474, 0, + /* 1940 */ 49, 0, 37, 406, 51, 0, 49, 0, 45, 0, + /* 1950 */ 0, 0, 0, 0, 0, 418, 49, 420, 0, 0, + /* 1960 */ 365, 0, 166, 0, 37, 0, 166, 0, 0, 0, + /* 1970 */ 0, 0, 0, 378, 0, 0, 0, 440, 0, 515, + /* 1980 */ 0, 0, 0, 365, 0, 0, 0, 0, 0, 49, + /* 1990 */ 0, 45, 0, 0, 0, 0, 378, 460, 0, 0, + /* 2000 */ 463, 406, 0, 0, 467, 468, 469, 470, 471, 472, + /* 2010 */ 0, 474, 148, 418, 0, 420, 147, 0, 365, 22, + /* 2020 */ 146, 0, 0, 22, 406, 0, 22, 50, 37, 50, + /* 2030 */ 0, 378, 14, 194, 0, 440, 418, 0, 420, 0, + /* 2040 */ 0, 0, 0, 37, 0, 37, 0, 0, 65, 42, + /* 2050 */ 37, 51, 0, 42, 65, 460, 33, 42, 463, 406, + /* 2060 */ 51, 65, 467, 468, 469, 470, 471, 472, 37, 474, + /* 2070 */ 51, 418, 45, 420, 0, 49, 0, 49, 460, 43, + /* 2080 */ 42, 463, 49, 0, 49, 467, 468, 469, 470, 471, + /* 2090 */ 472, 42, 474, 42, 0, 0, 72, 0, 0, 37, + /* 2100 */ 42, 365, 37, 42, 51, 0, 51, 0, 37, 42, + /* 2110 */ 51, 0, 37, 460, 378, 51, 463, 0, 0, 42, + /* 2120 */ 467, 468, 469, 470, 471, 472, 0, 474, 0, 0, + /* 2130 */ 0, 115, 22, 113, 0, 0, 518, 37, 365, 53, + /* 2140 */ 37, 37, 406, 37, 0, 37, 37, 33, 0, 37, + /* 2150 */ 37, 378, 37, 33, 418, 22, 420, 0, 37, 37, + /* 2160 */ 37, 22, 22, 22, 22, 0, 0, 0, 37, 37, + /* 2170 */ 0, 0, 22, 37, 20, 37, 365, 108, 0, 406, + /* 2180 */ 527, 0, 37, 37, 37, 107, 107, 0, 0, 378, + /* 2190 */ 22, 418, 49, 420, 22, 183, 460, 3, 1, 463, + /* 2200 */ 0, 289, 33, 467, 468, 469, 470, 471, 472, 108, + /* 2210 */ 474, 37, 476, 440, 365, 78, 19, 406, 33, 37, + /* 2220 */ 289, 3, 33, 107, 105, 50, 183, 378, 183, 418, + /* 2230 */ 50, 420, 35, 460, 107, 33, 463, 183, 33, 210, + /* 2240 */ 467, 468, 469, 470, 471, 472, 186, 474, 51, 33, + /* 2250 */ 49, 440, 365, 183, 206, 406, 190, 60, 61, 62, + /* 2260 */ 63, 108, 65, 190, 103, 378, 107, 418, 108, 420, + /* 2270 */ 108, 460, 108, 49, 463, 37, 33, 37, 467, 468, + /* 2280 */ 469, 470, 471, 472, 108, 474, 107, 37, 37, 37, + /* 2290 */ 107, 107, 37, 406, 108, 49, 37, 107, 365, 107, + /* 2300 */ 33, 108, 49, 106, 108, 418, 109, 420, 0, 460, + /* 2310 */ 0, 378, 463, 42, 108, 107, 467, 468, 469, 470, + /* 2320 */ 471, 472, 33, 474, 105, 105, 2, 22, 260, 237, + /* 2330 */ 273, 108, 107, 49, 108, 107, 107, 49, 141, 406, + /* 2340 */ 108, 22, 107, 187, 108, 289, 107, 460, 0, 108, + /* 2350 */ 463, 418, 107, 420, 467, 468, 469, 470, 471, 472, + /* 2360 */ 42, 474, 49, 107, 240, 116, 37, 107, 107, 107, + /* 2370 */ 365, 108, 107, 107, 117, 37, 185, 108, 108, 107, + /* 2380 */ 37, 107, 185, 378, 108, 107, 37, 108, 37, 192, + /* 2390 */ 107, 37, 107, 460, 108, 108, 463, 365, 37, 107, + /* 2400 */ 467, 468, 469, 470, 471, 472, 107, 474, 211, 128, + /* 2410 */ 378, 406, 33, 107, 37, 22, 107, 72, 128, 128, + /* 2420 */ 37, 128, 37, 418, 71, 420, 37, 101, 365, 37, + /* 2430 */ 78, 37, 37, 37, 37, 37, 78, 101, 406, 33, + /* 2440 */ 37, 378, 37, 22, 37, 37, 37, 37, 78, 37, + /* 2450 */ 418, 37, 420, 37, 37, 37, 22, 37, 0, 37, + /* 2460 */ 0, 42, 51, 37, 51, 460, 42, 365, 463, 406, + /* 2470 */ 0, 0, 467, 468, 469, 470, 471, 472, 37, 474, + /* 2480 */ 378, 418, 51, 420, 42, 37, 51, 42, 0, 37, + /* 2490 */ 37, 0, 460, 20, 22, 463, 33, 22, 21, 467, + /* 2500 */ 468, 469, 470, 471, 472, 22, 474, 22, 406, 530, + /* 2510 */ 21, 530, 530, 530, 530, 530, 530, 530, 530, 530, + /* 2520 */ 418, 530, 420, 460, 530, 530, 463, 530, 530, 530, + /* 2530 */ 467, 468, 469, 470, 471, 472, 530, 474, 530, 530, + /* 2540 */ 530, 530, 365, 530, 530, 530, 530, 530, 530, 530, + /* 2550 */ 530, 530, 530, 530, 530, 378, 530, 530, 530, 530, + /* 2560 */ 530, 530, 460, 530, 365, 463, 530, 530, 530, 467, + /* 2570 */ 468, 469, 470, 471, 472, 530, 474, 378, 530, 365, + /* 2580 */ 530, 530, 530, 406, 530, 530, 530, 530, 530, 530, + /* 2590 */ 530, 530, 378, 530, 530, 418, 530, 420, 530, 530, + /* 2600 */ 530, 530, 365, 530, 530, 406, 530, 530, 530, 530, + /* 2610 */ 530, 530, 530, 530, 530, 378, 530, 418, 530, 420, + /* 2620 */ 406, 530, 530, 365, 530, 530, 530, 530, 530, 530, + /* 2630 */ 530, 530, 418, 530, 420, 530, 378, 460, 530, 530, + /* 2640 */ 463, 530, 530, 406, 467, 468, 469, 470, 471, 472, + /* 2650 */ 530, 474, 530, 530, 530, 418, 530, 420, 530, 460, + /* 2660 */ 530, 530, 463, 530, 406, 530, 467, 468, 469, 470, + /* 2670 */ 471, 472, 530, 474, 460, 530, 418, 463, 420, 530, + /* 2680 */ 530, 467, 468, 469, 470, 471, 472, 530, 474, 530, + /* 2690 */ 530, 530, 530, 530, 530, 530, 530, 460, 530, 530, + /* 2700 */ 463, 530, 530, 530, 467, 468, 469, 470, 471, 472, + /* 2710 */ 530, 474, 530, 530, 530, 530, 530, 530, 460, 530, + /* 2720 */ 365, 463, 530, 530, 530, 467, 468, 469, 470, 471, + /* 2730 */ 472, 530, 474, 378, 530, 530, 365, 530, 530, 530, + /* 2740 */ 530, 530, 530, 530, 530, 530, 530, 530, 530, 378, + /* 2750 */ 530, 530, 530, 530, 530, 365, 530, 530, 530, 530, + /* 2760 */ 530, 406, 530, 530, 530, 530, 530, 530, 378, 530, + /* 2770 */ 530, 530, 530, 418, 530, 420, 530, 406, 530, 530, + /* 2780 */ 530, 530, 530, 530, 530, 530, 530, 530, 530, 418, + /* 2790 */ 530, 420, 530, 530, 365, 530, 406, 530, 530, 530, + /* 2800 */ 530, 530, 530, 530, 530, 530, 530, 378, 418, 530, + /* 2810 */ 420, 530, 530, 530, 530, 460, 530, 530, 463, 530, + /* 2820 */ 530, 530, 467, 468, 469, 470, 471, 472, 530, 474, + /* 2830 */ 530, 460, 530, 365, 463, 406, 530, 530, 467, 468, + /* 2840 */ 469, 470, 471, 472, 530, 474, 378, 418, 530, 420, + /* 2850 */ 460, 530, 530, 463, 530, 530, 530, 467, 468, 469, + /* 2860 */ 470, 471, 472, 530, 474, 365, 530, 530, 530, 530, + /* 2870 */ 530, 530, 530, 530, 406, 530, 530, 530, 378, 530, + /* 2880 */ 530, 530, 530, 530, 530, 530, 418, 530, 420, 460, + /* 2890 */ 530, 530, 463, 530, 530, 530, 467, 468, 469, 470, + /* 2900 */ 471, 472, 530, 474, 530, 530, 406, 530, 530, 530, + /* 2910 */ 530, 530, 530, 530, 530, 530, 530, 530, 418, 530, + /* 2920 */ 420, 530, 530, 530, 530, 530, 530, 530, 460, 530, + /* 2930 */ 530, 463, 530, 530, 530, 467, 468, 469, 470, 471, + /* 2940 */ 472, 530, 474, 365, 530, 530, 530, 530, 530, 530, + /* 2950 */ 530, 530, 530, 530, 530, 530, 378, 530, 530, 530, + /* 2960 */ 460, 530, 530, 463, 530, 530, 530, 467, 468, 469, + /* 2970 */ 470, 471, 472, 530, 474, 530, 530, 530, 530, 530, + /* 2980 */ 530, 365, 530, 530, 406, 530, 530, 530, 530, 530, + /* 2990 */ 530, 530, 530, 530, 378, 530, 418, 530, 420, 530, + /* 3000 */ 530, 530, 365, 530, 530, 530, 530, 530, 530, 530, + /* 3010 */ 530, 530, 530, 530, 530, 378, 530, 365, 530, 530, + /* 3020 */ 530, 530, 406, 530, 530, 530, 530, 530, 530, 530, + /* 3030 */ 378, 530, 530, 530, 418, 530, 420, 530, 460, 530, + /* 3040 */ 530, 463, 530, 406, 530, 467, 468, 469, 470, 471, + /* 3050 */ 472, 530, 474, 530, 530, 418, 530, 420, 406, 530, + /* 3060 */ 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, + /* 3070 */ 418, 530, 420, 530, 530, 530, 460, 530, 530, 463, + /* 3080 */ 530, 530, 530, 467, 468, 469, 470, 471, 472, 530, + /* 3090 */ 474, 530, 530, 530, 530, 530, 530, 460, 530, 530, + /* 3100 */ 463, 530, 530, 530, 467, 468, 469, 470, 471, 472, + /* 3110 */ 530, 474, 460, 530, 530, 463, 530, 530, 530, 467, + /* 3120 */ 468, 469, 470, 471, 472, 530, 474, 362, 362, 362, + /* 3130 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3140 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3150 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3160 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3170 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3180 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3190 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3200 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3210 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3220 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3230 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3240 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3250 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3260 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3270 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3280 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3290 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3300 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3310 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3320 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3330 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3340 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3350 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3360 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3370 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3380 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3390 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3400 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3410 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3420 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3430 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3440 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3450 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3460 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3470 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + /* 3480 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, }; -#define YY_SHIFT_COUNT (868) +#define YY_SHIFT_COUNT (869) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2462) +#define YY_SHIFT_MAX (2491) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 494, 0, 246, 0, 493, 493, 493, 493, 493, 493, - /* 10 */ 493, 493, 493, 493, 493, 493, 739, 985, 985, 1231, - /* 20 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, - /* 30 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, - /* 40 */ 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, - /* 50 */ 44, 422, 561, 215, 85, 520, 85, 85, 215, 215, - /* 60 */ 85, 1477, 85, 245, 1477, 164, 85, 68, 1485, 133, - /* 70 */ 79, 79, 1485, 1485, 151, 151, 133, 80, 667, 38, - /* 80 */ 38, 247, 79, 79, 79, 79, 79, 79, 79, 79, - /* 90 */ 79, 79, 79, 86, 292, 79, 79, 321, 68, 79, - /* 100 */ 86, 79, 68, 79, 79, 68, 79, 79, 68, 79, - /* 110 */ 68, 68, 68, 79, 344, 203, 203, 363, 13, 201, - /* 120 */ 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, - /* 130 */ 832, 832, 832, 832, 832, 832, 832, 832, 832, 1145, - /* 140 */ 170, 80, 667, 945, 945, 278, 584, 584, 584, 308, - /* 150 */ 308, 541, 892, 278, 321, 345, 68, 258, 68, 68, - /* 160 */ 616, 68, 616, 616, 583, 772, 212, 212, 212, 212, - /* 170 */ 212, 212, 212, 212, 2196, 284, 549, 293, 506, 506, - /* 180 */ 15, 223, 96, 200, 242, 367, 522, 1017, 257, 257, - /* 190 */ 57, 1024, 141, 403, 403, 403, 501, 426, 403, 384, - /* 200 */ 530, 438, 1010, 4, 530, 530, 1092, 1211, 1211, 427, - /* 210 */ 492, 1007, 892, 1258, 1494, 1509, 1532, 1337, 321, 1532, - /* 220 */ 321, 1364, 1545, 1547, 1524, 1547, 1524, 1392, 1545, 1547, - /* 230 */ 1545, 1524, 1392, 1392, 1392, 1484, 1489, 1545, 1499, 1545, - /* 240 */ 1545, 1545, 1586, 1567, 1586, 1567, 1532, 321, 321, 1612, - /* 250 */ 321, 1616, 1621, 321, 1616, 321, 1626, 321, 321, 1545, - /* 260 */ 321, 1586, 68, 68, 68, 68, 68, 68, 68, 68, - /* 270 */ 68, 68, 68, 1545, 772, 772, 1586, 616, 616, 616, - /* 280 */ 1443, 1564, 1532, 344, 1673, 1486, 1490, 1612, 344, 1258, - /* 290 */ 1545, 616, 1406, 1414, 1406, 1414, 1404, 1516, 1406, 1411, - /* 300 */ 1407, 1425, 1258, 1444, 1435, 1437, 1441, 1454, 1547, 1746, - /* 310 */ 1651, 1487, 1616, 344, 344, 1668, 1414, 616, 616, 616, - /* 320 */ 616, 1414, 616, 1601, 344, 583, 344, 1547, 616, 616, - /* 330 */ 1692, 616, 1545, 344, 1779, 1769, 1586, 3259, 3259, 3259, - /* 340 */ 3259, 3259, 3259, 3259, 3259, 3259, 36, 2216, 559, 663, - /* 350 */ 54, 32, 67, 531, 806, 864, 699, 888, 77, 77, - /* 360 */ 77, 77, 77, 77, 77, 77, 77, 944, 802, 21, - /* 370 */ 495, 495, 820, 543, 669, 614, 615, 368, 891, 850, - /* 380 */ 996, 1077, 923, 900, 1063, 610, 900, 900, 900, 1166, - /* 390 */ 1166, 1270, 329, 1099, 1306, 1141, 104, 582, 1202, 1207, - /* 400 */ 1230, 1247, 905, 1328, 1157, 1347, 1355, 1362, 1104, 1299, - /* 410 */ 1301, 1271, 1339, 1348, 1350, 1352, 1251, 1101, 1219, 1384, - /* 420 */ 1413, 1395, 1194, 1396, 1343, 1393, 1403, 1408, 1410, 1415, - /* 430 */ 1433, 1416, 1418, 1421, 1424, 1428, 1429, 1324, 1369, 1373, - /* 440 */ 1457, 1478, 1366, 848, 1819, 1820, 1823, 1780, 1827, 1791, - /* 450 */ 1602, 1793, 1794, 1795, 1606, 1834, 1798, 1800, 1613, 1804, - /* 460 */ 1842, 1617, 1843, 1808, 1846, 1810, 1848, 1828, 1849, 1815, - /* 470 */ 1633, 1854, 1646, 1857, 1649, 1652, 1656, 1660, 1864, 1871, - /* 480 */ 1873, 1676, 1678, 1876, 1877, 1732, 1845, 1859, 1891, 1860, - /* 490 */ 1898, 1906, 1872, 1862, 1910, 1867, 1911, 1875, 1917, 1918, - /* 500 */ 1921, 1878, 1922, 1924, 1925, 1926, 1929, 1930, 1771, 1894, - /* 510 */ 1934, 1773, 1939, 1941, 1942, 1943, 1944, 1945, 1946, 1947, - /* 520 */ 1948, 1949, 1950, 1951, 1953, 1955, 1957, 1958, 1959, 1960, - /* 530 */ 1961, 1913, 1963, 1919, 1965, 1966, 1967, 1971, 1972, 1973, - /* 540 */ 1975, 1954, 1978, 1821, 1979, 1835, 1981, 1837, 1992, 1993, - /* 550 */ 1976, 1962, 1977, 1983, 1995, 1935, 1970, 2011, 1964, 2015, - /* 560 */ 1974, 2016, 2023, 1988, 1980, 1984, 2034, 1991, 1985, 1996, - /* 570 */ 2035, 2003, 1990, 2000, 2044, 2008, 2046, 2002, 2006, 2017, - /* 580 */ 2005, 2007, 2038, 2009, 2053, 2014, 2018, 2059, 2061, 2062, - /* 590 */ 2063, 2022, 1879, 2065, 2005, 2019, 2066, 2070, 2001, 2074, - /* 600 */ 2075, 2039, 2026, 2036, 2079, 2043, 2030, 2040, 2084, 2049, - /* 610 */ 2037, 2045, 2089, 2055, 2042, 2048, 2095, 2096, 2104, 2106, - /* 620 */ 2107, 2108, 1998, 2013, 2077, 2093, 2111, 2085, 2087, 2090, - /* 630 */ 2092, 2094, 2103, 2105, 2109, 2112, 2114, 2116, 2117, 2122, - /* 640 */ 2118, 2148, 2134, 2151, 2135, 2158, 2137, 2110, 2160, 2139, - /* 650 */ 2125, 2164, 2165, 2166, 2130, 2168, 2132, 2170, 2152, 2153, - /* 660 */ 2138, 2140, 2141, 2071, 2073, 2181, 2012, 2080, 1982, 2005, - /* 670 */ 2133, 2184, 2025, 2149, 2167, 2188, 2021, 2171, 2027, 2029, - /* 680 */ 2190, 2198, 2031, 2032, 2041, 2033, 2193, 2175, 1923, 2113, - /* 690 */ 2102, 2120, 2121, 2179, 2180, 2123, 2162, 2119, 2169, 2115, - /* 700 */ 2136, 2205, 2207, 2142, 2145, 2147, 2155, 2156, 2208, 2194, - /* 710 */ 2197, 2161, 2209, 1986, 2177, 2157, 2212, 2163, 2211, 2172, - /* 720 */ 2174, 2246, 2227, 1987, 2226, 2232, 2234, 2235, 2236, 2247, - /* 730 */ 2178, 2182, 2238, 2020, 2250, 2239, 2285, 2289, 2186, 2249, - /* 740 */ 2262, 2191, 2051, 2192, 2296, 2277, 2064, 2195, 2200, 2201, - /* 750 */ 2252, 2204, 2206, 2255, 2210, 2290, 2076, 2213, 2215, 2218, - /* 760 */ 2214, 2217, 2128, 2220, 2316, 2275, 2144, 2222, 2203, 2005, - /* 770 */ 2281, 2224, 2225, 2228, 2231, 2233, 2230, 2237, 2297, 2298, - /* 780 */ 2242, 2244, 2302, 2243, 2245, 2304, 2254, 2256, 2305, 2258, - /* 790 */ 2259, 2306, 2263, 2261, 2307, 2264, 2248, 2251, 2257, 2265, - /* 800 */ 2266, 2321, 2268, 2326, 2270, 2321, 2321, 2344, 2300, 2311, - /* 810 */ 2341, 2346, 2347, 2352, 2353, 2357, 2358, 2359, 2360, 2320, - /* 820 */ 2301, 2325, 2303, 2366, 2373, 2374, 2375, 2391, 2378, 2379, - /* 830 */ 2380, 2340, 2112, 2382, 2114, 2383, 2385, 2387, 2388, 2408, - /* 840 */ 2395, 2429, 2397, 2390, 2401, 2444, 2409, 2398, 2406, 2450, - /* 850 */ 2414, 2402, 2410, 2454, 2419, 2411, 2415, 2458, 2423, 2424, - /* 860 */ 2459, 2442, 2432, 2446, 2455, 2456, 2457, 2460, 2462, + /* 0 */ 496, 0, 247, 0, 495, 495, 495, 495, 495, 495, + /* 10 */ 495, 495, 495, 495, 495, 495, 742, 989, 989, 1236, + /* 20 */ 989, 989, 989, 989, 989, 989, 989, 989, 989, 989, + /* 30 */ 989, 989, 989, 989, 989, 989, 989, 989, 989, 989, + /* 40 */ 989, 989, 989, 989, 989, 989, 989, 989, 989, 989, + /* 50 */ 69, 167, 406, 117, 108, 164, 108, 108, 117, 117, + /* 60 */ 108, 1304, 108, 246, 1304, 71, 108, 14, 1483, 134, + /* 70 */ 29, 29, 1483, 1483, 326, 326, 134, 245, 177, 402, + /* 80 */ 402, 574, 29, 29, 29, 29, 29, 29, 29, 29, + /* 90 */ 29, 29, 29, 52, 63, 29, 29, 116, 14, 29, + /* 100 */ 52, 29, 14, 29, 29, 14, 29, 29, 14, 29, + /* 110 */ 14, 14, 14, 29, 170, 204, 204, 741, 13, 413, + /* 120 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, + /* 130 */ 803, 803, 803, 803, 803, 803, 803, 803, 803, 1158, + /* 140 */ 444, 245, 177, 615, 615, 409, 429, 429, 429, 609, + /* 150 */ 609, 1025, 621, 409, 116, 87, 14, 68, 14, 14, + /* 160 */ 143, 14, 143, 143, 153, 428, 213, 213, 213, 213, + /* 170 */ 213, 213, 213, 213, 2197, 285, 202, 294, 303, 303, + /* 180 */ 15, 485, 219, 435, 42, 379, 148, 194, 344, 344, + /* 190 */ 387, 753, 521, 1124, 1124, 1124, 628, 909, 1124, 152, + /* 200 */ 1190, 1155, 415, 1079, 1190, 1190, 1205, 866, 866, 1004, + /* 210 */ 350, 620, 621, 1241, 1478, 1493, 1526, 1333, 116, 1526, + /* 220 */ 116, 1364, 1548, 1551, 1530, 1551, 1530, 1405, 1548, 1551, + /* 230 */ 1548, 1530, 1405, 1405, 1405, 1503, 1507, 1548, 1513, 1548, + /* 240 */ 1548, 1548, 1602, 1574, 1602, 1574, 1526, 116, 116, 1607, + /* 250 */ 116, 1624, 1631, 116, 1624, 116, 1639, 116, 116, 1548, + /* 260 */ 116, 1602, 14, 14, 14, 14, 14, 14, 14, 14, + /* 270 */ 14, 14, 14, 1548, 428, 428, 1602, 143, 143, 143, + /* 280 */ 1460, 1576, 1526, 170, 1671, 1504, 1509, 1607, 170, 1241, + /* 290 */ 1548, 143, 1434, 1438, 1434, 1438, 1441, 1558, 1434, 1448, + /* 300 */ 1450, 1469, 1241, 1477, 1485, 1456, 1470, 1473, 1551, 1758, + /* 310 */ 1666, 1500, 1624, 170, 170, 1686, 1438, 143, 143, 143, + /* 320 */ 143, 1438, 143, 1622, 170, 153, 170, 1551, 143, 143, + /* 330 */ 1711, 143, 1548, 170, 1799, 1789, 1602, 3127, 3127, 3127, + /* 340 */ 3127, 3127, 3127, 3127, 3127, 3127, 36, 1519, 561, 660, + /* 350 */ 445, 32, 925, 940, 1057, 1070, 386, 1045, 1418, 1418, + /* 360 */ 1418, 1418, 1418, 1418, 1418, 1418, 1418, 506, 579, 154, + /* 370 */ 467, 467, 70, 49, 520, 513, 745, 664, 731, 765, + /* 380 */ 853, 906, 831, 1048, 1187, 649, 1048, 1048, 1048, 950, + /* 390 */ 950, 1206, 1050, 698, 1287, 1248, 1151, 1299, 1212, 1218, + /* 400 */ 1224, 1252, 1283, 1296, 1313, 1327, 1336, 1346, 1142, 1264, + /* 410 */ 1275, 1302, 1282, 1340, 1368, 1390, 1207, 1111, 864, 1352, + /* 420 */ 1373, 1395, 1141, 1403, 1328, 1422, 1424, 1425, 1429, 1431, + /* 430 */ 1394, 1407, 1432, 1436, 1437, 1466, 1468, 234, 1362, 1367, + /* 440 */ 1400, 1401, 630, 1471, 1841, 1856, 1857, 1813, 1859, 1823, + /* 450 */ 1634, 1826, 1831, 1832, 1649, 1879, 1843, 1844, 1655, 1848, + /* 460 */ 1890, 1659, 1888, 1854, 1892, 1862, 1901, 1881, 1904, 1868, + /* 470 */ 1683, 1908, 1698, 1910, 1700, 1701, 1709, 1713, 1917, 1920, + /* 480 */ 1921, 1723, 1725, 1925, 1926, 1780, 1880, 1891, 1930, 1900, + /* 490 */ 1939, 1941, 1905, 1893, 1945, 1897, 1947, 1903, 1949, 1950, + /* 500 */ 1951, 1907, 1952, 1953, 1954, 1958, 1959, 1961, 1796, 1927, + /* 510 */ 1963, 1800, 1965, 1967, 1968, 1969, 1970, 1971, 1972, 1974, + /* 520 */ 1975, 1976, 1978, 1980, 1981, 1982, 1984, 1985, 1986, 1987, + /* 530 */ 1988, 1940, 1990, 1946, 1992, 1993, 1994, 1995, 1998, 1999, + /* 540 */ 2002, 2003, 1997, 2010, 1864, 2014, 1869, 2017, 1874, 2021, + /* 550 */ 2022, 2001, 1977, 2004, 1979, 2025, 1983, 1991, 2030, 1989, + /* 560 */ 2037, 1996, 2039, 2040, 2006, 2000, 2007, 2041, 2008, 2009, + /* 570 */ 2011, 2042, 2013, 2019, 2015, 2044, 2031, 2046, 2027, 2038, + /* 580 */ 2023, 2026, 2028, 2018, 2033, 2047, 2036, 2049, 2052, 2074, + /* 590 */ 2076, 2083, 2051, 1839, 2034, 2026, 2035, 2094, 2095, 2024, + /* 600 */ 2097, 2098, 2062, 2053, 2058, 2105, 2065, 2055, 2061, 2107, + /* 610 */ 2071, 2059, 2067, 2111, 2075, 2064, 2077, 2117, 2118, 2126, + /* 620 */ 2128, 2129, 2130, 2016, 2020, 2100, 2110, 2134, 2103, 2104, + /* 630 */ 2106, 2108, 2109, 2112, 2113, 2115, 2114, 2120, 2121, 2122, + /* 640 */ 2133, 2123, 2135, 2139, 2144, 2141, 2148, 2142, 2086, 2157, + /* 650 */ 2140, 2131, 2165, 2166, 2167, 2132, 2170, 2136, 2171, 2150, + /* 660 */ 2154, 2138, 2145, 2146, 2069, 2078, 2178, 2012, 2079, 2029, + /* 670 */ 2026, 2143, 2181, 2043, 2147, 2168, 2187, 2048, 2172, 2045, + /* 680 */ 2060, 2188, 2200, 2054, 2066, 2070, 2073, 2194, 2169, 1912, + /* 690 */ 2116, 2101, 2127, 2153, 2174, 2182, 2159, 2175, 2119, 2180, + /* 700 */ 2161, 2160, 2185, 2189, 2162, 2179, 2183, 2184, 2164, 2202, + /* 710 */ 2201, 2224, 2190, 2205, 1931, 2137, 2176, 2216, 2192, 2238, + /* 720 */ 2186, 2193, 2218, 2243, 2056, 2240, 2250, 2251, 2252, 2255, + /* 730 */ 2259, 2196, 2206, 2246, 2057, 2267, 2253, 2308, 2310, 2208, + /* 740 */ 2271, 2289, 2219, 2068, 2220, 2324, 2305, 2092, 2223, 2225, + /* 750 */ 2226, 2284, 2228, 2229, 2288, 2232, 2319, 2124, 2235, 2236, + /* 760 */ 2241, 2239, 2245, 2156, 2256, 2348, 2318, 2191, 2260, 2249, + /* 770 */ 2026, 2313, 2261, 2262, 2263, 2265, 2266, 2257, 2269, 2329, + /* 780 */ 2338, 2272, 2270, 2343, 2274, 2276, 2349, 2278, 2279, 2351, + /* 790 */ 2283, 2286, 2354, 2285, 2287, 2361, 2292, 2281, 2290, 2291, + /* 800 */ 2293, 2299, 2379, 2306, 2377, 2309, 2379, 2379, 2393, 2345, + /* 810 */ 2353, 2383, 2385, 2389, 2392, 2394, 2395, 2396, 2397, 2398, + /* 820 */ 2352, 2326, 2358, 2336, 2406, 2403, 2405, 2407, 2421, 2408, + /* 830 */ 2409, 2410, 2370, 2114, 2412, 2120, 2414, 2416, 2417, 2418, + /* 840 */ 2434, 2420, 2458, 2422, 2411, 2419, 2460, 2426, 2413, 2424, + /* 850 */ 2470, 2441, 2431, 2442, 2471, 2448, 2435, 2445, 2488, 2452, + /* 860 */ 2453, 2491, 2472, 2463, 2475, 2477, 2483, 2485, 2489, 2473, }; #define YY_REDUCE_COUNT (345) -#define YY_REDUCE_MIN (-485) -#define YY_REDUCE_MAX (2785) +#define YY_REDUCE_MIN (-488) +#define YY_REDUCE_MAX (2652) static const short yy_reduce_ofst[] = { - /* 0 */ 192, -321, 150, 390, 487, 635, 674, 732, 883, 920, - /* 10 */ 954, 1129, 1153, 428, 1285, 1399, 188, 1419, 1199, 1434, - /* 20 */ 1518, 1535, 1551, 1632, 1650, 1666, 1733, 1766, 1889, 1969, - /* 30 */ 2004, 2028, 2050, 2129, 2150, 2173, 2260, 2295, 2334, 2392, - /* 40 */ 2407, 2422, 2491, 2521, 2551, 2618, 2638, 2715, 2752, 2785, - /* 50 */ -323, 411, 153, 309, 445, 598, 690, 754, 336, 585, - /* 60 */ 878, -44, -485, -327, -239, -316, -152, -395, -302, 176, - /* 70 */ -183, -77, -79, -38, -371, -366, -387, 127, -233, 220, - /* 80 */ 545, -263, -22, -16, 55, 248, 332, 508, 255, 379, - /* 90 */ 394, 436, 548, 590, -360, 555, 627, 537, 353, 680, - /* 100 */ 672, 711, 650, 779, 784, 765, 787, 800, 799, 873, - /* 110 */ 870, 859, 877, 918, -194, -379, -379, -375, -357, -207, - /* 120 */ -343, -54, 279, 642, 644, 771, 789, 803, 881, 884, - /* 130 */ 899, 912, 916, 927, 929, 941, 947, 949, 959, 37, - /* 140 */ 157, 241, 285, 685, 811, 778, 157, 362, 400, 314, - /* 150 */ 430, -382, 640, 896, 482, 399, 554, 471, 595, 705, - /* 160 */ 713, 638, 801, 844, 909, 960, -400, 313, 456, 532, - /* 170 */ 546, 572, 643, 546, 701, 932, 1034, 1012, 943, 943, - /* 180 */ 925, 937, 946, 964, 1083, 943, 1059, 1059, 1072, 1073, - /* 190 */ 1065, 1121, 1070, 987, 990, 993, 1069, 1059, 995, 1133, - /* 200 */ 1089, 1144, 1109, 1079, 1103, 1105, 1059, 1032, 1039, 1019, - /* 210 */ 1054, 1041, 1146, 1107, 1086, 1093, 1106, 1098, 1172, 1108, - /* 220 */ 1175, 1118, 1190, 1191, 1148, 1198, 1152, 1156, 1204, 1205, - /* 230 */ 1208, 1159, 1160, 1163, 1164, 1201, 1206, 1217, 1216, 1229, - /* 240 */ 1232, 1234, 1242, 1252, 1259, 1254, 1176, 1245, 1249, 1220, - /* 250 */ 1250, 1262, 1200, 1257, 1266, 1260, 1214, 1263, 1265, 1275, - /* 260 */ 1267, 1284, 1255, 1268, 1269, 1272, 1273, 1277, 1278, 1279, - /* 270 */ 1280, 1281, 1283, 1287, 1288, 1289, 1290, 1237, 1240, 1274, - /* 280 */ 1218, 1221, 1227, 1309, 1243, 1246, 1256, 1282, 1315, 1261, - /* 290 */ 1323, 1291, 1203, 1307, 1209, 1308, 1212, 1224, 1210, 1215, - /* 300 */ 1239, 1241, 1317, 1264, 1253, 1233, 1235, 1276, 1387, 1302, - /* 310 */ 1286, 1292, 1394, 1390, 1391, 1294, 1344, 1361, 1363, 1365, - /* 320 */ 1367, 1346, 1368, 1356, 1405, 1389, 1409, 1417, 1374, 1378, - /* 330 */ 1397, 1383, 1426, 1420, 1439, 1438, 1440, 1370, 1358, 1377, - /* 340 */ 1381, 1422, 1423, 1427, 1430, 1448, + /* 0 */ 758, -322, 151, 189, 392, 424, 638, 671, 885, 924, + /* 10 */ 982, 1132, 1171, 1229, 1303, 1380, 502, 1404, 748, 1426, + /* 20 */ 1464, 1537, 1595, 1618, 1653, 1736, 1773, 1811, 1849, 1887, + /* 30 */ 1933, 2005, 2032, 2063, 2102, 2177, 2199, 2214, 2237, 2258, + /* 40 */ 2355, 2371, 2390, 2429, 2468, 2500, 2578, 2616, 2637, 2652, + /* 50 */ -324, -340, -432, 54, -434, -425, 787, 896, 470, 538, + /* 60 */ 1223, 141, 799, -61, -94, -419, 426, -395, -202, 178, + /* 70 */ -372, -327, -252, 261, 331, 399, -381, 128, 434, 195, + /* 80 */ 256, -298, -376, 11, 288, 381, -275, -115, 440, 479, + /* 90 */ 505, 535, -98, -217, -235, 637, 642, -370, 125, 645, + /* 100 */ 144, 683, 382, 697, 725, 275, 738, 750, 418, 752, + /* 110 */ 607, 430, 632, 782, 296, -62, -62, -335, -488, 397, + /* 120 */ 100, 408, 427, 500, 617, 639, 703, 735, 746, 749, + /* 130 */ 772, 786, 834, 836, 842, 844, 848, 849, 858, -104, + /* 140 */ 109, 646, 231, 780, 790, 497, 109, 301, 551, 394, + /* 150 */ 575, -346, 508, 64, 713, 679, -123, 437, 759, 789, + /* 160 */ 740, 770, 778, 806, 862, 916, -407, -403, 383, 421, + /* 170 */ 451, 528, 605, 451, 510, 702, 1010, 606, 623, 623, + /* 180 */ 576, 773, 871, 890, 1031, 623, 1016, 1016, 1049, 1052, + /* 190 */ 1028, 1071, 1035, 956, 984, 986, 1063, 1016, 990, 1127, + /* 200 */ 1081, 1135, 1097, 1067, 1086, 1088, 1016, 1021, 1022, 1003, + /* 210 */ 1038, 1023, 1131, 1091, 1069, 1082, 1093, 1094, 1176, 1109, + /* 220 */ 1178, 1121, 1192, 1195, 1156, 1200, 1159, 1163, 1211, 1215, + /* 230 */ 1213, 1169, 1173, 1174, 1181, 1219, 1225, 1235, 1228, 1242, + /* 240 */ 1243, 1244, 1253, 1255, 1256, 1258, 1179, 1250, 1251, 1210, + /* 250 */ 1260, 1269, 1209, 1268, 1276, 1272, 1226, 1277, 1278, 1284, + /* 260 */ 1280, 1292, 1261, 1263, 1265, 1266, 1267, 1270, 1271, 1273, + /* 270 */ 1274, 1279, 1281, 1293, 1306, 1307, 1308, 1288, 1289, 1290, + /* 280 */ 1232, 1237, 1230, 1310, 1249, 1295, 1291, 1305, 1338, 1285, + /* 290 */ 1349, 1309, 1222, 1297, 1240, 1314, 1239, 1245, 1246, 1254, + /* 300 */ 1257, 1259, 1316, 1262, 1294, 1247, 1286, 1298, 1409, 1315, + /* 310 */ 1301, 1300, 1411, 1410, 1412, 1311, 1361, 1381, 1383, 1385, + /* 320 */ 1388, 1371, 1393, 1382, 1428, 1413, 1433, 1435, 1398, 1408, + /* 330 */ 1415, 1416, 1442, 1439, 1461, 1459, 1463, 1389, 1376, 1399, + /* 340 */ 1402, 1445, 1453, 1455, 1452, 1475, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 10 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 20 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 30 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 40 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 50 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 60 */ 2331, 1991, 1991, 2294, 1991, 1991, 1991, 1991, 1991, 1991, - /* 70 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2301, 1991, 1991, - /* 80 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 90 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2090, 1991, 1991, - /* 100 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 110 */ 1991, 1991, 1991, 1991, 2088, 2555, 1991, 1991, 2584, 1991, - /* 120 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 130 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 140 */ 2567, 1991, 1991, 2062, 2062, 1991, 2567, 2567, 2567, 2527, - /* 150 */ 2527, 2088, 1991, 1991, 2090, 2369, 1991, 1991, 1991, 1991, - /* 160 */ 1991, 1991, 1991, 1991, 2213, 2021, 1991, 1991, 1991, 1991, - /* 170 */ 2237, 1991, 1991, 1991, 2357, 1991, 1991, 2613, 2559, 2560, - /* 180 */ 2675, 1991, 2616, 2578, 1991, 2573, 1991, 1991, 1991, 1991, - /* 190 */ 2306, 1991, 2603, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 200 */ 1991, 1991, 2166, 2351, 1991, 1991, 1991, 1991, 1991, 2659, - /* 210 */ 2557, 2597, 1991, 2607, 1991, 2394, 1991, 2383, 2090, 1991, - /* 220 */ 2090, 2344, 2289, 1991, 2299, 1991, 2299, 2296, 1991, 1991, - /* 230 */ 1991, 2299, 2296, 2296, 2296, 2155, 2151, 1991, 2149, 1991, - /* 240 */ 1991, 1991, 1991, 2046, 1991, 2046, 1991, 2090, 2090, 1991, - /* 250 */ 2090, 1991, 1991, 2090, 1991, 2090, 1991, 2090, 2090, 1991, - /* 260 */ 2090, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 270 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 280 */ 2381, 2367, 1991, 2088, 1991, 2355, 2353, 1991, 2088, 2607, - /* 290 */ 1991, 1991, 2629, 2624, 2629, 2624, 2643, 2639, 2629, 2648, - /* 300 */ 2645, 2609, 2607, 2590, 2586, 2678, 2665, 2661, 1991, 1991, - /* 310 */ 2595, 2593, 1991, 2088, 2088, 1991, 2624, 1991, 1991, 1991, - /* 320 */ 1991, 2624, 1991, 1991, 2088, 1991, 2088, 1991, 1991, 1991, - /* 330 */ 2182, 1991, 1991, 2088, 1991, 2030, 1991, 2346, 2372, 2327, - /* 340 */ 2327, 2216, 2216, 2216, 2091, 1996, 1991, 1991, 1991, 1991, - /* 350 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2642, 2641, - /* 360 */ 2479, 1991, 2531, 2530, 2529, 2520, 2478, 2178, 1991, 1991, - /* 370 */ 2477, 2476, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 380 */ 1991, 1991, 1991, 2470, 1991, 1991, 2471, 2469, 2468, 2318, - /* 390 */ 2317, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 400 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 410 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2662, 2666, 1991, - /* 420 */ 2556, 1991, 1991, 1991, 2450, 1991, 1991, 1991, 1991, 1991, - /* 430 */ 2418, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 440 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 450 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 460 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 470 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 480 */ 1991, 1991, 1991, 1991, 1991, 2295, 1991, 1991, 1991, 1991, - /* 490 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 500 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 510 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 520 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 530 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 540 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2310, 1991, 1991, - /* 550 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 560 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 570 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2035, - /* 580 */ 2457, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 590 */ 1991, 1991, 1991, 1991, 2460, 1991, 1991, 1991, 1991, 1991, - /* 600 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 610 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 620 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 630 */ 1991, 1991, 1991, 1991, 1991, 2130, 2129, 1991, 1991, 1991, - /* 640 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 650 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 660 */ 1991, 1991, 1991, 2461, 1991, 1991, 1991, 1991, 1991, 2452, - /* 670 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 680 */ 1991, 1991, 1991, 1991, 1991, 1991, 2658, 2610, 1991, 1991, - /* 690 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 700 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 710 */ 2450, 1991, 2640, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 720 */ 2656, 1991, 2660, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 730 */ 2566, 2562, 1991, 1991, 2558, 1991, 1991, 1991, 1991, 1991, - /* 740 */ 2517, 1991, 1991, 1991, 2551, 1991, 1991, 1991, 1991, 1991, - /* 750 */ 1991, 1991, 1991, 1991, 2461, 1991, 2464, 1991, 1991, 1991, - /* 760 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 2449, - /* 770 */ 1991, 2502, 2501, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 780 */ 2210, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 790 */ 1991, 1991, 1991, 1991, 1991, 1991, 2194, 2192, 2191, 2190, - /* 800 */ 1991, 2223, 1991, 1991, 1991, 2219, 2218, 1991, 1991, 1991, - /* 810 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 820 */ 1991, 1991, 1991, 2109, 1991, 1991, 1991, 1991, 1991, 1991, - /* 830 */ 1991, 1991, 2101, 1991, 2100, 1991, 1991, 1991, 1991, 1991, - /* 840 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 850 */ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, - /* 860 */ 1991, 1991, 2020, 1991, 1991, 1991, 1991, 1991, 1991, + /* 0 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 10 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 20 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 30 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 40 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 50 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 60 */ 2334, 1993, 1993, 2297, 1993, 1993, 1993, 1993, 1993, 1993, + /* 70 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2304, 1993, 1993, + /* 80 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 90 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2092, 1993, 1993, + /* 100 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 110 */ 1993, 1993, 1993, 1993, 2090, 2558, 1993, 1993, 2587, 1993, + /* 120 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 130 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 140 */ 2570, 1993, 1993, 2064, 2064, 1993, 2570, 2570, 2570, 2530, + /* 150 */ 2530, 2090, 1993, 1993, 2092, 2372, 1993, 1993, 1993, 1993, + /* 160 */ 1993, 1993, 1993, 1993, 2215, 2023, 1993, 1993, 1993, 1993, + /* 170 */ 2239, 1993, 1993, 1993, 2360, 1993, 1993, 2616, 2562, 2563, + /* 180 */ 2678, 1993, 2619, 2581, 1993, 2576, 1993, 1993, 1993, 1993, + /* 190 */ 2309, 1993, 2606, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 200 */ 1993, 1993, 2168, 2354, 1993, 1993, 1993, 1993, 1993, 2662, + /* 210 */ 2560, 2600, 1993, 2610, 1993, 2397, 1993, 2386, 2092, 1993, + /* 220 */ 2092, 2347, 2292, 1993, 2302, 1993, 2302, 2299, 1993, 1993, + /* 230 */ 1993, 2302, 2299, 2299, 2299, 2157, 2153, 1993, 2151, 1993, + /* 240 */ 1993, 1993, 1993, 2048, 1993, 2048, 1993, 2092, 2092, 1993, + /* 250 */ 2092, 1993, 1993, 2092, 1993, 2092, 1993, 2092, 2092, 1993, + /* 260 */ 2092, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 270 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 280 */ 2384, 2370, 1993, 2090, 1993, 2358, 2356, 1993, 2090, 2610, + /* 290 */ 1993, 1993, 2632, 2627, 2632, 2627, 2646, 2642, 2632, 2651, + /* 300 */ 2648, 2612, 2610, 2593, 2589, 2681, 2668, 2664, 1993, 1993, + /* 310 */ 2598, 2596, 1993, 2090, 2090, 1993, 2627, 1993, 1993, 1993, + /* 320 */ 1993, 2627, 1993, 1993, 2090, 1993, 2090, 1993, 1993, 1993, + /* 330 */ 2184, 1993, 1993, 2090, 1993, 2032, 1993, 2349, 2375, 2330, + /* 340 */ 2330, 2218, 2218, 2218, 2093, 1998, 1993, 1993, 1993, 1993, + /* 350 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2645, 2644, + /* 360 */ 2482, 1993, 2534, 2533, 2532, 2523, 2481, 2180, 1993, 1993, + /* 370 */ 2480, 2479, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 380 */ 1993, 1993, 1993, 2473, 1993, 1993, 2474, 2472, 2471, 2321, + /* 390 */ 2320, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 400 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 410 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2665, 2669, 1993, + /* 420 */ 2559, 1993, 1993, 1993, 2453, 1993, 1993, 1993, 1993, 1993, + /* 430 */ 2421, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 440 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 450 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 460 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 470 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 480 */ 1993, 1993, 1993, 1993, 1993, 2298, 1993, 1993, 1993, 1993, + /* 490 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 500 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 510 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 520 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 530 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 540 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2313, 1993, + /* 550 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 560 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 570 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 580 */ 2037, 2460, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 590 */ 1993, 1993, 1993, 1993, 1993, 2463, 1993, 1993, 1993, 1993, + /* 600 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 610 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 620 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 630 */ 1993, 1993, 1993, 1993, 1993, 1993, 2132, 2131, 1993, 1993, + /* 640 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 650 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 660 */ 1993, 1993, 1993, 1993, 2464, 1993, 1993, 1993, 1993, 1993, + /* 670 */ 2455, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 680 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2661, 2613, 1993, + /* 690 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 700 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 710 */ 1993, 2453, 1993, 2643, 1993, 1993, 1993, 1993, 1993, 1993, + /* 720 */ 1993, 2659, 1993, 2663, 1993, 1993, 1993, 1993, 1993, 1993, + /* 730 */ 1993, 2569, 2565, 1993, 1993, 2561, 1993, 1993, 1993, 1993, + /* 740 */ 1993, 2520, 1993, 1993, 1993, 2554, 1993, 1993, 1993, 1993, + /* 750 */ 1993, 1993, 1993, 1993, 1993, 2464, 1993, 2467, 1993, 1993, + /* 760 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 770 */ 2452, 1993, 2505, 2504, 1993, 1993, 1993, 1993, 1993, 1993, + /* 780 */ 1993, 2212, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 790 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 2196, 2194, 2193, + /* 800 */ 2192, 1993, 2225, 1993, 1993, 1993, 2221, 2220, 1993, 1993, + /* 810 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 820 */ 1993, 1993, 1993, 1993, 2111, 1993, 1993, 1993, 1993, 1993, + /* 830 */ 1993, 1993, 1993, 2103, 1993, 2102, 1993, 1993, 1993, 1993, + /* 840 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 850 */ 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, 1993, + /* 860 */ 1993, 1993, 1993, 2022, 1993, 1993, 1993, 1993, 1993, 1993, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1258,7 +1232,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* BWLIMIT => nothing */ 0, /* START => nothing */ 0, /* TIMESTAMP => nothing */ - 312, /* END => ABORT */ + 313, /* END => ABORT */ 0, /* TABLE => nothing */ 0, /* NK_LP => nothing */ 0, /* NK_RP => nothing */ @@ -1305,6 +1279,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* STABLES => nothing */ 0, /* MNODES => nothing */ 0, /* QNODES => nothing */ + 0, /* ARBGROUPS => nothing */ 0, /* FUNCTIONS => nothing */ 0, /* INDEXES => nothing */ 0, /* ACCOUNTS => nothing */ @@ -1328,7 +1303,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* VNODES => nothing */ 0, /* ALIVE => nothing */ 0, /* VIEWS => nothing */ - 312, /* VIEW => ABORT */ + 313, /* VIEW => ABORT */ 0, /* COMPACTS => nothing */ 0, /* NORMAL => nothing */ 0, /* CHILD => nothing */ @@ -1430,7 +1405,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* LEFT => nothing */ 0, /* RIGHT => nothing */ 0, /* OUTER => nothing */ - 312, /* SEMI => ABORT */ + 313, /* SEMI => ABORT */ 0, /* ANTI => nothing */ 0, /* ASOF => nothing */ 0, /* WINDOW => nothing */ @@ -1466,54 +1441,54 @@ static const YYCODETYPE yyFallback[] = { 0, /* ASC => nothing */ 0, /* NULLS => nothing */ 0, /* ABORT => nothing */ - 312, /* AFTER => ABORT */ - 312, /* ATTACH => ABORT */ - 312, /* BEFORE => ABORT */ - 312, /* BEGIN => ABORT */ - 312, /* BITAND => ABORT */ - 312, /* BITNOT => ABORT */ - 312, /* BITOR => ABORT */ - 312, /* BLOCKS => ABORT */ - 312, /* CHANGE => ABORT */ - 312, /* COMMA => ABORT */ - 312, /* CONCAT => ABORT */ - 312, /* CONFLICT => ABORT */ - 312, /* COPY => ABORT */ - 312, /* DEFERRED => ABORT */ - 312, /* DELIMITERS => ABORT */ - 312, /* DETACH => ABORT */ - 312, /* DIVIDE => ABORT */ - 312, /* DOT => ABORT */ - 312, /* EACH => ABORT */ - 312, /* FAIL => ABORT */ - 312, /* FILE => ABORT */ - 312, /* FOR => ABORT */ - 312, /* GLOB => ABORT */ - 312, /* ID => ABORT */ - 312, /* IMMEDIATE => ABORT */ - 312, /* IMPORT => ABORT */ - 312, /* INITIALLY => ABORT */ - 312, /* INSTEAD => ABORT */ - 312, /* ISNULL => ABORT */ - 312, /* KEY => ABORT */ - 312, /* MODULES => ABORT */ - 312, /* NK_BITNOT => ABORT */ - 312, /* NK_SEMI => ABORT */ - 312, /* NOTNULL => ABORT */ - 312, /* OF => ABORT */ - 312, /* PLUS => ABORT */ - 312, /* PRIVILEGE => ABORT */ - 312, /* RAISE => ABORT */ - 312, /* RESTRICT => ABORT */ - 312, /* ROW => ABORT */ - 312, /* STAR => ABORT */ - 312, /* STATEMENT => ABORT */ - 312, /* STRICT => ABORT */ - 312, /* STRING => ABORT */ - 312, /* TIMES => ABORT */ - 312, /* VALUES => ABORT */ - 312, /* VARIABLE => ABORT */ - 312, /* WAL => ABORT */ + 313, /* AFTER => ABORT */ + 313, /* ATTACH => ABORT */ + 313, /* BEFORE => ABORT */ + 313, /* BEGIN => ABORT */ + 313, /* BITAND => ABORT */ + 313, /* BITNOT => ABORT */ + 313, /* BITOR => ABORT */ + 313, /* BLOCKS => ABORT */ + 313, /* CHANGE => ABORT */ + 313, /* COMMA => ABORT */ + 313, /* CONCAT => ABORT */ + 313, /* CONFLICT => ABORT */ + 313, /* COPY => ABORT */ + 313, /* DEFERRED => ABORT */ + 313, /* DELIMITERS => ABORT */ + 313, /* DETACH => ABORT */ + 313, /* DIVIDE => ABORT */ + 313, /* DOT => ABORT */ + 313, /* EACH => ABORT */ + 313, /* FAIL => ABORT */ + 313, /* FILE => ABORT */ + 313, /* FOR => ABORT */ + 313, /* GLOB => ABORT */ + 313, /* ID => ABORT */ + 313, /* IMMEDIATE => ABORT */ + 313, /* IMPORT => ABORT */ + 313, /* INITIALLY => ABORT */ + 313, /* INSTEAD => ABORT */ + 313, /* ISNULL => ABORT */ + 313, /* KEY => ABORT */ + 313, /* MODULES => ABORT */ + 313, /* NK_BITNOT => ABORT */ + 313, /* NK_SEMI => ABORT */ + 313, /* NOTNULL => ABORT */ + 313, /* OF => ABORT */ + 313, /* PLUS => ABORT */ + 313, /* PRIVILEGE => ABORT */ + 313, /* RAISE => ABORT */ + 313, /* RESTRICT => ABORT */ + 313, /* ROW => ABORT */ + 313, /* STAR => ABORT */ + 313, /* STATEMENT => ABORT */ + 313, /* STRICT => ABORT */ + 313, /* STRING => ABORT */ + 313, /* TIMES => ABORT */ + 313, /* VALUES => ABORT */ + 313, /* VARIABLE => ABORT */ + 313, /* WAL => ABORT */ }; #endif /* YYFALLBACK */ @@ -1753,383 +1728,384 @@ static const char *const yyTokenName[] = { /* 149 */ "STABLES", /* 150 */ "MNODES", /* 151 */ "QNODES", - /* 152 */ "FUNCTIONS", - /* 153 */ "INDEXES", - /* 154 */ "ACCOUNTS", - /* 155 */ "APPS", - /* 156 */ "CONNECTIONS", - /* 157 */ "LICENCES", - /* 158 */ "GRANTS", - /* 159 */ "FULL", - /* 160 */ "LOGS", - /* 161 */ "MACHINES", - /* 162 */ "QUERIES", - /* 163 */ "SCORES", - /* 164 */ "TOPICS", - /* 165 */ "VARIABLES", - /* 166 */ "BNODES", - /* 167 */ "SNODES", - /* 168 */ "TRANSACTIONS", - /* 169 */ "DISTRIBUTED", - /* 170 */ "CONSUMERS", - /* 171 */ "SUBSCRIPTIONS", - /* 172 */ "VNODES", - /* 173 */ "ALIVE", - /* 174 */ "VIEWS", - /* 175 */ "VIEW", - /* 176 */ "COMPACTS", - /* 177 */ "NORMAL", - /* 178 */ "CHILD", - /* 179 */ "LIKE", - /* 180 */ "TBNAME", - /* 181 */ "QTAGS", - /* 182 */ "AS", - /* 183 */ "SYSTEM", - /* 184 */ "INDEX", - /* 185 */ "FUNCTION", - /* 186 */ "INTERVAL", - /* 187 */ "COUNT", - /* 188 */ "LAST_ROW", - /* 189 */ "META", - /* 190 */ "ONLY", - /* 191 */ "TOPIC", - /* 192 */ "CONSUMER", - /* 193 */ "GROUP", - /* 194 */ "DESC", - /* 195 */ "DESCRIBE", - /* 196 */ "RESET", - /* 197 */ "QUERY", - /* 198 */ "CACHE", - /* 199 */ "EXPLAIN", - /* 200 */ "ANALYZE", - /* 201 */ "VERBOSE", - /* 202 */ "NK_BOOL", - /* 203 */ "RATIO", - /* 204 */ "NK_FLOAT", - /* 205 */ "OUTPUTTYPE", - /* 206 */ "AGGREGATE", - /* 207 */ "BUFSIZE", - /* 208 */ "LANGUAGE", - /* 209 */ "REPLACE", - /* 210 */ "STREAM", - /* 211 */ "INTO", - /* 212 */ "PAUSE", - /* 213 */ "RESUME", - /* 214 */ "TRIGGER", - /* 215 */ "AT_ONCE", - /* 216 */ "WINDOW_CLOSE", - /* 217 */ "IGNORE", - /* 218 */ "EXPIRED", - /* 219 */ "FILL_HISTORY", - /* 220 */ "UPDATE", - /* 221 */ "SUBTABLE", - /* 222 */ "UNTREATED", - /* 223 */ "KILL", - /* 224 */ "CONNECTION", - /* 225 */ "TRANSACTION", - /* 226 */ "BALANCE", - /* 227 */ "VGROUP", - /* 228 */ "LEADER", - /* 229 */ "MERGE", - /* 230 */ "REDISTRIBUTE", - /* 231 */ "SPLIT", - /* 232 */ "DELETE", - /* 233 */ "INSERT", - /* 234 */ "NK_BIN", - /* 235 */ "NK_HEX", - /* 236 */ "NULL", - /* 237 */ "NK_QUESTION", - /* 238 */ "NK_ALIAS", - /* 239 */ "NK_ARROW", - /* 240 */ "ROWTS", - /* 241 */ "QSTART", - /* 242 */ "QEND", - /* 243 */ "QDURATION", - /* 244 */ "WSTART", - /* 245 */ "WEND", - /* 246 */ "WDURATION", - /* 247 */ "IROWTS", - /* 248 */ "ISFILLED", - /* 249 */ "CAST", - /* 250 */ "NOW", - /* 251 */ "TODAY", - /* 252 */ "TIMEZONE", - /* 253 */ "CLIENT_VERSION", - /* 254 */ "SERVER_VERSION", - /* 255 */ "SERVER_STATUS", - /* 256 */ "CURRENT_USER", - /* 257 */ "CASE", - /* 258 */ "WHEN", - /* 259 */ "THEN", - /* 260 */ "ELSE", - /* 261 */ "BETWEEN", - /* 262 */ "IS", - /* 263 */ "NK_LT", - /* 264 */ "NK_GT", - /* 265 */ "NK_LE", - /* 266 */ "NK_GE", - /* 267 */ "NK_NE", - /* 268 */ "MATCH", - /* 269 */ "NMATCH", - /* 270 */ "CONTAINS", - /* 271 */ "IN", - /* 272 */ "JOIN", - /* 273 */ "INNER", - /* 274 */ "LEFT", - /* 275 */ "RIGHT", - /* 276 */ "OUTER", - /* 277 */ "SEMI", - /* 278 */ "ANTI", - /* 279 */ "ASOF", - /* 280 */ "WINDOW", - /* 281 */ "WINDOW_OFFSET", - /* 282 */ "JLIMIT", - /* 283 */ "SELECT", - /* 284 */ "NK_HINT", - /* 285 */ "DISTINCT", - /* 286 */ "WHERE", - /* 287 */ "PARTITION", - /* 288 */ "BY", - /* 289 */ "SESSION", - /* 290 */ "STATE_WINDOW", - /* 291 */ "EVENT_WINDOW", - /* 292 */ "COUNT_WINDOW", - /* 293 */ "SLIDING", - /* 294 */ "FILL", - /* 295 */ "VALUE", - /* 296 */ "VALUE_F", - /* 297 */ "NONE", - /* 298 */ "PREV", - /* 299 */ "NULL_F", - /* 300 */ "LINEAR", - /* 301 */ "NEXT", - /* 302 */ "HAVING", - /* 303 */ "RANGE", - /* 304 */ "EVERY", - /* 305 */ "ORDER", - /* 306 */ "SLIMIT", - /* 307 */ "SOFFSET", - /* 308 */ "LIMIT", - /* 309 */ "OFFSET", - /* 310 */ "ASC", - /* 311 */ "NULLS", - /* 312 */ "ABORT", - /* 313 */ "AFTER", - /* 314 */ "ATTACH", - /* 315 */ "BEFORE", - /* 316 */ "BEGIN", - /* 317 */ "BITAND", - /* 318 */ "BITNOT", - /* 319 */ "BITOR", - /* 320 */ "BLOCKS", - /* 321 */ "CHANGE", - /* 322 */ "COMMA", - /* 323 */ "CONCAT", - /* 324 */ "CONFLICT", - /* 325 */ "COPY", - /* 326 */ "DEFERRED", - /* 327 */ "DELIMITERS", - /* 328 */ "DETACH", - /* 329 */ "DIVIDE", - /* 330 */ "DOT", - /* 331 */ "EACH", - /* 332 */ "FAIL", - /* 333 */ "FILE", - /* 334 */ "FOR", - /* 335 */ "GLOB", - /* 336 */ "ID", - /* 337 */ "IMMEDIATE", - /* 338 */ "IMPORT", - /* 339 */ "INITIALLY", - /* 340 */ "INSTEAD", - /* 341 */ "ISNULL", - /* 342 */ "KEY", - /* 343 */ "MODULES", - /* 344 */ "NK_BITNOT", - /* 345 */ "NK_SEMI", - /* 346 */ "NOTNULL", - /* 347 */ "OF", - /* 348 */ "PLUS", - /* 349 */ "PRIVILEGE", - /* 350 */ "RAISE", - /* 351 */ "RESTRICT", - /* 352 */ "ROW", - /* 353 */ "STAR", - /* 354 */ "STATEMENT", - /* 355 */ "STRICT", - /* 356 */ "STRING", - /* 357 */ "TIMES", - /* 358 */ "VALUES", - /* 359 */ "VARIABLE", - /* 360 */ "WAL", - /* 361 */ "cmd", - /* 362 */ "account_options", - /* 363 */ "alter_account_options", - /* 364 */ "literal", - /* 365 */ "alter_account_option", - /* 366 */ "ip_range_list", - /* 367 */ "white_list", - /* 368 */ "white_list_opt", - /* 369 */ "user_name", - /* 370 */ "sysinfo_opt", - /* 371 */ "privileges", - /* 372 */ "priv_level", - /* 373 */ "with_opt", - /* 374 */ "priv_type_list", - /* 375 */ "priv_type", - /* 376 */ "db_name", - /* 377 */ "table_name", - /* 378 */ "topic_name", - /* 379 */ "search_condition", - /* 380 */ "dnode_endpoint", - /* 381 */ "force_opt", - /* 382 */ "unsafe_opt", - /* 383 */ "not_exists_opt", - /* 384 */ "db_options", - /* 385 */ "exists_opt", - /* 386 */ "alter_db_options", - /* 387 */ "speed_opt", - /* 388 */ "start_opt", - /* 389 */ "end_opt", - /* 390 */ "integer_list", - /* 391 */ "variable_list", - /* 392 */ "retention_list", - /* 393 */ "signed", - /* 394 */ "alter_db_option", - /* 395 */ "retention", - /* 396 */ "full_table_name", - /* 397 */ "column_def_list", - /* 398 */ "tags_def_opt", - /* 399 */ "table_options", - /* 400 */ "multi_create_clause", - /* 401 */ "tags_def", - /* 402 */ "multi_drop_clause", - /* 403 */ "alter_table_clause", - /* 404 */ "alter_table_options", - /* 405 */ "column_name", - /* 406 */ "type_name", - /* 407 */ "tags_literal", - /* 408 */ "create_subtable_clause", - /* 409 */ "specific_cols_opt", - /* 410 */ "tags_literal_list", - /* 411 */ "drop_table_clause", - /* 412 */ "col_name_list", - /* 413 */ "column_def", - /* 414 */ "duration_list", - /* 415 */ "rollup_func_list", - /* 416 */ "alter_table_option", - /* 417 */ "duration_literal", - /* 418 */ "rollup_func_name", - /* 419 */ "function_name", - /* 420 */ "col_name", - /* 421 */ "db_kind_opt", - /* 422 */ "table_kind_db_name_cond_opt", - /* 423 */ "like_pattern_opt", - /* 424 */ "db_name_cond_opt", - /* 425 */ "table_name_cond", - /* 426 */ "from_db_opt", - /* 427 */ "tag_list_opt", - /* 428 */ "table_kind", - /* 429 */ "tag_item", - /* 430 */ "column_alias", - /* 431 */ "index_options", - /* 432 */ "full_index_name", - /* 433 */ "index_name", - /* 434 */ "func_list", - /* 435 */ "sliding_opt", - /* 436 */ "sma_stream_opt", - /* 437 */ "func", - /* 438 */ "sma_func_name", - /* 439 */ "expression_list", - /* 440 */ "with_meta", - /* 441 */ "query_or_subquery", - /* 442 */ "where_clause_opt", - /* 443 */ "cgroup_name", - /* 444 */ "analyze_opt", - /* 445 */ "explain_options", - /* 446 */ "insert_query", - /* 447 */ "or_replace_opt", - /* 448 */ "agg_func_opt", - /* 449 */ "bufsize_opt", - /* 450 */ "language_opt", - /* 451 */ "full_view_name", - /* 452 */ "view_name", - /* 453 */ "stream_name", - /* 454 */ "stream_options", - /* 455 */ "col_list_opt", - /* 456 */ "tag_def_or_ref_opt", - /* 457 */ "subtable_opt", - /* 458 */ "ignore_opt", - /* 459 */ "expression", - /* 460 */ "on_vgroup_id", - /* 461 */ "dnode_list", - /* 462 */ "literal_func", - /* 463 */ "signed_literal", - /* 464 */ "literal_list", - /* 465 */ "table_alias", - /* 466 */ "expr_or_subquery", - /* 467 */ "pseudo_column", - /* 468 */ "column_reference", - /* 469 */ "function_expression", - /* 470 */ "case_when_expression", - /* 471 */ "star_func", - /* 472 */ "star_func_para_list", - /* 473 */ "noarg_func", - /* 474 */ "other_para_list", - /* 475 */ "star_func_para", - /* 476 */ "when_then_list", - /* 477 */ "case_when_else_opt", - /* 478 */ "common_expression", - /* 479 */ "when_then_expr", - /* 480 */ "predicate", - /* 481 */ "compare_op", - /* 482 */ "in_op", - /* 483 */ "in_predicate_value", - /* 484 */ "boolean_value_expression", - /* 485 */ "boolean_primary", - /* 486 */ "from_clause_opt", - /* 487 */ "table_reference_list", - /* 488 */ "table_reference", - /* 489 */ "table_primary", - /* 490 */ "joined_table", - /* 491 */ "alias_opt", - /* 492 */ "subquery", - /* 493 */ "parenthesized_joined_table", - /* 494 */ "join_type", - /* 495 */ "join_subtype", - /* 496 */ "join_on_clause_opt", - /* 497 */ "window_offset_clause_opt", - /* 498 */ "jlimit_clause_opt", - /* 499 */ "window_offset_literal", - /* 500 */ "query_specification", - /* 501 */ "hint_list", - /* 502 */ "set_quantifier_opt", - /* 503 */ "tag_mode_opt", - /* 504 */ "select_list", - /* 505 */ "partition_by_clause_opt", - /* 506 */ "range_opt", - /* 507 */ "every_opt", - /* 508 */ "fill_opt", - /* 509 */ "twindow_clause_opt", - /* 510 */ "group_by_clause_opt", - /* 511 */ "having_clause_opt", - /* 512 */ "select_item", - /* 513 */ "partition_list", - /* 514 */ "partition_item", - /* 515 */ "interval_sliding_duration_literal", - /* 516 */ "fill_mode", - /* 517 */ "group_by_list", - /* 518 */ "query_expression", - /* 519 */ "query_simple", - /* 520 */ "order_by_clause_opt", - /* 521 */ "slimit_clause_opt", - /* 522 */ "limit_clause_opt", - /* 523 */ "union_query_expression", - /* 524 */ "query_simple_or_subquery", - /* 525 */ "sort_specification_list", - /* 526 */ "sort_specification", - /* 527 */ "ordering_specification_opt", - /* 528 */ "null_ordering_opt", + /* 152 */ "ARBGROUPS", + /* 153 */ "FUNCTIONS", + /* 154 */ "INDEXES", + /* 155 */ "ACCOUNTS", + /* 156 */ "APPS", + /* 157 */ "CONNECTIONS", + /* 158 */ "LICENCES", + /* 159 */ "GRANTS", + /* 160 */ "FULL", + /* 161 */ "LOGS", + /* 162 */ "MACHINES", + /* 163 */ "QUERIES", + /* 164 */ "SCORES", + /* 165 */ "TOPICS", + /* 166 */ "VARIABLES", + /* 167 */ "BNODES", + /* 168 */ "SNODES", + /* 169 */ "TRANSACTIONS", + /* 170 */ "DISTRIBUTED", + /* 171 */ "CONSUMERS", + /* 172 */ "SUBSCRIPTIONS", + /* 173 */ "VNODES", + /* 174 */ "ALIVE", + /* 175 */ "VIEWS", + /* 176 */ "VIEW", + /* 177 */ "COMPACTS", + /* 178 */ "NORMAL", + /* 179 */ "CHILD", + /* 180 */ "LIKE", + /* 181 */ "TBNAME", + /* 182 */ "QTAGS", + /* 183 */ "AS", + /* 184 */ "SYSTEM", + /* 185 */ "INDEX", + /* 186 */ "FUNCTION", + /* 187 */ "INTERVAL", + /* 188 */ "COUNT", + /* 189 */ "LAST_ROW", + /* 190 */ "META", + /* 191 */ "ONLY", + /* 192 */ "TOPIC", + /* 193 */ "CONSUMER", + /* 194 */ "GROUP", + /* 195 */ "DESC", + /* 196 */ "DESCRIBE", + /* 197 */ "RESET", + /* 198 */ "QUERY", + /* 199 */ "CACHE", + /* 200 */ "EXPLAIN", + /* 201 */ "ANALYZE", + /* 202 */ "VERBOSE", + /* 203 */ "NK_BOOL", + /* 204 */ "RATIO", + /* 205 */ "NK_FLOAT", + /* 206 */ "OUTPUTTYPE", + /* 207 */ "AGGREGATE", + /* 208 */ "BUFSIZE", + /* 209 */ "LANGUAGE", + /* 210 */ "REPLACE", + /* 211 */ "STREAM", + /* 212 */ "INTO", + /* 213 */ "PAUSE", + /* 214 */ "RESUME", + /* 215 */ "TRIGGER", + /* 216 */ "AT_ONCE", + /* 217 */ "WINDOW_CLOSE", + /* 218 */ "IGNORE", + /* 219 */ "EXPIRED", + /* 220 */ "FILL_HISTORY", + /* 221 */ "UPDATE", + /* 222 */ "SUBTABLE", + /* 223 */ "UNTREATED", + /* 224 */ "KILL", + /* 225 */ "CONNECTION", + /* 226 */ "TRANSACTION", + /* 227 */ "BALANCE", + /* 228 */ "VGROUP", + /* 229 */ "LEADER", + /* 230 */ "MERGE", + /* 231 */ "REDISTRIBUTE", + /* 232 */ "SPLIT", + /* 233 */ "DELETE", + /* 234 */ "INSERT", + /* 235 */ "NK_BIN", + /* 236 */ "NK_HEX", + /* 237 */ "NULL", + /* 238 */ "NK_QUESTION", + /* 239 */ "NK_ALIAS", + /* 240 */ "NK_ARROW", + /* 241 */ "ROWTS", + /* 242 */ "QSTART", + /* 243 */ "QEND", + /* 244 */ "QDURATION", + /* 245 */ "WSTART", + /* 246 */ "WEND", + /* 247 */ "WDURATION", + /* 248 */ "IROWTS", + /* 249 */ "ISFILLED", + /* 250 */ "CAST", + /* 251 */ "NOW", + /* 252 */ "TODAY", + /* 253 */ "TIMEZONE", + /* 254 */ "CLIENT_VERSION", + /* 255 */ "SERVER_VERSION", + /* 256 */ "SERVER_STATUS", + /* 257 */ "CURRENT_USER", + /* 258 */ "CASE", + /* 259 */ "WHEN", + /* 260 */ "THEN", + /* 261 */ "ELSE", + /* 262 */ "BETWEEN", + /* 263 */ "IS", + /* 264 */ "NK_LT", + /* 265 */ "NK_GT", + /* 266 */ "NK_LE", + /* 267 */ "NK_GE", + /* 268 */ "NK_NE", + /* 269 */ "MATCH", + /* 270 */ "NMATCH", + /* 271 */ "CONTAINS", + /* 272 */ "IN", + /* 273 */ "JOIN", + /* 274 */ "INNER", + /* 275 */ "LEFT", + /* 276 */ "RIGHT", + /* 277 */ "OUTER", + /* 278 */ "SEMI", + /* 279 */ "ANTI", + /* 280 */ "ASOF", + /* 281 */ "WINDOW", + /* 282 */ "WINDOW_OFFSET", + /* 283 */ "JLIMIT", + /* 284 */ "SELECT", + /* 285 */ "NK_HINT", + /* 286 */ "DISTINCT", + /* 287 */ "WHERE", + /* 288 */ "PARTITION", + /* 289 */ "BY", + /* 290 */ "SESSION", + /* 291 */ "STATE_WINDOW", + /* 292 */ "EVENT_WINDOW", + /* 293 */ "COUNT_WINDOW", + /* 294 */ "SLIDING", + /* 295 */ "FILL", + /* 296 */ "VALUE", + /* 297 */ "VALUE_F", + /* 298 */ "NONE", + /* 299 */ "PREV", + /* 300 */ "NULL_F", + /* 301 */ "LINEAR", + /* 302 */ "NEXT", + /* 303 */ "HAVING", + /* 304 */ "RANGE", + /* 305 */ "EVERY", + /* 306 */ "ORDER", + /* 307 */ "SLIMIT", + /* 308 */ "SOFFSET", + /* 309 */ "LIMIT", + /* 310 */ "OFFSET", + /* 311 */ "ASC", + /* 312 */ "NULLS", + /* 313 */ "ABORT", + /* 314 */ "AFTER", + /* 315 */ "ATTACH", + /* 316 */ "BEFORE", + /* 317 */ "BEGIN", + /* 318 */ "BITAND", + /* 319 */ "BITNOT", + /* 320 */ "BITOR", + /* 321 */ "BLOCKS", + /* 322 */ "CHANGE", + /* 323 */ "COMMA", + /* 324 */ "CONCAT", + /* 325 */ "CONFLICT", + /* 326 */ "COPY", + /* 327 */ "DEFERRED", + /* 328 */ "DELIMITERS", + /* 329 */ "DETACH", + /* 330 */ "DIVIDE", + /* 331 */ "DOT", + /* 332 */ "EACH", + /* 333 */ "FAIL", + /* 334 */ "FILE", + /* 335 */ "FOR", + /* 336 */ "GLOB", + /* 337 */ "ID", + /* 338 */ "IMMEDIATE", + /* 339 */ "IMPORT", + /* 340 */ "INITIALLY", + /* 341 */ "INSTEAD", + /* 342 */ "ISNULL", + /* 343 */ "KEY", + /* 344 */ "MODULES", + /* 345 */ "NK_BITNOT", + /* 346 */ "NK_SEMI", + /* 347 */ "NOTNULL", + /* 348 */ "OF", + /* 349 */ "PLUS", + /* 350 */ "PRIVILEGE", + /* 351 */ "RAISE", + /* 352 */ "RESTRICT", + /* 353 */ "ROW", + /* 354 */ "STAR", + /* 355 */ "STATEMENT", + /* 356 */ "STRICT", + /* 357 */ "STRING", + /* 358 */ "TIMES", + /* 359 */ "VALUES", + /* 360 */ "VARIABLE", + /* 361 */ "WAL", + /* 362 */ "cmd", + /* 363 */ "account_options", + /* 364 */ "alter_account_options", + /* 365 */ "literal", + /* 366 */ "alter_account_option", + /* 367 */ "ip_range_list", + /* 368 */ "white_list", + /* 369 */ "white_list_opt", + /* 370 */ "user_name", + /* 371 */ "sysinfo_opt", + /* 372 */ "privileges", + /* 373 */ "priv_level", + /* 374 */ "with_opt", + /* 375 */ "priv_type_list", + /* 376 */ "priv_type", + /* 377 */ "db_name", + /* 378 */ "table_name", + /* 379 */ "topic_name", + /* 380 */ "search_condition", + /* 381 */ "dnode_endpoint", + /* 382 */ "force_opt", + /* 383 */ "unsafe_opt", + /* 384 */ "not_exists_opt", + /* 385 */ "db_options", + /* 386 */ "exists_opt", + /* 387 */ "alter_db_options", + /* 388 */ "speed_opt", + /* 389 */ "start_opt", + /* 390 */ "end_opt", + /* 391 */ "integer_list", + /* 392 */ "variable_list", + /* 393 */ "retention_list", + /* 394 */ "signed", + /* 395 */ "alter_db_option", + /* 396 */ "retention", + /* 397 */ "full_table_name", + /* 398 */ "column_def_list", + /* 399 */ "tags_def_opt", + /* 400 */ "table_options", + /* 401 */ "multi_create_clause", + /* 402 */ "tags_def", + /* 403 */ "multi_drop_clause", + /* 404 */ "alter_table_clause", + /* 405 */ "alter_table_options", + /* 406 */ "column_name", + /* 407 */ "type_name", + /* 408 */ "tags_literal", + /* 409 */ "create_subtable_clause", + /* 410 */ "specific_cols_opt", + /* 411 */ "tags_literal_list", + /* 412 */ "drop_table_clause", + /* 413 */ "col_name_list", + /* 414 */ "column_def", + /* 415 */ "duration_list", + /* 416 */ "rollup_func_list", + /* 417 */ "alter_table_option", + /* 418 */ "duration_literal", + /* 419 */ "rollup_func_name", + /* 420 */ "function_name", + /* 421 */ "col_name", + /* 422 */ "db_kind_opt", + /* 423 */ "table_kind_db_name_cond_opt", + /* 424 */ "like_pattern_opt", + /* 425 */ "db_name_cond_opt", + /* 426 */ "table_name_cond", + /* 427 */ "from_db_opt", + /* 428 */ "tag_list_opt", + /* 429 */ "table_kind", + /* 430 */ "tag_item", + /* 431 */ "column_alias", + /* 432 */ "index_options", + /* 433 */ "full_index_name", + /* 434 */ "index_name", + /* 435 */ "func_list", + /* 436 */ "sliding_opt", + /* 437 */ "sma_stream_opt", + /* 438 */ "func", + /* 439 */ "sma_func_name", + /* 440 */ "expression_list", + /* 441 */ "with_meta", + /* 442 */ "query_or_subquery", + /* 443 */ "where_clause_opt", + /* 444 */ "cgroup_name", + /* 445 */ "analyze_opt", + /* 446 */ "explain_options", + /* 447 */ "insert_query", + /* 448 */ "or_replace_opt", + /* 449 */ "agg_func_opt", + /* 450 */ "bufsize_opt", + /* 451 */ "language_opt", + /* 452 */ "full_view_name", + /* 453 */ "view_name", + /* 454 */ "stream_name", + /* 455 */ "stream_options", + /* 456 */ "col_list_opt", + /* 457 */ "tag_def_or_ref_opt", + /* 458 */ "subtable_opt", + /* 459 */ "ignore_opt", + /* 460 */ "expression", + /* 461 */ "on_vgroup_id", + /* 462 */ "dnode_list", + /* 463 */ "literal_func", + /* 464 */ "signed_literal", + /* 465 */ "literal_list", + /* 466 */ "table_alias", + /* 467 */ "expr_or_subquery", + /* 468 */ "pseudo_column", + /* 469 */ "column_reference", + /* 470 */ "function_expression", + /* 471 */ "case_when_expression", + /* 472 */ "star_func", + /* 473 */ "star_func_para_list", + /* 474 */ "noarg_func", + /* 475 */ "other_para_list", + /* 476 */ "star_func_para", + /* 477 */ "when_then_list", + /* 478 */ "case_when_else_opt", + /* 479 */ "common_expression", + /* 480 */ "when_then_expr", + /* 481 */ "predicate", + /* 482 */ "compare_op", + /* 483 */ "in_op", + /* 484 */ "in_predicate_value", + /* 485 */ "boolean_value_expression", + /* 486 */ "boolean_primary", + /* 487 */ "from_clause_opt", + /* 488 */ "table_reference_list", + /* 489 */ "table_reference", + /* 490 */ "table_primary", + /* 491 */ "joined_table", + /* 492 */ "alias_opt", + /* 493 */ "subquery", + /* 494 */ "parenthesized_joined_table", + /* 495 */ "join_type", + /* 496 */ "join_subtype", + /* 497 */ "join_on_clause_opt", + /* 498 */ "window_offset_clause_opt", + /* 499 */ "jlimit_clause_opt", + /* 500 */ "window_offset_literal", + /* 501 */ "query_specification", + /* 502 */ "hint_list", + /* 503 */ "set_quantifier_opt", + /* 504 */ "tag_mode_opt", + /* 505 */ "select_list", + /* 506 */ "partition_by_clause_opt", + /* 507 */ "range_opt", + /* 508 */ "every_opt", + /* 509 */ "fill_opt", + /* 510 */ "twindow_clause_opt", + /* 511 */ "group_by_clause_opt", + /* 512 */ "having_clause_opt", + /* 513 */ "select_item", + /* 514 */ "partition_list", + /* 515 */ "partition_item", + /* 516 */ "interval_sliding_duration_literal", + /* 517 */ "fill_mode", + /* 518 */ "group_by_list", + /* 519 */ "query_expression", + /* 520 */ "query_simple", + /* 521 */ "order_by_clause_opt", + /* 522 */ "slimit_clause_opt", + /* 523 */ "limit_clause_opt", + /* 524 */ "union_query_expression", + /* 525 */ "query_simple_or_subquery", + /* 526 */ "sort_specification_list", + /* 527 */ "sort_specification", + /* 528 */ "ordering_specification_opt", + /* 529 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2390,440 +2366,441 @@ static const char *const yyRuleName[] = { /* 250 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", /* 251 */ "cmd ::= SHOW MNODES", /* 252 */ "cmd ::= SHOW QNODES", - /* 253 */ "cmd ::= SHOW FUNCTIONS", - /* 254 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 255 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", - /* 256 */ "cmd ::= SHOW STREAMS", - /* 257 */ "cmd ::= SHOW ACCOUNTS", - /* 258 */ "cmd ::= SHOW APPS", - /* 259 */ "cmd ::= SHOW CONNECTIONS", - /* 260 */ "cmd ::= SHOW LICENCES", - /* 261 */ "cmd ::= SHOW GRANTS", - /* 262 */ "cmd ::= SHOW GRANTS FULL", - /* 263 */ "cmd ::= SHOW GRANTS LOGS", - /* 264 */ "cmd ::= SHOW CLUSTER MACHINES", - /* 265 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 266 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 267 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 268 */ "cmd ::= SHOW QUERIES", - /* 269 */ "cmd ::= SHOW SCORES", - /* 270 */ "cmd ::= SHOW TOPICS", - /* 271 */ "cmd ::= SHOW VARIABLES", - /* 272 */ "cmd ::= SHOW CLUSTER VARIABLES", - /* 273 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 274 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", - /* 275 */ "cmd ::= SHOW BNODES", - /* 276 */ "cmd ::= SHOW SNODES", - /* 277 */ "cmd ::= SHOW CLUSTER", - /* 278 */ "cmd ::= SHOW TRANSACTIONS", - /* 279 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 280 */ "cmd ::= SHOW CONSUMERS", - /* 281 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 282 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 283 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", - /* 284 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", - /* 285 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", - /* 286 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", - /* 287 */ "cmd ::= SHOW VNODES", - /* 288 */ "cmd ::= SHOW db_name_cond_opt ALIVE", - /* 289 */ "cmd ::= SHOW CLUSTER ALIVE", - /* 290 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", - /* 291 */ "cmd ::= SHOW CREATE VIEW full_table_name", - /* 292 */ "cmd ::= SHOW COMPACTS", - /* 293 */ "cmd ::= SHOW COMPACT NK_INTEGER", - /* 294 */ "table_kind_db_name_cond_opt ::=", - /* 295 */ "table_kind_db_name_cond_opt ::= table_kind", - /* 296 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", - /* 297 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", - /* 298 */ "table_kind ::= NORMAL", - /* 299 */ "table_kind ::= CHILD", - /* 300 */ "db_name_cond_opt ::=", - /* 301 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 302 */ "like_pattern_opt ::=", - /* 303 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 304 */ "table_name_cond ::= table_name", - /* 305 */ "from_db_opt ::=", - /* 306 */ "from_db_opt ::= FROM db_name", - /* 307 */ "tag_list_opt ::=", - /* 308 */ "tag_list_opt ::= tag_item", - /* 309 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", - /* 310 */ "tag_item ::= TBNAME", - /* 311 */ "tag_item ::= QTAGS", - /* 312 */ "tag_item ::= column_name", - /* 313 */ "tag_item ::= column_name column_alias", - /* 314 */ "tag_item ::= column_name AS column_alias", - /* 315 */ "db_kind_opt ::=", - /* 316 */ "db_kind_opt ::= USER", - /* 317 */ "db_kind_opt ::= SYSTEM", - /* 318 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", - /* 319 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", - /* 320 */ "cmd ::= DROP INDEX exists_opt full_index_name", - /* 321 */ "full_index_name ::= index_name", - /* 322 */ "full_index_name ::= db_name NK_DOT index_name", - /* 323 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 324 */ "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", - /* 325 */ "func_list ::= func", - /* 326 */ "func_list ::= func_list NK_COMMA func", - /* 327 */ "func ::= sma_func_name NK_LP expression_list NK_RP", - /* 328 */ "sma_func_name ::= function_name", - /* 329 */ "sma_func_name ::= COUNT", - /* 330 */ "sma_func_name ::= FIRST", - /* 331 */ "sma_func_name ::= LAST", - /* 332 */ "sma_func_name ::= LAST_ROW", - /* 333 */ "sma_stream_opt ::=", - /* 334 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", - /* 335 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", - /* 336 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", - /* 337 */ "with_meta ::= AS", - /* 338 */ "with_meta ::= WITH META AS", - /* 339 */ "with_meta ::= ONLY META AS", - /* 340 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 341 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", - /* 342 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", - /* 343 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 344 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 345 */ "cmd ::= DESC full_table_name", - /* 346 */ "cmd ::= DESCRIBE full_table_name", - /* 347 */ "cmd ::= RESET QUERY CACHE", - /* 348 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 349 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", - /* 350 */ "analyze_opt ::=", - /* 351 */ "analyze_opt ::= ANALYZE", - /* 352 */ "explain_options ::=", - /* 353 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 354 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 355 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", - /* 356 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 357 */ "agg_func_opt ::=", - /* 358 */ "agg_func_opt ::= AGGREGATE", - /* 359 */ "bufsize_opt ::=", - /* 360 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 361 */ "language_opt ::=", - /* 362 */ "language_opt ::= LANGUAGE NK_STRING", - /* 363 */ "or_replace_opt ::=", - /* 364 */ "or_replace_opt ::= OR REPLACE", - /* 365 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", - /* 366 */ "cmd ::= DROP VIEW exists_opt full_view_name", - /* 367 */ "full_view_name ::= view_name", - /* 368 */ "full_view_name ::= db_name NK_DOT view_name", - /* 369 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", - /* 370 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 371 */ "cmd ::= PAUSE STREAM exists_opt stream_name", - /* 372 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", - /* 373 */ "col_list_opt ::=", - /* 374 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 375 */ "tag_def_or_ref_opt ::=", - /* 376 */ "tag_def_or_ref_opt ::= tags_def", - /* 377 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", - /* 378 */ "stream_options ::=", - /* 379 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 380 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 381 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 382 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 383 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 384 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 385 */ "stream_options ::= stream_options DELETE_MARK duration_literal", - /* 386 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", - /* 387 */ "subtable_opt ::=", - /* 388 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 389 */ "ignore_opt ::=", - /* 390 */ "ignore_opt ::= IGNORE UNTREATED", - /* 391 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 392 */ "cmd ::= KILL QUERY NK_STRING", - /* 393 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 394 */ "cmd ::= KILL COMPACT NK_INTEGER", - /* 395 */ "cmd ::= BALANCE VGROUP", - /* 396 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", - /* 397 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 398 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 399 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 400 */ "on_vgroup_id ::=", - /* 401 */ "on_vgroup_id ::= ON NK_INTEGER", - /* 402 */ "dnode_list ::= DNODE NK_INTEGER", - /* 403 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 404 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 405 */ "cmd ::= query_or_subquery", - /* 406 */ "cmd ::= insert_query", - /* 407 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 408 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", - /* 409 */ "tags_literal ::= NK_INTEGER", - /* 410 */ "tags_literal ::= NK_PLUS NK_INTEGER", - /* 411 */ "tags_literal ::= NK_MINUS NK_INTEGER", - /* 412 */ "tags_literal ::= NK_FLOAT", - /* 413 */ "tags_literal ::= NK_PLUS NK_FLOAT", - /* 414 */ "tags_literal ::= NK_MINUS NK_FLOAT", - /* 415 */ "tags_literal ::= NK_BIN", - /* 416 */ "tags_literal ::= NK_PLUS NK_BIN", - /* 417 */ "tags_literal ::= NK_MINUS NK_BIN", - /* 418 */ "tags_literal ::= NK_HEX", - /* 419 */ "tags_literal ::= NK_PLUS NK_HEX", - /* 420 */ "tags_literal ::= NK_MINUS NK_HEX", - /* 421 */ "tags_literal ::= NK_STRING", - /* 422 */ "tags_literal ::= NK_BOOL", - /* 423 */ "tags_literal ::= NULL", - /* 424 */ "tags_literal ::= literal_func", - /* 425 */ "tags_literal ::= literal_func NK_PLUS duration_literal", - /* 426 */ "tags_literal ::= literal_func NK_MINUS duration_literal", - /* 427 */ "tags_literal_list ::= tags_literal", - /* 428 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", - /* 429 */ "literal ::= NK_INTEGER", - /* 430 */ "literal ::= NK_FLOAT", - /* 431 */ "literal ::= NK_STRING", - /* 432 */ "literal ::= NK_BOOL", - /* 433 */ "literal ::= TIMESTAMP NK_STRING", - /* 434 */ "literal ::= duration_literal", - /* 435 */ "literal ::= NULL", - /* 436 */ "literal ::= NK_QUESTION", - /* 437 */ "duration_literal ::= NK_VARIABLE", - /* 438 */ "signed ::= NK_INTEGER", - /* 439 */ "signed ::= NK_PLUS NK_INTEGER", - /* 440 */ "signed ::= NK_MINUS NK_INTEGER", - /* 441 */ "signed ::= NK_FLOAT", - /* 442 */ "signed ::= NK_PLUS NK_FLOAT", - /* 443 */ "signed ::= NK_MINUS NK_FLOAT", - /* 444 */ "signed_literal ::= signed", - /* 445 */ "signed_literal ::= NK_STRING", - /* 446 */ "signed_literal ::= NK_BOOL", - /* 447 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 448 */ "signed_literal ::= duration_literal", - /* 449 */ "signed_literal ::= NULL", - /* 450 */ "signed_literal ::= literal_func", - /* 451 */ "signed_literal ::= NK_QUESTION", - /* 452 */ "literal_list ::= signed_literal", - /* 453 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 454 */ "db_name ::= NK_ID", - /* 455 */ "table_name ::= NK_ID", - /* 456 */ "column_name ::= NK_ID", - /* 457 */ "function_name ::= NK_ID", - /* 458 */ "view_name ::= NK_ID", - /* 459 */ "table_alias ::= NK_ID", - /* 460 */ "column_alias ::= NK_ID", - /* 461 */ "column_alias ::= NK_ALIAS", - /* 462 */ "user_name ::= NK_ID", - /* 463 */ "topic_name ::= NK_ID", - /* 464 */ "stream_name ::= NK_ID", - /* 465 */ "cgroup_name ::= NK_ID", - /* 466 */ "index_name ::= NK_ID", - /* 467 */ "expr_or_subquery ::= expression", - /* 468 */ "expression ::= literal", - /* 469 */ "expression ::= pseudo_column", - /* 470 */ "expression ::= column_reference", - /* 471 */ "expression ::= function_expression", - /* 472 */ "expression ::= case_when_expression", - /* 473 */ "expression ::= NK_LP expression NK_RP", - /* 474 */ "expression ::= NK_PLUS expr_or_subquery", - /* 475 */ "expression ::= NK_MINUS expr_or_subquery", - /* 476 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 477 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 478 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 479 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 480 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 481 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 482 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 483 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 484 */ "expression_list ::= expr_or_subquery", - /* 485 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 486 */ "column_reference ::= column_name", - /* 487 */ "column_reference ::= table_name NK_DOT column_name", - /* 488 */ "column_reference ::= NK_ALIAS", - /* 489 */ "column_reference ::= table_name NK_DOT NK_ALIAS", - /* 490 */ "pseudo_column ::= ROWTS", - /* 491 */ "pseudo_column ::= TBNAME", - /* 492 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 493 */ "pseudo_column ::= QSTART", - /* 494 */ "pseudo_column ::= QEND", - /* 495 */ "pseudo_column ::= QDURATION", - /* 496 */ "pseudo_column ::= WSTART", - /* 497 */ "pseudo_column ::= WEND", - /* 498 */ "pseudo_column ::= WDURATION", - /* 499 */ "pseudo_column ::= IROWTS", - /* 500 */ "pseudo_column ::= ISFILLED", - /* 501 */ "pseudo_column ::= QTAGS", - /* 502 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 503 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 504 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 505 */ "function_expression ::= literal_func", - /* 506 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 507 */ "literal_func ::= NOW", - /* 508 */ "literal_func ::= TODAY", - /* 509 */ "noarg_func ::= NOW", - /* 510 */ "noarg_func ::= TODAY", - /* 511 */ "noarg_func ::= TIMEZONE", - /* 512 */ "noarg_func ::= DATABASE", - /* 513 */ "noarg_func ::= CLIENT_VERSION", - /* 514 */ "noarg_func ::= SERVER_VERSION", - /* 515 */ "noarg_func ::= SERVER_STATUS", - /* 516 */ "noarg_func ::= CURRENT_USER", - /* 517 */ "noarg_func ::= USER", - /* 518 */ "star_func ::= COUNT", - /* 519 */ "star_func ::= FIRST", - /* 520 */ "star_func ::= LAST", - /* 521 */ "star_func ::= LAST_ROW", - /* 522 */ "star_func_para_list ::= NK_STAR", - /* 523 */ "star_func_para_list ::= other_para_list", - /* 524 */ "other_para_list ::= star_func_para", - /* 525 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 526 */ "star_func_para ::= expr_or_subquery", - /* 527 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 528 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 529 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 530 */ "when_then_list ::= when_then_expr", - /* 531 */ "when_then_list ::= when_then_list when_then_expr", - /* 532 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 533 */ "case_when_else_opt ::=", - /* 534 */ "case_when_else_opt ::= ELSE common_expression", - /* 535 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 536 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 537 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 538 */ "predicate ::= expr_or_subquery IS NULL", - /* 539 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 540 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 541 */ "compare_op ::= NK_LT", - /* 542 */ "compare_op ::= NK_GT", - /* 543 */ "compare_op ::= NK_LE", - /* 544 */ "compare_op ::= NK_GE", - /* 545 */ "compare_op ::= NK_NE", - /* 546 */ "compare_op ::= NK_EQ", - /* 547 */ "compare_op ::= LIKE", - /* 548 */ "compare_op ::= NOT LIKE", - /* 549 */ "compare_op ::= MATCH", - /* 550 */ "compare_op ::= NMATCH", - /* 551 */ "compare_op ::= CONTAINS", - /* 552 */ "in_op ::= IN", - /* 553 */ "in_op ::= NOT IN", - /* 554 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 555 */ "boolean_value_expression ::= boolean_primary", - /* 556 */ "boolean_value_expression ::= NOT boolean_primary", - /* 557 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 558 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 559 */ "boolean_primary ::= predicate", - /* 560 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 561 */ "common_expression ::= expr_or_subquery", - /* 562 */ "common_expression ::= boolean_value_expression", - /* 563 */ "from_clause_opt ::=", - /* 564 */ "from_clause_opt ::= FROM table_reference_list", - /* 565 */ "table_reference_list ::= table_reference", - /* 566 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 567 */ "table_reference ::= table_primary", - /* 568 */ "table_reference ::= joined_table", - /* 569 */ "table_primary ::= table_name alias_opt", - /* 570 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 571 */ "table_primary ::= subquery alias_opt", - /* 572 */ "table_primary ::= parenthesized_joined_table", - /* 573 */ "alias_opt ::=", - /* 574 */ "alias_opt ::= table_alias", - /* 575 */ "alias_opt ::= AS table_alias", - /* 576 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 577 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 578 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", - /* 579 */ "join_type ::=", - /* 580 */ "join_type ::= INNER", - /* 581 */ "join_type ::= LEFT", - /* 582 */ "join_type ::= RIGHT", - /* 583 */ "join_type ::= FULL", - /* 584 */ "join_subtype ::=", - /* 585 */ "join_subtype ::= OUTER", - /* 586 */ "join_subtype ::= SEMI", - /* 587 */ "join_subtype ::= ANTI", - /* 588 */ "join_subtype ::= ASOF", - /* 589 */ "join_subtype ::= WINDOW", - /* 590 */ "join_on_clause_opt ::=", - /* 591 */ "join_on_clause_opt ::= ON search_condition", - /* 592 */ "window_offset_clause_opt ::=", - /* 593 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", - /* 594 */ "window_offset_literal ::= NK_VARIABLE", - /* 595 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", - /* 596 */ "jlimit_clause_opt ::=", - /* 597 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", - /* 598 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 599 */ "hint_list ::=", - /* 600 */ "hint_list ::= NK_HINT", - /* 601 */ "tag_mode_opt ::=", - /* 602 */ "tag_mode_opt ::= TAGS", - /* 603 */ "set_quantifier_opt ::=", - /* 604 */ "set_quantifier_opt ::= DISTINCT", - /* 605 */ "set_quantifier_opt ::= ALL", - /* 606 */ "select_list ::= select_item", - /* 607 */ "select_list ::= select_list NK_COMMA select_item", - /* 608 */ "select_item ::= NK_STAR", - /* 609 */ "select_item ::= common_expression", - /* 610 */ "select_item ::= common_expression column_alias", - /* 611 */ "select_item ::= common_expression AS column_alias", - /* 612 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 613 */ "where_clause_opt ::=", - /* 614 */ "where_clause_opt ::= WHERE search_condition", - /* 615 */ "partition_by_clause_opt ::=", - /* 616 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 617 */ "partition_list ::= partition_item", - /* 618 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 619 */ "partition_item ::= expr_or_subquery", - /* 620 */ "partition_item ::= expr_or_subquery column_alias", - /* 621 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 622 */ "twindow_clause_opt ::=", - /* 623 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", - /* 624 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 625 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 626 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", - /* 627 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 628 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", - /* 629 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 630 */ "sliding_opt ::=", - /* 631 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", - /* 632 */ "interval_sliding_duration_literal ::= NK_VARIABLE", - /* 633 */ "interval_sliding_duration_literal ::= NK_STRING", - /* 634 */ "interval_sliding_duration_literal ::= NK_INTEGER", - /* 635 */ "fill_opt ::=", - /* 636 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 637 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", - /* 638 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", - /* 639 */ "fill_mode ::= NONE", - /* 640 */ "fill_mode ::= PREV", - /* 641 */ "fill_mode ::= NULL", - /* 642 */ "fill_mode ::= NULL_F", - /* 643 */ "fill_mode ::= LINEAR", - /* 644 */ "fill_mode ::= NEXT", - /* 645 */ "group_by_clause_opt ::=", - /* 646 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 647 */ "group_by_list ::= expr_or_subquery", - /* 648 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 649 */ "having_clause_opt ::=", - /* 650 */ "having_clause_opt ::= HAVING search_condition", - /* 651 */ "range_opt ::=", - /* 652 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 653 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", - /* 654 */ "every_opt ::=", - /* 655 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 656 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 657 */ "query_simple ::= query_specification", - /* 658 */ "query_simple ::= union_query_expression", - /* 659 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 660 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 661 */ "query_simple_or_subquery ::= query_simple", - /* 662 */ "query_simple_or_subquery ::= subquery", - /* 663 */ "query_or_subquery ::= query_expression", - /* 664 */ "query_or_subquery ::= subquery", - /* 665 */ "order_by_clause_opt ::=", - /* 666 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 667 */ "slimit_clause_opt ::=", - /* 668 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 669 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 670 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 671 */ "limit_clause_opt ::=", - /* 672 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 673 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 674 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 675 */ "subquery ::= NK_LP query_expression NK_RP", - /* 676 */ "subquery ::= NK_LP subquery NK_RP", - /* 677 */ "search_condition ::= common_expression", - /* 678 */ "sort_specification_list ::= sort_specification", - /* 679 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 680 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 681 */ "ordering_specification_opt ::=", - /* 682 */ "ordering_specification_opt ::= ASC", - /* 683 */ "ordering_specification_opt ::= DESC", - /* 684 */ "null_ordering_opt ::=", - /* 685 */ "null_ordering_opt ::= NULLS FIRST", - /* 686 */ "null_ordering_opt ::= NULLS LAST", + /* 253 */ "cmd ::= SHOW ARBGROUPS", + /* 254 */ "cmd ::= SHOW FUNCTIONS", + /* 255 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 256 */ "cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name", + /* 257 */ "cmd ::= SHOW STREAMS", + /* 258 */ "cmd ::= SHOW ACCOUNTS", + /* 259 */ "cmd ::= SHOW APPS", + /* 260 */ "cmd ::= SHOW CONNECTIONS", + /* 261 */ "cmd ::= SHOW LICENCES", + /* 262 */ "cmd ::= SHOW GRANTS", + /* 263 */ "cmd ::= SHOW GRANTS FULL", + /* 264 */ "cmd ::= SHOW GRANTS LOGS", + /* 265 */ "cmd ::= SHOW CLUSTER MACHINES", + /* 266 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 267 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 268 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 269 */ "cmd ::= SHOW QUERIES", + /* 270 */ "cmd ::= SHOW SCORES", + /* 271 */ "cmd ::= SHOW TOPICS", + /* 272 */ "cmd ::= SHOW VARIABLES", + /* 273 */ "cmd ::= SHOW CLUSTER VARIABLES", + /* 274 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 275 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt", + /* 276 */ "cmd ::= SHOW BNODES", + /* 277 */ "cmd ::= SHOW SNODES", + /* 278 */ "cmd ::= SHOW CLUSTER", + /* 279 */ "cmd ::= SHOW TRANSACTIONS", + /* 280 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 281 */ "cmd ::= SHOW CONSUMERS", + /* 282 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 283 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 284 */ "cmd ::= SHOW TAGS FROM db_name NK_DOT table_name", + /* 285 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt", + /* 286 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name", + /* 287 */ "cmd ::= SHOW VNODES ON DNODE NK_INTEGER", + /* 288 */ "cmd ::= SHOW VNODES", + /* 289 */ "cmd ::= SHOW db_name_cond_opt ALIVE", + /* 290 */ "cmd ::= SHOW CLUSTER ALIVE", + /* 291 */ "cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt", + /* 292 */ "cmd ::= SHOW CREATE VIEW full_table_name", + /* 293 */ "cmd ::= SHOW COMPACTS", + /* 294 */ "cmd ::= SHOW COMPACT NK_INTEGER", + /* 295 */ "table_kind_db_name_cond_opt ::=", + /* 296 */ "table_kind_db_name_cond_opt ::= table_kind", + /* 297 */ "table_kind_db_name_cond_opt ::= db_name NK_DOT", + /* 298 */ "table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT", + /* 299 */ "table_kind ::= NORMAL", + /* 300 */ "table_kind ::= CHILD", + /* 301 */ "db_name_cond_opt ::=", + /* 302 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 303 */ "like_pattern_opt ::=", + /* 304 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 305 */ "table_name_cond ::= table_name", + /* 306 */ "from_db_opt ::=", + /* 307 */ "from_db_opt ::= FROM db_name", + /* 308 */ "tag_list_opt ::=", + /* 309 */ "tag_list_opt ::= tag_item", + /* 310 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item", + /* 311 */ "tag_item ::= TBNAME", + /* 312 */ "tag_item ::= QTAGS", + /* 313 */ "tag_item ::= column_name", + /* 314 */ "tag_item ::= column_name column_alias", + /* 315 */ "tag_item ::= column_name AS column_alias", + /* 316 */ "db_kind_opt ::=", + /* 317 */ "db_kind_opt ::= USER", + /* 318 */ "db_kind_opt ::= SYSTEM", + /* 319 */ "cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options", + /* 320 */ "cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP", + /* 321 */ "cmd ::= DROP INDEX exists_opt full_index_name", + /* 322 */ "full_index_name ::= index_name", + /* 323 */ "full_index_name ::= db_name NK_DOT index_name", + /* 324 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 325 */ "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", + /* 326 */ "func_list ::= func", + /* 327 */ "func_list ::= func_list NK_COMMA func", + /* 328 */ "func ::= sma_func_name NK_LP expression_list NK_RP", + /* 329 */ "sma_func_name ::= function_name", + /* 330 */ "sma_func_name ::= COUNT", + /* 331 */ "sma_func_name ::= FIRST", + /* 332 */ "sma_func_name ::= LAST", + /* 333 */ "sma_func_name ::= LAST_ROW", + /* 334 */ "sma_stream_opt ::=", + /* 335 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal", + /* 336 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal", + /* 337 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal", + /* 338 */ "with_meta ::= AS", + /* 339 */ "with_meta ::= WITH META AS", + /* 340 */ "with_meta ::= ONLY META AS", + /* 341 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 342 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name", + /* 343 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt", + /* 344 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 345 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 346 */ "cmd ::= DESC full_table_name", + /* 347 */ "cmd ::= DESCRIBE full_table_name", + /* 348 */ "cmd ::= RESET QUERY CACHE", + /* 349 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 350 */ "cmd ::= EXPLAIN analyze_opt explain_options insert_query", + /* 351 */ "analyze_opt ::=", + /* 352 */ "analyze_opt ::= ANALYZE", + /* 353 */ "explain_options ::=", + /* 354 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 355 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 356 */ "cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt", + /* 357 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 358 */ "agg_func_opt ::=", + /* 359 */ "agg_func_opt ::= AGGREGATE", + /* 360 */ "bufsize_opt ::=", + /* 361 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 362 */ "language_opt ::=", + /* 363 */ "language_opt ::= LANGUAGE NK_STRING", + /* 364 */ "or_replace_opt ::=", + /* 365 */ "or_replace_opt ::= OR REPLACE", + /* 366 */ "cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery", + /* 367 */ "cmd ::= DROP VIEW exists_opt full_view_name", + /* 368 */ "full_view_name ::= view_name", + /* 369 */ "full_view_name ::= db_name NK_DOT view_name", + /* 370 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", + /* 371 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 372 */ "cmd ::= PAUSE STREAM exists_opt stream_name", + /* 373 */ "cmd ::= RESUME STREAM exists_opt ignore_opt stream_name", + /* 374 */ "col_list_opt ::=", + /* 375 */ "col_list_opt ::= NK_LP col_name_list NK_RP", + /* 376 */ "tag_def_or_ref_opt ::=", + /* 377 */ "tag_def_or_ref_opt ::= tags_def", + /* 378 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 379 */ "stream_options ::=", + /* 380 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 381 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 382 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 383 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 384 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 385 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 386 */ "stream_options ::= stream_options DELETE_MARK duration_literal", + /* 387 */ "stream_options ::= stream_options IGNORE UPDATE NK_INTEGER", + /* 388 */ "subtable_opt ::=", + /* 389 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 390 */ "ignore_opt ::=", + /* 391 */ "ignore_opt ::= IGNORE UNTREATED", + /* 392 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 393 */ "cmd ::= KILL QUERY NK_STRING", + /* 394 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 395 */ "cmd ::= KILL COMPACT NK_INTEGER", + /* 396 */ "cmd ::= BALANCE VGROUP", + /* 397 */ "cmd ::= BALANCE VGROUP LEADER on_vgroup_id", + /* 398 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 399 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 400 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 401 */ "on_vgroup_id ::=", + /* 402 */ "on_vgroup_id ::= ON NK_INTEGER", + /* 403 */ "dnode_list ::= DNODE NK_INTEGER", + /* 404 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 405 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 406 */ "cmd ::= query_or_subquery", + /* 407 */ "cmd ::= insert_query", + /* 408 */ "insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 409 */ "insert_query ::= INSERT INTO full_table_name query_or_subquery", + /* 410 */ "tags_literal ::= NK_INTEGER", + /* 411 */ "tags_literal ::= NK_PLUS NK_INTEGER", + /* 412 */ "tags_literal ::= NK_MINUS NK_INTEGER", + /* 413 */ "tags_literal ::= NK_FLOAT", + /* 414 */ "tags_literal ::= NK_PLUS NK_FLOAT", + /* 415 */ "tags_literal ::= NK_MINUS NK_FLOAT", + /* 416 */ "tags_literal ::= NK_BIN", + /* 417 */ "tags_literal ::= NK_PLUS NK_BIN", + /* 418 */ "tags_literal ::= NK_MINUS NK_BIN", + /* 419 */ "tags_literal ::= NK_HEX", + /* 420 */ "tags_literal ::= NK_PLUS NK_HEX", + /* 421 */ "tags_literal ::= NK_MINUS NK_HEX", + /* 422 */ "tags_literal ::= NK_STRING", + /* 423 */ "tags_literal ::= NK_BOOL", + /* 424 */ "tags_literal ::= NULL", + /* 425 */ "tags_literal ::= literal_func", + /* 426 */ "tags_literal ::= literal_func NK_PLUS duration_literal", + /* 427 */ "tags_literal ::= literal_func NK_MINUS duration_literal", + /* 428 */ "tags_literal_list ::= tags_literal", + /* 429 */ "tags_literal_list ::= tags_literal_list NK_COMMA tags_literal", + /* 430 */ "literal ::= NK_INTEGER", + /* 431 */ "literal ::= NK_FLOAT", + /* 432 */ "literal ::= NK_STRING", + /* 433 */ "literal ::= NK_BOOL", + /* 434 */ "literal ::= TIMESTAMP NK_STRING", + /* 435 */ "literal ::= duration_literal", + /* 436 */ "literal ::= NULL", + /* 437 */ "literal ::= NK_QUESTION", + /* 438 */ "duration_literal ::= NK_VARIABLE", + /* 439 */ "signed ::= NK_INTEGER", + /* 440 */ "signed ::= NK_PLUS NK_INTEGER", + /* 441 */ "signed ::= NK_MINUS NK_INTEGER", + /* 442 */ "signed ::= NK_FLOAT", + /* 443 */ "signed ::= NK_PLUS NK_FLOAT", + /* 444 */ "signed ::= NK_MINUS NK_FLOAT", + /* 445 */ "signed_literal ::= signed", + /* 446 */ "signed_literal ::= NK_STRING", + /* 447 */ "signed_literal ::= NK_BOOL", + /* 448 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 449 */ "signed_literal ::= duration_literal", + /* 450 */ "signed_literal ::= NULL", + /* 451 */ "signed_literal ::= literal_func", + /* 452 */ "signed_literal ::= NK_QUESTION", + /* 453 */ "literal_list ::= signed_literal", + /* 454 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 455 */ "db_name ::= NK_ID", + /* 456 */ "table_name ::= NK_ID", + /* 457 */ "column_name ::= NK_ID", + /* 458 */ "function_name ::= NK_ID", + /* 459 */ "view_name ::= NK_ID", + /* 460 */ "table_alias ::= NK_ID", + /* 461 */ "column_alias ::= NK_ID", + /* 462 */ "column_alias ::= NK_ALIAS", + /* 463 */ "user_name ::= NK_ID", + /* 464 */ "topic_name ::= NK_ID", + /* 465 */ "stream_name ::= NK_ID", + /* 466 */ "cgroup_name ::= NK_ID", + /* 467 */ "index_name ::= NK_ID", + /* 468 */ "expr_or_subquery ::= expression", + /* 469 */ "expression ::= literal", + /* 470 */ "expression ::= pseudo_column", + /* 471 */ "expression ::= column_reference", + /* 472 */ "expression ::= function_expression", + /* 473 */ "expression ::= case_when_expression", + /* 474 */ "expression ::= NK_LP expression NK_RP", + /* 475 */ "expression ::= NK_PLUS expr_or_subquery", + /* 476 */ "expression ::= NK_MINUS expr_or_subquery", + /* 477 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 478 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 479 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 480 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 481 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 482 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 483 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 484 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 485 */ "expression_list ::= expr_or_subquery", + /* 486 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 487 */ "column_reference ::= column_name", + /* 488 */ "column_reference ::= table_name NK_DOT column_name", + /* 489 */ "column_reference ::= NK_ALIAS", + /* 490 */ "column_reference ::= table_name NK_DOT NK_ALIAS", + /* 491 */ "pseudo_column ::= ROWTS", + /* 492 */ "pseudo_column ::= TBNAME", + /* 493 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 494 */ "pseudo_column ::= QSTART", + /* 495 */ "pseudo_column ::= QEND", + /* 496 */ "pseudo_column ::= QDURATION", + /* 497 */ "pseudo_column ::= WSTART", + /* 498 */ "pseudo_column ::= WEND", + /* 499 */ "pseudo_column ::= WDURATION", + /* 500 */ "pseudo_column ::= IROWTS", + /* 501 */ "pseudo_column ::= ISFILLED", + /* 502 */ "pseudo_column ::= QTAGS", + /* 503 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 504 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 505 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 506 */ "function_expression ::= literal_func", + /* 507 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 508 */ "literal_func ::= NOW", + /* 509 */ "literal_func ::= TODAY", + /* 510 */ "noarg_func ::= NOW", + /* 511 */ "noarg_func ::= TODAY", + /* 512 */ "noarg_func ::= TIMEZONE", + /* 513 */ "noarg_func ::= DATABASE", + /* 514 */ "noarg_func ::= CLIENT_VERSION", + /* 515 */ "noarg_func ::= SERVER_VERSION", + /* 516 */ "noarg_func ::= SERVER_STATUS", + /* 517 */ "noarg_func ::= CURRENT_USER", + /* 518 */ "noarg_func ::= USER", + /* 519 */ "star_func ::= COUNT", + /* 520 */ "star_func ::= FIRST", + /* 521 */ "star_func ::= LAST", + /* 522 */ "star_func ::= LAST_ROW", + /* 523 */ "star_func_para_list ::= NK_STAR", + /* 524 */ "star_func_para_list ::= other_para_list", + /* 525 */ "other_para_list ::= star_func_para", + /* 526 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 527 */ "star_func_para ::= expr_or_subquery", + /* 528 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 529 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 530 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 531 */ "when_then_list ::= when_then_expr", + /* 532 */ "when_then_list ::= when_then_list when_then_expr", + /* 533 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 534 */ "case_when_else_opt ::=", + /* 535 */ "case_when_else_opt ::= ELSE common_expression", + /* 536 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 537 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 538 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 539 */ "predicate ::= expr_or_subquery IS NULL", + /* 540 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 541 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 542 */ "compare_op ::= NK_LT", + /* 543 */ "compare_op ::= NK_GT", + /* 544 */ "compare_op ::= NK_LE", + /* 545 */ "compare_op ::= NK_GE", + /* 546 */ "compare_op ::= NK_NE", + /* 547 */ "compare_op ::= NK_EQ", + /* 548 */ "compare_op ::= LIKE", + /* 549 */ "compare_op ::= NOT LIKE", + /* 550 */ "compare_op ::= MATCH", + /* 551 */ "compare_op ::= NMATCH", + /* 552 */ "compare_op ::= CONTAINS", + /* 553 */ "in_op ::= IN", + /* 554 */ "in_op ::= NOT IN", + /* 555 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 556 */ "boolean_value_expression ::= boolean_primary", + /* 557 */ "boolean_value_expression ::= NOT boolean_primary", + /* 558 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 559 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 560 */ "boolean_primary ::= predicate", + /* 561 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 562 */ "common_expression ::= expr_or_subquery", + /* 563 */ "common_expression ::= boolean_value_expression", + /* 564 */ "from_clause_opt ::=", + /* 565 */ "from_clause_opt ::= FROM table_reference_list", + /* 566 */ "table_reference_list ::= table_reference", + /* 567 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 568 */ "table_reference ::= table_primary", + /* 569 */ "table_reference ::= joined_table", + /* 570 */ "table_primary ::= table_name alias_opt", + /* 571 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 572 */ "table_primary ::= subquery alias_opt", + /* 573 */ "table_primary ::= parenthesized_joined_table", + /* 574 */ "alias_opt ::=", + /* 575 */ "alias_opt ::= table_alias", + /* 576 */ "alias_opt ::= AS table_alias", + /* 577 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 578 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 579 */ "joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt", + /* 580 */ "join_type ::=", + /* 581 */ "join_type ::= INNER", + /* 582 */ "join_type ::= LEFT", + /* 583 */ "join_type ::= RIGHT", + /* 584 */ "join_type ::= FULL", + /* 585 */ "join_subtype ::=", + /* 586 */ "join_subtype ::= OUTER", + /* 587 */ "join_subtype ::= SEMI", + /* 588 */ "join_subtype ::= ANTI", + /* 589 */ "join_subtype ::= ASOF", + /* 590 */ "join_subtype ::= WINDOW", + /* 591 */ "join_on_clause_opt ::=", + /* 592 */ "join_on_clause_opt ::= ON search_condition", + /* 593 */ "window_offset_clause_opt ::=", + /* 594 */ "window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP", + /* 595 */ "window_offset_literal ::= NK_VARIABLE", + /* 596 */ "window_offset_literal ::= NK_MINUS NK_VARIABLE", + /* 597 */ "jlimit_clause_opt ::=", + /* 598 */ "jlimit_clause_opt ::= JLIMIT NK_INTEGER", + /* 599 */ "query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 600 */ "hint_list ::=", + /* 601 */ "hint_list ::= NK_HINT", + /* 602 */ "tag_mode_opt ::=", + /* 603 */ "tag_mode_opt ::= TAGS", + /* 604 */ "set_quantifier_opt ::=", + /* 605 */ "set_quantifier_opt ::= DISTINCT", + /* 606 */ "set_quantifier_opt ::= ALL", + /* 607 */ "select_list ::= select_item", + /* 608 */ "select_list ::= select_list NK_COMMA select_item", + /* 609 */ "select_item ::= NK_STAR", + /* 610 */ "select_item ::= common_expression", + /* 611 */ "select_item ::= common_expression column_alias", + /* 612 */ "select_item ::= common_expression AS column_alias", + /* 613 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 614 */ "where_clause_opt ::=", + /* 615 */ "where_clause_opt ::= WHERE search_condition", + /* 616 */ "partition_by_clause_opt ::=", + /* 617 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 618 */ "partition_list ::= partition_item", + /* 619 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 620 */ "partition_item ::= expr_or_subquery", + /* 621 */ "partition_item ::= expr_or_subquery column_alias", + /* 622 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 623 */ "twindow_clause_opt ::=", + /* 624 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP", + /* 625 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 626 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 627 */ "twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt", + /* 628 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 629 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP", + /* 630 */ "twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 631 */ "sliding_opt ::=", + /* 632 */ "sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP", + /* 633 */ "interval_sliding_duration_literal ::= NK_VARIABLE", + /* 634 */ "interval_sliding_duration_literal ::= NK_STRING", + /* 635 */ "interval_sliding_duration_literal ::= NK_INTEGER", + /* 636 */ "fill_opt ::=", + /* 637 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 638 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP", + /* 639 */ "fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP", + /* 640 */ "fill_mode ::= NONE", + /* 641 */ "fill_mode ::= PREV", + /* 642 */ "fill_mode ::= NULL", + /* 643 */ "fill_mode ::= NULL_F", + /* 644 */ "fill_mode ::= LINEAR", + /* 645 */ "fill_mode ::= NEXT", + /* 646 */ "group_by_clause_opt ::=", + /* 647 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 648 */ "group_by_list ::= expr_or_subquery", + /* 649 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 650 */ "having_clause_opt ::=", + /* 651 */ "having_clause_opt ::= HAVING search_condition", + /* 652 */ "range_opt ::=", + /* 653 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 654 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_RP", + /* 655 */ "every_opt ::=", + /* 656 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 657 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 658 */ "query_simple ::= query_specification", + /* 659 */ "query_simple ::= union_query_expression", + /* 660 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 661 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 662 */ "query_simple_or_subquery ::= query_simple", + /* 663 */ "query_simple_or_subquery ::= subquery", + /* 664 */ "query_or_subquery ::= query_expression", + /* 665 */ "query_or_subquery ::= subquery", + /* 666 */ "order_by_clause_opt ::=", + /* 667 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 668 */ "slimit_clause_opt ::=", + /* 669 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 670 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 671 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 672 */ "limit_clause_opt ::=", + /* 673 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 674 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 675 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 676 */ "subquery ::= NK_LP query_expression NK_RP", + /* 677 */ "subquery ::= NK_LP subquery NK_RP", + /* 678 */ "search_condition ::= common_expression", + /* 679 */ "sort_specification_list ::= sort_specification", + /* 680 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 681 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 682 */ "ordering_specification_opt ::=", + /* 683 */ "ordering_specification_opt ::= ASC", + /* 684 */ "ordering_specification_opt ::= DESC", + /* 685 */ "null_ordering_opt ::=", + /* 686 */ "null_ordering_opt ::= NULLS FIRST", + /* 687 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2950,242 +2927,242 @@ static void yy_destructor( */ /********* Begin destructor definitions ***************************************/ /* Default NON-TERMINAL Destructor */ - case 361: /* cmd */ - case 364: /* literal */ - case 373: /* with_opt */ - case 379: /* search_condition */ - case 384: /* db_options */ - case 386: /* alter_db_options */ - case 388: /* start_opt */ - case 389: /* end_opt */ - case 393: /* signed */ - case 395: /* retention */ - case 396: /* full_table_name */ - case 399: /* table_options */ - case 403: /* alter_table_clause */ - case 404: /* alter_table_options */ - case 407: /* tags_literal */ - case 408: /* create_subtable_clause */ - case 411: /* drop_table_clause */ - case 413: /* column_def */ - case 417: /* duration_literal */ - case 418: /* rollup_func_name */ - case 420: /* col_name */ - case 423: /* like_pattern_opt */ - case 424: /* db_name_cond_opt */ - case 425: /* table_name_cond */ - case 426: /* from_db_opt */ - case 429: /* tag_item */ - case 431: /* index_options */ - case 432: /* full_index_name */ - case 435: /* sliding_opt */ - case 436: /* sma_stream_opt */ - case 437: /* func */ - case 441: /* query_or_subquery */ - case 442: /* where_clause_opt */ - case 445: /* explain_options */ - case 446: /* insert_query */ - case 451: /* full_view_name */ - case 454: /* stream_options */ - case 457: /* subtable_opt */ - case 459: /* expression */ - case 462: /* literal_func */ - case 463: /* signed_literal */ - case 466: /* expr_or_subquery */ - case 467: /* pseudo_column */ - case 468: /* column_reference */ - case 469: /* function_expression */ - case 470: /* case_when_expression */ - case 475: /* star_func_para */ - case 477: /* case_when_else_opt */ - case 478: /* common_expression */ - case 479: /* when_then_expr */ - case 480: /* predicate */ - case 483: /* in_predicate_value */ - case 484: /* boolean_value_expression */ - case 485: /* boolean_primary */ - case 486: /* from_clause_opt */ - case 487: /* table_reference_list */ - case 488: /* table_reference */ - case 489: /* table_primary */ - case 490: /* joined_table */ - case 492: /* subquery */ - case 493: /* parenthesized_joined_table */ - case 496: /* join_on_clause_opt */ - case 497: /* window_offset_clause_opt */ - case 498: /* jlimit_clause_opt */ - case 499: /* window_offset_literal */ - case 500: /* query_specification */ - case 506: /* range_opt */ - case 507: /* every_opt */ - case 508: /* fill_opt */ - case 509: /* twindow_clause_opt */ - case 511: /* having_clause_opt */ - case 512: /* select_item */ - case 514: /* partition_item */ - case 515: /* interval_sliding_duration_literal */ - case 518: /* query_expression */ - case 519: /* query_simple */ - case 521: /* slimit_clause_opt */ - case 522: /* limit_clause_opt */ - case 523: /* union_query_expression */ - case 524: /* query_simple_or_subquery */ - case 526: /* sort_specification */ + case 362: /* cmd */ + case 365: /* literal */ + case 374: /* with_opt */ + case 380: /* search_condition */ + case 385: /* db_options */ + case 387: /* alter_db_options */ + case 389: /* start_opt */ + case 390: /* end_opt */ + case 394: /* signed */ + case 396: /* retention */ + case 397: /* full_table_name */ + case 400: /* table_options */ + case 404: /* alter_table_clause */ + case 405: /* alter_table_options */ + case 408: /* tags_literal */ + case 409: /* create_subtable_clause */ + case 412: /* drop_table_clause */ + case 414: /* column_def */ + case 418: /* duration_literal */ + case 419: /* rollup_func_name */ + case 421: /* col_name */ + case 424: /* like_pattern_opt */ + case 425: /* db_name_cond_opt */ + case 426: /* table_name_cond */ + case 427: /* from_db_opt */ + case 430: /* tag_item */ + case 432: /* index_options */ + case 433: /* full_index_name */ + case 436: /* sliding_opt */ + case 437: /* sma_stream_opt */ + case 438: /* func */ + case 442: /* query_or_subquery */ + case 443: /* where_clause_opt */ + case 446: /* explain_options */ + case 447: /* insert_query */ + case 452: /* full_view_name */ + case 455: /* stream_options */ + case 458: /* subtable_opt */ + case 460: /* expression */ + case 463: /* literal_func */ + case 464: /* signed_literal */ + case 467: /* expr_or_subquery */ + case 468: /* pseudo_column */ + case 469: /* column_reference */ + case 470: /* function_expression */ + case 471: /* case_when_expression */ + case 476: /* star_func_para */ + case 478: /* case_when_else_opt */ + case 479: /* common_expression */ + case 480: /* when_then_expr */ + case 481: /* predicate */ + case 484: /* in_predicate_value */ + case 485: /* boolean_value_expression */ + case 486: /* boolean_primary */ + case 487: /* from_clause_opt */ + case 488: /* table_reference_list */ + case 489: /* table_reference */ + case 490: /* table_primary */ + case 491: /* joined_table */ + case 493: /* subquery */ + case 494: /* parenthesized_joined_table */ + case 497: /* join_on_clause_opt */ + case 498: /* window_offset_clause_opt */ + case 499: /* jlimit_clause_opt */ + case 500: /* window_offset_literal */ + case 501: /* query_specification */ + case 507: /* range_opt */ + case 508: /* every_opt */ + case 509: /* fill_opt */ + case 510: /* twindow_clause_opt */ + case 512: /* having_clause_opt */ + case 513: /* select_item */ + case 515: /* partition_item */ + case 516: /* interval_sliding_duration_literal */ + case 519: /* query_expression */ + case 520: /* query_simple */ + case 522: /* slimit_clause_opt */ + case 523: /* limit_clause_opt */ + case 524: /* union_query_expression */ + case 525: /* query_simple_or_subquery */ + case 527: /* sort_specification */ { - nodesDestroyNode((yypminor->yy614)); + nodesDestroyNode((yypminor->yy1032)); } break; - case 362: /* account_options */ - case 363: /* alter_account_options */ - case 365: /* alter_account_option */ - case 387: /* speed_opt */ - case 440: /* with_meta */ - case 449: /* bufsize_opt */ + case 363: /* account_options */ + case 364: /* alter_account_options */ + case 366: /* alter_account_option */ + case 388: /* speed_opt */ + case 441: /* with_meta */ + case 450: /* bufsize_opt */ { } break; - case 366: /* ip_range_list */ - case 367: /* white_list */ - case 368: /* white_list_opt */ - case 390: /* integer_list */ - case 391: /* variable_list */ - case 392: /* retention_list */ - case 397: /* column_def_list */ - case 398: /* tags_def_opt */ - case 400: /* multi_create_clause */ - case 401: /* tags_def */ - case 402: /* multi_drop_clause */ - case 409: /* specific_cols_opt */ - case 410: /* tags_literal_list */ - case 412: /* col_name_list */ - case 414: /* duration_list */ - case 415: /* rollup_func_list */ - case 427: /* tag_list_opt */ - case 434: /* func_list */ - case 439: /* expression_list */ - case 455: /* col_list_opt */ - case 456: /* tag_def_or_ref_opt */ - case 461: /* dnode_list */ - case 464: /* literal_list */ - case 472: /* star_func_para_list */ - case 474: /* other_para_list */ - case 476: /* when_then_list */ - case 501: /* hint_list */ - case 504: /* select_list */ - case 505: /* partition_by_clause_opt */ - case 510: /* group_by_clause_opt */ - case 513: /* partition_list */ - case 517: /* group_by_list */ - case 520: /* order_by_clause_opt */ - case 525: /* sort_specification_list */ + case 367: /* ip_range_list */ + case 368: /* white_list */ + case 369: /* white_list_opt */ + case 391: /* integer_list */ + case 392: /* variable_list */ + case 393: /* retention_list */ + case 398: /* column_def_list */ + case 399: /* tags_def_opt */ + case 401: /* multi_create_clause */ + case 402: /* tags_def */ + case 403: /* multi_drop_clause */ + case 410: /* specific_cols_opt */ + case 411: /* tags_literal_list */ + case 413: /* col_name_list */ + case 415: /* duration_list */ + case 416: /* rollup_func_list */ + case 428: /* tag_list_opt */ + case 435: /* func_list */ + case 440: /* expression_list */ + case 456: /* col_list_opt */ + case 457: /* tag_def_or_ref_opt */ + case 462: /* dnode_list */ + case 465: /* literal_list */ + case 473: /* star_func_para_list */ + case 475: /* other_para_list */ + case 477: /* when_then_list */ + case 502: /* hint_list */ + case 505: /* select_list */ + case 506: /* partition_by_clause_opt */ + case 511: /* group_by_clause_opt */ + case 514: /* partition_list */ + case 518: /* group_by_list */ + case 521: /* order_by_clause_opt */ + case 526: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy608)); + nodesDestroyList((yypminor->yy444)); } break; - case 369: /* user_name */ - case 376: /* db_name */ - case 377: /* table_name */ - case 378: /* topic_name */ - case 380: /* dnode_endpoint */ - case 405: /* column_name */ - case 419: /* function_name */ - case 430: /* column_alias */ - case 433: /* index_name */ - case 438: /* sma_func_name */ - case 443: /* cgroup_name */ - case 450: /* language_opt */ - case 452: /* view_name */ - case 453: /* stream_name */ - case 460: /* on_vgroup_id */ - case 465: /* table_alias */ - case 471: /* star_func */ - case 473: /* noarg_func */ - case 491: /* alias_opt */ + case 370: /* user_name */ + case 377: /* db_name */ + case 378: /* table_name */ + case 379: /* topic_name */ + case 381: /* dnode_endpoint */ + case 406: /* column_name */ + case 420: /* function_name */ + case 431: /* column_alias */ + case 434: /* index_name */ + case 439: /* sma_func_name */ + case 444: /* cgroup_name */ + case 451: /* language_opt */ + case 453: /* view_name */ + case 454: /* stream_name */ + case 461: /* on_vgroup_id */ + case 466: /* table_alias */ + case 472: /* star_func */ + case 474: /* noarg_func */ + case 492: /* alias_opt */ { } break; - case 370: /* sysinfo_opt */ + case 371: /* sysinfo_opt */ { } break; - case 371: /* privileges */ - case 374: /* priv_type_list */ - case 375: /* priv_type */ + case 372: /* privileges */ + case 375: /* priv_type_list */ + case 376: /* priv_type */ { } break; - case 372: /* priv_level */ + case 373: /* priv_level */ { } break; - case 381: /* force_opt */ - case 382: /* unsafe_opt */ - case 383: /* not_exists_opt */ - case 385: /* exists_opt */ - case 444: /* analyze_opt */ - case 447: /* or_replace_opt */ - case 448: /* agg_func_opt */ - case 458: /* ignore_opt */ - case 502: /* set_quantifier_opt */ - case 503: /* tag_mode_opt */ + case 382: /* force_opt */ + case 383: /* unsafe_opt */ + case 384: /* not_exists_opt */ + case 386: /* exists_opt */ + case 445: /* analyze_opt */ + case 448: /* or_replace_opt */ + case 449: /* agg_func_opt */ + case 459: /* ignore_opt */ + case 503: /* set_quantifier_opt */ + case 504: /* tag_mode_opt */ { } break; - case 394: /* alter_db_option */ - case 416: /* alter_table_option */ + case 395: /* alter_db_option */ + case 417: /* alter_table_option */ { } break; - case 406: /* type_name */ + case 407: /* type_name */ { } break; - case 421: /* db_kind_opt */ - case 428: /* table_kind */ + case 422: /* db_kind_opt */ + case 429: /* table_kind */ { } break; - case 422: /* table_kind_db_name_cond_opt */ + case 423: /* table_kind_db_name_cond_opt */ { } break; - case 481: /* compare_op */ - case 482: /* in_op */ + case 482: /* compare_op */ + case 483: /* in_op */ { } break; - case 494: /* join_type */ + case 495: /* join_type */ { } break; - case 495: /* join_subtype */ + case 496: /* join_subtype */ { } break; - case 516: /* fill_mode */ + case 517: /* fill_mode */ { } break; - case 527: /* ordering_specification_opt */ + case 528: /* ordering_specification_opt */ { } break; - case 528: /* null_ordering_opt */ + case 529: /* null_ordering_opt */ { } @@ -3476,693 +3453,694 @@ static void yy_shift( /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side ** of that rule */ static const YYCODETYPE yyRuleInfoLhs[] = { - 361, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ - 361, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ - 362, /* (2) account_options ::= */ - 362, /* (3) account_options ::= account_options PPS literal */ - 362, /* (4) account_options ::= account_options TSERIES literal */ - 362, /* (5) account_options ::= account_options STORAGE literal */ - 362, /* (6) account_options ::= account_options STREAMS literal */ - 362, /* (7) account_options ::= account_options QTIME literal */ - 362, /* (8) account_options ::= account_options DBS literal */ - 362, /* (9) account_options ::= account_options USERS literal */ - 362, /* (10) account_options ::= account_options CONNS literal */ - 362, /* (11) account_options ::= account_options STATE literal */ - 363, /* (12) alter_account_options ::= alter_account_option */ - 363, /* (13) alter_account_options ::= alter_account_options alter_account_option */ - 365, /* (14) alter_account_option ::= PASS literal */ - 365, /* (15) alter_account_option ::= PPS literal */ - 365, /* (16) alter_account_option ::= TSERIES literal */ - 365, /* (17) alter_account_option ::= STORAGE literal */ - 365, /* (18) alter_account_option ::= STREAMS literal */ - 365, /* (19) alter_account_option ::= QTIME literal */ - 365, /* (20) alter_account_option ::= DBS literal */ - 365, /* (21) alter_account_option ::= USERS literal */ - 365, /* (22) alter_account_option ::= CONNS literal */ - 365, /* (23) alter_account_option ::= STATE literal */ - 366, /* (24) ip_range_list ::= NK_STRING */ - 366, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ - 367, /* (26) white_list ::= HOST ip_range_list */ - 368, /* (27) white_list_opt ::= */ - 368, /* (28) white_list_opt ::= white_list */ - 361, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ - 361, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ - 361, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ - 361, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ - 361, /* (33) cmd ::= ALTER USER user_name ADD white_list */ - 361, /* (34) cmd ::= ALTER USER user_name DROP white_list */ - 361, /* (35) cmd ::= DROP USER user_name */ - 370, /* (36) sysinfo_opt ::= */ - 370, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ - 361, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ - 361, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ - 371, /* (40) privileges ::= ALL */ - 371, /* (41) privileges ::= priv_type_list */ - 371, /* (42) privileges ::= SUBSCRIBE */ - 374, /* (43) priv_type_list ::= priv_type */ - 374, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ - 375, /* (45) priv_type ::= READ */ - 375, /* (46) priv_type ::= WRITE */ - 375, /* (47) priv_type ::= ALTER */ - 372, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ - 372, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ - 372, /* (50) priv_level ::= db_name NK_DOT table_name */ - 372, /* (51) priv_level ::= topic_name */ - 373, /* (52) with_opt ::= */ - 373, /* (53) with_opt ::= WITH search_condition */ - 361, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ - 361, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ - 361, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ - 361, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ - 361, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ - 361, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ - 361, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ - 361, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ - 361, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ - 361, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ - 361, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ - 380, /* (65) dnode_endpoint ::= NK_STRING */ - 380, /* (66) dnode_endpoint ::= NK_ID */ - 380, /* (67) dnode_endpoint ::= NK_IPTOKEN */ - 381, /* (68) force_opt ::= */ - 381, /* (69) force_opt ::= FORCE */ - 382, /* (70) unsafe_opt ::= UNSAFE */ - 361, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ - 361, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ - 361, /* (73) cmd ::= ALTER LOCAL NK_STRING */ - 361, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ - 361, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ - 361, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ - 361, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ - 361, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ - 361, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ - 361, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ - 361, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ - 361, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ - 361, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ - 361, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ - 361, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ - 361, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ - 361, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ - 361, /* (88) cmd ::= USE db_name */ - 361, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ - 361, /* (90) cmd ::= FLUSH DATABASE db_name */ - 361, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ - 361, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ - 383, /* (93) not_exists_opt ::= IF NOT EXISTS */ - 383, /* (94) not_exists_opt ::= */ - 385, /* (95) exists_opt ::= IF EXISTS */ - 385, /* (96) exists_opt ::= */ - 384, /* (97) db_options ::= */ - 384, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ - 384, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ - 384, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ - 384, /* (101) db_options ::= db_options COMP NK_INTEGER */ - 384, /* (102) db_options ::= db_options DURATION NK_INTEGER */ - 384, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ - 384, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ - 384, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ - 384, /* (106) db_options ::= db_options KEEP integer_list */ - 384, /* (107) db_options ::= db_options KEEP variable_list */ - 384, /* (108) db_options ::= db_options PAGES NK_INTEGER */ - 384, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ - 384, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ - 384, /* (111) db_options ::= db_options PRECISION NK_STRING */ - 384, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ - 384, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ - 384, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ - 384, /* (115) db_options ::= db_options RETENTIONS retention_list */ - 384, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ - 384, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ - 384, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ - 384, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ - 384, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 384, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ - 384, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 384, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ - 384, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ - 384, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ - 384, /* (126) db_options ::= db_options TABLE_PREFIX signed */ - 384, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ - 384, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ - 386, /* (129) alter_db_options ::= alter_db_option */ - 386, /* (130) alter_db_options ::= alter_db_options alter_db_option */ - 394, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ - 394, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ - 394, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ - 394, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ - 394, /* (135) alter_db_option ::= KEEP integer_list */ - 394, /* (136) alter_db_option ::= KEEP variable_list */ - 394, /* (137) alter_db_option ::= PAGES NK_INTEGER */ - 394, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ - 394, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - 394, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - 394, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ - 394, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ - 394, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ - 394, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ - 394, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ - 394, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ - 390, /* (147) integer_list ::= NK_INTEGER */ - 390, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - 391, /* (149) variable_list ::= NK_VARIABLE */ - 391, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - 392, /* (151) retention_list ::= retention */ - 392, /* (152) retention_list ::= retention_list NK_COMMA retention */ - 395, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - 395, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ - 387, /* (155) speed_opt ::= */ - 387, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ - 388, /* (157) start_opt ::= */ - 388, /* (158) start_opt ::= START WITH NK_INTEGER */ - 388, /* (159) start_opt ::= START WITH NK_STRING */ - 388, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ - 389, /* (161) end_opt ::= */ - 389, /* (162) end_opt ::= END WITH NK_INTEGER */ - 389, /* (163) end_opt ::= END WITH NK_STRING */ - 389, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ - 361, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - 361, /* (166) cmd ::= CREATE TABLE multi_create_clause */ - 361, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - 361, /* (168) cmd ::= DROP TABLE multi_drop_clause */ - 361, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ - 361, /* (170) cmd ::= ALTER TABLE alter_table_clause */ - 361, /* (171) cmd ::= ALTER STABLE alter_table_clause */ - 403, /* (172) alter_table_clause ::= full_table_name alter_table_options */ - 403, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - 403, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - 403, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - 403, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - 403, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - 403, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ - 403, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - 403, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - 403, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ - 400, /* (182) multi_create_clause ::= create_subtable_clause */ - 400, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ - 408, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ - 402, /* (185) multi_drop_clause ::= drop_table_clause */ - 402, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ - 411, /* (187) drop_table_clause ::= exists_opt full_table_name */ - 409, /* (188) specific_cols_opt ::= */ - 409, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - 396, /* (190) full_table_name ::= table_name */ - 396, /* (191) full_table_name ::= db_name NK_DOT table_name */ - 397, /* (192) column_def_list ::= column_def */ - 397, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ - 413, /* (194) column_def ::= column_name type_name */ - 406, /* (195) type_name ::= BOOL */ - 406, /* (196) type_name ::= TINYINT */ - 406, /* (197) type_name ::= SMALLINT */ - 406, /* (198) type_name ::= INT */ - 406, /* (199) type_name ::= INTEGER */ - 406, /* (200) type_name ::= BIGINT */ - 406, /* (201) type_name ::= FLOAT */ - 406, /* (202) type_name ::= DOUBLE */ - 406, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - 406, /* (204) type_name ::= TIMESTAMP */ - 406, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - 406, /* (206) type_name ::= TINYINT UNSIGNED */ - 406, /* (207) type_name ::= SMALLINT UNSIGNED */ - 406, /* (208) type_name ::= INT UNSIGNED */ - 406, /* (209) type_name ::= BIGINT UNSIGNED */ - 406, /* (210) type_name ::= JSON */ - 406, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - 406, /* (212) type_name ::= MEDIUMBLOB */ - 406, /* (213) type_name ::= BLOB */ - 406, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - 406, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ - 406, /* (216) type_name ::= DECIMAL */ - 406, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - 406, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 398, /* (219) tags_def_opt ::= */ - 398, /* (220) tags_def_opt ::= tags_def */ - 401, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - 399, /* (222) table_options ::= */ - 399, /* (223) table_options ::= table_options COMMENT NK_STRING */ - 399, /* (224) table_options ::= table_options MAX_DELAY duration_list */ - 399, /* (225) table_options ::= table_options WATERMARK duration_list */ - 399, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - 399, /* (227) table_options ::= table_options TTL NK_INTEGER */ - 399, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - 399, /* (229) table_options ::= table_options DELETE_MARK duration_list */ - 404, /* (230) alter_table_options ::= alter_table_option */ - 404, /* (231) alter_table_options ::= alter_table_options alter_table_option */ - 416, /* (232) alter_table_option ::= COMMENT NK_STRING */ - 416, /* (233) alter_table_option ::= TTL NK_INTEGER */ - 414, /* (234) duration_list ::= duration_literal */ - 414, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ - 415, /* (236) rollup_func_list ::= rollup_func_name */ - 415, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - 418, /* (238) rollup_func_name ::= function_name */ - 418, /* (239) rollup_func_name ::= FIRST */ - 418, /* (240) rollup_func_name ::= LAST */ - 412, /* (241) col_name_list ::= col_name */ - 412, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ - 420, /* (243) col_name ::= column_name */ - 361, /* (244) cmd ::= SHOW DNODES */ - 361, /* (245) cmd ::= SHOW USERS */ - 361, /* (246) cmd ::= SHOW USER PRIVILEGES */ - 361, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ - 361, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ - 361, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - 361, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ - 361, /* (251) cmd ::= SHOW MNODES */ - 361, /* (252) cmd ::= SHOW QNODES */ - 361, /* (253) cmd ::= SHOW FUNCTIONS */ - 361, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - 361, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - 361, /* (256) cmd ::= SHOW STREAMS */ - 361, /* (257) cmd ::= SHOW ACCOUNTS */ - 361, /* (258) cmd ::= SHOW APPS */ - 361, /* (259) cmd ::= SHOW CONNECTIONS */ - 361, /* (260) cmd ::= SHOW LICENCES */ - 361, /* (261) cmd ::= SHOW GRANTS */ - 361, /* (262) cmd ::= SHOW GRANTS FULL */ - 361, /* (263) cmd ::= SHOW GRANTS LOGS */ - 361, /* (264) cmd ::= SHOW CLUSTER MACHINES */ - 361, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ - 361, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ - 361, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ - 361, /* (268) cmd ::= SHOW QUERIES */ - 361, /* (269) cmd ::= SHOW SCORES */ - 361, /* (270) cmd ::= SHOW TOPICS */ - 361, /* (271) cmd ::= SHOW VARIABLES */ - 361, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ - 361, /* (273) cmd ::= SHOW LOCAL VARIABLES */ - 361, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - 361, /* (275) cmd ::= SHOW BNODES */ - 361, /* (276) cmd ::= SHOW SNODES */ - 361, /* (277) cmd ::= SHOW CLUSTER */ - 361, /* (278) cmd ::= SHOW TRANSACTIONS */ - 361, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - 361, /* (280) cmd ::= SHOW CONSUMERS */ - 361, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ - 361, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - 361, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - 361, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - 361, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - 361, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - 361, /* (287) cmd ::= SHOW VNODES */ - 361, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ - 361, /* (289) cmd ::= SHOW CLUSTER ALIVE */ - 361, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - 361, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ - 361, /* (292) cmd ::= SHOW COMPACTS */ - 361, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ - 422, /* (294) table_kind_db_name_cond_opt ::= */ - 422, /* (295) table_kind_db_name_cond_opt ::= table_kind */ - 422, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - 422, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - 428, /* (298) table_kind ::= NORMAL */ - 428, /* (299) table_kind ::= CHILD */ - 424, /* (300) db_name_cond_opt ::= */ - 424, /* (301) db_name_cond_opt ::= db_name NK_DOT */ - 423, /* (302) like_pattern_opt ::= */ - 423, /* (303) like_pattern_opt ::= LIKE NK_STRING */ - 425, /* (304) table_name_cond ::= table_name */ - 426, /* (305) from_db_opt ::= */ - 426, /* (306) from_db_opt ::= FROM db_name */ - 427, /* (307) tag_list_opt ::= */ - 427, /* (308) tag_list_opt ::= tag_item */ - 427, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - 429, /* (310) tag_item ::= TBNAME */ - 429, /* (311) tag_item ::= QTAGS */ - 429, /* (312) tag_item ::= column_name */ - 429, /* (313) tag_item ::= column_name column_alias */ - 429, /* (314) tag_item ::= column_name AS column_alias */ - 421, /* (315) db_kind_opt ::= */ - 421, /* (316) db_kind_opt ::= USER */ - 421, /* (317) db_kind_opt ::= SYSTEM */ - 361, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - 361, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - 361, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ - 432, /* (321) full_index_name ::= index_name */ - 432, /* (322) full_index_name ::= db_name NK_DOT index_name */ - 431, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - 431, /* (324) 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 */ - 434, /* (325) func_list ::= func */ - 434, /* (326) func_list ::= func_list NK_COMMA func */ - 437, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ - 438, /* (328) sma_func_name ::= function_name */ - 438, /* (329) sma_func_name ::= COUNT */ - 438, /* (330) sma_func_name ::= FIRST */ - 438, /* (331) sma_func_name ::= LAST */ - 438, /* (332) sma_func_name ::= LAST_ROW */ - 436, /* (333) sma_stream_opt ::= */ - 436, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - 436, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - 436, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - 440, /* (337) with_meta ::= AS */ - 440, /* (338) with_meta ::= WITH META AS */ - 440, /* (339) with_meta ::= ONLY META AS */ - 361, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - 361, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - 361, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - 361, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ - 361, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - 361, /* (345) cmd ::= DESC full_table_name */ - 361, /* (346) cmd ::= DESCRIBE full_table_name */ - 361, /* (347) cmd ::= RESET QUERY CACHE */ - 361, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - 361, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 444, /* (350) analyze_opt ::= */ - 444, /* (351) analyze_opt ::= ANALYZE */ - 445, /* (352) explain_options ::= */ - 445, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ - 445, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ - 361, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - 361, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ - 448, /* (357) agg_func_opt ::= */ - 448, /* (358) agg_func_opt ::= AGGREGATE */ - 449, /* (359) bufsize_opt ::= */ - 449, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 450, /* (361) language_opt ::= */ - 450, /* (362) language_opt ::= LANGUAGE NK_STRING */ - 447, /* (363) or_replace_opt ::= */ - 447, /* (364) or_replace_opt ::= OR REPLACE */ - 361, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - 361, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ - 451, /* (367) full_view_name ::= view_name */ - 451, /* (368) full_view_name ::= db_name NK_DOT view_name */ - 361, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - 361, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ - 361, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ - 361, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 455, /* (373) col_list_opt ::= */ - 455, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ - 456, /* (375) tag_def_or_ref_opt ::= */ - 456, /* (376) tag_def_or_ref_opt ::= tags_def */ - 456, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 454, /* (378) stream_options ::= */ - 454, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ - 454, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - 454, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - 454, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ - 454, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - 454, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - 454, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ - 454, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 457, /* (387) subtable_opt ::= */ - 457, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 458, /* (389) ignore_opt ::= */ - 458, /* (390) ignore_opt ::= IGNORE UNTREATED */ - 361, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ - 361, /* (392) cmd ::= KILL QUERY NK_STRING */ - 361, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ - 361, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ - 361, /* (395) cmd ::= BALANCE VGROUP */ - 361, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - 361, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - 361, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - 361, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ - 460, /* (400) on_vgroup_id ::= */ - 460, /* (401) on_vgroup_id ::= ON NK_INTEGER */ - 461, /* (402) dnode_list ::= DNODE NK_INTEGER */ - 461, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ - 361, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ - 361, /* (405) cmd ::= query_or_subquery */ - 361, /* (406) cmd ::= insert_query */ - 446, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - 446, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - 407, /* (409) tags_literal ::= NK_INTEGER */ - 407, /* (410) tags_literal ::= NK_PLUS NK_INTEGER */ - 407, /* (411) tags_literal ::= NK_MINUS NK_INTEGER */ - 407, /* (412) tags_literal ::= NK_FLOAT */ - 407, /* (413) tags_literal ::= NK_PLUS NK_FLOAT */ - 407, /* (414) tags_literal ::= NK_MINUS NK_FLOAT */ - 407, /* (415) tags_literal ::= NK_BIN */ - 407, /* (416) tags_literal ::= NK_PLUS NK_BIN */ - 407, /* (417) tags_literal ::= NK_MINUS NK_BIN */ - 407, /* (418) tags_literal ::= NK_HEX */ - 407, /* (419) tags_literal ::= NK_PLUS NK_HEX */ - 407, /* (420) tags_literal ::= NK_MINUS NK_HEX */ - 407, /* (421) tags_literal ::= NK_STRING */ - 407, /* (422) tags_literal ::= NK_BOOL */ - 407, /* (423) tags_literal ::= NULL */ - 407, /* (424) tags_literal ::= literal_func */ - 407, /* (425) tags_literal ::= literal_func NK_PLUS duration_literal */ - 407, /* (426) tags_literal ::= literal_func NK_MINUS duration_literal */ - 410, /* (427) tags_literal_list ::= tags_literal */ - 410, /* (428) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - 364, /* (429) literal ::= NK_INTEGER */ - 364, /* (430) literal ::= NK_FLOAT */ - 364, /* (431) literal ::= NK_STRING */ - 364, /* (432) literal ::= NK_BOOL */ - 364, /* (433) literal ::= TIMESTAMP NK_STRING */ - 364, /* (434) literal ::= duration_literal */ - 364, /* (435) literal ::= NULL */ - 364, /* (436) literal ::= NK_QUESTION */ - 417, /* (437) duration_literal ::= NK_VARIABLE */ - 393, /* (438) signed ::= NK_INTEGER */ - 393, /* (439) signed ::= NK_PLUS NK_INTEGER */ - 393, /* (440) signed ::= NK_MINUS NK_INTEGER */ - 393, /* (441) signed ::= NK_FLOAT */ - 393, /* (442) signed ::= NK_PLUS NK_FLOAT */ - 393, /* (443) signed ::= NK_MINUS NK_FLOAT */ - 463, /* (444) signed_literal ::= signed */ - 463, /* (445) signed_literal ::= NK_STRING */ - 463, /* (446) signed_literal ::= NK_BOOL */ - 463, /* (447) signed_literal ::= TIMESTAMP NK_STRING */ - 463, /* (448) signed_literal ::= duration_literal */ - 463, /* (449) signed_literal ::= NULL */ - 463, /* (450) signed_literal ::= literal_func */ - 463, /* (451) signed_literal ::= NK_QUESTION */ - 464, /* (452) literal_list ::= signed_literal */ - 464, /* (453) literal_list ::= literal_list NK_COMMA signed_literal */ - 376, /* (454) db_name ::= NK_ID */ - 377, /* (455) table_name ::= NK_ID */ - 405, /* (456) column_name ::= NK_ID */ - 419, /* (457) function_name ::= NK_ID */ - 452, /* (458) view_name ::= NK_ID */ - 465, /* (459) table_alias ::= NK_ID */ - 430, /* (460) column_alias ::= NK_ID */ - 430, /* (461) column_alias ::= NK_ALIAS */ - 369, /* (462) user_name ::= NK_ID */ - 378, /* (463) topic_name ::= NK_ID */ - 453, /* (464) stream_name ::= NK_ID */ - 443, /* (465) cgroup_name ::= NK_ID */ - 433, /* (466) index_name ::= NK_ID */ - 466, /* (467) expr_or_subquery ::= expression */ - 459, /* (468) expression ::= literal */ - 459, /* (469) expression ::= pseudo_column */ - 459, /* (470) expression ::= column_reference */ - 459, /* (471) expression ::= function_expression */ - 459, /* (472) expression ::= case_when_expression */ - 459, /* (473) expression ::= NK_LP expression NK_RP */ - 459, /* (474) expression ::= NK_PLUS expr_or_subquery */ - 459, /* (475) expression ::= NK_MINUS expr_or_subquery */ - 459, /* (476) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - 459, /* (477) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - 459, /* (478) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - 459, /* (479) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - 459, /* (480) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - 459, /* (481) expression ::= column_reference NK_ARROW NK_STRING */ - 459, /* (482) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - 459, /* (483) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - 439, /* (484) expression_list ::= expr_or_subquery */ - 439, /* (485) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - 468, /* (486) column_reference ::= column_name */ - 468, /* (487) column_reference ::= table_name NK_DOT column_name */ - 468, /* (488) column_reference ::= NK_ALIAS */ - 468, /* (489) column_reference ::= table_name NK_DOT NK_ALIAS */ - 467, /* (490) pseudo_column ::= ROWTS */ - 467, /* (491) pseudo_column ::= TBNAME */ - 467, /* (492) pseudo_column ::= table_name NK_DOT TBNAME */ - 467, /* (493) pseudo_column ::= QSTART */ - 467, /* (494) pseudo_column ::= QEND */ - 467, /* (495) pseudo_column ::= QDURATION */ - 467, /* (496) pseudo_column ::= WSTART */ - 467, /* (497) pseudo_column ::= WEND */ - 467, /* (498) pseudo_column ::= WDURATION */ - 467, /* (499) pseudo_column ::= IROWTS */ - 467, /* (500) pseudo_column ::= ISFILLED */ - 467, /* (501) pseudo_column ::= QTAGS */ - 469, /* (502) function_expression ::= function_name NK_LP expression_list NK_RP */ - 469, /* (503) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - 469, /* (504) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - 469, /* (505) function_expression ::= literal_func */ - 462, /* (506) literal_func ::= noarg_func NK_LP NK_RP */ - 462, /* (507) literal_func ::= NOW */ - 462, /* (508) literal_func ::= TODAY */ - 473, /* (509) noarg_func ::= NOW */ - 473, /* (510) noarg_func ::= TODAY */ - 473, /* (511) noarg_func ::= TIMEZONE */ - 473, /* (512) noarg_func ::= DATABASE */ - 473, /* (513) noarg_func ::= CLIENT_VERSION */ - 473, /* (514) noarg_func ::= SERVER_VERSION */ - 473, /* (515) noarg_func ::= SERVER_STATUS */ - 473, /* (516) noarg_func ::= CURRENT_USER */ - 473, /* (517) noarg_func ::= USER */ - 471, /* (518) star_func ::= COUNT */ - 471, /* (519) star_func ::= FIRST */ - 471, /* (520) star_func ::= LAST */ - 471, /* (521) star_func ::= LAST_ROW */ - 472, /* (522) star_func_para_list ::= NK_STAR */ - 472, /* (523) star_func_para_list ::= other_para_list */ - 474, /* (524) other_para_list ::= star_func_para */ - 474, /* (525) other_para_list ::= other_para_list NK_COMMA star_func_para */ - 475, /* (526) star_func_para ::= expr_or_subquery */ - 475, /* (527) star_func_para ::= table_name NK_DOT NK_STAR */ - 470, /* (528) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - 470, /* (529) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - 476, /* (530) when_then_list ::= when_then_expr */ - 476, /* (531) when_then_list ::= when_then_list when_then_expr */ - 479, /* (532) when_then_expr ::= WHEN common_expression THEN common_expression */ - 477, /* (533) case_when_else_opt ::= */ - 477, /* (534) case_when_else_opt ::= ELSE common_expression */ - 480, /* (535) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - 480, /* (536) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - 480, /* (537) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - 480, /* (538) predicate ::= expr_or_subquery IS NULL */ - 480, /* (539) predicate ::= expr_or_subquery IS NOT NULL */ - 480, /* (540) predicate ::= expr_or_subquery in_op in_predicate_value */ - 481, /* (541) compare_op ::= NK_LT */ - 481, /* (542) compare_op ::= NK_GT */ - 481, /* (543) compare_op ::= NK_LE */ - 481, /* (544) compare_op ::= NK_GE */ - 481, /* (545) compare_op ::= NK_NE */ - 481, /* (546) compare_op ::= NK_EQ */ - 481, /* (547) compare_op ::= LIKE */ - 481, /* (548) compare_op ::= NOT LIKE */ - 481, /* (549) compare_op ::= MATCH */ - 481, /* (550) compare_op ::= NMATCH */ - 481, /* (551) compare_op ::= CONTAINS */ - 482, /* (552) in_op ::= IN */ - 482, /* (553) in_op ::= NOT IN */ - 483, /* (554) in_predicate_value ::= NK_LP literal_list NK_RP */ - 484, /* (555) boolean_value_expression ::= boolean_primary */ - 484, /* (556) boolean_value_expression ::= NOT boolean_primary */ - 484, /* (557) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - 484, /* (558) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - 485, /* (559) boolean_primary ::= predicate */ - 485, /* (560) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - 478, /* (561) common_expression ::= expr_or_subquery */ - 478, /* (562) common_expression ::= boolean_value_expression */ - 486, /* (563) from_clause_opt ::= */ - 486, /* (564) from_clause_opt ::= FROM table_reference_list */ - 487, /* (565) table_reference_list ::= table_reference */ - 487, /* (566) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - 488, /* (567) table_reference ::= table_primary */ - 488, /* (568) table_reference ::= joined_table */ - 489, /* (569) table_primary ::= table_name alias_opt */ - 489, /* (570) table_primary ::= db_name NK_DOT table_name alias_opt */ - 489, /* (571) table_primary ::= subquery alias_opt */ - 489, /* (572) table_primary ::= parenthesized_joined_table */ - 491, /* (573) alias_opt ::= */ - 491, /* (574) alias_opt ::= table_alias */ - 491, /* (575) alias_opt ::= AS table_alias */ - 493, /* (576) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - 493, /* (577) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - 490, /* (578) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 494, /* (579) join_type ::= */ - 494, /* (580) join_type ::= INNER */ - 494, /* (581) join_type ::= LEFT */ - 494, /* (582) join_type ::= RIGHT */ - 494, /* (583) join_type ::= FULL */ - 495, /* (584) join_subtype ::= */ - 495, /* (585) join_subtype ::= OUTER */ - 495, /* (586) join_subtype ::= SEMI */ - 495, /* (587) join_subtype ::= ANTI */ - 495, /* (588) join_subtype ::= ASOF */ - 495, /* (589) join_subtype ::= WINDOW */ - 496, /* (590) join_on_clause_opt ::= */ - 496, /* (591) join_on_clause_opt ::= ON search_condition */ - 497, /* (592) window_offset_clause_opt ::= */ - 497, /* (593) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - 499, /* (594) window_offset_literal ::= NK_VARIABLE */ - 499, /* (595) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 498, /* (596) jlimit_clause_opt ::= */ - 498, /* (597) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - 500, /* (598) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 501, /* (599) hint_list ::= */ - 501, /* (600) hint_list ::= NK_HINT */ - 503, /* (601) tag_mode_opt ::= */ - 503, /* (602) tag_mode_opt ::= TAGS */ - 502, /* (603) set_quantifier_opt ::= */ - 502, /* (604) set_quantifier_opt ::= DISTINCT */ - 502, /* (605) set_quantifier_opt ::= ALL */ - 504, /* (606) select_list ::= select_item */ - 504, /* (607) select_list ::= select_list NK_COMMA select_item */ - 512, /* (608) select_item ::= NK_STAR */ - 512, /* (609) select_item ::= common_expression */ - 512, /* (610) select_item ::= common_expression column_alias */ - 512, /* (611) select_item ::= common_expression AS column_alias */ - 512, /* (612) select_item ::= table_name NK_DOT NK_STAR */ - 442, /* (613) where_clause_opt ::= */ - 442, /* (614) where_clause_opt ::= WHERE search_condition */ - 505, /* (615) partition_by_clause_opt ::= */ - 505, /* (616) partition_by_clause_opt ::= PARTITION BY partition_list */ - 513, /* (617) partition_list ::= partition_item */ - 513, /* (618) partition_list ::= partition_list NK_COMMA partition_item */ - 514, /* (619) partition_item ::= expr_or_subquery */ - 514, /* (620) partition_item ::= expr_or_subquery column_alias */ - 514, /* (621) partition_item ::= expr_or_subquery AS column_alias */ - 509, /* (622) twindow_clause_opt ::= */ - 509, /* (623) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - 509, /* (624) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - 509, /* (625) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 509, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - 509, /* (627) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - 509, /* (628) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - 509, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 435, /* (630) sliding_opt ::= */ - 435, /* (631) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - 515, /* (632) interval_sliding_duration_literal ::= NK_VARIABLE */ - 515, /* (633) interval_sliding_duration_literal ::= NK_STRING */ - 515, /* (634) interval_sliding_duration_literal ::= NK_INTEGER */ - 508, /* (635) fill_opt ::= */ - 508, /* (636) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - 508, /* (637) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - 508, /* (638) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - 516, /* (639) fill_mode ::= NONE */ - 516, /* (640) fill_mode ::= PREV */ - 516, /* (641) fill_mode ::= NULL */ - 516, /* (642) fill_mode ::= NULL_F */ - 516, /* (643) fill_mode ::= LINEAR */ - 516, /* (644) fill_mode ::= NEXT */ - 510, /* (645) group_by_clause_opt ::= */ - 510, /* (646) group_by_clause_opt ::= GROUP BY group_by_list */ - 517, /* (647) group_by_list ::= expr_or_subquery */ - 517, /* (648) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 511, /* (649) having_clause_opt ::= */ - 511, /* (650) having_clause_opt ::= HAVING search_condition */ - 506, /* (651) range_opt ::= */ - 506, /* (652) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - 506, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 507, /* (654) every_opt ::= */ - 507, /* (655) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - 518, /* (656) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - 519, /* (657) query_simple ::= query_specification */ - 519, /* (658) query_simple ::= union_query_expression */ - 523, /* (659) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - 523, /* (660) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - 524, /* (661) query_simple_or_subquery ::= query_simple */ - 524, /* (662) query_simple_or_subquery ::= subquery */ - 441, /* (663) query_or_subquery ::= query_expression */ - 441, /* (664) query_or_subquery ::= subquery */ - 520, /* (665) order_by_clause_opt ::= */ - 520, /* (666) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 521, /* (667) slimit_clause_opt ::= */ - 521, /* (668) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - 521, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - 521, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 522, /* (671) limit_clause_opt ::= */ - 522, /* (672) limit_clause_opt ::= LIMIT NK_INTEGER */ - 522, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - 522, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 492, /* (675) subquery ::= NK_LP query_expression NK_RP */ - 492, /* (676) subquery ::= NK_LP subquery NK_RP */ - 379, /* (677) search_condition ::= common_expression */ - 525, /* (678) sort_specification_list ::= sort_specification */ - 525, /* (679) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - 526, /* (680) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 527, /* (681) ordering_specification_opt ::= */ - 527, /* (682) ordering_specification_opt ::= ASC */ - 527, /* (683) ordering_specification_opt ::= DESC */ - 528, /* (684) null_ordering_opt ::= */ - 528, /* (685) null_ordering_opt ::= NULLS FIRST */ - 528, /* (686) null_ordering_opt ::= NULLS LAST */ + 362, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */ + 362, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */ + 363, /* (2) account_options ::= */ + 363, /* (3) account_options ::= account_options PPS literal */ + 363, /* (4) account_options ::= account_options TSERIES literal */ + 363, /* (5) account_options ::= account_options STORAGE literal */ + 363, /* (6) account_options ::= account_options STREAMS literal */ + 363, /* (7) account_options ::= account_options QTIME literal */ + 363, /* (8) account_options ::= account_options DBS literal */ + 363, /* (9) account_options ::= account_options USERS literal */ + 363, /* (10) account_options ::= account_options CONNS literal */ + 363, /* (11) account_options ::= account_options STATE literal */ + 364, /* (12) alter_account_options ::= alter_account_option */ + 364, /* (13) alter_account_options ::= alter_account_options alter_account_option */ + 366, /* (14) alter_account_option ::= PASS literal */ + 366, /* (15) alter_account_option ::= PPS literal */ + 366, /* (16) alter_account_option ::= TSERIES literal */ + 366, /* (17) alter_account_option ::= STORAGE literal */ + 366, /* (18) alter_account_option ::= STREAMS literal */ + 366, /* (19) alter_account_option ::= QTIME literal */ + 366, /* (20) alter_account_option ::= DBS literal */ + 366, /* (21) alter_account_option ::= USERS literal */ + 366, /* (22) alter_account_option ::= CONNS literal */ + 366, /* (23) alter_account_option ::= STATE literal */ + 367, /* (24) ip_range_list ::= NK_STRING */ + 367, /* (25) ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ + 368, /* (26) white_list ::= HOST ip_range_list */ + 369, /* (27) white_list_opt ::= */ + 369, /* (28) white_list_opt ::= white_list */ + 362, /* (29) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ + 362, /* (30) cmd ::= ALTER USER user_name PASS NK_STRING */ + 362, /* (31) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ + 362, /* (32) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ + 362, /* (33) cmd ::= ALTER USER user_name ADD white_list */ + 362, /* (34) cmd ::= ALTER USER user_name DROP white_list */ + 362, /* (35) cmd ::= DROP USER user_name */ + 371, /* (36) sysinfo_opt ::= */ + 371, /* (37) sysinfo_opt ::= SYSINFO NK_INTEGER */ + 362, /* (38) cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ + 362, /* (39) cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ + 372, /* (40) privileges ::= ALL */ + 372, /* (41) privileges ::= priv_type_list */ + 372, /* (42) privileges ::= SUBSCRIBE */ + 375, /* (43) priv_type_list ::= priv_type */ + 375, /* (44) priv_type_list ::= priv_type_list NK_COMMA priv_type */ + 376, /* (45) priv_type ::= READ */ + 376, /* (46) priv_type ::= WRITE */ + 376, /* (47) priv_type ::= ALTER */ + 373, /* (48) priv_level ::= NK_STAR NK_DOT NK_STAR */ + 373, /* (49) priv_level ::= db_name NK_DOT NK_STAR */ + 373, /* (50) priv_level ::= db_name NK_DOT table_name */ + 373, /* (51) priv_level ::= topic_name */ + 374, /* (52) with_opt ::= */ + 374, /* (53) with_opt ::= WITH search_condition */ + 362, /* (54) cmd ::= CREATE DNODE dnode_endpoint */ + 362, /* (55) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ + 362, /* (56) cmd ::= DROP DNODE NK_INTEGER force_opt */ + 362, /* (57) cmd ::= DROP DNODE dnode_endpoint force_opt */ + 362, /* (58) cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ + 362, /* (59) cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ + 362, /* (60) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ + 362, /* (61) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */ + 362, /* (62) cmd ::= ALTER ALL DNODES NK_STRING */ + 362, /* (63) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */ + 362, /* (64) cmd ::= RESTORE DNODE NK_INTEGER */ + 381, /* (65) dnode_endpoint ::= NK_STRING */ + 381, /* (66) dnode_endpoint ::= NK_ID */ + 381, /* (67) dnode_endpoint ::= NK_IPTOKEN */ + 382, /* (68) force_opt ::= */ + 382, /* (69) force_opt ::= FORCE */ + 383, /* (70) unsafe_opt ::= UNSAFE */ + 362, /* (71) cmd ::= ALTER CLUSTER NK_STRING */ + 362, /* (72) cmd ::= ALTER CLUSTER NK_STRING NK_STRING */ + 362, /* (73) cmd ::= ALTER LOCAL NK_STRING */ + 362, /* (74) cmd ::= ALTER LOCAL NK_STRING NK_STRING */ + 362, /* (75) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */ + 362, /* (76) cmd ::= DROP QNODE ON DNODE NK_INTEGER */ + 362, /* (77) cmd ::= RESTORE QNODE ON DNODE NK_INTEGER */ + 362, /* (78) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */ + 362, /* (79) cmd ::= DROP BNODE ON DNODE NK_INTEGER */ + 362, /* (80) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */ + 362, /* (81) cmd ::= DROP SNODE ON DNODE NK_INTEGER */ + 362, /* (82) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */ + 362, /* (83) cmd ::= DROP MNODE ON DNODE NK_INTEGER */ + 362, /* (84) cmd ::= RESTORE MNODE ON DNODE NK_INTEGER */ + 362, /* (85) cmd ::= RESTORE VNODE ON DNODE NK_INTEGER */ + 362, /* (86) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ + 362, /* (87) cmd ::= DROP DATABASE exists_opt db_name */ + 362, /* (88) cmd ::= USE db_name */ + 362, /* (89) cmd ::= ALTER DATABASE db_name alter_db_options */ + 362, /* (90) cmd ::= FLUSH DATABASE db_name */ + 362, /* (91) cmd ::= TRIM DATABASE db_name speed_opt */ + 362, /* (92) cmd ::= COMPACT DATABASE db_name start_opt end_opt */ + 384, /* (93) not_exists_opt ::= IF NOT EXISTS */ + 384, /* (94) not_exists_opt ::= */ + 386, /* (95) exists_opt ::= IF EXISTS */ + 386, /* (96) exists_opt ::= */ + 385, /* (97) db_options ::= */ + 385, /* (98) db_options ::= db_options BUFFER NK_INTEGER */ + 385, /* (99) db_options ::= db_options CACHEMODEL NK_STRING */ + 385, /* (100) db_options ::= db_options CACHESIZE NK_INTEGER */ + 385, /* (101) db_options ::= db_options COMP NK_INTEGER */ + 385, /* (102) db_options ::= db_options DURATION NK_INTEGER */ + 385, /* (103) db_options ::= db_options DURATION NK_VARIABLE */ + 385, /* (104) db_options ::= db_options MAXROWS NK_INTEGER */ + 385, /* (105) db_options ::= db_options MINROWS NK_INTEGER */ + 385, /* (106) db_options ::= db_options KEEP integer_list */ + 385, /* (107) db_options ::= db_options KEEP variable_list */ + 385, /* (108) db_options ::= db_options PAGES NK_INTEGER */ + 385, /* (109) db_options ::= db_options PAGESIZE NK_INTEGER */ + 385, /* (110) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ + 385, /* (111) db_options ::= db_options PRECISION NK_STRING */ + 385, /* (112) db_options ::= db_options REPLICA NK_INTEGER */ + 385, /* (113) db_options ::= db_options VGROUPS NK_INTEGER */ + 385, /* (114) db_options ::= db_options SINGLE_STABLE NK_INTEGER */ + 385, /* (115) db_options ::= db_options RETENTIONS retention_list */ + 385, /* (116) db_options ::= db_options SCHEMALESS NK_INTEGER */ + 385, /* (117) db_options ::= db_options WAL_LEVEL NK_INTEGER */ + 385, /* (118) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ + 385, /* (119) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ + 385, /* (120) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 385, /* (121) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ + 385, /* (122) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 385, /* (123) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ + 385, /* (124) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ + 385, /* (125) db_options ::= db_options STT_TRIGGER NK_INTEGER */ + 385, /* (126) db_options ::= db_options TABLE_PREFIX signed */ + 385, /* (127) db_options ::= db_options TABLE_SUFFIX signed */ + 385, /* (128) db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ + 387, /* (129) alter_db_options ::= alter_db_option */ + 387, /* (130) alter_db_options ::= alter_db_options alter_db_option */ + 395, /* (131) alter_db_option ::= BUFFER NK_INTEGER */ + 395, /* (132) alter_db_option ::= CACHEMODEL NK_STRING */ + 395, /* (133) alter_db_option ::= CACHESIZE NK_INTEGER */ + 395, /* (134) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ + 395, /* (135) alter_db_option ::= KEEP integer_list */ + 395, /* (136) alter_db_option ::= KEEP variable_list */ + 395, /* (137) alter_db_option ::= PAGES NK_INTEGER */ + 395, /* (138) alter_db_option ::= REPLICA NK_INTEGER */ + 395, /* (139) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + 395, /* (140) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + 395, /* (141) alter_db_option ::= MINROWS NK_INTEGER */ + 395, /* (142) alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ + 395, /* (143) alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ + 395, /* (144) alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ + 395, /* (145) alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ + 395, /* (146) alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ + 391, /* (147) integer_list ::= NK_INTEGER */ + 391, /* (148) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + 392, /* (149) variable_list ::= NK_VARIABLE */ + 392, /* (150) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + 393, /* (151) retention_list ::= retention */ + 393, /* (152) retention_list ::= retention_list NK_COMMA retention */ + 396, /* (153) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + 396, /* (154) retention ::= NK_MINUS NK_COLON NK_VARIABLE */ + 388, /* (155) speed_opt ::= */ + 388, /* (156) speed_opt ::= BWLIMIT NK_INTEGER */ + 389, /* (157) start_opt ::= */ + 389, /* (158) start_opt ::= START WITH NK_INTEGER */ + 389, /* (159) start_opt ::= START WITH NK_STRING */ + 389, /* (160) start_opt ::= START WITH TIMESTAMP NK_STRING */ + 390, /* (161) end_opt ::= */ + 390, /* (162) end_opt ::= END WITH NK_INTEGER */ + 390, /* (163) end_opt ::= END WITH NK_STRING */ + 390, /* (164) end_opt ::= END WITH TIMESTAMP NK_STRING */ + 362, /* (165) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + 362, /* (166) cmd ::= CREATE TABLE multi_create_clause */ + 362, /* (167) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + 362, /* (168) cmd ::= DROP TABLE multi_drop_clause */ + 362, /* (169) cmd ::= DROP STABLE exists_opt full_table_name */ + 362, /* (170) cmd ::= ALTER TABLE alter_table_clause */ + 362, /* (171) cmd ::= ALTER STABLE alter_table_clause */ + 404, /* (172) alter_table_clause ::= full_table_name alter_table_options */ + 404, /* (173) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + 404, /* (174) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + 404, /* (175) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + 404, /* (176) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + 404, /* (177) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + 404, /* (178) alter_table_clause ::= full_table_name DROP TAG column_name */ + 404, /* (179) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + 404, /* (180) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + 404, /* (181) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ + 401, /* (182) multi_create_clause ::= create_subtable_clause */ + 401, /* (183) multi_create_clause ::= multi_create_clause create_subtable_clause */ + 409, /* (184) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ + 403, /* (185) multi_drop_clause ::= drop_table_clause */ + 403, /* (186) multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ + 412, /* (187) drop_table_clause ::= exists_opt full_table_name */ + 410, /* (188) specific_cols_opt ::= */ + 410, /* (189) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + 397, /* (190) full_table_name ::= table_name */ + 397, /* (191) full_table_name ::= db_name NK_DOT table_name */ + 398, /* (192) column_def_list ::= column_def */ + 398, /* (193) column_def_list ::= column_def_list NK_COMMA column_def */ + 414, /* (194) column_def ::= column_name type_name */ + 407, /* (195) type_name ::= BOOL */ + 407, /* (196) type_name ::= TINYINT */ + 407, /* (197) type_name ::= SMALLINT */ + 407, /* (198) type_name ::= INT */ + 407, /* (199) type_name ::= INTEGER */ + 407, /* (200) type_name ::= BIGINT */ + 407, /* (201) type_name ::= FLOAT */ + 407, /* (202) type_name ::= DOUBLE */ + 407, /* (203) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + 407, /* (204) type_name ::= TIMESTAMP */ + 407, /* (205) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + 407, /* (206) type_name ::= TINYINT UNSIGNED */ + 407, /* (207) type_name ::= SMALLINT UNSIGNED */ + 407, /* (208) type_name ::= INT UNSIGNED */ + 407, /* (209) type_name ::= BIGINT UNSIGNED */ + 407, /* (210) type_name ::= JSON */ + 407, /* (211) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + 407, /* (212) type_name ::= MEDIUMBLOB */ + 407, /* (213) type_name ::= BLOB */ + 407, /* (214) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + 407, /* (215) type_name ::= GEOMETRY NK_LP NK_INTEGER NK_RP */ + 407, /* (216) type_name ::= DECIMAL */ + 407, /* (217) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + 407, /* (218) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 399, /* (219) tags_def_opt ::= */ + 399, /* (220) tags_def_opt ::= tags_def */ + 402, /* (221) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + 400, /* (222) table_options ::= */ + 400, /* (223) table_options ::= table_options COMMENT NK_STRING */ + 400, /* (224) table_options ::= table_options MAX_DELAY duration_list */ + 400, /* (225) table_options ::= table_options WATERMARK duration_list */ + 400, /* (226) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + 400, /* (227) table_options ::= table_options TTL NK_INTEGER */ + 400, /* (228) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + 400, /* (229) table_options ::= table_options DELETE_MARK duration_list */ + 405, /* (230) alter_table_options ::= alter_table_option */ + 405, /* (231) alter_table_options ::= alter_table_options alter_table_option */ + 417, /* (232) alter_table_option ::= COMMENT NK_STRING */ + 417, /* (233) alter_table_option ::= TTL NK_INTEGER */ + 415, /* (234) duration_list ::= duration_literal */ + 415, /* (235) duration_list ::= duration_list NK_COMMA duration_literal */ + 416, /* (236) rollup_func_list ::= rollup_func_name */ + 416, /* (237) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + 419, /* (238) rollup_func_name ::= function_name */ + 419, /* (239) rollup_func_name ::= FIRST */ + 419, /* (240) rollup_func_name ::= LAST */ + 413, /* (241) col_name_list ::= col_name */ + 413, /* (242) col_name_list ::= col_name_list NK_COMMA col_name */ + 421, /* (243) col_name ::= column_name */ + 362, /* (244) cmd ::= SHOW DNODES */ + 362, /* (245) cmd ::= SHOW USERS */ + 362, /* (246) cmd ::= SHOW USER PRIVILEGES */ + 362, /* (247) cmd ::= SHOW db_kind_opt DATABASES */ + 362, /* (248) cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ + 362, /* (249) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + 362, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ + 362, /* (251) cmd ::= SHOW MNODES */ + 362, /* (252) cmd ::= SHOW QNODES */ + 362, /* (253) cmd ::= SHOW ARBGROUPS */ + 362, /* (254) cmd ::= SHOW FUNCTIONS */ + 362, /* (255) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + 362, /* (256) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + 362, /* (257) cmd ::= SHOW STREAMS */ + 362, /* (258) cmd ::= SHOW ACCOUNTS */ + 362, /* (259) cmd ::= SHOW APPS */ + 362, /* (260) cmd ::= SHOW CONNECTIONS */ + 362, /* (261) cmd ::= SHOW LICENCES */ + 362, /* (262) cmd ::= SHOW GRANTS */ + 362, /* (263) cmd ::= SHOW GRANTS FULL */ + 362, /* (264) cmd ::= SHOW GRANTS LOGS */ + 362, /* (265) cmd ::= SHOW CLUSTER MACHINES */ + 362, /* (266) cmd ::= SHOW CREATE DATABASE db_name */ + 362, /* (267) cmd ::= SHOW CREATE TABLE full_table_name */ + 362, /* (268) cmd ::= SHOW CREATE STABLE full_table_name */ + 362, /* (269) cmd ::= SHOW QUERIES */ + 362, /* (270) cmd ::= SHOW SCORES */ + 362, /* (271) cmd ::= SHOW TOPICS */ + 362, /* (272) cmd ::= SHOW VARIABLES */ + 362, /* (273) cmd ::= SHOW CLUSTER VARIABLES */ + 362, /* (274) cmd ::= SHOW LOCAL VARIABLES */ + 362, /* (275) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + 362, /* (276) cmd ::= SHOW BNODES */ + 362, /* (277) cmd ::= SHOW SNODES */ + 362, /* (278) cmd ::= SHOW CLUSTER */ + 362, /* (279) cmd ::= SHOW TRANSACTIONS */ + 362, /* (280) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + 362, /* (281) cmd ::= SHOW CONSUMERS */ + 362, /* (282) cmd ::= SHOW SUBSCRIPTIONS */ + 362, /* (283) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + 362, /* (284) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + 362, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + 362, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + 362, /* (287) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + 362, /* (288) cmd ::= SHOW VNODES */ + 362, /* (289) cmd ::= SHOW db_name_cond_opt ALIVE */ + 362, /* (290) cmd ::= SHOW CLUSTER ALIVE */ + 362, /* (291) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + 362, /* (292) cmd ::= SHOW CREATE VIEW full_table_name */ + 362, /* (293) cmd ::= SHOW COMPACTS */ + 362, /* (294) cmd ::= SHOW COMPACT NK_INTEGER */ + 423, /* (295) table_kind_db_name_cond_opt ::= */ + 423, /* (296) table_kind_db_name_cond_opt ::= table_kind */ + 423, /* (297) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + 423, /* (298) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + 429, /* (299) table_kind ::= NORMAL */ + 429, /* (300) table_kind ::= CHILD */ + 425, /* (301) db_name_cond_opt ::= */ + 425, /* (302) db_name_cond_opt ::= db_name NK_DOT */ + 424, /* (303) like_pattern_opt ::= */ + 424, /* (304) like_pattern_opt ::= LIKE NK_STRING */ + 426, /* (305) table_name_cond ::= table_name */ + 427, /* (306) from_db_opt ::= */ + 427, /* (307) from_db_opt ::= FROM db_name */ + 428, /* (308) tag_list_opt ::= */ + 428, /* (309) tag_list_opt ::= tag_item */ + 428, /* (310) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + 430, /* (311) tag_item ::= TBNAME */ + 430, /* (312) tag_item ::= QTAGS */ + 430, /* (313) tag_item ::= column_name */ + 430, /* (314) tag_item ::= column_name column_alias */ + 430, /* (315) tag_item ::= column_name AS column_alias */ + 422, /* (316) db_kind_opt ::= */ + 422, /* (317) db_kind_opt ::= USER */ + 422, /* (318) db_kind_opt ::= SYSTEM */ + 362, /* (319) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + 362, /* (320) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + 362, /* (321) cmd ::= DROP INDEX exists_opt full_index_name */ + 433, /* (322) full_index_name ::= index_name */ + 433, /* (323) full_index_name ::= db_name NK_DOT index_name */ + 432, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + 432, /* (325) 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 */ + 435, /* (326) func_list ::= func */ + 435, /* (327) func_list ::= func_list NK_COMMA func */ + 438, /* (328) func ::= sma_func_name NK_LP expression_list NK_RP */ + 439, /* (329) sma_func_name ::= function_name */ + 439, /* (330) sma_func_name ::= COUNT */ + 439, /* (331) sma_func_name ::= FIRST */ + 439, /* (332) sma_func_name ::= LAST */ + 439, /* (333) sma_func_name ::= LAST_ROW */ + 437, /* (334) sma_stream_opt ::= */ + 437, /* (335) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + 437, /* (336) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + 437, /* (337) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + 441, /* (338) with_meta ::= AS */ + 441, /* (339) with_meta ::= WITH META AS */ + 441, /* (340) with_meta ::= ONLY META AS */ + 362, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + 362, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + 362, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + 362, /* (344) cmd ::= DROP TOPIC exists_opt topic_name */ + 362, /* (345) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + 362, /* (346) cmd ::= DESC full_table_name */ + 362, /* (347) cmd ::= DESCRIBE full_table_name */ + 362, /* (348) cmd ::= RESET QUERY CACHE */ + 362, /* (349) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + 362, /* (350) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 445, /* (351) analyze_opt ::= */ + 445, /* (352) analyze_opt ::= ANALYZE */ + 446, /* (353) explain_options ::= */ + 446, /* (354) explain_options ::= explain_options VERBOSE NK_BOOL */ + 446, /* (355) explain_options ::= explain_options RATIO NK_FLOAT */ + 362, /* (356) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + 362, /* (357) cmd ::= DROP FUNCTION exists_opt function_name */ + 449, /* (358) agg_func_opt ::= */ + 449, /* (359) agg_func_opt ::= AGGREGATE */ + 450, /* (360) bufsize_opt ::= */ + 450, /* (361) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 451, /* (362) language_opt ::= */ + 451, /* (363) language_opt ::= LANGUAGE NK_STRING */ + 448, /* (364) or_replace_opt ::= */ + 448, /* (365) or_replace_opt ::= OR REPLACE */ + 362, /* (366) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + 362, /* (367) cmd ::= DROP VIEW exists_opt full_view_name */ + 452, /* (368) full_view_name ::= view_name */ + 452, /* (369) full_view_name ::= db_name NK_DOT view_name */ + 362, /* (370) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + 362, /* (371) cmd ::= DROP STREAM exists_opt stream_name */ + 362, /* (372) cmd ::= PAUSE STREAM exists_opt stream_name */ + 362, /* (373) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 456, /* (374) col_list_opt ::= */ + 456, /* (375) col_list_opt ::= NK_LP col_name_list NK_RP */ + 457, /* (376) tag_def_or_ref_opt ::= */ + 457, /* (377) tag_def_or_ref_opt ::= tags_def */ + 457, /* (378) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 455, /* (379) stream_options ::= */ + 455, /* (380) stream_options ::= stream_options TRIGGER AT_ONCE */ + 455, /* (381) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + 455, /* (382) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + 455, /* (383) stream_options ::= stream_options WATERMARK duration_literal */ + 455, /* (384) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + 455, /* (385) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + 455, /* (386) stream_options ::= stream_options DELETE_MARK duration_literal */ + 455, /* (387) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 458, /* (388) subtable_opt ::= */ + 458, /* (389) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 459, /* (390) ignore_opt ::= */ + 459, /* (391) ignore_opt ::= IGNORE UNTREATED */ + 362, /* (392) cmd ::= KILL CONNECTION NK_INTEGER */ + 362, /* (393) cmd ::= KILL QUERY NK_STRING */ + 362, /* (394) cmd ::= KILL TRANSACTION NK_INTEGER */ + 362, /* (395) cmd ::= KILL COMPACT NK_INTEGER */ + 362, /* (396) cmd ::= BALANCE VGROUP */ + 362, /* (397) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + 362, /* (398) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + 362, /* (399) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + 362, /* (400) cmd ::= SPLIT VGROUP NK_INTEGER */ + 461, /* (401) on_vgroup_id ::= */ + 461, /* (402) on_vgroup_id ::= ON NK_INTEGER */ + 462, /* (403) dnode_list ::= DNODE NK_INTEGER */ + 462, /* (404) dnode_list ::= dnode_list DNODE NK_INTEGER */ + 362, /* (405) cmd ::= DELETE FROM full_table_name where_clause_opt */ + 362, /* (406) cmd ::= query_or_subquery */ + 362, /* (407) cmd ::= insert_query */ + 447, /* (408) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + 447, /* (409) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + 408, /* (410) tags_literal ::= NK_INTEGER */ + 408, /* (411) tags_literal ::= NK_PLUS NK_INTEGER */ + 408, /* (412) tags_literal ::= NK_MINUS NK_INTEGER */ + 408, /* (413) tags_literal ::= NK_FLOAT */ + 408, /* (414) tags_literal ::= NK_PLUS NK_FLOAT */ + 408, /* (415) tags_literal ::= NK_MINUS NK_FLOAT */ + 408, /* (416) tags_literal ::= NK_BIN */ + 408, /* (417) tags_literal ::= NK_PLUS NK_BIN */ + 408, /* (418) tags_literal ::= NK_MINUS NK_BIN */ + 408, /* (419) tags_literal ::= NK_HEX */ + 408, /* (420) tags_literal ::= NK_PLUS NK_HEX */ + 408, /* (421) tags_literal ::= NK_MINUS NK_HEX */ + 408, /* (422) tags_literal ::= NK_STRING */ + 408, /* (423) tags_literal ::= NK_BOOL */ + 408, /* (424) tags_literal ::= NULL */ + 408, /* (425) tags_literal ::= literal_func */ + 408, /* (426) tags_literal ::= literal_func NK_PLUS duration_literal */ + 408, /* (427) tags_literal ::= literal_func NK_MINUS duration_literal */ + 411, /* (428) tags_literal_list ::= tags_literal */ + 411, /* (429) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + 365, /* (430) literal ::= NK_INTEGER */ + 365, /* (431) literal ::= NK_FLOAT */ + 365, /* (432) literal ::= NK_STRING */ + 365, /* (433) literal ::= NK_BOOL */ + 365, /* (434) literal ::= TIMESTAMP NK_STRING */ + 365, /* (435) literal ::= duration_literal */ + 365, /* (436) literal ::= NULL */ + 365, /* (437) literal ::= NK_QUESTION */ + 418, /* (438) duration_literal ::= NK_VARIABLE */ + 394, /* (439) signed ::= NK_INTEGER */ + 394, /* (440) signed ::= NK_PLUS NK_INTEGER */ + 394, /* (441) signed ::= NK_MINUS NK_INTEGER */ + 394, /* (442) signed ::= NK_FLOAT */ + 394, /* (443) signed ::= NK_PLUS NK_FLOAT */ + 394, /* (444) signed ::= NK_MINUS NK_FLOAT */ + 464, /* (445) signed_literal ::= signed */ + 464, /* (446) signed_literal ::= NK_STRING */ + 464, /* (447) signed_literal ::= NK_BOOL */ + 464, /* (448) signed_literal ::= TIMESTAMP NK_STRING */ + 464, /* (449) signed_literal ::= duration_literal */ + 464, /* (450) signed_literal ::= NULL */ + 464, /* (451) signed_literal ::= literal_func */ + 464, /* (452) signed_literal ::= NK_QUESTION */ + 465, /* (453) literal_list ::= signed_literal */ + 465, /* (454) literal_list ::= literal_list NK_COMMA signed_literal */ + 377, /* (455) db_name ::= NK_ID */ + 378, /* (456) table_name ::= NK_ID */ + 406, /* (457) column_name ::= NK_ID */ + 420, /* (458) function_name ::= NK_ID */ + 453, /* (459) view_name ::= NK_ID */ + 466, /* (460) table_alias ::= NK_ID */ + 431, /* (461) column_alias ::= NK_ID */ + 431, /* (462) column_alias ::= NK_ALIAS */ + 370, /* (463) user_name ::= NK_ID */ + 379, /* (464) topic_name ::= NK_ID */ + 454, /* (465) stream_name ::= NK_ID */ + 444, /* (466) cgroup_name ::= NK_ID */ + 434, /* (467) index_name ::= NK_ID */ + 467, /* (468) expr_or_subquery ::= expression */ + 460, /* (469) expression ::= literal */ + 460, /* (470) expression ::= pseudo_column */ + 460, /* (471) expression ::= column_reference */ + 460, /* (472) expression ::= function_expression */ + 460, /* (473) expression ::= case_when_expression */ + 460, /* (474) expression ::= NK_LP expression NK_RP */ + 460, /* (475) expression ::= NK_PLUS expr_or_subquery */ + 460, /* (476) expression ::= NK_MINUS expr_or_subquery */ + 460, /* (477) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + 460, /* (478) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + 460, /* (479) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + 460, /* (480) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + 460, /* (481) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + 460, /* (482) expression ::= column_reference NK_ARROW NK_STRING */ + 460, /* (483) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + 460, /* (484) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + 440, /* (485) expression_list ::= expr_or_subquery */ + 440, /* (486) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + 469, /* (487) column_reference ::= column_name */ + 469, /* (488) column_reference ::= table_name NK_DOT column_name */ + 469, /* (489) column_reference ::= NK_ALIAS */ + 469, /* (490) column_reference ::= table_name NK_DOT NK_ALIAS */ + 468, /* (491) pseudo_column ::= ROWTS */ + 468, /* (492) pseudo_column ::= TBNAME */ + 468, /* (493) pseudo_column ::= table_name NK_DOT TBNAME */ + 468, /* (494) pseudo_column ::= QSTART */ + 468, /* (495) pseudo_column ::= QEND */ + 468, /* (496) pseudo_column ::= QDURATION */ + 468, /* (497) pseudo_column ::= WSTART */ + 468, /* (498) pseudo_column ::= WEND */ + 468, /* (499) pseudo_column ::= WDURATION */ + 468, /* (500) pseudo_column ::= IROWTS */ + 468, /* (501) pseudo_column ::= ISFILLED */ + 468, /* (502) pseudo_column ::= QTAGS */ + 470, /* (503) function_expression ::= function_name NK_LP expression_list NK_RP */ + 470, /* (504) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + 470, /* (505) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + 470, /* (506) function_expression ::= literal_func */ + 463, /* (507) literal_func ::= noarg_func NK_LP NK_RP */ + 463, /* (508) literal_func ::= NOW */ + 463, /* (509) literal_func ::= TODAY */ + 474, /* (510) noarg_func ::= NOW */ + 474, /* (511) noarg_func ::= TODAY */ + 474, /* (512) noarg_func ::= TIMEZONE */ + 474, /* (513) noarg_func ::= DATABASE */ + 474, /* (514) noarg_func ::= CLIENT_VERSION */ + 474, /* (515) noarg_func ::= SERVER_VERSION */ + 474, /* (516) noarg_func ::= SERVER_STATUS */ + 474, /* (517) noarg_func ::= CURRENT_USER */ + 474, /* (518) noarg_func ::= USER */ + 472, /* (519) star_func ::= COUNT */ + 472, /* (520) star_func ::= FIRST */ + 472, /* (521) star_func ::= LAST */ + 472, /* (522) star_func ::= LAST_ROW */ + 473, /* (523) star_func_para_list ::= NK_STAR */ + 473, /* (524) star_func_para_list ::= other_para_list */ + 475, /* (525) other_para_list ::= star_func_para */ + 475, /* (526) other_para_list ::= other_para_list NK_COMMA star_func_para */ + 476, /* (527) star_func_para ::= expr_or_subquery */ + 476, /* (528) star_func_para ::= table_name NK_DOT NK_STAR */ + 471, /* (529) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + 471, /* (530) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + 477, /* (531) when_then_list ::= when_then_expr */ + 477, /* (532) when_then_list ::= when_then_list when_then_expr */ + 480, /* (533) when_then_expr ::= WHEN common_expression THEN common_expression */ + 478, /* (534) case_when_else_opt ::= */ + 478, /* (535) case_when_else_opt ::= ELSE common_expression */ + 481, /* (536) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + 481, /* (537) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + 481, /* (538) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + 481, /* (539) predicate ::= expr_or_subquery IS NULL */ + 481, /* (540) predicate ::= expr_or_subquery IS NOT NULL */ + 481, /* (541) predicate ::= expr_or_subquery in_op in_predicate_value */ + 482, /* (542) compare_op ::= NK_LT */ + 482, /* (543) compare_op ::= NK_GT */ + 482, /* (544) compare_op ::= NK_LE */ + 482, /* (545) compare_op ::= NK_GE */ + 482, /* (546) compare_op ::= NK_NE */ + 482, /* (547) compare_op ::= NK_EQ */ + 482, /* (548) compare_op ::= LIKE */ + 482, /* (549) compare_op ::= NOT LIKE */ + 482, /* (550) compare_op ::= MATCH */ + 482, /* (551) compare_op ::= NMATCH */ + 482, /* (552) compare_op ::= CONTAINS */ + 483, /* (553) in_op ::= IN */ + 483, /* (554) in_op ::= NOT IN */ + 484, /* (555) in_predicate_value ::= NK_LP literal_list NK_RP */ + 485, /* (556) boolean_value_expression ::= boolean_primary */ + 485, /* (557) boolean_value_expression ::= NOT boolean_primary */ + 485, /* (558) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + 485, /* (559) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + 486, /* (560) boolean_primary ::= predicate */ + 486, /* (561) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + 479, /* (562) common_expression ::= expr_or_subquery */ + 479, /* (563) common_expression ::= boolean_value_expression */ + 487, /* (564) from_clause_opt ::= */ + 487, /* (565) from_clause_opt ::= FROM table_reference_list */ + 488, /* (566) table_reference_list ::= table_reference */ + 488, /* (567) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + 489, /* (568) table_reference ::= table_primary */ + 489, /* (569) table_reference ::= joined_table */ + 490, /* (570) table_primary ::= table_name alias_opt */ + 490, /* (571) table_primary ::= db_name NK_DOT table_name alias_opt */ + 490, /* (572) table_primary ::= subquery alias_opt */ + 490, /* (573) table_primary ::= parenthesized_joined_table */ + 492, /* (574) alias_opt ::= */ + 492, /* (575) alias_opt ::= table_alias */ + 492, /* (576) alias_opt ::= AS table_alias */ + 494, /* (577) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + 494, /* (578) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + 491, /* (579) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 495, /* (580) join_type ::= */ + 495, /* (581) join_type ::= INNER */ + 495, /* (582) join_type ::= LEFT */ + 495, /* (583) join_type ::= RIGHT */ + 495, /* (584) join_type ::= FULL */ + 496, /* (585) join_subtype ::= */ + 496, /* (586) join_subtype ::= OUTER */ + 496, /* (587) join_subtype ::= SEMI */ + 496, /* (588) join_subtype ::= ANTI */ + 496, /* (589) join_subtype ::= ASOF */ + 496, /* (590) join_subtype ::= WINDOW */ + 497, /* (591) join_on_clause_opt ::= */ + 497, /* (592) join_on_clause_opt ::= ON search_condition */ + 498, /* (593) window_offset_clause_opt ::= */ + 498, /* (594) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + 500, /* (595) window_offset_literal ::= NK_VARIABLE */ + 500, /* (596) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 499, /* (597) jlimit_clause_opt ::= */ + 499, /* (598) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + 501, /* (599) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 502, /* (600) hint_list ::= */ + 502, /* (601) hint_list ::= NK_HINT */ + 504, /* (602) tag_mode_opt ::= */ + 504, /* (603) tag_mode_opt ::= TAGS */ + 503, /* (604) set_quantifier_opt ::= */ + 503, /* (605) set_quantifier_opt ::= DISTINCT */ + 503, /* (606) set_quantifier_opt ::= ALL */ + 505, /* (607) select_list ::= select_item */ + 505, /* (608) select_list ::= select_list NK_COMMA select_item */ + 513, /* (609) select_item ::= NK_STAR */ + 513, /* (610) select_item ::= common_expression */ + 513, /* (611) select_item ::= common_expression column_alias */ + 513, /* (612) select_item ::= common_expression AS column_alias */ + 513, /* (613) select_item ::= table_name NK_DOT NK_STAR */ + 443, /* (614) where_clause_opt ::= */ + 443, /* (615) where_clause_opt ::= WHERE search_condition */ + 506, /* (616) partition_by_clause_opt ::= */ + 506, /* (617) partition_by_clause_opt ::= PARTITION BY partition_list */ + 514, /* (618) partition_list ::= partition_item */ + 514, /* (619) partition_list ::= partition_list NK_COMMA partition_item */ + 515, /* (620) partition_item ::= expr_or_subquery */ + 515, /* (621) partition_item ::= expr_or_subquery column_alias */ + 515, /* (622) partition_item ::= expr_or_subquery AS column_alias */ + 510, /* (623) twindow_clause_opt ::= */ + 510, /* (624) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + 510, /* (625) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + 510, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 510, /* (627) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + 510, /* (628) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + 510, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + 510, /* (630) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 436, /* (631) sliding_opt ::= */ + 436, /* (632) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + 516, /* (633) interval_sliding_duration_literal ::= NK_VARIABLE */ + 516, /* (634) interval_sliding_duration_literal ::= NK_STRING */ + 516, /* (635) interval_sliding_duration_literal ::= NK_INTEGER */ + 509, /* (636) fill_opt ::= */ + 509, /* (637) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + 509, /* (638) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + 509, /* (639) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + 517, /* (640) fill_mode ::= NONE */ + 517, /* (641) fill_mode ::= PREV */ + 517, /* (642) fill_mode ::= NULL */ + 517, /* (643) fill_mode ::= NULL_F */ + 517, /* (644) fill_mode ::= LINEAR */ + 517, /* (645) fill_mode ::= NEXT */ + 511, /* (646) group_by_clause_opt ::= */ + 511, /* (647) group_by_clause_opt ::= GROUP BY group_by_list */ + 518, /* (648) group_by_list ::= expr_or_subquery */ + 518, /* (649) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 512, /* (650) having_clause_opt ::= */ + 512, /* (651) having_clause_opt ::= HAVING search_condition */ + 507, /* (652) range_opt ::= */ + 507, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + 507, /* (654) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 508, /* (655) every_opt ::= */ + 508, /* (656) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + 519, /* (657) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + 520, /* (658) query_simple ::= query_specification */ + 520, /* (659) query_simple ::= union_query_expression */ + 524, /* (660) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + 524, /* (661) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + 525, /* (662) query_simple_or_subquery ::= query_simple */ + 525, /* (663) query_simple_or_subquery ::= subquery */ + 442, /* (664) query_or_subquery ::= query_expression */ + 442, /* (665) query_or_subquery ::= subquery */ + 521, /* (666) order_by_clause_opt ::= */ + 521, /* (667) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 522, /* (668) slimit_clause_opt ::= */ + 522, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + 522, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + 522, /* (671) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 523, /* (672) limit_clause_opt ::= */ + 523, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER */ + 523, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + 523, /* (675) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 493, /* (676) subquery ::= NK_LP query_expression NK_RP */ + 493, /* (677) subquery ::= NK_LP subquery NK_RP */ + 380, /* (678) search_condition ::= common_expression */ + 526, /* (679) sort_specification_list ::= sort_specification */ + 526, /* (680) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + 527, /* (681) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 528, /* (682) ordering_specification_opt ::= */ + 528, /* (683) ordering_specification_opt ::= ASC */ + 528, /* (684) ordering_specification_opt ::= DESC */ + 529, /* (685) null_ordering_opt ::= */ + 529, /* (686) null_ordering_opt ::= NULLS FIRST */ + 529, /* (687) null_ordering_opt ::= NULLS LAST */ }; /* For rule J, yyRuleInfoNRhs[J] contains the negative of the number @@ -4421,440 +4399,441 @@ static const signed char yyRuleInfoNRhs[] = { -3, /* (250) cmd ::= SHOW db_name_cond_opt VGROUPS */ -2, /* (251) cmd ::= SHOW MNODES */ -2, /* (252) cmd ::= SHOW QNODES */ - -2, /* (253) cmd ::= SHOW FUNCTIONS */ - -5, /* (254) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - -6, /* (255) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ - -2, /* (256) cmd ::= SHOW STREAMS */ - -2, /* (257) cmd ::= SHOW ACCOUNTS */ - -2, /* (258) cmd ::= SHOW APPS */ - -2, /* (259) cmd ::= SHOW CONNECTIONS */ - -2, /* (260) cmd ::= SHOW LICENCES */ - -2, /* (261) cmd ::= SHOW GRANTS */ - -3, /* (262) cmd ::= SHOW GRANTS FULL */ - -3, /* (263) cmd ::= SHOW GRANTS LOGS */ - -3, /* (264) cmd ::= SHOW CLUSTER MACHINES */ - -4, /* (265) cmd ::= SHOW CREATE DATABASE db_name */ - -4, /* (266) cmd ::= SHOW CREATE TABLE full_table_name */ - -4, /* (267) cmd ::= SHOW CREATE STABLE full_table_name */ - -2, /* (268) cmd ::= SHOW QUERIES */ - -2, /* (269) cmd ::= SHOW SCORES */ - -2, /* (270) cmd ::= SHOW TOPICS */ - -2, /* (271) cmd ::= SHOW VARIABLES */ - -3, /* (272) cmd ::= SHOW CLUSTER VARIABLES */ - -3, /* (273) cmd ::= SHOW LOCAL VARIABLES */ - -5, /* (274) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ - -2, /* (275) cmd ::= SHOW BNODES */ - -2, /* (276) cmd ::= SHOW SNODES */ - -2, /* (277) cmd ::= SHOW CLUSTER */ - -2, /* (278) cmd ::= SHOW TRANSACTIONS */ - -4, /* (279) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - -2, /* (280) cmd ::= SHOW CONSUMERS */ - -2, /* (281) cmd ::= SHOW SUBSCRIPTIONS */ - -5, /* (282) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - -6, /* (283) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ - -7, /* (284) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ - -8, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ - -5, /* (286) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ - -2, /* (287) cmd ::= SHOW VNODES */ - -3, /* (288) cmd ::= SHOW db_name_cond_opt ALIVE */ - -3, /* (289) cmd ::= SHOW CLUSTER ALIVE */ - -4, /* (290) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ - -4, /* (291) cmd ::= SHOW CREATE VIEW full_table_name */ - -2, /* (292) cmd ::= SHOW COMPACTS */ - -3, /* (293) cmd ::= SHOW COMPACT NK_INTEGER */ - 0, /* (294) table_kind_db_name_cond_opt ::= */ - -1, /* (295) table_kind_db_name_cond_opt ::= table_kind */ - -2, /* (296) table_kind_db_name_cond_opt ::= db_name NK_DOT */ - -3, /* (297) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ - -1, /* (298) table_kind ::= NORMAL */ - -1, /* (299) table_kind ::= CHILD */ - 0, /* (300) db_name_cond_opt ::= */ - -2, /* (301) db_name_cond_opt ::= db_name NK_DOT */ - 0, /* (302) like_pattern_opt ::= */ - -2, /* (303) like_pattern_opt ::= LIKE NK_STRING */ - -1, /* (304) table_name_cond ::= table_name */ - 0, /* (305) from_db_opt ::= */ - -2, /* (306) from_db_opt ::= FROM db_name */ - 0, /* (307) tag_list_opt ::= */ - -1, /* (308) tag_list_opt ::= tag_item */ - -3, /* (309) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ - -1, /* (310) tag_item ::= TBNAME */ - -1, /* (311) tag_item ::= QTAGS */ - -1, /* (312) tag_item ::= column_name */ - -2, /* (313) tag_item ::= column_name column_alias */ - -3, /* (314) tag_item ::= column_name AS column_alias */ - 0, /* (315) db_kind_opt ::= */ - -1, /* (316) db_kind_opt ::= USER */ - -1, /* (317) db_kind_opt ::= SYSTEM */ - -8, /* (318) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ - -9, /* (319) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ - -4, /* (320) cmd ::= DROP INDEX exists_opt full_index_name */ - -1, /* (321) full_index_name ::= index_name */ - -3, /* (322) full_index_name ::= db_name NK_DOT index_name */ - -10, /* (323) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - -12, /* (324) 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 */ - -1, /* (325) func_list ::= func */ - -3, /* (326) func_list ::= func_list NK_COMMA func */ - -4, /* (327) func ::= sma_func_name NK_LP expression_list NK_RP */ - -1, /* (328) sma_func_name ::= function_name */ - -1, /* (329) sma_func_name ::= COUNT */ - -1, /* (330) sma_func_name ::= FIRST */ - -1, /* (331) sma_func_name ::= LAST */ - -1, /* (332) sma_func_name ::= LAST_ROW */ - 0, /* (333) sma_stream_opt ::= */ - -3, /* (334) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - -3, /* (335) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ - -3, /* (336) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ - -1, /* (337) with_meta ::= AS */ - -3, /* (338) with_meta ::= WITH META AS */ - -3, /* (339) with_meta ::= ONLY META AS */ - -6, /* (340) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - -7, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ - -8, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ - -4, /* (343) cmd ::= DROP TOPIC exists_opt topic_name */ - -7, /* (344) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - -2, /* (345) cmd ::= DESC full_table_name */ - -2, /* (346) cmd ::= DESCRIBE full_table_name */ - -3, /* (347) cmd ::= RESET QUERY CACHE */ - -4, /* (348) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - -4, /* (349) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ - 0, /* (350) analyze_opt ::= */ - -1, /* (351) analyze_opt ::= ANALYZE */ - 0, /* (352) explain_options ::= */ - -3, /* (353) explain_options ::= explain_options VERBOSE NK_BOOL */ - -3, /* (354) explain_options ::= explain_options RATIO NK_FLOAT */ - -12, /* (355) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ - -4, /* (356) cmd ::= DROP FUNCTION exists_opt function_name */ - 0, /* (357) agg_func_opt ::= */ - -1, /* (358) agg_func_opt ::= AGGREGATE */ - 0, /* (359) bufsize_opt ::= */ - -2, /* (360) bufsize_opt ::= BUFSIZE NK_INTEGER */ - 0, /* (361) language_opt ::= */ - -2, /* (362) language_opt ::= LANGUAGE NK_STRING */ - 0, /* (363) or_replace_opt ::= */ - -2, /* (364) or_replace_opt ::= OR REPLACE */ - -6, /* (365) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ - -4, /* (366) cmd ::= DROP VIEW exists_opt full_view_name */ - -1, /* (367) full_view_name ::= view_name */ - -3, /* (368) full_view_name ::= db_name NK_DOT view_name */ - -12, /* (369) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ - -4, /* (370) cmd ::= DROP STREAM exists_opt stream_name */ - -4, /* (371) cmd ::= PAUSE STREAM exists_opt stream_name */ - -5, /* (372) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ - 0, /* (373) col_list_opt ::= */ - -3, /* (374) col_list_opt ::= NK_LP col_name_list NK_RP */ - 0, /* (375) tag_def_or_ref_opt ::= */ - -1, /* (376) tag_def_or_ref_opt ::= tags_def */ - -4, /* (377) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ - 0, /* (378) stream_options ::= */ - -3, /* (379) stream_options ::= stream_options TRIGGER AT_ONCE */ - -3, /* (380) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - -4, /* (381) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - -3, /* (382) stream_options ::= stream_options WATERMARK duration_literal */ - -4, /* (383) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - -3, /* (384) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - -3, /* (385) stream_options ::= stream_options DELETE_MARK duration_literal */ - -4, /* (386) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ - 0, /* (387) subtable_opt ::= */ - -4, /* (388) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - 0, /* (389) ignore_opt ::= */ - -2, /* (390) ignore_opt ::= IGNORE UNTREATED */ - -3, /* (391) cmd ::= KILL CONNECTION NK_INTEGER */ - -3, /* (392) cmd ::= KILL QUERY NK_STRING */ - -3, /* (393) cmd ::= KILL TRANSACTION NK_INTEGER */ - -3, /* (394) cmd ::= KILL COMPACT NK_INTEGER */ - -2, /* (395) cmd ::= BALANCE VGROUP */ - -4, /* (396) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ - -4, /* (397) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - -4, /* (398) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - -3, /* (399) cmd ::= SPLIT VGROUP NK_INTEGER */ - 0, /* (400) on_vgroup_id ::= */ - -2, /* (401) on_vgroup_id ::= ON NK_INTEGER */ - -2, /* (402) dnode_list ::= DNODE NK_INTEGER */ - -3, /* (403) dnode_list ::= dnode_list DNODE NK_INTEGER */ - -4, /* (404) cmd ::= DELETE FROM full_table_name where_clause_opt */ - -1, /* (405) cmd ::= query_or_subquery */ - -1, /* (406) cmd ::= insert_query */ - -7, /* (407) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - -4, /* (408) insert_query ::= INSERT INTO full_table_name query_or_subquery */ - -1, /* (409) tags_literal ::= NK_INTEGER */ - -2, /* (410) tags_literal ::= NK_PLUS NK_INTEGER */ - -2, /* (411) tags_literal ::= NK_MINUS NK_INTEGER */ - -1, /* (412) tags_literal ::= NK_FLOAT */ - -2, /* (413) tags_literal ::= NK_PLUS NK_FLOAT */ - -2, /* (414) tags_literal ::= NK_MINUS NK_FLOAT */ - -1, /* (415) tags_literal ::= NK_BIN */ - -2, /* (416) tags_literal ::= NK_PLUS NK_BIN */ - -2, /* (417) tags_literal ::= NK_MINUS NK_BIN */ - -1, /* (418) tags_literal ::= NK_HEX */ - -2, /* (419) tags_literal ::= NK_PLUS NK_HEX */ - -2, /* (420) tags_literal ::= NK_MINUS NK_HEX */ - -1, /* (421) tags_literal ::= NK_STRING */ - -1, /* (422) tags_literal ::= NK_BOOL */ - -1, /* (423) tags_literal ::= NULL */ - -1, /* (424) tags_literal ::= literal_func */ - -3, /* (425) tags_literal ::= literal_func NK_PLUS duration_literal */ - -3, /* (426) tags_literal ::= literal_func NK_MINUS duration_literal */ - -1, /* (427) tags_literal_list ::= tags_literal */ - -3, /* (428) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ - -1, /* (429) literal ::= NK_INTEGER */ - -1, /* (430) literal ::= NK_FLOAT */ - -1, /* (431) literal ::= NK_STRING */ - -1, /* (432) literal ::= NK_BOOL */ - -2, /* (433) literal ::= TIMESTAMP NK_STRING */ - -1, /* (434) literal ::= duration_literal */ - -1, /* (435) literal ::= NULL */ - -1, /* (436) literal ::= NK_QUESTION */ - -1, /* (437) duration_literal ::= NK_VARIABLE */ - -1, /* (438) signed ::= NK_INTEGER */ - -2, /* (439) signed ::= NK_PLUS NK_INTEGER */ - -2, /* (440) signed ::= NK_MINUS NK_INTEGER */ - -1, /* (441) signed ::= NK_FLOAT */ - -2, /* (442) signed ::= NK_PLUS NK_FLOAT */ - -2, /* (443) signed ::= NK_MINUS NK_FLOAT */ - -1, /* (444) signed_literal ::= signed */ - -1, /* (445) signed_literal ::= NK_STRING */ - -1, /* (446) signed_literal ::= NK_BOOL */ - -2, /* (447) signed_literal ::= TIMESTAMP NK_STRING */ - -1, /* (448) signed_literal ::= duration_literal */ - -1, /* (449) signed_literal ::= NULL */ - -1, /* (450) signed_literal ::= literal_func */ - -1, /* (451) signed_literal ::= NK_QUESTION */ - -1, /* (452) literal_list ::= signed_literal */ - -3, /* (453) literal_list ::= literal_list NK_COMMA signed_literal */ - -1, /* (454) db_name ::= NK_ID */ - -1, /* (455) table_name ::= NK_ID */ - -1, /* (456) column_name ::= NK_ID */ - -1, /* (457) function_name ::= NK_ID */ - -1, /* (458) view_name ::= NK_ID */ - -1, /* (459) table_alias ::= NK_ID */ - -1, /* (460) column_alias ::= NK_ID */ - -1, /* (461) column_alias ::= NK_ALIAS */ - -1, /* (462) user_name ::= NK_ID */ - -1, /* (463) topic_name ::= NK_ID */ - -1, /* (464) stream_name ::= NK_ID */ - -1, /* (465) cgroup_name ::= NK_ID */ - -1, /* (466) index_name ::= NK_ID */ - -1, /* (467) expr_or_subquery ::= expression */ - -1, /* (468) expression ::= literal */ - -1, /* (469) expression ::= pseudo_column */ - -1, /* (470) expression ::= column_reference */ - -1, /* (471) expression ::= function_expression */ - -1, /* (472) expression ::= case_when_expression */ - -3, /* (473) expression ::= NK_LP expression NK_RP */ - -2, /* (474) expression ::= NK_PLUS expr_or_subquery */ - -2, /* (475) expression ::= NK_MINUS expr_or_subquery */ - -3, /* (476) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - -3, /* (477) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - -3, /* (478) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - -3, /* (479) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - -3, /* (480) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - -3, /* (481) expression ::= column_reference NK_ARROW NK_STRING */ - -3, /* (482) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - -3, /* (483) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - -1, /* (484) expression_list ::= expr_or_subquery */ - -3, /* (485) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - -1, /* (486) column_reference ::= column_name */ - -3, /* (487) column_reference ::= table_name NK_DOT column_name */ - -1, /* (488) column_reference ::= NK_ALIAS */ - -3, /* (489) column_reference ::= table_name NK_DOT NK_ALIAS */ - -1, /* (490) pseudo_column ::= ROWTS */ - -1, /* (491) pseudo_column ::= TBNAME */ - -3, /* (492) pseudo_column ::= table_name NK_DOT TBNAME */ - -1, /* (493) pseudo_column ::= QSTART */ - -1, /* (494) pseudo_column ::= QEND */ - -1, /* (495) pseudo_column ::= QDURATION */ - -1, /* (496) pseudo_column ::= WSTART */ - -1, /* (497) pseudo_column ::= WEND */ - -1, /* (498) pseudo_column ::= WDURATION */ - -1, /* (499) pseudo_column ::= IROWTS */ - -1, /* (500) pseudo_column ::= ISFILLED */ - -1, /* (501) pseudo_column ::= QTAGS */ - -4, /* (502) function_expression ::= function_name NK_LP expression_list NK_RP */ - -4, /* (503) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - -6, /* (504) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - -1, /* (505) function_expression ::= literal_func */ - -3, /* (506) literal_func ::= noarg_func NK_LP NK_RP */ - -1, /* (507) literal_func ::= NOW */ - -1, /* (508) literal_func ::= TODAY */ - -1, /* (509) noarg_func ::= NOW */ - -1, /* (510) noarg_func ::= TODAY */ - -1, /* (511) noarg_func ::= TIMEZONE */ - -1, /* (512) noarg_func ::= DATABASE */ - -1, /* (513) noarg_func ::= CLIENT_VERSION */ - -1, /* (514) noarg_func ::= SERVER_VERSION */ - -1, /* (515) noarg_func ::= SERVER_STATUS */ - -1, /* (516) noarg_func ::= CURRENT_USER */ - -1, /* (517) noarg_func ::= USER */ - -1, /* (518) star_func ::= COUNT */ - -1, /* (519) star_func ::= FIRST */ - -1, /* (520) star_func ::= LAST */ - -1, /* (521) star_func ::= LAST_ROW */ - -1, /* (522) star_func_para_list ::= NK_STAR */ - -1, /* (523) star_func_para_list ::= other_para_list */ - -1, /* (524) other_para_list ::= star_func_para */ - -3, /* (525) other_para_list ::= other_para_list NK_COMMA star_func_para */ - -1, /* (526) star_func_para ::= expr_or_subquery */ - -3, /* (527) star_func_para ::= table_name NK_DOT NK_STAR */ - -4, /* (528) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - -5, /* (529) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - -1, /* (530) when_then_list ::= when_then_expr */ - -2, /* (531) when_then_list ::= when_then_list when_then_expr */ - -4, /* (532) when_then_expr ::= WHEN common_expression THEN common_expression */ - 0, /* (533) case_when_else_opt ::= */ - -2, /* (534) case_when_else_opt ::= ELSE common_expression */ - -3, /* (535) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - -5, /* (536) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - -6, /* (537) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - -3, /* (538) predicate ::= expr_or_subquery IS NULL */ - -4, /* (539) predicate ::= expr_or_subquery IS NOT NULL */ - -3, /* (540) predicate ::= expr_or_subquery in_op in_predicate_value */ - -1, /* (541) compare_op ::= NK_LT */ - -1, /* (542) compare_op ::= NK_GT */ - -1, /* (543) compare_op ::= NK_LE */ - -1, /* (544) compare_op ::= NK_GE */ - -1, /* (545) compare_op ::= NK_NE */ - -1, /* (546) compare_op ::= NK_EQ */ - -1, /* (547) compare_op ::= LIKE */ - -2, /* (548) compare_op ::= NOT LIKE */ - -1, /* (549) compare_op ::= MATCH */ - -1, /* (550) compare_op ::= NMATCH */ - -1, /* (551) compare_op ::= CONTAINS */ - -1, /* (552) in_op ::= IN */ - -2, /* (553) in_op ::= NOT IN */ - -3, /* (554) in_predicate_value ::= NK_LP literal_list NK_RP */ - -1, /* (555) boolean_value_expression ::= boolean_primary */ - -2, /* (556) boolean_value_expression ::= NOT boolean_primary */ - -3, /* (557) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - -3, /* (558) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - -1, /* (559) boolean_primary ::= predicate */ - -3, /* (560) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - -1, /* (561) common_expression ::= expr_or_subquery */ - -1, /* (562) common_expression ::= boolean_value_expression */ - 0, /* (563) from_clause_opt ::= */ - -2, /* (564) from_clause_opt ::= FROM table_reference_list */ - -1, /* (565) table_reference_list ::= table_reference */ - -3, /* (566) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - -1, /* (567) table_reference ::= table_primary */ - -1, /* (568) table_reference ::= joined_table */ - -2, /* (569) table_primary ::= table_name alias_opt */ - -4, /* (570) table_primary ::= db_name NK_DOT table_name alias_opt */ - -2, /* (571) table_primary ::= subquery alias_opt */ - -1, /* (572) table_primary ::= parenthesized_joined_table */ - 0, /* (573) alias_opt ::= */ - -1, /* (574) alias_opt ::= table_alias */ - -2, /* (575) alias_opt ::= AS table_alias */ - -3, /* (576) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - -3, /* (577) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - -8, /* (578) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ - 0, /* (579) join_type ::= */ - -1, /* (580) join_type ::= INNER */ - -1, /* (581) join_type ::= LEFT */ - -1, /* (582) join_type ::= RIGHT */ - -1, /* (583) join_type ::= FULL */ - 0, /* (584) join_subtype ::= */ - -1, /* (585) join_subtype ::= OUTER */ - -1, /* (586) join_subtype ::= SEMI */ - -1, /* (587) join_subtype ::= ANTI */ - -1, /* (588) join_subtype ::= ASOF */ - -1, /* (589) join_subtype ::= WINDOW */ - 0, /* (590) join_on_clause_opt ::= */ - -2, /* (591) join_on_clause_opt ::= ON search_condition */ - 0, /* (592) window_offset_clause_opt ::= */ - -6, /* (593) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ - -1, /* (594) window_offset_literal ::= NK_VARIABLE */ - -2, /* (595) window_offset_literal ::= NK_MINUS NK_VARIABLE */ - 0, /* (596) jlimit_clause_opt ::= */ - -2, /* (597) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - -14, /* (598) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - 0, /* (599) hint_list ::= */ - -1, /* (600) hint_list ::= NK_HINT */ - 0, /* (601) tag_mode_opt ::= */ - -1, /* (602) tag_mode_opt ::= TAGS */ - 0, /* (603) set_quantifier_opt ::= */ - -1, /* (604) set_quantifier_opt ::= DISTINCT */ - -1, /* (605) set_quantifier_opt ::= ALL */ - -1, /* (606) select_list ::= select_item */ - -3, /* (607) select_list ::= select_list NK_COMMA select_item */ - -1, /* (608) select_item ::= NK_STAR */ - -1, /* (609) select_item ::= common_expression */ - -2, /* (610) select_item ::= common_expression column_alias */ - -3, /* (611) select_item ::= common_expression AS column_alias */ - -3, /* (612) select_item ::= table_name NK_DOT NK_STAR */ - 0, /* (613) where_clause_opt ::= */ - -2, /* (614) where_clause_opt ::= WHERE search_condition */ - 0, /* (615) partition_by_clause_opt ::= */ - -3, /* (616) partition_by_clause_opt ::= PARTITION BY partition_list */ - -1, /* (617) partition_list ::= partition_item */ - -3, /* (618) partition_list ::= partition_list NK_COMMA partition_item */ - -1, /* (619) partition_item ::= expr_or_subquery */ - -2, /* (620) partition_item ::= expr_or_subquery column_alias */ - -3, /* (621) partition_item ::= expr_or_subquery AS column_alias */ - 0, /* (622) twindow_clause_opt ::= */ - -6, /* (623) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ - -4, /* (624) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - -6, /* (625) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -8, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ - -7, /* (627) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - -4, /* (628) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ - -6, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - 0, /* (630) sliding_opt ::= */ - -4, /* (631) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ - -1, /* (632) interval_sliding_duration_literal ::= NK_VARIABLE */ - -1, /* (633) interval_sliding_duration_literal ::= NK_STRING */ - -1, /* (634) interval_sliding_duration_literal ::= NK_INTEGER */ - 0, /* (635) fill_opt ::= */ - -4, /* (636) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - -6, /* (637) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ - -6, /* (638) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ - -1, /* (639) fill_mode ::= NONE */ - -1, /* (640) fill_mode ::= PREV */ - -1, /* (641) fill_mode ::= NULL */ - -1, /* (642) fill_mode ::= NULL_F */ - -1, /* (643) fill_mode ::= LINEAR */ - -1, /* (644) fill_mode ::= NEXT */ - 0, /* (645) group_by_clause_opt ::= */ - -3, /* (646) group_by_clause_opt ::= GROUP BY group_by_list */ - -1, /* (647) group_by_list ::= expr_or_subquery */ - -3, /* (648) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - 0, /* (649) having_clause_opt ::= */ - -2, /* (650) having_clause_opt ::= HAVING search_condition */ - 0, /* (651) range_opt ::= */ - -6, /* (652) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - -4, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ - 0, /* (654) every_opt ::= */ - -4, /* (655) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - -4, /* (656) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - -1, /* (657) query_simple ::= query_specification */ - -1, /* (658) query_simple ::= union_query_expression */ - -4, /* (659) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - -3, /* (660) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - -1, /* (661) query_simple_or_subquery ::= query_simple */ - -1, /* (662) query_simple_or_subquery ::= subquery */ - -1, /* (663) query_or_subquery ::= query_expression */ - -1, /* (664) query_or_subquery ::= subquery */ - 0, /* (665) order_by_clause_opt ::= */ - -3, /* (666) order_by_clause_opt ::= ORDER BY sort_specification_list */ - 0, /* (667) slimit_clause_opt ::= */ - -2, /* (668) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - -4, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - -4, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - 0, /* (671) limit_clause_opt ::= */ - -2, /* (672) limit_clause_opt ::= LIMIT NK_INTEGER */ - -4, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - -4, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - -3, /* (675) subquery ::= NK_LP query_expression NK_RP */ - -3, /* (676) subquery ::= NK_LP subquery NK_RP */ - -1, /* (677) search_condition ::= common_expression */ - -1, /* (678) sort_specification_list ::= sort_specification */ - -3, /* (679) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - -3, /* (680) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - 0, /* (681) ordering_specification_opt ::= */ - -1, /* (682) ordering_specification_opt ::= ASC */ - -1, /* (683) ordering_specification_opt ::= DESC */ - 0, /* (684) null_ordering_opt ::= */ - -2, /* (685) null_ordering_opt ::= NULLS FIRST */ - -2, /* (686) null_ordering_opt ::= NULLS LAST */ + -2, /* (253) cmd ::= SHOW ARBGROUPS */ + -2, /* (254) cmd ::= SHOW FUNCTIONS */ + -5, /* (255) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + -6, /* (256) cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ + -2, /* (257) cmd ::= SHOW STREAMS */ + -2, /* (258) cmd ::= SHOW ACCOUNTS */ + -2, /* (259) cmd ::= SHOW APPS */ + -2, /* (260) cmd ::= SHOW CONNECTIONS */ + -2, /* (261) cmd ::= SHOW LICENCES */ + -2, /* (262) cmd ::= SHOW GRANTS */ + -3, /* (263) cmd ::= SHOW GRANTS FULL */ + -3, /* (264) cmd ::= SHOW GRANTS LOGS */ + -3, /* (265) cmd ::= SHOW CLUSTER MACHINES */ + -4, /* (266) cmd ::= SHOW CREATE DATABASE db_name */ + -4, /* (267) cmd ::= SHOW CREATE TABLE full_table_name */ + -4, /* (268) cmd ::= SHOW CREATE STABLE full_table_name */ + -2, /* (269) cmd ::= SHOW QUERIES */ + -2, /* (270) cmd ::= SHOW SCORES */ + -2, /* (271) cmd ::= SHOW TOPICS */ + -2, /* (272) cmd ::= SHOW VARIABLES */ + -3, /* (273) cmd ::= SHOW CLUSTER VARIABLES */ + -3, /* (274) cmd ::= SHOW LOCAL VARIABLES */ + -5, /* (275) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ + -2, /* (276) cmd ::= SHOW BNODES */ + -2, /* (277) cmd ::= SHOW SNODES */ + -2, /* (278) cmd ::= SHOW CLUSTER */ + -2, /* (279) cmd ::= SHOW TRANSACTIONS */ + -4, /* (280) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + -2, /* (281) cmd ::= SHOW CONSUMERS */ + -2, /* (282) cmd ::= SHOW SUBSCRIPTIONS */ + -5, /* (283) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + -6, /* (284) cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ + -7, /* (285) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ + -8, /* (286) cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ + -5, /* (287) cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + -2, /* (288) cmd ::= SHOW VNODES */ + -3, /* (289) cmd ::= SHOW db_name_cond_opt ALIVE */ + -3, /* (290) cmd ::= SHOW CLUSTER ALIVE */ + -4, /* (291) cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ + -4, /* (292) cmd ::= SHOW CREATE VIEW full_table_name */ + -2, /* (293) cmd ::= SHOW COMPACTS */ + -3, /* (294) cmd ::= SHOW COMPACT NK_INTEGER */ + 0, /* (295) table_kind_db_name_cond_opt ::= */ + -1, /* (296) table_kind_db_name_cond_opt ::= table_kind */ + -2, /* (297) table_kind_db_name_cond_opt ::= db_name NK_DOT */ + -3, /* (298) table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ + -1, /* (299) table_kind ::= NORMAL */ + -1, /* (300) table_kind ::= CHILD */ + 0, /* (301) db_name_cond_opt ::= */ + -2, /* (302) db_name_cond_opt ::= db_name NK_DOT */ + 0, /* (303) like_pattern_opt ::= */ + -2, /* (304) like_pattern_opt ::= LIKE NK_STRING */ + -1, /* (305) table_name_cond ::= table_name */ + 0, /* (306) from_db_opt ::= */ + -2, /* (307) from_db_opt ::= FROM db_name */ + 0, /* (308) tag_list_opt ::= */ + -1, /* (309) tag_list_opt ::= tag_item */ + -3, /* (310) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ + -1, /* (311) tag_item ::= TBNAME */ + -1, /* (312) tag_item ::= QTAGS */ + -1, /* (313) tag_item ::= column_name */ + -2, /* (314) tag_item ::= column_name column_alias */ + -3, /* (315) tag_item ::= column_name AS column_alias */ + 0, /* (316) db_kind_opt ::= */ + -1, /* (317) db_kind_opt ::= USER */ + -1, /* (318) db_kind_opt ::= SYSTEM */ + -8, /* (319) cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ + -9, /* (320) cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ + -4, /* (321) cmd ::= DROP INDEX exists_opt full_index_name */ + -1, /* (322) full_index_name ::= index_name */ + -3, /* (323) full_index_name ::= db_name NK_DOT index_name */ + -10, /* (324) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + -12, /* (325) 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 */ + -1, /* (326) func_list ::= func */ + -3, /* (327) func_list ::= func_list NK_COMMA func */ + -4, /* (328) func ::= sma_func_name NK_LP expression_list NK_RP */ + -1, /* (329) sma_func_name ::= function_name */ + -1, /* (330) sma_func_name ::= COUNT */ + -1, /* (331) sma_func_name ::= FIRST */ + -1, /* (332) sma_func_name ::= LAST */ + -1, /* (333) sma_func_name ::= LAST_ROW */ + 0, /* (334) sma_stream_opt ::= */ + -3, /* (335) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ + -3, /* (336) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ + -3, /* (337) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ + -1, /* (338) with_meta ::= AS */ + -3, /* (339) with_meta ::= WITH META AS */ + -3, /* (340) with_meta ::= ONLY META AS */ + -6, /* (341) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + -7, /* (342) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ + -8, /* (343) cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ + -4, /* (344) cmd ::= DROP TOPIC exists_opt topic_name */ + -7, /* (345) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + -2, /* (346) cmd ::= DESC full_table_name */ + -2, /* (347) cmd ::= DESCRIBE full_table_name */ + -3, /* (348) cmd ::= RESET QUERY CACHE */ + -4, /* (349) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + -4, /* (350) cmd ::= EXPLAIN analyze_opt explain_options insert_query */ + 0, /* (351) analyze_opt ::= */ + -1, /* (352) analyze_opt ::= ANALYZE */ + 0, /* (353) explain_options ::= */ + -3, /* (354) explain_options ::= explain_options VERBOSE NK_BOOL */ + -3, /* (355) explain_options ::= explain_options RATIO NK_FLOAT */ + -12, /* (356) cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ + -4, /* (357) cmd ::= DROP FUNCTION exists_opt function_name */ + 0, /* (358) agg_func_opt ::= */ + -1, /* (359) agg_func_opt ::= AGGREGATE */ + 0, /* (360) bufsize_opt ::= */ + -2, /* (361) bufsize_opt ::= BUFSIZE NK_INTEGER */ + 0, /* (362) language_opt ::= */ + -2, /* (363) language_opt ::= LANGUAGE NK_STRING */ + 0, /* (364) or_replace_opt ::= */ + -2, /* (365) or_replace_opt ::= OR REPLACE */ + -6, /* (366) cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ + -4, /* (367) cmd ::= DROP VIEW exists_opt full_view_name */ + -1, /* (368) full_view_name ::= view_name */ + -3, /* (369) full_view_name ::= db_name NK_DOT view_name */ + -12, /* (370) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ + -4, /* (371) cmd ::= DROP STREAM exists_opt stream_name */ + -4, /* (372) cmd ::= PAUSE STREAM exists_opt stream_name */ + -5, /* (373) cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ + 0, /* (374) col_list_opt ::= */ + -3, /* (375) col_list_opt ::= NK_LP col_name_list NK_RP */ + 0, /* (376) tag_def_or_ref_opt ::= */ + -1, /* (377) tag_def_or_ref_opt ::= tags_def */ + -4, /* (378) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + 0, /* (379) stream_options ::= */ + -3, /* (380) stream_options ::= stream_options TRIGGER AT_ONCE */ + -3, /* (381) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + -4, /* (382) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + -3, /* (383) stream_options ::= stream_options WATERMARK duration_literal */ + -4, /* (384) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + -3, /* (385) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + -3, /* (386) stream_options ::= stream_options DELETE_MARK duration_literal */ + -4, /* (387) stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ + 0, /* (388) subtable_opt ::= */ + -4, /* (389) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + 0, /* (390) ignore_opt ::= */ + -2, /* (391) ignore_opt ::= IGNORE UNTREATED */ + -3, /* (392) cmd ::= KILL CONNECTION NK_INTEGER */ + -3, /* (393) cmd ::= KILL QUERY NK_STRING */ + -3, /* (394) cmd ::= KILL TRANSACTION NK_INTEGER */ + -3, /* (395) cmd ::= KILL COMPACT NK_INTEGER */ + -2, /* (396) cmd ::= BALANCE VGROUP */ + -4, /* (397) cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ + -4, /* (398) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + -4, /* (399) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + -3, /* (400) cmd ::= SPLIT VGROUP NK_INTEGER */ + 0, /* (401) on_vgroup_id ::= */ + -2, /* (402) on_vgroup_id ::= ON NK_INTEGER */ + -2, /* (403) dnode_list ::= DNODE NK_INTEGER */ + -3, /* (404) dnode_list ::= dnode_list DNODE NK_INTEGER */ + -4, /* (405) cmd ::= DELETE FROM full_table_name where_clause_opt */ + -1, /* (406) cmd ::= query_or_subquery */ + -1, /* (407) cmd ::= insert_query */ + -7, /* (408) insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + -4, /* (409) insert_query ::= INSERT INTO full_table_name query_or_subquery */ + -1, /* (410) tags_literal ::= NK_INTEGER */ + -2, /* (411) tags_literal ::= NK_PLUS NK_INTEGER */ + -2, /* (412) tags_literal ::= NK_MINUS NK_INTEGER */ + -1, /* (413) tags_literal ::= NK_FLOAT */ + -2, /* (414) tags_literal ::= NK_PLUS NK_FLOAT */ + -2, /* (415) tags_literal ::= NK_MINUS NK_FLOAT */ + -1, /* (416) tags_literal ::= NK_BIN */ + -2, /* (417) tags_literal ::= NK_PLUS NK_BIN */ + -2, /* (418) tags_literal ::= NK_MINUS NK_BIN */ + -1, /* (419) tags_literal ::= NK_HEX */ + -2, /* (420) tags_literal ::= NK_PLUS NK_HEX */ + -2, /* (421) tags_literal ::= NK_MINUS NK_HEX */ + -1, /* (422) tags_literal ::= NK_STRING */ + -1, /* (423) tags_literal ::= NK_BOOL */ + -1, /* (424) tags_literal ::= NULL */ + -1, /* (425) tags_literal ::= literal_func */ + -3, /* (426) tags_literal ::= literal_func NK_PLUS duration_literal */ + -3, /* (427) tags_literal ::= literal_func NK_MINUS duration_literal */ + -1, /* (428) tags_literal_list ::= tags_literal */ + -3, /* (429) tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ + -1, /* (430) literal ::= NK_INTEGER */ + -1, /* (431) literal ::= NK_FLOAT */ + -1, /* (432) literal ::= NK_STRING */ + -1, /* (433) literal ::= NK_BOOL */ + -2, /* (434) literal ::= TIMESTAMP NK_STRING */ + -1, /* (435) literal ::= duration_literal */ + -1, /* (436) literal ::= NULL */ + -1, /* (437) literal ::= NK_QUESTION */ + -1, /* (438) duration_literal ::= NK_VARIABLE */ + -1, /* (439) signed ::= NK_INTEGER */ + -2, /* (440) signed ::= NK_PLUS NK_INTEGER */ + -2, /* (441) signed ::= NK_MINUS NK_INTEGER */ + -1, /* (442) signed ::= NK_FLOAT */ + -2, /* (443) signed ::= NK_PLUS NK_FLOAT */ + -2, /* (444) signed ::= NK_MINUS NK_FLOAT */ + -1, /* (445) signed_literal ::= signed */ + -1, /* (446) signed_literal ::= NK_STRING */ + -1, /* (447) signed_literal ::= NK_BOOL */ + -2, /* (448) signed_literal ::= TIMESTAMP NK_STRING */ + -1, /* (449) signed_literal ::= duration_literal */ + -1, /* (450) signed_literal ::= NULL */ + -1, /* (451) signed_literal ::= literal_func */ + -1, /* (452) signed_literal ::= NK_QUESTION */ + -1, /* (453) literal_list ::= signed_literal */ + -3, /* (454) literal_list ::= literal_list NK_COMMA signed_literal */ + -1, /* (455) db_name ::= NK_ID */ + -1, /* (456) table_name ::= NK_ID */ + -1, /* (457) column_name ::= NK_ID */ + -1, /* (458) function_name ::= NK_ID */ + -1, /* (459) view_name ::= NK_ID */ + -1, /* (460) table_alias ::= NK_ID */ + -1, /* (461) column_alias ::= NK_ID */ + -1, /* (462) column_alias ::= NK_ALIAS */ + -1, /* (463) user_name ::= NK_ID */ + -1, /* (464) topic_name ::= NK_ID */ + -1, /* (465) stream_name ::= NK_ID */ + -1, /* (466) cgroup_name ::= NK_ID */ + -1, /* (467) index_name ::= NK_ID */ + -1, /* (468) expr_or_subquery ::= expression */ + -1, /* (469) expression ::= literal */ + -1, /* (470) expression ::= pseudo_column */ + -1, /* (471) expression ::= column_reference */ + -1, /* (472) expression ::= function_expression */ + -1, /* (473) expression ::= case_when_expression */ + -3, /* (474) expression ::= NK_LP expression NK_RP */ + -2, /* (475) expression ::= NK_PLUS expr_or_subquery */ + -2, /* (476) expression ::= NK_MINUS expr_or_subquery */ + -3, /* (477) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + -3, /* (478) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + -3, /* (479) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + -3, /* (480) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + -3, /* (481) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + -3, /* (482) expression ::= column_reference NK_ARROW NK_STRING */ + -3, /* (483) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + -3, /* (484) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + -1, /* (485) expression_list ::= expr_or_subquery */ + -3, /* (486) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + -1, /* (487) column_reference ::= column_name */ + -3, /* (488) column_reference ::= table_name NK_DOT column_name */ + -1, /* (489) column_reference ::= NK_ALIAS */ + -3, /* (490) column_reference ::= table_name NK_DOT NK_ALIAS */ + -1, /* (491) pseudo_column ::= ROWTS */ + -1, /* (492) pseudo_column ::= TBNAME */ + -3, /* (493) pseudo_column ::= table_name NK_DOT TBNAME */ + -1, /* (494) pseudo_column ::= QSTART */ + -1, /* (495) pseudo_column ::= QEND */ + -1, /* (496) pseudo_column ::= QDURATION */ + -1, /* (497) pseudo_column ::= WSTART */ + -1, /* (498) pseudo_column ::= WEND */ + -1, /* (499) pseudo_column ::= WDURATION */ + -1, /* (500) pseudo_column ::= IROWTS */ + -1, /* (501) pseudo_column ::= ISFILLED */ + -1, /* (502) pseudo_column ::= QTAGS */ + -4, /* (503) function_expression ::= function_name NK_LP expression_list NK_RP */ + -4, /* (504) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + -6, /* (505) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + -1, /* (506) function_expression ::= literal_func */ + -3, /* (507) literal_func ::= noarg_func NK_LP NK_RP */ + -1, /* (508) literal_func ::= NOW */ + -1, /* (509) literal_func ::= TODAY */ + -1, /* (510) noarg_func ::= NOW */ + -1, /* (511) noarg_func ::= TODAY */ + -1, /* (512) noarg_func ::= TIMEZONE */ + -1, /* (513) noarg_func ::= DATABASE */ + -1, /* (514) noarg_func ::= CLIENT_VERSION */ + -1, /* (515) noarg_func ::= SERVER_VERSION */ + -1, /* (516) noarg_func ::= SERVER_STATUS */ + -1, /* (517) noarg_func ::= CURRENT_USER */ + -1, /* (518) noarg_func ::= USER */ + -1, /* (519) star_func ::= COUNT */ + -1, /* (520) star_func ::= FIRST */ + -1, /* (521) star_func ::= LAST */ + -1, /* (522) star_func ::= LAST_ROW */ + -1, /* (523) star_func_para_list ::= NK_STAR */ + -1, /* (524) star_func_para_list ::= other_para_list */ + -1, /* (525) other_para_list ::= star_func_para */ + -3, /* (526) other_para_list ::= other_para_list NK_COMMA star_func_para */ + -1, /* (527) star_func_para ::= expr_or_subquery */ + -3, /* (528) star_func_para ::= table_name NK_DOT NK_STAR */ + -4, /* (529) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + -5, /* (530) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + -1, /* (531) when_then_list ::= when_then_expr */ + -2, /* (532) when_then_list ::= when_then_list when_then_expr */ + -4, /* (533) when_then_expr ::= WHEN common_expression THEN common_expression */ + 0, /* (534) case_when_else_opt ::= */ + -2, /* (535) case_when_else_opt ::= ELSE common_expression */ + -3, /* (536) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + -5, /* (537) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + -6, /* (538) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + -3, /* (539) predicate ::= expr_or_subquery IS NULL */ + -4, /* (540) predicate ::= expr_or_subquery IS NOT NULL */ + -3, /* (541) predicate ::= expr_or_subquery in_op in_predicate_value */ + -1, /* (542) compare_op ::= NK_LT */ + -1, /* (543) compare_op ::= NK_GT */ + -1, /* (544) compare_op ::= NK_LE */ + -1, /* (545) compare_op ::= NK_GE */ + -1, /* (546) compare_op ::= NK_NE */ + -1, /* (547) compare_op ::= NK_EQ */ + -1, /* (548) compare_op ::= LIKE */ + -2, /* (549) compare_op ::= NOT LIKE */ + -1, /* (550) compare_op ::= MATCH */ + -1, /* (551) compare_op ::= NMATCH */ + -1, /* (552) compare_op ::= CONTAINS */ + -1, /* (553) in_op ::= IN */ + -2, /* (554) in_op ::= NOT IN */ + -3, /* (555) in_predicate_value ::= NK_LP literal_list NK_RP */ + -1, /* (556) boolean_value_expression ::= boolean_primary */ + -2, /* (557) boolean_value_expression ::= NOT boolean_primary */ + -3, /* (558) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + -3, /* (559) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + -1, /* (560) boolean_primary ::= predicate */ + -3, /* (561) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + -1, /* (562) common_expression ::= expr_or_subquery */ + -1, /* (563) common_expression ::= boolean_value_expression */ + 0, /* (564) from_clause_opt ::= */ + -2, /* (565) from_clause_opt ::= FROM table_reference_list */ + -1, /* (566) table_reference_list ::= table_reference */ + -3, /* (567) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + -1, /* (568) table_reference ::= table_primary */ + -1, /* (569) table_reference ::= joined_table */ + -2, /* (570) table_primary ::= table_name alias_opt */ + -4, /* (571) table_primary ::= db_name NK_DOT table_name alias_opt */ + -2, /* (572) table_primary ::= subquery alias_opt */ + -1, /* (573) table_primary ::= parenthesized_joined_table */ + 0, /* (574) alias_opt ::= */ + -1, /* (575) alias_opt ::= table_alias */ + -2, /* (576) alias_opt ::= AS table_alias */ + -3, /* (577) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + -3, /* (578) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + -8, /* (579) joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + 0, /* (580) join_type ::= */ + -1, /* (581) join_type ::= INNER */ + -1, /* (582) join_type ::= LEFT */ + -1, /* (583) join_type ::= RIGHT */ + -1, /* (584) join_type ::= FULL */ + 0, /* (585) join_subtype ::= */ + -1, /* (586) join_subtype ::= OUTER */ + -1, /* (587) join_subtype ::= SEMI */ + -1, /* (588) join_subtype ::= ANTI */ + -1, /* (589) join_subtype ::= ASOF */ + -1, /* (590) join_subtype ::= WINDOW */ + 0, /* (591) join_on_clause_opt ::= */ + -2, /* (592) join_on_clause_opt ::= ON search_condition */ + 0, /* (593) window_offset_clause_opt ::= */ + -6, /* (594) window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ + -1, /* (595) window_offset_literal ::= NK_VARIABLE */ + -2, /* (596) window_offset_literal ::= NK_MINUS NK_VARIABLE */ + 0, /* (597) jlimit_clause_opt ::= */ + -2, /* (598) jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + -14, /* (599) query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + 0, /* (600) hint_list ::= */ + -1, /* (601) hint_list ::= NK_HINT */ + 0, /* (602) tag_mode_opt ::= */ + -1, /* (603) tag_mode_opt ::= TAGS */ + 0, /* (604) set_quantifier_opt ::= */ + -1, /* (605) set_quantifier_opt ::= DISTINCT */ + -1, /* (606) set_quantifier_opt ::= ALL */ + -1, /* (607) select_list ::= select_item */ + -3, /* (608) select_list ::= select_list NK_COMMA select_item */ + -1, /* (609) select_item ::= NK_STAR */ + -1, /* (610) select_item ::= common_expression */ + -2, /* (611) select_item ::= common_expression column_alias */ + -3, /* (612) select_item ::= common_expression AS column_alias */ + -3, /* (613) select_item ::= table_name NK_DOT NK_STAR */ + 0, /* (614) where_clause_opt ::= */ + -2, /* (615) where_clause_opt ::= WHERE search_condition */ + 0, /* (616) partition_by_clause_opt ::= */ + -3, /* (617) partition_by_clause_opt ::= PARTITION BY partition_list */ + -1, /* (618) partition_list ::= partition_item */ + -3, /* (619) partition_list ::= partition_list NK_COMMA partition_item */ + -1, /* (620) partition_item ::= expr_or_subquery */ + -2, /* (621) partition_item ::= expr_or_subquery column_alias */ + -3, /* (622) partition_item ::= expr_or_subquery AS column_alias */ + 0, /* (623) twindow_clause_opt ::= */ + -6, /* (624) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ + -4, /* (625) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + -6, /* (626) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -8, /* (627) twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ + -7, /* (628) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + -4, /* (629) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ + -6, /* (630) twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + 0, /* (631) sliding_opt ::= */ + -4, /* (632) sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ + -1, /* (633) interval_sliding_duration_literal ::= NK_VARIABLE */ + -1, /* (634) interval_sliding_duration_literal ::= NK_STRING */ + -1, /* (635) interval_sliding_duration_literal ::= NK_INTEGER */ + 0, /* (636) fill_opt ::= */ + -4, /* (637) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + -6, /* (638) fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ + -6, /* (639) fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ + -1, /* (640) fill_mode ::= NONE */ + -1, /* (641) fill_mode ::= PREV */ + -1, /* (642) fill_mode ::= NULL */ + -1, /* (643) fill_mode ::= NULL_F */ + -1, /* (644) fill_mode ::= LINEAR */ + -1, /* (645) fill_mode ::= NEXT */ + 0, /* (646) group_by_clause_opt ::= */ + -3, /* (647) group_by_clause_opt ::= GROUP BY group_by_list */ + -1, /* (648) group_by_list ::= expr_or_subquery */ + -3, /* (649) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + 0, /* (650) having_clause_opt ::= */ + -2, /* (651) having_clause_opt ::= HAVING search_condition */ + 0, /* (652) range_opt ::= */ + -6, /* (653) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + -4, /* (654) range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ + 0, /* (655) every_opt ::= */ + -4, /* (656) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + -4, /* (657) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + -1, /* (658) query_simple ::= query_specification */ + -1, /* (659) query_simple ::= union_query_expression */ + -4, /* (660) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + -3, /* (661) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + -1, /* (662) query_simple_or_subquery ::= query_simple */ + -1, /* (663) query_simple_or_subquery ::= subquery */ + -1, /* (664) query_or_subquery ::= query_expression */ + -1, /* (665) query_or_subquery ::= subquery */ + 0, /* (666) order_by_clause_opt ::= */ + -3, /* (667) order_by_clause_opt ::= ORDER BY sort_specification_list */ + 0, /* (668) slimit_clause_opt ::= */ + -2, /* (669) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + -4, /* (670) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + -4, /* (671) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + 0, /* (672) limit_clause_opt ::= */ + -2, /* (673) limit_clause_opt ::= LIMIT NK_INTEGER */ + -4, /* (674) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + -4, /* (675) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + -3, /* (676) subquery ::= NK_LP query_expression NK_RP */ + -3, /* (677) subquery ::= NK_LP subquery NK_RP */ + -1, /* (678) search_condition ::= common_expression */ + -1, /* (679) sort_specification_list ::= sort_specification */ + -3, /* (680) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + -3, /* (681) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + 0, /* (682) ordering_specification_opt ::= */ + -1, /* (683) ordering_specification_opt ::= ASC */ + -1, /* (684) ordering_specification_opt ::= DESC */ + 0, /* (685) null_ordering_opt ::= */ + -2, /* (686) null_ordering_opt ::= NULLS FIRST */ + -2, /* (687) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -4946,11 +4925,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,362,&yymsp[0].minor); + yy_destructor(yypParser,363,&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,363,&yymsp[0].minor); + yy_destructor(yypParser,364,&yymsp[0].minor); break; case 2: /* account_options ::= */ { } @@ -4964,20 +4943,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,362,&yymsp[-2].minor); +{ yy_destructor(yypParser,363,&yymsp[-2].minor); { } - yy_destructor(yypParser,364,&yymsp[0].minor); + yy_destructor(yypParser,365,&yymsp[0].minor); } break; case 12: /* alter_account_options ::= alter_account_option */ -{ yy_destructor(yypParser,365,&yymsp[0].minor); +{ yy_destructor(yypParser,366,&yymsp[0].minor); { } } break; case 13: /* alter_account_options ::= alter_account_options alter_account_option */ -{ yy_destructor(yypParser,363,&yymsp[-1].minor); +{ yy_destructor(yypParser,364,&yymsp[-1].minor); { } - yy_destructor(yypParser,365,&yymsp[0].minor); + yy_destructor(yypParser,366,&yymsp[0].minor); } break; case 14: /* alter_account_option ::= PASS literal */ @@ -4991,158 +4970,158 @@ 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,364,&yymsp[0].minor); + yy_destructor(yypParser,365,&yymsp[0].minor); break; case 24: /* ip_range_list ::= NK_STRING */ -{ yylhsminor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy608 = yylhsminor.yy608; +{ yylhsminor.yy444 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 25: /* ip_range_list ::= ip_range_list NK_COMMA NK_STRING */ -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; case 26: /* white_list ::= HOST ip_range_list */ -{ yymsp[-1].minor.yy608 = yymsp[0].minor.yy608; } +{ yymsp[-1].minor.yy444 = yymsp[0].minor.yy444; } break; case 27: /* white_list_opt ::= */ case 188: /* specific_cols_opt ::= */ yytestcase(yyruleno==188); case 219: /* tags_def_opt ::= */ yytestcase(yyruleno==219); - case 307: /* tag_list_opt ::= */ yytestcase(yyruleno==307); - case 373: /* col_list_opt ::= */ yytestcase(yyruleno==373); - case 375: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==375); - case 615: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==615); - case 645: /* group_by_clause_opt ::= */ yytestcase(yyruleno==645); - case 665: /* order_by_clause_opt ::= */ yytestcase(yyruleno==665); -{ yymsp[1].minor.yy608 = NULL; } + case 308: /* tag_list_opt ::= */ yytestcase(yyruleno==308); + case 374: /* col_list_opt ::= */ yytestcase(yyruleno==374); + case 376: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==376); + case 616: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==616); + case 646: /* group_by_clause_opt ::= */ yytestcase(yyruleno==646); + case 666: /* order_by_clause_opt ::= */ yytestcase(yyruleno==666); +{ yymsp[1].minor.yy444 = NULL; } break; case 28: /* white_list_opt ::= white_list */ case 220: /* tags_def_opt ::= tags_def */ yytestcase(yyruleno==220); - case 376: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==376); - case 523: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==523); -{ yylhsminor.yy608 = yymsp[0].minor.yy608; } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 377: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==377); + case 524: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==524); +{ yylhsminor.yy444 = yymsp[0].minor.yy444; } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 29: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt white_list_opt */ { - pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy803, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy337); - pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy608); + pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-4].minor.yy729, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy863); + pCxt->pRootNode = addCreateUserStmtWhiteList(pCxt, pCxt->pRootNode, yymsp[0].minor.yy444); } break; case 30: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy729, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 31: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy729, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 32: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy729, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 33: /* cmd ::= ALTER USER user_name ADD white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy608); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy729, TSDB_ALTER_USER_ADD_WHITE_LIST, yymsp[0].minor.yy444); } break; case 34: /* cmd ::= ALTER USER user_name DROP white_list */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy803, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy608); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy729, TSDB_ALTER_USER_DROP_WHITE_LIST, yymsp[0].minor.yy444); } break; case 35: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy803); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy729); } break; case 36: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy337 = 1; } +{ yymsp[1].minor.yy863 = 1; } break; case 37: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy337 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy863 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 38: /* cmd ::= GRANT privileges ON priv_level with_opt TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy777, &yymsp[-3].minor.yy187, &yymsp[0].minor.yy803, yymsp[-2].minor.yy614); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-5].minor.yy709, &yymsp[-3].minor.yy97, &yymsp[0].minor.yy729, yymsp[-2].minor.yy1032); } break; case 39: /* cmd ::= REVOKE privileges ON priv_level with_opt FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy777, &yymsp[-3].minor.yy187, &yymsp[0].minor.yy803, yymsp[-2].minor.yy614); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-5].minor.yy709, &yymsp[-3].minor.yy97, &yymsp[0].minor.yy729, yymsp[-2].minor.yy1032); } break; case 40: /* privileges ::= ALL */ -{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy709 = PRIVILEGE_TYPE_ALL; } break; case 41: /* privileges ::= priv_type_list */ case 43: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==43); -{ yylhsminor.yy777 = yymsp[0].minor.yy777; } - yymsp[0].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy709 = yymsp[0].minor.yy709; } + yymsp[0].minor.yy709 = yylhsminor.yy709; break; case 42: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy709 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 44: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy777 = yymsp[-2].minor.yy777 | yymsp[0].minor.yy777; } - yymsp[-2].minor.yy777 = yylhsminor.yy777; +{ yylhsminor.yy709 = yymsp[-2].minor.yy709 | yymsp[0].minor.yy709; } + yymsp[-2].minor.yy709 = yylhsminor.yy709; break; case 45: /* priv_type ::= READ */ -{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy709 = PRIVILEGE_TYPE_READ; } break; case 46: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy709 = PRIVILEGE_TYPE_WRITE; } break; case 47: /* priv_type ::= ALTER */ -{ yymsp[0].minor.yy777 = PRIVILEGE_TYPE_ALTER; } +{ yymsp[0].minor.yy709 = PRIVILEGE_TYPE_ALTER; } break; case 48: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy187.first = yymsp[-2].minor.yy0; yylhsminor.yy187.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy187 = yylhsminor.yy187; +{ yylhsminor.yy97.first = yymsp[-2].minor.yy0; yylhsminor.yy97.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy97 = yylhsminor.yy97; break; case 49: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy187.first = yymsp[-2].minor.yy803; yylhsminor.yy187.second = yymsp[0].minor.yy0; } - yymsp[-2].minor.yy187 = yylhsminor.yy187; +{ yylhsminor.yy97.first = yymsp[-2].minor.yy729; yylhsminor.yy97.second = yymsp[0].minor.yy0; } + yymsp[-2].minor.yy97 = yylhsminor.yy97; break; case 50: /* priv_level ::= db_name NK_DOT table_name */ -{ yylhsminor.yy187.first = yymsp[-2].minor.yy803; yylhsminor.yy187.second = yymsp[0].minor.yy803; } - yymsp[-2].minor.yy187 = yylhsminor.yy187; +{ yylhsminor.yy97.first = yymsp[-2].minor.yy729; yylhsminor.yy97.second = yymsp[0].minor.yy729; } + yymsp[-2].minor.yy97 = yylhsminor.yy97; break; case 51: /* priv_level ::= topic_name */ -{ yylhsminor.yy187.first = yymsp[0].minor.yy803; yylhsminor.yy187.second = nil_token; } - yymsp[0].minor.yy187 = yylhsminor.yy187; +{ yylhsminor.yy97.first = yymsp[0].minor.yy729; yylhsminor.yy97.second = nil_token; } + yymsp[0].minor.yy97 = yylhsminor.yy97; break; case 52: /* with_opt ::= */ case 157: /* start_opt ::= */ yytestcase(yyruleno==157); case 161: /* end_opt ::= */ yytestcase(yyruleno==161); - case 302: /* like_pattern_opt ::= */ yytestcase(yyruleno==302); - case 387: /* subtable_opt ::= */ yytestcase(yyruleno==387); - case 533: /* case_when_else_opt ::= */ yytestcase(yyruleno==533); - case 563: /* from_clause_opt ::= */ yytestcase(yyruleno==563); - case 590: /* join_on_clause_opt ::= */ yytestcase(yyruleno==590); - case 592: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==592); - case 596: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==596); - case 613: /* where_clause_opt ::= */ yytestcase(yyruleno==613); - case 622: /* twindow_clause_opt ::= */ yytestcase(yyruleno==622); - case 630: /* sliding_opt ::= */ yytestcase(yyruleno==630); - case 635: /* fill_opt ::= */ yytestcase(yyruleno==635); - case 649: /* having_clause_opt ::= */ yytestcase(yyruleno==649); - case 651: /* range_opt ::= */ yytestcase(yyruleno==651); - case 654: /* every_opt ::= */ yytestcase(yyruleno==654); - case 667: /* slimit_clause_opt ::= */ yytestcase(yyruleno==667); - case 671: /* limit_clause_opt ::= */ yytestcase(yyruleno==671); -{ yymsp[1].minor.yy614 = NULL; } + case 303: /* like_pattern_opt ::= */ yytestcase(yyruleno==303); + case 388: /* subtable_opt ::= */ yytestcase(yyruleno==388); + case 534: /* case_when_else_opt ::= */ yytestcase(yyruleno==534); + case 564: /* from_clause_opt ::= */ yytestcase(yyruleno==564); + case 591: /* join_on_clause_opt ::= */ yytestcase(yyruleno==591); + case 593: /* window_offset_clause_opt ::= */ yytestcase(yyruleno==593); + case 597: /* jlimit_clause_opt ::= */ yytestcase(yyruleno==597); + case 614: /* where_clause_opt ::= */ yytestcase(yyruleno==614); + case 623: /* twindow_clause_opt ::= */ yytestcase(yyruleno==623); + case 631: /* sliding_opt ::= */ yytestcase(yyruleno==631); + case 636: /* fill_opt ::= */ yytestcase(yyruleno==636); + case 650: /* having_clause_opt ::= */ yytestcase(yyruleno==650); + case 652: /* range_opt ::= */ yytestcase(yyruleno==652); + case 655: /* every_opt ::= */ yytestcase(yyruleno==655); + case 668: /* slimit_clause_opt ::= */ yytestcase(yyruleno==668); + case 672: /* limit_clause_opt ::= */ yytestcase(yyruleno==672); +{ yymsp[1].minor.yy1032 = NULL; } break; case 53: /* with_opt ::= WITH search_condition */ - case 564: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==564); - case 591: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==591); - case 614: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==614); - case 650: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==650); -{ yymsp[-1].minor.yy614 = yymsp[0].minor.yy614; } + case 565: /* from_clause_opt ::= FROM table_reference_list */ yytestcase(yyruleno==565); + case 592: /* join_on_clause_opt ::= ON search_condition */ yytestcase(yyruleno==592); + case 615: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==615); + case 651: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==651); +{ yymsp[-1].minor.yy1032 = yymsp[0].minor.yy1032; } break; case 54: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy803, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy729, NULL); } break; case 55: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0); } break; case 56: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy517, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy957, false); } break; case 57: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy517, false); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy729, yymsp[0].minor.yy957, false); } break; case 58: /* cmd ::= DROP DNODE NK_INTEGER unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy517); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, false, yymsp[0].minor.yy957); } break; case 59: /* cmd ::= DROP DNODE dnode_endpoint unsafe_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy803, false, yymsp[0].minor.yy517); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy729, false, yymsp[0].minor.yy957); } break; case 60: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -5162,57 +5141,57 @@ static YYACTIONTYPE yy_reduce( case 65: /* dnode_endpoint ::= NK_STRING */ case 66: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==66); case 67: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==67); - case 329: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==329); - case 330: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==330); - case 331: /* sma_func_name ::= LAST */ yytestcase(yyruleno==331); - case 332: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==332); - case 454: /* db_name ::= NK_ID */ yytestcase(yyruleno==454); - case 455: /* table_name ::= NK_ID */ yytestcase(yyruleno==455); - case 456: /* column_name ::= NK_ID */ yytestcase(yyruleno==456); - case 457: /* function_name ::= NK_ID */ yytestcase(yyruleno==457); - case 458: /* view_name ::= NK_ID */ yytestcase(yyruleno==458); - case 459: /* table_alias ::= NK_ID */ yytestcase(yyruleno==459); - case 460: /* column_alias ::= NK_ID */ yytestcase(yyruleno==460); - case 461: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==461); - case 462: /* user_name ::= NK_ID */ yytestcase(yyruleno==462); - case 463: /* topic_name ::= NK_ID */ yytestcase(yyruleno==463); - case 464: /* stream_name ::= NK_ID */ yytestcase(yyruleno==464); - case 465: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==465); - case 466: /* index_name ::= NK_ID */ yytestcase(yyruleno==466); - case 509: /* noarg_func ::= NOW */ yytestcase(yyruleno==509); - case 510: /* noarg_func ::= TODAY */ yytestcase(yyruleno==510); - case 511: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==511); - case 512: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==512); - case 513: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==513); - case 514: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==514); - case 515: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==515); - case 516: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==516); - case 517: /* noarg_func ::= USER */ yytestcase(yyruleno==517); - case 518: /* star_func ::= COUNT */ yytestcase(yyruleno==518); - case 519: /* star_func ::= FIRST */ yytestcase(yyruleno==519); - case 520: /* star_func ::= LAST */ yytestcase(yyruleno==520); - case 521: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==521); -{ yylhsminor.yy803 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy803 = yylhsminor.yy803; + case 330: /* sma_func_name ::= COUNT */ yytestcase(yyruleno==330); + case 331: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==331); + case 332: /* sma_func_name ::= LAST */ yytestcase(yyruleno==332); + case 333: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==333); + case 455: /* db_name ::= NK_ID */ yytestcase(yyruleno==455); + case 456: /* table_name ::= NK_ID */ yytestcase(yyruleno==456); + case 457: /* column_name ::= NK_ID */ yytestcase(yyruleno==457); + case 458: /* function_name ::= NK_ID */ yytestcase(yyruleno==458); + case 459: /* view_name ::= NK_ID */ yytestcase(yyruleno==459); + case 460: /* table_alias ::= NK_ID */ yytestcase(yyruleno==460); + case 461: /* column_alias ::= NK_ID */ yytestcase(yyruleno==461); + case 462: /* column_alias ::= NK_ALIAS */ yytestcase(yyruleno==462); + case 463: /* user_name ::= NK_ID */ yytestcase(yyruleno==463); + case 464: /* topic_name ::= NK_ID */ yytestcase(yyruleno==464); + case 465: /* stream_name ::= NK_ID */ yytestcase(yyruleno==465); + case 466: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==466); + case 467: /* index_name ::= NK_ID */ yytestcase(yyruleno==467); + case 510: /* noarg_func ::= NOW */ yytestcase(yyruleno==510); + case 511: /* noarg_func ::= TODAY */ yytestcase(yyruleno==511); + case 512: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==512); + case 513: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==513); + case 514: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==514); + case 515: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==515); + case 516: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==516); + case 517: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==517); + case 518: /* noarg_func ::= USER */ yytestcase(yyruleno==518); + case 519: /* star_func ::= COUNT */ yytestcase(yyruleno==519); + case 520: /* star_func ::= FIRST */ yytestcase(yyruleno==520); + case 521: /* star_func ::= LAST */ yytestcase(yyruleno==521); + case 522: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==522); +{ yylhsminor.yy729 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy729 = yylhsminor.yy729; break; case 68: /* force_opt ::= */ case 94: /* not_exists_opt ::= */ yytestcase(yyruleno==94); case 96: /* exists_opt ::= */ yytestcase(yyruleno==96); - case 350: /* analyze_opt ::= */ yytestcase(yyruleno==350); - case 357: /* agg_func_opt ::= */ yytestcase(yyruleno==357); - case 363: /* or_replace_opt ::= */ yytestcase(yyruleno==363); - case 389: /* ignore_opt ::= */ yytestcase(yyruleno==389); - case 601: /* tag_mode_opt ::= */ yytestcase(yyruleno==601); - case 603: /* set_quantifier_opt ::= */ yytestcase(yyruleno==603); -{ yymsp[1].minor.yy517 = false; } + case 351: /* analyze_opt ::= */ yytestcase(yyruleno==351); + case 358: /* agg_func_opt ::= */ yytestcase(yyruleno==358); + case 364: /* or_replace_opt ::= */ yytestcase(yyruleno==364); + case 390: /* ignore_opt ::= */ yytestcase(yyruleno==390); + case 602: /* tag_mode_opt ::= */ yytestcase(yyruleno==602); + case 604: /* set_quantifier_opt ::= */ yytestcase(yyruleno==604); +{ yymsp[1].minor.yy957 = false; } break; case 69: /* force_opt ::= FORCE */ case 70: /* unsafe_opt ::= UNSAFE */ yytestcase(yyruleno==70); - case 351: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==351); - case 358: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==358); - case 602: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==602); - case 604: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==604); -{ yymsp[0].minor.yy517 = true; } + case 352: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==352); + case 359: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==359); + case 603: /* tag_mode_opt ::= TAGS */ yytestcase(yyruleno==603); + case 605: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==605); +{ yymsp[0].minor.yy957 = true; } break; case 71: /* cmd ::= ALTER CLUSTER NK_STRING */ { pCxt->pRootNode = createAlterClusterStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -5260,241 +5239,241 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createRestoreComponentNodeStmt(pCxt, QUERY_NODE_RESTORE_VNODE_STMT, &yymsp[0].minor.yy0); } break; case 86: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy517, &yymsp[-1].minor.yy803, yymsp[0].minor.yy614); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy957, &yymsp[-1].minor.yy729, yymsp[0].minor.yy1032); } break; case 87: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; case 88: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy729); } break; case 89: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy614); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy729, yymsp[0].minor.yy1032); } break; case 90: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy729); } break; case 91: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy294); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy729, yymsp[0].minor.yy20); } break; case 92: /* cmd ::= COMPACT DATABASE db_name start_opt end_opt */ -{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy803, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } +{ pCxt->pRootNode = createCompactStmt(pCxt, &yymsp[-2].minor.yy729, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; case 93: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy517 = true; } +{ yymsp[-2].minor.yy957 = true; } break; case 95: /* exists_opt ::= IF EXISTS */ - case 364: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==364); - case 390: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==390); -{ yymsp[-1].minor.yy517 = true; } + case 365: /* or_replace_opt ::= OR REPLACE */ yytestcase(yyruleno==365); + case 391: /* ignore_opt ::= IGNORE UNTREATED */ yytestcase(yyruleno==391); +{ yymsp[-1].minor.yy957 = true; } break; case 97: /* db_options ::= */ -{ yymsp[1].minor.yy614 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy1032 = createDefaultDatabaseOptions(pCxt); } break; case 98: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 99: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 100: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 101: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 102: /* db_options ::= db_options DURATION NK_INTEGER */ case 103: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==103); -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 104: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 105: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 106: /* db_options ::= db_options KEEP integer_list */ case 107: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==107); -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_KEEP, yymsp[0].minor.yy608); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_KEEP, yymsp[0].minor.yy444); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 108: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 109: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 110: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 111: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 112: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 113: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 114: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 115: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_RETENTIONS, yymsp[0].minor.yy608); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_RETENTIONS, yymsp[0].minor.yy444); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 116: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 117: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 118: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 119: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 120: /* 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.yy614 = setDatabaseOption(pCxt, yymsp[-3].minor.yy614, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-3].minor.yy1032, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; case 121: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 122: /* 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.yy614 = setDatabaseOption(pCxt, yymsp[-3].minor.yy614, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-3].minor.yy1032, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; case 123: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 124: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 125: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 126: /* db_options ::= db_options TABLE_PREFIX signed */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy614); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_TABLE_PREFIX, yymsp[0].minor.yy1032); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 127: /* db_options ::= db_options TABLE_SUFFIX signed */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy614); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_TABLE_SUFFIX, yymsp[0].minor.yy1032); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 128: /* db_options ::= db_options KEEP_TIME_OFFSET NK_INTEGER */ -{ yylhsminor.yy614 = setDatabaseOption(pCxt, yymsp[-2].minor.yy614, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setDatabaseOption(pCxt, yymsp[-2].minor.yy1032, DB_OPTION_KEEP_TIME_OFFSET, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 129: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy614 = createAlterDatabaseOptions(pCxt); yylhsminor.yy614 = setAlterDatabaseOption(pCxt, yylhsminor.yy614, &yymsp[0].minor.yy511); } - yymsp[0].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterDatabaseOptions(pCxt); yylhsminor.yy1032 = setAlterDatabaseOption(pCxt, yylhsminor.yy1032, &yymsp[0].minor.yy505); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 130: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy614 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy614, &yymsp[0].minor.yy511); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy1032, &yymsp[0].minor.yy505); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; case 131: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 132: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 133: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 134: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 135: /* alter_db_option ::= KEEP integer_list */ case 136: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==136); -{ yymsp[-1].minor.yy511.type = DB_OPTION_KEEP; yymsp[-1].minor.yy511.pList = yymsp[0].minor.yy608; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_KEEP; yymsp[-1].minor.yy505.pList = yymsp[0].minor.yy444; } break; case 137: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_PAGES; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_PAGES; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 138: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 139: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_WAL; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 140: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 141: /* alter_db_option ::= MINROWS NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_MINROWS; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 142: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 143: /* alter_db_option ::= WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy511.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy511.val = t; + yymsp[-2].minor.yy505.type = DB_OPTION_WAL_RETENTION_PERIOD; yymsp[-2].minor.yy505.val = t; } break; case 144: /* alter_db_option ::= WAL_RETENTION_SIZE NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 145: /* alter_db_option ::= WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yymsp[-2].minor.yy511.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy511.val = t; + yymsp[-2].minor.yy505.type = DB_OPTION_WAL_RETENTION_SIZE; yymsp[-2].minor.yy505.val = t; } break; case 146: /* alter_db_option ::= KEEP_TIME_OFFSET NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = DB_OPTION_KEEP_TIME_OFFSET; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 147: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy608 = yylhsminor.yy608; +{ yylhsminor.yy444 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 148: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 403: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==403); -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; + case 404: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==404); +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; case 149: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy608 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy608 = yylhsminor.yy608; +{ yylhsminor.yy444 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 150: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; case 151: /* retention_list ::= retention */ case 182: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==182); @@ -5502,148 +5481,148 @@ static YYACTIONTYPE yy_reduce( case 192: /* column_def_list ::= column_def */ yytestcase(yyruleno==192); case 236: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==236); case 241: /* col_name_list ::= col_name */ yytestcase(yyruleno==241); - case 308: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==308); - case 325: /* func_list ::= func */ yytestcase(yyruleno==325); - case 427: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==427); - case 452: /* literal_list ::= signed_literal */ yytestcase(yyruleno==452); - case 524: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==524); - case 530: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==530); - case 606: /* select_list ::= select_item */ yytestcase(yyruleno==606); - case 617: /* partition_list ::= partition_item */ yytestcase(yyruleno==617); - case 678: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==678); -{ yylhsminor.yy608 = createNodeList(pCxt, yymsp[0].minor.yy614); } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 309: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==309); + case 326: /* func_list ::= func */ yytestcase(yyruleno==326); + case 428: /* tags_literal_list ::= tags_literal */ yytestcase(yyruleno==428); + case 453: /* literal_list ::= signed_literal */ yytestcase(yyruleno==453); + case 525: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==525); + case 531: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==531); + case 607: /* select_list ::= select_item */ yytestcase(yyruleno==607); + case 618: /* partition_list ::= partition_item */ yytestcase(yyruleno==618); + case 679: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==679); +{ yylhsminor.yy444 = createNodeList(pCxt, yymsp[0].minor.yy1032); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 152: /* retention_list ::= retention_list NK_COMMA retention */ case 186: /* multi_drop_clause ::= multi_drop_clause NK_COMMA drop_table_clause */ yytestcase(yyruleno==186); case 193: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==193); case 237: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==237); case 242: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==242); - case 309: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==309); - case 326: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==326); - case 428: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==428); - case 453: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==453); - case 525: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==525); - case 607: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==607); - case 618: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==618); - case 679: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==679); -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; + case 310: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==310); + case 327: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==327); + case 429: /* tags_literal_list ::= tags_literal_list NK_COMMA tags_literal */ yytestcase(yyruleno==429); + case 454: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==454); + case 526: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==526); + case 608: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==608); + case 619: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==619); + case 680: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==680); +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, yymsp[0].minor.yy1032); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; case 153: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ case 154: /* retention ::= NK_MINUS NK_COLON NK_VARIABLE */ yytestcase(yyruleno==154); -{ yylhsminor.yy614 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 155: /* speed_opt ::= */ - case 359: /* bufsize_opt ::= */ yytestcase(yyruleno==359); -{ yymsp[1].minor.yy294 = 0; } + case 360: /* bufsize_opt ::= */ yytestcase(yyruleno==360); +{ yymsp[1].minor.yy20 = 0; } break; case 156: /* speed_opt ::= BWLIMIT NK_INTEGER */ - case 360: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==360); -{ yymsp[-1].minor.yy294 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } + case 361: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==361); +{ yymsp[-1].minor.yy20 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 158: /* start_opt ::= START WITH NK_INTEGER */ case 162: /* end_opt ::= END WITH NK_INTEGER */ yytestcase(yyruleno==162); -{ yymsp[-2].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); } break; case 159: /* start_opt ::= START WITH NK_STRING */ case 163: /* end_opt ::= END WITH NK_STRING */ yytestcase(yyruleno==163); -{ yymsp[-2].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-2].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 160: /* start_opt ::= START WITH TIMESTAMP NK_STRING */ case 164: /* end_opt ::= END WITH TIMESTAMP NK_STRING */ yytestcase(yyruleno==164); -{ yymsp[-3].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } +{ yymsp[-3].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; case 165: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 167: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==167); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy517, yymsp[-5].minor.yy614, yymsp[-3].minor.yy608, yymsp[-1].minor.yy608, yymsp[0].minor.yy614); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy957, yymsp[-5].minor.yy1032, yymsp[-3].minor.yy444, yymsp[-1].minor.yy444, yymsp[0].minor.yy1032); } break; case 166: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy608); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy444); } break; case 168: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy608); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy444); } break; case 169: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy1032); } break; case 170: /* cmd ::= ALTER TABLE alter_table_clause */ - case 405: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==405); - case 406: /* cmd ::= insert_query */ yytestcase(yyruleno==406); -{ pCxt->pRootNode = yymsp[0].minor.yy614; } + case 406: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==406); + case 407: /* cmd ::= insert_query */ yytestcase(yyruleno==407); +{ pCxt->pRootNode = yymsp[0].minor.yy1032; } break; case 171: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy614); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy1032); } break; case 172: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy614 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; case 173: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy729, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 174: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy614 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy614, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy803); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy1032, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy729); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; case 175: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy729, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 176: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy614 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 177: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy729, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 178: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy614 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy614, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy803); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy1032, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy729); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; case 179: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy614 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy729, yymsp[0].minor.yy384); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 180: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy614 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy614, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy1032, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 181: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ tags_literal */ -{ yylhsminor.yy614 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy614, &yymsp[-2].minor.yy803, yymsp[0].minor.yy614); } - yymsp[-5].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy1032, &yymsp[-2].minor.yy729, yymsp[0].minor.yy1032); } + yymsp[-5].minor.yy1032 = yylhsminor.yy1032; break; case 183: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 531: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==531); -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-1].minor.yy608, yymsp[0].minor.yy614); } - yymsp[-1].minor.yy608 = yylhsminor.yy608; + case 532: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==532); +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-1].minor.yy444, yymsp[0].minor.yy1032); } + yymsp[-1].minor.yy444 = yylhsminor.yy444; break; case 184: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP tags_literal_list NK_RP table_options */ -{ yylhsminor.yy614 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy517, yymsp[-8].minor.yy614, yymsp[-6].minor.yy614, yymsp[-5].minor.yy608, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } - yymsp[-9].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy957, yymsp[-8].minor.yy1032, yymsp[-6].minor.yy1032, yymsp[-5].minor.yy444, yymsp[-2].minor.yy444, yymsp[0].minor.yy1032); } + yymsp[-9].minor.yy1032 = yylhsminor.yy1032; break; case 187: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy614 = createDropTableClause(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createDropTableClause(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy1032); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; case 189: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ - case 374: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==374); -{ yymsp[-2].minor.yy608 = yymsp[-1].minor.yy608; } + case 375: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==375); +{ yymsp[-2].minor.yy444 = yymsp[-1].minor.yy444; } break; case 190: /* full_table_name ::= table_name */ -{ yylhsminor.yy614 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy803, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy729, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 191: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy614 = createRealTableNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803, NULL); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createRealTableNode(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729, NULL); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 194: /* column_def ::= column_name type_name */ -{ yylhsminor.yy614 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy803, yymsp[0].minor.yy384, NULL); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy729, yymsp[0].minor.yy384, NULL); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; case 195: /* type_name ::= BOOL */ { yymsp[0].minor.yy384 = createDataType(TSDB_DATA_TYPE_BOOL); } @@ -5716,78 +5695,78 @@ static YYACTIONTYPE yy_reduce( { yymsp[-5].minor.yy384 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 221: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ - case 377: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==377); -{ yymsp[-3].minor.yy608 = yymsp[-1].minor.yy608; } + case 378: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==378); +{ yymsp[-3].minor.yy444 = yymsp[-1].minor.yy444; } break; case 222: /* table_options ::= */ -{ yymsp[1].minor.yy614 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy1032 = createDefaultTableOptions(pCxt); } break; case 223: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-2].minor.yy1032, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 224: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy608); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-2].minor.yy1032, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy444); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 225: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy608); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-2].minor.yy1032, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy444); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 226: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-4].minor.yy614, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy608); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-4].minor.yy1032, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy444); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 227: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-2].minor.yy1032, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 228: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-4].minor.yy614, TABLE_OPTION_SMA, yymsp[-1].minor.yy608); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-4].minor.yy1032, TABLE_OPTION_SMA, yymsp[-1].minor.yy444); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; case 229: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-2].minor.yy614, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy608); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-2].minor.yy1032, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy444); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; case 230: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy614 = createAlterTableOptions(pCxt); yylhsminor.yy614 = setTableOption(pCxt, yylhsminor.yy614, yymsp[0].minor.yy511.type, &yymsp[0].minor.yy511.val); } - yymsp[0].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createAlterTableOptions(pCxt); yylhsminor.yy1032 = setTableOption(pCxt, yylhsminor.yy1032, yymsp[0].minor.yy505.type, &yymsp[0].minor.yy505.val); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 231: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy614 = setTableOption(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy511.type, &yymsp[0].minor.yy511.val); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = setTableOption(pCxt, yymsp[-1].minor.yy1032, yymsp[0].minor.yy505.type, &yymsp[0].minor.yy505.val); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; case 232: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy511.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 233: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy511.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy511.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy505.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy505.val = yymsp[0].minor.yy0; } break; case 234: /* duration_list ::= duration_literal */ - case 484: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==484); -{ yylhsminor.yy608 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 485: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==485); +{ yylhsminor.yy444 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; case 235: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 485: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==485); -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; + case 486: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==486); +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; case 238: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[0].minor.yy803, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; +{ yylhsminor.yy1032 = createFunctionNode(pCxt, &yymsp[0].minor.yy729, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 239: /* rollup_func_name ::= FIRST */ case 240: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==240); - case 311: /* tag_item ::= QTAGS */ yytestcase(yyruleno==311); -{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 312: /* tag_item ::= QTAGS */ yytestcase(yyruleno==312); +{ yylhsminor.yy1032 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 243: /* col_name ::= column_name */ - case 312: /* tag_item ::= column_name */ yytestcase(yyruleno==312); -{ yylhsminor.yy614 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy803); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 313: /* tag_item ::= column_name */ yytestcase(yyruleno==313); +{ yylhsminor.yy1032 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy729); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; case 244: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -5801,19 +5780,19 @@ static YYACTIONTYPE yy_reduce( case 247: /* cmd ::= SHOW db_kind_opt DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); - setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy769); + setShowKind(pCxt, pCxt->pRootNode, yymsp[-1].minor.yy329); } break; case 248: /* cmd ::= SHOW table_kind_db_name_cond_opt TABLES like_pattern_opt */ { - pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy131, yymsp[0].minor.yy614, OP_TYPE_LIKE); + pCxt->pRootNode = createShowTablesStmt(pCxt, yymsp[-2].minor.yy677, yymsp[0].minor.yy1032, OP_TYPE_LIKE); } break; case 249: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032, OP_TYPE_LIKE); } break; case 250: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy614, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy1032, NULL, OP_TYPE_LIKE); } break; case 251: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -5821,1073 +5800,1076 @@ static YYACTIONTYPE yy_reduce( case 252: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 253: /* cmd ::= SHOW FUNCTIONS */ + case 253: /* cmd ::= SHOW ARBGROUPS */ +{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_ARBGROUPS_STMT); } + break; + case 254: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 254: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy614, yymsp[-1].minor.yy614, OP_TYPE_EQUAL); } + case 255: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy1032, yymsp[-1].minor.yy1032, OP_TYPE_EQUAL); } break; - case 255: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), OP_TYPE_EQUAL); } + case 256: /* cmd ::= SHOW INDEXES FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy729), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy729), OP_TYPE_EQUAL); } break; - case 256: /* cmd ::= SHOW STREAMS */ + case 257: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 257: /* cmd ::= SHOW ACCOUNTS */ + case 258: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 258: /* cmd ::= SHOW APPS */ + case 259: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 259: /* cmd ::= SHOW CONNECTIONS */ + case 260: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 260: /* cmd ::= SHOW LICENCES */ - case 261: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==261); + case 261: /* cmd ::= SHOW LICENCES */ + case 262: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==262); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 262: /* cmd ::= SHOW GRANTS FULL */ + case 263: /* cmd ::= SHOW GRANTS FULL */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_FULL_STMT); } break; - case 263: /* cmd ::= SHOW GRANTS LOGS */ + case 264: /* cmd ::= SHOW GRANTS LOGS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_GRANTS_LOGS_STMT); } break; - case 264: /* cmd ::= SHOW CLUSTER MACHINES */ + case 265: /* cmd ::= SHOW CLUSTER MACHINES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_MACHINES_STMT); } break; - case 265: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy803); } + case 266: /* cmd ::= SHOW CREATE DATABASE db_name */ +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy729); } break; - case 266: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy614); } + case 267: /* cmd ::= SHOW CREATE TABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy1032); } break; - case 267: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy614); } + case 268: /* cmd ::= SHOW CREATE STABLE full_table_name */ +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy1032); } break; - case 268: /* cmd ::= SHOW QUERIES */ + case 269: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 269: /* cmd ::= SHOW SCORES */ + case 270: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 270: /* cmd ::= SHOW TOPICS */ + case 271: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 271: /* cmd ::= SHOW VARIABLES */ - case 272: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==272); + case 272: /* cmd ::= SHOW VARIABLES */ + case 273: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==273); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 273: /* cmd ::= SHOW LOCAL VARIABLES */ + case 274: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 274: /* 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.yy614); } + case 275: /* 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.yy1032); } break; - case 275: /* cmd ::= SHOW BNODES */ + case 276: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 276: /* cmd ::= SHOW SNODES */ + case 277: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 277: /* cmd ::= SHOW CLUSTER */ + case 278: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 278: /* cmd ::= SHOW TRANSACTIONS */ + case 279: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 279: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy614); } + case 280: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy1032); } break; - case 280: /* cmd ::= SHOW CONSUMERS */ + case 281: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 281: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 282: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 282: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy614, yymsp[-1].minor.yy614, OP_TYPE_EQUAL); } + case 283: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy1032, yymsp[-1].minor.yy1032, OP_TYPE_EQUAL); } break; - case 283: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), OP_TYPE_EQUAL); } + case 284: /* cmd ::= SHOW TAGS FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy729), createIdentifierValueNode(pCxt, &yymsp[0].minor.yy729), OP_TYPE_EQUAL); } break; - case 284: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614, yymsp[-3].minor.yy608); } + case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032, yymsp[-3].minor.yy444); } break; - case 285: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy803), yymsp[-4].minor.yy608); } + case 286: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM db_name NK_DOT table_name */ +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, createIdentifierValueNode(pCxt, &yymsp[0].minor.yy729), createIdentifierValueNode(pCxt, &yymsp[-2].minor.yy729), yymsp[-4].minor.yy444); } break; - case 286: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ + case 287: /* cmd ::= SHOW VNODES ON DNODE NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 287: /* cmd ::= SHOW VNODES */ + case 288: /* cmd ::= SHOW VNODES */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, NULL); } break; - case 288: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy614, QUERY_NODE_SHOW_DB_ALIVE_STMT); } + case 289: /* cmd ::= SHOW db_name_cond_opt ALIVE */ +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy1032, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; - case 289: /* cmd ::= SHOW CLUSTER ALIVE */ + case 290: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; - case 290: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, OP_TYPE_LIKE); } + case 291: /* cmd ::= SHOW db_name_cond_opt VIEWS like_pattern_opt */ +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VIEWS_STMT, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032, OP_TYPE_LIKE); } break; - case 291: /* cmd ::= SHOW CREATE VIEW full_table_name */ -{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy614); } + case 292: /* cmd ::= SHOW CREATE VIEW full_table_name */ +{ pCxt->pRootNode = createShowCreateViewStmt(pCxt, QUERY_NODE_SHOW_CREATE_VIEW_STMT, yymsp[0].minor.yy1032); } break; - case 292: /* cmd ::= SHOW COMPACTS */ + case 293: /* cmd ::= SHOW COMPACTS */ { pCxt->pRootNode = createShowCompactsStmt(pCxt, QUERY_NODE_SHOW_COMPACTS_STMT); } break; - case 293: /* cmd ::= SHOW COMPACT NK_INTEGER */ + case 294: /* cmd ::= SHOW COMPACT NK_INTEGER */ { pCxt->pRootNode = createShowCompactDetailsStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 294: /* table_kind_db_name_cond_opt ::= */ -{ yymsp[1].minor.yy131.kind = SHOW_KIND_ALL; yymsp[1].minor.yy131.dbName = nil_token; } + case 295: /* table_kind_db_name_cond_opt ::= */ +{ yymsp[1].minor.yy677.kind = SHOW_KIND_ALL; yymsp[1].minor.yy677.dbName = nil_token; } break; - case 295: /* table_kind_db_name_cond_opt ::= table_kind */ -{ yylhsminor.yy131.kind = yymsp[0].minor.yy769; yylhsminor.yy131.dbName = nil_token; } - yymsp[0].minor.yy131 = yylhsminor.yy131; + case 296: /* table_kind_db_name_cond_opt ::= table_kind */ +{ yylhsminor.yy677.kind = yymsp[0].minor.yy329; yylhsminor.yy677.dbName = nil_token; } + yymsp[0].minor.yy677 = yylhsminor.yy677; break; - case 296: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy131.kind = SHOW_KIND_ALL; yylhsminor.yy131.dbName = yymsp[-1].minor.yy803; } - yymsp[-1].minor.yy131 = yylhsminor.yy131; + case 297: /* table_kind_db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy677.kind = SHOW_KIND_ALL; yylhsminor.yy677.dbName = yymsp[-1].minor.yy729; } + yymsp[-1].minor.yy677 = yylhsminor.yy677; break; - case 297: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ -{ yylhsminor.yy131.kind = yymsp[-2].minor.yy769; yylhsminor.yy131.dbName = yymsp[-1].minor.yy803; } - yymsp[-2].minor.yy131 = yylhsminor.yy131; + case 298: /* table_kind_db_name_cond_opt ::= table_kind db_name NK_DOT */ +{ yylhsminor.yy677.kind = yymsp[-2].minor.yy329; yylhsminor.yy677.dbName = yymsp[-1].minor.yy729; } + yymsp[-2].minor.yy677 = yylhsminor.yy677; break; - case 298: /* table_kind ::= NORMAL */ -{ yymsp[0].minor.yy769 = SHOW_KIND_TABLES_NORMAL; } + case 299: /* table_kind ::= NORMAL */ +{ yymsp[0].minor.yy329 = SHOW_KIND_TABLES_NORMAL; } break; - case 299: /* table_kind ::= CHILD */ -{ yymsp[0].minor.yy769 = SHOW_KIND_TABLES_CHILD; } + case 300: /* table_kind ::= CHILD */ +{ yymsp[0].minor.yy329 = SHOW_KIND_TABLES_CHILD; } break; - case 300: /* db_name_cond_opt ::= */ - case 305: /* from_db_opt ::= */ yytestcase(yyruleno==305); -{ yymsp[1].minor.yy614 = createDefaultDatabaseCondValue(pCxt); } + case 301: /* db_name_cond_opt ::= */ + case 306: /* from_db_opt ::= */ yytestcase(yyruleno==306); +{ yymsp[1].minor.yy1032 = createDefaultDatabaseCondValue(pCxt); } break; - case 301: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy614 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy803); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 302: /* db_name_cond_opt ::= db_name NK_DOT */ +{ yylhsminor.yy1032 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy729); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 303: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + case 304: /* like_pattern_opt ::= LIKE NK_STRING */ +{ yymsp[-1].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 304: /* table_name_cond ::= table_name */ -{ yylhsminor.yy614 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 305: /* table_name_cond ::= table_name */ +{ yylhsminor.yy1032 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy729); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 306: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy614 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy803); } + case 307: /* from_db_opt ::= FROM db_name */ +{ yymsp[-1].minor.yy1032 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy729); } break; - case 310: /* tag_item ::= TBNAME */ -{ yylhsminor.yy614 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 311: /* tag_item ::= TBNAME */ +{ yylhsminor.yy1032 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 313: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy614 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy803), &yymsp[0].minor.yy803); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 314: /* tag_item ::= column_name column_alias */ +{ yylhsminor.yy1032 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy729), &yymsp[0].minor.yy729); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 314: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy614 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy803), &yymsp[0].minor.yy803); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 315: /* tag_item ::= column_name AS column_alias */ +{ yylhsminor.yy1032 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy729), &yymsp[0].minor.yy729); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 315: /* db_kind_opt ::= */ -{ yymsp[1].minor.yy769 = SHOW_KIND_ALL; } + case 316: /* db_kind_opt ::= */ +{ yymsp[1].minor.yy329 = SHOW_KIND_ALL; } break; - case 316: /* db_kind_opt ::= USER */ -{ yymsp[0].minor.yy769 = SHOW_KIND_DATABASES_USER; } + case 317: /* db_kind_opt ::= USER */ +{ yymsp[0].minor.yy329 = SHOW_KIND_DATABASES_USER; } break; - case 317: /* db_kind_opt ::= SYSTEM */ -{ yymsp[0].minor.yy769 = SHOW_KIND_DATABASES_SYSTEM; } + case 318: /* db_kind_opt ::= SYSTEM */ +{ yymsp[0].minor.yy329 = SHOW_KIND_DATABASES_SYSTEM; } break; - case 318: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy517, yymsp[-3].minor.yy614, yymsp[-1].minor.yy614, NULL, yymsp[0].minor.yy614); } + case 319: /* cmd ::= CREATE SMA INDEX not_exists_opt col_name ON full_table_name index_options */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy957, yymsp[-3].minor.yy1032, yymsp[-1].minor.yy1032, NULL, yymsp[0].minor.yy1032); } break; - case 319: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy517, yymsp[-5].minor.yy614, yymsp[-3].minor.yy614, yymsp[-1].minor.yy608, NULL); } + case 320: /* cmd ::= CREATE INDEX not_exists_opt col_name ON full_table_name NK_LP col_name_list NK_RP */ +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy957, yymsp[-5].minor.yy1032, yymsp[-3].minor.yy1032, yymsp[-1].minor.yy444, NULL); } break; - case 320: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } + case 321: /* cmd ::= DROP INDEX exists_opt full_index_name */ +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy1032); } break; - case 321: /* full_index_name ::= index_name */ -{ yylhsminor.yy614 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy803); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 322: /* full_index_name ::= index_name */ +{ yylhsminor.yy1032 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy729); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 322: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy614 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 323: /* full_index_name ::= db_name NK_DOT index_name */ +{ yylhsminor.yy1032 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 323: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy614 = createIndexOption(pCxt, yymsp[-7].minor.yy608, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 324: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ +{ yymsp[-9].minor.yy1032 = createIndexOption(pCxt, yymsp[-7].minor.yy444, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), NULL, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 324: /* 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.yy614 = createIndexOption(pCxt, yymsp[-9].minor.yy608, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 325: /* 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.yy1032 = createIndexOption(pCxt, yymsp[-9].minor.yy444, releaseRawExprNode(pCxt, yymsp[-5].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 327: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy614 = createFunctionNode(pCxt, &yymsp[-3].minor.yy803, yymsp[-1].minor.yy608); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 328: /* func ::= sma_func_name NK_LP expression_list NK_RP */ +{ yylhsminor.yy1032 = createFunctionNode(pCxt, &yymsp[-3].minor.yy729, yymsp[-1].minor.yy444); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 328: /* sma_func_name ::= function_name */ - case 574: /* alias_opt ::= table_alias */ yytestcase(yyruleno==574); -{ yylhsminor.yy803 = yymsp[0].minor.yy803; } - yymsp[0].minor.yy803 = yylhsminor.yy803; + case 329: /* sma_func_name ::= function_name */ + case 575: /* alias_opt ::= table_alias */ yytestcase(yyruleno==575); +{ yylhsminor.yy729 = yymsp[0].minor.yy729; } + yymsp[0].minor.yy729 = yylhsminor.yy729; break; - case 333: /* sma_stream_opt ::= */ - case 378: /* stream_options ::= */ yytestcase(yyruleno==378); -{ yymsp[1].minor.yy614 = createStreamOptions(pCxt); } + case 334: /* sma_stream_opt ::= */ + case 379: /* stream_options ::= */ yytestcase(yyruleno==379); +{ yymsp[1].minor.yy1032 = createStreamOptions(pCxt); } break; - case 334: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 335: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy1032)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy1032); yylhsminor.yy1032 = yymsp[-2].minor.yy1032; } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 335: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 336: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy1032)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy1032); yylhsminor.yy1032 = yymsp[-2].minor.yy1032; } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 336: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy614)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); yylhsminor.yy614 = yymsp[-2].minor.yy614; } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 337: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ +{ ((SStreamOptions*)yymsp[-2].minor.yy1032)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy1032); yylhsminor.yy1032 = yymsp[-2].minor.yy1032; } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 337: /* with_meta ::= AS */ -{ yymsp[0].minor.yy294 = 0; } + case 338: /* with_meta ::= AS */ +{ yymsp[0].minor.yy20 = 0; } break; - case 338: /* with_meta ::= WITH META AS */ -{ yymsp[-2].minor.yy294 = 1; } + case 339: /* with_meta ::= WITH META AS */ +{ yymsp[-2].minor.yy20 = 1; } break; - case 339: /* with_meta ::= ONLY META AS */ -{ yymsp[-2].minor.yy294 = 2; } + case 340: /* with_meta ::= ONLY META AS */ +{ yymsp[-2].minor.yy20 = 2; } break; - case 340: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy517, &yymsp[-2].minor.yy803, yymsp[0].minor.yy614); } + case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy729, yymsp[0].minor.yy1032); } break; - case 341: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy517, &yymsp[-3].minor.yy803, &yymsp[0].minor.yy803, yymsp[-2].minor.yy294); } + case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta DATABASE db_name */ +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy957, &yymsp[-3].minor.yy729, &yymsp[0].minor.yy729, yymsp[-2].minor.yy20); } break; - case 342: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy517, &yymsp[-4].minor.yy803, yymsp[-1].minor.yy614, yymsp[-3].minor.yy294, yymsp[0].minor.yy614); } + case 343: /* cmd ::= CREATE TOPIC not_exists_opt topic_name with_meta STABLE full_table_name where_clause_opt */ +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-5].minor.yy957, &yymsp[-4].minor.yy729, yymsp[-1].minor.yy1032, yymsp[-3].minor.yy20, yymsp[0].minor.yy1032); } break; - case 343: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } + case 344: /* cmd ::= DROP TOPIC exists_opt topic_name */ +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; - case 344: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy517, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } + case 345: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy957, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729); } break; - case 345: /* cmd ::= DESC full_table_name */ - case 346: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==346); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy614); } + case 346: /* cmd ::= DESC full_table_name */ + case 347: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==347); +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy1032); } break; - case 347: /* cmd ::= RESET QUERY CACHE */ + case 348: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 348: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - case 349: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==349); -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy517, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 349: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 350: /* cmd ::= EXPLAIN analyze_opt explain_options insert_query */ yytestcase(yyruleno==350); +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 352: /* explain_options ::= */ -{ yymsp[1].minor.yy614 = createDefaultExplainOptions(pCxt); } + case 353: /* explain_options ::= */ +{ yymsp[1].minor.yy1032 = createDefaultExplainOptions(pCxt); } break; - case 353: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy614 = setExplainVerbose(pCxt, yymsp[-2].minor.yy614, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 354: /* explain_options ::= explain_options VERBOSE NK_BOOL */ +{ yylhsminor.yy1032 = setExplainVerbose(pCxt, yymsp[-2].minor.yy1032, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 354: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy614 = setExplainRatio(pCxt, yymsp[-2].minor.yy614, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 355: /* explain_options ::= explain_options RATIO NK_FLOAT */ +{ yylhsminor.yy1032 = setExplainRatio(pCxt, yymsp[-2].minor.yy1032, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 355: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy517, yymsp[-9].minor.yy517, &yymsp[-6].minor.yy803, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy384, yymsp[-1].minor.yy294, &yymsp[0].minor.yy803, yymsp[-10].minor.yy517); } + case 356: /* cmd ::= CREATE or_replace_opt agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt language_opt */ +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy957, yymsp[-9].minor.yy957, &yymsp[-6].minor.yy729, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy384, yymsp[-1].minor.yy20, &yymsp[0].minor.yy729, yymsp[-10].minor.yy957); } break; - case 356: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } + case 357: /* cmd ::= DROP FUNCTION exists_opt function_name */ +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; - case 361: /* language_opt ::= */ - case 400: /* on_vgroup_id ::= */ yytestcase(yyruleno==400); -{ yymsp[1].minor.yy803 = nil_token; } + case 362: /* language_opt ::= */ + case 401: /* on_vgroup_id ::= */ yytestcase(yyruleno==401); +{ yymsp[1].minor.yy729 = nil_token; } break; - case 362: /* language_opt ::= LANGUAGE NK_STRING */ - case 401: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==401); -{ yymsp[-1].minor.yy803 = yymsp[0].minor.yy0; } + case 363: /* language_opt ::= LANGUAGE NK_STRING */ + case 402: /* on_vgroup_id ::= ON NK_INTEGER */ yytestcase(yyruleno==402); +{ yymsp[-1].minor.yy729 = yymsp[0].minor.yy0; } break; - case 365: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy517, yymsp[-2].minor.yy614, &yymsp[-1].minor.yy0, yymsp[0].minor.yy614); } + case 366: /* cmd ::= CREATE or_replace_opt VIEW full_view_name AS query_or_subquery */ +{ pCxt->pRootNode = createCreateViewStmt(pCxt, yymsp[-4].minor.yy957, yymsp[-2].minor.yy1032, &yymsp[-1].minor.yy0, yymsp[0].minor.yy1032); } break; - case 366: /* cmd ::= DROP VIEW exists_opt full_view_name */ -{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy517, yymsp[0].minor.yy614); } + case 367: /* cmd ::= DROP VIEW exists_opt full_view_name */ +{ pCxt->pRootNode = createDropViewStmt(pCxt, yymsp[-1].minor.yy957, yymsp[0].minor.yy1032); } break; - case 367: /* full_view_name ::= view_name */ -{ yylhsminor.yy614 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy803); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 368: /* full_view_name ::= view_name */ +{ yylhsminor.yy1032 = createViewNode(pCxt, NULL, &yymsp[0].minor.yy729); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 368: /* full_view_name ::= db_name NK_DOT view_name */ -{ yylhsminor.yy614 = createViewNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 369: /* full_view_name ::= db_name NK_DOT view_name */ +{ yylhsminor.yy1032 = createViewNode(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 369: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy517, &yymsp[-8].minor.yy803, yymsp[-5].minor.yy614, yymsp[-7].minor.yy614, yymsp[-3].minor.yy608, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, yymsp[-4].minor.yy608); } + case 370: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy957, &yymsp[-8].minor.yy729, yymsp[-5].minor.yy1032, yymsp[-7].minor.yy1032, yymsp[-3].minor.yy444, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032, yymsp[-4].minor.yy444); } break; - case 370: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } + case 371: /* cmd ::= DROP STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; - case 371: /* cmd ::= PAUSE STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } + case 372: /* cmd ::= PAUSE STREAM exists_opt stream_name */ +{ pCxt->pRootNode = createPauseStreamStmt(pCxt, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; - case 372: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ -{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy517, yymsp[-1].minor.yy517, &yymsp[0].minor.yy803); } + case 373: /* cmd ::= RESUME STREAM exists_opt ignore_opt stream_name */ +{ pCxt->pRootNode = createResumeStreamStmt(pCxt, yymsp[-2].minor.yy957, yymsp[-1].minor.yy957, &yymsp[0].minor.yy729); } break; - case 379: /* stream_options ::= stream_options TRIGGER AT_ONCE */ - case 380: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==380); -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 380: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 381: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ yytestcase(yyruleno==381); +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-2].minor.yy1032, SOPT_TRIGGER_TYPE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 381: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 382: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-3].minor.yy1032, SOPT_TRIGGER_TYPE_SET, &yymsp[-1].minor.yy0, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 382: /* stream_options ::= stream_options WATERMARK duration_literal */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 383: /* stream_options ::= stream_options WATERMARK duration_literal */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-2].minor.yy1032, SOPT_WATERMARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 383: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 384: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-3].minor.yy1032, SOPT_IGNORE_EXPIRED_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 384: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 385: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-2].minor.yy1032, SOPT_FILL_HISTORY_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 385: /* stream_options ::= stream_options DELETE_MARK duration_literal */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-2].minor.yy614, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 386: /* stream_options ::= stream_options DELETE_MARK duration_literal */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-2].minor.yy1032, SOPT_DELETE_MARK_SET, NULL, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 386: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ -{ yylhsminor.yy614 = setStreamOptions(pCxt, yymsp[-3].minor.yy614, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 387: /* stream_options ::= stream_options IGNORE UPDATE NK_INTEGER */ +{ yylhsminor.yy1032 = setStreamOptions(pCxt, yymsp[-3].minor.yy1032, SOPT_IGNORE_UPDATE_SET, &yymsp[0].minor.yy0, NULL); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 388: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 631: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==631); - case 655: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==655); -{ yymsp[-3].minor.yy614 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy614); } + case 389: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 632: /* sliding_opt ::= SLIDING NK_LP interval_sliding_duration_literal NK_RP */ yytestcase(yyruleno==632); + case 656: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==656); +{ yymsp[-3].minor.yy1032 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032); } break; - case 391: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 392: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 392: /* cmd ::= KILL QUERY NK_STRING */ + case 393: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 393: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 394: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 394: /* cmd ::= KILL COMPACT NK_INTEGER */ + case 395: /* cmd ::= KILL COMPACT NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_COMPACT_STMT, &yymsp[0].minor.yy0); } break; - case 395: /* cmd ::= BALANCE VGROUP */ + case 396: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 396: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ -{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy803); } + case 397: /* cmd ::= BALANCE VGROUP LEADER on_vgroup_id */ +{ pCxt->pRootNode = createBalanceVgroupLeaderStmt(pCxt, &yymsp[0].minor.yy729); } break; - case 397: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 398: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 398: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy608); } + case 399: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy444); } break; - case 399: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 400: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 402: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy608 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 403: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy444 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 404: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 405: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 407: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ yymsp[-6].minor.yy614 = createInsertStmt(pCxt, yymsp[-4].minor.yy614, yymsp[-2].minor.yy608, yymsp[0].minor.yy614); } + case 408: /* insert_query ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ yymsp[-6].minor.yy1032 = createInsertStmt(pCxt, yymsp[-4].minor.yy1032, yymsp[-2].minor.yy444, yymsp[0].minor.yy1032); } break; - case 408: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ -{ yymsp[-3].minor.yy614 = createInsertStmt(pCxt, yymsp[-1].minor.yy614, NULL, yymsp[0].minor.yy614); } + case 409: /* insert_query ::= INSERT INTO full_table_name query_or_subquery */ +{ yymsp[-3].minor.yy1032 = createInsertStmt(pCxt, yymsp[-1].minor.yy1032, NULL, yymsp[0].minor.yy1032); } break; - case 409: /* tags_literal ::= NK_INTEGER */ - case 415: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==415); - case 418: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==418); -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 410: /* tags_literal ::= NK_INTEGER */ + case 416: /* tags_literal ::= NK_BIN */ yytestcase(yyruleno==416); + case 419: /* tags_literal ::= NK_HEX */ yytestcase(yyruleno==419); +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 410: /* tags_literal ::= NK_PLUS NK_INTEGER */ - case 411: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==411); - case 416: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==416); - case 417: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==417); - case 419: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==419); - case 420: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==420); + case 411: /* tags_literal ::= NK_PLUS NK_INTEGER */ + case 412: /* tags_literal ::= NK_MINUS NK_INTEGER */ yytestcase(yyruleno==412); + case 417: /* tags_literal ::= NK_PLUS NK_BIN */ yytestcase(yyruleno==417); + case 418: /* tags_literal ::= NK_MINUS NK_BIN */ yytestcase(yyruleno==418); + case 420: /* tags_literal ::= NK_PLUS NK_HEX */ yytestcase(yyruleno==420); + case 421: /* tags_literal ::= NK_MINUS NK_HEX */ yytestcase(yyruleno==421); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); + yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &t, NULL); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 412: /* tags_literal ::= NK_FLOAT */ -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 413: /* tags_literal ::= NK_FLOAT */ +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 413: /* tags_literal ::= NK_PLUS NK_FLOAT */ - case 414: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==414); + case 414: /* tags_literal ::= NK_PLUS NK_FLOAT */ + case 415: /* tags_literal ::= NK_MINUS NK_FLOAT */ yytestcase(yyruleno==415); { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); + yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t, NULL); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 421: /* tags_literal ::= NK_STRING */ -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 422: /* tags_literal ::= NK_STRING */ +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 422: /* tags_literal ::= NK_BOOL */ -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 423: /* tags_literal ::= NK_BOOL */ +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 423: /* tags_literal ::= NULL */ -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 424: /* tags_literal ::= NULL */ +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 424: /* tags_literal ::= literal_func */ -{ yylhsminor.yy614 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy614); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 425: /* tags_literal ::= literal_func */ +{ yylhsminor.yy1032 = createRawValueNode(pCxt, TSDB_DATA_TYPE_BINARY, NULL, yymsp[0].minor.yy1032); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 425: /* tags_literal ::= literal_func NK_PLUS duration_literal */ - case 426: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==426); + case 426: /* tags_literal ::= literal_func NK_PLUS duration_literal */ + case 427: /* tags_literal ::= literal_func NK_MINUS duration_literal */ yytestcase(yyruleno==427); { - SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); + SToken l = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken r = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); l.n = (r.z + r.n) - l.z; - yylhsminor.yy614 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy614, yymsp[0].minor.yy614); + yylhsminor.yy1032 = createRawValueNodeExt(pCxt, TSDB_DATA_TYPE_BINARY, &l, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 429: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 430: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 430: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 431: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 431: /* literal ::= NK_STRING */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 432: /* literal ::= NK_STRING */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 432: /* literal ::= NK_BOOL */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 433: /* literal ::= NK_BOOL */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 433: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 434: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 434: /* literal ::= duration_literal */ - case 444: /* signed_literal ::= signed */ yytestcase(yyruleno==444); - case 467: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==467); - case 468: /* expression ::= literal */ yytestcase(yyruleno==468); - case 470: /* expression ::= column_reference */ yytestcase(yyruleno==470); - case 471: /* expression ::= function_expression */ yytestcase(yyruleno==471); - case 472: /* expression ::= case_when_expression */ yytestcase(yyruleno==472); - case 505: /* function_expression ::= literal_func */ yytestcase(yyruleno==505); - case 555: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==555); - case 559: /* boolean_primary ::= predicate */ yytestcase(yyruleno==559); - case 561: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==561); - case 562: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==562); - case 565: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==565); - case 567: /* table_reference ::= table_primary */ yytestcase(yyruleno==567); - case 568: /* table_reference ::= joined_table */ yytestcase(yyruleno==568); - case 572: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==572); - case 657: /* query_simple ::= query_specification */ yytestcase(yyruleno==657); - case 658: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==658); - case 661: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==661); - case 663: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==663); -{ yylhsminor.yy614 = yymsp[0].minor.yy614; } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 435: /* literal ::= duration_literal */ + case 445: /* signed_literal ::= signed */ yytestcase(yyruleno==445); + case 468: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==468); + case 469: /* expression ::= literal */ yytestcase(yyruleno==469); + case 471: /* expression ::= column_reference */ yytestcase(yyruleno==471); + case 472: /* expression ::= function_expression */ yytestcase(yyruleno==472); + case 473: /* expression ::= case_when_expression */ yytestcase(yyruleno==473); + case 506: /* function_expression ::= literal_func */ yytestcase(yyruleno==506); + case 556: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==556); + case 560: /* boolean_primary ::= predicate */ yytestcase(yyruleno==560); + case 562: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==562); + case 563: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==563); + case 566: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==566); + case 568: /* table_reference ::= table_primary */ yytestcase(yyruleno==568); + case 569: /* table_reference ::= joined_table */ yytestcase(yyruleno==569); + case 573: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==573); + case 658: /* query_simple ::= query_specification */ yytestcase(yyruleno==658); + case 659: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==659); + case 662: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==662); + case 664: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==664); +{ yylhsminor.yy1032 = yymsp[0].minor.yy1032; } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 435: /* literal ::= NULL */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 436: /* literal ::= NULL */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 436: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 437: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 437: /* duration_literal ::= NK_VARIABLE */ - case 632: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==632); - case 633: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==633); - case 634: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==634); -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 438: /* duration_literal ::= NK_VARIABLE */ + case 633: /* interval_sliding_duration_literal ::= NK_VARIABLE */ yytestcase(yyruleno==633); + case 634: /* interval_sliding_duration_literal ::= NK_STRING */ yytestcase(yyruleno==634); + case 635: /* interval_sliding_duration_literal ::= NK_INTEGER */ yytestcase(yyruleno==635); +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 438: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 439: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 439: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 440: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 440: /* signed ::= NK_MINUS NK_INTEGER */ + case 441: /* 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.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 441: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 442: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 442: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 443: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 443: /* signed ::= NK_MINUS NK_FLOAT */ + case 444: /* 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.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 445: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 446: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 446: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 447: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 447: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 448: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 448: /* signed_literal ::= duration_literal */ - case 450: /* signed_literal ::= literal_func */ yytestcase(yyruleno==450); - case 526: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==526); - case 609: /* select_item ::= common_expression */ yytestcase(yyruleno==609); - case 619: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==619); - case 662: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==662); - case 664: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==664); - case 677: /* search_condition ::= common_expression */ yytestcase(yyruleno==677); -{ yylhsminor.yy614 = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 449: /* signed_literal ::= duration_literal */ + case 451: /* signed_literal ::= literal_func */ yytestcase(yyruleno==451); + case 527: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==527); + case 610: /* select_item ::= common_expression */ yytestcase(yyruleno==610); + case 620: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==620); + case 663: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==663); + case 665: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==665); + case 678: /* search_condition ::= common_expression */ yytestcase(yyruleno==678); +{ yylhsminor.yy1032 = releaseRawExprNode(pCxt, yymsp[0].minor.yy1032); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 449: /* signed_literal ::= NULL */ -{ yylhsminor.yy614 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 450: /* signed_literal ::= NULL */ +{ yylhsminor.yy1032 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 451: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy614 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 452: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy1032 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 469: /* expression ::= pseudo_column */ -{ yylhsminor.yy614 = yymsp[0].minor.yy614; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy614, true); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 470: /* expression ::= pseudo_column */ +{ yylhsminor.yy1032 = yymsp[0].minor.yy1032; setRawExprNodeIsPseudoColumn(pCxt, yylhsminor.yy1032, true); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 473: /* expression ::= NK_LP expression NK_RP */ - case 560: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==560); - case 676: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==676); -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 474: /* expression ::= NK_LP expression NK_RP */ + case 561: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==561); + case 677: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==677); +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 474: /* expression ::= NK_PLUS expr_or_subquery */ + case 475: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 475: /* expression ::= NK_MINUS expr_or_subquery */ + case 476: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy614), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032), NULL)); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 476: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 477: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 477: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 478: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 478: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 479: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 479: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 480: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 480: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 481: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 481: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 482: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 482: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 483: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 483: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 484: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 486: /* column_reference ::= column_name */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy803, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy803)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 487: /* column_reference ::= column_name */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy729, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy729)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 487: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803, createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy803)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 488: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729, createColumnNode(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy729)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 488: /* column_reference ::= NK_ALIAS */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 489: /* column_reference ::= NK_ALIAS */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 489: /* column_reference ::= table_name NK_DOT NK_ALIAS */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 490: /* column_reference ::= table_name NK_DOT NK_ALIAS */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0, createColumnNode(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 490: /* pseudo_column ::= ROWTS */ - case 491: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==491); - case 493: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==493); - case 494: /* pseudo_column ::= QEND */ yytestcase(yyruleno==494); - case 495: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==495); - case 496: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==496); - case 497: /* pseudo_column ::= WEND */ yytestcase(yyruleno==497); - case 498: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==498); - case 499: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==499); - case 500: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==500); - case 501: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==501); - case 507: /* literal_func ::= NOW */ yytestcase(yyruleno==507); - case 508: /* literal_func ::= TODAY */ yytestcase(yyruleno==508); -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 491: /* pseudo_column ::= ROWTS */ + case 492: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==492); + case 494: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==494); + case 495: /* pseudo_column ::= QEND */ yytestcase(yyruleno==495); + case 496: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==496); + case 497: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==497); + case 498: /* pseudo_column ::= WEND */ yytestcase(yyruleno==498); + case 499: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==499); + case 500: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==500); + case 501: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==501); + case 502: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==502); + case 508: /* literal_func ::= NOW */ yytestcase(yyruleno==508); + case 509: /* literal_func ::= TODAY */ yytestcase(yyruleno==509); +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 492: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy803)))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 493: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy729)))); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 502: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 503: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==503); -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy803, yymsp[-1].minor.yy608)); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 503: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 504: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==504); +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy729, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy729, yymsp[-1].minor.yy444)); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 504: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy384)); } - yymsp[-5].minor.yy614 = yylhsminor.yy614; + case 505: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), yymsp[-1].minor.yy384)); } + yymsp[-5].minor.yy1032 = yylhsminor.yy1032; break; - case 506: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy803, NULL)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 507: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy729, NULL)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 522: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy608 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 523: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy444 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; - case 527: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 612: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==612); -{ yylhsminor.yy614 = createColumnNode(pCxt, &yymsp[-2].minor.yy803, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 528: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 613: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==613); +{ yylhsminor.yy1032 = createColumnNode(pCxt, &yymsp[-2].minor.yy729, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 528: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy608, yymsp[-1].minor.yy614)); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 529: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy444, yymsp[-1].minor.yy1032)); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 529: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-2].minor.yy608, yymsp[-1].minor.yy614)); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; + case 530: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), yymsp[-2].minor.yy444, yymsp[-1].minor.yy1032)); } + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; - case 532: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy614 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614)); } + case 533: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy1032 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032)); } break; - case 534: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy614 = releaseRawExprNode(pCxt, yymsp[0].minor.yy614); } + case 535: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy1032 = releaseRawExprNode(pCxt, yymsp[0].minor.yy1032); } break; - case 535: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 540: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==540); + case 536: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 541: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==541); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy1034, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy900, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 536: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 537: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy614), releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-4].minor.yy614 = yylhsminor.yy614; + yymsp[-4].minor.yy1032 = yylhsminor.yy1032; break; - case 537: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 538: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-5].minor.yy614 = yylhsminor.yy614; + yymsp[-5].minor.yy1032 = yylhsminor.yy1032; break; - case 538: /* predicate ::= expr_or_subquery IS NULL */ + case 539: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), NULL)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 539: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 540: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), NULL)); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 541: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy1034 = OP_TYPE_LOWER_THAN; } + case 542: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy900 = OP_TYPE_LOWER_THAN; } break; - case 542: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy1034 = OP_TYPE_GREATER_THAN; } + case 543: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy900 = OP_TYPE_GREATER_THAN; } break; - case 543: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy1034 = OP_TYPE_LOWER_EQUAL; } + case 544: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy900 = OP_TYPE_LOWER_EQUAL; } break; - case 544: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy1034 = OP_TYPE_GREATER_EQUAL; } + case 545: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy900 = OP_TYPE_GREATER_EQUAL; } break; - case 545: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy1034 = OP_TYPE_NOT_EQUAL; } + case 546: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy900 = OP_TYPE_NOT_EQUAL; } break; - case 546: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy1034 = OP_TYPE_EQUAL; } + case 547: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy900 = OP_TYPE_EQUAL; } break; - case 547: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy1034 = OP_TYPE_LIKE; } + case 548: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy900 = OP_TYPE_LIKE; } break; - case 548: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy1034 = OP_TYPE_NOT_LIKE; } + case 549: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy900 = OP_TYPE_NOT_LIKE; } break; - case 549: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy1034 = OP_TYPE_MATCH; } + case 550: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy900 = OP_TYPE_MATCH; } break; - case 550: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy1034 = OP_TYPE_NMATCH; } + case 551: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy900 = OP_TYPE_NMATCH; } break; - case 551: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy1034 = OP_TYPE_JSON_CONTAINS; } + case 552: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy900 = OP_TYPE_JSON_CONTAINS; } break; - case 552: /* in_op ::= IN */ -{ yymsp[0].minor.yy1034 = OP_TYPE_IN; } + case 553: /* in_op ::= IN */ +{ yymsp[0].minor.yy900 = OP_TYPE_IN; } break; - case 553: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy1034 = OP_TYPE_NOT_IN; } + case 554: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy900 = OP_TYPE_NOT_IN; } break; - case 554: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 555: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy444)); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 556: /* boolean_value_expression ::= NOT boolean_primary */ + case 557: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy614), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032), NULL)); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 557: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 558: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 558: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 559: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy614); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy614); - yylhsminor.yy614 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy1032); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy1032); + yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 566: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy614 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy614, yymsp[0].minor.yy614, NULL); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 567: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy1032 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, JOIN_STYPE_NONE, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032, NULL); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 569: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy614 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 570: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy1032 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 570: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy614 = createRealTableNode(pCxt, &yymsp[-3].minor.yy803, &yymsp[-1].minor.yy803, &yymsp[0].minor.yy803); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 571: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy1032 = createRealTableNode(pCxt, &yymsp[-3].minor.yy729, &yymsp[-1].minor.yy729, &yymsp[0].minor.yy729); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 571: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy614 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614), &yymsp[0].minor.yy803); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 572: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy1032 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032), &yymsp[0].minor.yy729); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 573: /* alias_opt ::= */ -{ yymsp[1].minor.yy803 = nil_token; } + case 574: /* alias_opt ::= */ +{ yymsp[1].minor.yy729 = nil_token; } break; - case 575: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy803 = yymsp[0].minor.yy803; } + case 576: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy729 = yymsp[0].minor.yy729; } break; - case 576: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 577: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==577); -{ yymsp[-2].minor.yy614 = yymsp[-1].minor.yy614; } + case 577: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 578: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==578); +{ yymsp[-2].minor.yy1032 = yymsp[-1].minor.yy1032; } break; - case 578: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ + case 579: /* joined_table ::= table_reference join_type join_subtype JOIN table_reference join_on_clause_opt window_offset_clause_opt jlimit_clause_opt */ { - yylhsminor.yy614 = createJoinTableNode(pCxt, yymsp[-6].minor.yy148, yymsp[-5].minor.yy832, yymsp[-7].minor.yy614, yymsp[-3].minor.yy614, yymsp[-2].minor.yy614); - yylhsminor.yy614 = addWindowOffsetClause(pCxt, yylhsminor.yy614, yymsp[-1].minor.yy614); - yylhsminor.yy614 = addJLimitClause(pCxt, yylhsminor.yy614, yymsp[0].minor.yy614); + yylhsminor.yy1032 = createJoinTableNode(pCxt, yymsp[-6].minor.yy992, yymsp[-5].minor.yy134, yymsp[-7].minor.yy1032, yymsp[-3].minor.yy1032, yymsp[-2].minor.yy1032); + yylhsminor.yy1032 = addWindowOffsetClause(pCxt, yylhsminor.yy1032, yymsp[-1].minor.yy1032); + yylhsminor.yy1032 = addJLimitClause(pCxt, yylhsminor.yy1032, yymsp[0].minor.yy1032); } - yymsp[-7].minor.yy614 = yylhsminor.yy614; + yymsp[-7].minor.yy1032 = yylhsminor.yy1032; break; - case 579: /* join_type ::= */ -{ yymsp[1].minor.yy148 = JOIN_TYPE_INNER; } + case 580: /* join_type ::= */ +{ yymsp[1].minor.yy992 = JOIN_TYPE_INNER; } break; - case 580: /* join_type ::= INNER */ -{ yymsp[0].minor.yy148 = JOIN_TYPE_INNER; } + case 581: /* join_type ::= INNER */ +{ yymsp[0].minor.yy992 = JOIN_TYPE_INNER; } break; - case 581: /* join_type ::= LEFT */ -{ yymsp[0].minor.yy148 = JOIN_TYPE_LEFT; } + case 582: /* join_type ::= LEFT */ +{ yymsp[0].minor.yy992 = JOIN_TYPE_LEFT; } break; - case 582: /* join_type ::= RIGHT */ -{ yymsp[0].minor.yy148 = JOIN_TYPE_RIGHT; } + case 583: /* join_type ::= RIGHT */ +{ yymsp[0].minor.yy992 = JOIN_TYPE_RIGHT; } break; - case 583: /* join_type ::= FULL */ -{ yymsp[0].minor.yy148 = JOIN_TYPE_FULL; } + case 584: /* join_type ::= FULL */ +{ yymsp[0].minor.yy992 = JOIN_TYPE_FULL; } break; - case 584: /* join_subtype ::= */ -{ yymsp[1].minor.yy832 = JOIN_STYPE_NONE; } + case 585: /* join_subtype ::= */ +{ yymsp[1].minor.yy134 = JOIN_STYPE_NONE; } break; - case 585: /* join_subtype ::= OUTER */ -{ yymsp[0].minor.yy832 = JOIN_STYPE_OUTER; } + case 586: /* join_subtype ::= OUTER */ +{ yymsp[0].minor.yy134 = JOIN_STYPE_OUTER; } break; - case 586: /* join_subtype ::= SEMI */ -{ yymsp[0].minor.yy832 = JOIN_STYPE_SEMI; } + case 587: /* join_subtype ::= SEMI */ +{ yymsp[0].minor.yy134 = JOIN_STYPE_SEMI; } break; - case 587: /* join_subtype ::= ANTI */ -{ yymsp[0].minor.yy832 = JOIN_STYPE_ANTI; } + case 588: /* join_subtype ::= ANTI */ +{ yymsp[0].minor.yy134 = JOIN_STYPE_ANTI; } break; - case 588: /* join_subtype ::= ASOF */ -{ yymsp[0].minor.yy832 = JOIN_STYPE_ASOF; } + case 589: /* join_subtype ::= ASOF */ +{ yymsp[0].minor.yy134 = JOIN_STYPE_ASOF; } break; - case 589: /* join_subtype ::= WINDOW */ -{ yymsp[0].minor.yy832 = JOIN_STYPE_WIN; } + case 590: /* join_subtype ::= WINDOW */ +{ yymsp[0].minor.yy134 = JOIN_STYPE_WIN; } break; - case 593: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ -{ yymsp[-5].minor.yy614 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + case 594: /* window_offset_clause_opt ::= WINDOW_OFFSET NK_LP window_offset_literal NK_COMMA window_offset_literal NK_RP */ +{ yymsp[-5].minor.yy1032 = createWindowOffsetNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } break; - case 594: /* window_offset_literal ::= NK_VARIABLE */ -{ yylhsminor.yy614 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 595: /* window_offset_literal ::= NK_VARIABLE */ +{ yylhsminor.yy1032 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createTimeOffsetValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 595: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ + case 596: /* window_offset_literal ::= NK_MINUS NK_VARIABLE */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy614 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); + yylhsminor.yy1032 = createRawExprNode(pCxt, &t, createTimeOffsetValueNode(pCxt, &t)); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 597: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ - case 668: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==668); - case 672: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==672); -{ yymsp[-1].minor.yy614 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 598: /* jlimit_clause_opt ::= JLIMIT NK_INTEGER */ + case 669: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ yytestcase(yyruleno==669); + case 673: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==673); +{ yymsp[-1].minor.yy1032 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 598: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 599: /* query_specification ::= SELECT hint_list set_quantifier_opt tag_mode_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-13].minor.yy614 = createSelectStmt(pCxt, yymsp[-11].minor.yy517, yymsp[-9].minor.yy608, yymsp[-8].minor.yy614, yymsp[-12].minor.yy608); - yymsp[-13].minor.yy614 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy614, yymsp[-10].minor.yy517); - yymsp[-13].minor.yy614 = addWhereClause(pCxt, yymsp[-13].minor.yy614, yymsp[-7].minor.yy614); - yymsp[-13].minor.yy614 = addPartitionByClause(pCxt, yymsp[-13].minor.yy614, yymsp[-6].minor.yy608); - yymsp[-13].minor.yy614 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy614, yymsp[-2].minor.yy614); - yymsp[-13].minor.yy614 = addGroupByClause(pCxt, yymsp[-13].minor.yy614, yymsp[-1].minor.yy608); - yymsp[-13].minor.yy614 = addHavingClause(pCxt, yymsp[-13].minor.yy614, yymsp[0].minor.yy614); - yymsp[-13].minor.yy614 = addRangeClause(pCxt, yymsp[-13].minor.yy614, yymsp[-5].minor.yy614); - yymsp[-13].minor.yy614 = addEveryClause(pCxt, yymsp[-13].minor.yy614, yymsp[-4].minor.yy614); - yymsp[-13].minor.yy614 = addFillClause(pCxt, yymsp[-13].minor.yy614, yymsp[-3].minor.yy614); + yymsp[-13].minor.yy1032 = createSelectStmt(pCxt, yymsp[-11].minor.yy957, yymsp[-9].minor.yy444, yymsp[-8].minor.yy1032, yymsp[-12].minor.yy444); + yymsp[-13].minor.yy1032 = setSelectStmtTagMode(pCxt, yymsp[-13].minor.yy1032, yymsp[-10].minor.yy957); + yymsp[-13].minor.yy1032 = addWhereClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-7].minor.yy1032); + yymsp[-13].minor.yy1032 = addPartitionByClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-6].minor.yy444); + yymsp[-13].minor.yy1032 = addWindowClauseClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-2].minor.yy1032); + yymsp[-13].minor.yy1032 = addGroupByClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-1].minor.yy444); + yymsp[-13].minor.yy1032 = addHavingClause(pCxt, yymsp[-13].minor.yy1032, yymsp[0].minor.yy1032); + yymsp[-13].minor.yy1032 = addRangeClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-5].minor.yy1032); + yymsp[-13].minor.yy1032 = addEveryClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-4].minor.yy1032); + yymsp[-13].minor.yy1032 = addFillClause(pCxt, yymsp[-13].minor.yy1032, yymsp[-3].minor.yy1032); } break; - case 599: /* hint_list ::= */ -{ yymsp[1].minor.yy608 = createHintNodeList(pCxt, NULL); } + case 600: /* hint_list ::= */ +{ yymsp[1].minor.yy444 = createHintNodeList(pCxt, NULL); } break; - case 600: /* hint_list ::= NK_HINT */ -{ yylhsminor.yy608 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 601: /* hint_list ::= NK_HINT */ +{ yylhsminor.yy444 = createHintNodeList(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; - case 605: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy517 = false; } + case 606: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy957 = false; } break; - case 608: /* select_item ::= NK_STAR */ -{ yylhsminor.yy614 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy614 = yylhsminor.yy614; + case 609: /* select_item ::= NK_STAR */ +{ yylhsminor.yy1032 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy1032 = yylhsminor.yy1032; break; - case 610: /* select_item ::= common_expression column_alias */ - case 620: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==620); -{ yylhsminor.yy614 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614), &yymsp[0].minor.yy803); } - yymsp[-1].minor.yy614 = yylhsminor.yy614; + case 611: /* select_item ::= common_expression column_alias */ + case 621: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==621); +{ yylhsminor.yy1032 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032), &yymsp[0].minor.yy729); } + yymsp[-1].minor.yy1032 = yylhsminor.yy1032; break; - case 611: /* select_item ::= common_expression AS column_alias */ - case 621: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==621); -{ yylhsminor.yy614 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), &yymsp[0].minor.yy803); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 612: /* select_item ::= common_expression AS column_alias */ + case 622: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==622); +{ yylhsminor.yy1032 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), &yymsp[0].minor.yy729); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 616: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 646: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==646); - case 666: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==666); -{ yymsp[-2].minor.yy608 = yymsp[0].minor.yy608; } + case 617: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 647: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==647); + case 667: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==667); +{ yymsp[-2].minor.yy444 = yymsp[0].minor.yy444; } break; - case 623: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ -{ yymsp[-5].minor.yy614 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + case 624: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA interval_sliding_duration_literal NK_RP */ +{ yymsp[-5].minor.yy1032 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } break; - case 624: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy614 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + case 625: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy1032 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } break; - case 625: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy614 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), NULL, yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 626: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy1032 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), NULL, yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 626: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy614 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy614), releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), yymsp[-1].minor.yy614, yymsp[0].minor.yy614); } + case 627: /* twindow_clause_opt ::= INTERVAL NK_LP interval_sliding_duration_literal NK_COMMA interval_sliding_duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy1032 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), yymsp[-1].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 627: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy614 = createEventWindowNode(pCxt, yymsp[-3].minor.yy614, yymsp[0].minor.yy614); } + case 628: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy1032 = createEventWindowNode(pCxt, yymsp[-3].minor.yy1032, yymsp[0].minor.yy1032); } break; - case 628: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy614 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } + case 629: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_RP */ +{ yymsp[-3].minor.yy1032 = createCountWindowNode(pCxt, &yymsp[-1].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 629: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy614 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } + case 630: /* twindow_clause_opt ::= COUNT_WINDOW NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ +{ yymsp[-5].minor.yy1032 = createCountWindowNode(pCxt, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0); } break; - case 636: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy614 = createFillNode(pCxt, yymsp[-1].minor.yy720, NULL); } + case 637: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy1032 = createFillNode(pCxt, yymsp[-1].minor.yy574, NULL); } break; - case 637: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy614 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } + case 638: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy1032 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy444)); } break; - case 638: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ -{ yymsp[-5].minor.yy614 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy608)); } + case 639: /* fill_opt ::= FILL NK_LP VALUE_F NK_COMMA expression_list NK_RP */ +{ yymsp[-5].minor.yy1032 = createFillNode(pCxt, FILL_MODE_VALUE_F, createNodeListNode(pCxt, yymsp[-1].minor.yy444)); } break; - case 639: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy720 = FILL_MODE_NONE; } + case 640: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy574 = FILL_MODE_NONE; } break; - case 640: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy720 = FILL_MODE_PREV; } + case 641: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy574 = FILL_MODE_PREV; } break; - case 641: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy720 = FILL_MODE_NULL; } + case 642: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy574 = FILL_MODE_NULL; } break; - case 642: /* fill_mode ::= NULL_F */ -{ yymsp[0].minor.yy720 = FILL_MODE_NULL_F; } + case 643: /* fill_mode ::= NULL_F */ +{ yymsp[0].minor.yy574 = FILL_MODE_NULL_F; } break; - case 643: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy720 = FILL_MODE_LINEAR; } + case 644: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy574 = FILL_MODE_LINEAR; } break; - case 644: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy720 = FILL_MODE_NEXT; } + case 645: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy574 = FILL_MODE_NEXT; } break; - case 647: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy608 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[0].minor.yy608 = yylhsminor.yy608; + case 648: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy444 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } + yymsp[0].minor.yy444 = yylhsminor.yy444; break; - case 648: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy608 = addNodeToList(pCxt, yymsp[-2].minor.yy608, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy614))); } - yymsp[-2].minor.yy608 = yylhsminor.yy608; + case 649: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy444 = addNodeToList(pCxt, yymsp[-2].minor.yy444, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy1032))); } + yymsp[-2].minor.yy444 = yylhsminor.yy444; break; - case 652: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy614 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy614), releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + case 653: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy1032 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy1032), releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } break; - case 653: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy614 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy614)); } + case 654: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy1032 = createInterpTimePoint(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy1032)); } break; - case 656: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 657: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy614 = addOrderByClause(pCxt, yymsp[-3].minor.yy614, yymsp[-2].minor.yy608); - yylhsminor.yy614 = addSlimitClause(pCxt, yylhsminor.yy614, yymsp[-1].minor.yy614); - yylhsminor.yy614 = addLimitClause(pCxt, yylhsminor.yy614, yymsp[0].minor.yy614); + yylhsminor.yy1032 = addOrderByClause(pCxt, yymsp[-3].minor.yy1032, yymsp[-2].minor.yy444); + yylhsminor.yy1032 = addSlimitClause(pCxt, yylhsminor.yy1032, yymsp[-1].minor.yy1032); + yylhsminor.yy1032 = addLimitClause(pCxt, yylhsminor.yy1032, yymsp[0].minor.yy1032); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 659: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy614 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy614, yymsp[0].minor.yy614); } - yymsp[-3].minor.yy614 = yylhsminor.yy614; + case 660: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy1032 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy1032, yymsp[0].minor.yy1032); } + yymsp[-3].minor.yy1032 = yylhsminor.yy1032; break; - case 660: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy614 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy614, yymsp[0].minor.yy614); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 661: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy1032 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy1032, yymsp[0].minor.yy1032); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 669: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 673: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==673); -{ yymsp[-3].minor.yy614 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 670: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 674: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==674); +{ yymsp[-3].minor.yy1032 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 670: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 674: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==674); -{ yymsp[-3].minor.yy614 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 671: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 675: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==675); +{ yymsp[-3].minor.yy1032 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 675: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy614 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy614); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 676: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy1032 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy1032); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 680: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy614 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy614), yymsp[-1].minor.yy32, yymsp[0].minor.yy685); } - yymsp[-2].minor.yy614 = yylhsminor.yy614; + case 681: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy1032 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy1032), yymsp[-1].minor.yy478, yymsp[0].minor.yy617); } + yymsp[-2].minor.yy1032 = yylhsminor.yy1032; break; - case 681: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy32 = ORDER_ASC; } + case 682: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy478 = ORDER_ASC; } break; - case 682: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy32 = ORDER_ASC; } + case 683: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy478 = ORDER_ASC; } break; - case 683: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy32 = ORDER_DESC; } + case 684: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy478 = ORDER_DESC; } break; - case 684: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy685 = NULL_ORDER_DEFAULT; } + case 685: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy617 = NULL_ORDER_DEFAULT; } break; - case 685: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy685 = NULL_ORDER_FIRST; } + case 686: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy617 = NULL_ORDER_FIRST; } break; - case 686: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy685 = NULL_ORDER_LAST; } + case 687: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy617 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parAlterToBalanceTest.cpp b/source/libs/parser/test/parAlterToBalanceTest.cpp index bac5574f18..84be1e92d0 100644 --- a/source/libs/parser/test/parAlterToBalanceTest.cpp +++ b/source/libs/parser/test/parAlterToBalanceTest.cpp @@ -337,7 +337,7 @@ TEST_F(ParserInitialATest, alterDatabaseSemanticCheck) { run("ALTER DATABASE test PAGES 63", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 0", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test WAL_LEVEL 3", TSDB_CODE_PAR_INVALID_DB_OPTION); - run("ALTER DATABASE test REPLICA 2", TSDB_CODE_PAR_INVALID_DB_OPTION); + //run("ALTER DATABASE test REPLICA 2", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test STT_TRIGGER 0", TSDB_CODE_PAR_INVALID_DB_OPTION); run("ALTER DATABASE test STT_TRIGGER 17", TSDB_CODE_PAR_INVALID_DB_OPTION); // Regardless of the specific sentence diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 559fab5590..c15c99e449 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2523,6 +2523,13 @@ static bool eliminateProjOptMayBeOptimized(SLogicNode* pNode) { TSDB_SUPER_TABLE == ((SScanLogicNode*)nodesListGetNode(pNode->pChildren, 0))->tableType)) { return false; } + + if (QUERY_NODE_LOGIC_PLAN_DYN_QUERY_CTRL == nodeType(nodesListGetNode(pNode->pChildren, 0))) { + SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pNode->pChildren, 0); + if(LIST_LENGTH(pChild->pTargets) != LIST_LENGTH(pNode->pTargets)) { + return false; + } + } SProjectLogicNode* pProjectNode = (SProjectLogicNode*)pNode; if (NULL != pProjectNode->node.pLimit || NULL != pProjectNode->node.pSlimit || diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index a072ee1f6f..5f6440c06d 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -1128,7 +1128,11 @@ static int32_t metaHeartbeatToMnodeImpl(SStreamMeta* pMeta) { } if ((*pTask)->exec.pWalReader != NULL) { - entry.processedVer = (*pTask)->chkInfo.nextProcessVer - 1; + entry.processedVer = walReaderGetCurrentVer((*pTask)->exec.pWalReader) - 1; + if (entry.processedVer < 0) { + entry.processedVer = (*pTask)->chkInfo.processedVer; + } + walReaderValidVersionRange((*pTask)->exec.pWalReader, &entry.verStart, &entry.verEnd); } diff --git a/source/libs/sync/inc/syncCommit.h b/source/libs/sync/inc/syncCommit.h index 07b4702b1b..e6b54ea86b 100644 --- a/source/libs/sync/inc/syncCommit.h +++ b/source/libs/sync/inc/syncCommit.h @@ -53,6 +53,8 @@ bool syncNodeAgreedUpon(SSyncNode* pNode, SyncIndex index); int64_t syncNodeUpdateCommitIndex(SSyncNode* ths, SyncIndex commitIndex); int64_t syncNodeCheckCommitIndex(SSyncNode* ths, SyncIndex indexLikely); +int64_t syncNodeUpdateAssignedCommitIndex(SSyncNode* ths, SyncIndex assignedCommitIndex); + #ifdef __cplusplus } #endif diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 637c18e97d..3d8588a55a 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -160,6 +160,13 @@ typedef struct SSyncNode { SSyncLogStore* pLogStore; SyncIndex commitIndex; + // assigned leader log vars + SyncIndex assignedCommitIndex; + + SyncTerm arbTerm; + TdThreadMutex arbTokenMutex; + char arbToken[TSDB_ARB_TOKEN_SIZE]; + // timer ms init int32_t pingBaseLine; int32_t electBaseLine; @@ -219,6 +226,7 @@ typedef struct SSyncNode { int32_t electNum; int32_t becomeLeaderNum; + int32_t becomeAssignedLeaderNum; int32_t configChangeNum; int32_t hbSlowNum; int32_t hbrSlowNum; @@ -282,10 +290,12 @@ void syncNodeStepDown(SSyncNode* pSyncNode, SyncTerm newTerm); void syncNodeBecomeFollower(SSyncNode* pSyncNode, const char* debugStr); void syncNodeBecomeLearner(SSyncNode* pSyncNode, const char* debugStr); void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr); +void syncNodeBecomeAssignedLeader(SSyncNode* pSyncNode); void syncNodeCandidate2Leader(SSyncNode* pSyncNode); void syncNodeFollower2Candidate(SSyncNode* pSyncNode); void syncNodeLeader2Follower(SSyncNode* pSyncNode); void syncNodeCandidate2Follower(SSyncNode* pSyncNode); +int32_t syncNodeAssignedLeader2Leader(SSyncNode* pSyncNode); // raft vote -------------- void syncNodeVoteForTerm(SSyncNode* pSyncNode, SyncTerm term, SRaftId* pRaftId); diff --git a/source/libs/sync/inc/syncUtil.h b/source/libs/sync/inc/syncUtil.h index 39c679a2ad..a550ae8fbb 100644 --- a/source/libs/sync/inc/syncUtil.h +++ b/source/libs/sync/inc/syncUtil.h @@ -78,6 +78,8 @@ void syncUtilMsgHtoN(void* msg); bool syncUtilUserPreCommit(tmsg_t msgType); bool syncUtilUserRollback(tmsg_t msgType); +void syncUtilGenerateArbToken(int32_t nodeId, int32_t groupId, char* buf); + void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...); void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dflag, SSyncSnapshotSender* pSender, const char* format, ...); diff --git a/source/libs/sync/src/syncAppendEntriesReply.c b/source/libs/sync/src/syncAppendEntriesReply.c index 7c343c0e5d..16739647b5 100644 --- a/source/libs/sync/src/syncAppendEntriesReply.c +++ b/source/libs/sync/src/syncAppendEntriesReply.c @@ -55,7 +55,7 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { return 0; } - if (ths->state == TAOS_SYNC_STATE_LEADER) { + if (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (pMsg->term > raftStoreGetTerm(ths)) { syncLogRecvAppendEntriesReply(ths, pMsg, "error term"); syncNodeStepDown(ths, pMsg->term); @@ -76,7 +76,26 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { // commit if needed SyncIndex indexLikely = TMIN(pMsg->matchIndex, ths->pLogBuf->matchIndex); SyncIndex commitIndex = syncNodeCheckCommitIndex(ths, indexLikely); - (void)syncLogBufferCommit(ths->pLogBuf, ths, commitIndex); + if (ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + if (commitIndex >= ths->assignedCommitIndex) { + terrno = TSDB_CODE_SUCCESS; + raftStoreNextTerm(ths); + if (terrno != TSDB_CODE_SUCCESS) { + sError("vgId:%d, failed to update term, reason:%s", ths->vgId, tstrerror(terrno)); + return -1; + } + if (syncNodeAssignedLeader2Leader(ths) != 0) { + sError("vgId:%d, failed to change state from assigned leader to leader", ths->vgId); + return -1; + } + + taosThreadMutexLock(&ths->arbTokenMutex); + syncUtilGenerateArbToken(ths->myNodeInfo.nodeId, ths->vgId, ths->arbToken); + taosThreadMutexUnlock(&ths->arbTokenMutex); + } + } else { + (void)syncLogBufferCommit(ths->pLogBuf, ths, commitIndex); + } } // replicate log diff --git a/source/libs/sync/src/syncCommit.c b/source/libs/sync/src/syncCommit.c index 47e4049c73..3c401a978b 100644 --- a/source/libs/sync/src/syncCommit.c +++ b/source/libs/sync/src/syncCommit.c @@ -88,3 +88,11 @@ int64_t syncNodeCheckCommitIndex(SSyncNode* ths, SyncIndex indexLikely) { } return ths->commitIndex; } + +int64_t syncNodeUpdateAssignedCommitIndex(SSyncNode* ths, SyncIndex assignedCommitIndex) { + SyncIndex lastVer = ths->pLogStore->syncLogLastIndex(ths->pLogStore); + assignedCommitIndex = TMAX(assignedCommitIndex, ths->assignedCommitIndex); + ths->assignedCommitIndex = TMIN(assignedCommitIndex, lastVer); + ths->pLogStore->syncLogUpdateCommitIndex(ths->pLogStore, ths->assignedCommitIndex); + return ths->commitIndex; +} diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 7ff6116137..2a9b05e354 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -173,7 +173,7 @@ int32_t syncReconfig(int64_t rid, SSyncCfg* pNewCfg) { syncNodeUpdateNewConfigIndex(pSyncNode, pNewCfg); syncNodeDoConfigChange(pSyncNode, pNewCfg, pNewCfg->lastIndex); - if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state == TAOS_SYNC_STATE_LEADER || pSyncNode->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { syncNodeStopHeartbeatTimer(pSyncNode); for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { @@ -235,6 +235,9 @@ int32_t syncProcessMsg(int64_t rid, SRpcMsg* pMsg) { case TDMT_SYNC_FORCE_FOLLOWER: code = syncForceBecomeFollower(pSyncNode, pMsg); break; + case TDMT_SYNC_SET_ASSIGNED_LEADER: + code = syncBecomeAssignedLeader(pSyncNode, pMsg); + break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; code = -1; @@ -271,6 +274,78 @@ int32_t syncForceBecomeFollower(SSyncNode* ths, const SRpcMsg* pRpcMsg) { return 0; } +int32_t syncBecomeAssignedLeader(SSyncNode* ths, SRpcMsg* pRpcMsg) { + int32_t ret = -1; + + SVArbSetAssignedLeaderReq req = {0}; + if (tDeserializeSVArbSetAssignedLeaderReq((char*)pRpcMsg->pCont + sizeof(SMsgHead), pRpcMsg->contLen, &req) != 0) { + sError("vgId:%d, failed to deserialize SVArbSetAssignedLeaderReq", ths->vgId); + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + int32_t errcode = TSDB_CODE_MND_ARB_TOKEN_MISMATCH; + + if (ths->arbTerm > req.arbTerm) { + sInfo("vgId:%d, skip to set assigned leader, msg with lower term, local:%" PRId64 "msg:%" PRId64, ths->vgId, + ths->arbTerm, req.arbTerm); + goto _OVER; + } + + ths->arbTerm = TMAX(req.arbTerm, ths->arbTerm); + + if (strncmp(req.memberToken, ths->arbToken, TSDB_ARB_TOKEN_SIZE) == 0) { + if (ths->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { + raftStoreNextTerm(ths); + if (terrno != TSDB_CODE_SUCCESS) { + sError("vgId:%d, failed to set next term since:%s", ths->vgId, terrstr()); + goto _OVER; + } + syncNodeBecomeAssignedLeader(ths); + } + errcode = TSDB_CODE_SUCCESS; + } + + SVArbSetAssignedLeaderRsp rsp = {0}; + rsp.arbToken = req.arbToken; + rsp.memberToken = req.memberToken; + rsp.vgId = ths->vgId; + + int32_t contLen = tSerializeSVArbSetAssignedLeaderRsp(NULL, 0, &rsp); + if (contLen <= 0) { + sError("vgId:%d, failed to serialize SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + void* pHead = rpcMallocCont(contLen); + if (!pHead) { + sError("vgId:%d, failed to malloc memory for SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + if (tSerializeSVArbSetAssignedLeaderRsp(pHead, contLen, &rsp) <= 0) { + sError("vgId:%d, failed to serialize SVArbSetAssignedLeaderRsp", ths->vgId); + terrno = TSDB_CODE_OUT_OF_MEMORY; + rpcFreeCont(pHead); + goto _OVER; + } + + SRpcMsg rspMsg = { + .code = errcode, + .pCont = pHead, + .contLen = contLen, + .info = pRpcMsg->info, + }; + + tmsgSendRsp(&rspMsg); + + ret = 0; + +_OVER: + tFreeSVArbSetAssignedLeaderReq(&req); + return ret; +} + int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) { SSyncNode* pNode = syncNodeAcquire(rid); if (pNode == NULL) return -1; @@ -342,7 +417,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) { if (pSyncNode->totalReplicaNum > 1) { if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_FOLLOWER && - pSyncNode->state != TAOS_SYNC_STATE_LEARNER) { + pSyncNode->state != TAOS_SYNC_STATE_LEARNER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { sNTrace(pSyncNode, "new-snapshot-index:%" PRId64 " candidate or unknown state, do not delete wal", lastApplyIndex); syncNodeRelease(pSyncNode); @@ -434,7 +509,7 @@ bool syncNodeIsReadyForRead(SSyncNode* pSyncNode) { return false; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; return false; } @@ -562,6 +637,55 @@ SSyncState syncGetState(int64_t rid) { return state; } +int32_t syncGetArbToken(int64_t rid, char* outToken) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + memset(outToken, 0, TSDB_ARB_TOKEN_SIZE); + taosThreadMutexLock(&pSyncNode->arbTokenMutex); + strncpy(outToken, pSyncNode->arbToken, TSDB_ARB_TOKEN_SIZE); + taosThreadMutexUnlock(&pSyncNode->arbTokenMutex); + + terrno = TSDB_CODE_SUCCESS; + syncNodeRelease(pSyncNode); + return 0; +} + +int32_t syncGetAssignedLogSynced(int64_t rid) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + terrno = TSDB_CODE_VND_ARB_NOT_SYNCED; + syncNodeRelease(pSyncNode); + return 0; + } + + bool isSync = pSyncNode->commitIndex >= pSyncNode->assignedCommitIndex; + terrno = (isSync ? TSDB_CODE_SUCCESS : TSDB_CODE_VND_ARB_NOT_SYNCED); + + syncNodeRelease(pSyncNode); + return 0; +} + +int32_t syncUpdateArbTerm(int64_t rid, SyncTerm arbTerm) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + terrno = TSDB_CODE_NOT_FOUND; + return -1; + } + + pSyncNode->arbTerm = TMAX(arbTerm, pSyncNode->arbTerm); + syncNodeRelease(pSyncNode); + return 0; +} + SyncIndex syncNodeGetSnapshotConfigIndex(SSyncNode* pSyncNode, SyncIndex snapshotLastApplyIndex) { ASSERT(pSyncNode->raftCfg.configIndexCount >= 1); SyncIndex lastIndex = (pSyncNode->raftCfg.configIndexArr)[0]; @@ -668,8 +792,21 @@ ESyncRole syncGetRole(int64_t rid) { return role; } +int64_t syncGetTerm(int64_t rid) { + SSyncNode* pSyncNode = syncNodeAcquire(rid); + if (pSyncNode == NULL) { + sError("sync Node Acquire error since %d", errno); + return -1; + } + + int64_t term = raftStoreGetTerm(pSyncNode); + + syncNodeRelease(pSyncNode); + return term; +} + int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t* seq) { - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { terrno = TSDB_CODE_SYN_NOT_LEADER; sNWarn(pSyncNode, "sync propose not leader, type:%s", TMSG_INFO(pMsg->msgType)); return -1; @@ -683,7 +820,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_ } // heartbeat timeout - if (syncNodeHeartbeatReplyTimeout(pSyncNode)) { + if (pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER && syncNodeHeartbeatReplyTimeout(pSyncNode)) { terrno = TSDB_CODE_SYN_PROPOSE_NOT_READY; sNError(pSyncNode, "failed to sync propose since heartbeat timeout, type:%s, last:%" PRId64 ", cmt:%" PRId64, TMSG_INFO(pMsg->msgType), syncNodeGetLastIndex(pSyncNode), pSyncNode->commitIndex); @@ -916,6 +1053,10 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { goto _error; } + pSyncNode->arbTerm = -1; + taosThreadMutexInit(&pSyncNode->arbTokenMutex, NULL); + syncUtilGenerateArbToken(pSyncNode->myNodeInfo.nodeId, pSyncInfo->vgId, pSyncNode->arbToken); + // init peersNum, peers, peersId pSyncNode->peersNum = pSyncNode->raftCfg.cfg.totalReplicaNum - 1; int32_t j = 0; @@ -1064,9 +1205,9 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { pSyncNode->heartbeatTimerMS = pSyncNode->hbBaseLine; atomic_store_64(&pSyncNode->heartbeatTimerLogicClock, 0); atomic_store_64(&pSyncNode->heartbeatTimerLogicClockUser, 0); -#ifdef BUILD_NO_CALL +#ifdef BUILD_NO_CALL pSyncNode->FpHeartbeatTimerCB = syncNodeEqHeartbeatTimer; -#endif +#endif pSyncNode->heartbeatTimerCounter = 0; // init peer heartbeat timer @@ -1138,6 +1279,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) { pSyncNode->isStart = true; pSyncNode->electNum = 0; pSyncNode->becomeLeaderNum = 0; + pSyncNode->becomeAssignedLeaderNum = 0; pSyncNode->configChangeNum = 0; pSyncNode->hbSlowNum = 0; pSyncNode->hbrSlowNum = 0; @@ -1305,6 +1447,8 @@ void syncNodeClose(SSyncNode* pSyncNode) { syncLogBufferDestroy(pSyncNode->pLogBuf); pSyncNode->pLogBuf = NULL; + taosThreadMutexDestroy(&pSyncNode->arbTokenMutex); + for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) { if (pSyncNode->senders[i] != NULL) { sDebug("vgId:%d, snapshot sender destroy while close, data:%p", pSyncNode->vgId, pSyncNode->senders[i]); @@ -1906,6 +2050,66 @@ void syncNodeBecomeLeader(SSyncNode* pSyncNode, const char* debugStr) { sNInfo(pSyncNode, "become leader %s", debugStr); } +void syncNodeBecomeAssignedLeader(SSyncNode* pSyncNode) { + pSyncNode->becomeAssignedLeaderNum++; + pSyncNode->hbrSlowNum = 0; + + // reset restoreFinish + //pSyncNode->restoreFinish = false; + + // state change + pSyncNode->state = TAOS_SYNC_STATE_ASSIGNED_LEADER; + pSyncNode->roleTimeMs = taosGetTimestampMs(); + + // set leader cache + pSyncNode->leaderCache = pSyncNode->myRaftId; + + for (int32_t i = 0; i < pSyncNode->pNextIndex->replicaNum; ++i) { + SyncIndex lastIndex; + SyncTerm lastTerm; + int32_t code = syncNodeGetLastIndexTerm(pSyncNode, &lastIndex, &lastTerm); + ASSERT(code == 0); + pSyncNode->pNextIndex->index[i] = lastIndex + 1; + } + + for (int32_t i = 0; i < pSyncNode->pMatchIndex->replicaNum; ++i) { + // maybe overwrite myself, no harm + // just do it! + pSyncNode->pMatchIndex->index[i] = SYNC_INDEX_INVALID; + } + + // init peer mgr + syncNodePeerStateInit(pSyncNode); + + // close receiver + if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) { + snapshotReceiverStop(pSyncNode->pNewNodeReceiver); + } + + // stop elect timer + syncNodeStopElectTimer(pSyncNode); + + // start heartbeat timer + syncNodeStartHeartbeatTimer(pSyncNode); + + // send heartbeat right now + syncNodeHeartbeatPeers(pSyncNode); + + // call back + if (pSyncNode->pFsm != NULL && pSyncNode->pFsm->FpBecomeAssignedLeaderCb != NULL) { + pSyncNode->pFsm->FpBecomeAssignedLeaderCb(pSyncNode->pFsm); + } + + // min match index + pSyncNode->minMatchIndex = SYNC_INDEX_INVALID; + + // reset log buffer + syncLogBufferReset(pSyncNode->pLogBuf, pSyncNode); + + // trace log + sNInfo(pSyncNode, "become assigned leader"); +} + void syncNodeCandidate2Leader(SSyncNode* pSyncNode) { ASSERT(pSyncNode->state == TAOS_SYNC_STATE_CANDIDATE); bool granted = voteGrantedMajority(pSyncNode->pVotesGranted); @@ -1972,6 +2176,24 @@ void syncNodeCandidate2Follower(SSyncNode* pSyncNode) { } #endif +int32_t syncNodeAssignedLeader2Leader(SSyncNode* pSyncNode) { + ASSERT(pSyncNode->state == TAOS_SYNC_STATE_ASSIGNED_LEADER); + syncNodeBecomeLeader(pSyncNode, "assigned leader to leader"); + + sNTrace(pSyncNode, "assigned leader to leader"); + + int32_t ret = syncNodeAppendNoop(pSyncNode); + if (ret < 0) { + sError("vgId:%d, failed to append noop entry since %s", pSyncNode->vgId, terrstr()); + } + + SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); + sInfo("vgId:%d, become leader from assigned leader. term:%" PRId64 ", commit index:%" PRId64 + "assigned commit index:%" PRId64 ", last index:%" PRId64, + pSyncNode->vgId, raftStoreGetTerm(pSyncNode), pSyncNode->commitIndex, pSyncNode->assignedCommitIndex, lastIndex); + return 0; +} + // just called by syncNodeVoteForSelf // need assert void syncNodeVoteForTerm(SSyncNode* pSyncNode, SyncTerm term, SRaftId* pRaftId) { @@ -2291,7 +2513,7 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) { return; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { syncNodeRelease(pSyncNode); syncHbTimerDataRelease(pData); sError("vgId:%d, hb timer sync node not leader", pSyncNode->vgId); @@ -2426,7 +2648,8 @@ int32_t syncNodeCheckChangeConfig(SSyncNode* ths, SSyncRaftEntry* pEntry) { SSyncCfg cfg = {0}; syncBuildConfigFromReq(&req, &cfg); - if (cfg.totalReplicaNum >= 1 && ths->state == TAOS_SYNC_STATE_LEADER) { + if (cfg.totalReplicaNum >= 1 && + (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER)) { bool incfg = false; for (int32_t j = 0; j < cfg.totalReplicaNum; ++j) { if (strcmp(ths->myNodeInfo.nodeFqdn, cfg.nodeInfo[j].nodeFqdn) == 0 && @@ -2934,6 +3157,16 @@ _out:; ths->vgId, pEntry->index, pEntry->term, ths->pLogBuf->startIndex, ths->pLogBuf->commitIndex, ths->pLogBuf->matchIndex, ths->pLogBuf->endIndex); + if (code == 0 && ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { + (void)syncNodeUpdateAssignedCommitIndex(ths, matchIndex); + + if (ths->fsmState != SYNC_FSM_STATE_INCOMPLETE && + syncLogBufferCommit(ths->pLogBuf, ths, ths->assignedCommitIndex) < 0) { + sError("vgId:%d, failed to commit until commitIndex:%" PRId64 "", ths->vgId, ths->commitIndex); + code = -1; + } + } + // multi replica if (ths->replicaNum > 1) { return code; @@ -3080,7 +3313,8 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { currentTerm = pMsg->term; } - if (pMsg->term == currentTerm && ths->state != TAOS_SYNC_STATE_LEADER) { + if (pMsg->term == currentTerm && + (ths->state != TAOS_SYNC_STATE_LEADER && ths->state != TAOS_SYNC_STATE_ASSIGNED_LEADER)) { syncIndexMgrSetRecvTime(ths->pNextIndex, &(pMsg->srcId), tsMs); resetElect = true; @@ -3109,7 +3343,8 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } } - if (pMsg->term >= currentTerm && ths->state == TAOS_SYNC_STATE_LEADER) { + if (pMsg->term >= currentTerm && + (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER)) { SRpcMsg rpcMsgLocalCmd = {0}; (void)syncBuildLocalCmd(&rpcMsgLocalCmd, ths->vgId); @@ -3239,7 +3474,7 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn return -1; } - if (ths->state == TAOS_SYNC_STATE_LEADER) { + if (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) { if (pRetIndex) { (*pRetIndex) = index; } @@ -3288,6 +3523,8 @@ const char* syncStr(ESyncState state) { return "offline"; case TAOS_SYNC_STATE_LEARNER: return "learner"; + case TAOS_SYNC_STATE_ASSIGNED_LEADER: + return "assigned leader"; default: return "unknown"; } diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 70bdd4a837..d40fff447f 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -484,7 +484,7 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p taosMsleep(1); goto _out; } - + if(pEntry->originalRpcType == TDMT_SYNC_CONFIG_CHANGE){ if(pNode->pLogBuf->commitIndex == pEntry->index -1){ sInfo("vgId:%d, to change config at %s. " @@ -492,7 +492,7 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p "node, restore:%d, commitIndex:%" PRId64 ", " "cond: (pre entry index:%" PRId64 "== buf commit index:%" PRId64 ")", pNode->vgId, str, - pEntry->index, pEntry->term, + pEntry->index, pEntry->term, pNode->restoreFinish, pNode->commitIndex, pEntry->index - 1, pNode->pLogBuf->commitIndex); if(syncNodeChangeConfig(pNode, pEntry, str) != 0){ @@ -507,9 +507,9 @@ int64_t syncLogBufferProceed(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncTerm* p "node, commitIndex:%" PRId64 ", pBuf: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 "), " "cond:( pre entry index:%" PRId64" != buf commit index:%" PRId64 ")", pNode->vgId, str, - pEntry->index, pEntry->term, + pEntry->index, pEntry->term, pNode->commitIndex, pNode->pLogBuf->startIndex, pNode->pLogBuf->commitIndex, - pNode->pLogBuf->matchIndex, pNode->pLogBuf->endIndex, + pNode->pLogBuf->matchIndex, pNode->pLogBuf->endIndex, pEntry->index - 1, pNode->pLogBuf->commitIndex); } } @@ -653,8 +653,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm "current entry, index:%" PRId64 ", term:%" PRId64", " "node, role:%d, current term:%" PRId64 ", restore:%d, " "cond, next entry index:%" PRId64 ", msgType:%s", - vgId, - pEntry->index, pEntry->term, + vgId, + pEntry->index, pEntry->term, role, currentTerm, pNode->restoreFinish, pNextEntry->index, TMSG_INFO(pNextEntry->originalRpcType)); @@ -685,12 +685,12 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm syncEntryDestroy(pNextEntry); pNextEntry = NULL; } - } - + } + if (!inBuf) { syncEntryDestroy(pEntry); pEntry = NULL; - } + } } // recycle diff --git a/source/libs/sync/src/syncReplication.c b/source/libs/sync/src/syncReplication.c index 2c7fc70ae9..9312719be7 100644 --- a/source/libs/sync/src/syncReplication.c +++ b/source/libs/sync/src/syncReplication.c @@ -64,7 +64,8 @@ int32_t syncNodeReplicate(SSyncNode* pNode) { } int32_t syncNodeReplicateWithoutLock(SSyncNode* pNode) { - if (pNode->state != TAOS_SYNC_STATE_LEADER || pNode->raftCfg.cfg.totalReplicaNum == 1) { + if ((pNode->state != TAOS_SYNC_STATE_LEADER && pNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) || + pNode->raftCfg.cfg.totalReplicaNum == 1) { return -1; } for (int32_t i = 0; i < pNode->totalReplicaNum; i++) { diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index d9c8bb21ac..5c1f8739bd 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -1242,7 +1242,7 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, SRpcMsg *pRpcMsg) { goto _ERROR; } - if (pSyncNode->state != TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_LEADER && pSyncNode->state != TAOS_SYNC_STATE_ASSIGNED_LEADER) { sSError(pSender, "snapshot sender not leader"); terrno = TSDB_CODE_SYN_NOT_LEADER; goto _ERROR; diff --git a/source/libs/sync/src/syncTimeout.c b/source/libs/sync/src/syncTimeout.c index a57dfbee53..dbbd914041 100644 --- a/source/libs/sync/src/syncTimeout.c +++ b/source/libs/sync/src/syncTimeout.c @@ -77,7 +77,8 @@ static int32_t syncNodeTimerRoutine(SSyncNode* ths) { 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) { + if (ths->isStart && (ths->state == TAOS_SYNC_STATE_LEADER || ths->state == TAOS_SYNC_STATE_ASSIGNED_LEADER) && + pSender->start) { int64_t elapsedMs = timeNow - pSender->lastSendTime; if (elapsedMs < SYNC_SNAP_RESEND_MS) { continue; diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index 2ce56af946..93a06ddf30 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -44,7 +44,7 @@ void syncUtilNodeInfo2EpSet(const SNodeInfo* pInfo, SEpSet* pEpSet) { bool syncUtilNodeInfo2RaftId(const SNodeInfo* pInfo, SyncGroupId vgId, SRaftId* raftId) { uint32_t ipv4 = 0xFFFFFFFF; sDebug("vgId:%d, start to resolve sync addr fqdn in %d seconds, " - "dnode:%d cluster:%" PRId64 " fqdn:%s port:%u ", + "dnode:%d cluster:%" PRId64 " fqdn:%s port:%u ", vgId, tsResolveFQDNRetryTime, pInfo->nodeId, pInfo->clusterId, pInfo->nodeFqdn, pInfo->nodePort); for(int i = 0; i < tsResolveFQDNRetryTime; i++){ @@ -57,7 +57,7 @@ bool syncUtilNodeInfo2RaftId(const SNodeInfo* pInfo, SyncGroupId vgId, SRaftId* break; } } - + if (ipv4 == 0xFFFFFFFF || ipv4 == 1) { sError("failed to resolve ipv4 addr, fqdn:%s", pInfo->nodeFqdn); terrno = TSDB_CODE_TSC_INVALID_FQDN; @@ -103,6 +103,13 @@ bool syncUtilUserPreCommit(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && bool syncUtilUserRollback(tmsg_t msgType) { return msgType != TDMT_SYNC_NOOP && msgType != TDMT_SYNC_LEADER_TRANSFER; } +void syncUtilGenerateArbToken(int32_t nodeId, int32_t groupId, char* buf) { + memset(buf, 0, TSDB_ARB_TOKEN_SIZE); + int32_t randVal = taosSafeRand() % 1000; + int64_t currentMs = taosGetTimestampMs(); + snprintf(buf, TSDB_ARB_TOKEN_SIZE, "d%d#g%d#%" PRId64 "#%d", nodeId, groupId, currentMs, randVal); +} + // for leader static void syncHearbeatReplyTime2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { int32_t len = 0; @@ -221,19 +228,22 @@ void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNo SyncIndex appliedIndex = pNode->pFsm->FpAppliedIndexCb(pNode->pFsm); if (pNode != NULL) { - taosPrintLog(flags, level, dflag, - "vgId:%d, %s, sync:%s, term:%" PRIu64 ", commit-index:%" PRId64 ", applied-index:%" PRId64 - ", first-ver:%" PRId64 ", last-ver:%" PRId64 ", min:%" PRId64 ", snap:%" PRId64 ", snap-term:%" PRIu64 - ", elect-times:%d, as-leader-times:%d, cfg-ch-times:%d, hb-slow:%d, hbr-slow:%d, " - "aq-items:%d, snaping:%" PRId64 ", replicas:%d, last-cfg:%" PRId64 - ", chging:%d, restore:%d, quorum:%d, elect-lc-timer:%" PRId64 ", hb:%" PRId64 - ", buffer:%s, repl-mgrs:%s, members:%s, hb:%s, hb-reply:%s", - pNode->vgId, eventLog, syncStr(pNode->state), currentTerm, pNode->commitIndex, appliedIndex, - logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm, - pNode->electNum, pNode->becomeLeaderNum, pNode->configChangeNum, pNode->hbSlowNum, pNode->hbrSlowNum, - aqItems, pNode->snapshottingIndex, pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, - pNode->restoreFinish, syncNodeDynamicQuorum(pNode), pNode->electTimerLogicClock, - pNode->heartbeatTimerLogicClockUser, bufferStatesStr, replMgrStatesStr, cfgStr, hbTimeStr, hbrTimeStr); + taosPrintLog( + flags, level, dflag, + "vgId:%d, %s, sync:%s, term:%" PRIu64 ", commit-index:%" PRId64 ", assigned-index:%" PRId64 + ", applied-index:%" PRId64 ", first-ver:%" PRId64 ", last-ver:%" PRId64 ", min:%" PRId64 ", snap:%" PRId64 + ", snap-term:%" PRIu64 + ", elect-times:%d, as-leader-times:%d, as-assigned-leader-times:%d, cfg-ch-times:%d, hb-slow:%d, hbr-slow:%d, " + "aq-items:%d, snaping:%" PRId64 ", replicas:%d, last-cfg:%" PRId64 + ", chging:%d, restore:%d, quorum:%d, elect-lc-timer:%" PRId64 ", hb:%" PRId64 + ", buffer:%s, repl-mgrs:%s, members:%s, hb:%s, hb-reply:%s", + pNode->vgId, eventLog, syncStr(pNode->state), currentTerm, pNode->commitIndex, pNode->assignedCommitIndex, + appliedIndex, logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, + snapshot.lastApplyTerm, pNode->electNum, pNode->becomeLeaderNum, pNode->becomeAssignedLeaderNum, + pNode->configChangeNum, pNode->hbSlowNum, pNode->hbrSlowNum, aqItems, pNode->snapshottingIndex, + pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, pNode->restoreFinish, + syncNodeDynamicQuorum(pNode), pNode->electTimerLogicClock, pNode->heartbeatTimerLogicClockUser, bufferStatesStr, + replMgrStatesStr, cfgStr, hbTimeStr, hbrTimeStr); } } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 75685c8bf8..89f9a54129 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -254,6 +254,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_SNODE_ALREADY_EXIST, "Snode can only be cre TAOS_DEFINE_ERROR(TSDB_CODE_MND_SNODE_NOT_EXIST, "Snode not there") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_FEW_MNODES, "The replica of mnode cannot less than 1") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_MNODES, "The replica of mnode cannot exceed 3") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARBGROUP_ALREADY_EXIST, "Arbitrator group already exists") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARBGROUP_NOT_EXIST, "Arbitrator group not there") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_ARB_TOKEN_MISMATCH, "Arbitrator token mismatch") // mnode-dnode-part2 TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_DNODES, "Too many dnodes") @@ -368,6 +371,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NOT_CATCH_UP, "Vnode didn't catch up TAOS_DEFINE_ERROR(TSDB_CODE_VND_ALREADY_IS_VOTER, "Vnode already is a voter") TAOS_DEFINE_ERROR(TSDB_CODE_VND_DIR_ALREADY_EXIST, "Vnode directory already exist") TAOS_DEFINE_ERROR(TSDB_CODE_VND_META_DATA_UNSAFE_DELETE, "Single replica vnode data will lost permanently after this operation, if you make sure this, please use drop dnode unsafe to execute") +TAOS_DEFINE_ERROR(TSDB_CODE_VND_ARB_NOT_SYNCED, "Vgroup peer is not synced") // tsdb TAOS_DEFINE_ERROR(TSDB_CODE_TDB_INVALID_TABLE_ID, "Invalid table ID") @@ -712,7 +716,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TMQ_REPLAY_NOT_SUPPORT, "Replay is disabled TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_NOT_EXIST, "Stream task not exist") TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_EXEC_CANCELLED, "Stream task exec cancelled") TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_INVALID_STATETRANS, "Invalid task state to handle event") -TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_IVLD_STATUS,"Invalid task status to proceed") +TAOS_DEFINE_ERROR(TSDB_CODE_STREAM_TASK_IVLD_STATUS, "Invalid task status to proceed") // TDLite TAOS_DEFINE_ERROR(TSDB_CODE_TDLITE_IVLD_OPEN_FLAGS, "Invalid TDLite open flags") diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index 09b34a97d0..60899bc1c8 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -1,4 +1,4 @@ -import sys +import sys from util.log import * from util.cases import * from util.sql import * @@ -9,14 +9,14 @@ class TDTestCase: def caseDescription(self): ''' case1: [TD-21890] table count scan test case - ''' + ''' return - + def init(self, conn, logSql, replicaVer=1): tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor(), True) self._conn = conn - + def restartTaosd(self, index=1, dbname="db"): tdDnodes.stop(index) tdDnodes.startWithoutSleep(index) @@ -65,7 +65,7 @@ class TDTestCase: tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 29) + tdSql.checkData(0, 0, 30) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 3) @@ -77,7 +77,7 @@ class TDTestCase: tdSql.query('select count(1) v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 29) + tdSql.checkData(0, 0, 30) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -93,7 +93,7 @@ class TDTestCase: tdSql.checkData(1, 1, 'performance_schema') tdSql.checkData(0, 0, 3) tdSql.checkData(0, 1, 'tbl_count') - tdSql.checkData(2, 0, 29) + tdSql.checkData(2, 0, 30) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -106,7 +106,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 37) + tdSql.checkData(0, 0, 38) tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') @@ -189,7 +189,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 29) + tdSql.checkData(3, 0, 30) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -204,7 +204,7 @@ class TDTestCase: tdSql.checkData(2, 0, 5) tdSql.checkData(2, 1, 'performance_schema') tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 29) + tdSql.checkData(3, 0, 30) tdSql.checkData(3, 1, 'information_schema') tdSql.checkData(3, 2, None) @@ -215,7 +215,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'tbl_count') tdSql.checkData(1, 0, 5) tdSql.checkData(1, 1, 'performance_schema') - tdSql.checkData(2, 0, 29) + tdSql.checkData(2, 0, 30) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -228,7 +228,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 38) + tdSql.checkData(0, 0, 39) tdSql.execute('drop database tbl_count') diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 851fe2679b..2402f6a94a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -591,6 +591,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4348-td-27939.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/backslash_g.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/test_ts4467.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/geometry.py ,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py diff --git a/tests/script/tsim/db/create_all_options.sim b/tests/script/tsim/db/create_all_options.sim index abba824e82..71aa763662 100644 --- a/tests/script/tsim/db/create_all_options.sim +++ b/tests/script/tsim/db/create_all_options.sim @@ -362,7 +362,7 @@ if $data4_db != 1 then return -1 endi sql drop database db -sql_error create database db REPLICA 2 +#sql_error create database db REPLICA 2 sql_error create database db REPLICA 0 sql_error create database db REPLICA -1 sql_error create database db REPLICA 4 diff --git a/tests/script/tsim/query/sys_tbname.sim b/tests/script/tsim/query/sys_tbname.sim index 9069ad949c..65f96ebc66 100644 --- a/tests/script/tsim/query/sys_tbname.sim +++ b/tests/script/tsim/query/sys_tbname.sim @@ -52,13 +52,13 @@ if $data00 != @ins_stables@ then endi sql select * from information_schema.ins_tables where table_name=''; -if $rows != 0 then +if $rows != 0 then return -1 endi sql select tbname from information_schema.ins_tables; print $rows $data00 -if $rows != 38 then +if $rows != 39 then return -1 endi if $data00 != @ins_tables@ then diff --git a/tests/script/tsim/query/tableCount.sim b/tests/script/tsim/query/tableCount.sim index 573e134133..b8ffc3a41d 100644 --- a/tests/script/tsim/query/tableCount.sim +++ b/tests/script/tsim/query/tableCount.sim @@ -36,7 +36,7 @@ sql create table tba2 using sta tags(2, 2, 2); sql create table tbb1 using stb tags(4, 4, 4); sql create table tbb2 using stb tags(5, 5, 5); sql create table tbb3 using stb tags(6, 6, 6); - + sql select count(table_name) from information_schema.ins_tables group by stable_name; if $rows != 3 then return -1 @@ -53,7 +53,7 @@ sql select stable_name,count(table_name) from information_schema.ins_tables grou if $rows != 3 then return -1 endi -if $data01 != 35 then +if $data01 != 36 then return -1 endi if $data11 != 10 then @@ -72,7 +72,7 @@ endi if $data11 != 5 then return -1 endi -if $data21 != 29 then +if $data21 != 30 then return -1 endi if $data31 != 5 then @@ -97,7 +97,7 @@ endi if $data42 != 3 then return -1 endi -if $data52 != 29 then +if $data52 != 30 then return -1 endi if $data62 != 5 then diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index a7995762d8..33535f9c1d 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -58,7 +58,7 @@ class TDTestCase: self.ins_list = ['ins_dnodes','ins_mnodes','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges','ins_views', - 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines'] + 'ins_compacts', 'ins_compact_details', 'ins_grants_full','ins_grants_logs', 'ins_machines', 'ins_arbgroups'] self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] def insert_data(self,column_dict,tbname,row_num): insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str) diff --git a/tests/system-test/2-query/geometry.py b/tests/system-test/2-query/geometry.py index e430b62fb2..057795743d 100644 --- a/tests/system-test/2-query/geometry.py +++ b/tests/system-test/2-query/geometry.py @@ -171,6 +171,25 @@ class TDTestCase: for i in range(tdSql.queryRows): tdSql.checkData(i, 0, expectedResults[5][i+1]) + def test_td28365(self): + # verify TD-28365 + tdSql.execute("create database db2;") + tdSql.execute("use db2;") + tdSql.execute("create table st (ts timestamp, c1 int) tags(id int, location geometry(512));") + tdSql.execute("create table ct1 using st tags(1, 'POINT (3.000000 6.000000)')") + tdSql.execute("insert into ct1 values(now, 1)") + tdSql.execute("create table ct2 using st tags(2, 'LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)')") + tdSql.execute("insert into ct2 values(now, 2)") + tdSql.execute("create table ct3 using st tags(3, 'POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))')") + tdSql.execute("insert into ct3 values(now, 3)") + tdSql.query("select ST_AsText(location) from st order by location;") + tdSql.checkEqual(tdSql.queryRows, 3) + tdLog.debug(tdSql.queryResult) + # check geometry data + tdSql.checkEqual(tdSql.queryResult[0][0], "POINT (3.000000 6.000000)") + tdSql.checkEqual(tdSql.queryResult[1][0], "LINESTRING (1.000000 1.000000, 2.000000 2.000000, 5.000000 5.000000)") + tdSql.checkEqual(tdSql.queryResult[2][0], "POLYGON ((3.000000 6.000000, 5.000000 6.000000, 5.000000 8.000000, 3.000000 8.000000, 3.000000 6.000000))") + def run(self): tdSql.prepare() @@ -248,6 +267,7 @@ class TDTestCase: [1, self.point] # in where clause ] self.geomRelationFunc_test('ST_ContainsProperly', expectedResults) + self.test_td28365() def stop(self): tdSql.close()